This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject, you can't go back!
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
// Allow minters to add more tokens to the contract function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) { _mint(to, amount); }
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
// import "../node_modules/@openzeppelin/contracts/access/Ownable.sol"; import "../node_modules/@openzeppelin/contracts/access/AccessControl.sol"; import "../node_modules/@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol";
contract KmutnbToken is ERC20PresetFixedSupply, AccessControl { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
constructor(
address owner
)
ERC20PresetFixedSupply(
"KING MONGKUT'S UNIVERSITY OF TECHNOLOGY NORTH BANGKOK.",
"KMUTNB",
30000000 * 10 ** 18,
owner
)
{
_grantRole(DEFAULT_ADMIN_ROLE, owner);
_grantRole(MINTER_ROLE, owner);
//_setupRole(DEFAULT_ADMIN_ROLE, owner);
//_setupRole(MINTER_ROLE, owner);
}
// Allow minters to add more tokens to the contract
function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) {
_mint(to, amount);
}
// Allow the owner to add minters
function addMinter(address minter) public onlyRole(DEFAULT_ADMIN_ROLE) {
grantRole(MINTER_ROLE, minter);
}
}
--openssl-legacy-provider
truffle migrate --reset --network klaytn