// SPDX-License-Identifier: MIT pragma solidity 0.8.29; import "ERC20.sol"; import "Ownable.sol"; /** * Clare (CLA) * - 100,000,000 initial supply minted to dev wallet provided in constructor * - Ownable: owner can mint * - Bridge support: owner can set a bridge address which is allowed to mintFromBridge */ contract Clare is ERC20, Ownable { address public bridge; constructor(address _dev) ERC20("Clare", "CLA") Ownable(_dev) { uint256 initial = 100_000_000 * 10 ** decimals(); _mint(_dev, initial); } /// @notice Owner can mint additional tokens function mint(address to, uint256 amount) external onlyOwner { _mint(to, amount); } /// @notice Set bridge contract that can call mintFromBridge function setBridge(address _bridge) external onlyOwner { bridge = _bridge; } /// @notice Bridge contract mints tokens when tokens are bridged in function mintFromBridge(address to, uint256 amount) external { require(msg.sender == bridge, "Clare: caller is not bridge"); _mint(to, amount); } /// @notice Allow users to burn their tokens function burn(uint256 amount) external { _burn(msg.sender, amount); } }