Use node 16. Install node https://nodejs.org/es/ Then install dependencies
npm install
npm run test
npm run lint
npm run coverage
Edit the hardhat configuration file
module.exports = {
// See https://hardhat.org/config/
// to customize your hardhat configuration
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*" // Match any network id
},
rskregtest: {
host: "127.0.0.1",
port: 4444,
network_id: "*" // Match any network id
},
}
};
Launch the local network
ganache-cli --verbose
Deploy using hardhat to the desire network
npm run deploy --network <network>
Examples
npm run deploy --network development
npm run deploy --network rskregtest
This will also generate the json files for that network with the addresses of the deployed contracts that will be called by the federator.
After the deployments usign hardhat deploy, you will be able to verify all the deployed contracts using an script
$~ verify-script -n <networkName>
The network name is defined at
hardhat.config.js
- All the contracts to be deployed from now on should use the abidecoder v2
- So, at the
.sol
contracts add thepragma abicoder v2;
at the top, right after the pragma solidity version, like this: