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
Is your feature request related to a problem? Please describe.
Currently, all the functions of a dojo contracts (mostly systems) are generated as views. Even if dojo contracts are meant to be state less (we're not supposed to write any data into their storage), the ABI is then generated with state_mutability = view for those function.
Describe the solution you'd like
We should give the user the possibility to choose between view and external in the ABI, without having to pass ref self: ContractState or self: @ContractState.
In dojo, a system must be external if it writes data to the world storage. This is done using the set! macro. We should then inject the world with this information: ref world: IWorldDispatcher.
In the case we do need a view (to have some data returned from this view), we can omit the world injection, or inject it as it's done currently: world: IWorldDispatcher.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, all the functions of a dojo contracts (mostly systems) are generated as views. Even if dojo contracts are meant to be state less (we're not supposed to write any data into their storage), the ABI is then generated with
state_mutability = view
for those function.Describe the solution you'd like
We should give the user the possibility to choose between
view
andexternal
in the ABI, without having to passref self: ContractState
orself: @ContractState
.In dojo, a system must be external if it writes data to the world storage. This is done using the
set!
macro. We should then inject the world with this information:ref world: IWorldDispatcher
.In the case we do need a view (to have some data returned from this view), we can omit the world injection, or inject it as it's done currently:
world: IWorldDispatcher
.The text was updated successfully, but these errors were encountered: