Commit Graph

32 Commits

Author SHA1 Message Date
Dmitry Holodov
8941163c00 USDT compatibility (#484) 2023-06-17 04:30:20 -05:00
noot
c131112da1 feat: close stream after NotifyETHLocked is sent (#446) 2023-05-01 23:03:26 -04:00
noot
f344d09fc6 add AUTHORS file and update copyright in license header (#389) 2023-04-18 12:25:30 -04:00
Dmitry Holodov
15b8378c76 ERC20 balance support (#380)
* Added --token flag to swapcli's balances request allowing the user to query their token balance
* --eth-asset flag on swapcli make changed to --token
* Added TokenInfo RPC API method to retrieve an ERC20 token's metadata
* Added an end-to-end ERC20 unit test to the daemon package
* Fixed ERC20 token approval amount to SwapCreator contract to use the minimum value required (instead of approving the entire user's balance for transfer by the contract)
* Fixed a race condition between concurrent contract calls to approve/new_swap in ERC20 token swaps
* Removed hard coded assumptions that all tokens have 18 decimals
* Maked the decimal places in our test ERC20 token configurable
* Fixed token exchange rate calculations
* Updated ongoing and past swap queries to correctly support ERC20 tokens
* Initial unit tests in swapcli's main package
2023-04-17 11:59:47 -05:00
noot
a2d9e8ddd7 net: add initiate, query and relay timeouts (#378)
Co-authored-by: Dmitry Holodov <dimalinux@protonmail.com>
2023-04-15 14:09:49 +02:00
Dmitry Holodov
7fef2d7b76 XMR taker is relayer of last resort for the maker (#366)
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2023-04-05 20:16:41 -05:00
noot
b26228805c add license header to files; update readme disclaimer (#368) 2023-04-04 13:12:12 -04:00
Dmitry Holodov
0e80eee4dc integrated relayer into swapd (#342) 2023-03-17 14:22:16 -05:00
Dmitry Holodov
51d89a4d18 added more required tags to serialized structs (#330) 2023-02-28 22:41:03 -06:00
Dmitry Holodov
943e95cc11 JSON updates (#305)
* ensures  all p2p message types have JSON tags
* when available, marshaling uses our project types
* "common" package was decoupled from the "message" package
* protocol version bumped
2023-02-16 01:15:58 -06:00
Dmitry Holodov
2905d1b1f9 Fixed Point Math (#269)
Updates our code to use the fixed point match library apd.Decimal.
2023-01-10 16:03:22 -06:00
noot
5068dab46a remove previous net/* contents, move net/swapnet/* to net/ (#270) 2023-01-09 17:09:11 -05:00
noot
3ef8ae9427 refactor net package to separate generic and swap-specific functionality (#268) 2023-01-08 09:59:34 -05:00
Dmitry Holodov
ed15ed9c82 libp2p QUIC and NAT traversal features (#251)
Enables additional libp2p NAT traversal features and enables nodes to communicate using UDP/QUIC in addition to TCP. Switches to using libp2p's "routed host". Most commands that previously accepted multiaddress values now accept a Peer IDs instead.
2022-12-19 18:25:24 -06:00
noot
be9888f05b implement event watcher for contract events; remove unneeded network messages (#219) 2022-11-13 14:19:37 +01:00
noot
d7d7cf0e0a cleanup todos, either fix or add issue numbers (#166) 2022-08-20 23:57:23 -04:00
Dmitry Holodov
b2c8641087 rename module (#156) 2022-08-19 20:31:50 -04:00
noot
cca0b6c771 allow for multiple ongoing swaps (#128) 2022-06-13 20:50:10 -04:00
noot
55ae59046c add more unit tests + errors clean up (#114) 2022-05-15 23:36:03 -04:00
noot
968dd75fbd fixes for stagenet, log cleanup, add automated stagenet tester binary (#108) 2022-04-11 18:56:53 -04:00
noot
65d64544d7 implement unhappy path and error case integration tests (#102) 2022-03-21 15:54:41 -04:00
noot
5d225ac41d add code coverage to unit tests step, add lots of unit tests (#79) 2022-02-05 23:07:29 -05:00
noot
b0b6cb5286 implement swap_ rpc service to allow for fetching of current/past swap statuses (#82) 2022-01-22 22:24:43 -05:00
noot
988b514cf1 cleanup codebase (#72)
* remove unused code, move some funcs around

* move monero/crypto to crypto/monero

* cleanup alice swap_state.go, move funcs

* move rpcclient and types package to common
2022-01-16 23:34:29 -05:00
noot
39e6cc0bcd integrate DLEq into protocol (#67)
* update contract to use secp256k1 curve verification

* update go contract bindings script and bindings

* cleanup rust code, move to its own folder

* remove commented out stuff

* go fmt

* add go wrapper around farcaster-dleq

* add unit tests for farcaster-dleq wrapper

* add dleq unit test for keys

* add swap.go claim test, worksgit status

* add swap.go refund tests

* lint

* update SendKeysMessage to include DLEqProof, update alice/bob generateKeys

* add dleq proof verification to alice/bob handlers

* move alice and bob to protocol package

* add common protocol funcs for generating/verifying dleq proof

* lint

* update alice to store secp256k1 pubkey commitments in contract, update alice/bob to use dleq secret when calling contract

* update alice unit tests

* fix bob unit tests

* update network msg size

* add build-dleq makefile step

* cleanup

* attempt to fix test

* skip inconsistent test on CI
2022-01-15 13:41:27 -05:00
noot
5033587a4a refactor: allow for Bob to explicitly make offers and Alice to take them (#66)
* begin refactor of make/take offer

* implement ability to make offer, advertise new offers, lint, etc

* implement personal rpc service

* update readme instructions

* add check that taker of offer provides correct amount
2022-01-04 21:13:33 -05:00
noot
78752a9088 implement refund path for Bob on unexpected stream closure, add contract checks (#56) 2021-12-06 23:18:30 -05:00
noot
0c41b794e7 add more unit tests, add integration tests (#53) 2021-12-01 23:54:39 -05:00
noot
f369b9a3bb create mainnet, stagenet, and dev environments (#41)
* add environment type, update monero address to use network prefix

* update tests

* pass env through flag

* update --ethereum-privkey to take a file

* config basepath and chainIDs

* fix tests

* update network protocol IDs

* pass env to net

* go fmt, bump ci go version to 1.17

* make directories when needed

* fix tests
2021-11-23 23:47:41 -05:00
noot
95d72b7b02 add view key checks using open_wallet and close_wallet (#40)
* add view key checks using open_wallet and close_wallet

* fix unit tests, update script

* fix tests
2021-11-22 22:22:39 -05:00
noot
5da175b471 utilize t0 and t1 logic in protocol code for Alice and Bob (#30) 2021-11-21 21:10:34 -05:00
noot
10749646df implement rpc server for daemon process, refactor codebase to be controlled via rpc calls (#23) 2021-11-14 18:48:07 -05:00