Created
August 19, 2019 10:35
-
-
Save Marenz/596e33300290d10f0aee4f8f7602dbdb 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
contract C { | |
function f(bool a) public pure returns (bool x) { | |
bool b = a; | |
x = b; | |
require(b); | |
} | |
function fail() public pure returns (bool x) { | |
x = true; | |
require(false); | |
} | |
function succeed() public pure returns (bool x) { | |
x = true; | |
require(true); | |
} | |
function f2(bool a) public pure returns (bool x) { | |
x = a; | |
string memory message; | |
require(a, message); | |
} | |
function f3(bool a) public pure returns (bool x) { | |
x = a; | |
require(a, "msg"); | |
} | |
} | |
// ==== | |
// compileViaYul: true | |
// ---- | |
// f(bool): true -> true | |
// f(bool): false -> FAILURE | |
// fail() -> FAILURE | |
// succeed() -> true | |
// f2(bool): true -> true | |
// f2(bool): false -> FAILURE, hex"00", 0x00, "Transaction failed." | |
// f3(bool): true -> true | |
// f3(bool): false -> FAILURE, hex"00", 0x00, "Transaction failed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment