violetprotocol / ERC1238-token

Implementation of EIP-1238 for non-transferable tokens (fungible & non-fungible).
https://erc1238.notion.site/
16 stars 3 forks source link

Expirable #9

Closed ra-phael closed 2 years ago

ra-phael commented 2 years ago

Optional extension which adds expiration to tokens using a simple mapping from token id to expiry date. Relying parties can then check if a token is expired or not by calling isExpired(id).

0xpApaSmURf commented 2 years ago

Looks good.

I'm wondering if we also want a function like updateExpiry or even expire where the owner/minter can update the expiry of an existing token in the past to automatically expire it.

I think the idea of an immutable expiry might not always work for all use-cases.

ra-phael commented 2 years ago

Good point! Issuers might have a reason to update the expiry. That's why they can use the inherited _setExpiryDate(). Did you mean we should add setExpiryDate() to the IERC1238Expirable interface?

0xpApaSmURf commented 2 years ago

Yes exactly, otherwise the Expirable interface doesn't actually expose a way to directly set the expiry date as part of the feature "extension" because its just an internal function.