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

0 stars 0 forks source link

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

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Lines of code

https://github.com/code-423n4/2022-07-axelar/blob/main/xc20/contracts/XC20Wrapper.sol#L63

Vulnerability details

This is a classic Code4rena issue: https://github.com/code-423n4/2021-04-meebits-findings/issues/2 https://github.com/code-423n4/2022-01-openleverage-findings/issues/75

Impact

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

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

Instances:

xc20/contracts/XC20Wrapper.sol:63

xc20/contracts/XC20Wrapper.sol:63:        payable(msg.sender).transfer(address(this).balance);

Recommended Mitigation

Use call() instead of transfer()

GalloDaSballo commented 2 years ago

Similar to #230

re1ro commented 2 years ago

Duplicate of #4