hats-finance / Fenix--0x9d7765a7ebd5b6322a30797a44a5428531970d3d

0 stars 1 forks source link

Doesn't emit event after writing into `_IMPLEMENTATION_SLOT` #36

Open hats-bug-reporter[bot] opened 2 months ago

hats-bug-reporter[bot] commented 2 months ago

Github username: -- Twitter username: -- Submission hash (on-chain): 0xd0b66aba61d308bcb6cc3700b9d00784a9edda1a950517fcf9be0c407a22b839 Severity: low

Description: Description

fallback method of VirtualRewarderProxy() calls _setImplementation() in every call and write into _IMPLEMENTATION_SLOT if virtualRewarderImplementation is changed but it doesn't emit event after writing into storage slot.

  1. Proof of Concept (PoC) File
    function _setImplementation(address newImplementation) private {
        StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    fallback() external payable {
        address impl = ICompoundVeFNXManagedNFTStrategyFactory(factory).virtualRewarderImplementation();
        require(impl != address(0));

        //Just for etherscan compatibility
        if (impl != _getImplementation() && msg.sender != (address(0))) {
            _setImplementation(impl);
        }

      ........................................
    }

Event emissions offer transparency and on chain information about state change of _IMPLEMENTATION_SLOT i.e implementation address

Emit an event after writing into _IMPLEMENTATION_SLOT

0xmahdirostami commented 1 month ago

Out of scope