-
Notifications
You must be signed in to change notification settings - Fork 711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Readonly Smart Contract Calls #1977
Comments
@gterzian any news or pain points on this ? |
Still in progress, is going to be for next week.
@damip What do you mean with the |
Also, would it be good enough to run the code, and then undo the changes, like is currently done when there is an error? See 628e4fb |
Hmmm maybe we can do that indeed... @adrien-zinger @AureliaDolo @yvan-sraka any opinions ? |
I totally agree with that! |
Discussed in #1970
Originally posted by damip December 9, 2021
Rationale
When using Massa in a Web3 context for example, one should be able to perform read-only Smart Contract calls.
See: https://ethereum.stackexchange.com/questions/765/what-is-the-difference-between-a-transaction-and-a-call/770
Massa implementation
API
Add a "sc_readonly_call" API endpoint
Parameters:
Vec<u8>
// bytecode to executeReturn value:
Vec<SCOutputEvent>
// output events generated during executionOperation
when the sc_readonly_call is called, the bytecode's main() function will be called with the following execution context:
during the call, everything is allowed as with usual SC calls, except that any syscall attempting to WRITE anything to the SCE ledger will fail. Async message sending also fails when called from within a readonly context.
The text was updated successfully, but these errors were encountered: