-
Create a copy of
.env.example
and rename it to.env
.- For the smart contract deployment you will need the
PRIVATE_KEY
set in.env
. Never use a wallet with real funds for development. Always have a separate wallet for testing. - For the smart contract verification you will need a Celoscan API Key
CELOSCAN_API_KEY
set in.env
.
- For the smart contract deployment you will need the
-
Compile the contract
npx hardhat compile
- Deploy the contract
Make sure your wallet is funded when deploying to testnet or mainnet. You can get test tokens for deploying it on Alfajores from the Celo Faucet.
npx hardhat ignition deploy ./ignition/modules/MiniPay.ts --network <network-name>
On Alfajores
npx hardhat ignition deploy ./ignition/modules/MiniPay.ts --network alfajores
On Celo Mainnet
npx hardhat ignition deploy ./ignition/modules/MiniPay.ts --network celo
- Verify the contract
For Alfajores (Testnet) Verification
npx hardhat verify <CONTRACT_ADDRESS> <CONSTRUCTOR_ARGS> --network alfajores
For the MiniPay.sol contract that could look like this:
npx hardhat verify 0xF9316Ce3E661D704000bCDDA925766Bf7F09fF5B 0x1724707c52de2fa65ad9c586b5d38507f52D3c06 --network alfajores
For Celo Mainnet Verification
npx hardhat verify <CONTRACT_ADDRESS> <CONSTRUCTOR_ARGS> --network celo
Check the file hardhat.config.js
for Celo specific hardhat configuration.