Address Contract Verified
Address
0x8d010bf9C26881788b4e6bf5Fd1bdC358c8F90b8
Balance
0 ETH
Nonce
1
Code Size
4060 bytes
Creator
0xFd413e3A...B6dE at tx 0x18c55d5c...695766
Indexed Transactions
0
Contract Bytecode
4060 bytes
0x608060405234801561001057600080fd5b50600436106101425760003560e01c80638f283970116100b8578063a9059cbb1161007c578063a9059cbb146102d0578063c5b66dc9146102e3578063d539139314610309578063d547741f14610330578063dd62ed3e14610343578063ea35f36c1461035657600080fd5b80638f2839701461025657806391d148541461026957806395d89b41146102a25780639dc29fac146102aa578063a457c2d7146102bd57600080fd5b8063282c51f31161010a578063282c51f3146101bc5780632f2ff15d146101e3578063313ce567146101f8578063395093511461020757806340c10f191461021a57806370a082311461022d57600080fd5b806301ffc9a71461014757806306fdde031461016f578063095ea7b31461018457806318160ddd1461019757806323b872dd146101a9575b600080fd5b61015a610155366004610d99565b61037c565b60405190151581526020015b60405180910390f35b61017761038d565b6040516101669190610dca565b61015a610192366004610e34565b61041f565b6003545b604051908152602001610166565b61015a6101b7366004610e5e565b610437565b61019b7fe7ba54b021ea26ee9c797c92a7485e5bb59d2b07365aae349635a1bf8d0bd7af81565b6101f66101f1366004610e9a565b61045b565b005b60405160128152602001610166565b61015a610215366004610e34565b6104c5565b6101f6610228366004610e34565b6104e7565b61019b61023b366004610ec6565b6001600160a01b031660009081526001602052604090205490565b6101f6610264366004610ec6565b610567565b61015a610277366004610e9a565b60009182526006602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61017761067b565b6101f66102b8366004610e34565b61068a565b61015a6102cb366004610e34565b610706565b61015a6102de366004610e34565b610786565b7fe7ba54b021ea26ee9c797c92a7485e5bb59d2b07365aae349635a1bf8d0bd7af61019b565b61019b7f71c3f5d1e4abab6db588a0fd893947888ebf8abda567a125ca9d5845ef22dda581565b6101f661033e366004610e9a565b610794565b61019b610351366004610ee1565b6107fb565b7f71c3f5d1e4abab6db588a0fd893947888ebf8abda567a125ca9d5845ef22dda561019b565b600061038782610826565b92915050565b60606004805461039c90610f0b565b80601f01602080910402602001604051908101604052809291908181526020018280546103c890610f0b565b80156104155780601f106103ea57610100808354040283529160200191610415565b820191906000526020600020905b8154815290600101906020018083116103f857829003601f168201915b5050505050905090565b60003361042d818585610862565b5060019392505050565b600033610445858285610987565b610450858585610a01565b506001949350505050565b600082815260076020908152604080832033845290915290205460ff166104955760405163521128ff60e01b815260040160405180910390fd5b60009182526006602090815260408084206001600160a01b0390931684529190529020805460ff19166001179055565b60003361042d8185856104d883836107fb565b6104e29190610f45565b610862565b336000908152600080516020610f67833981519152602052604090205460ff1615801561053b57506105397f71c3f5d1e4abab6db588a0fd893947888ebf8abda567a125ca9d5845ef22dda533610277565b155b1561055957604051630782484160e21b815260040160405180910390fd5b6105638282610bac565b5050565b336000908152600080516020610f67833981519152602052604090205460ff1615806105b05750336000908152600080516020610f87833981519152602052604090205460ff16155b156105ce5760405163521128ff60e01b815260040160405180910390fd5b336000908152600080516020610f6783398151915260209081526040808320805460ff19908116909155600080516020610f87833981519152909252909120805490911690556001600160a01b0381166106255750565b6001600160a01b03166000908152600080516020610f67833981519152602090815260408083208054600160ff199182168117909255600080516020610f87833981519152909352922080549091169091179055565b60606005805461039c90610f0b565b336000908152600080516020610f87833981519152602052604090205460ff161580156106de57506106dc7fe7ba54b021ea26ee9c797c92a7485e5bb59d2b07365aae349635a1bf8d0bd7af33610277565b155b156106fc57604051630782484160e21b815260040160405180910390fd5b6105638282610c6d565b6000338161071482866107fb565b9050838110156107795760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b6104508286868403610862565b60003361042d818585610a01565b600082815260076020908152604080832033845290915290205460ff166107ce5760405163521128ff60e01b815260040160405180910390fd5b60009182526006602090815260408084206001600160a01b0390931684529190529020805460ff19169055565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b60006301ffc9a760e01b6001600160e01b0319831614806103875750506001600160e01b03191660009081526020819052604090205460ff1690565b6001600160a01b0383166108c45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610770565b6001600160a01b0382166109255760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610770565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b600061099384846107fb565b905060001981146109fb57818110156109ee5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610770565b6109fb8484848403610862565b50505050565b6001600160a01b038316610a655760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610770565b6001600160a01b038216610ac75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610770565b6001600160a01b03831660009081526001602052604090205481811015610b3f5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610770565b6001600160a01b0380851660008181526001602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610b9f9086815260200190565b60405180910390a36109fb565b6001600160a01b038216610c025760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610770565b8060036000828254610c149190610f45565b90915550506001600160a01b0382166000818152600160209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b038216610ccd5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610770565b6001600160a01b03821660009081526001602052604090205481811015610d415760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610770565b6001600160a01b03831660008181526001602090815260408083208686039055600380548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910161097a565b600060208284031215610dab57600080fd5b81356001600160e01b031981168114610dc357600080fd5b9392505050565b600060208083528351808285015260005b81811015610df757858101830151858201604001528201610ddb565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610e2f57600080fd5b919050565b60008060408385031215610e4757600080fd5b610e5083610e18565b946020939093013593505050565b600080600060608486031215610e7357600080fd5b610e7c84610e18565b9250610e8a60208501610e18565b9150604084013590509250925092565b60008060408385031215610ead57600080fd5b82359150610ebd60208401610e18565b90509250929050565b600060208284031215610ed857600080fd5b610dc382610e18565b60008060408385031215610ef457600080fd5b610efd83610e18565b9150610ebd60208401610e18565b600181811c90821680610f1f57607f821691505b602082108103610f3f57634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561038757634e487b7160e01b600052601160045260246000fdfe15e730a082bd931bd9f1fc81c9aa2c9308a74dbdf27de2bec5058a0e60fe64aac9597e0dd7b45d7b4c627952a921a5050cad933a06ad3e737ecde71f09857812a2646970667358221220d37640e95dbc9ed307762d95d08114470a70b5f392fde9ad14457ee342dcf33b64736f6c63430008140033
Verified Source Code Full Match
Compiler: v0.8.20+commit.a1b79de6
EVM: paris
Optimization: Yes (200 runs)
ERC6160Ext20.sol 119 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";
import {IERC6160Ext20, IERC5679Ext20, IERC_ACL_CORE} from "../interfaces/IERC6160Ext20.sol";
/// @notice Thrown if account is not the admin of a given role
error NotRoleAdmin();
/// @notice Thrown if account does not have required permission
error PermissionDenied();
contract ERC6160Ext20 is ERC165Storage, ERC20, IERC6160Ext20 {
/// @notice InterfaceId for ERC6160Ext20
bytes4 private constant IERC6160Ext20_ID = 0xb6ba5da3;
/// @notice The Id of Role required to mint token
bytes32 public constant MINTER_ROLE = keccak256("MINTER ROLE");
/// @notice The Id of Role required to burn token
bytes32 public constant BURNER_ROLE = keccak256("BURNER ROLE");
/// @notice mapping of defined roles in the contract
mapping(bytes32 => mapping(address => bool)) internal _roles;
/// @notice mapping of admins of defined roles
mapping(bytes32 => mapping(address => bool)) internal _rolesAdmin;
constructor(address admin, string memory name, string memory symbol) ERC20(name, symbol) {
_registerInterface(IERC6160Ext20_ID);
_registerInterface(type(IERC5679Ext20).interfaceId);
_registerInterface(type(IERC_ACL_CORE).interfaceId);
_rolesAdmin[MINTER_ROLE][admin] = true;
_rolesAdmin[BURNER_ROLE][admin] = true;
_roles[MINTER_ROLE][admin] = true;
_roles[BURNER_ROLE][admin] = true;
}
/// @notice Mints token to the specified account `_to`
function mint(address _to, uint256 _amount) public {
if (!_isRoleAdmin(MINTER_ROLE) && !hasRole(MINTER_ROLE, _msgSender())) revert PermissionDenied();
super._mint(_to, _amount);
}
/// @notice Burns token associated with the specified account `_from`
function burn(address _from, uint256 _amount) public {
if (!_isRoleAdmin(BURNER_ROLE) && !hasRole(BURNER_ROLE, _msgSender())) revert PermissionDenied();
super._burn(_from, _amount);
}
/// @notice Grants a given role to the specified account
/// @dev This method can only be called from an admin of the given role
/// @param _role The role to set for the account
/// @param _account The account to be granted the specified role
function grantRole(bytes32 _role, address _account) public {
if (!_isRoleAdmin(_role)) revert NotRoleAdmin();
_roles[_role][_account] = true;
}
/// @notice Revokes a given role to the specified account
/// @dev This method can only be called from an admin of the given role
/// @param _role The role to revoke for the account
/// @param _account The account whose role is to be revoked
function revokeRole(bytes32 _role, address _account) public {
if (!_isRoleAdmin(_role)) revert NotRoleAdmin();
_roles[_role][_account] = false;
}
/// @notice Changes the admin account to the provided address
/// @dev This method can only be called from an admin of the given role
/// @param newAdmin Address of the new admin
function changeAdmin(address newAdmin) public {
if (!_isRoleAdmin(MINTER_ROLE) || !_isRoleAdmin(BURNER_ROLE)) revert NotRoleAdmin();
delete _rolesAdmin[MINTER_ROLE][_msgSender()];
delete _rolesAdmin[BURNER_ROLE][_msgSender()];
if (newAdmin == address(0)) {
return;
}
_rolesAdmin[MINTER_ROLE][newAdmin] = true;
_rolesAdmin[BURNER_ROLE][newAdmin] = true;
}
/// @notice EIP-165 style to query for supported interfaces
/// @param _interfaceId The interface-id to query for support
function supportsInterface(bytes4 _interfaceId) public view virtual override(ERC165Storage) returns (bool) {
return super.supportsInterface(_interfaceId);
}
/// @notice Checks that an account has a specified role
/// @param _role The role to query
/// @param _account The account to query for the given role
function hasRole(bytes32 _role, address _account) public view returns (bool) {
return _roles[_role][_account];
}
/// @notice Get the Minter-Role ID
function getMinterRole() public pure returns (bytes32) {
return MINTER_ROLE;
}
/// @notice Get the Burner-Role ID
function getBurnerRole() public pure returns (bytes32) {
return BURNER_ROLE;
}
/**
* INTERNAL FUNCTIONS *
*/
function _isRoleAdmin(bytes32 role) internal view returns (bool) {
return _rolesAdmin[role][_msgSender()];
}
}
ERC20.sol 389 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
ERC165Storage.sol 42 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165Storage.sol)
pragma solidity ^0.8.0;
import "./ERC165.sol";
/**
* @dev Storage based implementation of the {IERC165} interface.
*
* Contracts may inherit from this and call {_registerInterface} to declare
* their support of an interface.
*/
abstract contract ERC165Storage is ERC165 {
/**
* @dev Mapping of interface ids to whether or not it's supported.
*/
mapping(bytes4 => bool) private _supportedInterfaces;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return super.supportsInterface(interfaceId) || _supportedInterfaces[interfaceId];
}
/**
* @dev Registers the contract as an implementer of the interface defined by
* `interfaceId`. Support of the actual ERC165 interface is automatic and
* registering its interface id is not required.
*
* See {IERC165-supportsInterface}.
*
* Requirements:
*
* - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
*/
function _registerInterface(bytes4 interfaceId) internal virtual {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
}
IERC6160Ext20.sol 20 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import {IERC_ACL_CORE} from "./IERCAclCore.sol";
// The EIP-165 identifier of this interface is 0xd0017968
interface IERC5679Ext20 {
function mint(address _to, uint256 _amount) external;
function burn(address _from, uint256 _amount) external;
}
/**
* @dev Interface of the ERC6160 standard, as defined in
* https://github.com/polytope-labs/EIPs/blob/master/EIPS/eip-6160.md.
*
* @author Polytope Labs
*
* The EIP-165 identifier of this interface is 0xbbb8b47e
*/
interface IERC6160Ext20 is IERC5679Ext20, IERC_ACL_CORE {}
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
IERC20Metadata.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERCAclCore.sol 15 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/**
* @dev Interface of the EIP5982 standard, as defined in
* https://github.com/polytope-labs/EIPs/blob/master/EIPS/eip-5982.md
*
* The EIP-165 identifier of this interface is 0x6bb9cd16
*/
interface IERC_ACL_CORE {
function hasRole(bytes32 role, address account) external view returns (bool);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function changeAdmin(address newAdmin) external;
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
Read Contract
BURNER_ROLE 0x282c51f3 → bytes32
MINTER_ROLE 0xd5391393 → bytes32
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
getBurnerRole 0xc5b66dc9 → bytes32
getMinterRole 0xea35f36c → bytes32
hasRole 0x91d14854 → bool
name 0x06fdde03 → string
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 10 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burn 0x9dc29fac
address _from
uint256 _amount
changeAdmin 0x8f283970
address newAdmin
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
grantRole 0x2f2ff15d
bytes32 _role
address _account
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
mint 0x40c10f19
address _to
uint256 _amount
revokeRole 0xd547741f
bytes32 _role
address _account
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
Recent Transactions
No transactions found for this address