-
set up
.env
-
deploy
forge script script/DeployInit.s.sol:DeployInit --multi --legacy -vvvv --verify --etherscan-api-key <> --broadcast
- write down resulting addresses for
MinterBurnerProxy
andNativeEscrowProxy
new MinterBurnerProxy@0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
new NativeConverterProxy@0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- on L2 EURC, execute the
ConfigureLxLyMinters
script
- check the explorers
Eth Mainnet | ZkEVM Mainnet |
---|---|
Native EURC | EURC.e |
n/a | BridgeWrapped EURC |
L1Escrow | n/a |
n/a | MinterBurner |
n/a | NativeEscrow |
Sepolia | Cardona |
---|---|
Native EURC | EURC.e |
n/a | BridgeWrapped EURC |
L1Escrow | n/a |
n/a | MinterBurner |
n/a | NativeEscrow |
- get the addresses ready
export L1_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/<XXXXX>
export L2_RPC_URL=https://zkevm-rpc.com
export PK=
export TESTER=0x02023f74ED12Df7752144aE8A23411776D4698b4
export L1_EURC=0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c
export L2_EURC=0x48ffd6616857ab5883487268eF3F1c78dde870e3
export L2_BWEURC=0x514723aCd1e233C2523E512Fa6af1eD4fad102E0
export L1_ESCROW=0x937d0003df039C9685bf0E4A6b3dd50FE0d719B0
export MINTER_BURNER=0xEF502e776367fbb5Bd17b9b36A1750cd30aEbf2B
export NATIVE_CONVERTER=0xa841f406e7E4fcCe2C9f3Da219D62BF6245bdf0B
- execute the cast commands
# Get Native EURC in L2 through L1Escrow
cast send --rpc-url $L1_RPC_URL --private-key $PK $L1_EURC "approve(address,uint256)" $L1_ESCROW 8000000
cast call $L1_EURC "allowance(address,address)" $TESTER $L1_ESCROW --rpc-url $L1_RPC_URL
cast send --rpc-url $L1_RPC_URL --private-key $PK $L1_ESCROW "bridgeToken(address,uint256,bool)" $TESTER 8000000 true
# Withdraw L2 (Native) EURC into L1 EURC
cast call $L2_EURC "balanceOf(address)" $TESTER --rpc-url $L2_RPC_URL
cast send --rpc-url $L2_RPC_URL --legacy --private-key $PK $L2_EURC "approve(address,uint256)" $MINTER_BURNER 1000000
cast send --rpc-url $L2_RPC_URL --legacy --private-key $PK $MINTER_BURNER "bridgeToken(address,uint256,bool)" $TESTER 1000000 true
# Convert BridgeWrapped EURC into Native EURC
cast send --rpc-url $L2_RPC_URL --legacy --private-key $PK $L2_BWEURC "approve(address,uint256)" $NATIVE_CONVERTER 1000000
cast send --rpc-url $L2_RPC_URL --legacy --private-key $PK $NATIVE_CONVERTER "convert(address,uint256,bytes)" $TESTER 1000000 ""
# Deconvert Native EURC into BridgeWrapped EURC
cast send --rpc-url $L2_RPC_URL --legacy --private-key $PK $L2_EURC "approve(address,uint256)" $NATIVE_CONVERTER 1000000
cast send --rpc-url $L2_RPC_URL --legacy --private-key $PK $NATIVE_CONVERTER "deconvert(address,uint256,bytes)" $TESTER 1000000 ""
# Admin Only - Migrate the BridgeWrapped EURC from L2 to L1Escrow
cast send --rpc-url $L2_RPC_URL --private-key $PK $NATIVE_CONVERTER "migrate()"