Client contract
function setFeeRecipient(address _feeRecipient) public onlyRole(DEFAULT_ADMIN_ROLE)
Sets the fee recipient address.
function setFeePercentage(uint256 _feePercentage) public onlyRole(DEFAULT_ADMIN_ROLE) {}
Sets the fee percentage.
/**
* @dev Sets the fee percentage.
* @param _feePercentage The new fee percentage.
*/
function setFeePercentage(uint256 _feePercentage) public onlyRole(DEFAULT_ADMIN_ROLE) {
}
/**
* @dev Sets the cancellation fee percentage.
* @param _cancelFeePercentage The new cancellation fee percentage.
*/
function setCancelFeePercentage(uint256 _cancelFeePercentage) public onlyRole(DEFAULT_ADMIN_ROLE) {
}
/**
* @dev Sets the precision factor.
* @param _precisionFactor The new precision factor.
*/
function setPrecisionFactor(uint8 _precisionFactor) public onlyRole(DEFAULT_ADMIN_ROLE) {
}
/**
* @dev
* This function is used to add a new stable coin to the supported stable coins.
*
* @param token The address of the stable coin to add.
*
* @notice This function can only be called by users with the DEFAULT_ADMIN_ROLE.
* @notice A StableCoinAdded event will be triggered after the stable coin is added.
*/
function addSourceStableCoin(address token) public onlyRole(DEFAULT_ADMIN_ROLE) {
}
/**
* @dev
* This function is used to remove a stable coin from the supported stable coins.
*
* @param token The address of the stable coin to remove.
*
* @notice This function can only be called by users with the DEFAULT_ADMIN_ROLE.
* @notice A StableCoinRemoved event will be triggered after the stable coin is removed.
*/
function removeSourceStableCoin(address token) public onlyRole(DEFAULT_ADMIN_ROLE) {
}
/**
* @dev
* This function is used to buy tokens.
*
* @param _stableCoinAmount The amount of stable coins to use for the purchase.
* @param _targetchainId The ID of the chain to buy the tokens on.
* @param _tokenAddress The address of the token to buy.
* @param _stableCoinAddress The address of the stable coin to use for the purchase.
* @param _sourceStableCoinAddress The address of the stable coin to use for the purchase.
* @param _tokenAmount The amount of tokens to buy.
*
* @notice This function can only be called by users with the TRADER_ROLE.
*/
function buyTokens(
uint256 _stableCoinAmount,
uint256 _targetchainId,
address _tokenAddress,
address _stableCoinAddress,
address _sourceStableCoinAddress,
uint256 _tokenAmount,
uint256 _startPrice,
uint256 _endPrice,
uint256 _duration
) public {
}
/**
* @dev
* This function is used to complete a buy request.
*
* @param requestId The ID of the request to complete.
* @param finalPrice The final price of the tokens.
*
* @notice This function can only be called by users with the TRADER_ROLE.
*/
function completeBuy(uint256 requestId, uint256 finalPrice) public onlyRole(TRADER_ROLE) {
}
/**
* @dev
* This function is used to sell tokens.
*
* @param _tokenAmount The amount of tokens to sell.
* @param _targetchainId The ID of the chain to sell the tokens on.
* @param _tokenAddress The address of the token to sell.
* @param _stableCoinAddress The address of the stable coin to use for the purchase.
* @param _sourceStableCoinAddress The address of the stable coin to use for the purchase.
* @param _stableCoinAmount The amount of stable coins to use for the purchase.
*
* @notice This function can only be called by users with the TRADER_ROLE.
*/
function sellTokens(
uint256 _tokenAmount,
uint256 _targetchainId,
address _tokenAddress,
address _stableCoinAddress,
address _sourceStableCoinAddress,
uint256 _stableCoinAmount,
uint256 _startPrice,
uint256 _endPrice,
uint256 _duration
) public {
}
/**
* @dev
* This function is used to complete a sell request.
*
* @param requestId The ID of the request to complete.
* @param finalPrice The final price of the tokens.
*
* @notice This function can only be called by users with the TRADER_ROLE.
*/
function completeSell(uint256 requestId, uint256 finalPrice) public onlyRole(TRADER_ROLE) {
}
/**
* @dev Initiates the cancellation of a buy token request on the source chain.
*
* @param requestId The ID of the request to initiate cancellation.
*
* @notice This function can only be called by the user who created the request or by an admin.
*/
function initiateCancelBuyToken(uint256 requestId) public {
}
/**
* @dev Completes the cancellation of a buy token request after confirmation on the target chain.
*
* @param requestId The ID of the request to complete cancellation.
*/
function completeCancelBuyToken(uint256 requestId) public onlyRole(TRADER_ROLE) {
}
/**
* @dev Initiates the cancellation of a sell token request on the source chain.
*
* @param requestId The ID of the request to initiate cancellation.
*
* @notice This function can only be called by the user who created the request or an admin.
*/
function initiateCancelSellToken(uint256 requestId) public {
}
/**
* @dev Completes the cancellation of a sell token request after confirmation on the target chain.
*
* @param requestId The ID of the request to complete cancellation.
*/
function completeCancelSellToken(uint256 requestId) public onlyRole(TRADER_ROLE) {
}
/**
* @dev Admin forcibly cancels an order
* @param requestId The ID of the order to cancel
*/
function forceCancelRequest(uint256 requestId) public onlyRole(TRADER_ROLE) {
}
/**
* @dev
* This function is used to get the balance of a user for a specific token on a specific chain.
*
* @param user The address of the user.
* @param chainId The ID of the chain.
* @param tokenAddress The address of the token.
*
* @return The balance of the user for the specified token on the specified chain.
*/
function getBalance(address user, uint256 chainId, address tokenAddress) public view returns (uint256) {
}
/**
* @dev
* This function is used to query the details of a request with a specific ID.
*
* @param requestId The ID of the request to query.
*
* @return request A RequestData struct containing all details of the request.
*/
function getRequest(uint256 requestId) public view returns (RequestData memory) {
}
/**
* @dev Get the user address of the specified request
* @param requestId The request ID
* @return The user address of the request
*/
function getRequestUser(uint256 requestId) public view returns (address) {
}
/**
* @dev Get the target chain ID of the specified request
* @param requestId The request ID
* @return The target chain ID of the request
*/
function getRequestTargetChainId(uint256 requestId) public view returns (uint256) {
}
/**
* @dev Get the target token address of the specified request
* @param requestId The request ID
* @return The target token address of the request
*/
function getRequestTargetTokenAddress(uint256 requestId) public view returns (address) {
}
/**
* @dev Get the target stable coin address of the specified request
* @param requestId The request ID
* @return The target stable coin address of the request
*/
function getRequestTargetStableCoinAddress(uint256 requestId) public view returns (address) {
}
/**
* @dev Get the source stable coin address of the specified request
* @param requestId The request ID
* @return The source stable coin address of the request
*/
function getRequestSourceStableCoinAddress(uint256 requestId) public view returns (address) {
}
/**
* @dev Get the stable coin amount of the specified request
* @param requestId The request ID
* @return The stable coin amount of the request
*/
function getRequestStableCoinAmount(uint256 requestId) public view returns (uint256) {
}
/**
* @dev Get the token amount of the specified request
* @param requestId The request ID
* @return The token amount of the request
*/
function getRequestTokenAmount(uint256 requestId) public view returns (uint256) {
}
/**
* @dev Get the start price of the specified request
* @param requestId The request ID
* @return The start price of the request
*/
function getRequestStartPrice(uint256 requestId) public view returns (uint256) {
}
/**
* @dev Get the end price of the specified request
* @param requestId The request ID
* @return The end price of the request
*/
function getRequestEndPrice(uint256 requestId) public view returns (uint256) {
}
/**
* @dev Get the duration of the specified request
* @param requestId The request ID
* @return The duration of the request
*/
function getRequestDuration(uint256 requestId) public view returns (uint256) {
}
/**
* @dev Get whether the specified request is a buy request
* @param requestId The request ID
* @return Whether the request is a buy request
*/
function getRequestIsBuy(uint256 requestId) public view returns (bool) {
}
/**
* @dev Get whether the specified request is fulfilled
* @param requestId The request ID
* @return Whether the request is fulfilled
*/
function getRequestFulfilled(uint256 requestId) public view returns (bool) {
}
/**
* @dev Get whether the specified request is canceled
* @param requestId The request ID
* @return Whether the request is canceled
*/
function getRequestIsCanceled(uint256 requestId) public view returns (bool) {
}
/**
* @dev Get requests based on user and fulfillment status with optional pagination
*
* @param user The address of the user whose requests are to be retrieved. Use address(0) to ignore user filter.
* @param fulfilledStatus Boolean indicating whether to retrieve fulfilled (true) or unfulfilled (false) requests.
* @param pageSize The number of requests per page. Set to 0 to return all requests.
* @param page The page number to retrieve, starting from 0. Ignored if pageSize is 0.
* @return requestsArray An array of RequestData containing requests filtered by the specified criteria and pagination.
*/
function getFilteredRequests(address user, bool fulfilledStatus, uint256 pageSize, uint256 page) public view returns (RequestData[] memory) {
}
Last updated