From 12326ce73f6ff452d624954ba6259eea55efa610 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Fri, 15 Jul 2022 18:19:06 +0200 Subject: [PATCH] Fix typo and add more logs --- scripts/create-proxy.js | 69 ++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a/scripts/create-proxy.js b/scripts/create-proxy.js index 10bff88..7aa40d7 100644 --- a/scripts/create-proxy.js +++ b/scripts/create-proxy.js @@ -22,7 +22,7 @@ async function main() { let contract = await upgrades.deployProxy(contractFactories[contractName], params) .catch(handleError); - contracts[contractName.toLowerCase()] = contract; + contracts[contractName] = contract; await contract.deployed().then(() => { console.log(`${contractName} deployed to:`, contract.address); @@ -39,30 +39,63 @@ async function main() { await deployContractProxy('Token'); await deployContractProxy('Reimbursement'); - await contracts.Contributor + console.log('Calling Contributor#setTokenContract') + await contracts.Contributor.functions .setTokenContract(contracts.Token.address) - .then(res => res.wait()).catch(handleError); - await contracts.Contributor - .setContributionContract(contracts.Contribution.address) - .then(res => res.wait()).catch(handleError); + .then(res => { + console.log(`...transaction published: ${res.hash}`); + return res.wait(); + }).catch(handleError); - await contracts.Contribution + console.log('Calling Contributor#setContributionContract') + await contracts.Contributor.functions + .setContributionContract(contracts.Contribution.address) + .then(res => { + console.log(`...transaction published: ${res.hash}`); + return res.wait(); + }).catch(handleError); + + + console.log('Calling Contribution#setTokenContract') + await contracts.Contribution.functions .setTokenContract(contracts.Token.address) - .then(res => res.wait()).catch(handleError); - await contracts.Contribution - .setContributorContract(contracts.Contributor.address) - .then(res => res.wait()).catch(handleError); + .then(res => { + console.log(`...transaction published: ${res.hash}`); + return res.wait(); + }).catch(handleError); - await contracts.Token + + console.log('Calling Contribution#setContributorContract') + await contracts.Contribution.functions + .setContributorContract(contracts.Contributor.address) + .then(res => { + console.log(`...transaction published: ${res.hash}`); + return res.wait(); + }).catch(handleError); + + console.log('Calling Token#setContributionContract') + await contracts.Token.functions .setContributionContract(contracts.Contribution.address) - .then(res => res.wait()).catch(handleError); - await contracts.Token - .setContributorContract(contracts.Contributor.address) - .then(res => res.wait()).catch(handleError); + .then(res => { + console.log(`...transaction published: ${res.hash}`); + return res.wait(); + }).catch(handleError); - await contracts.Reimbursement + console.log('Calling Token#setContributorContract') + await contracts.Token.functions .setContributorContract(contracts.Contributor.address) - .then(res => res.wait()).catch(handleError); + .then(res => { + console.log(`...transaction published: ${res.hash}`); + return res.wait(); + }).catch(handleError); + + console.log('Calling Reimbursement#setContributorContract') + await contracts.Reimbursement.functions + .setContributorContract(contracts.Contributor.address) + .then(res => { + console.log(`...transaction published: ${res.hash}`); + return res.wait(); + }).catch(handleError); const addresses = { Contributor: contracts.Contributor.address, -- 2.25.1