Here we uncovered an excessive number of external calls, with a total of 6 calls per iteration
Each iteration make at least 2 direct calls
swan.getListingPrice(asset)
swan.purchase(asset)
The purchase
call makes 4 more external calls(2NFT transfers, and 2 token transfers)
making a total of 6 external calls per iteration.
This could lead to a potential Reentrancy attack.
It may cause state inconsistency.
Due to unbounded loop size and multiple external calls per iteration the function call easily exceeds the block gas limit, especially with a large array.
Manual Review
Add array size limits:
uint256 private constant MAX_PURCHASE_BATCH = 100; //as the case may be
require(assets.length <= MAX_PURCHASE_BATCH, "Batch too large");
Implementing Batching
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.