From 27640cb360e187c34fab89caaa32e3355798c68c Mon Sep 17 00:00:00 2001 From: ricott1 Date: Tue, 17 Sep 2024 10:01:31 +0200 Subject: [PATCH 1/7] Update L1_FORK_RPC_URL and L2_FORK_RPC_URL default values Signed-off-by: ricott1 --- .env.mainnet | 6 +++--- .env.testnet | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.env.mainnet b/.env.mainnet index c4c820a8..0c85b729 100644 --- a/.env.mainnet +++ b/.env.mainnet @@ -1,5 +1,5 @@ # Deployer private key -PRIVATE_KEY= +PRIVATE_KEY=0x # Network to deploy to (mainnet, testnet, or devnet) NETWORK="mainnet" @@ -76,10 +76,10 @@ L2_ETHERSCAN_API_KEY= # *************** PRIVATE TESTNET *************** # RPC URL of the L1 network from which a private L1 test network is forked if a private test network is used, e.g. Infura, Alchemy -L1_FORK_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY +L1_FORK_RPC_URL=https://ethereum-rpc.publicnode.com # RPC URL of the L2 network from which a private L2 test network is forked if a private test network is used, e.g. Infura, Alchemy -L2_FORK_RPC_URL=https://optimism-sepolia.infura.io/v3/YOUR_INFURA_KEY +L2_FORK_RPC_URL=https://rpc.api.lisk.com # Test network default mnemonic TEST_NETWORK_MNEMONIC="test test test test test test test test test test test junk" diff --git a/.env.testnet b/.env.testnet index e36aef9e..50bce776 100644 --- a/.env.testnet +++ b/.env.testnet @@ -75,10 +75,10 @@ L2_ETHERSCAN_API_KEY= # *************** PRIVATE TESTNET *************** # RPC URL of the L1 network from which a private L1 test network is forked if a private test network is used, e.g. Infura, Alchemy -L1_FORK_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY +L1_FORK_RPC_URL=https://ethereum-sepolia-rpc.publicnode.com # RPC URL of the L2 network from which a private L2 test network is forked if a private test network is used, e.g. Infura, Alchemy -L2_FORK_RPC_URL=https://optimism-goerli.infura.io/v3/YOUR_INFURA_KEY +L2_FORK_RPC_URL=https://rpc.sepolia-api.lisk.com # Test network default mnemonic TEST_NETWORK_MNEMONIC="test test test test test test test test test test test junk" From e8bb6b7a137e0fccfb0cb0c6dfe61ccb2100c6b0 Mon Sep 17 00:00:00 2001 From: ricott1 Date: Tue, 17 Sep 2024 10:10:07 +0200 Subject: [PATCH 2/7] Add .env.devnet file and update README Signed-off-by: ricott1 --- .env.devnet | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 .env.devnet diff --git a/.env.devnet b/.env.devnet new file mode 100644 index 00000000..aed0cb46 --- /dev/null +++ b/.env.devnet @@ -0,0 +1,105 @@ +# Deployer private key +PRIVATE_KEY=0x + +# Network to deploy to (mainnet, testnet, or devnet) +NETWORK="devnet" + +# Owner address for L1LiskToken contract +L1_TOKEN_OWNER_ADDRESS=0x02cBF39018B40a48f0d95d3a0b2eeeF3D18e42Fe + +# Owner of L1VestingWallet contract +L1_VESTING_WALLET_OWNER_ADDRESS=0x02cBF39018B40a48f0d95d3a0b2eeeF3D18e42Fe + +# Owner of L2Claim contract +L2_CLAIM_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 + +# Owner of L2Staking contract +L2_STAKING_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 + +# Owner of L2LockingPosition contract +L2_LOCKING_POSITION_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 + +# Owner of L2Governor contract +L2_GOVERNOR_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 + +# Owner of L2VotingPower contract +L2_VOTING_POWER_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 + +# Owner of L2Reward contract +L2_REWARD_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 + +# Owner of L2Airdrop contract +L2_AIRDROP_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 + +# Owner of L2VestingWallet contract +L2_VESTING_WALLET_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 + +# Airdrop wallet address where LSK tokens are transferred to after airdrop period ends +L2_AIRDROP_WALLET_ADDRESS=0xaF3f4B5033Ef666b3F3EA91a0f360541cC21e5d7 + +# Salt for deterministic smart contract address generation +DETERMINISTIC_ADDRESS_SALT="lisk_l2_token_salt_test_network" + +# L1 standard bridge address (Mainnet, Goerli, Sepolia or custom) +L1_STANDARD_BRIDGE_ADDR=0x1Fb30e446eA791cd1f011675E5F3f5311b70faF5 + +# L2 standard bridge address +L2_STANDARD_BRIDGE_ADDR=0x4200000000000000000000000000000000000010 + +# L1 USDT token contract address to be bridged to L2 +REMOTE_TOKEN_ADDR_USDT=0x7169d38820dfd117c3fa1f22a697dba58d90ba06 + +# L1 RPC URL, e.g. Infura, Alchemy, or your own node +L1_RPC_URL=http://localhost:8545 + +# L2 RPC URL, e.g. Infura, Alchemy, or your own node +L2_RPC_URL=http://localhost:8546 + +# *************** SMART CONTRACT VERIFICATION *************** + +# Contract verifier - blockscout or etherscan. If not provided, verification will be skipped. +CONTRACT_VERIFIER=blockscout + +# Verifier URL for smart contracts deployed on L1 network +L1_VERIFIER_URL=https://eth-sepolia.blockscout.com/api\? + +# Verifier URL for smart contracts deployed on L2 network +L2_VERIFIER_URL=https://sepolia-blockscout.lisk.com/api\? + +# L1 Etherscan API key +L1_ETHERSCAN_API_KEY= + +# L2 Etherscan API key +L2_ETHERSCAN_API_KEY= + +# *************** PRIVATE TESTNET *************** + +# RPC URL of the L1 network from which a private L1 test network is forked if a private test network is used, e.g. Infura, Alchemy +L1_FORK_RPC_URL=https://ethereum-sepolia-rpc.publicnode.com + +# RPC URL of the L2 network from which a private L2 test network is forked if a private test network is used, e.g. Infura, Alchemy +L2_FORK_RPC_URL=https://rpc.sepolia-api.lisk.com + +# Test network default mnemonic +TEST_NETWORK_MNEMONIC="test test test test test test test test test test test junk" + + +# *************** SWAP AND BRIDGE *************** + +# L1 wdivETH token contract address to be bridged to L2 +L1_TOKEN_ADDR_DIVA=0x91701E62B2DA59224e92C42a970d7901d02C2F24 + +# L1 wstETH token contract address to be bridged to L2 +L1_TOKEN_ADDR_LIDO=0xB82381A3fBD3FaFA77B3a7bE693342618240067b + +# L1 custom bridge for wstETH +L1_LIDO_BRIDGE_ADDR=0xdDDbC273a81e6BC49c269Af55d007c08c005ea56 + +# L2 wdivETH token contract +L2_TOKEN_ADDR_DIVA= + +# L2 wstETH token contract +L2_TOKEN_ADDR_LIDO=0xA363167588e8b3060fFFf69519bC440D1D8e4945 + +# L2 custom bridge for wstETH +L2_LIDO_BRIDGE_ADDR=0x7A7265ae66b094b60D9196fD5d677c11a6A03438 \ No newline at end of file From d4ca13785da796d35f712de02ddaa579dfcc0211 Mon Sep 17 00:00:00 2001 From: ricott1 Date: Tue, 17 Sep 2024 15:52:25 +0200 Subject: [PATCH 3/7] Update devnet env file and README; Improve comments in env files Signed-off-by: ricott1 --- .env.devnet | 32 ++++++++-------- .env.example | 104 --------------------------------------------------- .env.mainnet | 2 +- .env.testnet | 2 +- README.md | 24 ++++++------ 5 files changed, 31 insertions(+), 133 deletions(-) delete mode 100644 .env.example diff --git a/.env.devnet b/.env.devnet index aed0cb46..6c547b45 100644 --- a/.env.devnet +++ b/.env.devnet @@ -5,42 +5,42 @@ PRIVATE_KEY=0x NETWORK="devnet" # Owner address for L1LiskToken contract -L1_TOKEN_OWNER_ADDRESS=0x02cBF39018B40a48f0d95d3a0b2eeeF3D18e42Fe +L1_TOKEN_OWNER_ADDRESS=0x # Owner of L1VestingWallet contract -L1_VESTING_WALLET_OWNER_ADDRESS=0x02cBF39018B40a48f0d95d3a0b2eeeF3D18e42Fe +L1_VESTING_WALLET_OWNER_ADDRESS=0x # Owner of L2Claim contract -L2_CLAIM_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 +L2_CLAIM_OWNER_ADDRESS=0x # Owner of L2Staking contract -L2_STAKING_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 +L2_STAKING_OWNER_ADDRESS=0x # Owner of L2LockingPosition contract -L2_LOCKING_POSITION_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 +L2_LOCKING_POSITION_OWNER_ADDRESS=0x # Owner of L2Governor contract -L2_GOVERNOR_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 +L2_GOVERNOR_OWNER_ADDRESS=0x # Owner of L2VotingPower contract -L2_VOTING_POWER_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 +L2_VOTING_POWER_OWNER_ADDRESS=0x # Owner of L2Reward contract -L2_REWARD_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 +L2_REWARD_OWNER_ADDRESS=0x # Owner of L2Airdrop contract -L2_AIRDROP_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 +L2_AIRDROP_OWNER_ADDRESS=0x # Owner of L2VestingWallet contract -L2_VESTING_WALLET_OWNER_ADDRESS=0x84277C9255b3B6904aCfe12C2c45c6a36E81B059 +L2_VESTING_WALLET_OWNER_ADDRESS=0x # Airdrop wallet address where LSK tokens are transferred to after airdrop period ends -L2_AIRDROP_WALLET_ADDRESS=0xaF3f4B5033Ef666b3F3EA91a0f360541cC21e5d7 +L2_AIRDROP_WALLET_ADDRESS=0x # Salt for deterministic smart contract address generation -DETERMINISTIC_ADDRESS_SALT="lisk_l2_token_salt_test_network" +DETERMINISTIC_ADDRESS_SALT="lisk_l2_token_salt_dev_network" -# L1 standard bridge address (Mainnet, Goerli, Sepolia or custom) +# L1 standard bridge address (Sepolia) L1_STANDARD_BRIDGE_ADDR=0x1Fb30e446eA791cd1f011675E5F3f5311b70faF5 # L2 standard bridge address @@ -58,13 +58,13 @@ L2_RPC_URL=http://localhost:8546 # *************** SMART CONTRACT VERIFICATION *************** # Contract verifier - blockscout or etherscan. If not provided, verification will be skipped. -CONTRACT_VERIFIER=blockscout +CONTRACT_VERIFIER= # Verifier URL for smart contracts deployed on L1 network -L1_VERIFIER_URL=https://eth-sepolia.blockscout.com/api\? +L1_VERIFIER_URL= # Verifier URL for smart contracts deployed on L2 network -L2_VERIFIER_URL=https://sepolia-blockscout.lisk.com/api\? +L2_VERIFIER_URL= # L1 Etherscan API key L1_ETHERSCAN_API_KEY= diff --git a/.env.example b/.env.example deleted file mode 100644 index aa49ffef..00000000 --- a/.env.example +++ /dev/null @@ -1,104 +0,0 @@ -# Deployer private key -PRIVATE_KEY=0x0 - -# Network to deploy to (mainnet, testnet, or devnet) -NETWORK="testnet" - -# Owner address for L1LiskToken contract -L1_TOKEN_OWNER_ADDRESS=0x0 - -# Owner of L1VestingWallet contract -L1_VESTING_WALLET_OWNER_ADDRESS=0x0 - -# Owner of L2Claim contract -L2_CLAIM_OWNER_ADDRESS=0x0 - -# Owner of L2Staking contract -L2_STAKING_OWNER_ADDRESS=0x0 - -# Owner of L2LockingPosition contract -L2_LOCKING_POSITION_OWNER_ADDRESS=0x0 - -# Owner of L2Governor contract -L2_GOVERNOR_OWNER_ADDRESS=0x0 - -# Owner of L2VotingPower contract -L2_VOTING_POWER_OWNER_ADDRESS=0x0 - -# Owner of L2Reward contract -L2_REWARD_OWNER_ADDRESS=0x0 - -# Owner of L2VestingWallet contract -L2_VESTING_WALLET_OWNER_ADDRESS=0x0 - -# Owner of L2Airdrop contract -L2_AIRDROP_OWNER_ADDRESS=0x0 - -# Airdrop wallet address where LSK tokens are transferred to after airdrop period ends -L2_AIRDROP_WALLET_ADDRESS=0x0 - -# Salt for deterministic smart contract address generation -DETERMINISTIC_ADDRESS_SALT="test_contract_address_salt" - -# L1 standard bridge address (Mainnet, Goerli, Sepolia or custom) -L1_STANDARD_BRIDGE_ADDR=0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1 - -# L2 standard bridge address -L2_STANDARD_BRIDGE_ADDR=0x4200000000000000000000000000000000000010 - -# L1 USDT token contract address to be bridged to L2 -REMOTE_TOKEN_ADDR_USDT=0x0 - -# L1 RPC URL, e.g. Infura, Alchemy, or your own node -L1_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY - -# L2 RPC URL, e.g. Infura, Alchemy, or your own node -L2_RPC_URL=https://optimism-sepolia.infura.io/v3/YOUR_INFURA_KEY - -# *************** SMART CONTRACT VERIFICATION *************** - -# Contract verifier - blockscout or etherscan. If not provided, verification will be skipped. -CONTRACT_VERIFIER=blockscout - -# Verifier URL for smart contracts deployed on L1 network -L1_VERIFIER_URL=https://eth-sepolia.blockscout.com/api\? - -# Verifier URL for smart contracts deployed on L2 network -L2_VERIFIER_URL=https://sepolia-blockscout.lisk.com/api\? - -# L1 Etherscan API key -L1_ETHERSCAN_API_KEY= - -# L2 Etherscan API key -L2_ETHERSCAN_API_KEY= - -# *************** PRIVATE TESTNET *************** - -# RPC URL of the L1 network from which a private L1 test network is forked if a private test network is used, e.g. Infura, Alchemy -L1_FORK_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY - -# RPC URL of the L2 network from which a private L2 test network is forked if a private test network is used, e.g. Infura, Alchemy -L2_FORK_RPC_URL=https://optimism-sepolia.infura.io/v3/YOUR_INFURA_KEY - -# Test network default mnemonic -TEST_NETWORK_MNEMONIC="test test test test test test test test test test test junk" - -# *************** SWAP AND BRIDGE *************** - -# L1 wdivETH token contract address to be bridged to L2 -L1_TOKEN_ADDR_DIVA= - -# L1 wstETH token contract address to be bridged to L2 -L1_TOKEN_ADDR_LIDO= - -# L1 custom bridge for wstETH -L1_LIDO_BRIDGE_ADDR= - -# L2 wdivETH token contract -L2_TOKEN_ADDR_DIVA= - -# L2 wstETH token contract -L2_TOKEN_ADDR_LIDO= - -# L2 custom bridge for wstETH -L2_LIDO_BRIDGE_ADDR= \ No newline at end of file diff --git a/.env.mainnet b/.env.mainnet index 0c85b729..c9b28cf6 100644 --- a/.env.mainnet +++ b/.env.mainnet @@ -40,7 +40,7 @@ L2_AIRDROP_WALLET_ADDRESS=0x0c92121A7C15cF01041e1122483Bc173Baccd877 # Salt for deterministic smart contract address generation DETERMINISTIC_ADDRESS_SALT="lisk_l2_token_deterministic_salt" -# L1 standard bridge address (Mainnet, Goerli, Sepolia or custom) +# L1 standard bridge address (Mainnet) L1_STANDARD_BRIDGE_ADDR=0x2658723Bf70c7667De6B25F99fcce13A16D25d08 # L2 standard bridge address diff --git a/.env.testnet b/.env.testnet index 50bce776..918f2ccf 100644 --- a/.env.testnet +++ b/.env.testnet @@ -40,7 +40,7 @@ L2_AIRDROP_WALLET_ADDRESS=0xaF3f4B5033Ef666b3F3EA91a0f360541cC21e5d7 # Salt for deterministic smart contract address generation DETERMINISTIC_ADDRESS_SALT="lisk_l2_token_salt_test_network" -# L1 standard bridge address (Mainnet, Goerli, Sepolia or custom) +# L1 standard bridge address (Sepolia) L1_STANDARD_BRIDGE_ADDR=0x1Fb30e446eA791cd1f011675E5F3f5311b70faF5 # L2 standard bridge address diff --git a/README.md b/README.md index d6bdb7dc..9590a871 100644 --- a/README.md +++ b/README.md @@ -80,12 +80,13 @@ git submodule update --init --recursive Private L1 and L2 test networks are established using the `anvil` tool, and the smart contracts are deployed using the `forge script` tool. To run private networks and deploy the smart contracts, follow these steps: -1. Create `.env` file and set the vars `PRIVATE_KEY`, `NETWORK`, `L1_TOKEN_OWNER_ADDRESS`, `L2_CLAIM_OWNER_ADDRESS`, `L2_STAKING_OWNER_ADDRESS`, `L2_LOCKING_POSITION_OWNER_ADDRESS`, `L2_REWARD_OWNER_ADDRESS`, `L2_GOVERNOR_OWNER_ADDRESS`, `L2_VOTING_POWER_OWNER_ADDRESS`, `L2_AIRDROP_OWNER_ADDRESS`, `L2_AIRDROP_WALLET_ADDRESS`, `DETERMINISTIC_ADDRESS_SALT`, `L1_STANDARD_BRIDGE_ADDR`, `L1_RPC_URL`, `L2_RPC_URL`, `L1_FORK_RPC_URL`, `L2_FORK_RPC_URL` and `TEST_NETWORK_MNEMONIC`. You can copy and rename the `.env.example` file if the default values provided in `.env.example` are satisfactory. `L1_RPC_URL` should be set to `http://127.0.0.1:8545` and `L2_RPC_URL` should be set to `http://127.0.0.1:8546` if no changes are made in the `./runL1TestNetwork.sh` or `./runL2TestNetwork.sh` script files. -2. Navigate to the `script` directory. -3. Place the `accounts.json` and `merkle-root.json` files in the correct folder (`data/devnet`, `data/testnet`, or `data/mainnet`) corresponding to the previously set `NETWORK` environment variable. Example files for `accounts.json` and `merkle-root.json` may be found inside `data/devnet` directory. -4. To create and launch a private test L1 network, execute the script: `./runL1TestNetwork.sh` -5. To create and launch a private test L2 network, execute the script: `./runL2TestNetwork.sh` -6. To deploy all smart contracts, execute the scripts: `./1_deployTokenContracts.sh`, `./2_deployStakingAndGovernance.sh`, `./3_deployVestingWallets.sh`, `./4_deployClaimContract` and `./5_deployAirdropContract.sh`. +1. Copy the devnet .env file with `cp .env.devnet .env`. +2. In the `.env` file, set the vars `PRIVATE_KEY`, `NETWORK`, `L1_TOKEN_OWNER_ADDRESS`, `L2_CLAIM_OWNER_ADDRESS`, `L2_STAKING_OWNER_ADDRESS`, `L2_LOCKING_POSITION_OWNER_ADDRESS`, `L2_REWARD_OWNER_ADDRESS`, `L2_GOVERNOR_OWNER_ADDRESS`, `L2_VOTING_POWER_OWNER_ADDRESS`, `L2_AIRDROP_OWNER_ADDRESS`, `L2_AIRDROP_WALLET_ADDRESS`, `DETERMINISTIC_ADDRESS_SALT`, `L1_STANDARD_BRIDGE_ADDR`, `L1_RPC_URL`, `L2_RPC_URL`, `L1_FORK_RPC_URL`, `L2_FORK_RPC_URL` and `TEST_NETWORK_MNEMONIC`. +3. Navigate to the `script` directory. +4. Place the `accounts.json` and `merkle-root.json` files in the correct folder (`data/devnet`, `data/testnet`, or `data/mainnet`) corresponding to the previously set `NETWORK` environment variable. Example files for `accounts.json` and `merkle-root.json` may be found inside `data/devnet` directory. +5. To create and launch a private test L1 network, execute the script: `./runL1TestNetwork.sh` +6. To create and launch a private test L2 network, execute the script: `./runL2TestNetwork.sh` +7. To deploy all smart contracts, execute the scripts: `./1_deployTokenContracts.sh`, `./2_deployStakingAndGovernance.sh`, `./3_deployVestingWallets.sh`, `./4_deployClaimContract` and `./5_deployAirdropContract.sh`. ## Deploying on Public Test Network @@ -93,11 +94,12 @@ Private L1 and L2 test networks are established using the `anvil` tool, and the To deploy smart contracts on both L1 and L2 public networks, you will need to provide for each network an URL for a public node from a RPC provider, such as Alchemy or Infura. Additionally, in order to verify smart contracts on Blockscout or Etherscan Block Explorers during the deployment process, it is necessary to provide verifier name along with additional information (URL and API key). Follow these steps to deploy the smart contracts: -1. Create `.env` file and set the vars `PRIVATE_KEY`, `NETWORK`, `L1_TOKEN_OWNER_ADDRESS`, `L2_CLAIM_OWNER_ADDRESS`, `L2_STAKING_OWNER_ADDRESS`, `L2_LOCKING_POSITION_OWNER_ADDRESS`, `L2_REWARD_OWNER_ADDRESS`, `L2_GOVERNOR_OWNER_ADDRESS`, `L2_VOTING_POWER_OWNER_ADDRESS`, `L2_AIRDROP_OWNER_ADDRESS`, `L2_AIRDROP_WALLET_ADDRESS`, `DETERMINISTIC_ADDRESS_SALT`, `L1_STANDARD_BRIDGE_ADDR`, `L1_RPC_URL`, `L2_RPC_URL` and `CONTRACT_VERIFIER`. You can copy and rename the `.env.example` file if the default values provided in `.env.example` are satisfactory. `CONTRACT_VERIFIER` may be empty to skip smart contracts verification process on Blockscout or Etherscan Block Explorers. -2. When `CONTRACT_VERIFIER` is configured as either `blockscout` or `etherscan`, there are specific additional variables that must be defined. For `blockscout`, it is necessary to set `L1_VERIFIER_URL` and `L2_VERIFIER_URL`. Conversely, for `etherscan`, it is necessary to set `L1_ETHERSCAN_API_KEY` and `L2_ETHERSCAN_API_KEY`. -3. Navigate to the `script` directory. -4. Place the `accounts.json` and `merkle-root.json` files in the correct folder (`data/devnet`, `data/testnet`, or `data/mainnet`) corresponding to the previously set `NETWORK` environment variable. Example files for `accounts.json` and `merkle-root.json` may be found inside `data/devnet` directory. -5. To deploy all smart contracts, execute the scripts: `./1_deployTokenContracts.sh`, `./2_deployStakingAndGovernance.sh`, `./3_deployVestingWallets.sh`, `./4_deployClaimContract` and `./5_deployAirdropContract.sh`. +1. Copy the testnet .env file with `cp .env.testnet .env`. +2. In the `.env` file, set the vars `PRIVATE_KEY`, `NETWORK`, `L1_TOKEN_OWNER_ADDRESS`, `L2_CLAIM_OWNER_ADDRESS`, `L2_STAKING_OWNER_ADDRESS`, `L2_LOCKING_POSITION_OWNER_ADDRESS`, `L2_REWARD_OWNER_ADDRESS`, `L2_GOVERNOR_OWNER_ADDRESS`, `L2_VOTING_POWER_OWNER_ADDRESS`, `L2_AIRDROP_OWNER_ADDRESS`, `L2_AIRDROP_WALLET_ADDRESS`, `DETERMINISTIC_ADDRESS_SALT`, `L1_STANDARD_BRIDGE_ADDR`, `L1_RPC_URL`, `L2_RPC_URL` and `CONTRACT_VERIFIER`. `CONTRACT_VERIFIER` may be empty to skip smart contracts verification process on Blockscout or Etherscan Block Explorers. +3. When `CONTRACT_VERIFIER` is configured as either `blockscout` or `etherscan`, there are specific additional variables that must be defined. For `blockscout`, it is necessary to set `L1_VERIFIER_URL` and `L2_VERIFIER_URL`. Conversely, for `etherscan`, it is necessary to set `L1_ETHERSCAN_API_KEY` and `L2_ETHERSCAN_API_KEY`. +4. Navigate to the `script` directory. +5. Place the `accounts.json` and `merkle-root.json` files in the correct folder (`data/devnet`, `data/testnet`, or `data/mainnet`) corresponding to the previously set `NETWORK` environment variable. Example files for `accounts.json` and `merkle-root.json` may be found inside `data/devnet` directory. +6. To deploy all smart contracts, execute the scripts: `./1_deployTokenContracts.sh`, `./2_deployStakingAndGovernance.sh`, `./3_deployVestingWallets.sh`, `./4_deployClaimContract` and `./5_deployAirdropContract.sh`. ## Deployments From f445a7fec53ba7753c1e552b19347dd50988eb63 Mon Sep 17 00:00:00 2001 From: ricott1 Date: Wed, 18 Sep 2024 09:58:18 +0200 Subject: [PATCH 4/7] Make default URLs consistent --- .env.devnet | 2 +- .env.mainnet | 5 ++--- .env.testnet | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.env.devnet b/.env.devnet index 6c547b45..88a8d3fc 100644 --- a/.env.devnet +++ b/.env.devnet @@ -75,7 +75,7 @@ L2_ETHERSCAN_API_KEY= # *************** PRIVATE TESTNET *************** # RPC URL of the L1 network from which a private L1 test network is forked if a private test network is used, e.g. Infura, Alchemy -L1_FORK_RPC_URL=https://ethereum-sepolia-rpc.publicnode.com +L1_FORK_RPC_URL=https://sepolia.drpc.org # RPC URL of the L2 network from which a private L2 test network is forked if a private test network is used, e.g. Infura, Alchemy L2_FORK_RPC_URL=https://rpc.sepolia-api.lisk.com diff --git a/.env.mainnet b/.env.mainnet index c9b28cf6..fc5c4f77 100644 --- a/.env.mainnet +++ b/.env.mainnet @@ -53,8 +53,7 @@ REMOTE_TOKEN_ADDR_USDT=0xdAC17F958D2ee523a2206206994597C13D831ec7 L1_RPC_URL=https://eth.drpc.org # L2 RPC URL, e.g. Infura, Alchemy, or your own node -L2_RPC_URL=https://lisk.drpc.org -#L2_RPC_URL=https://rpc.api.lisk.com +L2_RPC_URL=https://rpc.api.lisk.com # *************** SMART CONTRACT VERIFICATION *************** @@ -76,7 +75,7 @@ L2_ETHERSCAN_API_KEY= # *************** PRIVATE TESTNET *************** # RPC URL of the L1 network from which a private L1 test network is forked if a private test network is used, e.g. Infura, Alchemy -L1_FORK_RPC_URL=https://ethereum-rpc.publicnode.com +L1_FORK_RPC_URL=https://eth.drpc.org # RPC URL of the L2 network from which a private L2 test network is forked if a private test network is used, e.g. Infura, Alchemy L2_FORK_RPC_URL=https://rpc.api.lisk.com diff --git a/.env.testnet b/.env.testnet index 918f2ccf..4e215f2b 100644 --- a/.env.testnet +++ b/.env.testnet @@ -53,7 +53,7 @@ REMOTE_TOKEN_ADDR_USDT=0x7169d38820dfd117c3fa1f22a697dba58d90ba06 L1_RPC_URL=https://sepolia.drpc.org # L2 RPC URL, e.g. Infura, Alchemy, or your own node -L2_RPC_URL=https://lisk-sepolia.drpc.org +L2_RPC_URL=https://rpc.sepolia-api.lisk.com # *************** SMART CONTRACT VERIFICATION *************** @@ -75,7 +75,7 @@ L2_ETHERSCAN_API_KEY= # *************** PRIVATE TESTNET *************** # RPC URL of the L1 network from which a private L1 test network is forked if a private test network is used, e.g. Infura, Alchemy -L1_FORK_RPC_URL=https://ethereum-sepolia-rpc.publicnode.com +L1_FORK_RPC_URL=https://sepolia.drpc.org # RPC URL of the L2 network from which a private L2 test network is forked if a private test network is used, e.g. Infura, Alchemy L2_FORK_RPC_URL=https://rpc.sepolia-api.lisk.com From 25a7e29c5e1fc7625e383be07bb192bd054ed601 Mon Sep 17 00:00:00 2001 From: ricott1 Date: Wed, 18 Sep 2024 10:01:23 +0200 Subject: [PATCH 5/7] Remove unused fork rpc URLs from public chain .env files --- .env.mainnet | 4 ++-- .env.testnet | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.env.mainnet b/.env.mainnet index fc5c4f77..6ad6e30d 100644 --- a/.env.mainnet +++ b/.env.mainnet @@ -75,10 +75,10 @@ L2_ETHERSCAN_API_KEY= # *************** PRIVATE TESTNET *************** # RPC URL of the L1 network from which a private L1 test network is forked if a private test network is used, e.g. Infura, Alchemy -L1_FORK_RPC_URL=https://eth.drpc.org +L1_FORK_RPC_URL= # RPC URL of the L2 network from which a private L2 test network is forked if a private test network is used, e.g. Infura, Alchemy -L2_FORK_RPC_URL=https://rpc.api.lisk.com +L2_FORK_RPC_URL= # Test network default mnemonic TEST_NETWORK_MNEMONIC="test test test test test test test test test test test junk" diff --git a/.env.testnet b/.env.testnet index 4e215f2b..54b424d6 100644 --- a/.env.testnet +++ b/.env.testnet @@ -75,10 +75,10 @@ L2_ETHERSCAN_API_KEY= # *************** PRIVATE TESTNET *************** # RPC URL of the L1 network from which a private L1 test network is forked if a private test network is used, e.g. Infura, Alchemy -L1_FORK_RPC_URL=https://sepolia.drpc.org +L1_FORK_RPC_URL= # RPC URL of the L2 network from which a private L2 test network is forked if a private test network is used, e.g. Infura, Alchemy -L2_FORK_RPC_URL=https://rpc.sepolia-api.lisk.com +L2_FORK_RPC_URL= # Test network default mnemonic TEST_NETWORK_MNEMONIC="test test test test test test test test test test test junk" From a6b7ec0bcdacc8cf1661b32ba79bd602df86a4be Mon Sep 17 00:00:00 2001 From: ricott1 Date: Wed, 18 Sep 2024 11:01:40 +0200 Subject: [PATCH 6/7] Remove value of unused TEST_NETWORK_MNEMONIC variable --- .env.mainnet | 2 +- .env.testnet | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.mainnet b/.env.mainnet index 6ad6e30d..2f0c6232 100644 --- a/.env.mainnet +++ b/.env.mainnet @@ -81,7 +81,7 @@ L1_FORK_RPC_URL= L2_FORK_RPC_URL= # Test network default mnemonic -TEST_NETWORK_MNEMONIC="test test test test test test test test test test test junk" +TEST_NETWORK_MNEMONIC= # *************** SWAP AND BRIDGE *************** diff --git a/.env.testnet b/.env.testnet index 54b424d6..3989c23a 100644 --- a/.env.testnet +++ b/.env.testnet @@ -81,7 +81,7 @@ L1_FORK_RPC_URL= L2_FORK_RPC_URL= # Test network default mnemonic -TEST_NETWORK_MNEMONIC="test test test test test test test test test test test junk" +TEST_NETWORK_MNEMONIC= # *************** SWAP AND BRIDGE *************** From 19dbcfa412f6e73d222693a59754a3e32bd955a0 Mon Sep 17 00:00:00 2001 From: ricott1 Date: Wed, 18 Sep 2024 11:02:06 +0200 Subject: [PATCH 7/7] Update the deployment description in the README --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9590a871..ab92acb0 100644 --- a/README.md +++ b/README.md @@ -81,11 +81,11 @@ git submodule update --init --recursive Private L1 and L2 test networks are established using the `anvil` tool, and the smart contracts are deployed using the `forge script` tool. To run private networks and deploy the smart contracts, follow these steps: 1. Copy the devnet .env file with `cp .env.devnet .env`. -2. In the `.env` file, set the vars `PRIVATE_KEY`, `NETWORK`, `L1_TOKEN_OWNER_ADDRESS`, `L2_CLAIM_OWNER_ADDRESS`, `L2_STAKING_OWNER_ADDRESS`, `L2_LOCKING_POSITION_OWNER_ADDRESS`, `L2_REWARD_OWNER_ADDRESS`, `L2_GOVERNOR_OWNER_ADDRESS`, `L2_VOTING_POWER_OWNER_ADDRESS`, `L2_AIRDROP_OWNER_ADDRESS`, `L2_AIRDROP_WALLET_ADDRESS`, `DETERMINISTIC_ADDRESS_SALT`, `L1_STANDARD_BRIDGE_ADDR`, `L1_RPC_URL`, `L2_RPC_URL`, `L1_FORK_RPC_URL`, `L2_FORK_RPC_URL` and `TEST_NETWORK_MNEMONIC`. +2. The `.env` file provides defaults for several parameters. The deployer private key should be set in the `PRIVATE_KEY` env variable, other variables can be set depending on the intended deployments. 3. Navigate to the `script` directory. -4. Place the `accounts.json` and `merkle-root.json` files in the correct folder (`data/devnet`, `data/testnet`, or `data/mainnet`) corresponding to the previously set `NETWORK` environment variable. Example files for `accounts.json` and `merkle-root.json` may be found inside `data/devnet` directory. -5. To create and launch a private test L1 network, execute the script: `./runL1TestNetwork.sh` -6. To create and launch a private test L2 network, execute the script: `./runL2TestNetwork.sh` +4. To create and launch a private test L1 network, execute the script: `./runL1TestNetwork.sh` +5. To create and launch a private test L2 network, execute the script: `./runL2TestNetwork.sh` +6. Place the `accounts.json` and `merkle-root.json` files in the `data/devnet` folder. Example files for `accounts.json` and `merkle-root.json` may be found inside `data/devnet` directory. 7. To deploy all smart contracts, execute the scripts: `./1_deployTokenContracts.sh`, `./2_deployStakingAndGovernance.sh`, `./3_deployVestingWallets.sh`, `./4_deployClaimContract` and `./5_deployAirdropContract.sh`. ## Deploying on Public Test Network @@ -95,10 +95,10 @@ Private L1 and L2 test networks are established using the `anvil` tool, and the To deploy smart contracts on both L1 and L2 public networks, you will need to provide for each network an URL for a public node from a RPC provider, such as Alchemy or Infura. Additionally, in order to verify smart contracts on Blockscout or Etherscan Block Explorers during the deployment process, it is necessary to provide verifier name along with additional information (URL and API key). Follow these steps to deploy the smart contracts: 1. Copy the testnet .env file with `cp .env.testnet .env`. -2. In the `.env` file, set the vars `PRIVATE_KEY`, `NETWORK`, `L1_TOKEN_OWNER_ADDRESS`, `L2_CLAIM_OWNER_ADDRESS`, `L2_STAKING_OWNER_ADDRESS`, `L2_LOCKING_POSITION_OWNER_ADDRESS`, `L2_REWARD_OWNER_ADDRESS`, `L2_GOVERNOR_OWNER_ADDRESS`, `L2_VOTING_POWER_OWNER_ADDRESS`, `L2_AIRDROP_OWNER_ADDRESS`, `L2_AIRDROP_WALLET_ADDRESS`, `DETERMINISTIC_ADDRESS_SALT`, `L1_STANDARD_BRIDGE_ADDR`, `L1_RPC_URL`, `L2_RPC_URL` and `CONTRACT_VERIFIER`. `CONTRACT_VERIFIER` may be empty to skip smart contracts verification process on Blockscout or Etherscan Block Explorers. -3. When `CONTRACT_VERIFIER` is configured as either `blockscout` or `etherscan`, there are specific additional variables that must be defined. For `blockscout`, it is necessary to set `L1_VERIFIER_URL` and `L2_VERIFIER_URL`. Conversely, for `etherscan`, it is necessary to set `L1_ETHERSCAN_API_KEY` and `L2_ETHERSCAN_API_KEY`. +2. The `.env` file provides defaults for several parameters. The deployer private key should be set in the `PRIVATE_KEY` env variable, other variables can be set depending on the intended deployments. +3. `CONTRACT_VERIFIER` may be empty to skip smart contracts verification process on Blockscout or Etherscan block explorers. When `CONTRACT_VERIFIER` is configured as either `blockscout` or `etherscan`, there are specific additional variables that must be defined. For `blockscout`, it is necessary to set `L1_VERIFIER_URL` and `L2_VERIFIER_URL`. Conversely, for `etherscan`, it is necessary to set `L1_ETHERSCAN_API_KEY` and `L2_ETHERSCAN_API_KEY`. 4. Navigate to the `script` directory. -5. Place the `accounts.json` and `merkle-root.json` files in the correct folder (`data/devnet`, `data/testnet`, or `data/mainnet`) corresponding to the previously set `NETWORK` environment variable. Example files for `accounts.json` and `merkle-root.json` may be found inside `data/devnet` directory. +5. Place the `accounts.json` and `merkle-root.json` files in the `data/testnet` folder. Example files for `accounts.json` and `merkle-root.json` may be found inside `data/devnet` directory. 6. To deploy all smart contracts, execute the scripts: `./1_deployTokenContracts.sh`, `./2_deployStakingAndGovernance.sh`, `./3_deployVestingWallets.sh`, `./4_deployClaimContract` and `./5_deployAirdropContract.sh`. ## Deployments