OffchainLabs / stylus-sdk-rs

Rust Smart Contracts on Arbitrum
239 stars 79 forks source link

feat(stylus-proc): add support for fallback functions #113

Closed alexfertel closed 2 months ago

alexfertel commented 7 months ago

Description

Implementation of Solidity's fallback functions as a #[fallback] proc macro.

Motivation

In order to simplify the support for current Solidity proxy patterns, we need to support some sort of fallback mechanism so that a contract can act as a proxy and delegate calls to other contracts. This PR is an additive and relatively simple change that implements a mechanism similar to Solidity's fallback functions.

Implementation

Screenshot 2024-03-12 at 14 10 21 Screenshot 2024-03-12 at 14 09 51 Screenshot 2024-03-12 at 13 44 50

TODO