7 Commits

Author SHA1 Message Date
bezze
6cb2db190d Multi-hop swaps, leaner fees, better quoting, validation bugfixes (#94)
Co-authored-by: casiojapi <casiopilled@gmail.com>
2025-07-22 12:49:51 -03:00
Patrick Aljord
431fb1fd3d Revert broken changes (#93) 2025-07-17 17:00:04 +04:00
casiojapi
57a165cb36 feat: native extra gas support for ERC20 withdrawals (#80)
Co-authored-by: Francisco Bezzecchi <bezze@fatsolutions.xyz>
2025-07-16 03:39:08 -07:00
n8wb
cd09be1482 don't put config in dockerfile 2025-02-18 15:20:57 -08:00
Artem
022e4df79f bumped version, removed .npmrc from dockerfile 2025-02-19 00:36:43 +07:00
moebius
c0d80bcf6f chore: update relayer with sdk package (#82) 2025-02-14 10:52:03 +00:00
bezze
b6f58e6887 feat: relayer data checks and sdk integration (#58)
The core functionality of the feature takes place at
`packages/relayer/src/services/privacyPoolRelayer.service.ts` in the
`validateWithdrawal` function. There we check in order:
1. Decode Withdrawal.data and check feeReceiver ==
CONFIGURED_FEE_RECEIVER && feeBPS == CONFIGURED_FEE_BPS
2. Hash (Withdrawal || Scope) and check hash == Proof.context
3. Verify proof with SDK.verifyProof(Proof)
4. Call Entrypoint.scopeToPool() to get asset pool
5. Call Pool.ASSET() to get withdrawn asset
6. Check proof.withdrawnAmount() >=
CONFIGURED_MINIMUM_AMOUNT[withdrawn_asset]

If everything is ok, we call the Entrypoint.relay() with the user's
proof.

I've added examples for the config files `env.example`,
`withdraw_amount.example.json`. The first one are environment variables
to be defined in the server's environment. The second one contains a
mapping of the mimimum withdraw limits for the different supported
assets. There's an env var that should contain a path to this file.

Added a `Dockerfile` and a `docker-compose.yml` to the relayer to test
it or use it in dev flows. The circuit artifacts are loaded as volumes,
so before starting the docker-compose, you should run `yarn present`
from the circuits package dir to group all the artifacts and make them
easily accesible.

Additionally added a small package in
`/packages/relayer/test/integration/relay` that can be built and run to
test the relayer.
2025-02-05 14:24:29 +00:00