Skip to content

About

Production-Ready ERC20 Smart Contract with Role-Based Access Control, Transaction Fees, Pausable Transfers, Supply Cap, and Enterprise-Grade Security Features.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Advanced Token

Production-Ready ERC20 Smart Contract with Role-Based Access Control, Transaction Fees, Pausable Transfers, Supply Cap, and Enterprise-Grade Security Features.


Overview

Advanced Token is a production-oriented ERC20 implementation built with Solidity and OpenZeppelin.

The project demonstrates enterprise blockchain development practices including:

  • Role-Based Access Control (RBAC)
  • Minting Permissions
  • Pausable Transfers
  • Burnable Tokens
  • Supply Cap Management
  • Transaction Fee Mechanism
  • Fee Exclusion System
  • Hardhat Development Environment
  • Automated Testing Support
  • Gas Usage Analysis
  • Coverage Reporting

This repository serves as a showcase of advanced Solidity development practices and smart contract architecture.


Features

ERC20 Standard

Fully compliant ERC20 token implementation.

Mintable

Authorized accounts can mint new tokens.

Burnable

Token holders can burn their tokens.

Pausable

Authorized accounts can pause and resume transfers.

Role-Based Access Control

Supported roles:

  • DEFAULT_ADMIN_ROLE
  • MINTER_ROLE
  • PAUSER_ROLE

Supply Cap

Maximum supply can never exceed the predefined cap.

Transaction Fee System

Supports:

  • Fee Collector Wallet
  • Dynamic Fee Configuration
  • Fee Exclusion List
  • Basis Point Fee Calculation

Security

Built using:

  • OpenZeppelin Contracts
  • AccessControl
  • ReentrancyGuard
  • Solidity 0.8.x Overflow Protection

Technology Stack

Blockchain

  • Ethereum
  • Polygon
  • BNB Chain
  • EVM Compatible Networks

Smart Contracts

  • Solidity 0.8.24
  • OpenZeppelin 5.x

Development

  • Hardhat
  • Ethers v6
  • TypeChain

Testing

  • Chai
  • Hardhat Network Helpers
  • Solidity Coverage

Project Structure

/contracts AdvancedToken.sol

/scripts deploy.js

/test AdvancedToken.test.js

/typechain-types

/hardhat.config.js

/package.json


Installation

Clone repository:

git clone https://github.com/your-username/advanced-token.git

Install dependencies:

npm install

Compile contracts:

npx hardhat compile

Run tests:

npx hardhat test

Generate coverage report:

npx hardhat coverage

Run gas analysis:

REPORT_GAS=true npx hardhat test


Deployment

Local Deployment:

npx hardhat run scripts/deploy.js

Sepolia Deployment:

npx hardhat run scripts/deploy.js --network sepolia


Smart Contract Roles

Admin

Can:

  • Grant Roles
  • Revoke Roles
  • Configure Fees
  • Configure Fee Collector

Minter

Can:

  • Mint Tokens

Pauser

Can:

  • Pause Transfers
  • Resume Transfers

Fee Mechanism

Transaction fees are calculated in basis points.

Example:

100 = 1%

250 = 2.5%

1000 = 10%

Maximum fee allowed:

10%


Example Use Cases

Utility Token

Gaming ecosystems

Loyalty Systems

Customer reward platforms

Metaverse Economies

Digital asset ecosystems

DAO Governance

Community-driven projects

DeFi Protocols

Reward and utility token infrastructure


Security Considerations

  • Built on OpenZeppelin Contracts
  • Uses Role-Based Access Control
  • Supply Cap Protection
  • Fee Protection Logic
  • Reentrancy Protection
  • Solidity Overflow Protection

Independent security review is recommended before mainnet deployment.


Future Improvements

  • UUPS Upgradeability
  • Governance Module
  • Permit (EIP-2612)
  • Snapshot Voting
  • Multi-Signature Administration
  • DAO Integration

Author

Parsa Abolhasani

Blockchain Developer | Smart Contract Engineer | Web3 Developer

GitHub: https://github.com/ParsaAbolhasani

LinkedIn: www.linkedin.com/in/parsa-abolhasani-rad-


License

MIT License

About

Production-Ready ERC20 Smart Contract with Role-Based Access Control, Transaction Fees, Pausable Transfers, Supply Cap, and Enterprise-Grade Security Features.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages