File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
packages/ethereum-contracts/test/foundry/superfluid/yieldbackend Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -235,6 +235,14 @@ abstract contract YieldBackendUnitTestBase is Test {
235235 assertGt (receiverBalanceAfter, receiverBalanceBefore, "surplus receiver balance should increase " );
236236 }
237237
238+ /// @notice Test withdrawSurplus() direct call fails - assert: reverts when called directly (not via delegatecall)
239+ function testWithdrawSurplusDirectCallFails () public {
240+ // Attempt to call withdrawSurplus directly on backend (not via delegatecall)
241+ // This should fail because address(this) in backend context is the backend itself, not a SuperToken
242+ vm.expectRevert ();
243+ IYieldBackend (address (backend)).withdrawSurplus (0 );
244+ }
245+
238246 // ============ Internal helper functions ============
239247
240248 /// @notice Bound amount to reasonable range based on asset decimals
You can’t perform that action at this time.
0 commit comments