Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solidity models of L2 precompiled contracts: ArbSys and ArbTxRetryable #105

Draft
wants to merge 90 commits into
base: master
Choose a base branch
from

Conversation

ggrieco-tob
Copy link
Member

@ggrieco-tob ggrieco-tob commented Jun 29, 2022

This PR introduces two smart contracts in Solidity that provide some basic emulation (e.g. models) of Arbitrum precompiled contracts: ArbSys and ArbRetryableTx. The objective is to allow testing of some code deployed in Arbitrum directly from Etheno/Echidna.

Etheno should deploy ArbSysEmulated in 0x0000000000000000000000000000000000000064 and ArbRetryableTxEmulated in 0x000000000000000000000000000000000000006E in order to be used from Echidna.

As expected, only some functionality can be emulated from Solidity, but this should be enough for some basic support.

As a future work, the same idea could be replicated with predeployed Optimism contracts

ggrieco-tob and others added 30 commits September 3, 2021 09:19
Older versions depend on the deprecated ethereum-* libraries instead
of the newer eth-*, which cause a deprecation notice.
Manticore 0.3.6 causes issues when running etheno, see issue
#80 for the details.
This is done automatically in Dockerfiles
get.parity.io does not exist anymore
The upstream bug in ganache-cli appears to have been fixed.
This fixes an issue with the dockerfile getting stuck when installing
tzdata
anishnaik and others added 30 commits July 7, 2022 16:39
Co-authored-by: Emilio López <2642849+elopez@users.noreply.github.com>
…uest object modular

Two changes:
1. Removed unused code that was dependent on using integers as the mapping for EventPlugin._transactions mapping and for converting hashes into hex strings
2. Moved get_transaction_receipt_request into etheno.py so that both clients and plugins can use itt.
Used `black` to make code PEP 8 compliant
Fix issue with function call logging and PEP 8 Compliance
There have been a lot of changes that need to be pulled in to make development on this branch much easier.
It is easier to parse and compile individual contracts than to read the entire file and then separate into separate byte arrays for compilation.
1. Added command line argument to enable compilation of ArbSys and ArbRetryableTx
2. Created Precompiler EthenoPlugin that successfully compiles ArbSys.sol
3. Added logic to __main__.py to add Precompiler as an EthenoPlugin if the command-line argument is set to True and Ganache is the RPC Provider
`solc` was complaining that all functions that were inherited from the ArbRetryableTx interface need to have the `override` modifier. Thus, the modifiers were added
Here are the key changes:
1. Made finding the final offset in `precompiler.compile()` more flexible (note that only the last contract in a .sol file is deployed)
2. `etheno.deploy_contract` now returns a hex string instead of an int. The rationale for this is explained in the commend above that return statement.
3. Both ArbSys and ArbRetryableTx are now being deployed via Ganache.
4. Improved error handling for not finding files or unsuccessful compilation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants