Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
add DepositManager update script
Browse files Browse the repository at this point in the history
  • Loading branch information
simonDos committed Sep 19, 2023
1 parent 116bed5 commit d90805d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions scripts/updateDepositManager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const contractAddresses = require('../contractAddresses.json')

const DepositManager = artifacts.require('DepositManager')
const DepositManagerProxy = artifacts.require('DepositManagerProxy')

async function deployAndUpdateWM() {
const newDM = await DepositManager.new()
console.log('new DM deployed at: ', newDM.address)
const dmProxy = await DepositManagerProxy.at(
contractAddresses.root.DepositManagerProxy
)
const result = await dmProxy.updateImplementation(newDM.address)
console.log('tx hash: ', result.tx)

const impl = await dmProxy.implementation()
console.log('new impl: ', impl)
}

module.exports = async function(callback) {
// args starts with index 6, example: first arg == process.args[6]
console.log(process.argv)
try {
const accounts = await web3.eth.getAccounts()
console.log(
'Current configured address to make transactions:',
accounts[0]
)
await deployAndUpdateWM()
} catch (e) {
// truffle exec <script> doesn't throw errors, so handling it in a verbose manner here
console.log(e)
}
callback()
}

0 comments on commit d90805d

Please sign in to comment.