diff --git a/examples/gno.land/r/gov/dao/v3/impl/impl.gno b/examples/gno.land/r/gov/dao/v3/impl/impl.gno index b86d63a433d..7e9429850be 100644 --- a/examples/gno.land/r/gov/dao/v3/impl/impl.gno +++ b/examples/gno.land/r/gov/dao/v3/impl/impl.gno @@ -45,3 +45,11 @@ func AddMember(addr std.Address) { panic(err.Error()) } } + +func GetInstance() *GovDAO { + if std.PreviousRealm().PkgPath() != "gno.land/r/gov/dao/v3/loader" { + panic("not allowed") + } + + return govDAO +} diff --git a/examples/gno.land/r/gov/dao/v3/loader/loader.gno b/examples/gno.land/r/gov/dao/v3/loader/loader.gno index 625ae1b1670..7345c896644 100644 --- a/examples/gno.land/r/gov/dao/v3/loader/loader.gno +++ b/examples/gno.land/r/gov/dao/v3/loader/loader.gno @@ -8,7 +8,7 @@ import ( // this is only executed when loaded into genesis func init() { dao.UpdateImpl(dao.UpdateRequest{ - DAO: impl.NewGovDAO(), + DAO: impl.GetInstance(), AllowedDAOs: []string{"gno.land/r/gov/dao/v3/impl"}, }) }