Skip to content

[Governance] Create proposal entrypoint #89

Description

@Kaylahray

Description

The Governance contract defines proposal storage and vote execution flows, but it still needs a public proposal-creation entrypoint so proposals can be created on-chain without test-only storage seeding.

User Story

As a Protocol User,
I want to create a proposal through the contract,
so that governance state begins from an on-chain action rather than direct storage writes.

Requirements and Context

  • Files: contracts/governance/src/lib.rs, contracts/governance/src/types.rs, contracts/governance/src/test.rs
  • Add create_proposal(env: Env, proposer: Address, metadata_hash: BytesN<32>, end_time: u64) -> u32
  • Require proposer.require_auth()
  • Generate and persist a new proposal ID with zeroed vote counters and executed = false
  • Add any additional storage key needed for proposal counting

Suggested Implementation

// IN FUNCTION: create_proposal(env: Env, proposer: Address, metadata_hash: BytesN<32>, end_time: u64) -> u32
// 1. proposer.require_auth();
// 2. let proposal_id = next stored counter value;
// 3. let proposal = Proposal { ... };
// 4. env.storage().persistent().set(&DataKey::Proposal(proposal_id), &proposal);
// 5. return proposal_id;

Acceptance Criteria

  • Proposals can be created without writing storage directly in tests.
  • Proposal IDs increment predictably.
  • Newly created proposals are voteable and executable through existing governance flows.

Submission Guidelines

  • Branch: feat/create-proposal
  • Depends on: [Governance] Define proposal schema
  • PR: feat(governance): add create_proposal entrypoint

Activity

  1. malaysiaonelove commented on Jul 21, 2026

    @malaysiaonelove

    Hi maintain,I will love to work on this issue,I have an experience and I have already reviewed the issue please assigned me to it and I will give a good result.

  2. SaintSammi commented on Jul 25, 2026

    @SaintSammi
    Contributor

    Hi Maintainer, I have read and understood what is required, please assign this issue to me. I can deliver an excellent job

  3. grantfox-oss commented on Jul 25, 2026

    @grantfox-oss

    🦊 GrantFox — @SaintSammi has been assigned to this issue as part of the Official Campaign | FWC26 campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #89)
    2. Your PR will be reviewed by the learnault maintainers

    Good luck! Track your progress on GrantFox.

  4. grantfox-oss commented on Jul 29, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Official Campaign | FWC26 campaign!

    @SaintSammi's PR #104 was approved and merged by @Kaylahray.

    🏆 @SaintSammi: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (201 total points). Track your full progress on GrantFox.

    👏 Great work, @SaintSammi! Keep contributing to learnault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions