Category: Business Logic
transfer
function usage
Informational Severity
Informational Impact
N/A Likelihood
Description
The transferEth
function calls the transfer
function to send requested Ether amount.
function transferEth(address payable to, uint256 amount) public onlyRole(MANAGER_ROLE) whenNotPaused {
to.transfer(amount);
...
}
Impact
The transfer
function uses a hardcoded amount of GAS and will fail if GAS costs increase in the future, so it is no longer recommended for use.
Recommendations
Consider↗ using to.call{value: amount}("")
function:
function transferEth(address payable to, uint256 amount) public onlyRole(MANAGER_ROLE) whenNotPaused {
(bool sent, bytes memory data) = to.call{value: amount}("");
require(sent, "Failed to send Ether");
...
Remediation
The issue has been acknowledged by TrueFi. The TrueFi decided not to support ETH transfers and functionality was deleted in commit 0b0ca5f↗.