Using Foundry

Step 1: Prepare Your Contract for Verification

Ensure your smart contract, such as an SOL token, is ready and deployed. Keep the contract's address at hand, as you'll need it for the verification command.

Step 2: Verifying Your Contract

Verification is a straightforward process with Foundry. Depending on where your contract is deployed, you'll use either the mainnet or testnet command.

For Testnet Verification

If your contract is on the Milo testnet, use the following command, replacing CONTRACT_ADDRESS with your contract's actual address:

Copy

forge verify-contract CONTRACT_ADDRESS src/sol

For Mainnet Verification

For contracts deployed on the Milo mainnet, the command adjusts slightly to point to the mainnet explorer:

Copy

forge verify-contract CONTRACT_ADDRESS src/MySOL.sol:MySOL --verifier blockscout --verifier-url 

Remember to replace CONTRACT_ADDRESS with your contract's address and src/MySOL.sol:MySOL with the correct path to your contract.

Step 3: Confirm Your Contract's Verification

After executing the relevant command:

  • Enter your contract's address in the search bar.

  • You should find your contract listed and verified, it should have the green checkmark.

Conclusion

And that's it! You've just verified your SOL token on the Milo network using Foundry. Not too bad, right? Foundry makes these tasks less of a headache, so you can focus on the fun part: building your project.

Last updated