In the _increaseAllowance function of the LLMOracleCoordinator, LLMOracleRegistry contract, tokens like **PAX **and **BUSD **require the current allowance to be reset to 0 before setting a new allowance. Without this reset, the function call to increase the allowance can fail, preventing the correct approval of additional tokens for use. This issue specifically impacts tokens with custom implementations of the ERC-20 standard.
For tokens such as **PAX **and BUSD, which implement a stricter approve mechanism, an attempt to increase the allowance directly (without first resetting it to 0) will fail. The current code in the _increaseAllowance function tries to increase the allowance without accounting for this, resulting in potential transaction failures when using these tokens.
For **PAX **and **BUSD **, this method fails if there is already a non-zero allowance.
https://github.com/Cyfrin/2024-10-swan-dria/blob/c8686b199daadcef3161980022e12b66a5304f8e/contracts/llm/LLMOracleRegistry.sol#L130
https://github.com/Cyfrin/2024-10-swan-dria/blob/c8686b199daadcef3161980022e12b66a5304f8e/contracts/llm/LLMOracleCoordinator.sol#L397
Transaction Failures: The allowance cannot be increased directly without resetting it to 0, leading to failed transactions for **PAX **and **BUSD **tokens.
Inability to Use Tokens: This prevents the proper use of these tokens within the contract, potentially blocking key functions that depend on token transfers.
Understanding of the specific behavior of **PAX **and **BUSD **token contracts and their approval mechanisms.
Modify the _increaseAllowance function to handle tokens like **PAX **and **BUSD **by first resetting the allowance to 0 before increasing it:
This update ensures compatibility with **PAX **and **BUSD **, preventing failures when working with these 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.