-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
125 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
|
||
pragma solidity 0.8.24; | ||
|
||
|
||
|
||
// Mock token that uses all available gas on exchange rate calls. | ||
// This contract code is etched over LST token addresses in mainnet fork tests. | ||
// Has exchange rate functions for WSTETH and RETH. | ||
contract GasGuzzlerToken { | ||
uint256 pointlessStorageVar = 42; | ||
|
||
// RETH exchange rate getter | ||
function getExchangeRate() external view returns (uint256) { | ||
// Expensive SLOAD loop that hits the block gas limit before completing | ||
for (uint256 i = 0; i < 1000000; i++) { | ||
uint256 unusedVar = pointlessStorageVar + i; | ||
} | ||
return 11e17; | ||
} | ||
|
||
// WSTETH exchange rate getter | ||
function stEthPerToken() external view returns (uint256) { | ||
// Expensive SLOAD loop that hits the block gas limit before completing | ||
for (uint256 i = 0; i < 1000000; i++) { | ||
uint256 unusedVar = pointlessStorageVar + i; | ||
} | ||
return 11e17; | ||
} | ||
} |