Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 2.44 KB

README.md

File metadata and controls

30 lines (22 loc) · 2.44 KB

DAI Insured smart contracts

System consists of two contracts:

  • Insured - does all the heavy-lifting (talks to MakerDAO contracts, exchange, etc). Main target for bots.
  • Authority - allows DSProxy to work with Insured. Users can continue to use CDP Portal.

When set up anyone can call save and saveN methods of Insured to repay endangered CDPs. Both take DSProxy and CDP's id as arguments.

  • save(address target, bytes32 cup) - withdraws ether, sells it, and repays debt. Will revert gracefully if has nothing to do (current collaterizatoin ratio above ACTIVE level);
  • save(address target, bytes32 cup) - similar to save, but continues to repay debt until transaction runs out of gas (transaction finishes successfully) or the CDP becomes safe. Consider setting gas limit manually (might consume several million gas).

Deployment

  1. Deploy Insured
  2. Deploy Authority, use Insured address in constructor
  3. Assuming user has his DSProxy contract (created via CDP Portal). Initialize DSProxy.setAuthority with Authority's address.
    • One can use IDSProxy and Remix to call setAuthority function
    • Or send call the proxy contract with that msg.data: 0x7a9e5e4b000000000000000000000000951b0913e4acb4e788cad7c82b171e3a4402e754

Enjoy help from bots!

Kovan

Mainnet

Bots

Bots could watch for LogSetAuthority events, emitted from DSProxy.setAuthority cals.