Skip to content

approveWork ​

solidity
function approveWork(uint256 id) external

Only 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 → Approved

and emits:

solidity
WorkApproved(id, freelancerPayment, fee)

No ERC-20 transfer occurs during approval. The credited accounts withdraw later.

Documentation grounded in the current ERC-20 escrow implementation.