🎉 Gate Square Growth Points Summer Lucky Draw Round 1️⃣ 2️⃣ Is Live!
🎁 Prize pool over $10,000! Win Huawei Mate Tri-fold Phone, F1 Red Bull Racing Car Model, exclusive Gate merch, popular tokens & more!
Try your luck now 👉 https://www.gate.com/activities/pointprize?now_period=12
How to earn Growth Points fast?
1️⃣ Go to [Square], tap the icon next to your avatar to enter [Community Center]
2️⃣ Complete daily tasks like posting, commenting, liking, and chatting to earn points
100% chance to win — prizes guaranteed! Come and draw now!
Event ends: August 9, 16:00 UTC
More details: https://www
Sputnik DAO smart contracts core: In-depth analysis of the proposal mechanism
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 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:
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:
After voting, the program will call policy.proposal_status() to count the votes. The proposal status that meets the voting threshold will change accordingly:
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(