project screenshot 1
project screenshot 2
project screenshot 3

Dynamic offer validator

A neat library that enables marketplace/lending protocol offers to define conditions under which they are valid. Handy for dynamic NFTs 🤙

Dynamic offer validator

Created At

ETHGlobal Paris

Project Description

It's not easy to use dynamic NFTs, which value can be decreased by the owner at any time, as collateral in lending protocols. It is not impossible, but it requires bundling that NFT and waiting for an offer from a lender.

This library aims to solve this issue by implementing additional conditions under which offers are valid. Thanks to that, lenders can create offers that are (1) more flexible, (2) cannot be rugged by the owner, and (3) valid for an original collection.

The project is divided into two libraries:

  1. Getter - a simple library for making staticcalls to any address and decoding its return values
  2. ExpressionEvaluator - a library that defines comparison & logical expressions and evaluates them

Users can define more complex logical expressions that can be used to determine if an offer is valid or not. Such offers could be:

  1. offer to any Uni v3 LP NFT that has DAI as token0 or token1 and liquidity greater than 1000
  2. offer to any chicken bond with an amount greater than 1000 bLUSD and end date in 2 month
  3. offer to any bundle that is locked and contains at least 4 CryptoPunks
  4. offer to any streaming token with an unclaimed amount of 1000 DAI

The code is concise and quite self-explanatory. Interested files are ExpressionEvaluator.sol and some fork testing in ExpressionEvaluator.fork.t.sol.

How it's Made

Developed with Foundry. I haven't used any sponsor technologies, but it can be used on any EVM chain 😉 haven't seen any such offer flexibility anywhere.

EthGlobal wants me to add more information, but I don't believe judges are going to read all of it. Let's save them some energy and make it short.

background image mobile

Join the mailing list

Get the latest news and updates