diff --git a/README.md b/README.md index 4ab15982..4554ff37 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 -``` \ No newline at end of file +``` + +# Audit + +# Bug Bounty \ No newline at end of file diff --git a/assets/uniswapx-architecture.png b/assets/uniswapx-architecture.png deleted file mode 100644 index a8dd6428..00000000 Binary files a/assets/uniswapx-architecture.png and /dev/null differ diff --git a/audit/v1.1/ABDK.pdf b/audit/v1.1/ABDK.pdf deleted file mode 100644 index 5d7b153d..00000000 Binary files a/audit/v1.1/ABDK.pdf and /dev/null differ diff --git a/audit/v1.1/OpenZeppelin.pdf b/audit/v1.1/OpenZeppelin.pdf deleted file mode 100644 index f725f212..00000000 Binary files a/audit/v1.1/OpenZeppelin.pdf and /dev/null differ diff --git a/audit/v1/ABDK.pdf b/audit/v1/ABDK.pdf deleted file mode 100644 index 35bc069f..00000000 Binary files a/audit/v1/ABDK.pdf and /dev/null differ diff --git a/package.json b/package.json index 92b2cf73..23dd6fa5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@uniswap/relayer", "version": "1.0.0", "repository": "git@github.com:Uniswap/relayer.git", - "author": "Eric Zhong ", + "author": "Uniswap", "license": "GPL-2.0-or-later", "files": [ "src/base",