gofractally / demo-clsdk

Demonstration of using the clsdk to build and test contracts
13 stars 2 forks source link

contract: struct or class? #10

Open 7flash opened 2 years ago

7flash commented 2 years ago

What is the reasoning behing using struct instead of class when defining the contract?

https://github.com/gofractally/demo-clsdk/blob/578fe9310bbd1bc23a0a230b5ba322758604e6f1/depositspend.hpp#L58

swatanabe commented 2 years ago

In C++, the only difference between class and struct is that class defaults to private access and struct defaults to public. Everything is public in this contract.