sherlock-audit / 2023-03-sense-judging

4 stars 0 forks source link

w42d3n - Periphery.sol: dangerous payable functions #60

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

w42d3n

medium

Periphery.sol: dangerous payable functions

Summary

Vulnerability Detail

The contract Periphery.sol use several payable functions:

L116 function sponsorSeries(

L178 function swapForPTs(

L325 function addLiquidity(

In these functions , users can send ETH mistakenly so, we should check the msg.value is 0 or not.

Impact

Lost of funds for users

Code Snippet

Tool used

Manual Review

Recommendation

add the check for the non-native transfer section as follow

require(msg.value == 0,"NON ETH");