0xacme / ERC404

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If amount is smaller then minted how to transfer?

n00b21337 opened this issue · comments

With this code here

if (amountOrId <= minted) {

you enforce that if amountOrId in transferFrom is smaller than minted it will try to transfer NFT.
But what if I want to transfer less than 10k amount, for example I want to transfer 1000 amount and transferFrom is called, how will I transfer that tokens when it will keep going to the first part of condition and fail there?

I think it makes more sense to use [type(uint256).max / 2, type(uint256).max] bounds for tokenIds. And reserve [0, type(uint256).max / 2) domain only for ERC20 amount encoding. This way implementations will still be able to use up to 255 bits for storing ERC20 amounts, which is more than enough for most projects.