You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use of non-static fields and properties are wrong, and can not be fixed in an easy way, the reason of the problem is that static field/property can be initialized in a static constructor, while non-static have to be initialized when an object is created, yet no instance will be created for smartcontract. Thus all non-static field/properties can not be initizalied properly. A solution of this would be inserting opcode to initialize those fields when loading the conrtact, but that will just be the same as banning the use of non-static fields/property, and it makes more sense for me since contract will not have any instance anyway (interoperation and reentry will be consisdered totally different environment, static field/property will not be shared.).
And to align with the banning of using non-static field/property, we can also ban the use of non-static methods, to make the experience unified.
The text was updated successfully, but these errors were encountered:
Too complex to handle non-static property correctly, too many places need to be updated, and many of them actually did not handle static-non static property/field at all. It is very easy to make mistakes, better to ban defining non-static symbols in smart contract.
The use of non-static fields and properties are wrong, and can not be fixed in an easy way, the reason of the problem is that static field/property can be initialized in a static constructor, while non-static have to be initialized when an object is created, yet no instance will be created for smartcontract. Thus all non-static field/properties can not be initizalied properly. A solution of this would be inserting opcode to initialize those fields when loading the conrtact, but that will just be the same as banning the use of non-static fields/property, and it makes more sense for me since contract will not have any instance anyway (interoperation and reentry will be consisdered totally different environment, static field/property will not be shared.).
And to align with the banning of using non-static field/property, we can also ban the use of non-static methods, to make the experience unified.
The text was updated successfully, but these errors were encountered: