Skip to content

Deployment

This guide covers how to deploy the Rugdrome protocol to a local network, testnet, or mainnet.

Prerequisites

  1. A funded wallet private key set in .env as PRIVATE_KEY.
  2. A Blockscout API key set as ROBINHOOD_BLOCKSCOUT_API_KEY if deploying to Robinhood Chain.
  3. The target network configured in hardhat.config.js.

Local Deployment

Run the full deployment against a local Hardhat node:

bash
npx hardhat node
npx hardhat run scripts/deploy/deployFull.js --network localhost

Testnet Deployment

Replace robinhood_testnet with the network name from hardhat.config.js:

bash
npx hardhat run scripts/deploy/deployFull.js --network robinhood_testnet

Deployment Scripts

All deployment scripts live in scripts/deploy/:

ScriptPurpose
deployFull.jsDeploys the entire protocol in one run.
deployRugd.jsDeploys the RUGD token contract.
deployVotingEscrow.jsDeploys the voting escrow and veNFT.
deployVoter.jsDeploys the voter.
deployRouter.jsDeploys the swap router.
deployMinter.jsDeploys the emission minter.
deployZapHelper.jsDeploys the zap helper.

Deployment Outputs

After deployment, addresses are recorded in:

  • deployments.json — canonical deployment manifest.
  • .openzeppelin/ — Hardhat-upgrades manifests (if using proxies).

Verification

Verify contracts on Robinhood Chain:

bash
# Via Hardhat
npx hardhat run scripts/verify/verifyBlockscout.js --network robinhood

# Or via the bash wrapper
./scripts/verify/verifyHardhat.sh

TIP

Make sure ROBINHOOD_BLOCKSCOUT_API_KEY is set before verifying.

Post-Deployment Checklist

  1. Transfer PairFactory and other upgradeable admin rights to the Timelock or a multisig.
  2. Update the frontend contract address mappings in frontend/src/lib/contracts.ts.
  3. Verify all contracts on the block explorer.
  4. Run the E2E test against the deployed contracts.

Released under the GNU AGPL v3 License.