futarchy
futarchy copied to clipboard
Metadata program
To mention some of the simple design decisions as well. Here's the flow of creating the metadata account and using it
- the DAO treasury automatically signs and creates this account with a CPI call when creating their DAO account in the autocrat program.
- They immediately delegate authority over the metadata account to another account which can sign transactions more easily and update the metadata, since otherwise it would require a DAO for every change to the metadata account. The DAO has authority to reassign the delegate account.
- We track the last updated slot for security reasons or something and to access historical versions easily. Just so people can tell if they got hacked and we can see past revisions by going back to the account data in a given slot. We only update once per slot for the same reason.
Those are the main things we think about and try to account for with this program
What's going to be stored in here in practice, basic stuff
- DAO name
- Description
- Socials / Links All enforcement around keys, values and any schemas will be handled on the UI side.
- [x] Modify create metadata to load up the dao account and check that it exists before allowing creating a metadata account.
This is instead of adding any code to autocrat. Though we'll need to make sure the UI creates the DAO and the metadata account in the same transaction.
- [x] Reverting autocrat changes didn't quite work, will need to do another sync with develop and try again later.
I don't understand why the CI tests keep failing but local is fine. Might need more verbose errors in the tests.
Devnet details
Metadata account exists.
Metadata Account Details:
Metadata Account Public Key: 2nmJLYTKLM9geSYBLAPiFw3UYw1S1SUa9nDTeb1iHNZr
DAO Public Key: 8tanoHEyJEQgaasEkv1DxN6umYNWDotbaEpuzstcEufb
Treasury Public Key: GFBqvgmjZcqSGdHVeHw48UACg6JUBSJMdX94Gf9bhfLG
Delegate Public Key: FutaAyNb3x9HUn1EQNueZJhfy6KCNtAwztvBctoK6JnX
Metadata Items:
1. "description": "An example DAO on Solana"
2. "name": "Example DAO"
3. "twitter": "@exampledao"
4. "discord": "<a fake discord link that triggers the bot somehow>"
Program Ids
const AUTOCRAT_PROGRAM_ID = new PublicKey(
"FuTPR6ScKMPHtZFwacq9qrtf9VjscawNEFTb2wSYr1gY"
);
const METADATA_PROGRAM_ID = new PublicKey(
"DATAwTH3mTx43ekTTYoNXL2Z8EAMTGwENkJab7tKXHok"
);
Should be IDLs on chain for both
Still todo
- [ ] figure out why CI tests are failing when local tests are fine
- [ ] Add
init metadata
account instructions to initDao script