* initial commit for splitting payouts
Collateral goes to slot's host address, while reward payouts go to the slot's host payoutAddress
* Add fillSlot overload to make payoutAddress "optional"
* add tests for payoutAddress
* add doc to patchFillSlotOverloads
* formatting
* remove optional payoutAddress parameter
* Move payoutAddress to freeSlot
- remove payoutAddress parameter from `fillSlot`
- remove `payoutAddress` from slot struct and storage
- add payoutAddress parameter to `freeSlot`, preventing the need for storage
* formatting
* update certora spec to match updated function signature
* Add withdrawAddress to withdrawFunds
- prevent erc20 msg.sender blacklisting
* Update tests for paying out to withdrawAddress
* formatting
* Add collateralRecipient
* refactor: change withdrawFunds and freeSlot overloads
- `withdrawFunds` now has an option withdrawRecipient parameter
- `freeSlot` now has two optional parameters: rewardRecipient, and collateralRecipient. Both or none must be specified.
* update certora spec for new sigs
1. Remove proof extension as it is not needed. Host are required to provide proofs from the moment they fill a slot, for the duration specified by the contract. This means that the ending of their requirements will be staggered at the end, as they were at the start, but this is more predicable for determining the cost of a request.
2. The proof end time was modified so that if the request state is not accepting proofs, it takes the min of the slot proof end time, the request end time, or block.timestamp - 1, which ensures that it returns a time in the past. If the slot is accepting proofs, it returns the slot end time.
3. Modify marketplace tests so that `waitUntilFinished` advances time to the proof ending of the last slot filled.
1. Replace all instances of `now()` with `await currentTime()` to get a more accurate representation of time from the block timestamp. Update examples.js to be async.
2. Move `RequestState` to `marketplace.js`
3. Delete `TestStorage` as `slashAmount` function no longer needed.
Allow proof ending to be extending once a contract is started, so that all filled slots share an ending time that is equal to the contract end time. Added tests.
Add a mapping for proof id to endId so that proof expectations can be extended for all proofs that share a given endId.
Add function modifiers that require the request state to allow proofs, with accompanying tests.
General clean up of each function’s request state context, with accompanying tests.
General clean up of all tests, including state change “wait” functions and normalising the time advancement functions.
- Remove `FundsWithdrawn` event
- do not copy request to memory
- todo for changing withdraw amount to not include proof payments
- test lock expiry border
- in tests, move `RequestState` to exported const in marketplace.js
- move test for state checks on `fillSlot` to the “filling a slot” section.
Adds ability for client to withdraw funds from a cancelled storage request.
Tests to check if request has timed out, if the client address is requesting withdraw, if the request state is new, and the funds were successfully transferred.