-
Notifications
You must be signed in to change notification settings - Fork 20
/
ERC1967Proxy.sol
33 lines (27 loc) · 1.39 KB
/
ERC1967Proxy.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import { Proxy } from "@openzeppelin/contracts/proxy/Proxy.sol";
import { IERC1967Upgrade } from "../interfaces/IERC1967Upgrade.sol";
import { ERC1967Upgrade } from "./ERC1967Upgrade.sol";
/// @title ERC1967Proxy
/// @author Rohan Kulkarni
/// @notice Modified from OpenZeppelin Contracts v4.7.3 (proxy/ERC1967/ERC1967Proxy.sol)
/// - Inherits a modern, minimal ERC1967Upgrade
contract ERC1967Proxy is IERC1967Upgrade, Proxy, ERC1967Upgrade {
/// ///
/// CONSTRUCTOR ///
/// ///
/// @dev Initializes the proxy with an implementation contract and encoded function call
/// @param _logic The implementation address
/// @param _data The encoded function call
constructor(address _logic, bytes memory _data) payable {
_upgradeToAndCall(_logic, _data, false);
}
/// ///
/// FUNCTIONS ///
/// ///
/// @dev The address of the current implementation
function _implementation() internal view virtual override returns (address) {
return ERC1967Upgrade._getImplementation();
}
}