Closed sherlock-admin4 closed 8 months ago
1 comment(s) were left on this issue during the judging contest.
WangAudit commented:
when the initialize function is called; it triggers the initializer modifier which restricts repeated intialization
The initilaize() function can be called from implementation contract even when it has been deployed if we don't implement _disableInitializers().
0xKartikgiri00
high
initialize
function not disabled inAmirX
contract.Summary
The contract
AmirX
does not call the_disableInitializers()
function in its constructor, which leads to make the contract unpaused if it is meant to be paused.Vulnerability Detail
The contract
AmirX
contract does not call_disableInitializers()
function in its constructor. Which makes the implementation contract to callinitialize
function even after it is called by the proxy. The calling ofinitialize
function again in implementation contract will make the contract unpaused if it is paused.Impact
If the contract is meant to be paused the calling of
initialize
function again in implementation contract will make the contract unpaused.Code Snippet
https://github.com/sherlock-audit/2024-02-telcoin-platform-audit-update/blob/main/telcoin-contracts/contracts/swap/AmirX.sol#L49
Tool used
Manual Review
Recommendation
Call the _disableInitializers() function in the constructor of the AmirX contract to prevent the execution of initialize functions after it is called by proxy or called on implementation contract. Recommendation in code:-