Estimations
We offer several functions to help you estimate costs, including bridging and deployment fees.
Bridge Costs
To estimate bridge fees and minimum gas limits, we provide the estimateBridgeFee function. See below for more information.
/**
* @notice Returns estimated minimal amount to pay for bridging and minimal gas limit.
* @param dstChainId destination chain Id.
* @param dstGasLimit {redeem} call gas limit on the destination chain.
* @param customPayloadLength user's additional data length.
* @param protocolPayload UTS protocol's additional data.
* @return paymentAmount source chain native currency amount to pay for bridging.
* @return dstMinGasLimit destination chain minimal {redeem} call gas limit.
*/
function estimateBridgeFee(
uint256 dstChainId,
uint64 dstGasLimit,
uint16 customPayloadLength,
bytes calldata protocolPayload
) public view virtual returns(uint256 paymentAmount, uint64 dstMinGasLimit)Destination chain Id
Destination gas limit
Length of your custom payload
UTS protocol payload
Gas Limits
The UTS Router provides a function called dstMinGasLimit which returns the amount of gas required to execute the {redeem} function on the destination chain.
Deployment Costs
If you want to perform a cross-chain deploying using our UTSDeploymentRouter, you can use the estimateDeploy function to estimate the separated payments required for sending crosschain deployment requests in the payment token. The function will return the fees you need to pay in PAYMENT_TOKEN.
Array of chain ids where UTS Tokens will be deployed
Array of chain ids where UTS Connectors will be deployed
Deployment Costs in Native Currency
If you want to perform a cross-chain deploying using our UTSDeploymentRouter, you can use the estimateDeployNative function to estimate the separated payments required for sending crosschain deployment requests in the payment token. The function will return the fees you need to pay in native currency.
Last updated
Was this helpful?

