Deploy with Foundry
After connecting to the Plume testnet and funding your wallet with bridged SepoliaETH, you can easily deploy any EVM-compatible smart contract using the same tools used in Ethereum, Arbitrum, Optimism, and Polygon development. For instructions on connecting to the Plume testnet, please reach out to the Plume team on Telegram.
Foundry Setup
Foundry is a Solidity framework for deploying smart contracts, built by Paradigm and written in Rust to be blazingly fast. Simply follow their "Getting Started" documentation to install and run Foundry, then follow their "Projects" documentation to create a new project:
Let's write a simple one-of-one NFT contract based on OpenZeppelin's open-source ERC-721 implementation to tokenize our CBO's prized Rolex watch on Plume. First, install the dependency on OpenZeppelin:
Save this smart contract in src/RolexYachtMaster40.sol
then run forge build
to compile it:
Deploy NFT Contract
To deploy your smart contract to the Plume testnet with Foundry, follow the instructions in the "Deploying" documentation and set your ETH_RPC_URL
environment variable to the Plume RPC URL.
You can see the resulting smart contract on the Plume block explorer.
Verify NFT Contract
The Plume testnet block explorer is built using Blockscout's open-source technology, and supports verification of contracts via its Etherscan-compatible API. See the "Smart Contract Verification" section for more details.
To verify your smart contract, follow the instructions in Blockscout's "Foundry Contract Verification" page. Make sure to add the extra \?
to the end of the verified URL, otherwise the verification will fail:
You can see the resulting verified smart contract on the Plume block explorer.
Fork Testing
To test on a local fork of the Plume testnet, use the --fork-url
parameter in Foundry. Additionally, you can use flags like --fork-block-number 1
to set the block number.
Common Issues
You may run into errors when deploying using Foundry, because Foundry has a bug with gas estimation on rollups. To circumvent that, ensure that:
Your
foundry.toml
explicitly sets the EVM version:
Your
forge create
or deployment script includes the following flags:
Last updated