Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update default .env files #205

Merged
merged 9 commits into from
Sep 18, 2024
63 changes: 32 additions & 31 deletions .env.example → .env.devnet
AndreasKendziorra marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
# Deployer private key
PRIVATE_KEY=0x0
PRIVATE_KEY=0x

# Network to deploy to (mainnet, testnet, or devnet)
NETWORK="testnet"
NETWORK="devnet"

# Owner address for L1LiskToken contract
L1_TOKEN_OWNER_ADDRESS=0x0
L1_TOKEN_OWNER_ADDRESS=0x

# Owner of L1VestingWallet contract
L1_VESTING_WALLET_OWNER_ADDRESS=0x0
L1_VESTING_WALLET_OWNER_ADDRESS=0x

# Owner of L2Claim contract
L2_CLAIM_OWNER_ADDRESS=0x0
L2_CLAIM_OWNER_ADDRESS=0x

# Owner of L2Staking contract
L2_STAKING_OWNER_ADDRESS=0x0
L2_STAKING_OWNER_ADDRESS=0x

# Owner of L2LockingPosition contract
L2_LOCKING_POSITION_OWNER_ADDRESS=0x0
L2_LOCKING_POSITION_OWNER_ADDRESS=0x

# Owner of L2Governor contract
L2_GOVERNOR_OWNER_ADDRESS=0x0
L2_GOVERNOR_OWNER_ADDRESS=0x

# Owner of L2VotingPower contract
L2_VOTING_POWER_OWNER_ADDRESS=0x0
L2_VOTING_POWER_OWNER_ADDRESS=0x

# Owner of L2Reward contract
L2_REWARD_OWNER_ADDRESS=0x0

# Owner of L2VestingWallet contract
L2_VESTING_WALLET_OWNER_ADDRESS=0x0
L2_REWARD_OWNER_ADDRESS=0x

# Owner of L2Airdrop contract
L2_AIRDROP_OWNER_ADDRESS=0x0
L2_AIRDROP_OWNER_ADDRESS=0x

# Owner of L2VestingWallet contract
L2_VESTING_WALLET_OWNER_ADDRESS=0x

# Airdrop wallet address where LSK tokens are transferred to after airdrop period ends
L2_AIRDROP_WALLET_ADDRESS=0x0
L2_AIRDROP_WALLET_ADDRESS=0x

# Salt for deterministic smart contract address generation
DETERMINISTIC_ADDRESS_SALT="test_contract_address_salt"
DETERMINISTIC_ADDRESS_SALT="lisk_l2_token_salt_dev_network"

# L1 standard bridge address (Mainnet, Goerli, Sepolia or custom)
L1_STANDARD_BRIDGE_ADDR=0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1
# L1 standard bridge address (Sepolia)
L1_STANDARD_BRIDGE_ADDR=0x1Fb30e446eA791cd1f011675E5F3f5311b70faF5
AndreasKendziorra marked this conversation as resolved.
Show resolved Hide resolved

# L2 standard bridge address
L2_STANDARD_BRIDGE_ADDR=0x4200000000000000000000000000000000000010
AndreasKendziorra marked this conversation as resolved.
Show resolved Hide resolved

# L1 USDT token contract address to be bridged to L2
REMOTE_TOKEN_ADDR_USDT=0x0
REMOTE_TOKEN_ADDR_USDT=0x7169d38820dfd117c3fa1f22a697dba58d90ba06

# L1 RPC URL, e.g. Infura, Alchemy, or your own node
L1_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY
L1_RPC_URL=http://localhost:8545
AndreasKendziorra marked this conversation as resolved.
Show resolved Hide resolved

# L2 RPC URL, e.g. Infura, Alchemy, or your own node
L2_RPC_URL=https://optimism-sepolia.infura.io/v3/YOUR_INFURA_KEY
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=
Expand All @@ -75,30 +75,31 @@ 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-sepolia.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"


# *************** SWAP AND BRIDGE ***************

# L1 wdivETH token contract address to be bridged to L2
L1_TOKEN_ADDR_DIVA=
L1_TOKEN_ADDR_DIVA=0x91701E62B2DA59224e92C42a970d7901d02C2F24

# L1 wstETH token contract address to be bridged to L2
L1_TOKEN_ADDR_LIDO=
L1_TOKEN_ADDR_LIDO=0xB82381A3fBD3FaFA77B3a7bE693342618240067b

# L1 custom bridge for wstETH
L1_LIDO_BRIDGE_ADDR=
L1_LIDO_BRIDGE_ADDR=0xdDDbC273a81e6BC49c269Af55d007c08c005ea56

# L2 wdivETH token contract
L2_TOKEN_ADDR_DIVA=

# L2 wstETH token contract
L2_TOKEN_ADDR_LIDO=
L2_TOKEN_ADDR_LIDO=0xA363167588e8b3060fFFf69519bC440D1D8e4945

# L2 custom bridge for wstETH
L2_LIDO_BRIDGE_ADDR=
L2_LIDO_BRIDGE_ADDR=0x7A7265ae66b094b60D9196fD5d677c11a6A03438
2 changes: 1 addition & 1 deletion .env.mainnet
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .env.testnet
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,26 @@ 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`.
AndreasKendziorra marked this conversation as resolved.
Show resolved Hide resolved
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

**NOTE**: To successfully deploy all smart contracts and execute the required transactions, the deployer (specified by `PRIVATE_KEY` in the `.env` file) must have funds available in its address. This implies that a private key with a sufficient balance on both public test networks is required.

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.
AndreasKendziorra marked this conversation as resolved.
Show resolved Hide resolved
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

Expand Down
Loading