Minting a smart common means that developers accept governance based on consensus Proof-of-Value, moving away from capitalist modes of production. The focus here is:
- Signing a license to contribute your work as a smart common, which is a kind of public good for humanity.
- Reap the rewards of a decentralized valuation market in Proof-of-Value 1.0.
Smart Common refers to smart creative commons (including dApps, EIPs, AIs, games, papers, technical standards, etc.) published under the SCC0 license, possessing their own valuation tokens, and enabling developers to receive awards based on DAism's consensus Proof-of-Value (PoV).
The menu "Smart Commons" provides a way for developers to manage the versions of their smart commons and the awards they've received.
{
{
string name; // Smart Common name, unique, cannot have the same name as other Smart Commons.
string symbol; // Smart Common token name, unique, cannot have the same name as other Smart Common tokens.
string desc; // Smart Common description.
address manager; // Smart Common's manager.
uint16 version; // Smart Common's version number, starting from 1.
string SC_Type // Type of Smart Common.
},
address[] calldata _members, // List of members.
uint16[] calldata _dividendRights, // Member voting rights (dividend rights), corresponding one-to-one with _members.
uint16 _strategy, // Proposal voting pass rate. One hundred percent (unanimous) is 2 to the power of 16 minus 1 (65535), can be changed by proposals.
uint32 _lifetime, // Proposal lifespan, in seconds, starting from proposal creation, invalidated if not completed within this time.
uint32 _coolingPeriod // Proposal cooling period, in seconds, starting from proposal creation, no new proposals can be created until this period has passed. Note: Cooling period must be greater than the lifetime.
{
string filetype // File extension for the logo, must be svg.
string fileContent // Pure text content of the svg.
}
}
If your smart contract is an EIP or a paper, you'd better to read Applying Proof of Value (PoV) to EIPs or AI Applying PoV Value Proof to EIPs, AI Fields or anything else to understand the award mechanism brought by PoV.
- We recommend writing the EIP or paper as HTML source code in the smart contract:
function eipContent() external view returns(string memory);
- If it is an EIP already published on GitHub, such as ERC-2569, you can replace the EIP's HTML source code with a link to the EIP content (published on eips.ethereum.org, or github). For instance, the address could be https://eips.ethereum.org/EIPS/erc-2569. Additionally, the author should include an address in the original EIP that matches the owner address written in the smart contract. For example:
owner = your ethereum account(address)
- For non-dApp types of Smart Commons, pay attention to the exclusive naming method of the valuation token when minting. Relevant content (section "Naming Valuation Tokens") is at the bottom of this article.
Minting a Smart Common on DAism
- Only the owner of the smart contract can mint a Smart Common, please deploy your smart contract on Ethereum Mainnet first.
- The contract that mints the Smart Common can be any smart contract. Each contract address could create only one Smart Common.
- When minting a Smart Common, you can also mint any set of Honor Tokens (a type of NFT commemorating the birth of your Smart Common). The number can be N times the number of dividend members of your Smart Common. Ensure that your smart contract has the necessary interface calling codes in advance.
- Due to the high cost of Ethereum gas, it is recommended that the logo is a SVG vector graphic below 2K.
Smart Contract Example
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract ThreeDapp {
address public owner;
constructor(){
owner = tx.origin;
}
function ownerOf() public view returns(address){
return owner;
}
}
Example of Deploying and Minting a Smart Common with Hardhat
const fs = require('fs')
const {ethers} = require('hardhat')
// You can create a smart common by using the following script.
async function main() {
await hre.run('compile');
const[owner] = await ethers.getSigners();
// The following script is an example to mint a smart common with a dApp.
// The name of your dApp's contract, use this name to load and deploy your dApp.
const contractName = 'ThreeDapp';
// The contract address for smart commons' registration. You need to call this address to register when minting a smart common.
const daismRegistrar_ = '0x3Bf70f9BfCfF20a90f0F36bAAF0d5afc3Ee232b7';
// The contract address of Honor Token. You need to call it when minting a Honor Token alongside minting a smart common.
const daismHonorTokens_ = '0xC473f79875F202D15b128f2a40dff7e35B972Fc4';
// Load and deploy your dapp by using the name of your dapp contract.
const dappContract = await daism_deploy(owner, contractName, [])
// Below is the ABI for the registration of your smart common. This script needs to call this registration method to mint your smart common.
let registerAbi = [{
"inputs": [{
"components": [{
"internalType": "string",
"name": "name",
"type": "string"
},
{
"internalType": "string",
"name": "symbol",
"type": "string"
},
{
"internalType": "string",
"name": "desc",
"type": "string"
},
{
"internalType": "address",
"name": "manager",
"type": "address"
},
{
"internalType": "uint16",
"name": "version",
"type": "uint16"
},
{
"internalType": "string",
"name": "SCType",
"type": "string"
}],
"internalType": "struct SCInfo",
"name": "_SCInfo",
"type": "tuple"
},
{
"internalType": "address[]",
"name": "_members",
"type": "address[]"
},
{
"internalType": "uint16[]",
"name": "_dividendRights",
"type": "uint16[]"
},
{
"internalType": "uint16",
"name": "_strategy",
"type": "uint16"
},
{
"internalType": "uint32",
"name": "_lifetime",
"type": "uint32"
},
{
"internalType": "uint32",
"name": "_coolingPeriod",
"type": "uint32"
},
{
"components": [{
"internalType": "string",
"name": "fileType",
"type": "string"
},
{
"internalType": "string",
"name": "fileContent",
"type": "string"
}],
"internalType": "struct File",
"name": "_logo",
"type": "tuple"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}],
"name": "createSC",
"outputs": [{
"internalType": "uint256",
"name": "",
"type": "uint256"
}],
"stateMutability": "nonpayable",
"type": "function"
}]
//Load DAism's registration contract
const registerContract = new ethers.Contract(daismRegistrar_, registerAbi, owner)
// Parameters for minting a smart common (see the structural description above for parameter details). Note: your smart common's name and it's token name must not be the same.
let SCinfo = ["scname5", "scsymbol5", "scdesc5", await dappContract.getAddress(), 1, 'dapp']
// Mint a dApp type smart public asset.
let res = await registerContract.createSC(
SCinfo,
[owner.address], // member list
[10], // member voting rights (dividend rights), cannot be 1,2,3,4 because these four numbers have special uses.
(2 ** 16-1).toString(), // approval rate of proposal voting, percentage (full vote).
7 * 24 * 3600, // Lifetime is 7 days.
9 * 24 * 3600, // Cooldown period is 9 days.
[ 'svg', 'code of your svg'],
'0x' //0x indicates that no honor token will be minted.
)
console.log('createSC hash: ' + res.hash)
await res.wait()
console.log("createSC succeeded")
// The following is an example to mint an EIP-type smart common, along with minting a honor token.
let mintNum = 1 //Number of Honor Token's sets.
let abicoder = new ethers.AbiCoder()
//Package the owner list and number of honor token's sets.
let functionData = abicoder.encode(['address[]', 'uint256'], [[owner.address], mintNum])
//Package the honor token contract's address and parameters
let paras = abicoder.encode(["address", "bytes"], [daismHonorTokens_, functionData]);
//Parameters for minting a smart common (see the structural description above), note: name of your smart common and token name must not be the same.
SCinfo = ["scname6", "scsymbol6", "scdesc6", await dappContract.getAddress(), 1, 'EIP']
// Mint an EIP type smart common.
res = await registerContract.createSC(
SCinfo,
[owner.address], // member list
[10], // member voting rights (dividend rights), cannot be 1,2,3,4 because these four numbers have special uses.
(2 * *16 - 1).toString(), // approval rate of proposal voting, percentage (full vote).
7 * 24 * 3600, // Lifetime is 7 days.
9 * 24 * 3600, // Cooldown period is 9 days.
[ 'svg', 'code of your svg'],
paras)
console.log('createSC hash: ' + res.hash)
await res.wait()
console.log("createSC success")
console.log("--------------END--------------")
}
// Method to deploy the contract
async function daism_deploy(signer, contractName, paras = []) {
const factory = await ethers.getContractFactory(contractName, signer)
const product = await factory.deploy.apply(factory, paras)
await product.waitForDeployment()
const contract_address = await product.getAddress()
console.log('Deploy: ' + contractName + ' : ' + contract_address)
return await ethers.getContractAt(contractName, contract_address, signer)
}
main().then(() = >process.exit(0)).
catch((error) = >{
console.error(error);
process.exit(1);
});
Example of Minting a Smart Common on DAism's Webpage
First, deploy a smart contract capable of calling the mint Smart Common contract (e.g., your dApp). Obtain the deployment address of this smart contract or dApp.
Fill in the corresponding information on the webpage and mint, as shown in the image below:
Naming Valuation Tokens
We refer to common methods in operating systems Unix and Windows, namely:
- The classification of Smart Commons is reflected in the name of the valuation token.
- The naming of the valuation token refers to the method in computer operating systems, which is divided into two parts by ".":
- The naming of valuation tokens for dApps does not have a ".extension". For example: DAI.
- The naming rule for valuation tokens of any other category is "XXXX.extension". For example: UL.eip (indicating that its Smart Common is an EIP). Or: ALOHA.ai (indicating it is an AI project). The extension is recommended to be lowercase to make the preceding name stand out. Anyone can arbitrarily set the extension of his/her Smart Common—this is a decentralized naming convention. Of course, if others have already made a flawless naming in a category, it is hoped that subsequent developers will follow it.