Developers
...
EVM Tools
HardHat
Connecting Hardhat to Caduceus
6min
forking a hardhat project we recommend you create a clone a repository like https //github com/openzeppelin/openzeppelin contracts https //github com/openzeppelin/openzeppelin contracts which already has hardhat set up and working it also comes with an extensive amount of expertly written smart contracts which can be used to bootstrap your development so fork the repository and go through the readme to get you up and running \# clone the repository git clone https //github com/openzeppelin/openzeppelin contracts git \# enter into the directory cd openzeppelin contracts \# installs packages yarn alternatively you can also do this hardhat tutorial to initialise a new project https //hardhat org/hardhat runner/docs/getting started#quick start https //hardhat org/hardhat runner/docs/getting started#quick start changing the config inside your hardhat config js there will be a networks object this object is where you can define other networks for hardhat to deploy and test the smart contracts on this means you can point hardhat to the testnet note that the hardhat network is the default network used hardhat config js module exports = { networks { hardhat { blockgaslimit 10000000, allowunlimitedcontractsize !withoptimizations, }, }, }, to add the caduceus network you have to add the rpc endpoint along with a test wallet that ideally has test cmp tokens as deploying and interacting with contracts will take up cmp for gas hardhat config js module exports = { networks { hardhat { blockgaslimit 10000000, allowunlimitedcontractsize !withoptimizations, }, caduceustestnet { url 'https //galaxy block caduceus foundation', accounts { mnemonic 'test test test test test test test test test test test test', path "m/44'/60'/0'/0", initialindex 0, count 20, passphrase '', }, }, }, }, as you can see the url is set to our testnet rpc endpoint also there is an accounts object which includes the wallets secret recovery phrase along with other path details these path details are the default path details for hd wallets thus they might work for your wallet as well if you use metamask you can copy your mnemonic phrase from the app and paste it in here with this config and it should work go to here to see how to get your mnemonic phrase from metamask create a wallet docid\ h t8uz4zn1znn6rowisfp click here to learn more about hardhat configuration and networks https //hardhat org/hardhat network/docs/overview running tests now your hardhat configuration is set up you can execute tests by doing npx hardhat test /test/finance/vestingwallet test js network caduceustestnet where the network flag is the key of the of the network object in the config file in our case we named it caduceustestnet when you decide to run tests that deploy and interact with contracts then make sure that each account has enough cmp tokens to do so getting testnet tokens docid\ yo3xls6dblqwb3ccb bk5 can help you get test cmp