Skip to content

Commit

Permalink
feat(scratch deploy): set withdrawalQueue baseUri upon deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
arwer13 committed Nov 21, 2023
1 parent def39ce commit 573f7ea
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
3 changes: 2 additions & 1 deletion deployed-testnet-defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
"withdrawalQueueERC721": {
"deployParameters": {
"name": "stETH Withdrawal NFT",
"symbol": "unstETH"
"symbol": "unstETH",
"baseUri": null
}
}
}
7 changes: 7 additions & 0 deletions scripts/scratch/00-populate-deploy-artifact-from-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const DEPLOYER = process.env.DEPLOYER
const GATE_SEAL_FACTORY = process.env.GATE_SEAL_FACTORY
const GENESIS_TIME = parseInt(process.env.GENESIS_TIME)
const DEPOSIT_CONTRACT = process.env.DEPOSIT_CONTRACT
const WITHDRAWAL_QUEUE_BASE_URI = process.env.WITHDRAWAL_QUEUE_BASE_URI

async function saveDeployParameters({ web3, artifacts }) {
const netId = await web3.eth.net.getId()
Expand Down Expand Up @@ -37,6 +38,12 @@ async function saveDeployParameters({ web3, artifacts }) {
genesisTime: GENESIS_TIME,
depositContract: DEPOSIT_CONTRACT,
}
if (WITHDRAWAL_QUEUE_BASE_URI !== undefined) {
state.withdrawalQueueERC721.deployParameters = {
...state.withdrawalQueueERC721.deployParameters,
baseUri: WITHDRAWAL_QUEUE_BASE_URI,
}
}
persistNetworkState(network.name, netId, state)
}

Expand Down
16 changes: 14 additions & 2 deletions scripts/scratch/16-initialize-non-aragon-contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,26 @@ async function deployNewContracts({ web3, artifacts }) {
await makeTx(validatorsExitBusOracle, 'initialize', validatorsExitBusOracleArgs, { from: DEPLOYER })

//
// === WithdrawalQueue initialize ===
// === WithdrawalQueue: initialize ===
//
const withdrawalQueue = await artifacts.require('WithdrawalQueueERC721').at(withdrawalQueueAddress)
const withdrawalQueueArgs = [
withdrawalQueueAdmin, // _admin
]
const withdrawalQueue = await artifacts.require('WithdrawalQueueERC721').at(withdrawalQueueAddress)
await makeTx(withdrawalQueue, 'initialize', withdrawalQueueArgs, { from: DEPLOYER })

//
// === WithdrawalQueue: setBaseURI ===
//
const withdrawalQueueBaseUri = state["withdrawalQueueERC721"].deployParameters.baseUri
if (withdrawalQueueBaseUri !== null && withdrawalQueueBaseUri !== "") {
const MANAGE_TOKEN_URI_ROLE = await withdrawalQueue.MANAGE_TOKEN_URI_ROLE()
await makeTx(withdrawalQueue, 'grantRole', [MANAGE_TOKEN_URI_ROLE, DEPLOYER], { from: DEPLOYER })
await makeTx(withdrawalQueue, 'setBaseURI', [withdrawalQueueBaseUri] , { from: DEPLOYER })
console.log({ withdrawalQueueBaseUri })
await makeTx(withdrawalQueue, 'renounceRole', [MANAGE_TOKEN_URI_ROLE, DEPLOYER], { from: DEPLOYER })
}

//
// === StakingRouter: initialize ===
//
Expand Down
2 changes: 2 additions & 0 deletions scripts/scratch/dao-holesky-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export NETWORK_STATE_DEFAULTS_FILE="deployed-testnet-defaults.json"
export GENESIS_TIME=1695902400
export DEPOSIT_CONTRACT=0x4242424242424242424242424242424242424242

# export WITHDRAWAL_QUEUE_BASE_URI="<< SET IF REQUIED >>"

export GAS_PRIORITY_FEE="${GAS_PRIORITY_FEE:=1}"
export GAS_MAX_FEE="${GAS_MAX_FEE:=100}"

Expand Down
1 change: 1 addition & 0 deletions scripts/scratch/dao-local-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export NETWORK=local
export RPC_URL="http://127.0.0.1:8545"
export GATE_SEAL_FACTORY=0x0000000000000000000000000000000000000000
export GENESIS_TIME=1639659600 # just some time
# export WITHDRAWAL_QUEUE_BASE_URI="<< SET IF REQUIED >>"
#
export DEPLOYER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
export GAS_PRIORITY_FEE=1
Expand Down

0 comments on commit 573f7ea

Please sign in to comment.