Address Contract Verified
Address
0x4cfF49d0A19ed6Ff845a9122fa912AbcFB1F68A6
Balance
0 ETH
Nonce
1
Code Size
8291 bytes
Creator
0xF9330bc2...8595 at tx 0x0f891183...cf738d
Indexed Transactions
0
Contract Bytecode
8291 bytes
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c806370a0823111610104578063a9059cbb116100a2578063e4997dc511610071578063e4997dc5146103b8578063f2fde38b146103cb578063f3bdc228146103de578063fe72423f146103f1576101cf565b8063a9059cbb1461036c578063d543dbeb1461037f578063dd62ed3e14610392578063deb76965146103a5576101cf565b806395d89b41116100de57806395d89b41146103245780639ae407e81461032c578063a24835d114610346578063a457c2d714610359576101cf565b806370a0823114610301578063715018a6146103145780638da5cb5b1461031c576101cf565b8063325eaac1116101715780633ecea6b21161014b5780633ecea6b2146102a557806340c10f19146102ba5780634838d165146102cd578063617d7ec2146102e0576101cf565b8063325eaac11461027757806336e8c9b31461027f5780633950935114610292576101cf565b806318160ddd116101ad57806318160ddd1461022757806323b872dd1461023c5780632c0c74aa1461024f578063313ce56714610262576101cf565b806306fdde03146101d4578063095ea7b3146101f25780630ecb93c014610212575b600080fd5b6101dc610404565b6040516101e991906118e1565b60405180910390f35b6102056102003660046117e0565b610496565b6040516101e991906118d6565b6102256102203660046116db565b6104b3565b005b61022f610549565b6040516101e99190611df0565b61020561024a366004611727565b61054f565b61022561025d366004611762565b6105e8565b61026a610724565b6040516101e99190611e31565b61022f610729565b61022561028d366004611823565b61072f565b6102056102a03660046117e0565b610763565b6102ad6107b2565b6040516101e991906118a9565b6102256102c83660046117e0565b6107c1565b6102056102db3660046116db565b61081d565b6102f36102ee366004611823565b610832565b6040516101e9929190611df9565b61022f61030f3660046116db565b610860565b61022561087f565b6102ad6108f8565b6101dc610907565b610334610916565b6040516101e996959493929190611e07565b6102256103543660046117e0565b610a3b565b6102056103673660046117e0565b610a93565b61020561037a3660046117e0565b610b0e565b61022561038d366004611823565b610b22565b61022f6103a03660046116f5565b610b56565b6102256103b336600461183b565b610b81565b6102256103c63660046116db565b610d87565b6102256103d93660046116db565b610e06565b6102256103ec3660046116db565b610eb6565b6102256103ff366004611809565b610f9d565b60606004805461041390611fc1565b80601f016020809104026020016040519081016040528092919081815260200182805461043f90611fc1565b801561048c5780601f106104615761010080835404028352916020019161048c565b820191906000526020600020905b81548152906001019060200180831161046f57829003601f168201915b5050505050905090565b60006104aa6104a3610fdf565b8484610fe3565b50600192915050565b336104bc6108f8565b6001600160a01b0316146104eb5760405162461bcd60e51b81526004016104e290611b73565b60405180910390fd5b6001600160a01b03811660009081526006602052604090819020805460ff19166001179055517f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc9061053e9083906118a9565b60405180910390a150565b60035490565b600061055c848484611097565b6001600160a01b03841660009081526002602052604081208161057d610fdf565b6001600160a01b03166001600160a01b03168152602001908152602001600020549050828110156105c05760405162461bcd60e51b81526004016104e290611b2b565b6105db856105cc610fdf565b6105d68685611faa565b610fe3565b60019150505b9392505050565b336105f16108f8565b6001600160a01b0316146106175760405162461bcd60e51b81526004016104e290611b73565b8281146106365760405162461bcd60e51b81526004016104e290611d00565b600b80546001600160a01b0319166001600160a01b038716179055821561071d5761066360096000611628565b60005b8381101561071b5760098054600101808255600082815291908390811061069d57634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020190508585838181106106cd57634e487b7160e01b600052603260045260246000fd5b60200291909101358255508383838181106106f857634e487b7160e01b600052603260045260246000fd5b90506020020135816001018190555050808061071390611ffc565b915050610666565b505b5050505050565b601290565b600a5481565b336107386108f8565b6001600160a01b03161461075e5760405162461bcd60e51b81526004016104e290611b73565b600d55565b60006104aa610770610fdf565b84846002600061077e610fdf565b6001600160a01b03908116825260208083019390935260409182016000908120918b16815292529020546105d69190611e3f565b600b546001600160a01b031681565b336107ca6108f8565b6001600160a01b0316146107f05760405162461bcd60e51b81526004016104e290611b73565b610819826107fc610724565b61080a9060ff16600a611ebd565b6108149084611f8b565b6112a5565b5050565b60066020526000908152604090205460ff1681565b6009818154811061084257600080fd5b60009182526020909120600490910201805460019091015490915082565b6001600160a01b0381166000908152600160205260409020545b919050565b336108886108f8565b6001600160a01b0316146108ae5760405162461bcd60e51b81526004016104e290611b73565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60606005805461041390611fc1565b6000806000806000806000600a541115610a2057600a5460005b600954811015610a1d5760006009828154811061095d57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060040201905080600001548361097d9190611e3f565b9250824211610a0a57610991826001611e3f565b8154600183015485906002850160006109a8610fdf565b6001600160a01b03168152602081019190915260400160009081205460ff169060038701906109d5610fdf565b6001600160a01b03166001600160a01b0316815260200190815260200160002054985098509850985098509850505050610a33565b5080610a1581611ffc565b915050610930565b50505b5060009450849350839250829150819050805b909192939495565b33610a446108f8565b6001600160a01b031614610a6a5760405162461bcd60e51b81526004016104e290611b73565b61081982610a76610724565b610a849060ff16600a611ebd565b610a8e9084611f8b565b611359565b60008060026000610aa2610fdf565b6001600160a01b0390811682526020808301939093526040918201600090812091881681529252902054905082811015610aee5760405162461bcd60e51b81526004016104e290611d74565b610b04610af9610fdf565b856105d68685611faa565b5060019392505050565b60006104aa610b1b610fdf565b8484611097565b33610b2b6108f8565b6001600160a01b031614610b515760405162461bcd60e51b81526004016104e290611b73565b600c55565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b33610b8a6108f8565b6001600160a01b031614610bb05760405162461bcd60e51b81526004016104e290611b73565b6009548610610bd15760405162461bcd60e51b81526004016104e290611abe565b60008411610bf15760405162461bcd60e51b81526004016104e290611bdf565b60098681548110610c1257634e487b7160e01b600052603260045260246000fd5b9060005260206000209060040201600001548514610c5e578460098781548110610c4c57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600490910201555b60098681548110610c7f57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060040201600101548414610ccf578360098781548110610cb957634e487b7160e01b600052603260045260246000fd5b9060005260206000209060040201600101819055505b60005b82811015610d7e578160098881548110610cfc57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600402016002016000868685818110610d2f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610d4491906116db565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610d7681611ffc565b915050610cd2565b50505050505050565b33610d906108f8565b6001600160a01b031614610db65760405162461bcd60e51b81526004016104e290611b73565b6001600160a01b03811660009081526006602052604090819020805460ff19169055517fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c9061053e9083906118a9565b33610e0f6108f8565b6001600160a01b031614610e355760405162461bcd60e51b81526004016104e290611b73565b6001600160a01b038116610e5b5760405162461bcd60e51b81526004016104e290611a36565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b33610ebf6108f8565b6001600160a01b031614610ee55760405162461bcd60e51b81526004016104e290611b73565b6001600160a01b03811660009081526006602052604090205460ff16610f1d5760405162461bcd60e51b81526004016104e290611d2e565b6000610f2882610860565b6001600160a01b0383166000908152600160205260408120819055600380549293508392909190610f5a908490611faa565b90915550506040517f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c690610f9190849084906118bd565b60405180910390a15050565b33610fa66108f8565b6001600160a01b031614610fcc5760405162461bcd60e51b81526004016104e290611b73565b6008805460ff1916911515919091179055565b3390565b6001600160a01b0383166110095760405162461bcd60e51b81526004016104e290611cbc565b6001600160a01b03821661102f5760405162461bcd60e51b81526004016104e290611a7c565b6001600160a01b0380841660008181526002602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061108a908590611df0565b60405180910390a3505050565b6001600160a01b0383166110bd5760405162461bcd60e51b81526004016104e290611c77565b6001600160a01b0382166110e35760405162461bcd60e51b81526004016104e29061196b565b60085460ff166111d4576110f56108f8565b6001600160a01b0316836001600160a01b03161415801561112f57506111196108f8565b6001600160a01b0316826001600160a01b031614155b15611174576064600c54611141610549565b61114b9190611f8b565b6111559190611e57565b8111156111745760405162461bcd60e51b81526004016104e290611ba8565b6001600160a01b03831660009081526006602052604090205460ff16156111ad5760405162461bcd60e51b81526004016104e290611c0a565b6111b8838383611433565b6001600160a01b03821660009081526007602052604090204290555b6001600160a01b0383166000908152600160205260409020548181101561120d5760405162461bcd60e51b81526004016104e290611ae5565b6112178282611faa565b6001600160a01b03808616600090815260016020526040808220939093559085168152908120805484929061124d908490611e3f565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516112979190611df0565b60405180910390a350505050565b6001600160a01b0382166112cb5760405162461bcd60e51b81526004016104e290611db9565b80600360008282546112dd9190611e3f565b90915550506001600160a01b0382166000908152600160205260408120805483929061130a908490611e3f565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061134d908590611df0565b60405180910390a35050565b6001600160a01b03821661137f5760405162461bcd60e51b81526004016104e290611c36565b6001600160a01b038216600090815260016020526040902054818110156113b85760405162461bcd60e51b81526004016104e2906119f4565b6113c28282611faa565b6001600160a01b038416600090815260016020526040812091909155600380548492906113f0908490611faa565b90915550506040516000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061108a908690611df0565b600b546001600160a01b0316158061144b5750600954155b1561145557611623565b600a541580156114735750600b546001600160a01b03848116911614155b801561148c5750600b546001600160a01b038381169116145b80156114985750600081115b156114a25742600a555b600b546001600160a01b0384811691161480156114cd5750600b546001600160a01b03838116911614155b156116235760006114dc610916565b50505050509050600081111561162157600060096114fb600184611faa565b8154811061151957634e487b7160e01b600052603260045260246000fd5b600091825260208083206001600160a01b03881684526002600490930201918201905260409091205490915060ff166115645760405162461bcd60e51b81526004016104e290611934565b60018101546001600160a01b0385166000908152600383016020526040812054909111156115b9576001600160a01b038516600090815260038301602052604090205460018301546115b69190611faa565b90505b808411156115d95760405162461bcd60e51b81526004016104e2906119ae565b6001600160a01b03851660009081526003830160205260409020546115ff908590611e3f565b6001600160a01b03861660009081526003909301602052604090922091909155505b505b505050565b5080546000825560040290600052602060002090810190611649919061164c565b50565b5b80821115611667576000808255600182015560040161164d565b5090565b80356001600160a01b038116811461087a57600080fd5b60008083601f840112611693578182fd5b50813567ffffffffffffffff8111156116aa578182fd5b60208301915083602080830285010111156116c457600080fd5b9250929050565b8035801515811461087a57600080fd5b6000602082840312156116ec578081fd5b6105e18261166b565b60008060408385031215611707578081fd5b6117108361166b565b915061171e6020840161166b565b90509250929050565b60008060006060848603121561173b578081fd5b6117448461166b565b92506117526020850161166b565b9150604084013590509250925092565b600080600080600060608688031215611779578081fd5b6117828661166b565b9450602086013567ffffffffffffffff8082111561179e578283fd5b6117aa89838a01611682565b909650945060408801359150808211156117c2578283fd5b506117cf88828901611682565b969995985093965092949392505050565b600080604083850312156117f2578182fd5b6117fb8361166b565b946020939093013593505050565b60006020828403121561181a578081fd5b6105e1826116cb565b600060208284031215611834578081fd5b5035919050565b60008060008060008060a08789031215611853578081fd5b863595506020870135945060408701359350606087013567ffffffffffffffff81111561187e578182fd5b61188a89828a01611682565b909450925061189d9050608088016116cb565b90509295509295509295565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6000602080835283518082850152825b8181101561190d578581018301518582016040015282016118f1565b8181111561191e5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252601e908201527f544745202d204275796572206973206e6f742077686974656c69737465640000604082015260600190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526026908201527f544745202d20416d6f756e7420657863656564732077686974656c697374206d6040820152656178696d756d60d01b606082015260800190565b60208082526022908201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604082015261636560f01b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252600d908201526c092dcecc2d8d2c840d2dcc8caf609b1b604082015260600190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601c908201527f4f766572666c6f77206d6178207472616e7366657220616d6f756e7400000000604082015260600190565b602080825260119082015270092dcecc2d8d2c840c2dadeeadce89ac2f607b1b604082015260600190565b602080825260129082015271213630b1b5b634b9ba32b21039b2b63632b960711b604082015260600190565b60208082526021908201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b602080825260149082015273496e76616c69642077686974656c69737428732960601b604082015260600190565b60208082526026908201527f546869732075736572206973206e6f742061206d656d626572206f6620626c6160408201526518dadb1a5cdd60d21b606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604082015264207a65726f60d81b606082015260800190565b6020808252601f908201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604082015260600190565b90815260200190565b918252602082015260400190565b9586526020860194909452604085019290925260608401521515608083015260a082015260c00190565b60ff91909116815260200190565b60008219821115611e5257611e52612017565b500190565b600082611e7257634e487b7160e01b81526012600452602481fd5b500490565b80825b6001808611611e895750611eb4565b818704821115611e9b57611e9b612017565b80861615611ea857918102915b9490941c938002611e7a565b94509492505050565b60006105e16000198484600082611ed6575060016105e1565b81611ee3575060006105e1565b8160018114611ef95760028114611f0357611f30565b60019150506105e1565b60ff841115611f1457611f14612017565b6001841b915084821115611f2a57611f2a612017565b506105e1565b5060208310610133831016604e8410600b8410161715611f63575081810a83811115611f5e57611f5e612017565b6105e1565b611f708484846001611e77565b808604821115611f8257611f82612017565b02949350505050565b6000816000190483118215151615611fa557611fa5612017565b500290565b600082821015611fbc57611fbc612017565b500390565b600281046001821680611fd557607f821691505b60208210811415611ff657634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561201057612010612017565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220e2da6f3f724e6e149c0a275778c54f5fafce2fb3de76c1e5018cba8a7846abf764736f6c63430008000033
Verified Source Code Full Match
Compiler: v0.8.0+commit.c7dfd78e
EVM: istanbul
Optimization: Yes (200 runs)
WadzPayToken.sol 744 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount)
external
returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender)
external
view
returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @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 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) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
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 {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
address msgSender = msg.sender;
_owner = msgSender;
emit OwnershipTransferred(address(0), 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() == msg.sender, "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 {
emit OwnershipTransferred(_owner, address(0));
_owner = 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"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract WadzPayToken is Context, IERC20, IERC20Metadata, Ownable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
mapping(address => bool) public blackList;
mapping(address => uint256) private lastTxTimestamp;
bool private antibotPaused = true;
struct WhitelistRound {
uint256 duration;
uint256 amountMax;
mapping(address => bool) addresses;
mapping(address => uint256) purchased;
}
WhitelistRound[] public _tgeWhitelistRounds;
uint256 public _tgeTimestamp;
address public _tgePairAddress;
uint256 private maxTxPercent = 100;
uint256 private transferDelay = 0;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor() {
_name = "WadzPay Token";
_symbol = "WTK";
_mint(msg.sender, 250000000 * (10**uint256(decimals())));
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account)
public
view
virtual
override
returns (uint256)
{
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender)
public
view
virtual
override
returns (uint256)
{
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(
currentAllowance >= amount,
"ERC20: transfer amount exceeds allowance"
);
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender] + addedValue
);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(
currentAllowance >= subtractedValue,
"ERC20: decreased allowance below zero"
);
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
function mint(address account, uint256 amount) public onlyOwner {
_mint(account, amount * (10**uint256(decimals())));
}
function destroy(address account, uint256 amount) public onlyOwner {
_burn(account, amount * (10**uint256(decimals())));
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if (!antibotPaused) {
if (sender != owner() && recipient != owner()) {
require(
amount <= (totalSupply() * maxTxPercent) / 100,
"Overflow max transfer amount"
);
}
require(!blackList[sender], "Blacklisted seller");
_applyTGEWhitelist(sender, recipient, amount);
lastTxTimestamp[recipient] = block.timestamp;
}
uint256 senderBalance = _balances[sender];
require(
senderBalance >= amount,
"ERC20: transfer amount exceeds balance"
);
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/// @notice
/// Anti bot
/// @notice Add bot address to blacklist
function addBlackList(address _bot) external onlyOwner {
blackList[_bot] = true;
emit AddedBlackList(_bot);
}
/// @notice Remove the address from blacklist
function removeBlackList(address _addr) external onlyOwner {
blackList[_addr] = false;
emit RemovedBlackList(_addr);
}
/// @notice destroy the funds of blacklist
function destroyBlackFunds(address _blackListedUser) external onlyOwner {
require(blackList[_blackListedUser], "This user is not a member of blacklist");
uint dirtyFunds = balanceOf(_blackListedUser);
_balances[_blackListedUser] = 0;
_totalSupply -= dirtyFunds;
emit DestroyedBlackFunds(_blackListedUser, dirtyFunds);
}
event DestroyedBlackFunds(address _blackListedUser, uint _balance);
event AddedBlackList(address _user);
event RemovedBlackList(address _user);
/*
* createTGEWhitelist - Call this after initial Token Generation Event (TGE)
*
* pairAddress - address generated from createPair() event on DEX
* durations - array of durations (seconds) for each whitelist rounds
* amountsMax - array of max amounts (TOKEN decimals) for each whitelist round
*
*/
function createTGEWhitelist(address pairAddress, uint256[] calldata durations, uint256[] calldata amountsMax) external onlyOwner {
require(durations.length == amountsMax.length, "Invalid whitelist(s)");
_tgePairAddress = pairAddress;
if(durations.length > 0) {
delete _tgeWhitelistRounds;
for (uint256 i = 0; i < durations.length; i++) {
_tgeWhitelistRounds.push();
WhitelistRound storage wlRound = _tgeWhitelistRounds[i];
wlRound.duration = durations[i];
wlRound.amountMax = amountsMax[i];
}
}
}
/*
* modifyTGEWhitelistAddresses - Define what addresses are included/excluded from a whitelist round
*
* index - 0-based index of round to modify whitelist
* duration - period in seconds from TGE event or previous whitelist round
* amountMax - max amount (TOKEN decimals) for each whitelist round
*
*/
function modifyTGEWhitelist(uint256 index, uint256 duration, uint256 amountMax, address[] calldata addresses, bool enabled) external onlyOwner {
require(index < _tgeWhitelistRounds.length, "Invalid index");
require(amountMax > 0, "Invalid amountMax");
if(duration != _tgeWhitelistRounds[index].duration)
_tgeWhitelistRounds[index].duration = duration;
if(amountMax != _tgeWhitelistRounds[index].amountMax)
_tgeWhitelistRounds[index].amountMax = amountMax;
for (uint256 i = 0; i < addresses.length; i++) {
_tgeWhitelistRounds[index].addresses[addresses[i]] = enabled;
}
}
/*
* getTGEWhitelistRound
*
* returns:
*
* 1. whitelist round number ( 0 = no active round now )
* 2. duration, in seconds, current whitelist round is active for
* 3. timestamp current whitelist round closes at
* 4. maximum amount a whitelister can purchase in this round
* 5. is caller whitelisted
* 6. how much caller has purchased in current whitelist round
*
*/
function getTGEWhitelistRound() public view returns (uint256, uint256, uint256, uint256, bool, uint256) {
if(_tgeTimestamp > 0) {
uint256 wlCloseTimestampLast = _tgeTimestamp;
for (uint256 i = 0; i < _tgeWhitelistRounds.length; i++) {
WhitelistRound storage wlRound = _tgeWhitelistRounds[i];
wlCloseTimestampLast = wlCloseTimestampLast + wlRound.duration;
if(block.timestamp <= wlCloseTimestampLast)
return (i+1, wlRound.duration, wlCloseTimestampLast, wlRound.amountMax, wlRound.addresses[_msgSender()], wlRound.purchased[_msgSender()]);
}
}
return (0, 0, 0, 0, false, 0);
}
/*
* _applyTGEWhitelist - internal function to be called initially before any transfers
*
*/
function _applyTGEWhitelist(address sender, address recipient, uint256 amount) internal {
if(_tgePairAddress == address(0) || _tgeWhitelistRounds.length == 0)
return;
if(_tgeTimestamp == 0 && sender != _tgePairAddress && recipient == _tgePairAddress && amount > 0)
_tgeTimestamp = block.timestamp;
if(sender == _tgePairAddress && recipient != _tgePairAddress) {
//buying
(uint256 wlRoundNumber,,,,,) = getTGEWhitelistRound();
if(wlRoundNumber > 0) {
WhitelistRound storage wlRound = _tgeWhitelistRounds[wlRoundNumber-1];
require(wlRound.addresses[recipient], "TGE - Buyer is not whitelisted");
uint256 amountRemaining = 0;
if(wlRound.purchased[recipient] < wlRound.amountMax)
amountRemaining = wlRound.amountMax - wlRound.purchased[recipient];
require(amount <= amountRemaining, "TGE - Amount exceeds whitelist maximum");
wlRound.purchased[recipient] = wlRound.purchased[recipient] + amount;
}
}
}
/// @notice Set max transaction percent
function setMaxTxPercent(uint256 _maxTxPercent) external onlyOwner {
maxTxPercent = _maxTxPercent;
}
/// @notice Set transaction time delay
function setTransferDelay(uint256 _transferDelay) external onlyOwner {
transferDelay = _transferDelay;
}
/// @notice Set antibot status
function setAntibotPaused(bool _antibotPaused) external onlyOwner {
antibotPaused = _antibotPaused;
}
}
Read Contract
_tgePairAddress 0x3ecea6b2 → address
_tgeTimestamp 0x325eaac1 → uint256
_tgeWhitelistRounds 0x617d7ec2 → uint256, uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
blackList 0x4838d165 → bool
decimals 0x313ce567 → uint8
getTGEWhitelistRound 0x9ae407e8 → uint256, uint256, uint256, uint256, bool, uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 17 functions
These functions modify contract state and require a wallet transaction to execute.
addBlackList 0x0ecb93c0
address _bot
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
createTGEWhitelist 0x2c0c74aa
address pairAddress
uint256[] durations
uint256[] amountsMax
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
destroy 0xa24835d1
address account
uint256 amount
destroyBlackFunds 0xf3bdc228
address _blackListedUser
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
mint 0x40c10f19
address account
uint256 amount
modifyTGEWhitelist 0xdeb76965
uint256 index
uint256 duration
uint256 amountMax
address[] addresses
bool enabled
removeBlackList 0xe4997dc5
address _addr
renounceOwnership 0x715018a6
No parameters
setAntibotPaused 0xfe72423f
bool _antibotPaused
setMaxTxPercent 0xd543dbeb
uint256 _maxTxPercent
setTransferDelay 0x36e8c9b3
uint256 _transferDelay
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Token Balances (3)
View Transfers →Recent Transactions
No transactions found for this address