Address
0xef6570621b4e7ad12f60ece4fc09608769cdecd9Current Holdings
$0.00
TXs sent
not counted
First Active
2024-03-11
block 19,824,797
Last Active
44 days ago
block 27,214,665
Funded By
not identified
Net worth historyi
No net-worth snapshots recorded yet
exact matchQUESOTokensolc 0.8.24+commit.e11b9ed9runtime exact · creation not verified
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Direct GitHub imports for Remix IDE compatibility
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0/contracts/access/Ownable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0/contracts/access/AccessControl.sol";
contract QUESOToken is ERC20, Ownable, AccessControl {
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant MINTER_BURNER_ROLE = keccak256("MINTER_BURNER_ROLE");
constructor() ERC20("QUESO from Burritos.Cash", "QUESO") {
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
_setupRole(MINTER_ROLE, msg.sender);
_setupRole(MINTER_BURNER_ROLE, msg.sender);
}
function mint(address to, uint256 amount) public {
require(hasRole(MINTER_ROLE, msg.sender) || hasRole(MINTER_BURNER_ROLE, msg.sender), "Caller is not authorized to mint");
_mint(to, amount);
}
function burn(address from, uint256 amount) public {
require(hasRole(MINTER_BURNER_ROLE, msg.sender), "Caller is not authorized to burn");
_burn(from, amount);
}
function transferOwnership(address newOwner) public override onlyOwner {
require(newOwner != address(0), "New owner cannot be the zero address");
super.transferOwnership(newOwner);
grantRole(DEFAULT_ADMIN_ROLE, newOwner);
revokeRole(DEFAULT_ADMIN_ROLE, _msgSender());
}
function renounceOwnership() public override onlyOwner {
// Revoke roles before renouncing ownership to ensure no residual control
revokeRole(DEFAULT_ADMIN_ROLE, _msgSender());
revokeRole(MINTER_ROLE, _msgSender());
revokeRole(MINTER_BURNER_ROLE, _msgSender());
super.transferOwnership(address(0));
}
function getCurrentSupply() public view returns (uint256) {
return totalSupply();
}
}