Open code423n4 opened 2 years ago
gzeon
Save gas by keeping parameter arrays in calldata, i.e. https://github.com/code-423n4/2021-12-defiprotocol/blob/205d3766044171e325df6a8bf2e79b37856eece1/contracts/contracts/Auction.sol#L74
function settleAuction( uint256[] calldata bountyIDs, address[] calldata inputTokens, uint256[] calldata inputWeights, address[] calldata outputTokens, uint256[] calldata outputWeights ) public nonReentrant override {
To prevent stack too deep error, make some change to L97 https://github.com/code-423n4/2021-12-defiprotocol/blob/205d3766044171e325df6a8bf2e79b37856eece1/contracts/contracts/Auction.sol#L97
uint256 newRatio; { //TODO: name a and b or further split up uint256 a = factory.auctionMultiplier() * basket.ibRatio(); uint256 b = (bondBlock - auctionStart) * BASE / factory.auctionDecrement(); newRatio = a - b; }
Handle
gzeon
Vulnerability details
Impact
Save gas by keeping parameter arrays in calldata, i.e. https://github.com/code-423n4/2021-12-defiprotocol/blob/205d3766044171e325df6a8bf2e79b37856eece1/contracts/contracts/Auction.sol#L74
To prevent stack too deep error, make some change to L97 https://github.com/code-423n4/2021-12-defiprotocol/blob/205d3766044171e325df6a8bf2e79b37856eece1/contracts/contracts/Auction.sol#L97