Insrt-Finance / insrt-v2-contracts

0 stars 3 forks source link

Risk size #64

Closed NouDaimon closed 1 year ago

NouDaimon commented 1 year ago

Currently the risk values are of uint64 size since for an ERC721 two random numbers (chunking 256 => 128) are required, and for ERC1155 3 random number numbers are required (chunking 256 => 128, following by chunking the second 128 => 64).

This means that at some point, token amounts are down-cast from uint256 => uint64 to accommodate the necessary multiplicative calculations.

It is possible to either:

CruzMolina commented 1 year ago

After thinking about this a bit, and re-assessing the way VRF execution costs work, I think we should just bump the risks and request more random numbers on each mint attempt. In the current design, we're already paying the cost of performing the request and receiving it for one random uint256 in an array.

I don't like the idea of us being pigeon holed in either scenario via storage (on the amount or risk side) and would rather we support the max limit.

NouDaimon commented 1 year ago

I agree - chunking was awesome, but I think this way we also cut down on gas costs, even though overall costs for the protocol increase (slightly). In any case, the protocol costs only increase by 0.0005 LINK or 0.001 LINK for ERC721//1155 mint attempts respectively.