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

feat: BACK-8066 One deployment per chain + exhaustive list of selectors #99

Merged
merged 2 commits into from
Dec 2, 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
118 changes: 118 additions & 0 deletions registry/paraswap/calldata-AugustusSwapper-v4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{

Check warning on line 1 in registry/paraswap/calldata-AugustusSwapper-v4.json

View workflow job for this annotation

GitHub Actions / 🔎 validate descriptors

Missing Display field

No display field is defined for path `#.callees.[]` in function 0xa27e8b6b. If intentionally excluded, please add it to `excluded` list to avoid this warning.

Check warning on line 1 in registry/paraswap/calldata-AugustusSwapper-v4.json

View workflow job for this annotation

GitHub Actions / 🔎 validate descriptors

Missing Display field

No display field is defined for path `#.callees.[]` in function 0xcfc0afeb. If intentionally excluded, please add it to `excluded` list to avoid this warning.

Check warning on line 1 in registry/paraswap/calldata-AugustusSwapper-v4.json

View workflow job for this annotation

GitHub Actions / 🔎 validate descriptors

Missing Display field

No display field is defined for path `#.data.path.[].fromAmountPercent` in function 0xec1d21dd. If intentionally excluded, please add it to `excluded` list to avoid this warning.

Check warning on line 1 in registry/paraswap/calldata-AugustusSwapper-v4.json

View workflow job for this annotation

GitHub Actions / 🔎 validate descriptors

Missing Display field

No display field is defined for path `#.data.path.[].path.[].routes.[].exchange` in function 0xec1d21dd. If intentionally excluded, please add it to `excluded` list to avoid this warning.

Check warning on line 1 in registry/paraswap/calldata-AugustusSwapper-v4.json

View workflow job for this annotation

GitHub Actions / 🔎 validate descriptors

Missing Display field

No display field is defined for path `#.data.path.[].path.[].routes.[].networkFee` in function 0xec1d21dd. If intentionally excluded, please add it to `excluded` list to avoid this warning.

Check warning on line 1 in registry/paraswap/calldata-AugustusSwapper-v4.json

View workflow job for this annotation

GitHub Actions / 🔎 validate descriptors

Missing Display field

No display field is defined for path `#.data.path.[].path.[].routes.[].payload.[]` in function 0xec1d21dd. If intentionally excluded, please add it to `excluded` list to avoid this warning.

Check warning on line 1 in registry/paraswap/calldata-AugustusSwapper-v4.json

View workflow job for this annotation

GitHub Actions / 🔎 validate descriptors

Missing Display field

No display field is defined for path `#.data.path.[].path.[].routes.[].payload` in function 0xec1d21dd. If intentionally excluded, please add it to `excluded` list to avoid this warning.

Check warning on line 1 in registry/paraswap/calldata-AugustusSwapper-v4.json

View workflow job for this annotation

GitHub Actions / 🔎 validate descriptors

Missing Display field

No display field is defined for path `#.data.path.[].path.[].routes.[].percent` in function 0xec1d21dd. If intentionally excluded, please add it to `excluded` list to avoid this warning.

Check warning on line 1 in registry/paraswap/calldata-AugustusSwapper-v4.json

View workflow job for this annotation

GitHub Actions / 🔎 validate descriptors

Missing Display field

No display field is defined for path `#.data.path.[].path.[].routes.[].targetExchange` in function 0xec1d21dd. If intentionally excluded, please add it to `excluded` list to avoid this warning.

Check warning on line 1 in registry/paraswap/calldata-AugustusSwapper-v4.json

View workflow job for this annotation

GitHub Actions / 🔎 validate descriptors

Missing Display field

No display field is defined for path `#.data.path.[].path.[].routes.[]` in function 0xec1d21dd. If intentionally excluded, please add it to `excluded` list to avoid this warning.
fsamier marked this conversation as resolved.
Show resolved Hide resolved
"context": {
"$id": "AugustusSwapper",
"contract": {
"abi": "https://github.com/LedgerHQ/ledger-asset-dapps/blob/main/ethereum/paraswap/abis/0x1bd435f3c054b6e901b7b108a0ab7617c808677b.abi.json",
"deployments": [
{ "chainId": 1, "address": "0x1bd435f3c054b6e901b7b108a0ab7617c808677b" }
]
}
},
"metadata": { "owner": "Paraswap" },
"display": {
"definitions": {
"amountIn": { "label": "Income Amount", "format": "amount" },
"amountOut": { "label": "Outcome Amount", "format": "amount" },
"amountInMax": { "label": "Maximum Income Amount", "format": "amount" },
"factory": { "label": "Factory", "format": "addressName", "params": { "types": ["contract"] } },
"amountOutMin": { "label": "Minimum Outcome Amount", "format": "amount" },
"expectedAmount": { "label": "Expected Amount", "format": "amount" },
"fromToken": { "format": "addressName", "label": "Origin Token", "params": { "types": ["token"] } },
"toToken": { "format": "addressName", "label": "Destination Token", "params": { "types": ["token"] } },
"fromAmount": { "format": "tokenAmount", "label": "Income Amount", "params": { "tokenPath": "fromToken" } },
"toAmount": { "format": "tokenAmount", "label": "Outcome Amount", "params": { "tokenPath": "toToken" } },
"beneficiary": { "format": "addressName", "label": "Beneficiary address", "params": { "types": ["eoa"] } }
},
"formats": {
"0x58b9d179": {
"$id": "swapOnUniswap",
"fields": [
{ "path": "amountIn", "$ref": "$.display.definitions.amountIn" },
{ "path": "amountOutMin", "$ref": "$.display.definitions.amountOutMin" },
{ "path": "path.[]", "label": "Assets paths", "format": "addressName", "params": { "types": ["token"] } }
],
"required": ["amountIn", "amountOutMin", "path"]
},
"0x0863b7ac": {
"$id": "swapOnUniswapFork",
"fields": [
{ "path": "amountIn", "$ref": "$.display.definitions.amountIn" },
{ "path": "amountOutMin", "$ref": "$.display.definitions.amountOutMin" },
{ "path": "path.[]", "label": "Assets paths", "format": "addressName", "params": { "types": ["token"] } }
],
"required": ["amountIn", "amountOutMin", "path"]
},
"0xf9355f72": {
"$id": "buyOnUniswap",
"fields": [
{ "path": "amountOut", "$ref": "$.display.definitions.amountOut" },
{ "path": "amountInMax", "$ref": "$.display.definitions.amountInMax" },
{ "path": "path.[]", "label": "Assets paths", "format": "addressName", "params": { "types": ["token"] } }
],
"required": ["amountOut", "amountInMax", "path"]
},
"0x33635226": {
"$id": "buyOnUniswapFork",
"fields": [
{ "path": "amountOut", "$ref": "$.display.definitions.amountOut" },
{ "path": "amountInMax", "$ref": "$.display.definitions.amountInMax" },
{ "path": "path.[]", "label": "Assets paths", "format": "addressName", "params": { "types": ["token"] } }
],
"required": ["factory", "initCode", "amountOut", "amountInMax", "path"]
},
"0x8f00eccb": {
"$id": "multiSwap",
"fields": [
{ "path": "data.fromAmount", "$ref": "$.display.definitions.fromAmount", "params": { "tokenPath": "data.fromToken" } },
{ "path": "data.expectedAmount", "$ref": "$.display.definitions.expectedAmount" },
{ "path": "data.beneficiary", "$ref": "$.display.definitions.beneficiary" },
{ "path": "data.path.[]", "label": "Assets paths", "format": "addressName", "params": { "types": ["token"] } }
],
"required": ["data.fromAmount", "data.expectedAmount", "data.beneficiary", "data.path"]
},
"0xa27e8b6b": {
"$id": "simpleBuy",
"fields": [
{ "path": "fromToken", "$ref": "$.display.definitions.fromToken" },
{ "path": "toToken", "$ref": "$.display.definitions.toToken" },
{ "path": "fromAmount", "$ref": "$.display.definitions.fromAmount" },
{ "path": "toAmount", "$ref": "$.display.definitions.toAmount" },
{ "path": "beneficiary", "$ref": "$.display.definitions.beneficiary" }
],
"required": ["fromToken", "fromAmount", "toAmount", "beneficiary"]
},
"0xcfc0afeb": {
"$id": "simpleSwap",
"fields": [
{ "path": "fromToken", "$ref": "$.display.definitions.fromToken" },
{ "path": "toToken", "$ref": "$.display.definitions.toToken" },
{ "path": "fromAmount", "$ref": "$.display.definitions.fromAmount" },
{ "path": "toAmount", "$ref": "$.display.definitions.toAmount" },
{ "path": "beneficiary", "$ref": "$.display.definitions.beneficiary" }
],
"required": ["fromToken", "fromAmount", "toAmount", "beneficiary"]
},
"0xec1d21dd": {
"$id": "megaSwap",
"fields": [
{ "path": "data.fromToken", "$ref": "$.display.definitions.fromToken" },
{ "path": "data.fromAmount", "$ref": "$.display.definitions.fromAmount", "params": { "tokenPath": "data.fromToken" } },
{ "path": "data.expectedAmount", "$ref": "$.display.definitions.expectedAmount" },
{ "path": "data.beneficiary", "$ref": "$.display.definitions.beneficiary" },
{ "path": "data.path.[]", "label": "Assets paths", "format": "addressName", "params": { "types": ["token"] } }
],
"required": ["data.fromToken", "data.fromAmount", "data.beneficiary", "data.path", "data.expectedAmount"]
},
"0xf95a49eb": {
"$id": "buy",
"fields": [
{ "path": "data.fromToken", "$ref": "$.display.definitions.fromToken"},
{ "path": "data.toToken", "$ref": "$.display.definitions.toToken" },
{ "path": "data.fromAmount", "$ref": "$.display.definitions.fromAmount", "params": { "tokenPath": "data.fromToken" } },
{ "path": "data.toAmount", "$ref": "$.display.definitions.toAmount", "params": { "tokenPath": "data.toToken" } },
{ "path": "data.beneficiary", "$ref": "$.display.definitions.beneficiary" } ],
"required": ["data.fromToken", "data.toToken", "data.fromAmount", "data.toAmount", "data.beneficiary"]
}
}
}
}
86 changes: 68 additions & 18 deletions registry/paraswap/calldata-AugustusSwapper-v5.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{

Check notice on line 1 in registry/paraswap/calldata-AugustusSwapper-v5.json

View workflow job for this annotation

GitHub Actions / 🔎 validate descriptors

Proxy contract

Contract https://bscscan.com/address/0xdef171fe48cf0115b1d80b88dc8eab59176fee57#code is likely to be a proxy, validation of descriptor ABIs skipped
"context": {
"$id": "AugustusSwapper",
"contract": {
"abi": "https://github.com/LedgerHQ/ledger-asset-dapps/blob/main/ethereum/paraswap/abis/0xdef171fe48cf0115b1d80b88dc8eab59176fee57.abi.json",
"deployments": [
{ "chainId": 1, "address": "0x1bd435f3c054b6e901b7b108a0ab7617c808677b" },
{ "chainId": 1, "address": "0xdef171fe48cf0115b1d80b88dc8eab59176fee57" },
{ "chainId": 56, "address": "0x55a0e3b6579972055faa983482aceb4b251dcf15" },
{ "chainId": 56, "address": "0xdef171fe48cf0115b1d80b88dc8eab59176fee57" },
{ "chainId": 137, "address": "0x90249ed4d69d70e709ffcd8bee2c5a566f65dade" },
{ "chainId": 1, "address": "0xdef171fe48cf0115b1d80b88dc8eab59176fee57" },
{ "chainId": 137, "address": "0xdef171fe48cf0115b1d80b88dc8eab59176fee57" }
]
}
Expand All @@ -19,41 +16,41 @@
"amountIn": { "label": "Income Amount", "format": "amount" },
"amountOut": { "label": "Outcome Amount", "format": "amount" },
"amountInMax": { "label": "Maximum Income Amount", "format": "amount" },
"factory": { "label": "Factory", "format": "addressName", "params": { "types": ["contract"] } },
"tokenIn": { "label": "Inbound token", "format": "addressName", "params": { "types": ["token"] } },
"amountOutMin": { "label": "Minimum Outcome Amount", "format": "amount" },
"fromToken": { "format": "addressName", "label": "Origin Token", "params": { "types": ["token"] } },
"toToken": { "format": "addressName", "label": "Destination Token", "params": { "types": ["token"] } },
"fromAmount": { "format": "tokenAmount", "label": "Income Amount", "params": { "tokenPath": "fromToken" } },
"exchange": { "format": "addressName", "label": "Exchange address", "params": { "types": ["wallet"] } }
"exchange": { "format": "addressName", "label": "Exchange address", "params": { "types": ["wallet"] } },
"beneficiary": { "format": "addressName", "label": "Beneficiary address", "params": { "types": ["eoa"] } },
"toAmount": { "format": "tokenAmount", "label": "Outcome Amount", "params": { "tokenPath": "toToken" } },
"expectedAmount": { "label": "Expected Amount", "format": "amount" }
},
"formats": {
"0x54840d1a": {
"$id": "swapOnUniswap",
"fields": [
{ "path": "amountIn", "$ref": "$.display.definitions.amountIn" },
{ "path": "amountOutMin", "$ref": "$.display.definitions.amountOutMin" },
{ "path": "path.[]", "label": "Array of addresses", "format": "addressName", "params": { "types": ["wallet"] } }
{ "path": "path.[]", "label": "Assets paths", "format": "addressName", "params": { "types": ["token"] } }
],
"required": ["amountIn", "amountOutMin", "path"]
},
"0xf5661034": {
"$id": "swapOnUniswapFork",
"fields": [
{ "path": "factory", "$ref": "$.display.definitions.factory" },
{ "path": "initCode", "format": "raw", "label": "init code" },
{ "path": "amountIn", "$ref": "$.display.definitions.amountIn" },
{ "path": "amountOutMin", "$ref": "$.display.definitions.amountOutMin" },
{ "path": "path.[]", "label": "Array of addresses", "format": "addressName", "params": { "types": ["wallet"] } }
{ "path": "path.[]", "label": "Assets paths", "format": "addressName", "params": { "types": ["token"] } }
],
"required": ["factory", "initCode", "amountIn", "amountOutMin", "path"]
"required": ["amountIn", "amountOutMin", "path"]
},
"0x935fb84b": {
"$id": "buyOnUniswap",
"fields": [
{ "path": "amountOut", "$ref": "$.display.definitions.amountOut" },
{ "path": "amountInMax", "$ref": "$.display.definitions.amountInMax" },
{ "path": "path.[]", "label": "Array of addresses", "format": "addressName", "params": { "types": ["contract"] } }
{ "path": "path.[]", "label": "Assets paths", "format": "addressName", "params": { "types": ["token"] } }
],
"required": ["amountOut", "amountInMax", "path"]
},
Expand All @@ -62,9 +59,9 @@
"fields": [
{ "path": "amountOut", "$ref": "$.display.definitions.amountOut" },
{ "path": "amountInMax", "$ref": "$.display.definitions.amountInMax" },
{ "path": "path.[]", "label": "Array of addresses", "format": "addressName", "params": { "types": ["wallet"] } }
{ "path": "path.[]", "label": "Assets paths", "format": "addressName", "params": { "types": ["token"] } }
],
"required": ["factory", "initCode", "amountOut", "amountInMax", "path"]
"required": ["amountOut", "amountInMax", "path"]
},
"0x0b86a4c1": {
"$id": "swapOnUniswapV2Fork",
Expand All @@ -73,7 +70,7 @@
{ "path": "amountIn", "$ref": "$.display.definitions.amountIn", "params": { "tokenPath": "tokenIn" } },
{ "path": "amountOutMin", "$ref": "$.display.definitions.amountOutMin" }
],
"required": ["tokenIn", "amountIn", "amountOutMin", "weth", "pools"]
"required": ["tokenIn", "amountIn", "amountOutMin"]
},
"0x64466805": {
"$id": "swapOnZeroXv4",
Expand All @@ -82,10 +79,63 @@
{ "path": "toToken", "$ref": "$.display.definitions.toToken" },
{ "path": "fromAmount", "$ref": "$.display.definitions.fromAmount" },
{ "path": "amountOutMin", "$ref": "$.display.definitions.amountOutMin" },
{ "path": "exchange", "$ref": "$.display.definitions.exchange" },
{ "path": "payload", "format": "raw", "label": "payload" }
{ "path": "exchange", "$ref": "$.display.definitions.exchange" }
],
"required": ["fromToken", "toToken", "fromAmount", "amountOutMin", "exchange", "payload"]
"required": ["fromToken", "toToken", "fromAmount", "amountOutMin", "exchange"]
},
"0x2298207a": {
"$id": "simpleBuy",
"fields": [
{ "path": "data.fromToken", "$ref": "$.display.definitions.fromToken"},
{ "path": "data.toToken", "$ref": "$.display.definitions.toToken"},
{ "path": "data.fromAmount", "$ref": "$.display.definitions.fromAmount", "params": { "tokenPath": "data.fromToken" } },
{ "path": "data.toAmount", "$ref": "$.display.definitions.toAmount", "params": { "tokenPath": "data.toToken" } },
{ "path": "data.beneficiary", "$ref": "$.display.definitions.beneficiary" }
],
"required": ["data.fromToken", "data.toToken", "data.fromAmount", "data.toAmount", "data.beneficiary"]
},
"0x46c67b6d": {
"$id": "megaSwap",
"fields": [
{ "path": "data.fromToken", "$ref": "$.display.definitions.fromToken"},
{ "path": "data.fromAmount", "$ref": "$.display.definitions.fromAmount", "params": { "tokenPath": "data.fromToken" } },
{ "path": "data.beneficiary", "$ref": "$.display.definitions.beneficiary" },
{ "path": "data.path.[]", "label": "Assets paths", "format": "addressName", "params": { "types": ["token"] } }
],
"required": ["data.fromAmount", "data.fromToken", "data.beneficiary", "data.path"]
},
"0x54e3f31b": {
"$id": "simpleSwap",
"fields": [
{ "path": "data.fromToken", "$ref": "$.display.definitions.fromToken" },
{ "path": "data.toToken", "$ref": "$.display.definitions.toToken" },
{ "path": "data.fromAmount", "$ref": "$.display.definitions.fromAmount", "params": { "tokenPath": "data.fromToken" } },
{ "path": "data.toAmount", "$ref": "$.display.definitions.toAmount", "params": { "tokenPath": "data.toToken" } },
{ "path": "data.beneficiary", "$ref": "$.display.definitions.beneficiary" }
],
"required": ["data.fromToken", "data.toToken", "fromAmount", "toAmount", "beneficiary"]
},
"0xa94e78ef": {
"$id": "multiSwap",
"fields": [
{ "path": "data.fromToken", "$ref": "$.display.definitions.fromToken" },
{ "path": "data.fromAmount", "$ref": "$.display.definitions.fromAmount", "params": { "tokenPath": "data.fromToken" } },
{ "path": "data.expectedAmount", "$ref": "$.display.definitions.expectedAmount" },
{ "path": "data.beneficiary", "$ref": "$.display.definitions.beneficiary" },
{ "path": "data.path.[]", "label": "Assets paths", "format": "addressName", "params": { "types": ["token"] } }
],
"required": ["data.fromToken", "data.fromAmount", "data.toAmount", "data.expectedAmount", "data.beneficiary", "data.path"]
},
"0x81033120": {
"$id": "swapOnZeroXv2",
"fields": [
{ "path": "fromToken", "$ref": "$.display.definitions.fromToken" },
{ "path": "toToken", "$ref": "$.display.definitions.toToken" },
{ "path": "fromAmount", "$ref": "$.display.definitions.fromAmount" },
{ "path": "amountOutMin", "$ref": "$.display.definitions.amountOutMin" },
{ "path": "exchange", "$ref": "$.display.definitions.exchange" }
],
"required": ["fromToken", "toToken", "fromAmount", "amountOutMin", "exchange"]
}
}
}
Expand Down