├── .env.example ├── .github └── workflows │ └── checks.yml ├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── assets ├── gopher.png ├── gopher2.png └── nobg-gopher.png ├── flashbots ├── README.md ├── simulate │ ├── dai │ │ ├── dai.abi │ │ └── dai.go │ ├── go.mod │ ├── go.sum │ ├── main.go │ └── some_test.go └── stats │ └── main.go ├── state ├── dai.abi ├── dai.go ├── go.mod ├── go.sum └── main.go └── tracer ├── go.mod ├── go.sum └── main.go /.env.example: -------------------------------------------------------------------------------- 1 | ETH_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/ 2 | -------------------------------------------------------------------------------- /.github/workflows/checks.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | on: [push] 3 | env: 4 | ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }} 5 | jobs: 6 | tracer-tests: 7 | runs-on: ubuntu-latest 8 | defaults: 9 | run: 10 | working-directory: ./tracer 11 | steps: 12 | - uses: actions/checkout@v3 13 | - uses: actions/setup-go@v3 14 | - name: tests 15 | run: go test -timeout=30s . 16 | - name: benchmarks 17 | run: go test -bench=. . 18 | - name: lint 19 | uses: docker://morphy/revive-action:v2 20 | - name: vet 21 | run: go vet . 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Environment Variables 15 | .env 16 | .env.prod 17 | 18 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "go-ethereum"] 2 | path = go-ethereum 3 | url = https://github.com/ethereum/go-ethereum 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 asnared 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # geth-x • [![goreport](https://goreportcard.com/badge/github.com/abigger87/geth-x)](https://goreportcard.com/report/github.com/abigger87/geth-x) [![godocs](https://godoc.org/github.com/abigger87/geth-x?status.svg)](https://godoc.org/github.com/abigger87/geth-x) [![ci](https://github.com/abigger87/geth-x/actions/workflows/checks.yml/badge.svg)](https://github.com/abigger87/geth-x/actions/workflows/checks.yml) 4 | 5 | [go-ethereum](https://github.com/ethereum/go-ethereum) examples, trickery, and tomfoolery [with breakage]. 6 | 7 | > **Note** 8 | > 9 | > This is heavily inspired by [libevm](https://github.com/libevm)'s [geth-examples](https://github.com/libevm/geth-examples). 10 | > 11 | > _I am but a humble searcher, standing on the shoulders of giants._ 12 | 13 | ### Getting Started 14 | 15 | These examples presume you have a working knowledge of the go-ethereum codebase. To get up to speed, review [go-ethereum](https://github.com/ethereum/go-ethereum). 16 | 17 | // TODO: mermaid state diagram of interacting with geth 18 | 19 | // TODO: further examples 20 | 21 | // TODO: benchmarks 22 | 23 | ### Licensing and Contributing 24 | 25 | All contributions are highly welcomed. 26 | 27 | Licensed under [MIT](https://github.com/abigger87/geth-x/blob/main/LICENSE) - adapt, fork, copy, go wild! 28 | 29 | Good luck, searcher 🫡 30 | -------------------------------------------------------------------------------- /assets/gopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/refcell/geth-x/6c2a5d43fc8a9257206ba005f6bfdc92c52f6093/assets/gopher.png -------------------------------------------------------------------------------- /assets/gopher2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/refcell/geth-x/6c2a5d43fc8a9257206ba005f6bfdc92c52f6093/assets/gopher2.png -------------------------------------------------------------------------------- /assets/nobg-gopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/refcell/geth-x/6c2a5d43fc8a9257206ba005f6bfdc92c52f6093/assets/nobg-gopher.png -------------------------------------------------------------------------------- /flashbots/README.md: -------------------------------------------------------------------------------- 1 | 2 | See: [metachris/flashbotsrpc](https://github.com/metachris/flashbotsrpc/blob/master/examples) 3 | 4 | 5 | -------------------------------------------------------------------------------- /flashbots/simulate/dai/dai.abi: -------------------------------------------------------------------------------- 1 | [{"inputs":[{"internalType":"uint256","name":"chainId_","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"src","type":"address"},{"indexed":true,"internalType":"address","name":"guy","type":"address"},{"indexed":false,"internalType":"uint256","name":"wad","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"internalType":"bytes4","name":"sig","type":"bytes4"},{"indexed":true,"internalType":"address","name":"usr","type":"address"},{"indexed":true,"internalType":"bytes32","name":"arg1","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"arg2","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"LogNote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"src","type":"address"},{"indexed":true,"internalType":"address","name":"dst","type":"address"},{"indexed":false,"internalType":"uint256","name":"wad","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"move","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"holder","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"bool","name":"allowed","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"pull","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"push","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"wards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}] 2 | -------------------------------------------------------------------------------- /flashbots/simulate/dai/dai.go: -------------------------------------------------------------------------------- 1 | // Code generated - DO NOT EDIT. 2 | // This file is a generated binding and any manual changes will be lost. 3 | 4 | package dai 5 | 6 | import ( 7 | "errors" 8 | "math/big" 9 | "strings" 10 | 11 | ethereum "github.com/ethereum/go-ethereum" 12 | "github.com/ethereum/go-ethereum/accounts/abi" 13 | "github.com/ethereum/go-ethereum/accounts/abi/bind" 14 | "github.com/ethereum/go-ethereum/common" 15 | "github.com/ethereum/go-ethereum/core/types" 16 | "github.com/ethereum/go-ethereum/event" 17 | ) 18 | 19 | // Reference imports to suppress errors if they are not otherwise used. 20 | var ( 21 | _ = errors.New 22 | _ = big.NewInt 23 | _ = strings.NewReader 24 | _ = ethereum.NotFound 25 | _ = bind.Bind 26 | _ = common.Big1 27 | _ = types.BloomLookup 28 | _ = event.NewSubscription 29 | ) 30 | 31 | // DaiMetaData contains all meta data concerning the Dai contract. 32 | var DaiMetaData = &bind.MetaData{ 33 | ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId_\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":true,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sig\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"arg1\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"arg2\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"LogNote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"}],\"name\":\"deny\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"move\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"holder\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"pull\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"push\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"}],\"name\":\"rely\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"wards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]", 34 | } 35 | 36 | // DaiABI is the input ABI used to generate the binding from. 37 | // Deprecated: Use DaiMetaData.ABI instead. 38 | var DaiABI = DaiMetaData.ABI 39 | 40 | // Dai is an auto generated Go binding around an Ethereum contract. 41 | type Dai struct { 42 | DaiCaller // Read-only binding to the contract 43 | DaiTransactor // Write-only binding to the contract 44 | DaiFilterer // Log filterer for contract events 45 | } 46 | 47 | // DaiCaller is an auto generated read-only Go binding around an Ethereum contract. 48 | type DaiCaller struct { 49 | contract *bind.BoundContract // Generic contract wrapper for the low level calls 50 | } 51 | 52 | // DaiTransactor is an auto generated write-only Go binding around an Ethereum contract. 53 | type DaiTransactor struct { 54 | contract *bind.BoundContract // Generic contract wrapper for the low level calls 55 | } 56 | 57 | // DaiFilterer is an auto generated log filtering Go binding around an Ethereum contract events. 58 | type DaiFilterer struct { 59 | contract *bind.BoundContract // Generic contract wrapper for the low level calls 60 | } 61 | 62 | // DaiSession is an auto generated Go binding around an Ethereum contract, 63 | // with pre-set call and transact options. 64 | type DaiSession struct { 65 | Contract *Dai // Generic contract binding to set the session for 66 | CallOpts bind.CallOpts // Call options to use throughout this session 67 | TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 68 | } 69 | 70 | // DaiCallerSession is an auto generated read-only Go binding around an Ethereum contract, 71 | // with pre-set call options. 72 | type DaiCallerSession struct { 73 | Contract *DaiCaller // Generic contract caller binding to set the session for 74 | CallOpts bind.CallOpts // Call options to use throughout this session 75 | } 76 | 77 | // DaiTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 78 | // with pre-set transact options. 79 | type DaiTransactorSession struct { 80 | Contract *DaiTransactor // Generic contract transactor binding to set the session for 81 | TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 82 | } 83 | 84 | // DaiRaw is an auto generated low-level Go binding around an Ethereum contract. 85 | type DaiRaw struct { 86 | Contract *Dai // Generic contract binding to access the raw methods on 87 | } 88 | 89 | // DaiCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 90 | type DaiCallerRaw struct { 91 | Contract *DaiCaller // Generic read-only contract binding to access the raw methods on 92 | } 93 | 94 | // DaiTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 95 | type DaiTransactorRaw struct { 96 | Contract *DaiTransactor // Generic write-only contract binding to access the raw methods on 97 | } 98 | 99 | // NewDai creates a new instance of Dai, bound to a specific deployed contract. 100 | func NewDai(address common.Address, backend bind.ContractBackend) (*Dai, error) { 101 | contract, err := bindDai(address, backend, backend, backend) 102 | if err != nil { 103 | return nil, err 104 | } 105 | return &Dai{DaiCaller: DaiCaller{contract: contract}, DaiTransactor: DaiTransactor{contract: contract}, DaiFilterer: DaiFilterer{contract: contract}}, nil 106 | } 107 | 108 | // NewDaiCaller creates a new read-only instance of Dai, bound to a specific deployed contract. 109 | func NewDaiCaller(address common.Address, caller bind.ContractCaller) (*DaiCaller, error) { 110 | contract, err := bindDai(address, caller, nil, nil) 111 | if err != nil { 112 | return nil, err 113 | } 114 | return &DaiCaller{contract: contract}, nil 115 | } 116 | 117 | // NewDaiTransactor creates a new write-only instance of Dai, bound to a specific deployed contract. 118 | func NewDaiTransactor(address common.Address, transactor bind.ContractTransactor) (*DaiTransactor, error) { 119 | contract, err := bindDai(address, nil, transactor, nil) 120 | if err != nil { 121 | return nil, err 122 | } 123 | return &DaiTransactor{contract: contract}, nil 124 | } 125 | 126 | // NewDaiFilterer creates a new log filterer instance of Dai, bound to a specific deployed contract. 127 | func NewDaiFilterer(address common.Address, filterer bind.ContractFilterer) (*DaiFilterer, error) { 128 | contract, err := bindDai(address, nil, nil, filterer) 129 | if err != nil { 130 | return nil, err 131 | } 132 | return &DaiFilterer{contract: contract}, nil 133 | } 134 | 135 | // bindDai binds a generic wrapper to an already deployed contract. 136 | func bindDai(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 137 | parsed, err := abi.JSON(strings.NewReader(DaiABI)) 138 | if err != nil { 139 | return nil, err 140 | } 141 | return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil 142 | } 143 | 144 | // Call invokes the (constant) contract method with params as input values and 145 | // sets the output to result. The result type might be a single field for simple 146 | // returns, a slice of interfaces for anonymous returns and a struct for named 147 | // returns. 148 | func (_Dai *DaiRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 149 | return _Dai.Contract.DaiCaller.contract.Call(opts, result, method, params...) 150 | } 151 | 152 | // Transfer initiates a plain transaction to move funds to the contract, calling 153 | // its default method if one is available. 154 | func (_Dai *DaiRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 155 | return _Dai.Contract.DaiTransactor.contract.Transfer(opts) 156 | } 157 | 158 | // Transact invokes the (paid) contract method with params as input values. 159 | func (_Dai *DaiRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 160 | return _Dai.Contract.DaiTransactor.contract.Transact(opts, method, params...) 161 | } 162 | 163 | // Call invokes the (constant) contract method with params as input values and 164 | // sets the output to result. The result type might be a single field for simple 165 | // returns, a slice of interfaces for anonymous returns and a struct for named 166 | // returns. 167 | func (_Dai *DaiCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 168 | return _Dai.Contract.contract.Call(opts, result, method, params...) 169 | } 170 | 171 | // Transfer initiates a plain transaction to move funds to the contract, calling 172 | // its default method if one is available. 173 | func (_Dai *DaiTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 174 | return _Dai.Contract.contract.Transfer(opts) 175 | } 176 | 177 | // Transact invokes the (paid) contract method with params as input values. 178 | func (_Dai *DaiTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 179 | return _Dai.Contract.contract.Transact(opts, method, params...) 180 | } 181 | 182 | // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. 183 | // 184 | // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) 185 | func (_Dai *DaiCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { 186 | var out []interface{} 187 | err := _Dai.contract.Call(opts, &out, "DOMAIN_SEPARATOR") 188 | 189 | if err != nil { 190 | return *new([32]byte), err 191 | } 192 | 193 | out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) 194 | 195 | return out0, err 196 | 197 | } 198 | 199 | // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. 200 | // 201 | // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) 202 | func (_Dai *DaiSession) DOMAINSEPARATOR() ([32]byte, error) { 203 | return _Dai.Contract.DOMAINSEPARATOR(&_Dai.CallOpts) 204 | } 205 | 206 | // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. 207 | // 208 | // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) 209 | func (_Dai *DaiCallerSession) DOMAINSEPARATOR() ([32]byte, error) { 210 | return _Dai.Contract.DOMAINSEPARATOR(&_Dai.CallOpts) 211 | } 212 | 213 | // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. 214 | // 215 | // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) 216 | func (_Dai *DaiCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { 217 | var out []interface{} 218 | err := _Dai.contract.Call(opts, &out, "PERMIT_TYPEHASH") 219 | 220 | if err != nil { 221 | return *new([32]byte), err 222 | } 223 | 224 | out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) 225 | 226 | return out0, err 227 | 228 | } 229 | 230 | // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. 231 | // 232 | // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) 233 | func (_Dai *DaiSession) PERMITTYPEHASH() ([32]byte, error) { 234 | return _Dai.Contract.PERMITTYPEHASH(&_Dai.CallOpts) 235 | } 236 | 237 | // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. 238 | // 239 | // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) 240 | func (_Dai *DaiCallerSession) PERMITTYPEHASH() ([32]byte, error) { 241 | return _Dai.Contract.PERMITTYPEHASH(&_Dai.CallOpts) 242 | } 243 | 244 | // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. 245 | // 246 | // Solidity: function allowance(address , address ) view returns(uint256) 247 | func (_Dai *DaiCaller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { 248 | var out []interface{} 249 | err := _Dai.contract.Call(opts, &out, "allowance", arg0, arg1) 250 | 251 | if err != nil { 252 | return *new(*big.Int), err 253 | } 254 | 255 | out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 256 | 257 | return out0, err 258 | 259 | } 260 | 261 | // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. 262 | // 263 | // Solidity: function allowance(address , address ) view returns(uint256) 264 | func (_Dai *DaiSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { 265 | return _Dai.Contract.Allowance(&_Dai.CallOpts, arg0, arg1) 266 | } 267 | 268 | // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. 269 | // 270 | // Solidity: function allowance(address , address ) view returns(uint256) 271 | func (_Dai *DaiCallerSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { 272 | return _Dai.Contract.Allowance(&_Dai.CallOpts, arg0, arg1) 273 | } 274 | 275 | // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 276 | // 277 | // Solidity: function balanceOf(address ) view returns(uint256) 278 | func (_Dai *DaiCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { 279 | var out []interface{} 280 | err := _Dai.contract.Call(opts, &out, "balanceOf", arg0) 281 | 282 | if err != nil { 283 | return *new(*big.Int), err 284 | } 285 | 286 | out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 287 | 288 | return out0, err 289 | 290 | } 291 | 292 | // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 293 | // 294 | // Solidity: function balanceOf(address ) view returns(uint256) 295 | func (_Dai *DaiSession) BalanceOf(arg0 common.Address) (*big.Int, error) { 296 | return _Dai.Contract.BalanceOf(&_Dai.CallOpts, arg0) 297 | } 298 | 299 | // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 300 | // 301 | // Solidity: function balanceOf(address ) view returns(uint256) 302 | func (_Dai *DaiCallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { 303 | return _Dai.Contract.BalanceOf(&_Dai.CallOpts, arg0) 304 | } 305 | 306 | // Decimals is a free data retrieval call binding the contract method 0x313ce567. 307 | // 308 | // Solidity: function decimals() view returns(uint8) 309 | func (_Dai *DaiCaller) Decimals(opts *bind.CallOpts) (uint8, error) { 310 | var out []interface{} 311 | err := _Dai.contract.Call(opts, &out, "decimals") 312 | 313 | if err != nil { 314 | return *new(uint8), err 315 | } 316 | 317 | out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) 318 | 319 | return out0, err 320 | 321 | } 322 | 323 | // Decimals is a free data retrieval call binding the contract method 0x313ce567. 324 | // 325 | // Solidity: function decimals() view returns(uint8) 326 | func (_Dai *DaiSession) Decimals() (uint8, error) { 327 | return _Dai.Contract.Decimals(&_Dai.CallOpts) 328 | } 329 | 330 | // Decimals is a free data retrieval call binding the contract method 0x313ce567. 331 | // 332 | // Solidity: function decimals() view returns(uint8) 333 | func (_Dai *DaiCallerSession) Decimals() (uint8, error) { 334 | return _Dai.Contract.Decimals(&_Dai.CallOpts) 335 | } 336 | 337 | // Name is a free data retrieval call binding the contract method 0x06fdde03. 338 | // 339 | // Solidity: function name() view returns(string) 340 | func (_Dai *DaiCaller) Name(opts *bind.CallOpts) (string, error) { 341 | var out []interface{} 342 | err := _Dai.contract.Call(opts, &out, "name") 343 | 344 | if err != nil { 345 | return *new(string), err 346 | } 347 | 348 | out0 := *abi.ConvertType(out[0], new(string)).(*string) 349 | 350 | return out0, err 351 | 352 | } 353 | 354 | // Name is a free data retrieval call binding the contract method 0x06fdde03. 355 | // 356 | // Solidity: function name() view returns(string) 357 | func (_Dai *DaiSession) Name() (string, error) { 358 | return _Dai.Contract.Name(&_Dai.CallOpts) 359 | } 360 | 361 | // Name is a free data retrieval call binding the contract method 0x06fdde03. 362 | // 363 | // Solidity: function name() view returns(string) 364 | func (_Dai *DaiCallerSession) Name() (string, error) { 365 | return _Dai.Contract.Name(&_Dai.CallOpts) 366 | } 367 | 368 | // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. 369 | // 370 | // Solidity: function nonces(address ) view returns(uint256) 371 | func (_Dai *DaiCaller) Nonces(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { 372 | var out []interface{} 373 | err := _Dai.contract.Call(opts, &out, "nonces", arg0) 374 | 375 | if err != nil { 376 | return *new(*big.Int), err 377 | } 378 | 379 | out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 380 | 381 | return out0, err 382 | 383 | } 384 | 385 | // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. 386 | // 387 | // Solidity: function nonces(address ) view returns(uint256) 388 | func (_Dai *DaiSession) Nonces(arg0 common.Address) (*big.Int, error) { 389 | return _Dai.Contract.Nonces(&_Dai.CallOpts, arg0) 390 | } 391 | 392 | // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. 393 | // 394 | // Solidity: function nonces(address ) view returns(uint256) 395 | func (_Dai *DaiCallerSession) Nonces(arg0 common.Address) (*big.Int, error) { 396 | return _Dai.Contract.Nonces(&_Dai.CallOpts, arg0) 397 | } 398 | 399 | // Symbol is a free data retrieval call binding the contract method 0x95d89b41. 400 | // 401 | // Solidity: function symbol() view returns(string) 402 | func (_Dai *DaiCaller) Symbol(opts *bind.CallOpts) (string, error) { 403 | var out []interface{} 404 | err := _Dai.contract.Call(opts, &out, "symbol") 405 | 406 | if err != nil { 407 | return *new(string), err 408 | } 409 | 410 | out0 := *abi.ConvertType(out[0], new(string)).(*string) 411 | 412 | return out0, err 413 | 414 | } 415 | 416 | // Symbol is a free data retrieval call binding the contract method 0x95d89b41. 417 | // 418 | // Solidity: function symbol() view returns(string) 419 | func (_Dai *DaiSession) Symbol() (string, error) { 420 | return _Dai.Contract.Symbol(&_Dai.CallOpts) 421 | } 422 | 423 | // Symbol is a free data retrieval call binding the contract method 0x95d89b41. 424 | // 425 | // Solidity: function symbol() view returns(string) 426 | func (_Dai *DaiCallerSession) Symbol() (string, error) { 427 | return _Dai.Contract.Symbol(&_Dai.CallOpts) 428 | } 429 | 430 | // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. 431 | // 432 | // Solidity: function totalSupply() view returns(uint256) 433 | func (_Dai *DaiCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { 434 | var out []interface{} 435 | err := _Dai.contract.Call(opts, &out, "totalSupply") 436 | 437 | if err != nil { 438 | return *new(*big.Int), err 439 | } 440 | 441 | out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 442 | 443 | return out0, err 444 | 445 | } 446 | 447 | // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. 448 | // 449 | // Solidity: function totalSupply() view returns(uint256) 450 | func (_Dai *DaiSession) TotalSupply() (*big.Int, error) { 451 | return _Dai.Contract.TotalSupply(&_Dai.CallOpts) 452 | } 453 | 454 | // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. 455 | // 456 | // Solidity: function totalSupply() view returns(uint256) 457 | func (_Dai *DaiCallerSession) TotalSupply() (*big.Int, error) { 458 | return _Dai.Contract.TotalSupply(&_Dai.CallOpts) 459 | } 460 | 461 | // Version is a free data retrieval call binding the contract method 0x54fd4d50. 462 | // 463 | // Solidity: function version() view returns(string) 464 | func (_Dai *DaiCaller) Version(opts *bind.CallOpts) (string, error) { 465 | var out []interface{} 466 | err := _Dai.contract.Call(opts, &out, "version") 467 | 468 | if err != nil { 469 | return *new(string), err 470 | } 471 | 472 | out0 := *abi.ConvertType(out[0], new(string)).(*string) 473 | 474 | return out0, err 475 | 476 | } 477 | 478 | // Version is a free data retrieval call binding the contract method 0x54fd4d50. 479 | // 480 | // Solidity: function version() view returns(string) 481 | func (_Dai *DaiSession) Version() (string, error) { 482 | return _Dai.Contract.Version(&_Dai.CallOpts) 483 | } 484 | 485 | // Version is a free data retrieval call binding the contract method 0x54fd4d50. 486 | // 487 | // Solidity: function version() view returns(string) 488 | func (_Dai *DaiCallerSession) Version() (string, error) { 489 | return _Dai.Contract.Version(&_Dai.CallOpts) 490 | } 491 | 492 | // Wards is a free data retrieval call binding the contract method 0xbf353dbb. 493 | // 494 | // Solidity: function wards(address ) view returns(uint256) 495 | func (_Dai *DaiCaller) Wards(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { 496 | var out []interface{} 497 | err := _Dai.contract.Call(opts, &out, "wards", arg0) 498 | 499 | if err != nil { 500 | return *new(*big.Int), err 501 | } 502 | 503 | out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 504 | 505 | return out0, err 506 | 507 | } 508 | 509 | // Wards is a free data retrieval call binding the contract method 0xbf353dbb. 510 | // 511 | // Solidity: function wards(address ) view returns(uint256) 512 | func (_Dai *DaiSession) Wards(arg0 common.Address) (*big.Int, error) { 513 | return _Dai.Contract.Wards(&_Dai.CallOpts, arg0) 514 | } 515 | 516 | // Wards is a free data retrieval call binding the contract method 0xbf353dbb. 517 | // 518 | // Solidity: function wards(address ) view returns(uint256) 519 | func (_Dai *DaiCallerSession) Wards(arg0 common.Address) (*big.Int, error) { 520 | return _Dai.Contract.Wards(&_Dai.CallOpts, arg0) 521 | } 522 | 523 | // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 524 | // 525 | // Solidity: function approve(address usr, uint256 wad) returns(bool) 526 | func (_Dai *DaiTransactor) Approve(opts *bind.TransactOpts, usr common.Address, wad *big.Int) (*types.Transaction, error) { 527 | return _Dai.contract.Transact(opts, "approve", usr, wad) 528 | } 529 | 530 | // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 531 | // 532 | // Solidity: function approve(address usr, uint256 wad) returns(bool) 533 | func (_Dai *DaiSession) Approve(usr common.Address, wad *big.Int) (*types.Transaction, error) { 534 | return _Dai.Contract.Approve(&_Dai.TransactOpts, usr, wad) 535 | } 536 | 537 | // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 538 | // 539 | // Solidity: function approve(address usr, uint256 wad) returns(bool) 540 | func (_Dai *DaiTransactorSession) Approve(usr common.Address, wad *big.Int) (*types.Transaction, error) { 541 | return _Dai.Contract.Approve(&_Dai.TransactOpts, usr, wad) 542 | } 543 | 544 | // Burn is a paid mutator transaction binding the contract method 0x9dc29fac. 545 | // 546 | // Solidity: function burn(address usr, uint256 wad) returns() 547 | func (_Dai *DaiTransactor) Burn(opts *bind.TransactOpts, usr common.Address, wad *big.Int) (*types.Transaction, error) { 548 | return _Dai.contract.Transact(opts, "burn", usr, wad) 549 | } 550 | 551 | // Burn is a paid mutator transaction binding the contract method 0x9dc29fac. 552 | // 553 | // Solidity: function burn(address usr, uint256 wad) returns() 554 | func (_Dai *DaiSession) Burn(usr common.Address, wad *big.Int) (*types.Transaction, error) { 555 | return _Dai.Contract.Burn(&_Dai.TransactOpts, usr, wad) 556 | } 557 | 558 | // Burn is a paid mutator transaction binding the contract method 0x9dc29fac. 559 | // 560 | // Solidity: function burn(address usr, uint256 wad) returns() 561 | func (_Dai *DaiTransactorSession) Burn(usr common.Address, wad *big.Int) (*types.Transaction, error) { 562 | return _Dai.Contract.Burn(&_Dai.TransactOpts, usr, wad) 563 | } 564 | 565 | // Deny is a paid mutator transaction binding the contract method 0x9c52a7f1. 566 | // 567 | // Solidity: function deny(address guy) returns() 568 | func (_Dai *DaiTransactor) Deny(opts *bind.TransactOpts, guy common.Address) (*types.Transaction, error) { 569 | return _Dai.contract.Transact(opts, "deny", guy) 570 | } 571 | 572 | // Deny is a paid mutator transaction binding the contract method 0x9c52a7f1. 573 | // 574 | // Solidity: function deny(address guy) returns() 575 | func (_Dai *DaiSession) Deny(guy common.Address) (*types.Transaction, error) { 576 | return _Dai.Contract.Deny(&_Dai.TransactOpts, guy) 577 | } 578 | 579 | // Deny is a paid mutator transaction binding the contract method 0x9c52a7f1. 580 | // 581 | // Solidity: function deny(address guy) returns() 582 | func (_Dai *DaiTransactorSession) Deny(guy common.Address) (*types.Transaction, error) { 583 | return _Dai.Contract.Deny(&_Dai.TransactOpts, guy) 584 | } 585 | 586 | // Mint is a paid mutator transaction binding the contract method 0x40c10f19. 587 | // 588 | // Solidity: function mint(address usr, uint256 wad) returns() 589 | func (_Dai *DaiTransactor) Mint(opts *bind.TransactOpts, usr common.Address, wad *big.Int) (*types.Transaction, error) { 590 | return _Dai.contract.Transact(opts, "mint", usr, wad) 591 | } 592 | 593 | // Mint is a paid mutator transaction binding the contract method 0x40c10f19. 594 | // 595 | // Solidity: function mint(address usr, uint256 wad) returns() 596 | func (_Dai *DaiSession) Mint(usr common.Address, wad *big.Int) (*types.Transaction, error) { 597 | return _Dai.Contract.Mint(&_Dai.TransactOpts, usr, wad) 598 | } 599 | 600 | // Mint is a paid mutator transaction binding the contract method 0x40c10f19. 601 | // 602 | // Solidity: function mint(address usr, uint256 wad) returns() 603 | func (_Dai *DaiTransactorSession) Mint(usr common.Address, wad *big.Int) (*types.Transaction, error) { 604 | return _Dai.Contract.Mint(&_Dai.TransactOpts, usr, wad) 605 | } 606 | 607 | // Move is a paid mutator transaction binding the contract method 0xbb35783b. 608 | // 609 | // Solidity: function move(address src, address dst, uint256 wad) returns() 610 | func (_Dai *DaiTransactor) Move(opts *bind.TransactOpts, src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { 611 | return _Dai.contract.Transact(opts, "move", src, dst, wad) 612 | } 613 | 614 | // Move is a paid mutator transaction binding the contract method 0xbb35783b. 615 | // 616 | // Solidity: function move(address src, address dst, uint256 wad) returns() 617 | func (_Dai *DaiSession) Move(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { 618 | return _Dai.Contract.Move(&_Dai.TransactOpts, src, dst, wad) 619 | } 620 | 621 | // Move is a paid mutator transaction binding the contract method 0xbb35783b. 622 | // 623 | // Solidity: function move(address src, address dst, uint256 wad) returns() 624 | func (_Dai *DaiTransactorSession) Move(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { 625 | return _Dai.Contract.Move(&_Dai.TransactOpts, src, dst, wad) 626 | } 627 | 628 | // Permit is a paid mutator transaction binding the contract method 0x8fcbaf0c. 629 | // 630 | // Solidity: function permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) returns() 631 | func (_Dai *DaiTransactor) Permit(opts *bind.TransactOpts, holder common.Address, spender common.Address, nonce *big.Int, expiry *big.Int, allowed bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { 632 | return _Dai.contract.Transact(opts, "permit", holder, spender, nonce, expiry, allowed, v, r, s) 633 | } 634 | 635 | // Permit is a paid mutator transaction binding the contract method 0x8fcbaf0c. 636 | // 637 | // Solidity: function permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) returns() 638 | func (_Dai *DaiSession) Permit(holder common.Address, spender common.Address, nonce *big.Int, expiry *big.Int, allowed bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { 639 | return _Dai.Contract.Permit(&_Dai.TransactOpts, holder, spender, nonce, expiry, allowed, v, r, s) 640 | } 641 | 642 | // Permit is a paid mutator transaction binding the contract method 0x8fcbaf0c. 643 | // 644 | // Solidity: function permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) returns() 645 | func (_Dai *DaiTransactorSession) Permit(holder common.Address, spender common.Address, nonce *big.Int, expiry *big.Int, allowed bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { 646 | return _Dai.Contract.Permit(&_Dai.TransactOpts, holder, spender, nonce, expiry, allowed, v, r, s) 647 | } 648 | 649 | // Pull is a paid mutator transaction binding the contract method 0xf2d5d56b. 650 | // 651 | // Solidity: function pull(address usr, uint256 wad) returns() 652 | func (_Dai *DaiTransactor) Pull(opts *bind.TransactOpts, usr common.Address, wad *big.Int) (*types.Transaction, error) { 653 | return _Dai.contract.Transact(opts, "pull", usr, wad) 654 | } 655 | 656 | // Pull is a paid mutator transaction binding the contract method 0xf2d5d56b. 657 | // 658 | // Solidity: function pull(address usr, uint256 wad) returns() 659 | func (_Dai *DaiSession) Pull(usr common.Address, wad *big.Int) (*types.Transaction, error) { 660 | return _Dai.Contract.Pull(&_Dai.TransactOpts, usr, wad) 661 | } 662 | 663 | // Pull is a paid mutator transaction binding the contract method 0xf2d5d56b. 664 | // 665 | // Solidity: function pull(address usr, uint256 wad) returns() 666 | func (_Dai *DaiTransactorSession) Pull(usr common.Address, wad *big.Int) (*types.Transaction, error) { 667 | return _Dai.Contract.Pull(&_Dai.TransactOpts, usr, wad) 668 | } 669 | 670 | // Push is a paid mutator transaction binding the contract method 0xb753a98c. 671 | // 672 | // Solidity: function push(address usr, uint256 wad) returns() 673 | func (_Dai *DaiTransactor) Push(opts *bind.TransactOpts, usr common.Address, wad *big.Int) (*types.Transaction, error) { 674 | return _Dai.contract.Transact(opts, "push", usr, wad) 675 | } 676 | 677 | // Push is a paid mutator transaction binding the contract method 0xb753a98c. 678 | // 679 | // Solidity: function push(address usr, uint256 wad) returns() 680 | func (_Dai *DaiSession) Push(usr common.Address, wad *big.Int) (*types.Transaction, error) { 681 | return _Dai.Contract.Push(&_Dai.TransactOpts, usr, wad) 682 | } 683 | 684 | // Push is a paid mutator transaction binding the contract method 0xb753a98c. 685 | // 686 | // Solidity: function push(address usr, uint256 wad) returns() 687 | func (_Dai *DaiTransactorSession) Push(usr common.Address, wad *big.Int) (*types.Transaction, error) { 688 | return _Dai.Contract.Push(&_Dai.TransactOpts, usr, wad) 689 | } 690 | 691 | // Rely is a paid mutator transaction binding the contract method 0x65fae35e. 692 | // 693 | // Solidity: function rely(address guy) returns() 694 | func (_Dai *DaiTransactor) Rely(opts *bind.TransactOpts, guy common.Address) (*types.Transaction, error) { 695 | return _Dai.contract.Transact(opts, "rely", guy) 696 | } 697 | 698 | // Rely is a paid mutator transaction binding the contract method 0x65fae35e. 699 | // 700 | // Solidity: function rely(address guy) returns() 701 | func (_Dai *DaiSession) Rely(guy common.Address) (*types.Transaction, error) { 702 | return _Dai.Contract.Rely(&_Dai.TransactOpts, guy) 703 | } 704 | 705 | // Rely is a paid mutator transaction binding the contract method 0x65fae35e. 706 | // 707 | // Solidity: function rely(address guy) returns() 708 | func (_Dai *DaiTransactorSession) Rely(guy common.Address) (*types.Transaction, error) { 709 | return _Dai.Contract.Rely(&_Dai.TransactOpts, guy) 710 | } 711 | 712 | // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 713 | // 714 | // Solidity: function transfer(address dst, uint256 wad) returns(bool) 715 | func (_Dai *DaiTransactor) Transfer(opts *bind.TransactOpts, dst common.Address, wad *big.Int) (*types.Transaction, error) { 716 | return _Dai.contract.Transact(opts, "transfer", dst, wad) 717 | } 718 | 719 | // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 720 | // 721 | // Solidity: function transfer(address dst, uint256 wad) returns(bool) 722 | func (_Dai *DaiSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { 723 | return _Dai.Contract.Transfer(&_Dai.TransactOpts, dst, wad) 724 | } 725 | 726 | // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 727 | // 728 | // Solidity: function transfer(address dst, uint256 wad) returns(bool) 729 | func (_Dai *DaiTransactorSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { 730 | return _Dai.Contract.Transfer(&_Dai.TransactOpts, dst, wad) 731 | } 732 | 733 | // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 734 | // 735 | // Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) 736 | func (_Dai *DaiTransactor) TransferFrom(opts *bind.TransactOpts, src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { 737 | return _Dai.contract.Transact(opts, "transferFrom", src, dst, wad) 738 | } 739 | 740 | // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 741 | // 742 | // Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) 743 | func (_Dai *DaiSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { 744 | return _Dai.Contract.TransferFrom(&_Dai.TransactOpts, src, dst, wad) 745 | } 746 | 747 | // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 748 | // 749 | // Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) 750 | func (_Dai *DaiTransactorSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { 751 | return _Dai.Contract.TransferFrom(&_Dai.TransactOpts, src, dst, wad) 752 | } 753 | 754 | // DaiApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Dai contract. 755 | type DaiApprovalIterator struct { 756 | Event *DaiApproval // Event containing the contract specifics and raw log 757 | 758 | contract *bind.BoundContract // Generic contract to use for unpacking event data 759 | event string // Event name to use for unpacking event data 760 | 761 | logs chan types.Log // Log channel receiving the found contract events 762 | sub ethereum.Subscription // Subscription for errors, completion and termination 763 | done bool // Whether the subscription completed delivering logs 764 | fail error // Occurred error to stop iteration 765 | } 766 | 767 | // Next advances the iterator to the subsequent event, returning whether there 768 | // are any more events found. In case of a retrieval or parsing error, false is 769 | // returned and Error() can be queried for the exact failure. 770 | func (it *DaiApprovalIterator) Next() bool { 771 | // If the iterator failed, stop iterating 772 | if it.fail != nil { 773 | return false 774 | } 775 | // If the iterator completed, deliver directly whatever's available 776 | if it.done { 777 | select { 778 | case log := <-it.logs: 779 | it.Event = new(DaiApproval) 780 | if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 781 | it.fail = err 782 | return false 783 | } 784 | it.Event.Raw = log 785 | return true 786 | 787 | default: 788 | return false 789 | } 790 | } 791 | // Iterator still in progress, wait for either a data or an error event 792 | select { 793 | case log := <-it.logs: 794 | it.Event = new(DaiApproval) 795 | if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 796 | it.fail = err 797 | return false 798 | } 799 | it.Event.Raw = log 800 | return true 801 | 802 | case err := <-it.sub.Err(): 803 | it.done = true 804 | it.fail = err 805 | return it.Next() 806 | } 807 | } 808 | 809 | // Error returns any retrieval or parsing error occurred during filtering. 810 | func (it *DaiApprovalIterator) Error() error { 811 | return it.fail 812 | } 813 | 814 | // Close terminates the iteration process, releasing any pending underlying 815 | // resources. 816 | func (it *DaiApprovalIterator) Close() error { 817 | it.sub.Unsubscribe() 818 | return nil 819 | } 820 | 821 | // DaiApproval represents a Approval event raised by the Dai contract. 822 | type DaiApproval struct { 823 | Src common.Address 824 | Guy common.Address 825 | Wad *big.Int 826 | Raw types.Log // Blockchain specific contextual infos 827 | } 828 | 829 | // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 830 | // 831 | // Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) 832 | func (_Dai *DaiFilterer) FilterApproval(opts *bind.FilterOpts, src []common.Address, guy []common.Address) (*DaiApprovalIterator, error) { 833 | 834 | var srcRule []interface{} 835 | for _, srcItem := range src { 836 | srcRule = append(srcRule, srcItem) 837 | } 838 | var guyRule []interface{} 839 | for _, guyItem := range guy { 840 | guyRule = append(guyRule, guyItem) 841 | } 842 | 843 | logs, sub, err := _Dai.contract.FilterLogs(opts, "Approval", srcRule, guyRule) 844 | if err != nil { 845 | return nil, err 846 | } 847 | return &DaiApprovalIterator{contract: _Dai.contract, event: "Approval", logs: logs, sub: sub}, nil 848 | } 849 | 850 | // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 851 | // 852 | // Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) 853 | func (_Dai *DaiFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *DaiApproval, src []common.Address, guy []common.Address) (event.Subscription, error) { 854 | 855 | var srcRule []interface{} 856 | for _, srcItem := range src { 857 | srcRule = append(srcRule, srcItem) 858 | } 859 | var guyRule []interface{} 860 | for _, guyItem := range guy { 861 | guyRule = append(guyRule, guyItem) 862 | } 863 | 864 | logs, sub, err := _Dai.contract.WatchLogs(opts, "Approval", srcRule, guyRule) 865 | if err != nil { 866 | return nil, err 867 | } 868 | return event.NewSubscription(func(quit <-chan struct{}) error { 869 | defer sub.Unsubscribe() 870 | for { 871 | select { 872 | case log := <-logs: 873 | // New log arrived, parse the event and forward to the user 874 | event := new(DaiApproval) 875 | if err := _Dai.contract.UnpackLog(event, "Approval", log); err != nil { 876 | return err 877 | } 878 | event.Raw = log 879 | 880 | select { 881 | case sink <- event: 882 | case err := <-sub.Err(): 883 | return err 884 | case <-quit: 885 | return nil 886 | } 887 | case err := <-sub.Err(): 888 | return err 889 | case <-quit: 890 | return nil 891 | } 892 | } 893 | }), nil 894 | } 895 | 896 | // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 897 | // 898 | // Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) 899 | func (_Dai *DaiFilterer) ParseApproval(log types.Log) (*DaiApproval, error) { 900 | event := new(DaiApproval) 901 | if err := _Dai.contract.UnpackLog(event, "Approval", log); err != nil { 902 | return nil, err 903 | } 904 | event.Raw = log 905 | return event, nil 906 | } 907 | 908 | // DaiTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Dai contract. 909 | type DaiTransferIterator struct { 910 | Event *DaiTransfer // Event containing the contract specifics and raw log 911 | 912 | contract *bind.BoundContract // Generic contract to use for unpacking event data 913 | event string // Event name to use for unpacking event data 914 | 915 | logs chan types.Log // Log channel receiving the found contract events 916 | sub ethereum.Subscription // Subscription for errors, completion and termination 917 | done bool // Whether the subscription completed delivering logs 918 | fail error // Occurred error to stop iteration 919 | } 920 | 921 | // Next advances the iterator to the subsequent event, returning whether there 922 | // are any more events found. In case of a retrieval or parsing error, false is 923 | // returned and Error() can be queried for the exact failure. 924 | func (it *DaiTransferIterator) Next() bool { 925 | // If the iterator failed, stop iterating 926 | if it.fail != nil { 927 | return false 928 | } 929 | // If the iterator completed, deliver directly whatever's available 930 | if it.done { 931 | select { 932 | case log := <-it.logs: 933 | it.Event = new(DaiTransfer) 934 | if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 935 | it.fail = err 936 | return false 937 | } 938 | it.Event.Raw = log 939 | return true 940 | 941 | default: 942 | return false 943 | } 944 | } 945 | // Iterator still in progress, wait for either a data or an error event 946 | select { 947 | case log := <-it.logs: 948 | it.Event = new(DaiTransfer) 949 | if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 950 | it.fail = err 951 | return false 952 | } 953 | it.Event.Raw = log 954 | return true 955 | 956 | case err := <-it.sub.Err(): 957 | it.done = true 958 | it.fail = err 959 | return it.Next() 960 | } 961 | } 962 | 963 | // Error returns any retrieval or parsing error occurred during filtering. 964 | func (it *DaiTransferIterator) Error() error { 965 | return it.fail 966 | } 967 | 968 | // Close terminates the iteration process, releasing any pending underlying 969 | // resources. 970 | func (it *DaiTransferIterator) Close() error { 971 | it.sub.Unsubscribe() 972 | return nil 973 | } 974 | 975 | // DaiTransfer represents a Transfer event raised by the Dai contract. 976 | type DaiTransfer struct { 977 | Src common.Address 978 | Dst common.Address 979 | Wad *big.Int 980 | Raw types.Log // Blockchain specific contextual infos 981 | } 982 | 983 | // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 984 | // 985 | // Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) 986 | func (_Dai *DaiFilterer) FilterTransfer(opts *bind.FilterOpts, src []common.Address, dst []common.Address) (*DaiTransferIterator, error) { 987 | 988 | var srcRule []interface{} 989 | for _, srcItem := range src { 990 | srcRule = append(srcRule, srcItem) 991 | } 992 | var dstRule []interface{} 993 | for _, dstItem := range dst { 994 | dstRule = append(dstRule, dstItem) 995 | } 996 | 997 | logs, sub, err := _Dai.contract.FilterLogs(opts, "Transfer", srcRule, dstRule) 998 | if err != nil { 999 | return nil, err 1000 | } 1001 | return &DaiTransferIterator{contract: _Dai.contract, event: "Transfer", logs: logs, sub: sub}, nil 1002 | } 1003 | 1004 | // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 1005 | // 1006 | // Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) 1007 | func (_Dai *DaiFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *DaiTransfer, src []common.Address, dst []common.Address) (event.Subscription, error) { 1008 | 1009 | var srcRule []interface{} 1010 | for _, srcItem := range src { 1011 | srcRule = append(srcRule, srcItem) 1012 | } 1013 | var dstRule []interface{} 1014 | for _, dstItem := range dst { 1015 | dstRule = append(dstRule, dstItem) 1016 | } 1017 | 1018 | logs, sub, err := _Dai.contract.WatchLogs(opts, "Transfer", srcRule, dstRule) 1019 | if err != nil { 1020 | return nil, err 1021 | } 1022 | return event.NewSubscription(func(quit <-chan struct{}) error { 1023 | defer sub.Unsubscribe() 1024 | for { 1025 | select { 1026 | case log := <-logs: 1027 | // New log arrived, parse the event and forward to the user 1028 | event := new(DaiTransfer) 1029 | if err := _Dai.contract.UnpackLog(event, "Transfer", log); err != nil { 1030 | return err 1031 | } 1032 | event.Raw = log 1033 | 1034 | select { 1035 | case sink <- event: 1036 | case err := <-sub.Err(): 1037 | return err 1038 | case <-quit: 1039 | return nil 1040 | } 1041 | case err := <-sub.Err(): 1042 | return err 1043 | case <-quit: 1044 | return nil 1045 | } 1046 | } 1047 | }), nil 1048 | } 1049 | 1050 | // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 1051 | // 1052 | // Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) 1053 | func (_Dai *DaiFilterer) ParseTransfer(log types.Log) (*DaiTransfer, error) { 1054 | event := new(DaiTransfer) 1055 | if err := _Dai.contract.UnpackLog(event, "Transfer", log); err != nil { 1056 | return nil, err 1057 | } 1058 | event.Raw = log 1059 | return event, nil 1060 | } 1061 | -------------------------------------------------------------------------------- /flashbots/simulate/go.mod: -------------------------------------------------------------------------------- 1 | module simulate 2 | 3 | go 1.19 4 | 5 | require ( 6 | github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 7 | github.com/ethereum/go-ethereum v1.10.26 8 | github.com/metachris/flashbotsrpc v0.5.0 9 | ) 10 | 11 | require ( 12 | github.com/StackExchange/wmi v1.2.1 // indirect 13 | github.com/VictoriaMetrics/fastcache v1.12.0 // indirect 14 | github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 // indirect 15 | github.com/apache/arrow/go/v7 v7.0.1 // indirect 16 | github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect 17 | github.com/benbjohnson/immutable v0.4.0 // indirect 18 | github.com/beorn7/perks v1.0.1 // indirect 19 | github.com/btcsuite/btcd/btcec/v2 v2.3.1 // indirect 20 | github.com/cespare/xxhash v1.1.0 // indirect 21 | github.com/cespare/xxhash/v2 v2.1.2 // indirect 22 | github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect 23 | github.com/davecgh/go-spew v1.1.1 // indirect 24 | github.com/deckarep/golang-set v1.8.0 // indirect 25 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect 26 | github.com/deepmap/oapi-codegen v1.12.2 // indirect 27 | github.com/edsrzf/mmap-go v1.1.0 // indirect 28 | github.com/fjl/memsize v0.0.1 // indirect 29 | github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect 30 | github.com/go-ole/go-ole v1.2.6 // indirect 31 | github.com/go-stack/stack v1.8.1 // indirect 32 | github.com/goccy/go-json v0.9.11 // indirect 33 | github.com/gofrs/uuid v4.3.1+incompatible // indirect 34 | github.com/gogo/protobuf v1.3.2 // indirect 35 | github.com/golang-jwt/jwt/v4 v4.4.2 // indirect 36 | github.com/golang/protobuf v1.5.2 // indirect 37 | github.com/golang/snappy v0.0.4 // indirect 38 | github.com/google/flatbuffers v22.10.26+incompatible // indirect 39 | github.com/google/go-cmp v0.5.9 // indirect 40 | github.com/google/uuid v1.3.0 // indirect 41 | github.com/gorilla/websocket v1.5.0 // indirect 42 | github.com/graph-gophers/graphql-go v1.4.0 // indirect 43 | github.com/hashicorp/go-bexpr v0.1.11 // indirect 44 | github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect 45 | github.com/holiman/bloomfilter/v2 v2.0.3 // indirect 46 | github.com/holiman/uint256 v1.2.1 // indirect 47 | github.com/huin/goupnp v1.0.3 // indirect 48 | github.com/influxdata/flux v0.191.0 // indirect 49 | github.com/influxdata/influxdb v1.10.0 // indirect 50 | github.com/influxdata/influxdb-client-go/v2 v2.12.0 // indirect 51 | github.com/influxdata/influxql v1.1.1-0.20211004132434-7e7d61973256 // indirect 52 | github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf // indirect 53 | github.com/jackpal/go-nat-pmp v1.0.2 // indirect 54 | github.com/mattn/go-colorable v0.1.13 // indirect 55 | github.com/mattn/go-isatty v0.0.16 // indirect 56 | github.com/mattn/go-runewidth v0.0.14 // indirect 57 | github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect 58 | github.com/mitchellh/mapstructure v1.5.0 // indirect 59 | github.com/mitchellh/pointerstructure v1.2.1 // indirect 60 | github.com/olekukonko/tablewriter v0.0.5 // indirect 61 | github.com/opentracing/opentracing-go v1.2.0 // indirect 62 | github.com/peterh/liner v1.2.2 // indirect 63 | github.com/pkg/errors v0.9.1 // indirect 64 | github.com/prometheus/client_golang v1.14.0 // indirect 65 | github.com/prometheus/client_model v0.3.0 // indirect 66 | github.com/prometheus/common v0.37.0 // indirect 67 | github.com/prometheus/procfs v0.8.0 // indirect 68 | github.com/prometheus/tsdb v0.10.0 // indirect 69 | github.com/rivo/uniseg v0.4.3 // indirect 70 | github.com/rjeczalik/notify v0.9.2 // indirect 71 | github.com/rs/cors v1.8.2 // indirect 72 | github.com/russross/blackfriday/v2 v2.1.0 // indirect 73 | github.com/sergi/go-diff v1.2.0 // indirect 74 | github.com/shirou/gopsutil v3.21.11+incompatible // indirect 75 | github.com/status-im/keycard-go v0.2.0 // indirect 76 | github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect 77 | github.com/tklauser/go-sysconf v0.3.11 // indirect 78 | github.com/tklauser/numcpus v0.6.0 // indirect 79 | github.com/tyler-smith/go-bip39 v1.1.0 // indirect 80 | github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect 81 | github.com/uber/jaeger-lib v2.4.1+incompatible // indirect 82 | github.com/urfave/cli/v2 v2.23.5 // indirect 83 | github.com/xlab/treeprint v1.1.0 // indirect 84 | github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect 85 | github.com/yusufpapurcu/wmi v1.2.2 // indirect 86 | go.uber.org/atomic v1.10.0 // indirect 87 | go.uber.org/multierr v1.8.0 // indirect 88 | go.uber.org/zap v1.23.0 // indirect 89 | golang.org/x/crypto v0.3.0 // indirect 90 | golang.org/x/exp v0.0.0-20221114191408-850992195362 // indirect 91 | golang.org/x/mod v0.7.0 // indirect 92 | golang.org/x/net v0.2.0 // indirect 93 | golang.org/x/sync v0.1.0 // indirect 94 | golang.org/x/sys v0.2.0 // indirect 95 | golang.org/x/text v0.4.0 // indirect 96 | golang.org/x/time v0.2.0 // indirect 97 | golang.org/x/tools v0.3.0 // indirect 98 | golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect 99 | google.golang.org/protobuf v1.28.1 // indirect 100 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect 101 | gopkg.in/yaml.v2 v2.4.0 // indirect 102 | ) 103 | -------------------------------------------------------------------------------- /flashbots/simulate/main.go: -------------------------------------------------------------------------------- 1 | // Package main demonstrates simulating a transaction using flashbots. 2 | // Uses [metachris/flashbotsrpc]: https://github.com/metachris/flashbotsrpc 3 | package main 4 | 5 | import ( 6 | "errors" 7 | "fmt" 8 | "bytes" 9 | "math/big" 10 | "strings" 11 | 12 | "github.com/ethereum/go-ethereum/rlp" 13 | "github.com/ethereum/go-ethereum/common" 14 | "github.com/ethereum/go-ethereum/common/hexutil" 15 | "github.com/ethereum/go-ethereum/core/types" 16 | // "github.com/ethereum/go-ethereum/ethclient" 17 | // "github.com/ethereum/go-ethereum/rpc" 18 | "github.com/ethereum/go-ethereum/crypto" 19 | "github.com/metachris/flashbotsrpc" 20 | ) 21 | 22 | //go:generate abigen --abi ./dai/dai.abi --pkg dai --type Dai --out ./dai/dai.go 23 | type Dai interface { 24 | Allowance(common.Address, common.Address) (*big.Int, error) 25 | } 26 | 27 | func main() { 28 | // Create RPC Client 29 | // rpcUrl := os.Getenv("ETH_RPC_URL") 30 | // rpcClient, err := rpc.Dial(rpcUrl) 31 | // if err != nil { 32 | // fmt.Printf("Failed to construct rpc client: %v\n", err) 33 | // os.Exit(1) 34 | // } 35 | // ethClient := ethclient.NewClient(rpcClient) 36 | fmt.Println("✅ Configured RPC Client") 37 | 38 | // Create a new private key 39 | privateKey, _ := crypto.GenerateKey() 40 | 41 | // Create Dai Instance 42 | // daiContract := 0x6b175474e89094c44da98b954eedeac495271d0f 43 | // daiCaller, err := dai.NewDaiTransactor(daiContract, rpcClient) 44 | // if err != nil { 45 | // fmt.Printf("Error calling dai: %v\n", err) 46 | // os.Exit(1) 47 | // } 48 | 49 | // Construct Transaction 50 | testAddr := common.HexToAddress("b94f5374fce5edbc8e2a8697c15331677e6ebf0b") 51 | emptyEip2718Tx := types.NewTx(&types.AccessListTx{ 52 | ChainID: big.NewInt(1), 53 | Nonce: 3, 54 | To: &testAddr, 55 | Value: big.NewInt(10), 56 | Gas: 25000, 57 | GasPrice: big.NewInt(1), 58 | Data: common.FromHex("5544"), 59 | }) 60 | signedEip2718Tx, _ := emptyEip2718Tx.WithSignature( 61 | types.NewEIP2930Signer(big.NewInt(1)), 62 | common.Hex2Bytes("c9519f4f2b30335884581971573fadf60c6204f59a911df35ee8a540456b266032f1e8e2c5dd761f9e4f88f41c8310aeaba26a8bfcdacfedfa12ec3862d3752101"), 63 | ) 64 | 65 | // Encode Transaction to bytes 66 | encodedTx, err := rlp.EncodeToBytes(signedEip2718Tx) 67 | stringTx := hexutil.Encode(encodedTx) 68 | if err != nil { 69 | fmt.Errorf("encode error: %v", err) 70 | } 71 | want := common.FromHex("b86601f8630103018261a894b94f5374fce5edbc8e2a8697c15331677e6ebf0b0a825544c001a0c9519f4f2b30335884581971573fadf60c6204f59a911df35ee8a540456b2660a032f1e8e2c5dd761f9e4f88f41c8310aeaba26a8bfcdacfedfa12ec3862d37521") 72 | if !bytes.Equal(encodedTx, want) { 73 | fmt.Errorf("encoded RLP mismatch, got %x", encodedTx) 74 | } 75 | 76 | stringTx = strings.ReplaceAll(stringTx, "0x", "") 77 | fmt.Printf("Constructed raw tx: %s\n", stringTx) 78 | 79 | // Simulate Transactions using the eth_callBundle rpc method 80 | rpc := flashbotsrpc.New("https://relay.flashbots.net") 81 | opts := flashbotsrpc.FlashbotsCallBundleParam{ 82 | Txs: []string{stringTx}, 83 | BlockNumber: fmt.Sprintf("0x%x", 13281018), 84 | StateBlockNumber: "latest", 85 | } 86 | 87 | result, err := rpc.FlashbotsCallBundle(privateKey, opts) 88 | if err != nil { 89 | if errors.Is(err, flashbotsrpc.ErrRelayErrorResponse) { // user/tx error, rather than JSON or network error 90 | fmt.Println(err.Error()) 91 | } else { 92 | fmt.Printf("error: %+v\n", err) 93 | } 94 | return 95 | } 96 | 97 | // Print result 98 | fmt.Printf("%+v\n", result) 99 | } 100 | -------------------------------------------------------------------------------- /flashbots/simulate/some_test.go: -------------------------------------------------------------------------------- 1 | package main_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/btcsuite/btcd/chaincfg/chainhash" 7 | ) 8 | 9 | func TestHash(t *testing.T) { 10 | // Hash of block 234439. 11 | blockHashStr := "14a0810ac680a3eb3f82edc878cea25ec41d6b790744e5daeef" 12 | blockHash, err := chainhash.NewHashFromStr(blockHashStr) 13 | if err != nil { 14 | t.Errorf("NewHashFromStr: %v", err) 15 | } 16 | buf := []byte{ 17 | 0x79, 0xa6, 0x1a, 0xdb, 0xc6, 0xe5, 0xa2, 0xe1, 18 | 0x39, 0xd2, 0x71, 0x3a, 0x54, 0x6e, 0xc7, 0xc8, 19 | 0x75, 0x63, 0x2e, 0x75, 0xf1, 0xdf, 0x9c, 0x3f, 20 | 0xa6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 21 | } 22 | 23 | hash, err := chainhash.NewHash(buf) 24 | if err != nil { 25 | t.Errorf("NewHash: unexpected error %v", err) 26 | } 27 | 28 | if hash.IsEqual(blockHash) { 29 | t.Errorf("IsEqual: hash contents should not match - got: %v, want: %v", 30 | hash, blockHash) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /flashbots/stats/main.go: -------------------------------------------------------------------------------- 1 | // Package stats demonstrates how to send a bundle to Flashbots. 2 | // 3 | // This follows the example provided in the Flashbots documentation (linked below). 4 | // [Flashbots Documentation]: https://docs.flashbots.net/flashbots-auction/searchers/quick-start 5 | // 6 | // When you send bundles to Flashbots they must be signed with a private key so that flashbots can establish identity and reputation for searchers. 7 | // This private key does not store funds and is not the primary private key you use for executing transactions. 8 | // Again, it is only used for identity, and it can be any private key. 9 | // 10 | // Second, you'll need a way to interact with Flashbots. 11 | // The Flashbots builder receives bundles at relay.flashbots.net. 12 | // To send transactions, Flashbots provides specific RPC endpoints. 13 | // For example, below we demonstrate using the glashbots_getUserStats rpc endpoint to fetch the searcher's statistics. 14 | package stats 15 | 16 | import ( 17 | "bytes" 18 | "crypto/ecdsa" 19 | "encoding/json" 20 | "fmt" 21 | "io/ioutil" 22 | "math/big" 23 | "net/http" 24 | "time" 25 | 26 | "github.com/ethereum/go-ethereum/accounts" 27 | "github.com/ethereum/go-ethereum/common/hexutil" 28 | "github.com/ethereum/go-ethereum/crypto" 29 | ) 30 | 31 | const ( 32 | j = "application/json" 33 | flashbotURL = "https://relay.flashbots.net" 34 | stats = "flashbots_getUserStats" 35 | flashbotXHeader = "X-Flashbots-Signature" 36 | p = "POST" 37 | ) 38 | 39 | var ( 40 | privateKey, _ = crypto.HexToECDSA("2e19800fcbbf0abb7cf6d72ee7171f08943bc8e5c3568d1d7420e52136898154") 41 | ) 42 | 43 | func flashbotHeader(signature []byte, privateKey *ecdsa.PrivateKey) string { 44 | return crypto.PubkeyToAddress(privateKey.PublicKey).Hex() + ":" + hexutil.Encode(signature) 45 | } 46 | 47 | func main() { 48 | mevHTTPClient := &http.Client{ 49 | Timeout: time.Second * 3, 50 | } 51 | currentBlock := big.NewInt(12_900_000) 52 | params := map[string]interface{}{ 53 | "jsonrpc": "2.0", 54 | "id": 1, 55 | "method": stats, 56 | "params": []interface{}{ 57 | fmt.Sprintf("0x%x", currentBlock.Uint64()), 58 | }, 59 | } 60 | payload, _ := json.Marshal(params) 61 | req, _ := http.NewRequest(p, flashbotURL, bytes.NewBuffer(payload)) 62 | headerReady, _ := crypto.Sign( 63 | accounts.TextHash([]byte(hexutil.Encode(crypto.Keccak256(payload)))), 64 | privateKey, 65 | ) 66 | req.Header.Add("content-type", j) 67 | req.Header.Add("Accept", j) 68 | req.Header.Add(flashbotXHeader, flashbotHeader(headerReady, privateKey)) 69 | resp, _ := mevHTTPClient.Do(req) 70 | res, _ := ioutil.ReadAll(resp.Body) 71 | fmt.Println(string(res)) 72 | } 73 | -------------------------------------------------------------------------------- /state/dai.abi: -------------------------------------------------------------------------------- 1 | [{"inputs":[{"internalType":"uint256","name":"chainId_","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"src","type":"address"},{"indexed":true,"internalType":"address","name":"guy","type":"address"},{"indexed":false,"internalType":"uint256","name":"wad","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"internalType":"bytes4","name":"sig","type":"bytes4"},{"indexed":true,"internalType":"address","name":"usr","type":"address"},{"indexed":true,"internalType":"bytes32","name":"arg1","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"arg2","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"LogNote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"src","type":"address"},{"indexed":true,"internalType":"address","name":"dst","type":"address"},{"indexed":false,"internalType":"uint256","name":"wad","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"move","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"holder","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"bool","name":"allowed","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"pull","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"push","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"wards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}] 2 | -------------------------------------------------------------------------------- /state/dai.go: -------------------------------------------------------------------------------- 1 | // Code generated - DO NOT EDIT. 2 | // This file is a generated binding and any manual changes will be lost. 3 | 4 | package main 5 | 6 | import ( 7 | "errors" 8 | "math/big" 9 | "strings" 10 | 11 | ethereum "github.com/ethereum/go-ethereum" 12 | "github.com/ethereum/go-ethereum/accounts/abi" 13 | "github.com/ethereum/go-ethereum/accounts/abi/bind" 14 | "github.com/ethereum/go-ethereum/common" 15 | "github.com/ethereum/go-ethereum/core/types" 16 | "github.com/ethereum/go-ethereum/event" 17 | ) 18 | 19 | // Reference imports to suppress errors if they are not otherwise used. 20 | var ( 21 | _ = errors.New 22 | _ = big.NewInt 23 | _ = strings.NewReader 24 | _ = ethereum.NotFound 25 | _ = bind.Bind 26 | _ = common.Big1 27 | _ = types.BloomLookup 28 | _ = event.NewSubscription 29 | ) 30 | 31 | // DaiMetaData contains all meta data concerning the Dai contract. 32 | var DaiMetaData = &bind.MetaData{ 33 | ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId_\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":true,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sig\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"arg1\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"arg2\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"LogNote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"}],\"name\":\"deny\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"move\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"holder\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"pull\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"usr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"push\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"}],\"name\":\"rely\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"wards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]", 34 | } 35 | 36 | // DaiABI is the input ABI used to generate the binding from. 37 | // Deprecated: Use DaiMetaData.ABI instead. 38 | var DaiABI = DaiMetaData.ABI 39 | 40 | // Dai is an auto generated Go binding around an Ethereum contract. 41 | type Dai struct { 42 | DaiCaller // Read-only binding to the contract 43 | DaiTransactor // Write-only binding to the contract 44 | DaiFilterer // Log filterer for contract events 45 | } 46 | 47 | // DaiCaller is an auto generated read-only Go binding around an Ethereum contract. 48 | type DaiCaller struct { 49 | contract *bind.BoundContract // Generic contract wrapper for the low level calls 50 | } 51 | 52 | // DaiTransactor is an auto generated write-only Go binding around an Ethereum contract. 53 | type DaiTransactor struct { 54 | contract *bind.BoundContract // Generic contract wrapper for the low level calls 55 | } 56 | 57 | // DaiFilterer is an auto generated log filtering Go binding around an Ethereum contract events. 58 | type DaiFilterer struct { 59 | contract *bind.BoundContract // Generic contract wrapper for the low level calls 60 | } 61 | 62 | // DaiSession is an auto generated Go binding around an Ethereum contract, 63 | // with pre-set call and transact options. 64 | type DaiSession struct { 65 | Contract *Dai // Generic contract binding to set the session for 66 | CallOpts bind.CallOpts // Call options to use throughout this session 67 | TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 68 | } 69 | 70 | // DaiCallerSession is an auto generated read-only Go binding around an Ethereum contract, 71 | // with pre-set call options. 72 | type DaiCallerSession struct { 73 | Contract *DaiCaller // Generic contract caller binding to set the session for 74 | CallOpts bind.CallOpts // Call options to use throughout this session 75 | } 76 | 77 | // DaiTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 78 | // with pre-set transact options. 79 | type DaiTransactorSession struct { 80 | Contract *DaiTransactor // Generic contract transactor binding to set the session for 81 | TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 82 | } 83 | 84 | // DaiRaw is an auto generated low-level Go binding around an Ethereum contract. 85 | type DaiRaw struct { 86 | Contract *Dai // Generic contract binding to access the raw methods on 87 | } 88 | 89 | // DaiCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 90 | type DaiCallerRaw struct { 91 | Contract *DaiCaller // Generic read-only contract binding to access the raw methods on 92 | } 93 | 94 | // DaiTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 95 | type DaiTransactorRaw struct { 96 | Contract *DaiTransactor // Generic write-only contract binding to access the raw methods on 97 | } 98 | 99 | // NewDai creates a new instance of Dai, bound to a specific deployed contract. 100 | func NewDai(address common.Address, backend bind.ContractBackend) (*Dai, error) { 101 | contract, err := bindDai(address, backend, backend, backend) 102 | if err != nil { 103 | return nil, err 104 | } 105 | return &Dai{DaiCaller: DaiCaller{contract: contract}, DaiTransactor: DaiTransactor{contract: contract}, DaiFilterer: DaiFilterer{contract: contract}}, nil 106 | } 107 | 108 | // NewDaiCaller creates a new read-only instance of Dai, bound to a specific deployed contract. 109 | func NewDaiCaller(address common.Address, caller bind.ContractCaller) (*DaiCaller, error) { 110 | contract, err := bindDai(address, caller, nil, nil) 111 | if err != nil { 112 | return nil, err 113 | } 114 | return &DaiCaller{contract: contract}, nil 115 | } 116 | 117 | // NewDaiTransactor creates a new write-only instance of Dai, bound to a specific deployed contract. 118 | func NewDaiTransactor(address common.Address, transactor bind.ContractTransactor) (*DaiTransactor, error) { 119 | contract, err := bindDai(address, nil, transactor, nil) 120 | if err != nil { 121 | return nil, err 122 | } 123 | return &DaiTransactor{contract: contract}, nil 124 | } 125 | 126 | // NewDaiFilterer creates a new log filterer instance of Dai, bound to a specific deployed contract. 127 | func NewDaiFilterer(address common.Address, filterer bind.ContractFilterer) (*DaiFilterer, error) { 128 | contract, err := bindDai(address, nil, nil, filterer) 129 | if err != nil { 130 | return nil, err 131 | } 132 | return &DaiFilterer{contract: contract}, nil 133 | } 134 | 135 | // bindDai binds a generic wrapper to an already deployed contract. 136 | func bindDai(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 137 | parsed, err := abi.JSON(strings.NewReader(DaiABI)) 138 | if err != nil { 139 | return nil, err 140 | } 141 | return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil 142 | } 143 | 144 | // Call invokes the (constant) contract method with params as input values and 145 | // sets the output to result. The result type might be a single field for simple 146 | // returns, a slice of interfaces for anonymous returns and a struct for named 147 | // returns. 148 | func (_Dai *DaiRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 149 | return _Dai.Contract.DaiCaller.contract.Call(opts, result, method, params...) 150 | } 151 | 152 | // Transfer initiates a plain transaction to move funds to the contract, calling 153 | // its default method if one is available. 154 | func (_Dai *DaiRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 155 | return _Dai.Contract.DaiTransactor.contract.Transfer(opts) 156 | } 157 | 158 | // Transact invokes the (paid) contract method with params as input values. 159 | func (_Dai *DaiRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 160 | return _Dai.Contract.DaiTransactor.contract.Transact(opts, method, params...) 161 | } 162 | 163 | // Call invokes the (constant) contract method with params as input values and 164 | // sets the output to result. The result type might be a single field for simple 165 | // returns, a slice of interfaces for anonymous returns and a struct for named 166 | // returns. 167 | func (_Dai *DaiCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 168 | return _Dai.Contract.contract.Call(opts, result, method, params...) 169 | } 170 | 171 | // Transfer initiates a plain transaction to move funds to the contract, calling 172 | // its default method if one is available. 173 | func (_Dai *DaiTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 174 | return _Dai.Contract.contract.Transfer(opts) 175 | } 176 | 177 | // Transact invokes the (paid) contract method with params as input values. 178 | func (_Dai *DaiTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 179 | return _Dai.Contract.contract.Transact(opts, method, params...) 180 | } 181 | 182 | // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. 183 | // 184 | // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) 185 | func (_Dai *DaiCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { 186 | var out []interface{} 187 | err := _Dai.contract.Call(opts, &out, "DOMAIN_SEPARATOR") 188 | 189 | if err != nil { 190 | return *new([32]byte), err 191 | } 192 | 193 | out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) 194 | 195 | return out0, err 196 | 197 | } 198 | 199 | // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. 200 | // 201 | // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) 202 | func (_Dai *DaiSession) DOMAINSEPARATOR() ([32]byte, error) { 203 | return _Dai.Contract.DOMAINSEPARATOR(&_Dai.CallOpts) 204 | } 205 | 206 | // DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. 207 | // 208 | // Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) 209 | func (_Dai *DaiCallerSession) DOMAINSEPARATOR() ([32]byte, error) { 210 | return _Dai.Contract.DOMAINSEPARATOR(&_Dai.CallOpts) 211 | } 212 | 213 | // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. 214 | // 215 | // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) 216 | func (_Dai *DaiCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { 217 | var out []interface{} 218 | err := _Dai.contract.Call(opts, &out, "PERMIT_TYPEHASH") 219 | 220 | if err != nil { 221 | return *new([32]byte), err 222 | } 223 | 224 | out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) 225 | 226 | return out0, err 227 | 228 | } 229 | 230 | // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. 231 | // 232 | // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) 233 | func (_Dai *DaiSession) PERMITTYPEHASH() ([32]byte, error) { 234 | return _Dai.Contract.PERMITTYPEHASH(&_Dai.CallOpts) 235 | } 236 | 237 | // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. 238 | // 239 | // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) 240 | func (_Dai *DaiCallerSession) PERMITTYPEHASH() ([32]byte, error) { 241 | return _Dai.Contract.PERMITTYPEHASH(&_Dai.CallOpts) 242 | } 243 | 244 | // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. 245 | // 246 | // Solidity: function allowance(address , address ) view returns(uint256) 247 | func (_Dai *DaiCaller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { 248 | var out []interface{} 249 | err := _Dai.contract.Call(opts, &out, "allowance", arg0, arg1) 250 | 251 | if err != nil { 252 | return *new(*big.Int), err 253 | } 254 | 255 | out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 256 | 257 | return out0, err 258 | 259 | } 260 | 261 | // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. 262 | // 263 | // Solidity: function allowance(address , address ) view returns(uint256) 264 | func (_Dai *DaiSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { 265 | return _Dai.Contract.Allowance(&_Dai.CallOpts, arg0, arg1) 266 | } 267 | 268 | // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. 269 | // 270 | // Solidity: function allowance(address , address ) view returns(uint256) 271 | func (_Dai *DaiCallerSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { 272 | return _Dai.Contract.Allowance(&_Dai.CallOpts, arg0, arg1) 273 | } 274 | 275 | // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 276 | // 277 | // Solidity: function balanceOf(address ) view returns(uint256) 278 | func (_Dai *DaiCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { 279 | var out []interface{} 280 | err := _Dai.contract.Call(opts, &out, "balanceOf", arg0) 281 | 282 | if err != nil { 283 | return *new(*big.Int), err 284 | } 285 | 286 | out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 287 | 288 | return out0, err 289 | 290 | } 291 | 292 | // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 293 | // 294 | // Solidity: function balanceOf(address ) view returns(uint256) 295 | func (_Dai *DaiSession) BalanceOf(arg0 common.Address) (*big.Int, error) { 296 | return _Dai.Contract.BalanceOf(&_Dai.CallOpts, arg0) 297 | } 298 | 299 | // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 300 | // 301 | // Solidity: function balanceOf(address ) view returns(uint256) 302 | func (_Dai *DaiCallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { 303 | return _Dai.Contract.BalanceOf(&_Dai.CallOpts, arg0) 304 | } 305 | 306 | // Decimals is a free data retrieval call binding the contract method 0x313ce567. 307 | // 308 | // Solidity: function decimals() view returns(uint8) 309 | func (_Dai *DaiCaller) Decimals(opts *bind.CallOpts) (uint8, error) { 310 | var out []interface{} 311 | err := _Dai.contract.Call(opts, &out, "decimals") 312 | 313 | if err != nil { 314 | return *new(uint8), err 315 | } 316 | 317 | out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) 318 | 319 | return out0, err 320 | 321 | } 322 | 323 | // Decimals is a free data retrieval call binding the contract method 0x313ce567. 324 | // 325 | // Solidity: function decimals() view returns(uint8) 326 | func (_Dai *DaiSession) Decimals() (uint8, error) { 327 | return _Dai.Contract.Decimals(&_Dai.CallOpts) 328 | } 329 | 330 | // Decimals is a free data retrieval call binding the contract method 0x313ce567. 331 | // 332 | // Solidity: function decimals() view returns(uint8) 333 | func (_Dai *DaiCallerSession) Decimals() (uint8, error) { 334 | return _Dai.Contract.Decimals(&_Dai.CallOpts) 335 | } 336 | 337 | // Name is a free data retrieval call binding the contract method 0x06fdde03. 338 | // 339 | // Solidity: function name() view returns(string) 340 | func (_Dai *DaiCaller) Name(opts *bind.CallOpts) (string, error) { 341 | var out []interface{} 342 | err := _Dai.contract.Call(opts, &out, "name") 343 | 344 | if err != nil { 345 | return *new(string), err 346 | } 347 | 348 | out0 := *abi.ConvertType(out[0], new(string)).(*string) 349 | 350 | return out0, err 351 | 352 | } 353 | 354 | // Name is a free data retrieval call binding the contract method 0x06fdde03. 355 | // 356 | // Solidity: function name() view returns(string) 357 | func (_Dai *DaiSession) Name() (string, error) { 358 | return _Dai.Contract.Name(&_Dai.CallOpts) 359 | } 360 | 361 | // Name is a free data retrieval call binding the contract method 0x06fdde03. 362 | // 363 | // Solidity: function name() view returns(string) 364 | func (_Dai *DaiCallerSession) Name() (string, error) { 365 | return _Dai.Contract.Name(&_Dai.CallOpts) 366 | } 367 | 368 | // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. 369 | // 370 | // Solidity: function nonces(address ) view returns(uint256) 371 | func (_Dai *DaiCaller) Nonces(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { 372 | var out []interface{} 373 | err := _Dai.contract.Call(opts, &out, "nonces", arg0) 374 | 375 | if err != nil { 376 | return *new(*big.Int), err 377 | } 378 | 379 | out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 380 | 381 | return out0, err 382 | 383 | } 384 | 385 | // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. 386 | // 387 | // Solidity: function nonces(address ) view returns(uint256) 388 | func (_Dai *DaiSession) Nonces(arg0 common.Address) (*big.Int, error) { 389 | return _Dai.Contract.Nonces(&_Dai.CallOpts, arg0) 390 | } 391 | 392 | // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. 393 | // 394 | // Solidity: function nonces(address ) view returns(uint256) 395 | func (_Dai *DaiCallerSession) Nonces(arg0 common.Address) (*big.Int, error) { 396 | return _Dai.Contract.Nonces(&_Dai.CallOpts, arg0) 397 | } 398 | 399 | // Symbol is a free data retrieval call binding the contract method 0x95d89b41. 400 | // 401 | // Solidity: function symbol() view returns(string) 402 | func (_Dai *DaiCaller) Symbol(opts *bind.CallOpts) (string, error) { 403 | var out []interface{} 404 | err := _Dai.contract.Call(opts, &out, "symbol") 405 | 406 | if err != nil { 407 | return *new(string), err 408 | } 409 | 410 | out0 := *abi.ConvertType(out[0], new(string)).(*string) 411 | 412 | return out0, err 413 | 414 | } 415 | 416 | // Symbol is a free data retrieval call binding the contract method 0x95d89b41. 417 | // 418 | // Solidity: function symbol() view returns(string) 419 | func (_Dai *DaiSession) Symbol() (string, error) { 420 | return _Dai.Contract.Symbol(&_Dai.CallOpts) 421 | } 422 | 423 | // Symbol is a free data retrieval call binding the contract method 0x95d89b41. 424 | // 425 | // Solidity: function symbol() view returns(string) 426 | func (_Dai *DaiCallerSession) Symbol() (string, error) { 427 | return _Dai.Contract.Symbol(&_Dai.CallOpts) 428 | } 429 | 430 | // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. 431 | // 432 | // Solidity: function totalSupply() view returns(uint256) 433 | func (_Dai *DaiCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { 434 | var out []interface{} 435 | err := _Dai.contract.Call(opts, &out, "totalSupply") 436 | 437 | if err != nil { 438 | return *new(*big.Int), err 439 | } 440 | 441 | out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 442 | 443 | return out0, err 444 | 445 | } 446 | 447 | // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. 448 | // 449 | // Solidity: function totalSupply() view returns(uint256) 450 | func (_Dai *DaiSession) TotalSupply() (*big.Int, error) { 451 | return _Dai.Contract.TotalSupply(&_Dai.CallOpts) 452 | } 453 | 454 | // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. 455 | // 456 | // Solidity: function totalSupply() view returns(uint256) 457 | func (_Dai *DaiCallerSession) TotalSupply() (*big.Int, error) { 458 | return _Dai.Contract.TotalSupply(&_Dai.CallOpts) 459 | } 460 | 461 | // Version is a free data retrieval call binding the contract method 0x54fd4d50. 462 | // 463 | // Solidity: function version() view returns(string) 464 | func (_Dai *DaiCaller) Version(opts *bind.CallOpts) (string, error) { 465 | var out []interface{} 466 | err := _Dai.contract.Call(opts, &out, "version") 467 | 468 | if err != nil { 469 | return *new(string), err 470 | } 471 | 472 | out0 := *abi.ConvertType(out[0], new(string)).(*string) 473 | 474 | return out0, err 475 | 476 | } 477 | 478 | // Version is a free data retrieval call binding the contract method 0x54fd4d50. 479 | // 480 | // Solidity: function version() view returns(string) 481 | func (_Dai *DaiSession) Version() (string, error) { 482 | return _Dai.Contract.Version(&_Dai.CallOpts) 483 | } 484 | 485 | // Version is a free data retrieval call binding the contract method 0x54fd4d50. 486 | // 487 | // Solidity: function version() view returns(string) 488 | func (_Dai *DaiCallerSession) Version() (string, error) { 489 | return _Dai.Contract.Version(&_Dai.CallOpts) 490 | } 491 | 492 | // Wards is a free data retrieval call binding the contract method 0xbf353dbb. 493 | // 494 | // Solidity: function wards(address ) view returns(uint256) 495 | func (_Dai *DaiCaller) Wards(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { 496 | var out []interface{} 497 | err := _Dai.contract.Call(opts, &out, "wards", arg0) 498 | 499 | if err != nil { 500 | return *new(*big.Int), err 501 | } 502 | 503 | out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 504 | 505 | return out0, err 506 | 507 | } 508 | 509 | // Wards is a free data retrieval call binding the contract method 0xbf353dbb. 510 | // 511 | // Solidity: function wards(address ) view returns(uint256) 512 | func (_Dai *DaiSession) Wards(arg0 common.Address) (*big.Int, error) { 513 | return _Dai.Contract.Wards(&_Dai.CallOpts, arg0) 514 | } 515 | 516 | // Wards is a free data retrieval call binding the contract method 0xbf353dbb. 517 | // 518 | // Solidity: function wards(address ) view returns(uint256) 519 | func (_Dai *DaiCallerSession) Wards(arg0 common.Address) (*big.Int, error) { 520 | return _Dai.Contract.Wards(&_Dai.CallOpts, arg0) 521 | } 522 | 523 | // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 524 | // 525 | // Solidity: function approve(address usr, uint256 wad) returns(bool) 526 | func (_Dai *DaiTransactor) Approve(opts *bind.TransactOpts, usr common.Address, wad *big.Int) (*types.Transaction, error) { 527 | return _Dai.contract.Transact(opts, "approve", usr, wad) 528 | } 529 | 530 | // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 531 | // 532 | // Solidity: function approve(address usr, uint256 wad) returns(bool) 533 | func (_Dai *DaiSession) Approve(usr common.Address, wad *big.Int) (*types.Transaction, error) { 534 | return _Dai.Contract.Approve(&_Dai.TransactOpts, usr, wad) 535 | } 536 | 537 | // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 538 | // 539 | // Solidity: function approve(address usr, uint256 wad) returns(bool) 540 | func (_Dai *DaiTransactorSession) Approve(usr common.Address, wad *big.Int) (*types.Transaction, error) { 541 | return _Dai.Contract.Approve(&_Dai.TransactOpts, usr, wad) 542 | } 543 | 544 | // Burn is a paid mutator transaction binding the contract method 0x9dc29fac. 545 | // 546 | // Solidity: function burn(address usr, uint256 wad) returns() 547 | func (_Dai *DaiTransactor) Burn(opts *bind.TransactOpts, usr common.Address, wad *big.Int) (*types.Transaction, error) { 548 | return _Dai.contract.Transact(opts, "burn", usr, wad) 549 | } 550 | 551 | // Burn is a paid mutator transaction binding the contract method 0x9dc29fac. 552 | // 553 | // Solidity: function burn(address usr, uint256 wad) returns() 554 | func (_Dai *DaiSession) Burn(usr common.Address, wad *big.Int) (*types.Transaction, error) { 555 | return _Dai.Contract.Burn(&_Dai.TransactOpts, usr, wad) 556 | } 557 | 558 | // Burn is a paid mutator transaction binding the contract method 0x9dc29fac. 559 | // 560 | // Solidity: function burn(address usr, uint256 wad) returns() 561 | func (_Dai *DaiTransactorSession) Burn(usr common.Address, wad *big.Int) (*types.Transaction, error) { 562 | return _Dai.Contract.Burn(&_Dai.TransactOpts, usr, wad) 563 | } 564 | 565 | // Deny is a paid mutator transaction binding the contract method 0x9c52a7f1. 566 | // 567 | // Solidity: function deny(address guy) returns() 568 | func (_Dai *DaiTransactor) Deny(opts *bind.TransactOpts, guy common.Address) (*types.Transaction, error) { 569 | return _Dai.contract.Transact(opts, "deny", guy) 570 | } 571 | 572 | // Deny is a paid mutator transaction binding the contract method 0x9c52a7f1. 573 | // 574 | // Solidity: function deny(address guy) returns() 575 | func (_Dai *DaiSession) Deny(guy common.Address) (*types.Transaction, error) { 576 | return _Dai.Contract.Deny(&_Dai.TransactOpts, guy) 577 | } 578 | 579 | // Deny is a paid mutator transaction binding the contract method 0x9c52a7f1. 580 | // 581 | // Solidity: function deny(address guy) returns() 582 | func (_Dai *DaiTransactorSession) Deny(guy common.Address) (*types.Transaction, error) { 583 | return _Dai.Contract.Deny(&_Dai.TransactOpts, guy) 584 | } 585 | 586 | // Mint is a paid mutator transaction binding the contract method 0x40c10f19. 587 | // 588 | // Solidity: function mint(address usr, uint256 wad) returns() 589 | func (_Dai *DaiTransactor) Mint(opts *bind.TransactOpts, usr common.Address, wad *big.Int) (*types.Transaction, error) { 590 | return _Dai.contract.Transact(opts, "mint", usr, wad) 591 | } 592 | 593 | // Mint is a paid mutator transaction binding the contract method 0x40c10f19. 594 | // 595 | // Solidity: function mint(address usr, uint256 wad) returns() 596 | func (_Dai *DaiSession) Mint(usr common.Address, wad *big.Int) (*types.Transaction, error) { 597 | return _Dai.Contract.Mint(&_Dai.TransactOpts, usr, wad) 598 | } 599 | 600 | // Mint is a paid mutator transaction binding the contract method 0x40c10f19. 601 | // 602 | // Solidity: function mint(address usr, uint256 wad) returns() 603 | func (_Dai *DaiTransactorSession) Mint(usr common.Address, wad *big.Int) (*types.Transaction, error) { 604 | return _Dai.Contract.Mint(&_Dai.TransactOpts, usr, wad) 605 | } 606 | 607 | // Move is a paid mutator transaction binding the contract method 0xbb35783b. 608 | // 609 | // Solidity: function move(address src, address dst, uint256 wad) returns() 610 | func (_Dai *DaiTransactor) Move(opts *bind.TransactOpts, src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { 611 | return _Dai.contract.Transact(opts, "move", src, dst, wad) 612 | } 613 | 614 | // Move is a paid mutator transaction binding the contract method 0xbb35783b. 615 | // 616 | // Solidity: function move(address src, address dst, uint256 wad) returns() 617 | func (_Dai *DaiSession) Move(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { 618 | return _Dai.Contract.Move(&_Dai.TransactOpts, src, dst, wad) 619 | } 620 | 621 | // Move is a paid mutator transaction binding the contract method 0xbb35783b. 622 | // 623 | // Solidity: function move(address src, address dst, uint256 wad) returns() 624 | func (_Dai *DaiTransactorSession) Move(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { 625 | return _Dai.Contract.Move(&_Dai.TransactOpts, src, dst, wad) 626 | } 627 | 628 | // Permit is a paid mutator transaction binding the contract method 0x8fcbaf0c. 629 | // 630 | // Solidity: function permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) returns() 631 | func (_Dai *DaiTransactor) Permit(opts *bind.TransactOpts, holder common.Address, spender common.Address, nonce *big.Int, expiry *big.Int, allowed bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { 632 | return _Dai.contract.Transact(opts, "permit", holder, spender, nonce, expiry, allowed, v, r, s) 633 | } 634 | 635 | // Permit is a paid mutator transaction binding the contract method 0x8fcbaf0c. 636 | // 637 | // Solidity: function permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) returns() 638 | func (_Dai *DaiSession) Permit(holder common.Address, spender common.Address, nonce *big.Int, expiry *big.Int, allowed bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { 639 | return _Dai.Contract.Permit(&_Dai.TransactOpts, holder, spender, nonce, expiry, allowed, v, r, s) 640 | } 641 | 642 | // Permit is a paid mutator transaction binding the contract method 0x8fcbaf0c. 643 | // 644 | // Solidity: function permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) returns() 645 | func (_Dai *DaiTransactorSession) Permit(holder common.Address, spender common.Address, nonce *big.Int, expiry *big.Int, allowed bool, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { 646 | return _Dai.Contract.Permit(&_Dai.TransactOpts, holder, spender, nonce, expiry, allowed, v, r, s) 647 | } 648 | 649 | // Pull is a paid mutator transaction binding the contract method 0xf2d5d56b. 650 | // 651 | // Solidity: function pull(address usr, uint256 wad) returns() 652 | func (_Dai *DaiTransactor) Pull(opts *bind.TransactOpts, usr common.Address, wad *big.Int) (*types.Transaction, error) { 653 | return _Dai.contract.Transact(opts, "pull", usr, wad) 654 | } 655 | 656 | // Pull is a paid mutator transaction binding the contract method 0xf2d5d56b. 657 | // 658 | // Solidity: function pull(address usr, uint256 wad) returns() 659 | func (_Dai *DaiSession) Pull(usr common.Address, wad *big.Int) (*types.Transaction, error) { 660 | return _Dai.Contract.Pull(&_Dai.TransactOpts, usr, wad) 661 | } 662 | 663 | // Pull is a paid mutator transaction binding the contract method 0xf2d5d56b. 664 | // 665 | // Solidity: function pull(address usr, uint256 wad) returns() 666 | func (_Dai *DaiTransactorSession) Pull(usr common.Address, wad *big.Int) (*types.Transaction, error) { 667 | return _Dai.Contract.Pull(&_Dai.TransactOpts, usr, wad) 668 | } 669 | 670 | // Push is a paid mutator transaction binding the contract method 0xb753a98c. 671 | // 672 | // Solidity: function push(address usr, uint256 wad) returns() 673 | func (_Dai *DaiTransactor) Push(opts *bind.TransactOpts, usr common.Address, wad *big.Int) (*types.Transaction, error) { 674 | return _Dai.contract.Transact(opts, "push", usr, wad) 675 | } 676 | 677 | // Push is a paid mutator transaction binding the contract method 0xb753a98c. 678 | // 679 | // Solidity: function push(address usr, uint256 wad) returns() 680 | func (_Dai *DaiSession) Push(usr common.Address, wad *big.Int) (*types.Transaction, error) { 681 | return _Dai.Contract.Push(&_Dai.TransactOpts, usr, wad) 682 | } 683 | 684 | // Push is a paid mutator transaction binding the contract method 0xb753a98c. 685 | // 686 | // Solidity: function push(address usr, uint256 wad) returns() 687 | func (_Dai *DaiTransactorSession) Push(usr common.Address, wad *big.Int) (*types.Transaction, error) { 688 | return _Dai.Contract.Push(&_Dai.TransactOpts, usr, wad) 689 | } 690 | 691 | // Rely is a paid mutator transaction binding the contract method 0x65fae35e. 692 | // 693 | // Solidity: function rely(address guy) returns() 694 | func (_Dai *DaiTransactor) Rely(opts *bind.TransactOpts, guy common.Address) (*types.Transaction, error) { 695 | return _Dai.contract.Transact(opts, "rely", guy) 696 | } 697 | 698 | // Rely is a paid mutator transaction binding the contract method 0x65fae35e. 699 | // 700 | // Solidity: function rely(address guy) returns() 701 | func (_Dai *DaiSession) Rely(guy common.Address) (*types.Transaction, error) { 702 | return _Dai.Contract.Rely(&_Dai.TransactOpts, guy) 703 | } 704 | 705 | // Rely is a paid mutator transaction binding the contract method 0x65fae35e. 706 | // 707 | // Solidity: function rely(address guy) returns() 708 | func (_Dai *DaiTransactorSession) Rely(guy common.Address) (*types.Transaction, error) { 709 | return _Dai.Contract.Rely(&_Dai.TransactOpts, guy) 710 | } 711 | 712 | // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 713 | // 714 | // Solidity: function transfer(address dst, uint256 wad) returns(bool) 715 | func (_Dai *DaiTransactor) Transfer(opts *bind.TransactOpts, dst common.Address, wad *big.Int) (*types.Transaction, error) { 716 | return _Dai.contract.Transact(opts, "transfer", dst, wad) 717 | } 718 | 719 | // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 720 | // 721 | // Solidity: function transfer(address dst, uint256 wad) returns(bool) 722 | func (_Dai *DaiSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { 723 | return _Dai.Contract.Transfer(&_Dai.TransactOpts, dst, wad) 724 | } 725 | 726 | // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 727 | // 728 | // Solidity: function transfer(address dst, uint256 wad) returns(bool) 729 | func (_Dai *DaiTransactorSession) Transfer(dst common.Address, wad *big.Int) (*types.Transaction, error) { 730 | return _Dai.Contract.Transfer(&_Dai.TransactOpts, dst, wad) 731 | } 732 | 733 | // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 734 | // 735 | // Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) 736 | func (_Dai *DaiTransactor) TransferFrom(opts *bind.TransactOpts, src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { 737 | return _Dai.contract.Transact(opts, "transferFrom", src, dst, wad) 738 | } 739 | 740 | // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 741 | // 742 | // Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) 743 | func (_Dai *DaiSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { 744 | return _Dai.Contract.TransferFrom(&_Dai.TransactOpts, src, dst, wad) 745 | } 746 | 747 | // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 748 | // 749 | // Solidity: function transferFrom(address src, address dst, uint256 wad) returns(bool) 750 | func (_Dai *DaiTransactorSession) TransferFrom(src common.Address, dst common.Address, wad *big.Int) (*types.Transaction, error) { 751 | return _Dai.Contract.TransferFrom(&_Dai.TransactOpts, src, dst, wad) 752 | } 753 | 754 | // DaiApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Dai contract. 755 | type DaiApprovalIterator struct { 756 | Event *DaiApproval // Event containing the contract specifics and raw log 757 | 758 | contract *bind.BoundContract // Generic contract to use for unpacking event data 759 | event string // Event name to use for unpacking event data 760 | 761 | logs chan types.Log // Log channel receiving the found contract events 762 | sub ethereum.Subscription // Subscription for errors, completion and termination 763 | done bool // Whether the subscription completed delivering logs 764 | fail error // Occurred error to stop iteration 765 | } 766 | 767 | // Next advances the iterator to the subsequent event, returning whether there 768 | // are any more events found. In case of a retrieval or parsing error, false is 769 | // returned and Error() can be queried for the exact failure. 770 | func (it *DaiApprovalIterator) Next() bool { 771 | // If the iterator failed, stop iterating 772 | if it.fail != nil { 773 | return false 774 | } 775 | // If the iterator completed, deliver directly whatever's available 776 | if it.done { 777 | select { 778 | case log := <-it.logs: 779 | it.Event = new(DaiApproval) 780 | if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 781 | it.fail = err 782 | return false 783 | } 784 | it.Event.Raw = log 785 | return true 786 | 787 | default: 788 | return false 789 | } 790 | } 791 | // Iterator still in progress, wait for either a data or an error event 792 | select { 793 | case log := <-it.logs: 794 | it.Event = new(DaiApproval) 795 | if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 796 | it.fail = err 797 | return false 798 | } 799 | it.Event.Raw = log 800 | return true 801 | 802 | case err := <-it.sub.Err(): 803 | it.done = true 804 | it.fail = err 805 | return it.Next() 806 | } 807 | } 808 | 809 | // Error returns any retrieval or parsing error occurred during filtering. 810 | func (it *DaiApprovalIterator) Error() error { 811 | return it.fail 812 | } 813 | 814 | // Close terminates the iteration process, releasing any pending underlying 815 | // resources. 816 | func (it *DaiApprovalIterator) Close() error { 817 | it.sub.Unsubscribe() 818 | return nil 819 | } 820 | 821 | // DaiApproval represents a Approval event raised by the Dai contract. 822 | type DaiApproval struct { 823 | Src common.Address 824 | Guy common.Address 825 | Wad *big.Int 826 | Raw types.Log // Blockchain specific contextual infos 827 | } 828 | 829 | // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 830 | // 831 | // Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) 832 | func (_Dai *DaiFilterer) FilterApproval(opts *bind.FilterOpts, src []common.Address, guy []common.Address) (*DaiApprovalIterator, error) { 833 | 834 | var srcRule []interface{} 835 | for _, srcItem := range src { 836 | srcRule = append(srcRule, srcItem) 837 | } 838 | var guyRule []interface{} 839 | for _, guyItem := range guy { 840 | guyRule = append(guyRule, guyItem) 841 | } 842 | 843 | logs, sub, err := _Dai.contract.FilterLogs(opts, "Approval", srcRule, guyRule) 844 | if err != nil { 845 | return nil, err 846 | } 847 | return &DaiApprovalIterator{contract: _Dai.contract, event: "Approval", logs: logs, sub: sub}, nil 848 | } 849 | 850 | // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 851 | // 852 | // Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) 853 | func (_Dai *DaiFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *DaiApproval, src []common.Address, guy []common.Address) (event.Subscription, error) { 854 | 855 | var srcRule []interface{} 856 | for _, srcItem := range src { 857 | srcRule = append(srcRule, srcItem) 858 | } 859 | var guyRule []interface{} 860 | for _, guyItem := range guy { 861 | guyRule = append(guyRule, guyItem) 862 | } 863 | 864 | logs, sub, err := _Dai.contract.WatchLogs(opts, "Approval", srcRule, guyRule) 865 | if err != nil { 866 | return nil, err 867 | } 868 | return event.NewSubscription(func(quit <-chan struct{}) error { 869 | defer sub.Unsubscribe() 870 | for { 871 | select { 872 | case log := <-logs: 873 | // New log arrived, parse the event and forward to the user 874 | event := new(DaiApproval) 875 | if err := _Dai.contract.UnpackLog(event, "Approval", log); err != nil { 876 | return err 877 | } 878 | event.Raw = log 879 | 880 | select { 881 | case sink <- event: 882 | case err := <-sub.Err(): 883 | return err 884 | case <-quit: 885 | return nil 886 | } 887 | case err := <-sub.Err(): 888 | return err 889 | case <-quit: 890 | return nil 891 | } 892 | } 893 | }), nil 894 | } 895 | 896 | // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 897 | // 898 | // Solidity: event Approval(address indexed src, address indexed guy, uint256 wad) 899 | func (_Dai *DaiFilterer) ParseApproval(log types.Log) (*DaiApproval, error) { 900 | event := new(DaiApproval) 901 | if err := _Dai.contract.UnpackLog(event, "Approval", log); err != nil { 902 | return nil, err 903 | } 904 | event.Raw = log 905 | return event, nil 906 | } 907 | 908 | // DaiTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Dai contract. 909 | type DaiTransferIterator struct { 910 | Event *DaiTransfer // Event containing the contract specifics and raw log 911 | 912 | contract *bind.BoundContract // Generic contract to use for unpacking event data 913 | event string // Event name to use for unpacking event data 914 | 915 | logs chan types.Log // Log channel receiving the found contract events 916 | sub ethereum.Subscription // Subscription for errors, completion and termination 917 | done bool // Whether the subscription completed delivering logs 918 | fail error // Occurred error to stop iteration 919 | } 920 | 921 | // Next advances the iterator to the subsequent event, returning whether there 922 | // are any more events found. In case of a retrieval or parsing error, false is 923 | // returned and Error() can be queried for the exact failure. 924 | func (it *DaiTransferIterator) Next() bool { 925 | // If the iterator failed, stop iterating 926 | if it.fail != nil { 927 | return false 928 | } 929 | // If the iterator completed, deliver directly whatever's available 930 | if it.done { 931 | select { 932 | case log := <-it.logs: 933 | it.Event = new(DaiTransfer) 934 | if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 935 | it.fail = err 936 | return false 937 | } 938 | it.Event.Raw = log 939 | return true 940 | 941 | default: 942 | return false 943 | } 944 | } 945 | // Iterator still in progress, wait for either a data or an error event 946 | select { 947 | case log := <-it.logs: 948 | it.Event = new(DaiTransfer) 949 | if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 950 | it.fail = err 951 | return false 952 | } 953 | it.Event.Raw = log 954 | return true 955 | 956 | case err := <-it.sub.Err(): 957 | it.done = true 958 | it.fail = err 959 | return it.Next() 960 | } 961 | } 962 | 963 | // Error returns any retrieval or parsing error occurred during filtering. 964 | func (it *DaiTransferIterator) Error() error { 965 | return it.fail 966 | } 967 | 968 | // Close terminates the iteration process, releasing any pending underlying 969 | // resources. 970 | func (it *DaiTransferIterator) Close() error { 971 | it.sub.Unsubscribe() 972 | return nil 973 | } 974 | 975 | // DaiTransfer represents a Transfer event raised by the Dai contract. 976 | type DaiTransfer struct { 977 | Src common.Address 978 | Dst common.Address 979 | Wad *big.Int 980 | Raw types.Log // Blockchain specific contextual infos 981 | } 982 | 983 | // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 984 | // 985 | // Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) 986 | func (_Dai *DaiFilterer) FilterTransfer(opts *bind.FilterOpts, src []common.Address, dst []common.Address) (*DaiTransferIterator, error) { 987 | 988 | var srcRule []interface{} 989 | for _, srcItem := range src { 990 | srcRule = append(srcRule, srcItem) 991 | } 992 | var dstRule []interface{} 993 | for _, dstItem := range dst { 994 | dstRule = append(dstRule, dstItem) 995 | } 996 | 997 | logs, sub, err := _Dai.contract.FilterLogs(opts, "Transfer", srcRule, dstRule) 998 | if err != nil { 999 | return nil, err 1000 | } 1001 | return &DaiTransferIterator{contract: _Dai.contract, event: "Transfer", logs: logs, sub: sub}, nil 1002 | } 1003 | 1004 | // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 1005 | // 1006 | // Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) 1007 | func (_Dai *DaiFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *DaiTransfer, src []common.Address, dst []common.Address) (event.Subscription, error) { 1008 | 1009 | var srcRule []interface{} 1010 | for _, srcItem := range src { 1011 | srcRule = append(srcRule, srcItem) 1012 | } 1013 | var dstRule []interface{} 1014 | for _, dstItem := range dst { 1015 | dstRule = append(dstRule, dstItem) 1016 | } 1017 | 1018 | logs, sub, err := _Dai.contract.WatchLogs(opts, "Transfer", srcRule, dstRule) 1019 | if err != nil { 1020 | return nil, err 1021 | } 1022 | return event.NewSubscription(func(quit <-chan struct{}) error { 1023 | defer sub.Unsubscribe() 1024 | for { 1025 | select { 1026 | case log := <-logs: 1027 | // New log arrived, parse the event and forward to the user 1028 | event := new(DaiTransfer) 1029 | if err := _Dai.contract.UnpackLog(event, "Transfer", log); err != nil { 1030 | return err 1031 | } 1032 | event.Raw = log 1033 | 1034 | select { 1035 | case sink <- event: 1036 | case err := <-sub.Err(): 1037 | return err 1038 | case <-quit: 1039 | return nil 1040 | } 1041 | case err := <-sub.Err(): 1042 | return err 1043 | case <-quit: 1044 | return nil 1045 | } 1046 | } 1047 | }), nil 1048 | } 1049 | 1050 | // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 1051 | // 1052 | // Solidity: event Transfer(address indexed src, address indexed dst, uint256 wad) 1053 | func (_Dai *DaiFilterer) ParseTransfer(log types.Log) (*DaiTransfer, error) { 1054 | event := new(DaiTransfer) 1055 | if err := _Dai.contract.UnpackLog(event, "Transfer", log); err != nil { 1056 | return nil, err 1057 | } 1058 | event.Raw = log 1059 | return event, nil 1060 | } 1061 | -------------------------------------------------------------------------------- /state/go.mod: -------------------------------------------------------------------------------- 1 | module state 2 | 3 | go 1.19 4 | 5 | require github.com/ethereum/go-ethereum v1.10.26 6 | 7 | require ( 8 | github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect 9 | github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect 10 | github.com/deckarep/golang-set v1.8.0 // indirect 11 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect 12 | github.com/go-ole/go-ole v1.2.1 // indirect 13 | github.com/go-stack/stack v1.8.0 // indirect 14 | github.com/gorilla/websocket v1.4.2 // indirect 15 | github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect 16 | github.com/tklauser/go-sysconf v0.3.5 // indirect 17 | github.com/tklauser/numcpus v0.2.2 // indirect 18 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect 19 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect 20 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect 21 | ) 22 | -------------------------------------------------------------------------------- /state/go.sum: -------------------------------------------------------------------------------- 1 | github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= 2 | github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= 3 | github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= 4 | github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= 5 | github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= 6 | github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= 7 | github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= 8 | github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= 9 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 10 | github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= 11 | github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= 12 | github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= 13 | github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= 14 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= 15 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= 16 | github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= 17 | github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqBmytw72s= 18 | github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= 19 | github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= 20 | github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= 21 | github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= 22 | github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= 23 | github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= 24 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 25 | github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= 26 | github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= 27 | github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= 28 | github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= 29 | github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 30 | github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= 31 | github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= 32 | github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= 33 | github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= 34 | github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= 35 | github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= 36 | github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= 37 | github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= 38 | github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= 39 | github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= 40 | github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= 41 | github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= 42 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 43 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 44 | github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= 45 | github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= 46 | github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= 47 | github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= 48 | github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= 49 | github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= 50 | github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= 51 | github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= 52 | github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= 53 | github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= 54 | github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= 55 | github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= 56 | github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= 57 | github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef h1:wHSqTBrZW24CsNJDfeh9Ex6Pm0Rcpc7qrgKBiL44vF4= 58 | github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= 59 | github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= 60 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= 61 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 62 | golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= 63 | golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 64 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= 65 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 66 | golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= 67 | golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= 68 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= 69 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= 70 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 71 | -------------------------------------------------------------------------------- /state/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "math" 6 | "math/big" 7 | "os" 8 | 9 | "github.com/ethereum/go-ethereum/common" 10 | "github.com/ethereum/go-ethereum/crypto" 11 | "github.com/ethereum/go-ethereum/ethclient" 12 | "github.com/ethereum/go-ethereum/rpc" 13 | ) 14 | 15 | //go:generate abigen --abi ./dai.abi --pkg main --type Dai --out ./dai.go 16 | type Dai interface { 17 | Allowance(common.Address, common.Address) (*big.Int, error) 18 | } 19 | 20 | func main() { 21 | // Create RPC Client 22 | rpcUrl := os.Getenv("ETH_RPC_URL") 23 | rpcClient, err := rpc.Dial(rpcUrl) 24 | if err != nil { 25 | fmt.Printf("Failed to construct rpc client: %v\n", err) 26 | os.Exit(1) 27 | } 28 | _ = ethclient.NewClient(rpcClient) 29 | fmt.Println("✅ Configured RPC Client") 30 | 31 | // Setup Transaction Variables 32 | fromAddress := common.HexToAddress("0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe") 33 | toAddress := common.HexToAddress("0x3FB7501f5e451509Da23aD25c331A0737ef514A2") 34 | allowanceSlot := 3 // Allowance slot (differs from contract to contract) 35 | dai := common.HexToAddress("0x6b175474e89094c44da98b954eedeac495271d0f") 36 | 37 | // In order to get the allowance slot for the stateDiff, we need to calculate the slot location. 38 | // The slot location is calculated by first hashing the from address with the allowance slot. 39 | // Then, we hash the to address with the that result. 40 | // slot: keccak256(toAddress . keccak256(fromAddress . allowanceSlot)) 41 | // Hash the from address with the slot 42 | intermediate := crypto.Keccak256(fromAddress.Bytes(), common.BigToHash(big.NewInt(int64(allowanceSlot))).Bytes()) 43 | finalBytes := crypto.Keccak256(toAddress.Bytes(), intermediate) 44 | finalString := common.Bytes2Hex(finalBytes) 45 | final := common.HexToHash(finalString) 46 | 47 | fmt.Printf("✅ Calculated slot location: %s\n", final) 48 | fmt.Printf("Expected: 2b0a4d104c15978ca553d6173c81b852539ee7ea7baee7307410d1b224a172eb\n") 49 | 50 | // Construct dai approval transaction 51 | // const { data } = await Dai.populateTransaction.allowance(fromAddr, toAddr); 52 | 53 | // eth_call default params 54 | defaultParams := []interface{}{ 55 | struct { 56 | From common.Address 57 | To common.Address 58 | Data string 59 | }{ 60 | From: fromAddress, 61 | To: dai, 62 | Data: "0x", 63 | }, 64 | "latest", 65 | } 66 | fmt.Printf("Using default params: %+v\n", defaultParams) 67 | 68 | // State Diff example 69 | inner := make(map[common.Hash]common.Hash) 70 | inner[final] = common.BigToHash(big.NewInt(math.MaxInt64)) 71 | stateDiff := make(map[common.Address]struct{ StateDiff interface{} }) 72 | stateDiff[dai] = struct{ StateDiff interface{} }{inner} 73 | 74 | // Call with no state overrides 75 | vanillaCall := rpcClient.Call("eth_call", "latest", defaultParams) 76 | 77 | // Call with state overrides 78 | statefulCall := rpcClient.Call("eth_call", "latest", defaultParams, stateDiff) 79 | 80 | // Print results 81 | fmt.Printf("✅ Vanilla call: %v\n", vanillaCall) 82 | fmt.Printf("✅ Stateful call: %v\n", statefulCall) 83 | } 84 | -------------------------------------------------------------------------------- /tracer/go.mod: -------------------------------------------------------------------------------- 1 | module tracer 2 | 3 | go 1.19 4 | 5 | require github.com/ethereum/go-ethereum v1.10.26 6 | 7 | require ( 8 | github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect 9 | github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect 10 | github.com/deckarep/golang-set v1.8.0 // indirect 11 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect 12 | github.com/go-ole/go-ole v1.2.1 // indirect 13 | github.com/go-stack/stack v1.8.0 // indirect 14 | github.com/gorilla/websocket v1.4.2 // indirect 15 | github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect 16 | github.com/tklauser/go-sysconf v0.3.5 // indirect 17 | github.com/tklauser/numcpus v0.2.2 // indirect 18 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect 19 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect 20 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect 21 | ) 22 | -------------------------------------------------------------------------------- /tracer/go.sum: -------------------------------------------------------------------------------- 1 | github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= 2 | github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= 3 | github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= 4 | github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= 5 | github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= 6 | github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= 7 | github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= 8 | github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= 9 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 10 | github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= 11 | github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= 12 | github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= 13 | github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= 14 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= 15 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= 16 | github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= 17 | github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqBmytw72s= 18 | github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= 19 | github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= 20 | github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= 21 | github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= 22 | github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= 23 | github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= 24 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 25 | github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= 26 | github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= 27 | github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= 28 | github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= 29 | github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 30 | github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= 31 | github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= 32 | github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= 33 | github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= 34 | github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= 35 | github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= 36 | github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= 37 | github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= 38 | github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= 39 | github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= 40 | github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= 41 | github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= 42 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 43 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 44 | github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= 45 | github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= 46 | github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= 47 | github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= 48 | github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= 49 | github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= 50 | github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= 51 | github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= 52 | github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= 53 | github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= 54 | github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= 55 | github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= 56 | github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= 57 | github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef h1:wHSqTBrZW24CsNJDfeh9Ex6Pm0Rcpc7qrgKBiL44vF4= 58 | github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= 59 | github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= 60 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= 61 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 62 | golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= 63 | golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 64 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= 65 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 66 | golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= 67 | golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= 68 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= 69 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= 70 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 71 | -------------------------------------------------------------------------------- /tracer/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "os" 7 | 8 | "github.com/ethereum/go-ethereum/common" 9 | "github.com/ethereum/go-ethereum/ethclient" 10 | "github.com/ethereum/go-ethereum/rpc" 11 | ) 12 | 13 | func main() { 14 | // Create RPC Client 15 | rpcUrl := os.Getenv("ETH_RPC_URL") 16 | rpcClient, err := rpc.Dial(rpcUrl) 17 | if err != nil { 18 | fmt.Printf("Failed to construct rpc client: %v\n", err) 19 | os.Exit(1) 20 | } 21 | ethClient := ethclient.NewClient(rpcClient) 22 | fmt.Println("✅ Configured RPC Client") 23 | 24 | // Get a Transaction Receipt 25 | txHashString := "0x818b700de19d807ff9fa23c52fd6afd9dad7a419e0b9e6124edeecb4f53cbca8" 26 | txHash := common.HexToHash(txHashString) 27 | tx, pending, err := ethClient.TransactionByHash(context.Background(), txHash) 28 | if err != nil { 29 | fmt.Printf("Failed to get tx with hash: %s\n", txHashString) 30 | os.Exit(1) 31 | } 32 | fmt.Printf("✅ Fetched transaction for hash: %s\n", txHashString) 33 | fmt.Printf("Is tx pending: %t\n", pending) 34 | fmt.Printf("Got tx by hash: %+v\n", tx) 35 | 36 | // Execute the debug trace call 37 | // Format: debug.TraceCall(args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, config *TraceConfig) (*ExecutionResult, error) 38 | 39 | rpcClient.Call( 40 | "debug_traceCall", 41 | "14586706", 42 | // { 43 | // from: txResp.from, 44 | // to: txResp.to, 45 | // value: toRpcHexString(txResp.value), 46 | // gas: toRpcHexString(txResp.gasLimit), 47 | // data: txResp.data, 48 | // }, 49 | // "14586706", 50 | // { 51 | // tracer: `{ 52 | // data: [], 53 | // fault: function(log) {}, 54 | // step: function(log) { 55 | // var s = log.op.toString(); 56 | // if(s == "LOG0" || s == "LOG1" || s == "LOG2" || s == "LOG3" || s == "LOG4") { 57 | // var myStack = []; 58 | // var stackLength = log.stack.length(); 59 | // for (var i = 0; i < stackLength; i++) { 60 | // myStack.unshift(log.stack.peek(i)); 61 | // } 62 | // 63 | // var offset = parseInt(myStack[stackLength - 1]); 64 | // var length = parseInt(myStack[stackLength - 2]); 65 | // this.data.push({ 66 | // op: s, 67 | // address: log.contract.getAddress(), 68 | // caller: log.contract.getCaller(), 69 | // stack: myStack, 70 | // memory: log.memory.slice(offset, offset + length), 71 | // }); 72 | // } 73 | // }, 74 | // result: function() { return this.data; }} 75 | // `, 76 | // }, 77 | ) 78 | } 79 | --------------------------------------------------------------------------------