Reference library for Smart Contracts utilized by the Hedera network with supporting files and examples.
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.
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
For further details on methods, hashes and availability please refer to HTS Precompile methods
- Solidity files updated on April 20, 2022 to add token create support
- Solidity files updated on Jan 18, 2022
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/exchange-rate-precompile
For further details on methods, hashes and availability please refer to Exchange Rate Precompile methods
The PRNG functionality is defined by the IPrng.sol interface smart contract as defined in HIP 351 and exposed via the 0x169
address.
Reference smart contracts to call these functions as well as examples can be found under contracts/util-precompile
For further details on methods, hashes and availability please refer to PRNG Precompile methods
This project is set up using the Hardhat development environment. To get started, please follow this test setup guide.
For using this project as a library in a Foundry project see Foundry Testing
If you have a question on how to use the product, please see our support guide.
Contributions are welcome. Please see the contributing guide to see how you can get involved.
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].