_update()
is meant to only allow transfers to or from whitelisted addresses but it doesnt work as intended. a whitelisted address can transfer to an unwhitelisted address and an unwhitelisted address can make transfers to a whitelisted address
This issue is caused by the use of AND operator instead of the OR operator in the logic. Because AND operator is used, both values in the condition have to be false for it to revert. So
when the from
address is whitelisted and the to
address is not whitelisted, the transfer will be sucessfull
when the to
address is whitelisted and the from
address isn't, the transfer will be sucessfull
This goes against the intended implementation which is to prevent transfers to and from unwhitelisted addresses.
add code below to protocol/test/forge/templegold/TempleGold.t.sol
run test with forge test --mt test_transferToUnauthorized
Whitelist is not enforced in all cases. Still possible to transfer to an unwhitelisted address. Still possible to transfer from unwhitelsited address to whitelisted address.
manual review, foundry
change the AND operartor to OR, this will allow reverts if to
or from
is not whitelisted.
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.