-
Notifications
You must be signed in to change notification settings - Fork 396
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
bug?(gnovm): interface conversion error when trying to burn grc20 #3685
Comments
Update:
|
Update: I have found out that this error is not only for the Burn, but also for the Mint func in token.gno from grc20. I'm starting to think this is related to the fact that I am storing the ledger in the Pool struct in the tree, which is why I have decied to recreate this. Code I've written works perfectly fine: |
Hey. In order to verify if this is a bug or not, we need a minimal example of code that creates problem; and not as a screenshot, but as text - text is copyable, screenshots are not. I suspect this may be just some form of syntax error; I suggest you to inspect your code with |
Okay, so I was told by Leon to try and recreate it and after spending too much time, I stopped because he mock was too close to the original code in the PR. This is why I have chosen this approach - screenshots are easier to read because of the text coloring; here is the zipped dir of my namespace you can use locally (see attachement matijamarjanovic.zip - only thing you have to do is replace testAddr value to your address in matijamarjanovic/test) or alternatively you can see feat/gnoxchange on https://github.com/matijamarjanovic/gno if it's easier. This is token approval script you can use to give approval to tokens from the test so you can create a pool to try and withdraw from it:
As I have mentioned in the original description:
I'm sorry if I couldn't be of more help, if it is needed I will continue my efforts in recreating the issue in a simple manner. |
Please note that I might be mistaken as I lack deeper understanding of gnovm
I'm in the process of making a simple dex, which mints LP tokens to liquidity providers. When lp is to withdraw his assets the LP tokens should be burned, i do this in this func:
This results in this error:
0 /mnt/c/Users/matij/Projects/gno/tm2/pkg/errors/errors.go:28 - deliver transaction failed: log:recovered: interface conversion: gnolang.Stmt is *gnolang.AssignStmt, not *gnolang.bodyStmt
The prints I added in token.gno indicate that the error happens in line 214:
I have made sure that the amount of minted LPs is much higher than the amount I try to burn (I've tried burning both a little % as well as 100% of minted LPs). I have also double checked all the types (all are uint64). I have also run the
gno tool lint
and everything seems to be in order. Also calling this function works as inteded:which is what confuses me the most. Regardless, I hope to stand corrected (and find a solution to the error that I am getting).
The text was updated successfully, but these errors were encountered: