A sophisticated ERC20 token implementation with mining rewards functionality built on the Ethereum blockchain.
- Capped Supply: Token has a maximum supply limit defined at deployment
- Mining Rewards: Miners receive automatic token rewards for block validation
- Ownership Control: Contract includes owner-specific functions for parameter management
- Decimal Support: Full decimal support (18 decimals) for token operations
- Initial Supply: 50,000,000 tokens minted to deployer at contract creation
- Adjustable Block Rewards: Owner can modify mining reward amounts
- Name: MiningToken
- Symbol: MNT
- Decimals: 18
- Initial Supply: 50,000,000 MNT
- Supply Cap: Defined at deployment
The contract inherits from:
ERC20Capped
: Implements maximum supply cap functionalityOwnable
: Provides ownership control mechanismsERC20
: Base token implementation
-
Constructor
- Sets token cap and initial mining reward
- Mints initial supply to contract deployer
-
Mining Reward System
- Automatic reward distribution to miners
- Anti-manipulation checks for miner rewards
- Configurable reward amounts
-
Administrative Functions
setBlockReward
: Allows owner to adjust mining rewards- Protected minting with cap validation
-
Deploy the contract with parameters:
cap_
: Maximum token supplyreward_
: Initial block mining reward
-
Miners automatically receive rewards when processing transactions
-
Contract owner can adjust mining rewards using
setBlockReward
- Supply cap enforcement
- Protected minting mechanism
- Miner reward validation
- Owner-only administrative functions
- OpenZeppelin Contracts v4.x
- ERC20
- ERC20Capped
- Ownable
MIT License