mirror of
https://github.com/luxfi/precompile.git
synced 2026-09-24 00:26:21 +00:00
docs/ is the Fumadocs site for precompile.lux.network — should not have been deleted. Package READMEs document input/output formats and gas costs referenced by the docs site.
3.4 KiB
3.4 KiB
Dead Precompile (LP-0150)
Address: Multiple (0x0, 0xdead, 0xdEaD...)
Gas Cost: 10,000 base
Status: Implemented
Overview
The Dead Precompile intercepts transfers to "dead" addresses (commonly used for token burns) and routes them to a 50/50 split between:
- Actual Burn (50%) - Value is permanently destroyed (deflationary)
- DAO Treasury (50%) - Value goes to Protocol-Owned Liquidity (POL)
This creates sustainable protocol revenue from burn activities instead of purely destroying value.
Registered Addresses
| Address | Description | ConfigKey |
|---|---|---|
0x0000000000000000000000000000000000000000 |
Zero address | deadZeroConfig |
0x000000000000000000000000000000000000dEaD |
Common dead address | deadConfig |
0xdEaD000000000000000000000000000000000000 |
Full dead prefix | deadFullConfig |
DAO Treasury
Funds are routed to: 0x9011E888251AB053B7bD1cdB598Db4f9DEd94714
This address is on X-Chain and accumulates protocol-owned liquidity.
Split Ratio
| Component | Percentage | BPS |
|---|---|---|
| Burn | 50% | 5000 |
| Treasury | 50% | 5000 |
When values cannot be split evenly (odd wei amounts), the treasury receives the extra wei.
Usage
Direct Interaction
The precompile is automatically invoked when calling or transferring to any registered dead address:
// Solidity - transfer to dead address triggers precompile
address payable dead = payable(0x000000000000000000000000000000000000dEaD);
dead.transfer(1 ether);
// Result: 0.5 ETH burned, 0.5 ETH to treasury
Programmatic Access
package main
import (
"github.com/luxfi/precompile/dead"
"math/big"
)
func main() {
value := big.NewInt(1e18) // 1 ETH
// Check if address is a dead address
if dead.IsDeadAddress(addr) {
burn, treasury := dead.CalculateSplit(value)
// burn = 0.5 ETH
// treasury = 0.5 ETH
}
}
Mechanics
When a transaction targets a dead address:
- EVM recognizes the address as a precompile
DeadPrecompile.Run()is invoked- The
value(ETH sent) is split 50/50 - 50% is left at the dead address (effectively burned)
- 50% is transferred to DAO treasury
- Transaction stats are recorded via event
Events
event DeadReceived(
address indexed sender,
address indexed deadAddress,
uint256 totalValue,
uint256 burnedAmount,
uint256 treasuryAmount
);
Gas Costs
| Operation | Gas |
|---|---|
| Base cost | 10,000 |
| With balance transfer | +21,000 (standard transfer) |
Security Considerations
- Deterministic Split: Split ratio is hardcoded (not configurable) to prevent manipulation
- DAO Treasury: Uses a fixed address, governance changes require contract upgrade
- Reentrancy: The precompile is stateless and doesn't call external contracts in a reentrant manner
- Value Conservation: Total value always equals burn + treasury (verified in tests)
Files
| File | Description |
|---|---|
contract.go |
Core precompile implementation |
contract_test.go |
Unit tests |
module.go |
Module registration |
README.md |
This documentation |