From 06c9c5d6766ab31dd253bf5924fbe679e0a11967 Mon Sep 17 00:00:00 2001 From: Pierre Aoun Date: Wed, 15 Jan 2025 19:19:12 +0100 Subject: [PATCH] feat: add 1inch AggregationRouterV6 descriptor --- .../calldata-AggregationRouterV6-zksync.json | 13 ++ .../1inch/calldata-AggregationRouterV6.json | 51 +++++ .../1inch/common-AggregationRouterV6.json | 203 ++++++++++++++++++ 3 files changed, 267 insertions(+) create mode 100644 registry/1inch/calldata-AggregationRouterV6-zksync.json create mode 100644 registry/1inch/calldata-AggregationRouterV6.json create mode 100644 registry/1inch/common-AggregationRouterV6.json diff --git a/registry/1inch/calldata-AggregationRouterV6-zksync.json b/registry/1inch/calldata-AggregationRouterV6-zksync.json new file mode 100644 index 0000000..477205b --- /dev/null +++ b/registry/1inch/calldata-AggregationRouterV6-zksync.json @@ -0,0 +1,13 @@ +{ + "$schema": "../../specs/erc7730-v1.schema.json", + "includes": "common-AggregationRouterV6.json", + "context": { + "$id": "AggregationRouterV6", + "contract": { + "abi": "https://api.etherscan.io/v2/api?module=contract&action=getabi&chainid=324&address=0x111111125421cA6dc452d289314280a0f8842A65", + "deployments": [ + { "chainId": 324, "address": "0x6fd4383cB451173D5f9304F041C7BCBf27d561fF" } + ] + } + } +} diff --git a/registry/1inch/calldata-AggregationRouterV6.json b/registry/1inch/calldata-AggregationRouterV6.json new file mode 100644 index 0000000..08efb6c --- /dev/null +++ b/registry/1inch/calldata-AggregationRouterV6.json @@ -0,0 +1,51 @@ +{ + "$schema": "../../specs/erc7730-v1.schema.json", + "includes": "common-AggregationRouterV6.json", + "context": { + "$id": "AggregationRouterV6", + "contract": { + "abi": "https://api.etherscan.io/api?module=contract&action=getabi&address=0x111111125421cA6dc452d289314280a0f8842A65", + "deployments": [ + { "chainId": 1, "address": "0x111111125421cA6dc452d289314280a0f8842A65" }, + { "chainId": 10, "address": "0x111111125421cA6dc452d289314280a0f8842A65" }, + { "chainId": 56, "address": "0x111111125421cA6dc452d289314280a0f8842A65" }, + { "chainId": 100, "address": "0x111111125421cA6dc452d289314280a0f8842A65" }, + { "chainId": 137, "address": "0x111111125421cA6dc452d289314280a0f8842A65" }, + { "chainId": 250, "address": "0x111111125421cA6dc452d289314280a0f8842A65" }, + { "chainId": 8217, "address": "0x111111125421cA6dc452d289314280a0f8842A65" }, + { "chainId": 8453, "address": "0x111111125421cA6dc452d289314280a0f8842A65" }, + { "chainId": 42161, "address": "0x111111125421cA6dc452d289314280a0f8842A65" }, + { "chainId": 43114, "address": "0x111111125421cA6dc452d289314280a0f8842A65" }, + { "chainId": 1313161554, "address": "0x111111125421cA6dc452d289314280a0f8842A65" } + ] + } + }, + "display": { + "formats": { + "clipperSwap(address clipperExchange, uint256 srcToken, address dstToken, uint256 inputAmount, uint256 outputAmount, uint256 goodUntil, bytes32 r, bytes32 vs)": { + "$id": "clipperSwap", + "intent": "Swap", + "fields": [ + { "path": "inputAmount", "$ref": "$.display.definitions.sendAmount", "params": { "tokenPath": "srcToken.[-20:]" } }, + { "path": "outputAmount", "$ref": "$.display.definitions.minReceiveAmount", "params": { "tokenPath": "dstToken" } }, + { "path": "@.from", "$ref": "$.display.definitions.beneficiary" }, + { "path": "goodUntil", "$ref": "$.display.definitions.expirationTime" } + ], + "required": ["srcToken", "dstToken", "inputAmount", "outputAmount", "@.from", "goodUntil"], + "excluded": ["clipperExchange", "r", "vs"] + }, + "clipperSwapTo(address clipperExchange, address recipient, uint256 srcToken, address dstToken, uint256 inputAmount, uint256 outputAmount, uint256 goodUntil, bytes32 r, bytes32 vs)": { + "$id": "clipperSwapTo", + "intent": "Swap", + "fields": [ + { "path": "inputAmount", "$ref": "$.display.definitions.sendAmount", "params": { "tokenPath": "srcToken.[-20:]" } }, + { "path": "outputAmount", "$ref": "$.display.definitions.minReceiveAmount", "params": { "tokenPath": "dstToken" } }, + { "path": "recipient", "$ref": "$.display.definitions.beneficiary" }, + { "path": "goodUntil", "$ref": "$.display.definitions.expirationTime" } + ], + "required": ["srcToken", "dstToken", "inputAmount", "outputAmount", "recipient", "goodUntil"], + "excluded": ["clipperExchange", "r", "vs"] + } + } + } +} diff --git a/registry/1inch/common-AggregationRouterV6.json b/registry/1inch/common-AggregationRouterV6.json new file mode 100644 index 0000000..b902c11 --- /dev/null +++ b/registry/1inch/common-AggregationRouterV6.json @@ -0,0 +1,203 @@ +{ + "$schema": "../../specs/erc7730-v1.schema.json", + "metadata": { + "owner": "1inch", + "info": { "url": "https://1inch.io/", "legalName": "1inch Network", "lastUpdate": "2024-02-12T03:44:35Z" }, + "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" }, + "lastPool": { "label": "Last pool", "format": "addressName", "params": { "types": ["contract"] } }, + "expirationTime": { "label": "Expiration time", "format": "date", "params": { "encoding": "timestamp" } } + }, + "formats": { + "swap(address executor, (address srcToken, address dstToken, address srcReceiver, address dstReceiver, uint256 amount, uint256 minReturnAmount, uint256 flags) 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": ["executor", "desc.srcReceiver", "desc.flags", "data"] + }, + "unoswap(uint256 token, uint256 amount, uint256 minReturn, uint256 dex)": { + "$id": "unoswap", + "intent": "Swap", + "fields": [ + { "path": "amount", "$ref": "$.display.definitions.sendAmount", "params": { "tokenPath": "token.[-20:]" } }, + { "path": "minReturn", "$ref": "$.display.definitions.minReceiveAmount" }, + { "path": "@.from", "$ref": "$.display.definitions.beneficiary" }, + { "path": "dex.[-20:]", "$ref": "$.display.definitions.lastPool" } + ], + "required": ["amount", "minReturn", "@.from", "dex"] + }, + "unoswap2(uint256 token, uint256 amount, uint256 minReturn, uint256 dex, uint256 dex2)": { + "$id": "unoswap", + "intent": "Swap", + "fields": [ + { "path": "amount", "$ref": "$.display.definitions.sendAmount", "params": { "tokenPath": "token.[-20:]" } }, + { "path": "minReturn", "$ref": "$.display.definitions.minReceiveAmount" }, + { "path": "@.from", "$ref": "$.display.definitions.beneficiary" }, + { "path": "dex2.[-20:]", "$ref": "$.display.definitions.lastPool" } + ], + "required": ["amount", "minReturn", "@.from", "dex2"], + "excluded": ["dex"] + }, + "unoswap3(uint256 token, uint256 amount, uint256 minReturn, uint256 dex, uint256 dex2, uint256 dex3)": { + "$id": "unoswap", + "intent": "Swap", + "fields": [ + { "path": "amount", "$ref": "$.display.definitions.sendAmount", "params": { "tokenPath": "token.[-20:]" } }, + { "path": "minReturn", "$ref": "$.display.definitions.minReceiveAmount" }, + { "path": "@.from", "$ref": "$.display.definitions.beneficiary" }, + { "path": "dex3.[-20:]", "$ref": "$.display.definitions.lastPool" } + ], + "required": ["amount", "minReturn", "@.from", "dex3"], + "excluded": ["dex", "dex2"] + }, + "unoswapTo(uint256 to, uint256 token, uint256 amount, uint256 minReturn, uint256 dex)": { + "$id": "unoswapTo", + "intent": "Swap", + "fields": [ + { "path": "amount", "$ref": "$.display.definitions.sendAmount", "params": { "tokenPath": "token.[-20:]" } }, + { "path": "minReturn", "$ref": "$.display.definitions.minReceiveAmount" }, + { "path": "to.[-20:]", "$ref": "$.display.definitions.beneficiary" }, + { "path": "dex.[-20:]", "$ref": "$.display.definitions.lastPool" } + ], + "required": ["amount", "minReturn", "to", "dex"] + }, + "unoswapTo2(uint256 to, uint256 token, uint256 amount, uint256 minReturn, uint256 dex, uint256 dex2)": { + "$id": "unoswapTo", + "intent": "Swap", + "fields": [ + { "path": "amount", "$ref": "$.display.definitions.sendAmount", "params": { "tokenPath": "token.[-20:]" } }, + { "path": "minReturn", "$ref": "$.display.definitions.minReceiveAmount" }, + { "path": "to.[-20:]", "$ref": "$.display.definitions.beneficiary" }, + { "path": "dex2.[-20:]", "$ref": "$.display.definitions.lastPool" } + ], + "required": ["amount", "minReturn", "to", "dex2"], + "excluded": ["dex"] + }, + "unoswapTo3(uint256 to, uint256 token, uint256 amount, uint256 minReturn, uint256 dex, uint256 dex2, uint256 dex3)": { + "$id": "unoswapTo", + "intent": "Swap", + "fields": [ + { "path": "amount", "$ref": "$.display.definitions.sendAmount", "params": { "tokenPath": "token.[-20:]" } }, + { "path": "minReturn", "$ref": "$.display.definitions.minReceiveAmount" }, + { "path": "to.[-20:]", "$ref": "$.display.definitions.beneficiary" }, + { "path": "dex3.[-20:]", "$ref": "$.display.definitions.lastPool" } + ], + "required": ["amount", "minReturn", "to", "dex3"], + "excluded": ["dex", "dex2"] + }, + "ethUnoswap(uint256 minReturn, uint256 dex)" : { + "$id": "ethUnoswap", + "intent": "Swap", + "fields": [ + { "path": "@.value", "label": "Amount to Send", "format": "amount" }, + { "path": "minReturn.[-20:]", "$ref": "$.display.definitions.minReceiveAmount" }, + { "path": "@.from", "$ref": "$.display.definitions.beneficiary" }, + { "path": "dex.[-20:]", "$ref": "$.display.definitions.lastPool" } + ], + "required": ["minReturn", "@.value", "@.from", "dex"] + }, + "ethUnoswap2(uint256 minReturn, uint256 dex, uint256 dex2)" : { + "$id": "ethUnoswap", + "intent": "Swap", + "fields": [ + { "path": "@.value", "label": "Amount to Send", "format": "amount" }, + { "path": "minReturn.[-20:]", "$ref": "$.display.definitions.minReceiveAmount" }, + { "path": "@.from", "$ref": "$.display.definitions.beneficiary" }, + { "path": "dex2.[-20:]", "$ref": "$.display.definitions.lastPool" } + ], + "required": ["minReturn", "@.value", "@.from", "dex2"], + "excluded": ["dex"] + }, + "ethUnoswap3(uint256 minReturn, uint256 dex, uint256 dex2, uint256 dex3)" : { + "$id": "ethUnoswap", + "intent": "Swap", + "fields": [ + { "path": "@.value", "label": "Amount to Send", "format": "amount" }, + { "path": "minReturn.[-20:]", "$ref": "$.display.definitions.minReceiveAmount" }, + { "path": "@.from", "$ref": "$.display.definitions.beneficiary" }, + { "path": "dex3.[-20:]", "$ref": "$.display.definitions.lastPool" } + ], + "required": ["minReturn", "@.value", "@.from", "dex3"], + "excluded": ["dex", "dex2"] + }, + "ethUnoswapTo(uint256 to, uint256 minReturn, uint256 dex)" : { + "$id": "ethUnoswap", + "intent": "Swap", + "fields": [ + { "path": "@.value", "label": "Amount to Send", "format": "amount" }, + { "path": "minReturn.[-20:]", "$ref": "$.display.definitions.minReceiveAmount" }, + { "path": "to.[-20:]", "$ref": "$.display.definitions.beneficiary" }, + { "path": "dex.[-20:]", "$ref": "$.display.definitions.lastPool" } + ], + "required": ["minReturn", "to", "@.value", "dex"] + }, + "ethUnoswapTo2(uint256 to, uint256 minReturn, uint256 dex, uint256 dex2)" : { + "$id": "ethUnoswap", + "intent": "Swap", + "fields": [ + { "path": "@.value", "label": "Amount to Send", "format": "amount" }, + { "path": "minReturn.[-20:]", "$ref": "$.display.definitions.minReceiveAmount" }, + { "path": "to.[-20:]", "$ref": "$.display.definitions.beneficiary" }, + { "path": "dex2.[-20:]", "$ref": "$.display.definitions.lastPool" } + ], + "required": ["minReturn", "to", "@.value", "dex2"], + "excluded": ["dex"] + }, + "ethUnoswapTo3(uint256 to, uint256 minReturn, uint256 dex, uint256 dex2, uint256 dex3)" : { + "$id": "ethUnoswap", + "intent": "Swap", + "fields": [ + { "path": "@.value", "label": "Amount to Send", "format": "amount" }, + { "path": "minReturn.[-20:]", "$ref": "$.display.definitions.minReceiveAmount" }, + { "path": "to.[-20:]", "$ref": "$.display.definitions.beneficiary" }, + { "path": "dex3.[-20:]", "$ref": "$.display.definitions.lastPool" } + ], + "required": ["minReturn", "to", "@.value", "dex3"], + "excluded": ["dex", "dex2"] + }, + "cancelOrder(uint256 makerTraits, bytes32 orderHash)" : { + "$id": "cancelOrder", + "intent": "Cancel limit order", + "fields": [ + { "path": "orderHash", "label": "Order", "format": "raw" } + ], + "required": ["orderHash"], + "excluded": ["makerTraits"] + }, + "cancelOrders(uint256[] makerTraits, bytes32[] orderHashes)" : { + "$id": "cancelOrders", + "intent": "Cancel limit orders", + "fields": [ + { "path": "orderHashes.[]", "label": "Order", "format": "raw" } + ], + "required": ["orderHashes"], + "excluded": ["makerTraits"] + } + } + } +}