Skip to content
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
9 changes: 9 additions & 0 deletions crates/yttrium/src/clear_signing/assets/address_book.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"eip155:1": {
"0xe592427a0aece92de3edee1f18e0157c05861564": "Uniswap V3 Router"
},
"eip155:10": {
"0x851116d9223fabed8e56c0e6b8ad0c31d98b3507": "Uniswap Universal Router",
"0x000000000022d473030f116ddee9f6b43ac78ba3": "Uniswap Permit2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"formats": {
"OrderStructure": {
"intent": "1inch Order",
"interpolatedIntent": "Send {makingAmount} for at least {takingAmount} to {receiver}",
"fields": [
{ "path": "maker", "label": "From", "format": "raw" },
{ "path": "makingAmount", "label": "Send", "format": "tokenAmount", "params": { "tokenPath": "makerAsset" } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"formats": {
"Order": {
"intent": "1inch Order",
"interpolatedIntent": "Send {makingAmount} for at least {takingAmount} to {receiver}",
"fields": [
{ "path": "maker", "label": "From", "format": "raw" },
{ "path": "makingAmount", "label": "Send", "format": "tokenAmount", "params": { "tokenPath": "makerAsset" } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"depositETH(address undefined, address onBehalfOf, uint16 referralCode)": {
"$id": "depositETH",
"intent": "Supply",
"interpolatedIntent": "Supply {@.value} for {onBehalfOf}",
"fields": [
{ "path": "@.value", "format": "amount", "label": "Amount to supply" },
{
Expand All @@ -42,6 +43,7 @@
"repayETH(address undefined, uint256 amount, address onBehalfOf)": {
"$id": "repayETH",
"intent": "Repay loan",
"interpolatedIntent": "Repay {amount} for {onBehalfOf}",
"fields": [
{ "path": "amount", "format": "amount", "label": "Amount to repay" },
{
Expand All @@ -57,6 +59,7 @@
"withdrawETH(address undefined, uint256 amount, address to)": {
"$id": "withdrawETH",
"intent": "Withdraw",
"interpolatedIntent": "Withdraw {amount} to {to}",
"fields": [
{ "path": "amount", "format": "amount", "label": "Amount to withdraw" },
{
Expand All @@ -72,6 +75,7 @@
"withdrawETHWithPermit(address undefined, uint256 amount, address to, uint256 deadline, uint8 permitV, bytes32 permitR, bytes32 permitS)": {
"$id": "withdrawETHWithPermit",
"intent": "Withdraw",
"interpolatedIntent": "Withdraw {amount} to {to}",
"fields": [
{ "path": "amount", "format": "amount", "label": "Amount to withdraw" },
{
Expand All @@ -87,6 +91,7 @@
"borrowETH(address undefined, uint256 amount, uint16 referralCode)": {
"$id": "borrowETH",
"intent": "Borrow",
"interpolatedIntent": "Borrow {amount} as {@.from}",
"fields": [
{ "path": "amount", "format": "amount", "label": "Amount to borrow" },
{ "path": "@.from", "format": "addressName", "label": "Debtor", "params": { "types": ["eoa"], "sources": ["local", "ens"] } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"repay(address,uint256,uint256,address)": {
"$id": "repay",
"intent": "Repay loan",
"interpolatedIntent": "Repay {amount} for {onBehalfOf} with {rateMode} rate",
"fields": [
{
"path": "amount",
Expand All @@ -73,6 +74,7 @@
},
"setUserUseReserveAsCollateral(address,bool)": {
"intent": "Manage collateral",
"interpolatedIntent": "Set collateral usage for {asset} to {useAsCollateral}",
"fields": [
{
"path": "asset",
Expand All @@ -86,6 +88,7 @@
},
"withdraw(address,uint256,address)": {
"intent": "Withdraw",
"interpolatedIntent": "Withdraw {amount} to {to}",
"fields": [
{
"path": "amount",
Expand All @@ -104,6 +107,7 @@
},
"swapBorrowRateMode(address,uint256)": {
"intent": "Swap interest rate mode",
"interpolatedIntent": "Set {asset} borrow rate mode to {rateMode}",
"fields": [
{
"path": "asset",
Expand All @@ -122,6 +126,7 @@
},
"borrow(address,uint256,uint256,uint16,address)": {
"intent": "Borrow",
"interpolatedIntent": "Borrow {amount} for {onBehalfOf} with {interestRateMode} rate",
"fields": [
{ "path": "amount", "format": "tokenAmount", "label": "Amount to borrow", "params": { "tokenPath": "asset" } },
{
Expand All @@ -142,6 +147,7 @@
"deposit(address,uint256,address,uint16)": {
"$id": "deposit",
"intent": "Supply",
"interpolatedIntent": "Supply {amount} for {onBehalfOf}",
"fields": [
{ "path": "amount", "format": "tokenAmount", "label": "Amount to supply", "params": { "tokenPath": "asset" } },
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"repay(address asset, uint256 amount, uint256 interestRateMode, address onBehalfOf)": {
"$id": "repay",
"intent": "Repay loan",
"interpolatedIntent": "Repay {amount} for {onBehalfOf} with {interestRateMode} rate",
"fields": [
{
"path": "amount",
Expand Down Expand Up @@ -136,6 +137,7 @@
"repayWithPermit(address asset, uint256 amount, uint256 interestRateMode, address onBehalfOf, uint256 deadline, uint8 permitV, bytes32 permitR, bytes32 permitS)": {
"$id": "repayWithPermit",
"intent": "Repay loan",
"interpolatedIntent": "Repay {amount} for {onBehalfOf} with {interestRateMode} rate",
"fields": [
{
"path": "amount",
Expand Down Expand Up @@ -184,6 +186,7 @@
},
"setUserUseReserveAsCollateral(address asset, bool useAsCollateral)": {
"intent": "Manage collateral",
"interpolatedIntent": "Set collateral usage for {asset} to {useAsCollateral}",
"fields": [
{
"path": "asset",
Expand Down Expand Up @@ -212,6 +215,7 @@
},
"withdraw(address asset, uint256 amount, address to)": {
"intent": "Withdraw",
"interpolatedIntent": "Withdraw {amount} to {to}",
"fields": [
{
"path": "amount",
Expand Down Expand Up @@ -245,6 +249,7 @@
},
"borrow(address asset, uint256 amount, uint256 interestRateMode, uint16 referralCode, address onBehalfOf)": {
"intent": "Borrow",
"interpolatedIntent": "Borrow {amount} for {onBehalfOf} with {interestRateMode} rate",
"fields": [
{
"path": "amount",
Expand Down Expand Up @@ -289,6 +294,7 @@
"deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode)": {
"$id": "deposit",
"intent": "Supply",
"interpolatedIntent": "Supply {amount} for {onBehalfOf}",
"fields": [
{
"path": "amount",
Expand Down Expand Up @@ -324,6 +330,7 @@
"supply(address asset, uint256 amount, address onBehalfOf, uint16 referralCode)": {
"$id": "supply",
"intent": "Supply",
"interpolatedIntent": "Supply {amount} for {onBehalfOf}",
"fields": [
{
"path": "amount",
Expand Down Expand Up @@ -359,6 +366,7 @@
"supplyWithPermit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode, uint256 deadline, uint8 permitV, bytes32 permitR, bytes32 permitS)": {
"$id": "supplyWithPermit",
"intent": "Supply",
"interpolatedIntent": "Supply {amount} for {onBehalfOf}",
"fields": [
{
"path": "amount",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"formats": {
"setAmount(uint256)": {
"intent": "Set router amount",
"interpolatedIntent": "Set router amount to {amount}",
"fields": [
{
"path": "amount",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"deployments": [
{ "chainId": 1, "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" },
{ "chainId": 10, "address": "0x7F5c764cBc14f9669B88837CA1490cCa17C31607" },
{ "chainId": 10, "address": "0x0b2c639c533813f4aa9d7837caf62653d097ff85" },
{ "chainId": 42161, "address": "0xaf88d065e77c8cc2239327c5edb3a432268e5831" },
{ "chainId": 8453, "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bDa02913" }
]
Expand All @@ -24,6 +25,7 @@
"formats": {
"approve(address,uint256)": {
"intent": "Approve USDC spending",
"interpolatedIntent": "Approve {spender} to spend {value}",
"fields": [
{
"path": "spender",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"formats": {
"approve(address,uint256)": {
"intent": "Approve USDT spending",
"interpolatedIntent": "Approve {spender} to spend {value}",
"fields": [
{
"path": "spender",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"$schema": "../../specs/erc7730-v1.schema.json",
"includes": "uniswap-common-eip712.json",
"context": {
"eip712": {
"schemas": [
{
"types": {
"EIP712Domain": [
{ "name": "name", "type": "string" },
{ "name": "chainId", "type": "uint256" },
{ "name": "verifyingContract", "type": "address" }
],
"PermitDetails": [
{ "name": "token", "type": "address" },
{ "name": "amount", "type": "uint160" },
{ "name": "expiration", "type": "uint48" },
{ "name": "nonce", "type": "uint48" }
],
"PermitBatch": [
{ "name": "details", "type": "PermitDetails[]" },
{ "name": "spender", "type": "address" },
{ "name": "sigDeadline", "type": "uint256" }
]
},
"primaryType": "PermitBatch"
},
{
"types": {
"EIP712Domain": [
{ "name": "name", "type": "string" },
{ "name": "chainId", "type": "uint256" },
{ "name": "verifyingContract", "type": "address" }
],
"PermitDetails": [
{ "name": "token", "type": "address" },
{ "name": "amount", "type": "uint160" },
{ "name": "expiration", "type": "uint48" },
{ "name": "nonce", "type": "uint48" }
],
"PermitSingle": [
{ "name": "details", "type": "PermitDetails" },
{ "name": "spender", "type": "address" },
{ "name": "sigDeadline", "type": "uint256" }
]
},
"primaryType": "PermitSingle"
}
]
}
},
"display": {
"formats": {
"PermitSingle": {
"$id": "Permit2 Permit Single",
"intent": "Authorize spending of token",
"interpolatedIntent": "Authorize {spender} to spend {details.amount} until {sigDeadline}",
"fields": [
{ "path": "spender", "label": "Spender", "format": "addressName" },
{
"path": "details.amount",
"label": "Amount allowance",
"format": "tokenAmount",
"params": {
"tokenPath": "details.token",
"threshold": "$.metadata.constants.maxPermitAmount",
"message": "Unlimited"
}
},
{ "path": "details.expiration", "label": "Approval expires", "format": "date", "params": { "encoding": "timestamp" } },
{ "path": "sigDeadline", "label": "Signature deadline", "format": "date", "params": { "encoding": "timestamp" } }
],
"required": ["spender", "details.amount"],
"excluded": [],
"screens": {}
},
"PermitBatch": {
"$id": "Permit2 Permit Batch",
"intent": "Authorize spending of tokens",
"interpolatedIntent": "Authorize {spender} to spend multiple tokens until {sigDeadline}",
"fields": [
{ "path": "spender", "label": "Spender", "format": "addressName" },
{
"path": "details.[]",
"fields": [
{
"path": "amount",
"label": "Amount allowance",
"format": "tokenAmount",
"params": {
"tokenPath": "token",
"threshold": "$.metadata.constants.maxPermitAmount",
"message": "Unlimited"
}
},
{ "path": "expiration", "label": "Approval expires", "format": "date", "params": { "encoding": "timestamp" } }
]
},
{
"path": "sigDeadline",
"label": "Signature deadline",
"format": "date",
"params": { "encoding": "timestamp" }
}
],
"required": ["spender", "details"],
"excluded": [],
"screens": {}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "../../specs/erc7730-v1.schema.json",
"context": {
"eip712": {
"domain": { "name": "Permit2" },
"deployments": [
{ "chainId": 1, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" },
{ "chainId": 10, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" },
{ "chainId": 56, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" },
{ "chainId": 137, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" },
{ "chainId": 8453, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" },
{ "chainId": 42161, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" },
{ "chainId": 42220, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" },
{ "chainId": 43114, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" },
{ "chainId": 80001, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" },
{ "chainId": 81457, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" },
{ "chainId": 84532, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" },
{ "chainId": 421614, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" },
{ "chainId": 11155111, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" },
{ "chainId": 11155420, "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3" }
]
}
},
"metadata": {
"owner": "Uniswap",
"info": {
"legalName": "Uniswap Labs",
"deploymentDate": "2021-12-14T00:00:00Z",
"url": "https://uniswap.org/"
},
"constants": {
"maxPermitAmount": "0xffffffffffffffffffffffffffffffffffffffff"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"formats": {
"exactInputSingle((address,address,uint24,address,uint256,uint256,uint160))": {
"intent": "Swap tokens",
"interpolatedIntent": "Swap {params.amountIn} for at least {params.amountOutMinimum} to {params.recipient}",
"fields": [
{
"path": "params.amountIn",
Expand Down
Loading
Loading