w3f / PSPs

Polkadot Smart Contract Proposals
Creative Commons Zero v1.0 Universal
158 stars 68 forks source link

PSP-34: Non Fungible Token improvement #38

Closed xgreenx closed 2 years ago

xgreenx commented 2 years ago

Instead of two methods:

We can have one method with the next signature:

/// Returns `true` if the operator is approved by the owner to withdraw `id` token.
/// If `id` is `None`, returns `true` if the operator is approved to withdraw all owner's tokens.
fn allowance(owner: AccountId, operator: AccountId, id: Option<Id>) -> bool

Instead of two methods:

We can have one method with the next signature:

/// Approves `operator` to withdraw the `id` token from the caller's account.
/// If `id` is `None` approves or disapproves the operator for all tokens of the caller.
fn approve(operator: AccountId, id: Option<Id>, approved: bool) -> Result<(), PSP34Error>

It is simpler in implementation. That will reduce the size of the contracts and add a new feature that several persons have the ability to withdraw the token(when previously it can be done by operators and one person, now operators and several persons).