1271 lines
54 KiB
JSON
1271 lines
54 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": "0x608060405234801561001057600080fd5b50610275806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360df7f5814610051578063610b5925146100da575b600080fd5b34801561005d57600080fd5b506100d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061011d565b005b3480156100e657600080fd5b5061011b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610244565b005b600080600083519250600090505b8281101561023d5780840160200151818501604001604051600060208285858c5af4141561015857600080fd5b73ffffffffffffffffffffffffffffffffffffffff8151169450602080601f85010402602001840193505050503073ffffffffffffffffffffffffffffffffffffffff1663610b5925836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561022057600080fd5b505af1158015610234573d6000803e3d6000fd5b5050505061012b565b5050505050565b600080fd00a165627a7a72305820032b000033bdda6b988b435c96d1decf8e2f8e4da1b3a0b75e82e9e49c9c8dd10029",
|
|
"deployedBytecode": "0x60806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360df7f5814610051578063610b5925146100da575b600080fd5b34801561005d57600080fd5b506100d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061011d565b005b3480156100e657600080fd5b5061011b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610244565b005b600080600083519250600090505b8281101561023d5780840160200151818501604001604051600060208285858c5af4141561015857600080fd5b73ffffffffffffffffffffffffffffffffffffffff8151169450602080601f85010402602001840193505050503073ffffffffffffffffffffffffffffffffffffffff1663610b5925836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561022057600080fd5b505af1158015610234573d6000803e3d6000fd5b5050505061012b565b5050505050565b600080fd00a165627a7a72305820032b000033bdda6b988b435c96d1decf8e2f8e4da1b3a0b75e82e9e49c9c8dd10029",
|
|
"sourceMap": "250:1457:14:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;250:1457:14;;;;;;;",
|
|
"deployedSourceMap": "250:1457:14:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;820:885;;8:9:-1;5:2;;;30:1;27;20:12;5:2;820:885:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;410:81;;8:9:-1;5:2;;;30:1;27;20:12;5:2;410:81:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;820:885;912:14;950:13;973:9;929:4;:11;912:28;;985:1;973:13;;996:703;1007:6;1003:1;:10;996:703;;;1175:1;1169:4;1165:12;1159:4;1155:23;1149:30;1235:1;1229:4;1225:12;1219:4;1215:23;1276:4;1270:11;1383:1;1376:4;1368:6;1349:17;1336:11;1322:12;1317:3;1304:77;1301:84;1298:2;;;1398:1;1395;1388:12;1298:2;1448:42;1439:6;1433:13;1429:62;1419:72;;1629:4;1622;1615;1596:17;1592:28;1588:39;1584:50;1578:4;1574:61;1571:1;1567:69;1562:74;;1106:544;;;1663:4;:17;;;1681:6;1663:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1663:25:14;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1663:25:14;;;;996:703;;;820:885;;;;;:::o;410:81::-;476:8;;",
|
|
"source": "pragma solidity 0.4.24;\nimport \"../base/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": [
|
|
1848
|
|
]
|
|
},
|
|
"id": 1849,
|
|
"nodeType": "SourceUnit",
|
|
"nodes": [
|
|
{
|
|
"id": 1805,
|
|
"literals": [
|
|
"solidity",
|
|
"0.4",
|
|
".24"
|
|
],
|
|
"nodeType": "PragmaDirective",
|
|
"src": "0:23:14"
|
|
},
|
|
{
|
|
"absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/base/Module.sol",
|
|
"file": "../base/Module.sol",
|
|
"id": 1806,
|
|
"nodeType": "ImportDirective",
|
|
"scope": 1849,
|
|
"sourceUnit": 936,
|
|
"src": "24:28:14",
|
|
"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": 1848,
|
|
"linearizedBaseContracts": [
|
|
1848
|
|
],
|
|
"name": "CreateAndAddModules",
|
|
"nodeType": "ContractDefinition",
|
|
"nodes": [
|
|
{
|
|
"body": {
|
|
"id": 1814,
|
|
"nodeType": "Block",
|
|
"src": "466:25:14",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [],
|
|
"expression": {
|
|
"argumentTypes": [],
|
|
"id": 1811,
|
|
"name": "revert",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [
|
|
4020,
|
|
4021
|
|
],
|
|
"referencedDeclaration": 4020,
|
|
"src": "476:6:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
|
|
"typeString": "function () pure"
|
|
}
|
|
},
|
|
"id": 1812,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "476:8:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_tuple$__$",
|
|
"typeString": "tuple()"
|
|
}
|
|
},
|
|
"id": 1813,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "476:8:14"
|
|
}
|
|
]
|
|
},
|
|
"documentation": "@dev Function required to compile contract. Gnosis Safe function is called instead.\n @param module Not used.",
|
|
"id": 1815,
|
|
"implemented": true,
|
|
"isConstructor": false,
|
|
"isDeclaredConst": false,
|
|
"modifiers": [],
|
|
"name": "enableModule",
|
|
"nodeType": "FunctionDefinition",
|
|
"parameters": {
|
|
"id": 1809,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 1808,
|
|
"name": "module",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1815,
|
|
"src": "432:13:14",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$935",
|
|
"typeString": "contract Module"
|
|
},
|
|
"typeName": {
|
|
"contractScope": null,
|
|
"id": 1807,
|
|
"name": "Module",
|
|
"nodeType": "UserDefinedTypeName",
|
|
"referencedDeclaration": 935,
|
|
"src": "432:6:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$935",
|
|
"typeString": "contract Module"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "431:15:14"
|
|
},
|
|
"payable": false,
|
|
"returnParameters": {
|
|
"id": 1810,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [],
|
|
"src": "466:0:14"
|
|
},
|
|
"scope": 1848,
|
|
"src": "410:81:14",
|
|
"stateMutability": "nonpayable",
|
|
"superFunction": null,
|
|
"visibility": "public"
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 1846,
|
|
"nodeType": "Block",
|
|
"src": "902:803:14",
|
|
"statements": [
|
|
{
|
|
"assignments": [
|
|
1823
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 1823,
|
|
"name": "length",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1847,
|
|
"src": "912:14:14",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 1822,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "912:7:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 1826,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 1824,
|
|
"name": "data",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1819,
|
|
"src": "929:4:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bytes_memory_ptr",
|
|
"typeString": "bytes memory"
|
|
}
|
|
},
|
|
"id": 1825,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "length",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": null,
|
|
"src": "929:11:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "912:28:14"
|
|
},
|
|
{
|
|
"assignments": [],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 1828,
|
|
"name": "module",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1847,
|
|
"src": "950:13:14",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$935",
|
|
"typeString": "contract Module"
|
|
},
|
|
"typeName": {
|
|
"contractScope": null,
|
|
"id": 1827,
|
|
"name": "Module",
|
|
"nodeType": "UserDefinedTypeName",
|
|
"referencedDeclaration": 935,
|
|
"src": "950:6:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$935",
|
|
"typeString": "contract Module"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 1829,
|
|
"initialValue": null,
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "950:13:14"
|
|
},
|
|
{
|
|
"assignments": [
|
|
1831
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 1831,
|
|
"name": "i",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1847,
|
|
"src": "973:9:14",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 1830,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "973:7:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 1833,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"hexValue": "30",
|
|
"id": 1832,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "number",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "985:1:14",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_rational_0_by_1",
|
|
"typeString": "int_const 0"
|
|
},
|
|
"value": "0"
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "973:13:14"
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 1844,
|
|
"nodeType": "Block",
|
|
"src": "1015:684:14",
|
|
"statements": [
|
|
{
|
|
"externalReferences": [
|
|
{
|
|
"module": {
|
|
"declaration": 1828,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1419:6:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"data": {
|
|
"declaration": 1819,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1169:4:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1831,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1175:1:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"data": {
|
|
"declaration": 1819,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1229:4:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1831,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1235:1:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1831,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1562:1:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"proxyFactory": {
|
|
"declaration": 1817,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1322:12:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1831,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1571:1:14",
|
|
"valueSize": 1
|
|
}
|
|
}
|
|
],
|
|
"id": 1837,
|
|
"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": "1097:570:14"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 1841,
|
|
"name": "module",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1828,
|
|
"src": "1681:6:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$935",
|
|
"typeString": "contract Module"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_contract$_Module_$935",
|
|
"typeString": "contract Module"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 1838,
|
|
"name": "this",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 4056,
|
|
"src": "1663:4:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_CreateAndAddModules_$1848",
|
|
"typeString": "contract CreateAndAddModules"
|
|
}
|
|
},
|
|
"id": 1840,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "enableModule",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 1815,
|
|
"src": "1663:17:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_external_nonpayable$_t_contract$_Module_$935_$returns$__$",
|
|
"typeString": "function (contract Module) external"
|
|
}
|
|
},
|
|
"id": 1842,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1663:25:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_tuple$__$",
|
|
"typeString": "tuple()"
|
|
}
|
|
},
|
|
"id": 1843,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "1663:25:14"
|
|
}
|
|
]
|
|
},
|
|
"condition": {
|
|
"argumentTypes": null,
|
|
"commonType": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"id": 1836,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftExpression": {
|
|
"argumentTypes": null,
|
|
"id": 1834,
|
|
"name": "i",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1831,
|
|
"src": "1003:1:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "BinaryOperation",
|
|
"operator": "<",
|
|
"rightExpression": {
|
|
"argumentTypes": null,
|
|
"id": 1835,
|
|
"name": "length",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1823,
|
|
"src": "1007:6:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "1003:10:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"id": 1845,
|
|
"nodeType": "WhileStatement",
|
|
"src": "996:703:14"
|
|
}
|
|
]
|
|
},
|
|
"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": 1847,
|
|
"implemented": true,
|
|
"isConstructor": false,
|
|
"isDeclaredConst": false,
|
|
"modifiers": [],
|
|
"name": "createAndAddModules",
|
|
"nodeType": "FunctionDefinition",
|
|
"parameters": {
|
|
"id": 1820,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 1817,
|
|
"name": "proxyFactory",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1847,
|
|
"src": "849:20:14",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_address",
|
|
"typeString": "address"
|
|
},
|
|
"typeName": {
|
|
"id": 1816,
|
|
"name": "address",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "849:7:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_address",
|
|
"typeString": "address"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 1819,
|
|
"name": "data",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1847,
|
|
"src": "871:10:14",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bytes_memory_ptr",
|
|
"typeString": "bytes"
|
|
},
|
|
"typeName": {
|
|
"id": 1818,
|
|
"name": "bytes",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "871:5:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bytes_storage_ptr",
|
|
"typeString": "bytes"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "848:34:14"
|
|
},
|
|
"payable": false,
|
|
"returnParameters": {
|
|
"id": 1821,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [],
|
|
"src": "902:0:14"
|
|
},
|
|
"scope": 1848,
|
|
"src": "820:885:14",
|
|
"stateMutability": "nonpayable",
|
|
"superFunction": null,
|
|
"visibility": "public"
|
|
}
|
|
],
|
|
"scope": 1849,
|
|
"src": "250:1457:14"
|
|
}
|
|
],
|
|
"src": "0:1708:14"
|
|
},
|
|
"legacyAST": {
|
|
"absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/libraries/CreateAndAddModules.sol",
|
|
"exportedSymbols": {
|
|
"CreateAndAddModules": [
|
|
1848
|
|
]
|
|
},
|
|
"id": 1849,
|
|
"nodeType": "SourceUnit",
|
|
"nodes": [
|
|
{
|
|
"id": 1805,
|
|
"literals": [
|
|
"solidity",
|
|
"0.4",
|
|
".24"
|
|
],
|
|
"nodeType": "PragmaDirective",
|
|
"src": "0:23:14"
|
|
},
|
|
{
|
|
"absolutePath": "/Users/apanizo/git/gnosis/safe-contracts/contracts/base/Module.sol",
|
|
"file": "../base/Module.sol",
|
|
"id": 1806,
|
|
"nodeType": "ImportDirective",
|
|
"scope": 1849,
|
|
"sourceUnit": 936,
|
|
"src": "24:28:14",
|
|
"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": 1848,
|
|
"linearizedBaseContracts": [
|
|
1848
|
|
],
|
|
"name": "CreateAndAddModules",
|
|
"nodeType": "ContractDefinition",
|
|
"nodes": [
|
|
{
|
|
"body": {
|
|
"id": 1814,
|
|
"nodeType": "Block",
|
|
"src": "466:25:14",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [],
|
|
"expression": {
|
|
"argumentTypes": [],
|
|
"id": 1811,
|
|
"name": "revert",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [
|
|
4020,
|
|
4021
|
|
],
|
|
"referencedDeclaration": 4020,
|
|
"src": "476:6:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
|
|
"typeString": "function () pure"
|
|
}
|
|
},
|
|
"id": 1812,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "476:8:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_tuple$__$",
|
|
"typeString": "tuple()"
|
|
}
|
|
},
|
|
"id": 1813,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "476:8:14"
|
|
}
|
|
]
|
|
},
|
|
"documentation": "@dev Function required to compile contract. Gnosis Safe function is called instead.\n @param module Not used.",
|
|
"id": 1815,
|
|
"implemented": true,
|
|
"isConstructor": false,
|
|
"isDeclaredConst": false,
|
|
"modifiers": [],
|
|
"name": "enableModule",
|
|
"nodeType": "FunctionDefinition",
|
|
"parameters": {
|
|
"id": 1809,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 1808,
|
|
"name": "module",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1815,
|
|
"src": "432:13:14",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$935",
|
|
"typeString": "contract Module"
|
|
},
|
|
"typeName": {
|
|
"contractScope": null,
|
|
"id": 1807,
|
|
"name": "Module",
|
|
"nodeType": "UserDefinedTypeName",
|
|
"referencedDeclaration": 935,
|
|
"src": "432:6:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$935",
|
|
"typeString": "contract Module"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "431:15:14"
|
|
},
|
|
"payable": false,
|
|
"returnParameters": {
|
|
"id": 1810,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [],
|
|
"src": "466:0:14"
|
|
},
|
|
"scope": 1848,
|
|
"src": "410:81:14",
|
|
"stateMutability": "nonpayable",
|
|
"superFunction": null,
|
|
"visibility": "public"
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 1846,
|
|
"nodeType": "Block",
|
|
"src": "902:803:14",
|
|
"statements": [
|
|
{
|
|
"assignments": [
|
|
1823
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 1823,
|
|
"name": "length",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1847,
|
|
"src": "912:14:14",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 1822,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "912:7:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 1826,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 1824,
|
|
"name": "data",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1819,
|
|
"src": "929:4:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bytes_memory_ptr",
|
|
"typeString": "bytes memory"
|
|
}
|
|
},
|
|
"id": 1825,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "length",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": null,
|
|
"src": "929:11:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "912:28:14"
|
|
},
|
|
{
|
|
"assignments": [],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 1828,
|
|
"name": "module",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1847,
|
|
"src": "950:13:14",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$935",
|
|
"typeString": "contract Module"
|
|
},
|
|
"typeName": {
|
|
"contractScope": null,
|
|
"id": 1827,
|
|
"name": "Module",
|
|
"nodeType": "UserDefinedTypeName",
|
|
"referencedDeclaration": 935,
|
|
"src": "950:6:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$935",
|
|
"typeString": "contract Module"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 1829,
|
|
"initialValue": null,
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "950:13:14"
|
|
},
|
|
{
|
|
"assignments": [
|
|
1831
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 1831,
|
|
"name": "i",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1847,
|
|
"src": "973:9:14",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 1830,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "973:7:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 1833,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"hexValue": "30",
|
|
"id": 1832,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "number",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "985:1:14",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_rational_0_by_1",
|
|
"typeString": "int_const 0"
|
|
},
|
|
"value": "0"
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "973:13:14"
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 1844,
|
|
"nodeType": "Block",
|
|
"src": "1015:684:14",
|
|
"statements": [
|
|
{
|
|
"externalReferences": [
|
|
{
|
|
"module": {
|
|
"declaration": 1828,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1419:6:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"data": {
|
|
"declaration": 1819,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1169:4:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1831,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1175:1:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"data": {
|
|
"declaration": 1819,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1229:4:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1831,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1235:1:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1831,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1562:1:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"proxyFactory": {
|
|
"declaration": 1817,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1322:12:14",
|
|
"valueSize": 1
|
|
}
|
|
},
|
|
{
|
|
"i": {
|
|
"declaration": 1831,
|
|
"isOffset": false,
|
|
"isSlot": false,
|
|
"src": "1571:1:14",
|
|
"valueSize": 1
|
|
}
|
|
}
|
|
],
|
|
"id": 1837,
|
|
"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": "1097:570:14"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 1841,
|
|
"name": "module",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1828,
|
|
"src": "1681:6:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_Module_$935",
|
|
"typeString": "contract Module"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_contract$_Module_$935",
|
|
"typeString": "contract Module"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 1838,
|
|
"name": "this",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 4056,
|
|
"src": "1663:4:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_CreateAndAddModules_$1848",
|
|
"typeString": "contract CreateAndAddModules"
|
|
}
|
|
},
|
|
"id": 1840,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "enableModule",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 1815,
|
|
"src": "1663:17:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_external_nonpayable$_t_contract$_Module_$935_$returns$__$",
|
|
"typeString": "function (contract Module) external"
|
|
}
|
|
},
|
|
"id": 1842,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1663:25:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_tuple$__$",
|
|
"typeString": "tuple()"
|
|
}
|
|
},
|
|
"id": 1843,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "1663:25:14"
|
|
}
|
|
]
|
|
},
|
|
"condition": {
|
|
"argumentTypes": null,
|
|
"commonType": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"id": 1836,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftExpression": {
|
|
"argumentTypes": null,
|
|
"id": 1834,
|
|
"name": "i",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1831,
|
|
"src": "1003:1:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "BinaryOperation",
|
|
"operator": "<",
|
|
"rightExpression": {
|
|
"argumentTypes": null,
|
|
"id": 1835,
|
|
"name": "length",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 1823,
|
|
"src": "1007:6:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "1003:10:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"id": 1845,
|
|
"nodeType": "WhileStatement",
|
|
"src": "996:703:14"
|
|
}
|
|
]
|
|
},
|
|
"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": 1847,
|
|
"implemented": true,
|
|
"isConstructor": false,
|
|
"isDeclaredConst": false,
|
|
"modifiers": [],
|
|
"name": "createAndAddModules",
|
|
"nodeType": "FunctionDefinition",
|
|
"parameters": {
|
|
"id": 1820,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 1817,
|
|
"name": "proxyFactory",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1847,
|
|
"src": "849:20:14",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_address",
|
|
"typeString": "address"
|
|
},
|
|
"typeName": {
|
|
"id": 1816,
|
|
"name": "address",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "849:7:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_address",
|
|
"typeString": "address"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 1819,
|
|
"name": "data",
|
|
"nodeType": "VariableDeclaration",
|
|
"scope": 1847,
|
|
"src": "871:10:14",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bytes_memory_ptr",
|
|
"typeString": "bytes"
|
|
},
|
|
"typeName": {
|
|
"id": 1818,
|
|
"name": "bytes",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "871:5:14",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bytes_storage_ptr",
|
|
"typeString": "bytes"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "848:34:14"
|
|
},
|
|
"payable": false,
|
|
"returnParameters": {
|
|
"id": 1821,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [],
|
|
"src": "902:0:14"
|
|
},
|
|
"scope": 1848,
|
|
"src": "820:885:14",
|
|
"stateMutability": "nonpayable",
|
|
"superFunction": null,
|
|
"visibility": "public"
|
|
}
|
|
],
|
|
"scope": 1849,
|
|
"src": "250:1457:14"
|
|
}
|
|
],
|
|
"src": "0:1708:14"
|
|
},
|
|
"compiler": {
|
|
"name": "solc",
|
|
"version": "0.4.24+commit.e67f0147.Emscripten.clang"
|
|
},
|
|
"networks": {
|
|
"4": {
|
|
"events": {},
|
|
"links": {},
|
|
"address": "0xdf596548e089729535b171d13dec6e510cd22de4",
|
|
"transactionHash": "0x8da8ec46f7fd0935a74170caa40eaf18b29e88607b21273c232a09b7a7251d34"
|
|
},
|
|
"1538739975997": {
|
|
"events": {},
|
|
"links": {},
|
|
"address": "0xa57b8a5584442b467b4689f1144d269d096a3daf",
|
|
"transactionHash": "0xbab48fcde913e539ed8f71571e7f0abe2507e0322c9dda28780e5227e7d31d30"
|
|
}
|
|
},
|
|
"schemaVersion": "2.0.0",
|
|
"updatedAt": "2018-10-05T14:43:41.423Z"
|
|
} |