Haven1
  • Get started
    • 🧑‍🚀Welcome Havenauts!
    • 📄Haven1 Litepaper
    • 🧮H1 Tokenomics
  • Foundations of Haven1
    • 📐Architecture & network design
    • 🔐Network-level security
    • 📚Haven1 Core protocols
    • 💱Best in class liquidity
    • 👮Network Guardians: Firewall on Haven1
    • 🌉hBridge: Intro to Haven1 Bridge
  • Learn
    • 💵What does Haven1 solve?
    • 💡Haven1: Use Cases
    • 📚Understanding GoQuorum
    • 🔤Haven1 Blockchain basics
    • 🛂KYC policies on Haven1 blockchain
    • Security at Haven1
    • 🔓What is esH1?
    • ⚖️Dispute resolution mechanism
    • 🛣️Haven1 Roadmap
    • 🖥️Haven1 is EVM compatible
  • Products
    • 🔃hSwap - Spot DEX on Haven1
    • 📍hsETH on Haven1
    • Earn on Haven1
    • 🛡️2FA Wallet Shield
    • 🧊Haven1 block explorer
    • 🏛️Governance & veH1
    • 🆔hPassport - Key to Haven1
      • Advantages of having ID verification at a network level
      • Understanding the ID Verification Process
    • 💼Vesting esH1 - Converting esH1 to H1
    • 📍Staking H1 & esH1 - Earning rewards on your H1 holdings
      • Flexible Staking
      • Locked Staking
  • hPerpetuals - Perps DEX on Haven1
  • Haven1 Guides
    • 🔗Quick links
    • ✅Haven1 onboarding Guide
      • 🪪KYC Guide
      • Business KYC(KYB) Guide
    • Adding multiple wallets to a hPassport
    • 🌉Simple Bridging Guide on Haven1 network
    • 🏠Haven1 Portal - Your Gateway into Haven1
    • 🔑2FA Set up Guide
    • 🤑Haven1 Airdrop: Claim Process and Strategies
    • Claim Process Walkthrough on Team Finance
    • 📄Contract Addresses
  • Build
    • 📖Getting started
    • 🌐Haven1 Network information
    • 🍦Novel developer benefits on Haven1
    • 📑High level guide for secure deployment
    • ⚙️Detailed deployment Guide
    • 🧰Developer tools
      • 👛Haven1 Gnosis Safe wallet
      • 🛠️Haven1 SDK
        • 🔌@haven1/sdk-api-client
          • Class: Haven1SDK
          • Class: AuthModule
          • Class: SdkModule
        • ⛓️@haven1/blockchain-sdk
          • Contracts
        • 🧰@haven1/wagmi-sdk
          • Constant Module
            • Variable: haven1Devnet
            • Variable: haven1Testnet
            • Variable: H1
          • Contract Module
            • ProofOfIdentity
            • ProofOfIdentityV2
            • NativeAppFee
          • Utility Module
            • bigIntMax
            • formatBigint
            • bigintFromDecimals
          • Hook Module
            • useWatch
            • useBalance
            • useApproveERC20
            • useContractWrite
        • ⚛️@haven1/react-sdk
          • useHaven1SDK
          • useAuth
          • useIdentity
          • useNotifications
          • useOTP
          • useSignIn
        • 📜Use cases & Examples
          • Adding the Notification Component to Your React UI
          • Check Proof of Identity (POI) Status
      • Oracles on Haven1
      • Subgraph on Haven1
      • Haven1 block explorer
      • Web3 libraries and tools
    • Development frameworks
    • 🔐Using hPassport in Your dApps
      • Integrating hPassport into Your dApp
      • Implementing Identity Checks in Smart Contracts
        • Country codes
      • Sample Application - Country ID
      • Sample Application - Composable verification level
      • Sample Application - User type
      • Repository Information
    • ⛽Application fees
      • FeeContract.sol
      • Example FeeContract Interactions
      • Case Studies
    • 👷Builders grants program
  • Additional resources
    • 📚Haven1 terminology
  • Quick Links
    • Website
    • Twitter
    • Blog
    • Telegram
    • Customer Support
Powered by GitBook
On this page
  • Deployment Addresses
  • Description
  • Fee Setting Mechanism
  • Fee Collection
  • Fee Distribution
  • Contract Functions Relevant to Fees
  1. Build
  2. Application fees

FeeContract.sol

Understand the fee structure and smart contract implementation on Haven1.

PreviousApplication feesNextExample FeeContract Interactions

Last updated 1 year ago

Deployment Addresses

Implentation: Proxy:

Description

This contract serves as a fundamental component in managing the collection and distribution of application fees. It allows the addition, adjustment, and removal of channels, and it facilitates the proper distribution of fees to designated channels.


Fee Setting Mechanism

Content: In the FeeContract, the base application fee (_fee) is determined by an external Fee Oracle (IFeeOracle). This fee serves as the benchmark for all transaction-related charges within the platform.

Developers can set their fees based on multiples of this base fee. The allowed range is defined by two parameters: _minDevFeeMultiple and _maxDevFeeMultiple. For instance, if the base fee is 10 tokens, and the allowed multiples range from 1 to 3, developers can charge a fee anywhere between 10 to 30 tokens for their services.


Fee Collection

Role: Collecting Application Fees

Content: Application fees are collected automatically during transaction processing. The FeeContract is able to receive fees via its receive() function, emitting a `FeesReceived` event, and is equipped to store these fees safely. Each transaction contributing to the fee pool is a step towards ensuring the robustness and sustainability of the platform. The collected fees remain in the contract until they are distributed to predefined channels.


Fee Distribution

Role: Distributing Collected Fees

Content: Distribution of collected fees is a crucial aspect of the FeeContract. It employs a weighted distribution mechanism, where fees are allocated to different channels (_channels) based on their respective weights (_weights). The distributeFees() function, when called, distributes the accumulated fees proportionally among these channels. This process ensures a fair and equitable distribution of resources, supporting various stakeholders in the ecosystem.


Contract Functions Relevant to Fees

Title: Core Functions for Fee Management

Content: Several key functions within the FeeContract are crucial for managing application fees:

  • updateFee(): Updates the base application fee based on the current directive from the Fee Oracle. Can only be called once per period.

  • setMinFee(uint256 multiple): Sets the minimum fee multiple that developers can charge.

  • setMaxFee(uint256 multiple): Establishes the maximum fee multiple permissible for developer charges.

These functions ensure that the fee structure remains responsive to the ecosystem's needs and market conditions.

In summary, this contract serves as a sophisticated mechanism for managing, collecting, and distributing application fees within a blockchain-based ecosystem. It offers flexibility for developers to set their own fees within a defined range and ensures an orderly distribution of collected fees to designated channels based on predefined weights.\

⛽
0x716C2a405A658F96FCe7E7C2eE81C0C718bb3d76
0xe003BdBa0529ED4E1F2B7f40E4E136904fcaD435