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

Proper instance and class methods #366

Closed
nielstron opened this issue Apr 7, 2024 · 1 comment
Closed

Proper instance and class methods #366

nielstron opened this issue Apr 7, 2024 · 1 comment
Labels
bb: major Major issue according to bug bounty categorization bug bounty This issue is prized out as part of the Bug Bounty Program enhancement New feature or request

Comments

@nielstron
Copy link
Contributor

nielstron commented Apr 7, 2024

Is your feature request related to a problem? Please describe.
Currently classes in OpShin do not support methods. It would be nice to support methods. Especially magic methods (__add__) would improve the situation of i.e. Fractions etc.

Describe the solution you'd like
Users should be able to declare methods on PlutusData classes which will be dispatched to when called from OpShin code.

Describe alternatives you've considered
None

Additional context
Note that this might be more complex than it seems. In particular, the functions should be (C-Style) compiled and mapped somewhere global-statically, then called instead of the attribute accessed (one option). Note also that OpShin does currently not permit inheritance (and does not plan to) which should improve the situation.

Bug bounty: 2000 ADA

@nielstron nielstron added enhancement New feature or request bug bounty This issue is prized out as part of the Bug Bounty Program bb: major Major issue according to bug bounty categorization labels Apr 7, 2024
@SCMusson
Copy link
Contributor

#389 Is starting on this. Please let me know if this is what you are looking for. Also if there are any particular unit tests you want me to make sure it passes on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bb: major Major issue according to bug bounty categorization bug bounty This issue is prized out as part of the Bug Bounty Program enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants