Skip to content

georg-getz/hedera-smart-contracts

 
 

Repository files navigation

Hedera Smart Contracts

Reference library for Smart Contracts utilized by the Hedera network with supporting files and examples.

Overview

The Hedera network utilizes system contracts at a reserved contract address on the EVM to surface HAPI service functionality through EVM processed transactions. These system contracts are precompiled smart contracts whose function selectors are mapped to defined network logic. In this way EVM users can utilize exposed HAPI features natively in their smart contracts.

The precompiled functions are defined in this library and picked up by the Hedera Services repo.

HTS Precompile

The Hedera Token Service (HTS) functionality is defined by the IHederaTokenService.sol interface smart contract as defined in HIP 206, HIP 376 and HIP 514. The contract is exposed via the 0x167 address. Reference smart contracts to call these functions as well as examples can be found under contracts/hts-precompile

  • Solidity files updated on April 20, 2022 to add token create support
  • Solidity files updated on Jan 18, 2022

Exchange Rate Precompile

The Exchange Rate functionality is defined by the IExchangeRate.sol interface smart contract as defined in HIP 475 and exposed via the 0x168 address. Reference smart contracts to call these functions as well as examples can be found under contracts/exchnage-rate-precompile

Prng Precompile

The PRNG functionality is defined by the IPrng.sol interface smart contract as defined in HIP and exposed via the 0x169 address. Reference smart contracts to call these functions as well as examples can be found under contracts/util-precompile

Support

If you have a question on how to use the product, please see our support guide.

Contributing

Contributions are welcome. Please see the contributing guide to see how you can get involved.

Code of Conduct

This project is governed by the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to [email protected].

License

Apache License 2.0

About

Contains Hedera Smart Contract Service supporting files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 74.4%
  • JavaScript 25.6%