{"repo":"AmirhosseinHonardoust/Safe-Token-Design-Guide","free":true,"listed":false,"github":"https://github.com/AmirhosseinHonardoust/Safe-Token-Design-Guide","clone":"git clone https://github.com/AmirhosseinHonardoust/Safe-Token-Design-Guide.git","description":"A comprehensive guide to designing economically safe ERC-20 tokens using formal invariants and strict permission boundaries. Covers supply caps, fee ceilings, liquidity guarantees, transfer safety, oracle integrity, upgrade control, and economic threat modeling. Focused on real-world DeFi security and robust token design.","language":null,"stars":19,"topics":["audit","best-practices","blockchain","decentralized-finance","defi","economic-security","erc20","ethereum","governance","permission-boundaries"],"license":"MIT","category":"blockchain-web3","readme_excerpt":"Designing Safe Tokens: A Deep Guide to Economic Invariants and Permission Boundaries Why This Matters (More Than People Think) Most people still design tokens like this: “Just fork an ERC-20, add some tax logic, maybe a blacklist, maybe a mint function, ship.” Then they’re surprised when: a “trusted” admin mints infinite tokens fees get changed to 100% and nobody can exit users are selectively blacklisted a manual oracle changes price and liquidations explode upgrades introduce a backdoor All without a single “classic” bug like reentrancy. Economic design errors are now responsible for a huge fraction of real loss in DeFi. So if you want to design tokens that are genuinely safe , you need two big concepts: 1. Economic invariants , what must always hold about supply, fees, liquidity, etc. 2. Permission boundaries , who is allowed to touch those invariants, under what constraints . We’re going to build a mental and practical framework for both. --- 1. Economic Invariants: “Laws of Motion” for Tokens Think of an economic invariant as a law like: “No matter what happens, X must never exceed Y .” If you violate that, the system is no longer safe. 1.1 Types of Economic Invariants Let’s classify the main invariants for ERC-20-style tokens. 1. Supply Invariants Total supply cannot exceed a hard cap. Minting can only happen under specific, transparent rules. Burning must obey clear rules (no arbitrary forced burns). 2. Fee/Tax Invariants Fees must never exceed a given ceiling (e.g., 5","default_branch":null,"files":null,"tree":[],"storefront":"/r/AmirhosseinHonardoust","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/AmirhosseinHonardoust/Safe-Token-Design-Guide/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}