code-423n4 / 2022-06-canto-findings

0 stars 0 forks source link

use call instead of transfer #14

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Lines of code

https://github.com/Plex-Engineer/lending-market/blob/755424c1f9ab3f9f0408443e6606f94e4f08a990/contracts/Treasury/TreasuryDelegate.sol#L52 https://github.com/Plex-Engineer/lending-market/blob/755424c1f9ab3f9f0408443e6606f94e4f08a990/contracts/Treasury/TreasuryDelegate.sol#L56

Vulnerability details

The use of the deprecated transfer() function for an address will inevitably make the transaction fail when:

  1. The claimer smart contract does not implement a payable function.

  2. The claimer smart contract does implement a payable fallback which uses more than 2300 gas unit.

  3. The claimer smart contract implements a payable fallback function that needs less than 2300 gas units but is called through proxy, raising the call's gas usage above 2300.

Additionally, using higher than 2300 gas might be mandatory for some multisig wallets.

GalloDaSballo commented 2 years ago

call will revert also if the receiver doesn't have a receive function

Downgrading to QA in lack of POC (e.g. show me a wallet that will revert, Gnosis won't revert, I've tested)