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

Modification in decoding events #32

Merged
merged 1 commit into from
Feb 21, 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
98 changes: 43 additions & 55 deletions src/constants/FiberRouter.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
"abi": [
{
"inputs": [
{ "internalType": "address", "name": "_weth", "type": "address" },
{
"internalType": "address",
"name": "_wethAddress",
"name": "_oneInchAggregatorRouter",
"type": "address"
},
{
"internalType": "address",
"name": "_oneInchAggregator",
"type": "address"
},
{ "internalType": "address", "name": "_poolAddress", "type": "address" }
{ "internalType": "address", "name": "_pool", "type": "address" }
],
"stateMutability": "nonpayable",
"type": "constructor"
Expand Down Expand Up @@ -156,6 +152,12 @@
"internalType": "bytes32",
"name": "withdrawalData",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "uint256",
"name": "gasAmount",
"type": "uint256"
}
],
"name": "Swap",
Expand Down Expand Up @@ -309,49 +311,49 @@
{
"indexed": false,
"internalType": "address",
"name": "",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "",
"name": "amountIn",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "",
"name": "amountOutOneInch",
"type": "uint256"
},
{
"indexed": false,
"internalType": "address",
"name": "",
"name": "foundryToken",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "",
"name": "targetToken",
"type": "address"
},
{
"indexed": false,
"internalType": "bytes",
"name": "",
"name": "oneInchData",
"type": "bytes"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "",
"name": "salt",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "bytes",
"name": "",
"name": "multiSignature",
"type": "bytes"
}
],
Expand All @@ -365,6 +367,15 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gasWallet",
"outputs": [
{ "internalType": "address payable", "name": "", "type": "address" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
"name": "inventory",
Expand All @@ -390,43 +401,6 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "amountIn", "type": "uint256" },
{ "internalType": "uint256", "name": "amountOut", "type": "uint256" },
{
"internalType": "string",
"name": "crossTargetNetwork",
"type": "string"
},
{
"internalType": "string",
"name": "crossTargetToken",
"type": "string"
},
{
"internalType": "string",
"name": "crossTargetAddress",
"type": "string"
},
{ "internalType": "bytes", "name": "oneInchData", "type": "bytes" },
{ "internalType": "address", "name": "fromToken", "type": "address" },
{
"internalType": "address",
"name": "foundryToken",
"type": "address"
},
{
"internalType": "bytes32",
"name": "withdrawalData",
"type": "bytes32"
}
],
"name": "nonEvmSwapAndCrossOneInch",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "oneInchAggregatorRouter",
Expand Down Expand Up @@ -455,6 +429,19 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "_gasWallet",
"type": "address"
}
],
"name": "setGasWallet",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -500,7 +487,7 @@
],
"name": "swap",
"outputs": [],
"stateMutability": "nonpayable",
"stateMutability": "payable",
"type": "function"
},
{
Expand Down Expand Up @@ -537,7 +524,7 @@
],
"name": "swapAndCrossOneInch",
"outputs": [],
"stateMutability": "nonpayable",
"stateMutability": "payable",
"type": "function"
},
{
Expand Down Expand Up @@ -568,7 +555,8 @@
"internalType": "bytes32",
"name": "withdrawalData",
"type": "bytes32"
}
},
{ "internalType": "uint256", "name": "gasFee", "type": "uint256" }
],
"name": "swapAndCrossOneInchETH",
"outputs": [],
Expand Down
8 changes: 4 additions & 4 deletions src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ export const BEARER = "Bearer ";
export const NETWORKS = [
{
chainId: "56",
fundManagerAddress: "0xb14Fc4078C4C3b1D9CCADE2A0ab70F3E5F209F58",
fiberRouterAddress: "0x2b6956bea92B988917Fd8DeF40df3E9A07235b71",
fundManagerAddress: "0x985824b8623e523162122461e081721B4bCc778B",
fiberRouterAddress: "0x7FfD92b850c5660FB40BD5Efa4f24eb22665E4c4",
foundaryTokenAddress: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
},
{
chainId: "42161",
fundManagerAddress: "0xB82F45B578873C8531c4D7fe354C2B4b49e18C4b",
fiberRouterAddress: "0x8D73d2A7D197b22BBa4562a1E93adfd9fBCe2118",
fundManagerAddress: "0x985824b8623e523162122461e081721b4bcc778b",
fiberRouterAddress: "0x7FfD92b850c5660FB40BD5Efa4f24eb22665E4c4",
foundaryTokenAddress: "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
},
];
Expand Down
2 changes: 1 addition & 1 deletion src/services/web3.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const getLogsFromTransactionReceipt = (job: any) => {

const findSwapEvent = (topics: any[], job: any) => {
let swapEventHash = Web3.utils.sha3(
"Swap(address,address,uint256,uint256,uint256,address,address,uint256,bytes32)"
"Swap(address,address,uint256,uint256,uint256,address,address,uint256,bytes32,uint256)"
);
if (job.data.isDestinationNonEVM != null && job.data.isDestinationNonEVM) {
swapEventHash = Web3.utils.sha3(
Expand Down