From fbcb5fd1c5447689d1334be6fae0e1075f387fcf Mon Sep 17 00:00:00 2001 From: Hugo De La Cruz Date: Fri, 1 Mar 2024 20:39:22 -0700 Subject: [PATCH] Add yul-eof compiler in config --- retesteth/configs/Options.h | 1 + retesteth/configs/clientconfigs/t8ntool.cpp | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/retesteth/configs/Options.h b/retesteth/configs/Options.h index c38dc6750..ea4b1059b 100644 --- a/retesteth/configs/Options.h +++ b/retesteth/configs/Options.h @@ -6,6 +6,7 @@ namespace retesteth::options { extern dataobject::DataObject map_configs; extern std::string const yul_compiler_sh; +extern std::string const yul_eof_compiler_sh; extern std::string const t8ntool_start; #define REGISTER(X) \ diff --git a/retesteth/configs/clientconfigs/t8ntool.cpp b/retesteth/configs/clientconfigs/t8ntool.cpp index 0639d6d1b..05589e070 100644 --- a/retesteth/configs/clientconfigs/t8ntool.cpp +++ b/retesteth/configs/clientconfigs/t8ntool.cpp @@ -29,6 +29,26 @@ else fi )"; +string const yul_eof_compiler_sh = R"(#!/bin/sh +solc=$(which solc) +if [ -z $solc ]; then + >&2 echo "yul-eof.sh \"Yul (EOF) compilation error: 'solc' not found!\"" + echo "0x" +else + eof_gen=$(which eof_gen) + if [ -z $eof_gen ]; then + >&2 echo "yul-eof.sh \"Yul (EOF) compilation error: 'eof_gen' not found!\"" + echo "0x" + fi + # eof_gen command from https://github.com/hugo-dc/eofscripts + # Install: + # go install github.com/hugo-dc/eofscripts/cmd/eof_gen + evm=$(solc --assemble $1 | grep -i "^[0-9]") + echo 0x$(eof_gen c:$evm | tail -n1) +fi +)"; + + string const t8ntool_start = R"(#!/bin/sh wevm=$(which evm)