Address Contract Partially Verified
Address
0x45e82579792DDDF08cb3a037086604C262D78065
Balance
0 ETH
Nonce
1
Code Size
6751 bytes
Creator
0x87187B9F...E164 at tx 0x318a9587...61e24b
Indexed Transactions
0 (1 on-chain, 1.5% indexed)
Contract Bytecode
6751 bytes
0x60806040526004361061021e5760003560e01c80636d0ef3a311610123578063aa6e3301116100ab578063ea414b281161006f578063ea414b28146105f5578063f2fde38b14610615578063f3fef3a314610635578063fca3b5aa14610655578063ffb54a991461067557600080fd5b8063aa6e33011461057f578063ba3f076e1461059f578063cc1776d3146105bf578063dd62ed3e146105d5578063e7cb0df9146103af57600080fd5b80638a8c523c116100f25780638a8c523c146104f75780638da5cb5b1461050c57806395d89b411461052a578063a457c2d71461053f578063a9059cbb1461055f57600080fd5b80636d0ef3a3146104765780636ddd17131461048b57806370a08231146104ac578063715018a6146104e257600080fd5b8063313ce567116101a657806342966c681161017557806342966c68146103e45780634f7041a5146104045780635e7b655c1461041a5780635f29a7481461043057806362997f8c1461046057600080fd5b8063313ce56714610373578063395093511461038f5780633de7f844146103af57806340c10f19146103c457600080fd5b806318160ddd116101ed57806318160ddd146102dd57806323b872dd146102fc5780632717653f1461031c5780632bfb8ce4146103335780632f37aa6d1461035357600080fd5b806306fdde031461022a5780630754617214610255578063095ea7b31461028d5780631694505e146102bd57600080fd5b3661022557005b600080fd5b34801561023657600080fd5b5061023f610696565b60405161024c91906116ed565b60405180910390f35b34801561026157600080fd5b50600e54610275906001600160a01b031681565b6040516001600160a01b03909116815260200161024c565b34801561029957600080fd5b506102ad6102a8366004611750565b610728565b604051901515815260200161024c565b3480156102c957600080fd5b50600d54610275906001600160a01b031681565b3480156102e957600080fd5b506002545b60405190815260200161024c565b34801561030857600080fd5b506102ad61031736600461177c565b610742565b34801561032857600080fd5b50610331610766565b005b34801561033f57600080fd5b5061033161034e3660046117bd565b61078f565b34801561035f57600080fd5b5061033161036e3660046117da565b6107c0565b34801561037f57600080fd5b506040516012815260200161024c565b34801561039b57600080fd5b506102ad6103aa366004611750565b61085f565b3480156103bb57600080fd5b506102ee600281565b3480156103d057600080fd5b506103316103df366004611750565b610881565b3480156103f057600080fd5b506103316103ff3660046117fc565b6108a6565b34801561041057600080fd5b506102ee60085481565b34801561042657600080fd5b506102ee600a5481565b34801561043c57600080fd5b506102ad61044b3660046117bd565b600c6020526000908152604090205460ff1681565b34801561046c57600080fd5b506102ee600b5481565b34801561048257600080fd5b506103316108b3565b34801561049757600080fd5b50600d546102ad90600160b01b900460ff1681565b3480156104b857600080fd5b506102ee6104c73660046117bd565b6001600160a01b031660009081526020819052604090205490565b3480156104ee57600080fd5b506103316108ea565b34801561050357600080fd5b506103316108fe565b34801561051857600080fd5b506005546001600160a01b0316610275565b34801561053657600080fd5b5061023f610b51565b34801561054b57600080fd5b506102ad61055a366004611750565b610b60565b34801561056b57600080fd5b506102ad61057a366004611750565b610bdb565b34801561058b57600080fd5b5061033161059a3660046117da565b610be9565b3480156105ab57600080fd5b506103316105ba3660046117bd565b610bfc565b3480156105cb57600080fd5b506102ee60095481565b3480156105e157600080fd5b506102ee6105f0366004611815565b610c2d565b34801561060157600080fd5b506103316106103660046117bd565b610c58565b34801561062157600080fd5b506103316106303660046117bd565b610c82565b34801561064157600080fd5b50610331610650366004611750565b610cf8565b34801561066157600080fd5b506103316106703660046117bd565b610d0b565b34801561068157600080fd5b50600d546102ad90600160a81b900460ff1681565b6060600380546106a59061184e565b80601f01602080910402602001604051908101604052809291908181526020018280546106d19061184e565b801561071e5780601f106106f35761010080835404028352916020019161071e565b820191906000526020600020905b81548152906001019060200180831161070157829003601f168201915b5050505050905090565b600033610736818585610d4b565b60019150505b92915050565b600033610750858285610e70565b61075b858585610eea565b506001949350505050565b61076e611146565b600d805460ff60b01b198116600160b01b9182900460ff1615909102179055565b610797611146565b6001600160a01b03166000908152600c60205260409020805460ff19811660ff90911615179055565b6107c8611146565b6002821080156107d85750600281105b6108185760405162461bcd60e51b815260206004820152600c60248201526b0a8c2f040e8dede40d0d2ced60a31b60448201526064015b60405180910390fd5b6008829055600981905560408051838152602081018390527fb841faf0d1b32571f4ef966a2f35e3ae51f3cdda45318c3da5570a5b2ad85605910160405180910390a15050565b6000336107368185856108728383610c2d565b61087c919061189e565b610d4b565b600e546001600160a01b0316331461089857600080fd5b6108a282826111a0565b5050565b6108b0338261125f565b50565b6108bb611146565b3060009081526020819052604090205480156108da576108da81611389565b4780156108a2576108a28161151f565b6108f2611146565b6108fc6000611559565b565b610906611146565b600d54600160a81b900460ff16156109605760405162461bcd60e51b815260206004820152601b60248201527f54726164696e672068617320616c726561647920737461727465640000000000604482015260640161080f565b737a250d5630b4cf539739df2c5dacb4c659f2488d4660380361099457507305ff2b0db69458a0750badebc4f9e13add608c7f5b600d80546001600160a01b0319166001600160a01b0383169081179091556040805163c45a015560e01b81529051600192600c9260009263c45a0155916004808201926020929091908290030181865afa1580156109f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1a91906118b1565b6001600160a01b031663e6a4390530600d60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa091906118b1565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1191906118b1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905550600d805461ffff60a81b191661010160a81b179055565b6060600480546106a59061184e565b60003381610b6e8286610c2d565b905083811015610bce5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161080f565b61075b8286868403610d4b565b600033610736818585610eea565b610bf1611146565b600b91909155600a55565b610c04611146565b6001600160a01b03166000908152600660205260409020805460ff19811660ff90911615179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610c60611146565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b610c8a611146565b6001600160a01b038116610cef5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161080f565b6108b081611559565b610d00611146565b6108a2308383610eea565b610d13611146565b600e546001600160a01b031615610d2957600080fd5b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dad5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161080f565b6001600160a01b038216610e0e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161080f565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6000610e7c8484610c2d565b90506000198114610ee45781811015610ed75760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161080f565b610ee48484848403610d4b565b50505050565b6001600160a01b038316610f105760405162461bcd60e51b815260040161080f906118ce565b6001600160a01b038216610f365760405162461bcd60e51b815260040161080f90611913565b60008111610f985760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161080f565b6001600160a01b0382166000908152600c602052604081205460ff168015610fc957506001600160a01b0384163014155b15610fef57606460095483610fde9190611956565b610fe8919061196d565b9050611042565b6001600160a01b0384166000908152600c602052604090205460ff16801561102057506001600160a01b0383163014155b15611042576064600854836110359190611956565b61103f919061196d565b90505b30600090815260208190526040902054600d54600160a01b900460ff1615801561108457506001600160a01b0384166000908152600c602052604090205460ff165b80156110995750600d54600160b01b900460ff165b80156110a65750600a5481115b156110d1576110bf6110ba82600b546115ab565b611389565b4780156110cf576110cf4761151f565b505b6001600160a01b03851660009081526006602052604090205460ff168061111057506001600160a01b03841660009081526006602052604090205460ff165b1561111a57600091505b811561112b5761112b8530846115c3565b61113f858561113a858761198f565b6115c3565b5050505050565b6005546001600160a01b031633146108fc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161080f565b6001600160a01b0382166111f65760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161080f565b8060026000828254611208919061189e565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b0382166112bf5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161080f565b6001600160a01b038216600090815260208190526040902054818110156113335760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161080f565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610e63565b600d805460ff60a01b1916600160a01b1790558015806113b35750600d54600160a81b900460ff16155b61150f5760408051600280825260608201835260009260208301908036833701905050905030816000815181106113ec576113ec6119a2565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611445573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146991906118b1565b8160018151811061147c5761147c6119a2565b6001600160a01b039283166020918202929092010152600d546114a29130911684610d4b565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906114db9085906000908690309042906004016119b8565b600060405180830381600087803b1580156114f557600080fd5b505af1158015611509573d6000803e3d6000fd5b50505050505b50600d805460ff60a01b19169055565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108a2573d6000803e3d6000fd5b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008183116115ba57826115bc565b815b9392505050565b6001600160a01b0383166115e95760405162461bcd60e51b815260040161080f906118ce565b6001600160a01b03821661160f5760405162461bcd60e51b815260040161080f90611913565b6001600160a01b038316600090815260208190526040902054818110156116875760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161080f565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610ee4565b600060208083528351808285015260005b8181101561171a578581018301518582016040015282016116fe565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b03811681146108b057600080fd5b6000806040838503121561176357600080fd5b823561176e8161173b565b946020939093013593505050565b60008060006060848603121561179157600080fd5b833561179c8161173b565b925060208401356117ac8161173b565b929592945050506040919091013590565b6000602082840312156117cf57600080fd5b81356115bc8161173b565b600080604083850312156117ed57600080fd5b50508035926020909101359150565b60006020828403121561180e57600080fd5b5035919050565b6000806040838503121561182857600080fd5b82356118338161173b565b915060208301356118438161173b565b809150509250929050565b600181811c9082168061186257607f821691505b60208210810361188257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561073c5761073c611888565b6000602082840312156118c357600080fd5b81516115bc8161173b565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b808202811582820484141761073c5761073c611888565b60008261198a57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561073c5761073c611888565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a085784516001600160a01b0316835293830193918301916001016119e3565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220c9c5be19eb3dd76389a44b7430af9ebb75445a8c6a905cf43201199e78a7bd6064736f6c63430008110033
Verified Source Code Partial Match
Compiler: v0.8.17+commit.8df45f5f
EVM: london
Optimization: Yes (200 runs)
IXTokenV2.sol 805 lines
// Sources flattened with hardhat v2.22.2 https://hardhat.org // SPDX-License-Identifier: BUSL-1.1 AND MIT // File @openzeppelin/contracts/utils/[email protected] // Original license: 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; } } // File @openzeppelin/contracts/access/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; /** * @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); } } // File @openzeppelin/contracts/token/ERC20/[email protected] // Original license: 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); } // File @openzeppelin/contracts/token/ERC20/extensions/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; /** * @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); } // File @openzeppelin/contracts/token/ERC20/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; /** * @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 {} } // File contracts/econ/IXTokenV2.sol // Original license: SPDX_License_Identifier: BUSL-1.1 pragma solidity ^0.8.0; interface IUniswapV2Factory { function getPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint 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); } contract IXTokenV2 is ERC20, Ownable { mapping(address => bool) private _isExcludedFromFee; address payable private _taxWallet; uint256 public constant MAX_BUY_TAX = 2; uint256 public constant MAX_SELL_TAX = 2; uint256 public buyTax = MAX_BUY_TAX; uint256 public sellTax = MAX_SELL_TAX; uint256 public taxSwapThreshold = 100 ether; uint256 public maxTaxSwap = 100 ether; mapping(address => bool) public amms; IUniswapV2Router02 public uniswapV2Router; bool private inSwap = false; bool public tradingOpen; bool public swapEnabled; address public minter; event TaxUpdated(uint256 newBuyTax, uint256 newSellTax); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() ERC20("illumineX Token", "IX") { _taxWallet = payable(msg.sender); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; } function toggleAmm(address _amm) public onlyOwner { amms[_amm] = !amms[_amm]; } function setMinter(address _minter) public onlyOwner { require(minter == address(0)); minter = _minter; } function burn(uint256 amount) public { _burn(msg.sender, amount); } function mint(address to, uint256 amount) public { require(msg.sender == minter); _mint(to, amount); } function _transfer(address from, address to, uint256 amount) internal override { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); uint256 fee = 0; if (amms[to] && from != address(this)) { fee = (amount * sellTax) / 100; } else if (amms[from] && to != address(this)) { fee = (amount * buyTax) / 100; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && amms[to] && swapEnabled && contractTokenBalance > taxSwapThreshold) { swapTokensForEth(min(contractTokenBalance, maxTaxSwap)); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { fee = 0; } if (fee > 0) { super._transfer(from, address(this), fee); } super._transfer(from, to, amount - fee); } function min(uint256 a, uint256 b) private pure returns (uint256) { return (a > b) ? b : a; } function updateTax(uint256 newBuyTax, uint256 newSellTax) public onlyOwner { require(newBuyTax < MAX_BUY_TAX && newSellTax < MAX_SELL_TAX, "Tax too high"); buyTax = newBuyTax; sellTax = newSellTax; emit TaxUpdated(newBuyTax, newSellTax); } function setAutoswapParams(uint256 _maxSwapTax, uint256 _swapThreshold) public onlyOwner { maxTaxSwap = _maxSwapTax; taxSwapThreshold = _swapThreshold; } function toggleSwapStatus() public onlyOwner { swapEnabled = !swapEnabled; } function toggleExcludeFromFee(address _user) public onlyOwner { _isExcludedFromFee[_user] = !_isExcludedFromFee[_user]; } function setTaxWallet(address payable _newTaxWallet) public onlyOwner { _taxWallet = _newTaxWallet; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { if (tokenAmount == 0 || !tradingOpen) { return; } address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function enableTrading() public onlyOwner { require(!tradingOpen, "Trading has already started"); address routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; if (block.chainid == 56) { routerAddress = 0x05fF2B0DB69458A0750badebc4f9e13aDd608C7F; } uniswapV2Router = IUniswapV2Router02(routerAddress); amms[IUniswapV2Factory(uniswapV2Router.factory()).getPair(address(this), uniswapV2Router.WETH())] = true; swapEnabled = true; tradingOpen = true; } receive() external payable {} function withdraw(address to, uint256 amount) public onlyOwner { _transfer(address(this), to, amount); } function swapBalanceToETH() public onlyOwner { uint256 tokenBalance = balanceOf(address(this)); if (tokenBalance > 0) { swapTokensForEth(tokenBalance); } uint256 ethBalance = address(this).balance; if (ethBalance > 0) { sendETHToFee(ethBalance); } } }
Read Contract
MAX_BUY_TAX 0x3de7f844 → uint256
MAX_SELL_TAX 0xe7cb0df9 → uint256
allowance 0xdd62ed3e → uint256
amms 0x5f29a748 → bool
balanceOf 0x70a08231 → uint256
buyTax 0x4f7041a5 → uint256
decimals 0x313ce567 → uint8
maxTaxSwap 0x62997f8c → uint256
minter 0x07546172 → address
name 0x06fdde03 → string
owner 0x8da5cb5b → address
sellTax 0xcc1776d3 → uint256
swapEnabled 0x6ddd1713 → bool
symbol 0x95d89b41 → string
taxSwapThreshold 0x5e7b655c → uint256
totalSupply 0x18160ddd → uint256
tradingOpen 0xffb54a99 → bool
uniswapV2Router 0x1694505e → address
Write Contract 19 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burn 0x42966c68
uint256 amount
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
enableTrading 0x8a8c523c
No parameters
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
mint 0x40c10f19
address to
uint256 amount
renounceOwnership 0x715018a6
No parameters
setAutoswapParams 0xaa6e3301
uint256 _maxSwapTax
uint256 _swapThreshold
setMinter 0xfca3b5aa
address _minter
setTaxWallet 0xea414b28
address _newTaxWallet
swapBalanceToETH 0x6d0ef3a3
No parameters
toggleAmm 0x2bfb8ce4
address _amm
toggleExcludeFromFee 0xba3f076e
address _user
toggleSwapStatus 0x2717653f
No parameters
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateTax 0x2f37aa6d
uint256 newBuyTax
uint256 newSellTax
withdraw 0xf3fef3a3
address to
uint256 amount
Recent Transactions
This address has 1 on-chain transactions, but only 1.5% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →