Skip to content

initialize call during proxy creation (UUPS) #1

@kontrol-apa

Description

@kontrol-apa

Hey guys,
Lemme begin with how much I like your work. I pretty much use Foundry all the time and the lack up upgradable proxy support was a bummer. I found this repo while i was checking foundry-rs for proxy support. Thanks a bunch for your awesome work, I truly appreciate it .
So, when I was poking around i realized that the "initialize" is being called after the proxy creation (UUPS). This is a minor thing but I think its better if its directly called during the contract creation such as
proxy = new UUPSProxy(address(implV1), abi.encodeWithSignature("initialize()"));
instead of leaving the second parameter blank and calling it later. This way the contract will never be uninitialized.
I have a couple of other suggestions such as using the address of the proxy casted to an implementation interface IImplementation(proxyAddress).functionName() rather using low level call.(abi.encodeWithSignature("functionName()")) directly from the proxy. I had a a well tested project and this was the quickest way to test the proxy implementation. There is more to it actually, since if the implementation reverts (without a custom error), forge tests do not detect it since they dont bubble up to the proxy but it but thats another topic for another day.
I tried to create a branch and push it but dont have the permissions. If you could gimme access, i would love to contribute and open some pr's.

Cheers and thanks again for the awesome work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions