https://github.com/0xfuturistic/mev-tax
🩸 A minimal Solidity library for MEV taxes
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
â—‹CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
â—‹.zenodo.json file
-
â—‹DOI references
-
â—‹Academic publication links
-
â—‹Academic email domains
-
â—‹Institutional organization owner
-
â—‹JOSS paper metadata
-
â—‹Scientific vocabulary similarity
Low similarity (10.3%) to scientific vocabulary
Keywords
Repository
🩸 A minimal Solidity library for MEV taxes
Basic Info
Statistics
- Stars: 59
- Watchers: 1
- Forks: 5
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
🩸 MEV-Tax: A Solidity Library for MEV Taxes
MEV-Tax provides a simple way for developers to incorporate MEV taxes into their contracts, enabling them to automatically capture MEV based on the priority fee.
Features
- Easy integration with existing smart contracts
- Tax calculation based on transaction priority fee
- Customizable tax recipient
- Enables various use cases for MEV mitigation (e.g., DEX routers, AMMs, backrunning auctions)
How it Works
Background: Priority Is All You Need by Dan Robinson and Dave White (Paradigm).
The library calculates a tax amount based on the priority fee per gas of the transaction. When a function with the applyTax() modifier is called, the library tries to transfer a sufficient amount of an ERC20 currency to cover the tax. If that succeeds, the transaction proceeds. Otherwise, the transaction reverts.
Getting Started
- Install the library in your Solidity project
bash forge install 0xfuturistic/mev-tax - Import and inherit
MEVTaxin your smart contractsolidity import {MEVTax} from "mev-tax/src/MEVTax.sol"; Add
MEVTaxto your constructorsolidity constructor() MEVTax(currencyAddress) {}replacingcurrencyAddressby the address of the ERC20 token for paying the MEV tax. The implementation works especially well when this is the address of WETH in the network. For other tokens, an exchange rate from eth may be needed to compute the tax accurately.Apply the
applyTax()modifier to functions where you want to capture MEV
Whoever pays for the tax must have enough amount of currencyAddress to cover the tax and to have approved at least that amount for the contract.
- Optionally, override the
_getTaxAmount()function for a custom tax function
Limitations
The library relies on the assumption of competitive priority ordering, which means it only works for L2s like Base and Optimism, where there's a trusted sequencer, but not for Ethereum Mainnet. Enforcing these rules trustlessly is an open problem.
Contribute & Feedback
Feel free to raise an issue, suggest a feature, or even fork the repository for personal tweaks. If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.
For questions and feedback, you can also reach out via Twitter.
Owner
- Name: diego
- Login: 0xfuturistic
- Kind: user
- Twitter: 0xfuturistic
- Repositories: 1
- Profile: https://github.com/0xfuturistic
new acct
GitHub Events
Total
- Watch event: 3
- Fork event: 1
Last Year
- Watch event: 3
- Fork event: 1
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 1
- Total pull requests: 2
- Average time to close issues: 3 days
- Average time to close pull requests: about 1 month
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 6.0
- Average comments per pull request: 0.5
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 2
- Average time to close issues: 3 days
- Average time to close pull requests: about 1 month
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 6.0
- Average comments per pull request: 0.5
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- zach030 (1)
Pull Request Authors
- zach030 (4)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v4 composite
- foundry-rs/foundry-toolchain v1 composite