-
Notifications
You must be signed in to change notification settings - Fork 101
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
1 parent
8bf9baa
commit ccccbb6
Showing
2 changed files
with
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
pragma solidity ^0.8.0; | ||
|
||
/* | ||
The returnDataSize value needs careful calibration: it should not be so high that it depletes all the gas, causing a revert, nor should it be so low that the function consumes all the gas yet still returns the data successfully. | ||
Our goal is to determine an optimal median value for returnDataSize that will ensure the outer call reverts as intended. | ||
*/ | ||
|
||
contract returnBomb { | ||
fallback() external { | ||
uint128 public returnDataSize = 10000; // by default | ||
|
||
function setReturnDataSize(uint128 _returnDataSize) external { | ||
returnDataSize = _returnDataSize; | ||
} | ||
|
||
fallback () external { | ||
assembly { | ||
revert(1, 10000000) | ||
revert(0,returnDataSize.slot) | ||
} | ||
} | ||
} |
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