Skip to content

Mint and distribute Contribution Token via pallet_asset#9

Merged
lrazovic merged 12 commits intomainfrom
leonardo/mint-and-distribute-contribution-token
Jan 16, 2023
Merged

Mint and distribute Contribution Token via pallet_asset#9
lrazovic merged 12 commits intomainfrom
leonardo/mint-and-distribute-contribution-token

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!()

@lrazovic lrazovic requested a review from joepetrowski January 12, 2023 11:36
origin: OriginFor<T>,
project_metadata_hash: T::Hash,
project_id: T::ProjectIdentifier,
#[pallet::compact] project_id: T::ProjectIdentifier,

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.

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