0

[I am thinking about NFTs but it might be a broader idea]

It is intuitive to think that deploying a new minimal proxy contract exclusive for every new minted token (like an ERC721 with totalSupply of one) is more resource-intensive than minting several tokens on the same contract, but, is it really tho?

For storage, only two additional slots (64 bytes) are needed - the minimal proxy contract bytecode plus the logic contract address occupies exactly 45 bytes. But now we don't need another storage slot to hold the tokenId which represents an individual item (the whole contract does that). So realistically it just uses one single additional slot.

For runtime performance, since every proxy has a very small footprint (45 bytes) and is simply loading/forwarding all calls to a logic contract, there should not be any kind of disadvantage if compared to minting different items on a specific contract which is also a proxy contract.

Can anyone familiar with the inner workings of the EVM can say something about that?

Thanks ✌️

1 Answer 1

0

It is kind of intuitive but there will be cons

  1. It will have scalability issues. Also you don't want to have 10k contracts, prefer to have a single contract
  2. The runtime costs MAY increase because there is always an added delegatecall.
  3. If you need to maintain a list of proxies deployed than you'll need to store it in storage(used in a places like marketplace)
2
  • 1) What scalability issues? why prefer a single contract? Note that a single contract with multiple tokens requires an additional tokenId whenever I want to interact with a token. 2) That does not change anything if comparing to using a single contract which also happens to be a proxy contract (there is a delegatecall in both cases). 3) Might actually be better to store a contract address (20 bytes) which fully represents an individual asset than to store a contract address plus a tokenId (20 + 32 bytes) to reference an individual asset. Sep 15, 2023 at 16:39
  • 2) When interacting with a single contract(ERC721) there is no delegate call used. 3) If you want to query for ownerOf or transfer the NFT it's easier to use a single contract rather than a many proxies. It's the same contract for NFT of same collection but just unique tokenId(32 bytes). I'd suggest you to create a prototype using your idea Sep 16, 2023 at 6:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.