Butter Network
Github
  • 🌈About Butter Network
  • 🔥ZK Light Client
    • Understanding Light Client
    • Refactored ZK Light Client
  • 🔥Omnichain Development
    • Omnichain Isomorphism
    • More Possibilities
  • 🌈Butter Omnichain Messaging Integration
    • Introduction
    • Integration Guide
      • Message
      • Message with Ton
      • CALLDATA
      • Message And Relay
    • Contract Interface
    • Fee
    • Deployed Contracts
    • 👨‍💻API for Omnichain Message
      • GET Message History by Source Address
      • GET Message Info by Id
      • GET Message Info by Source Hash
  • 🔥Butter Bridge Integration
    • Integration Guide
    • Contract Interface
    • Fee
    • Deployed Contracts
  • 💰Butter Swap Integration
    • Introduction
    • 🟢Integration Guide
      • Contract Interface
      • Fee
    • Deployed Contracts
      • v2.1
    • 👩‍💻API for Routing
      • Integration Guide
      • GET /route
      • GET /swap
      • GET /routeAndSwap
      • GET /supportedChainList
      • GET /findToken
      • 🔴Error Code List
    • 👨‍💻API for Swap Data
      • GET Swap History by Source Hash
      • GET Swap History by Source Address
      • GET Swap Info by Order ID
      • GET Supported Chain Detail List
      • GET Supported Token Detail List
  • 💰Butter Swap User Guide
    • 🫂User Guide
  • Butter Swap SDK
    • Install
    • Config SDK
    • Request Routes
    • Execute Route
    • Others
  • Butter Swap Widget
    • Usage
  • 📢Resources
    • 🏠Website
    • 🫂Telegram
    • 📄X
Powered by GitBook
On this page
  1. Butter Omnichain Messaging Integration

Fee

When initiating a cross-chain message, a fee is charged to cover the gas consumption of transactions on other chains. We support payment using various tokens or the source chain token.

Below, we will explain our calculation method in detail:

  • Users can choose the gas limit for executing messages on the target chain.

  • During the cross-chain message process, we will go through the relay chain, which also incurs some gas consumption. To avoid affecting the execution of messages on the target chain, we also have a base gas limit.

  • The gas consumed on the target chain and the diversity of payment methods on the source chain will have different gas prices for calculation.

Finally, we can calculate the exact amount of tokens needed to be paid using the following formula:

(gasLimit + baseGasLimit) * gasPrice

For ease of use, you can use the following interface to get the base gas limit and gas price for the target chain:

function getFeeInfo(
uint256 _chainId,
address _feeToken
) external view override returns (uint256 _base, uint256 _gasPrice, address _receiverAddress);
PreviousContract InterfaceNextDeployed Contracts

Last updated 11 months ago

🌈