@@ -35,8 +35,20 @@ abstract contract BaseHarvester is IHarvester, AccessControl {
35
35
MODIFIERS
36
36
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
37
37
38
- modifier onlyAllowedOrGuardian () {
39
- if (! isAllowed[msg .sender ] && ! accessControlManager.isGovernorOrGuardian (msg .sender )) revert NotTrusted ();
38
+ /**
39
+ * @notice Checks whether the `msg.sender` is trusted to update target exposure and do others non critical operations
40
+ */
41
+ modifier onlyTrusted () {
42
+ if (! isTrusted[msg .sender ]) revert NotTrusted ();
43
+ _;
44
+ }
45
+
46
+ /**
47
+ * @notice Checks whether the `msg.sender` is trusted or guardian to update target exposure and do others non critical operations
48
+ */
49
+ modifier onlyTrustedOrGuardian () {
50
+ if (! isTrusted[msg .sender ] && ! accessControlManager.isGovernorOrGuardian (msg .sender ))
51
+ revert NotTrustedOrGuardian ();
40
52
_;
41
53
}
42
54
@@ -52,8 +64,8 @@ abstract contract BaseHarvester is IHarvester, AccessControl {
52
64
uint96 public maxSlippage;
53
65
/// @notice Data associated to a yield bearing asset
54
66
mapping (address => YieldBearingParams) public yieldBearingData;
55
- /// @notice Whether an address is allowed to update the target exposure of a yield bearing asset
56
- mapping (address => bool ) public isAllowed ;
67
+ /// @notice trusted addresses that can update target exposure and do others non critical operations
68
+ mapping (address => bool ) public isTrusted ;
57
69
58
70
/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
59
71
CONSTRUCTOR
@@ -121,23 +133,23 @@ abstract contract BaseHarvester is IHarvester, AccessControl {
121
133
}
122
134
123
135
/**
124
- * @notice add an address to the allowed list
125
- * @param account address to be added
136
+ * @notice Toggle the trusted status of an address
137
+ * @param trusted address to toggle the trusted status
126
138
*/
127
- function toggleAllowed (address account ) external onlyGuardian {
128
- isAllowed[account ] = ! isAllowed[account ];
139
+ function toggleTrusted (address trusted ) external onlyGuardian {
140
+ isTrusted[trusted ] = ! isTrusted[trusted ];
129
141
}
130
142
131
143
/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
132
- ALLOWED FUNCTIONS
144
+ TRUSTED FUNCTIONS
133
145
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
134
146
135
147
/**
136
148
* @notice Set the target exposure of a yield bearing asset
137
149
* @param yieldBearingAsset address of the yield bearing asset
138
150
* @param targetExposure target exposure to the yield bearing asset used
139
151
*/
140
- function setTargetExposure (address yieldBearingAsset , uint64 targetExposure ) external onlyAllowedOrGuardian {
152
+ function setTargetExposure (address yieldBearingAsset , uint64 targetExposure ) external onlyTrustedOrGuardian {
141
153
yieldBearingData[yieldBearingAsset].targetExposure = targetExposure;
142
154
}
143
155
0 commit comments