-
-
Save novaknole/5f761849cba2f076d8b89bc78a137af8 to your computer and use it in GitHub Desktop.
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
contract BadGuy { | |
function youveActivateMyTrapCard() external pure returns (bytes memory) { | |
assembly{ | |
revert(0, 10000000000000000000000) | |
} | |
} | |
} | |
contract Mark { | |
uint public a = 5; | |
function oops(address badGuy) public { | |
bool success; | |
bytes memory ret; | |
// Mark pays a lot of gas for this copy 😬😬😬 | |
(success, ret) = badGuy.call{gas: 30000}( | |
abi.encodeWithSelector( | |
BadGuy.youveActivateMyTrapCard.selector | |
) | |
); | |
// Still succeeds | |
a = 10; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment