github.com/InjectiveLabs/sdk-go@v1.53.0/wrappers/peggy.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 wrappers 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 // PeggyABI is the input ABI used to generate the binding from. 30 const PeggyABI = "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_peggyId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_powerThreshold\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"_validators\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_powers\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_tokenContract\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_eventNonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"_decimals\",\"type\":\"uint8\"}],\"name\":\"SendToCosmosEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_batchNonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_eventNonce\",\"type\":\"uint256\"}],\"name\":\"TransactionBatchExecutedEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_newValsetNonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"_validators\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_powers\",\"type\":\"uint256[]\"}],\"name\":\"ValsetUpdatedEvent\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_erc20Address\",\"type\":\"address\"}],\"name\":\"lastBatchNonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"seenTokens\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_tokenContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"sendToCosmos\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"state_lastBatchNonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_lastEventNonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_lastValsetCheckpoint\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_lastValsetNonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_peggyId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_powerThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_currentValidators\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_currentPowers\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_currentValsetNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"_v\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"_r\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"_s\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"_destinations\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_fees\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_batchNonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_tokenContract\",\"type\":\"address\"}],\"name\":\"submitBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_currentValidators\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_currentPowers\",\"type\":\"uint256[]\"},{\"internalType\":\"uint8[]\",\"name\":\"_v\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"_r\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"_s\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"_theHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_powerThreshold\",\"type\":\"uint256\"}],\"name\":\"testCheckValidatorSignatures\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_validators\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_powers\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_valsetNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_peggyId\",\"type\":\"bytes32\"}],\"name\":\"testMakeCheckpoint\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenDecimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenNames\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenSymbols\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_newValidators\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_newPowers\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_newValsetNonce\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"_currentValidators\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_currentPowers\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_currentValsetNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"_v\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"_r\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"_s\",\"type\":\"bytes32[]\"}],\"name\":\"updateValset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" 31 32 // Peggy is an auto generated Go binding around an Ethereum contract. 33 type Peggy struct { 34 PeggyCaller // Read-only binding to the contract 35 PeggyTransactor // Write-only binding to the contract 36 PeggyFilterer // Log filterer for contract events 37 } 38 39 // PeggyCaller is an auto generated read-only Go binding around an Ethereum contract. 40 type PeggyCaller struct { 41 contract *bind.BoundContract // Generic contract wrapper for the low level calls 42 } 43 44 // PeggyTransactor is an auto generated write-only Go binding around an Ethereum contract. 45 type PeggyTransactor struct { 46 contract *bind.BoundContract // Generic contract wrapper for the low level calls 47 } 48 49 // PeggyFilterer is an auto generated log filtering Go binding around an Ethereum contract events. 50 type PeggyFilterer struct { 51 contract *bind.BoundContract // Generic contract wrapper for the low level calls 52 } 53 54 // PeggySession is an auto generated Go binding around an Ethereum contract, 55 // with pre-set call and transact options. 56 type PeggySession struct { 57 Contract *Peggy // Generic contract binding to set the session for 58 CallOpts bind.CallOpts // Call options to use throughout this session 59 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 60 } 61 62 // PeggyCallerSession is an auto generated read-only Go binding around an Ethereum contract, 63 // with pre-set call options. 64 type PeggyCallerSession struct { 65 Contract *PeggyCaller // Generic contract caller binding to set the session for 66 CallOpts bind.CallOpts // Call options to use throughout this session 67 } 68 69 // PeggyTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 70 // with pre-set transact options. 71 type PeggyTransactorSession struct { 72 Contract *PeggyTransactor // Generic contract transactor binding to set the session for 73 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 74 } 75 76 // PeggyRaw is an auto generated low-level Go binding around an Ethereum contract. 77 type PeggyRaw struct { 78 Contract *Peggy // Generic contract binding to access the raw methods on 79 } 80 81 // PeggyCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 82 type PeggyCallerRaw struct { 83 Contract *PeggyCaller // Generic read-only contract binding to access the raw methods on 84 } 85 86 // PeggyTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 87 type PeggyTransactorRaw struct { 88 Contract *PeggyTransactor // Generic write-only contract binding to access the raw methods on 89 } 90 91 // NewPeggy creates a new instance of Peggy, bound to a specific deployed contract. 92 func NewPeggy(address common.Address, backend bind.ContractBackend) (*Peggy, error) { 93 contract, err := bindPeggy(address, backend, backend, backend) 94 if err != nil { 95 return nil, err 96 } 97 return &Peggy{PeggyCaller: PeggyCaller{contract: contract}, PeggyTransactor: PeggyTransactor{contract: contract}, PeggyFilterer: PeggyFilterer{contract: contract}}, nil 98 } 99 100 // NewPeggyCaller creates a new read-only instance of Peggy, bound to a specific deployed contract. 101 func NewPeggyCaller(address common.Address, caller bind.ContractCaller) (*PeggyCaller, error) { 102 contract, err := bindPeggy(address, caller, nil, nil) 103 if err != nil { 104 return nil, err 105 } 106 return &PeggyCaller{contract: contract}, nil 107 } 108 109 // NewPeggyTransactor creates a new write-only instance of Peggy, bound to a specific deployed contract. 110 func NewPeggyTransactor(address common.Address, transactor bind.ContractTransactor) (*PeggyTransactor, error) { 111 contract, err := bindPeggy(address, nil, transactor, nil) 112 if err != nil { 113 return nil, err 114 } 115 return &PeggyTransactor{contract: contract}, nil 116 } 117 118 // NewPeggyFilterer creates a new log filterer instance of Peggy, bound to a specific deployed contract. 119 func NewPeggyFilterer(address common.Address, filterer bind.ContractFilterer) (*PeggyFilterer, error) { 120 contract, err := bindPeggy(address, nil, nil, filterer) 121 if err != nil { 122 return nil, err 123 } 124 return &PeggyFilterer{contract: contract}, nil 125 } 126 127 // bindPeggy binds a generic wrapper to an already deployed contract. 128 func bindPeggy(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 129 parsed, err := abi.JSON(strings.NewReader(PeggyABI)) 130 if err != nil { 131 return nil, err 132 } 133 return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil 134 } 135 136 // Call invokes the (constant) contract method with params as input values and 137 // sets the output to result. The result type might be a single field for simple 138 // returns, a slice of interfaces for anonymous returns and a struct for named 139 // returns. 140 func (_Peggy *PeggyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 141 return _Peggy.Contract.PeggyCaller.contract.Call(opts, result, method, params...) 142 } 143 144 // Transfer initiates a plain transaction to move funds to the contract, calling 145 // its default method if one is available. 146 func (_Peggy *PeggyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 147 return _Peggy.Contract.PeggyTransactor.contract.Transfer(opts) 148 } 149 150 // Transact invokes the (paid) contract method with params as input values. 151 func (_Peggy *PeggyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 152 return _Peggy.Contract.PeggyTransactor.contract.Transact(opts, method, params...) 153 } 154 155 // Call invokes the (constant) contract method with params as input values and 156 // sets the output to result. The result type might be a single field for simple 157 // returns, a slice of interfaces for anonymous returns and a struct for named 158 // returns. 159 func (_Peggy *PeggyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 160 return _Peggy.Contract.contract.Call(opts, result, method, params...) 161 } 162 163 // Transfer initiates a plain transaction to move funds to the contract, calling 164 // its default method if one is available. 165 func (_Peggy *PeggyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 166 return _Peggy.Contract.contract.Transfer(opts) 167 } 168 169 // Transact invokes the (paid) contract method with params as input values. 170 func (_Peggy *PeggyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 171 return _Peggy.Contract.contract.Transact(opts, method, params...) 172 } 173 174 // LastBatchNonce is a free data retrieval call binding the contract method 0x011b2174. 175 // 176 // Solidity: function lastBatchNonce(address _erc20Address) view returns(uint256) 177 func (_Peggy *PeggyCaller) LastBatchNonce(opts *bind.CallOpts, _erc20Address common.Address) (*big.Int, error) { 178 var out []interface{} 179 err := _Peggy.contract.Call(opts, &out, "lastBatchNonce", _erc20Address) 180 181 if err != nil { 182 return *new(*big.Int), err 183 } 184 185 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 186 187 return out0, err 188 189 } 190 191 // LastBatchNonce is a free data retrieval call binding the contract method 0x011b2174. 192 // 193 // Solidity: function lastBatchNonce(address _erc20Address) view returns(uint256) 194 func (_Peggy *PeggySession) LastBatchNonce(_erc20Address common.Address) (*big.Int, error) { 195 return _Peggy.Contract.LastBatchNonce(&_Peggy.CallOpts, _erc20Address) 196 } 197 198 // LastBatchNonce is a free data retrieval call binding the contract method 0x011b2174. 199 // 200 // Solidity: function lastBatchNonce(address _erc20Address) view returns(uint256) 201 func (_Peggy *PeggyCallerSession) LastBatchNonce(_erc20Address common.Address) (*big.Int, error) { 202 return _Peggy.Contract.LastBatchNonce(&_Peggy.CallOpts, _erc20Address) 203 } 204 205 // SeenTokens is a free data retrieval call binding the contract method 0x13100091. 206 // 207 // Solidity: function seenTokens(address ) view returns(bool) 208 func (_Peggy *PeggyCaller) SeenTokens(opts *bind.CallOpts, arg0 common.Address) (bool, error) { 209 var out []interface{} 210 err := _Peggy.contract.Call(opts, &out, "seenTokens", arg0) 211 212 if err != nil { 213 return *new(bool), err 214 } 215 216 out0 := *abi.ConvertType(out[0], new(bool)).(*bool) 217 218 return out0, err 219 220 } 221 222 // SeenTokens is a free data retrieval call binding the contract method 0x13100091. 223 // 224 // Solidity: function seenTokens(address ) view returns(bool) 225 func (_Peggy *PeggySession) SeenTokens(arg0 common.Address) (bool, error) { 226 return _Peggy.Contract.SeenTokens(&_Peggy.CallOpts, arg0) 227 } 228 229 // SeenTokens is a free data retrieval call binding the contract method 0x13100091. 230 // 231 // Solidity: function seenTokens(address ) view returns(bool) 232 func (_Peggy *PeggyCallerSession) SeenTokens(arg0 common.Address) (bool, error) { 233 return _Peggy.Contract.SeenTokens(&_Peggy.CallOpts, arg0) 234 } 235 236 // StateLastBatchNonces is a free data retrieval call binding the contract method 0xdf97174b. 237 // 238 // Solidity: function state_lastBatchNonces(address ) view returns(uint256) 239 func (_Peggy *PeggyCaller) StateLastBatchNonces(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { 240 var out []interface{} 241 err := _Peggy.contract.Call(opts, &out, "state_lastBatchNonces", arg0) 242 243 if err != nil { 244 return *new(*big.Int), err 245 } 246 247 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 248 249 return out0, err 250 251 } 252 253 // StateLastBatchNonces is a free data retrieval call binding the contract method 0xdf97174b. 254 // 255 // Solidity: function state_lastBatchNonces(address ) view returns(uint256) 256 func (_Peggy *PeggySession) StateLastBatchNonces(arg0 common.Address) (*big.Int, error) { 257 return _Peggy.Contract.StateLastBatchNonces(&_Peggy.CallOpts, arg0) 258 } 259 260 // StateLastBatchNonces is a free data retrieval call binding the contract method 0xdf97174b. 261 // 262 // Solidity: function state_lastBatchNonces(address ) view returns(uint256) 263 func (_Peggy *PeggyCallerSession) StateLastBatchNonces(arg0 common.Address) (*big.Int, error) { 264 return _Peggy.Contract.StateLastBatchNonces(&_Peggy.CallOpts, arg0) 265 } 266 267 // StateLastEventNonce is a free data retrieval call binding the contract method 0x73b20547. 268 // 269 // Solidity: function state_lastEventNonce() view returns(uint256) 270 func (_Peggy *PeggyCaller) StateLastEventNonce(opts *bind.CallOpts) (*big.Int, error) { 271 var out []interface{} 272 err := _Peggy.contract.Call(opts, &out, "state_lastEventNonce") 273 274 if err != nil { 275 return *new(*big.Int), err 276 } 277 278 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 279 280 return out0, err 281 282 } 283 284 // StateLastEventNonce is a free data retrieval call binding the contract method 0x73b20547. 285 // 286 // Solidity: function state_lastEventNonce() view returns(uint256) 287 func (_Peggy *PeggySession) StateLastEventNonce() (*big.Int, error) { 288 return _Peggy.Contract.StateLastEventNonce(&_Peggy.CallOpts) 289 } 290 291 // StateLastEventNonce is a free data retrieval call binding the contract method 0x73b20547. 292 // 293 // Solidity: function state_lastEventNonce() view returns(uint256) 294 func (_Peggy *PeggyCallerSession) StateLastEventNonce() (*big.Int, error) { 295 return _Peggy.Contract.StateLastEventNonce(&_Peggy.CallOpts) 296 } 297 298 // StateLastValsetCheckpoint is a free data retrieval call binding the contract method 0xf2b53307. 299 // 300 // Solidity: function state_lastValsetCheckpoint() view returns(bytes32) 301 func (_Peggy *PeggyCaller) StateLastValsetCheckpoint(opts *bind.CallOpts) ([32]byte, error) { 302 var out []interface{} 303 err := _Peggy.contract.Call(opts, &out, "state_lastValsetCheckpoint") 304 305 if err != nil { 306 return *new([32]byte), err 307 } 308 309 out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) 310 311 return out0, err 312 313 } 314 315 // StateLastValsetCheckpoint is a free data retrieval call binding the contract method 0xf2b53307. 316 // 317 // Solidity: function state_lastValsetCheckpoint() view returns(bytes32) 318 func (_Peggy *PeggySession) StateLastValsetCheckpoint() ([32]byte, error) { 319 return _Peggy.Contract.StateLastValsetCheckpoint(&_Peggy.CallOpts) 320 } 321 322 // StateLastValsetCheckpoint is a free data retrieval call binding the contract method 0xf2b53307. 323 // 324 // Solidity: function state_lastValsetCheckpoint() view returns(bytes32) 325 func (_Peggy *PeggyCallerSession) StateLastValsetCheckpoint() ([32]byte, error) { 326 return _Peggy.Contract.StateLastValsetCheckpoint(&_Peggy.CallOpts) 327 } 328 329 // StateLastValsetNonce is a free data retrieval call binding the contract method 0xb56561fe. 330 // 331 // Solidity: function state_lastValsetNonce() view returns(uint256) 332 func (_Peggy *PeggyCaller) StateLastValsetNonce(opts *bind.CallOpts) (*big.Int, error) { 333 var out []interface{} 334 err := _Peggy.contract.Call(opts, &out, "state_lastValsetNonce") 335 336 if err != nil { 337 return *new(*big.Int), err 338 } 339 340 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 341 342 return out0, err 343 344 } 345 346 // StateLastValsetNonce is a free data retrieval call binding the contract method 0xb56561fe. 347 // 348 // Solidity: function state_lastValsetNonce() view returns(uint256) 349 func (_Peggy *PeggySession) StateLastValsetNonce() (*big.Int, error) { 350 return _Peggy.Contract.StateLastValsetNonce(&_Peggy.CallOpts) 351 } 352 353 // StateLastValsetNonce is a free data retrieval call binding the contract method 0xb56561fe. 354 // 355 // Solidity: function state_lastValsetNonce() view returns(uint256) 356 func (_Peggy *PeggyCallerSession) StateLastValsetNonce() (*big.Int, error) { 357 return _Peggy.Contract.StateLastValsetNonce(&_Peggy.CallOpts) 358 } 359 360 // StatePeggyId is a free data retrieval call binding the contract method 0x69dd3908. 361 // 362 // Solidity: function state_peggyId() view returns(bytes32) 363 func (_Peggy *PeggyCaller) StatePeggyId(opts *bind.CallOpts) ([32]byte, error) { 364 var out []interface{} 365 err := _Peggy.contract.Call(opts, &out, "state_peggyId") 366 367 if err != nil { 368 return *new([32]byte), err 369 } 370 371 out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) 372 373 return out0, err 374 375 } 376 377 // StatePeggyId is a free data retrieval call binding the contract method 0x69dd3908. 378 // 379 // Solidity: function state_peggyId() view returns(bytes32) 380 func (_Peggy *PeggySession) StatePeggyId() ([32]byte, error) { 381 return _Peggy.Contract.StatePeggyId(&_Peggy.CallOpts) 382 } 383 384 // StatePeggyId is a free data retrieval call binding the contract method 0x69dd3908. 385 // 386 // Solidity: function state_peggyId() view returns(bytes32) 387 func (_Peggy *PeggyCallerSession) StatePeggyId() ([32]byte, error) { 388 return _Peggy.Contract.StatePeggyId(&_Peggy.CallOpts) 389 } 390 391 // StatePowerThreshold is a free data retrieval call binding the contract method 0xe5a2b5d2. 392 // 393 // Solidity: function state_powerThreshold() view returns(uint256) 394 func (_Peggy *PeggyCaller) StatePowerThreshold(opts *bind.CallOpts) (*big.Int, error) { 395 var out []interface{} 396 err := _Peggy.contract.Call(opts, &out, "state_powerThreshold") 397 398 if err != nil { 399 return *new(*big.Int), err 400 } 401 402 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 403 404 return out0, err 405 406 } 407 408 // StatePowerThreshold is a free data retrieval call binding the contract method 0xe5a2b5d2. 409 // 410 // Solidity: function state_powerThreshold() view returns(uint256) 411 func (_Peggy *PeggySession) StatePowerThreshold() (*big.Int, error) { 412 return _Peggy.Contract.StatePowerThreshold(&_Peggy.CallOpts) 413 } 414 415 // StatePowerThreshold is a free data retrieval call binding the contract method 0xe5a2b5d2. 416 // 417 // Solidity: function state_powerThreshold() view returns(uint256) 418 func (_Peggy *PeggyCallerSession) StatePowerThreshold() (*big.Int, error) { 419 return _Peggy.Contract.StatePowerThreshold(&_Peggy.CallOpts) 420 } 421 422 // TestCheckValidatorSignatures is a free data retrieval call binding the contract method 0xdb7c4e57. 423 // 424 // Solidity: function testCheckValidatorSignatures(address[] _currentValidators, uint256[] _currentPowers, uint8[] _v, bytes32[] _r, bytes32[] _s, bytes32 _theHash, uint256 _powerThreshold) pure returns() 425 func (_Peggy *PeggyCaller) TestCheckValidatorSignatures(opts *bind.CallOpts, _currentValidators []common.Address, _currentPowers []*big.Int, _v []uint8, _r [][32]byte, _s [][32]byte, _theHash [32]byte, _powerThreshold *big.Int) error { 426 var out []interface{} 427 err := _Peggy.contract.Call(opts, &out, "testCheckValidatorSignatures", _currentValidators, _currentPowers, _v, _r, _s, _theHash, _powerThreshold) 428 429 if err != nil { 430 return err 431 } 432 433 return err 434 435 } 436 437 // TestCheckValidatorSignatures is a free data retrieval call binding the contract method 0xdb7c4e57. 438 // 439 // Solidity: function testCheckValidatorSignatures(address[] _currentValidators, uint256[] _currentPowers, uint8[] _v, bytes32[] _r, bytes32[] _s, bytes32 _theHash, uint256 _powerThreshold) pure returns() 440 func (_Peggy *PeggySession) TestCheckValidatorSignatures(_currentValidators []common.Address, _currentPowers []*big.Int, _v []uint8, _r [][32]byte, _s [][32]byte, _theHash [32]byte, _powerThreshold *big.Int) error { 441 return _Peggy.Contract.TestCheckValidatorSignatures(&_Peggy.CallOpts, _currentValidators, _currentPowers, _v, _r, _s, _theHash, _powerThreshold) 442 } 443 444 // TestCheckValidatorSignatures is a free data retrieval call binding the contract method 0xdb7c4e57. 445 // 446 // Solidity: function testCheckValidatorSignatures(address[] _currentValidators, uint256[] _currentPowers, uint8[] _v, bytes32[] _r, bytes32[] _s, bytes32 _theHash, uint256 _powerThreshold) pure returns() 447 func (_Peggy *PeggyCallerSession) TestCheckValidatorSignatures(_currentValidators []common.Address, _currentPowers []*big.Int, _v []uint8, _r [][32]byte, _s [][32]byte, _theHash [32]byte, _powerThreshold *big.Int) error { 448 return _Peggy.Contract.TestCheckValidatorSignatures(&_Peggy.CallOpts, _currentValidators, _currentPowers, _v, _r, _s, _theHash, _powerThreshold) 449 } 450 451 // TestMakeCheckpoint is a free data retrieval call binding the contract method 0xc227c30b. 452 // 453 // Solidity: function testMakeCheckpoint(address[] _validators, uint256[] _powers, uint256 _valsetNonce, bytes32 _peggyId) pure returns() 454 func (_Peggy *PeggyCaller) TestMakeCheckpoint(opts *bind.CallOpts, _validators []common.Address, _powers []*big.Int, _valsetNonce *big.Int, _peggyId [32]byte) error { 455 var out []interface{} 456 err := _Peggy.contract.Call(opts, &out, "testMakeCheckpoint", _validators, _powers, _valsetNonce, _peggyId) 457 458 if err != nil { 459 return err 460 } 461 462 return err 463 464 } 465 466 // TestMakeCheckpoint is a free data retrieval call binding the contract method 0xc227c30b. 467 // 468 // Solidity: function testMakeCheckpoint(address[] _validators, uint256[] _powers, uint256 _valsetNonce, bytes32 _peggyId) pure returns() 469 func (_Peggy *PeggySession) TestMakeCheckpoint(_validators []common.Address, _powers []*big.Int, _valsetNonce *big.Int, _peggyId [32]byte) error { 470 return _Peggy.Contract.TestMakeCheckpoint(&_Peggy.CallOpts, _validators, _powers, _valsetNonce, _peggyId) 471 } 472 473 // TestMakeCheckpoint is a free data retrieval call binding the contract method 0xc227c30b. 474 // 475 // Solidity: function testMakeCheckpoint(address[] _validators, uint256[] _powers, uint256 _valsetNonce, bytes32 _peggyId) pure returns() 476 func (_Peggy *PeggyCallerSession) TestMakeCheckpoint(_validators []common.Address, _powers []*big.Int, _valsetNonce *big.Int, _peggyId [32]byte) error { 477 return _Peggy.Contract.TestMakeCheckpoint(&_Peggy.CallOpts, _validators, _powers, _valsetNonce, _peggyId) 478 } 479 480 // TokenDecimals is a free data retrieval call binding the contract method 0x8ee573ac. 481 // 482 // Solidity: function tokenDecimals(address ) view returns(uint8) 483 func (_Peggy *PeggyCaller) TokenDecimals(opts *bind.CallOpts, arg0 common.Address) (uint8, error) { 484 var out []interface{} 485 err := _Peggy.contract.Call(opts, &out, "tokenDecimals", arg0) 486 487 if err != nil { 488 return *new(uint8), err 489 } 490 491 out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) 492 493 return out0, err 494 495 } 496 497 // TokenDecimals is a free data retrieval call binding the contract method 0x8ee573ac. 498 // 499 // Solidity: function tokenDecimals(address ) view returns(uint8) 500 func (_Peggy *PeggySession) TokenDecimals(arg0 common.Address) (uint8, error) { 501 return _Peggy.Contract.TokenDecimals(&_Peggy.CallOpts, arg0) 502 } 503 504 // TokenDecimals is a free data retrieval call binding the contract method 0x8ee573ac. 505 // 506 // Solidity: function tokenDecimals(address ) view returns(uint8) 507 func (_Peggy *PeggyCallerSession) TokenDecimals(arg0 common.Address) (uint8, error) { 508 return _Peggy.Contract.TokenDecimals(&_Peggy.CallOpts, arg0) 509 } 510 511 // TokenNames is a free data retrieval call binding the contract method 0xa8fc75e1. 512 // 513 // Solidity: function tokenNames(address ) view returns(string) 514 func (_Peggy *PeggyCaller) TokenNames(opts *bind.CallOpts, arg0 common.Address) (string, error) { 515 var out []interface{} 516 err := _Peggy.contract.Call(opts, &out, "tokenNames", arg0) 517 518 if err != nil { 519 return *new(string), err 520 } 521 522 out0 := *abi.ConvertType(out[0], new(string)).(*string) 523 524 return out0, err 525 526 } 527 528 // TokenNames is a free data retrieval call binding the contract method 0xa8fc75e1. 529 // 530 // Solidity: function tokenNames(address ) view returns(string) 531 func (_Peggy *PeggySession) TokenNames(arg0 common.Address) (string, error) { 532 return _Peggy.Contract.TokenNames(&_Peggy.CallOpts, arg0) 533 } 534 535 // TokenNames is a free data retrieval call binding the contract method 0xa8fc75e1. 536 // 537 // Solidity: function tokenNames(address ) view returns(string) 538 func (_Peggy *PeggyCallerSession) TokenNames(arg0 common.Address) (string, error) { 539 return _Peggy.Contract.TokenNames(&_Peggy.CallOpts, arg0) 540 } 541 542 // TokenSymbols is a free data retrieval call binding the contract method 0xfb0b2b36. 543 // 544 // Solidity: function tokenSymbols(address ) view returns(string) 545 func (_Peggy *PeggyCaller) TokenSymbols(opts *bind.CallOpts, arg0 common.Address) (string, error) { 546 var out []interface{} 547 err := _Peggy.contract.Call(opts, &out, "tokenSymbols", arg0) 548 549 if err != nil { 550 return *new(string), err 551 } 552 553 out0 := *abi.ConvertType(out[0], new(string)).(*string) 554 555 return out0, err 556 557 } 558 559 // TokenSymbols is a free data retrieval call binding the contract method 0xfb0b2b36. 560 // 561 // Solidity: function tokenSymbols(address ) view returns(string) 562 func (_Peggy *PeggySession) TokenSymbols(arg0 common.Address) (string, error) { 563 return _Peggy.Contract.TokenSymbols(&_Peggy.CallOpts, arg0) 564 } 565 566 // TokenSymbols is a free data retrieval call binding the contract method 0xfb0b2b36. 567 // 568 // Solidity: function tokenSymbols(address ) view returns(string) 569 func (_Peggy *PeggyCallerSession) TokenSymbols(arg0 common.Address) (string, error) { 570 return _Peggy.Contract.TokenSymbols(&_Peggy.CallOpts, arg0) 571 } 572 573 // SendToCosmos is a paid mutator transaction binding the contract method 0x5d2428fa. 574 // 575 // Solidity: function sendToCosmos(address _tokenContract, address _destination, uint256 _amount) returns() 576 func (_Peggy *PeggyTransactor) SendToCosmos(opts *bind.TransactOpts, _tokenContract common.Address, _destination common.Address, _amount *big.Int) (*types.Transaction, error) { 577 return _Peggy.contract.Transact(opts, "sendToCosmos", _tokenContract, _destination, _amount) 578 } 579 580 // SendToCosmos is a paid mutator transaction binding the contract method 0x5d2428fa. 581 // 582 // Solidity: function sendToCosmos(address _tokenContract, address _destination, uint256 _amount) returns() 583 func (_Peggy *PeggySession) SendToCosmos(_tokenContract common.Address, _destination common.Address, _amount *big.Int) (*types.Transaction, error) { 584 return _Peggy.Contract.SendToCosmos(&_Peggy.TransactOpts, _tokenContract, _destination, _amount) 585 } 586 587 // SendToCosmos is a paid mutator transaction binding the contract method 0x5d2428fa. 588 // 589 // Solidity: function sendToCosmos(address _tokenContract, address _destination, uint256 _amount) returns() 590 func (_Peggy *PeggyTransactorSession) SendToCosmos(_tokenContract common.Address, _destination common.Address, _amount *big.Int) (*types.Transaction, error) { 591 return _Peggy.Contract.SendToCosmos(&_Peggy.TransactOpts, _tokenContract, _destination, _amount) 592 } 593 594 // SubmitBatch is a paid mutator transaction binding the contract method 0xad131ec5. 595 // 596 // Solidity: function submitBatch(address[] _currentValidators, uint256[] _currentPowers, uint256 _currentValsetNonce, uint8[] _v, bytes32[] _r, bytes32[] _s, uint256[] _amounts, address[] _destinations, uint256[] _fees, uint256 _batchNonce, address _tokenContract) returns() 597 func (_Peggy *PeggyTransactor) SubmitBatch(opts *bind.TransactOpts, _currentValidators []common.Address, _currentPowers []*big.Int, _currentValsetNonce *big.Int, _v []uint8, _r [][32]byte, _s [][32]byte, _amounts []*big.Int, _destinations []common.Address, _fees []*big.Int, _batchNonce *big.Int, _tokenContract common.Address) (*types.Transaction, error) { 598 return _Peggy.contract.Transact(opts, "submitBatch", _currentValidators, _currentPowers, _currentValsetNonce, _v, _r, _s, _amounts, _destinations, _fees, _batchNonce, _tokenContract) 599 } 600 601 // SubmitBatch is a paid mutator transaction binding the contract method 0xad131ec5. 602 // 603 // Solidity: function submitBatch(address[] _currentValidators, uint256[] _currentPowers, uint256 _currentValsetNonce, uint8[] _v, bytes32[] _r, bytes32[] _s, uint256[] _amounts, address[] _destinations, uint256[] _fees, uint256 _batchNonce, address _tokenContract) returns() 604 func (_Peggy *PeggySession) SubmitBatch(_currentValidators []common.Address, _currentPowers []*big.Int, _currentValsetNonce *big.Int, _v []uint8, _r [][32]byte, _s [][32]byte, _amounts []*big.Int, _destinations []common.Address, _fees []*big.Int, _batchNonce *big.Int, _tokenContract common.Address) (*types.Transaction, error) { 605 return _Peggy.Contract.SubmitBatch(&_Peggy.TransactOpts, _currentValidators, _currentPowers, _currentValsetNonce, _v, _r, _s, _amounts, _destinations, _fees, _batchNonce, _tokenContract) 606 } 607 608 // SubmitBatch is a paid mutator transaction binding the contract method 0xad131ec5. 609 // 610 // Solidity: function submitBatch(address[] _currentValidators, uint256[] _currentPowers, uint256 _currentValsetNonce, uint8[] _v, bytes32[] _r, bytes32[] _s, uint256[] _amounts, address[] _destinations, uint256[] _fees, uint256 _batchNonce, address _tokenContract) returns() 611 func (_Peggy *PeggyTransactorSession) SubmitBatch(_currentValidators []common.Address, _currentPowers []*big.Int, _currentValsetNonce *big.Int, _v []uint8, _r [][32]byte, _s [][32]byte, _amounts []*big.Int, _destinations []common.Address, _fees []*big.Int, _batchNonce *big.Int, _tokenContract common.Address) (*types.Transaction, error) { 612 return _Peggy.Contract.SubmitBatch(&_Peggy.TransactOpts, _currentValidators, _currentPowers, _currentValsetNonce, _v, _r, _s, _amounts, _destinations, _fees, _batchNonce, _tokenContract) 613 } 614 615 // UpdateValset is a paid mutator transaction binding the contract method 0xe3cb9f62. 616 // 617 // Solidity: function updateValset(address[] _newValidators, uint256[] _newPowers, uint256 _newValsetNonce, address[] _currentValidators, uint256[] _currentPowers, uint256 _currentValsetNonce, uint8[] _v, bytes32[] _r, bytes32[] _s) returns() 618 func (_Peggy *PeggyTransactor) UpdateValset(opts *bind.TransactOpts, _newValidators []common.Address, _newPowers []*big.Int, _newValsetNonce *big.Int, _currentValidators []common.Address, _currentPowers []*big.Int, _currentValsetNonce *big.Int, _v []uint8, _r [][32]byte, _s [][32]byte) (*types.Transaction, error) { 619 return _Peggy.contract.Transact(opts, "updateValset", _newValidators, _newPowers, _newValsetNonce, _currentValidators, _currentPowers, _currentValsetNonce, _v, _r, _s) 620 } 621 622 // UpdateValset is a paid mutator transaction binding the contract method 0xe3cb9f62. 623 // 624 // Solidity: function updateValset(address[] _newValidators, uint256[] _newPowers, uint256 _newValsetNonce, address[] _currentValidators, uint256[] _currentPowers, uint256 _currentValsetNonce, uint8[] _v, bytes32[] _r, bytes32[] _s) returns() 625 func (_Peggy *PeggySession) UpdateValset(_newValidators []common.Address, _newPowers []*big.Int, _newValsetNonce *big.Int, _currentValidators []common.Address, _currentPowers []*big.Int, _currentValsetNonce *big.Int, _v []uint8, _r [][32]byte, _s [][32]byte) (*types.Transaction, error) { 626 return _Peggy.Contract.UpdateValset(&_Peggy.TransactOpts, _newValidators, _newPowers, _newValsetNonce, _currentValidators, _currentPowers, _currentValsetNonce, _v, _r, _s) 627 } 628 629 // UpdateValset is a paid mutator transaction binding the contract method 0xe3cb9f62. 630 // 631 // Solidity: function updateValset(address[] _newValidators, uint256[] _newPowers, uint256 _newValsetNonce, address[] _currentValidators, uint256[] _currentPowers, uint256 _currentValsetNonce, uint8[] _v, bytes32[] _r, bytes32[] _s) returns() 632 func (_Peggy *PeggyTransactorSession) UpdateValset(_newValidators []common.Address, _newPowers []*big.Int, _newValsetNonce *big.Int, _currentValidators []common.Address, _currentPowers []*big.Int, _currentValsetNonce *big.Int, _v []uint8, _r [][32]byte, _s [][32]byte) (*types.Transaction, error) { 633 return _Peggy.Contract.UpdateValset(&_Peggy.TransactOpts, _newValidators, _newPowers, _newValsetNonce, _currentValidators, _currentPowers, _currentValsetNonce, _v, _r, _s) 634 } 635 636 // PeggySendToCosmosEventIterator is returned from FilterSendToCosmosEvent and is used to iterate over the raw logs and unpacked data for SendToCosmosEvent events raised by the Peggy contract. 637 type PeggySendToCosmosEventIterator struct { 638 Event *PeggySendToCosmosEvent // Event containing the contract specifics and raw log 639 640 contract *bind.BoundContract // Generic contract to use for unpacking event data 641 event string // Event name to use for unpacking event data 642 643 logs chan types.Log // Log channel receiving the found contract events 644 sub ethereum.Subscription // Subscription for errors, completion and termination 645 done bool // Whether the subscription completed delivering logs 646 fail error // Occurred error to stop iteration 647 } 648 649 // Next advances the iterator to the subsequent event, returning whether there 650 // are any more events found. In case of a retrieval or parsing error, false is 651 // returned and Error() can be queried for the exact failure. 652 func (it *PeggySendToCosmosEventIterator) Next() bool { 653 // If the iterator failed, stop iterating 654 if it.fail != nil { 655 return false 656 } 657 // If the iterator completed, deliver directly whatever's available 658 if it.done { 659 select { 660 case log := <-it.logs: 661 it.Event = new(PeggySendToCosmosEvent) 662 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 663 it.fail = err 664 return false 665 } 666 it.Event.Raw = log 667 return true 668 669 default: 670 return false 671 } 672 } 673 // Iterator still in progress, wait for either a data or an error event 674 select { 675 case log := <-it.logs: 676 it.Event = new(PeggySendToCosmosEvent) 677 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 678 it.fail = err 679 return false 680 } 681 it.Event.Raw = log 682 return true 683 684 case err := <-it.sub.Err(): 685 it.done = true 686 it.fail = err 687 return it.Next() 688 } 689 } 690 691 // Error returns any retrieval or parsing error occurred during filtering. 692 func (it *PeggySendToCosmosEventIterator) Error() error { 693 return it.fail 694 } 695 696 // Close terminates the iteration process, releasing any pending underlying 697 // resources. 698 func (it *PeggySendToCosmosEventIterator) Close() error { 699 it.sub.Unsubscribe() 700 return nil 701 } 702 703 // PeggySendToCosmosEvent represents a SendToCosmosEvent event raised by the Peggy contract. 704 type PeggySendToCosmosEvent struct { 705 TokenContract common.Address 706 Sender common.Address 707 Destination common.Address 708 Amount *big.Int 709 EventNonce *big.Int 710 Name string 711 Symbol string 712 Decimals uint8 713 Raw types.Log // Blockchain specific contextual infos 714 } 715 716 // FilterSendToCosmosEvent is a free log retrieval operation binding the contract event 0x5b0cfcd9629f2864d66b907e3625f822058529e928617605883190ad34ecb96d. 717 // 718 // Solidity: event SendToCosmosEvent(address indexed _tokenContract, address indexed _sender, address indexed _destination, uint256 _amount, uint256 _eventNonce, string _name, string _symbol, uint8 _decimals) 719 func (_Peggy *PeggyFilterer) FilterSendToCosmosEvent(opts *bind.FilterOpts, _tokenContract []common.Address, _sender []common.Address, _destination []common.Address) (*PeggySendToCosmosEventIterator, error) { 720 721 var _tokenContractRule []interface{} 722 for _, _tokenContractItem := range _tokenContract { 723 _tokenContractRule = append(_tokenContractRule, _tokenContractItem) 724 } 725 var _senderRule []interface{} 726 for _, _senderItem := range _sender { 727 _senderRule = append(_senderRule, _senderItem) 728 } 729 var _destinationRule []interface{} 730 for _, _destinationItem := range _destination { 731 _destinationRule = append(_destinationRule, _destinationItem) 732 } 733 734 logs, sub, err := _Peggy.contract.FilterLogs(opts, "SendToCosmosEvent", _tokenContractRule, _senderRule, _destinationRule) 735 if err != nil { 736 return nil, err 737 } 738 return &PeggySendToCosmosEventIterator{contract: _Peggy.contract, event: "SendToCosmosEvent", logs: logs, sub: sub}, nil 739 } 740 741 // WatchSendToCosmosEvent is a free log subscription operation binding the contract event 0x5b0cfcd9629f2864d66b907e3625f822058529e928617605883190ad34ecb96d. 742 // 743 // Solidity: event SendToCosmosEvent(address indexed _tokenContract, address indexed _sender, address indexed _destination, uint256 _amount, uint256 _eventNonce, string _name, string _symbol, uint8 _decimals) 744 func (_Peggy *PeggyFilterer) WatchSendToCosmosEvent(opts *bind.WatchOpts, sink chan<- *PeggySendToCosmosEvent, _tokenContract []common.Address, _sender []common.Address, _destination []common.Address) (event.Subscription, error) { 745 746 var _tokenContractRule []interface{} 747 for _, _tokenContractItem := range _tokenContract { 748 _tokenContractRule = append(_tokenContractRule, _tokenContractItem) 749 } 750 var _senderRule []interface{} 751 for _, _senderItem := range _sender { 752 _senderRule = append(_senderRule, _senderItem) 753 } 754 var _destinationRule []interface{} 755 for _, _destinationItem := range _destination { 756 _destinationRule = append(_destinationRule, _destinationItem) 757 } 758 759 logs, sub, err := _Peggy.contract.WatchLogs(opts, "SendToCosmosEvent", _tokenContractRule, _senderRule, _destinationRule) 760 if err != nil { 761 return nil, err 762 } 763 return event.NewSubscription(func(quit <-chan struct{}) error { 764 defer sub.Unsubscribe() 765 for { 766 select { 767 case log := <-logs: 768 // New log arrived, parse the event and forward to the user 769 event := new(PeggySendToCosmosEvent) 770 if err := _Peggy.contract.UnpackLog(event, "SendToCosmosEvent", log); err != nil { 771 return err 772 } 773 event.Raw = log 774 775 select { 776 case sink <- event: 777 case err := <-sub.Err(): 778 return err 779 case <-quit: 780 return nil 781 } 782 case err := <-sub.Err(): 783 return err 784 case <-quit: 785 return nil 786 } 787 } 788 }), nil 789 } 790 791 // ParseSendToCosmosEvent is a log parse operation binding the contract event 0x5b0cfcd9629f2864d66b907e3625f822058529e928617605883190ad34ecb96d. 792 // 793 // Solidity: event SendToCosmosEvent(address indexed _tokenContract, address indexed _sender, address indexed _destination, uint256 _amount, uint256 _eventNonce, string _name, string _symbol, uint8 _decimals) 794 func (_Peggy *PeggyFilterer) ParseSendToCosmosEvent(log types.Log) (*PeggySendToCosmosEvent, error) { 795 event := new(PeggySendToCosmosEvent) 796 if err := _Peggy.contract.UnpackLog(event, "SendToCosmosEvent", log); err != nil { 797 return nil, err 798 } 799 event.Raw = log 800 return event, nil 801 } 802 803 // PeggyTransactionBatchExecutedEventIterator is returned from FilterTransactionBatchExecutedEvent and is used to iterate over the raw logs and unpacked data for TransactionBatchExecutedEvent events raised by the Peggy contract. 804 type PeggyTransactionBatchExecutedEventIterator struct { 805 Event *PeggyTransactionBatchExecutedEvent // Event containing the contract specifics and raw log 806 807 contract *bind.BoundContract // Generic contract to use for unpacking event data 808 event string // Event name to use for unpacking event data 809 810 logs chan types.Log // Log channel receiving the found contract events 811 sub ethereum.Subscription // Subscription for errors, completion and termination 812 done bool // Whether the subscription completed delivering logs 813 fail error // Occurred error to stop iteration 814 } 815 816 // Next advances the iterator to the subsequent event, returning whether there 817 // are any more events found. In case of a retrieval or parsing error, false is 818 // returned and Error() can be queried for the exact failure. 819 func (it *PeggyTransactionBatchExecutedEventIterator) Next() bool { 820 // If the iterator failed, stop iterating 821 if it.fail != nil { 822 return false 823 } 824 // If the iterator completed, deliver directly whatever's available 825 if it.done { 826 select { 827 case log := <-it.logs: 828 it.Event = new(PeggyTransactionBatchExecutedEvent) 829 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 830 it.fail = err 831 return false 832 } 833 it.Event.Raw = log 834 return true 835 836 default: 837 return false 838 } 839 } 840 // Iterator still in progress, wait for either a data or an error event 841 select { 842 case log := <-it.logs: 843 it.Event = new(PeggyTransactionBatchExecutedEvent) 844 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 845 it.fail = err 846 return false 847 } 848 it.Event.Raw = log 849 return true 850 851 case err := <-it.sub.Err(): 852 it.done = true 853 it.fail = err 854 return it.Next() 855 } 856 } 857 858 // Error returns any retrieval or parsing error occurred during filtering. 859 func (it *PeggyTransactionBatchExecutedEventIterator) Error() error { 860 return it.fail 861 } 862 863 // Close terminates the iteration process, releasing any pending underlying 864 // resources. 865 func (it *PeggyTransactionBatchExecutedEventIterator) Close() error { 866 it.sub.Unsubscribe() 867 return nil 868 } 869 870 // PeggyTransactionBatchExecutedEvent represents a TransactionBatchExecutedEvent event raised by the Peggy contract. 871 type PeggyTransactionBatchExecutedEvent struct { 872 BatchNonce *big.Int 873 Token common.Address 874 EventNonce *big.Int 875 Raw types.Log // Blockchain specific contextual infos 876 } 877 878 // FilterTransactionBatchExecutedEvent is a free log retrieval operation binding the contract event 0x02c7e81975f8edb86e2a0c038b7b86a49c744236abf0f6177ff5afc6986ab708. 879 // 880 // Solidity: event TransactionBatchExecutedEvent(uint256 indexed _batchNonce, address indexed _token, uint256 _eventNonce) 881 func (_Peggy *PeggyFilterer) FilterTransactionBatchExecutedEvent(opts *bind.FilterOpts, _batchNonce []*big.Int, _token []common.Address) (*PeggyTransactionBatchExecutedEventIterator, error) { 882 883 var _batchNonceRule []interface{} 884 for _, _batchNonceItem := range _batchNonce { 885 _batchNonceRule = append(_batchNonceRule, _batchNonceItem) 886 } 887 var _tokenRule []interface{} 888 for _, _tokenItem := range _token { 889 _tokenRule = append(_tokenRule, _tokenItem) 890 } 891 892 logs, sub, err := _Peggy.contract.FilterLogs(opts, "TransactionBatchExecutedEvent", _batchNonceRule, _tokenRule) 893 if err != nil { 894 return nil, err 895 } 896 return &PeggyTransactionBatchExecutedEventIterator{contract: _Peggy.contract, event: "TransactionBatchExecutedEvent", logs: logs, sub: sub}, nil 897 } 898 899 // WatchTransactionBatchExecutedEvent is a free log subscription operation binding the contract event 0x02c7e81975f8edb86e2a0c038b7b86a49c744236abf0f6177ff5afc6986ab708. 900 // 901 // Solidity: event TransactionBatchExecutedEvent(uint256 indexed _batchNonce, address indexed _token, uint256 _eventNonce) 902 func (_Peggy *PeggyFilterer) WatchTransactionBatchExecutedEvent(opts *bind.WatchOpts, sink chan<- *PeggyTransactionBatchExecutedEvent, _batchNonce []*big.Int, _token []common.Address) (event.Subscription, error) { 903 904 var _batchNonceRule []interface{} 905 for _, _batchNonceItem := range _batchNonce { 906 _batchNonceRule = append(_batchNonceRule, _batchNonceItem) 907 } 908 var _tokenRule []interface{} 909 for _, _tokenItem := range _token { 910 _tokenRule = append(_tokenRule, _tokenItem) 911 } 912 913 logs, sub, err := _Peggy.contract.WatchLogs(opts, "TransactionBatchExecutedEvent", _batchNonceRule, _tokenRule) 914 if err != nil { 915 return nil, err 916 } 917 return event.NewSubscription(func(quit <-chan struct{}) error { 918 defer sub.Unsubscribe() 919 for { 920 select { 921 case log := <-logs: 922 // New log arrived, parse the event and forward to the user 923 event := new(PeggyTransactionBatchExecutedEvent) 924 if err := _Peggy.contract.UnpackLog(event, "TransactionBatchExecutedEvent", log); err != nil { 925 return err 926 } 927 event.Raw = log 928 929 select { 930 case sink <- event: 931 case err := <-sub.Err(): 932 return err 933 case <-quit: 934 return nil 935 } 936 case err := <-sub.Err(): 937 return err 938 case <-quit: 939 return nil 940 } 941 } 942 }), nil 943 } 944 945 // ParseTransactionBatchExecutedEvent is a log parse operation binding the contract event 0x02c7e81975f8edb86e2a0c038b7b86a49c744236abf0f6177ff5afc6986ab708. 946 // 947 // Solidity: event TransactionBatchExecutedEvent(uint256 indexed _batchNonce, address indexed _token, uint256 _eventNonce) 948 func (_Peggy *PeggyFilterer) ParseTransactionBatchExecutedEvent(log types.Log) (*PeggyTransactionBatchExecutedEvent, error) { 949 event := new(PeggyTransactionBatchExecutedEvent) 950 if err := _Peggy.contract.UnpackLog(event, "TransactionBatchExecutedEvent", log); err != nil { 951 return nil, err 952 } 953 event.Raw = log 954 return event, nil 955 } 956 957 // PeggyValsetUpdatedEventIterator is returned from FilterValsetUpdatedEvent and is used to iterate over the raw logs and unpacked data for ValsetUpdatedEvent events raised by the Peggy contract. 958 type PeggyValsetUpdatedEventIterator struct { 959 Event *PeggyValsetUpdatedEvent // Event containing the contract specifics and raw log 960 961 contract *bind.BoundContract // Generic contract to use for unpacking event data 962 event string // Event name to use for unpacking event data 963 964 logs chan types.Log // Log channel receiving the found contract events 965 sub ethereum.Subscription // Subscription for errors, completion and termination 966 done bool // Whether the subscription completed delivering logs 967 fail error // Occurred error to stop iteration 968 } 969 970 // Next advances the iterator to the subsequent event, returning whether there 971 // are any more events found. In case of a retrieval or parsing error, false is 972 // returned and Error() can be queried for the exact failure. 973 func (it *PeggyValsetUpdatedEventIterator) Next() bool { 974 // If the iterator failed, stop iterating 975 if it.fail != nil { 976 return false 977 } 978 // If the iterator completed, deliver directly whatever's available 979 if it.done { 980 select { 981 case log := <-it.logs: 982 it.Event = new(PeggyValsetUpdatedEvent) 983 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 984 it.fail = err 985 return false 986 } 987 it.Event.Raw = log 988 return true 989 990 default: 991 return false 992 } 993 } 994 // Iterator still in progress, wait for either a data or an error event 995 select { 996 case log := <-it.logs: 997 it.Event = new(PeggyValsetUpdatedEvent) 998 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 999 it.fail = err 1000 return false 1001 } 1002 it.Event.Raw = log 1003 return true 1004 1005 case err := <-it.sub.Err(): 1006 it.done = true 1007 it.fail = err 1008 return it.Next() 1009 } 1010 } 1011 1012 // Error returns any retrieval or parsing error occurred during filtering. 1013 func (it *PeggyValsetUpdatedEventIterator) Error() error { 1014 return it.fail 1015 } 1016 1017 // Close terminates the iteration process, releasing any pending underlying 1018 // resources. 1019 func (it *PeggyValsetUpdatedEventIterator) Close() error { 1020 it.sub.Unsubscribe() 1021 return nil 1022 } 1023 1024 // PeggyValsetUpdatedEvent represents a ValsetUpdatedEvent event raised by the Peggy contract. 1025 type PeggyValsetUpdatedEvent struct { 1026 NewValsetNonce *big.Int 1027 Validators []common.Address 1028 Powers []*big.Int 1029 Raw types.Log // Blockchain specific contextual infos 1030 } 1031 1032 // FilterValsetUpdatedEvent is a free log retrieval operation binding the contract event 0xc6d025c076bafcdd040f00632d5e280b3a5188963f110f8c70c4f810184b30f3. 1033 // 1034 // Solidity: event ValsetUpdatedEvent(uint256 indexed _newValsetNonce, address[] _validators, uint256[] _powers) 1035 func (_Peggy *PeggyFilterer) FilterValsetUpdatedEvent(opts *bind.FilterOpts, _newValsetNonce []*big.Int) (*PeggyValsetUpdatedEventIterator, error) { 1036 1037 var _newValsetNonceRule []interface{} 1038 for _, _newValsetNonceItem := range _newValsetNonce { 1039 _newValsetNonceRule = append(_newValsetNonceRule, _newValsetNonceItem) 1040 } 1041 1042 logs, sub, err := _Peggy.contract.FilterLogs(opts, "ValsetUpdatedEvent", _newValsetNonceRule) 1043 if err != nil { 1044 return nil, err 1045 } 1046 return &PeggyValsetUpdatedEventIterator{contract: _Peggy.contract, event: "ValsetUpdatedEvent", logs: logs, sub: sub}, nil 1047 } 1048 1049 // WatchValsetUpdatedEvent is a free log subscription operation binding the contract event 0xc6d025c076bafcdd040f00632d5e280b3a5188963f110f8c70c4f810184b30f3. 1050 // 1051 // Solidity: event ValsetUpdatedEvent(uint256 indexed _newValsetNonce, address[] _validators, uint256[] _powers) 1052 func (_Peggy *PeggyFilterer) WatchValsetUpdatedEvent(opts *bind.WatchOpts, sink chan<- *PeggyValsetUpdatedEvent, _newValsetNonce []*big.Int) (event.Subscription, error) { 1053 1054 var _newValsetNonceRule []interface{} 1055 for _, _newValsetNonceItem := range _newValsetNonce { 1056 _newValsetNonceRule = append(_newValsetNonceRule, _newValsetNonceItem) 1057 } 1058 1059 logs, sub, err := _Peggy.contract.WatchLogs(opts, "ValsetUpdatedEvent", _newValsetNonceRule) 1060 if err != nil { 1061 return nil, err 1062 } 1063 return event.NewSubscription(func(quit <-chan struct{}) error { 1064 defer sub.Unsubscribe() 1065 for { 1066 select { 1067 case log := <-logs: 1068 // New log arrived, parse the event and forward to the user 1069 event := new(PeggyValsetUpdatedEvent) 1070 if err := _Peggy.contract.UnpackLog(event, "ValsetUpdatedEvent", log); err != nil { 1071 return err 1072 } 1073 event.Raw = log 1074 1075 select { 1076 case sink <- event: 1077 case err := <-sub.Err(): 1078 return err 1079 case <-quit: 1080 return nil 1081 } 1082 case err := <-sub.Err(): 1083 return err 1084 case <-quit: 1085 return nil 1086 } 1087 } 1088 }), nil 1089 } 1090 1091 // ParseValsetUpdatedEvent is a log parse operation binding the contract event 0xc6d025c076bafcdd040f00632d5e280b3a5188963f110f8c70c4f810184b30f3. 1092 // 1093 // Solidity: event ValsetUpdatedEvent(uint256 indexed _newValsetNonce, address[] _validators, uint256[] _powers) 1094 func (_Peggy *PeggyFilterer) ParseValsetUpdatedEvent(log types.Log) (*PeggyValsetUpdatedEvent, error) { 1095 event := new(PeggyValsetUpdatedEvent) 1096 if err := _Peggy.contract.UnpackLog(event, "ValsetUpdatedEvent", log); err != nil { 1097 return nil, err 1098 } 1099 event.Raw = log 1100 return event, nil 1101 }