2023-01-30 09:32:30 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2024-07-24 16:50:18 +00:00
|
|
|
pragma solidity ^0.8.23;
|
2023-01-30 09:32:30 +00:00
|
|
|
|
|
|
|
import "./TestToken.sol";
|
|
|
|
import "./Marketplace.sol";
|
2024-01-10 14:12:06 +00:00
|
|
|
import "./TestVerifier.sol";
|
2023-01-30 09:32:30 +00:00
|
|
|
|
|
|
|
contract FuzzMarketplace is Marketplace {
|
|
|
|
constructor()
|
|
|
|
Marketplace(
|
2024-01-30 05:36:27 +00:00
|
|
|
MarketplaceConfig(
|
|
|
|
CollateralConfig(10, 5, 3, 10),
|
2024-08-14 05:50:32 +00:00
|
|
|
ProofConfig(10, 5, 64, "", 67)
|
2024-01-30 05:36:27 +00:00
|
|
|
),
|
2024-01-10 14:12:06 +00:00
|
|
|
new TestToken(),
|
|
|
|
new TestVerifier()
|
2023-01-30 09:32:30 +00:00
|
|
|
)
|
|
|
|
// solhint-disable-next-line no-empty-blocks
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Properties to be tested through fuzzing
|
|
|
|
|
|
|
|
MarketplaceTotals private _lastSeenTotals;
|
|
|
|
|
|
|
|
function neverDecreaseTotals() public {
|
|
|
|
assert(_marketplaceTotals.received >= _lastSeenTotals.received);
|
|
|
|
assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);
|
|
|
|
_lastSeenTotals = _marketplaceTotals;
|
|
|
|
}
|
|
|
|
|
|
|
|
function neverLoseFunds() public view {
|
|
|
|
uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;
|
2024-02-06 07:49:41 +00:00
|
|
|
assert(token().balanceOf(address(this)) >= total);
|
2023-01-30 09:32:30 +00:00
|
|
|
}
|
|
|
|
}
|