The Tadle protocol utilizes a token whitelist mechanism managed by a trusted protocol owner to mitigate risks associated with non-standard ERC20 tokens. While this approach provides a significant layer of security, some residual risks remain due to the complex nature of various token implementations and the potential for human error in the vetting process.
The primary safeguard against problematic tokens in the Tadle protocol is the whitelist mechanism implemented in the TokenManager contract:
This whitelist, managed by a trusted protocol owner, provides a strong first line of defense. However, the protocol's token handling, particularly in the _transfer
function, still assumes standard ERC20 behavior:
While the whitelist significantly reduces the risk, it doesn't eliminate the potential for issues with non-standard tokens that may have been whitelisted.
The impacts, while mitigated by the whitelist, still include:
Accounting Discrepancies: If a non-standard token (e.g., fee-on-transfer) is whitelisted, it could lead to minor accounting issues.
Operational Disruptions: Unexpected token behavior could potentially disrupt specific protocol operations.
Delayed Response to Token Changes: If a whitelisted token changes its behavior post-vetting, it might take time to detect and respond to the change.
Manual Review
Given the existing safeguards and the trusted nature of the protocol owner, a complete overhaul of the token handling system is unnecessary. Instead:
Enhance the Whitelisting Process:
Develop a comprehensive checklist for token vetting, including checks for non-standard behaviors.
Implement a time-lock or multi-signature requirement for adding new tokens to the whitelist.
Develop wrapper contracts for non-standard tokens: Create standardized interfaces for different token types (e.g., fee-on-transfer, rebasing) and implement wrappers that handle their unique behaviors internally.
Implement a "Force of Transfer" (FoT) approach: Replace the current transfer checks with balance-based verifications:
Valid medium, there are disruptions to the ability to take market actions. The following functions will be disrupted without the possibiliy of reaching settlement, since the respective offers cannot be created/listed regardless of mode when transferring collateral token required to the CapitalPool contract or when refunding token from user to capital pool during relisting. So withdrawal is not an issue - `createOffer()` - reverts [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L96-L102) - `listOffer()` - reverts [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L355-L362) - `relistOffer()` - reverts [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L515-L521) - `createTaker()` - reverts [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L831-L836) I believe medium severity is appropriate although the likelihood is high and impact is medium (only some level of disruption i.e. FOT tokens not supported and no funds at risk)
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.