// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import {Test} from "forge-std/Test.sol"; import {CompliantFiatToken} from "../../contracts/tokens/CompliantFiatToken.sol"; contract CompliantFiatTokenTest is Test { CompliantFiatToken public token; address public owner; address public admin; address public user1; function setUp() public { owner = address(this); admin = address(this); user1 = address(0x1); token = new CompliantFiatToken( "Euro Coin (Compliant)", "cEURC", 6, "EUR", owner, admin, 1_000_000 * 10**6 ); } function testDecimals() public view { assertEq(token.decimals(), 6); } function testCurrencyCode() public view { assertEq(token.currencyCode(), "EUR"); } function testInitialSupply() public view { assertEq(token.totalSupply(), 1_000_000 * 10**6); assertEq(token.balanceOf(owner), 1_000_000 * 10**6); } function testTransfer() public { uint256 amount = 1000 * 10**6; token.transfer(user1, amount); assertEq(token.balanceOf(user1), amount); assertEq(token.balanceOf(owner), 1_000_000 * 10**6 - amount); } function testPause() public { token.pause(); assertTrue(token.paused()); vm.expectRevert(); token.transfer(user1, 1000 * 10**6); } function testMint() public { token.mint(user1, 5000 * 10**6); assertEq(token.balanceOf(user1), 5000 * 10**6); assertEq(token.totalSupply(), 1_000_000 * 10**6 + 5000 * 10**6); } function testBurn() public { token.burn(1000 * 10**6); assertEq(token.balanceOf(owner), 1_000_000 * 10**6 - 1000 * 10**6); assertEq(token.totalSupply(), 1_000_000 * 10**6 - 1000 * 10**6); } }