Skip to content
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

Mint and distribute Contribution Token via pallet_asset #9

Merged
merged 12 commits into from
Jan 16, 2023

Conversation

lrazovic
Copy link
Member

Add the (basic) ability to create and mint Contribution Tokens via pallet_asset.

  1. Loosely coupled pallet_asset to pallet_funding
  • The Asset is created via a create() extrinsic (provided by pallet_asset) at the end of the Community Round
    • Parameters:
      • id: The identifier of the new asset. We use the T::ProjectIdentifier.
      • admin: The admin of this class of assets. The Issuer of the project.
      • min_balance: The minimum balance of this new asset that any single account must have. Se via the Issuer when the project is created.
  • The Asset's metadata are set via the set() extrinsic (provided by pallet_asset)
  • Users, with the right credentials, can claim their contribution tokens using the new claim_contribution_tokens(origin: OriginFor<T>, project_id: T::ProjectIdentifier) extrinsic.
  1. Tests
    todo!()
  2. Benchmarks
    todo!()

@@ -381,7 +397,7 @@ pub mod pallet {
pub fn edit_metadata(
origin: OriginFor<T>,
project_metadata_hash: T::Hash,
project_id: T::ProjectIdentifier,
#[pallet::compact] project_id: T::ProjectIdentifier,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to be careful, when you go to 0.9.36 you will need to account for paritytech/substrate@a0e00dc.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the Cumulus companion for how that impacts the pallet config (and how you can still use compact).

@lrazovic lrazovic marked this pull request as ready for review January 16, 2023 10:33
@lrazovic
Copy link
Member Author

Following the same reasoning done for pallet-assets paritytech/substrate#12740 The HasCompact and TypeInfo trait bounds on ProjectId have been removed. Compact can be used on the new type ProjectIdParameter.

@lrazovic lrazovic merged commit 2d56a10 into main Jan 16, 2023
@lrazovic lrazovic self-assigned this Jan 17, 2023
@lrazovic lrazovic deleted the leonardo/mint-and-distribute-contribution-token branch March 22, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants