DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: low
Invalid

Functions that alter state should emit events

Functions that alter state should emit events

  • Severity: LOW

  • Confidence: Medium

Description

Functions that alter the state of the contract should emit an event to inform external observers of the change.

There are 31 instances of this issue:

File: contracts/facets/BidOrdersFacet.sol
330 function matchIncomingBid(
331 address asset,
332 STypes.Order memory incomingBid,
333 MTypes.Match memory matchTotal,
334 MTypes.BidMatchAlgo memory b
335 ) private returns (uint88 ethFilled, uint88 ercAmountLeft)

The function matchIncomingBid changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/BidOrdersFacet.sol#L330-L381

File: contracts/facets/ERC721Facet.sol
260 function mintNFT(address asset, uint8 shortRecordId)
261 external
262 isNotFrozen(asset)
263 nonReentrant
264 onlyValidShortRecord(asset, msg.sender, shortRecordId)
265

The function mintNFT changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/ERC721Facet.sol#L260-L284

File: contracts/facets/MarginCallPrimaryFacet.sol
202 function _performForcedBid(
203 MTypes.MarginCallPrimary memory m,
204 uint16[] memory shortHintArray
205 ) private

The function _performForcedBid changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/MarginCallPrimaryFacet.sol#L202-L253

File: contracts/facets/MarginCallPrimaryFacet.sol
262 function _marginFeeHandler(MTypes.MarginCallPrimary memory m) private

The function _marginFeeHandler changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/MarginCallPrimaryFacet.sol#L262-L280

File: contracts/facets/MarginCallSecondaryFacet.sol
195 function _secondaryLiquidationHelperPartialTapp(MTypes.MarginCallSecondary memory m)
196 private
197

The function _secondaryLiquidationHelperPartialTapp changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/MarginCallSecondaryFacet.sol#L195-L214

File: contracts/facets/OwnerFacet.sol
319 function _setAssetOracle(address asset, address oracle) private

The function _setAssetOracle changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L319-L322

File: contracts/facets/OwnerFacet.sol
324 function _setTithe(uint256 vault, uint16 zethTithePercent) private

The function _setTithe changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L324-L327

File: contracts/facets/OwnerFacet.sol
329 function _setDittoMatchedRate(uint256 vault, uint16 rewardRate) private

The function _setDittoMatchedRate changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L329-L332

File: contracts/facets/OwnerFacet.sol
334 function _setDittoShorterRate(uint256 vault, uint16 rewardRate) private

The function _setDittoShorterRate changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L334-L337

File: contracts/facets/OwnerFacet.sol
339 function _setInitialMargin(address asset, uint16 value) private

The function _setInitialMargin changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L339-L343

File: contracts/facets/OwnerFacet.sol
345 function _setPrimaryLiquidationCR(address asset, uint16 value) private

The function _setPrimaryLiquidationCR changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L345-L350

File: contracts/facets/OwnerFacet.sol
352 function _setSecondaryLiquidationCR(address asset, uint16 value) private

The function _setSecondaryLiquidationCR changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L352-L357

File: contracts/facets/OwnerFacet.sol
359 function _setForcedBidPriceBuffer(address asset, uint8 value) private

The function _setForcedBidPriceBuffer changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L359-L363

File: contracts/facets/OwnerFacet.sol
365 function _setMinimumCR(address asset, uint8 value) private

The function _setMinimumCR changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L365-L373

File: contracts/facets/OwnerFacet.sol
378 function _setResetLiquidationTime(address asset, uint16 value) private

The function _setResetLiquidationTime changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L378-L382

File: contracts/facets/OwnerFacet.sol
384 function _setSecondLiquidationTime(address asset, uint16 value) private

The function _setSecondLiquidationTime changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L384-L390

File: contracts/facets/OwnerFacet.sol
392 function _setFirstLiquidationTime(address asset, uint16 value) private

The function _setFirstLiquidationTime changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L392-L398

File: contracts/facets/OwnerFacet.sol
400 function _setTappFeePct(address asset, uint8 value) private

The function _setTappFeePct changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L400-L404

File: contracts/facets/OwnerFacet.sol
406 function _setCallerFeePct(address asset, uint8 value) private

The function _setCallerFeePct changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L406-L410

File: contracts/facets/OwnerFacet.sol
412 function _setMinBidEth(address asset, uint8 value) private

The function _setMinBidEth changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L412-L416

File: contracts/facets/OwnerFacet.sol
418 function _setMinAskEth(address asset, uint8 value) private

The function _setMinAskEth changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L418-L422

File: contracts/facets/OwnerFacet.sol
424 function _setMinShortErc(address asset, uint16 value) private

The function _setMinShortErc changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L424-L428

File: contracts/facets/OwnerFacet.sol
430 function _setWithdrawalFee(address bridge, uint16 withdrawalFee) private

The function _setWithdrawalFee changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L430-L433

File: contracts/facets/OwnerFacet.sol
435 function _setUnstakeFee(address bridge, uint8 unstakeFee) private

The function _setUnstakeFee changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L435-L438

File: contracts/facets/VaultFacet.sol
35 function depositZETH(address zeth, uint88 amount) external nonReentrant

The function depositZETH changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/VaultFacet.sol#L35-L47

File: contracts/facets/VaultFacet.sol
56 function depositAsset(address asset, uint104 amount)
57 external
58 onlyValidAsset(asset)
59 isNotFrozen(asset)
60 nonReentrant
61

The function depositAsset changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/VaultFacet.sol#L56-L66

File: contracts/facets/VaultFacet.sol
73 function withdrawZETH(address zeth, uint88 amount) external nonReentrant

The function withdrawZETH changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/VaultFacet.sol#L73-L89

File: contracts/facets/VaultFacet.sol
97 function withdrawAsset(address asset, uint104 amount)
98 external
99 onlyValidAsset(asset)
100 nonReentrant
101

The function withdrawAsset changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/VaultFacet.sol#L97-L109

File: contracts/facets/YieldFacet.sol
76 function _distributeYield(address asset)
77 private
78 onlyValidAsset(asset)
79 returns (uint88 yield, uint256 dittoYieldShares)
80

The function _distributeYield changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/YieldFacet.sol#L76-L123

File: contracts/facets/YieldFacet.sol
126 function _claimYield(uint256 vault, uint88 yield, uint256 dittoYieldShares) private

The function _claimYield changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/YieldFacet.sol#L126-L143

File: contracts/facets/YieldFacet.sol
189 function withdrawDittoReward(uint256 vault) external nonReentrant

The function withdrawDittoReward changes state but does not emit an event.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/YieldFacet.sol#L189-L198

Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.