mirror of
https://github.com/status-im/dagger-contracts.git
synced 2025-01-28 07:15:50 +00:00
2b840dcc80
Related to nim-codex/457, nim-codex/458. To cover the entire SlotId (uint256) address space, each validator must validate a portion of the SlotId space. When a slot is filled, the SlotId will be put in to a bucket, based on the value of the SlotId and the number of buckets (validators) configured. Similar to `myRequests` and `mySlots`, a function called `validationSlots` can be used to retrieve the `SlotIds` being validated for a particular bucket (validator index). This facilitates loading actively filled slots in need of validation when a validator starts.
39 lines
954 B
Solidity
39 lines
954 B
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.0;
|
|
|
|
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, ""),
|
|
ValidationConfig(5)
|
|
),
|
|
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);
|
|
}
|
|
}
|