code-423n4 / 2022-07-fractional-findings

0 stars 0 forks source link

call instead of transfer #38

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Lines of code

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/modules/Migration.sol#L172

Vulnerability details

call instead of transfer

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/modules/Migration.sol#L172

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.

recommendation

Use call() instead of transfer() to send ether. And return value must be checked to see if the call is successful. Sending ether with the transfer is no longer recommended.

mehtaculous commented 2 years ago

Duplicate of #325

HardlyDifficult commented 2 years ago

Duping to #504