Skip to content
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

A revert function to refund coins sent to a realm that doesn't take coins #2305

Closed
MalekLahbib opened this issue Jun 7, 2024 · 1 comment

Comments

@MalekLahbib
Copy link
Contributor

Description

I had a discussion today with @leohhhn that begun with this question:
I have a question, if someone deploys a realm, and someone sends coins to that contract (by error or other), is that money accessible even if the "deployer" didn't create any function for that?

And the response is: coins can be "locked" if a realm is not written properly.

So, in the actual state of gno.land, if there's no function to manage the coins sent to the smartcontract, that coins will be locked forever (but not burned).

So I was thinking: Is it necessary to create a function in an existing pkg (or create a pkg for this) that will be called by the realm in the begin of a function to verify if there's coins sent and resend them to the sender?
@zivkovicmilos @moul @deelawn @thehowl @jaekwon ?

@leohhhn
Copy link
Contributor

leohhhn commented Jun 11, 2024

I think that this is a default for all smart contract systems. The realm is an entity for itself, and if it receives coins and does not have a function to manipulate them, then they stay locked. This is a design choice that we leave to the developers.

On the other hand, creating a package that could be simply imported to allow this kind of functionality would certainly be an interesting experiment, but we actually want to disallow instantiating the banker in p/, so it will not be possible. Related issue.

Closing this issue.

@leohhhn leohhhn closed this as completed Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants