project screenshot 1

Sugar Borrow

A set of contracts and Hardhat scripts for giving/receiving credit delegations

Sugar Borrow

Created At

ETHOnline 2021

Project Description

This project covers credit delegation from multiple parties to a single wallet (eoa) or smart wallet. In its most basic form, a beneficiary should be able to enjoy credit from multiple parties, delegated from an Aave depositor via smart contract call. However for ease of use, a UI should be provider for beneficiaries and sponsors (UI Not part of submission as of today).

Fun arrives when smart wallet functionality is implemented. It would a be simple mechanic, just to control amounts borrowable by the beneficiary. A beneficiary will first borrow from the sponsor that has delegated more credit to them, until the credit available is exhausted.

How it's Made

I started with Hardhat for basic script proof of concept. This is delegating credit from one EOA to another EOA. This was done successfully. I did not manage to include oracle consumption, or the matcha swap router I had in mind.

I have also created a "dumb" smart contract wallet, called Purse, which resembles a vault more than an actual smart wallet. This is where multiple sponsors can delegate their credit to, and where there is space for borrowing logic.

Sponsor technology used was Aave Credit delegation. This is a core piece and without it this project wouldn't be possible! At least, not at this level of simplicity/abstraction.

background image mobile

Join the mailing list

Get the latest news and updates