Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Return value of low-level calls not used. #125

Closed
Pfed-prog opened this issue Feb 17, 2023 · 3 comments
Closed

Warning: Return value of low-level calls not used. #125

Pfed-prog opened this issue Feb 17, 2023 · 3 comments

Comments

@Pfed-prog
Copy link

Warning: Return value of low-level calls not used.
--> contracts/TalentLayerEscrow.sol:665:13:
|
665 | payable(transaction.receiver).call{value: receiverFee}("");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning: Return value of low-level calls not used.
--> contracts/TalentLayerEscrow.sol:686:13:
|
686 | payable(transaction.sender).call{value: senderFee}("");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning: Return value of low-level calls not used.
--> contracts/TalentLayerEscrow.sol:806:13:
|
806 | payable(transaction.sender).call{value: extraFeeSender}("");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning: Return value of low-level calls not used.
--> contracts/TalentLayerEscrow.sol:814:13:
|
814 | payable(transaction.receiver).call{value: extraFeeReceiver}("");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning: Return value of low-level calls not used.
--> contracts/TalentLayerEscrow.sol:843:13:
|
843 | sender.call{value: senderFee}("");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning: Return value of low-level calls not used.
--> contracts/TalentLayerEscrow.sol:846:13:
|
846 | receiver.call{value: receiverFee}("");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning: Return value of low-level calls not used.
--> contracts/TalentLayerEscrow.sol:856:13:
|
856 | sender.call{value: splitFeeAmount}("");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning: Return value of low-level calls not used.
--> contracts/TalentLayerEscrow.sol:857:13:
|
857 | receiver.call{value: splitFeeAmount}("");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning: Return value of low-level calls not used.
--> contracts/TalentLayerEscrow.sol:1105:13:
|
1105 | _recipient.call{value: _amount}("");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@Pfed-prog
Copy link
Author

Pfed-prog commented Feb 17, 2023

By example: the first warning instance payable(transaction.receiver).call{value: receiverFee}(""); fixed by
payable(transaction.receiver).transfer(receiverFee)

After fixing all warnings, the TalentLayerEscrow reduced to 23.149.
TalentLayerEscrow gas also reduced to 5198083

#126

@Pfed-prog
Copy link
Author

Pfed-prog commented Feb 20, 2023

Or

(bool success, ) = msg.sender.call.value(amount)("");
require(success, "Transfer failed.");

solve warning

@0xRomain
Copy link
Contributor

Handle the answer of the call bring some critical issues as now the receiver can break any function using it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants