Submitted by 0xalpharush
Because the Papr Controller never gives approval for ERC20 transfers, calls to safeTransferFrom on the Papr token will revert with insufficient approval. This will trap proceeds from auctions in the contract and prevent the owner/ DAO from collecting fees, motivating the rating of high severity. The root cause of this issue is misusing safeTransferFrom to transfer tokens directly out of the contract instead of using transfer directly. The contract will hold the token balance and thus does not need approval to transfer tokens, nor can it approve token transfers in the current implementation.
Comment out this token approval as the controller contract does not implement functionality to call approve. It doesnt make sense to prank a contract account in this context because it deviates from the runtime behavior of the deployed contract. That is, its impossible for the Papr Controller to approve token transfers. Run forge test -m testSendPaprFromAuctionFeesWorksIfOwner and observe that it fails because of insufficient approvals. Replace the call to safeTransferFrom with a call to transfer(to, amount) and rerun the test. It will now pass and correctly achieve the intended behavior.
Foundry
Call transfer(to, amount) instead of safeTrasferFrom here. Note, its unnecessary to use safeTransfer as the Papr token doesnt behave irregularly.
Jeiwan (warden) commented:
wilsoncusack (Backed) confirmed
trust1995 (judge) commented:
wilsoncusack (Backed) commented:
trust1995 (judge) commented:
