-
Notifications
You must be signed in to change notification settings - Fork 378
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
Add a way to fetch a realm object via package path #3164
Comments
the idea sounds good, I don't see any obvious reason why not to. Maybe there could be a better name |
|
Can we first:
|
This pattern is frequently used in the Gnoswap contracts as well. it could help reduce code duplication. 👍 |
Do you have links where we can check out some examples? |
@moul Sorry for the late answer. Actually, I had confused it with a different pattern. but still, I think it could be useful for other functions if it added. https://github.com/gnoswap-labs/gnoswap/blob/main/_deploy/r/gnoswap/common/access.gno |
Description
I want to be able to check if a certain pkgpath actually contains a realm (or a
p/
, maybe), from within Gno. To give a simple example, I would use it to check whether or not a user has created their home realm.Proposed API:
std.GetRealmAt(pkgpath string) *std.Realm
Usage:
Could also be a way to say, automatically deposit coins in case a specific realm exists, like rewarding users who've deployed a realm to a specific pkgpath.
WDYT?
The text was updated successfully, but these errors were encountered: