This is the LXDAO SBT-based Membership System Contract project.
By using this contract, any Dao can issue a unique soul-bound token to community members.
.env.example explanation
API_URLis the url of the archive node used to connect, we recommend using Alchemy/infura.PRIVATE_KEYis the wallet private key, used for generating signature and pass to contract to verify. It is recommended to create a new empty wallet.ETHERSCAN_API_KEYis the api key create frometherscanused to accessethereumdata.SIGNERis the public address of the wallet used to verifymintandupdateMetadatacall.
after all , modify the .env.example file to .env
npm install
npm run test
npm run compile
npm run deploy:rinkeby
When your deployment is complete, the SIGNER in the .env file will be the first SIGNER of the contract (which you can change later by using setSigner)
When a new member was added to the community, the signature of SIGNER is required, and the signature implementation function is as follows
import bs58 from "bs58";
import ethers from "ethers";
import * as dotenv from 'dotenv';
dotenv.config();
let provider = new ethers.providers.JsonRpcProvider(process.env.API_URL)
let originalSigner = new ethers.Wallet(process.env.PRIVATE_KEY, provider);//get Signer object
const ipfsHash = "Your ipfs Hash";
const builderAddress = "your wallet address"
async function getSignature() {
const bytes = bs58.decode(ipfsHash).slice(2);
const hash = ethers.utils.keccak256(
ethers.utils.defaultAbiCoder.encode(["bytes", "address"], [bytes, builderAddress]),
);
const hashBytes = ethers.utils.arrayify(hash);
const signature = await originalSigner.signMessage(hashBytes);
console.log("Signature:",signature)
return signature
}
getSignature()
- The
Pendingis the original status of the buidler which can't do everything beforemintsuccess. - The
Activestatus means that the buidler finished onboarding process and callmintsuccess. - Buidler can update metadata on official website themselves in
Activestatus anytime. - If the buidler quit from community, the status should be set to
Archived. - The buidler's status can be set to
Suspendedby committee for security reasons, reactivate is possible after resolve it.
LXDAO is an R&D-focused DAO in Web3. Our mission is: To bring together buidlers to buidl and maintain valuable projects for Web3, in a sustainable manner.
npx hardhat run scripts/snapshot.ts --network mainnet- Deploy Contract
npx hardhat run scripts/deploy.ts --network optimisticEthereum
# npx hardhat run scripts/deploy.ts --network optimisticSepoliastore the contract address and change the CONTRACT_ADDRESS in .env
- Verify Contract
npx hardhat verify {BUIDLER_CONTRACT_ADDRESS} {SIGNER} {METADATA_CONTRACT_ADDRESS} --network optimisticEthereum
# npx hardhat verify {BUIDLER_CONTRACT_ADDRESS} {SIGNER} {METADATA_CONTRACT_ADDRESS} --network optimisticSepolia- Airdrop
npx hardhat run scripts/airdrop.ts --network optimisticEthereum
# npx hardhat run scripts/airdrop.ts --network optimisticSepolia