Skip to content

Commit

Permalink
сall prepareToPOSDAO as part of upgrade home bridge implementation (#392
Browse files Browse the repository at this point in the history
)
  • Loading branch information
akolotov authored Mar 25, 2020
1 parent 6fecdbc commit 5f57e8f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "token-bridge-contracts",
"version": "4.0.2",
"version": "4.0.3",
"description": "Bridge",
"main": "index.js",
"scripts": {
Expand Down
17 changes: 16 additions & 1 deletion upgrade/src/upgradeBridgeOnHome.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ const {
NEW_IMPLEMENTATION_XDAI_BRIDGE
} = process.env

const migrationMethodAbi = [
{
constant: false,
inputs: [],
name: 'prepareToPOSDAO',
outputs: [],
payable: false,
stateMutability: 'nonpayable',
type: 'function'
}
]

const web3 = new Web3(new Web3.providers.HttpProvider(HOME_RPC_URL))
const { address } = web3.eth.accounts.wallet.add(HOME_PRIVKEY)

Expand All @@ -26,7 +38,10 @@ const upgradeBridgeOnHome = async () => {

await validatorState(web3, address, multiSigWallet)

const data = proxy.methods.upgradeTo('4', NEW_IMPLEMENTATION_XDAI_BRIDGE).encodeABI()
const bridge = new web3.eth.Contract(migrationMethodAbi, HOME_BRIDGE_ADDRESS)
const upgradeData = bridge.methods.prepareToPOSDAO().encodeABI()

const data = proxy.methods.upgradeToAndCall('4', NEW_IMPLEMENTATION_XDAI_BRIDGE, upgradeData).encodeABI()

await callMultiSigWallet({
role: ROLE,
Expand Down

0 comments on commit 5f57e8f

Please sign in to comment.