@@ -17,6 +17,7 @@ import {AllowList} from "contracts/allowlists/AllowList.sol";
17
17
import {Budget} from "contracts/budgets/Budget.sol " ;
18
18
import {Incentive} from "contracts/incentives/Incentive.sol " ;
19
19
import {Validator} from "contracts/validators/Validator.sol " ;
20
+ import {IAuth} from "contracts/auth/IAuth.sol " ;
20
21
21
22
/// @title Boost Core
22
23
/// @notice The core contract for the Boost protocol
@@ -53,6 +54,8 @@ contract BoostCore is Ownable, ReentrancyGuard {
53
54
/// @notice The BoostRegistry contract
54
55
BoostRegistry public registry;
55
56
57
+ IAuth public createBoostAuth;
58
+
56
59
/// @notice The protocol fee receiver
57
60
address public protocolFeeReceiver;
58
61
@@ -68,6 +71,13 @@ contract BoostCore is Ownable, ReentrancyGuard {
68
71
/// @notice The fee denominator (basis points, i.e. 10000 == 100%)
69
72
uint64 public constant FEE_DENOMINATOR = 10_000 ;
70
73
74
+ modifier canCreateBoost (address sender ) {
75
+ if (address (createBoostAuth) != address (0 ) && ! createBoostAuth.isAuthorized (sender)) {
76
+ revert BoostError.Unauthorized ();
77
+ }
78
+ _;
79
+ }
80
+
71
81
/// @notice Constructor to initialize the owner
72
82
constructor (BoostRegistry registry_ , address protocolFeeReceiver_ ) {
73
83
_initializeOwner (msg .sender );
@@ -92,7 +102,12 @@ contract BoostCore is Ownable, ReentrancyGuard {
92
102
/// - `uint256` for the referralFee (added to the base referral fee)
93
103
/// - `uint256` for the maxParticipants
94
104
/// - `address` for the owner of the Boost
95
- function createBoost (bytes calldata data_ ) external onlyOwner nonReentrant returns (BoostLib.Boost memory ) {
105
+ function createBoost (bytes calldata data_ )
106
+ external
107
+ canCreateBoost (msg .sender )
108
+ nonReentrant
109
+ returns (BoostLib.Boost memory )
110
+ {
96
111
InitPayload memory payload_ = abi.decode (data_.cdDecompress (), (InitPayload));
97
112
98
113
// Validate the Budget
@@ -160,6 +175,12 @@ contract BoostCore is Ownable, ReentrancyGuard {
160
175
return _boosts.length ;
161
176
}
162
177
178
+ /// @notice Set the createBoostAuth address
179
+ /// @param auth_ The new createBoostAuth address
180
+ function setCreateBoostAuth (address auth_ ) external onlyOwner {
181
+ createBoostAuth = IAuth (auth_);
182
+ }
183
+
163
184
/// @notice Set the protocol fee receiver address
164
185
/// @param protocolFeeReceiver_ The new protocol fee receiver address
165
186
/// @dev This function is only callable by the owner
0 commit comments