Address Contract Partially Verified
Address
0xB07bfF1BF22fB28C4D5D6d6c463958447F53ecD2
Balance
0 ETH
Nonce
1
Code Size
7903 bytes
Creator
0xFf145b4E...d0c8 at tx 0xed0f3db2...5b3716
Indexed Transactions
0
Contract Bytecode
7903 bytes
0x60806040526004361061024a5760003560e01c8063751039fc11610139578063c18bc195116100b6578063e2f456051161007a578063e2f456051461070c578063f11a24d314610722578063f2fde38b14610738578063f637434214610758578063f8b45b051461076e578063ffc94f901461078457600080fd5b8063c18bc1951461065a578063c8c8ebe41461067a578063d257b34f14610690578063d85ba063146106b0578063dd62ed3e146106c657600080fd5b8063924de9b7116100fd578063924de9b7146105c657806395d89b41146105e6578063a9059cbb146105fb578063bbc0c7421461061b578063c02466681461063a57600080fd5b8063751039fc1461053e5780637571336a14610553578063809d458d146105735780638a8c523c146105935780638da5cb5b146105a857600080fd5b806349bd5a5e116101c75780636a486a8e1161018b5780636a486a8e146104a75780636b2fb124146104bd5780636ddd1713146104d357806370a08231146104f3578063715018a61461052957600080fd5b806349bd5a5e146103ea5780634a62bb651461041e5780634fbee193146104385780635c068a8c1461047157806366ca9b831461048757600080fd5b806318160ddd1161020e57806318160ddd1461034f578063203e727e1461036e57806323b872dd1461038e578063313ce567146103ae5780634626402b146103ca57600080fd5b806302dbd8f81461025657806306fdde0314610278578063095ea7b3146102a357806310d5de53146102d35780631694505e1461030357600080fd5b3661025157005b600080fd5b34801561026257600080fd5b50610276610271366004611af4565b6107a4565b005b34801561028457600080fd5b5061028d610844565b60405161029a9190611b16565b60405180910390f35b3480156102af57600080fd5b506102c36102be366004611b82565b6108d6565b604051901515815260200161029a565b3480156102df57600080fd5b506102c36102ee366004611bac565b60136020526000908152604090205460ff1681565b34801561030f57600080fd5b506103377f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b6040516001600160a01b03909116815260200161029a565b34801561035b57600080fd5b506002545b60405190815260200161029a565b34801561037a57600080fd5b50610276610389366004611bc7565b6108ec565b34801561039a57600080fd5b506102c36103a9366004611be0565b6109c9565b3480156103ba57600080fd5b506040516012815260200161029a565b3480156103d657600080fd5b50600754610337906001600160a01b031681565b3480156103f657600080fd5b506103377f000000000000000000000000d6768d02dbc133475bb6a81579494c2ba7eff26181565b34801561042a57600080fd5b50600b546102c39060ff1681565b34801561044457600080fd5b506102c3610453366004611bac565b6001600160a01b031660009081526012602052604090205460ff1690565b34801561047d57600080fd5b50610360600d5481565b34801561049357600080fd5b506102766104a2366004611af4565b610a73565b3480156104b357600080fd5b50610360600f5481565b3480156104c957600080fd5b5061036060105481565b3480156104df57600080fd5b50600b546102c39062010000900460ff1681565b3480156104ff57600080fd5b5061036061050e366004611bac565b6001600160a01b031660009081526020819052604090205490565b34801561053557600080fd5b50610276610b06565b34801561054a57600080fd5b506102c3610b3c565b34801561055f57600080fd5b5061027661056e366004611c2c565b610b79565b34801561057f57600080fd5b5061027661058e366004611bac565b610bce565b34801561059f57600080fd5b50610276610c55565b3480156105b457600080fd5b506005546001600160a01b0316610337565b3480156105d257600080fd5b506102766105e1366004611c5f565b610c92565b3480156105f257600080fd5b5061028d610cd8565b34801561060757600080fd5b506102c3610616366004611b82565b610ce7565b34801561062757600080fd5b50600b546102c390610100900460ff1681565b34801561064657600080fd5b50610276610655366004611c2c565b610cf4565b34801561066657600080fd5b50610276610675366004611bc7565b610d7d565b34801561068657600080fd5b5061036060085481565b34801561069c57600080fd5b506102c36106ab366004611bc7565b610e4e565b3480156106bc57600080fd5b50610360600c5481565b3480156106d257600080fd5b506103606106e1366004611c7a565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b34801561071857600080fd5b5061036060095481565b34801561072e57600080fd5b50610360600e5481565b34801561074457600080fd5b50610276610753366004611bac565b610fa5565b34801561076457600080fd5b5061036060115481565b34801561077a57600080fd5b50610360600a5481565b34801561079057600080fd5b50600654610337906001600160a01b031681565b6005546001600160a01b031633146107d75760405162461bcd60e51b81526004016107ce90611ca4565b60405180910390fd5b601082905560118190556107eb8183611cef565b600f819055600a10156108405760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206665657320617420313025206f72206c65737300000060448201526064016107ce565b5050565b60606003805461085390611d07565b80601f016020809104026020016040519081016040528092919081815260200182805461087f90611d07565b80156108cc5780601f106108a1576101008083540402835291602001916108cc565b820191906000526020600020905b8154815290600101906020018083116108af57829003601f168201915b5050505050905090565b60006108e3338484611040565b50600192915050565b6005546001600160a01b031633146109165760405162461bcd60e51b81526004016107ce90611ca4565b670de0b6b3a76400006103e861092b60025490565b610936906001611d42565b6109409190611d61565b61094a9190611d61565b8110156109b15760405162461bcd60e51b815260206004820152602f60248201527f43616e6e6f7420736574206d61785472616e73616374696f6e416d6f756e742060448201526e6c6f776572207468616e20302e312560881b60648201526084016107ce565b6109c381670de0b6b3a7640000611d42565b60085550565b60006109d6848484611164565b6001600160a01b038416600090815260016020908152604080832033845290915290205482811015610a5b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084016107ce565b610a688533858403611040565b506001949350505050565b6005546001600160a01b03163314610a9d5760405162461bcd60e51b81526004016107ce90611ca4565b600d829055600e819055610ab18183611cef565b600c819055600a10156108405760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206665657320617420313025206f72206c65737300000060448201526064016107ce565b6005546001600160a01b03163314610b305760405162461bcd60e51b81526004016107ce90611ca4565b610b3a60006117a4565b565b6005546000906001600160a01b03163314610b695760405162461bcd60e51b81526004016107ce90611ca4565b50600b805460ff19169055600190565b6005546001600160a01b03163314610ba35760405162461bcd60e51b81526004016107ce90611ca4565b6001600160a01b03919091166000908152601360205260409020805460ff1916911515919091179055565b6005546001600160a01b03163314610bf85760405162461bcd60e51b81526004016107ce90611ca4565b6007546040516001600160a01b03918216918316907f02f8a1483978974a6412ba3a67040b4daa4fc0dfe9439a7295f9a9538394f63590600090a3600780546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b03163314610c7f5760405162461bcd60e51b81526004016107ce90611ca4565b600b805462ffff00191662010100179055565b6005546001600160a01b03163314610cbc5760405162461bcd60e51b81526004016107ce90611ca4565b600b8054911515620100000262ff000019909216919091179055565b60606004805461085390611d07565b60006108e3338484611164565b6005546001600160a01b03163314610d1e5760405162461bcd60e51b81526004016107ce90611ca4565b6001600160a01b038216600081815260126020908152604091829020805460ff191685151590811790915591519182527f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df7910160405180910390a25050565b6005546001600160a01b03163314610da75760405162461bcd60e51b81526004016107ce90611ca4565b670de0b6b3a76400006103e8610dbc60025490565b610dc7906005611d42565b610dd19190611d61565b610ddb9190611d61565b811015610e365760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f7420736574206d617857616c6c6574206c6f776572207468616e20604482015263302e352560e01b60648201526084016107ce565b610e4881670de0b6b3a7640000611d42565b600a5550565b6005546000906001600160a01b03163314610e7b5760405162461bcd60e51b81526004016107ce90611ca4565b620186a0610e8860025490565b610e93906001611d42565b610e9d9190611d61565b821015610f0a5760405162461bcd60e51b815260206004820152603560248201527f5377617020616d6f756e742063616e6e6f74206265206c6f776572207468616e60448201527410181718181892903a37ba30b61039bab838363c9760591b60648201526084016107ce565b6103e8610f1660025490565b610f21906005611d42565b610f2b9190611d61565b821115610f975760405162461bcd60e51b815260206004820152603460248201527f5377617020616d6f756e742063616e6e6f742062652068696768657220746861604482015273371018171a92903a37ba30b61039bab838363c9760611b60648201526084016107ce565b50600981905560015b919050565b6005546001600160a01b03163314610fcf5760405162461bcd60e51b81526004016107ce90611ca4565b6001600160a01b0381166110345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107ce565b61103d816117a4565b50565b6001600160a01b0383166110a25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ce565b6001600160a01b0382166111035760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ce565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661118a5760405162461bcd60e51b81526004016107ce90611d83565b6001600160a01b0382166111b05760405162461bcd60e51b81526004016107ce90611dc8565b806111c6576111c1838360006117f6565b505050565b600b5460ff161561149e576005546001600160a01b038481169116148015906111fd57506005546001600160a01b03838116911614155b801561121157506001600160a01b03821615155b801561122857506001600160a01b03821661dead14155b801561123e5750600654600160a01b900460ff16155b1561149e57600b54610100900460ff166112d6576001600160a01b03831660009081526012602052604090205460ff168061129157506001600160a01b03821660009081526012602052604090205460ff165b6112d65760405162461bcd60e51b81526020600482015260166024820152752a3930b234b7339034b9903737ba1030b1ba34bb329760511b60448201526064016107ce565b7f000000000000000000000000d6768d02dbc133475bb6a81579494c2ba7eff2616001600160a01b0316836001600160a01b031614801561133057506001600160a01b03821660009081526013602052604090205460ff16155b15611414576008548111156113a55760405162461bcd60e51b815260206004820152603560248201527f427579207472616e7366657220616d6f756e742065786365656473207468652060448201527436b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760591b60648201526084016107ce565b600a546001600160a01b0383166000908152602081905260409020546113cb9083611cef565b111561140f5760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b60448201526064016107ce565b61149e565b6001600160a01b03821660009081526013602052604090205460ff1661149e57600a546001600160a01b03831660009081526020819052604090205461145a9083611cef565b111561149e5760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b60448201526064016107ce565b30600090815260208190526040902054600954811080159081906114ca5750600b5462010000900460ff165b80156114e05750600654600160a01b900460ff16155b801561151d57507f000000000000000000000000d6768d02dbc133475bb6a81579494c2ba7eff2616001600160a01b0316846001600160a01b0316145b801561154257506001600160a01b03851660009081526012602052604090205460ff16155b801561156757506001600160a01b03841660009081526012602052604090205460ff16155b15611595576006805460ff60a01b1916600160a01b17905561158761194b565b6006805460ff60a01b191690555b6006546001600160a01b03861660009081526012602052604090205460ff600160a01b9092048216159116806115e357506001600160a01b03851660009081526012602052604090205460ff165b156115ec575060005b6000806000831561178e577f000000000000000000000000d6768d02dbc133475bb6a81579494c2ba7eff2616001600160a01b0316886001600160a01b031614801561163a57506000600f54115b156116a05761165f6064611659600f548a61199290919063ffffffff16565b906119a5565b9250600f54601154846116729190611d42565b61167c9190611d61565b9150600f546010548461168f9190611d42565b6116999190611d61565b905061173f565b7f000000000000000000000000d6768d02dbc133475bb6a81579494c2ba7eff2616001600160a01b0316896001600160a01b03161480156116e357506000600c54115b1561173f576117026064611659600c548a61199290919063ffffffff16565b9250600c54600e54846117159190611d42565b61171f9190611d61565b9150600c54600d54846117329190611d42565b61173c9190611d61565b90505b8215611750576117508930856117f6565b811561178157611781307f000000000000000000000000d6768d02dbc133475bb6a81579494c2ba7eff261846117f6565b61178b8388611e0b565b96505b6117998989896117f6565b505050505050505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03831661181c5760405162461bcd60e51b81526004016107ce90611d83565b6001600160a01b0382166118425760405162461bcd60e51b81526004016107ce90611dc8565b6001600160a01b038316600090815260208190526040902054818110156118ba5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016107ce565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906118f1908490611cef565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161193d91815260200190565b60405180910390a350505050565b30600090815260208190526040902054806119635750565b600954611971906014611d42565b81111561198957600954611986906014611d42565b90505b61103d816119b1565b600061199e8284611d42565b9392505050565b600061199e8284611d61565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106119e6576119e6611e22565b6001600160a01b039283166020918202929092010152600654825191169082906001908110611a1757611a17611e22565b60200260200101906001600160a01b031690816001600160a01b031681525050611a62307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84611040565b600754604051635c11d79560e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d811692635c11d79592611abe928792600092889291909116904290600401611e38565b600060405180830381600087803b158015611ad857600080fd5b505af1158015611aec573d6000803e3d6000fd5b505050505050565b60008060408385031215611b0757600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611b4357858101830151858201604001528201611b27565b81811115611b55576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610fa057600080fd5b60008060408385031215611b9557600080fd5b611b9e83611b6b565b946020939093013593505050565b600060208284031215611bbe57600080fd5b61199e82611b6b565b600060208284031215611bd957600080fd5b5035919050565b600080600060608486031215611bf557600080fd5b611bfe84611b6b565b9250611c0c60208501611b6b565b9150604084013590509250925092565b80358015158114610fa057600080fd5b60008060408385031215611c3f57600080fd5b611c4883611b6b565b9150611c5660208401611c1c565b90509250929050565b600060208284031215611c7157600080fd5b61199e82611c1c565b60008060408385031215611c8d57600080fd5b611c9683611b6b565b9150611c5660208401611b6b565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008219821115611d0257611d02611cd9565b500190565b600181811c90821680611d1b57607f821691505b60208210811415611d3c57634e487b7160e01b600052602260045260246000fd5b50919050565b6000816000190483118215151615611d5c57611d5c611cd9565b500290565b600082611d7e57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b600082821015611e1d57611e1d611cd9565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e885784516001600160a01b031683529383019391830191600101611e63565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220ff2d358473acf7bbe273df808b65afe7efb393b5b08db4a256a81d280d78196c64736f6c634300080c0033
Verified Source Code Partial Match
Compiler: v0.8.12+commit.f00d7308
EVM: london
Optimization: Yes (200 runs)
CONTRACT.sol 1048 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
pragma experimental ABIEncoderV2;
/**
* @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;
}
}
/**
* @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() {
_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);
}
}
/**
* @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);
}
/**
* @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);
}
/**
* @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 {}
}
/**
* @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 CONTRACT is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
address public pairedToken = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
bool private swapping;
address public treasuryWallet;
uint256 public maxTransactionAmount;
uint256 public swapTokensAtAmount;
uint256 public maxWallet;
bool public limitsInEffect = true;
bool public tradingActive = false;
bool public swapEnabled = false;
uint256 public buyTotalFees;
uint256 public buyTreasuryFee;
uint256 public buyLiquidityFee;
uint256 public sellTotalFees;
uint256 public sellTreasuryFee;
uint256 public sellLiquidityFee;
// exclude from fees and max transaction amount
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) public _isExcludedMaxTransactionAmount;
event ExcludeFromFees(address indexed account, bool isExcluded);
event treasuryWalletUpdated(
address indexed newWallet,
address indexed oldWallet
);
constructor() ERC20("MIKASA TSUKASA", "TSUKASA") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), pairedToken);
excludeFromMaxTransaction(address(uniswapV2Pair), true);
uint256 _buyTreasuryFee = 5;
uint256 _buyLiquidityFee = 0;
uint256 _sellTreasuryFee = 5;
uint256 _sellLiquidityFee = 0;
uint256 totalSupply = 100_000_000 * 1e18;
maxTransactionAmount = totalSupply * 1 / 100; // 1%
maxWallet = totalSupply * 1 / 100; // 5%
swapTokensAtAmount = (totalSupply * 10) / 10000; // 0.10%
buyTreasuryFee = _buyTreasuryFee;
buyLiquidityFee = _buyLiquidityFee;
buyTotalFees = buyTreasuryFee + buyLiquidityFee;
sellTreasuryFee = _sellTreasuryFee;
sellLiquidityFee = _sellLiquidityFee;
sellTotalFees = sellTreasuryFee + sellLiquidityFee;
treasuryWallet = address(0xFf145b4Ef498688B6eF5A88cf79C8c84bb48d0c8); // set as treasury wallet
// 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 {
require(
newNum >= ((totalSupply() * 1) / 1000) / 1e18,
"Cannot set maxTransactionAmount lower than 0.1%"
);
maxTransactionAmount = newNum * (10**18);
}
function updateMaxWalletAmount(uint256 newNum) external onlyOwner {
require(
newNum >= ((totalSupply() * 5) / 1000) / 1e18,
"Cannot set maxWallet lower than 0.5%"
);
maxWallet = newNum * (10**18);
}
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 _treasuryFee,
uint256 _liquidityFee
) external onlyOwner {
buyTreasuryFee = _treasuryFee;
buyLiquidityFee = _liquidityFee;
buyTotalFees = buyTreasuryFee + buyLiquidityFee;
require(buyTotalFees <= 10, "Must keep fees at 10% or less");
}
function updateSellFees(
uint256 _treasuryFee,
uint256 _liquidityFee
) external onlyOwner {
sellTreasuryFee = _treasuryFee;
sellLiquidityFee = _liquidityFee;
sellTotalFees = sellTreasuryFee + 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);
}
function updateTreasuryWallet(address newTreasuryWallet)
external
onlyOwner
{
emit treasuryWalletUpdated(newTreasuryWallet, treasuryWallet);
treasuryWallet = newTreasuryWallet;
}
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");
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 tokensForTreasury = 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;
tokensForTreasury = (fees * sellTreasuryFee) / sellTotalFees;
}
// on buy
else if (from == uniswapV2Pair && buyTotalFees > 0) {
fees = amount.mul(buyTotalFees).div(100);
tokensForLiquidity = (fees * buyLiquidityFee) / buyTotalFees;
tokensForTreasury = (fees * buyTreasuryFee) / 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 swapTokensForPairedToken(uint256 tokenAmount) private {
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = pairedToken;
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of pairedToken
path,
treasuryWallet,
block.timestamp
);
}
function swapBack() private {
uint256 contractBalance = balanceOf(address(this));
if (contractBalance == 0) {
return;
}
if (contractBalance > swapTokensAtAmount * 20) {
contractBalance = swapTokensAtAmount * 20;
}
swapTokensForPairedToken(contractBalance);
}
}
Read Contract
_isExcludedMaxTransactionAmount 0x10d5de53 → bool
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
buyLiquidityFee 0xf11a24d3 → uint256
buyTotalFees 0xd85ba063 → uint256
buyTreasuryFee 0x5c068a8c → uint256
decimals 0x313ce567 → uint8
isExcludedFromFees 0x4fbee193 → bool
limitsInEffect 0x4a62bb65 → bool
maxTransactionAmount 0xc8c8ebe4 → uint256
maxWallet 0xf8b45b05 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
pairedToken 0xffc94f90 → address
sellLiquidityFee 0xf6374342 → uint256
sellTotalFees 0x6a486a8e → uint256
sellTreasuryFee 0x6b2fb124 → uint256
swapEnabled 0x6ddd1713 → bool
swapTokensAtAmount 0xe2f45605 → uint256
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
tradingActive 0xbbc0c742 → bool
treasuryWallet 0x4626402b → address
uniswapV2Pair 0x49bd5a5e → address
uniswapV2Router 0x1694505e → address
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
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 _treasuryFee
uint256 _liquidityFee
updateMaxTxnAmount 0x203e727e
uint256 newNum
updateMaxWalletAmount 0xc18bc195
uint256 newNum
updateSellFees 0x02dbd8f8
uint256 _treasuryFee
uint256 _liquidityFee
updateSwapEnabled 0x924de9b7
bool enabled
updateSwapTokensAtAmount 0xd257b34f
uint256 newAmount
returns: bool
updateTreasuryWallet 0x809d458d
address newTreasuryWallet
Recent Transactions
No transactions found for this address