-
Notifications
You must be signed in to change notification settings - Fork 375
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
Gno Studio Connect: issues #2197
Comments
To clarify, we need to add a field for each public function in a realm which will allow users to specify an Since the studio/connect repo is not public, what would be a good place for the team & contributors to leave feedback on the UI/UX of Connect? |
No - every exported function is by default "payable". Gno is different from Solidity, and we want to keep as close as possible to Go syntax. A consideration would be to add a cc @moul |
I think we should start by playing with standardized comments that can be read both by humans and machines (gnoweb, wallets, SDKs). Maybe something like this: // Foo does foo things.
//
// @payable
// @...
func Foo() {} |
I see two issues with this:
I think adding a The above is Ethereum's way. I researched a bit on Solana & Aptos (Move lang), and they follow a different approach. To summarize, they have a built-in function that reverts if its argument, the amount of tokens required, is not available to be pulled from the callers balance - offloading the burden of sending coins from the user to the developer. Seems that Ethereum's way is much more approachable, considering how we manage our transaction context. |
I think that as soon as it becomes a standard, it can become more common, and we can use linters. That's what go is doing. https://tip.golang.org/doc/comment It's also easy to forget In general, I believe that doc comments are more frequently read than the first lines of a function implementation for things that configure the metadata of a function. Personally, I usually examine the function signature and comments before considering reading the actual code.
I don't understand your point about mistakes. Anyway, I don't understand the connection to the VM level if the goal is to generate better documentation for payable functions. It would make sense to have Go helpers if this also benefits other contracts. However, if this is solely for generating documentation when calling a function as an entry point, I don't see a need for the VM to be aware.
That's already doable by checking the std.OrigSend. We can eventually make a Assert helper. I suggest you write some example contracts or pseudocode so we can review something and decide more easily. There was a very old issue about this concept, if I recall correctly, which was named "rules". |
Thanks @leohhhn @MalekLahbib @moul May we add the feedback using the feedback realm? Just to recap, the suggestion for Connect is to add an I thought of a suggestion by Alan related to a somewhat related issue (Clarifying Acceptable Argument Values for Function Execution) - to use godocs to create a specific comment structure that provides information on the arguments, so perhaps there is a way to enforce the comments for payable functions. |
It should be easy to add a |
Description
As seen last Thursday on the "office hours" call with @leohhhn @michelleellen and @iam-agf, when testing Gno Studio Connect, we noticed with the example Leon suggested "wugnot" that the function Deposit is called without any args but is supposed to be a function that the user calls to deposit (send) coins to the contract.
So may be it's necessary to modify the code so it detects such type of functions and allow user to send coins using Gno Studio Connect.
The text was updated successfully, but these errors were encountered: