Commit Graph

308 Commits

Author SHA1 Message Date
noot
ea43b6a86c feat: implement swap relayer cmd package (#282) 2023-01-25 01:17:55 -05:00
omahs
af08415254 Fix: typos (#284) 2023-01-22 10:41:01 -06:00
noot
be37a73086 fix: add commas to offer hash preimage (#283) 2023-01-21 23:05:17 -05:00
noot
faf8cf35c8 fix: update offer ID to be hash of offer fields 2023-01-19 15:21:17 -05:00
Janaka-Steph
d13521daef Modify scripts to run on MacOS (#233)
Updates scripts/docs to support macOS as well as Linux/aarch64 (arm64)
2023-01-16 14:05:35 -06:00
Dmitry Holodov
b78cf06870 check ethereum chain ID (#278)
validates that the expected chain ID for the given environment matches the chain ID returned by the ethereum endpoint
2023-01-14 14:20:02 -06:00
noot
8e1db226fd implement suggested exchange rate (#262)
Pulls chainlink's ETH and XMR price feeds to create suggested exchange rates.
Co-authored-by: Dmitry Holodov <dimalinux@protonmail.com>
2023-01-12 22:50:52 -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
5c2afb949f fix mock (#272) 2023-01-09 18:30:24 -05: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
noot
531da8bf33 update readme (#267) 2023-01-02 16:48:15 -05:00
noot
8433b2307c bump go-dleq version (#266) 2023-01-02 16:47:53 -05:00
Dmitry Holodov
6e146f0dc5 support fallback monero nodes in default configs (#265)
Allows configuring multiple monerod nodes in our default configs. They get tried sequentially and the first one that works gets used.
2022-12-20 15:10:40 -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
noot
5a4ccb332f bump go-dleq version (#264) 2022-12-19 16:53:37 -05:00
phazejeff
b6f07845b9 feat: get-swap-timeout functionality (#260) 2022-12-19 14:59:30 -05:00
noot
3ee4f619db skip failing test (#263) 2022-12-19 14:41:34 -05:00
noot
d955034d63 update readme and ui/readme (#259) 2022-12-15 18:39:56 -05:00
Oldzitoja
2dd6e7ceda ui: make swapd ports configurable (#258)
* ui: make swapd ports configurable

* Allow to access SWAPD_PORT env variable in the code

Co-authored-by: Hubert Czerpak <hubert.czerpak@gmail.com>
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2022-12-15 17:23:38 -05:00
noot
7caadadff6 validate swap timeouts set by counterparty (#254) 2022-12-13 17:59:44 -05:00
phazejeff
dba88b7677 docs: update local.md (#257)
* Updated local.md

* Update local.md

Co-authored-by: phazejeff <phazejeff@proton.me>
2022-12-11 13:25:28 -05:00
noot
a25f62ee3d update forwarder code check (#255) 2022-12-09 15:00:20 -05:00
noot
f9aaa5e9d1 add forwarder contract code check (#253) 2022-12-06 21:46:04 -05:00
noot
83b1c877ff implement discoverLoop to find peers if count is low (#252) 2022-12-06 21:23:26 -05:00
Dmitry Holodov
1e83673f23 add package comments (#236)
package comments added to all packages
2022-12-02 00:43:32 -06:00
noot
4d95c4d9a9 implement get-offers for swapcli (#248) 2022-12-01 11:24:33 -05:00
noot
eff12532e1 remove unused struct (#249) 2022-11-30 19:36:51 -05:00
noot
6a85b4a327 fix: don't re-advertise if we have no offers (#245) 2022-11-30 18:43:53 -05:00
noot
5072a7dd1f fix: add monero public spend key check when verifying DLEq proof (#246) 2022-11-30 16:09:04 -05: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
6cdffdbebf add go-dleq; remove all rust dependencies (#242) 2022-11-28 19:31:41 -05:00
noot
21c2f2a585 implement auto-recover for xmrtaker (#238) 2022-11-24 07:09:14 -05:00
Dmitry Holodov
fc6c94b3ea use standard wallet computation of the view key (#239)
* now uses standard wallet computation of the view key
* removed unused monero signing code
* added custom json handling for monero ed25519 scalar/point types
2022-11-23 10:28:32 -06:00
noot
cac8928e22 implement auto-recover for xmrmaker (#235) 2022-11-22 07:14:44 -05:00
noot
04cd5b4809 store swap recovery information in database, remove "infofile" (#227) 2022-11-19 10:52:15 -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
7e44d6e7b9 add FakeDLEq; add pure go + darwin build commands (#225) 2022-11-14 16:14:10 -05: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
517259375e check if the domain separator is registered before registering (#221)
Code now checks if the domain separator is registered before registering.
2022-11-07 13:14:59 -06: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
Dmitry Holodov
ec325f2cf7 add linting and formatting support for solidity (#217)
* Added new `format-solidity` and `lint-solidity` Makefile targets
* Updated documentation on how to install the new tools dependencies
* Formatted the solidity code, updated expected byte code and deployed stagenet contract
* Updated go.mod to go 1.19
* Updated Github actions for go 1.19 and we now use all formatters/linters in the actions checks
2022-11-01 23:01:59 -05:00
noot
7e253a7aa1 update stagenet bootnodes (#216) 2022-10-31 21:28:09 -04: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
Dmitry Holodov
5a0b10a9fe updated how we check the contract (#214)
* Moved the swap factory contract checking code to the `ethereum` folder. That package seemed like a better fit given that we already had utility functions in it that were not generated code.
* We track the indexes of the trusted forwarder address in the compiled byte code in exact 20 byte (address length) increments.
* `CheckSwapFactoryContractCode` verifies that the same trusted forwarder address exists at all expected locations and returns the parsed value from the deployed contract.
* Unit tests were added that explicitly help the developer update the expected contract code as well as the slice of trusted forwarder indexes.
2022-10-27 23:16:07 -05:00
noot
0bdb6f6f2a add relayer support for claim contract function (#204) 2022-10-26 23:39:20 -04:00