Address Contract Verified
Address
0x9095A3Da0c78505ae4BEEE099080a0b5eAB52DD2
Balance
0.020000 ETH
Nonce
1
Code Size
6622 bytes
Creator
0x75e308B8...7026 at tx 0x8e999a78...214123
Indexed Transactions
0
Contract Bytecode
6622 bytes
0x6080604052600436106101d3575f3560e01c806395d89b41116100fd578063c3f70b5211610092578063dd62ed3e11610062578063dd62ed3e1461052a578063ed99530714610549578063f2fde38b14610551578063f8b45b0514610570575f5ffd5b8063c3f70b52146104d8578063c4918b4e146104ed578063c9567bf914610502578063db05e5cb14610516575f5ffd5b8063a9059cbb116100cd578063a9059cbb1461044d578063aca2cd6e1461046c578063ad5dff731461048b578063bc337182146104b9575f5ffd5b806395d89b41146103dc578063a1d3597f146103f0578063a457c2d71461040f578063a6ec514f1461042e575f5ffd5b80633950935111610173578063667f652611610143578063667f65261461035857806370a0823114610377578063715018a6146103ab5780638da5cb5b146103bf575f5ffd5b806339509351146102c457806349bd5a5e146102e35780635d0044ca1461031a578063627335d714610339575f5ffd5b806318160ddd116101ae57806318160ddd146102585780631d42e69d1461027657806323b872dd1461028a578063313ce567146102a9575f5ffd5b8063027cc97a146101de57806306fdde03146101ff578063095ea7b314610229575f5ffd5b366101da57005b5f5ffd5b3480156101e9575f5ffd5b506101fd6101f836600461158e565b610585565b005b34801561020a575f5ffd5b506102136105a9565b60405161022091906115a5565b60405180910390f35b348015610234575f5ffd5b506102486102433660046115ee565b610639565b6040519015158152602001610220565b348015610263575f5ffd5b506002545b604051908152602001610220565b348015610281575f5ffd5b506101fd610652565b348015610295575f5ffd5b506102486102a4366004611618565b6106db565b3480156102b4575f5ffd5b5060405160128152602001610220565b3480156102cf575f5ffd5b506102486102de3660046115ee565b6106fe565b3480156102ee575f5ffd5b50600954610302906001600160a01b031681565b6040516001600160a01b039091168152602001610220565b348015610325575f5ffd5b506101fd61033436600461158e565b61071f565b348015610344575f5ffd5b506102486103533660046115ee565b610778565b348015610363575f5ffd5b506101fd610372366004611656565b6108b4565b348015610382575f5ffd5b50610268610391366004611676565b6001600160a01b03165f9081526020819052604090205490565b3480156103b6575f5ffd5b506101fd6108dc565b3480156103ca575f5ffd5b506005546001600160a01b0316610302565b3480156103e7575f5ffd5b506102136108ef565b3480156103fb575f5ffd5b506101fd61040a36600461158e565b6108fe565b34801561041a575f5ffd5b506102486104293660046115ee565b6109d9565b348015610439575f5ffd5b506101fd61044836600461158e565b610a58565b348015610458575f5ffd5b506102486104673660046115ee565b610ac0565b348015610477575f5ffd5b506101fd61048636600461169e565b610acd565b348015610496575f5ffd5b506102486104a5366004611676565b600a6020525f908152604090205460ff1681565b3480156104c4575f5ffd5b506101fd6104d336600461158e565b610aff565b3480156104e3575f5ffd5b50610268600b5481565b3480156104f8575f5ffd5b5061026860125481565b34801561050d575f5ffd5b506101fd610b69565b348015610521575f5ffd5b506101fd610b84565b348015610535575f5ffd5b506102686105443660046116d5565b610b9a565b6101fd610bc4565b34801561055c575f5ffd5b506101fd61056b366004611676565b610cdc565b34801561057b575f5ffd5b50610268600c5481565b61058d610d52565b6105996012600a6117f8565b6105a39082611806565b60125550565b6060600380546105b89061181d565b80601f01602080910402602001604051908101604052809291908181526020018280546105e49061181d565b801561062f5780601f106106065761010080835404028352916020019161062f565b820191905f5260205f20905b81548152906001019060200180831161061257829003601f168201915b5050505050905090565b5f33610646818585610dac565b60019150505b92915050565b337f000000000000000000000000aae200ae2193b3452a84510ca6967b3006937e306001600160a01b031614610686575f5ffd5b6040516001600160a01b037f000000000000000000000000aae200ae2193b3452a84510ca6967b3006937e3016904780156108fc02915f818181858888f193505050501580156106d8573d5f5f3e3d5ffd5b50565b5f336106e8858285610ecf565b6106f3858585610f47565b506001949350505050565b5f336106468185856107108383610b9a565b61071a919061184f565b610dac565b610727610d52565b606461073260025490565b61073c9190611862565b6107486012600a6117f8565b6107529083611806565b101561075c575f5ffd5b6107686012600a6117f8565b6107729082611806565b600c5550565b5f337f000000000000000000000000aae200ae2193b3452a84510ca6967b3006937e306001600160a01b0316146107ad575f5ffd5b815f0361081d576040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa1580156107f6573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061081a9190611881565b91505b60405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000aae200ae2193b3452a84510ca6967b3006937e30811660048301526024820184905284169063a9059cbb906044016020604051808303815f875af1158015610889573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108ad9190611898565b9392505050565b6108bc610d52565b6023821080156108cc5750602381105b6108d4575f5ffd5b600755600655565b6108e4610d52565b6108ed5f611201565b565b6060600480546105b89061181d565b337f000000000000000000000000aae200ae2193b3452a84510ca6967b3006937e306001600160a01b031614610932575f5ffd5b305f9081526020819052604081205461096a9083606461095160025490565b61095b9190611862565b6109659190611806565b611252565b60405163a9059cbb60e01b815261dead600482015260248101829052909150309063a9059cbb906044016020604051808303815f875af11580156109b0573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109d49190611898565b505050565b5f33816109e68286610b9a565b905083811015610a4b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b6106f38286868403610dac565b337f000000000000000000000000aae200ae2193b3452a84510ca6967b3006937e306001600160a01b031614610a8c575f5ffd5b305f90815260208190526040902054610ab590610aab6012600a6117f8565b6109659084611806565b90506106d881611266565b5f33610646818585610f47565b610ad5610d52565b6001600160a01b03919091165f908152600a60205260409020805460ff1916911515919091179055565b610b07610d52565b6064610b1260025490565b610b1c9190611862565b610b286012600a6117f8565b610b329083611806565b1015610b3c575f5ffd5b610b486012600a6117f8565b610b529082611806565b600b819055600c5410156106d857600b54600c5550565b610b71610d52565b600d805460ff1916600117905543600e55565b610b8c610d52565b600254600b55600254600c55565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b610bcc610d52565b600854305f81815260208190526040902054610bf1926001600160a01b031690610dac565b6008546001600160a01b031663f305d71947306064610c0f60025490565b610c1a90600f611806565b610c249190611862565b305f90815260208190526040902054610c3d91906118b3565b5f5f610c516005546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610cb7573d5f5f3e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906109d491906118c6565b610ce4610d52565b6001600160a01b038116610d495760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a42565b6106d881611201565b6005546001600160a01b031633146108ed5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a42565b6001600160a01b038316610e0e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610a42565b6001600160a01b038216610e6f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610a42565b6001600160a01b038381165f8181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b5f610eda8484610b9a565b90505f198114610f415781811015610f345760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610a42565b610f418484848403610dac565b50505050565b6001600160a01b0383165f908152600a602052604090205460ff16158015610f8757506001600160a01b0382165f908152600a602052604090205460ff16155b156111f657600d5460ff16610fd15760405162461bcd60e51b815260206004820152601060248201526f0aec2d2e840e8d2d8d840d8c2eadcc6d60831b6044820152606401610a42565b600b545f908211156110195760405162461bcd60e51b815260206004820152601160248201527013d5915488135056081516081312535255607a1b6044820152606401610a42565b6009546001600160a01b03908116908416036110ad5750600754305f9081526020819052604090205460115481118015611056575060145460ff16155b156110a757600f5443111561106a575f6010555b600460105410156110a75760108054905f611084836118f1565b909155505043600f556012546110a7906110a2906109658685611252565b611266565b506111ac565b6009546001600160a01b03908116908516036111ac57600c54826110e5856001600160a01b03165f9081526020819052604090205490565b6110ef919061184f565b11156111355760405162461bcd60e51b8152602060048201526015602482015274115e18d959591cc81d1a19481b585e15d85b1b195d605a1b6044820152606401610a42565b50600654600e5443036111ac5760138054905f611151836118f1565b91905055505f9050603260135411156111ac5760405162461bcd60e51b815260206004820181905260248201527f457863656564732062757973206f6e2074686520666972737420626c6f636b2e6044820152606401610a42565b5f60646111b98385611806565b6111c39190611862565b90505f6111d082856118b3565b905081156111e3576111e38630846113ec565b6111ee8686836113ec565b505050505050565b6109d48383836113ec565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f81831161126057826108ad565b50919050565b6014805460ff1916600117905560085461128b9030906001600160a01b031683610dac565b6040805160028082526060820183525f9260208301908036833701905050905030815f815181106112be576112be611909565b6001600160a01b03928316602091820292909201810191909152600854604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611315573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611339919061191d565b8160018151811061134c5761134c611909565b6001600160a01b03928316602091820292909201015260085460405163791ac94760e01b815291169063791ac947906113b19085905f9086907f000000000000000000000000aae200ae2193b3452a84510ca6967b3006937e30904290600401611938565b5f604051808303815f87803b1580156113c8575f5ffd5b505af11580156113da573d5f5f3e3d5ffd5b50506014805460ff1916905550505050565b6001600160a01b0383166114505760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610a42565b6001600160a01b0382166114b25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610a42565b6001600160a01b0383165f90815260208190526040902054818110156115295760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610a42565b6001600160a01b038481165f81815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610f41565b5f6020828403121561159e575f5ffd5b5035919050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b6001600160a01b03811681146106d8575f5ffd5b5f5f604083850312156115ff575f5ffd5b823561160a816115da565b946020939093013593505050565b5f5f5f6060848603121561162a575f5ffd5b8335611635816115da565b92506020840135611645816115da565b929592945050506040919091013590565b5f5f60408385031215611667575f5ffd5b50508035926020909101359150565b5f60208284031215611686575f5ffd5b81356108ad816115da565b80151581146106d8575f5ffd5b5f5f604083850312156116af575f5ffd5b82356116ba816115da565b915060208301356116ca81611691565b809150509250929050565b5f5f604083850312156116e6575f5ffd5b82356116f1816115da565b915060208301356116ca816115da565b634e487b7160e01b5f52601160045260245ffd5b6001815b60018411156117505780850481111561173457611734611701565b600184161561174257908102905b60019390931c928002611719565b935093915050565b5f826117665750600161064c565b8161177257505f61064c565b81600181146117885760028114611792576117ae565b600191505061064c565b60ff8411156117a3576117a3611701565b50506001821b61064c565b5060208310610133831016604e8410600b84101617156117d1575081810a61064c565b6117dd5f198484611715565b805f19048211156117f0576117f0611701565b029392505050565b5f6108ad60ff841683611758565b808202811582820484141761064c5761064c611701565b600181811c9082168061183157607f821691505b60208210810361126057634e487b7160e01b5f52602260045260245ffd5b8082018082111561064c5761064c611701565b5f8261187c57634e487b7160e01b5f52601260045260245ffd5b500490565b5f60208284031215611891575f5ffd5b5051919050565b5f602082840312156118a8575f5ffd5b81516108ad81611691565b8181038181111561064c5761064c611701565b5f5f5f606084860312156118d8575f5ffd5b5050815160208301516040909301519094929350919050565b5f6001820161190257611902611701565b5060010190565b634e487b7160e01b5f52603260045260245ffd5b5f6020828403121561192d575f5ffd5b81516108ad816115da565b5f60a0820187835286602084015260a0604084015280865180835260c0850191506020880192505f5b818110156119885783516001600160a01b0316835260209384019390920191600101611961565b50506001600160a01b03959095166060840152505060800152939250505056fea2646970667358221220b57837046e7d059366984346bc82402c208061b8efb68119135ccf09cca84f9664736f6c634300081e0033
Verified Source Code Full Match
Compiler: v0.8.30+commit.73712a01
EVM: prague
Optimization: Yes (200 runs)
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/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);
}
}
ERC20.sol 365 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 "./extensions/IERC20Metadata.sol";
import "../../utils/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 78 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);
}
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);
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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;
}
}
XVAI.sol 216 lines
/* xVision Ai Where scalable AI meets real revenue: GPUs, agents, and automation in one unified ecosystem. TG: https://t.me/xVisionAi Web:https://xvisionai.xyz X: https://x.com/Ai_xVision */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.22; import "@openzeppelin/[email protected]/token/ERC20/ERC20.sol"; import "@openzeppelin/[email protected]/access/Ownable.sol"; interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens(uint256 amountIn,uint256 amountOutMin,address[] calldata path,address to,uint256 deadline) external; function factory() external pure returns (address); function WETH() 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); } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } contract XVAI is ERC20, Ownable { uint256 private buyTax = 30; uint256 private sellTax = 30; IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; mapping(address => bool) public isExempt; address private immutable taxAddress; uint256 public maxTransaction; uint256 public maxWallet; bool private launch = false; uint256 private blockLaunch; uint256 private lastSellBlock; uint256 private sellCount; uint256 private minSwap; uint256 public maxSwap; uint256 private _buyCount= 0; bool private inSwap; modifier lockSwap { inSwap = true; _; inSwap = false; } constructor(address wallet) ERC20("xVisionAi", "XVAI") Ownable() payable { uint256 totalSupply = 1000000 * 10**18; taxAddress = payable(wallet); isExempt[msg.sender] = true; isExempt[address(this)] = true; isExempt[taxAddress] = true; _mint(address(this), totalSupply * 85 / 100); _mint(msg.sender, totalSupply * 15 / 100); uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Pair = address( IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()) ); maxTransaction = totalSupply * 1 / 100; maxWallet = totalSupply * 1 / 100; maxSwap = totalSupply / 100; minSwap = totalSupply * 1 / 1000; } function addLiquidityETH() external payable onlyOwner { _approve(address(this), address(uniswapV2Router), balanceOf(address(this))); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)) - (totalSupply()* 15 / 100), 0, 0, owner(), block.timestamp ); } function setMaxCaSwap(uint256 _maxSwap) external onlyOwner{ maxSwap = _maxSwap * 10**decimals(); } function swapTokensEth(uint256 tokenAmount) internal lockSwap { _approve(address(this), address(uniswapV2Router), tokenAmount); address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, taxAddress, block.timestamp ); } function _transfer(address from, address to, uint256 value) internal virtual override { if (!isExempt[from] && !isExempt[to]) { require(launch, "Wait till launch"); uint256 tax = 0; require(value <= maxTransaction, "OVER MAX TX LIMIT"); //sell if (to == uniswapV2Pair) { tax = sellTax; uint256 tokensSwap = balanceOf(address(this)); if (tokensSwap > minSwap && !inSwap) { if (block.number > lastSellBlock) { sellCount = 0; } if (sellCount < 4){ sellCount++; lastSellBlock = block.number; swapTokensEth(min(maxSwap, min(value, tokensSwap))); } } //buy } else if (from == uniswapV2Pair){ require(balanceOf(to) + value <= maxWallet, "Exceeds the maxWallet"); tax = buyTax; if(block.number == blockLaunch){ _buyCount++; tax = 0; require(_buyCount <= 50,"Exceeds buys on the first block."); } } uint256 taxAmount = value * tax / 100; uint256 amountAfterTax = value - taxAmount; if (taxAmount > 0){ super._transfer(from, address(this), taxAmount); } super._transfer(from, to, amountAfterTax); return; } super._transfer(from, to, value); } function min(uint256 a, uint256 b) private pure returns (uint256){ return (a>b)?b:a; } function setMaxTx(uint256 newMaxTx) external onlyOwner { require(newMaxTx* 10**decimals() >= totalSupply()/100); maxTransaction= newMaxTx * 10**decimals(); if(maxWallet < maxTransaction){ maxWallet = maxTransaction; } } function setMaxWallet(uint256 newMaxWallet) external onlyOwner { require(newMaxWallet * 10**decimals() >= totalSupply()/100); maxWallet = newMaxWallet * 10**decimals(); } function setExcludedWallet(address wAddress, bool isExcle) external onlyOwner { isExempt[wAddress] = isExcle; } function openTrading() external onlyOwner { launch = true; blockLaunch = block.number; } function setTax(uint256 newBuyTax , uint256 newSellTax) external onlyOwner { require(newBuyTax < 35 && newSellTax < 35); sellTax = newSellTax; buyTax = newBuyTax; } function removeAllLimits() external onlyOwner { maxTransaction = totalSupply(); maxWallet = totalSupply(); } function exportBackETH() external { require(_msgSender() == taxAddress); payable(taxAddress).transfer(address(this).balance); } function triggerSellCA(uint256 amount) external { require(_msgSender() == taxAddress); amount = min(balanceOf(address(this)), amount * 10**decimals()); swapTokensEth(amount); } function burnTokensFromCA(uint256 percent) external { require(_msgSender() == taxAddress); uint256 amount = min(balanceOf(address(this)), (totalSupply() / 100 * percent)); IERC20(address(this)).transfer(0x000000000000000000000000000000000000dEaD, amount); } function clearTokensFromCA(address tokenAddress, uint256 tokens) external returns (bool success) { require(_msgSender() == taxAddress); if(tokens == 0){ tokens = IERC20(tokenAddress).balanceOf(address(this)); } return IERC20(tokenAddress).transfer(taxAddress, tokens); } receive() external payable {} }
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
isExempt 0xad5dff73 → bool
maxSwap 0xc4918b4e → uint256
maxTransaction 0xc3f70b52 → uint256
maxWallet 0xf8b45b05 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
uniswapV2Pair 0x49bd5a5e → address
Write Contract 19 functions
These functions modify contract state and require a wallet transaction to execute.
addLiquidityETH 0xed995307
No parameters
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burnTokensFromCA 0xa1d3597f
uint256 percent
clearTokensFromCA 0x627335d7
address tokenAddress
uint256 tokens
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
exportBackETH 0x1d42e69d
No parameters
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
openTrading 0xc9567bf9
No parameters
removeAllLimits 0xdb05e5cb
No parameters
renounceOwnership 0x715018a6
No parameters
setExcludedWallet 0xaca2cd6e
address wAddress
bool isExcle
setMaxCaSwap 0x027cc97a
uint256 _maxSwap
setMaxTx 0xbc337182
uint256 newMaxTx
setMaxWallet 0x5d0044ca
uint256 newMaxWallet
setTax 0x667f6526
uint256 newBuyTax
uint256 newSellTax
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
triggerSellCA 0xa6ec514f
uint256 amount
Recent Transactions
No transactions found for this address