← Back to home

StyliteProxy

A minimal Proxy in Rust built with Stylus

Screenshots

StyliteProxy screenshot 1
StyliteProxy screenshot 2
StyliteProxy screenshot 3

Problem Statement

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.

Solution

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 keccak256Compatibilty issue between different versions of alloy_primitives and stylus-sdkWe faced issues while parsing the data recieved from delegate_callBeing Solidity developers to be able to transition to Rust and work in it.

Hackathon

ETHIndia 2023

2023

Prizes

  • 🏆

    Best Stylus Project🥈 Runner - up

    Arbitrum

Contributors