Skip to content

suradathb/kmutnbLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started with Create React App

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

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.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

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.

npm run eject

Note: this is a one-way operation. Once you eject, you can't go back!

Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

npm run build fails to minify

EX1

// Allow minters to add more tokens to the contract function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) { _mint(to, amount); }

EX2 Allow the owner to add minters

// 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);
}

}

Start issue fails

--openssl-legacy-provider

truffle migrate --reset --network klaytn

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published