-
Notifications
You must be signed in to change notification settings - Fork 26
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
Implemented the PSP22
via pallet-assets
chain extension.
#168
Conversation
The library provides default implementation that can be re-used. The change is not fully ready it requires more examples, tests, and documentation.
The id of the chain extension is `0x48f6`. It is the first 2 bytes of the `blake2b` hash from the "pallet-assets-chain-extension@v0.1" string. The [chain extension](https://github.com/Supercolony-net/pallet-assets-chain-extension) created with usage of the [`obce`](https://github.com/Supercolony-net/obce) crate. The chain extension is not ready for production because it requires some additional changes on the `pallet-assets` side(some operations should be performed by the contract only if the contract is admin). But it is a matter of time, so I think we can register it and fix it with minor patches. Added support of the extension into [substrate-contract-node](paritytech/substrate-contracts-node#146) and into [OpenBrush](Supercolony-net/openbrush-contracts#168).
|
* Add `pallet-assets` chain extension. The id of the chain extension is `0x48f6`. It is the first 2 bytes of the `blake2b` hash from the "pallet-assets-chain-extension@v0.1" string. The [chain extension](https://github.com/Supercolony-net/pallet-assets-chain-extension) created with usage of the [`obce`](https://github.com/Supercolony-net/obce) crate. The chain extension is not ready for production because it requires some additional changes on the `pallet-assets` side(some operations should be performed by the contract only if the contract is admin). But it is a matter of time, so I think we can register it and fix it with minor patches. Added support of the extension into [substrate-contract-node](paritytech/substrate-contracts-node#146) and into [OpenBrush](Supercolony-net/openbrush-contracts#168). * Update registry.json Co-authored-by: Alexander Theißen <alex.theissen@me.com> Co-authored-by: Alexander Theißen <alex.theissen@me.com>
// | ||
// describe('MY_PSP22', () => { | ||
// async function setup() { | ||
// return setupContract('my_psp22_pallet', 'new', 123, '0', '1000') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To deploy a contract on the local node(from paritytech/substrate-contracts-node#146) you need to pass 10000 Units in the constructor. It is required deposit to create and Asset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works with polkadot js and don't work with redspot in integration tests. I'll try to use polkadot js directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to update the docker image to use the node with chain extension, but let's do that in the separate PR=)
Implemented the
PSP22
viapallet-assets
chain extension. AlsoMetadata
,Mintable
, andBurnable
.The library provides a default implementation that can be re-used.
Replaced all
String
with an alias toVec<u8>
to reduce the size of the contracts.