Open leohhhn opened 2 days ago
the idea sounds good, I don't see any obvious reason why not to.
Maybe there could be a better name
RealmFromPkgPath
? Also not sure what to do if a p/
is requested. Would be cool to check for it, but there is no Package
object in Gno (and there will not be one), so not sure how to relay this info and have a good function name.
Can we first:
grc20reg
and hof
.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?
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?