{
  "contractName": "DelegateScriptTarget",
  "abi": [
    {
      "constant": false,
      "inputs": [],
      "name": "exec",
      "outputs": [],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    }
  ],
  "bytecode": "0x",
  "deployedBytecode": "0x",
  "sourceMap": "",
  "deployedSourceMap": "",
  "source": "pragma solidity 0.4.18;\n\nimport \"../ScriptHelpers.sol\";\nimport \"../IEVMScriptExecutor.sol\";\n\n\ninterface DelegateScriptTarget {\n    function exec() public;\n}\n\n\ncontract DelegateScript is IEVMScriptExecutor {\n    using ScriptHelpers for *;\n\n    uint256 constant internal SCRIPT_START_LOCATION = 4;\n\n    /**\n    * @notice Executes script by delegatecall into a contract\n    * @param _script [ specId (uint32) ][ contract address (20 bytes) ]\n    * @param _input ABI encoded call to be made to contract (if empty executes default exec() function)\n    * @param _blacklist If any address is passed, will revert.\n    * @return Call return data\n    */\n    function execScript(bytes _script, bytes _input, address[] _blacklist) external returns (bytes) {\n        require(_blacklist.length == 0); // dont have ability to control bans, so fail.\n\n        // Script should be spec id + address (20 bytes)\n        require(_script.length == SCRIPT_START_LOCATION + 20);\n        return delegate(_script.addressAt(SCRIPT_START_LOCATION), _input);\n    }\n\n    /**\n    * @dev Delegatecall to contract with input data\n    */\n    function delegate(address _addr, bytes memory _input) internal returns (bytes memory output) {\n        require(isContract(_addr));\n        require(_addr.delegatecall(_input.length > 0 ? _input : defaultInput()));\n        return returnedData();\n    }\n\n    function isContract(address _target) internal view returns (bool) {\n        uint256 size;\n        assembly { size := extcodesize(_target) }\n        return size > 0;\n    }\n\n    function defaultInput() internal pure returns (bytes) {\n        return DelegateScriptTarget(0).exec.selector.toBytes();\n    }\n\n    /**\n    * @dev copies and returns last's call data\n    */\n    function returnedData() internal view returns (bytes ret) {\n        assembly {\n            let size := returndatasize\n            ret := mload(0x40) // free mem ptr get\n            mstore(0x40, add(ret, add(size, 0x20))) // free mem ptr set\n            mstore(ret, size) // set array length\n            returndatacopy(add(ret, 0x20), 0, size) // copy return data\n        }\n        return ret;\n    }\n}",
  "sourcePath": "@aragon/os/contracts/evmscript/executors/DelegateScript.sol",
  "ast": {
    "attributes": {
      "absolutePath": "@aragon/os/contracts/evmscript/executors/DelegateScript.sol",
      "exportedSymbols": {
        "DelegateScript": [
          8506
        ],
        "DelegateScriptTarget": [
          8389
        ]
      }
    },
    "children": [
      {
        "attributes": {
          "literals": [
            "solidity",
            "0.4",
            ".18"
          ]
        },
        "id": 8383,
        "name": "PragmaDirective",
        "src": "0:23:34"
      },
      {
        "attributes": {
          "SourceUnit": 8269,
          "absolutePath": "@aragon/os/contracts/evmscript/ScriptHelpers.sol",
          "file": "../ScriptHelpers.sol",
          "scope": 8507,
          "symbolAliases": [
            null
          ],
          "unitAlias": ""
        },
        "id": 8384,
        "name": "ImportDirective",
        "src": "25:30:34"
      },
      {
        "attributes": {
          "SourceUnit": 7862,
          "absolutePath": "@aragon/os/contracts/evmscript/IEVMScriptExecutor.sol",
          "file": "../IEVMScriptExecutor.sol",
          "scope": 8507,
          "symbolAliases": [
            null
          ],
          "unitAlias": ""
        },
        "id": 8385,
        "name": "ImportDirective",
        "src": "56:35:34"
      },
      {
        "attributes": {
          "baseContracts": [
            null
          ],
          "contractDependencies": [
            null
          ],
          "contractKind": "interface",
          "documentation": null,
          "fullyImplemented": false,
          "linearizedBaseContracts": [
            8389
          ],
          "name": "DelegateScriptTarget",
          "scope": 8507
        },
        "children": [
          {
            "attributes": {
              "body": null,
              "constant": false,
              "implemented": false,
              "isConstructor": false,
              "modifiers": [
                null
              ],
              "name": "exec",
              "payable": false,
              "scope": 8389,
              "stateMutability": "nonpayable",
              "superFunction": null,
              "visibility": "public"
            },
            "children": [
              {
                "attributes": {
                  "parameters": [
                    null
                  ]
                },
                "children": [],
                "id": 8386,
                "name": "ParameterList",
                "src": "144:2:34"
              },
              {
                "attributes": {
                  "parameters": [
                    null
                  ]
                },
                "children": [],
                "id": 8387,
                "name": "ParameterList",
                "src": "153:0:34"
              }
            ],
            "id": 8388,
            "name": "FunctionDefinition",
            "src": "131:23:34"
          }
        ],
        "id": 8389,
        "name": "ContractDefinition",
        "src": "94:62:34"
      },
      {
        "attributes": {
          "contractDependencies": [
            7861
          ],
          "contractKind": "contract",
          "documentation": null,
          "fullyImplemented": true,
          "linearizedBaseContracts": [
            8506,
            7861
          ],
          "name": "DelegateScript",
          "scope": 8507
        },
        "children": [
          {
            "attributes": {
              "arguments": [
                null
              ]
            },
            "children": [
              {
                "attributes": {
                  "contractScope": null,
                  "name": "IEVMScriptExecutor",
                  "referencedDeclaration": 7861,
                  "type": "contract IEVMScriptExecutor"
                },
                "id": 8390,
                "name": "UserDefinedTypeName",
                "src": "186:18:34"
              }
            ],
            "id": 8391,
            "name": "InheritanceSpecifier",
            "src": "186:18:34"
          },
          {
            "attributes": {
              "typeName": null
            },
            "children": [
              {
                "attributes": {
                  "contractScope": null,
                  "name": "ScriptHelpers",
                  "referencedDeclaration": 8268,
                  "type": "library ScriptHelpers"
                },
                "id": 8392,
                "name": "UserDefinedTypeName",
                "src": "217:13:34"
              }
            ],
            "id": 8393,
            "name": "UsingForDirective",
            "src": "211:26:34"
          },
          {
            "attributes": {
              "constant": true,
              "name": "SCRIPT_START_LOCATION",
              "scope": 8506,
              "stateVariable": true,
              "storageLocation": "default",
              "type": "uint256",
              "visibility": "internal"
            },
            "children": [
              {
                "attributes": {
                  "name": "uint256",
                  "type": "uint256"
                },
                "id": 8394,
                "name": "ElementaryTypeName",
                "src": "243:7:34"
              },
              {
                "attributes": {
                  "argumentTypes": null,
                  "hexvalue": "34",
                  "isConstant": false,
                  "isLValue": false,
                  "isPure": true,
                  "lValueRequested": false,
                  "subdenomination": null,
                  "token": "number",
                  "type": "int_const 4",
                  "value": "4"
                },
                "id": 8395,
                "name": "Literal",
                "src": "293:1:34"
              }
            ],
            "id": 8396,
            "name": "VariableDeclaration",
            "src": "243:51:34"
          },
          {
            "attributes": {
              "constant": false,
              "implemented": true,
              "isConstructor": false,
              "modifiers": [
                null
              ],
              "name": "execScript",
              "payable": false,
              "scope": 8506,
              "stateMutability": "nonpayable",
              "superFunction": 7860,
              "visibility": "external"
            },
            "children": [
              {
                "children": [
                  {
                    "attributes": {
                      "constant": false,
                      "name": "_script",
                      "scope": 8433,
                      "stateVariable": false,
                      "storageLocation": "default",
                      "type": "bytes calldata",
                      "value": null,
                      "visibility": "internal"
                    },
                    "children": [
                      {
                        "attributes": {
                          "name": "bytes",
                          "type": "bytes storage pointer"
                        },
                        "id": 8397,
                        "name": "ElementaryTypeName",
                        "src": "668:5:34"
                      }
                    ],
                    "id": 8398,
                    "name": "VariableDeclaration",
                    "src": "668:13:34"
                  },
                  {
                    "attributes": {
                      "constant": false,
                      "name": "_input",
                      "scope": 8433,
                      "stateVariable": false,
                      "storageLocation": "default",
                      "type": "bytes calldata",
                      "value": null,
                      "visibility": "internal"
                    },
                    "children": [
                      {
                        "attributes": {
                          "name": "bytes",
                          "type": "bytes storage pointer"
                        },
                        "id": 8399,
                        "name": "ElementaryTypeName",
                        "src": "683:5:34"
                      }
                    ],
                    "id": 8400,
                    "name": "VariableDeclaration",
                    "src": "683:12:34"
                  },
                  {
                    "attributes": {
                      "constant": false,
                      "name": "_blacklist",
                      "scope": 8433,
                      "stateVariable": false,
                      "storageLocation": "default",
                      "type": "address[] calldata",
                      "value": null,
                      "visibility": "internal"
                    },
                    "children": [
                      {
                        "attributes": {
                          "length": null,
                          "type": "address[] storage pointer"
                        },
                        "children": [
                          {
                            "attributes": {
                              "name": "address",
                              "type": "address"
                            },
                            "id": 8401,
                            "name": "ElementaryTypeName",
                            "src": "697:7:34"
                          }
                        ],
                        "id": 8402,
                        "name": "ArrayTypeName",
                        "src": "697:9:34"
                      }
                    ],
                    "id": 8403,
                    "name": "VariableDeclaration",
                    "src": "697:20:34"
                  }
                ],
                "id": 8404,
                "name": "ParameterList",
                "src": "667:51:34"
              },
              {
                "children": [
                  {
                    "attributes": {
                      "constant": false,
                      "name": "",
                      "scope": 8433,
                      "stateVariable": false,
                      "storageLocation": "default",
                      "type": "bytes memory",
                      "value": null,
                      "visibility": "internal"
                    },
                    "children": [
                      {
                        "attributes": {
                          "name": "bytes",
                          "type": "bytes storage pointer"
                        },
                        "id": 8405,
                        "name": "ElementaryTypeName",
                        "src": "737:5:34"
                      }
                    ],
                    "id": 8406,
                    "name": "VariableDeclaration",
                    "src": "737:5:34"
                  }
                ],
                "id": 8407,
                "name": "ParameterList",
                "src": "736:7:34"
              },
              {
                "children": [
                  {
                    "children": [
                      {
                        "attributes": {
                          "argumentTypes": null,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "isStructConstructorCall": false,
                          "lValueRequested": false,
                          "names": [
                            null
                          ],
                          "type": "tuple()",
                          "type_conversion": false
                        },
                        "children": [
                          {
                            "attributes": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_bool",
                                  "typeString": "bool"
                                }
                              ],
                              "overloadedDeclarations": [
                                null
                              ],
                              "referencedDeclaration": 12593,
                              "type": "function (bool) pure",
                              "value": "require"
                            },
                            "id": 8408,
                            "name": "Identifier",
                            "src": "754:7:34"
                          },
                          {
                            "attributes": {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "operator": "==",
                              "type": "bool"
                            },
                            "children": [
                              {
                                "attributes": {
                                  "argumentTypes": null,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "member_name": "length",
                                  "referencedDeclaration": null,
                                  "type": "uint256"
                                },
                                "children": [
                                  {
                                    "attributes": {
                                      "argumentTypes": null,
                                      "overloadedDeclarations": [
                                        null
                                      ],
                                      "referencedDeclaration": 8403,
                                      "type": "address[] calldata",
                                      "value": "_blacklist"
                                    },
                                    "id": 8409,
                                    "name": "Identifier",
                                    "src": "762:10:34"
                                  }
                                ],
                                "id": 8410,
                                "name": "MemberAccess",
                                "src": "762:17:34"
                              },
                              {
                                "attributes": {
                                  "argumentTypes": null,
                                  "hexvalue": "30",
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": true,
                                  "lValueRequested": false,
                                  "subdenomination": null,
                                  "token": "number",
                                  "type": "int_const 0",
                                  "value": "0"
                                },
                                "id": 8411,
                                "name": "Literal",
                                "src": "783:1:34"
                              }
                            ],
                            "id": 8412,
                            "name": "BinaryOperation",
                            "src": "762:22:34"
                          }
                        ],
                        "id": 8413,
                        "name": "FunctionCall",
                        "src": "754:31:34"
                      }
                    ],
                    "id": 8414,
                    "name": "ExpressionStatement",
                    "src": "754:31:34"
                  },
                  {
                    "children": [
                      {
                        "attributes": {
                          "argumentTypes": null,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "isStructConstructorCall": false,
                          "lValueRequested": false,
                          "names": [
                            null
                          ],
                          "type": "tuple()",
                          "type_conversion": false
                        },
                        "children": [
                          {
                            "attributes": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_bool",
                                  "typeString": "bool"
                                }
                              ],
                              "overloadedDeclarations": [
                                null
                              ],
                              "referencedDeclaration": 12593,
                              "type": "function (bool) pure",
                              "value": "require"
                            },
                            "id": 8415,
                            "name": "Identifier",
                            "src": "900:7:34"
                          },
                          {
                            "attributes": {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "operator": "==",
                              "type": "bool"
                            },
                            "children": [
                              {
                                "attributes": {
                                  "argumentTypes": null,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "member_name": "length",
                                  "referencedDeclaration": null,
                                  "type": "uint256"
                                },
                                "children": [
                                  {
                                    "attributes": {
                                      "argumentTypes": null,
                                      "overloadedDeclarations": [
                                        null
                                      ],
                                      "referencedDeclaration": 8398,
                                      "type": "bytes calldata",
                                      "value": "_script"
                                    },
                                    "id": 8416,
                                    "name": "Identifier",
                                    "src": "908:7:34"
                                  }
                                ],
                                "id": 8417,
                                "name": "MemberAccess",
                                "src": "908:14:34"
                              },
                              {
                                "attributes": {
                                  "argumentTypes": null,
                                  "commonType": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  },
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": true,
                                  "lValueRequested": false,
                                  "operator": "+",
                                  "type": "uint256"
                                },
                                "children": [
                                  {
                                    "attributes": {
                                      "argumentTypes": null,
                                      "overloadedDeclarations": [
                                        null
                                      ],
                                      "referencedDeclaration": 8396,
                                      "type": "uint256",
                                      "value": "SCRIPT_START_LOCATION"
                                    },
                                    "id": 8418,
                                    "name": "Identifier",
                                    "src": "926:21:34"
                                  },
                                  {
                                    "attributes": {
                                      "argumentTypes": null,
                                      "hexvalue": "3230",
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": true,
                                      "lValueRequested": false,
                                      "subdenomination": null,
                                      "token": "number",
                                      "type": "int_const 20",
                                      "value": "20"
                                    },
                                    "id": 8419,
                                    "name": "Literal",
                                    "src": "950:2:34"
                                  }
                                ],
                                "id": 8420,
                                "name": "BinaryOperation",
                                "src": "926:26:34"
                              }
                            ],
                            "id": 8421,
                            "name": "BinaryOperation",
                            "src": "908:44:34"
                          }
                        ],
                        "id": 8422,
                        "name": "FunctionCall",
                        "src": "900:53:34"
                      }
                    ],
                    "id": 8423,
                    "name": "ExpressionStatement",
                    "src": "900:53:34"
                  },
                  {
                    "attributes": {
                      "functionReturnParameters": 8407
                    },
                    "children": [
                      {
                        "attributes": {
                          "argumentTypes": null,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "isStructConstructorCall": false,
                          "lValueRequested": false,
                          "names": [
                            null
                          ],
                          "type": "bytes memory",
                          "type_conversion": false
                        },
                        "children": [
                          {
                            "attributes": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_address",
                                  "typeString": "address"
                                },
                                {
                                  "typeIdentifier": "t_bytes_calldata_ptr",
                                  "typeString": "bytes calldata"
                                }
                              ],
                              "overloadedDeclarations": [
                                null
                              ],
                              "referencedDeclaration": 8466,
                              "type": "function (address,bytes memory) returns (bytes memory)",
                              "value": "delegate"
                            },
                            "id": 8424,
                            "name": "Identifier",
                            "src": "970:8:34"
                          },
                          {
                            "attributes": {
                              "argumentTypes": null,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "isStructConstructorCall": false,
                              "lValueRequested": false,
                              "names": [
                                null
                              ],
                              "type": "address",
                              "type_conversion": false
                            },
                            "children": [
                              {
                                "attributes": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "member_name": "addressAt",
                                  "referencedDeclaration": 8131,
                                  "type": "function (bytes memory,uint256) pure returns (address)"
                                },
                                "children": [
                                  {
                                    "attributes": {
                                      "argumentTypes": null,
                                      "overloadedDeclarations": [
                                        null
                                      ],
                                      "referencedDeclaration": 8398,
                                      "type": "bytes calldata",
                                      "value": "_script"
                                    },
                                    "id": 8425,
                                    "name": "Identifier",
                                    "src": "979:7:34"
                                  }
                                ],
                                "id": 8426,
                                "name": "MemberAccess",
                                "src": "979:17:34"
                              },
                              {
                                "attributes": {
                                  "argumentTypes": null,
                                  "overloadedDeclarations": [
                                    null
                                  ],
                                  "referencedDeclaration": 8396,
                                  "type": "uint256",
                                  "value": "SCRIPT_START_LOCATION"
                                },
                                "id": 8427,
                                "name": "Identifier",
                                "src": "997:21:34"
                              }
                            ],
                            "id": 8428,
                            "name": "FunctionCall",
                            "src": "979:40:34"
                          },
                          {
                            "attributes": {
                              "argumentTypes": null,
                              "overloadedDeclarations": [
                                null
                              ],
                              "referencedDeclaration": 8400,
                              "type": "bytes calldata",
                              "value": "_input"
                            },
                            "id": 8429,
                            "name": "Identifier",
                            "src": "1021:6:34"
                          }
                        ],
                        "id": 8430,
                        "name": "FunctionCall",
                        "src": "970:58:34"
                      }
                    ],
                    "id": 8431,
                    "name": "Return",
                    "src": "963:65:34"
                  }
                ],
                "id": 8432,
                "name": "Block",
                "src": "744:291:34"
              }
            ],
            "id": 8433,
            "name": "FunctionDefinition",
            "src": "648:387:34"
          },
          {
            "attributes": {
              "constant": false,
              "implemented": true,
              "isConstructor": false,
              "modifiers": [
                null
              ],
              "name": "delegate",
              "payable": false,
              "scope": 8506,
              "stateMutability": "nonpayable",
              "superFunction": null,
              "visibility": "internal"
            },
            "children": [
              {
                "children": [
                  {
                    "attributes": {
                      "constant": false,
                      "name": "_addr",
                      "scope": 8466,
                      "stateVariable": false,
                      "storageLocation": "default",
                      "type": "address",
                      "value": null,
                      "visibility": "internal"
                    },
                    "children": [
                      {
                        "attributes": {
                          "name": "address",
                          "type": "address"
                        },
                        "id": 8434,
                        "name": "ElementaryTypeName",
                        "src": "1126:7:34"
                      }
                    ],
                    "id": 8435,
                    "name": "VariableDeclaration",
                    "src": "1126:13:34"
                  },
                  {
                    "attributes": {
                      "constant": false,
                      "name": "_input",
                      "scope": 8466,
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "type": "bytes memory",
                      "value": null,
                      "visibility": "internal"
                    },
                    "children": [
                      {
                        "attributes": {
                          "name": "bytes",
                          "type": "bytes storage pointer"
                        },
                        "id": 8436,
                        "name": "ElementaryTypeName",
                        "src": "1141:5:34"
                      }
                    ],
                    "id": 8437,
                    "name": "VariableDeclaration",
                    "src": "1141:19:34"
                  }
                ],
                "id": 8438,
                "name": "ParameterList",
                "src": "1125:36:34"
              },
              {
                "children": [
                  {
                    "attributes": {
                      "constant": false,
                      "name": "output",
                      "scope": 8466,
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "type": "bytes memory",
                      "value": null,
                      "visibility": "internal"
                    },
                    "children": [
                      {
                        "attributes": {
                          "name": "bytes",
                          "type": "bytes storage pointer"
                        },
                        "id": 8439,
                        "name": "ElementaryTypeName",
                        "src": "1180:5:34"
                      }
                    ],
                    "id": 8440,
                    "name": "VariableDeclaration",
                    "src": "1180:19:34"
                  }
                ],
                "id": 8441,
                "name": "ParameterList",
                "src": "1179:21:34"
              },
              {
                "children": [
                  {
                    "children": [
                      {
                        "attributes": {
                          "argumentTypes": null,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "isStructConstructorCall": false,
                          "lValueRequested": false,
                          "names": [
                            null
                          ],
                          "type": "tuple()",
                          "type_conversion": false
                        },
                        "children": [
                          {
                            "attributes": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_bool",
                                  "typeString": "bool"
                                }
                              ],
                              "overloadedDeclarations": [
                                null
                              ],
                              "referencedDeclaration": 12593,
                              "type": "function (bool) pure",
                              "value": "require"
                            },
                            "id": 8442,
                            "name": "Identifier",
                            "src": "1211:7:34"
                          },
                          {
                            "attributes": {
                              "argumentTypes": null,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "isStructConstructorCall": false,
                              "lValueRequested": false,
                              "names": [
                                null
                              ],
                              "type": "bool",
                              "type_conversion": false
                            },
                            "children": [
                              {
                                "attributes": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_address",
                                      "typeString": "address"
                                    }
                                  ],
                                  "overloadedDeclarations": [
                                    null
                                  ],
                                  "referencedDeclaration": 8482,
                                  "type": "function (address) view returns (bool)",
                                  "value": "isContract"
                                },
                                "id": 8443,
                                "name": "Identifier",
                                "src": "1219:10:34"
                              },
                              {
                                "attributes": {
                                  "argumentTypes": null,
                                  "overloadedDeclarations": [
                                    null
                                  ],
                                  "referencedDeclaration": 8435,
                                  "type": "address",
                                  "value": "_addr"
                                },
                                "id": 8444,
                                "name": "Identifier",
                                "src": "1230:5:34"
                              }
                            ],
                            "id": 8445,
                            "name": "FunctionCall",
                            "src": "1219:17:34"
                          }
                        ],
                        "id": 8446,
                        "name": "FunctionCall",
                        "src": "1211:26:34"
                      }
                    ],
                    "id": 8447,
                    "name": "ExpressionStatement",
                    "src": "1211:26:34"
                  },
                  {
                    "children": [
                      {
                        "attributes": {
                          "argumentTypes": null,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "isStructConstructorCall": false,
                          "lValueRequested": false,
                          "names": [
                            null
                          ],
                          "type": "tuple()",
                          "type_conversion": false
                        },
                        "children": [
                          {
                            "attributes": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_bool",
                                  "typeString": "bool"
                                }
                              ],
                              "overloadedDeclarations": [
                                null
                              ],
                              "referencedDeclaration": 12593,
                              "type": "function (bool) pure",
                              "value": "require"
                            },
                            "id": 8448,
                            "name": "Identifier",
                            "src": "1247:7:34"
                          },
                          {
                            "attributes": {
                              "argumentTypes": null,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "isStructConstructorCall": false,
                              "lValueRequested": false,
                              "names": [
                                null
                              ],
                              "type": "bool",
                              "type_conversion": false
                            },
                            "children": [
                              {
                                "attributes": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_bytes_memory_ptr",
                                      "typeString": "bytes memory"
                                    }
                                  ],
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "member_name": "delegatecall",
                                  "referencedDeclaration": null,
                                  "type": "function () returns (bool)"
                                },
                                "children": [
                                  {
                                    "attributes": {
                                      "argumentTypes": null,
                                      "overloadedDeclarations": [
                                        null
                                      ],
                                      "referencedDeclaration": 8435,
                                      "type": "address",
                                      "value": "_addr"
                                    },
                                    "id": 8449,
                                    "name": "Identifier",
                                    "src": "1255:5:34"
                                  }
                                ],
                                "id": 8450,
                                "name": "MemberAccess",
                                "src": "1255:18:34"
                              },
                              {
                                "attributes": {
                                  "argumentTypes": null,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "type": "bytes memory"
                                },
                                "children": [
                                  {
                                    "attributes": {
                                      "argumentTypes": null,
                                      "commonType": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      },
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": false,
                                      "lValueRequested": false,
                                      "operator": ">",
                                      "type": "bool"
                                    },
                                    "children": [
                                      {
                                        "attributes": {
                                          "argumentTypes": null,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "lValueRequested": false,
                                          "member_name": "length",
                                          "referencedDeclaration": null,
                                          "type": "uint256"
                                        },
                                        "children": [
                                          {
                                            "attributes": {
                                              "argumentTypes": null,
                                              "overloadedDeclarations": [
                                                null
                                              ],
                                              "referencedDeclaration": 8437,
                                              "type": "bytes memory",
                                              "value": "_input"
                                            },
                                            "id": 8451,
                                            "name": "Identifier",
                                            "src": "1274:6:34"
                                          }
                                        ],
                                        "id": 8452,
                                        "name": "MemberAccess",
                                        "src": "1274:13:34"
                                      },
                                      {
                                        "attributes": {
                                          "argumentTypes": null,
                                          "hexvalue": "30",
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": true,
                                          "lValueRequested": false,
                                          "subdenomination": null,
                                          "token": "number",
                                          "type": "int_const 0",
                                          "value": "0"
                                        },
                                        "id": 8453,
                                        "name": "Literal",
                                        "src": "1290:1:34"
                                      }
                                    ],
                                    "id": 8454,
                                    "name": "BinaryOperation",
                                    "src": "1274:17:34"
                                  },
                                  {
                                    "attributes": {
                                      "argumentTypes": null,
                                      "overloadedDeclarations": [
                                        null
                                      ],
                                      "referencedDeclaration": 8437,
                                      "type": "bytes memory",
                                      "value": "_input"
                                    },
                                    "id": 8455,
                                    "name": "Identifier",
                                    "src": "1294:6:34"
                                  },
                                  {
                                    "attributes": {
                                      "argumentTypes": null,
                                      "arguments": [
                                        null
                                      ],
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": false,
                                      "isStructConstructorCall": false,
                                      "lValueRequested": false,
                                      "names": [
                                        null
                                      ],
                                      "type": "bytes memory",
                                      "type_conversion": false
                                    },
                                    "children": [
                                      {
                                        "attributes": {
                                          "argumentTypes": [
                                            null
                                          ],
                                          "overloadedDeclarations": [
                                            null
                                          ],
                                          "referencedDeclaration": 8496,
                                          "type": "function () pure returns (bytes memory)",
                                          "value": "defaultInput"
                                        },
                                        "id": 8456,
                                        "name": "Identifier",
                                        "src": "1303:12:34"
                                      }
                                    ],
                                    "id": 8457,
                                    "name": "FunctionCall",
                                    "src": "1303:14:34"
                                  }
                                ],
                                "id": 8458,
                                "name": "Conditional",
                                "src": "1274:43:34"
                              }
                            ],
                            "id": 8459,
                            "name": "FunctionCall",
                            "src": "1255:63:34"
                          }
                        ],
                        "id": 8460,
                        "name": "FunctionCall",
                        "src": "1247:72:34"
                      }
                    ],
                    "id": 8461,
                    "name": "ExpressionStatement",
                    "src": "1247:72:34"
                  },
                  {
                    "attributes": {
                      "functionReturnParameters": 8441
                    },
                    "children": [
                      {
                        "attributes": {
                          "argumentTypes": null,
                          "arguments": [
                            null
                          ],
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "isStructConstructorCall": false,
                          "lValueRequested": false,
                          "names": [
                            null
                          ],
                          "type": "bytes memory",
                          "type_conversion": false
                        },
                        "children": [
                          {
                            "attributes": {
                              "argumentTypes": [
                                null
                              ],
                              "overloadedDeclarations": [
                                null
                              ],
                              "referencedDeclaration": 8505,
                              "type": "function () view returns (bytes memory)",
                              "value": "returnedData"
                            },
                            "id": 8462,
                            "name": "Identifier",
                            "src": "1336:12:34"
                          }
                        ],
                        "id": 8463,
                        "name": "FunctionCall",
                        "src": "1336:14:34"
                      }
                    ],
                    "id": 8464,
                    "name": "Return",
                    "src": "1329:21:34"
                  }
                ],
                "id": 8465,
                "name": "Block",
                "src": "1201:156:34"
              }
            ],
            "id": 8466,
            "name": "FunctionDefinition",
            "src": "1108:249:34"
          },
          {
            "attributes": {
              "constant": true,
              "implemented": true,
              "isConstructor": false,
              "modifiers": [
                null
              ],
              "name": "isContract",
              "payable": false,
              "scope": 8506,
              "stateMutability": "view",
              "superFunction": null,
              "visibility": "internal"
            },
            "children": [
              {
                "children": [
                  {
                    "attributes": {
                      "constant": false,
                      "name": "_target",
                      "scope": 8482,
                      "stateVariable": false,
                      "storageLocation": "default",
                      "type": "address",
                      "value": null,
                      "visibility": "internal"
                    },
                    "children": [
                      {
                        "attributes": {
                          "name": "address",
                          "type": "address"
                        },
                        "id": 8467,
                        "name": "ElementaryTypeName",
                        "src": "1383:7:34"
                      }
                    ],
                    "id": 8468,
                    "name": "VariableDeclaration",
                    "src": "1383:15:34"
                  }
                ],
                "id": 8469,
                "name": "ParameterList",
                "src": "1382:17:34"
              },
              {
                "children": [
                  {
                    "attributes": {
                      "constant": false,
                      "name": "",
                      "scope": 8482,
                      "stateVariable": false,
                      "storageLocation": "default",
                      "type": "bool",
                      "value": null,
                      "visibility": "internal"
                    },
                    "children": [
                      {
                        "attributes": {
                          "name": "bool",
                          "type": "bool"
                        },
                        "id": 8470,
                        "name": "ElementaryTypeName",
                        "src": "1423:4:34"
                      }
                    ],
                    "id": 8471,
                    "name": "VariableDeclaration",
                    "src": "1423:4:34"
                  }
                ],
                "id": 8472,
                "name": "ParameterList",
                "src": "1422:6:34"
              },
              {
                "children": [
                  {
                    "attributes": {
                      "assignments": [
                        null
                      ],
                      "initialValue": null
                    },
                    "children": [
                      {
                        "attributes": {
                          "constant": false,
                          "name": "size",
                          "scope": 8482,
                          "stateVariable": false,
                          "storageLocation": "default",
                          "type": "uint256",
                          "value": null,
                          "visibility": "internal"
                        },
                        "children": [
                          {
                            "attributes": {
                              "name": "uint256",
                              "type": "uint256"
                            },
                            "id": 8473,
                            "name": "ElementaryTypeName",
                            "src": "1439:7:34"
                          }
                        ],
                        "id": 8474,
                        "name": "VariableDeclaration",
                        "src": "1439:12:34"
                      }
                    ],
                    "id": 8475,
                    "name": "VariableDeclarationStatement",
                    "src": "1439:12:34"
                  },
                  {
                    "attributes": {
                      "externalReferences": [
                        {
                          "size": {
                            "declaration": 8474,
                            "isOffset": false,
                            "isSlot": false,
                            "src": "1472:4:34",
                            "valueSize": 1
                          }
                        },
                        {
                          "_target": {
                            "declaration": 8468,
                            "isOffset": false,
                            "isSlot": false,
                            "src": "1492:7:34",
                            "valueSize": 1
                          }
                        }
                      ],
                      "operations": "{\n    size := extcodesize(_target)\n}"
                    },
                    "children": [],
                    "id": 8476,
                    "name": "InlineAssembly",
                    "src": "1461:56:34"
                  },
                  {
                    "attributes": {
                      "functionReturnParameters": 8472
                    },
                    "children": [
                      {
                        "attributes": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "operator": ">",
                          "type": "bool"
                        },
                        "children": [
                          {
                            "attributes": {
                              "argumentTypes": null,
                              "overloadedDeclarations": [
                                null
                              ],
                              "referencedDeclaration": 8474,
                              "type": "uint256",
                              "value": "size"
                            },
                            "id": 8477,
                            "name": "Identifier",
                            "src": "1518:4:34"
                          },
                          {
                            "attributes": {
                              "argumentTypes": null,
                              "hexvalue": "30",
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "subdenomination": null,
                              "token": "number",
                              "type": "int_const 0",
                              "value": "0"
                            },
                            "id": 8478,
                            "name": "Literal",
                            "src": "1525:1:34"
                          }
                        ],
                        "id": 8479,
                        "name": "BinaryOperation",
                        "src": "1518:8:34"
                      }
                    ],
                    "id": 8480,
                    "name": "Return",
                    "src": "1511:15:34"
                  }
                ],
                "id": 8481,
                "name": "Block",
                "src": "1429:104:34"
              }
            ],
            "id": 8482,
            "name": "FunctionDefinition",
            "src": "1363:170:34"
          },
          {
            "attributes": {
              "constant": true,
              "implemented": true,
              "isConstructor": false,
              "modifiers": [
                null
              ],
              "name": "defaultInput",
              "payable": false,
              "scope": 8506,
              "stateMutability": "pure",
              "superFunction": null,
              "visibility": "internal"
            },
            "children": [
              {
                "attributes": {
                  "parameters": [
                    null
                  ]
                },
                "children": [],
                "id": 8483,
                "name": "ParameterList",
                "src": "1560:2:34"
              },
              {
                "children": [
                  {
                    "attributes": {
                      "constant": false,
                      "name": "",
                      "scope": 8496,
                      "stateVariable": false,
                      "storageLocation": "default",
                      "type": "bytes memory",
                      "value": null,
                      "visibility": "internal"
                    },
                    "children": [
                      {
                        "attributes": {
                          "name": "bytes",
                          "type": "bytes storage pointer"
                        },
                        "id": 8484,
                        "name": "ElementaryTypeName",
                        "src": "1586:5:34"
                      }
                    ],
                    "id": 8485,
                    "name": "VariableDeclaration",
                    "src": "1586:5:34"
                  }
                ],
                "id": 8486,
                "name": "ParameterList",
                "src": "1585:7:34"
              },
              {
                "children": [
                  {
                    "attributes": {
                      "functionReturnParameters": 8486
                    },
                    "children": [
                      {
                        "attributes": {
                          "argumentTypes": null,
                          "arguments": [
                            null
                          ],
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "isStructConstructorCall": false,
                          "lValueRequested": false,
                          "names": [
                            null
                          ],
                          "type": "bytes memory",
                          "type_conversion": false
                        },
                        "children": [
                          {
                            "attributes": {
                              "argumentTypes": [
                                null
                              ],
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "member_name": "toBytes",
                              "referencedDeclaration": 8215,
                              "type": "function (bytes4) pure returns (bytes memory)"
                            },
                            "children": [
                              {
                                "attributes": {
                                  "argumentTypes": null,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "member_name": "selector",
                                  "referencedDeclaration": null,
                                  "type": "bytes4"
                                },
                                "children": [
                                  {
                                    "attributes": {
                                      "argumentTypes": null,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": false,
                                      "lValueRequested": false,
                                      "member_name": "exec",
                                      "referencedDeclaration": 8388,
                                      "type": "function () external"
                                    },
                                    "children": [
                                      {
                                        "attributes": {
                                          "argumentTypes": null,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": true,
                                          "isStructConstructorCall": false,
                                          "lValueRequested": false,
                                          "names": [
                                            null
                                          ],
                                          "type": "contract DelegateScriptTarget",
                                          "type_conversion": true
                                        },
                                        "children": [
                                          {
                                            "attributes": {
                                              "argumentTypes": [
                                                {
                                                  "typeIdentifier": "t_rational_0_by_1",
                                                  "typeString": "int_const 0"
                                                }
                                              ],
                                              "overloadedDeclarations": [
                                                null
                                              ],
                                              "referencedDeclaration": 8389,
                                              "type": "type(contract DelegateScriptTarget)",
                                              "value": "DelegateScriptTarget"
                                            },
                                            "id": 8487,
                                            "name": "Identifier",
                                            "src": "1610:20:34"
                                          },
                                          {
                                            "attributes": {
                                              "argumentTypes": null,
                                              "hexvalue": "30",
                                              "isConstant": false,
                                              "isLValue": false,
                                              "isPure": true,
                                              "lValueRequested": false,
                                              "subdenomination": null,
                                              "token": "number",
                                              "type": "int_const 0",
                                              "value": "0"
                                            },
                                            "id": 8488,
                                            "name": "Literal",
                                            "src": "1631:1:34"
                                          }
                                        ],
                                        "id": 8489,
                                        "name": "FunctionCall",
                                        "src": "1610:23:34"
                                      }
                                    ],
                                    "id": 8490,
                                    "name": "MemberAccess",
                                    "src": "1610:28:34"
                                  }
                                ],
                                "id": 8491,
                                "name": "MemberAccess",
                                "src": "1610:37:34"
                              }
                            ],
                            "id": 8492,
                            "name": "MemberAccess",
                            "src": "1610:45:34"
                          }
                        ],
                        "id": 8493,
                        "name": "FunctionCall",
                        "src": "1610:47:34"
                      }
                    ],
                    "id": 8494,
                    "name": "Return",
                    "src": "1603:54:34"
                  }
                ],
                "id": 8495,
                "name": "Block",
                "src": "1593:71:34"
              }
            ],
            "id": 8496,
            "name": "FunctionDefinition",
            "src": "1539:125:34"
          },
          {
            "attributes": {
              "constant": true,
              "implemented": true,
              "isConstructor": false,
              "modifiers": [
                null
              ],
              "name": "returnedData",
              "payable": false,
              "scope": 8506,
              "stateMutability": "view",
              "superFunction": null,
              "visibility": "internal"
            },
            "children": [
              {
                "attributes": {
                  "parameters": [
                    null
                  ]
                },
                "children": [],
                "id": 8497,
                "name": "ParameterList",
                "src": "1753:2:34"
              },
              {
                "children": [
                  {
                    "attributes": {
                      "constant": false,
                      "name": "ret",
                      "scope": 8505,
                      "stateVariable": false,
                      "storageLocation": "default",
                      "type": "bytes memory",
                      "value": null,
                      "visibility": "internal"
                    },
                    "children": [
                      {
                        "attributes": {
                          "name": "bytes",
                          "type": "bytes storage pointer"
                        },
                        "id": 8498,
                        "name": "ElementaryTypeName",
                        "src": "1779:5:34"
                      }
                    ],
                    "id": 8499,
                    "name": "VariableDeclaration",
                    "src": "1779:9:34"
                  }
                ],
                "id": 8500,
                "name": "ParameterList",
                "src": "1778:11:34"
              },
              {
                "children": [
                  {
                    "attributes": {
                      "externalReferences": [
                        {
                          "ret": {
                            "declaration": 8499,
                            "isOffset": false,
                            "isSlot": false,
                            "src": "1862:3:34",
                            "valueSize": 1
                          }
                        },
                        {
                          "ret": {
                            "declaration": 8499,
                            "isOffset": false,
                            "isSlot": false,
                            "src": "2054:3:34",
                            "valueSize": 1
                          }
                        },
                        {
                          "ret": {
                            "declaration": 8499,
                            "isOffset": false,
                            "isSlot": false,
                            "src": "1992:3:34",
                            "valueSize": 1
                          }
                        },
                        {
                          "ret": {
                            "declaration": 8499,
                            "isOffset": false,
                            "isSlot": false,
                            "src": "1930:3:34",
                            "valueSize": 1
                          }
                        }
                      ],
                      "operations": "{\n    let size := returndatasize\n    ret := mload(0x40)\n    mstore(0x40, add(ret, add(size, 0x20)))\n    mstore(ret, size)\n    returndatacopy(add(ret, 0x20), 0, size)\n}"
                    },
                    "children": [],
                    "id": 8501,
                    "name": "InlineAssembly",
                    "src": "1800:319:34"
                  },
                  {
                    "attributes": {
                      "functionReturnParameters": 8500
                    },
                    "children": [
                      {
                        "attributes": {
                          "argumentTypes": null,
                          "overloadedDeclarations": [
                            null
                          ],
                          "referencedDeclaration": 8499,
                          "type": "bytes memory",
                          "value": "ret"
                        },
                        "id": 8502,
                        "name": "Identifier",
                        "src": "2120:3:34"
                      }
                    ],
                    "id": 8503,
                    "name": "Return",
                    "src": "2113:10:34"
                  }
                ],
                "id": 8504,
                "name": "Block",
                "src": "1790:340:34"
              }
            ],
            "id": 8505,
            "name": "FunctionDefinition",
            "src": "1732:398:34"
          }
        ],
        "id": 8506,
        "name": "ContractDefinition",
        "src": "159:1973:34"
      }
    ],
    "id": 8507,
    "name": "SourceUnit",
    "src": "0:2132:34"
  },
  "compiler": {
    "name": "solc",
    "version": "0.4.18+commit.9cf6e910.Emscripten.clang"
  },
  "networks": {},
  "schemaVersion": "1.0.1",
  "updatedAt": "2018-03-14T08:41:25.093Z"
}