YAR Docs
  • TestNet Instruction
    • Introduction
    • Add YARchain TestNet
    • Add a few others TestNets
    • YAR v.1.0beta — Rewarding Usage Experience
  • DEV DOCS
    • Protocol
    • Fees
    • Use cases
    • Hello world!
  • WhitePaper
    • Introduction
    • YAR architecture
      • YAR objective
      • YARchain architecture
      • Connectors architecture
    • Project mechanics
      • Nodes
      • Chain Connection
      • Witness operations
      • Consensus on transactions
      • Threshold Signature Scheme (TSS)
      • Scaling
      • Management
      • Voting in YAR DAO
      • Supported networks
      • Protocol updates
      • Use cases
      • $YAR Utilization
      • Transaction fee and cross-chain calls discount
    • Conclusion
    • LEGAL DISCLAIMER
Powered by GitBook
On this page

Was this helpful?

  1. DEV DOCS

Fees

To pay for gas in the delivery network, the protocol charges a sufficient amount in Yar tokens from the user's balance, stored on the YarHub smart contract in the Yar network. For the Relayers network to execute the transaction, the user must first deposit a sufficient amount. If the user does not have a sufficient deposit at the time of transaction execution, the transaction will remain in the queue. This is done by calling the deposit function on the YarRequest smart contract from any supported network.

yarRequest.deposit(amount);

Each network uses its own payment token, usually the native token of the network, but it can also be an EIP20 token. To see which token is used:

address feeToken = yarRequest.feeToken();

If feeToken == address(0), the native token of the network is used; otherwise, the specified EIP20 token is used.

For example, by calling YarRequest.deposit(1e18) on the Ethereum network, 1 ETH will be debited from the user's wallet, which will then be converted at the current rate into YAR tokens and credited to the user's deposit in YarHub.

To perform cross-chain transactions from the address of any smart contract but pay the Yar fee from the user's address, the user must allow the application to debit the deposit on their behalf.

yarRequest.approve(appAddress, yarAmount);
PreviousProtocolNextUse cases

Last updated 8 months ago

Was this helpful?