Shuffler Management
Setup and manage Shufflers
Last updated
Setup and manage Shufflers
Last updated
Execute setCurator(0xNewCurator)
function setCurator(address newCurator) external onlyOwner {
if (newCurator == curator) revert ErrorsLib.AlreadySet();
curator = newCurator;
emit EventsLib.SetCurator(newCurator);
}
Execute
setIsAllocator(0xNewAllocator, true)
. One can set the second attribute to false to revoke the allocation capacity.
function setIsAllocator(address newAllocator, bool newIsAllocator) external onlyOwner {
if (isAllocator[newAllocator] == newIsAllocator) revert ErrorsLib.AlreadySet();
isAllocator[newAllocator] = newIsAllocator;
emit EventsLib.SetIsAllocator(newAllocator, newIsAllocator);
}
Note that if no guardian is set, (which is the case at vault creation), submitting a new guardian sets it immediately as the guardian. Execute
submitGuardian(0xNewGuardian)
function submitGuardian(address newGuardian) external onlyOwner {
if (newGuardian == guardian) revert ErrorsLib.AlreadySet();
if (pendingGuardian.validAt != 0) revert ErrorsLib.AlreadyPending();
if (guardian == address(0)) {
_setGuardian(newGuardian);
} else {
pendingGuardian.update(newGuardian, timelock);
emit EventsLib.SubmitGuardian(newGuardian);
}
Execute setFeeRecipient(0xNewFeeRecipient)
Execute setFee(10000000000000000)
// 1%, FEE variable has 18 decimals.
function setFee(uint256 newFee) external onlyOwner {
if (newFee == fee) revert ErrorsLib.AlreadySet();
if (newFee > ConstantsLib.MAX_FEE) revert ErrorsLib.MaxFeeExceeded();
if (newFee != 0 && feeRecipient == address(0)) revert ErrorsLib.ZeroFeeRecipient();
// Accrue fee using the previous fee set before changing it.
_updateLastTotalAssets(_accrueFee());
// Safe "unchecked" cast because newFee <= MAX_FEE.
fee = uint96(newFee);
emit EventsLib.SetFee(_msgSender(), fee);
}
/// @inheritdoc INatriumBase
function setFeeRecipient(address newFeeRecipient) external onlyOwner {
if (newFeeRecipient == feeRecipient) revert ErrorsLib.AlreadySet();
if (newFeeRecipient == address(0) && fee != 0) revert ErrorsLib.ZeroFeeRecipient();
// Accrue fee to the previous fee recipient set before changing it.
_updateLastTotalAssets(_accrueFee());
feeRecipient = newFeeRecipient;
emit EventsLib.SetFeeRecipient(newFeeRecipient);
}
The skim recipient will receive all rewards that may have been allocated to the vault, while the latter earned them by allocating liquidity on Natrium markets.
function skim(address token) external {
if (skimRecipient == address(0)) revert ErrorsLib.ZeroAddress();
uint256 amount = IERC20(token).balanceOf(address(this));
IERC20(token).safeTransfer(skimRecipient, amount);
emit EventsLib.Skim(_msgSender(), token, amount);
}