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

Feat: Implemented EOA Constructor and get_evm_address #230

Conversation

danilowhk
Copy link
Contributor

Implemented the constructor for EOA (previously initialize()):

https://github.com/kkrt-labs/kakarot/blob/c0c80301d4dfe384247b423a3bc2726522b5d1a8/src/kakarot/accounts/eoa/externally_owned_account.cairo#L15

And get_evm_address function:
https://github.com/kkrt-labs/kakarot/blob/c0c80301d4dfe384247b423a3bc2726522b5d1a8/src/kakarot/accounts/eoa/externally_owned_account.cairo#L117

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Resolves: #216 #211

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

@github-actions
Copy link

github-actions bot commented Aug 30, 2023

Snapshot Comparison Report:

No changes in gas consumption.

crates/eoa/src/externally_owned_account.cairo Outdated Show resolved Hide resolved
crates/eoa/src/externally_owned_account.cairo Outdated Show resolved Hide resolved
crates/eoa/src/externally_owned_account.cairo Outdated Show resolved Hide resolved
crates/eoa/src/externally_owned_account.cairo Outdated Show resolved Hide resolved
@ClementWalter
Copy link
Member

I do see that we had in the cairo0 impl a get_evm_address in each contract, but this sounds like a mistake because it's part of the share interface between CA and EOA. I don't see any reason not to put this in the account lib, which btw doesn't exist in this repo.

}

#[external(v0)]
impl ExternallyOwnedAccount of super::IExternallyOwnedAccount<ContractState> {
/// Returns an empty span, required for the EXTCODE opcode
fn get_evm_address(self: @ContractState) -> EthAddress {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have a common library for both EOAs and Account contracts, I'd rather make an external component for that to share code and avoid maintaining twice the same thing. Should be ready next week-ish

@Eikix
Copy link
Member

Eikix commented Sep 5, 2023

Putting this PR review on hold until we have Cairo Components in SSJ

@ClementWalter ClementWalter marked this pull request as draft September 5, 2023 09:31
@Eikix
Copy link
Member

Eikix commented Oct 12, 2023

Closing this for now as it's outdated

@Eikix Eikix closed this Oct 12, 2023
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.

implement constructor logic for EOA (formerly called initialize)
4 participants