You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
depositWithSignature() won't work and always revert due to missing permit function in deposited asset.
Severity
Medium
Affected contracts
wrstMTRG.sol, wstARB.sol, wstDOJ.sol, wstMANTA.sol, wstMETIS.sol, wstROSE.sol, wstVLX.sol, wstZETA.sol and wstToken.sol
Vulnerability Detail
wstToken.sol is the referred contract from which the above contracts are deployed. wstToken is ERC4626 compatible. For example, in case of wstROSE.sol, it allows to deposit stROSE token and mints wstROSE tokens. This issue is with depositWithSignature() function of wstToken.sol:
depositWithSignature() is used to deposit the assets via permit and later deposits in single transaction. depositWithSignature() will always revert and won't work as expected as the asset being permitted to address(this) i.e wstToken.sol contract does not have permit() function in its implementation. This can be checked in stToken.solhere
Therefore, assets like rstMTRG.sol, stARB.sol, stDOJ.sol, stMANTA.sol, stMETIS.sol, stROSE.sol, stVLX.sol, stZETA.sol tokens does not have permit() function to work correctly in depositWithSignature() function for depositing of stToken in vaults.
Impact
Assets can not be deposited in wstToken contracts due to missing permit() function in deposited assets as described above.
Recommendation to fix
Implement permit() function in stToken.sol and also make relevant changes in rstMTRG.sol, stARB.sol, stDOJ.sol, stMANTA.sol, stMETIS.sol, stROSE.sol, stVLX.sol, stZETA.sol contracts.
Consider below changes in stToken.sol:
Add this openzeppelin's ERC20Permit.sol in stToken.sol.
Github username: @0xRizwan
Twitter username: 0xRizwann
Submission hash (on-chain): 0x65db4f9773c0e4f7ecce60decd9cb1711a85e625ffec2b6bf429a25b1954497d
Severity: medium
Description:
Title
depositWithSignature()
won't work and always revert due to missing permit function in deposited asset.Severity
Medium
Affected contracts
wrstMTRG.sol
,wstARB.sol
,wstDOJ.sol
,wstMANTA.sol
,wstMETIS.sol
,wstROSE.sol
,wstVLX.sol
,wstZETA.sol
andwstToken.sol
Vulnerability Detail
wstToken.sol
is the referred contract from which the above contracts are deployed. wstToken is ERC4626 compatible. For example, in case ofwstROSE.sol
, it allows to depositstROSE
token and mintswstROSE
tokens. This issue is withdepositWithSignature()
function ofwstToken.sol
:depositWithSignature()
is used to deposit the assets via permit and later deposits in single transaction.depositWithSignature()
will always revert and won't work as expected as theasset
being permitted toaddress(this)
i.ewstToken.sol
contract does not havepermit()
function in its implementation. This can be checked instToken.sol
hereTherefore, assets like
rstMTRG.sol
,stARB.sol
,stDOJ.sol
,stMANTA.sol
,stMETIS.sol
,stROSE.sol
,stVLX.sol
,stZETA.sol
tokens does not havepermit()
function to work correctly indepositWithSignature()
function for depositing of stToken in vaults.Impact
Assets can not be deposited in
wstToken
contracts due to missingpermit()
function in depositedassets
as described above.Recommendation to fix
Implement
permit()
function instToken.sol
and also make relevant changes inrstMTRG.sol
,stARB.sol
,stDOJ.sol
,stMANTA.sol
,stMETIS.sol
,stROSE.sol
,stVLX.sol
,stZETA.sol
contracts.Consider below changes in
stToken.sol
:Add this openzeppelin's
ERC20Permit.sol
instToken.sol
.Inherit the added
ERC20Permit.sol
.The text was updated successfully, but these errors were encountered: