Parameterize swap address

This commit is contained in:
Oskar Thoren 2021-02-09 12:01:41 +08:00
parent 7c23fc1858
commit 5ca72cb10a
3 changed files with 6 additions and 5 deletions

View File

@ -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));
});

View File

@ -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;

View File

@ -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;