Unnecessary argument when the smart contract class and its methods are non-static
When a user does not define the compiled smart contract class and its methods as static, the compiler builds an unnecessary argument, and input it as arg 0 (this of the class object) for all the non-static methods. An example is the compilation results of neo-devpack-dotnet/tests/Neo.Compiler.CSharp.TestContracts/Contract_Abort.cs (manifest and dumpnef affliated). Maybe we can avoid generating this unnecessary arg 0 in the compiler.
If (in the future) we have a symbolic VM that analyzes reads and writes to storage evaluation stack, static fields, arguments and local varaiables, we may try to identify the unnecessary constructions and delete the codes in the optimizer.
are you going to process it?
are you going to process it?
I'm not sure. I have not found the best way to handle it.
This problem can be handled by https://github.com/neo-project/neo-devpack-dotnet/pull/1185 in most cases. But in polymorphism tests, I did not remove the constructors in a derived smart contract class, because base may be called at any time.