From ae7af2dd7df95da254d464c1d960153811819082 Mon Sep 17 00:00:00 2001 From: Zikriya Date: Tue, 30 Jul 2024 13:29:38 +0500 Subject: [PATCH 1/2] Related stargate contracts and abi --- src/constants/FiberRouter.json | 501 ++++++++++++++++++++++++++++----- src/constants/constants.ts | 12 +- 2 files changed, 430 insertions(+), 83 deletions(-) diff --git a/src/constants/FiberRouter.json b/src/constants/FiberRouter.json index e12f127..c6a5047 100644 --- a/src/constants/FiberRouter.json +++ b/src/constants/FiberRouter.json @@ -308,21 +308,41 @@ { "inputs": [], "name": "NAME", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "VERSION", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "router", "type": "address" }, - { "internalType": "bytes4[]", "name": "selectors", "type": "bytes4[]" } + { + "internalType": "address", + "name": "router", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "selectors", + "type": "bytes4[]" + } ], "name": "addRouterAndSelectors", "outputs": [], @@ -331,7 +351,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "_signer", "type": "address" } + { + "internalType": "address", + "name": "_signer", + "type": "address" + } ], "name": "addSigner", "outputs": [], @@ -341,21 +365,39 @@ { "inputs": [], "name": "cctpFundManager", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feeWallet", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "fundManager", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, @@ -363,55 +405,115 @@ "inputs": [], "name": "gasWallet", "outputs": [ - { "internalType": "address payable", "name": "", "type": "address" } + { + "internalType": "address payable", + "name": "", + "type": "address" + } ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "name": "inventory", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "router", "type": "address" }, - { "internalType": "bytes", "name": "selector", "type": "bytes" } + { + "internalType": "address", + "name": "router", + "type": "address" + }, + { + "internalType": "bytes", + "name": "selector", + "type": "bytes" + } ], "name": "isAllowListed", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "uint256", "name": "cdPtr", "type": "uint256" } + { + "internalType": "uint256", + "name": "cdPtr", + "type": "uint256" + } ], "name": "isCctp", - "outputs": [{ "internalType": "bool", "name": "cctp", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "cctp", + "type": "bool" + } + ], "stateMutability": "pure", "type": "function" }, { "inputs": [], "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "platformFee", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "router", "type": "address" }, - { "internalType": "bytes", "name": "selector", "type": "bytes" } + { + "internalType": "address", + "name": "router", + "type": "address" + }, + { + "internalType": "bytes", + "name": "selector", + "type": "bytes" + } ], "name": "removeRouterAndSelector", "outputs": [], @@ -420,7 +522,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "_signer", "type": "address" } + { + "internalType": "address", + "name": "_signer", + "type": "address" + } ], "name": "removeSigner", "outputs": [], @@ -449,7 +555,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "_feeWallet", "type": "address" } + { + "internalType": "address", + "name": "_feeWallet", + "type": "address" + } ], "name": "setFeeWallet", "outputs": [], @@ -458,7 +568,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "_fundManager", "type": "address" } + { + "internalType": "address", + "name": "_fundManager", + "type": "address" + } ], "name": "setFundManager", "outputs": [], @@ -480,7 +594,11 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "_platformFee", "type": "uint256" } + { + "internalType": "uint256", + "name": "_platformFee", + "type": "uint256" + } ], "name": "setPlatformFee", "outputs": [], @@ -489,7 +607,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "_weth", "type": "address" } + { + "internalType": "address", + "name": "_weth", + "type": "address" + } ], "name": "setWeth", "outputs": [], @@ -497,29 +619,61 @@ "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "name": "signers", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, { "internalType": "uint256", "name": "minAmountOut", "type": "uint256" }, - { "internalType": "address", "name": "fromToken", "type": "address" }, - { "internalType": "address", "name": "toToken", "type": "address" }, + { + "internalType": "address", + "name": "fromToken", + "type": "address" + }, + { + "internalType": "address", + "name": "toToken", + "type": "address" + }, { "internalType": "address", "name": "targetAddress", "type": "address" }, - { "internalType": "address", "name": "router", "type": "address" }, - { "internalType": "bytes", "name": "routerCalldata", "type": "bytes" } + { + "internalType": "address", + "name": "router", + "type": "address" + }, + { + "internalType": "bytes", + "name": "routerCalldata", + "type": "bytes" + } ], "name": "swapOnSameNetwork", "outputs": [], @@ -533,14 +687,26 @@ "name": "minAmountOut", "type": "uint256" }, - { "internalType": "address", "name": "toToken", "type": "address" }, + { + "internalType": "address", + "name": "toToken", + "type": "address" + }, { "internalType": "address", "name": "targetAddress", "type": "address" }, - { "internalType": "address", "name": "router", "type": "address" }, - { "internalType": "bytes", "name": "routerCalldata", "type": "bytes" } + { + "internalType": "address", + "name": "router", + "type": "address" + }, + { + "internalType": "bytes", + "name": "routerCalldata", + "type": "bytes" + } ], "name": "swapOnSameNetworkETH", "outputs": [], @@ -549,8 +715,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "token", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, { "components": [ { @@ -578,7 +752,16 @@ "name": "withdrawalData", "type": "bytes32" }, - { "internalType": "bool", "name": "cctpType", "type": "bool" }, + { + "internalType": "bool", + "name": "cctpType", + "type": "bool" + }, + { + "internalType": "bool", + "name": "stgType", + "type": "bool" + }, { "components": [ { @@ -616,9 +799,21 @@ "name": "destinationAmountOut", "type": "uint256" }, - { "internalType": "bytes32", "name": "salt", "type": "bytes32" }, - { "internalType": "uint256", "name": "expiry", "type": "uint256" }, - { "internalType": "bytes", "name": "signature", "type": "bytes" } + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } ], "internalType": "struct FeeDistributor.FeeDistributionData", "name": "fd", @@ -632,20 +827,36 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, { "internalType": "uint256", "name": "minAmountOut", "type": "uint256" }, - { "internalType": "address", "name": "fromToken", "type": "address" }, + { + "internalType": "address", + "name": "fromToken", + "type": "address" + }, { "internalType": "address", "name": "foundryToken", "type": "address" }, - { "internalType": "address", "name": "router", "type": "address" }, - { "internalType": "bytes", "name": "routerCalldata", "type": "bytes" }, + { + "internalType": "address", + "name": "router", + "type": "address" + }, + { + "internalType": "bytes", + "name": "routerCalldata", + "type": "bytes" + }, { "components": [ { @@ -673,7 +884,11 @@ "name": "withdrawalData", "type": "bytes32" }, - { "internalType": "bool", "name": "cctpType", "type": "bool" }, + { + "internalType": "bool", + "name": "cctpType", + "type": "bool" + }, { "components": [ { @@ -711,9 +926,21 @@ "name": "destinationAmountOut", "type": "uint256" }, - { "internalType": "bytes32", "name": "salt", "type": "bytes32" }, - { "internalType": "uint256", "name": "expiry", "type": "uint256" }, - { "internalType": "bytes", "name": "signature", "type": "bytes" } + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } ], "internalType": "struct FeeDistributor.FeeDistributionData", "name": "fd", @@ -737,9 +964,21 @@ "name": "foundryToken", "type": "address" }, - { "internalType": "uint256", "name": "gasFee", "type": "uint256" }, - { "internalType": "address", "name": "router", "type": "address" }, - { "internalType": "bytes", "name": "routerCalldata", "type": "bytes" }, + { + "internalType": "uint256", + "name": "gasFee", + "type": "uint256" + }, + { + "internalType": "address", + "name": "router", + "type": "address" + }, + { + "internalType": "bytes", + "name": "routerCalldata", + "type": "bytes" + }, { "components": [ { @@ -767,7 +1006,11 @@ "name": "withdrawalData", "type": "bytes32" }, - { "internalType": "bool", "name": "cctpType", "type": "bool" }, + { + "internalType": "bool", + "name": "cctpType", + "type": "bool" + }, { "components": [ { @@ -805,9 +1048,21 @@ "name": "destinationAmountOut", "type": "uint256" }, - { "internalType": "bytes32", "name": "salt", "type": "bytes32" }, - { "internalType": "uint256", "name": "expiry", "type": "uint256" }, - { "internalType": "bytes", "name": "signature", "type": "bytes" } + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } ], "internalType": "struct FeeDistributor.FeeDistributionData", "name": "fd", @@ -820,7 +1075,13 @@ "type": "function" }, { - "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "name": "targetNetworks", "outputs": [ { @@ -839,7 +1100,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "newOwner", "type": "address" } + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } ], "name": "transferOwnership", "outputs": [], @@ -847,28 +1112,74 @@ "type": "function" }, { - "inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], "name": "usedSalt", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "weth", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "token", "type": "address" }, - { "internalType": "address", "name": "payee", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "internalType": "bytes32", "name": "salt", "type": "bytes32" }, - { "internalType": "uint256", "name": "expiry", "type": "uint256" }, - { "internalType": "bytes", "name": "multiSignature", "type": "bytes" }, - { "internalType": "bool", "name": "cctpType", "type": "bool" } + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "payee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "multiSignature", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "cctpType", + "type": "bool" + } ], "name": "withdrawSigned", "outputs": [], @@ -877,8 +1188,16 @@ }, { "inputs": [ - { "internalType": "address payable", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, + { + "internalType": "address payable", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, { "internalType": "uint256", "name": "minAmountOut", @@ -889,13 +1208,41 @@ "name": "foundryToken", "type": "address" }, - { "internalType": "address", "name": "targetToken", "type": "address" }, - { "internalType": "address", "name": "router", "type": "address" }, - { "internalType": "bytes", "name": "routerCalldata", "type": "bytes" }, - { "internalType": "bytes32", "name": "salt", "type": "bytes32" }, - { "internalType": "uint256", "name": "expiry", "type": "uint256" }, - { "internalType": "bytes", "name": "multiSignature", "type": "bytes" }, - { "internalType": "bool", "name": "cctpType", "type": "bool" } + { + "internalType": "address", + "name": "targetToken", + "type": "address" + }, + { + "internalType": "address", + "name": "router", + "type": "address" + }, + { + "internalType": "bytes", + "name": "routerCalldata", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "multiSignature", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "cctpType", + "type": "bool" + } ], "name": "withdrawSignedAndSwapRouter", "outputs": [], diff --git a/src/constants/constants.ts b/src/constants/constants.ts index 68c15a3..cd9076a 100644 --- a/src/constants/constants.ts +++ b/src/constants/constants.ts @@ -33,12 +33,12 @@ export const NETWORKS = [ }, { chainId: '42161', - fundManagerAddress: '0x106E2eF36123Cb573d0925C1f4a3b377d11CBF70', - fiberRouterAddress: '0xDf5Df008Fa3397ac0Bd895A1aFDBda0231D883e0', + fundManagerAddress: '0x61716EaB460D6D8009C41C9A20d411d9aFBE2F9F', + fiberRouterAddress: '0x85BAd0e82eE19dE5409C214851E2492Fc926C155', foundaryTokenAddress: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831', aggregateRouterContractAddress: '0x111111125421ca6dc452d289314280a0f8842a65', - cctpFundManager: '0x4FB303c0CB210EafdB9c5203BF449E88E67aeC51', + cctpFundManager: '0x87C4132a5E4FD799726d54350F4B4025a36f07CF', }, { chainId: '10', @@ -51,12 +51,12 @@ export const NETWORKS = [ }, { chainId: '43114', - fundManagerAddress: '0x39E205B5477Bf41CB05B18299D279b6535ba180f', - fiberRouterAddress: '0x4256b41a6B56CD4D93f35B3eD2889A57e1882C72', + fundManagerAddress: '0x42550004b376ed1b2f81B48d687568Cf6011ca16', + fiberRouterAddress: '0xf42c0D0CC4e6bC46DfD996389Fb93AbC1655Af47', foundaryTokenAddress: '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E', aggregateRouterContractAddress: '0x111111125421ca6dc452d289314280a0f8842a65', - cctpFundManager: '0x11D3c7671C34664A41f7B5b510C9eAd7AB94DBc0', + cctpFundManager: '0x2705d87D7a9db1D6997FF0d8e892203cC57344CA', }, { chainId: '8453', From e51e805953195fcf79c10c77eca5e47882d537d6 Mon Sep 17 00:00:00 2001 From: Zikriya Date: Tue, 30 Jul 2024 13:30:08 +0500 Subject: [PATCH 2/2] contracts updated --- src/constants/constants.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/constants/constants.ts b/src/constants/constants.ts index cd9076a..a0db9d2 100644 --- a/src/constants/constants.ts +++ b/src/constants/constants.ts @@ -33,12 +33,12 @@ export const NETWORKS = [ }, { chainId: '42161', - fundManagerAddress: '0x61716EaB460D6D8009C41C9A20d411d9aFBE2F9F', - fiberRouterAddress: '0x85BAd0e82eE19dE5409C214851E2492Fc926C155', + fundManagerAddress: '0xa114b22f1373b461242a953f513289C526F46F9D', + fiberRouterAddress: '0xE16243Ac1C34509F09DAE2756b152043a2B7Ffb5', foundaryTokenAddress: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831', aggregateRouterContractAddress: '0x111111125421ca6dc452d289314280a0f8842a65', - cctpFundManager: '0x87C4132a5E4FD799726d54350F4B4025a36f07CF', + cctpFundManager: '0x2779F1fBe5d45dC73db81A25F40D356cD2cf64B5', }, { chainId: '10', @@ -51,12 +51,12 @@ export const NETWORKS = [ }, { chainId: '43114', - fundManagerAddress: '0x42550004b376ed1b2f81B48d687568Cf6011ca16', - fiberRouterAddress: '0xf42c0D0CC4e6bC46DfD996389Fb93AbC1655Af47', + fundManagerAddress: '0x994E96acE3De7E97ADC09707427289Ef21e08139', + fiberRouterAddress: '0x0C9B78385a536676Baa35B26DDB03b242a65A0b9', foundaryTokenAddress: '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E', aggregateRouterContractAddress: '0x111111125421ca6dc452d289314280a0f8842a65', - cctpFundManager: '0x2705d87D7a9db1D6997FF0d8e892203cC57344CA', + cctpFundManager: '0xCfb1330Dc5F3D86686d3884a35ceE8954F8277C0', }, { chainId: '8453',