- Optional/nullable data types.
- Variant data types.
- Flag with extra information needed only in some cases (or different in different cases).
- Modeling states in a state machine where each state can have some data associated with it.
- List of operations for batch processing, where each operation can have its own arguments.
- Alternative to function overloading that allows avoiding combinatorial explosion when there are multiple parameters that need variants.
- Nested data structures with heterogenous nodes.
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
Chromosome: xiDslifaCrDLLujnxmIuVsetcuTjersOvjmnu | |
Program: erc20.sol-ERC20.yul | |
{ | |
mstore(64, 128) | |
if iszero(lt(calldatasize(), 4)) | |
{ | |
switch shr(224, calldataload(0)) | |
case 0x095ea7b3 { | |
if callvalue() { revert(0, 0) } | |
let param_0, param_1 := abi_decode_tuple_t_addresst_uint256(4, calldatasize()) |
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
pragma solidity ^0.7.0; | |
// SPDX-License-Identifier: GPLv3 | |
contract PrologContract { | |
struct Term { | |
string value; // If empty, term is a list, otherwise it's a predicate. | |
// value can represent an atom, variable, | or _. | |
Term[] children; | |
} |
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
# Default sequence from solc 0.8.24 | |
dhfoDgvulfnTUtnIf # None of these can make stack problems worse | |
[ | |
xa[r]EscLM # Turn into SSA and simplify | |
cCTUtTOntnfDIul # Perform structural simplification | |
Lcul # Simplify again | |
Vcul [j] # Reverse SSA | |
# should have good "compilability" property here. |
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
# Default sequence from solc 0.8.24 adjusted to stay in SSA form instead of reversing it in each cycle. | |
# Minimal version - only removes the `Vcul [j]` bit. | |
dhfoDgvulfnTUtnIf # None of these can make stack problems worse | |
[ | |
xa[r]EscLM # Turn into SSA and simplify | |
cCTUtTOntnfDIul # Perform structural simplification | |
Lcul # Simplify again | |
# should have good "compilability" property here. |
https://github.com/cameel/solc-seqbench
- Define inputs
- optimizer sequences
- contracts
- sequences of external calls with parameters
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
# Default sequence from solc 0.8.24 with only a single iteration of the main loop | |
dhfoDgvulfnTUtnIf # None of these can make stack problems worse | |
xa[r]EscLM # Turn into SSA and simplify | |
cCTUtTOntnfDIul # Perform structural simplification | |
Lcul # Simplify again | |
Vcul [j] # Reverse SSA | |
# should have good "compilability" property here. |
OlderNewer