Permit Singleton
Last updated
Last updated
Using Permits - messages for minting NFTs idea was made by Hadrien into ERC draft; you can find the draft implementation here:
Permit Singleton for backward-compatible signed ERC20/721/1155 transfers
TL:DR This implementation takes ERC20, ERC721, or ERC1155 assets and wraps them with a permit function.
"A user willing to use the Permit Singleton will have to grant it the authorization to manage his or her assets. This authorization is performed on a token-per-token basis, either by approving a balance to it (by calling 's approve
) or by making it an operator (by calling and 's setApprovalForAll
function).
Once approved, the singleton will be able to transfer the user's assets. For that, it requires the user to sign an authorization (following standard). There is one message format per token standard:
" - Author
"The Permit Singleton's nonces, which are represented as uint256
should be seen as the concatenation of two uint128
. The first one is the timeline id, while the second one is the nonce id within this timeline.
This means that regular nounce, which are smaller then 2128 are living on timeline 0, and match the exepcted behaviour. However, messages with nonce 2128, 22128 and 32128 are on 3 independant timeline and have no dependency (they are the first nonce in their respective timeline).
The current nonce of a user (on the trivial timeline) can be queried using function nonce(address) public view returns (uint256)
. The current nonce on a specific timeline can be queried using function nonce(address,uint256) public view returns (uint256)
." - Author
Full repo of the implementation: https://github.com/Amxx/Permit