mirror of
https://github.com/vacp2p/swap-contracts-module.git
synced 2025-02-27 18:30:33 +00:00
Update README
This commit is contained in:
parent
858b635d2b
commit
77e6c79ba3
18
README.md
18
README.md
@ -24,3 +24,21 @@ Which will return you a list a list of addresses for ERC20, Alice, Bob, and thei
|
|||||||
``` sh
|
``` sh
|
||||||
npx hardhat console --network localhost
|
npx hardhat console --network localhost
|
||||||
```
|
```
|
||||||
|
|
||||||
|
After setting up basic SWAP contracts, we can issue and redeem a cheque.
|
||||||
|
|
||||||
|
TODO: Turn copy-pasting into CLI arguments or automate it
|
||||||
|
|
||||||
|
1. Copy paste the aliceSwapAddress into `sign-cheque.js` script. Then run:
|
||||||
|
|
||||||
|
``` sh
|
||||||
|
npx hardhat run scripts/sign-cheque.js --network localhost
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Copy paste resulting signature and aliceSwapAddress into `redeem-cheque.js`, and run:
|
||||||
|
|
||||||
|
``` sh
|
||||||
|
npx hardhat run scripts/redeem-cheque.js --network localhost
|
||||||
|
```
|
||||||
|
|
||||||
|
Now Alice has send a cheque to Bob, and Bob has received it from the Swap contract. Cheques can be sent and received off-chain, and only settled once Bob wants to.
|
||||||
|
@ -20,12 +20,12 @@ var aliceAddress = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";
|
|||||||
var bobAddress = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8";
|
var bobAddress = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8";
|
||||||
|
|
||||||
// XXX These change
|
// XXX These change
|
||||||
var erc20address = "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853";
|
//var erc20address = "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853";
|
||||||
var aliceSwapAddress = "0x94099942864EA81cCF197E9D71ac53310b1468D8";
|
var aliceSwapAddress = "0x94099942864EA81cCF197E9D71ac53310b1468D8";
|
||||||
|
|
||||||
|
|
||||||
// XXX Hardcoded return from sign-cheque script of cheque from Alice to Bob:
|
// XXX Hardcoded return from sign-cheque script of cheque from Alice to Bob:
|
||||||
var issuerSig = "0x67c0c9ec1e72e90ebf0155b10953ec81b1ff5bca6283e51bee9bb55ec2fa14876278e88e8f0a34570bed0f9bed4cec9c576dc0ac34512adddbfd157b5be5df091c";
|
var issuerSig = "0x67c0c9ec1e72e90ebf0155b10953ec81b1ff5bca6283e51bee9bb55ec2fa14876278e88e8f0a34570bed0f9bed4cec9c576dc0ac34512adddbfd157b5be5df091c";
|
||||||
|
|
||||||
// TODO This should be parameterized with arguments, so probably as a task or standalone script?
|
// TODO This should be parameterized with arguments, so probably as a task or standalone script?
|
||||||
async function main() {
|
async function main() {
|
||||||
var recipient = bobAddress;
|
var recipient = bobAddress;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user