OpenZeppelin/nile

Add EthAccount support as plugin

andrew-fleming opened this issue · 0 comments

Nile currently only supports the standard OZ account. While EthAccount could be integrated into Nile, I think it's preferable for EthAccount support to exist as a plugin because it's not part of the core functionality of Nile—it's a nice-to-have. If the plugin approach seems preferable, this will supersede #337.

The refactored tx flow of Nile enables a fairly simple process for creating this plugin. #341 offers a roadmap (albeit a messy one). Here's a supplemental guide for the plugin.

Artifacts

Simply compile and store the EthAccount artifact and ABI.

eth_signer

This is already done here https://github.com/andrew-fleming/nile/blob/eth-account/src/nile/signer.py#L80-L94

eth_transactions

Most (if not all) of the work is already done here https://github.com/andrew-fleming/nile/blob/eth-account/src/nile/core/types/account.py

Note that the only real changes include signing the tx with the EthSigner, passing the signature correctly, and setting the abi path to EthAccount.

eth_account

This area is partially done in the drafted PR. Take note that signer.public_key needs to be signer.eth_address. It seems like most of the work will focus on deploying EthAccount (deploy an EthAccount from a standard Account as a workaround during development). Otherwise, most of the code can be c/p from account.py.

eth_counterfactual_address

Needs to be done.