OpenZeppelin / polkadot-runtime-templates

Runtime Templates for Polkadot Parachains
GNU General Public License v3.0
60 stars 17 forks source link

🎁 [Feature Request]: Pallet Abstractions to Improve DX #257

Open 4meta5 opened 2 months ago

4meta5 commented 2 months ago

templates

What is the feature you would like to see?

raised by @shawntabrizi in most recent sync with Parity

The goal of this issue is to abstract over pallet configurations that need not be exposed to improve DX.

Currently organizing abstractions in an internal notion document. Examples:

Contribution Guidelines

shawntabrizi commented 1 month ago

@4meta5

Check out some of the ideas that @kianenigma has been working on

https://github.com/kianenigma/flite

In this example (at the time of writing), he has been able to create a wrapper around frame_system allowing us to define concrete types, and then use those concrete types inside a new pallet.

The example he gives is having AccountId represented concretely rather than with a generic type.

Ideally, we could expand this idea to also include within a single pallet things like Balances, and also a concrete balance type.

At that point, building a new pallet with Flite becomes trivial like a smart contract

You can see that flite has some pretty non-trivial code / tricks inside of it, but the end pallet developed using it is super simple.

kianenigma commented 2 weeks ago

Update on this: https://github.com/paritytech/polkadot-sdk/pull/5584

kianenigma commented 2 weeks ago

Draft design seems to be: https://github.com/OpenZeppelin/polkadot-runtime-wrappers/tree/amar-oz-system-wrapper-poc