mirror of
https://github.com/logos-storage/logos-storage-contracts-eth.git
synced 2026-01-07 15:53:07 +00:00
marketplace: clarify why we flow & transfer funds before burning
Co-Authored-By: Adam Uhlíř <adam@uhlir.dev>
This commit is contained in:
parent
895e36fbba
commit
075d97e5da
@ -364,8 +364,16 @@ contract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {
|
|||||||
FundId fund = requestId.asFundId();
|
FundId fund = requestId.asFundId();
|
||||||
AccountId hostAccount = _vault.hostAccount(slot.host, slot.slotIndex);
|
AccountId hostAccount = _vault.hostAccount(slot.host, slot.slotIndex);
|
||||||
AccountId clientAccount = _vault.clientAccount(request.client);
|
AccountId clientAccount = _vault.clientAccount(request.client);
|
||||||
|
|
||||||
|
// ensure that nothing is flowing into the account anymore by reversing the
|
||||||
|
// incoming flow from the client
|
||||||
_vault.flow(fund, hostAccount, clientAccount, rate);
|
_vault.flow(fund, hostAccount, clientAccount, rate);
|
||||||
|
|
||||||
|
// temporarily transfer repair reward for the slot to the client until a
|
||||||
|
// host repairs the slot
|
||||||
_vault.transfer(fund, hostAccount, clientAccount, repairReward);
|
_vault.transfer(fund, hostAccount, clientAccount, repairReward);
|
||||||
|
|
||||||
|
// burn the rest of the funds in the account
|
||||||
_vault.burnAccount(fund, hostAccount);
|
_vault.burnAccount(fund, hostAccount);
|
||||||
|
|
||||||
_removeFromMySlots(slot.host, slotId);
|
_removeFromMySlots(slot.host, slotId);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user