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

Deployment script for WalletCoordinator upgrade #643

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

nkuba
Copy link
Member

@nkuba nkuba commented Jul 5, 2023

We add a script for WalletCoordinator contract upgrade.

The current WalletCoordinator contract deployed to mainnet is owned by Threshold Council, so it cannot be upgraded right away by the deployer.

The deployer will deploy a fresh WalletCoordinator contract implementation, then Threshold Council needs to execute transactions to upgrade the WalletCoordinator proxy to the new implementation and set the initial values for newly added parameters.

Refs: #641

We add a script for WalletCoordinator contract upgrade.

The current WalletCoordinator contract deployed to mainnet is owned by
Threshold Council, so it cannot be upgraded right away by the deployer.

The deployer will deploy a fresh WalletCoordinator contract
implementation, then Threshold Council need to execute transactions to
upgrade the WalletCoordinator proxy to the new implementation and set
the initial values for newely added parameters.
@nkuba nkuba self-assigned this Jul 5, 2023
@nkuba nkuba requested a review from pdyraga July 5, 2023 10:39
Comment on lines +34 to +63
const upgradeTxData = await proxyAdmin.interface.encodeFunctionData(
"upgrade",
[proxyDeployment.address, newImplementationAddress]
)

deployments.log(
`proxy admin owner ${proxyAdminOwner} is required to upgrade proxy implementation with transaction:\n` +
`\t\tfrom: ${proxyAdminOwner}\n` +
`\t\tto: ${proxyAdmin.address}\n` +
`\t\tdata: ${upgradeTxData}`
)

// Assemble parameters upgrade transaction.
const walletCoordinator: WalletCoordinator =
await helpers.contracts.getContract("WalletCoordinator")

const walletCoordinatorOwner = await walletCoordinator.owner()

const updateRedemptionProposalParametersTxData =
walletCoordinator.interface.encodeFunctionData(
"updateRedemptionProposalParameters",
[7200, 600, 7200, 20, 20000]
)

deployments.log(
`WalletCoordinator owner ${walletCoordinatorOwner} is required to update redemption proposal parameters with transaction:\n` +
`\t\tfrom: ${walletCoordinatorOwner}\n` +
`\t\tto: ${walletCoordinator.address}\n` +
`\t\tdata: ${updateRedemptionProposalParametersTxData}`
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is nice to be able to double-check the data in the simulation but worth noting, this part is not strictly required.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely, we will simulate with Tenderly first. But we need the new contract to be deployed for that.

@pdyraga pdyraga merged commit 716bf06 into main Jul 5, 2023
@pdyraga pdyraga deleted the wallet-coordinator-upgrade branch July 5, 2023 10:47
@nkuba nkuba added this to the solidity/v1.5.0 milestone Jul 6, 2023
@nkuba nkuba added the :shipit: deployment Deployments and CI workflows label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:shipit: deployment Deployments and CI workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants