approveWork
solidity
function approveWork(uint256 id) externalOnly the client can approve work, and the escrow must be Delivered.
The function calculates the platform fee and freelancer payment, then credits internal balances.
solidity
userBalances[escrow.freelancer][escrow.token] += freelancerPayment;
userBalances[platformWallet][escrow.token] += fee;It changes:
text
Delivered → Approvedand emits:
solidity
WorkApproved(id, freelancerPayment, fee)No ERC-20 transfer occurs during approval. The credited accounts withdraw later.