{ "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": "0x608060405234801561001057600080fd5b5060405161026d38038061026d83398101806040528101908080519060200190929190805182019291905050508160008173ffffffffffffffffffffffffffffffffffffffff161415151561006457600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506000815111156100f15773ffffffffffffffffffffffffffffffffffffffff60005416600080835160208501846127105a03f46040513d6000823e60008214156100ed573d81fd5b5050505b505061016b806101026000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634555d5c91461008b5780635c60da1b146100b6575b73ffffffffffffffffffffffffffffffffffffffff600054163660008037600080366000845af43d6000803e6000811415610086573d6000fd5b3d6000f35b34801561009757600080fd5b506100a061010d565b6040518082815260200191505060405180910390f35b3480156100c257600080fd5b506100cb610116565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60006002905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050905600a165627a7a72305820caf2b106039b60d7c8f99a3087b6cbf6014cdee3748f0823ccd8cbf983ee4a720029", "deployedBytecode": "0x60806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634555d5c91461008b5780635c60da1b146100b6575b73ffffffffffffffffffffffffffffffffffffffff600054163660008037600080366000845af43d6000803e6000811415610086573d6000fd5b3d6000f35b34801561009757600080fd5b506100a061010d565b6040518082815260200191505060405180910390f35b3480156100c257600080fd5b506100cb610116565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60006002905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050905600a165627a7a72305820caf2b106039b60d7c8f99a3087b6cbf6014cdee3748f0823ccd8cbf983ee4a720029", "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:12;578:11;:16;;;;570:25;;;;;;;;618:11;605:10;;:24;;;;;;;;;;;;;;;;;;508:128;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:-;;;;;;;;;;;;;;;;;;;;;;;;;;915:42:12;911:1;905:8;901:57;990:14;987:1;984;971:34;1085:1;1082;1066:14;1063:1;1051:10;1046:3;1033:54;1121:16;1118:1;1115;1100:38;1166:1;1157:7;1154:14;1151:2;;;1181:16;1178:1;1171:27;1151:2;1223:16;1220:1;1213:27;1386:104;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1386:104:12;;;;;;;;;;;;;;;;;;;;;;;1262:118;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1262:118:12;;;;;;;;;;;;;;;;;;;;;;;;;;;1386:104;1452:7;1482:1;1475:8;;1386:104;:::o;1262:118::-;1333:7;1363:10;;;;;;;;;;;1356:17;;1262:118;:::o", "source": "pragma solidity 0.4.23;\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", ".23" ], "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": 1509, "src": "24:21:0", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 3, "name": "Proxy", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1508, "src": "392:5:0", "typeDescriptions": { "typeIdentifier": "t_contract$_Proxy_$1508", "typeString": "contract Proxy" } }, "id": 4, "nodeType": "InheritanceSpecifier", "src": "392:5:0" } ], "contractDependencies": [ 1508 ], "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, 1508 ], "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": 1508, "src": "662:5:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Proxy_$1508_$", "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", ".23" ], "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": 1509, "src": "24:21:0", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 3, "name": "Proxy", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1508, "src": "392:5:0", "typeDescriptions": { "typeIdentifier": "t_contract$_Proxy_$1508", "typeString": "contract Proxy" } }, "id": 4, "nodeType": "InheritanceSpecifier", "src": "392:5:0" } ], "contractDependencies": [ 1508 ], "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, 1508 ], "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": 1508, "src": "662:5:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Proxy_$1508_$", "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.23+commit.124ca40d.Emscripten.clang" }, "networks": {}, "schemaVersion": "2.0.0", "updatedAt": "2018-05-10T10:43:07.891Z" }