Skip to content

Instantly share code, notes, and snippets.

Welcome

This guide is intended to provide resources for those wanting to help test Metropolis EIPs. The CPP team is currently in the middle of a migration from EthDocs to a documentation site that is more dedicated to CPP-Ethereum so the documentation on creating tests for Ethereum using testeth is scattered. Everything you will need to get started should be compiled below.

Suggested skill sets needed to create and run tests

  1. Ability to compile/build testeth and LLL compiler or run a docker file.
  2. Ability to understand the LLL Ethereum language.
  3. Ability to understand EIPs, particuarly [those that are going to be going into t

Keybase proof

I hereby claim:

  • I am pirapira on github.
  • I am pirapira (https://keybase.io/pirapira) on keybase.
  • I have a public key ASA6RAHQO73dc8kBsVh_lc6eIq13DGlZJ5qT5Q5uTbrdCwo

To claim this, I am signing this object:

Test Case "bcShanghaiLoveHomestead":
100%
==651==T20098: stack [0x700000107000,0x700000187000) size 0x80000; local=0x700000186ea8
==651==T20099: stack [0x70000018a000,0x70000020a000) size 0x80000; local=0x700000209ea8
==651==T20100: stack [0x70000020d000,0x70000028d000) size 0x80000; local=0x70000028cea8
==651==T20101: stack [0x700000290000,0x700000310000) size 0x80000; local=0x70000030fea8
==651==T20102: stack [0x700000313000,0x700000393000) size 0x80000; local=0x700000392ea8
==651==T20103: stack [0x700000396000,0x700000416000) size 0x80000; local=0x700000415ea8
==651==T20104: stack [0x700000419000,0x700000499000) size 0x80000; local=0x700000498ea8
==651==T20105: stack [0x70000049c000,0x70000051c000) size 0x80000; local=0x70000051bea8
TIMESTAMP
JUMPDEST
BALANCE
DUP1
JUMP
JUMPDEST
BALANCE
DUP1
JUMP
JUMPDEST
> src0 = "contract Events { function getEvent(bytes32 eventHash) returns (int a, int b, int c, int d, int e) {}}"
> src1 = "contract Events { function getEvent(bytes32 eventHash) returns (int a, int b, int c, int d, int e);} contract test { function foo(address addr) { Events events = Events(addr); var (,,,,) = events.getEvent(0); } }"
> admin.setSolc("./src/solidity/build-develop/solc/solc")
> eth.compile.solidity(src0)
> contracts0 = eth.compile.solidity(src0)
> contracts1 = eth.compile.solidity(src1)
/usr/bin/ld: cannot find -lLLVMLinker
/usr/bin/ld: cannot find -lLLVMX86Disassembler
/usr/bin/ld: cannot find -lLLVMX86AsmParser
/usr/bin/ld: cannot find -lLLVMX86CodeGen
/usr/bin/ld: cannot find -lLLVMSelectionDAG
/usr/bin/ld: cannot find -lLLVMAsmPrinter
/usr/bin/ld: cannot find -lLLVMX86Desc
/usr/bin/ld: cannot find -lLLVMMCDisassembler
/usr/bin/ld: cannot find -lLLVMX86Info
/usr/bin/ld: cannot find -lLLVMX86AsmPrinter
@pirapira
pirapira / example1.v
Last active August 30, 2016 19:38
An analysis of an Ethereum contract.
(* Coq 8.5pl5 with ssreflect 1.5. *)
(* Can be interesting to read this in Emacs with ProofGeneral 4.3pre150930. *)
(* There, maybe repeat `proof-assert-next-command-interactive`. *)
Require Import String.
Require Import List.
Require Import FMapInterface.
Require Import ssreflect ssrbool.
@pirapira
pirapira / auction00.sol
Last active November 4, 2021 13:32
An auction contract written in Solidity
contract auction {
// An auction contract written in Solidity
// Can be deployed similarly to what is described at:
// https://dappsforbeginners.wordpress.com/tutorials/your-first-dapp/
// Initialization.
// Remembering bids from each address.
mapping (address => uint) bids;
// Also remembering the max_bid and the max_bidder to easily determine the winner.
uint max_bid = 0;
Require Import ssreflect ssrbool eqtype ssrnat seq ssrfun fintype.
Ltac 破 := case.
Ltac 解 := elim.
Ltac 動 := move.
Ltac 割 := split.
Ltac 矣 := done.
Ltac 用 := apply.
Ltac 在 := exists.
@pirapira
pirapira / IOtt.v
Created September 27, 2012 07:53
proving monad laws for something.
(**
IOtt functor from
Swierstra, Wouter, and Thorsten Altenkirch. "Beauty in the Beast."
In Proceedings of the ACM SIGPLAN Workshop on Haskell Workshop.
Haskell '07. ACM, 2007. http://doi.acm.org/10.1145/1291201.1291206.
**)
Require Import Logic.FunctionalExtensionality.
Inductive IOtt (a: Set) : Set :=