Commit Graph

25 Commits

Author SHA1 Message Date
Dmitry Holodov
8941163c00 USDT compatibility (#484) 2023-06-17 04:30:20 -05: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
noot
9cc39e84da solc optimize contract bytecode (#414) 2023-04-25 08:02:56 -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
a17f95d414 SwapFactory to SwapCreator rename, upgrade to solc 0.8.19 (#372) 2023-04-09 03:08: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
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
noot
87357180f5 remove hardhat dependency from ethereum/ dir (#196) 2022-10-03 18:13:38 -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
007162b929 New bash library, and well as bash linting and formatting (#170)
* Allows unit and integration tests to share the same bash code via a utility library named testlib.sh.
* Linting and formatting of bash scripts was added to the Makefile targets lint and format.
* Updated the docker image and Go used by git actions
2022-08-25 13:24:13 -05:00
Dmitry Holodov
36bfb03831 Update go ethereum (#149)
* Updated go-ethereum dep to 1.10.21
* Code now installs/uses an abigen that automatically matches the version of our go-ethereum in the go.mod
* solc was updated to 0.8.16 (in the docs, we don't install it, but anyone wanting to generate identical output needs it).
* Minimum go version is now 1.18
* golangci-lint updated to v1.48.0 (was needed to play nicely with go 1.18 and the new generated code)
* dleq/cgo-dleq submodule updated to latest version
2022-08-11 13:52:47 -05:00
Dmitry Holodov
b729588dd5 update to current version of ganache (#138)
Updates the repo to install the latest version of ganache (ganache-cli is obsolete). 

One of the things that changed in the newer version of Ganache, is gas fee estimation uses the timestamp from the last mined block instead of the local computer's current timestamp. This mirrors what Geth does, so the Ganache change is helpful, but it caused a few problems that this PR fixes.

If we want to do dynamic fee estimation for a transaction that can not happen before time T0 or T1, we need to wait until there is one mined block after T0 or T1 to create our transaction. Otherwise the transaction will be reverted during fee estimation, returning an error when creating the transaction, and we'll never send the transaction out to the network.

Ganache, by default, only mines blocks when you create a transaction. In order to have a mined block after T0 or T1 to calculate transaction fees, we stopped using instamine, and now mine a block every second. This PR chose the minimum block interval for speedier tests.

Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2022-08-06 22:30:45 -05:00
Matthew Di Ferrante
961ceea463 Optimize gas usage through less reads (#122)
* rework contracts to use less gas by storing just swap hash when creating a swap

* prevent overriding of existing swaps

* ensure swap exists when trying to refund

* update bindings script and go contract bindings

* update swapfactory go tests

* updating protocol, compiles

* update recoverer, everything builds

* fix cmd/recover tests

* fix recover tests

* lint

* fix checkContractCode

* fix protocol/ tests

* inherit secp256k1 instead of using library to prevent double deployment

* rerun abigen and hardcode runtime bin for now

* add nolint to long hardcoded runtime bin line

* cleanup commented out stuff

Co-authored-by: noot <elizabethjbinks@gmail.com>
2022-05-28 22:36:01 +02:00
noot
d62765a1ff implement SwapFactory.sol and integrate into codebase (#85) 2022-01-26 19:27: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
e9057490f9 add ci checks for build, test, lint; lint code; change filenames to be go-idiomatic (#12) 2021-10-25 18:20:14 -04:00
Robert Hambrock
8a547bd901 Merge branch 'onchain-rename' into secp256k1_solidity 2021-10-24 15:58:25 +02:00
Robert Hambrock
3bf04202d3 rename Swap->SwapOnChain 2021-10-24 15:49:10 +02:00
Robert Hambrock
0b77e6fcd3 finish renaming 2021-10-24 15:33:46 +02:00
Robert Hambrock
e96b4b190d rename Swap->SwapDLEQ 2021-10-24 15:26:48 +02:00
Robert Hambrock
10e0110f12 update readme and remove concrete SOLC_BIN binding 2021-10-23 21:29:44 +02:00
Marcin Górny
a59e975d3a Fix generate bindings script after directory rename 2021-10-23 17:28:16 +02:00
Marcin Górny
00ee458fa3 Fix the compilation of go tests 2021-10-23 15:03:29 +02:00
noot
741be865a5 add monero package, able to generate monero keys 2021-10-22 16:53:42 -04:00