https://github.com/ddaws/go-maker
Golang bindings to the Multi-Colatoral Dai stablecoin system
https://github.com/ddaws/go-maker
dai golang-library golang-package makerdao
Last synced: 5 months ago
JSON representation
Golang bindings to the Multi-Colatoral Dai stablecoin system
- Host: GitHub
- URL: https://github.com/ddaws/go-maker
- Owner: ddaws
- License: mit
- Created: 2020-03-03T08:10:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-09-06T19:53:40.000Z (over 2 years ago)
- Last Synced: 2024-10-19T23:22:51.149Z (over 1 year ago)
- Topics: dai, golang-library, golang-package, makerdao
- Language: Go
- Homepage: https://pkg.go.dev/github.com/ddaws/go-maker/maker?tab=overview
- Size: 193 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
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
```go
// 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
- [x] Flip
- [x] Flop
- [ ] Join
- [x] Jug
- [ ] Lib
- [x] Pot
- [ ] Spot
- [x] 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
```bash
git submodule update --init --recursive
```