Skip to content

Roles and permissions ​

The contract does not maintain a global role registry. Roles are contextual to each escrow.

Client ​

The caller of createEscrow becomes that escrow's client. Only the client can fund, approve work, and request the implemented refund.

Violations revert with NotClient().

Freelancer ​

The freelancer address is supplied during creation. Only that address can call deliverWork(id).

Violations revert with NotFreelancer().

Platform wallet ​

The platform wallet is configured in the constructor. It is not an administrator in the current implementation. It receives an internal balance credit when work is approved and must call withdraw to move accrued fees.

Any account ​

Any address may create a new escrow. Any address may call withdraw, but the accounting restricts it to:

solidity
userBalances[msg.sender][token]

This distinction is of utmost importance: the function is public, but the withdrawable balance is caller-specific.

Permission matrix ​

ActionClientFreelancerPlatform walletOther account
Create a new escrowYesYesYesYes
Fund a given escrowYesNoNoNo
Mark deliveryNoYesNoNo
Approve workYesNoNoNo
Request refundYesNoNoNo
Withdraw own credited balanceYesYesYesYes

Documentation grounded in the current ERC-20 escrow implementation.