Hello Folks - Just on the Journey of Token Implementation and thought I would ask for Opinions to some design decisions.
- Do most brutish raw implementation of ERC20 in vyper to skip on most all checks.
- Allow ZERO_ADDRESS transfers - burn and minting would use the tokens contract address instead.
- Default to approve X for one transaction.
- Donot set approvals back to 0 again instead use int128 and set it to -1 - so the space will not become freed. Update -> this is nonsense xD, because free will also return gas, and is overall more gas efficient
Point 3 probably needs some further explaination and is also the part with highest level of uncertainty.
From my perspective there are 3 different ways how to approve.
- give Full Approval and done until revoked
- give Approval for a max of X tokens to be spend for 1 transaction
- increase or decrease the Approved amount of tokens to be spent
The thing is for nr. 2 that as soon as you have approved for 1 transaction…
- …you actually expect that it definately will be used
- …it would reset any left amount to -1. -> Update: reseting to 0 is better
- …well, is debatable if it is more desirable not reset the left amount to -1 afterwards^^ -> Update: reseting to 0 is better
To me it appears that the default thought behaviour is that nr. 2 without the limitation of only one transaction.
When does the case ever occur where it is necessary to grant a spending limit over multiple transactions?
Isn’t better then to use the increase, decrease allowance mechanics for this case instead?