Deploy using Foundry

Foundryarrow-up-right is a Solidity framework for deploying smart contracts, built by Paradigmarrow-up-right and written in Rust to be blazingly fast.

Before you Begin

circle-info

Learn more about claiming test tokens from here.

Foundry Setup

Simply follow their "Getting Started" documentationarrow-up-right to install and run Foundry, then follow their "Projects" documentationarrow-up-right to create a new project.

Run the following commands in your terminal:

curl -L https://foundry.paradigm.xyz | bash
foundryup

Setup your project

To start a new project with Foundry, use forge initarrow-up-right:

forge init plume

Let's install the OpenZeppelin dependency required for our sample smart contract.

forge install openzeppelin/openzeppelin-contracts
chevron-rightSample Smart Contract Codehashtag

This is a sample NFT contract based on OpenZeppelin's open-source ERC-721arrow-up-right implementation to tokenize our CBO's prized Rolex watch on Plume.

Then, compile the project using forge buildarrow-up-right:

Deploy your Contract

Follow the instructions on in the "Deploying" documentationarrow-up-right and set your PLUME_RPC_URL environment variable similar to the ETH RPC URL. The below command will deploy the sample smart contract provided above on Plume Testnet for instance (switch the RPC and verifier URL to Mainnet to deploy on Plume Mainnet).

circle-info

To verify the contract while deploying, use --verify flag, more details herearrow-up-right.

The below command will verify the contract and deploy it simultaneously.

circle-exclamation

Sample Output

You can view the deployed contract on the Plume Testnet Explorerarrow-up-right.

Last updated