contract GFarmToken is ERC20, AccessControl {

    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");

    constructor() ERC20("Gains", "GFARM") {
        // Set roles to dev => set roles for GFarm & GFarmTrading contracts => renounce roles
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _setupRole(MINTER_ROLE, msg.sender);
        _setupRole(BURNER_ROLE, msg.sender);
    }

    // Mint GFARM tokens (only GFarm & GFarmTrading contracts)
    function mint(address to, uint amount) external {
        require(hasRole(MINTER_ROLE, msg.sender), "Caller is not a minter");
        _mint(to, amount);
    }

    // Burn GFARM tokens (only GFarmTrading contract)
    function burn(address from, uint amount) external {
        require(hasRole(BURNER_ROLE, msg.sender), "Caller is not a burner");
        _burn(from, amount);
    }
}
function burn(address from, uint amount) external {
    require(hasRole(BURNER_ROLE, msg.sender), "Caller is not a burner");
    _burn(from, amount);
}

// Burn GFARM tokens (only GFarmTrading contract)