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

Scratch deploy: capability to set WithdrawalQueue baseUri #805

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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",
folkyatina marked this conversation as resolved.
Show resolved Hide resolved
"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 })
arwer13 marked this conversation as resolved.
Show resolved Hide resolved
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
folkyatina marked this conversation as resolved.
Show resolved Hide resolved
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
Loading