From e49c5bdcbeb8f8a1920aafdac9c42c9a9971bbc7 Mon Sep 17 00:00:00 2001 From: VP Date: Wed, 21 Feb 2024 12:56:40 +0100 Subject: [PATCH 1/3] Update deploy script to include contract upgrade --- ...deploy-sepolia-deposit-contract-adapter.js | 33 +++++++++++++++---- scripts/scratch/dao-sepolia-deploy.sh | 3 ++ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/scripts/deploy-sepolia-deposit-contract-adapter.js b/scripts/deploy-sepolia-deposit-contract-adapter.js index 339ceb7e6..2913937a4 100644 --- a/scripts/deploy-sepolia-deposit-contract-adapter.js +++ b/scripts/deploy-sepolia-deposit-contract-adapter.js @@ -3,20 +3,41 @@ const { deployBehindOssifiableProxy } = require('./helpers/deploy') const DEPLOYER = process.env.DEPLOYER || '' -async function deployNewContracts({ web3, artifacts }) { - if (!DEPLOYER) { - throw new Error('Deployer is not specified') - } +async function updateAdapterImplementation(proxyOwner) { + const sepoliaDepositAdapter = "" + const proxyAddress = "0x80b5DC88C98E528bF9cb4B7F0f076aC41da24651" + + const OssifiableProxy = await artifacts.require('OssifiableProxy') + const proxy = await OssifiableProxy.at(proxyAddress) + await proxy.proxy__upgradeTo(sepoliaDepositAdapter, { from: proxyOwner }) +} + +async function deployAdaperBehindPrixy(depositAdapterProxyOwner) { const sepoliaDepositContract = "0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D" - const depositAdapterProxyOwner = "0x6885E36BFcb68CB383DfE90023a462C03BCB2AE5" const constructorArgs = [sepoliaDepositContract] const contract = await deployBehindOssifiableProxy(null, "SepoliaDepositAdapter", depositAdapterProxyOwner, DEPLOYER, constructorArgs, null) - console.log(contract) + console.log('new-deposit-adapter-address', contract) +} + +// RPC_URL= yarn hardhat --network sepolia verify --no-compile --contract "contracts/0.8.9/SepoliaDepositAdapter.sol:SepoliaDepositAdapter" --constructor-args contract-args.js +// contract-args.js example: +// module.exports = [ +// '0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D' +// ] + +async function deployNewContracts({ web3, artifacts }) { + if (!DEPLOYER) { + throw new Error('Deployer is not specified') + } + + const depositAdapterProxyOwner = "0x6885E36BFcb68CB383DfE90023a462C03BCB2AE5" + // await deployAdaperBehindPrixy(depositAdapterProxyOwner) + await updateAdapterImplementation(depositAdapterProxyOwner) } module.exports = runOrWrapScript(deployNewContracts, module) diff --git a/scripts/scratch/dao-sepolia-deploy.sh b/scripts/scratch/dao-sepolia-deploy.sh index 326882776..7bff37abe 100755 --- a/scripts/scratch/dao-sepolia-deploy.sh +++ b/scripts/scratch/dao-sepolia-deploy.sh @@ -25,6 +25,9 @@ export DSM_PREDEFINED_ADDRESS="0x6885E36BFcb68CB383DfE90023a462C03BCB2AE5" export GAS_PRIORITY_FEE="${GAS_PRIORITY_FEE:=1}" export GAS_MAX_FEE="${GAS_MAX_FEE:=100}" +# Deposit adapter depoyment / upgrading +# yarn hardhat --network $NETWORK run ./scripts/deploy-sepolia-deposit-contract-adapter.js --no-compile + # Deposit contract custom LIDO adapter # deployed from scripts/deploy-sepolia-deposit-contract-adapter.js export DEPOSIT_CONTRACT="0x80b5DC88C98E528bF9cb4B7F0f076aC41da24651" From 1e2dd51a57af4e1977cda7931a76ba4528d5c5b1 Mon Sep 17 00:00:00 2001 From: VP Date: Wed, 21 Feb 2024 16:27:36 +0100 Subject: [PATCH 2/3] Fix typo --- scripts/deploy-sepolia-deposit-contract-adapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/deploy-sepolia-deposit-contract-adapter.js b/scripts/deploy-sepolia-deposit-contract-adapter.js index 2913937a4..e64572ebe 100644 --- a/scripts/deploy-sepolia-deposit-contract-adapter.js +++ b/scripts/deploy-sepolia-deposit-contract-adapter.js @@ -13,7 +13,7 @@ async function updateAdapterImplementation(proxyOwner) { await proxy.proxy__upgradeTo(sepoliaDepositAdapter, { from: proxyOwner }) } -async function deployAdaperBehindPrixy(depositAdapterProxyOwner) { +async function deployAdaperBehindProxy(depositAdapterProxyOwner) { const sepoliaDepositContract = "0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D" const constructorArgs = [sepoliaDepositContract] @@ -36,7 +36,7 @@ async function deployNewContracts({ web3, artifacts }) { const depositAdapterProxyOwner = "0x6885E36BFcb68CB383DfE90023a462C03BCB2AE5" - // await deployAdaperBehindPrixy(depositAdapterProxyOwner) + // await deployAdaperBehindProxy(depositAdapterProxyOwner) await updateAdapterImplementation(depositAdapterProxyOwner) } From 26d0c5aef499d69febc725888abafe3137fdb999 Mon Sep 17 00:00:00 2001 From: VP Date: Wed, 21 Feb 2024 16:39:05 +0100 Subject: [PATCH 3/3] Add SepoliaDepositAdapter to the state file --- deployed-sepolia.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/deployed-sepolia.json b/deployed-sepolia.json index 821ea133c..26b582fc0 100644 --- a/deployed-sepolia.json +++ b/deployed-sepolia.json @@ -531,6 +531,22 @@ ] ] }, + "sepoliaDepositAdapter": { + "implementation": { + "contract": "contracts/0.8.9/SepoliaDepositAdapter.sol", + "address": "0x5c5C4556F0017FF57c331185E1C61d91acEf966e", + "constructorArgs": [ + "0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D" + ] + }, + "proxy": { + "address": "0x80b5DC88C98E528bF9cb4B7F0f076aC41da24651", + "contract": "contracts/0.8.9/proxy/OssifiableProxy.sol", + "constructorArgs": [ + "0x5c5C4556F0017FF57c331185E1C61d91acEf966e" + ] + } + }, "stakingRouter": { "proxy": { "contract": "contracts/0.8.9/proxy/OssifiableProxy.sol",