From 2346a9d4a1982d06f2f9334983d5426b8e2fd323 Mon Sep 17 00:00:00 2001 From: John Cairns Date: Thu, 23 May 2024 17:06:21 -0500 Subject: [PATCH] XLayer deployment --- .vscode/tasks.json | 13 ++++++------- README.md | 17 ++++++++++++++--- contracts/L2/ETHxTokenWrapper.sol | 2 +- script/DeployETHx.s.sol | 3 ++- script/DeployWrapper.s.sol | 4 ++-- script/OFT.s.sol | 1 - 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 2d9e2ee..ee45f71 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -202,7 +202,6 @@ "options": { "cwd": "${workspaceFolder}", "env": { - "PROXY_ADMIN": "0xb30256CA8A9Ebe058Eb78a4edbf3364e7F8e5d86", "ETHX": "0x7D03Bfa72Cd70e96A391cF32e7B27e43AE68a574", "LZ_ENDPOINT": "0x6EDCE65403992e310A62460808c4b910D972f10f", "DELEGATE": "0x2E1F5C7f87096fb7FfFbB6654Fc3b2CE303aEff5", @@ -258,13 +257,13 @@ { "label": "deployoftadapter", "type": "shell", - "command": "forge script ./script/OFTAdapter.s.sol --sig 'deploy()' --slow --broadcast --rpc-url ${HOLESKY_URL} --private-key ${PRIVATE_KEY} --etherscan-api-key ${ETHERSCAN_API_KEY} --verify", + "command": "forge script ./script/OFTAdapter.s.sol --sig 'deploy()' --slow --broadcast --rpc-url ${HOLESKY_URL} --private-key ${PRIVATE_KEY} --etherscan-api-key ${ETHERSCAN_API_KEY} --verifyca", "options": { "cwd": "${workspaceFolder}", "env": { - "ETHX": "0xB4F5fc289a778B80392b86fa70A7111E5bE0F859", - "LZ_ENDPOINT": "0x6edce65403992e310a62460808c4b910d972f10f", - "DELEGATE": "0xfcB068B43AB08aA9210F52eabd261A7a3b0C8357", + "ETHX": "0xA35b1B31Ce002FBF2058D22F30f95D405200A15b", + "LZ_ENDPOINT": "0x1a44076050125825900e736c501f859c50fE728c", + "DELEGATE": "0xc6160F5bC3C673AC390f11c492E8ED0d0693579A", } }, "dependsOn": "test", @@ -294,14 +293,14 @@ { "label": "quotesend", "type": "shell", - "command": "forge script ./script/OFTAdapter.s.sol --sig 'quoteSend()' --slow --broadcast --rpc-url ${HOLESKY_URL} --private-key ${PRIVATE_KEY}", + "command": "forge script ./script/OFTAdapter.s.sol --sig 'quoteSend()' --legacy --slow --broadcast --rpc-url ${HOLESKY_URL} --private-key ${PRIVATE_KEY}", "options": { "cwd": "${workspaceFolder}", "env": { "OFT_ADAPTER": "0x4a5CC4c467CF043247f4d06Ef0b688aa5C3F7F6a", "PEER_EID": "40231", "DEST_ACCOUNT": "0x2E1F5C7f87096fb7FfFbB6654Fc3b2CE303aEff5", - "AMOUNT": "1000000000000000", + "AMOUNT": "10000000000000000", "GAS": "200000" } }, diff --git a/README.md b/README.md index 05da913..4e99eff 100644 --- a/README.md +++ b/README.md @@ -69,12 +69,12 @@ $ forge test -v | ETHx | 0xc54B43eaF921A5194c7973A4d65E055E5a1453c2 | Optimism | | ETHx ProxyAdmin | 0x8bc3646d175ECb081469Be6a0b2A10eeE112101C | Optimism | | ETHx | 0xB4F5fc289a778B80392b86fa70A7111E5bE0F859 | Holesky | -| ETHx_OFTAdapter | 0x4D306b4d57BEFdFFB7d98b47e8c8D07CE517D9BF | Holesky | +| ETHx_OFTAdapter | 0x4a5CC4c467CF043247f4d06Ef0b688aa5C3F7F6a | Holesky | | ETHx ProxyAdmin | 0xe6460418db6D7A6D85423560B19A8Af37c1092a4 | Holesky | | ETHx PriceOracle | 0x66C4924Cc30dC47D0c8484143236F465F4e37c9E | Holesky | | ETHxRateProvider | 0xbF11aB33C9E1206Fb868b3dbFc8C9cB8D4e6BD79 | Holesky | -| ETHx | 0x7F9c175343637e03b2a056D831BD5C96d1157ED6 | Arbitrum Sepolia | -| ETHx_OFT | 0x8826E2Dd7555Ec6A8782F63e3b10A4C7F973b03d | Arbitrum Sepolia | +| ETHx | 0x52312ea29135A468417F0C71d6A75CfEA75351b7 | Arbitrum Sepolia | +| ETHx_OFT | 0x8AEDA11bD0C5fBafbFb142830d23812Df02A8424 | Arbitrum Sepolia | | ETHxRateReceiver | 0x2b700f8b3F03798e7Db0e67a5aB48c12D10046DE | Arbitrum Sepolia | | ETHx ProxyAdmin | 0xb30256CA8A9Ebe058Eb78a4edbf3364e7F8e5d86 | XLayer Testnet | | ETHx | 0x7D03Bfa72Cd70e96A391cF32e7B27e43AE68a574 | XLayer Testnet | @@ -82,6 +82,17 @@ $ forge test -v | ETHx Wrapper | 0x0B2fAadfe75fE6507Dc8F81f8331198C65cA2C24 | XLayer Testnet | | ETHxPoolV4 | 0x217EBabCf15EC6deaCF11f737d79275e95C97EFE | XLayer Testnet | | ETHxRateReceiver | 0xBe23e1A64969Cb28eFdB6c3d2CE9E4Bf16042187 | XLayer Testnet | +| ProxyAdmin | 0xD99E8bA5259Dd2b8B9aBFE0eD78913ec60B8F898 | Ethereum | +| ETHx | 0xA35b1B31Ce002FBF2058D22F30f95D405200A15b | Ethereum | +| ETHx_OFTAdapter | 0x39d0ce7d1509a4f22619D0f666978FBe820665E9 | Ethereum | +| ETHxPriceOracle | 0x9305d41Ac91A200B848D285242D8e415E6414B2F | Ethereum | +| ETHxRateProvider | 0x0B2fAadfe75fE6507Dc8F81f8331198C65cA2C24 | Ethereum | +| ETHx ProxyAdmin | 0x99A7102235A7773003D70bA0f6cc8D97e38ABB53 | XLayer | +| ETHx | 0xDC685bf4b416f8D5cAc64927E9c516be45b81d28 | XLayer | +| ETHx_OFT | 0xC0A0fDD802b2750b7f972C2a7972c8942328099f | XLayer | +| ETHxTokenWrapper | 0xDBAaD20ffd67dfaeBdE40b842cB78eAa18F1BB74 | XLayer | +| ETHxRateReceiver | 0x063d4c8CFeF375C2Fc1710934504e2b7aB85fd15 | XLayer | +| ETHxPoolV4 | 0xaE11a5de90D6eC8b296b5D8cc7d0F262c0074Eef | XLayer | ### Deployment diff --git a/contracts/L2/ETHxTokenWrapper.sol b/contracts/L2/ETHxTokenWrapper.sol index e5cc600..c207e00 100644 --- a/contracts/L2/ETHxTokenWrapper.sol +++ b/contracts/L2/ETHxTokenWrapper.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: GNU-3.0-or-later pragma solidity 0.8.22; import { SafeERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; diff --git a/script/DeployETHx.s.sol b/script/DeployETHx.s.sol index 9717fd0..ac3a81e 100644 --- a/script/DeployETHx.s.sol +++ b/script/DeployETHx.s.sol @@ -29,10 +29,11 @@ contract DeployETHx is Script { function deployProxy() public { address admin = vm.envAddress("ETHX_ADMIN"); address proxyAdmin = vm.envAddress("PROXY_ADMIN"); + console.log("ProxyAdmin: ", proxyAdmin); address deploymentAdmin = msg.sender; vm.startBroadcast(); ETHx implementation = new ETHx(); - bytes memory initializationData = abi.encodeWithSelector(ETHx.initialize.selector, admin); + bytes memory initializationData = abi.encodeWithSelector(ETHx.initialize.selector, deploymentAdmin); TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(address(implementation), proxyAdmin, initializationData); console.log("ETHx deployed to proxy at: ", address(proxy)); diff --git a/script/DeployWrapper.s.sol b/script/DeployWrapper.s.sol index 1ac123e..a693f1d 100644 --- a/script/DeployWrapper.s.sol +++ b/script/DeployWrapper.s.sol @@ -21,7 +21,7 @@ contract DeployWrapper is Script { vm.startBroadcast(); ETHxTokenWrapper implementation = new ETHxTokenWrapper(); bytes memory initializationData = - abi.encodeWithSelector(ETHxTokenWrapper.initialize.selector, admin, bridger, ethx); + abi.encodeWithSelector(ETHxTokenWrapper.initialize.selector, deploymentAdmin, bridger, ethx); TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(address(implementation), proxyAdmin, initializationData); console.log("ETHxTokenWrapper deployed to proxy at: ", address(proxy)); @@ -49,7 +49,7 @@ contract DeployWrapper is Script { vm.startBroadcast(); ETHxPoolV4 implementation = new ETHxPoolV4(); bytes memory initializationData = - abi.encodeWithSelector(ETHxTokenWrapper.initialize.selector, admin, bridger, wethx); + abi.encodeWithSelector(ETHxTokenWrapper.initialize.selector, deploymentAdmin, bridger, wethx); TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(address(implementation), proxyAdmin, initializationData); console.log("ETHxPoolV4 deployed to proxy at: ", address(proxy)); diff --git a/script/OFT.s.sol b/script/OFT.s.sol index 9f210f5..1d8f862 100644 --- a/script/OFT.s.sol +++ b/script/OFT.s.sol @@ -26,7 +26,6 @@ contract OFT is Script { ETHx ethx = ETHx(proxy); ethx.grantRole(ethx.MINTER_ROLE(), admin); ethx.grantRole(ethx.BURNER_ROLE(), admin); - ethx.grantRole(ethx.PAUSER_ROLE(), admin); } function setPeer() public {