This is a collection of sample projects, tests and trials. Some are just experiments of my own, others are there to help community members solve particular challenges.
Note: These repositories are not necessarily maintained regularly and may not be fully up to date.
cp .env.sample .env
nano .env # edit the OPERATOR_ID and OPERATOR_KEY to match your Hedera Account and Private Key
Tests different scenarios from Javascript where contracts call each other (with/without proxies) and how a token's supply key can be set to a contract depending on the contracts architecture.
Shows a contract MomContract
creating another contract DaughterContract
when MomContract
is constructed.
The example also queries MomContract
and DaughterContract
to show the construction was successful
Demonstrates the use of fallback and receive (some which don't work yet on Hedera SC)
Demonstrates how to create a contract and a token, allocating the contract to be the token's treasury and supply key. This enables the contract to mint and burn the token.
Shows how a contract can be used to escrow an NFT with an asking price so that it can be purchased by a third party.
Shows how a contract can be used to manage fungible and non-fungible token allowances
Demonstrates how to create an upgradable contract that manages a native token.
Demonstrates how to use the pseudo random precompiled contract
Hbar has 8 decimals, whereas Ethereum has 18, when converting hbar to wei for payable functions, you end up with a smaller amount than converting hbar to tinybar. Demonstrates the use of hethers.js for the appropriate calculation.