Intro to Dai Savings Escrows

Escrows-that-Earn with Internet Money Programming

lexDAO
LexDAOism
4 min readMar 29, 2020

--

Coming hot off the tracks of launching LexDAO Banknotes, we have re-purposed some of the related Chai code to create legal Escrows-that-Earn.

Just input deal terms on a smart template with someone else online, then lock your DAI into a synced escrow with CHAI $$$ so no interest is wasted 🍵⏳.

Take a gander at v1 script here for Dai Savings Escow, and ping comments to our chat room. Welcoming pull requests as well to our common repo~~

Anyways,

Dai Savings Escrows are being piloted first on OpenLaw to upload deal terms and make it easy for parties to act as escrow agents/bankers by signing transactions with their MetaMask wallets.

To make a DSE, you might first interact with the Solidity code by using our demo deal template for a Sale of Goods, “DIGITAL ESCROW FOR SALE OF GOODS.”

As a buyer or client, you can:

(1) Input deal terms on OpenLaw and E-sign legal Contract

In addition to programming an escrow that will be stamped by these legal terms, you also have an opportunity here to set up codified permissions and timetables for accounts that can interact with the resulting escrow . . . Purchaser, Supplier and a termination date stored on Ethereum:

(2) Approve Dai Deposit from MetaMask wallet

resulting TX

Basically, here, the deal Purchaser is signing a digital check that the DSE smart contract can cash when Purchaser fully registers their Dai/Chai escrow in the next step that formally deposits their funds (this is a security 2-step incidental to most ERC-20 tokens . . . ):

(3) Register Dai Escrow from MetaMask wallet

resulting TX

This will then convert your Dai deposit into Chai so that it can potentially earn an interest through the DSR. This continuously-earning Chai amount will then be either forwarded to the service_goods provider, withdrawn on termination of the deal timer, or split upon a vote of lexDAO in digital arbitration proceedings.

(4) Follow white rabbit, fulfill deal on Etherscan smart contract UI

If you click the link to the chained TX on OpenLaw, you can also inspect the Event Logs and find the index number of the newly-registered escrow for your digital deal on the Etherscan block explorer for Ethereum:

Event logs on Ethereum // Etherscan

Pinging our index number, “3”, into the smart contract reader, we can see the following stored deal description, fastened hard to the Ethereum distributed database and programs:

Details string stores reference to E-signed OpenLaw Contract

In the role of Purchaser, I can then choose to (i) confirm this deal and release the Chai (wrap) balance to the deal Provider, which would also reflect accrued interest recoverable in Dai, (ii) recover this deposited sum if timer terminates, or (iii) dispute the deal (on other end, Provider can also lodge a dispute and store complaints in smart contract . . . )~~

Remembering our deal `index` number, the OpenLaw-signed Provider, Purchaser and lexDAO accounts can secure this deal entirely online and move money in ways previously unimaginable 🌈💸✨.

In this case, my demo escrow has actually timed out . . .

I double-checked against the epoch converter using the stored termination:

(1585497600)

and, but for time lapse, I would have otherwise clicked to release, as so:

But lo and behold, a proud, programmatic error . . .

Fair enough, as Purchaser, I will take my ball home, and click to withdraw escrowed Chai like so:

and regain my escrowed Dai + interest via Chai:

resulting TX

That’s a wrap! Onward to v2 and better (stable) earning Escrows for web3 deals>>>

--

--