Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions contracts/v2/VaultV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,27 @@ contract VaultV2 is ReentrancyGuard {
backstopRouter = _backstopRouter;
}

/**
* @notice Admin escape hatch: withdraw from feePool to any address
* @dev Covers LMSR fees that have no per-contract tracking/withdrawal path.
* Exchange and ShareToken track their own portions via protocolFeesAccumulated,
* creatorFeesAccumulated, and resolutionFeesAccumulated — admin should only
* withdraw the untracked remainder (LMSR fees).
* @param to Recipient address (typically treasury)
* @param amount USDC amount to withdraw from feePool
*/
function adminWithdrawFeePool(address to, uint256 amount) external onlyAdmin whenNotPaused {
if (amount == 0) revert ZeroAmount();
if (to == address(0)) revert ZeroAddress();
if (feePool < amount) revert InsufficientFeePool();

feePool -= amount;
balances[to] += amount;
totalBalances += amount;

emit LedgerTransfer(address(this), to, amount, LedgerReason.WithdrawFeePool);
}

function pause() external onlyAdmin {
paused = true;
emit Paused(msg.sender);
Expand Down
Loading