{
  "contractName": "BaseUpgradeabilityProxy",
  "abi": [
    {
      "payable": true,
      "stateMutability": "payable",
      "type": "fallback"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "name": "implementation",
          "type": "address"
        }
      ],
      "name": "Upgraded",
      "type": "event"
    }
  ],
  "bytecode": "0x608060405234801561001057600080fd5b5060a48061001f6000396000f3fe6080604052600a600c565b005b60126020565b601e601a6022565b6053565b565b565b6000807f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c36001029050805491505090565b3660008037600080366000845af43d6000803e80600081146073573d6000f35b3d6000fdfea165627a7a72305820d57e22327e387328e9b3ae9e0c6101ceab4ba334f31cba6f6e135ed35b747f480029",
  "deployedBytecode": "0x6080604052600a600c565b005b60126020565b601e601a6022565b6053565b565b565b6000807f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c36001029050805491505090565b3660008037600080366000845af43d6000803e80600081146073573d6000f35b3d6000fdfea165627a7a72305820d57e22327e387328e9b3ae9e0c6101ceab4ba334f31cba6f6e135ed35b747f480029",
  "sourceMap": "295:1517:30:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;295:1517:30;;;;;;;",
  "deployedSourceMap": "295:1517:30:-;;;453:11:33;:9;:11::i;:::-;295:1517:30;1952:90:33;1988:15;:13;:15::i;:::-;2009:28;2019:17;:15;:17::i;:::-;2009:9;:28::i;:::-;1952:90::o;1818:39::-;:::o;949:156:30:-;999:12;1019;769:66;1034:19;;1019:34;;1090:4;1084:11;1076:19;;1068:33;;:::o;878:731:33:-;1180:12;1177:1;1174;1161:32;1370:1;1367;1353:12;1350:1;1334:14;1329:3;1316:56;1434:14;1431:1;1428;1413:36;1464:6;1524:1;1519:36;;;;1582:14;1579:1;1572:25;1519:36;1538:14;1535:1;1528:25",
  "source": "pragma solidity ^0.5.0;\n\nimport './Proxy.sol';\nimport '../utils/Address.sol';\n\n/**\n * @title BaseUpgradeabilityProxy\n * @dev This contract implements a proxy that allows to change the\n * implementation address to which it will delegate.\n * Such a change is called an implementation upgrade.\n */\ncontract BaseUpgradeabilityProxy is Proxy {\n  /**\n   * @dev Emitted when the implementation is upgraded.\n   * @param implementation Address of the new implementation.\n   */\n  event Upgraded(address indexed implementation);\n\n  /**\n   * @dev Storage slot with the address of the current implementation.\n   * This is the keccak-256 hash of \"org.zeppelinos.proxy.implementation\", and is\n   * validated in the constructor.\n   */\n  bytes32 internal constant IMPLEMENTATION_SLOT = 0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3;\n\n  /**\n   * @dev Returns the current implementation.\n   * @return Address of the current implementation\n   */\n  function _implementation() internal view returns (address impl) {\n    bytes32 slot = IMPLEMENTATION_SLOT;\n    assembly {\n      impl := sload(slot)\n    }\n  }\n\n  /**\n   * @dev Upgrades the proxy to a new implementation.\n   * @param newImplementation Address of the new implementation.\n   */\n  function _upgradeTo(address newImplementation) internal {\n    _setImplementation(newImplementation);\n    emit Upgraded(newImplementation);\n  }\n\n  /**\n   * @dev Sets the implementation address of the proxy.\n   * @param newImplementation Address of the new implementation.\n   */\n  function _setImplementation(address newImplementation) internal {\n    require(ZOSLibAddress.isContract(newImplementation), \"Cannot set a proxy implementation to a non-contract address\");\n\n    bytes32 slot = IMPLEMENTATION_SLOT;\n\n    assembly {\n      sstore(slot, newImplementation)\n    }\n  }\n}\n",
  "sourcePath": "/home/spalladino/Projects/sdk/zos/packages/lib/contracts/upgradeability/BaseUpgradeabilityProxy.sol",
  "ast": {
    "absolutePath": "/home/spalladino/Projects/sdk/zos/packages/lib/contracts/upgradeability/BaseUpgradeabilityProxy.sol",
    "exportedSymbols": {
      "BaseUpgradeabilityProxy": [
        5339
      ]
    },
    "id": 5340,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 5283,
        "literals": [
          "solidity",
          "^",
          "0.5",
          ".0"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:23:30"
      },
      {
        "absolutePath": "/home/spalladino/Projects/sdk/zos/packages/lib/contracts/upgradeability/Proxy.sol",
        "file": "./Proxy.sol",
        "id": 5284,
        "nodeType": "ImportDirective",
        "scope": 5340,
        "sourceUnit": 5477,
        "src": "25:21:30",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/spalladino/Projects/sdk/zos/packages/lib/contracts/utils/Address.sol",
        "file": "../utils/Address.sol",
        "id": 5285,
        "nodeType": "ImportDirective",
        "scope": 5340,
        "sourceUnit": 5964,
        "src": "47:30:30",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "baseContracts": [
          {
            "arguments": null,
            "baseName": {
              "contractScope": null,
              "id": 5286,
              "name": "Proxy",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 5476,
              "src": "331:5:30",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_Proxy_$5476",
                "typeString": "contract Proxy"
              }
            },
            "id": 5287,
            "nodeType": "InheritanceSpecifier",
            "src": "331:5:30"
          }
        ],
        "contractDependencies": [
          5476
        ],
        "contractKind": "contract",
        "documentation": "@title BaseUpgradeabilityProxy\n@dev This contract implements a proxy that allows to change the\nimplementation address to which it will delegate.\nSuch a change is called an implementation upgrade.",
        "fullyImplemented": true,
        "id": 5339,
        "linearizedBaseContracts": [
          5339,
          5476
        ],
        "name": "BaseUpgradeabilityProxy",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "anonymous": false,
            "documentation": "@dev Emitted when the implementation is upgraded.\n@param implementation Address of the new implementation.",
            "id": 5291,
            "name": "Upgraded",
            "nodeType": "EventDefinition",
            "parameters": {
              "id": 5290,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 5289,
                  "indexed": true,
                  "name": "implementation",
                  "nodeType": "VariableDeclaration",
                  "scope": 5291,
                  "src": "485:30:30",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 5288,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "485:7:30",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "484:32:30"
            },
            "src": "470:47:30"
          },
          {
            "constant": true,
            "id": 5294,
            "name": "IMPLEMENTATION_SLOT",
            "nodeType": "VariableDeclaration",
            "scope": 5339,
            "src": "721:114:30",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_bytes32",
              "typeString": "bytes32"
            },
            "typeName": {
              "id": 5292,
              "name": "bytes32",
              "nodeType": "ElementaryTypeName",
              "src": "721:7:30",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes32",
                "typeString": "bytes32"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "307837303530633965306634636137363963363962643361386566373430626333373933346638653263303336653561373233666438656530343865643366386333",
              "id": 5293,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "769:66:30",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_50801780122331352337026042894847907698553222651959119521779622085092237899971_by_1",
                "typeString": "int_const 5080...(69 digits omitted)...9971"
              },
              "value": "0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3"
            },
            "visibility": "internal"
          },
          {
            "body": {
              "id": 5304,
              "nodeType": "Block",
              "src": "1013:92:30",
              "statements": [
                {
                  "assignments": [
                    5300
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 5300,
                      "name": "slot",
                      "nodeType": "VariableDeclaration",
                      "scope": 5304,
                      "src": "1019:12:30",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 5299,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "1019:7:30",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 5302,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 5301,
                    "name": "IMPLEMENTATION_SLOT",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 5294,
                    "src": "1034:19:30",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1019:34:30"
                },
                {
                  "externalReferences": [
                    {
                      "impl": {
                        "declaration": 5297,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1076:4:30",
                        "valueSize": 1
                      }
                    },
                    {
                      "slot": {
                        "declaration": 5300,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1090:4:30",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 5303,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    impl := sload(slot)\n}",
                  "src": "1059:46:30"
                }
              ]
            },
            "documentation": "@dev Returns the current implementation.\n@return Address of the current implementation",
            "id": 5305,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_implementation",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 5295,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "973:2:30"
            },
            "returnParameters": {
              "id": 5298,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 5297,
                  "name": "impl",
                  "nodeType": "VariableDeclaration",
                  "scope": 5305,
                  "src": "999:12:30",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 5296,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "999:7:30",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "998:14:30"
            },
            "scope": 5339,
            "src": "949:156:30",
            "stateMutability": "view",
            "superFunction": 5452,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 5318,
              "nodeType": "Block",
              "src": "1296:86:30",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 5311,
                        "name": "newImplementation",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 5307,
                        "src": "1321:17:30",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 5310,
                      "name": "_setImplementation",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 5338,
                      "src": "1302:18:30",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
                        "typeString": "function (address)"
                      }
                    },
                    "id": 5312,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1302:37:30",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 5313,
                  "nodeType": "ExpressionStatement",
                  "src": "1302:37:30"
                },
                {
                  "eventCall": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 5315,
                        "name": "newImplementation",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 5307,
                        "src": "1359:17:30",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 5314,
                      "name": "Upgraded",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 5291,
                      "src": "1350:8:30",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$",
                        "typeString": "function (address)"
                      }
                    },
                    "id": 5316,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1350:27:30",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 5317,
                  "nodeType": "EmitStatement",
                  "src": "1345:32:30"
                }
              ]
            },
            "documentation": "@dev Upgrades the proxy to a new implementation.\n@param newImplementation Address of the new implementation.",
            "id": 5319,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_upgradeTo",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 5308,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 5307,
                  "name": "newImplementation",
                  "nodeType": "VariableDeclaration",
                  "scope": 5319,
                  "src": "1260:25:30",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 5306,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1260:7:30",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1259:27:30"
            },
            "returnParameters": {
              "id": 5309,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "1296:0:30"
            },
            "scope": 5339,
            "src": "1240:142:30",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 5337,
              "nodeType": "Block",
              "src": "1583:227:30",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 5327,
                            "name": "newImplementation",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 5321,
                            "src": "1622:17:30",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 5325,
                            "name": "ZOSLibAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 5963,
                            "src": "1597:13:30",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_ZOSLibAddress_$5963_$",
                              "typeString": "type(library ZOSLibAddress)"
                            }
                          },
                          "id": 5326,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "isContract",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5962,
                          "src": "1597:24:30",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$",
                            "typeString": "function (address) view returns (bool)"
                          }
                        },
                        "id": 5328,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "1597:43:30",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "43616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373",
                        "id": 5329,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "1642:61:30",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_b5145a64ce8c406e5785204fe5b300f0ceda96d6636350b38fdccb9cd8c0c37c",
                          "typeString": "literal_string \"Cannot set a proxy implementation to a non-contract address\""
                        },
                        "value": "Cannot set a proxy implementation to a non-contract address"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_b5145a64ce8c406e5785204fe5b300f0ceda96d6636350b38fdccb9cd8c0c37c",
                          "typeString": "literal_string \"Cannot set a proxy implementation to a non-contract address\""
                        }
                      ],
                      "id": 5324,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5990,
                        5991
                      ],
                      "referencedDeclaration": 5991,
                      "src": "1589:7:30",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 5330,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1589:115:30",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 5331,
                  "nodeType": "ExpressionStatement",
                  "src": "1589:115:30"
                },
                {
                  "assignments": [
                    5333
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 5333,
                      "name": "slot",
                      "nodeType": "VariableDeclaration",
                      "scope": 5337,
                      "src": "1711:12:30",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 5332,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "1711:7:30",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 5335,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 5334,
                    "name": "IMPLEMENTATION_SLOT",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 5294,
                    "src": "1726:19:30",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1711:34:30"
                },
                {
                  "externalReferences": [
                    {
                      "slot": {
                        "declaration": 5333,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1776:4:30",
                        "valueSize": 1
                      }
                    },
                    {
                      "newImplementation": {
                        "declaration": 5321,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1782:17:30",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 5336,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    sstore(slot, newImplementation)\n}",
                  "src": "1752:58:30"
                }
              ]
            },
            "documentation": "@dev Sets the implementation address of the proxy.\n@param newImplementation Address of the new implementation.",
            "id": 5338,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_setImplementation",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 5322,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 5321,
                  "name": "newImplementation",
                  "nodeType": "VariableDeclaration",
                  "scope": 5338,
                  "src": "1547:25:30",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 5320,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1547:7:30",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1546:27:30"
            },
            "returnParameters": {
              "id": 5323,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "1583:0:30"
            },
            "scope": 5339,
            "src": "1519:291:30",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          }
        ],
        "scope": 5340,
        "src": "295:1517:30"
      }
    ],
    "src": "0:1813:30"
  },
  "legacyAST": {
    "absolutePath": "/home/spalladino/Projects/sdk/zos/packages/lib/contracts/upgradeability/BaseUpgradeabilityProxy.sol",
    "exportedSymbols": {
      "BaseUpgradeabilityProxy": [
        5339
      ]
    },
    "id": 5340,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 5283,
        "literals": [
          "solidity",
          "^",
          "0.5",
          ".0"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:23:30"
      },
      {
        "absolutePath": "/home/spalladino/Projects/sdk/zos/packages/lib/contracts/upgradeability/Proxy.sol",
        "file": "./Proxy.sol",
        "id": 5284,
        "nodeType": "ImportDirective",
        "scope": 5340,
        "sourceUnit": 5477,
        "src": "25:21:30",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/spalladino/Projects/sdk/zos/packages/lib/contracts/utils/Address.sol",
        "file": "../utils/Address.sol",
        "id": 5285,
        "nodeType": "ImportDirective",
        "scope": 5340,
        "sourceUnit": 5964,
        "src": "47:30:30",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "baseContracts": [
          {
            "arguments": null,
            "baseName": {
              "contractScope": null,
              "id": 5286,
              "name": "Proxy",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 5476,
              "src": "331:5:30",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_Proxy_$5476",
                "typeString": "contract Proxy"
              }
            },
            "id": 5287,
            "nodeType": "InheritanceSpecifier",
            "src": "331:5:30"
          }
        ],
        "contractDependencies": [
          5476
        ],
        "contractKind": "contract",
        "documentation": "@title BaseUpgradeabilityProxy\n@dev This contract implements a proxy that allows to change the\nimplementation address to which it will delegate.\nSuch a change is called an implementation upgrade.",
        "fullyImplemented": true,
        "id": 5339,
        "linearizedBaseContracts": [
          5339,
          5476
        ],
        "name": "BaseUpgradeabilityProxy",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "anonymous": false,
            "documentation": "@dev Emitted when the implementation is upgraded.\n@param implementation Address of the new implementation.",
            "id": 5291,
            "name": "Upgraded",
            "nodeType": "EventDefinition",
            "parameters": {
              "id": 5290,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 5289,
                  "indexed": true,
                  "name": "implementation",
                  "nodeType": "VariableDeclaration",
                  "scope": 5291,
                  "src": "485:30:30",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 5288,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "485:7:30",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "484:32:30"
            },
            "src": "470:47:30"
          },
          {
            "constant": true,
            "id": 5294,
            "name": "IMPLEMENTATION_SLOT",
            "nodeType": "VariableDeclaration",
            "scope": 5339,
            "src": "721:114:30",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_bytes32",
              "typeString": "bytes32"
            },
            "typeName": {
              "id": 5292,
              "name": "bytes32",
              "nodeType": "ElementaryTypeName",
              "src": "721:7:30",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes32",
                "typeString": "bytes32"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "307837303530633965306634636137363963363962643361386566373430626333373933346638653263303336653561373233666438656530343865643366386333",
              "id": 5293,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "769:66:30",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_50801780122331352337026042894847907698553222651959119521779622085092237899971_by_1",
                "typeString": "int_const 5080...(69 digits omitted)...9971"
              },
              "value": "0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3"
            },
            "visibility": "internal"
          },
          {
            "body": {
              "id": 5304,
              "nodeType": "Block",
              "src": "1013:92:30",
              "statements": [
                {
                  "assignments": [
                    5300
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 5300,
                      "name": "slot",
                      "nodeType": "VariableDeclaration",
                      "scope": 5304,
                      "src": "1019:12:30",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 5299,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "1019:7:30",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 5302,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 5301,
                    "name": "IMPLEMENTATION_SLOT",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 5294,
                    "src": "1034:19:30",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1019:34:30"
                },
                {
                  "externalReferences": [
                    {
                      "impl": {
                        "declaration": 5297,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1076:4:30",
                        "valueSize": 1
                      }
                    },
                    {
                      "slot": {
                        "declaration": 5300,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1090:4:30",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 5303,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    impl := sload(slot)\n}",
                  "src": "1059:46:30"
                }
              ]
            },
            "documentation": "@dev Returns the current implementation.\n@return Address of the current implementation",
            "id": 5305,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_implementation",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 5295,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "973:2:30"
            },
            "returnParameters": {
              "id": 5298,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 5297,
                  "name": "impl",
                  "nodeType": "VariableDeclaration",
                  "scope": 5305,
                  "src": "999:12:30",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 5296,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "999:7:30",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "998:14:30"
            },
            "scope": 5339,
            "src": "949:156:30",
            "stateMutability": "view",
            "superFunction": 5452,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 5318,
              "nodeType": "Block",
              "src": "1296:86:30",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 5311,
                        "name": "newImplementation",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 5307,
                        "src": "1321:17:30",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 5310,
                      "name": "_setImplementation",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 5338,
                      "src": "1302:18:30",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
                        "typeString": "function (address)"
                      }
                    },
                    "id": 5312,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1302:37:30",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 5313,
                  "nodeType": "ExpressionStatement",
                  "src": "1302:37:30"
                },
                {
                  "eventCall": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 5315,
                        "name": "newImplementation",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 5307,
                        "src": "1359:17:30",
                        "typeDescriptions": {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_address",
                          "typeString": "address"
                        }
                      ],
                      "id": 5314,
                      "name": "Upgraded",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 5291,
                      "src": "1350:8:30",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$",
                        "typeString": "function (address)"
                      }
                    },
                    "id": 5316,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1350:27:30",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 5317,
                  "nodeType": "EmitStatement",
                  "src": "1345:32:30"
                }
              ]
            },
            "documentation": "@dev Upgrades the proxy to a new implementation.\n@param newImplementation Address of the new implementation.",
            "id": 5319,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_upgradeTo",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 5308,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 5307,
                  "name": "newImplementation",
                  "nodeType": "VariableDeclaration",
                  "scope": 5319,
                  "src": "1260:25:30",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 5306,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1260:7:30",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1259:27:30"
            },
            "returnParameters": {
              "id": 5309,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "1296:0:30"
            },
            "scope": 5339,
            "src": "1240:142:30",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 5337,
              "nodeType": "Block",
              "src": "1583:227:30",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 5327,
                            "name": "newImplementation",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 5321,
                            "src": "1622:17:30",
                            "typeDescriptions": {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_address",
                              "typeString": "address"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 5325,
                            "name": "ZOSLibAddress",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 5963,
                            "src": "1597:13:30",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_contract$_ZOSLibAddress_$5963_$",
                              "typeString": "type(library ZOSLibAddress)"
                            }
                          },
                          "id": 5326,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "isContract",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 5962,
                          "src": "1597:24:30",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$",
                            "typeString": "function (address) view returns (bool)"
                          }
                        },
                        "id": 5328,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "1597:43:30",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "43616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373",
                        "id": 5329,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "1642:61:30",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_b5145a64ce8c406e5785204fe5b300f0ceda96d6636350b38fdccb9cd8c0c37c",
                          "typeString": "literal_string \"Cannot set a proxy implementation to a non-contract address\""
                        },
                        "value": "Cannot set a proxy implementation to a non-contract address"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_b5145a64ce8c406e5785204fe5b300f0ceda96d6636350b38fdccb9cd8c0c37c",
                          "typeString": "literal_string \"Cannot set a proxy implementation to a non-contract address\""
                        }
                      ],
                      "id": 5324,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5990,
                        5991
                      ],
                      "referencedDeclaration": 5991,
                      "src": "1589:7:30",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 5330,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1589:115:30",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 5331,
                  "nodeType": "ExpressionStatement",
                  "src": "1589:115:30"
                },
                {
                  "assignments": [
                    5333
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 5333,
                      "name": "slot",
                      "nodeType": "VariableDeclaration",
                      "scope": 5337,
                      "src": "1711:12:30",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 5332,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "1711:7:30",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 5335,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 5334,
                    "name": "IMPLEMENTATION_SLOT",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 5294,
                    "src": "1726:19:30",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1711:34:30"
                },
                {
                  "externalReferences": [
                    {
                      "slot": {
                        "declaration": 5333,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1776:4:30",
                        "valueSize": 1
                      }
                    },
                    {
                      "newImplementation": {
                        "declaration": 5321,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1782:17:30",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 5336,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    sstore(slot, newImplementation)\n}",
                  "src": "1752:58:30"
                }
              ]
            },
            "documentation": "@dev Sets the implementation address of the proxy.\n@param newImplementation Address of the new implementation.",
            "id": 5338,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_setImplementation",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 5322,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 5321,
                  "name": "newImplementation",
                  "nodeType": "VariableDeclaration",
                  "scope": 5338,
                  "src": "1547:25:30",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 5320,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "1547:7:30",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1546:27:30"
            },
            "returnParameters": {
              "id": 5323,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "1583:0:30"
            },
            "scope": 5339,
            "src": "1519:291:30",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          }
        ],
        "scope": 5340,
        "src": "295:1517:30"
      }
    ],
    "src": "0:1813:30"
  },
  "compiler": {
    "name": "solc",
    "version": "0.5.3+commit.10d17f24.Emscripten.clang"
  },
  "networks": {},
  "schemaVersion": "3.0.2",
  "updatedAt": "2020-02-20T14:02:47.780Z",
  "devdoc": {
    "details": "This contract implements a proxy that allows to change the implementation address to which it will delegate. Such a change is called an implementation upgrade.",
    "methods": {},
    "title": "BaseUpgradeabilityProxy"
  },
  "userdoc": {
    "methods": {}
  }
}