The PriorityPool contract includes the onTokenTransfer function but lacks the proper implementation of the IERC677Receiver interface, which creates a security and compatibility issue when receiving ERC677 tokens like LINK.
In ERC677 tokens such as LINK, transfers utilizing the transferAndCall function require that the recipient contract implements the IERC677Receiver interface to handle incoming transfers properly. Without this interface, the onTokenTransfer function is improperly utilized, leading to failures in the expected operation, such as deposits.
Here is the relevant portion from the LINK token contract:
As seen, transferAndCall invokes contractFallback, which casts the receiving contract as an ERC677Receiver. However, since the PriorityPool contract does not implement IERC677Receiver, this will lead to errors when LINK is transferred using transferAndCall.
In PriorityPool, the onTokenTransfer function is as follows:
The problem lies in the assumption that PriorityPool will receive the tokens through onTokenTransfer without conforming to the required ERC677Receiver interface. Since the interface is not implemented, the contractFallback in the LINK token contract will fail.
LINK transfers using transferAndCall will fail since the PriorityPool contract lacks the required interface, then _deposit function won’t get execute as intended.
Manually
Implement IERC677Receiver Interface: Implement the IERC677Receiver interface in the PriorityPool contract to ensure compatibility with ERC677 tokens.
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.