MockFeeManager
Inherits: IFeeManager
Title: MockFeeManager
Mock implementation of IFeeManager for testing Mayan contracts
Handles fee calculations and deposits with configurable values
State Variables
_feeCollector
address public _feeCollector
_defaultProtocolBps
uint8 public _defaultProtocolBps
protocolBps
mapping(address => mapping(bytes32 => mapping(uint16 => uint8))) public protocolBps
Functions
constructor
constructor(address feeCollector_, uint8 defaultProtocolBps_) ;
feeCollector
Get the fee collector address
function feeCollector() external view returns (address);
depositFee
Deposit fee for a relayer
function depositFee(address relayer, address token, uint256 amount) external;
Parameters
| Name | Type | Description |
|---|---|---|
relayer | address | The relayer address |
token | address | The token address |
amount | uint256 | The fee amount |
calcProtocolBps
Calculate protocol basis points for MayanCircle
function calcProtocolBps(uint64 amount, address tokenIn, bytes32 tokenOut, uint16 destChain, uint8 referrerBps)
external
view
returns (uint8);
Parameters
| Name | Type | Description |
|---|---|---|
amount | uint64 | The transaction amount |
tokenIn | address | The input token |
tokenOut | bytes32 | The output token (bytes32) |
destChain | uint16 | The destination chain |
referrerBps | uint8 | The referrer basis points |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint8 | The protocol basis points |
calcFastMCTPProtocolBps
Calculate protocol basis points for FastMCTP
function calcFastMCTPProtocolBps(
uint8 payloadType,
address localToken,
uint256 cctpAmount,
address tokenOut,
address referrerAddr,
uint8 referrerBps
) external view returns (uint8);
Parameters
| Name | Type | Description |
|---|---|---|
payloadType | uint8 | The payload type |
localToken | address | The local token |
cctpAmount | uint256 | The CCTP amount |
tokenOut | address | The output token |
referrerAddr | address | The referrer address |
referrerBps | uint8 | The referrer basis points |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint8 | The protocol basis points |
setProtocolBps
Set protocol basis points for a specific configuration (testing only)
function setProtocolBps(address tokenIn, bytes32 tokenOut, uint16 destChain, uint8 bps) external;
setFeeCollector
Set the fee collector (testing only)
function setFeeCollector(address newFeeCollector) external;
setDefaultProtocolBps
Set the default protocol basis points (testing only)
function setDefaultProtocolBps(uint8 newBps) external;
rescueTokens
Rescue tokens from this contract (testing only)
function rescueTokens(address token, address to, uint256 amount) external;