Proposals can never get created due to reaching block.gaslimit
#235
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Warden finding
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Handle
hrkrshnn
Vulnerability details
Proposals can never get created due to reaching
block.gaslimit
The function
proposeBasketLicense
allows initializing proposals of with arbitrary amount of tokens.
However,
createBasket
stage involves the actual transfers. Since eachunique token in the list undergoes a
safeApprove
, which would cost atleast
22,100
gas (for zero to non-zero sstore update). Taking thisalone would mean that having a token list of size
1300
would exceedthe current block gas limit. This number would in practice be even lower
when including other calls.
Recommended Mitigation Steps
proposeBasketLicense
forn
tokens andtry to estimate
n
that exceeds the current block gas limit.proposeBasketLicense
with arequire(tokens.length < n)
.This would more or less guarantee that each proposed basket can be
created.
The text was updated successfully, but these errors were encountered: