Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nmirchev8_ctf - Incorrect check for gas #44

Open
0xleadwizard opened this issue Aug 13, 2024 · 1 comment
Open

nmirchev8_ctf - Incorrect check for gas #44

0xleadwizard opened this issue Aug 13, 2024 · 1 comment
Labels
invalid This doesn't seem right

Comments

@0xleadwizard
Copy link

The current check is:
x = (g-g/64)
y = gasLImit
x > y else revert
but it should be x >= y

      // if g - g//64 <= gasAmount, revert. We subtract g//64 because of EIP-150
      if iszero(gt(sub(g, div(g, 64)), gasLimit)) {
        mstore(0x0, NOT_ENOUGH_GAS_FOR_CALL_SIG)
        revert(0x0, 0x4)
      }
@NicolaMirchev NicolaMirchev added the invalid This doesn't seem right label Aug 17, 2024
@NicolaMirchev
Copy link
Contributor

This is intended behaviour as you can see by the comment:
if g - g//64 <= gasAmount, revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants