UNPKG

@openzeppelin/upgrades

Version:

JavaScript library for the OpenZeppelin smart contract platform

1,252 lines (1,251 loc) 57.3 kB
{ "fileName": "Ownable.sol", "contractName": "OpenZeppelinUpgradesOwnable", "source": "pragma solidity ^0.5.0;\n\n/**\n * @title Ownable\n * @dev The Ownable contract has an owner address, and provides basic authorization control\n * functions, this simplifies the implementation of \"user permissions\".\n *\n * Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/ownership/Ownable.sol\n * This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts\n * when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the\n * build/artifacts folder) as well as the vanilla Ownable implementation from an openzeppelin version.\n */\ncontract OpenZeppelinUpgradesOwnable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev The Ownable constructor sets the original `owner` of the contract to the sender\n * account.\n */\n constructor () internal {\n _owner = msg.sender;\n emit OwnershipTransferred(address(0), _owner);\n }\n\n /**\n * @return the address of the owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(isOwner());\n _;\n }\n\n /**\n * @return true if `msg.sender` is the owner of the contract.\n */\n function isOwner() public view returns (bool) {\n return msg.sender == _owner;\n }\n\n /**\n * @dev Allows the current owner to relinquish control of the contract.\n * @notice Renouncing to ownership will leave the contract without an owner.\n * It will not be possible to call the functions with the `onlyOwner`\n * modifier anymore.\n */\n function renounceOwnership() public onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Allows the current owner to transfer control of the contract to a newOwner.\n * @param newOwner The address to transfer ownership to.\n */\n function transferOwnership(address newOwner) public onlyOwner {\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers control of the contract to a newOwner.\n * @param newOwner The address to transfer ownership to.\n */\n function _transferOwnership(address newOwner) internal {\n require(newOwner != address(0));\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n", "sourcePath": "contracts/ownership/Ownable.sol", "sourceMap": "", "deployedSourceMap": "", "abi": [ { "constant": false, "inputs": [], "name": "renounceOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "isOwner", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "previousOwner", "type": "address" }, { "indexed": true, "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" } ], "ast": { "absolutePath": "contracts/ownership/Ownable.sol", "exportedSymbols": { "OpenZeppelinUpgradesOwnable": [ 5493 ] }, "id": 5494, "nodeType": "SourceUnit", "nodes": [ { "id": 5386, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:33" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "@title Ownable\n@dev The Ownable contract has an owner address, and provides basic authorization control\nfunctions, this simplifies the implementation of \"user permissions\".\n * Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/ownership/Ownable.sol\nThis contract is copied here and renamed from the original to avoid clashes in the compiled artifacts\nwhen the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the\nbuild/artifacts folder) as well as the vanilla Ownable implementation from an openzeppelin version.", "fullyImplemented": true, "id": 5493, "linearizedBaseContracts": [ 5493 ], "name": "OpenZeppelinUpgradesOwnable", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 5388, "name": "_owner", "nodeType": "VariableDeclaration", "scope": 5493, "src": "703:22:33", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 5387, "name": "address", "nodeType": "ElementaryTypeName", "src": "703:7:33", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "private" }, { "anonymous": false, "documentation": null, "id": 5394, "name": "OwnershipTransferred", "nodeType": "EventDefinition", "parameters": { "id": 5393, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5390, "indexed": true, "name": "previousOwner", "nodeType": "VariableDeclaration", "scope": 5394, "src": "759:29:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 5389, "name": "address", "nodeType": "ElementaryTypeName", "src": "759:7:33", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5392, "indexed": true, "name": "newOwner", "nodeType": "VariableDeclaration", "scope": 5394, "src": "790:24:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 5391, "name": "address", "nodeType": "ElementaryTypeName", "src": "790:7:33", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "758:57:33" }, "src": "732:84:33" }, { "body": { "id": 5409, "nodeType": "Block", "src": "970:91:33", "statements": [ { "expression": { "argumentTypes": null, "id": 5400, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5397, "name": "_owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5388, "src": "980:6:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 5398, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6463, "src": "989:3:33", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 5399, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "989:10:33", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "src": "980:19:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 5401, "nodeType": "ExpressionStatement", "src": "980:19:33" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 5404, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1043:1:33", "subdenomination": null, "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": 5403, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1035:7:33", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 5405, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1035:10:33", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, { "argumentTypes": null, "id": 5406, "name": "_owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5388, "src": "1047:6:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" }, { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 5402, "name": "OwnershipTransferred", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5394, "src": "1014:20:33", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", "typeString": "function (address,address)" } }, "id": 5407, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1014:40:33", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5408, "nodeType": "EmitStatement", "src": "1009:45:33" } ] }, "documentation": "@dev The Ownable constructor sets the original `owner` of the contract to the sender\naccount.", "id": 5410, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 5395, "nodeType": "ParameterList", "parameters": [], "src": "958:2:33" }, "returnParameters": { "id": 5396, "nodeType": "ParameterList", "parameters": [], "src": "970:0:33" }, "scope": 5493, "src": "946:115:33", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" }, { "body": { "id": 5417, "nodeType": "Block", "src": "1171:30:33", "statements": [ { "expression": { "argumentTypes": null, "id": 5415, "name": "_owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5388, "src": "1188:6:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 5414, "id": 5416, "nodeType": "Return", "src": "1181:13:33" } ] }, "documentation": "@return the address of the owner.", "id": 5418, "implemented": true, "kind": "function", "modifiers": [], "name": "owner", "nodeType": "FunctionDefinition", "parameters": { "id": 5411, "nodeType": "ParameterList", "parameters": [], "src": "1138:2:33" }, "returnParameters": { "id": 5414, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5413, "name": "", "nodeType": "VariableDeclaration", "scope": 5418, "src": "1162:7:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 5412, "name": "address", "nodeType": "ElementaryTypeName", "src": "1162:7:33", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1161:9:33" }, "scope": 5493, "src": "1124:77:33", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 5426, "nodeType": "Block", "src": "1310:46:33", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 5421, "name": "isOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5438, "src": "1328:7:33", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", "typeString": "function () view returns (bool)" } }, "id": 5422, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1328:9:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 5420, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6466, 6467 ], "referencedDeclaration": 6466, "src": "1320:7:33", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 5423, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1320:18:33", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5424, "nodeType": "ExpressionStatement", "src": "1320:18:33" }, { "id": 5425, "nodeType": "PlaceholderStatement", "src": "1348:1:33" } ] }, "documentation": "@dev Throws if called by any account other than the owner.", "id": 5427, "name": "onlyOwner", "nodeType": "ModifierDefinition", "parameters": { "id": 5419, "nodeType": "ParameterList", "parameters": [], "src": "1307:2:33" }, "src": "1289:67:33", "visibility": "internal" }, { "body": { "id": 5437, "nodeType": "Block", "src": "1490:44:33", "statements": [ { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 5435, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 5432, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6463, "src": "1507:3:33", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 5433, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1507:10:33", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 5434, "name": "_owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5388, "src": "1521:6:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "1507:20:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 5431, "id": 5436, "nodeType": "Return", "src": "1500:27:33" } ] }, "documentation": "@return true if `msg.sender` is the owner of the contract.", "id": 5438, "implemented": true, "kind": "function", "modifiers": [], "name": "isOwner", "nodeType": "FunctionDefinition", "parameters": { "id": 5428, "nodeType": "ParameterList", "parameters": [], "src": "1460:2:33" }, "returnParameters": { "id": 5431, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5430, "name": "", "nodeType": "VariableDeclaration", "scope": 5438, "src": "1484:4:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 5429, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1484:4:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "1483:6:33" }, "scope": 5493, "src": "1444:90:33", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 5456, "nodeType": "Block", "src": "1858:91:33", "statements": [ { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5444, "name": "_owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5388, "src": "1894:6:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 5446, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1910:1:33", "subdenomination": null, "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": 5445, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1902:7:33", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 5447, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1902:10:33", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 5443, "name": "OwnershipTransferred", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5394, "src": "1873:20:33", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", "typeString": "function (address,address)" } }, "id": 5448, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1873:40:33", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5449, "nodeType": "EmitStatement", "src": "1868:45:33" }, { "expression": { "argumentTypes": null, "id": 5454, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 5450, "name": "_owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5388, "src": "1923:6:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 5452, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1940:1:33", "subdenomination": null, "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": 5451, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1932:7:33", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 5453, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1932:10:33", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "src": "1923:19:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 5455, "nodeType": "ExpressionStatement", "src": "1923:19:33" } ] }, "documentation": "@dev Allows the current owner to relinquish control of the contract.\n@notice Renouncing to ownership will leave the contract without an owner.\nIt will not be possible to call the functions with the `onlyOwner`\nmodifier anymore.", "id": 5457, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 5441, "modifierName": { "argumentTypes": null, "id": 5440, "name": "onlyOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5427, "src": "1848:9:33", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "1848:9:33" } ], "name": "renounceOwnership", "nodeType": "FunctionDefinition", "parameters": { "id": 5439, "nodeType": "ParameterList", "parameters": [], "src": "1838:2:33" }, "returnParameters": { "id": 5442, "nodeType": "ParameterList", "parameters": [], "src": "1858:0:33" }, "scope": 5493, "src": "1812:137:33", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 5468, "nodeType": "Block", "src": "2182:45:33", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 5465, "name": "newOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5459, "src": "2211:8:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 5464, "name": "_transferOwnership", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5492, "src": "2192:18:33", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 5466, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2192:28:33", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 5467, "nodeType": "ExpressionStatement", "src": "2192:28:33" } ] }, "documentation": "@dev Allows the current owner to transfer control of the contract to a newOwner.\n@param newOwner The address to transfer ownership to.", "id": 5469, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 5462, "modifierName": { "argumentTypes": null, "id": 5461, "name": "onlyOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5427, "src": "2172:9:33", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "2172:9:33" } ], "name": "transferOwnership", "nodeType": "FunctionDefinition", "parameters": { "id": 5460, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5459, "name": "newOwner", "nodeType": "VariableDeclaration", "scope": 5469, "src": "2147:16:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 5458, "name": "address", "nodeType": "ElementaryTypeName", "src": "2147:7:33", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2146:18:33" }, "returnParameters": { "id": 5463, "nodeType": "ParameterList", "parameters": [], "src": "2182:0:33" }, "scope": 5493, "src": "2120:107:33", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 5491, "nodeType": "Block", "src": "2426:128:33", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 5479, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 5475, "name": "newOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5471, "src": "2444:8:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 5477, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "2464:1:33", "subdenomination": null, "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": 5476, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2456:7:33", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 5478, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2456:10:33", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "src": "2444:22:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 5474, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6466, 6467 ], "referencedDeclaration": 6466, "src": "2436:7:33", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 5480, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2436:31:33",