πŸ†
GrantPicks
AppGithubPotlock
  • πŸ—ΊοΈOverview
  • πŸ“šUser Guides
    • Getting Started
    • Exploring Rounds
    • User Classes
      • β€πŸ’Ό Projects
        • Applying for A Round
        • Editing Project
        • Creating A Project
        • KYC/Compliance
      • πŸ‘¨β€πŸ’» Round Managers
        • Create A Round
        • Get A Round Funded
        • Reviewing Applications
        • Setting Payouts
        • Triggering Payouts
      • πŸ—³οΈ Voters
        • Voting in a Round
        • Create Challenges
        • Funding A Vaulted Round
      • πŸ•΅οΈ Observers
    • πŸ‘―β€β™‚οΈPairwise Voting Explained
    • Getting Started with Stellar
  • πŸ› οΈDevelopers
    • Smart Contracts - Stellar
      • Project Registry
      • Rounds
        • Factory Methods
        • Round & Vote Methods
        • Events For Indexer
    • Forking the App
    • Smart Contracts on NEAR
  • πŸ™EXTRA
    • πŸ“šGlossary
Powered by GitBook
On this page
  • 1. Set Cooldown Configuration
  • 2. Set Compliance Configuration
  • 3. Set Redistribution Configuration
  • 4. Set Applications Configuration
  • 5. Set Voting Period
  • 6. Set Number of Votes
  • 7. Set Expected Amount
  • 8. Set Admins
  • 9. Add Approved Project
  • 10. Transfer Round Ownership
  • 11. Set Round Complete
  • 12. Update Round
  • 13. Delete Round
  • Application Management Methods
  • Apply to Round

Was this helpful?

  1. Developers
  2. Smart Contracts - Stellar
  3. Rounds

Round & Vote Methods

The Rounds contract includes several methods that facilitate the management of funding rounds and the voting process. Below is a detailed overview of these methods:

1. Set Cooldown Configuration

rustfn set_cooldown_config(env: &Env, round_id: u128, caller: Address, cooldown_period_ms: Option<u64>) -> RoundDetail;

Purpose: This method configures the cooldown period for a specific funding round, which is the time required before a new round can be initiated after the current one ends.

  • Parameters:

    • env: The environment context for executing the method.

    • round_id: The unique identifier of the round being configured.

    • caller: The address of the user making the request.

    • cooldown_period_ms: Optional parameter specifying the cooldown duration in milliseconds.

  • Returns: A RoundDetail object containing updated information about the round.

2. Set Compliance Configuration

rustfn set_compliance_config(env: &Env, round_id: u128, caller: Address, compliance_req_desc: Option<String>, compliance_period_ms: Option<u64>) -> RoundDetail;

Purpose: This method sets compliance requirements for a funding round, including any necessary documentation or checks that must be completed.

  • Parameters:

    • env: The environment context for executing the method.

    • round_id: The unique identifier of the round being configured.

    • caller: The address of the user making the request.

    • compliance_req_desc: Optional description of compliance requirements.

    • compliance_period_ms: Optional duration for which compliance must be maintained.

  • Returns: A RoundDetail object with updated compliance settings.

3. Set Redistribution Configuration

rustfn set_redistribution_config(env: &Env, round_id: u128, caller: Address, allow_remaining_dist: bool, remaining_dist_address: Option<Address>) -> RoundDetail;

Purpose: This method configures whether remaining funds from a round can be redistributed and specifies where those funds should be sent.

  • Parameters:

    • env: The environment context for executing the method.

    • round_id: The unique identifier of the round being configured.

    • caller: The address of the user making the request.

    • allow_remaining_dist: Boolean indicating if redistribution is allowed.

    • remaining_dist_address: Optional address for receiving redistributed funds.

  • Returns: A RoundDetail object reflecting changes to redistribution settings.

4. Set Applications Configuration

rustfn set_applications_config(env: &Env, round_id: u128, caller: Address, allow_applications: bool, start_ms: Option<u64>, end_ms: Option<u64>) -> RoundDetail;

