Address Contract Partially Verified
Address
0x25C5EcD97Aa0f9C1A66BCF345320183bdf458E29
Balance
0 ETH
Nonce
1
Code Size
7956 bytes
Creator
0x3ed6e862...589C at tx 0x9d4ee181...ab3ce0
Indexed Transactions
0
Contract Bytecode
7956 bytes
0x60806040526004361061026b5760003560e01c806389a3027111610144578063c18bc195116100b6578063dd62ed3e1161007a578063dd62ed3e1461076d578063e2f45605146107b3578063f11a24d3146107c9578063f2fde38b146107df578063f6374342146107ff578063f8b45b051461081557600080fd5b8063c18bc195146106d1578063c8c8ebe4146106f1578063d257b34f14610707578063d85ba06314610727578063dbac26e91461073d57600080fd5b806395d89b411161010857806395d89b41146106315780639c3b4fdc14610646578063a0d82dc51461065c578063a9059cbb14610672578063bbc0c74214610692578063c0246668146106b157600080fd5b806389a302711461059e5780638a8c523c146105be5780638da5cb5b146105d35780638ea5220f146105f1578063924de9b71461061157600080fd5b806349bd5a5e116101dd5780636ddd1713116101a15780636ddd1713146104de57806370a08231146104fe578063715018a614610534578063751039fc146105495780637571336a1461055e5780638236802e1461057e57600080fd5b806349bd5a5e146104215780634a62bb65146104555780634fbee1931461046f57806366ca9b83146104a85780636a486a8e146104c857600080fd5b806318160ddd1161022f57806318160ddd146103705780631816467f1461038f578063203e727e146103af57806323b872dd146103cf57806327c8f835146103ef578063313ce5671461040557600080fd5b806302dbd8f81461027757806306fdde0314610299578063095ea7b3146102c457806310d5de53146102f45780631694505e1461032457600080fd5b3661027257005b600080fd5b34801561028357600080fd5b50610297610292366004611b2a565b61082b565b005b3480156102a557600080fd5b506102ae6108cb565b6040516102bb9190611b4c565b60405180910390f35b3480156102d057600080fd5b506102e46102df366004611bb8565b61095d565b60405190151581526020016102bb565b34801561030057600080fd5b506102e461030f366004611be2565b60146020526000908152604090205460ff1681565b34801561033057600080fd5b506103587f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b6040516001600160a01b0390911681526020016102bb565b34801561037c57600080fd5b506002545b6040519081526020016102bb565b34801561039b57600080fd5b506102976103aa366004611be2565b610973565b3480156103bb57600080fd5b506102976103ca366004611bfd565b6109fa565b3480156103db57600080fd5b506102e46103ea366004611c16565b610a29565b3480156103fb57600080fd5b5061035861dead81565b34801561041157600080fd5b50604051601281526020016102bb565b34801561042d57600080fd5b506103587f0000000000000000000000009742b04058b44125b7895234214c5c8bc6a8770981565b34801561046157600080fd5b50600c546102e49060ff1681565b34801561047b57600080fd5b506102e461048a366004611be2565b6001600160a01b031660009081526013602052604090205460ff1690565b3480156104b457600080fd5b506102976104c3366004611b2a565b610ad3565b3480156104d457600080fd5b5061038160105481565b3480156104ea57600080fd5b50600c546102e49062010000900460ff1681565b34801561050a57600080fd5b50610381610519366004611be2565b6001600160a01b031660009081526020819052604090205490565b34801561054057600080fd5b50610297610b66565b34801561055557600080fd5b506102e4610b9c565b34801561056a57600080fd5b50610297610579366004611c62565b610bd9565b34801561058a57600080fd5b50610297610599366004611c62565b610c2e565b3480156105aa57600080fd5b50600754610358906001600160a01b031681565b3480156105ca57600080fd5b50610297610c83565b3480156105df57600080fd5b506005546001600160a01b0316610358565b3480156105fd57600080fd5b50600854610358906001600160a01b031681565b34801561061d57600080fd5b5061029761062c366004611c95565b610cc0565b34801561063d57600080fd5b506102ae610d06565b34801561065257600080fd5b50610381600e5481565b34801561066857600080fd5b5061038160115481565b34801561067e57600080fd5b506102e461068d366004611bb8565b610d15565b34801561069e57600080fd5b50600c546102e490610100900460ff1681565b3480156106bd57600080fd5b506102976106cc366004611c62565b610d22565b3480156106dd57600080fd5b506102976106ec366004611bfd565b610dab565b3480156106fd57600080fd5b5061038160095481565b34801561071357600080fd5b506102e4610722366004611bfd565b610dda565b34801561073357600080fd5b50610381600d5481565b34801561074957600080fd5b506102e4610758366004611be2565b60066020526000908152604090205460ff1681565b34801561077957600080fd5b50610381610788366004611cb0565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3480156107bf57600080fd5b50610381600a5481565b3480156107d557600080fd5b50610381600f5481565b3480156107eb57600080fd5b506102976107fa366004611be2565b610f31565b34801561080b57600080fd5b5061038160125481565b34801561082157600080fd5b50610381600b5481565b6005546001600160a01b0316331461085e5760405162461bcd60e51b815260040161085590611cda565b60405180910390fd5b601182905560128190556108728183611d25565b6010819055600a10156108c75760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206665657320617420313025206f72206c6573730000006044820152606401610855565b5050565b6060600380546108da90611d3d565b80601f016020809104026020016040519081016040528092919081815260200182805461090690611d3d565b80156109535780601f1061092857610100808354040283529160200191610953565b820191906000526020600020905b81548152906001019060200180831161093657829003601f168201915b5050505050905090565b600061096a338484610fcc565b50600192915050565b6005546001600160a01b0316331461099d5760405162461bcd60e51b815260040161085590611cda565b6008546040516001600160a01b03918216918316907f90b8024c4923d3873ff5b9fcb43d0360d4b9217fa41225d07ba379993552e74390600090a3600880546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b03163314610a245760405162461bcd60e51b815260040161085590611cda565b600955565b6000610a368484846110f0565b6001600160a01b038416600090815260016020908152604080832033845290915290205482811015610abb5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b6064820152608401610855565b610ac88533858403610fcc565b506001949350505050565b6005546001600160a01b03163314610afd5760405162461bcd60e51b815260040161085590611cda565b600e829055600f819055610b118183611d25565b600d819055600a10156108c75760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206665657320617420313025206f72206c6573730000006044820152606401610855565b6005546001600160a01b03163314610b905760405162461bcd60e51b815260040161085590611cda565b610b9a60006117d7565b565b6005546000906001600160a01b03163314610bc95760405162461bcd60e51b815260040161085590611cda565b50600c805460ff19169055600190565b6005546001600160a01b03163314610c035760405162461bcd60e51b815260040161085590611cda565b6001600160a01b03919091166000908152601460205260409020805460ff1916911515919091179055565b6005546001600160a01b03163314610c585760405162461bcd60e51b815260040161085590611cda565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6005546001600160a01b03163314610cad5760405162461bcd60e51b815260040161085590611cda565b600c805462ffff00191662010100179055565b6005546001600160a01b03163314610cea5760405162461bcd60e51b815260040161085590611cda565b600c8054911515620100000262ff000019909216919091179055565b6060600480546108da90611d3d565b600061096a3384846110f0565b6005546001600160a01b03163314610d4c5760405162461bcd60e51b815260040161085590611cda565b6001600160a01b038216600081815260136020908152604091829020805460ff191685151590811790915591519182527f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df7910160405180910390a25050565b6005546001600160a01b03163314610dd55760405162461bcd60e51b815260040161085590611cda565b600b55565b6005546000906001600160a01b03163314610e075760405162461bcd60e51b815260040161085590611cda565b620186a0610e1460025490565b610e1f906001611d77565b610e299190611d96565b821015610e965760405162461bcd60e51b815260206004820152603560248201527f5377617020616d6f756e742063616e6e6f74206265206c6f776572207468616e60448201527410181718181892903a37ba30b61039bab838363c9760591b6064820152608401610855565b6103e8610ea260025490565b610ead906005611d77565b610eb79190611d96565b821115610f235760405162461bcd60e51b815260206004820152603460248201527f5377617020616d6f756e742063616e6e6f742062652068696768657220746861604482015273371018171a92903a37ba30b61039bab838363c9760611b6064820152608401610855565b50600a81905560015b919050565b6005546001600160a01b03163314610f5b5760405162461bcd60e51b815260040161085590611cda565b6001600160a01b038116610fc05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610855565b610fc9816117d7565b50565b6001600160a01b03831661102e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610855565b6001600160a01b03821661108f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610855565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166111165760405162461bcd60e51b815260040161085590611db8565b6001600160a01b03821661113c5760405162461bcd60e51b815260040161085590611dfd565b6001600160a01b03831660009081526006602052604090205460ff1615801561117e57506001600160a01b03821660009081526006602052604090205460ff16155b6111e05760405162461bcd60e51b815260206004820152602d60248201527f4572726f723a20426c61636b6c69737420426f74732f436f6e7472616374732060448201526c6e6f7420416c6c6f776564212160981b6064820152608401610855565b806000036111f9576111f483836000611829565b505050565b600c5460ff16156114d1576005546001600160a01b0384811691161480159061123057506005546001600160a01b03838116911614155b801561124457506001600160a01b03821615155b801561125b57506001600160a01b03821661dead14155b80156112715750600754600160a01b900460ff16155b156114d157600c54610100900460ff16611309576001600160a01b03831660009081526013602052604090205460ff16806112c457506001600160a01b03821660009081526013602052604090205460ff165b6113095760405162461bcd60e51b81526020600482015260166024820152752a3930b234b7339034b9903737ba1030b1ba34bb329760511b6044820152606401610855565b7f0000000000000000000000009742b04058b44125b7895234214c5c8bc6a877096001600160a01b0316836001600160a01b031614801561136357506001600160a01b03821660009081526014602052604090205460ff16155b15611447576009548111156113d85760405162461bcd60e51b815260206004820152603560248201527f427579207472616e7366657220616d6f756e742065786365656473207468652060448201527436b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760591b6064820152608401610855565b600b546001600160a01b0383166000908152602081905260409020546113fe9083611d25565b11156114425760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610855565b6114d1565b6001600160a01b03821660009081526014602052604090205460ff166114d157600b546001600160a01b03831660009081526020819052604090205461148d9083611d25565b11156114d15760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610855565b30600090815260208190526040902054600a54811080159081906114fd5750600c5462010000900460ff165b80156115135750600754600160a01b900460ff16155b801561155057507f0000000000000000000000009742b04058b44125b7895234214c5c8bc6a877096001600160a01b0316846001600160a01b0316145b801561157557506001600160a01b03851660009081526013602052604090205460ff16155b801561159a57506001600160a01b03841660009081526013602052604090205460ff16155b156115c8576007805460ff60a01b1916600160a01b1790556115ba61197e565b6007805460ff60a01b191690555b6007546001600160a01b03861660009081526013602052604090205460ff600160a01b90920482161591168061161657506001600160a01b03851660009081526013602052604090205460ff165b1561161f575060005b600080600083156117c1577f0000000000000000000000009742b04058b44125b7895234214c5c8bc6a877096001600160a01b0316886001600160a01b031614801561166d57506000601054115b156116d357611692606461168c6010548a6119c890919063ffffffff16565b906119db565b9250601054601254846116a59190611d77565b6116af9190611d96565b9150601054601154846116c29190611d77565b6116cc9190611d96565b9050611772565b7f0000000000000000000000009742b04058b44125b7895234214c5c8bc6a877096001600160a01b0316896001600160a01b031614801561171657506000600d54115b1561177257611735606461168c600d548a6119c890919063ffffffff16565b9250600d54600f54846117489190611d77565b6117529190611d96565b9150600d54600e54846117659190611d77565b61176f9190611d96565b90505b821561178357611783893085611829565b81156117b4576117b4307f0000000000000000000000009742b04058b44125b7895234214c5c8bc6a8770984611829565b6117be8388611e40565b96505b6117cc898989611829565b505050505050505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03831661184f5760405162461bcd60e51b815260040161085590611db8565b6001600160a01b0382166118755760405162461bcd60e51b815260040161085590611dfd565b6001600160a01b038316600090815260208190526040902054818110156118ed5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610855565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290611924908490611d25565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161197091815260200190565b60405180910390a350505050565b30600090815260208190526040812054908190036119995750565b600a546119a7906014611d77565b8111156119bf57600a546119bc906014611d77565b90505b610fc9816119e7565b60006119d48284611d77565b9392505050565b60006119d48284611d96565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110611a1c57611a1c611e57565b6001600160a01b039283166020918202929092010152600754825191169082906001908110611a4d57611a4d611e57565b60200260200101906001600160a01b031690816001600160a01b031681525050611a98307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84610fcc565b600854604051635c11d79560e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d811692635c11d79592611af4928792600092889291909116904290600401611e6d565b600060405180830381600087803b158015611b0e57600080fd5b505af1158015611b22573d6000803e3d6000fd5b505050505050565b60008060408385031215611b3d57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611b7957858101830151858201604001528201611b5d565b81811115611b8b576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610f2c57600080fd5b60008060408385031215611bcb57600080fd5b611bd483611ba1565b946020939093013593505050565b600060208284031215611bf457600080fd5b6119d482611ba1565b600060208284031215611c0f57600080fd5b5035919050565b600080600060608486031215611c2b57600080fd5b611c3484611ba1565b9250611c4260208501611ba1565b9150604084013590509250925092565b80358015158114610f2c57600080fd5b60008060408385031215611c7557600080fd5b611c7e83611ba1565b9150611c8c60208401611c52565b90509250929050565b600060208284031215611ca757600080fd5b6119d482611c52565b60008060408385031215611cc357600080fd5b611ccc83611ba1565b9150611c8c60208401611ba1565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008219821115611d3857611d38611d0f565b500190565b600181811c90821680611d5157607f821691505b602082108103611d7157634e487b7160e01b600052602260045260246000fd5b50919050565b6000816000190483118215151615611d9157611d91611d0f565b500290565b600082611db357634e487b7160e01b600052601260045260246000fd5b500490565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b600082821015611e5257611e52611d0f565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ebd5784516001600160a01b031683529383019391830191600101611e98565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220e682a34c66858cfa232a86a4a4b014842fdc3c1c49e5e98f68d20880ee98d91764736f6c634300080f0033
Verified Source Code Partial Match
Compiler: v0.8.15+commit.e14f2714
EVM: london
Optimization: Yes (200 runs)
THEDIE.sol 1067 lines
/*
這是為社區提供的,由 vitalik 提供
This is for the community, courtesy of vitalik
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
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() {
_transferOwnership(_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 {
_transferOwnership(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");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
////// lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol)
/* 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);
}
////// lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol
// OpenZeppelin Contracts v4.4.0 (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);
}
////// lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol
// OpenZeppelin Contracts v4.4.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.zeppelin.solutions/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:
*
* - `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 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 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 {}
}
////// lib/openzeppelin-contracts/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts v4.4.0 (utils/math/SafeMath.sol)
/* pragma solidity ^0.8.0; */
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint256
);
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function factory() external pure returns (address);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
contract THEDIE is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
mapping (address => bool) public blacklisted;
address public constant deadAddress = address(0xdead);
address public USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
bool private swapping;
address public devWallet;
uint256 public maxTransactionAmount;
uint256 public swapTokensAtAmount;
uint256 public maxWallet;
bool public limitsInEffect = true;
bool public tradingActive = false;
bool public swapEnabled = true;
uint256 public buyTotalFees;
uint256 public buyDevFee;
uint256 public buyLiquidityFee;
uint256 public sellTotalFees;
uint256 public sellDevFee;
uint256 public sellLiquidityFee;
/******************/
// exlcude from fees and max transaction amount
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) public _isExcludedMaxTransactionAmount;
event ExcludeFromFees(address indexed account, bool isExcluded);
event devWalletUpdated(
address indexed newWallet,
address indexed oldWallet
);
constructor() ERC20("DIE", unicode"DIE-死") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), USDC);
excludeFromMaxTransaction(address(uniswapV2Pair), true);
uint256 _buyDevFee = 0;
uint256 _buyLiquidityFee = 0;
uint256 _sellDevFee = 0;
uint256 _sellLiquidityFee = 0;
uint256 totalSupply = 1000_000_000 * 1e18;
maxTransactionAmount = totalSupply * 5 / 1000; // 2% from total supply maxTransactionAmountTxn
maxWallet = totalSupply * 10 / 1000; // 2% from total supply maxWallet
swapTokensAtAmount = (totalSupply * 5) / 10000; // 0.05% swap wallet
buyDevFee = _buyDevFee;
buyLiquidityFee = _buyLiquidityFee;
buyTotalFees = buyDevFee + buyLiquidityFee;
sellDevFee = _sellDevFee;
sellLiquidityFee = _sellLiquidityFee;
sellTotalFees = sellDevFee + sellLiquidityFee;
devWallet = address(0x0); //
// exclude from paying fees or having max transaction amount
excludeFromFees(owner(), true);
excludeFromFees(address(this), true);
excludeFromFees(address(0xdead), true);
excludeFromMaxTransaction(owner(), true);
excludeFromMaxTransaction(address(this), true);
excludeFromMaxTransaction(address(0xdead), true);
/*
_mint is an internal function in ERC20.sol that is only called here,
and CANNOT be called ever again
*/
_mint(msg.sender, totalSupply);
}
receive() external payable {}
// once enabled, can never be turned off
function enableTrading() external onlyOwner {
tradingActive = true;
swapEnabled = true;
}
// remove limits after token is stable
function removeLimits() external onlyOwner returns (bool) {
limitsInEffect = false;
return true;
}
// change the minimum amount of tokens to sell from fees
function updateSwapTokensAtAmount(uint256 newAmount)
external
onlyOwner
returns (bool)
{
require(
newAmount >= (totalSupply() * 1) / 100000,
"Swap amount cannot be lower than 0.001% total supply."
);
require(
newAmount <= (totalSupply() * 5) / 1000,
"Swap amount cannot be higher than 0.5% total supply."
);
swapTokensAtAmount = newAmount;
return true;
}
function updateMaxTxnAmount(uint256 newNum) external onlyOwner {
maxTransactionAmount = newNum;
}
function updateMaxWalletAmount(uint256 newNum) external onlyOwner {
maxWallet = newNum;
}
function excludeFromMaxTransaction(address updAds, bool isEx)
public
onlyOwner
{
_isExcludedMaxTransactionAmount[updAds] = isEx;
}
// only use to disable contract sales if absolutely necessary (emergency use only)
function updateSwapEnabled(bool enabled) external onlyOwner {
swapEnabled = enabled;
}
function updateBuyFees(
uint256 _devFee,
uint256 _liquidityFee
) external onlyOwner {
buyDevFee = _devFee;
buyLiquidityFee = _liquidityFee;
buyTotalFees = buyDevFee + buyLiquidityFee;
require(buyTotalFees <= 10, "Must keep fees at 10% or less");
}
function updateSellFees(
uint256 _devFee,
uint256 _liquidityFee
) external onlyOwner {
sellDevFee = _devFee;
sellLiquidityFee = _liquidityFee;
sellTotalFees = sellDevFee + sellLiquidityFee;
require(sellTotalFees <= 10, "Must keep fees at 10% or less");
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
_isExcludedFromFees[account] = excluded;
emit ExcludeFromFees(account, excluded);
}
//To Block Bots to trade
function blacklistBot(address _adr,bool _status) public onlyOwner {
blacklisted[_adr] = _status;
}
function updateDevWallet(address newDevWallet)
external
onlyOwner
{
emit devWalletUpdated(newDevWallet, devWallet);
devWallet = newDevWallet;
}
function isExcludedFromFees(address account) public view returns (bool) {
return _isExcludedFromFees[account];
}
function _transfer(
address from,
address to,
uint256 amount
) internal override {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(!blacklisted[from] && !blacklisted[to],"Error: Blacklist Bots/Contracts not Allowed!!");
if (amount == 0) {
super._transfer(from, to, 0);
return;
}
if (limitsInEffect) {
if (
from != owner() &&
to != owner() &&
to != address(0) &&
to != address(0xdead) &&
!swapping
) {
if (!tradingActive) {
require(
_isExcludedFromFees[from] || _isExcludedFromFees[to],
"Trading is not active."
);
}
// at launch if the transfer delay is enabled, ensure the block timestamps for purchasers is set -- during launch.
//when buy
if (
from == uniswapV2Pair &&
!_isExcludedMaxTransactionAmount[to]
) {
require(
amount <= maxTransactionAmount,
"Buy transfer amount exceeds the maxTransactionAmount."
);
require(
amount + balanceOf(to) <= maxWallet,
"Max wallet exceeded"
);
}
else if (!_isExcludedMaxTransactionAmount[to]) {
require(
amount + balanceOf(to) <= maxWallet,
"Max wallet exceeded"
);
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if (
canSwap &&
swapEnabled &&
!swapping &&
to == uniswapV2Pair &&
!_isExcludedFromFees[from] &&
!_isExcludedFromFees[to]
) {
swapping = true;
swapBack();
swapping = false;
}
bool takeFee = !swapping;
// if any account belongs to _isExcludedFromFee account then remove the fee
if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
}
uint256 fees = 0;
uint256 tokensForLiquidity = 0;
uint256 tokensForDev = 0;
// only take fees on buys/sells, do not take on wallet transfers
if (takeFee) {
// on sell
if (to == uniswapV2Pair && sellTotalFees > 0) {
fees = amount.mul(sellTotalFees).div(100);
tokensForLiquidity = (fees * sellLiquidityFee) / sellTotalFees;
tokensForDev = (fees * sellDevFee) / sellTotalFees;
}
// on buy
else if (from == uniswapV2Pair && buyTotalFees > 0) {
fees = amount.mul(buyTotalFees).div(100);
tokensForLiquidity = (fees * buyLiquidityFee) / buyTotalFees;
tokensForDev = (fees * buyDevFee) / buyTotalFees;
}
if (fees> 0) {
super._transfer(from, address(this), fees);
}
if (tokensForLiquidity > 0) {
super._transfer(address(this), uniswapV2Pair, tokensForLiquidity);
}
amount -= fees;
}
super._transfer(from, to, amount);
}
function swapTokensForUSDC(uint256 tokenAmount) private {
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = USDC;
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of USDC
path,
devWallet,
block.timestamp
);
}
function swapBack() private {
uint256 contractBalance = balanceOf(address(this));
if (contractBalance == 0) {
return;
}
if (contractBalance > swapTokensAtAmount * 20) {
contractBalance = swapTokensAtAmount * 20;
}
swapTokensForUSDC(contractBalance);
}
}
Read Contract
USDC 0x89a30271 → address
_isExcludedMaxTransactionAmount 0x10d5de53 → bool
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
blacklisted 0xdbac26e9 → bool
buyDevFee 0x9c3b4fdc → uint256
buyLiquidityFee 0xf11a24d3 → uint256
buyTotalFees 0xd85ba063 → uint256
deadAddress 0x27c8f835 → address
decimals 0x313ce567 → uint8
devWallet 0x8ea5220f → address
isExcludedFromFees 0x4fbee193 → bool
limitsInEffect 0x4a62bb65 → bool
maxTransactionAmount 0xc8c8ebe4 → uint256
maxWallet 0xf8b45b05 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
sellDevFee 0xa0d82dc5 → uint256
sellLiquidityFee 0xf6374342 → uint256
sellTotalFees 0x6a486a8e → uint256
swapEnabled 0x6ddd1713 → bool
swapTokensAtAmount 0xe2f45605 → uint256
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
tradingActive 0xbbc0c742 → bool
uniswapV2Pair 0x49bd5a5e → address
uniswapV2Router 0x1694505e → address
Write Contract 17 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
blacklistBot 0x8236802e
address _adr
bool _status
enableTrading 0x8a8c523c
No parameters
excludeFromFees 0xc0246668
address account
bool excluded
excludeFromMaxTransaction 0x7571336a
address updAds
bool isEx
removeLimits 0x751039fc
No parameters
returns: bool
renounceOwnership 0x715018a6
No parameters
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateBuyFees 0x66ca9b83
uint256 _devFee
uint256 _liquidityFee
updateDevWallet 0x1816467f
address newDevWallet
updateMaxTxnAmount 0x203e727e
uint256 newNum
updateMaxWalletAmount 0xc18bc195
uint256 newNum
updateSellFees 0x02dbd8f8
uint256 _devFee
uint256 _liquidityFee
updateSwapEnabled 0x924de9b7
bool enabled
updateSwapTokensAtAmount 0xd257b34f
uint256 newAmount
returns: bool
Recent Transactions
No transactions found for this address