@@ -3,33 +3,21 @@ pragma solidity ^0.8.20;
3
3
4
4
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol " ;
5
5
import {IPolicy} from "../interfaces/IPolicy.sol " ;
6
+ import {Clone} from "../proxy/Clone.sol " ;
6
7
import {LibClone} from "solady/src/utils/LibClone.sol " ;
7
8
8
- abstract contract Policy is IPolicy , Ownable (msg .sender ) {
9
- /// @notice One-time initialization guard.
10
- bool private _initialized;
11
-
9
+ abstract contract Policy is Clone , IPolicy , Ownable (msg .sender ) {
12
10
/// @notice The “gatekeeped” contract address set once by the owner (if at all).
13
11
address internal target;
14
12
15
- /**
16
- * @notice The base init. By default, transfers ownership to `msg.sender` (i.e., the caller).
17
- * @dev If you want the factory to always be the owner, you just have the factory call this function,
18
- * so `msg.sender` is the factory in that transaction.
19
- */
20
- function initialize () public virtual {
21
- if (_initialized) revert AlreadyInitialized ();
22
- _initialized = true ;
13
+ function _initialize () internal virtual override {
14
+ super ._initialize ();
23
15
24
16
// By default, set the owner to the caller (likely the factory).
25
17
// this is not the zero address as above!
26
18
_transferOwnership (msg .sender );
27
19
}
28
20
29
- function _getAppendedBytes () internal view returns (bytes memory ) {
30
- return LibClone.argsOnClone (address (this ));
31
- }
32
-
33
21
/**
34
22
* @notice Only the owner can call `setTarget` once.
35
23
* @param _target The contract to be protected by this policy.
0 commit comments