mirror of
https://github.com/logos-storage/logos-storage-contracts-eth.git
synced 2026-01-10 17:23:12 +00:00
Add a parameter, `saturation` to the network-level configuration, under `SlotReservationConfig`. This parameter represents the percentage of total time before expiry that all addresses are eligible to reserve a slot. Total time is the duration between request creation and expiry. Valid range is [0, 99]. Note, this parameter is not yet used anywhere.
39 lines
966 B
Solidity
39 lines
966 B
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.23;
|
|
|
|
import "./TestToken.sol";
|
|
import "./Marketplace.sol";
|
|
import "./TestVerifier.sol";
|
|
|
|
contract FuzzMarketplace is Marketplace {
|
|
constructor()
|
|
Marketplace(
|
|
MarketplaceConfig(
|
|
CollateralConfig(10, 5, 3, 10),
|
|
ProofConfig(10, 5, 64, "", 67),
|
|
SlotReservationsConfig(20)
|
|
),
|
|
new TestToken(),
|
|
new TestVerifier()
|
|
)
|
|
// 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;
|
|
assert(token().balanceOf(address(this)) >= total);
|
|
}
|
|
}
|