Emergency Controls
Last updated
Last updated
The rescueTokens
function allows Node owners to recover tokens accidentally sent to the Node that are not part of its components.
function rescueTokens(address token, address recipient, uint256 amount) external onlyOwner {
if (token == asset) revert ErrorsLib.InvalidToken();
if (_isComponent(token)) revert ErrorsLib.InvalidToken();
IERC20(token).safeTransfer(recipient, amount);
emit EventsLib.RescueTokens(token, recipient, amount);
}
Only Node owner can call
Cannot rescue Node's underlying asset
Cannot rescue any token that is a component
Token must implement ERC20
Recover tokens sent to Node by mistake
Remove airdrops or other unwanted tokens
Clean up Node contract of non-component assets
The function prevents extraction of:
function _isComponent(address component) internal view returns (bool) {
return componentAllocations[component].isComponent;
}
Node's underlying asset
Any current component tokens
Any tokens used in Node strategies