This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 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
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() | ||
} |