Address Contract Verified
Address
0x2a7CAd775fd9C5c43f996A948660fFc21b4e628c
Balance
0 ETH
Nonce
1
Code Size
5831 bytes
Creator
0x46866365...0e46 at tx 0xf72efed4...5f76df
Indexed Transactions
0
Contract Bytecode
5831 bytes
0x608060405234801561001057600080fd5b50600436106102115760003560e01c806383e88ec411610125578063bc086005116100ad578063ea2f0b371161007c578063ea2f0b3714610489578063f2fde38b1461049c578063f4de9ab7146104af578063f5f7b962146104c2578063fe575a87146104d557600080fd5b8063bc0860051461042d578063c7b122b114610440578063db9f76a614610463578063dd62ed3e1461047657600080fd5b806395d89b41116100f457806395d89b41146103e35780639e16606c146103eb578063a457c2d7146103f4578063a9059cbb14610407578063ab8439dd1461041a57600080fd5b806383e88ec4146103a35780638da5cb5b146103ac5780638e2eee84146103bd5780638fbf1e93146103d057600080fd5b8063313ce567116101a85780634a377e1d116101775780634a377e1d146103295780635342acb41461033c57806368c488b31461035f57806370a0823114610372578063715018a61461039b57600080fd5b8063313ce567146102e7578063351a964d146102f65780633950935114610303578063437823ec1461031657600080fd5b80631f6976a6116101e45780631f6976a61461027e57806323b872dd146102ae5780632c61beaf146102c157806330455ede146102d457600080fd5b806306fdde0314610216578063095ea7b314610234578063177c50131461025757806318160ddd1461026c575b600080fd5b61021e6104f8565b60405161022b919061124d565b60405180910390f35b6102476102423660046112b0565b61058a565b604051901515815260200161022b565b61026a6102653660046112dc565b6105a4565b005b6002545b60405190815260200161022b565b600a546102969061010090046001600160a01b031681565b6040516001600160a01b03909116815260200161022b565b6102476102bc3660046112f5565b6105f0565b6102966102cf3660046112dc565b610614565b61026a6102e2366004611344565b61063e565b6040516012815260200161022b565b600a546102479060ff1681565b6102476103113660046112b0565b610659565b61026a610324366004611368565b61067b565b600d54610296906001600160a01b031681565b61024761034a366004611368565b60066020526000908152604090205460ff1681565b61029661036d366004611368565b6106a7565b610270610380366004611368565b6001600160a01b031660009081526020819052604090205490565b61026a61088a565b61027060095481565b6005546001600160a01b0316610296565b61026a6103cb366004611385565b61089e565b61026a6103de366004611368565b61091b565b61021e61094b565b61027060085481565b6102476104023660046112b0565b61095a565b6102476104153660046112b0565b6109d5565b61026a610428366004611368565b6109e3565b61026a61043b3660046112dc565b610a0d565b61024761044e366004611368565b600f6020526000908152604090205460ff1681565b600b54610296906001600160a01b031681565b61027061048436600461140b565b610a50565b61026a610497366004611368565b610a7b565b61026a6104aa366004611368565b610aa4565b600c54610296906001600160a01b031681565b61026a6104d0366004611368565b610b1d565b6102476104e3366004611368565b60076020526000908152604090205460ff1681565b60606003805461050790611444565b80601f016020809104026020016040519081016040528092919081815260200182805461053390611444565b80156105805780601f1061055557610100808354040283529160200191610580565b820191906000526020600020905b81548152906001019060200180831161056357829003601f168201915b5050505050905090565b600033610598818585610b47565b60019150505b92915050565b6105ac610c6b565b6105b86012600a611578565b6105c390600a611587565b8111156105eb5760405162461bcd60e51b81526004016105e29061159e565b60405180910390fd5b600955565b6000336105fe858285610cc5565b610609858585610d39565b506001949350505050565b600e818154811061062457600080fd5b6000918252602090912001546001600160a01b0316905081565b610646610c6b565b600a805460ff1916911515919091179055565b60003361059881858561066c8383610a50565b61067691906115e0565b610b47565b610683610c6b565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b60006106b1610c6b565b600d546040805163c45a015560e01b815290516001600160a01b0390921691600091839163c45a0155916004808201926020929091908290030181865afa158015610700573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072491906115f3565b60405163e6a4390560e01b81523060048201526001600160a01b03868116602483015291925060009183169063e6a4390590604401602060405180830381865afa158015610776573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079a91906115f3565b90506001600160a01b03811661081f576040516364e329cb60e11b81523060048201526001600160a01b03868116602483015283169063c9c65396906044016020604051808303816000875af11580156107f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081c91906115f3565b90505b600e805460018082019092557fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0180546001600160a01b0319166001600160a01b0384169081179091556000908152600f60205260409020805460ff19169091179055949350505050565b610892610c6b565b61089c6000611001565b565b6108a6610c6b565b60005b828110156109155781600760008686858181106108c8576108c8611610565b90506020020160208101906108dd9190611368565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905561090e81611626565b90506108a9565b50505050565b610923610c6b565b600a80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60606004805461050790611444565b600033816109688286610a50565b9050838110156109c85760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016105e2565b6106098286868403610b47565b600033610598818585610d39565b6109eb610c6b565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b610a15610c6b565b610a216012600a611578565b610a2c90600a611587565b811115610a4b5760405162461bcd60e51b81526004016105e29061159e565b600855565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610a83610c6b565b6001600160a01b03166000908152600660205260409020805460ff19169055565b610aac610c6b565b6001600160a01b038116610b115760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105e2565b610b1a81611001565b50565b610b25610c6b565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610ba95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105e2565b6001600160a01b038216610c0a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105e2565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6005546001600160a01b0316331461089c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e2565b6000610cd18484610a50565b905060001981146109155781811015610d2c5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016105e2565b6109158484848403610b47565b6001600160a01b03831660009081526007602052604090205460ff1615610da25760405162461bcd60e51b815260206004820152601c60248201527f41646472657373204066726f6d20697320626c61636b6c69737465640000000060448201526064016105e2565b6001600160a01b03821660009081526007602052604090205460ff1615610e0b5760405162461bcd60e51b815260206004820152601a60248201527f416464726573732040746f20697320626c61636b6c697374656400000000000060448201526064016105e2565b6001600160a01b0383166000908152600f602052604081205460ff16158015610e4d57506001600160a01b0383166000908152600f602052604090205460ff16155b15610e6257610e5d848484611053565b610915565b6001600160a01b03841660009081526006602052604090205460ff1680610ea157506001600160a01b03831660009081526006602052604090205460ff165b15610eb157610e5d848484611053565b6001600160a01b0384166000908152600f602052604090205460ff16610edf57610eda826111f7565b610ee8565b610ee882611227565b9050610efe8484610ef9848661163f565b611053565b801561091557600a5460ff1615610fab57600a54610f2c90859061010090046001600160a01b031683611053565b600a60019054906101000a90046001600160a01b03166001600160a01b031663614619546040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610f81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa59190611652565b50610915565b6000610fb860028361166f565b90506000610fc6828461163f565b600c54909150610fe19087906001600160a01b031684611053565b600b54610ff99087906001600160a01b031683611053565b505050505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0383166110b75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105e2565b6001600160a01b0382166111195760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105e2565b6001600160a01b038316600090815260208190526040902054818110156111915760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105e2565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610915565b60006112056012600a611578565b611210906064611587565b60095461121d9084611587565b61059e919061166f565b60006112356012600a611578565b611240906064611587565b60085461121d9084611587565b600060208083528351808285015260005b8181101561127a5785810183015185820160400152820161125e565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b0381168114610b1a57600080fd5b600080604083850312156112c357600080fd5b82356112ce8161129b565b946020939093013593505050565b6000602082840312156112ee57600080fd5b5035919050565b60008060006060848603121561130a57600080fd5b83356113158161129b565b925060208401356113258161129b565b929592945050506040919091013590565b8015158114610b1a57600080fd5b60006020828403121561135657600080fd5b813561136181611336565b9392505050565b60006020828403121561137a57600080fd5b81356113618161129b565b60008060006040848603121561139a57600080fd5b833567ffffffffffffffff808211156113b257600080fd5b818601915086601f8301126113c657600080fd5b8135818111156113d557600080fd5b8760208260051b85010111156113ea57600080fd5b6020928301955093505084013561140081611336565b809150509250925092565b6000806040838503121561141e57600080fd5b82356114298161129b565b915060208301356114398161129b565b809150509250929050565b600181811c9082168061145857607f821691505b60208210810361147857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600181815b808511156114cf5781600019048211156114b5576114b561147e565b808516156114c257918102915b93841c9390800290611499565b509250929050565b6000826114e65750600161059e565b816114f35750600061059e565b816001811461150957600281146115135761152f565b600191505061059e565b60ff8411156115245761152461147e565b50506001821b61059e565b5060208310610133831016604e8410600b8410161715611552575081810a61059e565b61155c8383611494565b80600019048211156115705761157061147e565b029392505050565b600061136160ff8416836114d7565b808202811582820484141761059e5761059e61147e565b60208082526022908201527f54617820726174652063616e6e6f7420627920686967686572207468656e2031604082015261302560f01b606082015260800190565b8082018082111561059e5761059e61147e565b60006020828403121561160557600080fd5b81516113618161129b565b634e487b7160e01b600052603260045260246000fd5b6000600182016116385761163861147e565b5060010190565b8181038181111561059e5761059e61147e565b60006020828403121561166457600080fd5b815161136181611336565b60008261168c57634e487b7160e01b600052601260045260246000fd5b50049056fea264697066735822122042543b337541f26026807ecced493b5f620b277911ade0ec7911ade88c634e2664736f6c63430008130033
Verified Source Code Full Match
Compiler: v0.8.19+commit.7dd6d404
EVM: paris
Optimization: Yes (200 runs)
ERC20.sol 415 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./IERC20Metadata.sol";
import "./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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of 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}.
*
* 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 default value returned by this function, unless
* it's 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:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(
address to,
uint256 amount
) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, 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}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(
address spender,
uint256 amount
) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, 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}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, 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) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, 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) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(
currentAllowance >= subtractedValue,
"ERC20: decreased allowance below zero"
);
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* 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:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(
fromBalance >= amount,
"ERC20: transfer amount exceeds balance"
);
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, 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;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(
currentAllowance >= amount,
"ERC20: insufficient allowance"
);
unchecked {
_approve(owner, spender, currentAllowance - 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 {}
}
IERC20.sol 89 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
/**
* @dev Returns the 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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from,
address to,
uint256 amount
) external returns (bool);
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
Ownable.sol 89 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "./Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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);
}
}
ITaxHelper.sol 6 lines
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.8.19;
interface ITaxHelper {
function execute() external returns (bool);
}
dop-verify.sol 180 lines
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import "./IUniswapV2Factory.sol"; import "./IUniswapV2Router02.sol"; import "./IUniswapV2Pair.sol"; import "./ERC20.sol"; import "./Ownable.sol"; import "./ITaxHelper.sol"; /// @custom:security-contact [email protected] contract DDrops is ERC20, Ownable { // Allows the contract owner to block certain address // from sending and receiving tokens mapping(address => bool) public isExcludedFromFee; mapping(address => bool) public isBlacklisted; // Variables required for the taxing functionality uint public buyContributionFee; uint public sellContributionFee; bool public isSwapEnabled = false; ITaxHelper public taxHelper; // Wallets which recieve the taxed tokens address public treasureWalletAddress; address public developementWalletAddress; address public uniswapV2RouterAddress; address[] public uniswapV2Pairs; mapping(address => bool) public isUniswapV2Pair; constructor() ERC20("D-Drops", "DOP") Ownable() { _mint(msg.sender, 337500000 * 10 ** decimals()); buyContributionFee = 6 * (10 ** decimals()); sellContributionFee = 6 * (10 ** decimals()); developementWalletAddress = 0x8a170c4033410737fC6719A74A1E451037daF047; treasureWalletAddress = 0x0e516A61c792eC36dA070a65DC961e82aF9106Af; // Uniswap V2 router Address uniswapV2RouterAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // Exclude owner-, dev- and treasure- wallet from fee isExcludedFromFee[owner()] = true; isExcludedFromFee[developementWalletAddress] = true; isExcludedFromFee[treasureWalletAddress] = true; } function _transfer( address from, address to, uint256 amount ) internal override { require(isBlacklisted[from] == false, "Address @from is blacklisted"); require(isBlacklisted[to] == false, "Address @to is blacklisted"); uint256 tax = 0; if (!isUniswapV2Pair[from] && !isUniswapV2Pair[to]) { super._transfer(from, to, amount); } else if (isExcludedFromFee[from] || isExcludedFromFee[to]) { super._transfer(from, to, amount); } else { tax = isUniswapV2Pair[from] ? _calculateBuyContributionFee(amount) : _calculateSellContributionFee(amount); super._transfer(from, to, amount - tax); if (tax > 0) { if (isSwapEnabled) { super._transfer(from, address(taxHelper), tax); taxHelper.execute(); } else { uint256 _developementWalletAmount = tax / 2; uint256 _treasureWalletAmount = tax - _developementWalletAmount; super._transfer( from, developementWalletAddress, _developementWalletAmount ); super._transfer( from, treasureWalletAddress, _treasureWalletAmount ); } } } } function createUniswapV2Pair( address otherToken ) external onlyOwner returns (address) { IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02( uniswapV2RouterAddress ); IUniswapV2Factory uFactory = IUniswapV2Factory( uniswapV2Router.factory() ); address _uniswapV2Pair = uFactory.getPair(address(this), otherToken); if (_uniswapV2Pair == address(0)) { _uniswapV2Pair = uFactory.createPair(address(this), otherToken); } uniswapV2Pairs.push(_uniswapV2Pair); isUniswapV2Pair[address(_uniswapV2Pair)] = true; return _uniswapV2Pair; } // Set the amount of BUY contribution fee, limited to max 15% function setBuyContributionFee( uint256 _newBuyContributionFee ) external onlyOwner { require( _newBuyContributionFee <= 10 * (10 ** decimals()), "Tax rate cannot by higher then 10%" ); buyContributionFee = _newBuyContributionFee; } // Set the amount of SELL contribution fee, limited to max 20% function setSellContributionFee( uint256 _newSellContributionFee ) external onlyOwner { require( _newSellContributionFee <= 10 * (10 ** decimals()), "Tax rate cannot by higher then 10%" ); sellContributionFee = _newSellContributionFee; } function setDevelopementWallet( address _newDevelopementWallet ) external onlyOwner { developementWalletAddress = _newDevelopementWallet; } function setTreasureWallet(address _newTreasureWallet) external onlyOwner { treasureWalletAddress = _newTreasureWallet; } function excludeFromFee(address _account) external onlyOwner { isExcludedFromFee[_account] = true; } function includeInFee(address _account) external onlyOwner { isExcludedFromFee[_account] = false; } function _calculateBuyContributionFee( uint amount ) internal view returns (uint) { return (amount * buyContributionFee) / (100 * (10 ** decimals())); } function _calculateSellContributionFee( uint amount ) internal view returns (uint) { return (amount * sellContributionFee) / (100 * (10 ** decimals())); } //Add or remove one or more addresses from the black list, make sure to send enough gas function manage_blacklist( address[] calldata _addresses, bool _value ) external onlyOwner { for (uint256 i; i < _addresses.length; ++i) { isBlacklisted[_addresses[i]] = _value; } } function setIsSwapEnabled(bool value) external onlyOwner { isSwapEnabled = value; } function setTaxHelper(address taxHelperAddress) external onlyOwner { taxHelper = ITaxHelper(taxHelperAddress); } }
IERC20Metadata.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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);
}
IUniswapV2Pair.sol 100 lines
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(
address owner,
address spender
) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(
address from,
address to,
uint value
) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(
address owner,
address spender,
uint value,
uint deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(
address indexed sender,
uint amount0,
uint amount1,
address indexed to
);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves()
external
view
returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(
uint amount0Out,
uint amount1Out,
address to,
bytes calldata data
) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
IUniswapV2Factory.sol 32 lines
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint
);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(
address tokenA,
address tokenB
) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(
address tokenA,
address tokenB
) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
IUniswapV2Router01.sol 150 lines
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
)
external
payable
returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable returns (uint[] memory amounts);
function swapTokensForExactETH(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactTokensForETH(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapETHForExactTokens(
uint amountOut,
address[] calldata path,
address to,
uint deadline
) external payable returns (uint[] memory amounts);
function quote(
uint amountA,
uint reserveA,
uint reserveB
) external pure returns (uint amountB);
function getAmountOut(
uint amountIn,
uint reserveIn,
uint reserveOut
) external pure returns (uint amountOut);
function getAmountIn(
uint amountOut,
uint reserveIn,
uint reserveOut
) external pure returns (uint amountIn);
function getAmountsOut(
uint amountIn,
address[] calldata path
) external view returns (uint[] memory amounts);
function getAmountsIn(
uint amountOut,
address[] calldata path
) external view returns (uint[] memory amounts);
}
IUniswapV2Router02.sol 50 lines
pragma solidity >=0.6.2;
import "./IUniswapV2Router01.sol";
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
buyContributionFee 0x9e16606c → uint256
decimals 0x313ce567 → uint8
developementWalletAddress 0xf4de9ab7 → address
isBlacklisted 0xfe575a87 → bool
isExcludedFromFee 0x5342acb4 → bool
isSwapEnabled 0x351a964d → bool
isUniswapV2Pair 0xc7b122b1 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
sellContributionFee 0x83e88ec4 → uint256
symbol 0x95d89b41 → string
taxHelper 0x1f6976a6 → address
totalSupply 0x18160ddd → uint256
treasureWalletAddress 0xdb9f76a6 → address
uniswapV2Pairs 0x2c61beaf → address
uniswapV2RouterAddress 0x4a377e1d → 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
createUniswapV2Pair 0x68c488b3
address otherToken
returns: address
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
excludeFromFee 0x437823ec
address _account
includeInFee 0xea2f0b37
address _account
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
manage_blacklist 0x8e2eee84
address[] _addresses
bool _value
renounceOwnership 0x715018a6
No parameters
setBuyContributionFee 0xbc086005
uint256 _newBuyContributionFee
setDevelopementWallet 0xab8439dd
address _newDevelopementWallet
setIsSwapEnabled 0x30455ede
bool value
setSellContributionFee 0x177c5013
uint256 _newSellContributionFee
setTaxHelper 0x8fbf1e93
address taxHelperAddress
setTreasureWallet 0xf5f7b962
address _newTreasureWallet
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address