-
Notifications
You must be signed in to change notification settings - Fork 379
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
WIP: POC: std.Call
to support dynamic import and call
#566
Conversation
What problem we try to solve with std.Call()? We can just import gno.land/r/demo/foo20 and call TotalSupply() in our contract. Dynamically package loading is not safe and trustable, and it could appear to call a contract that may not exist at the first place. |
It's POC. If no one needs this feature, or if there are security concerns, I'm fine with closing this PR.:-) |
I think it's useful when we don't know exactly which package(realms) we need to import. And for the (security) concerns, maybe we can discuss & improve it 😄 |
@anarcher @r3v4s Those are very good thinking and use cases! To include pool contracts in a dex, we can either use call back function through interface or pass by function to register the pool contract itself to the dex. We can achieve it using the idiomatic go style in gno. It avoids VM importing undetermined packages. Solidity's low level call() is a EVM backdoor which should have been limited to minimum usage after they bootstrap the initial iterations of Solidity. It is not recommended to use in Solidity language specs either. Since EVM and GVM are fundamentally different, we don't need to migrate things from Solidity. Many patterns in Solidity are work arounds to EVM's limitation in their evolving implementations. Those limitations may not exist in GNO VM. The program written in idiomatic go/gno is a lot more readable, auditable and secure than Solidity. |
I'll close this PR. I think there's a better approach than this PR somewhere. :-) |
Description
This idea originated in #473 (comment) . This is not intended for general use, but may be useful in special situations (e.g. multi token management contract?).
It's POC. I'm not sure if this is the right way to go. and it needs more testing, there are still things to add (e.g.
std.CallArgs
).How has this been tested?
It hasn't yet.
Please complete this section if you ran tests for this functionality, otherwise delete it