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: do all call restriction checks (only owner etc.) in contracts #1094

Open
ClementWalter opened this issue Apr 10, 2024 · 2 comments
Open
Assignees

Comments

@ClementWalter
Copy link
Member

ClementWalter commented Apr 10, 2024

In a lot of places, we currently do in the contract

@external
func foo{
    syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr
}(bar: felt) {
    return Library.foo(bar);
}

and in the associated library

func foo{
    syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr
}(bar: felt) {
    Ownable.assert_only_owner();
    // ...
}

The check Ownable.assert_only_owner(); shouldn't be in the library because it belongs to a contract logic (who is the caller) and not a library logic (what is the function actually doing).

This issue is consequently about moving all these checks (not only only_owner but similar semantic) at the contract level

@emilamaj
Copy link

Do you mind assigning it to me ?

@ClementWalter ClementWalter assigned emilamaj and unassigned emilamaj Apr 17, 2024
@enitrat enitrat self-assigned this Apr 26, 2024
@stevencartavia
Copy link

Hi, can I try this one?

@enitrat enitrat assigned stevencartavia and unassigned enitrat Jun 1, 2024
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

4 participants