@@ -6,6 +6,7 @@ import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
66import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol " ;
77
88import { Universal_SpokePool, IHelios } from "../../../../contracts/Universal_SpokePool.sol " ;
9+ import "../../../../contracts/SpokePool.sol " ;
910import "../../../../contracts/libraries/CircleCCTPAdapter.sol " ;
1011import "../../../../contracts/test/MockCCTP.sol " ;
1112import { IOFT, SendParam, MessagingFee } from "../../../../contracts/interfaces/IOFT.sol " ;
@@ -26,11 +27,7 @@ contract MockHelios is IHelios {
2627 headTimestamp = _timestamp;
2728 }
2829
29- function getStorageSlot (
30- uint256 ,
31- address ,
32- bytes32 _key
33- ) external view returns (bytes32 ) {
30+ function getStorageSlot (uint256 , address , bytes32 _key ) external view returns (bytes32 ) {
3431 return storageSlots[_key];
3532 }
3633}
@@ -62,7 +59,7 @@ contract MockUniversalSpokePool is Universal_SpokePool {
6259 )
6360 {}
6461
65- function test_bridgeTokensToHubPool (uint256 amountToReturn , address l2TokenAddress ) external {
62+ function test_bridgeTokensToHubPool (uint256 amountToReturn , address l2TokenAddress ) external payable {
6663 _bridgeTokensToHubPool (amountToReturn, l2TokenAddress);
6764 }
6865}
@@ -365,13 +362,10 @@ contract UniversalSpokePoolTest is Test {
365362 spokePool.executeMessage (nonce, value, 100 );
366363 nonce++ ; // Increment nonce for the next message
367364
368- // Fund the spokePool with enough native currency to attempt the transaction but less than the high fee
369- // The check for OFT_FEE_CAP happens before the balance check.
370- deal (address (spokePool), spokePool.OFT_FEE_CAP ());
371-
372- // Expect the OftFeeCapExceeded error from OFTTransportAdapter
365+ // Expect the OftFeeCapExceeded error from OFTTransportAdapter.
366+ // Provide msg.value to cover the quoted fee so the cap guard is triggered.
373367 vm.expectRevert (OFTTransportAdapter.OftFeeCapExceeded.selector );
374- spokePool.test_bridgeTokensToHubPool (usdcMintAmount, address (usdt));
368+ spokePool.test_bridgeTokensToHubPool { value: highNativeFee } (usdcMintAmount, address (usdt));
375369 }
376370
377371 function testBridgeTokensToHubPool_oft () public {
@@ -423,12 +417,9 @@ contract UniversalSpokePoolTest is Test {
423417 spokePool.executeMessage (nonce, value, 100 );
424418 nonce++ ;
425419
426- // Ensure spokePool has less balance than nativeFee
427- deal (address (spokePool), nativeFee - 1 );
428-
429- // Expect revert due to insufficient balance for fee
430- vm.expectRevert (OFTTransportAdapter.OftInsufficientBalanceForFee.selector );
431- spokePool.test_bridgeTokensToHubPool (usdcMintAmount, address (usdt));
420+ // Expect revert due to caller underpaying the required OFT native fee
421+ vm.expectRevert (SpokePool.OFTFeeUnderpaid.selector );
422+ spokePool.test_bridgeTokensToHubPool { value: nativeFee - 1 }(usdcMintAmount, address (usdt));
432423 }
433424
434425 function testBridgeTokensToHubPool_oft_incorrectAmountReceived () public {
0 commit comments