BaseXVSProxyOFT
The BaseXVSProxyOFT contract is tailored for facilitating cross-chain transactions with an ERC20 token. It manages transaction limits of a single and daily transactions. This contract inherits key functionalities from other contracts, including pausing capabilities and error handling. It holds state variables for the inner token and maps for tracking transaction limits and statistics across various chains and addresses. The contract allows the owner to configure limits, set whitelists, and control pausing. Internal functions conduct eligibility check of transactions, making the contract a fundamental component for cross-chain token management.
The address of ResilientOracle contract wrapped in its interface.
Copy contract ResilientOracleInterface oracle chainIdToMaxSingleTransactionLimit
Maximum limit for a single transaction in USD(scaled with 18 decimals) from local chain.
Copy mapping ( uint16 => uint256 ) chainIdToMaxSingleTransactionLimit chainIdToMaxDailyLimit
Maximum daily limit for transactions in USD(scaled with 18 decimals) from local chain.
Copy mapping ( uint16 => uint256 ) chainIdToMaxDailyLimit chainIdToLast24HourTransferred
Total sent amount in USD(scaled with 18 decimals) within the last 24-hour window from local chain.
chainIdToLast24HourWindowStart
Timestamp when the last 24-hour window started from local chain.
chainIdToMaxSingleReceiveTransactionLimit
Maximum limit for a single receive transaction in USD(scaled with 18 decimals) from remote chain.
chainIdToMaxDailyReceiveLimit
Maximum daily limit for receiving transactions in USD(scaled with 18 decimals) from remote chain.
chainIdToLast24HourReceived
Total received amount in USD(scaled with 18 decimals) within the last 24-hour window from remote chain.
chainIdToLast24HourReceiveWindowStart
Timestamp when the last 24-hour window started from remote chain.
Address on which cap check and bound limit is not applicable.
Set the address of the ResilientOracle contract.
Parameters
The new address of the ResilientOracle contract.
📅 Events
Emits OracleChanged with old and new oracle address.
⛔️ Access Requirements
setMaxSingleTransactionLimit
Sets the limit of single transaction amount.
Parameters
Amount in USD(scaled with 18 decimals).
📅 Events
Emits SetMaxSingleTransactionLimit with old and new limit associated with chain id.
⛔️ Access Requirements
setMaxDailyLimit
Sets the limit of daily (24 Hour) transactions amount.
Parameters
Amount in USD(scaled with 18 decimals).
📅 Events
Emits setMaxDailyLimit with old and new limit associated with chain id.
⛔️ Access Requirements
setMaxSingleReceiveTransactionLimit
Sets the maximum limit for a single receive transaction.
Parameters
The destination chain ID.
The new maximum limit in USD(scaled with 18 decimals).
📅 Events
Emits setMaxSingleReceiveTransactionLimit with old and new limit associated with chain id.
⛔️ Access Requirements
setMaxDailyReceiveLimit
Sets the maximum daily limit for receiving transactions.
Parameters
The destination chain ID.
The new maximum daily limit in USD(scaled with 18 decimals).
📅 Events
Emits setMaxDailyReceiveLimit with old and new limit associated with chain id.
⛔️ Access Requirements
Sets the whitelist address to skip checks on transaction limit.
Parameters
Address to be add in whitelist.
Boolean to be set (true for user_ address is whitelisted).
📅 Events
⛔️ Access Requirements
Triggers stopped state of the bridge.
⛔️ Access Requirements
Triggers resume state of the bridge.
⛔️ Access Requirements
A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to user
Parameters
The address of the ERC-20 token to sweep
The address of the recipient
The amount of tokens needs to transfer
📅 Events
⛔️ Access Requirements
❌ Errors
Throw InsufficientBalance if amount_ is greater than the available balance of the token in the contract
removeTrustedRemote
Remove trusted remote from storage.
Parameters
The chain's id corresponds to setting the trusted remote to empty.
📅 Events
Emits TrustedRemoteRemoved once chain id is removed from trusted remote.
⛔️ Access Requirements
updateSendAndCallEnabled
It enables or disables sendAndCall functionality for the bridge.
Parameters
Boolean indicating whether the sendAndCall function should be enabled or disabled.
isEligibleToSend
Checks the eligibility of a sender to initiate a cross-chain token transfer.
Parameters
The sender's address initiating the transfer.
Indicates destination chain.
The quantity of tokens to be transferred.
Return Values
A boolean indicating whether the sender is eligible to transfer the tokens.
maxSingleTransactionLimit
The maximum limit for a single transaction.
The maximum daily limit for transactions.
The equivalent amount in USD based on the oracle price.
The total amount transferred in the current 24-hour window.
The timestamp when the current 24-hour window started.
A boolean indicating whether the sender is whitelisted.
Initiates a cross-chain token transfer and triggers a call on the destination chain.
Parameters
Address from which tokens will be debited.
Destination chain id on which tokens will be send.
Address on which tokens will be credited on destination chain.
Amount of tokens that will be transferred.
Additional data payload for the call on the destination chain.
The amount of gas allocated for the call on the destination chain.
struct ICommonOFT.LzCallParams
Additional parameters, including refund address, ZRO payment address, and adapter params.
renounceOwnership
Empty implementation of renounce ownership to avoid any mishappening.
Return's the address of the inner token of this bridge.
Return Values
Address of the inner token of this bridge.