Skip to content

Commit

Permalink
fix: disable native and stable coins in Stargate V2, add cake between…
Browse files Browse the repository at this point in the history
… bnb and polygon zkevm
  • Loading branch information
Jeff-CCH committed Aug 15, 2024
1 parent b895896 commit e7e50fd
Show file tree
Hide file tree
Showing 17 changed files with 2,958 additions and 420 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-pianos-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@protocolink/logics': patch
---

disable native and stable coins in Stargate V2, add cake between bnb and polygon zkevm
2 changes: 2 additions & 0 deletions .env.bnb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CHAIN_ID=56
HTTP_RPC_URL=https://bsc-dataseed.binance.org
361 changes: 361 additions & 0 deletions src/logics/stargate-v2/abis/OFTWrapper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,361 @@
[
{
"inputs": [{ "internalType": "uint256", "name": "_defaultBps", "type": "uint256" }],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" },
{ "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": true, "internalType": "address", "name": "oft", "type": "address" },
{ "indexed": false, "internalType": "address", "name": "to", "type": "address" },
{ "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "WrapperFeeWithdrawn",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": true, "internalType": "bytes2", "name": "partnerId", "type": "bytes2" },
{ "indexed": false, "internalType": "address", "name": "token", "type": "address" },
{ "indexed": false, "internalType": "uint256", "name": "wrapperFee", "type": "uint256" },
{ "indexed": false, "internalType": "uint256", "name": "callerFee", "type": "uint256" }
],
"name": "WrapperFees",
"type": "event"
},
{
"inputs": [],
"name": "BPS_DENOMINATOR",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_UINT",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "defaultBps",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_oft", "type": "address" },
{ "internalType": "uint16", "name": "_dstChainId", "type": "uint16" },
{ "internalType": "bytes", "name": "_toAddress", "type": "bytes" },
{ "internalType": "uint256", "name": "_amount", "type": "uint256" },
{ "internalType": "bool", "name": "_useZro", "type": "bool" },
{ "internalType": "bytes", "name": "_adapterParams", "type": "bytes" },
{
"components": [
{ "internalType": "uint256", "name": "callerBps", "type": "uint256" },
{ "internalType": "address", "name": "caller", "type": "address" },
{ "internalType": "bytes2", "name": "partnerId", "type": "bytes2" }
],
"internalType": "struct IOFTWrapper.FeeObj",
"name": "_feeObj",
"type": "tuple"
}
],
"name": "estimateSendFee",
"outputs": [
{ "internalType": "uint256", "name": "nativeFee", "type": "uint256" },
{ "internalType": "uint256", "name": "zroFee", "type": "uint256" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_oft", "type": "address" },
{ "internalType": "uint16", "name": "_dstChainId", "type": "uint16" },
{ "internalType": "bytes32", "name": "_toAddress", "type": "bytes32" },
{ "internalType": "uint256", "name": "_amount", "type": "uint256" },
{ "internalType": "bool", "name": "_useZro", "type": "bool" },
{ "internalType": "bytes", "name": "_adapterParams", "type": "bytes" },
{
"components": [
{ "internalType": "uint256", "name": "callerBps", "type": "uint256" },
{ "internalType": "address", "name": "caller", "type": "address" },
{ "internalType": "bytes2", "name": "partnerId", "type": "bytes2" }
],
"internalType": "struct IOFTWrapper.FeeObj",
"name": "_feeObj",
"type": "tuple"
}
],
"name": "estimateSendFeeV2",
"outputs": [
{ "internalType": "uint256", "name": "nativeFee", "type": "uint256" },
{ "internalType": "uint256", "name": "zroFee", "type": "uint256" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_token", "type": "address" },
{ "internalType": "uint256", "name": "_amount", "type": "uint256" },
{ "internalType": "uint256", "name": "_callerBps", "type": "uint256" }
],
"name": "getAmountAndFees",
"outputs": [
{ "internalType": "uint256", "name": "amount", "type": "uint256" },
{ "internalType": "uint256", "name": "wrapperFee", "type": "uint256" },
{ "internalType": "uint256", "name": "callerFee", "type": "uint256" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
"name": "oftBps",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{ "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" },
{
"inputs": [
{ "internalType": "address", "name": "_oft", "type": "address" },
{ "internalType": "uint16", "name": "_dstChainId", "type": "uint16" },
{ "internalType": "bytes", "name": "_toAddress", "type": "bytes" },
{ "internalType": "uint256", "name": "_amount", "type": "uint256" },
{ "internalType": "uint256", "name": "_minAmount", "type": "uint256" },
{ "internalType": "address payable", "name": "_refundAddress", "type": "address" },
{ "internalType": "address", "name": "_zroPaymentAddress", "type": "address" },
{ "internalType": "bytes", "name": "_adapterParams", "type": "bytes" },
{
"components": [
{ "internalType": "uint256", "name": "callerBps", "type": "uint256" },
{ "internalType": "address", "name": "caller", "type": "address" },
{ "internalType": "bytes2", "name": "partnerId", "type": "bytes2" }
],
"internalType": "struct IOFTWrapper.FeeObj",
"name": "_feeObj",
"type": "tuple"
}
],
"name": "sendOFT",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_oft", "type": "address" },
{ "internalType": "uint16", "name": "_dstChainId", "type": "uint16" },
{ "internalType": "bytes32", "name": "_toAddress", "type": "bytes32" },
{ "internalType": "uint256", "name": "_amount", "type": "uint256" },
{ "internalType": "uint256", "name": "_minAmount", "type": "uint256" },
{
"components": [
{ "internalType": "address payable", "name": "refundAddress", "type": "address" },
{ "internalType": "address", "name": "zroPaymentAddress", "type": "address" },
{ "internalType": "bytes", "name": "adapterParams", "type": "bytes" }
],
"internalType": "struct ICommonOFT.LzCallParams",
"name": "_callParams",
"type": "tuple"
},
{
"components": [
{ "internalType": "uint256", "name": "callerBps", "type": "uint256" },
{ "internalType": "address", "name": "caller", "type": "address" },
{ "internalType": "bytes2", "name": "partnerId", "type": "bytes2" }
],
"internalType": "struct IOFTWrapper.FeeObj",
"name": "_feeObj",
"type": "tuple"
}
],
"name": "sendOFTFeeV2",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_oft", "type": "address" },
{ "internalType": "uint16", "name": "_dstChainId", "type": "uint16" },
{ "internalType": "bytes32", "name": "_toAddress", "type": "bytes32" },
{ "internalType": "uint256", "name": "_amount", "type": "uint256" },
{ "internalType": "uint256", "name": "_minAmount", "type": "uint256" },
{
"components": [
{ "internalType": "address payable", "name": "refundAddress", "type": "address" },
{ "internalType": "address", "name": "zroPaymentAddress", "type": "address" },
{ "internalType": "bytes", "name": "adapterParams", "type": "bytes" }
],
"internalType": "struct ICommonOFT.LzCallParams",
"name": "_callParams",
"type": "tuple"
},
{
"components": [
{ "internalType": "uint256", "name": "callerBps", "type": "uint256" },
{ "internalType": "address", "name": "caller", "type": "address" },
{ "internalType": "bytes2", "name": "partnerId", "type": "bytes2" }
],
"internalType": "struct IOFTWrapper.FeeObj",
"name": "_feeObj",
"type": "tuple"
}
],
"name": "sendOFTV2",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_proxyOft", "type": "address" },
{ "internalType": "uint16", "name": "_dstChainId", "type": "uint16" },
{ "internalType": "bytes", "name": "_toAddress", "type": "bytes" },
{ "internalType": "uint256", "name": "_amount", "type": "uint256" },
{ "internalType": "uint256", "name": "_minAmount", "type": "uint256" },
{ "internalType": "address payable", "name": "_refundAddress", "type": "address" },
{ "internalType": "address", "name": "_zroPaymentAddress", "type": "address" },
{ "internalType": "bytes", "name": "_adapterParams", "type": "bytes" },
{
"components": [
{ "internalType": "uint256", "name": "callerBps", "type": "uint256" },
{ "internalType": "address", "name": "caller", "type": "address" },
{ "internalType": "bytes2", "name": "partnerId", "type": "bytes2" }
],
"internalType": "struct IOFTWrapper.FeeObj",
"name": "_feeObj",
"type": "tuple"
}
],
"name": "sendProxyOFT",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_proxyOft", "type": "address" },
{ "internalType": "uint16", "name": "_dstChainId", "type": "uint16" },
{ "internalType": "bytes32", "name": "_toAddress", "type": "bytes32" },
{ "internalType": "uint256", "name": "_amount", "type": "uint256" },
{ "internalType": "uint256", "name": "_minAmount", "type": "uint256" },
{
"components": [
{ "internalType": "address payable", "name": "refundAddress", "type": "address" },
{ "internalType": "address", "name": "zroPaymentAddress", "type": "address" },
{ "internalType": "bytes", "name": "adapterParams", "type": "bytes" }
],
"internalType": "struct ICommonOFT.LzCallParams",
"name": "_callParams",
"type": "tuple"
},
{
"components": [
{ "internalType": "uint256", "name": "callerBps", "type": "uint256" },
{ "internalType": "address", "name": "caller", "type": "address" },
{ "internalType": "bytes2", "name": "partnerId", "type": "bytes2" }
],
"internalType": "struct IOFTWrapper.FeeObj",
"name": "_feeObj",
"type": "tuple"
}
],
"name": "sendProxyOFTFeeV2",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_proxyOft", "type": "address" },
{ "internalType": "uint16", "name": "_dstChainId", "type": "uint16" },
{ "internalType": "bytes32", "name": "_toAddress", "type": "bytes32" },
{ "internalType": "uint256", "name": "_amount", "type": "uint256" },
{ "internalType": "uint256", "name": "_minAmount", "type": "uint256" },
{
"components": [
{ "internalType": "address payable", "name": "refundAddress", "type": "address" },
{ "internalType": "address", "name": "zroPaymentAddress", "type": "address" },
{ "internalType": "bytes", "name": "adapterParams", "type": "bytes" }
],
"internalType": "struct ICommonOFT.LzCallParams",
"name": "_callParams",
"type": "tuple"
},
{
"components": [
{ "internalType": "uint256", "name": "callerBps", "type": "uint256" },
{ "internalType": "address", "name": "caller", "type": "address" },
{ "internalType": "bytes2", "name": "partnerId", "type": "bytes2" }
],
"internalType": "struct IOFTWrapper.FeeObj",
"name": "_feeObj",
"type": "tuple"
}
],
"name": "sendProxyOFTV2",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [{ "internalType": "uint256", "name": "_defaultBps", "type": "uint256" }],
"name": "setDefaultBps",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_token", "type": "address" },
{ "internalType": "uint256", "name": "_bps", "type": "uint256" }
],
"name": "setOFTBps",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_oft", "type": "address" },
{ "internalType": "address", "name": "_to", "type": "address" },
{ "internalType": "uint256", "name": "_amount", "type": "uint256" }
],
"name": "withdrawFees",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
Loading

0 comments on commit e7e50fd

Please sign in to comment.