The problem StyliteProxy solves
- Proxy contracts provide you the ability of making your contracts upgradable, while rust is performant and gas efficient. But currently there are no sample/implementations for Proxy Patterns in Rust.
- We built a project to demonstrate a minimal proxy on Stylus using delegate_call(). The primary functionality allows for deploying and upgrading the implementation contract by deploying a new implementation contract and subsequently calling set_implementation() on the proxy, specifying the address of the newly deployed contract.
Challenges we ran into
Stylus being new we ran into quite many technical challenges, major ones :-
- We faced issue while using function_selector! macro and were not able to get the correct selector. We worked around by implementing ourself by using keccak256
- Compatibilty issue between different versions of alloy_primitives and stylus-sdk
- We faced issues while parsing the data recieved from delegate_call
- Being Solidity developers to be able to transition to Rust and work in it.