diff --git a/contracts/gen/gen.go b/contracts/gen/gen.go index 062c9b86..4ba136bc 100644 --- a/contracts/gen/gen.go +++ b/contracts/gen/gen.go @@ -38,10 +38,12 @@ //go:generate go run github.com/0xsequence/ethkit/cmd/ethkit abigen --pkg=niftyswap --type=INiftyswapExchange --outFile=niftyswap/iniftyswap_exchange.gen.go --artifactsFile=../artifacts/niftyswap/interfaces/INiftyswapExchange.sol/INiftyswapExchange.json //go:generate go run github.com/0xsequence/ethkit/cmd/ethkit abigen --pkg=niftyswap --type=INiftyswapExchange20 --outFile=niftyswap/iniftyswap_exchange_20.gen.go --artifactsFile=../artifacts/niftyswap/interfaces/INiftyswapExchange20.sol/INiftyswapExchange20.json //go:generate go run github.com/0xsequence/ethkit/cmd/ethkit abigen --pkg=niftyswap --type=INiftyswapFactory --outFile=niftyswap/iniftyswap_factory.gen.go --artifactsFile=../artifacts/niftyswap/interfaces/INiftyswapFactory.sol/INiftyswapFactory.json +//go:generate go run github.com/0xsequence/ethkit/cmd/ethkit abigen --pkg=niftyswap --type=INiftyswapFactory20 --outFile=niftyswap/iniftyswap_factory_20.gen.go --artifactsFile=../artifacts/niftyswap/interfaces/INiftyswapFactory20.sol/INiftyswapFactory20.json //go:generate go run github.com/0xsequence/ethkit/cmd/ethkit abigen --pkg=niftyswap --type=IWrapAndNiftyswap --outFile=niftyswap/iwrap_and_niftyswap.gen.go --artifactsFile=../artifacts/niftyswap/interfaces/IWrapAndNiftyswap.sol/IWrapAndNiftyswap.json //go:generate go run github.com/0xsequence/ethkit/cmd/ethkit abigen --pkg=niftyswap --type=NiftyswapExchange --outFile=niftyswap/niftyswap_exchange.gen.go --artifactsFile=../artifacts/niftyswap/exchange/NiftyswapExchange.sol/NiftyswapExchange.json //go:generate go run github.com/0xsequence/ethkit/cmd/ethkit abigen --pkg=niftyswap --type=NiftyswapExchange20 --outFile=niftyswap/niftyswap_exchange_20.gen.go --artifactsFile=../artifacts/niftyswap/exchange/NiftyswapExchange20.sol/NiftyswapExchange20.json //go:generate go run github.com/0xsequence/ethkit/cmd/ethkit abigen --pkg=niftyswap --type=NiftyswapFactory --outFile=niftyswap/niftyswap_factory.gen.go --artifactsFile=../artifacts/niftyswap/exchange/NiftyswapFactory.sol/NiftyswapFactory.json +//go:generate go run github.com/0xsequence/ethkit/cmd/ethkit abigen --pkg=niftyswap --type=NiftyswapFactory20 --outFile=niftyswap/niftyswap_factory_20.gen.go --artifactsFile=../artifacts/niftyswap/exchange/NiftyswapFactory20.sol/NiftyswapFactory20.json //go:generate go run github.com/0xsequence/ethkit/cmd/ethkit abigen --pkg=niftyswap --type=WrapAndNiftyswap --outFile=niftyswap/wrap_and_niftyswap.gen.go --artifactsFile=../artifacts/niftyswap/utils/WrapAndNiftyswap.sol/WrapAndNiftyswap.json // diff --git a/contracts/gen/niftyswap/iniftyswap_factory_20.gen.go b/contracts/gen/niftyswap/iniftyswap_factory_20.gen.go new file mode 100644 index 00000000..5ec8eb1f --- /dev/null +++ b/contracts/gen/niftyswap/iniftyswap_factory_20.gen.go @@ -0,0 +1,426 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package niftyswap + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/0xsequence/ethkit/go-ethereum" + "github.com/0xsequence/ethkit/go-ethereum/accounts/abi" + "github.com/0xsequence/ethkit/go-ethereum/accounts/abi/bind" + "github.com/0xsequence/ethkit/go-ethereum/common" + "github.com/0xsequence/ethkit/go-ethereum/core/types" + "github.com/0xsequence/ethkit/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// INiftyswapFactory20MetaData contains all meta data concerning the INiftyswapFactory20 contract. +var INiftyswapFactory20MetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"currency\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"exchange\",\"type\":\"address\"}],\"name\":\"NewExchange\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_currency\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_instance\",\"type\":\"uint256\"}],\"name\":\"createExchange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_currency\",\"type\":\"address\"}],\"name\":\"getPairExchanges\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_currency\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_instance\",\"type\":\"uint256\"}],\"name\":\"tokensToExchange\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +// INiftyswapFactory20ABI is the input ABI used to generate the binding from. +// Deprecated: Use INiftyswapFactory20MetaData.ABI instead. +var INiftyswapFactory20ABI = INiftyswapFactory20MetaData.ABI + +// INiftyswapFactory20 is an auto generated Go binding around an Ethereum contract. +type INiftyswapFactory20 struct { + INiftyswapFactory20Caller // Read-only binding to the contract + INiftyswapFactory20Transactor // Write-only binding to the contract + INiftyswapFactory20Filterer // Log filterer for contract events +} + +// INiftyswapFactory20Caller is an auto generated read-only Go binding around an Ethereum contract. +type INiftyswapFactory20Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// INiftyswapFactory20Transactor is an auto generated write-only Go binding around an Ethereum contract. +type INiftyswapFactory20Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// INiftyswapFactory20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type INiftyswapFactory20Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// INiftyswapFactory20Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type INiftyswapFactory20Session struct { + Contract *INiftyswapFactory20 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// INiftyswapFactory20CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type INiftyswapFactory20CallerSession struct { + Contract *INiftyswapFactory20Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// INiftyswapFactory20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type INiftyswapFactory20TransactorSession struct { + Contract *INiftyswapFactory20Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// INiftyswapFactory20Raw is an auto generated low-level Go binding around an Ethereum contract. +type INiftyswapFactory20Raw struct { + Contract *INiftyswapFactory20 // Generic contract binding to access the raw methods on +} + +// INiftyswapFactory20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type INiftyswapFactory20CallerRaw struct { + Contract *INiftyswapFactory20Caller // Generic read-only contract binding to access the raw methods on +} + +// INiftyswapFactory20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type INiftyswapFactory20TransactorRaw struct { + Contract *INiftyswapFactory20Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewINiftyswapFactory20 creates a new instance of INiftyswapFactory20, bound to a specific deployed contract. +func NewINiftyswapFactory20(address common.Address, backend bind.ContractBackend) (*INiftyswapFactory20, error) { + contract, err := bindINiftyswapFactory20(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &INiftyswapFactory20{INiftyswapFactory20Caller: INiftyswapFactory20Caller{contract: contract}, INiftyswapFactory20Transactor: INiftyswapFactory20Transactor{contract: contract}, INiftyswapFactory20Filterer: INiftyswapFactory20Filterer{contract: contract}}, nil +} + +// NewINiftyswapFactory20Caller creates a new read-only instance of INiftyswapFactory20, bound to a specific deployed contract. +func NewINiftyswapFactory20Caller(address common.Address, caller bind.ContractCaller) (*INiftyswapFactory20Caller, error) { + contract, err := bindINiftyswapFactory20(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &INiftyswapFactory20Caller{contract: contract}, nil +} + +// NewINiftyswapFactory20Transactor creates a new write-only instance of INiftyswapFactory20, bound to a specific deployed contract. +func NewINiftyswapFactory20Transactor(address common.Address, transactor bind.ContractTransactor) (*INiftyswapFactory20Transactor, error) { + contract, err := bindINiftyswapFactory20(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &INiftyswapFactory20Transactor{contract: contract}, nil +} + +// NewINiftyswapFactory20Filterer creates a new log filterer instance of INiftyswapFactory20, bound to a specific deployed contract. +func NewINiftyswapFactory20Filterer(address common.Address, filterer bind.ContractFilterer) (*INiftyswapFactory20Filterer, error) { + contract, err := bindINiftyswapFactory20(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &INiftyswapFactory20Filterer{contract: contract}, nil +} + +// bindINiftyswapFactory20 binds a generic wrapper to an already deployed contract. +func bindINiftyswapFactory20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(INiftyswapFactory20ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_INiftyswapFactory20 *INiftyswapFactory20Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _INiftyswapFactory20.Contract.INiftyswapFactory20Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_INiftyswapFactory20 *INiftyswapFactory20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _INiftyswapFactory20.Contract.INiftyswapFactory20Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_INiftyswapFactory20 *INiftyswapFactory20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _INiftyswapFactory20.Contract.INiftyswapFactory20Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_INiftyswapFactory20 *INiftyswapFactory20CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _INiftyswapFactory20.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_INiftyswapFactory20 *INiftyswapFactory20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _INiftyswapFactory20.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_INiftyswapFactory20 *INiftyswapFactory20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _INiftyswapFactory20.Contract.contract.Transact(opts, method, params...) +} + +// GetPairExchanges is a free data retrieval call binding the contract method 0x9b307388. +// +// Solidity: function getPairExchanges(address _token, address _currency) view returns(address[]) +func (_INiftyswapFactory20 *INiftyswapFactory20Caller) GetPairExchanges(opts *bind.CallOpts, _token common.Address, _currency common.Address) ([]common.Address, error) { + var out []interface{} + err := _INiftyswapFactory20.contract.Call(opts, &out, "getPairExchanges", _token, _currency) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +// GetPairExchanges is a free data retrieval call binding the contract method 0x9b307388. +// +// Solidity: function getPairExchanges(address _token, address _currency) view returns(address[]) +func (_INiftyswapFactory20 *INiftyswapFactory20Session) GetPairExchanges(_token common.Address, _currency common.Address) ([]common.Address, error) { + return _INiftyswapFactory20.Contract.GetPairExchanges(&_INiftyswapFactory20.CallOpts, _token, _currency) +} + +// GetPairExchanges is a free data retrieval call binding the contract method 0x9b307388. +// +// Solidity: function getPairExchanges(address _token, address _currency) view returns(address[]) +func (_INiftyswapFactory20 *INiftyswapFactory20CallerSession) GetPairExchanges(_token common.Address, _currency common.Address) ([]common.Address, error) { + return _INiftyswapFactory20.Contract.GetPairExchanges(&_INiftyswapFactory20.CallOpts, _token, _currency) +} + +// TokensToExchange is a free data retrieval call binding the contract method 0x1427474c. +// +// Solidity: function tokensToExchange(address _token, address _currency, uint256 _instance) view returns(address) +func (_INiftyswapFactory20 *INiftyswapFactory20Caller) TokensToExchange(opts *bind.CallOpts, _token common.Address, _currency common.Address, _instance *big.Int) (common.Address, error) { + var out []interface{} + err := _INiftyswapFactory20.contract.Call(opts, &out, "tokensToExchange", _token, _currency, _instance) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// TokensToExchange is a free data retrieval call binding the contract method 0x1427474c. +// +// Solidity: function tokensToExchange(address _token, address _currency, uint256 _instance) view returns(address) +func (_INiftyswapFactory20 *INiftyswapFactory20Session) TokensToExchange(_token common.Address, _currency common.Address, _instance *big.Int) (common.Address, error) { + return _INiftyswapFactory20.Contract.TokensToExchange(&_INiftyswapFactory20.CallOpts, _token, _currency, _instance) +} + +// TokensToExchange is a free data retrieval call binding the contract method 0x1427474c. +// +// Solidity: function tokensToExchange(address _token, address _currency, uint256 _instance) view returns(address) +func (_INiftyswapFactory20 *INiftyswapFactory20CallerSession) TokensToExchange(_token common.Address, _currency common.Address, _instance *big.Int) (common.Address, error) { + return _INiftyswapFactory20.Contract.TokensToExchange(&_INiftyswapFactory20.CallOpts, _token, _currency, _instance) +} + +// CreateExchange is a paid mutator transaction binding the contract method 0x8359289c. +// +// Solidity: function createExchange(address _token, address _currency, uint256 _instance) returns() +func (_INiftyswapFactory20 *INiftyswapFactory20Transactor) CreateExchange(opts *bind.TransactOpts, _token common.Address, _currency common.Address, _instance *big.Int) (*types.Transaction, error) { + return _INiftyswapFactory20.contract.Transact(opts, "createExchange", _token, _currency, _instance) +} + +// CreateExchange is a paid mutator transaction binding the contract method 0x8359289c. +// +// Solidity: function createExchange(address _token, address _currency, uint256 _instance) returns() +func (_INiftyswapFactory20 *INiftyswapFactory20Session) CreateExchange(_token common.Address, _currency common.Address, _instance *big.Int) (*types.Transaction, error) { + return _INiftyswapFactory20.Contract.CreateExchange(&_INiftyswapFactory20.TransactOpts, _token, _currency, _instance) +} + +// CreateExchange is a paid mutator transaction binding the contract method 0x8359289c. +// +// Solidity: function createExchange(address _token, address _currency, uint256 _instance) returns() +func (_INiftyswapFactory20 *INiftyswapFactory20TransactorSession) CreateExchange(_token common.Address, _currency common.Address, _instance *big.Int) (*types.Transaction, error) { + return _INiftyswapFactory20.Contract.CreateExchange(&_INiftyswapFactory20.TransactOpts, _token, _currency, _instance) +} + +// INiftyswapFactory20NewExchangeIterator is returned from FilterNewExchange and is used to iterate over the raw logs and unpacked data for NewExchange events raised by the INiftyswapFactory20 contract. +type INiftyswapFactory20NewExchangeIterator struct { + Event *INiftyswapFactory20NewExchange // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *INiftyswapFactory20NewExchangeIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(INiftyswapFactory20NewExchange) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(INiftyswapFactory20NewExchange) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *INiftyswapFactory20NewExchangeIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *INiftyswapFactory20NewExchangeIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// INiftyswapFactory20NewExchange represents a NewExchange event raised by the INiftyswapFactory20 contract. +type INiftyswapFactory20NewExchange struct { + Token common.Address + Currency common.Address + Salt *big.Int + Exchange common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNewExchange is a free log retrieval operation binding the contract event 0x23658fa6d505b3e3034045b3937d4239cbdaa345bfb0c4a2d6637ade8b85457c. +// +// Solidity: event NewExchange(address indexed token, address indexed currency, uint256 indexed salt, address exchange) +func (_INiftyswapFactory20 *INiftyswapFactory20Filterer) FilterNewExchange(opts *bind.FilterOpts, token []common.Address, currency []common.Address, salt []*big.Int) (*INiftyswapFactory20NewExchangeIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var currencyRule []interface{} + for _, currencyItem := range currency { + currencyRule = append(currencyRule, currencyItem) + } + var saltRule []interface{} + for _, saltItem := range salt { + saltRule = append(saltRule, saltItem) + } + + logs, sub, err := _INiftyswapFactory20.contract.FilterLogs(opts, "NewExchange", tokenRule, currencyRule, saltRule) + if err != nil { + return nil, err + } + return &INiftyswapFactory20NewExchangeIterator{contract: _INiftyswapFactory20.contract, event: "NewExchange", logs: logs, sub: sub}, nil +} + +// WatchNewExchange is a free log subscription operation binding the contract event 0x23658fa6d505b3e3034045b3937d4239cbdaa345bfb0c4a2d6637ade8b85457c. +// +// Solidity: event NewExchange(address indexed token, address indexed currency, uint256 indexed salt, address exchange) +func (_INiftyswapFactory20 *INiftyswapFactory20Filterer) WatchNewExchange(opts *bind.WatchOpts, sink chan<- *INiftyswapFactory20NewExchange, token []common.Address, currency []common.Address, salt []*big.Int) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var currencyRule []interface{} + for _, currencyItem := range currency { + currencyRule = append(currencyRule, currencyItem) + } + var saltRule []interface{} + for _, saltItem := range salt { + saltRule = append(saltRule, saltItem) + } + + logs, sub, err := _INiftyswapFactory20.contract.WatchLogs(opts, "NewExchange", tokenRule, currencyRule, saltRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(INiftyswapFactory20NewExchange) + if err := _INiftyswapFactory20.contract.UnpackLog(event, "NewExchange", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseNewExchange is a log parse operation binding the contract event 0x23658fa6d505b3e3034045b3937d4239cbdaa345bfb0c4a2d6637ade8b85457c. +// +// Solidity: event NewExchange(address indexed token, address indexed currency, uint256 indexed salt, address exchange) +func (_INiftyswapFactory20 *INiftyswapFactory20Filterer) ParseNewExchange(log types.Log) (*INiftyswapFactory20NewExchange, error) { + event := new(INiftyswapFactory20NewExchange) + if err := _INiftyswapFactory20.contract.UnpackLog(event, "NewExchange", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/contracts/gen/niftyswap/niftyswap_factory_20.gen.go b/contracts/gen/niftyswap/niftyswap_factory_20.gen.go new file mode 100644 index 00000000..3bc9ff2a --- /dev/null +++ b/contracts/gen/niftyswap/niftyswap_factory_20.gen.go @@ -0,0 +1,653 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package niftyswap + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/0xsequence/ethkit/go-ethereum" + "github.com/0xsequence/ethkit/go-ethereum/accounts/abi" + "github.com/0xsequence/ethkit/go-ethereum/accounts/abi/bind" + "github.com/0xsequence/ethkit/go-ethereum/common" + "github.com/0xsequence/ethkit/go-ethereum/core/types" + "github.com/0xsequence/ethkit/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// NiftyswapFactory20MetaData contains all meta data concerning the NiftyswapFactory20 contract. +var NiftyswapFactory20MetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_admin\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"currency\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"exchange\",\"type\":\"address\"}],\"name\":\"NewExchange\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_currency\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_instance\",\"type\":\"uint256\"}],\"name\":\"createExchange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_currency\",\"type\":\"address\"}],\"name\":\"getPairExchanges\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"tokensToExchange\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5060405161603c38038061603c8339818101604052602081101561003357600080fd5b5051600080546001600160a01b0319166001600160a01b03831690811782556040518392907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35050615fae8061008e6000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c8063893d20e811610050578063893d20e8146100f65780639b307388146100fe578063f2fde38b1461017c57610067565b80631427474c1461006c5780638359289c146100be575b600080fd5b6100a26004803603606081101561008257600080fd5b506001600160a01b038135811691602081013590911690604001356101a2565b604080516001600160a01b039092168252519081900360200190f35b6100f4600480360360608110156100d457600080fd5b506001600160a01b038135811691602081013590911690604001356101ce565b005b6100a2610344565b61012c6004803603604081101561011457600080fd5b506001600160a01b0381358116916020013516610353565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610168578181015183820152602001610150565b505050509050019250505060405180910390f35b6100f46004803603602081101561019257600080fd5b50356001600160a01b03166103d6565b60016020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b6001600160a01b03838116600090815260016020908152604080832086851684528252808320858452909152902054161561023a5760405162461bcd60e51b815260040180806020018281038252603b815260200180615f3e603b913960400191505060405180910390fd5b6000838360405161024a90610495565b6001600160a01b03928316815291166020820152604080519182900301906000f08015801561027d573d6000803e3d6000fd5b506001600160a01b0380861660008181526001602081815260408084208a87168086529083528185208a8652835281852080549789167fffffffffffffffffffffffff00000000000000000000000000000000000000009889168117909155868652600284528286208287528452828620805495860181558652948390209093018054909616841790955584519283529351949550869490937f23658fa6d505b3e3034045b3937d4239cbdaa345bfb0c4a2d6637ade8b85457c928290030190a450505050565b6000546001600160a01b031690565b6001600160a01b0380831660009081526002602090815260408083209385168352928152908290208054835181840281018401909452808452606093928301828280156103c957602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116103ab575b5050505050905092915050565b6000546001600160a01b031633146104095760405162461bcd60e51b8152600401610400906104ff565b60405180910390fd5b6001600160a01b03811661042f5760405162461bcd60e51b8152600401610400906104a2565b600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383811691821780845560405192939116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6159e18061055d83390190565b6020808252602a908201527f4f776e61626c65237472616e736665724f776e6572736869703a20494e56414c60408201527f49445f4144445245535300000000000000000000000000000000000000000000606082015260800190565b60208082526026908201527f4f776e61626c65236f6e6c794f776e65723a2053454e4445525f49535f4e4f5460408201527f5f4f574e4552000000000000000000000000000000000000000000000000000060608201526080019056fe6101006040523480156200001257600080fd5b50604051620059e1380380620059e1833981016040819052620000359162000263565b6000805460ff1916600117905560408051631127a41d60e31b815290513391829163893d20e891600480820192602092909190829003018186803b1580156200007d57600080fd5b505afa925050508015620000b0575060408051601f3d908101601f19168201909252620000ad918101906200023f565b60015b620000d85760405162461bcd60e51b8152600401620000cf90620002d1565b60405180910390fd5b50600380546001600160a01b0319166001600160a01b0383169081179091556040516000907ffca4bc097843727c93a8ab8d241a38481cccf8ec96dda1a342574712cfe8eb40908290a3506001600160a01b038216158015906200014457506001600160a01b03811615155b620001635760405162461bcd60e51b8152600401620000cf9062000308565b33606090811b60c0526001600160601b031983821b81166080529082901b1660a0526040516301ffc9a760e01b81526001600160a01b038316906301ffc9a790620001ba9063152a902d60e11b90600401620002bc565b60206040518083038186803b158015620001d357600080fd5b505afa92505050801562000206575060408051601f3d908101601f1916820190925262000203918101906200029a565b60015b62000211576200021a565b151560f81b60e0525b505062000355565b80516001600160a01b03811681146200023a57600080fd5b919050565b60006020828403121562000251578081fd5b6200025c8262000222565b9392505050565b6000806040838503121562000276578081fd5b620002818362000222565b9150620002916020840162000222565b90509250929050565b600060208284031215620002ac578081fd5b815180151581146200025c578182fd5b6001600160e01b031991909116815260200190565b60208082526015908201527f504152454e54204953204e4f54204f574e41424c450000000000000000000000604082015260600190565b6020808252602d908201527f4e696674797377617045786368616e6765323023636f6e7374727563746f723a60408201526c1253959053125117d253941555609a1b606082015260800190565b60805160601c60a05160601c60c05160601c60e05160f81c6155f5620003ec60003980611405525080610cf55250806107685280610c9452806111ff528061158d52806123df52806127f65280612b58528061309652508061053352806109745280610dac5280610f6052806110bb52806112dc52806114595280612bae52806130ec528061348d528061367a52506155f56000f3fe608060405234801561001057600080fd5b50600436106101cd5760003560e01c8063a22cb46511610104578063be571468116100a2578063e985e9c511610071578063e985e9c5146103e1578063f23a6e61146103f4578063f242432a14610407578063fca16c3b1461041a576101cd565b8063be57146814610392578063c7ed115e146103a5578063d93e8aaa146103c6578063e523d3fc146103d9576101cd565b8063a9c2e36c116100de578063a9c2e36c14610344578063aeaad2081461034c578063b5de3d141461035f578063bc197c8114610372576101cd565b8063a22cb4651461030b578063a63138751461031e578063a7380f6e14610331576101cd565b80632eb2c2d6116101715780636ee8e1341161014b5780636ee8e134146102ca578063863ed300146102dd57806389382ca0146102f0578063893d20e814610303576101cd565b80632eb2c2d61461029a57806346adf5ca146102af5780634e1273f4146102b7576101cd565b806310fe9ae8116101ad57806310fe9ae81461023f57806314556a5614610254578063209b96c5146102675780632bef5e3814610287576101cd565b80628e09d8146101ee578062fdd58e1461020c57806301ffc9a71461021f575b60405162461bcd60e51b81526004016101e5906146c8565b60405180910390fd5b6101f661042d565b60405161020391906152de565b60405180910390f35b6101f661021a366004613f18565b610433565b61023261022d36600461419d565b61045e565b6040516102039190614625565b610247610531565b60405161020391906144f4565b6101f6610262366004613d6a565b610555565b61027a610275366004613fd1565b610570565b60405161020391906145d9565b61027a610295366004613fd1565b610611565b6102ad6102a8366004613dda565b6106a9565b005b610247610766565b61027a6102c5366004613f70565b61078a565b6101f66102d836600461445e565b6108a3565b61027a6102eb366004614011565b61091d565b6102ad6102fe366004613d6a565b610aa3565b610247610b69565b6102ad610319366004613eeb565b610c04565b6102ad61032c366004613d6a565b610c72565b6101f661033f366004614489565b610cbe565b610247610cf3565b6101f661035a366004614489565b610d17565b6102ad61036d366004614419565b610d41565b610385610380366004613dda565b610f0a565b6040516102039190614630565b61027a6103a0366004614011565b611285565b6103b86103b336600461443d565b611400565b604051610203929190614560565b61027a6103d43660046140b5565b611545565b610247611756565b6102326103ef366004613da2565b611765565b610385610402366004613e84565b611793565b6102ad610415366004613e84565b611892565b6101f661042836600461445e565b611948565b60045490565b6001600160a01b03821660009081526001602090815260408083208484529091529020545b92915050565b60006001600160e01b031982167f36372b070000000000000000000000000000000000000000000000000000000014806104c157506001600160e01b031982167f01ffc9a700000000000000000000000000000000000000000000000000000000145b806104f557506001600160e01b031982167fd9b67a2600000000000000000000000000000000000000000000000000000000145b8061052957506001600160e01b031982167f4e2312e000000000000000000000000000000000000000000000000000000000145b90505b919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526008602052604090205490565b606081818167ffffffffffffffff8111801561058b57600080fd5b506040519080825280602002602001820160405280156105b5578160200160208202803683370190505b50905060005b8281101561060857600760008787848181106105d357fe5b905060200201358152602001908152602001600020548282815181106105f557fe5b60209081029190910101526001016105bb565b50949350505050565b606081818167ffffffffffffffff8111801561062c57600080fd5b50604051908082528060200260200182016040528015610656578160200160208202803683370190505b50905060005b82811015610608576006600087878481811061067457fe5b9050602002013581526020019081526020016000205482828151811061069657fe5b602090810291909101015260010161065c565b336001600160a01b03861614806106c557506106c58533611765565b6107005760405162461bcd60e51b815260040180806020018281038252602f8152602001806154bb602f913960400191505060405180910390fd5b6001600160a01b0384166107455760405162461bcd60e51b815260040180806020018281038252603081526020018061542f6030913960400191505060405180910390fd5b610751858585856119ad565b61075f858585855a86611c48565b5050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b606081518351146107cc5760405162461bcd60e51b815260040180806020018281038252602c81526020018061548f602c913960400191505060405180910390fd5b6060835167ffffffffffffffff811180156107e657600080fd5b50604051908082528060200260200182016040528015610810578160200160208202803683370190505b50905060005b845181101561089b576001600086838151811061082f57fe5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600085838151811061086557fe5b602002602001015181526020019081526020016000205482828151811061088857fe5b6020908102919091010152600101610816565b509392505050565b600080831180156108b45750600082115b6108d05760405162461bcd60e51b81526004016101e59061508a565b60006108de856103de611e59565b905060006108ec8285611e59565b9050600061090683610900886103e8611e59565b90611ecf565b905080828161091157fe5b04979650505050505050565b606083818167ffffffffffffffff8111801561093857600080fd5b50604051908082528060200260200182016040528015610962578160200160208202803683370190505b50905060005b82811015610a985760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031662fdd58e308b8b868181106109ad57fe5b905060200201356040518363ffffffff1660e01b81526004016109d1929190614560565b60206040518083038186803b1580156109e957600080fd5b505afa1580156109fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a219190614401565b9050610a78898984818110610a3257fe5b90506020020135888885818110610a4557fe5b9050602002013583600760008e8e89818110610a5d57fe5b90506020020135815260200190815260200160002054610cbe565b838381518110610a8457fe5b602090810291909101015250600101610968565b509695505050505050565b610aab610b69565b6001600160a01b0316336001600160a01b031614610adb5760405162461bcd60e51b81526004016101e5906151c7565b6001600160a01b038116610b015760405162461bcd60e51b81526004016101e590614b39565b600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0383811691821792839055604051919216907ffca4bc097843727c93a8ab8d241a38481cccf8ec96dda1a342574712cfe8eb4090600090a350565b600354604080517f893d20e800000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163893d20e8916004808301926020929190829003018186803b158015610bc757600080fd5b505afa158015610bdb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bff9190613d86565b905090565b3360008181526002602090815260408083206001600160a01b03871680855290835292819020805460ff1916861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b6001600160a01b03811660009081526008602052604081208054919055610cba7f00000000000000000000000000000000000000000000000000000000000000008383611f29565b5050565b600080610ccc8585856108a3565b90506000610cda8783611400565b9150610ce8905082826120a4565b979650505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b600080610d25858585611948565b90506000610d338783611400565b9150610ce890508282611ecf565b610d49610b69565b6001600160a01b0316336001600160a01b031614610d795760405162461bcd60e51b81526004016101e5906151c7565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906301ffc9a790610e01907f2a55205a0000000000000000000000000000000000000000000000000000000090600401614630565b60206040518083038186803b158015610e1957600080fd5b505afa158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e519190614181565b90508015610e715760405162461bcd60e51b81526004016101e590614f73565b6103de8310610e925760405162461bcd60e51b81526004016101e5906148bf565b6004839055600580547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0384169081179091556040517f02365318429bf1d603e8383b62068288a077545c5c9e709201d563b3f56ce2b390610efd9086906152de565b60405180910390a2505050565b60008082806020019051810190610f2191906141b9565b90506001600160e01b031981167fade79c7a00000000000000000000000000000000000000000000000000000000141561107e57336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f9d5760405162461bcd60e51b81526004016101e590614e36565b610fa5613a9e565b83806020019051810190610fb9919061432a565b8051909250600091506001600160a01b031615610fd7578151610fd9565b875b9050816060015151826040015151146110045760405162461bcd60e51b81526004016101e590614979565b60606110258888856020015186608001518688604001518960600151612101565b9050816001600160a01b0316896001600160a01b03167f89e4dbdd48f69e7920342e9ad9691b9a7150f254e6a0af177ccfd2556aab8bcd8a8a8560405161106e939291906145ec565b60405180910390a3505050611259565b6001600160e01b031981167f82da2b7300000000000000000000000000000000000000000000000000000000141561113557336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110f85760405162461bcd60e51b81526004016101e590614725565b611100613ad6565b8380602001905181019061111491906141d5565b90508091505061112f87878784600001518560200151612420565b50611259565b6001600160e01b031981167f5c0bf2590000000000000000000000000000000000000000000000000000000014156111c2573330146111865760405162461bcd60e51b81526004016101e590614bf3565b61118e613af0565b838060200190518101906111a2919061426e565b90508091505061112f87878784600001518560200151866040015161287b565b6001600160e01b031981167fc8c323f900000000000000000000000000000000000000000000000000000000141561124157336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461123c5760405162461bcd60e51b81526004016101e590614db3565b611259565b60405162461bcd60e51b81526004016101e590614adc565b507fbc197c81000000000000000000000000000000000000000000000000000000009695505050505050565b606083818167ffffffffffffffff811180156112a057600080fd5b506040519080825280602002602001820160405280156112ca578160200160208202803683370190505b50905060005b82811015610a985760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031662fdd58e308b8b8681811061131557fe5b905060200201356040518363ffffffff1660e01b8152600401611339929190614560565b60206040518083038186803b15801561135157600080fd5b505afa158015611365573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113899190614401565b90506113e089898481811061139a57fe5b905060200201358888858181106113ad57fe5b90506020020135600760008d8d888181106113c457fe5b9050602002013581526020019081526020016000205484610d17565b8383815181106113ec57fe5b6020908102919091010152506001016112d0565b6000807f000000000000000000000000000000000000000000000000000000000000000015611519576040517f2a55205a0000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632a55205a9061149090879087906004016152e7565b604080518083038186803b1580156114a757600080fd5b505afa9250505080156114d7575060408051601f3d908101601f191682019092526114d491810190613f43565b60015b61150f576005546004546001600160a01b0390911690611506906103e890611500908790611e59565b90612c7a565b9150915061153e565b909250905061153e565b6005546004546001600160a01b0390911690611506906103e890611500908790611e59565b9250929050565b6060428510156115675760405162461bcd60e51b81526004016101e590614c76565b60008851116115885760405162461bcd60e51b81526004016101e590614fd0565b6115b47f0000000000000000000000000000000000000000000000000000000000000000333089612ce4565b60006001600160a01b038516156115cb57846115cd565b335b84518451919250889181146115f45760405162461bcd60e51b81526004016101e590614979565b60005b818110156116e657600086828151811061160d57fe5b602002602001015111156116de5761164186828151811061162a57fe5b6020026020010151846120a490919063ffffffff16565b92506116a186828151811061165257fe5b6020026020010151600860008a858151811061166a57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054611ecf90919063ffffffff16565b600860008984815181106116b157fe5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055505b6001016115f7565b5060606116f68c8c858c88612e67565b9050836001600160a01b0316336001600160a01b03167fd38bc77e62e239476b3e25620d73f29a4a188e808aad79f4a81aaf44871a7a308e8e8560405161173f939291906145ec565b60405180910390a39b9a5050505050505050505050565b6005546001600160a01b031690565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b6040805160018082528183019092526000916060919060208083019080368337505060408051600180825281830190925292935060609291506020808301908036833701905050905085826000815181106117ea57fe5b602002602001018181525050848160008151811061180457fe5b60200260200101818152505061181d8888848488610f0a565b6001600160e01b0319167fbc197c8100000000000000000000000000000000000000000000000000000000146118655760405162461bcd60e51b81526004016101e590614d30565b507ff23a6e6100000000000000000000000000000000000000000000000000000000979650505050505050565b336001600160a01b03861614806118ae57506118ae8533611765565b6118e95760405162461bcd60e51b815260040180806020018281038252602a81526020018061539f602a913960400191505060405180910390fd5b6001600160a01b03841661192e5760405162461bcd60e51b815260040180806020018281038252602b815260200180615374602b913960400191505060405180910390fd5b61193a85858585613172565b61075f858585855a86613253565b600080831180156119595750600082115b6119755760405162461bcd60e51b81526004016101e590614b96565b600061198d6103e86119878688611e59565b90611e59565b905060006119a16103de61198786896120a4565b9050610a9882826133de565b80518251146119ed5760405162461bcd60e51b81526004018080602001828103825260358152602001806153fa6035913960400191505060405180910390fd5b815160005b81811015611b6757611a69838281518110611a0957fe5b602002602001015160016000896001600160a01b03166001600160a01b031681526020019081526020016000206000878581518110611a4457fe5b60200260200101518152602001908152602001600020546120a490919063ffffffff16565b6001600160a01b03871660009081526001602052604081208651909190879085908110611a9257fe5b6020026020010151815260200190815260200160002081905550611b1b838281518110611abb57fe5b602002602001015160016000886001600160a01b03166001600160a01b031681526020019081526020016000206000878581518110611af657fe5b6020026020010151815260200190815260200160002054611ecf90919063ffffffff16565b6001600160a01b03861660009081526001602052604081208651909190879085908110611b4457fe5b6020908102919091018101518252810191909152604001600020556001016119f2565b50836001600160a01b0316856001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015611bed578181015183820152602001611bd5565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015611c2c578181015183820152602001611c14565b5050505090500194505050505060405180910390a45050505050565b611c5a856001600160a01b0316613424565b15611e51576000856001600160a01b031663bc197c8184338a8989886040518763ffffffff1660e01b815260040180866001600160a01b03168152602001856001600160a01b03168152602001806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b83811015611ceb578181015183820152602001611cd3565b50505050905001848103835286818151815260200191508051906020019060200280838360005b83811015611d2a578181015183820152602001611d12565b50505050905001848103825285818151815260200191508051906020019080838360005b83811015611d66578181015183820152602001611d4e565b50505050905090810190601f168015611d935780820380516001836020036101000a031916815260200191505b5098505050505050505050602060405180830381600088803b158015611db857600080fd5b5087f1158015611dcc573d6000803e3d6000fd5b50505050506040513d6020811015611de357600080fd5b505190506001600160e01b031981167fbc197c810000000000000000000000000000000000000000000000000000000014611e4f5760405162461bcd60e51b815260040180806020018281038252603f81526020018061551a603f913960400191505060405180910390fd5b505b505050505050565b600082611e6857506000610458565b82820282848281611e7557fe5b0414611ec8576040805162461bcd60e51b815260206004820152601660248201527f536166654d617468236d756c3a204f564552464c4f5700000000000000000000604482015290519081900360640190fd5b9392505050565b600082820183811015611ec8576040805162461bcd60e51b815260206004820152601660248201527f536166654d617468236164643a204f564552464c4f5700000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000178152925182516000946060949389169392918291908083835b60208310611fd45780518252601f199092019160209182019101611fb5565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612036576040519150601f19603f3d011682016040523d82523d6000602084013e61203b565b606091505b5091509150818015612069575080511580612069575080806020019051602081101561206657600080fd5b50515b61075f5760405162461bcd60e51b815260040180806020018281038252602d815260200180615593602d913960400191505060405180910390fd5b6000828211156120fb576040805162461bcd60e51b815260206004820152601760248201527f536166654d617468237375623a20554e444552464c4f57000000000000000000604482015290519081900360640190fd5b50900390565b60005460609060ff1661215b576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6000805460ff191690558751428610156121875760405162461bcd60e51b81526004016101e590614a7f565b60008167ffffffffffffffff811180156121a057600080fd5b506040519080825280602002602001820160405280156121ca578160200160208202803683370190505b50925060606121d88b61345b565b905060005b8381101561232b5760008c82815181106121f357fe5b6020026020010151905060008c838151811061220b57fe5b60200260200101519050600084848151811061222357fe5b602002602001015190506000821161224d5760405162461bcd60e51b81526004016101e590614f16565b600083815260076020526040812054906122718461226b85826120a4565b846108a3565b90506000806122808784611400565b909250905080156122c8576001600160a01b0382166000908152600860205260409020546122ae9082611ecf565b6001600160a01b0383166000908152600860205260409020555b6122dc6122d584836120a4565b8b90611ecf565b99506122e884846120a4565b60008881526007602052604090205561230183826120a4565b8c898151811061230d57fe5b60209081029190910101525050600190950194506121dd9350505050565b5060005b85518110156123b957600086828151811061234657fe5b602002602001015111156123b15761236386828151811061162a57fe5b925061237486828151811061165257fe5b6008600089848151811061238457fe5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055505b60010161232f565b50888210156123da5760405162461bcd60e51b81526004016101e590614645565b6124057f00000000000000000000000000000000000000000000000000000000000000008884611f29565b5050506000805460ff19166001179055979650505050505050565b60005460ff16612477576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6000805460ff19169055428110156124a15760405162461bcd60e51b81526004016101e590614cd3565b8351600060608267ffffffffffffffff811180156124be57600080fd5b506040519080825280602002602001820160405280156124e8578160200160208202803683370190505b50905060608367ffffffffffffffff8111801561250457600080fd5b5060405190808252806020026020018201604052801561252e578160200160208202803683370190505b509050606061253c8961345b565b905060005b858110156127d55760008a828151811061255757fe5b6020026020010151905060008a838151811061256f57fe5b6020026020010151905060008a848151811061258757fe5b6020026020010151116125ac5760405162461bcd60e51b81526004016101e59061516a565b600081116125cc5760405162461bcd60e51b81526004016101e590614eb9565b600082815260066020526040902054801561272857600083815260076020526040812054865190919087908790811061260157fe5b602002602001015190506000806126336126248588611e5990919063ffffffff16565b61262e85896120a4565b6133de565b91509150818f898151811061264457fe5b6020026020010151101561266a5760405162461bcd60e51b81526004016101e59061502d565b6126748483611ecf565b60008881526007602052604090205561268d8c83611ecf565b9b50836126b086611987846126a35760006126a6565b60015b869060ff166120a4565b816126b757fe5b048b89815181106126c457fe5b602002602001018181525050818a89815181106126dd57fe5b60200260200101818152505061270f8b89815181106126f857fe5b602002602001015186611ecf90919063ffffffff16565b600088815260066020526040902055506127ca92505050565b60008b858151811061273657fe5b60200260200101519050633b9aca008110156127645760405162461bcd60e51b81526004016101e590614862565b600084815260076020526040902081905561277f8982611ecf565b6000858152600660205260409020829055885190995081908990879081106127a357fe5b602002602001018181525050808786815181106127bc57fe5b602002602001018181525050505b505050600101612541565b506127f18a8a856040518060200160405280600081525061370e565b61281d7f00000000000000000000000000000000000000000000000000000000000000008b3087612ce4565b896001600160a01b03167f403f9dc4582dae52d3eeb4a22d37540ffb13c32d964c92ec5ac0d3d5628da3168a8a8560405161285a939291906145ec565b60405180910390a250506000805460ff191660011790555050505050505050565b60005460ff166128d2576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6000805460ff191690554281116128fb5760405162461bcd60e51b81526004016101e590614805565b8451600060608267ffffffffffffffff8111801561291857600080fd5b50604051908082528060200260200182016040528015612942578160200160208202803683370190505b50905060608367ffffffffffffffff8111801561295e57600080fd5b50604051908082528060200260200182016040528015612988578160200160208202803683370190505b50905060606129968a61345b565b905060005b85811015612b475760008b82815181106129b157fe5b6020026020010151905060008b83815181106129c957fe5b6020026020010151905060008484815181106129e157fe5b6020026020010151905060006006600085815260200190815260200160002054905060008111612a235760405162461bcd60e51b81526004016101e5906147a8565b6000848152600760205260408120549082612a3e8684611e59565b81612a4557fe5b049050600083612a558787611e59565b81612a5c57fe5b0490508f8881518110612a6b57fe5b6020026020010151821015612a925760405162461bcd60e51b81526004016101e5906149fc565b8e8881518110612a9e57fe5b6020026020010151811015612ac55760405162461bcd60e51b81526004016101e590615281565b612acf84876120a4565b600088815260066020526040902055612ae883836120a4565b600088815260076020526040902055612b018c83611ecf565b9b50808b8981518110612b1057fe5b602002602001018181525050818a8981518110612b2957fe5b602090810291909101015250506001909501945061299b9350505050565b50612b53308b8b6138db565b612b7e7f00000000000000000000000000000000000000000000000000000000000000008c86611f29565b6040517f2eb2c2d60000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632eb2c2d690612be99030908f908f908990600401614508565b600060405180830381600087803b158015612c0357600080fd5b505af1158015612c17573d6000803e3d6000fd5b505050508a6001600160a01b03167f711e9bcb94b4cf7bc99c1cb938edc75ac7e85a136838e90abf6ee1f5adebd4238b8585604051612c58939291906145ec565b60405180910390a250506000805460ff19166001179055505050505050505050565b6000808211612cd0576040805162461bcd60e51b815260206004820152601e60248201527f536166654d617468236469763a204449564953494f4e5f42595f5a45524f0000604482015290519081900360640190fd5b6000828481612cdb57fe5b04949350505050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017815292518251600094606094938a169392918291908083835b60208310612d975780518252601f199092019160209182019101612d78565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612df9576040519150601f19603f3d011682016040523d82523d6000602084013e612dfe565b606091505b5091509150818015612e2c575080511580612e2c5750808060200190516020811015612e2957600080fd5b50515b611e515760405162461bcd60e51b81526004018080602001828103825260318152602001806153c96031913960400191505060405180910390fd5b60005460609060ff16612ec1576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6000805460ff1916905542831015612eeb5760405162461bcd60e51b81526004016101e590615224565b8551848167ffffffffffffffff81118015612f0557600080fd5b50604051908082528060200260200182016040528015612f2f578160200160208202803683370190505b5092506060612f3d8961345b565b905060005b8381101561308a5760008a8281518110612f5857fe5b6020026020010151905060008a8381518110612f7057fe5b602002602001015190506000848481518110612f8857fe5b6020026020010151905060008211612fb25760405162461bcd60e51b81526004016101e59061491c565b60008381526007602052604081205490612fcd848385611948565b9050600080612fdc8784611400565b90925090508015613024576001600160a01b03821660009081526008602052604090205461300a9082611ecf565b6001600160a01b0383166000908152600860205260409020555b613038816130328c866120a4565b906120a4565b99506130448382611ecf565b8c898151811061305057fe5b60209081029190910101526130658484611ecf565b60009788526007602052604090972096909655505060019094019350612f4292505050565b5081156130bc576130bc7f00000000000000000000000000000000000000000000000000000000000000008684611f29565b6040517f2eb2c2d60000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632eb2c2d69061312790309089908e908e90600401614508565b600060405180830381600087803b15801561314157600080fd5b505af1158015613155573d6000803e3d6000fd5b505050505050506000805460ff1916600117905595945050505050565b6001600160a01b03841660009081526001602090815260408083208584529091529020546131a090826120a4565b6001600160a01b0380861660009081526001602081815260408084208885528252808420959095559287168252825282812085825290915220546131e49082611ecf565b6001600160a01b038085166000818152600160209081526040808320888452825291829020949094558051868152938401859052805191939288169233927fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62929181900390910190a450505050565b613265856001600160a01b0316613424565b15611e51576000856001600160a01b031663f23a6e6184338a8989886040518763ffffffff1660e01b815260040180866001600160a01b03168152602001856001600160a01b0316815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156132f75781810151838201526020016132df565b50505050905090810190601f1680156133245780820380516001836020036101000a031916815260200191505b509650505050505050602060405180830381600088803b15801561334757600080fd5b5087f115801561335b573d6000803e3d6000fd5b50505050506040513d602081101561337257600080fd5b505190506001600160e01b031981167ff23a6e610000000000000000000000000000000000000000000000000000000014611e4f5760405162461bcd60e51b815260040180806020018281038252603a815260200180615559603a913960400191505060405180910390fd5b6000808284816133ea57fe5b061561340c5761340560018486816133fe57fe5b0490611ecf565b6001613419565b82848161341557fe5b0460005b915091509250929050565b6000813f8015801590611ec857507fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470141592915050565b8051606090600181141561355d57604080516001808252818301909252606091602080830190803683370190505090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031662fdd58e30866000815181106134c757fe5b60200260200101516040518363ffffffff1660e01b81526004016134ec929190614560565b60206040518083038186803b15801561350457600080fd5b505afa158015613518573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061353c9190614401565b8160008151811061354957fe5b6020908102919091010152915061052c9050565b60608167ffffffffffffffff8111801561357657600080fd5b506040519080825280602002602001820160405280156135a0578160200160208202803683370190505b50905030816000815181106135b157fe5b6001600160a01b039092166020928302919091019091015260015b82811015613649578481815181106135e057fe5b60200260200101518560018303815181106135f757fe5b60200260200101511061361c5760405162461bcd60e51b81526004016101e5906150e7565b3082828151811061362957fe5b6001600160a01b03909216602092830291909101909101526001016135cc565b506040517f4e1273f40000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690634e1273f4906136b19084908890600401614579565b60006040518083038186803b1580156136c957600080fd5b505afa1580156136dd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613705919081019061407a565b9250505061052c565b815183511461374e5760405162461bcd60e51b81526004018080602001828103825260308152602001806154ea6030913960400191505060405180910390fd5b825160005b818110156137f1576137a584828151811061376a57fe5b602002602001015160016000896001600160a01b03166001600160a01b031681526020019081526020016000206000888581518110611af657fe5b6001600160a01b038716600090815260016020526040812087519091908890859081106137ce57fe5b602090810291909101810151825281019190915260400160002055600101613753565b50846001600160a01b031660006001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015613878578181015183820152602001613860565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156138b757818101518382015260200161389f565b5050505090500194505050505060405180910390a461075f60008686865a87611c48565b81518151811461391c5760405162461bcd60e51b815260040180806020018281038252603081526020018061545f6030913960400191505060405180910390fd5b60005b818110156139bd5761397183828151811061393657fe5b602002602001015160016000886001600160a01b03166001600160a01b031681526020019081526020016000206000878581518110611a4457fe5b6001600160a01b0386166000908152600160205260408120865190919087908590811061399a57fe5b60209081029190910181015182528101919091526040016000205560010161391f565b5060006001600160a01b0316846001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015613a44578181015183820152602001613a2c565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015613a83578181015183820152602001613a6b565b5050505090500194505050505060405180910390a450505050565b6040518060a0016040528060006001600160a01b03168152602001600081526020016060815260200160608152602001600081525090565b604051806040016040528060608152602001600081525090565b60405180606001604052806060815260200160608152602001600081525090565b803561052c81615337565b805161052c81615337565b600082601f830112613b37578081fd5b8135613b4a613b4582615319565b6152f5565b818152915060208083019084810181840286018201871015613b6b57600080fd5b60005b84811015613b93578135613b8181615337565b84529282019290820190600101613b6e565b505050505092915050565b600082601f830112613bae578081fd5b8151613bbc613b4582615319565b818152915060208083019084810181840286018201871015613bdd57600080fd5b60005b84811015613b93578151613bf381615337565b84529282019290820190600101613be0565b60008083601f840112613c16578182fd5b50813567ffffffffffffffff811115613c2d578182fd5b602083019150836020808302850101111561153e57600080fd5b600082601f830112613c57578081fd5b8135613c65613b4582615319565b818152915060208083019084810181840286018201871015613c8657600080fd5b60005b84811015613b9357813584529282019290820190600101613c89565b600082601f830112613cb5578081fd5b8151613cc3613b4582615319565b818152915060208083019084810181840286018201871015613ce457600080fd5b60005b84811015613b9357815184529282019290820190600101613ce7565b600082601f830112613d13578081fd5b813567ffffffffffffffff811115613d2757fe5b613d3a6020601f19601f840116016152f5565b9150808252836020828501011115613d5157600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215613d7b578081fd5b8135611ec881615337565b600060208284031215613d97578081fd5b8151611ec881615337565b60008060408385031215613db4578081fd5b8235613dbf81615337565b91506020830135613dcf81615337565b809150509250929050565b600080600080600060a08688031215613df1578081fd5b8535613dfc81615337565b94506020860135613e0c81615337565b9350604086013567ffffffffffffffff80821115613e28578283fd5b613e3489838a01613c47565b94506060880135915080821115613e49578283fd5b613e5589838a01613c47565b93506080880135915080821115613e6a578283fd5b50613e7788828901613d03565b9150509295509295909350565b600080600080600060a08688031215613e9b578081fd5b8535613ea681615337565b94506020860135613eb681615337565b93506040860135925060608601359150608086013567ffffffffffffffff811115613edf578182fd5b613e7788828901613d03565b60008060408385031215613efd578182fd5b8235613f0881615337565b91506020830135613dcf8161534f565b60008060408385031215613f2a578182fd5b8235613f3581615337565b946020939093013593505050565b60008060408385031215613f55578182fd5b8251613f6081615337565b6020939093015192949293505050565b60008060408385031215613f82578182fd5b823567ffffffffffffffff80821115613f99578384fd5b613fa586838701613b27565b93506020850135915080821115613fba578283fd5b50613fc785828601613c47565b9150509250929050565b60008060208385031215613fe3578182fd5b823567ffffffffffffffff811115613ff9578283fd5b61400585828601613c05565b90969095509350505050565b60008060008060408587031215614026578182fd5b843567ffffffffffffffff8082111561403d578384fd5b61404988838901613c05565b90965094506020870135915080821115614061578384fd5b5061406e87828801613c05565b95989497509550505050565b60006020828403121561408b578081fd5b815167ffffffffffffffff8111156140a1578182fd5b6140ad84828501613ca5565b949350505050565b600080600080600080600060e0888a0312156140cf578485fd5b873567ffffffffffffffff808211156140e6578687fd5b6140f28b838c01613c47565b985060208a0135915080821115614107578687fd5b6141138b838c01613c47565b975060408a0135965060608a0135955061412f60808b01613b11565b945060a08a0135915080821115614144578384fd5b6141508b838c01613b27565b935060c08a0135915080821115614165578283fd5b506141728a828b01613c47565b91505092959891949750929550565b600060208284031215614192578081fd5b8151611ec88161534f565b6000602082840312156141ae578081fd5b8135611ec88161535d565b6000602082840312156141ca578081fd5b8151611ec88161535d565b600080604083850312156141e7578182fd5b82516141f28161535d565b602084015190925067ffffffffffffffff8082111561420f578283fd5b9084019060408287031215614222578283fd5b60405160408101818110838211171561423757fe5b604052825182811115614248578485fd5b61425488828601613ca5565b825250602083015160208201528093505050509250929050565b60008060408385031215614280578182fd5b825161428b8161535d565b602084015190925067ffffffffffffffff808211156142a8578283fd5b90840190606082870312156142bb578283fd5b6040516060810181811083821117156142d057fe5b6040528251828111156142e1578485fd5b6142ed88828601613ca5565b825250602083015182811115614301578485fd5b61430d88828601613ca5565b602083015250604083015160408201528093505050509250929050565b6000806040838503121561433c578182fd5b82516143478161535d565b602084015190925067ffffffffffffffff80821115614364578283fd5b9084019060a08287031215614377578283fd5b60405160a08101818110838211171561438c57fe5b60405261439883613b1c565b8152602083015160208201526040830151828111156143b5578485fd5b6143c188828601613b9e565b6040830152506060830151828111156143d8578485fd5b6143e488828601613ca5565b606083015250608083015160808201528093505050509250929050565b600060208284031215614412578081fd5b5051919050565b6000806040838503121561442b578182fd5b823591506020830135613dcf81615337565b6000806040838503121561444f578182fd5b50508035926020909101359150565b600080600060608486031215614472578081fd5b505081359360208301359350604090920135919050565b6000806000806080858703121561449e578182fd5b5050823594602084013594506040840135936060013592509050565b6000815180845260208085019450808401835b838110156144e9578151875295820195908201906001016144cd565b509495945050505050565b6001600160a01b0391909116815260200190565b60006001600160a01b03808716835280861660208401525060a0604083015261453460a08301856144ba565b828103606084015261454681856144ba565b838103608090940193909352508152602001949350505050565b6001600160a01b03929092168252602082015260400190565b604080825283519082018190526000906020906060840190828701845b828110156145bb5781516001600160a01b031684529284019290840190600101614596565b505050838103828501526145cf81866144ba565b9695505050505050565b600060208252611ec860208301846144ba565b6000606082526145ff60608301866144ba565b828103602084015261461181866144ba565b905082810360408401526145cf81856144ba565b901515815260200190565b6001600160e01b031991909116815260200190565b60208082526042908201527f4e696674797377617045786368616e67653230235f746f6b656e546f4375727260408201527f656e63793a20494e53554646494349454e545f43555252454e43595f414d4f5560608201527f4e54000000000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526026908201527f4e696674797377617045786368616e676532303a554e535550504f525445445f60408201527f4d4554484f440000000000000000000000000000000000000000000000000000606082015260800190565b60208082526045908201527f4e696674797377617045786368616e67653230236f6e4552433131353542617460408201527f636852656365697665643a20494e56414c49445f544f4b454e5f5452414e534660608201527f4552524544000000000000000000000000000000000000000000000000000000608082015260a00190565b6020808252603a908201527f4e696674797377617045786368616e67653230235f72656d6f76654c6971756960408201527f646974793a204e554c4c5f544f54414c5f4c4951554944495459000000000000606082015260800190565b60208082526037908201527f4e696674797377617045786368616e67653230235f72656d6f76654c6971756960408201527f646974793a20444541444c494e455f4558434545444544000000000000000000606082015260800190565b6020808252603a908201527f4e696674797377617045786368616e67653230235f6164644c6971756964697460408201527f793a20494e56414c49445f43555252454e43595f414d4f554e54000000000000606082015260800190565b6020808252603b908201527f4e696674797377617045786368616e6765323023736574526f79616c7479496e60408201527f666f3a20524f59414c54595f4645455f49535f544f4f5f484947480000000000606082015260800190565b60208082526038908201527f4e696674797377617045786368616e67653230235f63757272656e6379546f5460408201527f6f6b656e3a204e554c4c5f544f4b454e535f424f554748540000000000000000606082015260800190565b60208082526044908201527f4e696674797377617045786368616e6765323023627579546f6b656e733a204560408201527f585452415f464545535f4152524159535f4152455f4e4f545f53414d455f4c4560608201527f4e47544800000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526042908201527f4e696674797377617045786368616e67653230235f72656d6f76654c6971756960408201527f646974793a20494e53554646494349454e545f43555252454e43595f414d4f5560608201527f4e54000000000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526037908201527f4e696674797377617045786368616e67653230235f746f6b656e546f4375727260408201527f656e63793a20444541444c494e455f4558434545444544000000000000000000606082015260800190565b6020808252603a908201527f4e696674797377617045786368616e67653230236f6e4552433131353542617460408201527f636852656365697665643a20494e56414c49445f4d4554484f44000000000000606082015260800190565b60208082526035908201527f44656c6567617465644f776e61626c65236368616e67654f776e61626c65506160408201527f72656e743a20494e56414c49445f414444524553530000000000000000000000606082015260800190565b6020808252602e908201527f4e696674797377617045786368616e676532302367657442757950726963653a60408201527f20454d5054595f52455345525645000000000000000000000000000000000000606082015260800190565b6020808252604c908201527f4e696674797377617045786368616e67653230236f6e4552433131353542617460408201527f636852656365697665643a20494e56414c49445f4e494654595f544f4b454e5360608201527f5f5452414e534645525245440000000000000000000000000000000000000000608082015260a00190565b60208082526030908201527f4e696674797377617045786368616e6765323023627579546f6b656e733a204460408201527f4541444c494e455f455843454544454400000000000000000000000000000000606082015260800190565b60208082526034908201527f4e696674797377617045786368616e67653230235f6164644c6971756964697460408201527f793a20444541444c494e455f4558434545444544000000000000000000000000606082015260800190565b60208082526041908201527f4e696674797377617045786368616e67653230236f6e4552433131353552656360408201527f65697665643a20494e56414c49445f4f4e52454345495645445f4d455353414760608201527f4500000000000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526044908201527f4e696674797377617045786368616e67653230236f6e4552433131353542617460408201527f636852656365697665643a20494e56414c49445f544f4b454e535f4445504f5360608201527f4954454400000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526046908201527f4e696674797377617045786368616e67653230236f6e4552433131353542617460408201527f636852656365697665643a20494e56414c49445f544f4b454e535f5452414e5360608201527f4645525245440000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526035908201527f4e696674797377617045786368616e67653230235f6164644c6971756964697460408201527f793a204e554c4c5f544f4b454e535f414d4f554e540000000000000000000000606082015260800190565b60208082526036908201527f4e696674797377617045786368616e67653230235f746f6b656e546f4375727260408201527f656e63793a204e554c4c5f544f4b454e535f534f4c4400000000000000000000606082015260800190565b6020808252603b908201527f4e696674797377617045786368616e6765323023736574526f79616c7479496e60408201527f666f3a20544f4b454e20535550504f525453204552432d323938310000000000606082015260800190565b6020808252603a908201527f4e696674797377617045786368616e6765323023627579546f6b656e733a204960408201527f4e56414c49445f43555252454e43595f4944535f414d4f554e54000000000000606082015260800190565b6020808252603f908201527f4e696674797377617045786368616e67653230235f6164644c6971756964697460408201527f793a204d41585f43555252454e43595f414d4f554e545f455843454544454400606082015260800190565b6020808252602f908201527f4e696674797377617045786368616e676532302367657453656c6c507269636560408201527f3a20454d5054595f524553455256450000000000000000000000000000000000606082015260800190565b60208082526046908201527f4e696674797377617045786368616e67653230235f676574546f6b656e52657360408201527f65727665733a20554e534f525445445f4f525f4455504c49434154455f544f4b60608201527f454e5f4944530000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526034908201527f4e696674797377617045786368616e67653230235f6164644c6971756964697460408201527f793a204e554c4c5f4d41585f43555252454e4359000000000000000000000000606082015260800190565b6020808252602f908201527f44656c6567617465644f776e61626c65236f6e6c794f776e65723a2053454e4460408201527f45525f49535f4e4f545f4f574e45520000000000000000000000000000000000606082015260800190565b60208082526037908201527f4e696674797377617045786368616e67653230235f63757272656e6379546f5460408201527f6f6b656e3a20444541444c494e455f4558434545444544000000000000000000606082015260800190565b60208082526039908201527f4e696674797377617045786368616e67653230235f72656d6f76654c6971756960408201527f646974793a20494e53554646494349454e545f544f4b454e5300000000000000606082015260800190565b90815260200190565b918252602082015260400190565b60405181810167ffffffffffffffff8111828210171561531157fe5b604052919050565b600067ffffffffffffffff82111561532d57fe5b5060209081020190565b6001600160a01b038116811461534c57600080fd5b50565b801515811461534c57600080fd5b6001600160e01b03198116811461534c57600080fdfe4552433131353523736166655472616e7366657246726f6d3a20494e56414c49445f524543495049454e544552433131353523736166655472616e7366657246726f6d3a20494e56414c49445f4f50455241544f525472616e7366657248656c7065723a3a7472616e7366657246726f6d3a207472616e7366657246726f6d206661696c656445524331313535235f7361666542617463685472616e7366657246726f6d3a20494e56414c49445f4152524159535f4c454e47544845524331313535237361666542617463685472616e7366657246726f6d3a20494e56414c49445f524543495049454e54455243313135354d696e744275726e2362617463684275726e3a20494e56414c49445f4152524159535f4c454e475448455243313135352362616c616e63654f6642617463683a20494e56414c49445f41525241595f4c454e47544845524331313535237361666542617463685472616e7366657246726f6d3a20494e56414c49445f4f50455241544f52455243313135354d696e744275726e2362617463684d696e743a20494e56414c49445f4152524159535f4c454e47544845524331313535235f63616c6c6f6e45524331313535426174636852656365697665643a20494e56414c49445f4f4e5f524543454956455f4d45535341474545524331313535235f63616c6c6f6e4552433131353552656365697665643a20494e56414c49445f4f4e5f524543454956455f4d4553534147455472616e7366657248656c7065723a3a736166655472616e736665723a207472616e73666572206661696c6564a2646970667358221220ba018a7e4168c001561fc6ffac131df935ada6767baab149bcc177150d97788b64736f6c634300070400334e6966747973776170466163746f727932302363726561746545786368616e67653a2045584348414e47455f414c52454144595f43524541544544a26469706673582212204907d49bc357197cf2f4b78d7643c2c8f6c322e8b5e211b6b72a09a32cc32ca464736f6c63430007040033", +} + +// NiftyswapFactory20ABI is the input ABI used to generate the binding from. +// Deprecated: Use NiftyswapFactory20MetaData.ABI instead. +var NiftyswapFactory20ABI = NiftyswapFactory20MetaData.ABI + +// NiftyswapFactory20Bin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use NiftyswapFactory20MetaData.Bin instead. +var NiftyswapFactory20Bin = NiftyswapFactory20MetaData.Bin + +// DeployNiftyswapFactory20 deploys a new Ethereum contract, binding an instance of NiftyswapFactory20 to it. +func DeployNiftyswapFactory20(auth *bind.TransactOpts, backend bind.ContractBackend, _admin common.Address) (common.Address, *types.Transaction, *NiftyswapFactory20, error) { + parsed, err := NiftyswapFactory20MetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(NiftyswapFactory20Bin), backend, _admin) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &NiftyswapFactory20{NiftyswapFactory20Caller: NiftyswapFactory20Caller{contract: contract}, NiftyswapFactory20Transactor: NiftyswapFactory20Transactor{contract: contract}, NiftyswapFactory20Filterer: NiftyswapFactory20Filterer{contract: contract}}, nil +} + +// NiftyswapFactory20 is an auto generated Go binding around an Ethereum contract. +type NiftyswapFactory20 struct { + NiftyswapFactory20Caller // Read-only binding to the contract + NiftyswapFactory20Transactor // Write-only binding to the contract + NiftyswapFactory20Filterer // Log filterer for contract events +} + +// NiftyswapFactory20Caller is an auto generated read-only Go binding around an Ethereum contract. +type NiftyswapFactory20Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NiftyswapFactory20Transactor is an auto generated write-only Go binding around an Ethereum contract. +type NiftyswapFactory20Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NiftyswapFactory20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type NiftyswapFactory20Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NiftyswapFactory20Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type NiftyswapFactory20Session struct { + Contract *NiftyswapFactory20 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// NiftyswapFactory20CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type NiftyswapFactory20CallerSession struct { + Contract *NiftyswapFactory20Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// NiftyswapFactory20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type NiftyswapFactory20TransactorSession struct { + Contract *NiftyswapFactory20Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// NiftyswapFactory20Raw is an auto generated low-level Go binding around an Ethereum contract. +type NiftyswapFactory20Raw struct { + Contract *NiftyswapFactory20 // Generic contract binding to access the raw methods on +} + +// NiftyswapFactory20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type NiftyswapFactory20CallerRaw struct { + Contract *NiftyswapFactory20Caller // Generic read-only contract binding to access the raw methods on +} + +// NiftyswapFactory20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type NiftyswapFactory20TransactorRaw struct { + Contract *NiftyswapFactory20Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewNiftyswapFactory20 creates a new instance of NiftyswapFactory20, bound to a specific deployed contract. +func NewNiftyswapFactory20(address common.Address, backend bind.ContractBackend) (*NiftyswapFactory20, error) { + contract, err := bindNiftyswapFactory20(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &NiftyswapFactory20{NiftyswapFactory20Caller: NiftyswapFactory20Caller{contract: contract}, NiftyswapFactory20Transactor: NiftyswapFactory20Transactor{contract: contract}, NiftyswapFactory20Filterer: NiftyswapFactory20Filterer{contract: contract}}, nil +} + +// NewNiftyswapFactory20Caller creates a new read-only instance of NiftyswapFactory20, bound to a specific deployed contract. +func NewNiftyswapFactory20Caller(address common.Address, caller bind.ContractCaller) (*NiftyswapFactory20Caller, error) { + contract, err := bindNiftyswapFactory20(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &NiftyswapFactory20Caller{contract: contract}, nil +} + +// NewNiftyswapFactory20Transactor creates a new write-only instance of NiftyswapFactory20, bound to a specific deployed contract. +func NewNiftyswapFactory20Transactor(address common.Address, transactor bind.ContractTransactor) (*NiftyswapFactory20Transactor, error) { + contract, err := bindNiftyswapFactory20(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &NiftyswapFactory20Transactor{contract: contract}, nil +} + +// NewNiftyswapFactory20Filterer creates a new log filterer instance of NiftyswapFactory20, bound to a specific deployed contract. +func NewNiftyswapFactory20Filterer(address common.Address, filterer bind.ContractFilterer) (*NiftyswapFactory20Filterer, error) { + contract, err := bindNiftyswapFactory20(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &NiftyswapFactory20Filterer{contract: contract}, nil +} + +// bindNiftyswapFactory20 binds a generic wrapper to an already deployed contract. +func bindNiftyswapFactory20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(NiftyswapFactory20ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_NiftyswapFactory20 *NiftyswapFactory20Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NiftyswapFactory20.Contract.NiftyswapFactory20Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_NiftyswapFactory20 *NiftyswapFactory20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NiftyswapFactory20.Contract.NiftyswapFactory20Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NiftyswapFactory20 *NiftyswapFactory20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NiftyswapFactory20.Contract.NiftyswapFactory20Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_NiftyswapFactory20 *NiftyswapFactory20CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NiftyswapFactory20.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_NiftyswapFactory20 *NiftyswapFactory20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NiftyswapFactory20.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NiftyswapFactory20 *NiftyswapFactory20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NiftyswapFactory20.Contract.contract.Transact(opts, method, params...) +} + +// GetOwner is a free data retrieval call binding the contract method 0x893d20e8. +// +// Solidity: function getOwner() view returns(address) +func (_NiftyswapFactory20 *NiftyswapFactory20Caller) GetOwner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NiftyswapFactory20.contract.Call(opts, &out, "getOwner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetOwner is a free data retrieval call binding the contract method 0x893d20e8. +// +// Solidity: function getOwner() view returns(address) +func (_NiftyswapFactory20 *NiftyswapFactory20Session) GetOwner() (common.Address, error) { + return _NiftyswapFactory20.Contract.GetOwner(&_NiftyswapFactory20.CallOpts) +} + +// GetOwner is a free data retrieval call binding the contract method 0x893d20e8. +// +// Solidity: function getOwner() view returns(address) +func (_NiftyswapFactory20 *NiftyswapFactory20CallerSession) GetOwner() (common.Address, error) { + return _NiftyswapFactory20.Contract.GetOwner(&_NiftyswapFactory20.CallOpts) +} + +// GetPairExchanges is a free data retrieval call binding the contract method 0x9b307388. +// +// Solidity: function getPairExchanges(address _token, address _currency) view returns(address[]) +func (_NiftyswapFactory20 *NiftyswapFactory20Caller) GetPairExchanges(opts *bind.CallOpts, _token common.Address, _currency common.Address) ([]common.Address, error) { + var out []interface{} + err := _NiftyswapFactory20.contract.Call(opts, &out, "getPairExchanges", _token, _currency) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +// GetPairExchanges is a free data retrieval call binding the contract method 0x9b307388. +// +// Solidity: function getPairExchanges(address _token, address _currency) view returns(address[]) +func (_NiftyswapFactory20 *NiftyswapFactory20Session) GetPairExchanges(_token common.Address, _currency common.Address) ([]common.Address, error) { + return _NiftyswapFactory20.Contract.GetPairExchanges(&_NiftyswapFactory20.CallOpts, _token, _currency) +} + +// GetPairExchanges is a free data retrieval call binding the contract method 0x9b307388. +// +// Solidity: function getPairExchanges(address _token, address _currency) view returns(address[]) +func (_NiftyswapFactory20 *NiftyswapFactory20CallerSession) GetPairExchanges(_token common.Address, _currency common.Address) ([]common.Address, error) { + return _NiftyswapFactory20.Contract.GetPairExchanges(&_NiftyswapFactory20.CallOpts, _token, _currency) +} + +// TokensToExchange is a free data retrieval call binding the contract method 0x1427474c. +// +// Solidity: function tokensToExchange(address , address , uint256 ) view returns(address) +func (_NiftyswapFactory20 *NiftyswapFactory20Caller) TokensToExchange(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 *big.Int) (common.Address, error) { + var out []interface{} + err := _NiftyswapFactory20.contract.Call(opts, &out, "tokensToExchange", arg0, arg1, arg2) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// TokensToExchange is a free data retrieval call binding the contract method 0x1427474c. +// +// Solidity: function tokensToExchange(address , address , uint256 ) view returns(address) +func (_NiftyswapFactory20 *NiftyswapFactory20Session) TokensToExchange(arg0 common.Address, arg1 common.Address, arg2 *big.Int) (common.Address, error) { + return _NiftyswapFactory20.Contract.TokensToExchange(&_NiftyswapFactory20.CallOpts, arg0, arg1, arg2) +} + +// TokensToExchange is a free data retrieval call binding the contract method 0x1427474c. +// +// Solidity: function tokensToExchange(address , address , uint256 ) view returns(address) +func (_NiftyswapFactory20 *NiftyswapFactory20CallerSession) TokensToExchange(arg0 common.Address, arg1 common.Address, arg2 *big.Int) (common.Address, error) { + return _NiftyswapFactory20.Contract.TokensToExchange(&_NiftyswapFactory20.CallOpts, arg0, arg1, arg2) +} + +// CreateExchange is a paid mutator transaction binding the contract method 0x8359289c. +// +// Solidity: function createExchange(address _token, address _currency, uint256 _instance) returns() +func (_NiftyswapFactory20 *NiftyswapFactory20Transactor) CreateExchange(opts *bind.TransactOpts, _token common.Address, _currency common.Address, _instance *big.Int) (*types.Transaction, error) { + return _NiftyswapFactory20.contract.Transact(opts, "createExchange", _token, _currency, _instance) +} + +// CreateExchange is a paid mutator transaction binding the contract method 0x8359289c. +// +// Solidity: function createExchange(address _token, address _currency, uint256 _instance) returns() +func (_NiftyswapFactory20 *NiftyswapFactory20Session) CreateExchange(_token common.Address, _currency common.Address, _instance *big.Int) (*types.Transaction, error) { + return _NiftyswapFactory20.Contract.CreateExchange(&_NiftyswapFactory20.TransactOpts, _token, _currency, _instance) +} + +// CreateExchange is a paid mutator transaction binding the contract method 0x8359289c. +// +// Solidity: function createExchange(address _token, address _currency, uint256 _instance) returns() +func (_NiftyswapFactory20 *NiftyswapFactory20TransactorSession) CreateExchange(_token common.Address, _currency common.Address, _instance *big.Int) (*types.Transaction, error) { + return _NiftyswapFactory20.Contract.CreateExchange(&_NiftyswapFactory20.TransactOpts, _token, _currency, _instance) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address _newOwner) returns() +func (_NiftyswapFactory20 *NiftyswapFactory20Transactor) TransferOwnership(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) { + return _NiftyswapFactory20.contract.Transact(opts, "transferOwnership", _newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address _newOwner) returns() +func (_NiftyswapFactory20 *NiftyswapFactory20Session) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) { + return _NiftyswapFactory20.Contract.TransferOwnership(&_NiftyswapFactory20.TransactOpts, _newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address _newOwner) returns() +func (_NiftyswapFactory20 *NiftyswapFactory20TransactorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) { + return _NiftyswapFactory20.Contract.TransferOwnership(&_NiftyswapFactory20.TransactOpts, _newOwner) +} + +// NiftyswapFactory20NewExchangeIterator is returned from FilterNewExchange and is used to iterate over the raw logs and unpacked data for NewExchange events raised by the NiftyswapFactory20 contract. +type NiftyswapFactory20NewExchangeIterator struct { + Event *NiftyswapFactory20NewExchange // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *NiftyswapFactory20NewExchangeIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(NiftyswapFactory20NewExchange) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(NiftyswapFactory20NewExchange) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *NiftyswapFactory20NewExchangeIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NiftyswapFactory20NewExchangeIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NiftyswapFactory20NewExchange represents a NewExchange event raised by the NiftyswapFactory20 contract. +type NiftyswapFactory20NewExchange struct { + Token common.Address + Currency common.Address + Salt *big.Int + Exchange common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNewExchange is a free log retrieval operation binding the contract event 0x23658fa6d505b3e3034045b3937d4239cbdaa345bfb0c4a2d6637ade8b85457c. +// +// Solidity: event NewExchange(address indexed token, address indexed currency, uint256 indexed salt, address exchange) +func (_NiftyswapFactory20 *NiftyswapFactory20Filterer) FilterNewExchange(opts *bind.FilterOpts, token []common.Address, currency []common.Address, salt []*big.Int) (*NiftyswapFactory20NewExchangeIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var currencyRule []interface{} + for _, currencyItem := range currency { + currencyRule = append(currencyRule, currencyItem) + } + var saltRule []interface{} + for _, saltItem := range salt { + saltRule = append(saltRule, saltItem) + } + + logs, sub, err := _NiftyswapFactory20.contract.FilterLogs(opts, "NewExchange", tokenRule, currencyRule, saltRule) + if err != nil { + return nil, err + } + return &NiftyswapFactory20NewExchangeIterator{contract: _NiftyswapFactory20.contract, event: "NewExchange", logs: logs, sub: sub}, nil +} + +// WatchNewExchange is a free log subscription operation binding the contract event 0x23658fa6d505b3e3034045b3937d4239cbdaa345bfb0c4a2d6637ade8b85457c. +// +// Solidity: event NewExchange(address indexed token, address indexed currency, uint256 indexed salt, address exchange) +func (_NiftyswapFactory20 *NiftyswapFactory20Filterer) WatchNewExchange(opts *bind.WatchOpts, sink chan<- *NiftyswapFactory20NewExchange, token []common.Address, currency []common.Address, salt []*big.Int) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var currencyRule []interface{} + for _, currencyItem := range currency { + currencyRule = append(currencyRule, currencyItem) + } + var saltRule []interface{} + for _, saltItem := range salt { + saltRule = append(saltRule, saltItem) + } + + logs, sub, err := _NiftyswapFactory20.contract.WatchLogs(opts, "NewExchange", tokenRule, currencyRule, saltRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(NiftyswapFactory20NewExchange) + if err := _NiftyswapFactory20.contract.UnpackLog(event, "NewExchange", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseNewExchange is a log parse operation binding the contract event 0x23658fa6d505b3e3034045b3937d4239cbdaa345bfb0c4a2d6637ade8b85457c. +// +// Solidity: event NewExchange(address indexed token, address indexed currency, uint256 indexed salt, address exchange) +func (_NiftyswapFactory20 *NiftyswapFactory20Filterer) ParseNewExchange(log types.Log) (*NiftyswapFactory20NewExchange, error) { + event := new(NiftyswapFactory20NewExchange) + if err := _NiftyswapFactory20.contract.UnpackLog(event, "NewExchange", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NiftyswapFactory20OwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the NiftyswapFactory20 contract. +type NiftyswapFactory20OwnershipTransferredIterator struct { + Event *NiftyswapFactory20OwnershipTransferred // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *NiftyswapFactory20OwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(NiftyswapFactory20OwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(NiftyswapFactory20OwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *NiftyswapFactory20OwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NiftyswapFactory20OwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NiftyswapFactory20OwnershipTransferred represents a OwnershipTransferred event raised by the NiftyswapFactory20 contract. +type NiftyswapFactory20OwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_NiftyswapFactory20 *NiftyswapFactory20Filterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*NiftyswapFactory20OwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _NiftyswapFactory20.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &NiftyswapFactory20OwnershipTransferredIterator{contract: _NiftyswapFactory20.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_NiftyswapFactory20 *NiftyswapFactory20Filterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *NiftyswapFactory20OwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _NiftyswapFactory20.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(NiftyswapFactory20OwnershipTransferred) + if err := _NiftyswapFactory20.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_NiftyswapFactory20 *NiftyswapFactory20Filterer) ParseOwnershipTransferred(log types.Log) (*NiftyswapFactory20OwnershipTransferred, error) { + event := new(NiftyswapFactory20OwnershipTransferred) + if err := _NiftyswapFactory20.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +}