This is a reflection token smart contract built on Ethereum using Solidity ^0.6.12. It implements a deflationary mechanism where token holders automatically receive rewards through reflections from transactions.
- Name: Myth
- Symbol: MYTH
- Decimals: 8
- Total Supply: 10,000,000,000 (100 million * 10^8)
- Contract Standard: ERC-20 compatible with reflection mechanics
- Token holders automatically earn rewards from every transaction
- Reflections are distributed proportionally to all holders based on their token balance
- No staking required - simply hold tokens to earn passive income
- Contract owner can exclude/include addresses from receiving reflections
- Excluded addresses don't earn reflections but can still hold and transfer tokens
- Useful for exchanges, liquidity pools, or other smart contracts
- Currently configured with 0% transfer fee (
tAmount.div(100).mul(0)
) - All transfers are fee-free, making it ideal for everyday transactions
- Fee structure can be modified by updating the
_getTValues
function
- Reflection Engine: Manages the dual balance system (rOwned/tOwned)
- Exclusion System: Handles accounts that don't participate in reflections
- Standard ERC-20 Functions: Full compatibility with ERC-20 standard
- Ownership Controls: Owner-only functions for managing exclusions
reflect(uint256 tAmount)
: Manually distribute tokens to all holdersreflectionFromToken(uint256, bool)
: Calculate reflection value for a token amounttokenFromReflection(uint256)
: Convert reflection amount back to tokensisExcluded(address)
: Check if an address is excluded from reflectionstotalFees()
: View total fees distributed as reflections
excludeAccount(address)
: Exclude an address from receiving reflectionsincludeAccount(address)
: Include a previously excluded address
The contract uses a sophisticated mathematical model:
_rTotal
: Total reflection supply (MAX - (MAX % _tTotal))_rOwned
: Reflection balances for each holder_tOwned
: Token balances for excluded accounts- Rate calculation:
_rTotal / _tTotal
determines conversion rates
The contract handles four different transfer scenarios:
- Standard: Non-excluded to non-excluded
- To Excluded: Non-excluded to excluded account
- From Excluded: Excluded to non-excluded account
- Both Excluded: Between two excluded accounts
- SafeMath Library: Prevents overflow/underflow vulnerabilities
- Address Validation: Checks for zero addresses in transfers and approvals
- Ownership Controls: Critical functions restricted to contract owner
- Reentrancy Protection: Uses checks-effects-interactions pattern
// Check your balance (includes reflections)
uint256 balance = mythToken.balanceOf(userAddress);
// Transfer tokens
mythToken.transfer(recipient, amount);
// Approve spending
mythToken.approve(spender, amount);
// Exclude an exchange from reflections
mythToken.excludeAccount(exchangeAddress);
// Include an address back in reflections
mythToken.includeAccount(userAddress);
- Solidity Version: ^0.6.12
- License: Unlicensed
- Dependencies: OpenZeppelin-style contracts (Context, IERC20, SafeMath, Address, Ownable)
- Reflection Rewards: Holders automatically earn from all transactions
- No Transfer Fees: Currently set to 0% for all transfers
- Owner Privileges: Owner can manage account exclusions
- Gas Optimization: Efficient reflection calculations minimize gas costs
- Smart contract risk: Code should be audited before mainnet deployment
- Owner centralization: Owner has significant control over exclusions
- Reflection complexity: Users should understand how reflections work
- Gas costs: Complex calculations may result in higher gas fees
- Deploy the contract to your preferred Ethereum network
- The deployer automatically becomes the owner and receives all initial tokens
- Configure exclusions for exchanges, pools, or other contracts as needed
- Token holders automatically start earning reflections from transactions
This is an experimental token contract. Please conduct thorough testing and auditing before any mainnet deployment.