This is an ERC20 token project created using Foundry and OpenZeppelin Contracts.
MyToken is a standard ERC20 token with additional features:
- Token minting (owner only)
- Token burning
- Access control management through Ownable
- Name: MyToken
- Symbol: MTK
- Decimals: 18
- Initial Supply: 1,000,000 tokens
- Standard: ERC20
transfer(address to, uint256 amount)- Transfer tokensapprove(address spender, uint256 amount)- Approve spendingtransferFrom(address from, address to, uint256 amount)- Transfer on behalf of another addressbalanceOf(address account)- Account balanceallowance(address owner, address spender)- Approved amount for spending
mint(address to, uint256 amount)- Mint tokens (owner only)burn(uint256 amount)- Burn own tokensburnFrom(address account, uint256 amount)- Burn tokens from another account (with approval)
# Clone the repository
git clone <repository-url>
cd soldility-cicd-test
# Install dependencies
forge install
# Compile contracts
forge build# Run all tests
forge test
# Run tests with verbose output
forge test -v
# Run specific test
forge test --match-test test_Transfer# Deploy to local network
forge script script/MyToken.s.sol --fork-url http://localhost:8545 --broadcast
# Deploy to testnet (e.g., Sepolia)
forge script script/MyToken.s.sol --fork-url $SEPOLIA_RPC_URL --broadcast --verify├── src/
│ └── MyToken.sol # Main token contract
├── script/
│ └── MyToken.s.sol # Deployment script
├── test/
│ └── MyToken.t.sol # Tests
├── lib/
│ └── openzeppelin-contracts/ # OpenZeppelin libraries
└── foundry.toml # Foundry configuration
The contract uses verified OpenZeppelin libraries:
ERC20.sol- Standard ERC20 implementationOwnable.sol- Access control management
UNLICENSED