Fee
Inherits: Auth
SPDX-License-Identifier: SSPL-1.-0
State Variables
BP_DENOMINATOR
uint256 public constant BP_DENOMINATOR = 10_000;
chainIdToFeeBps
mapping(uint16 => FeeConfig) public chainIdToFeeBps;
defaultFeeBp
uint16 public defaultFeeBp;
feeOwner
address public feeOwner;
Functions
constructor
constructor(address authority);
setDefaultFeeBp
function setDefaultFeeBp(uint16 _feeBp) public virtual onlyAdmin;
setFeeBp
function setFeeBp(uint16 _dstChainId, bool _enabled, uint16 _feeBp) public virtual onlyAdmin;
setFeeOwner
Sets the fee owner address
This function sets the fee owner address to the address passed in as an argument. If the address passed in is 0x0, the function will revert with the FeeOwnerNotSet error.
function setFeeOwner(address _feeOwner) public virtual onlyAdmin;
Parameters
Name | Type | Description |
---|---|---|
_feeOwner | address | The address to set as the fee owner |
quoteOFTFee
function quoteOFTFee(uint16 _dstChainId, uint256 _amount) public view virtual returns (uint256 fee);
_payOFTFee
function _payOFTFee(address _from, uint16 _dstChainId, uint256 _amount) internal virtual returns (uint256 amount, uint256 fee);
_transferFrom
This function is used to transfer tokens from one address to another.
This function is called by the transferFrom() function. It is used to transfer tokens from one address to another.
function _transferFrom(address _from, address _to, uint256 _amount) internal virtual returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_from | address | The address from which the tokens are being transferred. |
_to | address | The address to which the tokens are being transferred. |
_amount | uint256 | The amount of tokens being transferred. |
Events
SetFeeBp
event SetFeeBp(uint16 dstchainId, bool enabled, uint16 feeBp);
SetDefaultFeeBp
event SetDefaultFeeBp(uint16 feeBp);
SetFeeOwner
event SetFeeOwner(address feeOwner);
Errors
FeeBpTooLarge
error FeeBpTooLarge();
FeeOwnerNotSet
error FeeOwnerNotSet();
Structs
FeeConfig
struct FeeConfig {
uint16 feeBP;
bool enabled;
}