From 0756569dc7aa0121976ef5b4ca0673cac387e063 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Tue, 28 Sep 2021 13:19:50 +0200 Subject: [PATCH] FIx deployment script for RSK we need to wait a bit more because RSK is slower and transactions must be confirmed --- scripts/create-proxy.js | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/scripts/create-proxy.js b/scripts/create-proxy.js index 128e668..b87676e 100644 --- a/scripts/create-proxy.js +++ b/scripts/create-proxy.js @@ -38,19 +38,30 @@ async function main() { console.log("...waiting for 1 confirmation"); await reimbursement.deployTransaction.wait(); - await contributor.setTokenContract(token.address); - await contributor.setContributionContract(contribution.address); + await contributor + .setTokenContract(token.address) + .then((response) => response.wait()); + await contributor + .setContributionContract(contribution.address) + .then((response) => response.wait()); - await contribution.setTokenContract(token.address); - await contribution.setContributorContract(contributor.address); + await contribution + .setTokenContract(token.address) + .then((response) => response.wait()); + await contribution + .setContributorContract(contributor.address) + .then((response) => response.wait()); - await token.setContributionContract(contribution.address); - await token.setContributorContract(contributor.address); + await token + .setContributionContract(contribution.address) + .then((response) => response.wait()); + await token + .setContributorContract(contributor.address) + .then((response) => response.wait()); - await reimbursement.setContributorContract(contributor.address); - - const c = await contributor.contributionContract(); - console.log(c); + await reimbursement + .setContributorContract(contributor.address) + .then((response) => response.wait()); const addresses = { Contributor: contributor.address, @@ -59,8 +70,10 @@ async function main() { Reimbursement: reimbursement.address, }; + console.log("Writing addresses.json"); const libPath = path.join(__dirname, "..", "lib"); fileInject(path.join(libPath, "addresses.json"), networkId, addresses); + console.log("DONE!"); } main();