Created
May 23, 2024 18:36
-
-
Save dvgui/afba278e2c0a9ee155b4d3acbc2cc9bc to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.19+commit.7dd6d404.js&optimize=true&runs=10000&gist=
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) | |
pragma solidity ^0.8.0; | |
import "../utils/Context.sol"; | |
/** | |
* @dev Contract module which provides a basic access control mechanism, where | |
* there is an account (an owner) that can be granted exclusive access to | |
* specific functions. | |
* | |
* By default, the owner account will be the one that deploys the contract. This | |
* can later be changed with {transferOwnership}. | |
* | |
* This module is used through inheritance. It will make available the modifier | |
* `onlyOwner`, which can be applied to your functions to restrict their use to | |
* the owner. | |
*/ | |
abstract contract Ownable is Context { | |
address private _owner; | |
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); | |
/** | |
* @dev Initializes the contract setting the deployer as the initial owner. | |
*/ | |
constructor() { | |
_transferOwnership(_msgSender()); | |
} | |
/** | |
* @dev Throws if called by any account other than the owner. | |
*/ | |
modifier onlyOwner() { | |
_checkOwner(); | |
_; | |
} | |
/** | |
* @dev Returns the address of the current owner. | |
*/ | |
function owner() public view virtual returns (address) { | |
return _owner; | |
} | |
/** | |
* @dev Throws if the sender is not the owner. | |
*/ | |
function _checkOwner() internal view virtual { | |
require(owner() == _msgSender(), "Ownable: caller is not the owner"); | |
} | |
/** | |
* @dev Leaves the contract without owner. It will not be possible to call | |
* `onlyOwner` functions. Can only be called by the current owner. | |
* | |
* NOTE: Renouncing ownership will leave the contract without an owner, | |
* thereby disabling any functionality that is only available to the owner. | |
*/ | |
function renounceOwnership() public virtual onlyOwner { | |
_transferOwnership(address(0)); | |
} | |
/** | |
* @dev Transfers ownership of the contract to a new account (`newOwner`). | |
* Can only be called by the current owner. | |
*/ | |
function transferOwnership(address newOwner) public virtual onlyOwner { | |
require(newOwner != address(0), "Ownable: new owner is the zero address"); | |
_transferOwnership(newOwner); | |
} | |
/** | |
* @dev Transfers ownership of the contract to a new account (`newOwner`). | |
* Internal function without access restriction. | |
*/ | |
function _transferOwnership(address newOwner) internal virtual { | |
address oldOwner = _owner; | |
_owner = newOwner; | |
emit OwnershipTransferred(oldOwner, newOwner); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) | |
pragma solidity ^0.8.1; | |
/** | |
* @dev Collection of functions related to the address type | |
*/ | |
library Address { | |
/** | |
* @dev Returns true if `account` is a contract. | |
* | |
* [IMPORTANT] | |
* ==== | |
* It is unsafe to assume that an address for which this function returns | |
* false is an externally-owned account (EOA) and not a contract. | |
* | |
* Among others, `isContract` will return false for the following | |
* types of addresses: | |
* | |
* - an externally-owned account | |
* - a contract in construction | |
* - an address where a contract will be created | |
* - an address where a contract lived, but was destroyed | |
* | |
* Furthermore, `isContract` will also return true if the target contract within | |
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`, | |
* which only has an effect at the end of a transaction. | |
* ==== | |
* | |
* [IMPORTANT] | |
* ==== | |
* You shouldn't rely on `isContract` to protect against flash loan attacks! | |
* | |
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets | |
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract | |
* constructor. | |
* ==== | |
*/ | |
function isContract(address account) internal view returns (bool) { | |
// This method relies on extcodesize/address.code.length, which returns 0 | |
// for contracts in construction, since the code is only stored at the end | |
// of the constructor execution. | |
return account.code.length > 0; | |
} | |
/** | |
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to | |
* `recipient`, forwarding all available gas and reverting on errors. | |
* | |
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost | |
* of certain opcodes, possibly making contracts go over the 2300 gas limit | |
* imposed by `transfer`, making them unable to receive funds via | |
* `transfer`. {sendValue} removes this limitation. | |
* | |
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. | |
* | |
* IMPORTANT: because control is transferred to `recipient`, care must be | |
* taken to not create reentrancy vulnerabilities. Consider using | |
* {ReentrancyGuard} or the | |
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. | |
*/ | |
function sendValue(address payable recipient, uint256 amount) internal { | |
require(address(this).balance >= amount, "Address: insufficient balance"); | |
(bool success, ) = recipient.call{value: amount}(""); | |
require(success, "Address: unable to send value, recipient may have reverted"); | |
} | |
/** | |
* @dev Performs a Solidity function call using a low level `call`. A | |
* plain `call` is an unsafe replacement for a function call: use this | |
* function instead. | |
* | |
* If `target` reverts with a revert reason, it is bubbled up by this | |
* function (like regular Solidity function calls). | |
* | |
* Returns the raw returned data. To convert to the expected return value, | |
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. | |
* | |
* Requirements: | |
* | |
* - `target` must be a contract. | |
* - calling `target` with `data` must not revert. | |
* | |
* _Available since v3.1._ | |
*/ | |
function functionCall(address target, bytes memory data) internal returns (bytes memory) { | |
return functionCallWithValue(target, data, 0, "Address: low-level call failed"); | |
} | |
/** | |
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with | |
* `errorMessage` as a fallback revert reason when `target` reverts. | |
* | |
* _Available since v3.1._ | |
*/ | |
function functionCall( | |
address target, | |
bytes memory data, | |
string memory errorMessage | |
) internal returns (bytes memory) { | |
return functionCallWithValue(target, data, 0, errorMessage); | |
} | |
/** | |
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], | |
* but also transferring `value` wei to `target`. | |
* | |
* Requirements: | |
* | |
* - the calling contract must have an ETH balance of at least `value`. | |
* - the called Solidity function must be `payable`. | |
* | |
* _Available since v3.1._ | |
*/ | |
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { | |
return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); | |
} | |
/** | |
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but | |
* with `errorMessage` as a fallback revert reason when `target` reverts. | |
* | |
* _Available since v3.1._ | |
*/ | |
function functionCallWithValue( | |
address target, | |
bytes memory data, | |
uint256 value, | |
string memory errorMessage | |
) internal returns (bytes memory) { | |
require(address(this).balance >= value, "Address: insufficient balance for call"); | |
(bool success, bytes memory returndata) = target.call{value: value}(data); | |
return verifyCallResultFromTarget(target, success, returndata, errorMessage); | |
} | |
/** | |
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], | |
* but performing a static call. | |
* | |
* _Available since v3.3._ | |
*/ | |
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { | |
return functionStaticCall(target, data, "Address: low-level static call failed"); | |
} | |
/** | |
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], | |
* but performing a static call. | |
* | |
* _Available since v3.3._ | |
*/ | |
function functionStaticCall( | |
address target, | |
bytes memory data, | |
string memory errorMessage | |
) internal view returns (bytes memory) { | |
(bool success, bytes memory returndata) = target.staticcall(data); | |
return verifyCallResultFromTarget(target, success, returndata, errorMessage); | |
} | |
/** | |
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], | |
* but performing a delegate call. | |
* | |
* _Available since v3.4._ | |
*/ | |
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { | |
return functionDelegateCall(target, data, "Address: low-level delegate call failed"); | |
} | |
/** | |
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], | |
* but performing a delegate call. | |
* | |
* _Available since v3.4._ | |
*/ | |
function functionDelegateCall( | |
address target, | |
bytes memory data, | |
string memory errorMessage | |
) internal returns (bytes memory) { | |
(bool success, bytes memory returndata) = target.delegatecall(data); | |
return verifyCallResultFromTarget(target, success, returndata, errorMessage); | |
} | |
/** | |
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling | |
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. | |
* | |
* _Available since v4.8._ | |
*/ | |
function verifyCallResultFromTarget( | |
address target, | |
bool success, | |
bytes memory returndata, | |
string memory errorMessage | |
) internal view returns (bytes memory) { | |
if (success) { | |
if (returndata.length == 0) { | |
// only check isContract if the call was successful and the return data is empty | |
// otherwise we already know that it was a contract | |
require(isContract(target), "Address: call to non-contract"); | |
} | |
return returndata; | |
} else { | |
_revert(returndata, errorMessage); | |
} | |
} | |
/** | |
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the | |
* revert reason or using the provided one. | |
* | |
* _Available since v4.3._ | |
*/ | |
function verifyCallResult( | |
bool success, | |
bytes memory returndata, | |
string memory errorMessage | |
) internal pure returns (bytes memory) { | |
if (success) { | |
return returndata; | |
} else { | |
_revert(returndata, errorMessage); | |
} | |
} | |
function _revert(bytes memory returndata, string memory errorMessage) private pure { | |
// Look for revert reason and bubble it up if present | |
if (returndata.length > 0) { | |
// The easiest way to bubble the revert reason is using memory via assembly | |
/// @solidity memory-safe-assembly | |
assembly { | |
let returndata_size := mload(returndata) | |
revert(add(32, returndata), returndata_size) | |
} | |
} else { | |
revert(errorMessage); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts (last updated v4.9.4) (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; | |
} | |
function _contextSuffixLength() internal view virtual returns (uint256) { | |
return 0; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "6b6a25d8bebf9c0fbeb5d5ec133165de", | |
"_format": "hh-sol-build-info-1", | |
"solcVersion": "0.8.25", | |
"solcLongVersion": "0.8.25+commit.b61c2a91", | |
"input": { | |
"language": "Solidity", | |
"sources": { | |
".deps/npm/@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" | |
}, | |
".deps/npm/@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" | |
} | |
}, | |
"settings": { | |
"optimizer": { | |
"enabled": false, | |
"runs": 200 | |
}, | |
"outputSelection": { | |
"*": { | |
"": [ | |
"ast" | |
], | |
"*": [ | |
"abi", | |
"metadata", | |
"devdoc", | |
"userdoc", | |
"storageLayout", | |
"evm.legacyAssembly", | |
"evm.bytecode", | |
"evm.deployedBytecode", | |
"evm.methodIdentifiers", | |
"evm.gasEstimates", | |
"evm.assembly" | |
] | |
} | |
}, | |
"remappings": [] | |
} | |
}, | |
"output": { | |
"contracts": { | |
".deps/npm/@openzeppelin/contracts/access/Ownable.sol": { | |
"Ownable": { | |
"abi": [ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "owner", | |
"type": "address" | |
} | |
], | |
"name": "OwnableInvalidOwner", | |
"type": "error" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "account", | |
"type": "address" | |
} | |
], | |
"name": "OwnableUnauthorizedAccount", | |
"type": "error" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "previousOwner", | |
"type": "address" | |
}, | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "newOwner", | |
"type": "address" | |
} | |
], | |
"name": "OwnershipTransferred", | |
"type": "event" | |
}, | |
{ | |
"inputs": [], | |
"name": "owner", | |
"outputs": [ | |
{ | |
"internalType": "address", | |
"name": "", | |
"type": "address" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "renounceOwnership", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "newOwner", | |
"type": "address" | |
} | |
], | |
"name": "transferOwnership", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
} | |
], | |
"devdoc": { | |
"details": "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. The initial owner is set to the address provided by the deployer. 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.", | |
"errors": { | |
"OwnableInvalidOwner(address)": [ | |
{ | |
"details": "The owner is not a valid owner account. (eg. `address(0)`)" | |
} | |
], | |
"OwnableUnauthorizedAccount(address)": [ | |
{ | |
"details": "The caller account is not authorized to perform an operation." | |
} | |
] | |
}, | |
"kind": "dev", | |
"methods": { | |
"constructor": { | |
"details": "Initializes the contract setting the address provided by the deployer as the initial owner." | |
}, | |
"owner()": { | |
"details": "Returns the address of the current owner." | |
}, | |
"renounceOwnership()": { | |
"details": "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." | |
}, | |
"transferOwnership(address)": { | |
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." | |
} | |
}, | |
"version": 1 | |
}, | |
"evm": { | |
"assembly": "", | |
"bytecode": { | |
"functionDebugData": {}, | |
"generatedSources": [], | |
"linkReferences": {}, | |
"object": "", | |
"opcodes": "", | |
"sourceMap": "" | |
}, | |
"deployedBytecode": { | |
"functionDebugData": {}, | |
"generatedSources": [], | |
"immutableReferences": {}, | |
"linkReferences": {}, | |
"object": "", | |
"opcodes": "", | |
"sourceMap": "" | |
}, | |
"gasEstimates": null, | |
"legacyAssembly": null, | |
"methodIdentifiers": { | |
"owner()": "8da5cb5b", | |
"renounceOwnership()": "715018a6", | |
"transferOwnership(address)": "f2fde38b" | |
} | |
}, | |
"metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"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. The initial owner is set to the address provided by the deployer. 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.\",\"errors\":{\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}]},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the contract setting the address provided by the deployer as the initial owner.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"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.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\".deps/npm/@openzeppelin/contracts/access/Ownable.sol\":\"Ownable\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\".deps/npm/@openzeppelin/contracts/access/Ownable.sol\":{\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8ed324d3920bb545059d66ab97d43e43ee85fd3bd52e03e401f020afb0b120f6\",\"dweb:/ipfs/QmfEckWLmZkDDcoWrkEvMWhms66xwTLff9DDhegYpvHo1a\"]},\".deps/npm/@openzeppelin/contracts/utils/Context.sol\":{\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6a708e8a5bdb1011c2c381c9a5cfd8a9a956d7d0a9dc1bd8bcdaf52f76ef2f12\",\"dweb:/ipfs/Qmax9WHBnVsZP46ZxEMNRQpLQnrdE4dK8LehML1Py8FowF\"]}},\"version\":1}", | |
"storageLayout": { | |
"storage": [ | |
{ | |
"astId": 8, | |
"contract": ".deps/npm/@openzeppelin/contracts/access/Ownable.sol:Ownable", | |
"label": "_owner", | |
"offset": 0, | |
"slot": "0", | |
"type": "t_address" | |
} | |
], | |
"types": { | |
"t_address": { | |
"encoding": "inplace", | |
"label": "address", | |
"numberOfBytes": "20" | |
} | |
} | |
}, | |
"userdoc": { | |
"kind": "user", | |
"methods": {}, | |
"version": 1 | |
} | |
} | |
}, | |
".deps/npm/@openzeppelin/contracts/utils/Context.sol": { | |
"Context": { | |
"abi": [], | |
"devdoc": { | |
"details": "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.", | |
"kind": "dev", | |
"methods": {}, | |
"version": 1 | |
}, | |
"evm": { | |
"assembly": "", | |
"bytecode": { | |
"functionDebugData": {}, | |
"generatedSources": [], | |
"linkReferences": {}, | |
"object": "", | |
"opcodes": "", | |
"sourceMap": "" | |
}, | |
"deployedBytecode": { | |
"functionDebugData": {}, | |
"generatedSources": [], | |
"immutableReferences": {}, | |
"linkReferences": {}, | |
"object": "", | |
"opcodes": "", | |
"sourceMap": "" | |
}, | |
"gasEstimates": null, | |
"legacyAssembly": null, | |
"methodIdentifiers": {} | |
}, | |
"metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"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.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\".deps/npm/@openzeppelin/contracts/utils/Context.sol\":\"Context\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\".deps/npm/@openzeppelin/contracts/utils/Context.sol\":{\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6a708e8a5bdb1011c2c381c9a5cfd8a9a956d7d0a9dc1bd8bcdaf52f76ef2f12\",\"dweb:/ipfs/Qmax9WHBnVsZP46ZxEMNRQpLQnrdE4dK8LehML1Py8FowF\"]}},\"version\":1}", | |
"storageLayout": { | |
"storage": [], | |
"types": null | |
}, | |
"userdoc": { | |
"kind": "user", | |
"methods": {}, | |
"version": 1 | |
} | |
} | |
} | |
}, | |
"sources": { | |
".deps/npm/@openzeppelin/contracts/access/Ownable.sol": { | |
"ast": { | |
"absolutePath": ".deps/npm/@openzeppelin/contracts/access/Ownable.sol", | |
"exportedSymbols": { | |
"Context": [ | |
177 | |
], | |
"Ownable": [ | |
147 | |
] | |
}, | |
"id": 148, | |
"license": "MIT", | |
"nodeType": "SourceUnit", | |
"nodes": [ | |
{ | |
"id": 1, | |
"literals": [ | |
"solidity", | |
"^", | |
"0.8", | |
".20" | |
], | |
"nodeType": "PragmaDirective", | |
"src": "102:24:0" | |
}, | |
{ | |
"absolutePath": ".deps/npm/@openzeppelin/contracts/utils/Context.sol", | |
"file": "../utils/Context.sol", | |
"id": 3, | |
"nameLocation": "-1:-1:-1", | |
"nodeType": "ImportDirective", | |
"scope": 148, | |
"sourceUnit": 178, | |
"src": "128:45:0", | |
"symbolAliases": [ | |
{ | |
"foreign": { | |
"id": 2, | |
"name": "Context", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 177, | |
"src": "136:7:0", | |
"typeDescriptions": {} | |
}, | |
"nameLocation": "-1:-1:-1" | |
} | |
], | |
"unitAlias": "" | |
}, | |
{ | |
"abstract": true, | |
"baseContracts": [ | |
{ | |
"baseName": { | |
"id": 5, | |
"name": "Context", | |
"nameLocations": [ | |
"692:7:0" | |
], | |
"nodeType": "IdentifierPath", | |
"referencedDeclaration": 177, | |
"src": "692:7:0" | |
}, | |
"id": 6, | |
"nodeType": "InheritanceSpecifier", | |
"src": "692:7:0" | |
} | |
], | |
"canonicalName": "Ownable", | |
"contractDependencies": [], | |
"contractKind": "contract", | |
"documentation": { | |
"id": 4, | |
"nodeType": "StructuredDocumentation", | |
"src": "175:487:0", | |
"text": " @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 The initial owner is set to the address provided by the deployer. This can\n later be changed with {transferOwnership}.\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." | |
}, | |
"fullyImplemented": true, | |
"id": 147, | |
"linearizedBaseContracts": [ | |
147, | |
177 | |
], | |
"name": "Ownable", | |
"nameLocation": "681:7:0", | |
"nodeType": "ContractDefinition", | |
"nodes": [ | |
{ | |
"constant": false, | |
"id": 8, | |
"mutability": "mutable", | |
"name": "_owner", | |
"nameLocation": "722:6:0", | |
"nodeType": "VariableDeclaration", | |
"scope": 147, | |
"src": "706:22:0", | |
"stateVariable": true, | |
"storageLocation": "default", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"typeName": { | |
"id": 7, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "706:7:0", | |
"stateMutability": "nonpayable", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"visibility": "private" | |
}, | |
{ | |
"documentation": { | |
"id": 9, | |
"nodeType": "StructuredDocumentation", | |
"src": "735:85:0", | |
"text": " @dev The caller account is not authorized to perform an operation." | |
}, | |
"errorSelector": "118cdaa7", | |
"id": 13, | |
"name": "OwnableUnauthorizedAccount", | |
"nameLocation": "831:26:0", | |
"nodeType": "ErrorDefinition", | |
"parameters": { | |
"id": 12, | |
"nodeType": "ParameterList", | |
"parameters": [ | |
{ | |
"constant": false, | |
"id": 11, | |
"mutability": "mutable", | |
"name": "account", | |
"nameLocation": "866:7:0", | |
"nodeType": "VariableDeclaration", | |
"scope": 13, | |
"src": "858:15:0", | |
"stateVariable": false, | |
"storageLocation": "default", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"typeName": { | |
"id": 10, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "858:7:0", | |
"stateMutability": "nonpayable", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"visibility": "internal" | |
} | |
], | |
"src": "857:17:0" | |
}, | |
"src": "825:50:0" | |
}, | |
{ | |
"documentation": { | |
"id": 14, | |
"nodeType": "StructuredDocumentation", | |
"src": "881:82:0", | |
"text": " @dev The owner is not a valid owner account. (eg. `address(0)`)" | |
}, | |
"errorSelector": "1e4fbdf7", | |
"id": 18, | |
"name": "OwnableInvalidOwner", | |
"nameLocation": "974:19:0", | |
"nodeType": "ErrorDefinition", | |
"parameters": { | |
"id": 17, | |
"nodeType": "ParameterList", | |
"parameters": [ | |
{ | |
"constant": false, | |
"id": 16, | |
"mutability": "mutable", | |
"name": "owner", | |
"nameLocation": "1002:5:0", | |
"nodeType": "VariableDeclaration", | |
"scope": 18, | |
"src": "994:13:0", | |
"stateVariable": false, | |
"storageLocation": "default", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"typeName": { | |
"id": 15, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "994:7:0", | |
"stateMutability": "nonpayable", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"visibility": "internal" | |
} | |
], | |
"src": "993:15:0" | |
}, | |
"src": "968:41:0" | |
}, | |
{ | |
"anonymous": false, | |
"eventSelector": "8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", | |
"id": 24, | |
"name": "OwnershipTransferred", | |
"nameLocation": "1021:20:0", | |
"nodeType": "EventDefinition", | |
"parameters": { | |
"id": 23, | |
"nodeType": "ParameterList", | |
"parameters": [ | |
{ | |
"constant": false, | |
"id": 20, | |
"indexed": true, | |
"mutability": "mutable", | |
"name": "previousOwner", | |
"nameLocation": "1058:13:0", | |
"nodeType": "VariableDeclaration", | |
"scope": 24, | |
"src": "1042:29:0", | |
"stateVariable": false, | |
"storageLocation": "default", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"typeName": { | |
"id": 19, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "1042:7:0", | |
"stateMutability": "nonpayable", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"visibility": "internal" | |
}, | |
{ | |
"constant": false, | |
"id": 22, | |
"indexed": true, | |
"mutability": "mutable", | |
"name": "newOwner", | |
"nameLocation": "1089:8:0", | |
"nodeType": "VariableDeclaration", | |
"scope": 24, | |
"src": "1073:24:0", | |
"stateVariable": false, | |
"storageLocation": "default", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"typeName": { | |
"id": 21, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "1073:7:0", | |
"stateMutability": "nonpayable", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"visibility": "internal" | |
} | |
], | |
"src": "1041:57:0" | |
}, | |
"src": "1015:84:0" | |
}, | |
{ | |
"body": { | |
"id": 49, | |
"nodeType": "Block", | |
"src": "1259:153:0", | |
"statements": [ | |
{ | |
"condition": { | |
"commonType": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"id": 35, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"lValueRequested": false, | |
"leftExpression": { | |
"id": 30, | |
"name": "initialOwner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 27, | |
"src": "1273:12:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"nodeType": "BinaryOperation", | |
"operator": "==", | |
"rightExpression": { | |
"arguments": [ | |
{ | |
"hexValue": "30", | |
"id": 33, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"kind": "number", | |
"lValueRequested": false, | |
"nodeType": "Literal", | |
"src": "1297:1:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_rational_0_by_1", | |
"typeString": "int_const 0" | |
}, | |
"value": "0" | |
} | |
], | |
"expression": { | |
"argumentTypes": [ | |
{ | |
"typeIdentifier": "t_rational_0_by_1", | |
"typeString": "int_const 0" | |
} | |
], | |
"id": 32, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"lValueRequested": false, | |
"nodeType": "ElementaryTypeNameExpression", | |
"src": "1289:7:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_type$_t_address_$", | |
"typeString": "type(address)" | |
}, | |
"typeName": { | |
"id": 31, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "1289:7:0", | |
"typeDescriptions": {} | |
} | |
}, | |
"id": 34, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"kind": "typeConversion", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "1289:10:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"src": "1273:26:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_bool", | |
"typeString": "bool" | |
} | |
}, | |
"id": 44, | |
"nodeType": "IfStatement", | |
"src": "1269:95:0", | |
"trueBody": { | |
"id": 43, | |
"nodeType": "Block", | |
"src": "1301:63:0", | |
"statements": [ | |
{ | |
"errorCall": { | |
"arguments": [ | |
{ | |
"arguments": [ | |
{ | |
"hexValue": "30", | |
"id": 39, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"kind": "number", | |
"lValueRequested": false, | |
"nodeType": "Literal", | |
"src": "1350:1:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_rational_0_by_1", | |
"typeString": "int_const 0" | |
}, | |
"value": "0" | |
} | |
], | |
"expression": { | |
"argumentTypes": [ | |
{ | |
"typeIdentifier": "t_rational_0_by_1", | |
"typeString": "int_const 0" | |
} | |
], | |
"id": 38, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"lValueRequested": false, | |
"nodeType": "ElementaryTypeNameExpression", | |
"src": "1342:7:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_type$_t_address_$", | |
"typeString": "type(address)" | |
}, | |
"typeName": { | |
"id": 37, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "1342:7:0", | |
"typeDescriptions": {} | |
} | |
}, | |
"id": 40, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"kind": "typeConversion", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "1342:10:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
} | |
], | |
"expression": { | |
"argumentTypes": [ | |
{ | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
], | |
"id": 36, | |
"name": "OwnableInvalidOwner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 18, | |
"src": "1322:19:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_function_error_pure$_t_address_$returns$__$", | |
"typeString": "function (address) pure" | |
} | |
}, | |
"id": 41, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"kind": "functionCall", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "1322:31:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_tuple$__$", | |
"typeString": "tuple()" | |
} | |
}, | |
"id": 42, | |
"nodeType": "RevertStatement", | |
"src": "1315:38:0" | |
} | |
] | |
} | |
}, | |
{ | |
"expression": { | |
"arguments": [ | |
{ | |
"id": 46, | |
"name": "initialOwner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 27, | |
"src": "1392:12:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
} | |
], | |
"expression": { | |
"argumentTypes": [ | |
{ | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
], | |
"id": 45, | |
"name": "_transferOwnership", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 146, | |
"src": "1373:18:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", | |
"typeString": "function (address)" | |
} | |
}, | |
"id": 47, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"kind": "functionCall", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "1373:32:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_tuple$__$", | |
"typeString": "tuple()" | |
} | |
}, | |
"id": 48, | |
"nodeType": "ExpressionStatement", | |
"src": "1373:32:0" | |
} | |
] | |
}, | |
"documentation": { | |
"id": 25, | |
"nodeType": "StructuredDocumentation", | |
"src": "1105:115:0", | |
"text": " @dev Initializes the contract setting the address provided by the deployer as the initial owner." | |
}, | |
"id": 50, | |
"implemented": true, | |
"kind": "constructor", | |
"modifiers": [], | |
"name": "", | |
"nameLocation": "-1:-1:-1", | |
"nodeType": "FunctionDefinition", | |
"parameters": { | |
"id": 28, | |
"nodeType": "ParameterList", | |
"parameters": [ | |
{ | |
"constant": false, | |
"id": 27, | |
"mutability": "mutable", | |
"name": "initialOwner", | |
"nameLocation": "1245:12:0", | |
"nodeType": "VariableDeclaration", | |
"scope": 50, | |
"src": "1237:20:0", | |
"stateVariable": false, | |
"storageLocation": "default", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"typeName": { | |
"id": 26, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "1237:7:0", | |
"stateMutability": "nonpayable", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"visibility": "internal" | |
} | |
], | |
"src": "1236:22:0" | |
}, | |
"returnParameters": { | |
"id": 29, | |
"nodeType": "ParameterList", | |
"parameters": [], | |
"src": "1259:0:0" | |
}, | |
"scope": 147, | |
"src": "1225:187:0", | |
"stateMutability": "nonpayable", | |
"virtual": false, | |
"visibility": "internal" | |
}, | |
{ | |
"body": { | |
"id": 57, | |
"nodeType": "Block", | |
"src": "1521:41:0", | |
"statements": [ | |
{ | |
"expression": { | |
"arguments": [], | |
"expression": { | |
"argumentTypes": [], | |
"id": 53, | |
"name": "_checkOwner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 84, | |
"src": "1531:11:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_function_internal_view$__$returns$__$", | |
"typeString": "function () view" | |
} | |
}, | |
"id": 54, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"kind": "functionCall", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "1531:13:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_tuple$__$", | |
"typeString": "tuple()" | |
} | |
}, | |
"id": 55, | |
"nodeType": "ExpressionStatement", | |
"src": "1531:13:0" | |
}, | |
{ | |
"id": 56, | |
"nodeType": "PlaceholderStatement", | |
"src": "1554:1:0" | |
} | |
] | |
}, | |
"documentation": { | |
"id": 51, | |
"nodeType": "StructuredDocumentation", | |
"src": "1418:77:0", | |
"text": " @dev Throws if called by any account other than the owner." | |
}, | |
"id": 58, | |
"name": "onlyOwner", | |
"nameLocation": "1509:9:0", | |
"nodeType": "ModifierDefinition", | |
"parameters": { | |
"id": 52, | |
"nodeType": "ParameterList", | |
"parameters": [], | |
"src": "1518:2:0" | |
}, | |
"src": "1500:62:0", | |
"virtual": false, | |
"visibility": "internal" | |
}, | |
{ | |
"body": { | |
"id": 66, | |
"nodeType": "Block", | |
"src": "1693:30:0", | |
"statements": [ | |
{ | |
"expression": { | |
"id": 64, | |
"name": "_owner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 8, | |
"src": "1710:6:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"functionReturnParameters": 63, | |
"id": 65, | |
"nodeType": "Return", | |
"src": "1703:13:0" | |
} | |
] | |
}, | |
"documentation": { | |
"id": 59, | |
"nodeType": "StructuredDocumentation", | |
"src": "1568:65:0", | |
"text": " @dev Returns the address of the current owner." | |
}, | |
"functionSelector": "8da5cb5b", | |
"id": 67, | |
"implemented": true, | |
"kind": "function", | |
"modifiers": [], | |
"name": "owner", | |
"nameLocation": "1647:5:0", | |
"nodeType": "FunctionDefinition", | |
"parameters": { | |
"id": 60, | |
"nodeType": "ParameterList", | |
"parameters": [], | |
"src": "1652:2:0" | |
}, | |
"returnParameters": { | |
"id": 63, | |
"nodeType": "ParameterList", | |
"parameters": [ | |
{ | |
"constant": false, | |
"id": 62, | |
"mutability": "mutable", | |
"name": "", | |
"nameLocation": "-1:-1:-1", | |
"nodeType": "VariableDeclaration", | |
"scope": 67, | |
"src": "1684:7:0", | |
"stateVariable": false, | |
"storageLocation": "default", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"typeName": { | |
"id": 61, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "1684:7:0", | |
"stateMutability": "nonpayable", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"visibility": "internal" | |
} | |
], | |
"src": "1683:9:0" | |
}, | |
"scope": 147, | |
"src": "1638:85:0", | |
"stateMutability": "view", | |
"virtual": true, | |
"visibility": "public" | |
}, | |
{ | |
"body": { | |
"id": 83, | |
"nodeType": "Block", | |
"src": "1841:117:0", | |
"statements": [ | |
{ | |
"condition": { | |
"commonType": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"id": 75, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"lValueRequested": false, | |
"leftExpression": { | |
"arguments": [], | |
"expression": { | |
"argumentTypes": [], | |
"id": 71, | |
"name": "owner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 67, | |
"src": "1855:5:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", | |
"typeString": "function () view returns (address)" | |
} | |
}, | |
"id": 72, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"kind": "functionCall", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "1855:7:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"nodeType": "BinaryOperation", | |
"operator": "!=", | |
"rightExpression": { | |
"arguments": [], | |
"expression": { | |
"argumentTypes": [], | |
"id": 73, | |
"name": "_msgSender", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 159, | |
"src": "1866:10:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", | |
"typeString": "function () view returns (address)" | |
} | |
}, | |
"id": 74, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"kind": "functionCall", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "1866:12:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"src": "1855:23:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_bool", | |
"typeString": "bool" | |
} | |
}, | |
"id": 82, | |
"nodeType": "IfStatement", | |
"src": "1851:101:0", | |
"trueBody": { | |
"id": 81, | |
"nodeType": "Block", | |
"src": "1880:72:0", | |
"statements": [ | |
{ | |
"errorCall": { | |
"arguments": [ | |
{ | |
"arguments": [], | |
"expression": { | |
"argumentTypes": [], | |
"id": 77, | |
"name": "_msgSender", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 159, | |
"src": "1928:10:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", | |
"typeString": "function () view returns (address)" | |
} | |
}, | |
"id": 78, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"kind": "functionCall", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "1928:12:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
} | |
], | |
"expression": { | |
"argumentTypes": [ | |
{ | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
], | |
"id": 76, | |
"name": "OwnableUnauthorizedAccount", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 13, | |
"src": "1901:26:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_function_error_pure$_t_address_$returns$__$", | |
"typeString": "function (address) pure" | |
} | |
}, | |
"id": 79, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"kind": "functionCall", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "1901:40:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_tuple$__$", | |
"typeString": "tuple()" | |
} | |
}, | |
"id": 80, | |
"nodeType": "RevertStatement", | |
"src": "1894:47:0" | |
} | |
] | |
} | |
} | |
] | |
}, | |
"documentation": { | |
"id": 68, | |
"nodeType": "StructuredDocumentation", | |
"src": "1729:62:0", | |
"text": " @dev Throws if the sender is not the owner." | |
}, | |
"id": 84, | |
"implemented": true, | |
"kind": "function", | |
"modifiers": [], | |
"name": "_checkOwner", | |
"nameLocation": "1805:11:0", | |
"nodeType": "FunctionDefinition", | |
"parameters": { | |
"id": 69, | |
"nodeType": "ParameterList", | |
"parameters": [], | |
"src": "1816:2:0" | |
}, | |
"returnParameters": { | |
"id": 70, | |
"nodeType": "ParameterList", | |
"parameters": [], | |
"src": "1841:0:0" | |
}, | |
"scope": 147, | |
"src": "1796:162:0", | |
"stateMutability": "view", | |
"virtual": true, | |
"visibility": "internal" | |
}, | |
{ | |
"body": { | |
"id": 97, | |
"nodeType": "Block", | |
"src": "2347:47:0", | |
"statements": [ | |
{ | |
"expression": { | |
"arguments": [ | |
{ | |
"arguments": [ | |
{ | |
"hexValue": "30", | |
"id": 93, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"kind": "number", | |
"lValueRequested": false, | |
"nodeType": "Literal", | |
"src": "2384:1:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_rational_0_by_1", | |
"typeString": "int_const 0" | |
}, | |
"value": "0" | |
} | |
], | |
"expression": { | |
"argumentTypes": [ | |
{ | |
"typeIdentifier": "t_rational_0_by_1", | |
"typeString": "int_const 0" | |
} | |
], | |
"id": 92, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"lValueRequested": false, | |
"nodeType": "ElementaryTypeNameExpression", | |
"src": "2376:7:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_type$_t_address_$", | |
"typeString": "type(address)" | |
}, | |
"typeName": { | |
"id": 91, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "2376:7:0", | |
"typeDescriptions": {} | |
} | |
}, | |
"id": 94, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"kind": "typeConversion", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "2376:10:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
} | |
], | |
"expression": { | |
"argumentTypes": [ | |
{ | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
], | |
"id": 90, | |
"name": "_transferOwnership", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 146, | |
"src": "2357:18:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", | |
"typeString": "function (address)" | |
} | |
}, | |
"id": 95, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"kind": "functionCall", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "2357:30:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_tuple$__$", | |
"typeString": "tuple()" | |
} | |
}, | |
"id": 96, | |
"nodeType": "ExpressionStatement", | |
"src": "2357:30:0" | |
} | |
] | |
}, | |
"documentation": { | |
"id": 85, | |
"nodeType": "StructuredDocumentation", | |
"src": "1964:324:0", | |
"text": " @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 NOTE: Renouncing ownership will leave the contract without an owner,\n thereby disabling any functionality that is only available to the owner." | |
}, | |
"functionSelector": "715018a6", | |
"id": 98, | |
"implemented": true, | |
"kind": "function", | |
"modifiers": [ | |
{ | |
"id": 88, | |
"kind": "modifierInvocation", | |
"modifierName": { | |
"id": 87, | |
"name": "onlyOwner", | |
"nameLocations": [ | |
"2337:9:0" | |
], | |
"nodeType": "IdentifierPath", | |
"referencedDeclaration": 58, | |
"src": "2337:9:0" | |
}, | |
"nodeType": "ModifierInvocation", | |
"src": "2337:9:0" | |
} | |
], | |
"name": "renounceOwnership", | |
"nameLocation": "2302:17:0", | |
"nodeType": "FunctionDefinition", | |
"parameters": { | |
"id": 86, | |
"nodeType": "ParameterList", | |
"parameters": [], | |
"src": "2319:2:0" | |
}, | |
"returnParameters": { | |
"id": 89, | |
"nodeType": "ParameterList", | |
"parameters": [], | |
"src": "2347:0:0" | |
}, | |
"scope": 147, | |
"src": "2293:101:0", | |
"stateMutability": "nonpayable", | |
"virtual": true, | |
"visibility": "public" | |
}, | |
{ | |
"body": { | |
"id": 125, | |
"nodeType": "Block", | |
"src": "2613:145:0", | |
"statements": [ | |
{ | |
"condition": { | |
"commonType": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"id": 111, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"lValueRequested": false, | |
"leftExpression": { | |
"id": 106, | |
"name": "newOwner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 101, | |
"src": "2627:8:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"nodeType": "BinaryOperation", | |
"operator": "==", | |
"rightExpression": { | |
"arguments": [ | |
{ | |
"hexValue": "30", | |
"id": 109, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"kind": "number", | |
"lValueRequested": false, | |
"nodeType": "Literal", | |
"src": "2647:1:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_rational_0_by_1", | |
"typeString": "int_const 0" | |
}, | |
"value": "0" | |
} | |
], | |
"expression": { | |
"argumentTypes": [ | |
{ | |
"typeIdentifier": "t_rational_0_by_1", | |
"typeString": "int_const 0" | |
} | |
], | |
"id": 108, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"lValueRequested": false, | |
"nodeType": "ElementaryTypeNameExpression", | |
"src": "2639:7:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_type$_t_address_$", | |
"typeString": "type(address)" | |
}, | |
"typeName": { | |
"id": 107, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "2639:7:0", | |
"typeDescriptions": {} | |
} | |
}, | |
"id": 110, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"kind": "typeConversion", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "2639:10:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"src": "2627:22:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_bool", | |
"typeString": "bool" | |
} | |
}, | |
"id": 120, | |
"nodeType": "IfStatement", | |
"src": "2623:91:0", | |
"trueBody": { | |
"id": 119, | |
"nodeType": "Block", | |
"src": "2651:63:0", | |
"statements": [ | |
{ | |
"errorCall": { | |
"arguments": [ | |
{ | |
"arguments": [ | |
{ | |
"hexValue": "30", | |
"id": 115, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"kind": "number", | |
"lValueRequested": false, | |
"nodeType": "Literal", | |
"src": "2700:1:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_rational_0_by_1", | |
"typeString": "int_const 0" | |
}, | |
"value": "0" | |
} | |
], | |
"expression": { | |
"argumentTypes": [ | |
{ | |
"typeIdentifier": "t_rational_0_by_1", | |
"typeString": "int_const 0" | |
} | |
], | |
"id": 114, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"lValueRequested": false, | |
"nodeType": "ElementaryTypeNameExpression", | |
"src": "2692:7:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_type$_t_address_$", | |
"typeString": "type(address)" | |
}, | |
"typeName": { | |
"id": 113, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "2692:7:0", | |
"typeDescriptions": {} | |
} | |
}, | |
"id": 116, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"kind": "typeConversion", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "2692:10:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
} | |
], | |
"expression": { | |
"argumentTypes": [ | |
{ | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
], | |
"id": 112, | |
"name": "OwnableInvalidOwner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 18, | |
"src": "2672:19:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_function_error_pure$_t_address_$returns$__$", | |
"typeString": "function (address) pure" | |
} | |
}, | |
"id": 117, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"kind": "functionCall", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "2672:31:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_tuple$__$", | |
"typeString": "tuple()" | |
} | |
}, | |
"id": 118, | |
"nodeType": "RevertStatement", | |
"src": "2665:38:0" | |
} | |
] | |
} | |
}, | |
{ | |
"expression": { | |
"arguments": [ | |
{ | |
"id": 122, | |
"name": "newOwner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 101, | |
"src": "2742:8:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
} | |
], | |
"expression": { | |
"argumentTypes": [ | |
{ | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
], | |
"id": 121, | |
"name": "_transferOwnership", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 146, | |
"src": "2723:18:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", | |
"typeString": "function (address)" | |
} | |
}, | |
"id": 123, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"kind": "functionCall", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "2723:28:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_tuple$__$", | |
"typeString": "tuple()" | |
} | |
}, | |
"id": 124, | |
"nodeType": "ExpressionStatement", | |
"src": "2723:28:0" | |
} | |
] | |
}, | |
"documentation": { | |
"id": 99, | |
"nodeType": "StructuredDocumentation", | |
"src": "2400:138:0", | |
"text": " @dev Transfers ownership of the contract to a new account (`newOwner`).\n Can only be called by the current owner." | |
}, | |
"functionSelector": "f2fde38b", | |
"id": 126, | |
"implemented": true, | |
"kind": "function", | |
"modifiers": [ | |
{ | |
"id": 104, | |
"kind": "modifierInvocation", | |
"modifierName": { | |
"id": 103, | |
"name": "onlyOwner", | |
"nameLocations": [ | |
"2603:9:0" | |
], | |
"nodeType": "IdentifierPath", | |
"referencedDeclaration": 58, | |
"src": "2603:9:0" | |
}, | |
"nodeType": "ModifierInvocation", | |
"src": "2603:9:0" | |
} | |
], | |
"name": "transferOwnership", | |
"nameLocation": "2552:17:0", | |
"nodeType": "FunctionDefinition", | |
"parameters": { | |
"id": 102, | |
"nodeType": "ParameterList", | |
"parameters": [ | |
{ | |
"constant": false, | |
"id": 101, | |
"mutability": "mutable", | |
"name": "newOwner", | |
"nameLocation": "2578:8:0", | |
"nodeType": "VariableDeclaration", | |
"scope": 126, | |
"src": "2570:16:0", | |
"stateVariable": false, | |
"storageLocation": "default", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"typeName": { | |
"id": 100, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "2570:7:0", | |
"stateMutability": "nonpayable", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"visibility": "internal" | |
} | |
], | |
"src": "2569:18:0" | |
}, | |
"returnParameters": { | |
"id": 105, | |
"nodeType": "ParameterList", | |
"parameters": [], | |
"src": "2613:0:0" | |
}, | |
"scope": 147, | |
"src": "2543:215:0", | |
"stateMutability": "nonpayable", | |
"virtual": true, | |
"visibility": "public" | |
}, | |
{ | |
"body": { | |
"id": 145, | |
"nodeType": "Block", | |
"src": "2975:124:0", | |
"statements": [ | |
{ | |
"assignments": [ | |
133 | |
], | |
"declarations": [ | |
{ | |
"constant": false, | |
"id": 133, | |
"mutability": "mutable", | |
"name": "oldOwner", | |
"nameLocation": "2993:8:0", | |
"nodeType": "VariableDeclaration", | |
"scope": 145, | |
"src": "2985:16:0", | |
"stateVariable": false, | |
"storageLocation": "default", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"typeName": { | |
"id": 132, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "2985:7:0", | |
"stateMutability": "nonpayable", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"visibility": "internal" | |
} | |
], | |
"id": 135, | |
"initialValue": { | |
"id": 134, | |
"name": "_owner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 8, | |
"src": "3004:6:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"nodeType": "VariableDeclarationStatement", | |
"src": "2985:25:0" | |
}, | |
{ | |
"expression": { | |
"id": 138, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"lValueRequested": false, | |
"leftHandSide": { | |
"id": 136, | |
"name": "_owner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 8, | |
"src": "3020:6:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"nodeType": "Assignment", | |
"operator": "=", | |
"rightHandSide": { | |
"id": 137, | |
"name": "newOwner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 129, | |
"src": "3029:8:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"src": "3020:17:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"id": 139, | |
"nodeType": "ExpressionStatement", | |
"src": "3020:17:0" | |
}, | |
{ | |
"eventCall": { | |
"arguments": [ | |
{ | |
"id": 141, | |
"name": "oldOwner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 133, | |
"src": "3073:8:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
{ | |
"id": 142, | |
"name": "newOwner", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 129, | |
"src": "3083:8:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
} | |
], | |
"expression": { | |
"argumentTypes": [ | |
{ | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
{ | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
], | |
"id": 140, | |
"name": "OwnershipTransferred", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 24, | |
"src": "3052:20:0", | |
"typeDescriptions": { | |
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", | |
"typeString": "function (address,address)" | |
} | |
}, | |
"id": 143, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"kind": "functionCall", | |
"lValueRequested": false, | |
"nameLocations": [], | |
"names": [], | |
"nodeType": "FunctionCall", | |
"src": "3052:40:0", | |
"tryCall": false, | |
"typeDescriptions": { | |
"typeIdentifier": "t_tuple$__$", | |
"typeString": "tuple()" | |
} | |
}, | |
"id": 144, | |
"nodeType": "EmitStatement", | |
"src": "3047:45:0" | |
} | |
] | |
}, | |
"documentation": { | |
"id": 127, | |
"nodeType": "StructuredDocumentation", | |
"src": "2764:143:0", | |
"text": " @dev Transfers ownership of the contract to a new account (`newOwner`).\n Internal function without access restriction." | |
}, | |
"id": 146, | |
"implemented": true, | |
"kind": "function", | |
"modifiers": [], | |
"name": "_transferOwnership", | |
"nameLocation": "2921:18:0", | |
"nodeType": "FunctionDefinition", | |
"parameters": { | |
"id": 130, | |
"nodeType": "ParameterList", | |
"parameters": [ | |
{ | |
"constant": false, | |
"id": 129, | |
"mutability": "mutable", | |
"name": "newOwner", | |
"nameLocation": "2948:8:0", | |
"nodeType": "VariableDeclaration", | |
"scope": 146, | |
"src": "2940:16:0", | |
"stateVariable": false, | |
"storageLocation": "default", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"typeName": { | |
"id": 128, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "2940:7:0", | |
"stateMutability": "nonpayable", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"visibility": "internal" | |
} | |
], | |
"src": "2939:18:0" | |
}, | |
"returnParameters": { | |
"id": 131, | |
"nodeType": "ParameterList", | |
"parameters": [], | |
"src": "2975:0:0" | |
}, | |
"scope": 147, | |
"src": "2912:187:0", | |
"stateMutability": "nonpayable", | |
"virtual": true, | |
"visibility": "internal" | |
} | |
], | |
"scope": 148, | |
"src": "663:2438:0", | |
"usedErrors": [ | |
13, | |
18 | |
], | |
"usedEvents": [ | |
24 | |
] | |
} | |
], | |
"src": "102:3000:0" | |
}, | |
"id": 0 | |
}, | |
".deps/npm/@openzeppelin/contracts/utils/Context.sol": { | |
"ast": { | |
"absolutePath": ".deps/npm/@openzeppelin/contracts/utils/Context.sol", | |
"exportedSymbols": { | |
"Context": [ | |
177 | |
] | |
}, | |
"id": 178, | |
"license": "MIT", | |
"nodeType": "SourceUnit", | |
"nodes": [ | |
{ | |
"id": 149, | |
"literals": [ | |
"solidity", | |
"^", | |
"0.8", | |
".20" | |
], | |
"nodeType": "PragmaDirective", | |
"src": "101:24:1" | |
}, | |
{ | |
"abstract": true, | |
"baseContracts": [], | |
"canonicalName": "Context", | |
"contractDependencies": [], | |
"contractKind": "contract", | |
"documentation": { | |
"id": 150, | |
"nodeType": "StructuredDocumentation", | |
"src": "127:496:1", | |
"text": " @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 This contract is only required for intermediate, library-like contracts." | |
}, | |
"fullyImplemented": true, | |
"id": 177, | |
"linearizedBaseContracts": [ | |
177 | |
], | |
"name": "Context", | |
"nameLocation": "642:7:1", | |
"nodeType": "ContractDefinition", | |
"nodes": [ | |
{ | |
"body": { | |
"id": 158, | |
"nodeType": "Block", | |
"src": "718:34:1", | |
"statements": [ | |
{ | |
"expression": { | |
"expression": { | |
"id": 155, | |
"name": "msg", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 4294967281, | |
"src": "735:3:1", | |
"typeDescriptions": { | |
"typeIdentifier": "t_magic_message", | |
"typeString": "msg" | |
} | |
}, | |
"id": 156, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"lValueRequested": false, | |
"memberLocation": "739:6:1", | |
"memberName": "sender", | |
"nodeType": "MemberAccess", | |
"src": "735:10:1", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"functionReturnParameters": 154, | |
"id": 157, | |
"nodeType": "Return", | |
"src": "728:17:1" | |
} | |
] | |
}, | |
"id": 159, | |
"implemented": true, | |
"kind": "function", | |
"modifiers": [], | |
"name": "_msgSender", | |
"nameLocation": "665:10:1", | |
"nodeType": "FunctionDefinition", | |
"parameters": { | |
"id": 151, | |
"nodeType": "ParameterList", | |
"parameters": [], | |
"src": "675:2:1" | |
}, | |
"returnParameters": { | |
"id": 154, | |
"nodeType": "ParameterList", | |
"parameters": [ | |
{ | |
"constant": false, | |
"id": 153, | |
"mutability": "mutable", | |
"name": "", | |
"nameLocation": "-1:-1:-1", | |
"nodeType": "VariableDeclaration", | |
"scope": 159, | |
"src": "709:7:1", | |
"stateVariable": false, | |
"storageLocation": "default", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
}, | |
"typeName": { | |
"id": 152, | |
"name": "address", | |
"nodeType": "ElementaryTypeName", | |
"src": "709:7:1", | |
"stateMutability": "nonpayable", | |
"typeDescriptions": { | |
"typeIdentifier": "t_address", | |
"typeString": "address" | |
} | |
}, | |
"visibility": "internal" | |
} | |
], | |
"src": "708:9:1" | |
}, | |
"scope": 177, | |
"src": "656:96:1", | |
"stateMutability": "view", | |
"virtual": true, | |
"visibility": "internal" | |
}, | |
{ | |
"body": { | |
"id": 167, | |
"nodeType": "Block", | |
"src": "825:32:1", | |
"statements": [ | |
{ | |
"expression": { | |
"expression": { | |
"id": 164, | |
"name": "msg", | |
"nodeType": "Identifier", | |
"overloadedDeclarations": [], | |
"referencedDeclaration": 4294967281, | |
"src": "842:3:1", | |
"typeDescriptions": { | |
"typeIdentifier": "t_magic_message", | |
"typeString": "msg" | |
} | |
}, | |
"id": 165, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": false, | |
"lValueRequested": false, | |
"memberLocation": "846:4:1", | |
"memberName": "data", | |
"nodeType": "MemberAccess", | |
"src": "842:8:1", | |
"typeDescriptions": { | |
"typeIdentifier": "t_bytes_calldata_ptr", | |
"typeString": "bytes calldata" | |
} | |
}, | |
"functionReturnParameters": 163, | |
"id": 166, | |
"nodeType": "Return", | |
"src": "835:15:1" | |
} | |
] | |
}, | |
"id": 168, | |
"implemented": true, | |
"kind": "function", | |
"modifiers": [], | |
"name": "_msgData", | |
"nameLocation": "767:8:1", | |
"nodeType": "FunctionDefinition", | |
"parameters": { | |
"id": 160, | |
"nodeType": "ParameterList", | |
"parameters": [], | |
"src": "775:2:1" | |
}, | |
"returnParameters": { | |
"id": 163, | |
"nodeType": "ParameterList", | |
"parameters": [ | |
{ | |
"constant": false, | |
"id": 162, | |
"mutability": "mutable", | |
"name": "", | |
"nameLocation": "-1:-1:-1", | |
"nodeType": "VariableDeclaration", | |
"scope": 168, | |
"src": "809:14:1", | |
"stateVariable": false, | |
"storageLocation": "calldata", | |
"typeDescriptions": { | |
"typeIdentifier": "t_bytes_calldata_ptr", | |
"typeString": "bytes" | |
}, | |
"typeName": { | |
"id": 161, | |
"name": "bytes", | |
"nodeType": "ElementaryTypeName", | |
"src": "809:5:1", | |
"typeDescriptions": { | |
"typeIdentifier": "t_bytes_storage_ptr", | |
"typeString": "bytes" | |
} | |
}, | |
"visibility": "internal" | |
} | |
], | |
"src": "808:16:1" | |
}, | |
"scope": 177, | |
"src": "758:99:1", | |
"stateMutability": "view", | |
"virtual": true, | |
"visibility": "internal" | |
}, | |
{ | |
"body": { | |
"id": 175, | |
"nodeType": "Block", | |
"src": "935:25:1", | |
"statements": [ | |
{ | |
"expression": { | |
"hexValue": "30", | |
"id": 173, | |
"isConstant": false, | |
"isLValue": false, | |
"isPure": true, | |
"kind": "number", | |
"lValueRequested": false, | |
"nodeType": "Literal", | |
"src": "952:1:1", | |
"typeDescriptions": { | |
"typeIdentifier": "t_rational_0_by_1", | |
"typeString": "int_const 0" | |
}, | |
"value": "0" | |
}, | |
"functionReturnParameters": 172, | |
"id": 174, | |
"nodeType": "Return", | |
"src": "945:8:1" | |
} | |
] | |
}, | |
"id": 176, | |
"implemented": true, | |
"kind": "function", | |
"modifiers": [], | |
"name": "_contextSuffixLength", | |
"nameLocation": "872:20:1", | |
"nodeType": "FunctionDefinition", | |
"parameters": { | |
"id": 169, | |
"nodeType": "ParameterList", | |
"parameters": [], | |
"src": "892:2:1" | |
}, | |
"returnParameters": { | |
"id": 172, | |
"nodeType": "ParameterList", | |
"parameters": [ | |
{ | |
"constant": false, | |
"id": 171, | |
"mutability": "mutable", | |
"name": "", | |
"nameLocation": "-1:-1:-1", | |
"nodeType": "VariableDeclaration", | |
"scope": 176, | |
"src": "926:7:1", | |
"stateVariable": false, | |
"storageLocation": "default", | |
"typeDescriptions": { | |
"typeIdentifier": "t_uint256", | |
"typeString": "uint256" | |
}, | |
"typeName": { | |
"id": 170, | |
"name": "uint256", | |
"nodeType": "ElementaryTypeName", | |
"src": "926:7:1", | |
"typeDescriptions": { | |
"typeIdentifier": "t_uint256", | |
"typeString": "uint256" | |
} | |
}, | |
"visibility": "internal" | |
} | |
], | |
"src": "925:9:1" | |
}, | |
"scope": 177, | |
"src": "863:97:1", | |
"stateMutability": "view", | |
"virtual": true, | |
"visibility": "internal" | |
} | |
], | |
"scope": 178, | |
"src": "624:338:1", | |
"usedErrors": [], | |
"usedEvents": [] | |
} | |
], | |
"src": "101:862:1" | |
}, | |
"id": 1 | |
} | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"deploy": { | |
"VM:-": { | |
"linkReferences": {}, | |
"autoDeployLib": true | |
}, | |
"main:1": { | |
"linkReferences": {}, | |
"autoDeployLib": true | |
}, | |
"ropsten:3": { | |
"linkReferences": {}, | |
"autoDeployLib": true | |
}, | |
"rinkeby:4": { | |
"linkReferences": {}, | |
"autoDeployLib": true | |
}, | |
"kovan:42": { | |
"linkReferences": {}, | |
"autoDeployLib": true | |
}, | |
"goerli:5": { | |
"linkReferences": {}, | |
"autoDeployLib": true | |
}, | |
"Custom": { | |
"linkReferences": {}, | |
"autoDeployLib": true | |
} | |
}, | |
"data": { | |
"bytecode": { | |
"functionDebugData": {}, | |
"generatedSources": [], | |
"linkReferences": {}, | |
"object": "", | |
"opcodes": "", | |
"sourceMap": "" | |
}, | |
"deployedBytecode": { | |
"functionDebugData": {}, | |
"generatedSources": [], | |
"immutableReferences": {}, | |
"linkReferences": {}, | |
"object": "", | |
"opcodes": "", | |
"sourceMap": "" | |
}, | |
"gasEstimates": null, | |
"methodIdentifiers": { | |
"owner()": "8da5cb5b", | |
"renounceOwnership()": "715018a6", | |
"transferOwnership(address)": "f2fde38b" | |
} | |
}, | |
"abi": [ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "owner", | |
"type": "address" | |
} | |
], | |
"name": "OwnableInvalidOwner", | |
"type": "error" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "account", | |
"type": "address" | |
} | |
], | |
"name": "OwnableUnauthorizedAccount", | |
"type": "error" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "previousOwner", | |
"type": "address" | |
}, | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "newOwner", | |
"type": "address" | |
} | |
], | |
"name": "OwnershipTransferred", | |
"type": "event" | |
}, | |
{ | |
"inputs": [], | |
"name": "owner", | |
"outputs": [ | |
{ | |
"internalType": "address", | |
"name": "", | |
"type": "address" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "renounceOwnership", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "newOwner", | |
"type": "address" | |
} | |
], | |
"name": "transferOwnership", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compiler": { | |
"version": "0.8.25+commit.b61c2a91" | |
}, | |
"language": "Solidity", | |
"output": { | |
"abi": [ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "owner", | |
"type": "address" | |
} | |
], | |
"name": "OwnableInvalidOwner", | |
"type": "error" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "account", | |
"type": "address" | |
} | |
], | |
"name": "OwnableUnauthorizedAccount", | |
"type": "error" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "previousOwner", | |
"type": "address" | |
}, | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "newOwner", | |
"type": "address" | |
} | |
], | |
"name": "OwnershipTransferred", | |
"type": "event" | |
}, | |
{ | |
"inputs": [], | |
"name": "owner", | |
"outputs": [ | |
{ | |
"internalType": "address", | |
"name": "", | |
"type": "address" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "renounceOwnership", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "newOwner", | |
"type": "address" | |
} | |
], | |
"name": "transferOwnership", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
} | |
], | |
"devdoc": { | |
"details": "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. The initial owner is set to the address provided by the deployer. 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.", | |
"errors": { | |
"OwnableInvalidOwner(address)": [ | |
{ | |
"details": "The owner is not a valid owner account. (eg. `address(0)`)" | |
} | |
], | |
"OwnableUnauthorizedAccount(address)": [ | |
{ | |
"details": "The caller account is not authorized to perform an operation." | |
} | |
] | |
}, | |
"kind": "dev", | |
"methods": { | |
"constructor": { | |
"details": "Initializes the contract setting the address provided by the deployer as the initial owner." | |
}, | |
"owner()": { | |
"details": "Returns the address of the current owner." | |
}, | |
"renounceOwnership()": { | |
"details": "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." | |
}, | |
"transferOwnership(address)": { | |
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." | |
} | |
}, | |
"version": 1 | |
}, | |
"userdoc": { | |
"kind": "user", | |
"methods": {}, | |
"version": 1 | |
} | |
}, | |
"settings": { | |
"compilationTarget": { | |
".deps/npm/@openzeppelin/contracts/access/Ownable.sol": "Ownable" | |
}, | |
"evmVersion": "cancun", | |
"libraries": {}, | |
"metadata": { | |
"bytecodeHash": "ipfs" | |
}, | |
"optimizer": { | |
"enabled": false, | |
"runs": 200 | |
}, | |
"remappings": [] | |
}, | |
"sources": { | |
".deps/npm/@openzeppelin/contracts/access/Ownable.sol": { | |
"keccak256": "0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb", | |
"license": "MIT", | |
"urls": [ | |
"bzz-raw://8ed324d3920bb545059d66ab97d43e43ee85fd3bd52e03e401f020afb0b120f6", | |
"dweb:/ipfs/QmfEckWLmZkDDcoWrkEvMWhms66xwTLff9DDhegYpvHo1a" | |
] | |
}, | |
".deps/npm/@openzeppelin/contracts/utils/Context.sol": { | |
"keccak256": "0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2", | |
"license": "MIT", | |
"urls": [ | |
"bzz-raw://6a708e8a5bdb1011c2c381c9a5cfd8a9a956d7d0a9dc1bd8bcdaf52f76ef2f12", | |
"dweb:/ipfs/Qmax9WHBnVsZP46ZxEMNRQpLQnrdE4dK8LehML1Py8FowF" | |
] | |
} | |
}, | |
"version": 1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) | |
pragma solidity ^0.8.20; | |
import {Context} from "../utils/Context.sol"; | |
/** | |
* @dev Contract module which provides a basic access control mechanism, where | |
* there is an account (an owner) that can be granted exclusive access to | |
* specific functions. | |
* | |
* The initial owner is set to the address provided by the deployer. 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; | |
/** | |
* @dev The caller account is not authorized to perform an operation. | |
*/ | |
error OwnableUnauthorizedAccount(address account); | |
/** | |
* @dev The owner is not a valid owner account. (eg. `address(0)`) | |
*/ | |
error OwnableInvalidOwner(address owner); | |
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); | |
/** | |
* @dev Initializes the contract setting the address provided by the deployer as the initial owner. | |
*/ | |
constructor(address initialOwner) { | |
if (initialOwner == address(0)) { | |
revert OwnableInvalidOwner(address(0)); | |
} | |
_transferOwnership(initialOwner); | |
} | |
/** | |
* @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 { | |
if (owner() != _msgSender()) { | |
revert OwnableUnauthorizedAccount(_msgSender()); | |
} | |
} | |
/** | |
* @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 { | |
if (newOwner == address(0)) { | |
revert OwnableInvalidOwner(address(0)); | |
} | |
_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); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) | |
pragma solidity ^0.8.20; | |
/** | |
* @dev Collection of functions related to the address type | |
*/ | |
library Address { | |
/** | |
* @dev The ETH balance of the account is not enough to perform the operation. | |
*/ | |
error AddressInsufficientBalance(address account); | |
/** | |
* @dev There's no code at `target` (it is not a contract). | |
*/ | |
error AddressEmptyCode(address target); | |
/** | |
* @dev A call to an address target failed. The target may have reverted. | |
*/ | |
error FailedInnerCall(); | |
/** | |
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to | |
* `recipient`, forwarding all available gas and reverting on errors. | |
* | |
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost | |
* of certain opcodes, possibly making contracts go over the 2300 gas limit | |
* imposed by `transfer`, making them unable to receive funds via | |
* `transfer`. {sendValue} removes this limitation. | |
* | |
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. | |
* | |
* IMPORTANT: because control is transferred to `recipient`, care must be | |
* taken to not create reentrancy vulnerabilities. Consider using | |
* {ReentrancyGuard} or the | |
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. | |
*/ | |
function sendValue(address payable recipient, uint256 amount) internal { | |
if (address(this).balance < amount) { | |
revert AddressInsufficientBalance(address(this)); | |
} | |
(bool success, ) = recipient.call{value: amount}(""); | |
if (!success) { | |
revert FailedInnerCall(); | |
} | |
} | |
/** | |
* @dev Performs a Solidity function call using a low level `call`. A | |
* plain `call` is an unsafe replacement for a function call: use this | |
* function instead. | |
* | |
* If `target` reverts with a revert reason or custom error, it is bubbled | |
* up by this function (like regular Solidity function calls). However, if | |
* the call reverted with no returned reason, this function reverts with a | |
* {FailedInnerCall} error. | |
* | |
* Returns the raw returned data. To convert to the expected return value, | |
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. | |
* | |
* Requirements: | |
* | |
* - `target` must be a contract. | |
* - calling `target` with `data` must not revert. | |
*/ | |
function functionCall(address target, bytes memory data) internal returns (bytes memory) { | |
return functionCallWithValue(target, data, 0); | |
} | |
/** | |
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], | |
* but also transferring `value` wei to `target`. | |
* | |
* Requirements: | |
* | |
* - the calling contract must have an ETH balance of at least `value`. | |
* - the called Solidity function must be `payable`. | |
*/ | |
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { | |
if (address(this).balance < value) { | |
revert AddressInsufficientBalance(address(this)); | |
} | |
(bool success, bytes memory returndata) = target.call{value: value}(data); | |
return verifyCallResultFromTarget(target, success, returndata); | |
} | |
/** | |
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], | |
* but performing a static call. | |
*/ | |
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { | |
(bool success, bytes memory returndata) = target.staticcall(data); | |
return verifyCallResultFromTarget(target, success, returndata); | |
} | |
/** | |
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], | |
* but performing a delegate call. | |
*/ | |
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { | |
(bool success, bytes memory returndata) = target.delegatecall(data); | |
return verifyCallResultFromTarget(target, success, returndata); | |
} | |
/** | |
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target | |
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an | |
* unsuccessful call. | |
*/ | |
function verifyCallResultFromTarget( | |
address target, | |
bool success, | |
bytes memory returndata | |
) internal view returns (bytes memory) { | |
if (!success) { | |
_revert(returndata); | |
} else { | |
// only check if target is a contract if the call was successful and the return data is empty | |
// otherwise we already know that it was a contract | |
if (returndata.length == 0 && target.code.length == 0) { | |
revert AddressEmptyCode(target); | |
} | |
return returndata; | |
} | |
} | |
/** | |
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the | |
* revert reason or with a default {FailedInnerCall} error. | |
*/ | |
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { | |
if (!success) { | |
_revert(returndata); | |
} else { | |
return returndata; | |
} | |
} | |
/** | |
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. | |
*/ | |
function _revert(bytes memory returndata) private pure { | |
// Look for revert reason and bubble it up if present | |
if (returndata.length > 0) { | |
// The easiest way to bubble the revert reason is using memory via assembly | |
/// @solidity memory-safe-assembly | |
assembly { | |
let returndata_size := mload(returndata) | |
revert(add(32, returndata), returndata_size) | |
} | |
} else { | |
revert FailedInnerCall(); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) | |
pragma solidity ^0.8.20; | |
/** | |
* @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; | |
} | |
function _contextSuffixLength() internal view virtual returns (uint256) { | |
return 0; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[core] | |
repositoryformatversion = 0 | |
filemode = false | |
bare = false | |
logallrefupdates = true | |
symlinks = false | |
ignorecase = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ref: refs/heads/main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIRC fO�%/� fO�%/� + �� ���o#q{K���Sc��X�W�n .prettierrc.json fO�%.�� fO�%.�� * �� �}�7i��$���IQ��B.� | |
README.txt fO�%'���fO�%'��� �� +��^x;n��G�g�f6� contracts/1_Storage.sol fO�%(;��fO�%(;�� �� �I����*̛���>K���?�' |