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

feat (pop api): add burn and mint to local fungibles use case #98

Closed
Tracked by #132
Daanvdplas opened this issue Jul 5, 2024 · 5 comments · Fixed by #150
Closed
Tracked by #132

feat (pop api): add burn and mint to local fungibles use case #98

Daanvdplas opened this issue Jul 5, 2024 · 5 comments · Fixed by #150

Comments

@Daanvdplas
Copy link
Collaborator

Daanvdplas commented Jul 5, 2024

Based on the Mintable and Burnable standards.

standards:

As you can see they also emit the Transfer event

@chungquantin
Copy link
Collaborator

#[pallet::call_index(6)]
pub fn mint(
	origin: OriginFor<T>,
	id: T::AssetIdParameter,
	beneficiary: AccountIdLookupOf<T>,
	#[pallet::compact] amount: T::Balance,
) -> DispatchResult

#[pallet::call_index(7)]
pub fn burn(
	origin: OriginFor<T>,
	id: T::AssetIdParameter,
	who: AccountIdLookupOf<T>,
	#[pallet::compact] amount: T::Balance,
) -> DispatchResult

@Daanvdplas
Copy link
Collaborator Author

Daanvdplas commented Jul 22, 2024

For the native token we won't be able to mint or burn since we are using the DOT token. Minting happens through inflation.

In other words, we need Polkadot root origin to do that which we can not :)

This is a good find, we will have to look for what error to return (BadOrigin perhaps) and make sure this is documented properly in the API.

@chungquantin
Copy link
Collaborator

chungquantin commented Jul 22, 2024

@Daanvdplas But this is specifically in the Pop network case that use DOT as a chain token right? I think POP API still need to support the native token mint when it is used in other Substrate-based blockchain.

@Daanvdplas
Copy link
Collaborator Author

This will still require the root origin most of the time because allowing anyone to mint the native token of the chain seems like a unlikely configuration (difficult to create value for your token if everyone can create them our of thin air). A chain using a contract to mint its native token could be a use case but TMO not reason enough to include it now. In general, the force_ dispatchables have also not been added to the fungibles use case for the same reason. Depending on use cases and developer demand we can always implement them.

@Daanvdplas Daanvdplas assigned Daanvdplas and unassigned Daanvdplas Jul 26, 2024
@Daanvdplas Daanvdplas linked a pull request Jul 31, 2024 that will close this issue
@Daanvdplas
Copy link
Collaborator Author

Closed with #150

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 a pull request may close this issue.

2 participants