Skip to content

Commit

Permalink
Merge pull request #317 from celo-org/fix-verification-proccess
Browse files Browse the repository at this point in the history
fix instructions and settings for smart contract verification
  • Loading branch information
sodofi authored Nov 1, 2024
2 parents a67fa3d + 7324d6b commit 50ed754
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12,801 deletions.
14 changes: 10 additions & 4 deletions packages/hardhat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
npx hardhat compile
```

5. Deploy the contract
3. 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](https://faucet.celo.org/alfajores).

Expand All @@ -34,18 +34,24 @@ On Celo Mainnet
npx hardhat ignition deploy ./ignition/modules/Lock.ts --network celo
```

1. Verify the contract
4. Verify the contract

For Alfajores (Testnet) Verification

```bash
npx hardhat verify [CONTRACT_ADDRESS] [...CONSTRUCTOR_ARGS] --network alfajores
npx hardhat verify <CONTRACT_ADDRESS> <CONSTRUCTOR_ARGS> --network alfajores
```

For the Lock.sol contract that could look like this:

```bash
npx hardhat verify 0x756Af13eafF4Ef0D9e294222F9A922226567C39e 1893456000 --network alfajores
```

For Celo Mainnet Verification

```bash
npx hardhat verify [CONTRACT_ADDRESS] [...CONSTRUCTOR_ARGS] --network celo
npx hardhat verify <CONTRACT_ADDRESS> <CONSTRUCTOR_ARGS> --network celo
```

Check the file `hardhat.config.js` for Celo specific hardhat configuration.
21 changes: 12 additions & 9 deletions packages/hardhat/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ import { HardhatUserConfig } from 'hardhat/config';
dotEnvConfig();

const config: HardhatUserConfig = {
networks: {
alfajores: {
accounts: [process.env.PRIVATE_KEY ?? '0x0'],
url: 'https://alfajores-forno.celo-testnet.org',
},
celo: {
accounts: [process.env.PRIVATE_KEY ?? '0x0'],
url: 'https://forno.celo.org',
},
},
etherscan: {
apiKey: {
alfajores: process.env.CELOSCAN_API_KEY ?? '',
Expand All @@ -30,15 +40,8 @@ const config: HardhatUserConfig = {
},
],
},
networks: {
alfajores: {
accounts: [process.env.PRIVATE_KEY ?? '0x0'],
url: 'https://alfajores-forno.celo-testnet.org',
},
celo: {
accounts: [process.env.PRIVATE_KEY ?? '0x0'],
url: 'https://forno.celo.org',
},
sourcify: {
enabled: false,
},
solidity: '0.8.24',
};
Expand Down
Loading

0 comments on commit 50ed754

Please sign in to comment.