Commit Graph

33 Commits

Author SHA1 Message Date
Dmitry Holodov
0f1865c33f additonal erc20 and taker decimal checks (#478) 2023-05-30 21:49:22 -05:00
noot
c131112da1 feat: close stream after NotifyETHLocked is sent (#446) 2023-05-01 23:03:26 -04:00
Matt
3f9e4eecf6 Fix messages for xmrmaker provided amount out of range errors (#394) 2023-04-19 09:57: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
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
noot
aa70b55a5c log updates for ERC20 swaps (#369) 2023-04-02 18:38:46 -04:00
noot
d913658446 fix xmrmaker initiation + recovery, don't delete offer from db (#322) 2023-02-22 10:25:00 -05:00
Dmitry Holodov
812ba9d6b6 harmonize offer deletion behavior (#312) 2023-02-20 14:35:10 -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
Dmitry Holodov
1e83673f23 add package comments (#236)
package comments added to all packages
2022-12-02 00:43:32 -06:00
noot
21c2f2a585 implement auto-recover for xmrtaker (#238) 2022-11-24 07:09:14 -05:00
noot
cac8928e22 implement auto-recover for xmrmaker (#235) 2022-11-22 07:14:44 -05:00
noot
591046e787 handle decimals of ERC20 tokens properly (#231) 2022-11-18 18:45:10 -05:00
Dmitry Holodov
ec89cd684a misc fixes (#232)
* Relayer now runs as a dedicated binary in integration tests
* Binaries are now in `bin/` folder
* Removed warnings in our github actions
* Libp2p libs updated
* Signal handling improvements
* xmrmaker instance locking fix added
2022-11-18 16:47:16 -06:00
Dmitry Holodov
bfefd3bb45 rework backend wallet interfaces (#224)
Refactored the Monero and Ethereum wallet/node sub-interfaces into a has-a relationship with the backend.
2022-11-14 18:19:20 -06:00
noot
be9888f05b implement event watcher for contract events; remove unneeded network messages (#219) 2022-11-13 14:19:37 +01:00
noot
36518eae87 persist swap info to disk (#213) 2022-11-07 14:42:35 -05:00
noot
0bdb6f6f2a add relayer support for claim contract function (#204) 2022-10-26 23:39:20 -04:00
noot
a51ea4e731 implement database; persist offers to disk and reload on startup (#200) 2022-10-11 15:44:37 -04:00
noot
5ed5b9271b implement ERC20 integration tests (#197) 2022-10-08 11:43:58 -04:00
Dmitry Holodov
476bc69b82 CLI cleanups (#185)
* Switches to current v2 version of urfave CLI
* Fixes incorrect port values in the help
* Provides defaults directly to urfave for clear `--help` messaging
* `--base-path` flag renamed to `--data-dir`. This matches `monerod`'s' `--data-dir` and almost matches the `geth` flag `--datadir`
* Bootnodes and contract address are provided for stagenet testing
* Bootnodes can be provided individually by repeating the `--bootnodes`/`--bn` flag, or as a comma separated block (original behavior), or even a combination of both. (Makes adding/removing bootnodes a lot easier.)
* More precise error messaging when XMR maker/taker values are off
* Fixes bug in the peer finder where XMR was hardcoded as the provides coin
* `cleanup-test-processes.sh` displays which processes are being killed
2022-09-07 19:45:01 -05:00
doonte
067b12f584 add direct ERC-20 swap support (#158)
Co-authored-by: noot <elizabethjbinks@gmail.com>
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2022-09-05 14:12:22 -04:00
Dmitry Holodov
b2c8641087 rename module (#156) 2022-08-19 20:31:50 -04:00
Dmitry Holodov
49a4ff12f3 Full API Monero RPC client (#154)
Switches from our partial Monero RPC client implementation to a full-API client to help with testing, reliability, debugging and future features. Other changes:
* GenerateBlocks written for better results when called by multiple parties simultaneously
* monero.Client interface renamed to monero.WalletClient to be orthogonal with monero.DaemonClient interface
* monero.NewClient(...) renamed to monero.NewWalletClient(...) to be orthogonal with monero.NewDaemonClient(...)
* monero.CreateMoneroWallet(...) simplified to monero.CreateWallet(...) (package prefix already states wallet type)
* monero/clent.go, monero/daemon.go renamed to monero/wallet_client.go, monero/daemon_client.go
* monero/rpc.go removed with code consolidated into monero/wallet_client.go and monero/daemon_client.go
2022-08-18 23:58:14 -05:00
Dmitry Holodov
cbecd6a891 fix various concurrency issues (#147)
* Fixes lock issues on the XMR Maker's offer list (new package protocol/xmrmaker/offers)
* Fixes lock issues on the swapState maps
* Fixes go routine sync issues in TestError_ShouldOnlyTakeOfferOnce that were sometimes breaking TestSuccess_ConcurrentSwaps
* Ensures that the id field of "types.Offer" is initialized when created
2022-08-10 08:12:12 -05:00
noot
cca0b6c771 allow for multiple ongoing swaps (#128) 2022-06-13 20:50:10 -04:00
noot
0eb4f73dcc refactor: create protocol backend, rename protocol packages to xmrmaker/xmrtaker (#123) 2022-06-02 22:08:20 -04:00