File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
pragma solidity ^ 0.8.20 ;
4
4
5
- import { IAuthority } from "@openzeppelin/contracts/access/manager/IAuthority.sol " ;
6
- import { Masks } from "../utils/Masks.sol " ;
5
+ import { IAuthority } from "@openzeppelin/contracts/access/manager/IAuthority.sol " ;
6
+ import { Masks } from "../utils/Masks.sol " ;
7
7
8
8
contract AccessManagerLight is IAuthority {
9
9
using Masks for * ;
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: MIT
2
+
3
+ pragma solidity ^ 0.8.20 ;
4
+
5
+ import {IBeacon} from "@openzeppelin/contracts/proxy/beacon/IBeacon.sol " ;
6
+ import {ERC1967Utils } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol " ;
7
+ import {Proxy} from "@openzeppelin/contracts/proxy/Proxy.sol " ;
8
+ import {Address} from "@openzeppelin/contracts/utils/Address.sol " ;
9
+
10
+ contract HybridProxy is Proxy {
11
+ constructor (address implementation , bytes memory data )
12
+ {
13
+ ERC1967Utils .upgradeToAndCall (implementation, "" );
14
+ if (data.length > 0 ) {
15
+ Address.functionDelegateCall (_implementation (), data);
16
+ }
17
+ }
18
+
19
+ function _implementation ()
20
+ internal
21
+ view
22
+ override
23
+ returns (address )
24
+ {
25
+ address implementation = ERC1967Utils .getImplementation ();
26
+ try IBeacon (implementation).implementation () returns (address result ) {
27
+ return result;
28
+ } catch {
29
+ return implementation;
30
+ }
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments