ℹ️ This repo has served it's purpose, provable ETH call is now a part of HDP Cairo 🎉🚀
What is left here is an example of usage of the provable ETH call, with testing contracts, serving as a testing/experimentation suite for the provable ETH call.
Last state before move to the HDP Cairo repo is available on the
before-move-to-hdpbranch.
To install run:
curl -fsSL https://raw.githubusercontent.com/HerodotusDev/hdp-cairo/main/install-cli.sh | bash
To run see commands in run.sh or run it directly:
./run.sh
-
account_get_bytecode -
fusaka forkcompatibility -
account_is_deployed -
header_get_prevrandao -
secp256r1support -
EC opssupport
- execute simple bytecode (DONE! run ERC20 decimals())
- execute more complex bytecode accessing storage slots
-
needsfusaka compatibility PRon HDP for the sound run to pass
-
- execute even more complex bytecode - a proxy running the code of another contract
- needs
account_get_bytecode PRon HDP to be possible
- needs
ℹ️ Search the code for
TODO: @herodotus [<subject>]
-
Cleanup lib.cairo
- split into functions
- generic function for running calldata and expecting a result
- file with testing setup - a list of all calldata + expected result pairs to not have them hardcoded in lib.cairo
- run all methods on the HPECT1 contract - comment out the ones using calls to other contracts or precompiles we dont support
-
implement everything in hdp-backend.cairo
- storage - todos with
[storage] - account - todos with
[account]-
fetch_bytecoderemains unimplemented, it needs HDP support. -
is_deployedcurrently returnstruealways, unless it panics, needs a proper way of handling this check
-
- storage - todos with
-
fix precompiles in interpreter.cairo search for:
[precompiles]- two precompiles need HDP to support them first:
EcAdd,EcMul - also everything based on
secp256r1won't work until HDP supports it
- two precompiles need HDP to support them first:
-
resolve
[misc]TODOs along the way -
Cleanup & brainstorm how to tackle Environment and Message structs setup in lib.cairo
- Especially Environment stuff like gas price, chain id, prevrandao, block number, gas limit, timestamp, coinbase, base fee - they all have to come from somewhere
- Only field missing is
prevrundao - Better setup is places in
new_mainbut needs HDP to support bytecode first.
- Only field missing is
- Especially Environment stuff like gas price, chain id, prevrandao, block number, gas limit, timestamp, coinbase, base fee - they all have to come from somewhere
-
Create a new folder
solidityfor testing contracts to use- basic function, just simple bytecode
- more advanced functions
- using storage slots
- using precompiles
- proxy contract
This project makes use of code adapted from Kakarot (@kkrt-labs/kakarot-ssj) under the MIT License.
Thanks for all the hard work guys 🙏
Original project: https://github.com/kkrt-labs/kakarot-ssj
License file: https://github.com/kkrt-labs/kakarot-ssj/blob/main/LICENSE
hdp-provable-eth-call is licensed under the GNU General Public License v3.0.