moonwalkerswap-v1-core
Version:
Moonwalkerswap v1 core
999 lines • 39.1 kB
JSON
{
"contractName": "NoDelegateCall",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"stateVariables\":{\"original\":{\"details\":\"The original address of this contract\"}},\"title\":\"Prevents delegatecall to a contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Base contract that provides a modifier for preventing delegatecall to methods in a child contract\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/MoonwalkerSwap-v1-Core/contracts/NoDelegateCall.sol\":\"NoDelegateCall\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/MoonwalkerSwap-v1-Core/contracts/NoDelegateCall.sol\":{\"keccak256\":\"0x386511254c4d6d2633d7ffa3041630379d50e4a1ec492f9ca1b757947290b0e6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fd48f9bacc3be4e22d68a8b9ff22c009579ac2469c6a7a936f7f9771dcd581f5\",\"dweb:/ipfs/QmTMkABgncwV73CfemiKv9vbmdDJSL75soQr2KjBEwsJkY\"]}},\"version\":1}",
"bytecode": "0x",
"deployedBytecode": "0x",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "",
"deployedSourceMap": "",
"source": "// SPDX-License-Identifier: MIT\npragma solidity =0.7.6;\n\n/// @title Prevents delegatecall to a contract\n/// @notice Base contract that provides a modifier for preventing delegatecall to methods in a child contract\nabstract contract NoDelegateCall {\n /// @dev The original address of this contract\n address private immutable original;\n\n constructor() {\n // Immutables are computed in the init code of the contract, and then inlined into the deployed bytecode.\n // In other words, this variable won't change when it's checked at runtime.\n original = address(this);\n }\n\n /// @dev Private method is used instead of inlining into modifier because modifiers are copied into each method,\n /// and the use of immutable means the address bytes are copied in every place the modifier is used.\n function checkNotDelegateCall() private view {\n require(address(this) == original);\n }\n\n /// @notice Prevents delegatecall into the modified method\n modifier noDelegateCall() {\n checkNotDelegateCall();\n _;\n }\n}\n",
"sourcePath": "/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/MoonwalkerSwap-v1-Core/contracts/NoDelegateCall.sol",
"ast": {
"absolutePath": "/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/MoonwalkerSwap-v1-Core/contracts/NoDelegateCall.sol",
"exportedSymbols": {
"NoDelegateCall": [
2864
]
},
"id": 2865,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2826,
"literals": [
"solidity",
"=",
"0.7",
".6"
],
"nodeType": "PragmaDirective",
"src": "32:23:3"
},
{
"abstract": true,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": {
"id": 2827,
"nodeType": "StructuredDocumentation",
"src": "57:157:3",
"text": "@title Prevents delegatecall to a contract\n @notice Base contract that provides a modifier for preventing delegatecall to methods in a child contract"
},
"fullyImplemented": true,
"id": 2864,
"linearizedBaseContracts": [
2864
],
"name": "NoDelegateCall",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"documentation": {
"id": 2828,
"nodeType": "StructuredDocumentation",
"src": "253:46:3",
"text": "@dev The original address of this contract"
},
"id": 2830,
"mutability": "immutable",
"name": "original",
"nodeType": "VariableDeclaration",
"scope": 2864,
"src": "304:34:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2829,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "304:7:3",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "private"
},
{
"body": {
"id": 2840,
"nodeType": "Block",
"src": "359:239:3",
"statements": [
{
"expression": {
"id": 2838,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 2833,
"name": "original",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2830,
"src": "567:8:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"id": 2836,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967268,
"src": "586:4:3",
"typeDescriptions": {
"typeIdentifier": "t_contract$_NoDelegateCall_$2864",
"typeString": "contract NoDelegateCall"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_NoDelegateCall_$2864",
"typeString": "contract NoDelegateCall"
}
],
"id": 2835,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "578:7:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 2834,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "578:7:3",
"typeDescriptions": {}
}
},
"id": 2837,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "578:13:3",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "567:24:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 2839,
"nodeType": "ExpressionStatement",
"src": "567:24:3"
}
]
},
"id": 2841,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2831,
"nodeType": "ParameterList",
"parameters": [],
"src": "356:2:3"
},
"returnParameters": {
"id": 2832,
"nodeType": "ParameterList",
"parameters": [],
"src": "359:0:3"
},
"scope": 2864,
"src": "345:253:3",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 2854,
"nodeType": "Block",
"src": "875:51:3",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 2851,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"id": 2848,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967268,
"src": "901:4:3",
"typeDescriptions": {
"typeIdentifier": "t_contract$_NoDelegateCall_$2864",
"typeString": "contract NoDelegateCall"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_NoDelegateCall_$2864",
"typeString": "contract NoDelegateCall"
}
],
"id": 2847,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "893:7:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 2846,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "893:7:3",
"typeDescriptions": {}
}
},
"id": 2849,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "893:13:3",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"id": 2850,
"name": "original",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2830,
"src": "910:8:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "893:25:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 2845,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "885:7:3",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 2852,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "885:34:3",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2853,
"nodeType": "ExpressionStatement",
"src": "885:34:3"
}
]
},
"documentation": {
"id": 2842,
"nodeType": "StructuredDocumentation",
"src": "604:221:3",
"text": "@dev Private method is used instead of inlining into modifier because modifiers are copied into each method,\n and the use of immutable means the address bytes are copied in every place the modifier is used."
},
"id": 2855,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "checkNotDelegateCall",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2843,
"nodeType": "ParameterList",
"parameters": [],
"src": "859:2:3"
},
"returnParameters": {
"id": 2844,
"nodeType": "ParameterList",
"parameters": [],
"src": "875:0:3"
},
"scope": 2864,
"src": "830:96:3",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 2862,
"nodeType": "Block",
"src": "1021:50:3",
"statements": [
{
"expression": {
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 2858,
"name": "checkNotDelegateCall",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2855,
"src": "1031:20:3",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$__$",
"typeString": "function () view"
}
},
"id": 2859,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1031:22:3",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2860,
"nodeType": "ExpressionStatement",
"src": "1031:22:3"
},
{
"id": 2861,
"nodeType": "PlaceholderStatement",
"src": "1063:1:3"
}
]
},
"documentation": {
"id": 2856,
"nodeType": "StructuredDocumentation",
"src": "932:58:3",
"text": "@notice Prevents delegatecall into the modified method"
},
"id": 2863,
"name": "noDelegateCall",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 2857,
"nodeType": "ParameterList",
"parameters": [],
"src": "1018:2:3"
},
"src": "995:76:3",
"virtual": false,
"visibility": "internal"
}
],
"scope": 2865,
"src": "214:859:3"
}
],
"src": "32:1042:3"
},
"legacyAST": {
"attributes": {
"absolutePath": "/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/MoonwalkerSwap-v1-Core/contracts/NoDelegateCall.sol",
"exportedSymbols": {
"NoDelegateCall": [
2864
]
},
"license": "MIT"
},
"children": [
{
"attributes": {
"literals": [
"solidity",
"=",
"0.7",
".6"
]
},
"id": 2826,
"name": "PragmaDirective",
"src": "32:23:3"
},
{
"attributes": {
"abstract": true,
"baseContracts": [
null
],
"contractDependencies": [
null
],
"contractKind": "contract",
"fullyImplemented": true,
"linearizedBaseContracts": [
2864
],
"name": "NoDelegateCall",
"scope": 2865
},
"children": [
{
"attributes": {
"text": "@title Prevents delegatecall to a contract\n @notice Base contract that provides a modifier for preventing delegatecall to methods in a child contract"
},
"id": 2827,
"name": "StructuredDocumentation",
"src": "57:157:3"
},
{
"attributes": {
"constant": false,
"mutability": "immutable",
"name": "original",
"scope": 2864,
"stateVariable": true,
"storageLocation": "default",
"type": "address",
"visibility": "private"
},
"children": [
{
"attributes": {
"name": "address",
"stateMutability": "nonpayable",
"type": "address"
},
"id": 2829,
"name": "ElementaryTypeName",
"src": "304:7:3"
},
{
"attributes": {
"text": "@dev The original address of this contract"
},
"id": 2828,
"name": "StructuredDocumentation",
"src": "253:46:3"
}
],
"id": 2830,
"name": "VariableDeclaration",
"src": "304:34:3"
},
{
"attributes": {
"implemented": true,
"isConstructor": true,
"kind": "constructor",
"modifiers": [
null
],
"name": "",
"scope": 2864,
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2831,
"name": "ParameterList",
"src": "356:2:3"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2832,
"name": "ParameterList",
"src": "359:0:3"
},
{
"children": [
{
"children": [
{
"attributes": {
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "=",
"type": "address"
},
"children": [
{
"attributes": {
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2830,
"type": "address",
"value": "original"
},
"id": 2833,
"name": "Identifier",
"src": "567:8:3"
},
{
"attributes": {
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"tryCall": false,
"type": "address",
"type_conversion": true
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_NoDelegateCall_$2864",
"typeString": "contract NoDelegateCall"
}
],
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"type": "type(address)"
},
"children": [
{
"attributes": {
"name": "address"
},
"id": 2834,
"name": "ElementaryTypeName",
"src": "578:7:3"
}
],
"id": 2835,
"name": "ElementaryTypeNameExpression",
"src": "578:7:3"
},
{
"attributes": {
"overloadedDeclarations": [
null
],
"referencedDeclaration": 4294967268,
"type": "contract NoDelegateCall",
"value": "this"
},
"id": 2836,
"name": "Identifier",
"src": "586:4:3"
}
],
"id": 2837,
"name": "FunctionCall",
"src": "578:13:3"
}
],
"id": 2838,
"name": "Assignment",
"src": "567:24:3"
}
],
"id": 2839,
"name": "ExpressionStatement",
"src": "567:24:3"
}
],
"id": 2840,
"name": "Block",
"src": "359:239:3"
}
],
"id": 2841,
"name": "FunctionDefinition",
"src": "345:253:3"
},
{
"attributes": {
"implemented": true,
"isConstructor": false,
"kind": "function",
"modifiers": [
null
],
"name": "checkNotDelegateCall",
"scope": 2864,
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
"children": [
{
"attributes": {
"text": "@dev Private method is used instead of inlining into modifier because modifiers are copied into each method,\n and the use of immutable means the address bytes are copied in every place the modifier is used."
},
"id": 2842,
"name": "StructuredDocumentation",
"src": "604:221:3"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2843,
"name": "ParameterList",
"src": "859:2:3"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2844,
"name": "ParameterList",
"src": "875:0:3"
},
{
"children": [
{
"children": [
{
"attributes": {
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"tryCall": false,
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"overloadedDeclarations": [
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"type": "function (bool) pure",
"value": "require"
},
"id": 2845,
"name": "Identifier",
"src": "885:7:3"
},
{
"attributes": {
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "==",
"type": "bool"
},
"children": [
{
"attributes": {
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"tryCall": false,
"type": "address",
"type_conversion": true
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_NoDelegateCall_$2864",
"typeString": "contract NoDelegateCall"
}
],
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"type": "type(address)"
},
"children": [
{
"attributes": {
"name": "address"
},
"id": 2846,
"name": "ElementaryTypeName",
"src": "893:7:3"
}
],
"id": 2847,
"name": "ElementaryTypeNameExpression",
"src": "893:7:3"
},
{
"attributes": {
"overloadedDeclarations": [
null
],
"referencedDeclaration": 4294967268,
"type": "contract NoDelegateCall",
"value": "this"
},
"id": 2848,
"name": "Identifier",
"src": "901:4:3"
}
],
"id": 2849,
"name": "FunctionCall",
"src": "893:13:3"
},
{
"attributes": {
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2830,
"type": "address",
"value": "original"
},
"id": 2850,
"name": "Identifier",
"src": "910:8:3"
}
],
"id": 2851,
"name": "BinaryOperation",
"src": "893:25:3"
}
],
"id": 2852,
"name": "FunctionCall",
"src": "885:34:3"
}
],
"id": 2853,
"name": "ExpressionStatement",
"src": "885:34:3"
}
],
"id": 2854,
"name": "Block",
"src": "875:51:3"
}
],
"id": 2855,
"name": "FunctionDefinition",
"src": "830:96:3"
},
{
"attributes": {
"name": "noDelegateCall",
"virtual": false,
"visibility": "internal"
},
"children": [
{
"attributes": {
"text": "@notice Prevents delegatecall into the modified method"
},
"id": 2856,
"name": "StructuredDocumentation",
"src": "932:58:3"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2857,
"name": "ParameterList",
"src": "1018:2:3"
},
{
"children": [
{
"children": [
{
"attributes": {
"arguments": [
null
],
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"tryCall": false,
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
null
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2855,
"type": "function () view",
"value": "checkNotDelegateCall"
},
"id": 2858,
"name": "Identifier",
"src": "1031:20:3"
}
],
"id": 2859,
"name": "FunctionCall",
"src": "1031:22:3"
}
],
"id": 2860,
"name": "ExpressionStatement",
"src": "1031:22:3"
},
{
"id": 2861,
"name": "PlaceholderStatement",
"src": "1063:1:3"
}
],
"id": 2862,
"name": "Block",
"src": "1021:50:3"
}
],
"id": 2863,
"name": "ModifierDefinition",
"src": "995:76:3"
}
],
"id": 2864,
"name": "ContractDefinition",
"src": "214:859:3"
}
],
"id": 2865,
"name": "SourceUnit",
"src": "32:1042:3"
},
"compiler": {
"name": "solc",
"version": "0.7.6+commit.7338295f.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.4.1",
"updatedAt": "2022-01-17T20:05:41.692Z",
"devdoc": {
"kind": "dev",
"methods": {},
"stateVariables": {
"original": {
"details": "The original address of this contract"
}
},
"title": "Prevents delegatecall to a contract",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"notice": "Base contract that provides a modifier for preventing delegatecall to methods in a child contract",
"version": 1
}
}