1271 lines
53 KiB
JSON
1271 lines
53 KiB
JSON
{
|
|
"contractName": "CreateAndAddModules",
|
|
"abi": [
|
|
{
|
|
"constant": false,
|
|
"inputs": [
|
|
{
|
|
"name": "module",
|
|
"type": "address"
|
|
}
|
|
],
|
|
"name": "enableModule",
|
|
"outputs": [],
|
|
"payable": false,
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"inputs": [
|
|
{
|
|
"name": "proxyFactory",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"name": "data",
|
|
"type": "bytes"
|
|
}
|
|
],
|
|
"name": "createAndAddModules",
|
|
"outputs": [],
|
|
"payable": false,
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
}
|
|
],
|
|
"bytecode": "0x608060405234801561001057600080fd5b50610275806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360df7f5814610051578063610b5925146100da575b600080fd5b34801561005d57600080fd5b506100d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061011d565b005b3480156100e657600080fd5b5061011b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610244565b005b600080600083519250600090505b8281101561023d5780840160200151818501604001604051600060208285858c5af4141561015857600080fd5b73ffffffffffffffffffffffffffffffffffffffff8151169450602080601f85010402602001840193505050503073ffffffffffffffffffffffffffffffffffffffff1663610b5925836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561022057600080fd5b505af1158015610234573d6000803e3d6000fd5b5050505061012b565b5050505050565b600080fd00a165627a7a723058207c5f557823bcf2be1858240c0c1037c633c0f0159752cd4b58f9f35c29ad604c0029",
|
|
"deployedBytecode": "0x60806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360df7f5814610051578063610b5925146100da575b600080fd5b34801561005d57600080fd5b506100d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061011d565b005b3480156100e657600080fd5b5061011b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610244565b005b600080600083519250600090505b8281101561023d5780840160200151818501604001604051600060208285858c5af4141561015857600080fd5b73ffffffffffffffffffffffffffffffffffffffff8151169450602080601f85010402602001840193505050503073ffffffffffffffffffffffffffffffffffffffff1663610b5925836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561022057600080fd5b505af1158015610234573d6000803e3d6000fd5b5050505061012b565b5050505050565b600080fd00a165627a7a723058207c5f557823bcf2be1858240c0c1037c633c0f0159752cd4b58f9f35c29ad604c0029",
|
|
"sourceMap": "245:1457:18:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;245:1457:18;;;;;;;",
|
|
"deployedSourceMap": "245:1457:18:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;815:885;;8:9:-1;5:2;;;30:1;27;20:12;5:2;815:885:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;405:81;;8:9:-1;5:2;;;30:1;27;20:12;5:2;405:81:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;815:885;907:14;945:13;968:9;924:4;:11;907:28;;980:1;968:13;;991:703;1002:6;998:1;:10;991:703;;;1170:1;1164:4;1160:12;1154:4;1150:23;1144:30;1230:1;1224:4;1220:12;1214:4;1210:23;1271:4;1265:11;1378:1;1371:4;1363:6;1344:17;1331:11;1317:12;1312:3;1299:77;1296:84;1293:2;;;1393:1;1390;1383:12;1293:2;1443:42;1434:6;1428:13;1424:62;1414:72;;1624:4;1617;1610;1591:17;1587:28;1583:39;1579:50;1573:4;1569:61;1566:1;1562:69;1557:74;;1101:544;;;1658:4;:17;;;1676:6;1658:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1658:25:18;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1658:25:18;;;;991:703;;;815:885;;;;;:::o;405:81::-;471:8;;",
|
|
"source": "pragma solidity 0.4.24;\nimport \"../Module.sol\";\n\n\n/// @title Create and Add Modules - Allows to create and add multiple module in one transaction.\n/// @author Stefan George - <stefan@gnosis.pm>\n/// @author Richard Meissner - <richard@gnosis.pm>\ncontract CreateAndAddModules {\n\n /// @dev Function required to compile contract. Gnosis Safe function is called instead.\n /// @param module Not used.\n function enableModule(Module module)\n public\n {\n revert();\n }\n\n /// @dev Allows to create and add multiple module in one transaction.\n /// @param proxyFactory Module proxy factory contract.\n /// @param data Modules constructor payload. This is the data for each proxy factory call concatinated. (e.g. <byte_array_len_1><byte_array_data_1><byte_array_len_2><byte_array_data_2>)\n function createAndAddModules(address proxyFactory, bytes data)\n public\n {\n uint256 length = data.length;\n Module module;\n uint256 i = 0;\n while (i < length) {\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n let createBytesLength := mload(add(0x20, add(data, i)))\n let createBytes := add(0x40, add(data, i))\n\n let output := mload(0x40)\n if eq(delegatecall(gas, proxyFactory, createBytes, createBytesLength, output, 0x20), 0) { revert(0, 0) }\n module := and(mload(output), 0xffffffffffffffffffffffffffffffffffffffff)\n\n // Data is always padded to 32 bytes\n i := add(i, add(0x20, mul(div(add(createBytesLength, 0x1f), 0x20), 0x20)))\n }\n this.enableModule(module);\n }\n }\n}\n",
|
|
"sourcePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/libraries/CreateAndAddModules.sol",
|
|
"ast": {
|
|
"absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/libraries/CreateAndAddModules.sol",
|
|
"exportedSymbols": {
|
|
"CreateAndAddModules": [
|
|
1866
|
|
]
|
|
},
|
|
"id": 1867,
|
|
"nodeType": "SourceUnit",
|
|
"nodes": [
|
|
{
|
|
"id": 1823,
|
|
"literals": [
|
|
"solidity",
|
|
"0.4",
|
|
".24"
|
|
],
|
|
"nodeType": "PragmaDirective",
|
|
"src": "0:23:18"
|
|
},
|
|
{
|
|
"absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/Module.sol",
|
|
"file": "../Module.sol",
|
|
"id": 1824,
|
|
"nodeType": "ImportDirective",
|
|
"scope": 1867,
|
|
"sourceUnit": 914,
|
|
"src": "24:23:18",
|
|
"symbolAliases": [],
|
|
"unitAlias": ""
|
|
},
|
|
{
|
|
"baseContracts": [],
|
|
"contractDependencies": [],
|
|
"contractKind": "contract",
|
|
"documentation": "@title Create and Add Modules - Allows to create and add multiple module in one transaction.\n @author Stefan George - <stefan@gnosis.pm>\n @author Richard Meissner - <richard@gnosis.pm>",
|
|
"fullyImplemented": true,
|
|
"id": 1866,
|
|
"linearizedBaseContracts": [
|
|
1866
|
|
],
|
|
"name": "CreateAndAddModules",
|
|
"nodeType": "ContractDefinition",
|
|
"nodes": [
|
|
{
|
|
"body": {
|
|
"id": 1832,
|
|
"nodeType": "Block",
|
|
"src": "461:25:18",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [],
|
|
"expression": {
|
|
"argumentTypes": [],
|
|
"id": 1829,
|
|
"name": "revert",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [
|
|
3833,
|
|
3834
|
|
],
|
|
"referencedDeclaration": 3833,
|
|
"src": "471:6:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
|
|
"typeString": "function () pure"
|
|
}
|
|
},
|
|
"id": 1830,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "471:8:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_tuple$__$",
|
|
"typeString": "tuple()"
|
|
}
|
|
},
|
|
"id": 1831,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "471:8:18"
|
|
}
|
|
]
|
|
},
|
|
"documentation": "@dev Function required to compile contract. Gnosis Safe function is called instead.\n @param module Not used.",
|
|
"id": 1833,
|
|
"implemented": true,
|
|
"isConstructor": false,
|
|
"isDeclaredConst": false,
|
|
"modifiers": [],
|
|
"name": "enableModule",
|
|
"nodeType": "FunctionDefinition",
|
|
"parameters": {
|
|
"id": 1827,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 1826,
|
|
"name": "module",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1833,
|
|
"src": "427:13:18",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$913",
|
|
"typeString": "contract Module"
|
|
},
|
|
"typeName": {
|
|
"contractScope": null,
|
|
"id": 1825,
|
|
"name": "Module",
|
|
"nodeType": "UserDefinedTypeName",
|
|
"referencedDeclaration": 913,
|
|
"src": "427:6:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$913",
|
|
"typeString": "contract Module"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "426:15:18"
|
|
},
|
|
"payable": false,
|
|
"returnParameters": {
|
|
"id": 1828,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [],
|
|
"src": "461:0:18"
|
|
},
|
|
"scope": 1866,
|
|
"src": "405:81:18",
|
|
"stateMutability": "nonpayable",
|
|
"superFunction": null,
|
|
"visibility": "public"
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 1864,
|
|
"nodeType": "Block",
|
|
"src": "897:803:18",
|
|
"statements": [
|
|
{
|
|
"assignments": [
|
|
1841
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 1841,
|
|
"name": "length",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1865,
|
|
"src": "907:14:18",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 1840,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "907:7:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 1844,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 1842,
|
|
"name": "data",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1837,
|
|
"src": "924:4:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bytes_memory_ptr",
|
|
"typeString": "bytes memory"
|
|
}
|
|
},
|
|
"id": 1843,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "length",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": null,
|
|
"src": "924:11:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "907:28:18"
|
|
},
|
|
{
|
|
"assignments": [],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 1846,
|
|
"name": "module",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1865,
|
|
"src": "945:13:18",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$913",
|
|
"typeString": "contract Module"
|
|
},
|
|
"typeName": {
|
|
"contractScope": null,
|
|
"id": 1845,
|
|
"name": "Module",
|
|
"nodeType": "UserDefinedTypeName",
|
|
"referencedDeclaration": 913,
|
|
"src": "945:6:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$913",
|
|
"typeString": "contract Module"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 1847,
|
|
"initialValue": null,
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "945:13:18"
|
|
},
|
|
{
|
|
"assignments": [
|
|
1849
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 1849,
|
|
"name": "i",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1865,
|
|
"src": "968:9:18",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 1848,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "968:7:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 1851,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"hexValue": "30",
|
|
"id": 1850,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "number",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "980:1:18",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_rational_0_by_1",
|
|
"typeString": "int_const 0"
|
|
},
|
|
"value": "0"
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "968:13:18"
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 1862,
|
|
"nodeType": "Block",
|
|
"src": "1010:684:18",
|
|
"statements": [
|
|
{
|
|
"externalReferences": [
|
|
{
|
|
"module": {
|
|
"declaration": 1846,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1414:6:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"data": {
|
|
"declaration": 1837,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1164:4:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1849,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1170:1:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"data": {
|
|
"declaration": 1837,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1224:4:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1849,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1230:1:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1849,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1557:1:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"proxyFactory": {
|
|
"declaration": 1835,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1317:12:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1849,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1566:1:18",
|
|
"valueSize": 1
|
|
}
|
|
}
|
|
],
|
|
"id": 1855,
|
|
"nodeType": "InlineAssembly",
|
|
"operations": "{\n let createBytesLength := mload(add(0x20, add(data, i)))\n let createBytes := add(0x40, add(data, i))\n let output := mload(0x40)\n if eq(delegatecall(gas(), proxyFactory, createBytes, createBytesLength, output, 0x20), 0)\n {\n revert(0, 0)\n }\n module := and(mload(output), 0xffffffffffffffffffffffffffffffffffffffff)\n i := add(i, add(0x20, mul(div(add(createBytesLength, 0x1f), 0x20), 0x20)))\n}",
|
|
"src": "1092:570:18"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 1859,
|
|
"name": "module",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1846,
|
|
"src": "1676:6:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$913",
|
|
"typeString": "contract Module"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_contract$_Module_$913",
|
|
"typeString": "contract Module"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 1856,
|
|
"name": "this",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 3877,
|
|
"src": "1658:4:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_CreateAndAddModules_$1866",
|
|
"typeString": "contract CreateAndAddModules"
|
|
}
|
|
},
|
|
"id": 1858,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "enableModule",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 1833,
|
|
"src": "1658:17:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_external_nonpayable$_t_contract$_Module_$913_$returns$__$",
|
|
"typeString": "function (contract Module) external"
|
|
}
|
|
},
|
|
"id": 1860,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1658:25:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_tuple$__$",
|
|
"typeString": "tuple()"
|
|
}
|
|
},
|
|
"id": 1861,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "1658:25:18"
|
|
}
|
|
]
|
|
},
|
|
"condition": {
|
|
"argumentTypes": null,
|
|
"commonType": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"id": 1854,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftExpression": {
|
|
"argumentTypes": null,
|
|
"id": 1852,
|
|
"name": "i",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1849,
|
|
"src": "998:1:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "BinaryOperation",
|
|
"operator": "<",
|
|
"rightExpression": {
|
|
"argumentTypes": null,
|
|
"id": 1853,
|
|
"name": "length",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1841,
|
|
"src": "1002:6:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "998:10:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"id": 1863,
|
|
"nodeType": "WhileStatement",
|
|
"src": "991:703:18"
|
|
}
|
|
]
|
|
},
|
|
"documentation": "@dev Allows to create and add multiple module in one transaction.\n @param proxyFactory Module proxy factory contract.\n @param data Modules constructor payload. This is the data for each proxy factory call concatinated. (e.g. <byte_array_len_1><byte_array_data_1><byte_array_len_2><byte_array_data_2>)",
|
|
"id": 1865,
|
|
"implemented": true,
|
|
"isConstructor": false,
|
|
"isDeclaredConst": false,
|
|
"modifiers": [],
|
|
"name": "createAndAddModules",
|
|
"nodeType": "FunctionDefinition",
|
|
"parameters": {
|
|
"id": 1838,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 1835,
|
|
"name": "proxyFactory",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1865,
|
|
"src": "844:20:18",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_address",
|
|
"typeString": "address"
|
|
},
|
|
"typeName": {
|
|
"id": 1834,
|
|
"name": "address",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "844:7:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_address",
|
|
"typeString": "address"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 1837,
|
|
"name": "data",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1865,
|
|
"src": "866:10:18",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bytes_memory_ptr",
|
|
"typeString": "bytes"
|
|
},
|
|
"typeName": {
|
|
"id": 1836,
|
|
"name": "bytes",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "866:5:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bytes_storage_ptr",
|
|
"typeString": "bytes"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "843:34:18"
|
|
},
|
|
"payable": false,
|
|
"returnParameters": {
|
|
"id": 1839,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [],
|
|
"src": "897:0:18"
|
|
},
|
|
"scope": 1866,
|
|
"src": "815:885:18",
|
|
"stateMutability": "nonpayable",
|
|
"superFunction": null,
|
|
"visibility": "public"
|
|
}
|
|
],
|
|
"scope": 1867,
|
|
"src": "245:1457:18"
|
|
}
|
|
],
|
|
"src": "0:1703:18"
|
|
},
|
|
"legacyAST": {
|
|
"absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/libraries/CreateAndAddModules.sol",
|
|
"exportedSymbols": {
|
|
"CreateAndAddModules": [
|
|
1866
|
|
]
|
|
},
|
|
"id": 1867,
|
|
"nodeType": "SourceUnit",
|
|
"nodes": [
|
|
{
|
|
"id": 1823,
|
|
"literals": [
|
|
"solidity",
|
|
"0.4",
|
|
".24"
|
|
],
|
|
"nodeType": "PragmaDirective",
|
|
"src": "0:23:18"
|
|
},
|
|
{
|
|
"absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/Module.sol",
|
|
"file": "../Module.sol",
|
|
"id": 1824,
|
|
"nodeType": "ImportDirective",
|
|
"scope": 1867,
|
|
"sourceUnit": 914,
|
|
"src": "24:23:18",
|
|
"symbolAliases": [],
|
|
"unitAlias": ""
|
|
},
|
|
{
|
|
"baseContracts": [],
|
|
"contractDependencies": [],
|
|
"contractKind": "contract",
|
|
"documentation": "@title Create and Add Modules - Allows to create and add multiple module in one transaction.\n @author Stefan George - <stefan@gnosis.pm>\n @author Richard Meissner - <richard@gnosis.pm>",
|
|
"fullyImplemented": true,
|
|
"id": 1866,
|
|
"linearizedBaseContracts": [
|
|
1866
|
|
],
|
|
"name": "CreateAndAddModules",
|
|
"nodeType": "ContractDefinition",
|
|
"nodes": [
|
|
{
|
|
"body": {
|
|
"id": 1832,
|
|
"nodeType": "Block",
|
|
"src": "461:25:18",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [],
|
|
"expression": {
|
|
"argumentTypes": [],
|
|
"id": 1829,
|
|
"name": "revert",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [
|
|
3833,
|
|
3834
|
|
],
|
|
"referencedDeclaration": 3833,
|
|
"src": "471:6:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
|
|
"typeString": "function () pure"
|
|
}
|
|
},
|
|
"id": 1830,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "471:8:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_tuple$__$",
|
|
"typeString": "tuple()"
|
|
}
|
|
},
|
|
"id": 1831,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "471:8:18"
|
|
}
|
|
]
|
|
},
|
|
"documentation": "@dev Function required to compile contract. Gnosis Safe function is called instead.\n @param module Not used.",
|
|
"id": 1833,
|
|
"implemented": true,
|
|
"isConstructor": false,
|
|
"isDeclaredConst": false,
|
|
"modifiers": [],
|
|
"name": "enableModule",
|
|
"nodeType": "FunctionDefinition",
|
|
"parameters": {
|
|
"id": 1827,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 1826,
|
|
"name": "module",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1833,
|
|
"src": "427:13:18",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$913",
|
|
"typeString": "contract Module"
|
|
},
|
|
"typeName": {
|
|
"contractScope": null,
|
|
"id": 1825,
|
|
"name": "Module",
|
|
"nodeType": "UserDefinedTypeName",
|
|
"referencedDeclaration": 913,
|
|
"src": "427:6:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$913",
|
|
"typeString": "contract Module"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "426:15:18"
|
|
},
|
|
"payable": false,
|
|
"returnParameters": {
|
|
"id": 1828,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [],
|
|
"src": "461:0:18"
|
|
},
|
|
"scope": 1866,
|
|
"src": "405:81:18",
|
|
"stateMutability": "nonpayable",
|
|
"superFunction": null,
|
|
"visibility": "public"
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 1864,
|
|
"nodeType": "Block",
|
|
"src": "897:803:18",
|
|
"statements": [
|
|
{
|
|
"assignments": [
|
|
1841
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 1841,
|
|
"name": "length",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1865,
|
|
"src": "907:14:18",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 1840,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "907:7:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 1844,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 1842,
|
|
"name": "data",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1837,
|
|
"src": "924:4:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bytes_memory_ptr",
|
|
"typeString": "bytes memory"
|
|
}
|
|
},
|
|
"id": 1843,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "length",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": null,
|
|
"src": "924:11:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "907:28:18"
|
|
},
|
|
{
|
|
"assignments": [],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 1846,
|
|
"name": "module",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1865,
|
|
"src": "945:13:18",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$913",
|
|
"typeString": "contract Module"
|
|
},
|
|
"typeName": {
|
|
"contractScope": null,
|
|
"id": 1845,
|
|
"name": "Module",
|
|
"nodeType": "UserDefinedTypeName",
|
|
"referencedDeclaration": 913,
|
|
"src": "945:6:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$913",
|
|
"typeString": "contract Module"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 1847,
|
|
"initialValue": null,
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "945:13:18"
|
|
},
|
|
{
|
|
"assignments": [
|
|
1849
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 1849,
|
|
"name": "i",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1865,
|
|
"src": "968:9:18",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 1848,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "968:7:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 1851,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"hexValue": "30",
|
|
"id": 1850,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "number",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "980:1:18",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_rational_0_by_1",
|
|
"typeString": "int_const 0"
|
|
},
|
|
"value": "0"
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "968:13:18"
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 1862,
|
|
"nodeType": "Block",
|
|
"src": "1010:684:18",
|
|
"statements": [
|
|
{
|
|
"externalReferences": [
|
|
{
|
|
"module": {
|
|
"declaration": 1846,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1414:6:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"data": {
|
|
"declaration": 1837,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1164:4:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1849,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1170:1:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"data": {
|
|
"declaration": 1837,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1224:4:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1849,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1230:1:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1849,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1557:1:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"proxyFactory": {
|
|
"declaration": 1835,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1317:12:18",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1849,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1566:1:18",
|
|
"valueSize": 1
|
|
}
|
|
}
|
|
],
|
|
"id": 1855,
|
|
"nodeType": "InlineAssembly",
|
|
"operations": "{\n let createBytesLength := mload(add(0x20, add(data, i)))\n let createBytes := add(0x40, add(data, i))\n let output := mload(0x40)\n if eq(delegatecall(gas(), proxyFactory, createBytes, createBytesLength, output, 0x20), 0)\n {\n revert(0, 0)\n }\n module := and(mload(output), 0xffffffffffffffffffffffffffffffffffffffff)\n i := add(i, add(0x20, mul(div(add(createBytesLength, 0x1f), 0x20), 0x20)))\n}",
|
|
"src": "1092:570:18"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 1859,
|
|
"name": "module",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1846,
|
|
"src": "1676:6:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$913",
|
|
"typeString": "contract Module"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_contract$_Module_$913",
|
|
"typeString": "contract Module"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 1856,
|
|
"name": "this",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 3877,
|
|
"src": "1658:4:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_CreateAndAddModules_$1866",
|
|
"typeString": "contract CreateAndAddModules"
|
|
}
|
|
},
|
|
"id": 1858,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "enableModule",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 1833,
|
|
"src": "1658:17:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_external_nonpayable$_t_contract$_Module_$913_$returns$__$",
|
|
"typeString": "function (contract Module) external"
|
|
}
|
|
},
|
|
"id": 1860,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1658:25:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_tuple$__$",
|
|
"typeString": "tuple()"
|
|
}
|
|
},
|
|
"id": 1861,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "1658:25:18"
|
|
}
|
|
]
|
|
},
|
|
"condition": {
|
|
"argumentTypes": null,
|
|
"commonType": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"id": 1854,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftExpression": {
|
|
"argumentTypes": null,
|
|
"id": 1852,
|
|
"name": "i",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1849,
|
|
"src": "998:1:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "BinaryOperation",
|
|
"operator": "<",
|
|
"rightExpression": {
|
|
"argumentTypes": null,
|
|
"id": 1853,
|
|
"name": "length",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1841,
|
|
"src": "1002:6:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "998:10:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"id": 1863,
|
|
"nodeType": "WhileStatement",
|
|
"src": "991:703:18"
|
|
}
|
|
]
|
|
},
|
|
"documentation": "@dev Allows to create and add multiple module in one transaction.\n @param proxyFactory Module proxy factory contract.\n @param data Modules constructor payload. This is the data for each proxy factory call concatinated. (e.g. <byte_array_len_1><byte_array_data_1><byte_array_len_2><byte_array_data_2>)",
|
|
"id": 1865,
|
|
"implemented": true,
|
|
"isConstructor": false,
|
|
"isDeclaredConst": false,
|
|
"modifiers": [],
|
|
"name": "createAndAddModules",
|
|
"nodeType": "FunctionDefinition",
|
|
"parameters": {
|
|
"id": 1838,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 1835,
|
|
"name": "proxyFactory",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1865,
|
|
"src": "844:20:18",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_address",
|
|
"typeString": "address"
|
|
},
|
|
"typeName": {
|
|
"id": 1834,
|
|
"name": "address",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "844:7:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_address",
|
|
"typeString": "address"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 1837,
|
|
"name": "data",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1865,
|
|
"src": "866:10:18",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bytes_memory_ptr",
|
|
"typeString": "bytes"
|
|
},
|
|
"typeName": {
|
|
"id": 1836,
|
|
"name": "bytes",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "866:5:18",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bytes_storage_ptr",
|
|
"typeString": "bytes"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "843:34:18"
|
|
},
|
|
"payable": false,
|
|
"returnParameters": {
|
|
"id": 1839,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [],
|
|
"src": "897:0:18"
|
|
},
|
|
"scope": 1866,
|
|
"src": "815:885:18",
|
|
"stateMutability": "nonpayable",
|
|
"superFunction": null,
|
|
"visibility": "public"
|
|
}
|
|
],
|
|
"scope": 1867,
|
|
"src": "245:1457:18"
|
|
}
|
|
],
|
|
"src": "0:1703:18"
|
|
},
|
|
"compiler": {
|
|
"name": "solc",
|
|
"version": "0.4.24+commit.e67f0147.Emscripten.clang"
|
|
},
|
|
"networks": {
|
|
"4": {
|
|
"events": {},
|
|
"links": {},
|
|
"address": "0x8d4852f62df9390e178e4ccc5267f82a4f3aa059",
|
|
"transactionHash": "0xd844d56b38ac9f9f6b9e767dbc441bbc3b6b0f4d3109c5428bc63001cbe64c5c"
|
|
},
|
|
"1534750848541": {
|
|
"events": {},
|
|
"links": {},
|
|
"address": "0x970e8f18ebfea0b08810f33a5a40438b9530fbcf",
|
|
"transactionHash": "0x81ed98a58ec6e7d31721cadae9205ef9d68cdb0ccf37e505fbcb154abc170b13"
|
|
}
|
|
},
|
|
"schemaVersion": "2.0.0",
|
|
"updatedAt": "2018-08-20T07:50:29.680Z"
|
|
} |