Add README with basic howto; persistent node

This commit is contained in:
Oskar Thoren 2021-02-02 12:34:43 +08:00
parent 711c7a7884
commit 53a029c4f1
No known key found for this signature in database
GPG Key ID: BDB55C8C0EF29911
2 changed files with 22 additions and 1 deletions

22
README.md Normal file
View File

@ -0,0 +1,22 @@
# Minimal Swap PoC
A minimal end to end proof of concept of using Swap contracts written by Swarm and maintained here: https://github.com/ethersphere/swap-swear-and-swindle
All contract code imported from the above repo.
Ported to Hardhat and Ethers.io.
# How to run
For scripts there is a script to setup SWAP contracts. To run it and make it persistent we can do the following:
``` sh
# Run a node
npx hardhat node
# Run script to setup SWAP contracts
npx hardhat run scripts/setup-swap.js
```
Which will return you a list a list of addresses for ERC20, Alice, Bob, and their respective SWAP contracts.

View File

@ -33,7 +33,6 @@ async function main() {
var logs = await ethers.provider.getLogs({address: simpleSwapFactory.address}); var logs = await ethers.provider.getLogs({address: simpleSwapFactory.address});
var BobSwapAddress = swapFactoryInterface.parseLog(logs[0]).args.contractAddress var BobSwapAddress = swapFactoryInterface.parseLog(logs[0]).args.contractAddress
// TODO Setup node to work against for persistence
console.log("Alice address:", aliceAddress); console.log("Alice address:", aliceAddress);
console.log("Bob address:", bobAddress); console.log("Bob address:", bobAddress);
console.log("AliceSwapAddress:", AliceSwapAddress) console.log("AliceSwapAddress:", AliceSwapAddress)