Closed sherlock-admin3 closed 7 months ago
1 comment(s) were left on this issue during the judging contest.
WangAudit commented:
they inherit from pausable contract which has the pause function; yeah protocols often override them; but in that case I believe they decided not to do that!
Tendency
medium
MIssing Admin Setters for
_pause()
and_unpause()
Summary
The contracts
mTOFT
,AssetToSGLPLeverageExecutor
, andUsdo
utilize thewhenNotPaused
modifier for contract control but fail to implement an owner-only functionality for pausing and unpausing the contracts.Vulnerability Detail
The following contracts
mTOFT
,AssetToSGLPLeverageExecutor
andUsdo
all inherit fromOpenZeppelin
Pausable
contract, and also make use of thewhenNotPaused
modifier for contract control, but fail to include an owner only functionality for pausing and unpausing the contracts.The
whenNotPaused
modifier is used in the following contract functions:https://github.com/sherlock-audit/2024-02-tapioca/blob/dc2464f420927409a67763de6ec60fe5c028ab0e/Tapioca-bar/contracts/markets/leverage/AssetToSGLPLeverageExecutor.sol#L75
https://github.com/sherlock-audit/2024-02-tapioca/blob/dc2464f420927409a67763de6ec60fe5c028ab0e/TapiocaZ/contracts/tOFT/mTOFT.sol#L316
https://github.com/sherlock-audit/2024-02-tapioca/blob/dc2464f420927409a67763de6ec60fe5c028ab0e/TapiocaZ/contracts/tOFT/mTOFT.sol#L237
https://github.com/sherlock-audit/2024-02-tapioca/blob/dc2464f420927409a67763de6ec60fe5c028ab0e/TapiocaZ/contracts/tOFT/mTOFT.sol#L290
https://github.com/sherlock-audit/2024-02-tapioca/blob/dc2464f420927409a67763de6ec60fe5c028ab0e/TapiocaZ/contracts/tOFT/mTOFT.sol#L316 https://github.com/sherlock-audit/2024-02-tapioca/blob/dc2464f420927409a67763de6ec60fe5c028ab0e/Tapioca-bar/contracts/usdo/Usdo.sol#L155
https://github.com/sherlock-audit/2024-02-tapioca/blob/dc2464f420927409a67763de6ec60fe5c028ab0e/Tapioca-bar/contracts/usdo/Usdo.sol#L191
https://github.com/sherlock-audit/2024-02-tapioca/blob/dc2464f420927409a67763de6ec60fe5c028ab0e/Tapioca-bar/contracts/usdo/Usdo.sol#L243
https://github.com/sherlock-audit/2024-02-tapioca/blob/dc2464f420927409a67763de6ec60fe5c028ab0e/Tapioca-bar/contracts/usdo/Usdo.sol#L255
Impact
In the event of a security incident requiring the pausing of major functionalities, the absence of an admin setter prevents the contracts from being paused, potentially exacerbating the impact of the incident.
Code Snippet
https://github.com/sherlock-audit/2024-02-tapioca/blob/dc2464f420927409a67763de6ec60fe5c028ab0e/Tapioca-bar/contracts/usdo/Usdo.sol#L45
https://github.com/sherlock-audit/2024-02-tapioca/blob/dc2464f420927409a67763de6ec60fe5c028ab0e/Tapioca-bar/contracts/markets/leverage/AssetToSGLPLeverageExecutor.sol#L40
https://github.com/sherlock-audit/2024-02-tapioca/blob/dc2464f420927409a67763de6ec60fe5c028ab0e/TapiocaZ/contracts/tOFT/mTOFT.sol#L50
Tool used
Manual Review
Recommendation
Add an owner-only function for pausing and unpausing the contracts.
Duplicate of #64