Disable solhint about relying on timestamp

This commit is contained in:
Mark Spanbroek 2022-03-08 15:58:49 +01:00 committed by markspanbroek
parent 78eaaa7812
commit 07d0e33789
3 changed files with 2 additions and 4 deletions

View File

@ -2,6 +2,7 @@
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["warn", "^0.8.0"],
"func-visibility": ["warn", {"ignoreConstructors": true}]
"func-visibility": ["warn", {"ignoreConstructors": true}],
"not-rely-on-time": "off"
}
}

View File

@ -68,7 +68,6 @@ contract AccountLocks {
}
function isInactive(Lock storage lock) private view returns (bool) {
// solhint-disable-next-line not-rely-on-time
return lock.unlocked || lock.expiry <= block.timestamp;
}

View File

@ -44,7 +44,6 @@ contract Marketplace is Collateral {
Request storage request = requests[offer.requestId];
require(request.client != address(0), "Unknown request");
// solhint-disable-next-line not-rely-on-time
require(request.expiry > block.timestamp, "Request expired");
require(offer.price <= request.maxPrice, "Price too high");
@ -62,7 +61,6 @@ contract Marketplace is Collateral {
function selectOffer(bytes32 id) public marketplaceInvariant {
Offer storage offer = offers[id];
require(offer.host != address(0), "Unknown offer");
// solhint-disable-next-line not-rely-on-time
require(offer.expiry > block.timestamp, "Offer expired");
Request storage request = requests[offer.requestId];