Skip to content

Latest commit

 

History

History
536 lines (340 loc) · 13.8 KB

DEPLOYMENT_GUIDE.md

File metadata and controls

536 lines (340 loc) · 13.8 KB

Insrt V2 Deployment Guide

Table of Contents

  1. Introduction
  2. Prerequisites
  3. Environment Variables
  4. Local Development
  5. Deployment Overview
  6. Deployment Steps
  7. Post-Deployment Configuration

Introduction

This guide outlines the steps to deploy & configure the Insrt V2 protocol.


Prerequisites


Environment Variables

Common to All Deployments

  • DEPLOYER_KEY: Private key of the deployer account

Arbitrum Deployments

  • ARBITRUM_RPC_URL: Arbitrum RPC URL
  • ARBISCAN_API_KEY: Arbiscan API key for contract verification

Arbitrum Sepolia Deployments

  • ARBITRUM_SEPOLIA_RPC_URL: Arbitrum Sepolia RPC URL
  • ARBISCAN_API_KEY: Arbiscan API key for contract verification

Base Deployments

  • BASE_RPC_URL: Base RPC URL
  • BASESCAN_API_KEY: Basescan API key for contract verification

Base Sepolia Deployments

  • BASE_SEPOLIA_RPC_URL: Base Sepolia RPC URL
  • BASESCAN_API_KEY: Basescan API key for contract verification

Localhost Deployments (Arbitrum Fork)

  • ARBITRUM_RPC_URL: Arbitrum RPC URL for forking the initial local state

Localhost Deployments (Base Fork)

  • BASE_RPC_URL: Base RPC URL for forking the initial local state

Local Development

Step 1: Install Dependencies

make install

Step 2: Compilation

make build

Step 3: Testing

make test

Deployment Overview

We provide deployment scripts for the following networks:

  1. Arbitrum
  2. Arbitrum Sepolia (Testnet)
  3. Base
  4. Base Sepolia (Testnet)
  5. Localhost (Arbitrum Fork)
  6. Localhost (Base Fork)

Deployment Steps

Here is how to deploy on each of these networks.

Bash Environment Variables

These are set in each of the deployment bash scripts.

Double-check that they are correct before running the deployment script.

Arbitrum

export VRF_COORDINATOR="0x..." # Address of the Chainlink VRF Coordinator

Base

export VRF_ROUTER="0x..." # Address of the Supra VRF Router

Hardcoded Metadata

The following metadata is set on deployment in the Solidity deployment scripts:

  • name: Name of the mint consolation token
  • symbol: Symbol of the mint consolation token
  • receiptName: Name of the receipt token received when winning mints
  • receiptSymbol: Symbol of the receipt token received when winning mints
  • receiptName: Name of the receipt token received when winning mints
  • receiptSymbol: Symbol of the receipt token received when winning mints

Deploying on Arbitrum

make deploy-arb

Deploying on Arbitrum Sepolia (Testnet)

make deploy-arb-sepolia

Deploying on Arbitrum Sepolia (Testnet) w/ the Insrt VRF Coordinator

make deploy-arb-sepolia-custom

Deploying on Base

make deploy-base

Deploying on Base Sepolia (Testnet)

make deploy-base-sepolia

Deploying on Blast

make deploy-blast

Deploying on Blast Sepolia (Testnet)

make deploy-blast-sepolia

Deploying on Blast Sepolia (Testnet) w/ the Insrt VRF Coordinator

make deploy-blast-sepolia-custom

Deploying Locally (on an Arbitrum Fork)

make deploy-local-arb

Deploying Locally (on a Base Fork)

make deploy-local-base

Post-Deployment Configuration

We provide post-deployment configuration scripts for the following networks:

  1. Arbitrum
  2. Arbitrum Sepolia (Testnet)
  3. Base
  4. Base Sepolia (Testnet)
  5. Localhost (Arbitrum Fork)
  6. Localhost (Base Fork)

Bash Environment Variables

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%

Step 1: Token Configuration

Arbitrum

make configure-token-arb

Arbitrum Sepolia (Testnet)

make configure-token-arb-sepolia

Locally (on an Arbitrum Fork)

make configure-token-local-arb

Base

make configure-token-base

Base Sepolia (Testnet)

make configure-token-base-sepolia

Locally (on a Base Fork)

make configure-token-local-base

Blast

make configure-token-blast

Blast Sepolia (Testnet)

make configure-token-blast-sepolia

Step 2: VRF Configuration

Arbitrum

make configure-vrf-arb

Arbitrum Sepolia (Testnet)

make configure-vrf-arb-sepolia

Arbitrum Sepolia (Testnet) w/ the Insrt VRF Coordinator

make configure-vrf-arb-sepolia-custom

Locally (on an Arbitrum Fork)

make configure-vrf-local-arb

Base

make configure-vrf-base

Base Sepolia (Testnet)

make configure-vrf-base-sepolia

Locally (on a Base Fork)

make configure-vrf-local-base

Blast

make configure-vrf-blast

Blast Sepolia (Testnet)

make configure-vrf-blast-sepolia

Blast Sepolia (Testnet) w/ the Insrt VRF Coordinator

make configure-vrf-blast-sepolia-custom

Step 3: PerpetualMint Configuration

NOTE: Once this step is complete, the protocol is activated.

Arbitrum

make configure-perp-mint-arb

Arbitrum Sepolia (Testnet)

make configure-perp-mint-arb-sepolia

Locally (on an Arbitrum Fork)

make configure-perp-mint-local-arb

Base

make configure-perp-mint-base

Base Sepolia (Testnet)

make configure-perp-mint-base-sepolia

Locally (on a Base Fork)

make configure-perp-mint-local-base

Blast

make configure-perp-mint-blast

Blast Sepolia (Testnet)

make configure-perp-mint-blast-sepolia