123456789101112131415161718192021222324252627282930313233343536373839 |
- // SPDX-License-Identifier: MIT
- pragma solidity ^0.8.24;
- import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
- import "@openzeppelin/contracts/access/Ownable.sol";
- /**
- * @title MockUSD1
- * @dev Mock USD1 token for testing purposes
- */
- contract MockUSD1 is ERC20, Ownable {
- uint8 private _decimals = 18; // Standard ERC20 has 18 decimals
- constructor() ERC20("Mock USD1", "mUSD1") Ownable(msg.sender) {
- // Mint initial supply to deployer
- _mint(msg.sender, 1000000 * 10**18); // 1M USD1
- }
- /**
- * @dev Returns the number of decimals used to get its user representation.
- */
- function decimals() public view virtual override returns (uint8) {
- return _decimals;
- }
- /**
- * @dev Mint tokens to a specific address (only owner)
- */
- function mint(address to, uint256 amount) public onlyOwner {
- _mint(to, amount);
- }
- /**
- * @dev Burn tokens from caller
- */
- function burn(uint256 amount) public {
- _burn(msg.sender, amount);
- }
- }
|