// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @title MockERC20 * @dev Test ERC20 token for VideoPayment testing */ contract MockERC20 is ERC20, Ownable { uint8 private _decimals; constructor( string memory name, string memory symbol, uint8 decimals_, address initialOwner ) ERC20(name, symbol) Ownable(initialOwner) { _decimals = decimals_; } /** * @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 specified address * @param to Address to mint tokens to * @param amount Amount of tokens to mint */ function mint(address to, uint256 amount) external onlyOwner { _mint(to, amount); } /** * @dev Burn tokens from specified address * @param from Address to burn tokens from * @param amount Amount of tokens to burn */ function burn(address from, uint256 amount) external onlyOwner { _burn(from, amount); } /** * @dev Batch mint tokens to multiple addresses * @param recipients Array of addresses to mint tokens to * @param amounts Array of amounts to mint */ function batchMint( address[] memory recipients, uint256[] memory amounts ) external onlyOwner { require(recipients.length == amounts.length, "Arrays length mismatch"); for (uint256 i = 0; i < recipients.length; i++) { _mint(recipients[i], amounts[i]); } } }