Skip to content

Latest commit

 

History

History
57 lines (36 loc) · 1.54 KB

README.md

File metadata and controls

57 lines (36 loc) · 1.54 KB

Celo Composer - MiniPay Template | Hardhat

How to use

  1. Create a copy of .env.example and rename it to .env.

    1. 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.
    2. For the smart contract verification you will need a Celoscan API Key CELOSCAN_API_KEY set in .env.
  2. Compile the contract

npx hardhat compile
  1. 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
  1. 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.