Skip to content

beeinger/hdp-provable-eth-call

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HDP EVM ByteCode

ℹ️ 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-hdp branch.

Prerequisites

To install run:

curl -fsSL https://raw.githubusercontent.com/HerodotusDev/hdp-cairo/main/install-cli.sh | bash

Development

To run see commands in run.sh or run it directly:

./run.sh

Waiting on HDP features

  • account_get_bytecode
  • fusaka fork compatibility
  • account_is_deployed
  • header_get_prevrandao
  • secp256r1 support
  • EC ops support

TODOs

Next Goals:

  • execute simple bytecode (DONE! run ERC20 decimals())
  • execute more complex bytecode accessing storage slots
    • needs fusaka compatibility PR on HDP for the sound run to pass
  • execute even more complex bytecode - a proxy running the code of another contract
    • needs account_get_bytecode PR on HDP to be possible

TODOs:

ℹ️ 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_bytecode remains unimplemented, it needs HDP support.
      • is_deployed currently returns true always, unless it panics, needs a proper way of handling this check
  • fix precompiles in interpreter.cairo search for: [precompiles]

    • two precompiles need HDP to support them first: EcAdd, EcMul
    • also everything based on secp256r1 won't work until HDP supports it
  • 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_main but needs HDP to support bytecode first.
  • Create a new folder solidity for testing contracts to use

    • basic function, just simple bytecode
    • more advanced functions
      • using storage slots
      • using precompiles
    • proxy contract

Mentions

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


License

hdp-provable-eth-call is licensed under the GNU General Public License v3.0.


About

Provable ETH call in Cairo 1 using HDP.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 2

  •  
  •