Address Contract Verified
Address
0x84FD87C1EdA342b4dCa52F3a988ee4f6Cc898997
Balance
0 ETH
Nonce
1
Code Size
5399 bytes
Creator
0x0f1a748c...0C3f at tx 0x9503bcbb...8908da
Indexed Transactions
0
Contract Bytecode
5399 bytes
0x608060405234801561001057600080fd5b50600436106101365760003560e01c806340c10f19116100b2578063a457c2d711610081578063c4d66de811610066578063c4d66de81461028f578063dc20f401146102a2578063dd62ed3e146102c557610136565b8063a457c2d714610269578063a9059cbb1461027c57610136565b806340c10f191461021257806370a08231146102255780639386e1971461024e57806395d89b411461026157610136565b806318160ddd1161010957806323b872dd116100ee57806323b872dd146101dd578063313ce567146101f057806339509351146101ff57610136565b806318160ddd146101b657806322e4e61d146101c857610136565b806301ffc9a71461013b57806306fdde03146101635780630754617214610178578063095ea7b3146101a3575b600080fd5b61014e610149366004611392565b6102fe565b60405190151581526020015b60405180910390f35b61016b610339565b60405161015a91906113f3565b60655461018b906001600160a01b031681565b6040516001600160a01b03909116815260200161015a565b61014e6101b13660046112e1565b6103cb565b6035545b60405190815260200161015a565b6101db6101d63660046113d2565b6103e1565b005b61014e6101eb3660046112a6565b61045c565b6040516006815260200161015a565b61014e61020d3660046112e1565b610527565b6101db6102203660046112e1565b61055e565b6101ba610233366004611253565b6001600160a01b031660009081526033602052604090205490565b6101db61025c36600461130a565b610583565b61016b610624565b61014e6102773660046112e1565b610633565b61014e61028a3660046112e1565b6106e6565b6101db61029d366004611253565b6106f3565b61014e6102b036600461137a565b60666020526000908152604090205460ff1681565b6101ba6102d3366004611274565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b7fffffffff00000000000000000000000000000000000000000000000000000000811660009081526067602052604090205460ff165b919050565b60606036805461034890611475565b80601f016020809104026020016040519081016040528092919081815260200182805461037490611475565b80156103c15780601f10610396576101008083540402835291602001916103c1565b820191906000526020600020905b8154815290600101906020018083116103a457829003601f168201915b5050505050905090565b60006103d8338484610976565b50600192915050565b60008181526066602052604090205460ff16156103fd57600080fd5b6000818152606660205260409020805460ff191660011790556104203383610acf565b604051828152339082907f48bc562be531fa6322b3cb3a9333ca19d2e3c63c1793fcb5ce885d02d6e0226e906020015b60405180910390a35050565b6000610469848484610c55565b6001600160a01b0384166000908152603460209081526040808320338452909152902054828110156105085760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61051c8533610517868561145e565b610976565b506001949350505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916103d8918590610517908690611446565b6065546001600160a01b0316331461057557600080fd5b61057f8282610e76565b5050565b6065546001600160a01b0316331461059a57600080fd5b60005b8181101561061f5761060d8383838181106105c857634e487b7160e01b600052603260045260246000fd5b6105de9260206040909202019081019150611253565b8484848181106105fe57634e487b7160e01b600052603260045260246000fd5b90506040020160200135610e76565b80610617816114b0565b91505061059d565b505050565b60606037805461034890611475565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156106cd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016104ff565b6106dc3385610517868561145e565b5060019392505050565b60006103d8338484610c55565b600054610100900460ff168061070c575060005460ff16155b61076f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104ff565b600054610100900460ff16158015610791576000805461ffff19166101011790555b6108056040518060400160405280600b81526020017f5772617070656420484e530000000000000000000000000000000000000000008152506040518060400160405280600481526020017f57484e5300000000000000000000000000000000000000000000000000000000815250610f4e565b606580547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03841617905560676020527f8b4f8c6895117275d329e8ed30ba92c6c3c53384664dcc82cd4f835c59578ec4805460ff1990811660019081179092557f320de971b511c590edbdb4d053cb4234c82e23b43af9779f619ef1dfe3021acb80548216831790557fa5040158746d4488445441cce19480fc9c8df13a77152f05bdd00260ab321f1580548216831790557f6bbfa84437a99a8c7cb49e9118044a1027cc085c87654d988c2a7ad8de295bd980548216831790557fbdb87c87b562ba3985761d50f5b95a2e0bda2fb97a05bf95b4fa29fd47055f5680548216831790557f313ce567000000000000000000000000000000000000000000000000000000006000527fdcdeace6c0399c676e18e16a5b4915826473f2caf8a94efcbd445bde8038774080549091169091179055801561057f576000805461ff00191690555050565b6001600160a01b0383166109f15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016104ff565b6001600160a01b038216610a6d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016104ff565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038216610b4b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016104ff565b6001600160a01b03821660009081526033602052604090205481811015610bda5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016104ff565b610be4828261145e565b6001600160a01b03841660009081526033602052604081209190915560358054849290610c1290849061145e565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610ac2565b6001600160a01b038316610cd15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016104ff565b6001600160a01b038216610d4d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016104ff565b6001600160a01b03831660009081526033602052604090205481811015610ddc5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016104ff565b610de6828261145e565b6001600160a01b038086166000908152603360205260408082209390935590851681529081208054849290610e1c908490611446565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e6891815260200190565b60405180910390a350505050565b6001600160a01b038216610ecc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016104ff565b8060356000828254610ede9190611446565b90915550506001600160a01b03821660009081526033602052604081208054839290610f0b908490611446565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610450565b600054610100900460ff1680610f67575060005460ff16155b610fca5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104ff565b600054610100900460ff16158015610fec576000805461ffff19166101011790555b610ff4611014565b610ffe83836110c7565b801561061f576000805461ff0019169055505050565b600054610100900460ff168061102d575060005460ff16155b6110905760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104ff565b600054610100900460ff161580156110b2576000805461ffff19166101011790555b80156110c4576000805461ff00191690555b50565b600054610100900460ff16806110e0575060005460ff16155b6111435760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104ff565b600054610100900460ff16158015611165576000805461ffff19166101011790555b82516111789060369060208601906111a3565b50815161118c9060379060208501906111a3565b50801561061f576000805461ff0019169055505050565b8280546111af90611475565b90600052602060002090601f0160209004810192826111d15760008555611217565b82601f106111ea57805160ff1916838001178555611217565b82800160010185558215611217579182015b828111156112175782518255916020019190600101906111fc565b50611223929150611227565b5090565b5b808211156112235760008155600101611228565b80356001600160a01b038116811461033457600080fd5b600060208284031215611264578081fd5b61126d8261123c565b9392505050565b60008060408385031215611286578081fd5b61128f8361123c565b915061129d6020840161123c565b90509250929050565b6000806000606084860312156112ba578081fd5b6112c38461123c565b92506112d16020850161123c565b9150604084013590509250925092565b600080604083850312156112f3578182fd5b6112fc8361123c565b946020939093013593505050565b6000806020838503121561131c578182fd5b823567ffffffffffffffff80821115611333578384fd5b818501915085601f830112611346578384fd5b813581811115611354578485fd5b8660208260061b8501011115611368578485fd5b60209290920196919550909350505050565b60006020828403121561138b578081fd5b5035919050565b6000602082840312156113a3578081fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461126d578182fd5b600080604083850312156113e4578182fd5b50508035926020909101359150565b6000602080835283518082850152825b8181101561141f57858101830151858201604001528201611403565b818111156114305783604083870101525b50601f01601f1916929092016040019392505050565b60008219821115611459576114596114cb565b500190565b600082821015611470576114706114cb565b500390565b600181811c9082168061148957607f821691505b602082108114156114aa57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156114c4576114c46114cb565b5060010190565b634e487b7160e01b600052601160045260246000fdfea264697066735822122029b36605170ffc089e196b18e54825485d2f6bd1c2500549343f71898fca20b564736f6c63430008030033
Verified Source Code Full Match
Compiler: v0.8.3+commit.8d00100c
EVM: istanbul
Optimization: Yes (1000 runs)
WhnsTokenV1.sol 101 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import './openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol';
contract WhnsTokenV1 is ERC20Upgradeable {
struct MintArgs {
address to;
uint256 amount;
}
/**
* @dev The address with permission to mint new tokens
*/
address public minter;
/**
* @dev Tracking for used redeem tokens.
*/
mapping(bytes32 => bool) public isRedeemTokenUsed;
/**
* @dev Mapping of interface ids to whether or not it's supported.
*/
mapping(bytes4 => bool) internal _supportedInterfaces;
event TokensRedeemed(
bytes32 indexed redeemToken,
address indexed from,
uint256 amount
);
function initialize(address _minter) public initializer {
__ERC20_init('Wrapped HNS', 'WHNS');
minter = _minter;
_supportedInterfaces[this.supportsInterface.selector] = true; // ERC165 itself
_supportedInterfaces[0x36372b07] = true; // ERC20
_supportedInterfaces[
this.name.selector ^ this.symbol.selector ^ this.decimals.selector
] = true; // ERC20 metadata
_supportedInterfaces[this.name.selector] = true;
_supportedInterfaces[this.symbol.selector] = true;
_supportedInterfaces[this.decimals.selector] = true;
}
function decimals() public pure override returns (uint8) {
return 6;
}
/**
* @dev Mint tokens to an address. Can only be called by the recognized minter.
*
* @param _to The address to mint to
* @param _amount The amount (in dollarydoos) to mint
*/
function mint(address _to, uint256 _amount) external {
require(msg.sender == minter);
_mint(_to, _amount);
}
/**
* @dev Mint tokens to a set of addresses. Can only be called by the recognized
* minter.
*
* @param _mints The set of {to: address, amount: uint256} pairs
*/
function batchMint(MintArgs[] calldata _mints) external {
require(msg.sender == minter);
for (uint256 i = 0; i < _mints.length; i++) {
_mint(_mints[i].to, _mints[i].amount);
}
}
/**
* @dev Allows a token holder to redeem tokens to real HNS in a Namebase account.
* A particular redeem token can only be used once.
*
* @param _amount the number of dollarydoos to redeem
* @param _redeemToken 32 bytes to identify the redemption, provided by Namebase
*/
function redeem(uint256 _amount, bytes32 _redeemToken) external {
require(isRedeemTokenUsed[_redeemToken] == false);
isRedeemTokenUsed[_redeemToken] = true;
_burn(msg.sender, _amount);
emit TokensRedeemed(_redeemToken, msg.sender, _amount);
}
/**
* @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) {
return _supportedInterfaces[_interfaceId];
}
}
ContextUpgradeable.sol 33 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import '../proxy/utils/Initializable.sol';
/*
* @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 ContextUpgradeable is Initializable {
function __Context_init() internal initializer {
__Context_init_unchained();
}
function __Context_init_unchained() internal initializer {}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
uint256[50] private __gap;
}
Initializable.sol 50 lines
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.3;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Modifier to protect an initializer function from being invoked twice.
*/
modifier initializer() {
require(
_initializing || !_initialized,
'Initializable: contract is already initialized'
);
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
}
ERC20Upgradeable.sol 379 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import './IERC20Upgradeable.sol';
import './extensions/IERC20MetadataUpgradeable.sol';
import '../../utils/ContextUpgradeable.sol';
import '../../proxy/utils/Initializable.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.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of 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 ERC20Upgradeable is
Initializable,
ContextUpgradeable,
IERC20Upgradeable,
IERC20MetadataUpgradeable
{
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 defaut 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.
*/
function __ERC20_init(string memory name_, string memory symbol_)
internal
initializer
{
__Context_init_unchained();
__ERC20_init_unchained(name_, symbol_);
}
function __ERC20_init_unchained(string memory name_, string memory symbol_)
internal
initializer
{
_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:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
_transfer(_msgSender(), recipient, 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}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
_approve(_msgSender(), 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}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(
currentAllowance >= amount,
'ERC20: transfer amount exceeds allowance'
);
_approve(sender, _msgSender(), currentAllowance - 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)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][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)
{
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(
currentAllowance >= subtractedValue,
'ERC20: decreased allowance below zero'
);
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is 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:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), 'ERC20: transfer from the zero address');
require(recipient != address(0), 'ERC20: transfer to the zero address');
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, 'ERC20: transfer amount exceeds balance');
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, 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:
*
* - `to` 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;
_balances[account] += amount;
emit Transfer(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');
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(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 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 to 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 {}
uint256[45] private __gap;
}
IERC20Upgradeable.sol 84 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @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 `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @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);
}
IERC20MetadataUpgradeable.sol 27 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '../IERC20Upgradeable.sol';
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
/**
* @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);
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
isRedeemTokenUsed 0xdc20f401 → bool
minter 0x07546172 → address
name 0x06fdde03 → string
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 9 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
batchMint 0x55f919fa
tuple[] _mints
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
initialize 0xc4d66de8
address _minter
mint 0x40c10f19
address _to
uint256 _amount
redeem 0x22e4e61d
uint256 _amount
bytes32 _redeemToken
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
Recent Transactions
No transactions found for this address