-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
artifact_sample.json
28 lines (28 loc) · 28.8 KB
/
artifact_sample.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
"manifest": "ethpm/3",
"name": "tmp55rcxgy-",
"version": "0.1.0",
"meta": {
"authors": null,
"license": null,
"description": null,
"keywords": null,
"links": null
},
"sources": {
"contracts/src/snekmate/tokens/ERC20.vy": {
"urls": [],
"checksum": null,
"content": "#pragma version ^0.3.10\n#pragma evm-version shanghai\n\n\"\"\"\n@title Modern and Gas-Efficient ERC-20 + EIP-2612 Implementation\n@custom:contract-name ERC20\n@license GNU Affero General Public License v3.0 only\n@author pcaversaccio\n@notice These functions implement the ERC-20\n standard interface:\n - https://eips.ethereum.org/EIPS/eip-20.\n In addition, the following functions have\n been added for convenience:\n - `name` (`external` `view` function),\n - `symbol` (`external` `view` function),\n - `decimals` (`external` `view` function),\n - `burn` (`external` function),\n - `burn_from` (`external` function),\n - `is_minter` (`external` `view` function),\n - `mint` (`external` function),\n - `set_minter` (`external` function),\n - `permit` (`external` function),\n - `nonces` (`external` `view` function),\n - `DOMAIN_SEPARATOR` (`external` `view` function),\n - `eip712Domain` (`external` `view` function),\n - `owner` (`external` `view` function),\n - `transfer_ownership` (`external` function),\n - `renounce_ownership` (`external` function),\n - `_before_token_transfer` (`internal` function),\n - `_after_token_transfer` (`internal` function).\n The `permit` function implements approvals via\n EIP-712 secp256k1 signatures:\n https://eips.ethereum.org/EIPS/eip-2612.\n In addition, this contract also implements the EIP-5267\n function `eip712Domain`:\n https://eips.ethereum.org/EIPS/eip-5267.\n The implementation is inspired by OpenZeppelin's\n implementation here:\n https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol,\n as well as by ApeAcademy's implementation here:\n https://github.com/ApeAcademy/ERC20/blob/main/%7B%7Bcookiecutter.project_name%7D%7D/contracts/Token.vy.\n@custom:security This ERC-20 implementation allows the commonly known\n address poisoning attack, where `transferFrom` instructions\n are executed from arbitrary addresses with an `amount` of 0.\n However, this poisoning attack is not an on-chain vulnerability.\n All assets are safe. It is an off-chain log interpretation issue.\n The main reason why we do not disallow address poisonig is that\n we do not want to potentially break any DeFi composability.\n This issue has been extensively discussed here:\n https://github.com/pcaversaccio/snekmate/issues/51,\n as well as in the OpenZeppelin repository:\n https://github.com/OpenZeppelin/openzeppelin-contracts/issues/3931.\n\"\"\"\n\n\n# @dev We import and implement the `ERC20` interface,\n# which is a built-in interface of the Vyper compiler.\nfrom vyper.interfaces import ERC20\nimplements: ERC20\n\n\n# @dev We import and implement the `ERC20Detailed` interface,\n# which is a built-in interface of the Vyper compiler.\nfrom vyper.interfaces import ERC20Detailed\nimplements: ERC20Detailed\n\n\n# @dev We import and implement the `IERC20Permit`\n# interface, which is written using standard Vyper\n# syntax.\nimport interfaces.IERC20Permit as IERC20Permit\nimplements: IERC20Permit\n\n\n# @dev We import and implement the `IERC5267` interface,\n# which is written using standard Vyper syntax.\nfrom ..utils.interfaces import IERC5267\nimplements: IERC5267\n\n\n# @dev Returns the decimals places of the token.\n# The default value is 18.\n# @notice If you declare a variable as `public`,\n# Vyper automatically generates an `external`\n# getter function for the variable. Furthermore,\n# to preserve consistency with the interface for\n# the optional metadata functions of the ERC-20\n# standard, we use lower case letters for the\n# `immutable` and `constant` variables `name`,\n# `symbol`, and `decimals`.\ndecimals: public(constant(uint8)) = 18\n\n\n# @dev Constant used as part of the ECDSA recovery function.\n_MALLEABILITY_THRESHOLD: constant(bytes32) = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0\n\n\n# @dev The 32-byte type hash for the EIP-712 domain separator.\n_TYPE_HASH: constant(bytes32) = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\")\n\n\n# @dev The 32-byte type hash of the `permit` function.\n_PERMIT_TYPE_HASH: constant(bytes32) = keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\")\n\n\n# @dev Returns the name of the token.\n# @notice See comment on lower case letters\n# above at `decimals`.\nname: public(immutable(String[25]))\n\n\n# @dev Returns the symbol of the token.\n# @notice See comment on lower case letters\n# above at `decimals`.\nsymbol: public(immutable(String[5]))\n\n\n# @dev Caches the domain separator as an `immutable`\n# value, but also stores the corresponding chain ID\n# to invalidate the cached domain separator if the\n# chain ID changes.\n_CACHED_DOMAIN_SEPARATOR: immutable(bytes32)\n_CACHED_CHAIN_ID: immutable(uint256)\n\n\n# @dev Caches `self` to `immutable` storage to avoid\n# potential issues if a vanilla contract is used in\n# a `delegatecall` context.\n_CACHED_SELF: immutable(address)\n\n\n# @dev `immutable` variables to store the (hashed)\n# name and (hashed) version during contract creation.\n_NAME: immutable(String[50])\n_HASHED_NAME: immutable(bytes32)\n_VERSION: immutable(String[20])\n_HASHED_VERSION: immutable(bytes32)\n\n\n# @dev Returns the amount of tokens owned by an `address`.\nbalanceOf: public(HashMap[address, uint256])\n\n\n# @dev Returns the remaining number of tokens that a\n# `spender` will be allowed to spend on behalf of\n# `owner` through `transferFrom`. This is zero by\n# default. This value changes when `approve` or\n# `transferFrom` are called.\nallowance: public(HashMap[address, HashMap[address, uint256]])\n\n\n# @dev Returns the amount of tokens in existence.\ntotalSupply: public(uint256)\n\n\n# @dev Returns the address of the current owner.\nowner: public(address)\n\n\n# @dev Returns `True` if an `address` has been\n# granted the minter role.\nis_minter: public(HashMap[address, bool])\n\n\n# @dev Returns the current on-chain tracked nonce\n# of `address`.\nnonces: public(HashMap[address, uint256])\n\n\n# @dev Emitted when `amount` tokens are moved\n# from one account (`owner`) to another (`to`).\n# Note that the parameter `amount` may be zero.\nevent Transfer:\n owner: indexed(address)\n to: indexed(address)\n amount: uint256\n\n\n# @dev Emitted when the allowance of a `spender`\n# for an `owner` is set by a call to `approve`.\n# The parameter `amount` is the new allowance.\nevent Approval:\n owner: indexed(address)\n spender: indexed(address)\n amount: uint256\n\n\n# @dev May be emitted to signal that the domain could\n# have changed.\nevent EIP712DomainChanged:\n pass\n\n\n# @dev Emitted when the ownership is transferred\n# from `previous_owner` to `new_owner`.\nevent OwnershipTransferred:\n previous_owner: indexed(address)\n new_owner: indexed(address)\n\n\n# @dev Emitted when the status of a `minter`\n# address is changed.\nevent RoleMinterChanged:\n minter: indexed(address)\n status: bool\n\n\n@external\n@payable\ndef __init__(name_: String[25], symbol_: String[5], initial_supply_: uint256, name_eip712_: String[50], version_eip712_: String[20]):\n \"\"\"\n @dev To omit the opcodes for checking the `msg.value`\n in the creation-time EVM bytecode, the constructor\n is declared as `payable`.\n @notice The initial supply of the token as well\n as the `owner` role will be assigned to\n the `msg.sender`.\n @param name_ The maximum 25-character user-readable\n string name of the token.\n @param symbol_ The maximum 5-character user-readable\n string symbol of the token.\n @param initial_supply_ The initial supply of the token.\n @param name_eip712_ The maximum 50-character user-readable\n string name of the signing domain, i.e. the name\n of the dApp or protocol.\n @param version_eip712_ The maximum 20-character current\n main version of the signing domain. Signatures\n from different versions are not compatible.\n \"\"\"\n initial_supply: uint256 = initial_supply_ * 10 ** convert(decimals, uint256)\n name = name_\n symbol = symbol_\n\n self._transfer_ownership(msg.sender)\n self.is_minter[msg.sender] = True\n log RoleMinterChanged(msg.sender, True)\n\n if (initial_supply != empty(uint256)):\n self._before_token_transfer(empty(address), msg.sender, initial_supply)\n self.totalSupply = initial_supply\n self.balanceOf[msg.sender] = initial_supply\n log Transfer(empty(address), msg.sender, initial_supply)\n self._after_token_transfer(empty(address), msg.sender, initial_supply)\n\n _NAME = name_eip712_\n _VERSION = version_eip712_\n _HASHED_NAME = keccak256(name_eip712_)\n _HASHED_VERSION = keccak256(version_eip712_)\n _CACHED_DOMAIN_SEPARATOR = self._build_domain_separator()\n _CACHED_CHAIN_ID = chain.id\n _CACHED_SELF = self\n\n\n@external\ndef transfer(to: address, amount: uint256) -> bool:\n \"\"\"\n @dev Moves `amount` tokens from the caller's\n account to `to`.\n @notice Note that `to` cannot be the zero address.\n Also, the caller must have a balance of at\n least `amount`.\n @param to The 20-byte receiver address.\n @param amount The 32-byte token amount to be transferred.\n @return bool The verification whether the transfer succeeded\n or failed. Note that the function reverts instead\n of returning `False` on a failure.\n \"\"\"\n self._transfer(msg.sender, to, amount)\n return True\n\n\n@external\ndef approve(spender: address, amount: uint256) -> bool:\n \"\"\"\n @dev Sets `amount` as the allowance of `spender`\n over the caller's tokens.\n @notice WARNING: Note that if `amount` is the maximum\n `uint256`, the allowance is not updated on\n `transferFrom`. This is semantically equivalent\n to an infinite approval. Also, `spender` cannot\n be the zero address.\n\n IMPORTANT: Beware that changing an allowance\n with this method brings the risk that someone\n may use both the old and the new allowance by\n unfortunate transaction ordering. One possible\n solution to mitigate this race condition is to\n first reduce the spender's allowance to 0 and\n set the desired amount afterwards:\n https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729.\n @param spender The 20-byte spender address.\n @param amount The 32-byte token amount that is\n allowed to be spent by the `spender`.\n @return bool The verification whether the approval operation\n succeeded or failed. Note that the function reverts\n instead of returning `False` on a failure.\n \"\"\"\n self._approve(msg.sender, spender, amount)\n return True\n\n\n@external\ndef transferFrom(owner: address, to: address, amount: uint256) -> bool:\n \"\"\"\n @dev Moves `amount` tokens from `owner`\n to `to` using the allowance mechanism.\n The `amount` is then deducted from the\n caller's allowance.\n @notice Note that `owner` and `to` cannot\n be the zero address. Also, `owner`\n must have a balance of at least `amount`.\n Eventually, the caller must have allowance\n for `owner`'s tokens of at least `amount`.\n\n WARNING: The function does not update the\n allowance if the current allowance is the\n maximum `uint256`.\n @param owner The 20-byte owner address.\n @param to The 20-byte receiver address.\n @param amount The 32-byte token amount to be transferred.\n @return bool The verification whether the transfer succeeded\n or failed. Note that the function reverts instead\n of returning `False` on a failure.\n \"\"\"\n self._spend_allowance(owner, msg.sender, amount)\n self._transfer(owner, to, amount)\n return True\n\n\n@external\ndef burn(amount: uint256):\n \"\"\"\n @dev Destroys `amount` tokens from the caller.\n @param amount The 32-byte token amount to be destroyed.\n \"\"\"\n self._burn(msg.sender, amount)\n\n\n@external\ndef burn_from(owner: address, amount: uint256):\n \"\"\"\n @dev Destroys `amount` tokens from `owner`,\n deducting from the caller's allowance.\n @notice Note that `owner` cannot be the\n zero address. Also, the caller must\n have an allowance for `owner`'s tokens\n of at least `amount`.\n @param owner The 20-byte owner address.\n @param amount The 32-byte token amount to be destroyed.\n \"\"\"\n self._spend_allowance(owner, msg.sender, amount)\n self._burn(owner, amount)\n\n\n@external\ndef mint(owner: address, amount: uint256):\n \"\"\"\n @dev Creates `amount` tokens and assigns them to `owner`.\n @notice Only authorised minters can access this function.\n Note that `owner` cannot be the zero address.\n @param amount The 32-byte token amount to be created.\n \"\"\"\n assert self.is_minter[msg.sender], \"AccessControl: access is denied\"\n self._mint(owner, amount)\n\n\n@external\ndef set_minter(minter: address, status: bool):\n \"\"\"\n @dev Adds or removes an address `minter` to/from the\n list of allowed minters. Note that only the\n `owner` can add or remove `minter` addresses.\n Also, the `minter` cannot be the zero address.\n Eventually, the `owner` cannot remove himself\n from the list of allowed minters.\n @param minter The 20-byte minter address.\n @param status The Boolean variable that sets the status.\n \"\"\"\n self._check_owner()\n assert minter != empty(address), \"AccessControl: minter is the zero address\"\n # We ensured in the previous step `self._check_owner()`\n # that `msg.sender` is the `owner`.\n assert minter != msg.sender, \"AccessControl: minter is owner address\"\n self.is_minter[minter] = status\n log RoleMinterChanged(minter, status)\n\n\n@external\ndef permit(owner: address, spender: address, amount: uint256, deadline: uint256, v: uint8, r: bytes32, s: bytes32):\n \"\"\"\n @dev Sets `amount` as the allowance of `spender`\n over `owner`'s tokens, given `owner`'s signed\n approval.\n @notice Note that `spender` cannot be the zero address.\n Also, `deadline` must be a block timestamp in\n the future. `v`, `r`, and `s` must be a valid\n secp256k1 signature from `owner` over the\n EIP-712-formatted function arguments. Eventually,\n the signature must use `owner`'s current nonce.\n @param owner The 20-byte owner address.\n @param spender The 20-byte spender address.\n @param amount The 32-byte token amount that is\n allowed to be spent by the `spender`.\n @param deadline The 32-byte block timestamp up\n which the `spender` is allowed to spend `amount`.\n @param v The secp256k1 1-byte signature parameter `v`.\n @param r The secp256k1 32-byte signature parameter `r`.\n @param s The secp256k1 32-byte signature parameter `s`.\n \"\"\"\n assert block.timestamp <= deadline, \"ERC20Permit: expired deadline\"\n\n current_nonce: uint256 = self.nonces[owner]\n self.nonces[owner] = unsafe_add(current_nonce, 1)\n\n struct_hash: bytes32 = keccak256(_abi_encode(_PERMIT_TYPE_HASH, owner, spender, amount, current_nonce, deadline))\n hash: bytes32 = self._hash_typed_data_v4(struct_hash)\n\n signer: address = self._recover_vrs(hash, convert(v, uint256), convert(r, uint256), convert(s, uint256))\n assert signer == owner, \"ERC20Permit: invalid signature\"\n\n self._approve(owner, spender, amount)\n\n\n@external\n@view\ndef DOMAIN_SEPARATOR() -> bytes32:\n \"\"\"\n @dev Returns the domain separator for the current chain.\n @return bytes32 The 32-byte domain separator.\n \"\"\"\n return self._domain_separator_v4()\n\n\n@external\n@view\ndef eip712Domain() -> (bytes1, String[50], String[20], uint256, address, bytes32, DynArray[uint256, 128]):\n \"\"\"\n @dev Returns the fields and values that describe the domain\n separator used by this contract for EIP-712 signatures.\n @notice The bits in the 1-byte bit map are read from the least\n significant to the most significant, and fields are indexed\n in the order that is specified by EIP-712, identical to the\n order in which they are listed in the function type.\n @return bytes1 The 1-byte bit map where bit `i` is set to 1\n if and only if domain field `i` is present (`0 ≤ i ≤ 4`).\n @return String The maximum 50-character user-readable string name\n of the signing domain, i.e. the name of the dApp or protocol.\n @return String The maximum 20-character current main version of\n the signing domain. Signatures from different versions are\n not compatible.\n @return uint256 The 32-byte EIP-155 chain ID.\n @return address The 20-byte address of the verifying contract.\n @return bytes32 The 32-byte disambiguation salt for the protocol.\n @return DynArray The 32-byte array of EIP-712 extensions.\n \"\"\"\n # Note that `\\x0f` equals `01111`.\n return (convert(b\"\\x0f\", bytes1), _NAME, _VERSION, chain.id, self, empty(bytes32), empty(DynArray[uint256, 128]))\n\n\n@external\ndef transfer_ownership(new_owner: address):\n \"\"\"\n @dev Transfers the ownership of the contract\n to a new account `new_owner`.\n @notice Note that this function can only be\n called by the current `owner`. Also,\n the `new_owner` cannot be the zero address.\n\n WARNING: The ownership transfer also removes\n the previous owner's minter role and assigns\n the minter role to `new_owner` accordingly.\n @param new_owner The 20-byte address of the new owner.\n \"\"\"\n self._check_owner()\n assert new_owner != empty(address), \"Ownable: new owner is the zero address\"\n\n self.is_minter[msg.sender] = False\n log RoleMinterChanged(msg.sender, False)\n\n self._transfer_ownership(new_owner)\n self.is_minter[new_owner] = True\n log RoleMinterChanged(new_owner, True)\n\n\n@external\ndef renounce_ownership():\n \"\"\"\n @dev Leaves the contract without an owner.\n @notice Renouncing ownership will leave the\n contract without an owner, thereby\n removing any functionality that is\n only available to the owner. Note\n that the `owner` is also removed from\n the list of allowed minters.\n\n WARNING: All other existing `minter`\n addresses will still be able to create\n new tokens. Consider removing all non-owner\n minter addresses first via `set_minter`\n before calling `renounce_ownership`.\n \"\"\"\n self._check_owner()\n self.is_minter[msg.sender] = False\n log RoleMinterChanged(msg.sender, False)\n self._transfer_ownership(empty(address))\n\n\n@internal\ndef _transfer(owner: address, to: address, amount: uint256):\n \"\"\"\n @dev Moves `amount` tokens from the owner's\n account to `to`.\n @notice Note that `owner` and `to` cannot be\n the zero address. Also, `owner` must\n have a balance of at least `amount`.\n @param owner The 20-byte owner address.\n @param to The 20-byte receiver address.\n @param amount The 32-byte token amount to be transferred.\n \"\"\"\n assert owner != empty(address), \"ERC20: transfer from the zero address\"\n assert to != empty(address), \"ERC20: transfer to the zero address\"\n\n self._before_token_transfer(owner, to, amount)\n\n owner_balanceOf: uint256 = self.balanceOf[owner]\n assert owner_balanceOf >= amount, \"ERC20: transfer amount exceeds balance\"\n self.balanceOf[owner] = unsafe_sub(owner_balanceOf, amount)\n self.balanceOf[to] = unsafe_add(self.balanceOf[to], amount)\n log Transfer(owner, to, amount)\n\n self._after_token_transfer(owner, to, amount)\n\n\n@internal\ndef _mint(owner: address, amount: uint256):\n \"\"\"\n @dev Creates `amount` tokens and assigns\n them to `owner`, increasing the\n total supply.\n @notice This is an `internal` function without\n access restriction. Note that `owner`\n cannot be the zero address.\n @param owner The 20-byte owner address.\n @param amount The 32-byte token amount to be created.\n \"\"\"\n assert owner != empty(address), \"ERC20: mint to the zero address\"\n\n self._before_token_transfer(empty(address), owner, amount)\n\n self.totalSupply += amount\n self.balanceOf[owner] = unsafe_add(self.balanceOf[owner], amount)\n log Transfer(empty(address), owner, amount)\n\n self._after_token_transfer(empty(address), owner, amount)\n\n\n@internal\ndef _burn(owner: address, amount: uint256):\n \"\"\"\n @dev Destroys `amount` tokens from `owner`,\n reducing the total supply.\n @notice Note that `owner` cannot be the\n zero address. Also, `owner` must\n have at least `amount` tokens.\n @param owner The 20-byte owner address.\n @param amount The 32-byte token amount to be destroyed.\n \"\"\"\n assert owner != empty(address), \"ERC20: burn from the zero address\"\n\n self._before_token_transfer(owner, empty(address), amount)\n\n account_balance: uint256 = self.balanceOf[owner]\n assert account_balance >= amount, \"ERC20: burn amount exceeds balance\"\n self.balanceOf[owner] = unsafe_sub(account_balance, amount)\n self.totalSupply = unsafe_sub(self.totalSupply, amount)\n log Transfer(owner, empty(address), amount)\n\n self._after_token_transfer(owner, empty(address), amount)\n\n\n@internal\ndef _approve(owner: address, spender: address, amount: uint256):\n \"\"\"\n @dev Sets `amount` as the allowance of `spender`\n over the `owner`'s tokens.\n @notice Note that `owner` and `spender` cannot\n be the zero address.\n @param owner The 20-byte owner address.\n @param spender The 20-byte spender address.\n @param amount The 32-byte token amount that is\n allowed to be spent by the `spender`.\n \"\"\"\n assert owner != empty(address), \"ERC20: approve from the zero address\"\n assert spender != empty(address), \"ERC20: approve to the zero address\"\n\n self.allowance[owner][spender] = amount\n log Approval(owner, spender, amount)\n\n\n@internal\ndef _spend_allowance(owner: address, spender: address, amount: uint256):\n \"\"\"\n @dev Updates `owner`'s allowance for `spender`\n based on spent `amount`.\n @notice WARNING: Note that it does not update the\n allowance `amount` in case of infinite\n allowance. Also, it reverts if not enough\n allowance is available.\n @param owner The 20-byte owner address.\n @param spender The 20-byte spender address.\n @param amount The 32-byte token amount that is\n allowed to be spent by the `spender`.\n \"\"\"\n current_allowance: uint256 = self.allowance[owner][spender]\n if (current_allowance != max_value(uint256)):\n # The following line allows the commonly known address\n # poisoning attack, where `transferFrom` instructions\n # are executed from arbitrary addresses with an `amount`\n # of 0. However, this poisoning attack is not an on-chain\n # vulnerability. All assets are safe. It is an off-chain\n # log interpretation issue.\n assert current_allowance >= amount, \"ERC20: insufficient allowance\"\n self._approve(owner, spender, unsafe_sub(current_allowance, amount))\n\n\n@internal\ndef _before_token_transfer(owner: address, to: address, amount: uint256):\n \"\"\"\n @dev Hook that is called before any transfer of tokens.\n This includes minting and burning.\n @notice The calling conditions are:\n - when `owner` and `to` are both non-zero,\n `amount` of `owner`'s tokens will be\n transferred to `to`,\n - when `owner` is zero, `amount` tokens will\n be minted for `to`,\n - when `to` is zero, `amount` of `owner`'s\n tokens will be burned,\n - `owner` and `to` are never both zero.\n @param owner The 20-byte owner address.\n @param to The 20-byte receiver address.\n @param amount The 32-byte token amount to be transferred.\n \"\"\"\n pass\n\n\n@internal\ndef _after_token_transfer(owner: address, to: address, amount: uint256):\n \"\"\"\n @dev Hook that is called after any transfer of tokens.\n This includes minting and burning.\n @notice The calling conditions are:\n - when `owner` and `to` are both non-zero,\n `amount` of `owner`'s tokens has been\n transferred to `to`,\n - when `owner` is zero, `amount` tokens\n have been minted for `to`,\n - when `to` is zero, `amount` of `owner`'s\n tokens have been burned,\n - `owner` and `to` are never both zero.\n @param owner The 20-byte owner address.\n @param to The 20-byte receiver address.\n @param amount The 32-byte token amount that has\n been transferred.\n \"\"\"\n pass\n\n\n@internal\ndef _check_owner():\n \"\"\"\n @dev Sourced from {Ownable-_check_owner}.\n @notice See {Ownable-_check_owner} for\n the function docstring.\n \"\"\"\n assert msg.sender == self.owner, \"Ownable: caller is not the owner\"\n\n\n@internal\ndef _transfer_ownership(new_owner: address):\n \"\"\"\n @dev Sourced from {Ownable-_transfer_ownership}.\n @notice See {Ownable-_transfer_ownership} for\n the function docstring.\n \"\"\"\n old_owner: address = self.owner\n self.owner = new_owner\n log OwnershipTransferred(old_owner, new_owner)\n\n\n@internal\n@view\ndef _domain_separator_v4() -> bytes32:\n \"\"\"\n @dev Sourced from {EIP712DomainSeparator-domain_separator_v4}.\n @notice See {EIP712DomainSeparator-domain_separator_v4}\n for the function docstring.\n \"\"\"\n if (self == _CACHED_SELF and chain.id == _CACHED_CHAIN_ID):\n return _CACHED_DOMAIN_SEPARATOR\n else:\n return self._build_domain_separator()\n\n\n@internal\n@view\ndef _build_domain_separator() -> bytes32:\n \"\"\"\n @dev Sourced from {EIP712DomainSeparator-_build_domain_separator}.\n @notice See {EIP712DomainSeparator-_build_domain_separator}\n for the function docstring.\n \"\"\"\n return keccak256(_abi_encode(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION, chain.id, self))\n\n\n@internal\n@view\ndef _hash_typed_data_v4(struct_hash: bytes32) -> bytes32:\n \"\"\"\n @dev Sourced from {EIP712DomainSeparator-hash_typed_data_v4}.\n @notice See {EIP712DomainSeparator-hash_typed_data_v4}\n for the function docstring.\n \"\"\"\n return self._to_typed_data_hash(self._domain_separator_v4(), struct_hash)\n\n\n@internal\n@pure\ndef _to_typed_data_hash(domain_separator: bytes32, struct_hash: bytes32) -> bytes32:\n \"\"\"\n @dev Sourced from {ECDSA-to_typed_data_hash}.\n @notice See {ECDSA-to_typed_data_hash} for the\n function docstring.\n \"\"\"\n return keccak256(concat(b\"\\x19\\x01\", domain_separator, struct_hash))\n\n\n@internal\n@pure\ndef _recover_vrs(hash: bytes32, v: uint256, r: uint256, s: uint256) -> address:\n \"\"\"\n @dev Sourced from {ECDSA-_recover_vrs}.\n @notice See {ECDSA-_recover_vrs} for the\n function docstring.\n \"\"\"\n return self._try_recover_vrs(hash, v, r, s)\n\n\n@internal\n@pure\ndef _try_recover_vrs(hash: bytes32, v: uint256, r: uint256, s: uint256) -> address:\n \"\"\"\n @dev Sourced from {ECDSA-_try_recover_vrs}.\n @notice See {ECDSA-_try_recover_vrs} for the\n function docstring.\n \"\"\"\n assert s <= convert(_MALLEABILITY_THRESHOLD, uint256), \"ECDSA: invalid signature `s` value\"\n\n signer: address = ecrecover(hash, v, r, s)\n assert signer != empty(address), \"ECDSA: invalid signature\"\n\n return signer\n",
"installPath": null,
"type": null,
"license": null,
"references": null,
"imports": null
}
},
"contractTypes": {},
"compilers": null,
"deployments": {},
"buildDependencies": {}
}