go-maker

module
v0.0.0-...-edb312b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2022 License: MIT

README

Go Maker

Golang bindings to the Multi-Colatoral Dai stablecoin system

Note: This library is still under development and currently supports Vat (central holdings), Pot (DSR), and Jug (Stability Fee) access

Usage

Assuming you're connected to an Ethereum RPC gateway (geth, parity, Infura, etc...) via go-ethereum

// Connect to Ethereum gateway...
client := //...

vat, err := maker.LoadVat(client)
if err != nil {
  log.Fatalln(err)
}

// You shouldn't ignore errors like this!
var (
  debt, _ = vat.Debt(nil)
  vice, _ = vat.Vice(nil)
  line, _ = vat.Line(nil)
)

log.Printf(`

Vat @ %s
----------
  debt: %s
  vice: %s
  line: %s

`, maker.VatAddress.Hex(), debt, vice, line)

For the complete example check out the examples/ directory!

To Do

  • Autogenerate maker/load.go for easy reference and loading of deployed contracts
  • Add support for the complete MCD system of contracts
    • Cat
    • Dai
    • End
    • Flap
    • Flip
    • Flop
    • Join
    • Jug
    • Lib
    • Pot
    • Spot
    • Vat
    • Vow

Developing

Note: Compiled bindings are comitted to the repo. You can consume this package directly like any other Go library

Tooling
  • solc - Solidity compiler
  • abigen - Generate language specific bindings to Solidity contracts
Setup

To get started you will need to clone update submodules

git submodule update --init --recursive

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL