Tokens will be stuck in the escrow when the state is set to disputed and the arbiter is set blacklisted in the rewards token
In Escrow
contract : the role of the arbiter is to solve the dispute if the seller or the arbiter initiated it.
When the issue state is set to disputed; there's no way for the seller or the buyer(when state is set to disputed) to receive their rewards tokens unless the arbiter solves the dispute (by calling resolveDispute
function).
So when the arbiter calls resolveDispute
function, it sets the tokens amount to be sent to the buyer, and the arbiter will get his fees i_arbiterFee
and the remaining contract tokens balance (if any remains) will be sent to the seller.
But some tokens have a blacklist where certain accounts are prohibited from having/transferring any tokens.
So if the arbiter is set in the blacklist of i_tokenContract
token (if it has a blacklist); then tokens will be stuck in the contract as the resolveDispute
function will always revert and there's no way to change the issue state if it's set to disputed.
Rewards tokens will be stuck in the escrow contract permanently.
Code:
Line 123
Foundry PoC:
ERC20BlackList contract (which inherits OZ ERC20Mock contract) is set to mimick the behavior of blacklisting in tokens: a simple logic is set to check if the sender or the receiver of tokens is The blacklisted account,assuming that there's only one constant blacklisted account (which is set to the arbiter address):
add this ERC20BlackList
contract file in the test/mocks
directory :
testResolveDisputeRevertWhenBlacklistedArbiter
test is set in the EscrowTest.t.sol
file to test the behavior of the escrow if the arbiter is a blacklisted address in the tokenContract (the basic arguments are copied from testDeployEscrowFromFactory
test and updated to demonstrate the vulnerability).
add this import statement and test to the EscrowTest.t.sol
file :
Test result:
Manual Testing & Foundry.
Check (off-chain) if the arbiter is a blacklisted account in the rewards token or not before creating the escrow.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.