OpShin / opshin

A simple pythonic programming language for Smart Contracts on Cardano
https://book.opshin.dev/
MIT License
137 stars 26 forks source link

Properly distinguish between Classes and Instances #365

Open nielstron opened 5 months ago

nielstron commented 5 months ago

Is your feature request related to a problem? Please describe. Currently, OpShin does not distinguish between instances and classes properly. Looking at the type system, every access to an instance type simply gets forwarded to the class that implements it, at this step we loose information about whether the object that had the attribute was a Class or an Instance. Cf the implementation of InstanceType: https://github.com/OpShin/opshin/blob/main/opshin/types.py#L1437.

Describe the solution you'd like There should be a seperate InstanceType that handles requests differently than the corresponding Class Type (or calls the class and adds the self parameter or sth similar. However unclear how #103 would then work).

Describe alternatives you've considered None

Bug bounty: 1500 ADA