The owner of swan contract is also an operator and any operators can access any functions with onlyAuthorized modifier in buyerAgent contract. This will leave to an open door for updating state of buyer agent without consent of owner of buyerAgent.
In contets details it is expressed swan owner and operators are trusted.
SwanOwner (Trusted): This is the wallet that deploys Swan by default.
SwanOperator (Trusted): For every Buyer, there is anonlyAuthorizedmodifier that ensures the modified function is callable byBuyerAgentowner, or an address such thatswan.isOperator(addr)is true. These operators simply exist so that buyer owner's dont have to be online all the time to callpurchase,updateStateetc., and can instead let the Swan operators call it for them. The operators are currently centralized, and belong to FirstBatch.
That migh make sense for functions like purchase, updateState due to the mentioned reason above, however not for withdraw(), which is defined as:
ı believe this function supposed to be called by the owner. Both the comment in the function and the following test in BuyerAgent.test.ts support what ı said.
if we look at the withdraw method, onlyAuthorized modifier is used, which defined as:
it can be seen an operator can call any function with the modifier.For operators this can make sense but the owner of swan is also set as an operator:
Even if the owner of swan contract is trusted, it should not interfere with state of buyerAgent without the consent of users in this case.
Affecting buyerAgent state without its owner's consent, leading to undesired outcomes
None
I believe wrong modifier is used here. Instead of onlyAuthorized , onlyOwner modifier should be used.
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.