[fuzzing] transfers out of the contract should always pass

When a transfer of tokens from the contract fails, then the
fuzzer has found a bug. Changing `require` to `assert`
ensures that the fuzzer considers this a test failure.
This commit is contained in:
Mark Spanbroek 2023-05-30 14:46:56 +02:00 committed by markspanbroek
parent 03e5546121
commit a7dd840eaa
1 changed files with 2 additions and 2 deletions

View File

@ -203,7 +203,7 @@ contract Marketplace is Proofs, StateRetrieval {
slot.currentCollateral;
_marketplaceTotals.sent += amount;
slot.state = SlotState.Paid;
require(token.transfer(slot.host, amount), "Payment failed");
assert(token.transfer(slot.host, amount));
}
/// @notice Withdraws storage request funds back to the client that deposited them.
@ -228,7 +228,7 @@ contract Marketplace is Proofs, StateRetrieval {
// deducted from the price.
uint256 amount = request.price();
_marketplaceTotals.sent += amount;
require(token.transfer(msg.sender, amount), "Withdraw failed");
assert(token.transfer(msg.sender, amount));
}
function getActiveSlot(