Move deposit deployment inside function
@@ -10,17 +10,17 @@ module.exports = async function() {
try {
keepBridge = await KeepBridge.deployed()
tbtcSystem = await TBTCSystem.deployed()
-
- // This is a temporary solution to deploy a new contract. It will be replaced
- // by a deposit factory.
- deposit = await Deposit.new()
- console.log('new deposit deployed: ', deposit.address)
} catch (err) {
console.error(`initialization failed: ${err}`)
process.exit(1)
}
async function createNewDeposit() {
+ // This is a temporary solution to deploy a new contract. It will be replaced
+ // by a deposit factory.
+ deposit = await Deposit.new()
+ console.log('new deposit deployed: ', deposit.address)
+
const result = await deposit.createNewDeposit(
tbtcSystem.address, // address _TBTCSystem,
'0x0000000000000000000000000000000000000000', // address _TBTCToken,
