Summary: Return values of below functions are not stored in local or state variable.
1.TradingAccountBranch.createTradingAccount(bytes,bool)
, below line ignores return value.
TradingAccount.create(tradingAccountId, msg.sender);
2. TradingAccountBranch.withdrawMargin(uint128,address,uint256)
below line ignores return value.
(UD60x18 requiredInitialMarginUsdX18,, SD59x18 accountTotalUnrealizedPnlUsdX18) =
tradingAccount.getAccountMarginRequirementUsdAndUnrealizedPnlUsd(0, SD59x18_ZERO);
3.SettlementBranch._fillOrder(uint128,uint128,uint128,SD59x18,UD60x18)
below line ignores return value.
tradingAccount.deductAccountMargin({
feeRecipients: FeeRecipients.Data({
marginCollateralRecipient: globalConfiguration.marginCollateralRecipient,
orderFeeRecipient: globalConfiguration.orderFeeRecipient,
settlementFeeRecipient: globalConfiguration.settlementFeeRecipient
})
4.In OrderBranch.simulateTrade(uint128,uint128,uint128,int128)
below line ignores return value.
perpMarket.checkOpenInterestLimits(
ctx.sizeDeltaX18, ctx.positionSizeX18, ctx.positionSizeX18.add(ctx.sizeDeltaX18)
);
5.In OrderBranch.cancelMarketOrder(uint128)
below line ignores return value.
TradingAccount.loadExistingAccountAndVerifySender(tradingAccountId);
Vulnerability Details
Impact
Tools Used: Slither and Foundry.
Recommendations