Add Makefile and instructions for the tests in the README

This commit is contained in:
Alex Beregszaszi 2020-04-15 12:03:19 +01:00
parent b0c9d8c2fd
commit faecab1100
2 changed files with 22 additions and 0 deletions

12
Makefile Normal file
View File

@ -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

View File

@ -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.