-
Notifications
You must be signed in to change notification settings - Fork 5
Script for deploy proxy on mainnet #68
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
Open
olga24912
wants to merge
2
commits into
master
Choose a base branch
from
deploy_proxy_on_mainnet
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| { | ||
| "proverAddress": "0x051ad3f020274910065dcb421629cd2e6e5b46c4", | ||
| "clientAddress": "0x0151568af92125fb289f1dd81d9d8f7484efc362", | ||
| "clientAddress": "0x3FEFc5A4B1c02f21cBc8D3613643ba0635b9a873", | ||
| "ethConnectorAddress": "0x6BFaD42cFC4EfC96f529D786D643Ff4A8B89FA52", | ||
| "nearEvmAccount": "aurora", | ||
| "bridgeFactoryAccount": "factory.bridge.near" | ||
| "bridgeFactoryAccount": "factory.bridge.near", | ||
| "proxyAddress": "TODO" | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| const hre = require('hardhat'); | ||
|
|
||
| async function updateAdminProxy(ethereumConfig, newAdmin) { | ||
| const privateKey = hre.network.config.accounts[0]; | ||
| const signerWallet = new hre.ethers.Wallet(privateKey, hre.ethers.provider); | ||
|
|
||
| console.log(`Update admin proxy with the account: ${signerWallet.address}`); | ||
|
|
||
| const ethCustodianProxyContractFactory = await hre.ethers.getContractFactory('EthCustodianProxy'); | ||
| const ethCustodianProxy = await ethCustodianProxyContractFactory.attach(ethereumConfig.proxyAddress); | ||
|
|
||
| console.log(`EthCustodian Proxy address: ${await ethCustodianProxy.getAddress()}`); | ||
|
|
||
| let tx_grant_admin = await ethCustodianProxy | ||
| .connect(signerWallet) | ||
| .grantRole("0x0000000000000000000000000000000000000000000000000000000000000000", newAdmin); | ||
| console.log(`Grant Admin Role for ${newAdmin} Tx Hash: ${tx_grant_admin.hash}`); | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to wait for the transaction to complete. |
||
| let tx_grant_pausable = await ethCustodianProxy | ||
| .connect(signerWallet) | ||
| .grantRole("0x1e1db0d9c63b4a23ec134ff71a2f56610c32f638cbff81e96e14734c4daf0b4d", newAdmin); | ||
| console.log(`Grant Pausable Admin Role for ${newAdmin} Tx Hash: ${tx_grant_pausable.hash}`); | ||
|
|
||
| let tx_revoke_pausable = await ethCustodianProxy | ||
| .connect(signerWallet) | ||
| .revokeRole("0x1e1db0d9c63b4a23ec134ff71a2f56610c32f638cbff81e96e14734c4daf0b4d", signerWallet.address); | ||
kiseln marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| console.log(`Revoke Pausable Admin Role for ${signerWallet.address} Tx Hash: ${tx_revoke_pausable.hash}`); | ||
| } | ||
|
|
||
| exports.updateAdminProxy = updateAdminProxy; | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this from the other script is equivalent and an easier way to get the signer
const [signerWallet] = await hre.ethers.getSigners();There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It returns HardhatEthersSigner, but I need Wallet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signer seem to be enough for all subsequent uses of this object