Functions
Order Functions
Functions related to buying, selling and spending TokenMaster Tokens through the TokenMaster Router. Platforms integrating TokenMaster MUST implement these functions to allow users to buy, sell and spend tokens through TokenMaster, validate current orders, and allow creators to manage existing orders.
// Callable by users to buy, sell and spend tokens.
function buyTokens(BuyOrder calldata buyOrder) external payable;
function buyTokensAdvanced(
BuyOrder calldata buyOrder,
SignedOrder calldata signedOrder,
PermitTransfer calldata permitTransfer
) external payable;
function sellTokens(SellOrder calldata sellOrder) external;
function sellTokensAdvanced(SellOrder calldata sellOrder, SignedOrder calldata signedOrder) external;
function spendTokens(
SpendOrder calldata spendOrder,
SignedOrder calldata signedOrder
) external;
// Retrieves advanced order tracking data for orders with wallet/total limits, validates order and signatures.
function getBuyTrackingData(
address tokenMasterToken,
SignedOrder calldata signedOrder,
address buyer
) external view returns (
uint256 totalBought,
uint256 totalWalletBought,
bool orderDisabled,
bool signatureValid,
bool cosignatureValid
);
function getSellTrackingData(
address tokenMasterToken,
SignedOrder calldata signedOrder,
address seller
) external view returns (
uint256 totalSold,
uint256 totalWalletSold,
bool orderDisabled,
bool signatureValid,
bool cosignatureValid
);
function getSpendTrackingData(
address tokenMasterToken,
SignedOrder calldata signedOrder,
address spender
) external view returns (
uint256 totalMultipliersSpent,
uint256 totalWalletMultipliersSpent,
bool orderDisabled,
bool signatureValid,
bool cosignatureValid
);
// Callable by the token owner, default admin role holder, or order manager role holder to disable or re-enable an advanced order.
function disableBuyOrder(address tokenMasterToken, SignedOrder calldata signedOrder, bool disabled) external;
function disableSellOrder(address tokenMasterToken, SignedOrder calldata signedOrder, bool disabled) external;
function disableSpendOrder(address tokenMasterToken, SignedOrder calldata signedOrder, bool disabled) external;
Token Deployment / Settings Functions
Functions related to deploying TokenMaster Tokens, managing and retrieving their current settings. Platforms integrating TokenMaster must implement these functions to allow creators to fully manage their tokens.
// Deploys a TokenMaster Token.
function deployToken(
DeploymentParameters calldata deploymentParameters,
SignatureECDSA calldata signature
) external payable;
// Updates token settings on router, may be called by owner or default admin role holder.
function updateTokenSettings(
address tokenAddress,
bool blockTransactionsFromUntrustedChannels,
bool restrictPairingToLists
) external;
function setOrderSigner(address tokenMasterToken, address signer, bool allowed) external;
function setTokenAllowedPairToDeployer(address tokenAddress, address deployer, bool allowed) external;
function setTokenAllowedPairToToken(address tokenAddress, address tokenAllowedToPair, bool allowed) external;
// Retrieves current settings for tokens.
function getTokenSettings(
address tokenAddress
) external view returns (
bool deployedByTokenMaster,
bool blockTransactionsFromUntrustedChannels,
bool restrictPairingToLists,
address partnerFeeRecipient
);
function getOrderSigners(address tokenMasterToken) external view returns (address[] memory orderSigners);
function getTrustedChannels(address tokenMasterToken) external view returns (address[] memory trustedChannels);
function getAllowedPairToDeployers(address tokenMasterToken) external view returns (address[] memory allowedPairToDeployers);
function getAllowedPairToTokens(address tokenMasterToken) external view returns (address[] memory allowedPairToTokens);
Creator / Partner / Infrastructure Functions
Functions relating to the withdrawal and transfer of creator, partner and infrastructure fees from TokenMaster Tokens. Platforms integrating TokenMaster MUST implement the withdrawCreatorShare and transferCreatorShareToMarket functions for creators to withdraw or manage their earnings. Platforms should implement partnerProposeFeeReceiver, acceptProposedPartnerFeeReceiver and withdrawFees to manage partner fee receiver changes and fee withdrawal.
Partner fee receivers utilize a two-step transfer process where the current partner fee receiver proposes a new receiving address and the token owner accepts the proposed address. Token owners MUST inspect the proposed address to ensure it is valid for receiving fees and will not be subject to any transfer restrictions.
// Callable by the token owner or default admin role holder.
function withdrawCreatorShare(ITokenMasterERC20C tokenMasterToken, address withdrawTo, uint256 withdrawAmount) external;
function transferCreatorShareToMarket(ITokenMasterERC20C tokenMasterToken, uint256 transferAmount) external;
function acceptProposedPartnerFeeReceiver(address tokenMasterToken, address expectedPartnerFeeRecipient) external;
// Callable by the partner fee receiver for a token to propose a new fee receiver address.
function partnerProposeFeeReceiver(address tokenMasterToken, address proposedPartnerFeeRecipient) external;
// Callable by TokenMaster fee collector or a partner for a token.
function withdrawFees(ITokenMasterERC20C[] calldata tokenMasterTokens) external;
Administrative Functions
For reference only, these functions are only callable by the TokenMaster admin to update the protocol fee and add/remove allowed token factories.
// Callable by the TokenMaster admin.
function setAllowedTokenFactory(address tokenFactory, bool allowed) external;
function setInfrastructureFee(uint16 _infrastructureFeeBPS) external;
