Fees and balances
The platform fee is fixed at deployment and stored in basis points.
solidity
uint256 public platformFeeBps;Maximum:
text
1000 bps = 10%Calculation
solidity
(amount * feeBps) / 10000For an amount of 1000 and a fee of 250 bps:
text
fee = 25
freelancer payment = 975Rounding
Solidity integer division truncates fractions. A sufficiently small amount can therefore produce a fee of zero.
Balance ledger
solidity
mapping(address => mapping(address => uint256)) public userBalances;The dimensions are:
text
user → token → balanceThis prevents one token's balance from being conflated with another.