Deploying HRC20
This tutorial will take you though creating your own HRC20 token. HRC20 is nothing but an ERC20 token deployed on Harmony.
Last updated
Was this helpful?
This tutorial will take you though creating your own HRC20 token. HRC20 is nothing but an ERC20 token deployed on Harmony.
Last updated
Was this helpful?
Was this helpful?
// contracts/GLDToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract GLDToken is ERC20 {
constructor(uint256 initialSupply) ERC20("Gold", "GLD") {
_mint(msg.sender, initialSupply);
}
}function decimals() public view virtual override returns (uint8) {
return 16;
}// contracts/GLDToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
contract GLDToken is ERC20PresetMinterPauser {
constructor(uint256 initialSupply) ERC20PresetMinterPauser("Gold", "GLD") {
_mint(msg.sender, initialSupply);
}
}