ens.go 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892
  1. // Code generated - DO NOT EDIT.
  2. // This file is a generated binding and any manual changes will be lost.
  3. package contract
  4. import (
  5. "math/big"
  6. "strings"
  7. ethereum "github.com/ethereum/go-ethereum"
  8. "github.com/ethereum/go-ethereum/accounts/abi"
  9. "github.com/ethereum/go-ethereum/accounts/abi/bind"
  10. "github.com/ethereum/go-ethereum/common"
  11. "github.com/ethereum/go-ethereum/core/types"
  12. "github.com/ethereum/go-ethereum/event"
  13. )
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var (
  16. _ = big.NewInt
  17. _ = strings.NewReader
  18. _ = ethereum.NotFound
  19. _ = abi.U256
  20. _ = bind.Bind
  21. _ = common.Big1
  22. _ = types.BloomLookup
  23. _ = event.NewSubscription
  24. )
  25. // ENSABI is the input ABI used to generate the binding from.
  26. const ENSABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"resolver\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"label\",\"type\":\"bytes32\"},{\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"setSubnodeOwner\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"ttl\",\"type\":\"uint64\"}],\"name\":\"setTTL\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"ttl\",\"outputs\":[{\"name\":\"\",\"type\":\"uint64\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"setResolver\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"setOwner\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"label\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"NewOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"NewResolver\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"ttl\",\"type\":\"uint64\"}],\"name\":\"NewTTL\",\"type\":\"event\"}]"
  27. // ENSBin is the compiled bytecode used for deploying new contracts.
  28. const ENSBin = `0x`
  29. // DeployENS deploys a new Ethereum contract, binding an instance of ENS to it.
  30. func DeployENS(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ENS, error) {
  31. parsed, err := abi.JSON(strings.NewReader(ENSABI))
  32. if err != nil {
  33. return common.Address{}, nil, nil, err
  34. }
  35. address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ENSBin), backend)
  36. if err != nil {
  37. return common.Address{}, nil, nil, err
  38. }
  39. return address, tx, &ENS{ENSCaller: ENSCaller{contract: contract}, ENSTransactor: ENSTransactor{contract: contract}, ENSFilterer: ENSFilterer{contract: contract}}, nil
  40. }
  41. // ENS is an auto generated Go binding around an Ethereum contract.
  42. type ENS struct {
  43. ENSCaller // Read-only binding to the contract
  44. ENSTransactor // Write-only binding to the contract
  45. ENSFilterer // Log filterer for contract events
  46. }
  47. // ENSCaller is an auto generated read-only Go binding around an Ethereum contract.
  48. type ENSCaller struct {
  49. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  50. }
  51. // ENSTransactor is an auto generated write-only Go binding around an Ethereum contract.
  52. type ENSTransactor struct {
  53. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  54. }
  55. // ENSFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
  56. type ENSFilterer struct {
  57. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  58. }
  59. // ENSSession is an auto generated Go binding around an Ethereum contract,
  60. // with pre-set call and transact options.
  61. type ENSSession struct {
  62. Contract *ENS // Generic contract binding to set the session for
  63. CallOpts bind.CallOpts // Call options to use throughout this session
  64. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  65. }
  66. // ENSCallerSession is an auto generated read-only Go binding around an Ethereum contract,
  67. // with pre-set call options.
  68. type ENSCallerSession struct {
  69. Contract *ENSCaller // Generic contract caller binding to set the session for
  70. CallOpts bind.CallOpts // Call options to use throughout this session
  71. }
  72. // ENSTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
  73. // with pre-set transact options.
  74. type ENSTransactorSession struct {
  75. Contract *ENSTransactor // Generic contract transactor binding to set the session for
  76. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  77. }
  78. // ENSRaw is an auto generated low-level Go binding around an Ethereum contract.
  79. type ENSRaw struct {
  80. Contract *ENS // Generic contract binding to access the raw methods on
  81. }
  82. // ENSCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
  83. type ENSCallerRaw struct {
  84. Contract *ENSCaller // Generic read-only contract binding to access the raw methods on
  85. }
  86. // ENSTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
  87. type ENSTransactorRaw struct {
  88. Contract *ENSTransactor // Generic write-only contract binding to access the raw methods on
  89. }
  90. // NewENS creates a new instance of ENS, bound to a specific deployed contract.
  91. func NewENS(address common.Address, backend bind.ContractBackend) (*ENS, error) {
  92. contract, err := bindENS(address, backend, backend, backend)
  93. if err != nil {
  94. return nil, err
  95. }
  96. return &ENS{ENSCaller: ENSCaller{contract: contract}, ENSTransactor: ENSTransactor{contract: contract}, ENSFilterer: ENSFilterer{contract: contract}}, nil
  97. }
  98. // NewENSCaller creates a new read-only instance of ENS, bound to a specific deployed contract.
  99. func NewENSCaller(address common.Address, caller bind.ContractCaller) (*ENSCaller, error) {
  100. contract, err := bindENS(address, caller, nil, nil)
  101. if err != nil {
  102. return nil, err
  103. }
  104. return &ENSCaller{contract: contract}, nil
  105. }
  106. // NewENSTransactor creates a new write-only instance of ENS, bound to a specific deployed contract.
  107. func NewENSTransactor(address common.Address, transactor bind.ContractTransactor) (*ENSTransactor, error) {
  108. contract, err := bindENS(address, nil, transactor, nil)
  109. if err != nil {
  110. return nil, err
  111. }
  112. return &ENSTransactor{contract: contract}, nil
  113. }
  114. // NewENSFilterer creates a new log filterer instance of ENS, bound to a specific deployed contract.
  115. func NewENSFilterer(address common.Address, filterer bind.ContractFilterer) (*ENSFilterer, error) {
  116. contract, err := bindENS(address, nil, nil, filterer)
  117. if err != nil {
  118. return nil, err
  119. }
  120. return &ENSFilterer{contract: contract}, nil
  121. }
  122. // bindENS binds a generic wrapper to an already deployed contract.
  123. func bindENS(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
  124. parsed, err := abi.JSON(strings.NewReader(ENSABI))
  125. if err != nil {
  126. return nil, err
  127. }
  128. return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
  129. }
  130. // Call invokes the (constant) contract method with params as input values and
  131. // sets the output to result. The result type might be a single field for simple
  132. // returns, a slice of interfaces for anonymous returns and a struct for named
  133. // returns.
  134. func (_ENS *ENSRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  135. return _ENS.Contract.ENSCaller.contract.Call(opts, result, method, params...)
  136. }
  137. // Transfer initiates a plain transaction to move funds to the contract, calling
  138. // its default method if one is available.
  139. func (_ENS *ENSRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  140. return _ENS.Contract.ENSTransactor.contract.Transfer(opts)
  141. }
  142. // Transact invokes the (paid) contract method with params as input values.
  143. func (_ENS *ENSRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  144. return _ENS.Contract.ENSTransactor.contract.Transact(opts, method, params...)
  145. }
  146. // Call invokes the (constant) contract method with params as input values and
  147. // sets the output to result. The result type might be a single field for simple
  148. // returns, a slice of interfaces for anonymous returns and a struct for named
  149. // returns.
  150. func (_ENS *ENSCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  151. return _ENS.Contract.contract.Call(opts, result, method, params...)
  152. }
  153. // Transfer initiates a plain transaction to move funds to the contract, calling
  154. // its default method if one is available.
  155. func (_ENS *ENSTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  156. return _ENS.Contract.contract.Transfer(opts)
  157. }
  158. // Transact invokes the (paid) contract method with params as input values.
  159. func (_ENS *ENSTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  160. return _ENS.Contract.contract.Transact(opts, method, params...)
  161. }
  162. // Owner is a free data retrieval call binding the contract method 0x02571be3.
  163. //
  164. // Solidity: function owner(bytes32 node) constant returns(address)
  165. func (_ENS *ENSCaller) Owner(opts *bind.CallOpts, node [32]byte) (common.Address, error) {
  166. var (
  167. ret0 = new(common.Address)
  168. )
  169. out := ret0
  170. err := _ENS.contract.Call(opts, out, "owner", node)
  171. return *ret0, err
  172. }
  173. // Owner is a free data retrieval call binding the contract method 0x02571be3.
  174. //
  175. // Solidity: function owner(bytes32 node) constant returns(address)
  176. func (_ENS *ENSSession) Owner(node [32]byte) (common.Address, error) {
  177. return _ENS.Contract.Owner(&_ENS.CallOpts, node)
  178. }
  179. // Owner is a free data retrieval call binding the contract method 0x02571be3.
  180. //
  181. // Solidity: function owner(bytes32 node) constant returns(address)
  182. func (_ENS *ENSCallerSession) Owner(node [32]byte) (common.Address, error) {
  183. return _ENS.Contract.Owner(&_ENS.CallOpts, node)
  184. }
  185. // Resolver is a free data retrieval call binding the contract method 0x0178b8bf.
  186. //
  187. // Solidity: function resolver(bytes32 node) constant returns(address)
  188. func (_ENS *ENSCaller) Resolver(opts *bind.CallOpts, node [32]byte) (common.Address, error) {
  189. var (
  190. ret0 = new(common.Address)
  191. )
  192. out := ret0
  193. err := _ENS.contract.Call(opts, out, "resolver", node)
  194. return *ret0, err
  195. }
  196. // Resolver is a free data retrieval call binding the contract method 0x0178b8bf.
  197. //
  198. // Solidity: function resolver(bytes32 node) constant returns(address)
  199. func (_ENS *ENSSession) Resolver(node [32]byte) (common.Address, error) {
  200. return _ENS.Contract.Resolver(&_ENS.CallOpts, node)
  201. }
  202. // Resolver is a free data retrieval call binding the contract method 0x0178b8bf.
  203. //
  204. // Solidity: function resolver(bytes32 node) constant returns(address)
  205. func (_ENS *ENSCallerSession) Resolver(node [32]byte) (common.Address, error) {
  206. return _ENS.Contract.Resolver(&_ENS.CallOpts, node)
  207. }
  208. // Ttl is a free data retrieval call binding the contract method 0x16a25cbd.
  209. //
  210. // Solidity: function ttl(bytes32 node) constant returns(uint64)
  211. func (_ENS *ENSCaller) Ttl(opts *bind.CallOpts, node [32]byte) (uint64, error) {
  212. var (
  213. ret0 = new(uint64)
  214. )
  215. out := ret0
  216. err := _ENS.contract.Call(opts, out, "ttl", node)
  217. return *ret0, err
  218. }
  219. // Ttl is a free data retrieval call binding the contract method 0x16a25cbd.
  220. //
  221. // Solidity: function ttl(bytes32 node) constant returns(uint64)
  222. func (_ENS *ENSSession) Ttl(node [32]byte) (uint64, error) {
  223. return _ENS.Contract.Ttl(&_ENS.CallOpts, node)
  224. }
  225. // Ttl is a free data retrieval call binding the contract method 0x16a25cbd.
  226. //
  227. // Solidity: function ttl(bytes32 node) constant returns(uint64)
  228. func (_ENS *ENSCallerSession) Ttl(node [32]byte) (uint64, error) {
  229. return _ENS.Contract.Ttl(&_ENS.CallOpts, node)
  230. }
  231. // SetOwner is a paid mutator transaction binding the contract method 0x5b0fc9c3.
  232. //
  233. // Solidity: function setOwner(bytes32 node, address owner) returns()
  234. func (_ENS *ENSTransactor) SetOwner(opts *bind.TransactOpts, node [32]byte, owner common.Address) (*types.Transaction, error) {
  235. return _ENS.contract.Transact(opts, "setOwner", node, owner)
  236. }
  237. // SetOwner is a paid mutator transaction binding the contract method 0x5b0fc9c3.
  238. //
  239. // Solidity: function setOwner(bytes32 node, address owner) returns()
  240. func (_ENS *ENSSession) SetOwner(node [32]byte, owner common.Address) (*types.Transaction, error) {
  241. return _ENS.Contract.SetOwner(&_ENS.TransactOpts, node, owner)
  242. }
  243. // SetOwner is a paid mutator transaction binding the contract method 0x5b0fc9c3.
  244. //
  245. // Solidity: function setOwner(bytes32 node, address owner) returns()
  246. func (_ENS *ENSTransactorSession) SetOwner(node [32]byte, owner common.Address) (*types.Transaction, error) {
  247. return _ENS.Contract.SetOwner(&_ENS.TransactOpts, node, owner)
  248. }
  249. // SetResolver is a paid mutator transaction binding the contract method 0x1896f70a.
  250. //
  251. // Solidity: function setResolver(bytes32 node, address resolver) returns()
  252. func (_ENS *ENSTransactor) SetResolver(opts *bind.TransactOpts, node [32]byte, resolver common.Address) (*types.Transaction, error) {
  253. return _ENS.contract.Transact(opts, "setResolver", node, resolver)
  254. }
  255. // SetResolver is a paid mutator transaction binding the contract method 0x1896f70a.
  256. //
  257. // Solidity: function setResolver(bytes32 node, address resolver) returns()
  258. func (_ENS *ENSSession) SetResolver(node [32]byte, resolver common.Address) (*types.Transaction, error) {
  259. return _ENS.Contract.SetResolver(&_ENS.TransactOpts, node, resolver)
  260. }
  261. // SetResolver is a paid mutator transaction binding the contract method 0x1896f70a.
  262. //
  263. // Solidity: function setResolver(bytes32 node, address resolver) returns()
  264. func (_ENS *ENSTransactorSession) SetResolver(node [32]byte, resolver common.Address) (*types.Transaction, error) {
  265. return _ENS.Contract.SetResolver(&_ENS.TransactOpts, node, resolver)
  266. }
  267. // SetSubnodeOwner is a paid mutator transaction binding the contract method 0x06ab5923.
  268. //
  269. // Solidity: function setSubnodeOwner(bytes32 node, bytes32 label, address owner) returns()
  270. func (_ENS *ENSTransactor) SetSubnodeOwner(opts *bind.TransactOpts, node [32]byte, label [32]byte, owner common.Address) (*types.Transaction, error) {
  271. return _ENS.contract.Transact(opts, "setSubnodeOwner", node, label, owner)
  272. }
  273. // SetSubnodeOwner is a paid mutator transaction binding the contract method 0x06ab5923.
  274. //
  275. // Solidity: function setSubnodeOwner(bytes32 node, bytes32 label, address owner) returns()
  276. func (_ENS *ENSSession) SetSubnodeOwner(node [32]byte, label [32]byte, owner common.Address) (*types.Transaction, error) {
  277. return _ENS.Contract.SetSubnodeOwner(&_ENS.TransactOpts, node, label, owner)
  278. }
  279. // SetSubnodeOwner is a paid mutator transaction binding the contract method 0x06ab5923.
  280. //
  281. // Solidity: function setSubnodeOwner(bytes32 node, bytes32 label, address owner) returns()
  282. func (_ENS *ENSTransactorSession) SetSubnodeOwner(node [32]byte, label [32]byte, owner common.Address) (*types.Transaction, error) {
  283. return _ENS.Contract.SetSubnodeOwner(&_ENS.TransactOpts, node, label, owner)
  284. }
  285. // SetTTL is a paid mutator transaction binding the contract method 0x14ab9038.
  286. //
  287. // Solidity: function setTTL(bytes32 node, uint64 ttl) returns()
  288. func (_ENS *ENSTransactor) SetTTL(opts *bind.TransactOpts, node [32]byte, ttl uint64) (*types.Transaction, error) {
  289. return _ENS.contract.Transact(opts, "setTTL", node, ttl)
  290. }
  291. // SetTTL is a paid mutator transaction binding the contract method 0x14ab9038.
  292. //
  293. // Solidity: function setTTL(bytes32 node, uint64 ttl) returns()
  294. func (_ENS *ENSSession) SetTTL(node [32]byte, ttl uint64) (*types.Transaction, error) {
  295. return _ENS.Contract.SetTTL(&_ENS.TransactOpts, node, ttl)
  296. }
  297. // SetTTL is a paid mutator transaction binding the contract method 0x14ab9038.
  298. //
  299. // Solidity: function setTTL(bytes32 node, uint64 ttl) returns()
  300. func (_ENS *ENSTransactorSession) SetTTL(node [32]byte, ttl uint64) (*types.Transaction, error) {
  301. return _ENS.Contract.SetTTL(&_ENS.TransactOpts, node, ttl)
  302. }
  303. // ENSNewOwnerIterator is returned from FilterNewOwner and is used to iterate over the raw logs and unpacked data for NewOwner events raised by the ENS contract.
  304. type ENSNewOwnerIterator struct {
  305. Event *ENSNewOwner // Event containing the contract specifics and raw log
  306. contract *bind.BoundContract // Generic contract to use for unpacking event data
  307. event string // Event name to use for unpacking event data
  308. logs chan types.Log // Log channel receiving the found contract events
  309. sub ethereum.Subscription // Subscription for errors, completion and termination
  310. done bool // Whether the subscription completed delivering logs
  311. fail error // Occurred error to stop iteration
  312. }
  313. // Next advances the iterator to the subsequent event, returning whether there
  314. // are any more events found. In case of a retrieval or parsing error, false is
  315. // returned and Error() can be queried for the exact failure.
  316. func (it *ENSNewOwnerIterator) Next() bool {
  317. // If the iterator failed, stop iterating
  318. if it.fail != nil {
  319. return false
  320. }
  321. // If the iterator completed, deliver directly whatever's available
  322. if it.done {
  323. select {
  324. case log := <-it.logs:
  325. it.Event = new(ENSNewOwner)
  326. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  327. it.fail = err
  328. return false
  329. }
  330. it.Event.Raw = log
  331. return true
  332. default:
  333. return false
  334. }
  335. }
  336. // Iterator still in progress, wait for either a data or an error event
  337. select {
  338. case log := <-it.logs:
  339. it.Event = new(ENSNewOwner)
  340. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  341. it.fail = err
  342. return false
  343. }
  344. it.Event.Raw = log
  345. return true
  346. case err := <-it.sub.Err():
  347. it.done = true
  348. it.fail = err
  349. return it.Next()
  350. }
  351. }
  352. // Error returns any retrieval or parsing error occurred during filtering.
  353. func (it *ENSNewOwnerIterator) Error() error {
  354. return it.fail
  355. }
  356. // Close terminates the iteration process, releasing any pending underlying
  357. // resources.
  358. func (it *ENSNewOwnerIterator) Close() error {
  359. it.sub.Unsubscribe()
  360. return nil
  361. }
  362. // ENSNewOwner represents a NewOwner event raised by the ENS contract.
  363. type ENSNewOwner struct {
  364. Node [32]byte
  365. Label [32]byte
  366. Owner common.Address
  367. Raw types.Log // Blockchain specific contextual infos
  368. }
  369. // FilterNewOwner is a free log retrieval operation binding the contract event 0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82.
  370. //
  371. // Solidity: event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner)
  372. func (_ENS *ENSFilterer) FilterNewOwner(opts *bind.FilterOpts, node [][32]byte, label [][32]byte) (*ENSNewOwnerIterator, error) {
  373. var nodeRule []interface{}
  374. for _, nodeItem := range node {
  375. nodeRule = append(nodeRule, nodeItem)
  376. }
  377. var labelRule []interface{}
  378. for _, labelItem := range label {
  379. labelRule = append(labelRule, labelItem)
  380. }
  381. logs, sub, err := _ENS.contract.FilterLogs(opts, "NewOwner", nodeRule, labelRule)
  382. if err != nil {
  383. return nil, err
  384. }
  385. return &ENSNewOwnerIterator{contract: _ENS.contract, event: "NewOwner", logs: logs, sub: sub}, nil
  386. }
  387. // WatchNewOwner is a free log subscription operation binding the contract event 0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82.
  388. //
  389. // Solidity: event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner)
  390. func (_ENS *ENSFilterer) WatchNewOwner(opts *bind.WatchOpts, sink chan<- *ENSNewOwner, node [][32]byte, label [][32]byte) (event.Subscription, error) {
  391. var nodeRule []interface{}
  392. for _, nodeItem := range node {
  393. nodeRule = append(nodeRule, nodeItem)
  394. }
  395. var labelRule []interface{}
  396. for _, labelItem := range label {
  397. labelRule = append(labelRule, labelItem)
  398. }
  399. logs, sub, err := _ENS.contract.WatchLogs(opts, "NewOwner", nodeRule, labelRule)
  400. if err != nil {
  401. return nil, err
  402. }
  403. return event.NewSubscription(func(quit <-chan struct{}) error {
  404. defer sub.Unsubscribe()
  405. for {
  406. select {
  407. case log := <-logs:
  408. // New log arrived, parse the event and forward to the user
  409. event := new(ENSNewOwner)
  410. if err := _ENS.contract.UnpackLog(event, "NewOwner", log); err != nil {
  411. return err
  412. }
  413. event.Raw = log
  414. select {
  415. case sink <- event:
  416. case err := <-sub.Err():
  417. return err
  418. case <-quit:
  419. return nil
  420. }
  421. case err := <-sub.Err():
  422. return err
  423. case <-quit:
  424. return nil
  425. }
  426. }
  427. }), nil
  428. }
  429. // ENSNewResolverIterator is returned from FilterNewResolver and is used to iterate over the raw logs and unpacked data for NewResolver events raised by the ENS contract.
  430. type ENSNewResolverIterator struct {
  431. Event *ENSNewResolver // Event containing the contract specifics and raw log
  432. contract *bind.BoundContract // Generic contract to use for unpacking event data
  433. event string // Event name to use for unpacking event data
  434. logs chan types.Log // Log channel receiving the found contract events
  435. sub ethereum.Subscription // Subscription for errors, completion and termination
  436. done bool // Whether the subscription completed delivering logs
  437. fail error // Occurred error to stop iteration
  438. }
  439. // Next advances the iterator to the subsequent event, returning whether there
  440. // are any more events found. In case of a retrieval or parsing error, false is
  441. // returned and Error() can be queried for the exact failure.
  442. func (it *ENSNewResolverIterator) Next() bool {
  443. // If the iterator failed, stop iterating
  444. if it.fail != nil {
  445. return false
  446. }
  447. // If the iterator completed, deliver directly whatever's available
  448. if it.done {
  449. select {
  450. case log := <-it.logs:
  451. it.Event = new(ENSNewResolver)
  452. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  453. it.fail = err
  454. return false
  455. }
  456. it.Event.Raw = log
  457. return true
  458. default:
  459. return false
  460. }
  461. }
  462. // Iterator still in progress, wait for either a data or an error event
  463. select {
  464. case log := <-it.logs:
  465. it.Event = new(ENSNewResolver)
  466. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  467. it.fail = err
  468. return false
  469. }
  470. it.Event.Raw = log
  471. return true
  472. case err := <-it.sub.Err():
  473. it.done = true
  474. it.fail = err
  475. return it.Next()
  476. }
  477. }
  478. // Error returns any retrieval or parsing error occurred during filtering.
  479. func (it *ENSNewResolverIterator) Error() error {
  480. return it.fail
  481. }
  482. // Close terminates the iteration process, releasing any pending underlying
  483. // resources.
  484. func (it *ENSNewResolverIterator) Close() error {
  485. it.sub.Unsubscribe()
  486. return nil
  487. }
  488. // ENSNewResolver represents a NewResolver event raised by the ENS contract.
  489. type ENSNewResolver struct {
  490. Node [32]byte
  491. Resolver common.Address
  492. Raw types.Log // Blockchain specific contextual infos
  493. }
  494. // FilterNewResolver is a free log retrieval operation binding the contract event 0x335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0.
  495. //
  496. // Solidity: event NewResolver(bytes32 indexed node, address resolver)
  497. func (_ENS *ENSFilterer) FilterNewResolver(opts *bind.FilterOpts, node [][32]byte) (*ENSNewResolverIterator, error) {
  498. var nodeRule []interface{}
  499. for _, nodeItem := range node {
  500. nodeRule = append(nodeRule, nodeItem)
  501. }
  502. logs, sub, err := _ENS.contract.FilterLogs(opts, "NewResolver", nodeRule)
  503. if err != nil {
  504. return nil, err
  505. }
  506. return &ENSNewResolverIterator{contract: _ENS.contract, event: "NewResolver", logs: logs, sub: sub}, nil
  507. }
  508. // WatchNewResolver is a free log subscription operation binding the contract event 0x335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0.
  509. //
  510. // Solidity: event NewResolver(bytes32 indexed node, address resolver)
  511. func (_ENS *ENSFilterer) WatchNewResolver(opts *bind.WatchOpts, sink chan<- *ENSNewResolver, node [][32]byte) (event.Subscription, error) {
  512. var nodeRule []interface{}
  513. for _, nodeItem := range node {
  514. nodeRule = append(nodeRule, nodeItem)
  515. }
  516. logs, sub, err := _ENS.contract.WatchLogs(opts, "NewResolver", nodeRule)
  517. if err != nil {
  518. return nil, err
  519. }
  520. return event.NewSubscription(func(quit <-chan struct{}) error {
  521. defer sub.Unsubscribe()
  522. for {
  523. select {
  524. case log := <-logs:
  525. // New log arrived, parse the event and forward to the user
  526. event := new(ENSNewResolver)
  527. if err := _ENS.contract.UnpackLog(event, "NewResolver", log); err != nil {
  528. return err
  529. }
  530. event.Raw = log
  531. select {
  532. case sink <- event:
  533. case err := <-sub.Err():
  534. return err
  535. case <-quit:
  536. return nil
  537. }
  538. case err := <-sub.Err():
  539. return err
  540. case <-quit:
  541. return nil
  542. }
  543. }
  544. }), nil
  545. }
  546. // ENSNewTTLIterator is returned from FilterNewTTL and is used to iterate over the raw logs and unpacked data for NewTTL events raised by the ENS contract.
  547. type ENSNewTTLIterator struct {
  548. Event *ENSNewTTL // Event containing the contract specifics and raw log
  549. contract *bind.BoundContract // Generic contract to use for unpacking event data
  550. event string // Event name to use for unpacking event data
  551. logs chan types.Log // Log channel receiving the found contract events
  552. sub ethereum.Subscription // Subscription for errors, completion and termination
  553. done bool // Whether the subscription completed delivering logs
  554. fail error // Occurred error to stop iteration
  555. }
  556. // Next advances the iterator to the subsequent event, returning whether there
  557. // are any more events found. In case of a retrieval or parsing error, false is
  558. // returned and Error() can be queried for the exact failure.
  559. func (it *ENSNewTTLIterator) Next() bool {
  560. // If the iterator failed, stop iterating
  561. if it.fail != nil {
  562. return false
  563. }
  564. // If the iterator completed, deliver directly whatever's available
  565. if it.done {
  566. select {
  567. case log := <-it.logs:
  568. it.Event = new(ENSNewTTL)
  569. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  570. it.fail = err
  571. return false
  572. }
  573. it.Event.Raw = log
  574. return true
  575. default:
  576. return false
  577. }
  578. }
  579. // Iterator still in progress, wait for either a data or an error event
  580. select {
  581. case log := <-it.logs:
  582. it.Event = new(ENSNewTTL)
  583. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  584. it.fail = err
  585. return false
  586. }
  587. it.Event.Raw = log
  588. return true
  589. case err := <-it.sub.Err():
  590. it.done = true
  591. it.fail = err
  592. return it.Next()
  593. }
  594. }
  595. // Error returns any retrieval or parsing error occurred during filtering.
  596. func (it *ENSNewTTLIterator) Error() error {
  597. return it.fail
  598. }
  599. // Close terminates the iteration process, releasing any pending underlying
  600. // resources.
  601. func (it *ENSNewTTLIterator) Close() error {
  602. it.sub.Unsubscribe()
  603. return nil
  604. }
  605. // ENSNewTTL represents a NewTTL event raised by the ENS contract.
  606. type ENSNewTTL struct {
  607. Node [32]byte
  608. Ttl uint64
  609. Raw types.Log // Blockchain specific contextual infos
  610. }
  611. // FilterNewTTL is a free log retrieval operation binding the contract event 0x1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa68.
  612. //
  613. // Solidity: event NewTTL(bytes32 indexed node, uint64 ttl)
  614. func (_ENS *ENSFilterer) FilterNewTTL(opts *bind.FilterOpts, node [][32]byte) (*ENSNewTTLIterator, error) {
  615. var nodeRule []interface{}
  616. for _, nodeItem := range node {
  617. nodeRule = append(nodeRule, nodeItem)
  618. }
  619. logs, sub, err := _ENS.contract.FilterLogs(opts, "NewTTL", nodeRule)
  620. if err != nil {
  621. return nil, err
  622. }
  623. return &ENSNewTTLIterator{contract: _ENS.contract, event: "NewTTL", logs: logs, sub: sub}, nil
  624. }
  625. // WatchNewTTL is a free log subscription operation binding the contract event 0x1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa68.
  626. //
  627. // Solidity: event NewTTL(bytes32 indexed node, uint64 ttl)
  628. func (_ENS *ENSFilterer) WatchNewTTL(opts *bind.WatchOpts, sink chan<- *ENSNewTTL, node [][32]byte) (event.Subscription, error) {
  629. var nodeRule []interface{}
  630. for _, nodeItem := range node {
  631. nodeRule = append(nodeRule, nodeItem)
  632. }
  633. logs, sub, err := _ENS.contract.WatchLogs(opts, "NewTTL", nodeRule)
  634. if err != nil {
  635. return nil, err
  636. }
  637. return event.NewSubscription(func(quit <-chan struct{}) error {
  638. defer sub.Unsubscribe()
  639. for {
  640. select {
  641. case log := <-logs:
  642. // New log arrived, parse the event and forward to the user
  643. event := new(ENSNewTTL)
  644. if err := _ENS.contract.UnpackLog(event, "NewTTL", log); err != nil {
  645. return err
  646. }
  647. event.Raw = log
  648. select {
  649. case sink <- event:
  650. case err := <-sub.Err():
  651. return err
  652. case <-quit:
  653. return nil
  654. }
  655. case err := <-sub.Err():
  656. return err
  657. case <-quit:
  658. return nil
  659. }
  660. }
  661. }), nil
  662. }
  663. // ENSTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ENS contract.
  664. type ENSTransferIterator struct {
  665. Event *ENSTransfer // Event containing the contract specifics and raw log
  666. contract *bind.BoundContract // Generic contract to use for unpacking event data
  667. event string // Event name to use for unpacking event data
  668. logs chan types.Log // Log channel receiving the found contract events
  669. sub ethereum.Subscription // Subscription for errors, completion and termination
  670. done bool // Whether the subscription completed delivering logs
  671. fail error // Occurred error to stop iteration
  672. }
  673. // Next advances the iterator to the subsequent event, returning whether there
  674. // are any more events found. In case of a retrieval or parsing error, false is
  675. // returned and Error() can be queried for the exact failure.
  676. func (it *ENSTransferIterator) Next() bool {
  677. // If the iterator failed, stop iterating
  678. if it.fail != nil {
  679. return false
  680. }
  681. // If the iterator completed, deliver directly whatever's available
  682. if it.done {
  683. select {
  684. case log := <-it.logs:
  685. it.Event = new(ENSTransfer)
  686. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  687. it.fail = err
  688. return false
  689. }
  690. it.Event.Raw = log
  691. return true
  692. default:
  693. return false
  694. }
  695. }
  696. // Iterator still in progress, wait for either a data or an error event
  697. select {
  698. case log := <-it.logs:
  699. it.Event = new(ENSTransfer)
  700. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  701. it.fail = err
  702. return false
  703. }
  704. it.Event.Raw = log
  705. return true
  706. case err := <-it.sub.Err():
  707. it.done = true
  708. it.fail = err
  709. return it.Next()
  710. }
  711. }
  712. // Error returns any retrieval or parsing error occurred during filtering.
  713. func (it *ENSTransferIterator) Error() error {
  714. return it.fail
  715. }
  716. // Close terminates the iteration process, releasing any pending underlying
  717. // resources.
  718. func (it *ENSTransferIterator) Close() error {
  719. it.sub.Unsubscribe()
  720. return nil
  721. }
  722. // ENSTransfer represents a Transfer event raised by the ENS contract.
  723. type ENSTransfer struct {
  724. Node [32]byte
  725. Owner common.Address
  726. Raw types.Log // Blockchain specific contextual infos
  727. }
  728. // FilterTransfer is a free log retrieval operation binding the contract event 0xd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d266.
  729. //
  730. // Solidity: event Transfer(bytes32 indexed node, address owner)
  731. func (_ENS *ENSFilterer) FilterTransfer(opts *bind.FilterOpts, node [][32]byte) (*ENSTransferIterator, error) {
  732. var nodeRule []interface{}
  733. for _, nodeItem := range node {
  734. nodeRule = append(nodeRule, nodeItem)
  735. }
  736. logs, sub, err := _ENS.contract.FilterLogs(opts, "Transfer", nodeRule)
  737. if err != nil {
  738. return nil, err
  739. }
  740. return &ENSTransferIterator{contract: _ENS.contract, event: "Transfer", logs: logs, sub: sub}, nil
  741. }
  742. // WatchTransfer is a free log subscription operation binding the contract event 0xd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d266.
  743. //
  744. // Solidity: event Transfer(bytes32 indexed node, address owner)
  745. func (_ENS *ENSFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ENSTransfer, node [][32]byte) (event.Subscription, error) {
  746. var nodeRule []interface{}
  747. for _, nodeItem := range node {
  748. nodeRule = append(nodeRule, nodeItem)
  749. }
  750. logs, sub, err := _ENS.contract.WatchLogs(opts, "Transfer", nodeRule)
  751. if err != nil {
  752. return nil, err
  753. }
  754. return event.NewSubscription(func(quit <-chan struct{}) error {
  755. defer sub.Unsubscribe()
  756. for {
  757. select {
  758. case log := <-logs:
  759. // New log arrived, parse the event and forward to the user
  760. event := new(ENSTransfer)
  761. if err := _ENS.contract.UnpackLog(event, "Transfer", log); err != nil {
  762. return err
  763. }
  764. event.Raw = log
  765. select {
  766. case sink <- event:
  767. case err := <-sub.Err():
  768. return err
  769. case <-quit:
  770. return nil
  771. }
  772. case err := <-sub.Err():
  773. return err
  774. case <-quit:
  775. return nil
  776. }
  777. }
  778. }), nil
  779. }