From 987711d4af48e1ce98925ada3a46869445d15199 Mon Sep 17 00:00:00 2001 From: cebgcontract <99630598+cebgcontract@users.noreply.github.com> Date: Tue, 22 Feb 2022 12:44:33 +0800 Subject: [PATCH] add begold --- contracts/BEGold.sol | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 contracts/BEGold.sol diff --git a/contracts/BEGold.sol b/contracts/BEGold.sol new file mode 100644 index 0000000..3590840 --- /dev/null +++ b/contracts/BEGold.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.10; +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; +import "@openzeppelin/contracts/security/Pausable.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; +/** + * this contract will transfer ownership to BETimelockController after deployed + * all onlyowner method would add timelock + */ +contract BEGold is ERC20, ERC20Burnable, Pausable, Ownable { + + uint256 public constant INITIALIZED_CAP = 100000000 * 1e18; + + constructor() ERC20("Crypto Elite's Gold", "CEG") { + _mint(msg.sender, INITIALIZED_CAP); + } + + function pause() public onlyOwner { + _pause(); + } + + function unpause() public onlyOwner { + _unpause(); + } + + function mint(address to, uint256 amount) public onlyOwner { + _mint(to, amount); + } + + function _beforeTokenTransfer(address from, address to, uint256 amount) + internal + whenNotPaused + override + { + super._beforeTokenTransfer(from, to, amount); + } +} \ No newline at end of file