Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: medium
Invalid

Complete code

// SPDX-License-Identifier: MIT
//✨only fixed logic that checks if the market was successfully unpaused since it was flawed changed bool from paused to ispaused
pragma solidity 0.8.25;

// Zaros dependencies
import { Errors } from "@zaros/utils/Errors.sol";
import { MarketMakingEngineConfigurationBranch } from
"@zaros/market-making/branches/MarketMakingEngineConfigurationBranch.sol";

// Zaros dependencies test
import { Base_Test } from "test/Base.t.sol";

// Open Zeppelin dependencies
import { Ownable } from "@openzeppelin/access/Ownable.sol";

contract MarketMakingEngineConfigurationBranch_UnpauseMarket_Integration_Test is Base_Test {
function setUp() public virtual override {
Base_Test.setUp();
changePrank({ msgSender: users.owner.account });
configureSystemParameters();
createPerpMarkets();
}

function testFuzz_RevertGiven_TheSenderIsNotTheOwner(uint256 marketId) external {
MarketConfig memory fuzzMarketConfig = getFuzzMarketConfig(marketId);
changePrank({ msgSender: users.sakura.account });
// it should revert
vm.expectRevert({
revertData: abi.encodeWithSelector(Ownable.OwnableUnauthorizedAccount.selector, users.sakura.account)
});
marketMakingEngine.unpauseMarket(fuzzMarketConfig.marketId);
}
function testFuzz_GivenTheSenderIsTheOwner(uint256 marketId) external {
MarketConfig memory fuzzMarketConfig = getFuzzMarketConfig(marketId);
marketMakingEngine.unpauseMarket(fuzzMarketConfig.marketId);
uint128[] memory activeMarketIds = marketMakingEngine.getLiveMarketIds();
// it should unpause the market
bool isUnpaused = false;
for (uint256 i = 0; i < activeMarketIds.length; i++) {
if (activeMarketIds[i] == fuzzMarketConfig.marketId) {
isUnpaused = true;
break; // No need to continue looping after finding the match
}

}

assertTrue(isUnpaused, "Market ID was not found in the active markets list after unpausing.");
}

}

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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