🎉 [Gate 30 Million Milestone] Share Your Gate Moment & Win Exclusive Gifts!
Gate has surpassed 30M users worldwide — not just a number, but a journey we've built together.
Remember the thrill of opening your first account, or the Gate merch that’s been part of your daily life?
📸 Join the #MyGateMoment# campaign!
Share your story on Gate Square, and embrace the next 30 million together!
✅ How to Participate:
1️⃣ Post a photo or video with Gate elements
2️⃣ Add #MyGateMoment# and share your story, wishes, or thoughts
3️⃣ Share your post on Twitter (X) — top 10 views will get extra rewards!
👉
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.