Data Type
The structures and enumerations used in Protocolink contracts.
Last updated
The structures and enumerations used in Protocolink contracts.
Last updated
NONE
: Do not wrap the native token when Protocolink executes the protocol operation.
WRAP_BEFORE
: Wrap the native token before Protocolink executes the protocol operation.
UNWRAP_AFTER
: Unwrap the token after Protocolink executes the protocol operation.
token
: The address of the input token.
balanceBps
: The value represents how much percentage of the token balance will be used. The base is 10_000
which means 7_000
represents 70% of the token balance. If you want to use a fixed amount instead, set this value to 0
.
amountOrOffset
: The value represents the fixed token amount in use when balanceBps
is set to 0
. Otherwise, it represents the byte offset for replacing the amount value in the Logic.data
. If the amount value does not need to be replaced, set amountOrOffset
to .
to
: The contract address that Protocolink interacts with.
data
: The transaction data to execute.
inputs
: The token addresses and amounts expected to be used in the transaction.
wrapMode
: Specifies whether the native tokens need to be wrapped (e.g., ETH to WETH). If the native tokens need to be wrapped, set it to WRAP_BEFORE
. If the tokens need to be unwrapped after the transaction data is executed, set it to UNWRAP_AFTER
. Otherwise, set it to NONE
.
callback
: The callback address is provided to a flash loan contract to execute subsequent operations.
permit2Datas
: The Permit2 data for pulling tokens from the user address.
logics
: The operations for Protocolink to interact with other protocols.
tokensReturn
: The specified tokens should be sent back to the user address at the end of the transaction.
nonce
: A one-time used value to prevent signature replay attack.
deadline
: The signature expiration time.
token
: The fee token address.
amount
: The fee amount.
metadata
: The fee source that is used only for events.
logics
: The operations for Protocolink to interact with other protocols.
fees
: The fees that are charged by Protocolink.
referrals
: The receivers of the fees and the fee rates.
deadline
: The signature expiration time.
permit2Datas
: The Permit2 data for pulling tokens from the user address.
logicBatch
: The operations for Protocolink to interact with other protocols.
tokensReturn
: The specified tokens should be sent back to the user address at the end of the transaction.
nonce
: A one-time used value to prevent signature replay attack.
deadline
: The signature expiration time.
delegatee
: The delegatee address.
expiry
: The delegation expiration time.
nonce
: A one-time used value to prevent signature replay attack.
deadline
: The signature expiration time.
expiry
: The delegation expiration time.
nonce
: A one-time used value to prevent signature replay attack.
Check more details at .
approveTo
: Authorize a contract address, such as , that does not equal the to
address. If the approveTo
address equals the to
address, fill in the approveTo
address with address(0)
.