chapter29-code-1

PHOTO EMBED

Thu Mar 30 2023 11:45:22 GMT+0000 (Coordinated Universal Time)

Saved by @RareSkills

contract ExampleERC20 {

	uint256 public constant MAX_SUPPLY = 22_000_000;
	// erc20 code

	function mint(unint256 amount) external {
		require(totalSupply() + amount <= MAX_SUPPLY, "max supply exceeded");
		balanceOf[msg.sender] += amount;

		emit Transfer(address(0), msg.sender, amount);
	}
	// rest of the erc20 code
}
content_copyCOPY