npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@thesnakewitcher/contracts-fees

v0.1.1

Published

fee management contracts

Readme

README

A solidity library for fee management. That is, every dApp usually charge a fee for his services, these library will help you with that.

Architecture

Broadly speaking contracts in these repo can be divided in components, contracts and presets.

  • Components are minimal building blocks used by contracts.
  • Contracts has more complete features for certain use cases but without assuming any security/access mechanism.
  • Presets are ready to use contracts which use predefined security/access mechanism.

Contracts are divided in those designed so they can manage fees for a single contract and the fee charging functionality is part of the inheritor contract(FeeCharger*) and those that manage fees for a set of contract or a complete smart contract system and that functionality wants to be kept external(FeeManager*). In the case of FeeManager* family of contracts they usually enforce and manage a default fee.

Additionally, these contracts are divided in those who charge fees using native cryptocurrency which have Value in their name like FeeChargerValue or FeeManagerValue or those how use ERC20 tokens which have ERC20 in their name like FeeChargerERC20 and FeeManagerERC20.

Lastly is how the amount to charge is managed. The amount could be static, dynamic, operations or internal.

  • The static case is where the fee amount to charge is a predefined parameter or state variable.
  • The dynamic case is where the fee must be calculated in execution time according to certain parameters.
  • The operations case allow to set a fee per function(only external or public make sense).
  • The internal case only for Value related contracts is like static but stored the fees internally.

Example:

  • Contracts FeeChargerValue and FeeChargerERC20 obtain the fee amount to charge by reading a predefined state variable(statically).
  • Contracts FeeChargerValueDynamic and FeeChargerERC20Dynamic calculate the current fee acording to arbitrary parameters(dynamically).
  • Contracts FeeChargerValueOperations and FeeChargerERC20Operations allow to define a fee amount for every function and charge accordingly to current function being called, aditionally allow to define a default fee.