composable

smart contract tool for both protocols and users to compose arbitrary actions across defi space

Demo Video Source Code

Prizes

Pocket Gateway + RPC Endpoint 5th place

Technologies

Ethereum

Solidity

Description

We provide an interface to simplify calling arbitrary functions from within Ethereum, using our own defined specific encoding standard. We were inspired by Diamond standard contracts, aka EIP-2535, which uses a fallback function to map unspecified function selectors to specific addresses which implement the functions. Well, what if we could just route calls through without needing to identify the contract through a predetermined storage? It turns out that’s not a new idea, and it is already the basis of many contracts, such as proxy contracts, factories, multi signs, and the aforementioned diamonds. Where we differ is in providing the ability to compose multiple calls into a single bundle, by concatenating the specially encoded Composable calls, and the smart contract will sequentially execute the calls with no further issues. You can send one function call, two or three, or ten! It will handle them all the same way. With hashing functions coded into the contract, it’s possible to form any kind of arbitrary hash tree of your data, whereby you can prove to a governance contract that you’re performing the calls exactly as intended, without requiring them to be stored on chain. Contracts can cryptographically guarantee the output will be produced by the expected input. Many people have been entirely excluded from participating in DeFi because of exorbitant gas fees. With certain DeFi actions spanning multiple protocols _and_ transactions, users may even have intermediate transactions delayed/stopped if gas prices rise too quickly in a short period, further compounding the problem. High gas costs have at least been _part_ of the motivation for aggregating token balances of accounts with aligned interests in delegated vaults, ie yEarn, if not a major deciding factor. With Composable, cheap, efficient contracts can turn individuals into their own vaults, where they can use their own strategies, and furthermore Composable can add a bit of flexibility to existing contracts that rely on strategies which need to be as fluid as the market is. Composable can be injected into Aave’s Flashloan contract, and can become a public beacon where users can trigger all kinds of sequences of actions within a flashloan context. DeFi protocols can build on top of that, taking advantage of an efficient smart contract infrastructure that aids in composability. There is quite a bit that can be done through Composable, but it’s going to be a journey.

How It's Made

We used Javascript, React, web3, truffle, pocket network, ganache, solidity, and inline assembly to do most of the work. What we discovered though, is that Yul exists independently of Solidity. We seek to further optimize certain aspects by first mastering Yul. Yul is high level enough to not be a bizarre mess of 0’s, X’s and capslocked op codes. It’s harder to follow than Solidity, but delivers a lot of minute control over the structure of smart contracts. We expect that Yul will elevate the quality of the contracts by a substantial degree.

Team

Justin Beaurone Jason Huan Anthony Khoshrozeh Angela Lu Tyler Goodman
← click here to see all projects