📢 Gate Square #MBG Posting Challenge# is Live— Post for MBG Rewards!
Want a share of 1,000 MBG? Get involved now—show your insights and real participation to become an MBG promoter!
💰 20 top posts will each win 50 MBG!
How to Participate:
1️⃣ Research the MBG project
Share your in-depth views on MBG’s fundamentals, community governance, development goals, and tokenomics, etc.
2️⃣ Join and share your real experience
Take part in MBG activities (CandyDrop, Launchpool, or spot trading), and post your screenshots, earnings, or step-by-step tutorials. Content can include profits, beginner-friendl
Sputnik DAO smart contracts analysis: Decentralization governance of the NEAR ecosystem from the proposal mechanism
Rust smart contracts Development Diary: In-depth Analysis of Sputnik DAO Proposal Mechanism
Sputnik DAO, as the infrastructure of the NEAR ecosystem, is promoting NEAR projects towards decentralized autonomy. This article will delve into the core concepts of the Sputnik DAO smart contracts - the proposal mechanism (Proposal).
1. Proposal Initiation
Each member in the Sputnik DAO can initiate proposals to express opinions on project governance. From the contract perspective, members can call the add_proposal() method of the sputnikdaov2 contract to initiate a new proposal:
rust u64
The proposer needs to provide detailed information about the proposal, including:
The contract will further process this information, generating a complete Proposal object and assigning a unique proposal_id.
It is worth noting that initiating a proposal requires staking a certain amount of NEAR tokens as collateral. This collateral will be refunded to the proposer after the proposal concludes normally.
2. Proposal Status
Proposals in the Sputnik DAO may go through various states:
The change in the proposal status is driven by the act_proposal() method. DAO members can call this method to vote on the proposal:
After the voting ends, update the proposal status based on the voting results.
3. Proposal Execution
When the proposal status changes to Approved, the contract will call the internal_execute_proposal() function to execute the proposal content.
Sputnik DAO supports various types of proposals, this article focuses on two typical proposals:
( 3.1 Contract Function Execution Proposal
For proposals of the FunctionCall type, the contract will execute the function calls specified in the proposal. The proposal can contain multiple ActionCall objects, each specifying the contract method and parameters to be called.
![])https://img-cdn.gateio.im/webp-social/moments-eb73d5e15f6161f0a4b442cd4b99a91e.webp###
( 3.2 Fund Transfer Proposal for Smart Contracts
Transfer proposals are used to transfer tokens from the contract account to a specified account. The contract will perform the corresponding transfer operation based on the token type and the type of receiving account.
![])https://img-cdn.gateio.im/webp-social/moments-4aed25bcefecb3d554dbe01447d4a0e8.webp###
4. Summary
This article introduces the core concepts of the proposal mechanism in the Sputnik DAO smart contracts, including the creation, status changes, and execution process of proposals. This mechanism provides a flexible and efficient decentralized governance solution for the NEAR project.