abi.go 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593
  1. package satoshi
  2. const validatorSetABI = `
  3. [
  4. {
  5. "anonymous": false,
  6. "inputs": [
  7. {
  8. "indexed": true,
  9. "internalType": "address",
  10. "name": "validator",
  11. "type": "address"
  12. },
  13. {
  14. "indexed": false,
  15. "internalType": "uint256",
  16. "name": "amount",
  17. "type": "uint256"
  18. }
  19. ],
  20. "name": "deprecatedDeposit",
  21. "type": "event"
  22. },
  23. {
  24. "anonymous": false,
  25. "inputs": [
  26. {
  27. "indexed": true,
  28. "internalType": "address payable",
  29. "name": "validator",
  30. "type": "address"
  31. },
  32. {
  33. "indexed": false,
  34. "internalType": "uint256",
  35. "name": "amount",
  36. "type": "uint256"
  37. }
  38. ],
  39. "name": "directTransfer",
  40. "type": "event"
  41. },
  42. {
  43. "anonymous": false,
  44. "inputs": [
  45. {
  46. "indexed": true,
  47. "internalType": "address payable",
  48. "name": "validator",
  49. "type": "address"
  50. },
  51. {
  52. "indexed": false,
  53. "internalType": "uint256",
  54. "name": "amount",
  55. "type": "uint256"
  56. }
  57. ],
  58. "name": "directTransferFail",
  59. "type": "event"
  60. },
  61. {
  62. "anonymous": false,
  63. "inputs": [
  64. {
  65. "indexed": false,
  66. "internalType": "string",
  67. "name": "message",
  68. "type": "string"
  69. }
  70. ],
  71. "name": "failReasonWithStr",
  72. "type": "event"
  73. },
  74. {
  75. "anonymous": false,
  76. "inputs": [
  77. {
  78. "indexed": false,
  79. "internalType": "string",
  80. "name": "key",
  81. "type": "string"
  82. },
  83. {
  84. "indexed": false,
  85. "internalType": "bytes",
  86. "name": "value",
  87. "type": "bytes"
  88. }
  89. ],
  90. "name": "paramChange",
  91. "type": "event"
  92. },
  93. {
  94. "anonymous": false,
  95. "inputs": [
  96. {
  97. "indexed": false,
  98. "internalType": "uint256",
  99. "name": "amount",
  100. "type": "uint256"
  101. }
  102. ],
  103. "name": "systemTransfer",
  104. "type": "event"
  105. },
  106. {
  107. "anonymous": false,
  108. "inputs": [
  109. {
  110. "indexed": true,
  111. "internalType": "address",
  112. "name": "validator",
  113. "type": "address"
  114. },
  115. {
  116. "indexed": false,
  117. "internalType": "uint256",
  118. "name": "amount",
  119. "type": "uint256"
  120. }
  121. ],
  122. "name": "validatorDeposit",
  123. "type": "event"
  124. },
  125. {
  126. "anonymous": false,
  127. "inputs": [
  128. {
  129. "indexed": true,
  130. "internalType": "address",
  131. "name": "validator",
  132. "type": "address"
  133. }
  134. ],
  135. "name": "validatorEmptyJailed",
  136. "type": "event"
  137. },
  138. {
  139. "anonymous": false,
  140. "inputs": [
  141. {
  142. "indexed": true,
  143. "internalType": "address",
  144. "name": "validator",
  145. "type": "address"
  146. },
  147. {
  148. "indexed": false,
  149. "internalType": "uint256",
  150. "name": "amount",
  151. "type": "uint256"
  152. }
  153. ],
  154. "name": "validatorFelony",
  155. "type": "event"
  156. },
  157. {
  158. "anonymous": false,
  159. "inputs": [
  160. {
  161. "indexed": true,
  162. "internalType": "address",
  163. "name": "validator",
  164. "type": "address"
  165. }
  166. ],
  167. "name": "validatorJailed",
  168. "type": "event"
  169. },
  170. {
  171. "anonymous": false,
  172. "inputs": [
  173. {
  174. "indexed": true,
  175. "internalType": "address",
  176. "name": "validator",
  177. "type": "address"
  178. },
  179. {
  180. "indexed": false,
  181. "internalType": "uint256",
  182. "name": "amount",
  183. "type": "uint256"
  184. }
  185. ],
  186. "name": "validatorMisdemeanor",
  187. "type": "event"
  188. },
  189. {
  190. "anonymous": false,
  191. "inputs": [],
  192. "name": "validatorSetUpdated",
  193. "type": "event"
  194. },
  195. {
  196. "inputs": [],
  197. "name": "CANDIDATE_HUB_ADDR",
  198. "outputs": [
  199. {
  200. "internalType": "address",
  201. "name": "",
  202. "type": "address"
  203. }
  204. ],
  205. "stateMutability": "view",
  206. "type": "function"
  207. },
  208. {
  209. "inputs": [],
  210. "name": "CODE_OK",
  211. "outputs": [
  212. {
  213. "internalType": "uint32",
  214. "name": "",
  215. "type": "uint32"
  216. }
  217. ],
  218. "stateMutability": "view",
  219. "type": "function"
  220. },
  221. {
  222. "inputs": [],
  223. "name": "ERROR_FAIL_DECODE",
  224. "outputs": [
  225. {
  226. "internalType": "uint32",
  227. "name": "",
  228. "type": "uint32"
  229. }
  230. ],
  231. "stateMutability": "view",
  232. "type": "function"
  233. },
  234. {
  235. "inputs": [],
  236. "name": "GOV_HUB_ADDR",
  237. "outputs": [
  238. {
  239. "internalType": "address",
  240. "name": "",
  241. "type": "address"
  242. }
  243. ],
  244. "stateMutability": "view",
  245. "type": "function"
  246. },
  247. {
  248. "inputs": [],
  249. "name": "INIT_VALIDATORSET_BYTES",
  250. "outputs": [
  251. {
  252. "internalType": "bytes",
  253. "name": "",
  254. "type": "bytes"
  255. }
  256. ],
  257. "stateMutability": "view",
  258. "type": "function"
  259. },
  260. {
  261. "inputs": [],
  262. "name": "LIGHT_CLIENT_ADDR",
  263. "outputs": [
  264. {
  265. "internalType": "address",
  266. "name": "",
  267. "type": "address"
  268. }
  269. ],
  270. "stateMutability": "view",
  271. "type": "function"
  272. },
  273. {
  274. "inputs": [],
  275. "name": "MAX_NUM_OF_VALIDATORS",
  276. "outputs": [
  277. {
  278. "internalType": "uint256",
  279. "name": "",
  280. "type": "uint256"
  281. }
  282. ],
  283. "stateMutability": "view",
  284. "type": "function"
  285. },
  286. {
  287. "inputs": [],
  288. "name": "RELAYER_HUB_ADDR",
  289. "outputs": [
  290. {
  291. "internalType": "address",
  292. "name": "",
  293. "type": "address"
  294. }
  295. ],
  296. "stateMutability": "view",
  297. "type": "function"
  298. },
  299. {
  300. "inputs": [],
  301. "name": "SLASH_CONTRACT_ADDR",
  302. "outputs": [
  303. {
  304. "internalType": "address",
  305. "name": "",
  306. "type": "address"
  307. }
  308. ],
  309. "stateMutability": "view",
  310. "type": "function"
  311. },
  312. {
  313. "inputs": [],
  314. "name": "SYSTEM_REWARD_ADDR",
  315. "outputs": [
  316. {
  317. "internalType": "address",
  318. "name": "",
  319. "type": "address"
  320. }
  321. ],
  322. "stateMutability": "view",
  323. "type": "function"
  324. },
  325. {
  326. "inputs": [],
  327. "name": "VALIDATOR_CONTRACT_ADDR",
  328. "outputs": [
  329. {
  330. "internalType": "address",
  331. "name": "",
  332. "type": "address"
  333. }
  334. ],
  335. "stateMutability": "view",
  336. "type": "function"
  337. },
  338. {
  339. "inputs": [],
  340. "name": "alreadyInit",
  341. "outputs": [
  342. {
  343. "internalType": "bool",
  344. "name": "",
  345. "type": "bool"
  346. }
  347. ],
  348. "stateMutability": "view",
  349. "type": "function"
  350. },
  351. {
  352. "inputs": [
  353. {
  354. "internalType": "uint256",
  355. "name": "",
  356. "type": "uint256"
  357. }
  358. ],
  359. "name": "currentValidatorSet",
  360. "outputs": [
  361. {
  362. "internalType": "address",
  363. "name": "consensusAddress",
  364. "type": "address"
  365. },
  366. {
  367. "internalType": "address payable",
  368. "name": "feeAddress",
  369. "type": "address"
  370. },
  371. {
  372. "internalType": "bool",
  373. "name": "jailed",
  374. "type": "bool"
  375. },
  376. {
  377. "internalType": "uint256",
  378. "name": "incoming",
  379. "type": "uint256"
  380. }
  381. ],
  382. "stateMutability": "view",
  383. "type": "function"
  384. },
  385. {
  386. "inputs": [
  387. {
  388. "internalType": "address",
  389. "name": "",
  390. "type": "address"
  391. }
  392. ],
  393. "name": "currentValidatorSetMap",
  394. "outputs": [
  395. {
  396. "internalType": "uint256",
  397. "name": "",
  398. "type": "uint256"
  399. }
  400. ],
  401. "stateMutability": "view",
  402. "type": "function"
  403. },
  404. {
  405. "inputs": [
  406. {
  407. "internalType": "address",
  408. "name": "valAddr",
  409. "type": "address"
  410. }
  411. ],
  412. "name": "deposit",
  413. "outputs": [],
  414. "stateMutability": "payable",
  415. "type": "function"
  416. },
  417. {
  418. "inputs": [
  419. {
  420. "internalType": "address",
  421. "name": "validator",
  422. "type": "address"
  423. }
  424. ],
  425. "name": "felony",
  426. "outputs": [],
  427. "stateMutability": "nonpayable",
  428. "type": "function"
  429. },
  430. {
  431. "inputs": [
  432. {
  433. "internalType": "address",
  434. "name": "validator",
  435. "type": "address"
  436. }
  437. ],
  438. "name": "getIncoming",
  439. "outputs": [
  440. {
  441. "internalType": "uint256",
  442. "name": "",
  443. "type": "uint256"
  444. }
  445. ],
  446. "stateMutability": "view",
  447. "type": "function"
  448. },
  449. {
  450. "inputs": [],
  451. "name": "getValidators",
  452. "outputs": [
  453. {
  454. "internalType": "address[]",
  455. "name": "",
  456. "type": "address[]"
  457. }
  458. ],
  459. "stateMutability": "view",
  460. "type": "function"
  461. },
  462. {
  463. "inputs": [],
  464. "name": "init",
  465. "outputs": [],
  466. "stateMutability": "nonpayable",
  467. "type": "function"
  468. },
  469. {
  470. "inputs": [
  471. {
  472. "internalType": "address",
  473. "name": "validator",
  474. "type": "address"
  475. }
  476. ],
  477. "name": "misdemeanor",
  478. "outputs": [],
  479. "stateMutability": "nonpayable",
  480. "type": "function"
  481. },
  482. {
  483. "inputs": [],
  484. "name": "numOfJailed",
  485. "outputs": [
  486. {
  487. "internalType": "uint256",
  488. "name": "",
  489. "type": "uint256"
  490. }
  491. ],
  492. "stateMutability": "view",
  493. "type": "function"
  494. },
  495. {
  496. "inputs": [],
  497. "name": "totalInComing",
  498. "outputs": [
  499. {
  500. "internalType": "uint256",
  501. "name": "",
  502. "type": "uint256"
  503. }
  504. ],
  505. "stateMutability": "view",
  506. "type": "function"
  507. },
  508. {
  509. "inputs": [
  510. {
  511. "internalType": "string",
  512. "name": "key",
  513. "type": "string"
  514. },
  515. {
  516. "internalType": "bytes",
  517. "name": "value",
  518. "type": "bytes"
  519. }
  520. ],
  521. "name": "updateParam",
  522. "outputs": [],
  523. "stateMutability": "nonpayable",
  524. "type": "function"
  525. },
  526. {
  527. "inputs": [
  528. {
  529. "internalType": "address[]",
  530. "name": "consensusAddrList",
  531. "type": "address[]"
  532. },
  533. {
  534. "internalType": "address[]",
  535. "name": "feeAddrList",
  536. "type": "address[]"
  537. }
  538. ],
  539. "name": "updateValidatorSet",
  540. "outputs": [],
  541. "stateMutability": "nonpayable",
  542. "type": "function"
  543. }
  544. ]
  545. `
  546. const slashABI = `
  547. [
  548. {
  549. "anonymous": false,
  550. "inputs": [],
  551. "name": "indicatorCleaned",
  552. "type": "event"
  553. },
  554. {
  555. "anonymous": false,
  556. "inputs": [
  557. {
  558. "indexed": false,
  559. "internalType": "string",
  560. "name": "key",
  561. "type": "string"
  562. },
  563. {
  564. "indexed": false,
  565. "internalType": "bytes",
  566. "name": "value",
  567. "type": "bytes"
  568. }
  569. ],
  570. "name": "paramChange",
  571. "type": "event"
  572. },
  573. {
  574. "anonymous": false,
  575. "inputs": [
  576. {
  577. "indexed": true,
  578. "internalType": "address",
  579. "name": "validator",
  580. "type": "address"
  581. }
  582. ],
  583. "name": "validatorSlashed",
  584. "type": "event"
  585. },
  586. {
  587. "inputs": [],
  588. "name": "CANDIDATE_HUB_ADDR",
  589. "outputs": [
  590. {
  591. "internalType": "address",
  592. "name": "",
  593. "type": "address"
  594. }
  595. ],
  596. "stateMutability": "view",
  597. "type": "function"
  598. },
  599. {
  600. "inputs": [],
  601. "name": "CODE_OK",
  602. "outputs": [
  603. {
  604. "internalType": "uint32",
  605. "name": "",
  606. "type": "uint32"
  607. }
  608. ],
  609. "stateMutability": "view",
  610. "type": "function"
  611. },
  612. {
  613. "inputs": [],
  614. "name": "DECREASE_RATE",
  615. "outputs": [
  616. {
  617. "internalType": "uint256",
  618. "name": "",
  619. "type": "uint256"
  620. }
  621. ],
  622. "stateMutability": "view",
  623. "type": "function"
  624. },
  625. {
  626. "inputs": [],
  627. "name": "ERROR_FAIL_DECODE",
  628. "outputs": [
  629. {
  630. "internalType": "uint32",
  631. "name": "",
  632. "type": "uint32"
  633. }
  634. ],
  635. "stateMutability": "view",
  636. "type": "function"
  637. },
  638. {
  639. "inputs": [],
  640. "name": "FELONY_THRESHOLD",
  641. "outputs": [
  642. {
  643. "internalType": "uint256",
  644. "name": "",
  645. "type": "uint256"
  646. }
  647. ],
  648. "stateMutability": "view",
  649. "type": "function"
  650. },
  651. {
  652. "inputs": [],
  653. "name": "GOV_HUB_ADDR",
  654. "outputs": [
  655. {
  656. "internalType": "address",
  657. "name": "",
  658. "type": "address"
  659. }
  660. ],
  661. "stateMutability": "view",
  662. "type": "function"
  663. },
  664. {
  665. "inputs": [],
  666. "name": "LIGHT_CLIENT_ADDR",
  667. "outputs": [
  668. {
  669. "internalType": "address",
  670. "name": "",
  671. "type": "address"
  672. }
  673. ],
  674. "stateMutability": "view",
  675. "type": "function"
  676. },
  677. {
  678. "inputs": [],
  679. "name": "MISDEMEANOR_THRESHOLD",
  680. "outputs": [
  681. {
  682. "internalType": "uint256",
  683. "name": "",
  684. "type": "uint256"
  685. }
  686. ],
  687. "stateMutability": "view",
  688. "type": "function"
  689. },
  690. {
  691. "inputs": [],
  692. "name": "RELAYER_HUB_ADDR",
  693. "outputs": [
  694. {
  695. "internalType": "address",
  696. "name": "",
  697. "type": "address"
  698. }
  699. ],
  700. "stateMutability": "view",
  701. "type": "function"
  702. },
  703. {
  704. "inputs": [],
  705. "name": "RELAYER_REWARD",
  706. "outputs": [
  707. {
  708. "internalType": "uint256",
  709. "name": "",
  710. "type": "uint256"
  711. }
  712. ],
  713. "stateMutability": "view",
  714. "type": "function"
  715. },
  716. {
  717. "inputs": [],
  718. "name": "SLASH_CONTRACT_ADDR",
  719. "outputs": [
  720. {
  721. "internalType": "address",
  722. "name": "",
  723. "type": "address"
  724. }
  725. ],
  726. "stateMutability": "view",
  727. "type": "function"
  728. },
  729. {
  730. "inputs": [],
  731. "name": "SYSTEM_REWARD_ADDR",
  732. "outputs": [
  733. {
  734. "internalType": "address",
  735. "name": "",
  736. "type": "address"
  737. }
  738. ],
  739. "stateMutability": "view",
  740. "type": "function"
  741. },
  742. {
  743. "inputs": [],
  744. "name": "VALIDATOR_CONTRACT_ADDR",
  745. "outputs": [
  746. {
  747. "internalType": "address",
  748. "name": "",
  749. "type": "address"
  750. }
  751. ],
  752. "stateMutability": "view",
  753. "type": "function"
  754. },
  755. {
  756. "inputs": [],
  757. "name": "alreadyInit",
  758. "outputs": [
  759. {
  760. "internalType": "bool",
  761. "name": "",
  762. "type": "bool"
  763. }
  764. ],
  765. "stateMutability": "view",
  766. "type": "function"
  767. },
  768. {
  769. "inputs": [],
  770. "name": "clean",
  771. "outputs": [],
  772. "stateMutability": "nonpayable",
  773. "type": "function"
  774. },
  775. {
  776. "inputs": [],
  777. "name": "felonyThreshold",
  778. "outputs": [
  779. {
  780. "internalType": "uint256",
  781. "name": "",
  782. "type": "uint256"
  783. }
  784. ],
  785. "stateMutability": "view",
  786. "type": "function"
  787. },
  788. {
  789. "inputs": [
  790. {
  791. "internalType": "address",
  792. "name": "validator",
  793. "type": "address"
  794. }
  795. ],
  796. "name": "getSlashIndicator",
  797. "outputs": [
  798. {
  799. "internalType": "uint256",
  800. "name": "",
  801. "type": "uint256"
  802. },
  803. {
  804. "internalType": "uint256",
  805. "name": "",
  806. "type": "uint256"
  807. }
  808. ],
  809. "stateMutability": "view",
  810. "type": "function"
  811. },
  812. {
  813. "inputs": [
  814. {
  815. "internalType": "address",
  816. "name": "",
  817. "type": "address"
  818. }
  819. ],
  820. "name": "indicators",
  821. "outputs": [
  822. {
  823. "internalType": "uint256",
  824. "name": "height",
  825. "type": "uint256"
  826. },
  827. {
  828. "internalType": "uint256",
  829. "name": "count",
  830. "type": "uint256"
  831. },
  832. {
  833. "internalType": "bool",
  834. "name": "exist",
  835. "type": "bool"
  836. }
  837. ],
  838. "stateMutability": "view",
  839. "type": "function"
  840. },
  841. {
  842. "inputs": [],
  843. "name": "init",
  844. "outputs": [],
  845. "stateMutability": "nonpayable",
  846. "type": "function"
  847. },
  848. {
  849. "inputs": [],
  850. "name": "misdemeanorThreshold",
  851. "outputs": [
  852. {
  853. "internalType": "uint256",
  854. "name": "",
  855. "type": "uint256"
  856. }
  857. ],
  858. "stateMutability": "view",
  859. "type": "function"
  860. },
  861. {
  862. "inputs": [],
  863. "name": "previousHeight",
  864. "outputs": [
  865. {
  866. "internalType": "uint256",
  867. "name": "",
  868. "type": "uint256"
  869. }
  870. ],
  871. "stateMutability": "view",
  872. "type": "function"
  873. },
  874. {
  875. "inputs": [
  876. {
  877. "internalType": "address",
  878. "name": "validator",
  879. "type": "address"
  880. }
  881. ],
  882. "name": "slash",
  883. "outputs": [],
  884. "stateMutability": "nonpayable",
  885. "type": "function"
  886. },
  887. {
  888. "inputs": [
  889. {
  890. "internalType": "string",
  891. "name": "key",
  892. "type": "string"
  893. },
  894. {
  895. "internalType": "bytes",
  896. "name": "value",
  897. "type": "bytes"
  898. }
  899. ],
  900. "name": "updateParam",
  901. "outputs": [],
  902. "stateMutability": "nonpayable",
  903. "type": "function"
  904. },
  905. {
  906. "inputs": [
  907. {
  908. "internalType": "uint256",
  909. "name": "",
  910. "type": "uint256"
  911. }
  912. ],
  913. "name": "validators",
  914. "outputs": [
  915. {
  916. "internalType": "address",
  917. "name": "",
  918. "type": "address"
  919. }
  920. ],
  921. "stateMutability": "view",
  922. "type": "function"
  923. }
  924. ]
  925. `
  926. const candidateHubABI = `
  927. [
  928. {
  929. "anonymous": false,
  930. "inputs": [
  931. {
  932. "indexed": false,
  933. "internalType": "address",
  934. "name": "_consensusAddress",
  935. "type": "address"
  936. },
  937. {
  938. "indexed": false,
  939. "internalType": "address",
  940. "name": "_feeAddress",
  941. "type": "address"
  942. },
  943. {
  944. "indexed": false,
  945. "internalType": "uint256",
  946. "name": "value",
  947. "type": "uint256"
  948. }
  949. ],
  950. "name": "candidatePledge",
  951. "type": "event"
  952. },
  953. {
  954. "anonymous": false,
  955. "inputs": [
  956. {
  957. "indexed": false,
  958. "internalType": "address",
  959. "name": "_powerAddress",
  960. "type": "address"
  961. },
  962. {
  963. "indexed": false,
  964. "internalType": "address",
  965. "name": "_consensusAddress",
  966. "type": "address"
  967. },
  968. {
  969. "indexed": false,
  970. "internalType": "address",
  971. "name": "_feeAddress",
  972. "type": "address"
  973. }
  974. ],
  975. "name": "candidateRegister",
  976. "type": "event"
  977. },
  978. {
  979. "anonymous": false,
  980. "inputs": [
  981. {
  982. "indexed": false,
  983. "internalType": "address",
  984. "name": "_consensusAddress",
  985. "type": "address"
  986. },
  987. {
  988. "indexed": false,
  989. "internalType": "uint256",
  990. "name": "value",
  991. "type": "uint256"
  992. }
  993. ],
  994. "name": "candidateRelease",
  995. "type": "event"
  996. },
  997. {
  998. "anonymous": false,
  999. "inputs": [
  1000. {
  1001. "indexed": false,
  1002. "internalType": "address",
  1003. "name": "_powerAddress",
  1004. "type": "address"
  1005. }
  1006. ],
  1007. "name": "candidateUnRegister",
  1008. "type": "event"
  1009. },
  1010. {
  1011. "anonymous": false,
  1012. "inputs": [
  1013. {
  1014. "indexed": false,
  1015. "internalType": "string",
  1016. "name": "key",
  1017. "type": "string"
  1018. },
  1019. {
  1020. "indexed": false,
  1021. "internalType": "bytes",
  1022. "name": "value",
  1023. "type": "bytes"
  1024. }
  1025. ],
  1026. "name": "paramChange",
  1027. "type": "event"
  1028. },
  1029. {
  1030. "inputs": [],
  1031. "name": "CANDIDATE_HUB_ADDR",
  1032. "outputs": [
  1033. {
  1034. "internalType": "address",
  1035. "name": "",
  1036. "type": "address"
  1037. }
  1038. ],
  1039. "stateMutability": "view",
  1040. "type": "function"
  1041. },
  1042. {
  1043. "inputs": [],
  1044. "name": "CODE_OK",
  1045. "outputs": [
  1046. {
  1047. "internalType": "uint32",
  1048. "name": "",
  1049. "type": "uint32"
  1050. }
  1051. ],
  1052. "stateMutability": "view",
  1053. "type": "function"
  1054. },
  1055. {
  1056. "inputs": [],
  1057. "name": "ERROR_FAIL_DECODE",
  1058. "outputs": [
  1059. {
  1060. "internalType": "uint32",
  1061. "name": "",
  1062. "type": "uint32"
  1063. }
  1064. ],
  1065. "stateMutability": "view",
  1066. "type": "function"
  1067. },
  1068. {
  1069. "inputs": [],
  1070. "name": "GOV_HUB_ADDR",
  1071. "outputs": [
  1072. {
  1073. "internalType": "address",
  1074. "name": "",
  1075. "type": "address"
  1076. }
  1077. ],
  1078. "stateMutability": "view",
  1079. "type": "function"
  1080. },
  1081. {
  1082. "inputs": [],
  1083. "name": "INIT_DUES",
  1084. "outputs": [
  1085. {
  1086. "internalType": "uint256",
  1087. "name": "",
  1088. "type": "uint256"
  1089. }
  1090. ],
  1091. "stateMutability": "view",
  1092. "type": "function"
  1093. },
  1094. {
  1095. "inputs": [],
  1096. "name": "INIT_MIN_PLEDGE_DEPOSIT",
  1097. "outputs": [
  1098. {
  1099. "internalType": "uint256",
  1100. "name": "",
  1101. "type": "uint256"
  1102. }
  1103. ],
  1104. "stateMutability": "view",
  1105. "type": "function"
  1106. },
  1107. {
  1108. "inputs": [],
  1109. "name": "INIT_MIN_POWER",
  1110. "outputs": [
  1111. {
  1112. "internalType": "uint256",
  1113. "name": "",
  1114. "type": "uint256"
  1115. }
  1116. ],
  1117. "stateMutability": "view",
  1118. "type": "function"
  1119. },
  1120. {
  1121. "inputs": [],
  1122. "name": "INIT_REQUIRED_DEPOSIT",
  1123. "outputs": [
  1124. {
  1125. "internalType": "uint256",
  1126. "name": "",
  1127. "type": "uint256"
  1128. }
  1129. ],
  1130. "stateMutability": "view",
  1131. "type": "function"
  1132. },
  1133. {
  1134. "inputs": [],
  1135. "name": "INIT_ROUND_HASH",
  1136. "outputs": [
  1137. {
  1138. "internalType": "bytes32",
  1139. "name": "",
  1140. "type": "bytes32"
  1141. }
  1142. ],
  1143. "stateMutability": "view",
  1144. "type": "function"
  1145. },
  1146. {
  1147. "inputs": [],
  1148. "name": "INIT_ROUND_INTERVAL",
  1149. "outputs": [
  1150. {
  1151. "internalType": "uint256",
  1152. "name": "",
  1153. "type": "uint256"
  1154. }
  1155. ],
  1156. "stateMutability": "view",
  1157. "type": "function"
  1158. },
  1159. {
  1160. "inputs": [],
  1161. "name": "INIT_VALIDATOR_COUNT",
  1162. "outputs": [
  1163. {
  1164. "internalType": "uint256",
  1165. "name": "",
  1166. "type": "uint256"
  1167. }
  1168. ],
  1169. "stateMutability": "view",
  1170. "type": "function"
  1171. },
  1172. {
  1173. "inputs": [],
  1174. "name": "LIGHT_CLIENT_ADDR",
  1175. "outputs": [
  1176. {
  1177. "internalType": "address",
  1178. "name": "",
  1179. "type": "address"
  1180. }
  1181. ],
  1182. "stateMutability": "view",
  1183. "type": "function"
  1184. },
  1185. {
  1186. "inputs": [],
  1187. "name": "RELAYER_HUB_ADDR",
  1188. "outputs": [
  1189. {
  1190. "internalType": "address",
  1191. "name": "",
  1192. "type": "address"
  1193. }
  1194. ],
  1195. "stateMutability": "view",
  1196. "type": "function"
  1197. },
  1198. {
  1199. "inputs": [],
  1200. "name": "SLASH_CONTRACT_ADDR",
  1201. "outputs": [
  1202. {
  1203. "internalType": "address",
  1204. "name": "",
  1205. "type": "address"
  1206. }
  1207. ],
  1208. "stateMutability": "view",
  1209. "type": "function"
  1210. },
  1211. {
  1212. "inputs": [],
  1213. "name": "SYSTEM_REWARD_ADDR",
  1214. "outputs": [
  1215. {
  1216. "internalType": "address",
  1217. "name": "",
  1218. "type": "address"
  1219. }
  1220. ],
  1221. "stateMutability": "view",
  1222. "type": "function"
  1223. },
  1224. {
  1225. "inputs": [],
  1226. "name": "VALIDATOR_CONTRACT_ADDR",
  1227. "outputs": [
  1228. {
  1229. "internalType": "address",
  1230. "name": "",
  1231. "type": "address"
  1232. }
  1233. ],
  1234. "stateMutability": "view",
  1235. "type": "function"
  1236. },
  1237. {
  1238. "inputs": [],
  1239. "name": "alreadyInit",
  1240. "outputs": [
  1241. {
  1242. "internalType": "bool",
  1243. "name": "",
  1244. "type": "bool"
  1245. }
  1246. ],
  1247. "stateMutability": "view",
  1248. "type": "function"
  1249. },
  1250. {
  1251. "inputs": [
  1252. {
  1253. "internalType": "uint256",
  1254. "name": "",
  1255. "type": "uint256"
  1256. }
  1257. ],
  1258. "name": "btcCandidateSet",
  1259. "outputs": [
  1260. {
  1261. "internalType": "address",
  1262. "name": "btcAddress",
  1263. "type": "address"
  1264. },
  1265. {
  1266. "internalType": "address",
  1267. "name": "consensusAddress",
  1268. "type": "address"
  1269. },
  1270. {
  1271. "internalType": "address",
  1272. "name": "feeAddress",
  1273. "type": "address"
  1274. },
  1275. {
  1276. "internalType": "uint256",
  1277. "name": "votingPower",
  1278. "type": "uint256"
  1279. },
  1280. {
  1281. "internalType": "uint256",
  1282. "name": "deposit",
  1283. "type": "uint256"
  1284. },
  1285. {
  1286. "internalType": "uint256",
  1287. "name": "dues",
  1288. "type": "uint256"
  1289. }
  1290. ],
  1291. "stateMutability": "view",
  1292. "type": "function"
  1293. },
  1294. {
  1295. "inputs": [],
  1296. "name": "dues",
  1297. "outputs": [
  1298. {
  1299. "internalType": "uint256",
  1300. "name": "",
  1301. "type": "uint256"
  1302. }
  1303. ],
  1304. "stateMutability": "view",
  1305. "type": "function"
  1306. },
  1307. {
  1308. "inputs": [],
  1309. "name": "init",
  1310. "outputs": [],
  1311. "stateMutability": "nonpayable",
  1312. "type": "function"
  1313. },
  1314. {
  1315. "inputs": [
  1316. {
  1317. "internalType": "address",
  1318. "name": "sender",
  1319. "type": "address"
  1320. }
  1321. ],
  1322. "name": "isBtcCandidate",
  1323. "outputs": [
  1324. {
  1325. "internalType": "bool",
  1326. "name": "",
  1327. "type": "bool"
  1328. }
  1329. ],
  1330. "stateMutability": "view",
  1331. "type": "function"
  1332. },
  1333. {
  1334. "inputs": [
  1335. {
  1336. "internalType": "address",
  1337. "name": "sender",
  1338. "type": "address"
  1339. }
  1340. ],
  1341. "name": "isBtcRegisterdd",
  1342. "outputs": [
  1343. {
  1344. "internalType": "bool",
  1345. "name": "",
  1346. "type": "bool"
  1347. }
  1348. ],
  1349. "stateMutability": "view",
  1350. "type": "function"
  1351. },
  1352. {
  1353. "inputs": [
  1354. {
  1355. "internalType": "address",
  1356. "name": "sender",
  1357. "type": "address"
  1358. }
  1359. ],
  1360. "name": "isPledgeCandidate",
  1361. "outputs": [
  1362. {
  1363. "internalType": "bool",
  1364. "name": "",
  1365. "type": "bool"
  1366. }
  1367. ],
  1368. "stateMutability": "view",
  1369. "type": "function"
  1370. },
  1371. {
  1372. "inputs": [
  1373. {
  1374. "internalType": "address",
  1375. "name": "validator",
  1376. "type": "address"
  1377. },
  1378. {
  1379. "internalType": "uint256",
  1380. "name": "round",
  1381. "type": "uint256"
  1382. }
  1383. ],
  1384. "name": "jailValidator",
  1385. "outputs": [],
  1386. "stateMutability": "nonpayable",
  1387. "type": "function"
  1388. },
  1389. {
  1390. "inputs": [],
  1391. "name": "minPledgeDeposit",
  1392. "outputs": [
  1393. {
  1394. "internalType": "uint256",
  1395. "name": "",
  1396. "type": "uint256"
  1397. }
  1398. ],
  1399. "stateMutability": "view",
  1400. "type": "function"
  1401. },
  1402. {
  1403. "inputs": [],
  1404. "name": "minPower",
  1405. "outputs": [
  1406. {
  1407. "internalType": "uint256",
  1408. "name": "",
  1409. "type": "uint256"
  1410. }
  1411. ],
  1412. "stateMutability": "view",
  1413. "type": "function"
  1414. },
  1415. {
  1416. "inputs": [
  1417. {
  1418. "internalType": "address payable",
  1419. "name": "feeAddress",
  1420. "type": "address"
  1421. }
  1422. ],
  1423. "name": "pledge",
  1424. "outputs": [],
  1425. "stateMutability": "payable",
  1426. "type": "function"
  1427. },
  1428. {
  1429. "inputs": [
  1430. {
  1431. "internalType": "uint256",
  1432. "name": "",
  1433. "type": "uint256"
  1434. }
  1435. ],
  1436. "name": "pledgeCandidateSet",
  1437. "outputs": [
  1438. {
  1439. "internalType": "address",
  1440. "name": "consensusAddress",
  1441. "type": "address"
  1442. },
  1443. {
  1444. "internalType": "address",
  1445. "name": "feeAddress",
  1446. "type": "address"
  1447. },
  1448. {
  1449. "internalType": "uint256",
  1450. "name": "votingPower",
  1451. "type": "uint256"
  1452. },
  1453. {
  1454. "internalType": "uint256",
  1455. "name": "deposit",
  1456. "type": "uint256"
  1457. },
  1458. {
  1459. "internalType": "uint256",
  1460. "name": "dues",
  1461. "type": "uint256"
  1462. }
  1463. ],
  1464. "stateMutability": "view",
  1465. "type": "function"
  1466. },
  1467. {
  1468. "inputs": [],
  1469. "name": "preroundTailHash",
  1470. "outputs": [
  1471. {
  1472. "internalType": "bytes32",
  1473. "name": "",
  1474. "type": "bytes32"
  1475. }
  1476. ],
  1477. "stateMutability": "view",
  1478. "type": "function"
  1479. },
  1480. {
  1481. "inputs": [
  1482. {
  1483. "internalType": "address",
  1484. "name": "consensusAddress",
  1485. "type": "address"
  1486. },
  1487. {
  1488. "internalType": "address payable",
  1489. "name": "feeAddress",
  1490. "type": "address"
  1491. }
  1492. ],
  1493. "name": "register",
  1494. "outputs": [],
  1495. "stateMutability": "payable",
  1496. "type": "function"
  1497. },
  1498. {
  1499. "inputs": [],
  1500. "name": "releasePledge",
  1501. "outputs": [],
  1502. "stateMutability": "nonpayable",
  1503. "type": "function"
  1504. },
  1505. {
  1506. "inputs": [],
  1507. "name": "requiredDeposit",
  1508. "outputs": [
  1509. {
  1510. "internalType": "uint256",
  1511. "name": "",
  1512. "type": "uint256"
  1513. }
  1514. ],
  1515. "stateMutability": "view",
  1516. "type": "function"
  1517. },
  1518. {
  1519. "inputs": [],
  1520. "name": "roundInterval",
  1521. "outputs": [
  1522. {
  1523. "internalType": "uint256",
  1524. "name": "",
  1525. "type": "uint256"
  1526. }
  1527. ],
  1528. "stateMutability": "view",
  1529. "type": "function"
  1530. },
  1531. {
  1532. "inputs": [],
  1533. "name": "roundTag",
  1534. "outputs": [
  1535. {
  1536. "internalType": "uint256",
  1537. "name": "",
  1538. "type": "uint256"
  1539. }
  1540. ],
  1541. "stateMutability": "view",
  1542. "type": "function"
  1543. },
  1544. {
  1545. "inputs": [],
  1546. "name": "turnRound",
  1547. "outputs": [],
  1548. "stateMutability": "nonpayable",
  1549. "type": "function"
  1550. },
  1551. {
  1552. "inputs": [],
  1553. "name": "unregister",
  1554. "outputs": [],
  1555. "stateMutability": "nonpayable",
  1556. "type": "function"
  1557. },
  1558. {
  1559. "inputs": [
  1560. {
  1561. "internalType": "string",
  1562. "name": "key",
  1563. "type": "string"
  1564. },
  1565. {
  1566. "internalType": "bytes",
  1567. "name": "value",
  1568. "type": "bytes"
  1569. }
  1570. ],
  1571. "name": "updateParam",
  1572. "outputs": [],
  1573. "stateMutability": "nonpayable",
  1574. "type": "function"
  1575. },
  1576. {
  1577. "inputs": [],
  1578. "name": "validatorCount",
  1579. "outputs": [
  1580. {
  1581. "internalType": "uint256",
  1582. "name": "",
  1583. "type": "uint256"
  1584. }
  1585. ],
  1586. "stateMutability": "view",
  1587. "type": "function"
  1588. }
  1589. ]
  1590. `