flintlang/flint

Split FIP-0001: Asset Traits into FIP-0004 Traits and FIP-0005 Assets

Closed this issue · 0 comments

As I write the traits proposal, I've realised we seem to be talking about completely separate but interlinked features.

The Asset traits proposal is a completely distinct because it creates new guarantees about how the internal state can be at the end of transactions or how the Asset can be used: we can only transfer Assets not create or destroy them.

This isn't a feature of traits, but a unique feature of Assets. As such it feels that we are implicitly creating a unique inbuilt typeclass Asset of which you can create instances of e.g. Wei if you define the functions specified (getRawValue, transfer, destroy).

The method for doing this instancing is using traits (as in Rust: https://doc.rust-lang.org/rust-by-example/trait.html#traits) but the typeclass is not the trait itself. We don't define these special properties that Assets have in the trait Asset.