Submitted by RaymondFam, also found by ajtra, AkshaySrivastav, JC, asgeir, pashov, cryptonue, carrotsmuggler, fs0c, karanctf, jonatascm, Tutturu, ladboy233, Awesome, pauliax, Rahoz, bin2chen, shark, supernova, __141345__, simon135, lumoswiz, zaskoh, 0xdeadbeef0x, ajtra, hansfriese, yellowBirdy, cccz, CRYP70, dic0de, Bnke0x0, tourist, ahmedov, Parth, ahmedov, obront, chaduke, zapaz, HollaDieWaldfee, btk, rvierdiiev, martin, 0xhacksmithh, fatherOfBlocks, and aviggiano
https://github.com/code-423n4/2022-12-escher/blob/main/src/minters/LPDA.sol#L105
https://github.com/code-423n4/2022-12-escher/blob/main/src/minters/LPDA.sol#L85-L86
https://github.com/code-423n4/2022-12-escher/blob/main/src/minters/FixedPrice.sol#L109
https://github.com/code-423n4/2022-12-escher/blob/main/src/minters/OpenEdition.sol#L92
The protocol uses Soliditys transfer() when transferring ETH to the recipients. This has some notable shortcomings when the recipient is a smart contract, which can render ETH impossible to transfer. Specifically, the transfer will inevitably fail when the smart contract:
File: LPDA.sol
File: FixedPrice.sol#L109
File: OpenEdition.sol#L92
Issues pertaining to the use of transfer() in the code blocks above may be referenced further via:
Using call with its returned boolean checked in combination with re-entrancy guard is highly recommended after December 2019.
For instance, line 105 in LPDA.sol may be refactored as follows:
Alternatively, Address.sendValue() available in OpenZeppelin Contracts Address library can be used to transfer the Ether without being limited to 2300 gas units.
And again, in either of the above measures adopted, the risks of re-entrancy stemming from the use of this function can be mitigated by tightly following the Check-effects-interactions pattern and/or using OpenZeppelin Contracts ReentrancyGuard contract.
mehtaculous (Escher) confirmed and commented:
