github.com/prysmaticlabs/prysm@v1.4.4/contracts/deposit-contract/depositContract.go (about) 1 // Code generated - DO NOT EDIT. 2 // This file is a generated binding and any manual changes will be lost. 3 4 package depositcontract 5 6 import ( 7 "math/big" 8 "strings" 9 10 ethereum "github.com/ethereum/go-ethereum" 11 "github.com/ethereum/go-ethereum/accounts/abi" 12 "github.com/ethereum/go-ethereum/accounts/abi/bind" 13 "github.com/ethereum/go-ethereum/common" 14 "github.com/ethereum/go-ethereum/core/types" 15 "github.com/ethereum/go-ethereum/event" 16 ) 17 18 // Reference imports to suppress errors if they are not otherwise used. 19 var ( 20 _ = big.NewInt 21 _ = strings.NewReader 22 _ = ethereum.NotFound 23 _ = bind.Bind 24 _ = common.Big1 25 _ = types.BloomLookup 26 _ = event.NewSubscription 27 ) 28 29 // DepositContractABI is the input ABI used to generate the binding from. 30 const DepositContractABI = "[{\"name\":\"DepositEvent\",\"inputs\":[{\"type\":\"bytes\",\"name\":\"pubkey\",\"indexed\":false},{\"type\":\"bytes\",\"name\":\"withdrawal_credentials\",\"indexed\":false},{\"type\":\"bytes\",\"name\":\"amount\",\"indexed\":false},{\"type\":\"bytes\",\"name\":\"signature\",\"indexed\":false},{\"type\":\"bytes\",\"name\":\"index\",\"indexed\":false}],\"anonymous\":false,\"type\":\"event\"},{\"outputs\":[],\"inputs\":[{\"type\":\"address\",\"name\":\"_drain_address\"}],\"constant\":false,\"payable\":false,\"type\":\"constructor\"},{\"name\":\"get_deposit_root\",\"outputs\":[{\"type\":\"bytes32\",\"name\":\"out\"}],\"inputs\":[],\"constant\":true,\"payable\":false,\"type\":\"function\",\"gas\":95389},{\"name\":\"get_deposit_count\",\"outputs\":[{\"type\":\"bytes\",\"name\":\"out\"}],\"inputs\":[],\"constant\":true,\"payable\":false,\"type\":\"function\",\"gas\":17683},{\"name\":\"deposit\",\"outputs\":[],\"inputs\":[{\"type\":\"bytes\",\"name\":\"pubkey\"},{\"type\":\"bytes\",\"name\":\"withdrawal_credentials\"},{\"type\":\"bytes\",\"name\":\"signature\"},{\"type\":\"bytes32\",\"name\":\"deposit_data_root\"}],\"constant\":false,\"payable\":true,\"type\":\"function\",\"gas\":1754607},{\"name\":\"drain\",\"outputs\":[],\"inputs\":[],\"constant\":false,\"payable\":false,\"type\":\"function\",\"gas\":35793},{\"name\":\"drain_address\",\"outputs\":[{\"type\":\"address\",\"name\":\"out\"}],\"inputs\":[],\"constant\":true,\"payable\":false,\"type\":\"function\",\"gas\":663}]" 31 32 // DepositContractBin is the compiled bytecode used for deploying new contracts. 33 var DepositContractBin = "0x740100000000000000000000000000000000000000006020526f7fffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff8000000000000000000000000000000060605274012a05f1fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffed5fa0e000000000000000000000000000000000060a05260206112736101403934156100a157600080fd5b602061127360c03960c05160205181106100ba57600080fd5b50610140516002556101606000601f818352015b600061016051602081106100e157600080fd5b600360c052602060c0200154602082610180010152602081019050610160516020811061010d57600080fd5b600360c052602060c020015460208261018001015260208101905080610180526101809050602060c0825160208401600060025af161014b57600080fd5b60c0519050606051600161016051018060405190131561016a57600080fd5b809190121561017857600080fd5b6020811061018557600080fd5b600360c052602060c02001555b81516001018083528114156100ce575b505061125b56600035601c52740100000000000000000000000000000000000000006020526f7fffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff8000000000000000000000000000000060605274012a05f1fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffed5fa0e000000000000000000000000000000000060a052600015610265575b6101605261014052600061018052610140516101a0526101c060006008818352015b61018051600860008112156100da578060000360020a82046100e1565b8060020a82025b905090506101805260ff6101a051166101e052610180516101e0516101805101101561010c57600080fd5b6101e0516101805101610180526101a0517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff86000811215610155578060000360020a820461015c565b8060020a82025b905090506101a0525b81516001018083528114156100bd575b50506018600860208206610200016020828401111561019357600080fd5b60208061022082610180600060046015f15050818152809050905090508051602001806102c0828460006004600a8704601201f16101d057600080fd5b50506103206102c0516020818352015b60206103205111156101f15761020d565b6000610320516102e001535b81516001018083528114156101e0575b505060206102a05260406102c0510160206001820306601f8201039050610280525b6000610280511115156102415761025d565b602061028051036102a00151602061028051036102805261022f565b610160515650005b63c5f2892f60005114156104f757341561027e57600080fd5b6000610140526101405161016052600154610180526101a060006020818352015b60016001610180511614156103205760006101a051602081106102c157600080fd5b600060c052602060c02001546020826102400101526020810190506101605160208261024001015260208101905080610240526102409050602060c0825160208401600060025af161031257600080fd5b60c05190506101605261038e565b6000610160516020826101c00101526020810190506101a0516020811061034657600080fd5b600360c052602060c02001546020826101c0010152602081019050806101c0526101c09050602060c0825160208401600060025af161038457600080fd5b60c0519050610160525b610180600261039c57600080fd5b60028151048152505b815160010180835281141561029f575b505060006101605160208261046001015260208101905061014051610160516101805163806732896102e05260015461030052610300516006580161009b565b506103605260006103c0525b6103605160206001820306601f82010390506103c0511015156104235761043c565b6103c05161038001526103c0516020016103c052610401565b61018052610160526101405261036060088060208461046001018260208501600060046012f150508051820191505060006018602082066103e0016020828401111561048757600080fd5b60208061040082610140600060046015f150508181528090509050905060188060208461046001018260208501600060046014f150508051820191505080610460526104609050602060c0825160208401600060025af16104e757600080fd5b60c051905060005260206000f350005b63621fd13060005114156105f857341561051057600080fd5b63806732896101405260015461016052610160516006580161009b565b506101c0526000610220525b6101c05160206001820306601f82010390506102205110151561055b57610574565b610220516101e001526102205160200161022052610539565b6101c0805160200180610280828460006004600a8704601201f161059757600080fd5b50506102e0610280516020818352015b60206102e05111156105b8576105d4565b60006102e0516102a001535b81516001018083528114156105a7575b50506020610260526040610280510160206001820306601f8201039050610260f350005b6322895118600051141561105157605060043560040161014037603060043560040135111561062657600080fd5b60406024356004016101c037602060243560040135111561064657600080fd5b608060443560040161022037606060443560040135111561066657600080fd5b63ffffffff6001541061067857600080fd5b633b9aca006102e0526102e05161068e57600080fd5b6102e05134046102c052633b9aca006102c05110156106ac57600080fd5b603061014051146106bc57600080fd5b60206101c051146106cc57600080fd5b606061022051146106dc57600080fd5b610140610360525b61036051516020610360510161036052610360610360511015610706576106e4565b6380673289610380526102c0516103a0526103a0516006580161009b565b50610400526000610460525b6104005160206001820306601f8201039050610460511015156107525761076b565b6104605161042001526104605160200161046052610730565b610340610360525b610360515260206103605103610360526101406103605110151561079657610773565b610400805160200180610300828460006004600a8704601201f16107b957600080fd5b5050610140610480525b610480515160206104805101610480526104806104805110156107e5576107c3565b63806732896104a0526001546104c0526104c0516006580161009b565b50610520526000610580525b6105205160206001820306601f82010390506105805110151561083057610849565b610580516105400152610580516020016105805261080e565b610460610480525b610480515260206104805103610480526101406104805110151561087457610851565b6105208051602001806105a0828460006004600a8704601201f161089757600080fd5b505060a06106205261062051610660526101408051602001806106205161066001828460006004600a8704601201f16108cf57600080fd5b5050610600610620516106600151610240818352015b6102406106005111156108f757610918565b600061060051610620516106800101535b81516001018083528114156108e5575b5050602061062051610660015160206001820306601f82010390506106205101016106205261062051610680526101c08051602001806106205161066001828460006004600a8704601201f161096d57600080fd5b5050610600610620516106600151610240818352015b610240610600511115610995576109b6565b600061060051610620516106800101535b8151600101808352811415610983575b5050602061062051610660015160206001820306601f820103905061062051010161062052610620516106a0526103008051602001806106205161066001828460006004600a8704601201f1610a0b57600080fd5b5050610600610620516106600151610240818352015b610240610600511115610a3357610a54565b600061060051610620516106800101535b8151600101808352811415610a21575b5050602061062051610660015160206001820306601f820103905061062051010161062052610620516106c0526102208051602001806106205161066001828460006004600a8704601201f1610aa957600080fd5b5050610600610620516106600151610240818352015b610240610600511115610ad157610af2565b600061060051610620516106800101535b8151600101808352811415610abf575b5050602061062051610660015160206001820306601f820103905061062051010161062052610620516106e0526105a08051602001806106205161066001828460006004600a8704601201f1610b4757600080fd5b5050610600610620516106600151610240818352015b610240610600511115610b6f57610b90565b600061060051610620516106800101535b8151600101808352811415610b5d575b5050602061062051610660015160206001820306601f8201039050610620510101610620527f649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c561062051610660a160006107005260006101406030806020846107c001018260208501600060046016f150508051820191505060006010602082066107400160208284011115610c2557600080fd5b60208061076082610700600060046015f15050818152809050905090506010806020846107c001018260208501600060046013f1505080518201915050806107c0526107c09050602060c0825160208401600060025af1610c8557600080fd5b60c0519050610720526000600060406020820661086001610220518284011115610cae57600080fd5b606080610880826020602088068803016102200160006004601bf1505081815280905090509050602060c0825160208401600060025af1610cee57600080fd5b60c0519050602082610a600101526020810190506000604060206020820661092001610220518284011115610d2257600080fd5b606080610940826020602088068803016102200160006004601bf15050818152809050905090506020806020846109e001018260208501600060046015f1505080518201915050610700516020826109e0010152602081019050806109e0526109e09050602060c0825160208401600060025af1610d9f57600080fd5b60c0519050602082610a6001015260208101905080610a6052610a609050602060c0825160208401600060025af1610dd657600080fd5b60c0519050610840526000600061072051602082610b000101526020810190506101c0602080602084610b0001018260208501600060046015f150508051820191505080610b0052610b009050602060c0825160208401600060025af1610e3c57600080fd5b60c0519050602082610c800101526020810190506000610300600880602084610c0001018260208501600060046012f15050805182019150506000601860208206610b800160208284011115610e9157600080fd5b602080610ba082610700600060046015f1505081815280905090509050601880602084610c0001018260208501600060046014f150508051820191505061084051602082610c0001015260208101905080610c0052610c009050602060c0825160208401600060025af1610f0457600080fd5b60c0519050602082610c8001015260208101905080610c8052610c809050602060c0825160208401600060025af1610f3b57600080fd5b60c0519050610ae052606435610ae05114610f5557600080fd5b6001805460018254011015610f6957600080fd5b6001815401815550600154610d0052610d2060006020818352015b60016001610d0051161415610fb957610ae051610d205160208110610fa857600080fd5b600060c052602060c020015561104d565b6000610d205160208110610fcc57600080fd5b600060c052602060c0200154602082610d40010152602081019050610ae051602082610d4001015260208101905080610d4052610d409050602060c0825160208401600060025af161101d57600080fd5b60c0519050610ae052610d00600261103457600080fd5b60028151048152505b8151600101808352811415610f84575b5050005b639890220b600051141561108557341561106a57600080fd5b600060006000600030316002546000f161108357600080fd5b005b638ba35cdf60005114156110ac57341561109e57600080fd5b60025460005260206000f350005b60006000fd5b6101a961125b036101a96000396101a961125b036000f3" 34 35 // DeployDepositContract deploys a new Ethereum contract, binding an instance of DepositContract to it. 36 func DeployDepositContract(auth *bind.TransactOpts, backend bind.ContractBackend, _drain_address common.Address) (common.Address, *types.Transaction, *DepositContract, error) { 37 parsed, err := abi.JSON(strings.NewReader(DepositContractABI)) 38 if err != nil { 39 return common.Address{}, nil, nil, err 40 } 41 42 address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(DepositContractBin), backend, _drain_address) 43 if err != nil { 44 return common.Address{}, nil, nil, err 45 } 46 return address, tx, &DepositContract{DepositContractCaller: DepositContractCaller{contract: contract}, DepositContractTransactor: DepositContractTransactor{contract: contract}, DepositContractFilterer: DepositContractFilterer{contract: contract}}, nil 47 } 48 49 // DepositContract is an auto generated Go binding around an Ethereum contract. 50 type DepositContract struct { 51 DepositContractCaller // Read-only binding to the contract 52 DepositContractTransactor // Write-only binding to the contract 53 DepositContractFilterer // Log filterer for contract events 54 } 55 56 // DepositContractCaller is an auto generated read-only Go binding around an Ethereum contract. 57 type DepositContractCaller struct { 58 contract *bind.BoundContract // Generic contract wrapper for the low level calls 59 } 60 61 // DepositContractTransactor is an auto generated write-only Go binding around an Ethereum contract. 62 type DepositContractTransactor struct { 63 contract *bind.BoundContract // Generic contract wrapper for the low level calls 64 } 65 66 // DepositContractFilterer is an auto generated log filtering Go binding around an Ethereum contract events. 67 type DepositContractFilterer struct { 68 contract *bind.BoundContract // Generic contract wrapper for the low level calls 69 } 70 71 // DepositContractSession is an auto generated Go binding around an Ethereum contract, 72 // with pre-set call and transact options. 73 type DepositContractSession struct { 74 Contract *DepositContract // Generic contract binding to set the session for 75 CallOpts bind.CallOpts // Call options to use throughout this session 76 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 77 } 78 79 // DepositContractCallerSession is an auto generated read-only Go binding around an Ethereum contract, 80 // with pre-set call options. 81 type DepositContractCallerSession struct { 82 Contract *DepositContractCaller // Generic contract caller binding to set the session for 83 CallOpts bind.CallOpts // Call options to use throughout this session 84 } 85 86 // DepositContractTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 87 // with pre-set transact options. 88 type DepositContractTransactorSession struct { 89 Contract *DepositContractTransactor // Generic contract transactor binding to set the session for 90 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 91 } 92 93 // DepositContractRaw is an auto generated low-level Go binding around an Ethereum contract. 94 type DepositContractRaw struct { 95 Contract *DepositContract // Generic contract binding to access the raw methods on 96 } 97 98 // DepositContractCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 99 type DepositContractCallerRaw struct { 100 Contract *DepositContractCaller // Generic read-only contract binding to access the raw methods on 101 } 102 103 // DepositContractTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 104 type DepositContractTransactorRaw struct { 105 Contract *DepositContractTransactor // Generic write-only contract binding to access the raw methods on 106 } 107 108 // NewDepositContract creates a new instance of DepositContract, bound to a specific deployed contract. 109 func NewDepositContract(address common.Address, backend bind.ContractBackend) (*DepositContract, error) { 110 contract, err := bindDepositContract(address, backend, backend, backend) 111 if err != nil { 112 return nil, err 113 } 114 return &DepositContract{DepositContractCaller: DepositContractCaller{contract: contract}, DepositContractTransactor: DepositContractTransactor{contract: contract}, DepositContractFilterer: DepositContractFilterer{contract: contract}}, nil 115 } 116 117 // NewDepositContractCaller creates a new read-only instance of DepositContract, bound to a specific deployed contract. 118 func NewDepositContractCaller(address common.Address, caller bind.ContractCaller) (*DepositContractCaller, error) { 119 contract, err := bindDepositContract(address, caller, nil, nil) 120 if err != nil { 121 return nil, err 122 } 123 return &DepositContractCaller{contract: contract}, nil 124 } 125 126 // NewDepositContractTransactor creates a new write-only instance of DepositContract, bound to a specific deployed contract. 127 func NewDepositContractTransactor(address common.Address, transactor bind.ContractTransactor) (*DepositContractTransactor, error) { 128 contract, err := bindDepositContract(address, nil, transactor, nil) 129 if err != nil { 130 return nil, err 131 } 132 return &DepositContractTransactor{contract: contract}, nil 133 } 134 135 // NewDepositContractFilterer creates a new log filterer instance of DepositContract, bound to a specific deployed contract. 136 func NewDepositContractFilterer(address common.Address, filterer bind.ContractFilterer) (*DepositContractFilterer, error) { 137 contract, err := bindDepositContract(address, nil, nil, filterer) 138 if err != nil { 139 return nil, err 140 } 141 return &DepositContractFilterer{contract: contract}, nil 142 } 143 144 // bindDepositContract binds a generic wrapper to an already deployed contract. 145 func bindDepositContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 146 parsed, err := abi.JSON(strings.NewReader(DepositContractABI)) 147 if err != nil { 148 return nil, err 149 } 150 return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil 151 } 152 153 // Call invokes the (constant) contract method with params as input values and 154 // sets the output to result. The result type might be a single field for simple 155 // returns, a slice of interfaces for anonymous returns and a struct for named 156 // returns. 157 func (_DepositContract *DepositContractRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 158 return _DepositContract.Contract.DepositContractCaller.contract.Call(opts, result, method, params...) 159 } 160 161 // Transfer initiates a plain transaction to move funds to the contract, calling 162 // its default method if one is available. 163 func (_DepositContract *DepositContractRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 164 return _DepositContract.Contract.DepositContractTransactor.contract.Transfer(opts) 165 } 166 167 // Transact invokes the (paid) contract method with params as input values. 168 func (_DepositContract *DepositContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 169 return _DepositContract.Contract.DepositContractTransactor.contract.Transact(opts, method, params...) 170 } 171 172 // Call invokes the (constant) contract method with params as input values and 173 // sets the output to result. The result type might be a single field for simple 174 // returns, a slice of interfaces for anonymous returns and a struct for named 175 // returns. 176 func (_DepositContract *DepositContractCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 177 return _DepositContract.Contract.contract.Call(opts, result, method, params...) 178 } 179 180 // Transfer initiates a plain transaction to move funds to the contract, calling 181 // its default method if one is available. 182 func (_DepositContract *DepositContractTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 183 return _DepositContract.Contract.contract.Transfer(opts) 184 } 185 186 // Transact invokes the (paid) contract method with params as input values. 187 func (_DepositContract *DepositContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 188 return _DepositContract.Contract.contract.Transact(opts, method, params...) 189 } 190 191 // DrainAddress is a free data retrieval call binding the contract method 0x8ba35cdf. 192 // 193 // Solidity: function drain_address() returns(address out) 194 func (_DepositContract *DepositContractCaller) DrainAddress(opts *bind.CallOpts) (common.Address, error) { 195 var out []interface{} 196 err := _DepositContract.contract.Call(opts, &out, "drain_address") 197 198 if err != nil { 199 return *new(common.Address), err 200 } 201 202 out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) 203 204 return out0, err 205 206 } 207 208 // DrainAddress is a free data retrieval call binding the contract method 0x8ba35cdf. 209 // 210 // Solidity: function drain_address() returns(address out) 211 func (_DepositContract *DepositContractSession) DrainAddress() (common.Address, error) { 212 return _DepositContract.Contract.DrainAddress(&_DepositContract.CallOpts) 213 } 214 215 // DrainAddress is a free data retrieval call binding the contract method 0x8ba35cdf. 216 // 217 // Solidity: function drain_address() returns(address out) 218 func (_DepositContract *DepositContractCallerSession) DrainAddress() (common.Address, error) { 219 return _DepositContract.Contract.DrainAddress(&_DepositContract.CallOpts) 220 } 221 222 // GetDepositCount is a free data retrieval call binding the contract method 0x621fd130. 223 // 224 // Solidity: function get_deposit_count() returns(bytes out) 225 func (_DepositContract *DepositContractCaller) GetDepositCount(opts *bind.CallOpts) ([]byte, error) { 226 var out []interface{} 227 err := _DepositContract.contract.Call(opts, &out, "get_deposit_count") 228 229 if err != nil { 230 return *new([]byte), err 231 } 232 233 out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) 234 235 return out0, err 236 237 } 238 239 // GetDepositCount is a free data retrieval call binding the contract method 0x621fd130. 240 // 241 // Solidity: function get_deposit_count() returns(bytes out) 242 func (_DepositContract *DepositContractSession) GetDepositCount() ([]byte, error) { 243 return _DepositContract.Contract.GetDepositCount(&_DepositContract.CallOpts) 244 } 245 246 // GetDepositCount is a free data retrieval call binding the contract method 0x621fd130. 247 // 248 // Solidity: function get_deposit_count() returns(bytes out) 249 func (_DepositContract *DepositContractCallerSession) GetDepositCount() ([]byte, error) { 250 return _DepositContract.Contract.GetDepositCount(&_DepositContract.CallOpts) 251 } 252 253 // GetDepositRoot is a free data retrieval call binding the contract method 0xc5f2892f. 254 // 255 // Solidity: function get_deposit_root() returns(bytes32 out) 256 func (_DepositContract *DepositContractCaller) GetDepositRoot(opts *bind.CallOpts) ([32]byte, error) { 257 var out []interface{} 258 err := _DepositContract.contract.Call(opts, &out, "get_deposit_root") 259 260 if err != nil { 261 return *new([32]byte), err 262 } 263 264 out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) 265 266 return out0, err 267 268 } 269 270 // GetDepositRoot is a free data retrieval call binding the contract method 0xc5f2892f. 271 // 272 // Solidity: function get_deposit_root() returns(bytes32 out) 273 func (_DepositContract *DepositContractSession) GetDepositRoot() ([32]byte, error) { 274 return _DepositContract.Contract.GetDepositRoot(&_DepositContract.CallOpts) 275 } 276 277 // GetDepositRoot is a free data retrieval call binding the contract method 0xc5f2892f. 278 // 279 // Solidity: function get_deposit_root() returns(bytes32 out) 280 func (_DepositContract *DepositContractCallerSession) GetDepositRoot() ([32]byte, error) { 281 return _DepositContract.Contract.GetDepositRoot(&_DepositContract.CallOpts) 282 } 283 284 // Deposit is a paid mutator transaction binding the contract method 0x22895118. 285 // 286 // Solidity: function deposit(bytes pubkey, bytes withdrawal_credentials, bytes signature, bytes32 deposit_data_root) returns() 287 func (_DepositContract *DepositContractTransactor) Deposit(opts *bind.TransactOpts, pubkey []byte, withdrawal_credentials []byte, signature []byte, deposit_data_root [32]byte) (*types.Transaction, error) { 288 return _DepositContract.contract.Transact(opts, "deposit", pubkey, withdrawal_credentials, signature, deposit_data_root) 289 } 290 291 // Deposit is a paid mutator transaction binding the contract method 0x22895118. 292 // 293 // Solidity: function deposit(bytes pubkey, bytes withdrawal_credentials, bytes signature, bytes32 deposit_data_root) returns() 294 func (_DepositContract *DepositContractSession) Deposit(pubkey []byte, withdrawal_credentials []byte, signature []byte, deposit_data_root [32]byte) (*types.Transaction, error) { 295 return _DepositContract.Contract.Deposit(&_DepositContract.TransactOpts, pubkey, withdrawal_credentials, signature, deposit_data_root) 296 } 297 298 // Deposit is a paid mutator transaction binding the contract method 0x22895118. 299 // 300 // Solidity: function deposit(bytes pubkey, bytes withdrawal_credentials, bytes signature, bytes32 deposit_data_root) returns() 301 func (_DepositContract *DepositContractTransactorSession) Deposit(pubkey []byte, withdrawal_credentials []byte, signature []byte, deposit_data_root [32]byte) (*types.Transaction, error) { 302 return _DepositContract.Contract.Deposit(&_DepositContract.TransactOpts, pubkey, withdrawal_credentials, signature, deposit_data_root) 303 } 304 305 // Drain is a paid mutator transaction binding the contract method 0x9890220b. 306 // 307 // Solidity: function drain() returns() 308 func (_DepositContract *DepositContractTransactor) Drain(opts *bind.TransactOpts) (*types.Transaction, error) { 309 return _DepositContract.contract.Transact(opts, "drain") 310 } 311 312 // Drain is a paid mutator transaction binding the contract method 0x9890220b. 313 // 314 // Solidity: function drain() returns() 315 func (_DepositContract *DepositContractSession) Drain() (*types.Transaction, error) { 316 return _DepositContract.Contract.Drain(&_DepositContract.TransactOpts) 317 } 318 319 // Drain is a paid mutator transaction binding the contract method 0x9890220b. 320 // 321 // Solidity: function drain() returns() 322 func (_DepositContract *DepositContractTransactorSession) Drain() (*types.Transaction, error) { 323 return _DepositContract.Contract.Drain(&_DepositContract.TransactOpts) 324 } 325 326 // DepositContractDepositEventIterator is returned from FilterDepositEvent and is used to iterate over the raw logs and unpacked data for DepositEvent events raised by the DepositContract contract. 327 type DepositContractDepositEventIterator struct { 328 Event *DepositContractDepositEvent // Event containing the contract specifics and raw log 329 330 contract *bind.BoundContract // Generic contract to use for unpacking event data 331 event string // Event name to use for unpacking event data 332 333 logs chan types.Log // Log channel receiving the found contract events 334 sub ethereum.Subscription // Subscription for errors, completion and termination 335 done bool // Whether the subscription completed delivering logs 336 fail error // Occurred error to stop iteration 337 } 338 339 // Next advances the iterator to the subsequent event, returning whether there 340 // are any more events found. In case of a retrieval or parsing error, false is 341 // returned and Error() can be queried for the exact failure. 342 func (it *DepositContractDepositEventIterator) Next() bool { 343 // If the iterator failed, stop iterating 344 if it.fail != nil { 345 return false 346 } 347 // If the iterator completed, deliver directly whatever's available 348 if it.done { 349 select { 350 case log := <-it.logs: 351 it.Event = new(DepositContractDepositEvent) 352 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 353 it.fail = err 354 return false 355 } 356 it.Event.Raw = log 357 return true 358 359 default: 360 return false 361 } 362 } 363 // Iterator still in progress, wait for either a data or an error event 364 select { 365 case log := <-it.logs: 366 it.Event = new(DepositContractDepositEvent) 367 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 368 it.fail = err 369 return false 370 } 371 it.Event.Raw = log 372 return true 373 374 case err := <-it.sub.Err(): 375 it.done = true 376 it.fail = err 377 return it.Next() 378 } 379 } 380 381 // Error returns any retrieval or parsing error occurred during filtering. 382 func (it *DepositContractDepositEventIterator) Error() error { 383 return it.fail 384 } 385 386 // Close terminates the iteration process, releasing any pending underlying 387 // resources. 388 func (it *DepositContractDepositEventIterator) Close() error { 389 it.sub.Unsubscribe() 390 return nil 391 } 392 393 // DepositContractDepositEvent represents a DepositEvent event raised by the DepositContract contract. 394 type DepositContractDepositEvent struct { 395 Pubkey []byte 396 WithdrawalCredentials []byte 397 Amount []byte 398 Signature []byte 399 Index []byte 400 Raw types.Log // Blockchain specific contextual infos 401 } 402 403 // FilterDepositEvent is a free log retrieval operation binding the contract event 0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5. 404 // 405 // Solidity: event DepositEvent(bytes pubkey, bytes withdrawal_credentials, bytes amount, bytes signature, bytes index) 406 func (_DepositContract *DepositContractFilterer) FilterDepositEvent(opts *bind.FilterOpts) (*DepositContractDepositEventIterator, error) { 407 408 logs, sub, err := _DepositContract.contract.FilterLogs(opts, "DepositEvent") 409 if err != nil { 410 return nil, err 411 } 412 return &DepositContractDepositEventIterator{contract: _DepositContract.contract, event: "DepositEvent", logs: logs, sub: sub}, nil 413 } 414 415 // WatchDepositEvent is a free log subscription operation binding the contract event 0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5. 416 // 417 // Solidity: event DepositEvent(bytes pubkey, bytes withdrawal_credentials, bytes amount, bytes signature, bytes index) 418 func (_DepositContract *DepositContractFilterer) WatchDepositEvent(opts *bind.WatchOpts, sink chan<- *DepositContractDepositEvent) (event.Subscription, error) { 419 420 logs, sub, err := _DepositContract.contract.WatchLogs(opts, "DepositEvent") 421 if err != nil { 422 return nil, err 423 } 424 return event.NewSubscription(func(quit <-chan struct{}) error { 425 defer sub.Unsubscribe() 426 for { 427 select { 428 case log := <-logs: 429 // New log arrived, parse the event and forward to the user 430 event := new(DepositContractDepositEvent) 431 if err := _DepositContract.contract.UnpackLog(event, "DepositEvent", log); err != nil { 432 return err 433 } 434 event.Raw = log 435 436 select { 437 case sink <- event: 438 case err := <-sub.Err(): 439 return err 440 case <-quit: 441 return nil 442 } 443 case err := <-sub.Err(): 444 return err 445 case <-quit: 446 return nil 447 } 448 } 449 }), nil 450 } 451 452 // ParseDepositEvent is a log parse operation binding the contract event 0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5. 453 // 454 // Solidity: event DepositEvent(bytes pubkey, bytes withdrawal_credentials, bytes amount, bytes signature, bytes index) 455 func (_DepositContract *DepositContractFilterer) ParseDepositEvent(log types.Log) (*DepositContractDepositEvent, error) { 456 event := new(DepositContractDepositEvent) 457 if err := _DepositContract.contract.UnpackLog(event, "DepositEvent", log); err != nil { 458 return nil, err 459 } 460 return event, nil 461 }