Platform: Code4rena
Start Date: 06/12/2022
Pot Size: $36,500 USDC
Total HM: 16
Participants: 119
Period: 3 days
Judge: berndartmueller
Total Solo HM: 2
Id: 189
League: ETH
Rank: 111/119
Findings: 1
Award: $0.61
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: RaymondFam
Also found by: 0xdeadbeef0x, 0xhacksmithh, AkshaySrivastav, Awesome, Bnke0x0, CRYP70, HollaDieWaldfee, JC, Parth, Rahoz, Tutturu, __141345__, ahmedov, ajtra, asgeir, aviggiano, bin2chen, btk, carrotsmuggler, cccz, chaduke, cryptonue, dic0de, fatherOfBlocks, fs0c, hansfriese, jonatascm, karanctf, ladboy233, lumoswiz, martin, obront, pashov, pauliax, rvierdiiev, shark, simon135, supernova, tourist, yellowBirdy, zapaz, zaskoh
0.6136 USDC - $0.61
https://github.com/code-423n4/2022-12-escher/blob/5d8be6aa0e8634fdb2f328b99076b0d05fefab73/src/minters/FixedPrice.sol#L109 https://github.com/code-423n4/2022-12-escher/blob/5d8be6aa0e8634fdb2f328b99076b0d05fefab73/src/minters/LPDA.sol#L85-L86 https://github.com/code-423n4/2022-12-escher/blob/5d8be6aa0e8634fdb2f328b99076b0d05fefab73/src/minters/LPDA.sol#L105 https://github.com/code-423n4/2022-12-escher/blob/5d8be6aa0e8634fdb2f328b99076b0d05fefab73/src/minters/OpenEdition.sol#L92
When operations use a wrapped native token, the withdraw is being handled with a payable.transfer()
 method.
When withdrawing and refund extra ETH, the ETHRegistrarController contract uses Solidity’s transfer()
function.
Using Solidity's transfer()
function has some notable shortcomings when the withdrawer is a smart contract, which can render ETH deposits impossible to withdraw. Specifically, the withdrawal will inevitably fail when:
Risks of reentrancy stemming from the use of this function can be mitigated by tightly following the "Check-Effects-Interactions" pattern and using OpenZeppelin Contract’s ReentrancyGuard contract.Â
File: src/minters/FixedPrice.sol 109: ISaleFactory(factory).feeReceiver().transfer(address(this).balance / 20); 110: selfdestruct(_sale.saleReceiver); File: src/minters/LPDA.sol 85: ISaleFactory(factory).feeReceiver().transfer(fee); 86: temp.saleReceiver.transfer(totalSale - fee); 105: payable(msg.sender).transfer(owed); File: src/minters/OpenEdition.sol 92: ISaleFactory(factory).feeReceiver().transfer(address(this).balance / 20);
The issues with transfer()
 are outlined here
For further reference on why using Solidity’s transfer()
is no longer recommended, refer to these articles.
Manual analysis.
Using low-level call.value(amount)
 with the corresponding result check or using the OpenZeppelin Address.sendValue
 is advised, reference.
#0 - c4-judge
2022-12-10T00:30:01Z
berndartmueller marked the issue as duplicate of #99
#1 - c4-judge
2023-01-03T12:46:51Z
berndartmueller marked the issue as satisfactory