Enable configuration for sharesActionTimelock, which will prevent shares price arbitrage attacks
However not enabled by default, as it also breaks our deposit contract that calls buySharesOnBehalf which needs to have the deposit contract whitelisted by Enzyme FundDeployer
/// @dev This function is freely callable if there is no sharesActionTimelock set, but it is
/// limited to a list of trusted callers otherwise, in order to prevent a griefing attack
/// where the caller buys shares for a _buyer, thereby resetting their lastSharesBought value.
function buySharesOnBehalf(
address _buyer,
uint256 _investmentAmount,
uint256 _minSharesQuantity
) external returns (uint256 sharesReceived_) {
bool hasSharesActionTimelock = getSharesActionTimelock() > 0;
address canonicalSender = __msgSender();
require(
!hasSharesActionTimelock ||
IFundDeployer(getFundDeployer()).isAllowedBuySharesOnBehalfCaller(canonicalSender),
"buySharesOnBehalf: Unauthorized"
);
return
__buyShares(
_buyer,
_investmentAmount,
_minSharesQuantity,
hasSharesActionTimelock,
canonicalSender
);
}
sharesActionTimelock
, which will prevent shares price arbitrage attacksbuySharesOnBehalf
which needs to have the deposit contract whitelisted by Enzyme FundDeployer