- Introduction
- Prerequisites
- Environment Variables
- Local Development
- Deployment Overview
- Deployment Steps
- Post-Deployment Configuration
This guide outlines the steps to deploy & configure the Insrt V2 protocol.
- Foundry: Make sure Foundry is installed. Installation guide.
- NodeJS: Required version >= v18.16.0. Download NodeJS.
DEPLOYER_KEY
: Private key of the deployer account
ARBITRUM_RPC_URL
: Arbitrum RPC URLARBISCAN_API_KEY
: Arbiscan API key for contract verification
ARBITRUM_SEPOLIA_RPC_URL
: Arbitrum Sepolia RPC URLARBISCAN_API_KEY
: Arbiscan API key for contract verification
BASE_RPC_URL
: Base RPC URLBASESCAN_API_KEY
: Basescan API key for contract verification
BASE_SEPOLIA_RPC_URL
: Base Sepolia RPC URLBASESCAN_API_KEY
: Basescan API key for contract verification
ARBITRUM_RPC_URL
: Arbitrum RPC URL for forking the initial local state
BASE_RPC_URL
: Base RPC URL for forking the initial local state
make install
make build
make test
We provide deployment scripts for the following networks:
- Arbitrum
- Arbitrum Sepolia (Testnet)
- Base
- Base Sepolia (Testnet)
- Localhost (Arbitrum Fork)
- Localhost (Base Fork)
Here is how to deploy on each of these networks.
These are set in each of the deployment bash scripts.
Double-check that they are correct before running the deployment script.
export VRF_COORDINATOR="0x..." # Address of the Chainlink VRF Coordinator
export VRF_ROUTER="0x..." # Address of the Supra VRF Router
The following metadata is set on deployment in the Solidity deployment scripts:
name
: Name of the mint consolation tokensymbol
: Symbol of the mint consolation token
receiptName
: Name of the receipt token received when winning mintsreceiptSymbol
: Symbol of the receipt token received when winning mints
receiptName
: Name of the receipt token received when winning mintsreceiptSymbol
: Symbol of the receipt token received when winning mints
make deploy-arb
make deploy-arb-sepolia
make deploy-arb-sepolia-custom
make deploy-base
make deploy-base-sepolia
make deploy-blast
make deploy-blast-sepolia
make deploy-blast-sepolia-custom
make deploy-local-arb
make deploy-local-base
We provide post-deployment configuration scripts for the following networks:
- Arbitrum
- Arbitrum Sepolia (Testnet)
- Base
- Base Sepolia (Testnet)
- Localhost (Arbitrum Fork)
- Localhost (Base Fork)
These are set in each of the post-deployment configuration bash scripts.
Double-check that they are correct before running the script.
NOTE: For reference, currently the BASIS
being used by PerpetualMint
& Token
is 1e9
.
export NEW_TOKEN_PROXY_OWNER="0x..." # Address to set as the new TokenProxy owner
# Determines the token emissions rate per mint
export TOKEN_DISTRIBUTION_FRACTION_BP=<1e7 percentage number> # Example: 1e7 = 1%
export LINK_FUND_AMOUNT=<base LINK unit amount> # Example: 1 = 1 LINK, can be 0 to fund subscription later
export LINK_TOKEN="0x..." # Address of the LINK token
export NEW_VRF_OWNER="0x..." # Address to set and request as the new VRF subscription owner
export VRF_SUBSCRIPTION_BALANCE_THRESHOLD=<base LINK unit amount> # Example: 1 = 1 LINK
# Mint for collection consolation fee used for funding $MINT
export COLLECTION_CONSOLATION_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Default collection mint referral fee in basis points
export DEFAULT_COLLECTION_REFERRAL_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Mint for ETH buffer applied to mint earnings as a safety measure
export MINT_EARNINGS_BUFFER_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Protocol mint fee
export MINT_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Mint for ETH consolation fee used for funding $MINT
export MINT_FOR_ETH_CONSOLATION_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Mint for $MINT consolation fee used for funding $MINT
export MINT_TOKEN_CONSOLATION_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
export MINT_TOKEN_TIER_MULTIPLIERS=<1e9 number array aligned with MINT_TOKEN_TIER_RISKS> # Example: 1e9,2e9,4e9,8e9,16e9 = 1x, 2x, 4x, 8x, 16x
export MINT_TOKEN_TIER_RISKS=<1e7 number array aligned with MINT_TOKEN_TIER_MULTIPLIERS> # Example: 60e7,25e7,10e7,4e7,1e7 = 60%, 25%, 10%, 4%, 1%
export NEW_PERP_MINT_OWNER="0x..." # Address to set as the new Core/PerpetualMint owner
export REDEMPTION_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
export TIER_MULTIPLIERS=<1e9 number array aligned with TIER_RISKS> # Example: 1e9,2e9,4e9,8e9,16e9 = 1x, 2x, 4x, 8x, 16x
export TIER_RISKS=<1e7 number array aligned with TIER_MULTIPLIERS> # Example: 60e7,25e7,10e7,4e7,1e7 = 60%, 25%, 10%, 4%, 1%
export VRF_KEY_HASH="0x..." # Bytes32 gas lane key hash for the Chainlink VRF Coordinator
NOTE: For reference, currently the BASIS
being used by PerpetualMint
& Token
is 1e9
.
export NEW_TOKEN_PROXY_OWNER="0x..." # Address to set as the new TokenProxy owner
# Determines the token emissions rate per mint
export TOKEN_DISTRIBUTION_FRACTION_BP=<1e7 percentage number> # Example: 1e7 = 1%
export ETH_FUND_AMOUNT=<base ETH unit amount> # Example: 1 = 1 ETH, can be 0 to fund subscription later
# Mint for collection consolation fee used for funding $MINT
export COLLECTION_CONSOLATION_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Default collection mint referral fee in basis points
export DEFAULT_COLLECTION_REFERRAL_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Mint for ETH buffer applied to mint earnings as a safety measure
export MINT_EARNINGS_BUFFER_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Protocol mint fee
export MINT_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Mint for ETH consolation fee used for funding $MINT
export MINT_FOR_ETH_CONSOLATION_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Mint for $MINT consolation fee used for funding $MINT
export MINT_TOKEN_CONSOLATION_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
export MINT_TOKEN_TIER_MULTIPLIERS=<1e9 number array aligned with MINT_TOKEN_TIER_RISKS> # Example: 1e9,2e9,4e9,8e9,16e9 = 1x, 2x, 4x, 8x, 16x
export MINT_TOKEN_TIER_RISKS=<1e7 number array aligned with MINT_TOKEN_TIER_MULTIPLIERS> # Example: 60e7,25e7,10e7,4e7,1e7 = 60%, 25%, 10%, 4%, 1%
export NEW_PERP_MINT_OWNER="0x..." # Address to set as the new Core/PerpetualMint owner
export REDEMPTION_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
export TIER_MULTIPLIERS=<1e9 number array aligned with TIER_RISKS> # Example: 1e9,2e9,4e9,8e9,16e9 = 1x, 2x, 4x, 8x, 16x
export TIER_RISKS=<1e7 number array aligned with TIER_MULTIPLIERS> # Example: 60e7,25e7,10e7,4e7,1e7 = 60%, 25%, 10%, 4%, 1%
export ETH_FUND_AMOUNT=<base ETH unit amount> # Example: 1 = 1 ETH, can be 0 to fund subscription later
# Odds of winning the Blast Yield Bounty (Claimable Blast Yield + Blast Gas)
export BLAST_YIELD_RISK=<1e7 percentage number> # Example: 1e7 = 1%
# Mint for collection consolation fee used for funding $MINT
export COLLECTION_CONSOLATION_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Default collection mint referral fee in basis points
export DEFAULT_COLLECTION_REFERRAL_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Mint for ETH buffer applied to mint earnings as a safety measure
export MINT_EARNINGS_BUFFER_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Protocol mint fee
export MINT_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Mint for ETH consolation fee used for funding $MINT
export MINT_FOR_ETH_CONSOLATION_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
# Mint for $MINT consolation fee used for funding $MINT
export MINT_TOKEN_CONSOLATION_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
export MINT_TOKEN_TIER_MULTIPLIERS=<1e9 number array aligned with MINT_TOKEN_TIER_RISKS> # Example: 1e9,2e9,4e9,8e9,16e9 = 1x, 2x, 4x, 8x, 16x
export MINT_TOKEN_TIER_RISKS=<1e7 number array aligned with MINT_TOKEN_TIER_MULTIPLIERS> # Example: 60e7,25e7,10e7,4e7,1e7 = 60%, 25%, 10%, 4%, 1%
export NEW_PERP_MINT_OWNER="0x..." # Address to set as the new Core/PerpetualMint owner
export REDEMPTION_FEE_BP=<1e7 percentage number> # Example: 1e7 = 1%
export TIER_MULTIPLIERS=<1e9 number array aligned with TIER_RISKS> # Example: 1e9,2e9,4e9,8e9,16e9 = 1x, 2x, 4x, 8x, 16x
export TIER_RISKS=<1e7 number array aligned with TIER_MULTIPLIERS> # Example: 60e7,25e7,10e7,4e7,1e7 = 60%, 25%, 10%, 4%, 1%
make configure-token-arb
make configure-token-arb-sepolia
make configure-token-local-arb
make configure-token-base
make configure-token-base-sepolia
make configure-token-local-base
make configure-token-blast
make configure-token-blast-sepolia
make configure-vrf-arb
make configure-vrf-arb-sepolia
make configure-vrf-arb-sepolia-custom
make configure-vrf-local-arb
make configure-vrf-base
make configure-vrf-base-sepolia
make configure-vrf-local-base
make configure-vrf-blast
make configure-vrf-blast-sepolia
make configure-vrf-blast-sepolia-custom
NOTE: Once this step is complete, the protocol is activated.
make configure-perp-mint-arb
make configure-perp-mint-arb-sepolia
make configure-perp-mint-local-arb
make configure-perp-mint-base
make configure-perp-mint-base-sepolia
make configure-perp-mint-local-base
make configure-perp-mint-blast
make configure-perp-mint-blast-sepolia