{ "contractName": "DelegateConstructorProxy", "abi": [ { "constant": true, "inputs": [], "name": "proxyType", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "pure", "type": "function" }, { "constant": true, "inputs": [], "name": "implementation", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [ { "name": "_masterCopy", "type": "address" }, { "name": "initializer", "type": "bytes" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "payable": true, "stateMutability": "payable", "type": "fallback" } ], "bytecode": "0x608060405234801561001057600080fd5b506040516102fc3803806102fc83398101806040528101908080519060200190929190805182019291905050508160008173ffffffffffffffffffffffffffffffffffffffff16141515156100f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f496e76616c6964206d617374657220636f707920616464726573732070726f7681526020017f696465640000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506000815111156101805773ffffffffffffffffffffffffffffffffffffffff60005416600080835160208501846127105a03f46040513d6000823e600082141561017c573d81fd5b5050505b505061016b806101916000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634555d5c91461008b5780635c60da1b146100b6575b73ffffffffffffffffffffffffffffffffffffffff600054163660008037600080366000845af43d6000803e6000811415610086573d6000fd5b3d6000f35b34801561009757600080fd5b506100a061010d565b6040518082815260200191505060405180910390f35b3480156100c257600080fd5b506100cb610116565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60006002905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050905600a165627a7a72305820bab5357556c704bffef0f96326dd27742408be175057ffd8f4f58237314cfd520029", "deployedBytecode": "0x60806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634555d5c91461008b5780635c60da1b146100b6575b73ffffffffffffffffffffffffffffffffffffffff600054163660008037600080366000845af43d6000803e6000811415610086573d6000fd5b3d6000f35b34801561009757600080fd5b506100a061010d565b6040518082815260200191505060405180910390f35b3480156100c257600080fd5b506100cb610116565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60006002905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050905600a165627a7a72305820bab5357556c704bffef0f96326dd27742408be175057ffd8f4f58237314cfd520029", "sourceMap": "355:882:0:-;;;610:625;8:9:-1;5:2;;;30:1;27;20:12;5:2;610:625:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;668:11;593:1:11;578:11;:16;;;;570:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;658:11;645:10;;:24;;;;;;;;;;;;;;;;;;508:168;735:1:0;714:11;:18;:22;710:519;;;879:42;875:1;869:8;865:57;1043:1;1040;1026:11;1020:18;1013:4;1000:11;996:22;984:10;976:5;971:3;967:15;954:91;1079:4;1073:11;1124:14;1121:1;1116:3;1101:38;1171:1;1162:7;1159:14;1156:2;;;1188:14;1183:3;1176:27;1156:2;829:390;;;;610:625;;355:882;;;;;;", "deployedSourceMap": "355:882:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;955:42:11;951:1;945:8;941:57;1030:14;1027:1;1024;1011:34;1125:1;1122;1106:14;1103:1;1091:10;1086:3;1073:54;1161:16;1158:1;1155;1140:38;1206:1;1197:7;1194:14;1191:2;;;1221:16;1218:1;1211:27;1191:2;1263:16;1260:1;1253:27;1426:104;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1426:104:11;;;;;;;;;;;;;;;;;;;;;;;1302:118;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1302:118:11;;;;;;;;;;;;;;;;;;;;;;;;;;;1426:104;1492:7;1522:1;1515:8;;1426:104;:::o;1302:118::-;1373:7;1403:10;;;;;;;;;;;1396:17;;1302:118;:::o", "source": "pragma solidity 0.4.24;\nimport \"./Proxy.sol\";\n\n\n/// @title Delegate Constructor Proxy - Generic proxy contract allows to execute all transactions applying the code of a master contract. It is possible to send along initialization data with the constructor.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract DelegateConstructorProxy is Proxy {\n\n /// @dev Constructor function sets address of master copy contract.\n /// @param _masterCopy Master copy address.\n /// @param initializer Data used for a delegate call to initialize the contract.\n constructor(address _masterCopy, bytes initializer) Proxy(_masterCopy)\n public\n {\n if (initializer.length > 0) {\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n let masterCopy := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n let success := delegatecall(sub(gas, 10000), masterCopy, add(initializer, 0x20), mload(initializer), 0, 0)\n let ptr := mload(0x40)\n returndatacopy(ptr, 0, returndatasize)\n if eq(success, 0) { revert(ptr, returndatasize) }\n }\n }\n }\n}\n", "sourcePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/DelegateConstructorProxy.sol", "ast": { "absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/DelegateConstructorProxy.sol", "exportedSymbols": { "DelegateConstructorProxy": [ 23 ] }, "id": 24, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:23:0" }, { "absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/Proxy.sol", "file": "./Proxy.sol", "id": 2, "nodeType": "ImportDirective", "scope": 24, "sourceUnit": 1603, "src": "24:21:0", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 3, "name": "Proxy", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1602, "src": "392:5:0", "typeDescriptions": { "typeIdentifier": "t_contract$_Proxy_$1602", "typeString": "contract Proxy" } }, "id": 4, "nodeType": "InheritanceSpecifier", "src": "392:5:0" } ], "contractDependencies": [ 1602 ], "contractKind": "contract", "documentation": "@title Delegate Constructor Proxy - Generic proxy contract allows to execute all transactions applying the code of a master contract. It is possible to send along initialization data with the constructor.\n @author Stefan George - \n @author Richard Meissner - ", "fullyImplemented": true, "id": 23, "linearizedBaseContracts": [ 23, 1602 ], "name": "DelegateConstructorProxy", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 21, "nodeType": "Block", "src": "700:535:0", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 17, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 14, "name": "initializer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8, "src": "714:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 15, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "714:18:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 16, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "735:1:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "714:22:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 20, "nodeType": "IfStatement", "src": "710:519:0", "trueBody": { "id": 19, "nodeType": "Block", "src": "738:491:0", "statements": [ { "externalReferences": [ { "initializer": { "declaration": 8, "isOffset": false, "isSlot": false, "src": "1000:11:0", "valueSize": 1 } }, { "initializer": { "declaration": 8, "isOffset": false, "isSlot": false, "src": "1026:11:0", "valueSize": 1 } } ], "id": 18, "nodeType": "InlineAssembly", "operations": "{\n let masterCopy := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n let success := delegatecall(sub(gas(), 10000), masterCopy, add(initializer, 0x20), mload(initializer), 0, 0)\n let ptr := mload(0x40)\n returndatacopy(ptr, 0, returndatasize())\n if eq(success, 0)\n {\n revert(ptr, returndatasize())\n }\n}", "src": "820:409:0" } ] } } ] }, "documentation": "@dev Constructor function sets address of master copy contract.\n @param _masterCopy Master copy address.\n @param initializer Data used for a delegate call to initialize the contract.", "id": 22, "implemented": true, "isConstructor": true, "isDeclaredConst": false, "modifiers": [ { "arguments": [ { "argumentTypes": null, "id": 11, "name": "_masterCopy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6, "src": "668:11:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "id": 12, "modifierName": { "argumentTypes": null, "id": 10, "name": "Proxy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1602, "src": "662:5:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Proxy_$1602_$", "typeString": "type(contract Proxy)" } }, "nodeType": "ModifierInvocation", "src": "662:18:0" } ], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 9, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6, "name": "_masterCopy", "nodeType": "VariableDeclaration", "scope": 22, "src": "622:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 5, "name": "address", "nodeType": "ElementaryTypeName", "src": "622:7:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 8, "name": "initializer", "nodeType": "VariableDeclaration", "scope": 22, "src": "643:17:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 7, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "643:5:0", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "621:40:0" }, "payable": false, "returnParameters": { "id": 13, "nodeType": "ParameterList", "parameters": [], "src": "700:0:0" }, "scope": 23, "src": "610:625:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], "scope": 24, "src": "355:882:0" } ], "src": "0:1238:0" }, "legacyAST": { "absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/DelegateConstructorProxy.sol", "exportedSymbols": { "DelegateConstructorProxy": [ 23 ] }, "id": 24, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:23:0" }, { "absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/Proxy.sol", "file": "./Proxy.sol", "id": 2, "nodeType": "ImportDirective", "scope": 24, "sourceUnit": 1603, "src": "24:21:0", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 3, "name": "Proxy", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1602, "src": "392:5:0", "typeDescriptions": { "typeIdentifier": "t_contract$_Proxy_$1602", "typeString": "contract Proxy" } }, "id": 4, "nodeType": "InheritanceSpecifier", "src": "392:5:0" } ], "contractDependencies": [ 1602 ], "contractKind": "contract", "documentation": "@title Delegate Constructor Proxy - Generic proxy contract allows to execute all transactions applying the code of a master contract. It is possible to send along initialization data with the constructor.\n @author Stefan George - \n @author Richard Meissner - ", "fullyImplemented": true, "id": 23, "linearizedBaseContracts": [ 23, 1602 ], "name": "DelegateConstructorProxy", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 21, "nodeType": "Block", "src": "700:535:0", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 17, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 14, "name": "initializer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8, "src": "714:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 15, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "714:18:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 16, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "735:1:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "714:22:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 20, "nodeType": "IfStatement", "src": "710:519:0", "trueBody": { "id": 19, "nodeType": "Block", "src": "738:491:0", "statements": [ { "externalReferences": [ { "initializer": { "declaration": 8, "isOffset": false, "isSlot": false, "src": "1000:11:0", "valueSize": 1 } }, { "initializer": { "declaration": 8, "isOffset": false, "isSlot": false, "src": "1026:11:0", "valueSize": 1 } } ], "id": 18, "nodeType": "InlineAssembly", "operations": "{\n let masterCopy := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n let success := delegatecall(sub(gas(), 10000), masterCopy, add(initializer, 0x20), mload(initializer), 0, 0)\n let ptr := mload(0x40)\n returndatacopy(ptr, 0, returndatasize())\n if eq(success, 0)\n {\n revert(ptr, returndatasize())\n }\n}", "src": "820:409:0" } ] } } ] }, "documentation": "@dev Constructor function sets address of master copy contract.\n @param _masterCopy Master copy address.\n @param initializer Data used for a delegate call to initialize the contract.", "id": 22, "implemented": true, "isConstructor": true, "isDeclaredConst": false, "modifiers": [ { "arguments": [ { "argumentTypes": null, "id": 11, "name": "_masterCopy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6, "src": "668:11:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "id": 12, "modifierName": { "argumentTypes": null, "id": 10, "name": "Proxy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1602, "src": "662:5:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Proxy_$1602_$", "typeString": "type(contract Proxy)" } }, "nodeType": "ModifierInvocation", "src": "662:18:0" } ], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 9, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6, "name": "_masterCopy", "nodeType": "VariableDeclaration", "scope": 22, "src": "622:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 5, "name": "address", "nodeType": "ElementaryTypeName", "src": "622:7:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 8, "name": "initializer", "nodeType": "VariableDeclaration", "scope": 22, "src": "643:17:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 7, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "643:5:0", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "621:40:0" }, "payable": false, "returnParameters": { "id": 13, "nodeType": "ParameterList", "parameters": [], "src": "700:0:0" }, "scope": 23, "src": "610:625:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], "scope": 24, "src": "355:882:0" } ], "src": "0:1238:0" }, "compiler": { "name": "solc", "version": "0.4.24+commit.e67f0147.Emscripten.clang" }, "networks": {}, "schemaVersion": "2.0.0", "updatedAt": "2018-05-28T05:59:52.697Z" }