-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts to deploy, upgrade and interact with
EthErc20FastBridge
(…
…#28) * Add scripts to deploy, upgrade and interact with EthErc20FastBridge. * Update README. --------- Co-authored-by: Karim <[email protected]> Co-authored-by: Olga Kunyavskaya <[email protected]> Co-authored-by: Kirill <[email protected]>
- Loading branch information
1 parent
5ee143b
commit c1039b5
Showing
13 changed files
with
437 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
36 changes: 36 additions & 0 deletions
36
eth/scripts/EthErc20FastBridge/deploy_and_verify_bridge.js
This file contains 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,36 @@ | ||
const { ethers, upgrades } = require("hardhat"); | ||
const { getAddressSaver, verify } = require("../deployment/utilities/helpers"); | ||
const { getImplementationAddress } = require("@openzeppelin/upgrades-core"); | ||
const path = require("path"); | ||
|
||
const main = async () => { | ||
const [deployer] = await ethers.getSigners(); | ||
const network = (await ethers.getDefaultProvider().getNetwork()).name; | ||
const addressesPath = path.join(__dirname, "../deployment/deploymentAddresses.json"); | ||
const saveAddress = getAddressSaver(addressesPath, network, true); | ||
|
||
const tokensAddresses = Object.values(require("../deployment/deploymentAddresses.json").tokens); | ||
const whitelistedTokens = Object.values(require("../deployment/deploymentAddresses.json").whitelisted_tokens); | ||
|
||
const bridge = await ethers.getContractFactory("EthErc20FastBridge", deployer); | ||
const Bridge = await upgrades.deployProxy(bridge, [tokensAddresses, whitelistedTokens], { | ||
unsafeAllow: ["delegatecall"] | ||
}); | ||
await Bridge.deployed(); | ||
|
||
saveAddress("bridge_proxy", Bridge.address); // save bridge address | ||
|
||
const currentImplAddress = await getImplementationAddress(ethers.provider, Bridge.address); | ||
|
||
saveAddress("bridge_Implementation", currentImplAddress); // save implementation address | ||
|
||
// verify | ||
console.log("Verifing Contract"); | ||
await verify(Bridge.address, [tokensAddresses, whitelistedTokens]); | ||
console.log("Verified."); | ||
}; | ||
|
||
main().catch((error) => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); |
Oops, something went wrong.