{
  "address": "0x9b38044A276fED8bC1703bd4a2DA1b17F2c61d16",
  "abi": [
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "_oldImplementation",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "_newImplementation",
          "type": "address"
        }
      ],
      "name": "ImplementationChanged",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "previousOwner",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "OwnershipTransferred",
      "type": "event"
    },
    {
      "stateMutability": "payable",
      "type": "fallback"
    },
    {
      "inputs": [],
      "name": "getImplementation",
      "outputs": [
        {
          "internalType": "address",
          "name": "_implementation",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getOwner",
      "outputs": [
        {
          "internalType": "address",
          "name": "_owner",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_implementation",
          "type": "address"
        }
      ],
      "name": "setImplementation",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_owner",
          "type": "address"
        }
      ],
      "name": "setOwner",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "stateMutability": "payable",
      "type": "receive"
    }
  ],
  "transactionHash": "0x17a5e16748799c965f71e98bb149b5fbc20d06d0d6458b5ec741a1ed4c0fd470",
  "receipt": {
    "to": null,
    "from": "0x13Be55487D37FE3C66EE7305e1e9C1ac85de75Ae",
    "contractAddress": "0x9b38044A276fED8bC1703bd4a2DA1b17F2c61d16",
    "transactionIndex": 0,
    "gasUsed": "421195",
    "logsBloom": "0x00000000000020000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000001000000000000000000000000000000000000020000000000000000001800000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000020000000000000000000000000000000000000000000000000000000000000000000",
    "blockHash": "0xca5d32edcea44e15e4754505be6821e769fc49a220a47f79824094e23a835c20",
    "transactionHash": "0x17a5e16748799c965f71e98bb149b5fbc20d06d0d6458b5ec741a1ed4c0fd470",
    "logs": [
      {
        "transactionIndex": 0,
        "blockNumber": 5263791,
        "transactionHash": "0x17a5e16748799c965f71e98bb149b5fbc20d06d0d6458b5ec741a1ed4c0fd470",
        "address": "0x9b38044A276fED8bC1703bd4a2DA1b17F2c61d16",
        "topics": [
          "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0",
          "0x0000000000000000000000000000000000000000000000000000000000000000",
          "0x00000000000000000000000013be55487d37fe3c66ee7305e1e9c1ac85de75ae"
        ],
        "data": "0x",
        "logIndex": 0,
        "blockHash": "0xca5d32edcea44e15e4754505be6821e769fc49a220a47f79824094e23a835c20"
      }
    ],
    "blockNumber": 5263791,
    "cumulativeGasUsed": "421195",
    "status": 1,
    "byzantium": true
  },
  "args": [],
  "numDeployments": 1,
  "solcInputHash": "e503d07ca3127357b87a58afb3d8f198",
  "metadata": "{\"compiler\":{\"version\":\"0.6.11+commit.5ef660b1\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldImplementation\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newImplementation\",\"type\":\"address\"}],\"name\":\"ImplementationChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"getImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"name\":\"setImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"setOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getImplementation()\":{\"returns\":{\"_implementation\":\"Address of the implementation. \"}},\"getOwner()\":{\"returns\":{\"_owner\":\"Address of the owner. \"}},\"setImplementation(address)\":{\"details\":\"Wrapper for _setImplementation that exposes the function as public for owner to be able to set a new version of the contract as current pointing implementation.\",\"params\":{\"_implementation\":\"Address of the implementation. \"}},\"setOwner(address)\":{\"params\":{\"_owner\":\"Address of the owner. \"}}},\"title\":\"Upgradable Proxy contract. Adapted version of https://github.com/DistributedCollective/Sovryn-smart-contracts/blob/development/contracts/proxy/UpgradableProxy.sol \",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getImplementation()\":{\"notice\":\"Return address of the implementation.\"},\"getOwner()\":{\"notice\":\"Return address of the owner.\"},\"setImplementation(address)\":{\"notice\":\"Set address of the implementation.\"},\"setOwner(address)\":{\"notice\":\"Set address of the owner (only owner can call this function)\"}},\"notice\":\"A disadvantage of the immutable ledger is that nobody can change the source code of a smart contract after it\\u2019s been deployed. In order to fix bugs or introduce new features, smart contracts need to be upgradable somehow. Although it is not possible to upgrade the code of an already deployed smart contract, it is possible to set-up a proxy contract architecture that will allow to use new deployed contracts as if the main logic had been upgraded. A proxy architecture pattern is such that all message calls go through a Proxy contract that will redirect them to the latest deployed contract logic. To upgrade, a new version of the contract is deployed, and the Proxy is updated to reference the new contract address. \",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Proxy/UpgradableProxy.sol\":\"UpgradableProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"contracts/Dependencies/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.6.11;\\n\\n/**\\n * Based on OpenZeppelin's Ownable contract:\\n * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\\n *\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n    bytes32 private constant KEY_OWNER = keccak256(\\\"key.ownable.owner\\\");\\n\\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n    /**\\n     * @dev Initializes the contract setting the deployer as the initial owner.\\n     */\\n    constructor () internal {\\n        _setOwner(msg.sender);\\n    }\\n\\n    /**\\n     * @dev Throws if called by any account other than the owner.\\n     */\\n    modifier onlyOwner() {\\n        require(msg.sender == getOwner(), \\\"Ownable:: access denied\\\");\\n        _;\\n    }\\n\\n    /**\\n     * @notice Set address of the owner.\\n     * @param _owner Address of the owner.\\n     * */\\n    function _setOwner(address _owner) internal {\\n        require(_owner != address(0), \\\"Ownable::setOwner: invalid address\\\");\\n        emit OwnershipTransferred(getOwner(), _owner);\\n\\n        bytes32 key = KEY_OWNER;\\n        assembly {\\n            sstore(key, _owner)\\n        }\\n    }\\n\\n    /**\\n     * @notice Set address of the owner (only owner can call this function)\\n     * @param _owner Address of the owner.\\n     * */\\n    function setOwner(address _owner) public onlyOwner {\\n        _setOwner(_owner);\\n    }\\n\\n    /**\\n     * @notice Return address of the owner.\\n     * @return _owner Address of the owner.\\n     * */\\n    function getOwner() public view returns (address _owner) {\\n        bytes32 key = KEY_OWNER;\\n        assembly {\\n            _owner := sload(key)\\n        }\\n    }\\n}\\n\",\"keccak256\":\"0xb5fc626e0b227fc0feb1d84440585015a0a5f586547d298534a604dd113efec6\",\"license\":\"MIT\"},\"contracts/Proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.6.11;\\n\\nimport \\\"../Dependencies/Ownable.sol\\\";\\n/**\\n * @title Base Proxy contract.\\n * \\n * Adapted version of https://github.com/DistributedCollective/Sovryn-smart-contracts/blob/development/contracts/proxy/Proxy.sol \\n *\\n * @notice The proxy performs delegated calls to the contract implementation\\n * it is pointing to. This way upgradable contracts are possible on blockchain.\\n *\\n * Delegating proxy contracts are widely used for both upgradeability and gas\\n * savings. These proxies rely on a logic contract (also known as implementation\\n * contract or master copy) that is called using delegatecall. This allows\\n * proxies to keep a persistent state (storage and balance) while the code is\\n * delegated to the logic contract.\\n *\\n * Proxy contract is meant to be inherited and its internal functions\\n * _setImplementation and _setOwner to be called when upgrades become\\n * neccessary.\\n *\\n * The loan token (iToken) contract as well as the protocol contract act as\\n * proxies, delegating all calls to underlying contracts. Therefore, if you\\n * want to interact with them using web3, you need to use the ABIs from the\\n * contracts containing the actual logic or the interface contract.\\n *   ABI for LoanToken contracts: LoanTokenLogicStandard\\n *   ABI for Protocol contract: ISovryn\\n *\\n * @dev UpgradableProxy is the contract that inherits Proxy and wraps these\\n * functions.\\n * */\\ncontract Proxy is Ownable {\\n    bytes32 private constant KEY_IMPLEMENTATION = keccak256(\\\"key.implementation\\\");\\n\\n    event ImplementationChanged(\\n        address indexed _oldImplementation,\\n        address indexed _newImplementation\\n    );\\n\\n    /**\\n     * @notice Set address of the implementation.\\n     * @param _implementation Address of the implementation.\\n     * */\\n    function _setImplementation(address _implementation) internal {\\n        require(_implementation != address(0), \\\"Proxy::setImplementation: invalid address\\\");\\n        emit ImplementationChanged(getImplementation(), _implementation);\\n\\n        bytes32 key = KEY_IMPLEMENTATION;\\n        assembly {\\n            sstore(key, _implementation)\\n        }\\n    }\\n\\n    /**\\n     * @notice Return address of the implementation.\\n     * @return _implementation Address of the implementation.\\n     * */\\n    function getImplementation() public view returns (address _implementation) {\\n        bytes32 key = KEY_IMPLEMENTATION;\\n        assembly {\\n            _implementation := sload(key)\\n        }\\n    }\\n\\n    /**\\n     * @notice Fallback function performs a delegate call\\n     * to the actual implementation address is pointing this proxy.\\n     * Returns whatever the implementation call returns.\\n     * */\\n    fallback() external payable {\\n        delegate();\\n    }\\n\\n    /**\\n     * @notice Fallback function performs a delegate call\\n     * to the actual implementation address is pointing this proxy.\\n     * Returns whatever the implementation call returns.\\n     * */\\n    receive() external payable {\\n        delegate();\\n    }\\n\\n    function delegate() internal {\\n        address implementation = getImplementation();\\n        require(implementation != address(0), \\\"Proxy::(): implementation not found\\\");\\n\\n        assembly {\\n            let pointer := mload(0x40)\\n            calldatacopy(pointer, 0, calldatasize())\\n            let result := delegatecall(gas(), implementation, pointer, calldatasize(), 0, 0)\\n            let size := returndatasize()\\n            returndatacopy(pointer, 0, size)\\n\\n            switch result\\n            case 0 {\\n                revert(pointer, size)\\n            }\\n            default {\\n                return(pointer, size)\\n            }\\n        }\\n    }\\n}\\n\",\"keccak256\":\"0xebadc363c4b07589b9d432da451c9f68f636a4fbe6da6f66cfbb360f12c05132\",\"license\":\"MIT\"},\"contracts/Proxy/UpgradableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.6.11;\\n\\nimport \\\"./Proxy.sol\\\";\\n\\n/**\\n * @title Upgradable Proxy contract.\\n *\\n * Adapted version of https://github.com/DistributedCollective/Sovryn-smart-contracts/blob/development/contracts/proxy/UpgradableProxy.sol\\n * \\n * @notice A disadvantage of the immutable ledger is that nobody can change the\\n * source code of a smart contract after it\\u2019s been deployed. In order to fix\\n * bugs or introduce new features, smart contracts need to be upgradable somehow.\\n *\\n * Although it is not possible to upgrade the code of an already deployed smart\\n * contract, it is possible to set-up a proxy contract architecture that will\\n * allow to use new deployed contracts as if the main logic had been upgraded.\\n *\\n * A proxy architecture pattern is such that all message calls go through a\\n * Proxy contract that will redirect them to the latest deployed contract logic.\\n * To upgrade, a new version of the contract is deployed, and the Proxy is\\n * updated to reference the new contract address.\\n * */\\ncontract UpgradableProxy is Proxy {\\n    /**\\n     * @notice Set address of the implementation.\\n     * @dev Wrapper for _setImplementation that exposes the function\\n     * as public for owner to be able to set a new version of the\\n     * contract as current pointing implementation.\\n     * @param _implementation Address of the implementation.\\n     * */\\n    function setImplementation(address _implementation) public onlyOwner {\\n        _setImplementation(_implementation);\\n    }\\n\\n}\\n\",\"keccak256\":\"0x0841172f0b41b3e61cb76c8897132db520b875779897cb5cbc12ca2aab6329d5\",\"license\":\"MIT\"}},\"version\":1}",
  "bytecode": "0x608060405234801561001057600080fd5b50610023336001600160e01b0361002816565b610110565b6001600160a01b03811661006d5760405162461bcd60e51b81526004018080602001828103825260228152602001806105e26022913960400191505060405180910390fd5b6001600160a01b0381166100886001600160e01b036100e616565b6001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3604080517035b2bc9737bbb730b136329737bbb732b960791b8152905190819003601101902055565b604080517035b2bc9737bbb730b136329737bbb732b960791b815290519081900360110190205490565b6104c38061011f6000396000f3fe6080604052600436106100435760003560e01c806313af40351461005a578063893d20e81461008d578063aaf10f42146100be578063d784d426146100d357610052565b3661005257610050610106565b005b610050610106565b34801561006657600080fd5b506100506004803603602081101561007d57600080fd5b50356001600160a01b031661017c565b34801561009957600080fd5b506100a26101ef565b604080516001600160a01b039092168252519081900360200190f35b3480156100ca57600080fd5b506100a2610219565b3480156100df57600080fd5b50610050600480360360208110156100f657600080fd5b50356001600160a01b0316610244565b6000610110610219565b90506001600160a01b0381166101575760405162461bcd60e51b815260040180806020018281038252602381526020018061046b6023913960400191505060405180910390fd5b60405136600082376000803683855af43d806000843e818015610178578184f35b8184fd5b6101846101ef565b6001600160a01b0316336001600160a01b0316146101e3576040805162461bcd60e51b815260206004820152601760248201527613dddb98589b194e8e881858d8d95cdcc819195b9a5959604a1b604482015290519081900360640190fd5b6101ec816102b4565b50565b604080517035b2bc9737bbb730b136329737bbb732b960791b815290519081900360110190205490565b604080517135b2bc9734b6b83632b6b2b73a30ba34b7b760711b815290519081900360120190205490565b61024c6101ef565b6001600160a01b0316336001600160a01b0316146102ab576040805162461bcd60e51b815260206004820152601760248201527613dddb98589b194e8e881858d8d95cdcc819195b9a5959604a1b604482015290519081900360640190fd5b6101ec81610369565b6001600160a01b0381166102f95760405162461bcd60e51b81526004018080602001828103825260228152602001806104206022913960400191505060405180910390fd5b806001600160a01b031661030b6101ef565b6001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3604080517035b2bc9737bbb730b136329737bbb732b960791b8152905190819003601101902055565b6001600160a01b0381166103ae5760405162461bcd60e51b81526004018080602001828103825260298152602001806104426029913960400191505060405180910390fd5b806001600160a01b03166103c0610219565b6001600160a01b03167fcfbf4028add9318bbf716f08c348595afb063b0e9feed1f86d33681a4b3ed4d360405160405180910390a3604080517135b2bc9734b6b83632b6b2b73a30ba34b7b760711b815290519081900360120190205556fe4f776e61626c653a3a7365744f776e65723a20696e76616c6964206164647265737350726f78793a3a736574496d706c656d656e746174696f6e3a20696e76616c6964206164647265737350726f78793a3a28293a20696d706c656d656e746174696f6e206e6f7420666f756e64a2646970667358221220f84db5b0f5dd60cbb7d66141de13219d0da4edbe3006d54bb4d362cbc0da0dfa64736f6c634300060b00334f776e61626c653a3a7365744f776e65723a20696e76616c69642061646472657373",
  "deployedBytecode": "0x6080604052600436106100435760003560e01c806313af40351461005a578063893d20e81461008d578063aaf10f42146100be578063d784d426146100d357610052565b3661005257610050610106565b005b610050610106565b34801561006657600080fd5b506100506004803603602081101561007d57600080fd5b50356001600160a01b031661017c565b34801561009957600080fd5b506100a26101ef565b604080516001600160a01b039092168252519081900360200190f35b3480156100ca57600080fd5b506100a2610219565b3480156100df57600080fd5b50610050600480360360208110156100f657600080fd5b50356001600160a01b0316610244565b6000610110610219565b90506001600160a01b0381166101575760405162461bcd60e51b815260040180806020018281038252602381526020018061046b6023913960400191505060405180910390fd5b60405136600082376000803683855af43d806000843e818015610178578184f35b8184fd5b6101846101ef565b6001600160a01b0316336001600160a01b0316146101e3576040805162461bcd60e51b815260206004820152601760248201527613dddb98589b194e8e881858d8d95cdcc819195b9a5959604a1b604482015290519081900360640190fd5b6101ec816102b4565b50565b604080517035b2bc9737bbb730b136329737bbb732b960791b815290519081900360110190205490565b604080517135b2bc9734b6b83632b6b2b73a30ba34b7b760711b815290519081900360120190205490565b61024c6101ef565b6001600160a01b0316336001600160a01b0316146102ab576040805162461bcd60e51b815260206004820152601760248201527613dddb98589b194e8e881858d8d95cdcc819195b9a5959604a1b604482015290519081900360640190fd5b6101ec81610369565b6001600160a01b0381166102f95760405162461bcd60e51b81526004018080602001828103825260228152602001806104206022913960400191505060405180910390fd5b806001600160a01b031661030b6101ef565b6001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3604080517035b2bc9737bbb730b136329737bbb732b960791b8152905190819003601101902055565b6001600160a01b0381166103ae5760405162461bcd60e51b81526004018080602001828103825260298152602001806104426029913960400191505060405180910390fd5b806001600160a01b03166103c0610219565b6001600160a01b03167fcfbf4028add9318bbf716f08c348595afb063b0e9feed1f86d33681a4b3ed4d360405160405180910390a3604080517135b2bc9734b6b83632b6b2b73a30ba34b7b760711b815290519081900360120190205556fe4f776e61626c653a3a7365744f776e65723a20696e76616c6964206164647265737350726f78793a3a736574496d706c656d656e746174696f6e3a20696e76616c6964206164647265737350726f78793a3a28293a20696d706c656d656e746174696f6e206e6f7420666f756e64a2646970667358221220f84db5b0f5dd60cbb7d66141de13219d0da4edbe3006d54bb4d362cbc0da0dfa64736f6c634300060b0033",
  "devdoc": {
    "kind": "dev",
    "methods": {
      "getImplementation()": {
        "returns": {
          "_implementation": "Address of the implementation. "
        }
      },
      "getOwner()": {
        "returns": {
          "_owner": "Address of the owner. "
        }
      },
      "setImplementation(address)": {
        "details": "Wrapper for _setImplementation that exposes the function as public for owner to be able to set a new version of the contract as current pointing implementation.",
        "params": {
          "_implementation": "Address of the implementation. "
        }
      },
      "setOwner(address)": {
        "params": {
          "_owner": "Address of the owner. "
        }
      }
    },
    "title": "Upgradable Proxy contract. Adapted version of https://github.com/DistributedCollective/Sovryn-smart-contracts/blob/development/contracts/proxy/UpgradableProxy.sol ",
    "version": 1
  },
  "userdoc": {
    "kind": "user",
    "methods": {
      "getImplementation()": {
        "notice": "Return address of the implementation."
      },
      "getOwner()": {
        "notice": "Return address of the owner."
      },
      "setImplementation(address)": {
        "notice": "Set address of the implementation."
      },
      "setOwner(address)": {
        "notice": "Set address of the owner (only owner can call this function)"
      }
    },
    "notice": "A disadvantage of the immutable ledger is that nobody can change the source code of a smart contract after it’s been deployed. In order to fix bugs or introduce new features, smart contracts need to be upgradable somehow. Although it is not possible to upgrade the code of an already deployed smart contract, it is possible to set-up a proxy contract architecture that will allow to use new deployed contracts as if the main logic had been upgraded. A proxy architecture pattern is such that all message calls go through a Proxy contract that will redirect them to the latest deployed contract logic. To upgrade, a new version of the contract is deployed, and the Proxy is updated to reference the new contract address. ",
    "version": 1
  },
  "storageLayout": {
    "storage": [],
    "types": null
  }
}