Sputnik DAO smart contracts core: In-depth analysis of the proposal mechanism

robot
Abstract generation in progress

Rust smart contracts Development Diary ( 1) Sputnik DAO::Proposal Mechanism Analysis

Sputnik-DAO is the infrastructure provided by NEAR Protocol to promote the NEAR ecosystem towards decentralization. Currently, the platform has facilitated the establishment of multiple decentralized autonomous communities for NEAR projects, providing a complete and flexible governance solution for community decision-making.

Sputnikdaov2 is a smart contract used for governance voting in the Sputnik-DAO community. This article will introduce the core concepts of this contract: Proposal (, and subsequent articles will introduce relevant DAO governance models ).

1. Proposal Initiation

Members of the Sputnik-DAO community can express opinions or submit proposals, and other stakeholders can review and vote on the proposals. Members can influence the future direction of the project by voting or initiating new proposals.

At the contract level, members can call the sputnikdaov2 contract's add_proposal() method to initiate a new proposal:

rust u64

The proposer must provide detailed information about the proposal ( ProposalInput ):

  • The text description of the proposal ( Description )
  • Proposal type ( kind )

The proposal information is passed as a parameter to the add_proposal() method, which generates a complete proposal(Proposal) after validation and processing, and binds it to a unique proposal_id, adding it to the globally maintained proposal pool of the smart contracts.

The complete attribute information of the proposal includes:

  • description: description
  • kind:type
  • proposer: proposer
  • status: status ( defaults to InProgress )
  • submission_time: submission time
  • vote_counts: vote count ( is initially empty )
  • votes: Voting details ( initial is empty )

The concept of proposal deposit (proposal_bond) exists in Sputnik-DAO, where the proposer needs to stake a certain amount of NEAR tokens as collateral when calling add_proposal(). This deposit will be returned to the proposer when the proposal concludes normally.

2. Proposal Status

Proposals in Sputnik-DAO may go through various states, with the initial state being InProgress. The state changes are driven by the act_proposal() method.

Members can call act_proposal() to perform the following actions on the proposal:

  • VoteApprove: Approve
  • VoteReject:Reject
  • VoteRemove: Remove

After voting, the program will call policy.proposal_status() to count the votes. The proposal status that meets the voting threshold will change accordingly:

  • Approved: internal_execute_proposal() executed
  • Rejected/Removed: processed through internal_reject_proposal()

Proposals with a Removed status will be removed from the proposal pool and the deposit will not be refunded, while proposals with a Rejected status will be retained and the deposit will be refunded.

3. Proposal Execution

Proposals in the Approved state will call internal_execute_proposal() to execute the decision content. Sputnik-DAO supports multiple types of proposals, and this article introduces two typical types:

( 3.1 Contract Function Execution Proposal ) FunctionCall (

The FunctionCall proposal type has passed the function operation to be executed )actions### at the time of creation. internal_execute_proposal() executes these operations in the form of Promise Batch Actions.

( 3.2 Contract Fund Transfer Proposal ) Transfer (

The Transfer type proposal is used to transfer tokens accumulated in the contract account to a specified account. internal_execute_proposal)### will call the internal_payout() function to implement the transfer operations of different types of tokens.

4. Summary

This article introduces the core concepts of the Sputnik DAO smart contracts - Proposal (, including the creation, status changes, and execution process of the proposal. Subsequently, it will further discuss the governance model of Sputnik-DAO based on the proposal )Policy(.

![])https://img-cdn.gateio.im/webp-social/moments-4aed25bcefecb3d554dbe01447d4a0e8.webp(

ACT-4.84%
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • 2
  • Share
Comment
0/400
Hash_Banditvip
· 21h ago
mining near protocol back in 2020... good times ngl
Reply0
RuntimeErrorvip
· 21h ago
When will the new version be available?
View OriginalReply0
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)