Transaction

662CC62E269386…E8FEE46BA04D

Block 25,920 · index 0 · indexed

Summary

Hash
662CC62E2693867791ED19052B6860D4AE61207C735367B508E7E8FEE46BA04D
Block
25,920
Size
3454 bytes
Gas used
8,932,676 / 10,719,271
Fee
1000000ugnot
Memo
gnopublish
Status
success

Messages

#1AddPackagegno.land/p/moul/udao/v09 arguments

Arguments · 9

  1. #1udao
  2. #2README.md
  3. #3# `gno.land/p/moul/udao/v0` _TODO: describe this package._ <!-- BEGIN GNOCONTRACTS FOOTER (generated by `make readmes`; do not edit below) --> --- Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage. > ⚠️ **Disclaimer:** provided as-is, without warranty; not security-audited. Full disclaimer: [DISCLAIMER](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md). <!-- END GNOCONTRACTS FOOTER -->
  4. #4gnomod.toml
  5. #5module = "gno.land/p/moul/udao/v0" gno = "0.9"
  6. #6udao.gno
  7. #7// Package udao defines minimal interfaces for Decentralized Autonomous Organizations (DAOs). // It intentionally does not expose members and votes, as these details are implementation-specific. // Instead, it focuses on providing an external view of proposals and their statuses, // which is what non-members and non-voters typically care about. // // The package is designed to allow for composable DAO patterns, enabling flexible // and modular implementations of various DAO structures and behaviors. package udao // DAO defines a minimal interface for a Decentralized Autonomous Organization // from an external point of view, hiding the internal details of members and voting. type DAO interface { // Propose submits a new proposal to the DAO Propose(prop Proposal) (id uint64, err error) // GetProposalStatus retrieves the current status and metrics of a specific proposal GetProposalStatus(id uint64) (ProposalStatus, error) // Execute attempts to execute a proposal if it has passed Execute(id uint64) error // GetProposal retrieves the details of a specific proposal GetProposal(id uint64) (Proposal, error) // XXX: find a smart way to list proposals // // ListProposalss retrieves a list of Proposals with pagination and optional filters // ListDAOs(offset, limit int, filters ...ProposalFilter) ([]DAO, error) } // Proposal defines the interface for a DAO proposal type Proposal interface { Title() string Body() string Constraints() []Constraint } // ProposalStatus represents the current status and metrics of a proposal type ProposalStatus struct { // status State ProposalState // metrics YeaPercentage float64 NayPercentage float64 NonVoterPercentage float64 // XXX: other metrics? } // ProposalState represents the current state of a proposal type ProposalState int const ( Pending ProposalState = iota Active Passed Rejected Executed Expired // XXX: better name for when it's expired but not because of time? ) // Constraint defines an interface for proposal constraints type Constraint interface { Validate() (bool, string) Description() string } // ValidateConstraints checks if all constraints of a proposal are met func ValidateConstraints(p Proposal) (bool, []string) { var unmetReasons []string for _, constraint := range p.Constraints() { valid, reason := constraint.Validate() if !valid { unmetReasons = append(unmetReasons, reason) } } return len(unmetReasons) == 0, unmetReasons }
  8. #8/gno.MemPackageType
  9. #9 MPUserProd

Result log

msg:0,success:true,log:,events:[]

← Back to block 25,920