a Golang sdk for working with DeFi protocols, and ethereum compatible blockchains

Overview


A golang sdk for working with DeFi protocols and general utilities for working with ethereum-compatible blockchains.

packages

  • bclient
  • bindings
  • cli
  • config
  • database
  • sushiswap
  • uniswap
  • testenv
  • utils

bclient

Provides a wrapper around the ethclient package

bindings

Provides code generated by abigen for working with smart contracts:

  • bindings/erc20 provides generated code for working with ERC20 contracts
  • bindings/oneinch/v2 provides generated code for working with OneInch V2 router contracts
  • bindings/oneinch/v3 provides generated code for working with OneInch V3 router contracts
  • unicrypt/presalefactory provides generated code for working with UniCrypt presale factories
  • uniswap/* provides generated code for working with Uniswap V2 contracts (note these can also be used for working with the corresponding sushiswap contracts)

cli

cli package

config

configuration management package

database

database management packlage

sushiswap

Wrapper around go-ethereum's ethclient package for using sushiswap v2.

uniswap

Wrapper around go-ethereum's ethclient package for using uniswap v2.

testenv

Provides a wrapper around the SimulatedBackend allowing for an in-memory blockchain. It is particularly useful for local smart contract development, or developing backend dApps.

utils

Provides utility functions including all goethereum book utils, a helper to make bind.TransactOpts safe for concurrent use, as well as a general Blockchain interface that satisfies all functions provided by simulated backend, as well as ethclient which is useful for drop-in replacement of actual RPC clients, and test environments.

examples

transaction matching

$> /go-defi txm --methods transfer --methods transferFrom --methods buy --contract.address 0x5ade7aE8660293F2ebfcEfaba91d141d72d221e8
Issues
  • add errors.Wrap to have better error tracing

    add errors.Wrap to have better error tracing

    I like your package but saw that sometimes you just return the err directly instead of wrapping it. This makes it harder to see where the error is coming from. This is why I created this pull request to have this improved.

    opened by maedu 0
  • Transaction Matching

    Transaction Matching

    Adds the ability to filter transactions to particular contract addresses and ABIs. This can be used to filter out all addresses that interacted with a particular contract using particular ABI methods. For example given an ERC20 contract and a range of blocks, you can find all addresses that invoked transfer, transferFrom, and approval methods within the specified block range.

    This also fixes a bug with incorrectly loading configuration file from disk.

    opened by bonedaddy 0
  • Refactor To Use Blockchain Interface And Configuration Changes

    Refactor To Use Blockchain Interface And Configuration Changes

    Refactors code to use utils.Blockchain instead of ethclient.Client, also updates the configuration to enable specifying simulated blockchain (in-memory), as well as include account configuration.

    opened by bonedaddy 0
  • Uniswap V3 Integration (WIP)

    Uniswap V3 Integration (WIP)

    Changes

    • Breakup uniswap functionality into two packages a uniswap/v2 and univswap/v3 package.
    • Enable deploying complete uniswap v3 to simulated backend for testing

    TODO

    More robust copying of uniswap core abis and bins

    Right now to get it done quickly im copying the bytecode manually but it would be better to do it more automatically

    https://github.com/wighawag/hardhat-deploy#access-to-artifacts-non-deployed-contract-code-and-abi

    Delete uniswap v3 submodules

    Remove uniswap v3 submodules

    opened by bonedaddy 2
Releases(v0.0.4)
Owner
bonedaddy
you're always in somebody's school
bonedaddy
Ethereum go-ethereum - Official Golang implementation of the Ethereum protocol

Go Ethereum Official Golang implementation of the Ethereum protocol. Automated b

null 6 Feb 17, 2022
Signing, Keystore and RLP encoding utilities for EVM / Ethereum / secp256k1 based blockchains

Signing, Keystore and RLP encoding utilities for EVM / Ethereum / secp256k1 based blockchains. Written in Go with an enterprise friendly Apache 2.0 license, and a runtime JSON/RPC proxy server. Part of the Hyperledger FireFly project

Hyperledger 2 May 12, 2022
ConsenSys Software 8 Jan 18, 2022
Go-ethereum - Official Golang implementation of the Ethereum protocol

Go Ethereum Official Golang implementation of the Ethereum protocol. Automated b

i06 0 Jan 4, 2022
Evmos is a scalable, high-throughput Proof-of-Stake blockchain that is fully compatible and interoperable with Ethereum.

Evmos Evmos is a scalable, high-throughput Proof-of-Stake blockchain that is fully compatible and interoperable with Ethereum. It's built using the Co

Tharsis 1.3k Jun 22, 2022
LEO (Low Ethereum Orbit) is an Ethereum Portal Network client.

LEO LEO (Low Ethereum Orbit) is an Ethereum Portal Network client. What makes LEO different from other Portal Network clients is that it uses libp2p f

Valist, Inc. 10 Apr 19, 2022
Ethereum-vanity-wallet - A fork of https://github.com/meehow/ethereum-vanity-wallet but the key can be exported to a JSON keystore file

ethereum-vanity-wallet See https://github.com/meehow/ethereum-vanity-wallet This version: doesn't display the private key let's you interactively expo

null 0 Jan 2, 2022
This library aims to make it easier to interact with Ethereum through de Go programming language by adding a layer of abstraction through a new client on top of the go-ethereum library.

Simple ethereum client Simple ethereum client aims to make it easier for the developers to interact with Ethereum through a new layer of abstraction t

Jero 3 May 1, 2022
Ethermint is a scalable and interoperable Ethereum library, built on Proof-of-Stake with fast-finality using the Cosmos SDK.

Ethermint Ethermint is a scalable and interoperable Ethereum library, built on Proof-of-Stake with fast-finality using the Cosmos SDK which runs on to

Tharsis 1.6k Jun 22, 2022
A blockchains platform with high throughput, and blazing fast transactions

Node implementation for the Avalanche network - a blockchains platform with high throughput, and blazing fast transactions. Installation Avalanche is

null 1 Oct 31, 2021
A naive and simple implementation of blockchains.

naivechain A naive and simple implementation of blockchains. Build And Run Download and compile go get -v github.com/kofj/naivechain Start First Node

疯魔慕薇 312 Jun 11, 2022
Dijetsnetgo: a blockchains platform with high throughput, and blazing fast transactions

Node implementation for the Avalanche network - a blockchains platform with high

Dijets 0 Jan 18, 2022
Avalanche: a network composed of multiple blockchains

Coreth and the C-Chain Avalanche is a network composed of multiple blockchains.

Ava Labs 110 Jun 18, 2022
A Verifyable Chain Relay for Proof of Stake Blockchains

A Verifyable Chain Relay for Proof of Stake Blockchains This repository contains

null 3 Feb 21, 2022
A collection about awesome blockchains

A collection about awesome blockchains - open distributed public databases w/ crypto hashes incl. git ;-). Blockchains are the new tulips :tulip::tulip::tulip:. Distributed is the new centralized.

Blockchain! Blockchain! Blockchain! 3.5k Jun 24, 2022
Official Golang implementation of the Ethereum protocol

Go Ethereum Official Golang implementation of the Ethereum protocol. Automated builds are available for stable releases and the unstable master branch

StarWORKS Global 0 Nov 24, 2021
Ethconvert: Ethereum unit converter written in golang

ethconvert Ethereum unit converter written in go. Install go get github.com/jon4

Jonah 0 Dec 18, 2021