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 deploy script to include SepoliaDepositAdapter contract upgrade #824

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions deployed-sepolia.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
33 changes: 27 additions & 6 deletions scripts/deploy-sepolia-deposit-contract-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<new-deposit-adapter-address>"
const proxyAddress = "0x80b5DC88C98E528bF9cb4B7F0f076aC41da24651"

const OssifiableProxy = await artifacts.require('OssifiableProxy')
const proxy = await OssifiableProxy.at(proxyAddress)

await proxy.proxy__upgradeTo(sepoliaDepositAdapter, { from: proxyOwner })
}

async function deployAdaperBehindProxy(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=<rpc> yarn hardhat --network sepolia verify --no-compile --contract "contracts/0.8.9/SepoliaDepositAdapter.sol:SepoliaDepositAdapter" --constructor-args contract-args.js <new-address>
// 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 deployAdaperBehindProxy(depositAdapterProxyOwner)
await updateAdapterImplementation(depositAdapterProxyOwner)
}

module.exports = runOrWrapScript(deployNewContracts, module)
3 changes: 3 additions & 0 deletions scripts/scratch/dao-sepolia-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading