Deploy using Foundry

Foundry is a Solidity framework for deploying smart contracts, built by Paradigm and written in Rust to be blazingly fast.

Before you Begin

Learn more about claiming test tokens from here.

Foundry Setup

Simply follow their "Getting Started" documentation to install and run Foundry, then follow their "Projects" documentation 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 init:

forge init plume

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

forge install openzeppelin/openzeppelin-contracts
Sample Smart Contract Code

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

Then, compile the project using forge build:

Deploy your Contract

Follow the instructions on in the "Deploying" documentation 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).

To verify the contract while deploying, use --verify flag, more details here.

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

Sample Output

You can view the deployed contract on the Plume Testnet Explorer.

Last updated