Skip to content

Commit

Permalink
chore: update test4.gno.land backup
Browse files Browse the repository at this point in the history
  • Loading branch information
gfanton authored and github-actions[bot] committed Oct 4, 2024
1 parent 35b1de6 commit 158bdaf
Show file tree
Hide file tree
Showing 59 changed files with 7,047 additions and 10 deletions.
18 changes: 9 additions & 9 deletions test4.gno.land/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## TXs
```
19887
19908
```

## addpkgs
Expand All @@ -11,33 +11,33 @@

## top realm calls
```
4321 "gno.land/r/demo/wugnot"
4329 "gno.land/r/demo/wugnot"
1142 "gno.land/r/gnoswap/gns"
882 "gno.land/r/gnoswap/v2/gns"
883 "gno.land/r/gnoswap/v2/gns"
764 "gno.land/r/gnoswap/router"
755 "gno.land/r/gnoswap/position"
705 "gno.land/r/gnoswap/v2/router"
707 "gno.land/r/gnoswap/v2/router"
654 "gno.land/r/gnoswap/gnft"
613 "gno.land/r/onbloc/usdc"
616 "gno.land/r/onbloc/usdc"
589 "gno.land/r/onbloc/foo"
583 "gno.land/r/gnoswap/v2/position"
585 "gno.land/r/gnoswap/v2/position"
405 "gno.land/r/gnoswap/v2/staker"
385 "gno.land/r/gnoswap/v2/gnft"
386 "gno.land/r/gnoswap/v2/gnft"
344 "gno.land/r/onbloc/bar"
320 "gno.land/r/gnoswap/staker"
258 "gno.land/r/onbloc/baz"
201 "gno.land/r/flippando/flippando"
150 "gno.land/r/onbloc/obl"
113 "gno.land/r/g17ernafy6ctpcz6uepfsq2js8x2vz0wladh5yc3/zentasktic_core"
112 "gno.land/r/gnoswap/pool"
95 "gno.land/r/demo/users"
92 "gno.land/r/gov/dao"
89 "gno.land/r/demo/users"
86 "gno.land/r/teritori/social_feeds"
70 "gno.land/r/g1ngywvql2ql7t8uzl63w60eqcejkwg4rm4lxdw9/candy20"
53 "gno.land/r/teritori/profile"
42 "gno.land/r/gnoswap/v2/pool"
30 "gno.land/r/onbloc/qux"
30 "gno.land/r/varmeta/demo/v405/domain/registrar"
28 "gno.land/r/teritori/profile"
26 "gno.land/r/g1w6886hdj2tet0seyw6kn8fl92sx06prgd9w9j8/game/v3/diceroller"
25 "gno.land/r/varmeta/demo/v403/domain/registrar"
21 "gno.land/r/g1w62226g8hykfmtuasvz80rdf0jl6phgxsphh5v/testing/openocean"
Expand Down
21 changes: 21 additions & 0 deletions test4.gno.land/backup_2169827-2201542.jsonl

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package hello

func Render(path string) string {
return "Hello World!"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"creator":"g1w9rlvl7nchzn5d3p8hyy78js5l4j6fc8gjp0an","deposit":""}
62 changes: 62 additions & 0 deletions test4.gno.land/extracted/r/ecodevx/dao/pre1:2145604/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Copyright (c) 2024. All rights reserved.

Project Owner:
NewTendermint, LLC

Project Maintainer:
İlker Göktuğ ÖZTÜRK. <[email protected]>, <[email protected]>

Your access to this Project and your contributions to this Project are subject
to the following terms:

* You hereby grant to the listed Owner and Maintainer of this Project the
worldwide, irrevocable and royalty-free right to use, publish, relicense and
sublicense your contributions under any non-exclusive license of their
choosing for commercial and non-commercial purposes.
* You shall not attempt to bring any intellectual property infringement or
misappropriation claims against the Owner or Maintainer of this Project
relating to or arising from your contributions.
* You represent that you are the sole owner of all rights in your
contributions and that no third party has any rights or interests therein.

FOR THE SCOPE OF THIS LICENSE, A CONTRIBUTION IS DEFINED TO INCLUDE ANY WORKS,
IDEAS, CODE, PROCESSES, OR APIS MADE AVAILABLE TO VIEW BY THE GENERAL PUBLIC
(INCLUDING ANY PUBLICLY ACCESSIBLE INTERNET FORUMS AND CHAT SERVERS WHERE
ACCESS IS AVAILABLE FOR FREE WITH REGISTRATION) OR PRIVATELY TO THIS PROJECT'S
OWNER AND MAINTAINERS; INCLUDING WORKS, IDEAS, CODE, PROCESSES, AND APIS THAT
ARE ABOUT THIS PROJECT AND ITS CONTRIBUTIONS, OR MENTIONED IN REFERENCE TO
THIS PROJECT, WHERE SUCH WORKS, IDEAS, CODE, PROCESSES, AND APIS ARE MATERIAL
TO THE SUCCESS, IMPROVEMENT, OR COMPLETION OF THIS PROJECT, AS DETERMINED BY
THE OWNER OF THIS PROJECT.

Contributions may come in any form, and include (but are not limited to):

* pull requests
* diff patches
* commentary
* example code

If you do not want your contribution to become incorporated into this Project,
do not make contributions to this Project. The creation of contributions that
may in the future become known to this Project's Owner and Maintainer
constitutes a willing contribution to this Project in accordance with this
license.

THIS PROJECT AND THE WORKS AVAILABLE THROUGH THIS PROJECT ARE PROVIDED “AS IS”
AND WITHOUT WARRANTY OF ANY KIND. IN NO EVENT SHALL THE OWNER OR MAINTAINER OF
THIS PROJECT BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THIS PROJECT OR THE WORKS AVAILABLE THROUGH
THIS PROJECT. YOU AGREED TO INDEMNIFY, DEFEND AND HOLD THE OWNER AND
MAINTAINER FROM AND AGAINST ANY CLAIMS, LOSSES OR DAMAGES ARISING FROM YOUR
USE OF THIS PROJECT OR THE WORKS AVAILABLE THROUGH THIS PROJECT.

This license is subject to change at any time by the Project Owner or
Maintainer.

Your continued access to or use of this Project or any works
available through this Project shall be subject to the then-current version
of this license.

The Project Owner and Maintainer reserve the right to change this license
without needing the consent of the contributors to this Project.
68 changes: 68 additions & 0 deletions test4.gno.land/extracted/r/ecodevx/dao/pre1:2145604/gnome.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package gnome

import (
"strings"

gnome "gno.land/p/ecodevx/dao"
)

// Names of the initial DAOs.
const (
nameCouncilDAO = "council"
nameMainDAO = "main"
)

// Member roles.
const (
RoleAdmin gnome.Role = "admin"
RoleEcoDev gnome.Role = "eco-dev"
RoleDev gnome.Role = "dev"
RoleRealm gnome.Role = "realm"
)

// The "Gno.me" DAO defines an initial root DAO with a single sub DAO, where the root is
// the council DAO and the child is the main DAO. Council DAO members are hard coded and
// can't be modified. Main DAO members can be modified anytime though a modify DAO members
// proposals.
//
// The main DAO must have a minimum of three members at all time to be able to apply 2/3s
// voting majority criteria required for some proposal types allowed for the main DAO.
//
// Sub DAOs can be created though sub DAO add proposals but its members can't be modified
// once the sub DAO is created. Sub DAOs must be dismissed though a proposal and a new sub
// DAO must be created if its members must be modified.
var gnomeDAO = gnome.MustNew(
nameCouncilDAO,
"Council",
gnome.WithManifest("Gnomes are thinking"),
gnome.AssignAsSuperCouncil(),
gnome.WithMembers(
gnome.NewMember("g1lyzcpa7duh69lk04nahxup484xrz4k6k2nqdun", RoleDev),
gnome.NewMember("g125t352u4pmdrr57emc4pe04y40sknr5ztng5mt", RoleDev),
gnome.NewMember("g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5", RoleEcoDev),
),
gnome.WithSubDAO(
gnome.MustNew(
nameMainDAO,
"Main",
gnome.WithManifest("Gnomes are building"),
gnome.WithMembers(
gnome.NewMember("g1lyzcpa7duh69lk04nahxup484xrz4k6k2nqdun", RoleDev),
gnome.NewMember("g125t352u4pmdrr57emc4pe04y40sknr5ztng5mt", RoleDev),
gnome.NewMember("g1778y2yphxs2wpuaflsy5y9qwcd4gttn4g5yjx5", RoleEcoDev),
),
),
),
)

func mustGetDAO(path string) *gnome.DAO {
if strings.TrimSpace(path) == "" {
panic("DAO path is empty")
}

dao, found := daos.GetByPath(path)
if !found {
panic("DAO not found")
}
return dao
}
102 changes: 102 additions & 0 deletions test4.gno.land/extracted/r/ecodevx/dao/pre1:2145604/indexes.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package gnome

import (
"gno.land/p/demo/avl"

gnome "gno.land/p/ecodevx/dao"
)

var (
daos daoIndex
proposals proposalIndex
lastProposalID gnome.ID
)

func init() {
// Index initial council and main DAO
mainDAO := gnomeDAO.SubDAOs()[0]
daos.IndexByPath(gnomeDAO)
daos.IndexByPath(mainDAO)
}

func genProposalID() gnome.ID {
lastProposalID += 1
return lastProposalID
}

// TODO: Deprecate DAO index in favor of using DAO methods
type daoIndex struct {
index avl.Tree // string(DAO path) -> *gnome.DAO
}

// IndexByPath indexes a DAO by its path.
func (x *daoIndex) IndexByPath(dao *gnome.DAO) bool {
return x.index.Set(dao.Path(), dao)
}

// GetByPath gets a DAO by its path.
func (x daoIndex) GetByPath(path string) (*gnome.DAO, bool) {
if v, ok := x.index.Get(path); ok {
return v.(*gnome.DAO), true
}
return nil, false
}

// HasPathKey checks if a key with a DAO path exists.
func (x daoIndex) HasPathKey(path string) bool {
return x.index.Has(path)
}

type proposalIndex struct {
index avl.Tree // string(binary gnome.ID) -> *gnome.Proposal
groups avl.Tree // string(DAO path) -> []*gnome.Proposal
}

// Index indexes a proposal by its ID and DAO.
func (x *proposalIndex) Index(p *gnome.Proposal) {
x.IndexByID(p)
x.IndexByDAO(p)
}

// IndexByID indexes a proposal by its ID.
func (x *proposalIndex) IndexByID(p *gnome.Proposal) bool {
return x.index.Set(p.ID().Key(), p)
}

// IndexByDAO indexes a proposal for a DAO.
func (x *proposalIndex) IndexByDAO(p *gnome.Proposal) bool {
daoPath := p.DAO().Path()
proposals := x.GetAllByDAO(daoPath)
proposals = append([]*gnome.Proposal{p}, proposals...) // reverse append
return x.groups.Set(daoPath, proposals)
}

// GetByID gets a proposal by its ID.
func (x proposalIndex) GetByID(id gnome.ID) (*gnome.Proposal, bool) {
if v, exists := x.index.Get(id.Key()); exists {
return v.(*gnome.Proposal), true
}
return nil, false
}

// GetAllByDAO gets all proposals of a DAO.
func (x proposalIndex) GetAllByDAO(daoPath string) []*gnome.Proposal {
if v, exists := x.groups.Get(daoPath); exists {
return v.([]*gnome.Proposal)
}
return nil
}

// Iterate iterates proposals starting from the oldest one.
func (x proposalIndex) Iterate(fn gnome.ProposalIterFn) bool {
return x.index.Iterate("", "", func(_ string, v interface{}) bool {
return fn(v.(*gnome.Proposal))
})
}

// ReverseIterate iterates proposals starting from the latest one.
func (x proposalIndex) ReverseIterate(fn gnome.ProposalIterFn) bool {
return x.index.ReverseIterate("", "", func(_ string, v interface{}) bool {
return fn(v.(*gnome.Proposal))
})
}
46 changes: 46 additions & 0 deletions test4.gno.land/extracted/r/ecodevx/dao/pre1:2145604/params.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package gnome

import (
"time"

gnome "gno.land/p/ecodevx/dao"
)

// Day defines the duration of a day.
const Day = time.Hour * 24

// Names for the different strategy types.
const (
StrategyNameSubDAOCreation = "sub-dao-creation"
StrategyNameSubDAODismissal = "sub-dao-dismissal"
StrategyNameDAOMembersModification = "dao-members-modification"
StrategyNameBudget = "budget"
StrategyNameGeneral = "general"
StrategyNameLocking = "locking"
StrategyNameParamsUpdate = "params-update"
)

var parameters struct {
// VotingPeriods contains the current voting period for each proposal type.
VotingPeriods gnome.DurationParams

// ReviewDeadline defines the time after which a proposal can't be withdrawed by the proposer.
// Proposal can only be voted on after this deadline but not before.
// This greace period gives the proposer the chance to withdraw a proposal if there is a mistake.
ReviewDeadline time.Duration
}

func init() {
// Initial voting periods for each proposal type.
// Periods can be changed by sumitting a params update proposal.
parameters.VotingPeriods.Set(StrategyNameSubDAOCreation, time.Minute*10)
parameters.VotingPeriods.Set(StrategyNameSubDAODismissal, Day*7)
parameters.VotingPeriods.Set(StrategyNameDAOMembersModification, time.Minute*30)
parameters.VotingPeriods.Set(StrategyNameBudget, Day*7)
parameters.VotingPeriods.Set(StrategyNameGeneral, Day*2)
parameters.VotingPeriods.Set(StrategyNameLocking, Day*2)
parameters.VotingPeriods.Set(StrategyNameParamsUpdate, time.Minute*10)

// Initial review deadline
parameters.ReviewDeadline = time.Second
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"creator":"g147ah9520z0r6jh9mjr6c75rv6l8aypzvcd3f7d","deposit":"1ugnot"}
Loading

0 comments on commit 158bdaf

Please sign in to comment.