LogoLogo
  • Entangle
    • Overview
    • Security Audits
  • Universal Interoperability Protocol
    • Overview
    • Architecture
      • Scalability and Network Stability
        • L2 Utility Blockchains
        • Transmitter Groups
      • Security and Consensus Mechanism
      • Finality
      • Execution Latency
      • Compatibility and Interoperability
    • Developer Guides
      • Getting Started
      • Solidity
        • Simple Abstract Messenger Example
        • Deploying Your Custom EVM Protocol
        • Bridging Tokens with UIP
        • Become an EVM Transmitter
      • Solana
        • Simple Abstract Messenger Example
        • Deploying Your Custom Solana Protocol
        • Become a Solana Transmitter
      • Calculate Cross-Chain Transaction Cost
      • Customizable Message Transmission Options
      • How to Debug Sent Messages
      • SDK Setup
      • Revenue Sharing for Transmitters
      • How to Become a Super Transmitter
    • Endpoints
  • Universal Data Feeds
    • Overview
    • Architecture
      • Data Delivery Methods
        • Pull Model
        • Push Model
      • Oracle Contract & User Interaction
    • Developer Guides
      • Custom Data Feeds
      • Fetch Data via Pull Model (PAYG)
        • EVM Smart Contracts
        • Solana Smart Contracts
      • Fetch Data via Pull Model (Subscriptions)
        • EVM Smart Contracts
        • Solana Smart Contracts
      • Fetch Data via Push Model
        • EVM Smart Contracts
        • Solana Smart Contracts
    • User Guides
      • Accessing Feeds
      • Subscribe to a Data Feed
      • Check Subscription
      • Manage Subscription
      • Renew Subscription
    • Data Endpoints
  • Universal Token Standard
    • Overview
    • Architecture
      • Fee Components
    • Developer Guides
      • Manual Deploy
        • Token Deployment Types
        • Create a Custom Token
        • Factory Blueprint Deployment
        • Examples
          • Initial Setup
          • UTS Connector
            • Mint & Burn Connector Scheme
            • Lock & Unlock Connector Scheme
            • Connector Over Native Currency
          • UTS Token
            • Simple Token
            • Token with Messages
      • Bridge SDK
      • Token Verification
      • Fees Calculation & Gas Estimation Logic
      • Estimations
    • User Guides
      • Launch Universal Token
      • Create a Liquidity Pool
      • Expand Existing Token
      • Transfer Liquidity to Connector
      • Bridging
    • Contract Addresses
  • Entangle Interoperable Blockchain
    • Overview
    • Architecture
    • Developer Guides
      • Set up a Validator Node
      • Delegating to Validators
      • Undelegating from Validators
      • Supported Accounts
  • More
    • Media Kit
    • FAQ
    • Report an Issue
    • Become a Partner
Powered by GitBook
On this page
  • Bridge Costs
  • Gas Limits
  • Deployment Costs
  • Deployment Costs in Native Currency

Was this helpful?

Export as PDF
  1. Universal Token Standard
  2. Developer Guides

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)
Name
Meaning

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.

/**
* @notice Returns the amount of gas required to execute {redeem} function on the destination chain.
* @param dstChainId destination chain Id.
* @return dstMinGasLimitAmount the amount of gas required to execute {redeem} function on the provided {dstChainId}.
*/
function dstMinGasLimit(
    uint256 dstChainId
) public view returns(uint64 dstMinGasLimitAmount)

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.

/**
 * @notice Estimates the separated payments required for send crosschain deployment requests in the {PAYMENT_TOKEN}.
 * @param dstTokenChainIds destination chain Ids for {UTSToken} deployments.
 * @param dstConnectorChainIds destination chain Ids for {UTSConnector} deployments.
 * @return tokenPaymentAmount array of estimated payment amount in the {PAYMENT_TOKEN} for each {dstChainId}.
 * @return connectorPaymentAmount array of estimated payment amount in the {PAYMENT_TOKEN} for each {dstChainId}.
 * @return totalPaymentAmount estimated total payment amount in the {PAYMENT_TOKEN}.
 */
function estimateDeploy(
    uint256[] calldata dstTokenChainIds,
    uint256[] calldata dstConnectorChainIds
) external view returns(
    uint256[] memory tokenPaymentAmount, 
    uint256[] memory connectorPaymentAmount, 
    uint256 totalPaymentAmount
)
Name
Meaning

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.

/**
 * @notice Estimates the separated payments required for send crosschain deployment requests in native currency.
 * @param dstTokenChainIds destination chain Ids for {UTSToken} deployments.
 * @param dstConnectorChainIds destination chain Ids for {UTSConnector} deployments.
 * @return tokenPaymentAmountNative array of estimated payment amount in native currency for each {dstChainId}.
 * @return connectorPaymentAmountNative array of estimated payment amount in native currency for each {dstChainId}.
 * @return totalPaymentAmountNative estimated total payment amount in native currency.
 */
function estimateDeployNative(
    uint256[] calldata dstTokenChainIds,
    uint256[] calldata dstConnectorChainIds
) external view returns(
    uint256[] memory tokenPaymentAmountNative, 
    uint256[] memory connectorPaymentAmountNative, 
    uint256 totalPaymentAmountNative
)
PreviousFees Calculation & Gas Estimation LogicNextUser Guides

Last updated 4 months ago

Was this helpful?

dstChainId
dstGasLimit
customPayloadLength
protocolPayload 
dstTokenChainIds
dstConnectorChainIds