ens.go 36 KB

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