Skip to content

Commit

Permalink
fix kyberswap wrong taker amount (#108)
Browse files Browse the repository at this point in the history
* fix kyberswap wrong taker amount

* add unit test
  • Loading branch information
linhnt3400 authored Dec 16, 2024
1 parent 073287a commit 64ffe4e
Show file tree
Hide file tree
Showing 4 changed files with 218 additions and 8 deletions.
108 changes: 108 additions & 0 deletions v2/pkg/parser/kyberswap/abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,114 @@
],
"name": "Swapped",
"type": "event"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "callTarget",
"type": "address"
},
{
"internalType": "address",
"name": "approveTarget",
"type": "address"
},
{
"internalType": "bytes",
"name": "targetData",
"type": "bytes"
},
{
"components": [
{
"internalType": "contract IERC20",
"name": "srcToken",
"type": "address"
},
{
"internalType": "contract IERC20",
"name": "dstToken",
"type": "address"
},
{
"internalType": "address[]",
"name": "srcReceivers",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "srcAmounts",
"type": "uint256[]"
},
{
"internalType": "address[]",
"name": "feeReceivers",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "feeAmounts",
"type": "uint256[]"
},
{
"internalType": "address",
"name": "dstReceiver",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minReturnAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "flags",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "permit",
"type": "bytes"
}
],
"internalType": "struct MetaAggregationRouterV2.SwapDescriptionV2",
"name": "desc",
"type": "tuple"
},
{
"internalType": "bytes",
"name": "clientData",
"type": "bytes"
}
],
"internalType": "struct MetaAggregationRouterV2.SwapExecutionParams",
"name": "execution",
"type": "tuple"
}
],
"name": "swap",
"outputs": [
{
"internalType": "uint256",
"name": "returnAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "gasUsed",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
}
]

52 changes: 49 additions & 3 deletions v2/pkg/parser/kyberswap/kyberswap.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 64ffe4e

Please sign in to comment.