Commit Graph

70 Commits

Author SHA1 Message Date
Dmitry Holodov
9e3ef7b527 ETH transfer fixes and sweep ETH addition (#481) 2023-06-09 01:43:11 -05:00
Dmitry Holodov
0f1865c33f additonal erc20 and taker decimal checks (#478) 2023-05-30 21:49:22 -05:00
Dmitry Holodov
0ab11176c4 unified RPC/websockets client (#472) 2023-05-20 16:29:42 -05:00
Dmitry Holodov
0abc9e6139 fix: bootnode version RPC call (#467) 2023-05-08 21:19:19 -04:00
noot
e1b51b0811 bump relayer fee to 0.01 (#458) 2023-05-03 20:55:05 -04:00
Dmitry Holodov
998347ded0 added new waitForNewSwapReceipt method for xmrmaker (#455) 2023-05-03 11:08:00 -05:00
Dmitry Holodov
e3c24b5e4a eth endpoint defaults and error handling (#451) 2023-05-02 23:12:45 -05:00
Dmitry Holodov
df057ac5cd time index shift (#450) 2023-05-02 10:52:28 -05:00
noot
c131112da1 feat: close stream after NotifyETHLocked is sent (#446) 2023-05-01 23:03:26 -04:00
noot
fb95751dda feat: update SwapCreater.sol claimRelayer to no longer use forwarder (#449)
Co-authored-by: Dmitry Holodov <dimalinux@protonmail.com>
2023-05-01 19:23:17 -04:00
Dmitry Holodov
f9a63ff7c3 min and max offer amount checks (#445)
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2023-04-30 17:36:31 -05:00
Dmitry Holodov
caa5251e59 move to gsnforwarder that is bytecode identical on mainnet and dev (#427) 2023-04-26 13:55:00 -05:00
noot
f344d09fc6 add AUTHORS file and update copyright in license header (#389) 2023-04-18 12:25:30 -04:00
noot
c0c87e8ecb contract updates and cleanup (#382)
Co-authored-by: Dmitry Holodov <dimalinux@protonmail.com>
2023-04-17 13:49:53 -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
b26228805c add license header to files; update readme disclaimer (#368) 2023-04-04 13:12:12 -04:00
noot
bf0443c5bc xmrmaker: check if swap was completed already when restarting swap (#361) 2023-04-01 18:04:28 -04:00
Dmitry Holodov
528715b602 swapd daemon setup/start decoupled from CLI parsing (#354) 2023-03-25 19:18:51 -05: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
250a041703 switch to codecov-action@v3 for uploading code coverage (#334) 2023-02-28 08:22:45 -06:00
Dmitry Holodov
a537be03cf fixed the TestAbort_ERC20_XMRMakerCancels issue (#333) 2023-02-27 18:16:19 -06:00
noot
f7d244754c update relayer fee to be fixed at 0.009 ETH (#316) 2023-02-25 13:04:58 -05:00
Dmitry Holodov
1d7c00a8ed dedicated monero address type (#327)
Adds custom type for monero addresses with better validations.
2023-02-25 11:18:16 -06:00
Dmitry Holodov
812ba9d6b6 harmonize offer deletion behavior (#312) 2023-02-20 14:35:10 -06:00
Dmitry Holodov
b157adc28b JSON validation (#309)
Integrates the go-playground validator library into our codebase for objects that are serialized/deserialized.
2023-02-18 18:37:52 -06:00
Dmitry Holodov
bb9a50dd7f upgrade linter (#297)
Upgraded linter to 1.50.1 and improved protocol documentation.
2023-02-07 22:31:06 -06:00
noot
17ab2f11ff feat: add relayer discovery and transaction submission via network (#291)
Co-authored-by: Dmitry Holodov <dimalinux@protonmail.com>
2023-02-03 19:01:32 -05: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
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
Dmitry Holodov
7dd84a1d77 Cleanup RPC posting (#241)
* Moves RPC posting out of the `rpctypes` package making it a member function of the RPC client type
* Does proper context handling when making http POSTs
* Handles JSON serialization/deserialization in the POST method, simplifying code for callers
* Takes advantage of the Gorilla JSON-RPC 2.0 client library which simplifies error handling
* Updates HTTP transport to use DialContext in place of the deprecated Dial
2022-11-29 22:36:34 -06: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
Dmitry Holodov
ab82a5bc0e relay updates (#220)
* Updates to the latest go-relayer version which can be terminated by canceling the context 
* Swapd's RPC server context handling was improved
* Reformats the contracts with prettier-plugin-solidity@1.0.0-rc.1
* Adds test helper for checking/updating the goerli contract
2022-11-03 23:32:19 -05:00
noot
50e1080d22 unused param fix in offer manager, fix erc20 relayer claim (#215) 2022-10-31 20:48:36 -04:00
Dmitry Holodov
cdcd4db15d monero transaction checks (#207)
* Bob now waits for his XMR transfer to the A+B wallet to have 10 confirmations before notifying Alice that the XMR is locked.
* Alice now rejects the locked Monero if there is more than one block left before she can spend the funds (1 block freedom is in case of network latency on Alice's side). This eliminates Bob's ability to double spend and allows Alice to sweep funds to her primary wallet from the A+B wallet in a reasonable time frame.
* Sweeping received XMR to the primary wallet is now the default behavior.
* A+B swap wallets are created with a restore height set for quick wallet creation in production where the blockchain is big.
* Fixes SleepWithContext moving it into the common package and having it return an error when the sleep is interrupted by the context being canceled.
* Fixed timeout and context handling in integration tests
* Added new GetChainHeight method that queries monerod instead of monero-wallet-rpc
2022-10-31 00:26:25 -05:00
noot
0bdb6f6f2a add relayer support for claim contract function (#204) 2022-10-26 23:39:20 -04:00
noot
5ed5b9271b implement ERC20 integration tests (#197) 2022-10-08 11:43:58 -04:00
Dmitry Holodov
ecd91f624c monero-wallet-rpc now embedded (#192)
* Embeds monero-wallet-rpc instead of having the user start it separately.
* Location of all the files standardized and documented in docs/default-file-locations.md.
* Ethereum and Monero wallets will be created if they do not exist.
* New RPC API  personal_balances added including swapcli support.
2022-10-07 22:18:46 -05:00
noot
87357180f5 remove hardhat dependency from ethereum/ dir (#196) 2022-10-03 18:13:38 -04:00
noot
fefd270424 update cgo-dleq submodule commit, fix test errors (#195) 2022-10-03 11:14:02 -04:00
Dmitry Holodov
6fcd1b8e26 match folders to exec names (#189) 2022-09-12 20:27:56 -04:00
Dmitry Holodov
5698e25239 RPC and WS endpoints share the same port (#187)
Combine our HTTP RPC and Websocket services into a single HTTP server, eliminating the --ws-port flag to swapd and using --swapd-port flag for swapcli.
2022-09-10 14:54:43 -05: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
noot
d7d7cf0e0a cleanup todos, either fix or add issue numbers (#166) 2022-08-20 23:57:23 -04:00