
secondary title
Decentralized Autonomous Organization (DAO) is a brand-new collaborative way for Internet human organizations. It operates on a blockchain network and is co-owned and governed by its internal committee of members. The characteristic of DAO is its "decentralization", which means that this type of organization does not need to be supervised and operated by a centralized organization, and its internal decision-making is usually managed and promoted in the form of proposals (Proposal) and voting (Voting).
text
1.1 🧐Why use DAO?
From the perspective of smart contracts, there are often some privileged operations in conventional contracts, similar to:
Upgrade of contract business logic
Changes to contract key configuration information
Replacement of contract function accounts
Sensitive operations involving DeFi fund pools
wait...
Solidity contracts deployed in Ethereum usually use modifiers such as onlyOwner to prevent ordinary users of the contract from executing these privileged functions, and at the same time, the operation of setting these privilege levels must be performed by the administrator (Administer) or operator allowed by the contract (Operator) to execute on behalf of.
However, using such a method for authority control, the contract will inevitably have a "centralization problem"💥.
Imagine the following situation:
The private key of the contract function account (such as the manager and operator) may be lost, which will cause a single point of failure problem, causing the contract to be permanently in a state of denial of service.
The project team that develops the contract is untrustworthy or irresponsible, and there is a possibility of carrying out some malicious behaviors such as "running away with money".
DAOs are often used for organization-wide voting. Compared with traditional centralized operating organizations, specific things are not controlled by a specific "CEO". Likewise, there are no CFO, CMO and many other management roles in this organization. Instead, it is a smart contract that integrates business logic and is deployed on the chain to run automatically.
secondary title
2. Interpretation of Spuntnik DAO contract series
The DAO infrastructure platform Sputnik DAO (also known as astrodao) provided by NEAR Protocol endows NEAR with a good ecological community autonomy.
This series of "Rust Smart Contract Cultivation Diary (10) - Spuntnik DAO" will introduce Spuntnik-DAO in detail, and will gradually analyze the internal implementation principles of its smart contracts in subsequent articles, and help everyone better Think about "How to develop Rust smart contracts from a security perspective" 🥳
secondary title
3. Spuntnik DAO project structure
The Spuntnik DAO platform is mainly composed of 3 NEAR smart contracts, which perform different functions in the project:
sputnikdao2 contract: it is a specific DAO instance contract, which can realize the formulation of DAO governance model/strategy, and perform the functions related to decision-making management within the Spuntnik DAO platform. For example, processing proposals and voting, controlling the roles and permissions of DAO member councils, etc...
The following is a simplified schematic diagram of the contract, and more detailed interpretations will be further expanded in subsequent articles
sputnik-staking contract: the governance token contract bound to the DAO instance contract. For example, the user can deposit a certain amount of governance tokens into the contract to obtain the voting weight in the user's sputnikdao2 contract, or entrust the governance tokens to a designated user to increase the proxy's voting weight.
sputnikdao-factory2 contract: This contract uses the creational factory design pattern (Factory Pattern) to realize the unified creation and management of all decentralized autonomous organization (DAO) instances under the platform.
Note: The open source code warehouse of Spuntnik-DAO v2 version is located [here] The code of this version is still in the development and testing stage, and has not yet been officially launched on the NEAR mainnet. This series of Rust contract development diaries is only for learning and research purposes.