Address Contract Partially Verified
Address
0x33bE6AeCAb6b93d6752CaB968505ef05D3117CFe
Balance
0 ETH
Nonce
1
Code Size
6269 bytes
Creator
0xE52D85a4...D9e2 at tx 0x6473a545...da064a
Indexed Transactions
0
Contract Bytecode
6269 bytes
0x6080604052600436106101795760003560e01c8063715018a6116100cb578063a457c2d71161007f578063dd62ed3e11610059578063dd62ed3e146103fa578063f2fde38b14610440578063fbac39511461046057600080fd5b8063a457c2d71461039a578063a9059cbb146103ba578063ad2bb1b3146103da57600080fd5b80638da5cb5b116100b05780638da5cb5b1461033d578063942d468b1461036557806395d89b411461038557600080fd5b8063715018a61461030857806379cc67901461031d57600080fd5b8063313ce5671161012d57806342966c681161010757806342966c681461029d57806361b20d8c146102bd57806370a08231146102d257600080fd5b8063313ce56714610241578063395093511461025d5780633a6364f81461027d57600080fd5b806318160ddd1161015e57806318160ddd146101e0578063186d9d88146101ff57806323b872dd1461022157600080fd5b806306fdde0314610185578063095ea7b3146101b057600080fd5b3661018057005b600080fd5b34801561019157600080fd5b5061019a610499565b6040516101a7919061176a565b60405180910390f35b3480156101bc57600080fd5b506101d06101cb3660046116bb565b61052b565b60405190151581526020016101a7565b3480156101ec57600080fd5b506002545b6040519081526020016101a7565b34801561020b57600080fd5b5061021f61021a36600461162a565b610541565b005b34801561022d57600080fd5b506101d061023c36600461167f565b6105ed565b34801561024d57600080fd5b50604051601281526020016101a7565b34801561026957600080fd5b506101d06102783660046116bb565b6106ca565b34801561028957600080fd5b5061021f61029836600461162a565b610706565b3480156102a957600080fd5b5061021f6102b8366004611751565b61078f565b3480156102c957600080fd5b5061021f6107f1565b3480156102de57600080fd5b506101f16102ed36600461162a565b6001600160a01b031660009081526020819052604090205490565b34801561031457600080fd5b5061021f6109b7565b34801561032957600080fd5b5061021f6103383660046116bb565b610a1d565b34801561034957600080fd5b506005546040516001600160a01b0390911681526020016101a7565b34801561037157600080fd5b506101d06103803660046116e5565b610a8c565b34801561039157600080fd5b5061019a610c29565b3480156103a657600080fd5b506101d06103b53660046116bb565b610c38565b3480156103c657600080fd5b506101d06103d53660046116bb565b610ce9565b3480156103e657600080fd5b5061021f6103f536600461162a565b610dbc565b34801561040657600080fd5b506101f161041536600461164c565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b34801561044c57600080fd5b5061021f61045b36600461162a565b610ec1565b34801561046c57600080fd5b506101d061047b36600461162a565b6001600160a01b031660009081526006602052604090205460ff1690565b6060600380546104a8906117ee565b80601f01602080910402602001604051908101604052809291908181526020018280546104d4906117ee565b80156105215780601f106104f657610100808354040283529160200191610521565b820191906000526020600020905b81548152906001019060200180831161050457829003601f168201915b5050505050905090565b6000610538338484610fa0565b50600192915050565b6005546001600160a01b031633146105a05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b038116600081815260066020526040808220805460ff19169055519091907f8b013b23a88536ac388362502bb7e856a071b191d4d460cad41b54c88c5d0aaa908390a350565b6001600160a01b038316600090815260066020526040812054849060ff161561064d5760405162461bcd60e51b81526020600482015260126024820152711059191c995cdcc81a5cc8189b1bd8dad95960721b6044820152606401610597565b6001600160a01b03841660009081526006602052604090205460ff16156106b65760405162461bcd60e51b815260206004820152601460248201527f526563697069656e7420697320626c6f636b65640000000000000000000000006044820152606401610597565b6106c18585856110c4565b95945050505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105389185906107019086906117bf565b610fa0565b6005546001600160a01b031633146107605760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610597565b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b3360008181526006602052604090205460ff16156107e45760405162461bcd60e51b81526020600482015260126024820152711059191c995cdcc81a5cc8189b1bd8dad95960721b6044820152606401610597565b6107ed82611183565b5050565b6005546001600160a01b0316331461084b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610597565b6000471161089b5760405162461bcd60e51b815260206004820152601460248201527f4e6f2066756e647320746f2072657472696576650000000000000000000000006044820152606401610597565b6007546001600160a01b031633146109005760405162461bcd60e51b815260206004820152602260248201527f4e6f742077686974656c697374656420666f722066756e642072657472696576604482015261185b60f21b6064820152608401610597565b60006109146005546001600160a01b031690565b6001600160a01b03164760405160006040518083038185875af1925050503d806000811461095e576040519150601f19603f3d011682016040523d82523d6000602084013e610963565b606091505b50509050806109b45760405162461bcd60e51b815260206004820152600f60248201527f5472616e73666572206661696c656400000000000000000000000000000000006044820152606401610597565b50565b6005546001600160a01b03163314610a115760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610597565b610a1b600061118d565b565b6001600160a01b038216600090815260066020526040902054829060ff1615610a7d5760405162461bcd60e51b81526020600482015260126024820152711059191c995cdcc81a5cc8189b1bd8dad95960721b6044820152606401610597565b610a8783836111ec565b505050565b3360008181526006602052604081205490919060ff1615610ae45760405162461bcd60e51b81526020600482015260126024820152711059191c995cdcc81a5cc8189b1bd8dad95960721b6044820152606401610597565b848314610b595760405162461bcd60e51b815260206004820152602660248201527f526563697069656e747320616e6420616d6f756e7473206c656e677468206d6960448201527f736d6174636800000000000000000000000000000000000000000000000000006064820152608401610597565b6064851115610bb65760405162461bcd60e51b815260206004820152602360248201527f45786365656473206261746368207472616e73666572206c696d6974206f662060448201526203130360ec1b6064820152608401610597565b60005b85811015610c1c57610c09878783818110610bd657610bd661185a565b9050602002016020810190610beb919061162a565b868684818110610bfd57610bfd61185a565b90506020020135610ce9565b5080610c1481611829565b915050610bb9565b5060019695505050505050565b6060600480546104a8906117ee565b3360009081526001602090815260408083206001600160a01b038616845290915281205482811015610cd25760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610597565b610cdf3385858403610fa0565b5060019392505050565b3360008181526006602052604081205490919060ff1615610d415760405162461bcd60e51b81526020600482015260126024820152711059191c995cdcc81a5cc8189b1bd8dad95960721b6044820152606401610597565b6001600160a01b03841660009081526006602052604090205460ff1615610daa5760405162461bcd60e51b815260206004820152601460248201527f526563697069656e7420697320626c6f636b65640000000000000000000000006044820152606401610597565b610db4848461126d565b949350505050565b6005546001600160a01b03163314610e165760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610597565b6001600160a01b038116331415610e6f5760405162461bcd60e51b815260206004820152601560248201527f43616e6e6f7420626c6f636b20796f757273656c6600000000000000000000006044820152606401610597565b6001600160a01b038116600081815260066020526040808220805460ff1916600190811790915590519092917f8b013b23a88536ac388362502bb7e856a071b191d4d460cad41b54c88c5d0aaa91a350565b6005546001600160a01b03163314610f1b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610597565b6001600160a01b038116610f975760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610597565b6109b48161118d565b6001600160a01b0383166110025760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610597565b6001600160a01b0382166110635760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610597565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006110d1848484611276565b6001600160a01b03841660009081526001602090815260408083203384529091529020548281101561116b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e63650000000000000000000000000000000000000000000000006064820152608401610597565b6111788533858403610fa0565b506001949350505050565b6109b43382611474565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006111f88333610415565b9050818110156112565760405162461bcd60e51b8152602060048201526024808201527f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f77604482015263616e636560e01b6064820152608401610597565b6112638333848403610fa0565b610a878383611474565b60006105383384845b6001600160a01b0383166112f25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610597565b6001600160a01b0382166113545760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610597565b6001600160a01b038316600090815260208190526040902054818110156113e35760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610597565b6001600160a01b0380851660009081526020819052604080822085850390559185168152908120805484929061141a9084906117bf565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161146691815260200190565b60405180910390a350505050565b6001600160a01b0382166114d45760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610597565b6001600160a01b038216600090815260208190526040902054818110156115485760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610597565b6001600160a01b03831660009081526020819052604081208383039055600280548492906115779084906117d7565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b80356001600160a01b03811681146115d957600080fd5b919050565b60008083601f8401126115f057600080fd5b50813567ffffffffffffffff81111561160857600080fd5b6020830191508360208260051b850101111561162357600080fd5b9250929050565b60006020828403121561163c57600080fd5b611645826115c2565b9392505050565b6000806040838503121561165f57600080fd5b611668836115c2565b9150611676602084016115c2565b90509250929050565b60008060006060848603121561169457600080fd5b61169d846115c2565b92506116ab602085016115c2565b9150604084013590509250925092565b600080604083850312156116ce57600080fd5b6116d7836115c2565b946020939093013593505050565b600080600080604085870312156116fb57600080fd5b843567ffffffffffffffff8082111561171357600080fd5b61171f888389016115de565b9096509450602087013591508082111561173857600080fd5b50611745878288016115de565b95989497509550505050565b60006020828403121561176357600080fd5b5035919050565b600060208083528351808285015260005b818110156117975785810183015185820160400152820161177b565b818111156117a9576000604083870101525b50601f01601f1916929092016040019392505050565b600082198211156117d2576117d2611844565b500190565b6000828210156117e9576117e9611844565b500390565b600181811c9082168061180257607f821691505b6020821081141561182357634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561183d5761183d611844565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea164736f6c6343000806000a
Verified Source Code Partial Match
Compiler: v0.8.6+commit.11564f7e
EVM: berlin
Optimization: Yes (800 runs)
IONP.sol 111 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.6;
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract IONP is ERC20Burnable, Ownable {
mapping(address => bool) private _blocklist;
address private _fundRetrieveWhitelist;
event Blocklist(address indexed account, bool indexed status);
constructor(
address[] memory accounts,
uint256[] memory amounts,
address owner
) ERC20("Ion Power Token", "IONP") {
transferOwnership(owner);
_mintToWallets(accounts, amounts);
_fundRetrieveWhitelist = owner;
}
function _mintToWallets(address[] memory _accounts, uint256[] memory _amounts) internal {
require(_accounts.length == _amounts.length, "Length mismatch");
for (uint256 i = 0; i < _accounts.length; i++) {
_mint(_accounts[i], _amounts[i]);
}
}
// Blocklist functions
modifier notBlocked(address account) {
require(!_blocklist[account], "Address is blocked");
_;
}
function blockAddress(address account) public onlyOwner {
require(account != msg.sender, "Cannot block yourself");
_blocklist[account] = true;
emit Blocklist(account, true);
}
function unblockAddress(address account) public onlyOwner {
_blocklist[account] = false;
emit Blocklist(account, false);
}
function isBlocked(address account) public view returns (bool) {
return _blocklist[account];
}
// Overriding transfer functions with blocklist check
function transfer(address recipient, uint256 amount)
public
override
notBlocked(msg.sender)
returns (bool)
{
require(!_blocklist[recipient], "Recipient is blocked");
return super.transfer(recipient, amount);
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override notBlocked(sender) returns (bool) {
require(!_blocklist[recipient], "Recipient is blocked");
return super.transferFrom(sender, recipient, amount);
}
// Batch transfer with a limit
function transferArray(address[] calldata recipients, uint256[] calldata amounts)
public
notBlocked(msg.sender)
returns (bool)
{
require(recipients.length == amounts.length, "Recipients and amounts length mismatch");
require(recipients.length <= 100, "Exceeds batch transfer limit of 100");
for (uint256 i = 0; i < recipients.length; i++) {
transfer(recipients[i], amounts[i]);
}
return true;
}
// Retrieve funds function with whitelist
function retrieveFunds() external onlyOwner {
require(address(this).balance > 0, "No funds to retrieve");
require(msg.sender == _fundRetrieveWhitelist, "Not whitelisted for fund retrieval");
(bool success, ) = payable(owner()).call{ value: address(this).balance }("");
require(success, "Transfer failed");
}
function setFundRetrieveWhitelist(address account) public onlyOwner {
_fundRetrieveWhitelist = account;
}
// Burn function
function burn(uint256 amount) public override notBlocked(msg.sender) {
super.burn(amount);
}
function burnFrom(address account, uint256 amount) public override notBlocked(account) {
super.burnFrom(account, amount);
}
// Accept Ether
receive() external payable {}
}
ERC20Burnable.sol 42 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../ERC20.sol";
import "../../../utils/Context.sol";
/**
* @dev Extension of {ERC20} that allows token holders to destroy both their own
* tokens and those that they have an allowance for, in a way that can be
* recognized off-chain (via event analysis).
*/
abstract contract ERC20Burnable is Context, ERC20 {
/**
* @dev Destroys `amount` tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
/**
* @dev Destroys `amount` tokens from `account`, deducting from the caller's
* allowance.
*
* See {ERC20-_burn} and {ERC20-allowance}.
*
* Requirements:
*
* - the caller must have allowance for ``accounts``'s tokens of at least
* `amount`.
*/
function burnFrom(address account, uint256 amount) public virtual {
uint256 currentAllowance = allowance(account, _msgSender());
require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
unchecked {
_approve(account, _msgSender(), currentAllowance - amount);
}
_burn(account, amount);
}
}
Ownable.sol 71 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
ERC20.sol 354 lines
// SPDX-License-Identifier: MIT
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.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 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:
*
* - `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");
unchecked {
_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");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* 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:
*
* - `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");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(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:
*
* - `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;
_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;
}
_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 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 {}
}
Context.sol 23 lines
// SPDX-License-Identifier: MIT
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;
}
}
IERC20.sol 81 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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);
}
IERC20Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
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);
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
isBlocked 0xfbac3951 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 14 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
blockAddress 0xad2bb1b3
address account
burn 0x42966c68
uint256 amount
burnFrom 0x79cc6790
address account
uint256 amount
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
renounceOwnership 0x715018a6
No parameters
retrieveFunds 0x61b20d8c
No parameters
setFundRetrieveWhitelist 0x3a6364f8
address account
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferArray 0x942d468b
address[] recipients
uint256[] amounts
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unblockAddress 0x186d9d88
address account
Recent Transactions
No transactions found for this address