StableUnit - over-collateralized multi-currency stablecoin that yields interest directly to users wallets. Censorship resistance is achieved by DAO ownership.
The end goal is to expand DAO for the maximum number of people and implement an open-source monetary system that owned by everyone on the planet and shares benefit equally for everyone. Collective ownership would prevent centralized abuse such as overprinting and solves UBI. More details
DAO is owned and governed by NFT and SuDAO token holders, to represent both reputation-based and capital-based sources of influence. This repository contains wip implementation of the system.
My proposal for stableunit community to form onchain org to creating something cool together init DAO
- create two wallets on bsc and ethereum with the same address
- ask for $5-10 donations
- deploy multisig bsc
- share github with ready to use migration script with 4.1 deploy suDAO token and transfer ownership to multisig 4.2 deploy vesting contract 4.3 put under 1y vesting 0.1% of total supply of suDAO tokens and airdrops it to all donators equally
- setup snapshot + safeSnap for vested suDAO tokens and add it to multisig now we have DAO from the project supporters which is able to deploy any contact on BSC and control the faite of the project
-
we develop contracts which exchange 7% of suDAO for special NFT
-
create a proposal for DAO to issue a 3 types of NFT tokens:
type A for $1000
type B for $10,000
type C for $100,000
contract for redeem fNFTs for suDAO over time
contract which pays to developers in 5 milestones, and DAO can vote NO is dev didn’t reach milestones.
-
dao-multisig sells these NFTs on OPEN
-
build the best stablecoin possible
-
share ownership for every person in the world
snapshot.org for offchain voting on all chains
controls StableUnitDao-multisig - safe gnosis
SafeSnap - oracle to deliver snapshot offchain voting onchains
StableUnitDao-NFTs
ogNFT
aNFT
cNFT
kolNFT
SuDAO.sol - erc20 with voteDelegate
Distributors
TokenDistributor_v3.sol - code for friends only, to distribute first suDAO and get initital capital
tokens get distributed via timelockVault
TimelockVault.sol - locks suDAO under vesting
npm install --legacy-peer-deps
git submodule init
git submodule update --init --recursive
npx hardhat typechain
npx hardhat compile
We have 3 types of test: unit, integration and deployments.
For clear testing you should delete .openzeppelin/unknown-31337.json
.
You can run tests by this:
npm run test:unit
npm run test:integration
npm run test:deployment
To see contracts coverage running all tests run this:
npm run coverage
if you add new/remove migrations-ts script - please delete all files from js folder so migrations-ts would be recompiled.
npm run deploy:goerli
npm run verify:goerli
Features three options for NFT DAO:
- Og-NFT, original community of 99+ participants
- A-NFT, advisors
- C-NFT, community tokens. Allow inviting new members
Voting power in StableUnit DAO is split between StableUnit NFT and suDAO tokens.
StableUnit dao has 2 token vote system: NFT and suDAO
We have 3 NFT tokens:
- Og-NFT - genesis community
- A-NFT - advisors
- C-NFT - future community members
1. Og-NFT in total would have f_og(t) suDAO voting power from 100% to 30% at the end of the year
2. A-NFT in total would have f_a(t) suDAO voting power 1/10 from all og-NFT
3. C-NFT in total would have f_c(t) from 0 to 50% (I,.e, same as og-NFT eventually)
SuDAO in minted every block like bitcoin-like function and goes to treasury, split into 4 buckets:
- Capital providers & patrons 15%
- Development 25 %(+4 year vesting)
- Farming and other incentives 30%
- DAO Treasury 30%
Og-NFT got invited by core team. Each next invitee has diminishing voting power such that a sum of all NFT powers is finite, like bitcoin mint.
C-NFT token get the same system, can be any amount of members, but each new one gets little less voting power
npx hardhat test
npx hardhat run scripts/deploy-nft.ts --network NETWORK_NAME
For networks other than Ethereum, provide BSC/POLYGONSCAN API KEY like this:
ETHERSCAN_API_KEY=your-bsc/polygonscan-api-key npx hardhat run scripts/deploy-nft.ts --network NETWORK_NAME
This will deploy contract to the network, verify on Xscan, pause the contract for transferring tokens. Save the deployed address
Place the list of addresses into airdrop1.csv
files, 20 in each.
Run airdrop like this:
npx hardhat airdrop --address 0xDEPLOYED_ADDRESS --filename ./airdrop.csv --network NETWORK_NAME
npx hardhat grant-role --address 0xDEPLOYED_ADDRESS --network NETWORK_NAME \
--role ADMIN \
--account 0xyouraddress
Optionally, grant yourself minter and pauser access:
npx hardhat grant-role --address 0xDEPLOYED_ADDRESS --network NETWORK_NAME \
--role MINTER \
--account 0xyouraddress
npx hardhat grant-role --address 0xDEPLOYED_ADDRESS --network NETWORK_NAME \
--role PAUSER \
--account 0xyouraddress
npx hardhat renounce-role --address 0xDEPLOYED_ADDRESS --network NETWORK_NAME
This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, a sample script that deploys that contract, and an example of a task implementation, which simply lists the available accounts.
Try running some following tasks:
npm install
npx hardhat accounts
npx hardhat compile
npx hardhat test
Deploy & verify (verification might fail)
npx hardhat run scripts/deploy-nft.ts --network mumbai
npx hardhat verify --network mumbai 0x000000006cD799E2cC7A3Fe68ef0D8bfD7f8f477
npx hardhat airdrop --network mumbai --address 0x000000006cD799E2cC7A3Fe68ef0D8bfD7f8f477 --filename ./airdrop.csv
npx hardhat transfer-owner --network mumbai --address 0x000000006cD799E2cC7A3Fe68ef0D8bfD7f8f477 --owner 0xF2A961aF157426953e392F6468B0162F86B2aCBC
npx hardhat renounce-role --network mumbai --address 0x000000006cD799E2cC7A3Fe68ef0D8bfD7f8f477
- Generate typechain by
hardhat typechain
(you may need to comment 21-23 lines in hardhat.config.js and after generation uncomment them) - deployer run
npm run deploy:goerli
(has only PRIVATE_KEY_TESTNET_DEPLOYER) - admin run
npx hardhat setDistributor --verbose --network goerli
(he has also PRIVATE_KEY_TESTNET_ADMIN) - admin run
npx hardhat setBonus --verbose --network goerli
- admin run
npm run verify:goerli
- dao (multisig) run
suDAO.mint(tokenDistributor.address, 1450000000000000000000000)
- dao (multisig) run
accessControlSingleton.grantRole(await tokenDistributor.ADMIN_ROLE(), tokenDistributor.address)
from gnosis-safe multisig.- ADMIN_ROLE is
0xa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775
- tokenDistributor.address you can find in
submodule-artifacts/goerli/TokenDistributorV4.json
- ADMIN_ROLE is
- Choose what you need in
scripts/propose-upgrade.ts
inmain
function. - Run
npm run upgrade-proposal:goerli
- If you have
deployment at 0x... address is not registered
error, you have incorrect .openzeppelin/goerli.json. So you need to run forceImport (10 line in propose-upgrade.ts)
- If you have
- Go to the url in the log (it's url of created proposal that can see that ProxyAdmin owner is gnosis-safe multisig)
- In the proposal - addresses, that are in the gnosis-safe multisig, can approve this proposal
- After that you can execute it.
- If proposal is executed you can verify contract via
npm run verify:goerli
CrossChain NFT (gitbook)
We use Layer-Zero UniversalONFT721 in the base. So for make NFT cross-chain sendable you should:
- Deploy to chain1 with
npm run deploy-nft:goerli
- Deploy to chain2 with
npm run deploy-nft:mumbai
(it could fail in verification step, you can ignore that) - Prepare NFT in chain1 with
hardhat run ./scripts/prepare-lz-nft.ts --network mumbai
- Prepare NFT in chain2 with
hardhat run ./scripts/prepare-lz-nft.ts --network goerli
- For testing that all works - run script that sends token with id 100 from deployer in mumbai to admin in goerli with
hardhat run ./scripts/send-lz-nft.ts --network mumbai
We use Layer-Zero LzAppUpgradeable in the base. So for make ERC-20 cross-chain sendable you should:
- Deploy to chain1 with
npm run deploy-suDAO:goerli
- Deploy to chain2 with
npm run deploy-suDAO:mumbai
(it could fail in verification step, you can ignore that) - Prepare NFT in chain1 with
npm run prepare-suDAO:mumbai
- Prepare NFT in chain2 with
npm run prepare-suDAO:goerli
- For testing that all works call bridge function and pass eth as fee for that operation.
To run coverage:
- Remove typechain-types folder in contracts/periphery folder
- Run
hardhat coverage
For 23/11/2023 coverage is: