Skip to content

Commit

Permalink
Update readme (#92)
Browse files Browse the repository at this point in the history
* Add readme

* Update README.md

Co-authored-by: Sara Reynolds <30504811+snreynolds@users.noreply.github.com>

* Update README.md

Co-authored-by: Sara Reynolds <30504811+snreynolds@users.noreply.github.com>

* Update README.md

Co-authored-by: Sara Reynolds <30504811+snreynolds@users.noreply.github.com>

* feedback

* Remove old assets and audits

---------

Co-authored-by: Sara Reynolds <30504811+snreynolds@users.noreply.github.com>
  • Loading branch information
zhongeric and snreynolds authored Feb 19, 2024
1 parent 2165e6c commit 53081e7
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 3 deletions.
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
# WIP
# Relayer
Contracts that allow for the relaying of transactions to the UniversalRouter in exchange for ERC20 tokens. The contract ensures that UniversalRouter is called with the calldata encoded in the order and transfers tokens from the swapper to a specified recipient.

## RelayOrderReactor
The RelayOrderReactor is responsible for validating RelayOrders, transferring input tokens and making the requested onchain call to the Universal Router. There is no additional verification performed after an order is filled, so it is crucial to encode any desired checks for balance or ownership into the calldata within the order.

This contract does _not_ inherit the standard `IReactor` interface in UniswapX as the contract does not perform a callback to a filler. The following functions are available for fillers to call:

- `execute(SignedOrder calldata order, address feeRecipient)`
- `execute(SignedOrder calldata order)`
- `permit(ERC20 token, address owner, address spender, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s)`
- `multicall(bytes[] calldata data)`

Execute must be called with an order and its signature. Providing a feeRecipient argument is optional and if omitted, fees will be sent to the caller.

With multicall any combination of the calls above can be batched allowing callers to fill multiple orders in a single call, or actions like permit + execute.

## RelayOrder
Swappers generate Relay Orders to be submitted onchain. These orders have one static input, one dynamic fee, and calldata encoded for the UniversalRouter.

The Input in a RelayOrder is a static amount which is sent to a specific recipient signed by the swapper. For example, an Input could be sent to the UniversalRouter to perform a relayed swap.

The fee specified in a RelayOrder is sent directly to `feeRecipient` and can optionally increase in value linearly over the lifetime of the order. The actual amount transferred will be resolved at the time of filling.

# Integrating as a filler

# Deployment Addresses

# Usage

Expand All @@ -12,6 +38,19 @@ forge build
# run unit tests
forge test
# setup hardhat
yarn && yarn presymlink && yarn symlink
# generate calldata for integration tests
yarn test
# setup .env
cp .env.example .env
# run integration tests
FOUNDRY_PROFILE=integration forge test
```
```

# Audit

# Bug Bounty
Binary file removed assets/uniswapx-architecture.png
Binary file not shown.
Binary file removed audit/v1.1/ABDK.pdf
Binary file not shown.
Binary file removed audit/v1.1/OpenZeppelin.pdf
Binary file not shown.
Binary file removed audit/v1/ABDK.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@uniswap/relayer",
"version": "1.0.0",
"repository": "git@github.com:Uniswap/relayer.git",
"author": "Eric Zhong <eric.zhong@uniswap.org>",
"author": "Uniswap",
"license": "GPL-2.0-or-later",
"files": [
"src/base",
Expand Down

0 comments on commit 53081e7

Please sign in to comment.