Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme #92

Merged
merged 6 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
zhongeric marked this conversation as resolved.
Show resolved Hide resolved
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
Loading