fhlAbi.go 21 KB

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