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.
Network Parameters
All tools will require that you provide some or all of the Plume testnet network parameters so they can deploy to the testnet. You can refer to them here:
Name | Value |
---|---|
Network Name | Plume Testnet |
HTTP RPC URL | |
WebSockets RPC URL | |
Chain ID | 161221135 |
Currency Symbol | ETH |
Block Explorer URL |
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:
Note that we must use an older version of the OpenZeppelin contracts because the Plume testnet doesn't support Solidity compiler versions 0.8.20
and above, which is the minimum compiler version in v5 of the OpenZeppelin contracts.
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. We have to add the --legacy
flag because Foundry has a bug with gas estimation on L2s.
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
Run the following, additionally you can parse flags like --fork-block-number 1
to set the block number
Common issues
You may run into errors with gas estimation when deploying using Foundry. To circumvent that, ensure that:
Your foundry.toml explicitly sets EVM version
Your forge create or deployment script has these flags
Last updated