Code for 0x30ae…c77e (WrappedAyeAyeCoin)
Since block 19957983
Verified contract
- {{
- "language": "Solidity",
- "sources": {
- "WrappedAyeAyeCoin.sol": {
- "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ninterface AyeAyeCoin {\n\n function coinBalanceOf(address _owner) external returns (uint256);\n function sendCoin(address _receiver, uint256 _amount) external;\n}\n\ncontract DropBox is Ownable(msg.sender) {\n\n function collect(uint256 value, AyeAyeCoin aaInt) public onlyOwner {\n aaInt.sendCoin(owner(), value);\n }\n}\n\ncontract WrappedAyeAyeCoin is ERC20 {\n\n event DropBoxCreated(address indexed owner);\n event ClaimedAndWrapped(uint256 indexed value, address indexed owner);\n event Wrapped(uint256 indexed value, address indexed owner);\n event Unwrapped(uint256 indexed value, address indexed owner);\n\n bytes constant claimSig = hex\"5479f98b\";\n address constant faucetAddr = 0xcD063B3081Ea55535E5b60a21eff7f14E785A877;\n address constant aaAddr = 0x3edDc7ebC7db94f54b72D8Ed1F42cE6A527305bB;\n AyeAyeCoin constant aaInt = AyeAyeCoin(aaAddr);\n\n mapping(address => address) public dropBoxes;\n\n constructor() ERC20(\"Wrapped AyeAyeCoin\", \"WAAC\") {}\n\n function createDropBox() public {\n require(dropBoxes[msg.sender] == address(0), \"Drop box already exists\");\n\n dropBoxes[msg.sender] = address(new DropBox());\n \n emit DropBoxCreated(msg.sender);\n }\n\n function claimAndWrap(uint256 value) public {\n require(aaInt.coinBalanceOf(faucetAddr) >= value, \"Not enough coins in faucet\");\n\n for (uint256 i = 0; i < value; i++) {\n aaAddr.call(claimSig);\n }\n _mint(msg.sender, value);\n \n emit ClaimedAndWrapped(value, msg.sender);\n }\n\n function wrap(uint256 value) public {\n address dropBox = dropBoxes[msg.sender];\n\n require(dropBox != address(0), \"You must create a drop box first\"); \n require(aaInt.coinBalanceOf(dropBox) >= value, \"Not enough coins in drop box\");\n\n DropBox(dropBox).collect(value, aaInt);\n _mint(msg.sender, value);\n \n emit Wrapped(value, msg.sender);\n }\n\n function unwrap(uint256 value) public {\n require(balanceOf(msg.sender) >= value, \"Not enough coins to unwrap\");\n\n aaInt.sendCoin(msg.sender, value);\n _burn(msg.sender, value);\n\n emit Unwrapped(value, msg.sender);\n }\n\n function decimals() public pure override returns (uint8) {\n return 0;\n }\n}"
- },
- "@openzeppelin/contracts/access/Ownable.sol": {
- "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
- },
- "@openzeppelin/contracts/token/ERC20/ERC20.sol": {
- "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC20Metadata} from \"./extensions/IERC20Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {IERC20Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n */\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n mapping(address account => uint256) private _balances;\n\n mapping(address account => mapping(address spender => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `value`.\n */\n function transfer(address to, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, value);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, value);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `value`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `value`.\n */\n function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, value);\n _transfer(from, to, value);\n return true;\n }\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _transfer(address from, address to, uint256 value) internal {\n if (from == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n if (to == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(from, to, value);\n }\n\n /**\n * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n * this function.\n *\n * Emits a {Transfer} event.\n */\n function _update(address from, address to, uint256 value) internal virtual {\n if (from == address(0)) {\n // Overflow check required: The rest of the code assumes that totalSupply never overflows\n _totalSupply += value;\n } else {\n uint256 fromBalance = _balances[from];\n if (fromBalance < value) {\n revert ERC20InsufficientBalance(from, fromBalance, value);\n }\n unchecked {\n // Overflow not possible: value <= fromBalance <= totalSupply.\n _balances[from] = fromBalance - value;\n }\n }\n\n if (to == address(0)) {\n unchecked {\n // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n _totalSupply -= value;\n }\n } else {\n unchecked {\n // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n _balances[to] += value;\n }\n }\n\n emit Transfer(from, to, value);\n }\n\n /**\n * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n * Relies on the `_update` mechanism\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _mint(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(address(0), account, value);\n }\n\n /**\n * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n * Relies on the `_update` mechanism.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead\n */\n function _burn(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n _update(account, address(0), value);\n }\n\n /**\n * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address owner, address spender, uint256 value) internal {\n _approve(owner, spender, value, true);\n }\n\n /**\n * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n *\n * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n * `Approval` event during `transferFrom` operations.\n *\n * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n * true using the following override:\n * ```\n * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n * super._approve(owner, spender, value, true);\n * }\n * ```\n *\n * Requirements are the same as {_approve}.\n */\n function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n if (owner == address(0)) {\n revert ERC20InvalidApprover(address(0));\n }\n if (spender == address(0)) {\n revert ERC20InvalidSpender(address(0));\n }\n _allowances[owner][spender] = value;\n if (emitEvent) {\n emit Approval(owner, spender, value);\n }\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `value`.\n *\n * Does not update the allowance value in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Does not emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n if (currentAllowance < value) {\n revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n }\n unchecked {\n _approve(owner, spender, currentAllowance - value, false);\n }\n }\n }\n}\n"
- },
- "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": {
- "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"
- },
- "@openzeppelin/contracts/utils/Context.sol": {
- "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n"
- },
- "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": {
- "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n"
- },
- "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
- "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"
- }
- },
- "settings": {
- "optimizer": {
- "enabled": false,
- "runs": 200
- },
- "outputSelection": {
- "*": {
- "*": [
- "evm.bytecode",
- "evm.deployedBytecode",
- "devdoc",
- "userdoc",
- "metadata",
- "abi"
- ]
- }
- }
- }
- }}
Contract sourced from Etherscan. Solidity version v0.8.20+commit.a1b79de6
.
Panoramix decompilation
# Palkeoramix decompiler. def _fallback(?): # not payable, default function revert
Decompilation generated by Panoramix.
Raw bytecode
0x608060405234801562000010575f80fd5b5060043610620000fe575f3560e01c806395d89b411162000097578063d6d2bb98116200006d578063d6d2bb98146200028e578063dd62ed3e14620002c4578063de0e9a3e14620002fa578063ea598cb0146200031a57620000fe565b806395d89b41146200022a578063a9059cbb146200024c578063b8bdd4b2146200028257620000fe565b806323b872dd11620000d957806323b872dd146200017c578063313ce56714620001b257806370a0823114620001d45780637844c393146200020a57620000fe565b806306fdde031462000102578063095ea7b3146200012457806318160ddd146200015a575b5f80fd5b6200010c6200033a565b6040516200011b9190620014a8565b60405180910390f35b6200014260048036038101906200013c919062001567565b620003d2565b604051620001519190620015c8565b60405180910390f35b62000164620003f8565b604051620001739190620015f4565b60405180910390f35b6200019a60048036038101906200019491906200160f565b62000401565b604051620001a99190620015c8565b60405180910390f35b620001bc62000435565b604051620001cb919062001685565b60405180910390f35b620001f26004803603810190620001ec9190620016a0565b62000439565b604051620002019190620015f4565b60405180910390f35b620002286004803603810190620002229190620016d0565b6200047e565b005b6200023462000691565b604051620002439190620014a8565b60405180910390f35b6200026a600480360381019062000264919062001567565b62000729565b604051620002799190620015c8565b60405180910390f35b6200028c6200074f565b005b620002ac6004803603810190620002a69190620016a0565b62000904565b604051620002bb919062001711565b60405180910390f35b620002e26004803603810190620002dc91906200172c565b62000934565b604051620002f19190620015f4565b60405180910390f35b620003186004803603810190620003129190620016d0565b620009b6565b005b620003386004803603810190620003329190620016d0565b62000ad9565b005b6060600380546200034b906200179e565b80601f016020809104026020016040519081016040528092919081815260200182805462000379906200179e565b8015620003c85780601f106200039e57610100808354040283529160200191620003c8565b820191905f5260205f20905b815481529060010190602001808311620003aa57829003601f168201915b5050505050905090565b5f80620003de62000d55565b9050620003ed81858562000d5c565b600191505092915050565b5f600254905090565b5f806200040d62000d55565b90506200041c85828562000d70565b6200042985858562000e0a565b60019150509392505050565b5f90565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b80733eddc7ebc7db94f54b72d8ed1f42ce6a527305bb73ffffffffffffffffffffffffffffffffffffffff1663bbd39ac073cd063b3081ea55535e5b60a21eff7f14e785a8776040518263ffffffff1660e01b8152600401620004e2919062001711565b6020604051808303815f875af1158015620004ff573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620005259190620017e8565b101562000569576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620005609062001866565b60405180910390fd5b5f5b818110156200063d57733eddc7ebc7db94f54b72d8ed1f42ce6a527305bb73ffffffffffffffffffffffffffffffffffffffff166040518060400160405280600481526020017f5479f98b00000000000000000000000000000000000000000000000000000000815250604051620005e49190620018d0565b5f604051808303815f865af19150503d805f81146200061f576040519150601f19603f3d011682016040523d82523d5f602084013e62000624565b606091505b5050508080620006349062001915565b9150506200056b565b506200064a338262000f02565b3373ffffffffffffffffffffffffffffffffffffffff16817f0698dc68abe4e268dc6d6cbabea5fc24ae8bace764c1ab5e1dbe12a4d9067b0b60405160405180910390a350565b606060048054620006a2906200179e565b80601f0160208091040260200160405190810160405280929190818152602001828054620006d0906200179e565b80156200071f5780601f10620006f5576101008083540402835291602001916200071f565b820191905f5260205f20905b8154815290600101906020018083116200070157829003601f168201915b5050505050905090565b5f806200073562000d55565b90506200074481858562000e0a565b600191505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff1660055f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146200081c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200081390620019af565b60405180910390fd5b6040516200082a9062001406565b604051809103905ff08015801562000844573d5f803e3d5ffd5b5060055f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167f2c601b1355d1a6cd1373df5a1e2460c77aedfbb5c16c66b47bb96b35462808e260405160405180910390a2565b6005602052805f5260405f205f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b80620009c23362000439565b101562000a06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620009fd9062001a1d565b60405180910390fd5b733eddc7ebc7db94f54b72d8ed1f42ce6a527305bb73ffffffffffffffffffffffffffffffffffffffff166390b98a1133836040518363ffffffff1660e01b815260040162000a5792919062001a3d565b5f604051808303815f87803b15801562000a6f575f80fd5b505af115801562000a82573d5f803e3d5ffd5b5050505062000a92338262000f86565b3373ffffffffffffffffffffffffffffffffffffffff16817f1d27d1c62712f590d53fa9eb8bbf3a75d09503deae319bb9d99644339cb312e160405160405180910390a350565b5f60055f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160362000baa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000ba19062001ab6565b60405180910390fd5b81733eddc7ebc7db94f54b72d8ed1f42ce6a527305bb73ffffffffffffffffffffffffffffffffffffffff1663bbd39ac0836040518263ffffffff1660e01b815260040162000bfa919062001711565b6020604051808303815f875af115801562000c17573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000c3d9190620017e8565b101562000c81576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000c789062001b24565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16638d3c100a83733eddc7ebc7db94f54b72d8ed1f42ce6a527305bb6040518363ffffffff1660e01b815260040162000cd292919062001bab565b5f604051808303815f87803b15801562000cea575f80fd5b505af115801562000cfd573d5f803e3d5ffd5b5050505062000d0d338362000f02565b3373ffffffffffffffffffffffffffffffffffffffff16827f9c307a39a47fdf1a019642a4e8a585ffe9894b5018226029887fe6d4241611bb60405160405180910390a35050565b5f33905090565b62000d6b83838360016200100a565b505050565b5f62000d7d848462000934565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811462000e04578181101562000df3578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040162000dea9392919062001bd6565b60405180910390fd5b62000e0384848484035f6200100a565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160362000e7d575f6040517f96c6fd1e00000000000000000000000000000000000000000000000000000000815260040162000e74919062001711565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160362000ef0575f6040517fec442f0500000000000000000000000000000000000000000000000000000000815260040162000ee7919062001711565b60405180910390fd5b62000efd838383620011e2565b505050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160362000f75575f6040517fec442f0500000000000000000000000000000000000000000000000000000000815260040162000f6c919062001711565b60405180910390fd5b62000f825f8383620011e2565b5050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160362000ff9575f6040517f96c6fd1e00000000000000000000000000000000000000000000000000000000815260040162000ff0919062001711565b60405180910390fd5b62001006825f83620011e2565b5050565b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036200107d575f6040517fe602df0500000000000000000000000000000000000000000000000000000000815260040162001074919062001711565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603620010f0575f6040517f94280d62000000000000000000000000000000000000000000000000000000008152600401620010e7919062001711565b60405180910390fd5b8160015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508015620011dc578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051620011d39190620015f4565b60405180910390a35b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160362001236578060025f82825462001229919062001c11565b9250508190555062001307565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905081811015620012c2578381836040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401620012b99392919062001bd6565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550505b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160362001350578060025f82825403925050819055506200139a565b805f808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051620013f99190620015f4565b60405180910390a3505050565b6106bb8062001c4c83390190565b5f81519050919050565b5f82825260208201905092915050565b5f5b838110156200144d57808201518184015260208101905062001430565b5f8484015250505050565b5f601f19601f8301169050919050565b5f620014748262001414565b6200148081856200141e565b9350620014928185602086016200142e565b6200149d8162001458565b840191505092915050565b5f6020820190508181035f830152620014c2818462001468565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f620014f982620014ce565b9050919050565b6200150b81620014ed565b811462001516575f80fd5b50565b5f81359050620015298162001500565b92915050565b5f819050919050565b62001543816200152f565b81146200154e575f80fd5b50565b5f81359050620015618162001538565b92915050565b5f806040838503121562001580576200157f620014ca565b5b5f6200158f8582860162001519565b9250506020620015a28582860162001551565b9150509250929050565b5f8115159050919050565b620015c281620015ac565b82525050565b5f602082019050620015dd5f830184620015b7565b92915050565b620015ee816200152f565b82525050565b5f602082019050620016095f830184620015e3565b92915050565b5f805f60608486031215620016295762001628620014ca565b5b5f620016388682870162001519565b93505060206200164b8682870162001519565b92505060406200165e8682870162001551565b9150509250925092565b5f60ff82169050919050565b6200167f8162001668565b82525050565b5f6020820190506200169a5f83018462001674565b92915050565b5f60208284031215620016b857620016b7620014ca565b5b5f620016c78482850162001519565b91505092915050565b5f60208284031215620016e857620016e7620014ca565b5b5f620016f78482850162001551565b91505092915050565b6200170b81620014ed565b82525050565b5f602082019050620017265f83018462001700565b92915050565b5f8060408385031215620017455762001744620014ca565b5b5f620017548582860162001519565b9250506020620017678582860162001519565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680620017b657607f821691505b602082108103620017cc57620017cb62001771565b5b50919050565b5f81519050620017e28162001538565b92915050565b5f602082840312156200180057620017ff620014ca565b5b5f6200180f84828501620017d2565b91505092915050565b7f4e6f7420656e6f75676820636f696e7320696e206661756365740000000000005f82015250565b5f6200184e601a836200141e565b91506200185b8262001818565b602082019050919050565b5f6020820190508181035f8301526200187f8162001840565b9050919050565b5f81519050919050565b5f81905092915050565b5f620018a68262001886565b620018b2818562001890565b9350620018c48185602086016200142e565b80840191505092915050565b5f620018dd82846200189a565b915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f62001921826200152f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203620019565762001955620018e8565b5b600182019050919050565b7f44726f7020626f7820616c7265616479206578697374730000000000000000005f82015250565b5f620019976017836200141e565b9150620019a48262001961565b602082019050919050565b5f6020820190508181035f830152620019c88162001989565b9050919050565b7f4e6f7420656e6f75676820636f696e7320746f20756e777261700000000000005f82015250565b5f62001a05601a836200141e565b915062001a1282620019cf565b602082019050919050565b5f6020820190508181035f83015262001a3681620019f7565b9050919050565b5f60408201905062001a525f83018562001700565b62001a616020830184620015e3565b9392505050565b7f596f75206d7573742063726561746520612064726f7020626f782066697273745f82015250565b5f62001a9e6020836200141e565b915062001aab8262001a68565b602082019050919050565b5f6020820190508181035f83015262001acf8162001a90565b9050919050565b7f4e6f7420656e6f75676820636f696e7320696e2064726f7020626f78000000005f82015250565b5f62001b0c601c836200141e565b915062001b198262001ad6565b602082019050919050565b5f6020820190508181035f83015262001b3d8162001afe565b9050919050565b5f819050919050565b5f62001b6d62001b6762001b6184620014ce565b62001b44565b620014ce565b9050919050565b5f62001b808262001b4d565b9050919050565b5f62001b938262001b74565b9050919050565b62001ba58162001b87565b82525050565b5f60408201905062001bc05f830185620015e3565b62001bcf602083018462001b9a565b9392505050565b5f60608201905062001beb5f83018662001700565b62001bfa6020830185620015e3565b62001c096040830184620015e3565b949350505050565b5f62001c1d826200152f565b915062001c2a836200152f565b925082820190508082111562001c455762001c44620018e8565b5b9291505056fe608060405234801561000f575f80fd5b50335f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610081575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016100789190610196565b60405180910390fd5b6100908161009660201b60201c565b506101af565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61018082610157565b9050919050565b61019081610176565b82525050565b5f6020820190506101a95f830184610187565b92915050565b6104ff806101bc5f395ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c8063715018a61461004e5780638d3c100a146100585780638da5cb5b14610074578063f2fde38b14610092575b5f80fd5b6100566100ae565b005b610072600480360381019061006d91906103d8565b6100c1565b005b61007c61013c565b6040516100899190610425565b60405180910390f35b6100ac60048036038101906100a79190610468565b610163565b005b6100b66101e7565b6100bf5f61026e565b565b6100c96101e7565b8073ffffffffffffffffffffffffffffffffffffffff166390b98a116100ed61013c565b846040518363ffffffff1660e01b815260040161010b9291906104a2565b5f604051808303815f87803b158015610122575f80fd5b505af1158015610134573d5f803e3d5ffd5b505050505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61016b6101e7565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036101db575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016101d29190610425565b60405180910390fd5b6101e48161026e565b50565b6101ef61032f565b73ffffffffffffffffffffffffffffffffffffffff1661020d61013c565b73ffffffffffffffffffffffffffffffffffffffff161461026c5761023061032f565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016102639190610425565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f80fd5b5f819050919050565b61034c8161033a565b8114610356575f80fd5b50565b5f8135905061036781610343565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6103968261036d565b9050919050565b5f6103a78261038c565b9050919050565b6103b78161039d565b81146103c1575f80fd5b50565b5f813590506103d2816103ae565b92915050565b5f80604083850312156103ee576103ed610336565b5b5f6103fb85828601610359565b925050602061040c858286016103c4565b9150509250929050565b61041f8161038c565b82525050565b5f6020820190506104385f830184610416565b92915050565b6104478161038c565b8114610451575f80fd5b50565b5f813590506104628161043e565b92915050565b5f6020828403121561047d5761047c610336565b5b5f61048a84828501610454565b91505092915050565b61049c8161033a565b82525050565b5f6040820190506104b55f830185610416565b6104c26020830184610493565b939250505056fea26469706673582212202a05c88132ac7f78d55366c9bee04544ecb81ab88c6c5b3e46b0f5a1aad00ed964736f6c63430008140033a2646970667358221220cae359c63c396ae5b0d9f37b6c54a2ec3bfdd898256404304ca071481662c9fc64736f6c63430008140033