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

Custom python decorators with global functions without arguments #647

Closed
meevee98 opened this issue Sep 15, 2021 · 1 comment
Closed

Custom python decorators with global functions without arguments #647

meevee98 opened this issue Sep 15, 2021 · 1 comment
Assignees

Comments

@meevee98
Copy link
Contributor

meevee98 commented Sep 15, 2021

See #574

A very simple use case I can think of would be to implement something like that:

from boa3.builtin import CreateNewEvent, public
                                               
def onlyOwner(): 
    # do owner check and abort if false                              
    pass                                       
                                               
@onlyOwner                                     
@public                                        
def withdraw() -> bool:                        
    pass                                       

Only decorators that calls global or imported functions without arguments is going to be implemented in this issue

@luc10921
Copy link
Contributor

It's not possible to create a decorator without a parameter

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

No branches or pull requests

2 participants