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

0 stars 0 forks source link

`call()` should be used instead of `transfer()` on an address payable #112

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Lines of code

https://github.com/code-423n4/2022-07-ens/blob/main/contracts/ethregistrar/ETHRegistrarController.sol#L183

Vulnerability details

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

File:  main/contracts/ethregistrar/ETHRegistrarController.sol

183:     payable(msg.sender).transfer
204:     payable(msg.sender).transfer(msg.value - price.base);
211:     payable(owner()).transfer(address(this).balance);

Recommended Mitigation Steps

I recommend using call() instead of transfer().

jefflau commented 2 years ago

Duplicate of #133