Skip to content

Planning #240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class ProposalBase(CustomBaseModel):
end_block: Optional[int] = None
start_block: Optional[int] = None
liquid_tokens: Optional[str] = None # Using string to handle large numbers
parameters: Optional[str] = None # Hex encoded parameters
parameters: Optional[str] = None
# Additional fields from blockchain data
concluded_by: Optional[str] = None
executed: Optional[bool] = None
Expand Down
94 changes: 70 additions & 24 deletions examples/proposal_evaluation_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,69 @@ async def create_test_proposal(dao_id: UUID) -> UUID:
The ID of the created proposal
"""
# Create test parameters as a JSON object
parameters = "let this rip https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExN3VoZzJzdmV3eGs4M2VrOXBkamg2dTVhb2NhcndwNzVxNHplMzhoaiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/M7HkIkPrNhSy4/giphy.gif https://mkkhfmcrbwyuutcvtier.supabase.co/storage/v1/object/public/x-vote-media//img_2.jpeg"
# parameters = "I Publius.btc will do a $FACES airdrop to as many bitcoin faces holders as possible. I will report back with a confirmation message and proof. Give me a shot."
parameters = """

Proposal Title: $FACES Airdrop to Bitcoin Faces Holders with Transparent Execution and Community Engagement

Proposer: Publius.btc

Proposal Data:
I, Publius.btc, propose to execute a $FACES airdrop to Bitcoin Faces holders to boost community engagement and reward active participants in the DAO. Due to a limit of 1,000 tokens per proposal, this will be 1 of 10 proposals, each distributing up to 1,000 $FACES tokens. The airdrop will distribute a total of 10,000 $FACES tokens to eligible holders, with a clear execution plan, transparent verification, and measurable outcomes. The proposal aligns with the DAO's mission to promote community activity and token utility. Below are the details:

