tokamak-network / ton-staking-v2

8 stars 3 forks source link

H_7. Change payable method #10

Closed zzooppii closed 4 months ago

zzooppii commented 4 months ago

Describe the bug Payable method not recommended

Configuration

Impact Because gas prices are fixed, transmission may fail.

Recommendation recommend changing the payable method by following this link

Exploit Scenario

Demo

Zena-park commented 4 months ago

Thank you for reporting the above. :smiley: I will check the above information again and revise it as shown below.

:bug: Potential for error https://eips.ethereum.org/EIPS/eip-1884 increases the gas cost of certain opcodes, possibly making contracts go over the 2300 gas limit imposed by 'transfer, making them unable to receive funds via 'transfer'.

:bug: Change function Send funds using the call function.

:lock: Caution When transferring Ether using the call function, control is transferred to the recipient, so care must be taken regarding reentrancy vulnerabilities.

:zap: Code enhancements Added a lock modifier to the calling function to prevent reentrancy.

Zena-park commented 4 months ago

@zzooppii I applied for the code review.

zzooppii commented 4 months ago

thank you