project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4

Open Stylus

Modular and gas-optimized smart contract libraries and frameworks for Stylus Smart contract development.

Open Stylus

Created At

ETHIndia 2023

Winner of

Arbitrum - Best Library / Framework 🥇 Winner

Project Description

Open Stylus is an alternative to OpenZeppelin for Stylus smart contracts. Our development efforts encompass prominent ERC standards, including ERC20, ERC721, ERC1155, ERC4626, ERC6909, and WETH. Moreover, we've created a Stylus implementation of Solidity ABDKMaths libraries. Stylus significantly enhances computations by up to 100x and memory optimizations by up to 500x, leveraging the processing of machine-native code. Once activated, our precompiled Maths libraries become a valuable resource, offering users direct access to functions for various mathematical computations, such as mul_div, mean, roots, powers, and unsigned to signed conversions, specifically tailored for Alloy types primitives.

A significant highlight of our project is the implementation of the Fast Fourier Transform (FFT) in Stylus. This function facilitates the conversion from the time domain to the frequency domain, a crucial formula in communication engineering technologies. Our discrete fast Fourier transform implementation ensures rapid computation with O(n log n) complexity. Originally developed for cryptographic libraries, this implementation showcases the speed and gas efficiency of the Stylus framework. Gas cost comparisons between FFT implementations in both Solidity and Stylus consistently demonstrate Stylus as the more efficient and faster option. We have included gas cost comparison data to highlight the superior performance of Stylus in FFT computations in our github readme.

How it's Made

Participating in a hackathon and implementing Rust-based projects presents a significant challenge, primarily because of the constraints imposed by time limitations. In our case, the usage of only alloy_primitives in Stylus necessitated meticulous implementation of all data types to align with the Alloy framework. Additionally, the implementation of no_std in Stylus posed a challenge as it disconnected us from crucial Rust development tools like rust-analyzer, making error handling a bit more challenging. The most challenging aspects of our project were the implementation of the FFT algorithm and ERC4337(currently under development). These challenges arose due to the inherent mathematical and logical complexities associated with these tasks. Despite these difficulties, our team navigated through the hurdles to deliver a robust and innovative project within the given constraints.

background image mobile

Join the mailing list

Get the latest news and updates