Objective: Distribute $FACES tokens to Bitcoin Faces holders to incentivize participation, increase governance engagement, and strengthen community ties.
Eligibility Criteria:
Holders of Bitcoin Faces NFTs as of a snapshot date (to be set 7 days after proposal approval).
Minimum holding: 1 Bitcoin Faces NFT.
Exclusion: Wallets flagged for suspicious activity (e.g., wash trading) based on on-chain analysis.
Execution Plan:
Snapshot: Conduct a blockchain snapshot of Bitcoin Faces holders on the specified date, using a third-party tool (e.g., Etherscan or equivalent for Bitcoin-based assets).
Distribution: Distribute 10 $FACES per eligible wallet, up to a total of 1,000 tokens per proposal, via a smart contract to ensure transparency and immutability. This proposal is part of a series of 10 proposals to reach the full 10,000 token distribution.
Timeline:
Day 1–7: Proposal approval and snapshot preparation.
Day 8: Snapshot execution.
Day 9–14: Smart contract deployment and testing.
Day 15: Airdrop distribution.
Day 20: Post-airdrop report published.
Budget and Funding:
Total Cost: 1,000 $FACES tokens for this proposal (valued at $0.10 per token based on current market price, totaling $100). The full airdrop campaign will total 10,000 tokens across 10 proposals.
Additional Costs: $500 for smart contract development, auditing, and gas fees, to be funded from the DAO treasury.
Funding Request: 1,000 $FACES tokens + $500 in stablecoins (e.g., USDC) from the DAO treasury for this proposal.
Cost Justification: The airdrop is cost-effective, targeting active holders to maximize engagement with minimal token dilution. The $500 covers secure execution to mitigate risks.
Verification and Transparency:
Publish the snapshot data and eligible wallet list on the DAO's governance forum.
Share the smart contract address and transaction hashes on-chain for public verification.
Provide a detailed post-airdrop report within 5 days of distribution, including the number of wallets reached, tokens distributed, and community feedback.
Community Benefit:
Inclusivity: All Bitcoin Faces holders are eligible, ensuring broad participation.
Engagement: The airdrop will encourage holders to participate in governance and DAO activities, addressing low governance participation.
Stakeholder Consideration: The plan includes outreach to diverse community segments via the DAO's social channels (e.g., Discord, X) to ensure awareness and feedback.
Alignment with DAO Priorities:
Promotes token utility and community engagement, core to the DAO's mission.
Supports financial prudence by capping costs and providing ROI through increased governance participation (measurable via voting turnout post-airdrop).
Risk Mitigation:
Financial Risk: Limited to 1,000 $FACES and $500 for this proposal, with no ongoing costs. The full campaign is capped at 10,000 tokens and $5,000 across all proposals.
Execution Risk: Smart contract audit to prevent vulnerabilities.
Inclusion Risk: Transparent eligibility criteria to avoid disputes.
Deliverables and ROI:
Deliverables: Snapshot data, smart contract, airdrop distribution, and post-airdrop report.
ROI: Expected 10% increase in governance participation (based on similar airdrop campaigns) and enhanced community sentiment, measurable via forum activity and X posts.
Addressing Past Concerns:
Unlike previous proposals, this includes a detailed execution plan, budget, and verification process.
Responds to feedback on inclusion by defining clear eligibility and outreach strategies.
Aligns with financial priorities by justifying costs and capping token usage.
Commitment:
I will execute the airdrop as outlined, provide regular updates on the DAO's governance forum, and deliver a comprehensive report with proof of distribution. If the proposal is approved, I will collaborate with the DAO's technical and community teams to ensure success.
"""

# Convert parameters to JSON string and then hex encode it
parameters_hex = "0x" + binascii.hexlify(parameters.encode("utf-8")).decode("utf-8")
# # Convert parameters to JSON string and then hex encode it
# parameters_hex = "0x" + binascii.hexlify(parameters.encode("utf-8")).decode("utf-8")

# Create a test proposal
proposal_data = ProposalCreate(
dao_id=dao_id,
type=ProposalType.ACTION,
parameters=parameters_hex, # Use hex encoded parameters
parameters=parameters, # Use hex encoded parameters
action="send_message",
contract_principal="ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.test-contract",
creator="ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM",
Expand Down Expand Up @@ -145,28 +198,21 @@ async def test_proposal_evaluation_workflow():

# Print the results
print("\nEvaluation Results:")
print(f"Success: {result['success']}")
if result["success"]:
print(f"Approval: {result['evaluation']['approve']}")
print(f"Confidence: {result['evaluation']['confidence_score']}")
print(f"Reasoning: {result['evaluation']['reasoning']}")
print(
f"Total Token Usage by Model: {result.get('total_token_usage_by_model')}"
)
print(f"Total Cost by Model: {result.get('total_cost_by_model')}")
print(
f"Total Overall Cost: ${result.get('total_overall_cost', 0.0):.4f}"
)
print(f"Approval: {result['evaluation'].get('approve', False)}")
print(f"Confidence: {result['evaluation'].get('confidence_score', 0)}")
print(
f"Reasoning: {result['evaluation'].get('reasoning', 'No reasoning provided')}"
)

if scenario["auto_vote"]:
print(f"Auto-voted: {result['auto_voted']}")
if result["vote_result"]:
print(f"Vote Result: {result['vote_result']}")
if result.get("tx_id"):
print(f"Transaction ID: {result['tx_id']}")
else:
print(f"Error: {result.get('error', 'Unknown error')}")
if "token_usage" in result.get("evaluation", {}):
print(f"Total Token Usage: {result['evaluation']['token_usage']}")

if scenario["auto_vote"]:
print(f"Auto-voted: {result.get('auto_voted', False)}")
if result.get("vote_result"):
print(f"Vote Result: {result['vote_result']}")
if result.get("tx_id"):
print(f"Transaction ID: {result['tx_id']}")
except Exception as e:
print(f"Error in scenario {scenario['name']}: {e}")

Expand Down
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

import api
from api import chat, tools, webhooks
from config import config
from lib.logger import configure_logger
from services import startup
Expand Down Expand Up @@ -48,9 +48,9 @@ async def health_check():


# Load API routes
app.include_router(api.tools.router)
app.include_router(api.chat.router)
app.include_router(api.webhooks.router)
app.include_router(tools.router)
app.include_router(chat.router)
app.include_router(webhooks.router)


@app.on_event("startup")
Expand Down
Loading