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

dev: group Kakarot entrypoints in dedicated files #1303

Open
ClementWalter opened this issue Jul 24, 2024 · 1 comment
Open

dev: group Kakarot entrypoints in dedicated files #1303

ClementWalter opened this issue Jul 24, 2024 · 1 comment
Assignees

Comments

@ClementWalter
Copy link
Member

ClementWalter commented Jul 24, 2024

Why

Currently, the Kakarot contract is one single file with all the entry points.

As the contract gets bigger, it becomes difficult to read and understand what does what.

What

Create several sub contract with meaningful entrypoints

  1. eth
  2. config
  3. messaging
  4. admin

keep in the main kakarot.cairo only the constructor and imports all the functions defined in the other sub contracts (presets)

The simple getter and setter defined in the library.cairo should also be directly inlined in the corresponding entry points

(e.g.

@view
func get_native_token{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr}() -> (
    native_token_address: felt
) {
    return Kakarot.get_native_token();
}

should be inlined in Kakarot.get_native_token)

@ClementWalter
Copy link
Member Author

This is partially done (see #1352) we could do the others as well. tbd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 Backlog
Development

No branches or pull requests

2 participants