Purpose: This method configures application settings for a funding round, including whether applications are allowed and their time frame.

  • Parameters:

    • env: The environment context for executing the method.

    • round_id: The unique identifier of the round being configured.

    • caller: The address of the user making the request.

    • allow_applications: Boolean indicating if applications can be submitted.

    • start_ms: Optional start time for accepting applications in milliseconds.

    • end_ms: Optional end time for accepting applications in milliseconds.

  • Returns: A RoundDetail object with updated application settings.

5. Set Voting Period

rustfn set_voting_period(env: &Env, round_id: u128, caller: Address, start_ms: u64, end_ms: u64);

Purpose: This method sets the voting period for a specific funding round.

  • Parameters:

    • env: The environment context for executing the method.

    • round_id: The unique identifier of the round being configured.

    • caller: The address of the user making the request.

    • start_ms: Start time for voting in milliseconds.

    • end_ms: End time for voting in milliseconds.

6. Set Number of Votes

rustfn set_number_of_votes(env: &Env, round_id: u128, caller: Address, num_picks_per_voter: u32);

Purpose: This method specifies how many projects each voter can select during voting.

  • Parameters:

    • env: The environment context for executing the method.

    • round_id: The unique identifier of the round being configured.

    • caller: The address of the user making the request.

    • num_picks_per_voter: Number of projects each voter can choose.

7. Set Expected Amount

rustfn set_expected_amount(env: &Env, round_id: u128, caller: Address, amount: u128);

Purpose: This method sets an expected funding amount for a specific funding round.

  • Parameters:

    • env: The environment context for executing the method.

    • round_id: The unique identifier of the round being configured.

    • caller: The address of the user making the request.

    • amount: Expected amount to be raised in this round.

8. Set Admins

rustfn set_admins(env: &Env, round_id: u128, round_admins: Vec<Address>);

Purpose: This method assigns administrators to manage a specific funding round.

  • Parameters:

    • env: The environment context for executing the method.

    • round_id: The unique identifier of the round being configured.

    • round_admins: List of addresses designated as admins for this round.

9. Add Approved Project

rustfn add_approved_project(env: &Env, round_id: u128, caller: Address, project_ids: Vec<u128>);

Purpose: This method allows an admin to add approved projects to a specific funding round.

  • Parameters:

    • env: The environment context for executing the method.

    • round_id: The unique identifier of the round being modified.

    • caller: The address of the user making this request (must be an admin).

    • project_ids: List of project IDs to be added as approved projects.

10. Transfer Round Ownership

rustfn transfer_round_ownership(env: &Env, round_id: u128, new_owner: Address);

Purpose: This method transfers ownership of a specific funding round to a new owner.

  • Parameters:

    • env: The environment context for executing this transfer.

    • round_id: The unique identifier of the round being transferred.

    • new_owner: Address of the new owner who will take over control.

11. Set Round Complete

rustfn set_round_complete(env: &Env, round_id: u128, caller: Address) -> RoundDetail;

Purpose: This method marks a funding round as complete once all processes are finalized.

  • Parameters:

    • env: The environment context for executing this action.

    • round_id: The unique identifier of the completed round.

    • caller: The address of the user initiating this action (must be an admin).

  • Returns: A updated RoundDetail object indicating that this round has been completed.

12. Update Round

rustfn update_round(env: &Env, caller: Address, round_id: u128, round_detail: UpdateRoundParams) -> RoundDetail;

Purpose: This method allows an admin to update details about an existing funding round.

  • Parameters:

    • env: The environment context for executing this update.

    • caller: The address of the user initiating this update (must be an admin).

    • round_id: The unique identifier of the round being updated.

    • round_detail: Updated parameters encapsulated in an UpdateRoundParams struct.

  • Returns: An updated RoundDetail object reflecting changes made to this funding round.

13. Delete Round

rustfn delete_round(env: &Env, round_id: u128) -> RoundDetail;

Purpose: This method removes a specified funding round from existence within the contract.

  • Parameters:

    • env: The environment context for executing this deletion.

    • round_id: The unique identifier of the round to be deleted.

  • Returns : A deleted (or removed) RoundDetail object indicating that this funding has been removed from existence.

Application Management Methods

Apply to Round

rustfn apply
PreviousFactory MethodsNextEvents For Indexer

Last updated 7 months ago

Was this helpful?

πŸ› οΈ