diff --git a/hardhat.config.js b/hardhat.config.js index 54615f8..fb07639 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -30,9 +30,10 @@ task("setupSwap", "Setup Swap") }); task("signCheque", "Sign cheque") + .addParam("swapaddress", "Address to Swap Contract (Assumed to belong to Alice)") .setAction(async taskArgs => { // TODO Argument, aliceSwapAddress - var resp = await swap.signCheque(); + var resp = await swap.signCheque(taskArgs.swapaddress); console.log(JSON.stringify(resp)); }); diff --git a/scripts/sign-cheque.js b/scripts/sign-cheque.js index b9fe7cc..4887b91 100644 --- a/scripts/sign-cheque.js +++ b/scripts/sign-cheque.js @@ -23,6 +23,7 @@ var bobAddress = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"; var erc20address = "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853"; var aliceSwapAddress = "0x94099942864EA81cCF197E9D71ac53310b1468D8"; +// XXX Using swap-helpers and task for now, parameterize this etc // TODO This should be parameterized with arguments, so probably as a task or standalone script? async function main() { var swapAddress = aliceSwapAddress; diff --git a/src/swap-helpers.js b/src/swap-helpers.js index fc49062..5bfeda2 100644 --- a/src/swap-helpers.js +++ b/src/swap-helpers.js @@ -21,7 +21,7 @@ var bobAddress = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"; // XXX These change // TODO Parameterize var erc20address = "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853"; -var aliceSwapAddress = "0x94099942864EA81cCF197E9D71ac53310b1468D8"; +//var aliceSwapAddress = "0x94099942864EA81cCF197E9D71ac53310b1468D8"; async function setupSwap() { // Basic setup and definitions @@ -94,9 +94,8 @@ async function setupSwap() { return resp; } -// TODO This should be parameterized with arguments, so probably as a task or standalone script? -async function signCheque() { - var swapAddress = aliceSwapAddress; +async function signCheque(swapAddress) { + var aliceSwapAddress = swapAddress; var beneficiary = bobAddress; var cumulativePayout = 500; var chainId = 31337;