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_URL
is the url of the archive node used to connect, we recommend using Alchemy/infura.PRIVATE_KEY
is 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_KEY
is the api key create frometherscan
used to accessethereum
data.SIGNER
is the public address of the wallet used to verifymint
andupdateMetadata
call.
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
Pending
is the original status of the buidler which can't do everything beforemint
success. - The
Active
status means that the buidler finished onboarding process and callmint
success. - Buidler can update metadata on official website themselves in
Active
status anytime. - If the buidler quit from community, the status should be set to
Archived
. - The buidler's status can be set to
Suspended
by 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 optimisticSepolia
store 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