Skip to content

Instantly share code, notes, and snippets.

#include <type_traits>
#include <cassert>
enum class StructureType {
A, B, C
};
template<StructureType fixedType>
class alignas(StructureType) FixedStructureType {
StructureType value = fixedType;
#include <type_traits>
#include <cassert>
enum class StructureType {
A, B, C
};
template<StructureType fixedType>
class alignas(StructureType) FixedStructureType {
StructureType value = fixedType;
#include <vector>
enum class Instruction { STOP, ADD };
struct NotPresent {};
template<template<auto> typename Operation>
struct EVMBuiltins
{
static auto constexpr STOP = Operation<Instruction::STOP>{};
--- /tmp/with_ptr_opt 2020-03-13 14:54:27.070101705 +0100
+++ /tmp/without_ptr_opt 2020-03-13 14:54:06.510009293 +0100
@@ -11,11 +11,11 @@
value := calldataload(offset)
validator_revert_t_address(value)
}
- function abi_decode_t_array$_t_address_$dyn_memory_ptr(offset, end) -> array
+ function abi_decode_t_array$_t_address_$dyn_memory(offset, end) -> array
{
if iszero(slt(add(offset, 0x1f), end)) { revert(0, 0) }
--- /tmp/with_ptr 2020-03-13 14:53:35.666537168 +0100
+++ /tmp/without_ptr 2020-03-13 14:53:56.476630832 +0100
@@ -11,11 +11,11 @@
value := calldataload(offset)
validator_revert_t_address(value)
}
- function abi_decode_t_array$_t_address_$dyn_memory_ptr(offset, end) -> array
+ function abi_decode_t_array$_t_address_$dyn_memory(offset, end) -> array
{
if iszero(slt(add(offset, 0x1f), end)) { revert(0, 0) }
structure ABICoder : sig
type int
type 'a word
type abi_type
type 'a bit0
type num1
type char
type ('a, 'b) sum
type abi_value
val decode :
pragma experimental ABIEncoderV2;
struct ResizableArray {
uint256[] data;
uint256 size;
}
library ResizableArrayLibrary {
function length(ResizableArray memory a) internal pure returns(uint256) { return a.size; }
function capacity(ResizableArray memory a) internal pure returns(uint256) { return a.data.length; }
{
{
mstore(64, memoryguard(0x0120))
if iszero(lt(calldatasize(), 4))
{
switch shift_right_224_unsigned(calldataload(0))
case 0x13d1aa2e {
let param_0, param_1 := abi_decode_tuple_t_uint256t_uint256(4, calldatasize())
let ret_0 := fun_f_23(param_0, param_1)
let memPos := allocateMemory(0)
#!/usr/bin/env python
import os
import sys
import re
# Patterns to match Z3 API entry point definitions.
def_pat = re.compile(" *def_API(.*)")
extradef_pat = re.compile(" *extra_API(.*)")
# Pattern to extract name and arguments from the above.