diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ade701ad977..f47da63c683 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -18,7 +18,11 @@ # Gno examples and default contracts. /examples/ @gnolang/tech-staff @gnolang/devrels +/examples/gno.land/p/demo/ @gnolang/tech-staff @gnolang/devrels +/examples/gno.land/r/demo/ @gnolang/tech-staff @gnolang/devrels /examples/gno.land/r/gnoland/ @moul +/examples/gno.land/p/gov/ @moul +/examples/gno.land/p/sys/ @moul /examples/gno.land/r/gov/ @moul /examples/gno.land/r/sys/ @moul /examples/gno.land/r/worx/ @moul diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 29af2700b81..917ad1e1a20 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -78,7 +78,9 @@ jobs: - run: go run ./gnovm/cmd/gno lint -v ./examples/gno.land/p - run: go run ./gnovm/cmd/gno lint -v ./examples/gno.land/r/demo - run: go run ./gnovm/cmd/gno lint -v ./examples/gno.land/r/gnoland - - run: go run ./gnovm/cmd/gno lint -v ./examples/gno.land/r/system + - run: go run ./gnovm/cmd/gno lint -v ./examples/gno.land/r/sys + # - run: go run ./gnovm/cmd/gno lint -v ./examples/gno.land/r/gov + # TODO: consider running lint on every other directories, maybe in "warning" mode? # TODO: track coverage mod-tidy: strategy: diff --git a/docs/concepts/proof-of-contribution.md b/docs/concepts/proof-of-contribution.md index 364a5eb254d..5446fa83a69 100644 --- a/docs/concepts/proof-of-contribution.md +++ b/docs/concepts/proof-of-contribution.md @@ -34,22 +34,22 @@ Presentation: https://github.com/gnolang/workshops/tree/main/presentations/2023- | gno.land/{p,r} contracts | | gno.land | | | | | | +-----------------------------+ +---------------------+ | | | - | | | | r/system/valset | | | | + | | | | r/sys/validators | | | | | | | +->| |--+------+ | +-------------+ | | | worxDAO | | | validator set | | | | | | | | | |--+ +---------------------+ | +-------+->| Gno SDK |----------+ | - | | the "Contributors DAO" | | | r/system/chaincfg | | | | | | | | + | | the "Contributors DAO" | | | r/sys/config | | | | | | | | | | | +->| |--+------+ | +-------------+ | | | | | | chain configuration | | | | | | | +-----------------------------+ +---------------------+ | | | | | | | +---------------------+ | | v v | - | v | r/system/rewards | | | +-------------+ +-------------+ | - | +--------------------+ | | | | | | | | | - | | Evaluation DAO | |distribute rewards to| | | | TM2 |-->| GnoVM | | - | | | | contributors and | | | | | | | | - | |Qualification system| | validators | | | +-------------+ +-------------+ | - | |to distribute ^worx | | +------+ | | | | | | - | +--------------------+ | |Bucket|<- - -|- + -chain fees -|- - - - - | | + | v | r/sys/rewards | | | +-------------+ +-------------+ | + | +----------------------+ | | | | | | | | | + | | Evaluation DAO | | distribute rewards | | | | TM2 |-->| GnoVM | | + | | | | to contributors and | | | | | | | | + | | Qualification system | | validators | | | +-------------+ +-------------+ | + | | to distribute ^worx | | +------+ | | | | | | + | +----------------------+ | |Bucket|<- - -|- + -chain fees -|- - - - - | | | +-------+------+------+ | | | | +---------------------------------------------------------------+ +---------------------------+--------+ ^ | @@ -67,11 +67,11 @@ contracts with the `GnoVM` and can self-configure from contracts using the ### `worxDAO` The governance entity consisting of contributors, responsible for governing the -`r/system` realms, including `valset` and `chaincfg`. +`r/sys` realms, including `validators` and `config`. Meta issue: [#872](https://github.com/gnolang/gno/issues/872). -### `r/system/valset` +### `r/sys/validators` A realm (smart contract) that enables the `worxDAO` to update the validator set. Similar to a PoA system, the authority is decentralized in a DAO. @@ -79,7 +79,7 @@ Similar to a PoA system, the authority is decentralized in a DAO. Additionally, this contract is queried by `gno.land` to configure `TM2` when changes are made to the validator set. -### `r/system/chaincfg` +### `r/sys/config` A governance-backed smart contract that allows for chain configuration through governance. @@ -88,7 +88,7 @@ It helps prevent unnecessary upgrade campaigns for minor updates. ### Evaluation DAO -The system employed by the `worxDAO` to incentivize contributions with `^worx` tokens. +The system employed by the `worxDAO` to incentivize contributions with `^worx` points. +---------------1. propose a contribution-------------+ | v diff --git a/examples/Makefile b/examples/Makefile index 5d7c94b2409..4894e28a1bb 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -26,7 +26,8 @@ GOTEST_FLAGS ?= -v -p 1 -timeout=30m OFFICIAL_PACKAGES = ./gno.land/p OFFICIAL_PACKAGES += ./gno.land/r/demo OFFICIAL_PACKAGES += ./gno.land/r/gnoland -OFFICIAL_PACKAGES += ./gno.land/r/system +OFFICIAL_PACKAGES += ./gno.land/r/sys +OFFICIAL_PACKAGES += ./gno.land/r/gov ######################################## # Dev tools diff --git a/examples/gno.land/r/gnoland/home/home.gno b/examples/gno.land/r/gnoland/home/home.gno index 737c811c062..d8bec8242c2 100644 --- a/examples/gno.land/r/gnoland/home/home.gno +++ b/examples/gno.land/r/gnoland/home/home.gno @@ -177,11 +177,11 @@ func packageStaffPicks() ui.Element { ui.Link{URL: "r/gnoland/home"}, ui.Link{URL: "r/gnoland/pages"}, }, - ui.H4("[r/system](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/system)"), + ui.H4("[r/sys](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/sys)"), ui.BulletList{ - ui.Link{URL: "r/system/names"}, - ui.Link{URL: "r/system/rewards"}, - ui.Link{URL: "r/system/validators"}, + ui.Link{URL: "r/sys/names"}, + ui.Link{URL: "r/sys/rewards"}, + ui.Link{URL: "r/sys/validators"}, }, }, { ui.H4("[r/demo](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/demo)"), diff --git a/examples/gno.land/r/gnoland/home/home_filetest.gno b/examples/gno.land/r/gnoland/home/home_filetest.gno index 0304ad641f6..fa6fbe4e2a1 100644 --- a/examples/gno.land/r/gnoland/home/home_filetest.gno +++ b/examples/gno.land/r/gnoland/home/home_filetest.gno @@ -111,11 +111,11 @@ func main() { //- [r/gnoland/home](r/gnoland/home) //- [r/gnoland/pages](r/gnoland/pages) // -//#### [r/system](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/system) +//#### [r/sys](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/sys) // -//- [r/system/names](r/system/names) -//- [r/system/rewards](r/system/rewards) -//- [r/system/validators](r/system/validators) +//- [r/sys/names](r/sys/names) +//- [r/sys/rewards](r/sys/rewards) +//- [r/sys/validators](r/sys/validators) // // //
diff --git a/examples/gno.land/r/sys/README.md b/examples/gno.land/r/sys/README.md new file mode 100644 index 00000000000..6dff0afd5b6 --- /dev/null +++ b/examples/gno.land/r/sys/README.md @@ -0,0 +1,5 @@ +#`r/sys/*` + +This folder contains contracts designed for chain use. All content should be +minimal, future-proof, and gas-efficient. + diff --git a/examples/gno.land/r/system/names/genesis.gno b/examples/gno.land/r/sys/names/genesis.gno similarity index 88% rename from examples/gno.land/r/system/names/genesis.gno rename to examples/gno.land/r/sys/names/genesis.gno index 7477b1b903f..7e4ae51645f 100644 --- a/examples/gno.land/r/system/names/genesis.gno +++ b/examples/gno.land/r/sys/names/genesis.gno @@ -18,7 +18,8 @@ func init() { ) namespaces.Set("demo", &Space{Admins: []std.Address{jaekwon, manfred}}) namespaces.Set("gnoland", &Space{Admins: []std.Address{jaekwon, manfred}}) - namespaces.Set("system", &Space{Admins: []std.Address{jaekwon, manfred}}) + namespaces.Set("sys", &Space{Admins: []std.Address{jaekwon, manfred}}) + namespaces.Set("gov", &Space{Admins: []std.Address{jaekwon, manfred}}) namespaces.Set("jaekwon", &Space{Admins: []std.Address{jaekwon}}) namespaces.Set("manfred", &Space{Admins: []std.Address{manfred}}) namespaces.Set("test1", &Space{Admins: []std.Address{test1}}) diff --git a/examples/gno.land/r/system/names/gno.mod b/examples/gno.land/r/sys/names/gno.mod similarity index 58% rename from examples/gno.land/r/system/names/gno.mod rename to examples/gno.land/r/sys/names/gno.mod index cd4fd0aae4a..97236a84892 100644 --- a/examples/gno.land/r/system/names/gno.mod +++ b/examples/gno.land/r/sys/names/gno.mod @@ -1,3 +1,3 @@ -module gno.land/r/system/names +module gno.land/r/sys/names require gno.land/p/demo/avl v0.0.0-latest diff --git a/examples/gno.land/r/system/names/names.gno b/examples/gno.land/r/sys/names/names.gno similarity index 90% rename from examples/gno.land/r/system/names/names.gno rename to examples/gno.land/r/sys/names/names.gno index e1f479fc379..d73ec59b2c5 100644 --- a/examples/gno.land/r/system/names/names.gno +++ b/examples/gno.land/r/sys/names/names.gno @@ -1,4 +1,4 @@ -// The realm r/system/names is used to manage namespaces on gno.land. +// The realm r/sys/names is used to manage namespaces on gno.land. package names import ( @@ -7,7 +7,7 @@ import ( "gno.land/p/demo/avl" ) -// "AddPkg" will check if r/system/names exists. If yes, it will +// "AddPkg" will check if r/sys/names exists. If yes, it will // inspect the realm's state and use the following variable to // determine if an address can publish a package or not. var namespaces avl.Tree // name(string) -> Space diff --git a/examples/gno.land/r/sys/rewards/gno.mod b/examples/gno.land/r/sys/rewards/gno.mod new file mode 100644 index 00000000000..f615998a01f --- /dev/null +++ b/examples/gno.land/r/sys/rewards/gno.mod @@ -0,0 +1 @@ +module gno.land/r/sys/rewards diff --git a/examples/gno.land/r/system/rewards/rewards.gno b/examples/gno.land/r/sys/rewards/rewards.gno similarity index 100% rename from examples/gno.land/r/system/rewards/rewards.gno rename to examples/gno.land/r/sys/rewards/rewards.gno diff --git a/examples/gno.land/r/sys/validators/gno.mod b/examples/gno.land/r/sys/validators/gno.mod new file mode 100644 index 00000000000..84df66b9001 --- /dev/null +++ b/examples/gno.land/r/sys/validators/gno.mod @@ -0,0 +1 @@ +module gno.land/r/sys/validators diff --git a/examples/gno.land/r/system/validators/validators.gno b/examples/gno.land/r/sys/validators/validators.gno similarity index 100% rename from examples/gno.land/r/system/validators/validators.gno rename to examples/gno.land/r/sys/validators/validators.gno diff --git a/examples/gno.land/r/system/rewards/gno.mod b/examples/gno.land/r/system/rewards/gno.mod deleted file mode 100644 index e785c4675b5..00000000000 --- a/examples/gno.land/r/system/rewards/gno.mod +++ /dev/null @@ -1 +0,0 @@ -module gno.land/r/system/rewards diff --git a/examples/gno.land/r/system/validators/gno.mod b/examples/gno.land/r/system/validators/gno.mod deleted file mode 100644 index fdc8d556e56..00000000000 --- a/examples/gno.land/r/system/validators/gno.mod +++ /dev/null @@ -1 +0,0 @@ -module gno.land/r/system/validators