Skip to content

Instantly share code, notes, and snippets.

@arturmartins
Created April 3, 2024 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arturmartins/9b92ff77390d05a46d70355dd6f21e2b to your computer and use it in GitHub Desktop.
Save arturmartins/9b92ff77390d05a46d70355dd6f21e2b to your computer and use it in GitHub Desktop.
Chainlink Bootcamp - Day 3
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import "@openzeppelin/contracts@4.6.0/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts@4.6.0/access/AccessControl.sol";
contract Token is ERC20, AccessControl {
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
constructor() ERC20("Chainlink Bootcamp 2024 Token", "CLBoot24") {
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(MINTER_ROLE, msg.sender);
}
function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) {
_mint(to, amount);
}
function decimals() public pure override returns (uint8) {
return 2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment