Skip to content

Commit

Permalink
Merge branch 'master' into update-spec-eip712-schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
fsamier authored Nov 7, 2024
2 parents bd389a5 + 5f4bed3 commit d5a981c
Show file tree
Hide file tree
Showing 6 changed files with 995 additions and 0 deletions.
132 changes: 132 additions & 0 deletions registry/1inch/calldata-AggregationRouterV3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"$schema": "../../specs/erc7730-v1.schema.json",

"context": {
"$id": "AggregationRouterV3",
"contract": {
"abi": "https://api.etherscan.io/api?module=contract&action=getabi&address=0x11111112542d85b3ef69ae05771c2dccff4faa26",
"deployments": [
{
"chainId": 1,
"address": "0x11111112542D85B3EF69AE05771c2dCCff4fAa26"
},
{
"chainId": 56,
"address": "0x11111112542D85B3EF69AE05771c2dCCff4fAa26"
},
{
"chainId": 137,
"address": "0x11111112542D85B3EF69AE05771c2dCCff4fAa26"
}
]
}
},

"metadata": {
"owner": "1inch",
"info": {
"url": "https://1inch.io/",
"legalName": "1inch Network",
"lastUpdate": "2021-03-14T20:28:50Z"
},
"constants": {
"addressAsEth": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"addressAsNull": "0x0000000000000000000000000000000000000000"
}
},

"display": {
"definitions": {
"sendAmount": {
"label": "Amount to Send",
"format": "tokenAmount",
"params": {
"nativeCurrencyAddress": [
"$.metadata.constants.addressAsEth",
"$.metadata.constants.addressAsNull"
]
}
},
"minReceiveAmount": {
"label": "Minimum to Receive",
"format": "tokenAmount",
"params": {
"nativeCurrencyAddress": [
"$.metadata.constants.addressAsEth",
"$.metadata.constants.addressAsNull"
]
}
},
"beneficiary": {
"label": "Beneficiary",
"format": "addressName"
}
},
"formats": {
"swap(address caller, (address srcToken, address dstToken, address srcReceiver, address dstReceiver, uint256 amount, uint256 minReturnAmount, uint256 flags, bytes permit) desc, bytes data)" : {
"$id": "swap",
"intent": "Swap",
"fields": [
{
"path": "desc.amount",
"$ref": "$.display.definitions.sendAmount",
"params": { "tokenPath": "desc.srcToken" }
},
{
"path": "desc.minReturnAmount",
"$ref": "$.display.definitions.minReceiveAmount",
"params": { "tokenPath": "desc.dstToken" }
},
{
"path": "desc.dstReceiver",
"$ref": "$.display.definitions.beneficiary"
}
],
"required": ["desc.amount", "desc.minReturnAmount", "desc.dstReceiver"],
"excluded": ["caller", "desc.srcReceiver", "desc.flags", "desc.permit", "data"]
},
"unoswap(address srcToken, uint256 amount, uint256 minReturn, bytes32[] pools)" : {
"$id": "unoswap",
"intent": "Swap",
"fields": [
{
"path": "amount",
"$ref": "$.display.definitions.sendAmount",
"params": { "tokenPath": "srcToken" }
},
{
"path": "minReturn",
"$ref": "$.display.definitions.minReceiveAmount"
},
{
"path": "@.from",
"$ref": "$.display.definitions.beneficiary"
}
],
"required": ["amount", "minReturn", "@.from"],
"excluded": ["pools"]
},
"unoswapWithPermit(address srcToken, uint256 amount, uint256 minReturn, bytes32[] pools, bytes permit)" : {
"$id": "unoswapWithPermit",
"intent": "Swap",
"fields": [
{
"path": "amount",
"$ref": "$.display.definitions.sendAmount",
"params": { "tokenPath": "srcToken" }
},
{
"path": "minReturn",
"$ref": "$.display.definitions.minReceiveAmount"
},
{
"path": "@.from",
"$ref": "$.display.definitions.beneficiary"
}
],
"required": ["amount", "minReturn", "@.from"],
"excluded": ["pools", "permit"]
}
}
}
}
86 changes: 86 additions & 0 deletions registry/1inch/calldata-AggregationRouterV4-eth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"$schema": "../../specs/erc7730-v1.schema.json",
"includes": "common-AggregationRouterV4.json",

"context": {
"$id": "AggregationRouterV4",
"contract": {
"abi": "https://api.etherscan.io/api?module=contract&action=getabi&address=0x1111111254fb6c44bac0bed2854e76f90643097d",
"deployments": [
{
"chainId": 1,
"address": "0x1111111254fb6c44bAC0beD2854e76F90643097d"
}
]
}
},

"display": {
"formats": {
"clipperSwap(address srcToken, address dstToken, uint256 amount, uint256 minReturn)" : {
"$id": "clipperSwap",
"intent": "Swap",
"fields": [
{
"path": "amount",
"$ref": "$.display.definitions.sendAmount",
"params": { "tokenPath": "srcToken" }
},
{
"path": "minReturn",
"$ref": "$.display.definitions.minReceiveAmount",
"params": { "tokenPath": "dstToken" }
},
{
"path": "@.from",
"$ref": "$.display.definitions.beneficiary"
}
],
"required": ["amount", "minReturn", "@.from"]
},
"clipperSwapTo(address recipient, address srcToken, address dstToken, uint256 amount, uint256 minReturn)" : {
"$id": "clipperSwapTo",
"intent": "Swap",
"fields": [
{
"path": "amount",
"$ref": "$.display.definitions.sendAmount",
"params": { "tokenPath": "srcToken" }
},
{
"path": "minReturn",
"$ref": "$.display.definitions.minReceiveAmount",
"params": { "tokenPath": "dstToken" }
},
{
"path": "recipient",
"$ref": "$.display.definitions.beneficiary"
}
],
"required": ["amount", "minReturn", "recipient"]
},
"clipperSwapToWithPermit(address recipient, address srcToken, address dstToken, uint256 amount, uint256 minReturn, bytes permit)" : {
"$id": "clipperSwapToWithPermit",
"intent": "Swap",
"fields": [
{
"path": "amount",
"$ref": "$.display.definitions.sendAmount",
"params": { "tokenPath": "srcToken" }
},
{
"path": "minReturn",
"$ref": "$.display.definitions.minReceiveAmount",
"params": { "tokenPath": "dstToken" }
},
{
"path": "recipient",
"$ref": "$.display.definitions.beneficiary"
}
],
"required": ["amount", "minReturn", "recipient"],
"excluded": ["permit"]
}
}
}
}
21 changes: 21 additions & 0 deletions registry/1inch/calldata-AggregationRouterV4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "../../specs/erc7730-v1.schema.json",
"includes": "common-AggregationRouterV4.json",

"context": {
"$id": "AggregationRouterV4",
"contract": {
"abi": "https://api.etherscan.io/v2/api?module=contract&action=getabi&chainid=56&address=0x1111111254fb6c44bac0bed2854e76f90643097d",
"deployments": [
{
"chainId": 56,
"address": "0x1111111254fb6c44bAC0beD2854e76F90643097d"
},
{
"chainId": 137,
"address": "0x1111111254fb6c44bAC0beD2854e76F90643097d"
}
]
}
}
}
Loading

0 comments on commit d5a981c

Please sign in to comment.