From faecab11003f884a6d36776aa261600c05f36b70 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 15 Apr 2020 12:03:19 +0100 Subject: [PATCH] Add Makefile and instructions for the tests in the README --- Makefile | 12 ++++++++++++ README.md | 10 ++++++++++ 2 files changed, 22 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..7564a587d --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +all: compile + +clean: + @rm -f DepositContract.abi DepositContract.bin IDepositContract.abi IDepositContract.bin deposit_contract.json + +compile: clean + @solc --bin --abi --overwrite -o . deposit_contract.sol + @/bin/echo -n '{"abi": ' > deposit_contract.json + @cat DepositContract.abi >> deposit_contract.json + @/bin/echo -n ', "bytecode": "0x' >> deposit_contract.json + @cat DepositContract.bin >> deposit_contract.json + @/bin/echo -n '"}' >> deposit_contract.json diff --git a/README.md b/README.md index 99a0f118c..f34864759 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,13 @@ This is a just for fun port of the [Vyper Eth 2.0 deposit contract](https://gith The motivation is to run the SMTChecker and the new Yul IR generator option (`--ir`) in the compiler. **THIS IS NOT THE OFFICIAL DEPOSIT CONTRACT. NOT SUITABLE FOR ANY USE** + +## Using this with the tests + +1. Create the `deposit_contract.json` with running `make` (this requires `solc` to be in the path) +2. Download [eth2.0-specs](https://github.com/ethereum/eth2.0-specs) +3. Replace `eth2.0-specs/deposit_contract/contracts/validator_registration.json` with `deposit_contract.json` +4. In the `eth2.0-specs` directory run `make install_deposit_contract_tester` to install the tools needed (make sure to have Python 3.7 and pip installed) +5. Finally in the `eth2.0-specs` directory run `make test_deposit_contract` to execute the tests + +The Makefile currently compiles the code without optimisations. To enable optimisations add `--optimize` to the `solc` line.