You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1137 lines
23 KiB

5 months ago
5 months ago
5 months ago
  1. const ethers = require("ethers")
  2. const _abi = [
  3. {
  4. inputs: [],
  5. name: "InvalidInitialization",
  6. type: "error",
  7. },
  8. {
  9. inputs: [],
  10. name: "NotInitializing",
  11. type: "error",
  12. },
  13. {
  14. anonymous: false,
  15. inputs: [
  16. {
  17. indexed: false,
  18. internalType: "uint64",
  19. name: "version",
  20. type: "uint64",
  21. },
  22. ],
  23. name: "Initialized",
  24. type: "event",
  25. },
  26. {
  27. inputs: [
  28. {
  29. internalType: "address",
  30. name: "",
  31. type: "address",
  32. },
  33. ],
  34. name: "blackList",
  35. outputs: [
  36. {
  37. internalType: "bool",
  38. name: "",
  39. type: "bool",
  40. },
  41. ],
  42. stateMutability: "view",
  43. type: "function",
  44. },
  45. {
  46. inputs: [
  47. {
  48. components: [
  49. {
  50. internalType: "uint256",
  51. name: "tokenId",
  52. type: "uint256",
  53. },
  54. {
  55. internalType: "uint256",
  56. name: "startTime",
  57. type: "uint256",
  58. },
  59. {
  60. internalType: "uint256",
  61. name: "endTime",
  62. type: "uint256",
  63. },
  64. {
  65. internalType: "uint256",
  66. name: "withdrawTime",
  67. type: "uint256",
  68. },
  69. {
  70. internalType: "uint256",
  71. name: "pledgeAmount",
  72. type: "uint256",
  73. },
  74. {
  75. internalType: "uint256",
  76. name: "rate",
  77. type: "uint256",
  78. },
  79. {
  80. internalType: "uint256",
  81. name: "pledgeDay",
  82. type: "uint256",
  83. },
  84. {
  85. internalType: "address",
  86. name: "sender",
  87. type: "address",
  88. },
  89. ],
  90. internalType: "struct PledgeType",
  91. name: "_pledge",
  92. type: "tuple",
  93. },
  94. {
  95. internalType: "uint256",
  96. name: "_type",
  97. type: "uint256",
  98. },
  99. ],
  100. name: "calculateInterest",
  101. outputs: [
  102. {
  103. internalType: "uint256",
  104. name: "",
  105. type: "uint256",
  106. },
  107. ],
  108. stateMutability: "view",
  109. type: "function",
  110. },
  111. {
  112. inputs: [],
  113. name: "dayTime",
  114. outputs: [
  115. {
  116. internalType: "uint256",
  117. name: "",
  118. type: "uint256",
  119. },
  120. ],
  121. stateMutability: "view",
  122. type: "function",
  123. },
  124. {
  125. inputs: [
  126. {
  127. internalType: "uint256",
  128. name: "tokenId",
  129. type: "uint256",
  130. },
  131. ],
  132. name: "destroyPledge",
  133. outputs: [],
  134. stateMutability: "nonpayable",
  135. type: "function",
  136. },
  137. {
  138. inputs: [
  139. {
  140. internalType: "address",
  141. name: "addr",
  142. type: "address",
  143. },
  144. ],
  145. name: "getAllInvitationMember",
  146. outputs: [
  147. {
  148. components: [
  149. {
  150. internalType: "address",
  151. name: "key",
  152. type: "address",
  153. },
  154. {
  155. internalType: "address",
  156. name: "referrer",
  157. type: "address",
  158. },
  159. {
  160. internalType: "uint256",
  161. name: "bindTime",
  162. type: "uint256",
  163. },
  164. {
  165. internalType: "uint256",
  166. name: "contribute",
  167. type: "uint256",
  168. },
  169. ],
  170. internalType: "struct RecommendObjType[]",
  171. name: "result",
  172. type: "tuple[]",
  173. },
  174. ],
  175. stateMutability: "view",
  176. type: "function",
  177. },
  178. {
  179. inputs: [],
  180. name: "getCurrentTime",
  181. outputs: [
  182. {
  183. internalType: "uint256",
  184. name: "",
  185. type: "uint256",
  186. },
  187. ],
  188. stateMutability: "view",
  189. type: "function",
  190. },
  191. {
  192. inputs: [
  193. {
  194. internalType: "address",
  195. name: "_owner",
  196. type: "address",
  197. },
  198. ],
  199. name: "getInvitationWithdrawRecord",
  200. outputs: [
  201. {
  202. components: [
  203. {
  204. internalType: "uint256",
  205. name: "amount",
  206. type: "uint256",
  207. },
  208. {
  209. internalType: "uint256",
  210. name: "createTime",
  211. type: "uint256",
  212. },
  213. ],
  214. internalType: "struct InvitationWithdrawRecordType[]",
  215. name: "",
  216. type: "tuple[]",
  217. },
  218. ],
  219. stateMutability: "view",
  220. type: "function",
  221. },
  222. {
  223. inputs: [
  224. {
  225. internalType: "address",
  226. name: "owner",
  227. type: "address",
  228. },
  229. ],
  230. name: "getOwnerAllInvitationWithdrawAmout",
  231. outputs: [
  232. {
  233. internalType: "uint256",
  234. name: "",
  235. type: "uint256",
  236. },
  237. ],
  238. stateMutability: "view",
  239. type: "function",
  240. },
  241. {
  242. inputs: [
  243. {
  244. internalType: "address",
  245. name: "_ownerAddress",
  246. type: "address",
  247. },
  248. ],
  249. name: "getOwnerAllPledgeInfo",
  250. outputs: [
  251. {
  252. components: [
  253. {
  254. internalType: "uint256",
  255. name: "tokenId",
  256. type: "uint256",
  257. },
  258. {
  259. internalType: "uint256",
  260. name: "startTime",
  261. type: "uint256",
  262. },
  263. {
  264. internalType: "uint256",
  265. name: "endTime",
  266. type: "uint256",
  267. },
  268. {
  269. internalType: "uint256",
  270. name: "withdrawTime",
  271. type: "uint256",
  272. },
  273. {
  274. internalType: "uint256",
  275. name: "pledgeAmount",
  276. type: "uint256",
  277. },
  278. {
  279. internalType: "uint256",
  280. name: "rate",
  281. type: "uint256",
  282. },
  283. {
  284. internalType: "uint256",
  285. name: "pledgeDay",
  286. type: "uint256",
  287. },
  288. {
  289. internalType: "address",
  290. name: "sender",
  291. type: "address",
  292. },
  293. ],
  294. internalType: "struct PledgeType[]",
  295. name: "result",
  296. type: "tuple[]",
  297. },
  298. ],
  299. stateMutability: "view",
  300. type: "function",
  301. },
  302. {
  303. inputs: [
  304. {
  305. internalType: "address",
  306. name: "_ownerAddress",
  307. type: "address",
  308. },
  309. ],
  310. name: "getOwnerAllTokens",
  311. outputs: [
  312. {
  313. internalType: "uint256[]",
  314. name: "",
  315. type: "uint256[]",
  316. },
  317. ],
  318. stateMutability: "view",
  319. type: "function",
  320. },
  321. {
  322. inputs: [
  323. {
  324. internalType: "address",
  325. name: "addr",
  326. type: "address",
  327. },
  328. ],
  329. name: "getOwnerInvitationPledges",
  330. outputs: [
  331. {
  332. components: [
  333. {
  334. internalType: "uint256",
  335. name: "tokenId",
  336. type: "uint256",
  337. },
  338. {
  339. internalType: "uint256",
  340. name: "startTime",
  341. type: "uint256",
  342. },
  343. {
  344. internalType: "uint256",
  345. name: "endTime",
  346. type: "uint256",
  347. },
  348. {
  349. internalType: "uint256",
  350. name: "withdrawTime",
  351. type: "uint256",
  352. },
  353. {
  354. internalType: "uint256",
  355. name: "pledgeAmount",
  356. type: "uint256",
  357. },
  358. {
  359. internalType: "uint256",
  360. name: "rate",
  361. type: "uint256",
  362. },
  363. {
  364. internalType: "uint256",
  365. name: "pledgeDay",
  366. type: "uint256",
  367. },
  368. {
  369. internalType: "address",
  370. name: "sender",
  371. type: "address",
  372. },
  373. ],
  374. internalType: "struct PledgeType[]",
  375. name: "result",
  376. type: "tuple[]",
  377. },
  378. ],
  379. stateMutability: "view",
  380. type: "function",
  381. },
  382. {
  383. inputs: [
  384. {
  385. internalType: "address",
  386. name: "_owner",
  387. type: "address",
  388. },
  389. ],
  390. name: "getPledgeDestoryRecords",
  391. outputs: [
  392. {
  393. components: [
  394. {
  395. internalType: "uint256",
  396. name: "tokenId",
  397. type: "uint256",
  398. },
  399. {
  400. internalType: "uint256",
  401. name: "startTime",
  402. type: "uint256",
  403. },
  404. {
  405. internalType: "uint256",
  406. name: "endTime",
  407. type: "uint256",
  408. },
  409. {
  410. internalType: "uint256",
  411. name: "withdrawTime",
  412. type: "uint256",
  413. },
  414. {
  415. internalType: "uint256",
  416. name: "pledgeAmount",
  417. type: "uint256",
  418. },
  419. {
  420. internalType: "uint256",
  421. name: "rate",
  422. type: "uint256",
  423. },
  424. {
  425. internalType: "uint256",
  426. name: "pledgeDay",
  427. type: "uint256",
  428. },
  429. {
  430. internalType: "address",
  431. name: "sender",
  432. type: "address",
  433. },
  434. ],
  435. internalType: "struct PledgeType[]",
  436. name: "",
  437. type: "tuple[]",
  438. },
  439. ],
  440. stateMutability: "view",
  441. type: "function",
  442. },
  443. {
  444. inputs: [
  445. {
  446. internalType: "address",
  447. name: "_owner",
  448. type: "address",
  449. },
  450. ],
  451. name: "getPledgeRecords",
  452. outputs: [
  453. {
  454. components: [
  455. {
  456. internalType: "uint256",
  457. name: "tokenId",
  458. type: "uint256",
  459. },
  460. {
  461. internalType: "uint256",
  462. name: "startTime",
  463. type: "uint256",
  464. },
  465. {
  466. internalType: "uint256",
  467. name: "endTime",
  468. type: "uint256",
  469. },
  470. {
  471. internalType: "uint256",
  472. name: "withdrawTime",
  473. type: "uint256",
  474. },
  475. {
  476. internalType: "uint256",
  477. name: "pledgeAmount",
  478. type: "uint256",
  479. },
  480. {
  481. internalType: "uint256",
  482. name: "rate",
  483. type: "uint256",
  484. },
  485. {
  486. internalType: "uint256",
  487. name: "pledgeDay",
  488. type: "uint256",
  489. },
  490. {
  491. internalType: "address",
  492. name: "sender",
  493. type: "address",
  494. },
  495. ],
  496. internalType: "struct PledgeType[]",
  497. name: "",
  498. type: "tuple[]",
  499. },
  500. ],
  501. stateMutability: "view",
  502. type: "function",
  503. },
  504. {
  505. inputs: [
  506. {
  507. internalType: "address",
  508. name: "_owner",
  509. type: "address",
  510. },
  511. ],
  512. name: "getPledgeWithdrawRecord",
  513. outputs: [
  514. {
  515. components: [
  516. {
  517. internalType: "uint256",
  518. name: "amount",
  519. type: "uint256",
  520. },
  521. {
  522. internalType: "uint256",
  523. name: "createTime",
  524. type: "uint256",
  525. },
  526. {
  527. internalType: "uint256",
  528. name: "tokenId",
  529. type: "uint256",
  530. },
  531. {
  532. internalType: "uint256",
  533. name: "pledgeDay",
  534. type: "uint256",
  535. },
  536. {
  537. internalType: "uint256",
  538. name: "_type",
  539. type: "uint256",
  540. },
  541. ],
  542. internalType: "struct PledgeWithdrawRecordType[]",
  543. name: "",
  544. type: "tuple[]",
  545. },
  546. ],
  547. stateMutability: "view",
  548. type: "function",
  549. },
  550. {
  551. inputs: [],
  552. name: "getProductInfo",
  553. outputs: [
  554. {
  555. components: [
  556. {
  557. internalType: "uint256",
  558. name: "day",
  559. type: "uint256",
  560. },
  561. {
  562. internalType: "uint256",
  563. name: "rate",
  564. type: "uint256",
  565. },
  566. ],
  567. internalType: "struct ProductInfo[]",
  568. name: "",
  569. type: "tuple[]",
  570. },
  571. ],
  572. stateMutability: "view",
  573. type: "function",
  574. },
  575. {
  576. inputs: [
  577. {
  578. internalType: "address",
  579. name: "_owner",
  580. type: "address",
  581. },
  582. ],
  583. name: "getWithdrawbleAmount",
  584. outputs: [
  585. {
  586. internalType: "uint256",
  587. name: "",
  588. type: "uint256",
  589. },
  590. ],
  591. stateMutability: "view",
  592. type: "function",
  593. },
  594. {
  595. inputs: [
  596. {
  597. internalType: "address",
  598. name: "nftAddress",
  599. type: "address",
  600. },
  601. {
  602. internalType: "address",
  603. name: "poolAddress",
  604. type: "address",
  605. },
  606. ],
  607. name: "initialize",
  608. outputs: [],
  609. stateMutability: "nonpayable",
  610. type: "function",
  611. },
  612. {
  613. inputs: [
  614. {
  615. internalType: "address",
  616. name: "",
  617. type: "address",
  618. },
  619. {
  620. internalType: "uint256",
  621. name: "",
  622. type: "uint256",
  623. },
  624. ],
  625. name: "invitationAddress",
  626. outputs: [
  627. {
  628. internalType: "address",
  629. name: "",
  630. type: "address",
  631. },
  632. ],
  633. stateMutability: "view",
  634. type: "function",
  635. },
  636. {
  637. inputs: [
  638. {
  639. internalType: "uint256",
  640. name: "",
  641. type: "uint256",
  642. },
  643. ],
  644. name: "invitationPledges",
  645. outputs: [
  646. {
  647. internalType: "uint256",
  648. name: "tokenId",
  649. type: "uint256",
  650. },
  651. {
  652. internalType: "uint256",
  653. name: "startTime",
  654. type: "uint256",
  655. },
  656. {
  657. internalType: "uint256",
  658. name: "endTime",
  659. type: "uint256",
  660. },
  661. {
  662. internalType: "uint256",
  663. name: "withdrawTime",
  664. type: "uint256",
  665. },
  666. {
  667. internalType: "uint256",
  668. name: "pledgeAmount",
  669. type: "uint256",
  670. },
  671. {
  672. internalType: "uint256",
  673. name: "rate",
  674. type: "uint256",
  675. },
  676. {
  677. internalType: "uint256",
  678. name: "pledgeDay",
  679. type: "uint256",
  680. },
  681. {
  682. internalType: "address",
  683. name: "sender",
  684. type: "address",
  685. },
  686. ],
  687. stateMutability: "view",
  688. type: "function",
  689. },
  690. {
  691. inputs: [],
  692. name: "invitationRate",
  693. outputs: [
  694. {
  695. internalType: "uint256",
  696. name: "",
  697. type: "uint256",
  698. },
  699. ],
  700. stateMutability: "view",
  701. type: "function",
  702. },
  703. {
  704. inputs: [
  705. {
  706. internalType: "address",
  707. name: "",
  708. type: "address",
  709. },
  710. {
  711. internalType: "uint256",
  712. name: "",
  713. type: "uint256",
  714. },
  715. ],
  716. name: "invitationTokens",
  717. outputs: [
  718. {
  719. internalType: "uint256",
  720. name: "",
  721. type: "uint256",
  722. },
  723. ],
  724. stateMutability: "view",
  725. type: "function",
  726. },
  727. {
  728. inputs: [
  729. {
  730. internalType: "address",
  731. name: "",
  732. type: "address",
  733. },
  734. {
  735. internalType: "uint256",
  736. name: "",
  737. type: "uint256",
  738. },
  739. ],
  740. name: "invitationWithdrawRecord",
  741. outputs: [
  742. {
  743. internalType: "uint256",
  744. name: "amount",
  745. type: "uint256",
  746. },
  747. {
  748. internalType: "uint256",
  749. name: "createTime",
  750. type: "uint256",
  751. },
  752. ],
  753. stateMutability: "view",
  754. type: "function",
  755. },
  756. {
  757. inputs: [
  758. {
  759. internalType: "uint256",
  760. name: "amount",
  761. type: "uint256",
  762. },
  763. {
  764. internalType: "uint256",
  765. name: "index",
  766. type: "uint256",
  767. },
  768. {
  769. internalType: "address",
  770. name: "_referrer",
  771. type: "address",
  772. },
  773. ],
  774. name: "pledge",
  775. outputs: [],
  776. stateMutability: "nonpayable",
  777. type: "function",
  778. },
  779. {
  780. inputs: [
  781. {
  782. internalType: "address",
  783. name: "",
  784. type: "address",
  785. },
  786. {
  787. internalType: "uint256",
  788. name: "",
  789. type: "uint256",
  790. },
  791. ],
  792. name: "pledgeDestoryRecords",
  793. outputs: [
  794. {
  795. internalType: "uint256",
  796. name: "tokenId",
  797. type: "uint256",
  798. },
  799. {
  800. internalType: "uint256",
  801. name: "startTime",
  802. type: "uint256",
  803. },
  804. {
  805. internalType: "uint256",
  806. name: "endTime",
  807. type: "uint256",
  808. },
  809. {
  810. internalType: "uint256",
  811. name: "withdrawTime",
  812. type: "uint256",
  813. },
  814. {
  815. internalType: "uint256",
  816. name: "pledgeAmount",
  817. type: "uint256",
  818. },
  819. {
  820. internalType: "uint256",
  821. name: "rate",
  822. type: "uint256",
  823. },
  824. {
  825. internalType: "uint256",
  826. name: "pledgeDay",
  827. type: "uint256",
  828. },
  829. {
  830. internalType: "address",
  831. name: "sender",
  832. type: "address",
  833. },
  834. ],
  835. stateMutability: "view",
  836. type: "function",
  837. },
  838. {
  839. inputs: [
  840. {
  841. internalType: "address",
  842. name: "",
  843. type: "address",
  844. },
  845. {
  846. internalType: "uint256",
  847. name: "",
  848. type: "uint256",
  849. },
  850. ],
  851. name: "pledgeRecords",
  852. outputs: [
  853. {
  854. internalType: "uint256",
  855. name: "tokenId",
  856. type: "uint256",
  857. },
  858. {
  859. internalType: "uint256",
  860. name: "startTime",
  861. type: "uint256",
  862. },
  863. {
  864. internalType: "uint256",
  865. name: "endTime",
  866. type: "uint256",
  867. },
  868. {
  869. internalType: "uint256",
  870. name: "withdrawTime",
  871. type: "uint256",
  872. },
  873. {
  874. internalType: "uint256",
  875. name: "pledgeAmount",
  876. type: "uint256",
  877. },
  878. {
  879. internalType: "uint256",
  880. name: "rate",
  881. type: "uint256",
  882. },
  883. {
  884. internalType: "uint256",
  885. name: "pledgeDay",
  886. type: "uint256",
  887. },
  888. {
  889. internalType: "address",
  890. name: "sender",
  891. type: "address",
  892. },
  893. ],
  894. stateMutability: "view",
  895. type: "function",
  896. },
  897. {
  898. inputs: [],
  899. name: "pledgeStatus",
  900. outputs: [
  901. {
  902. internalType: "bool",
  903. name: "",
  904. type: "bool",
  905. },
  906. ],
  907. stateMutability: "view",
  908. type: "function",
  909. },
  910. {
  911. inputs: [
  912. {
  913. internalType: "address",
  914. name: "",
  915. type: "address",
  916. },
  917. {
  918. internalType: "uint256",
  919. name: "",
  920. type: "uint256",
  921. },
  922. ],
  923. name: "pledgeWithdrawRecord",
  924. outputs: [
  925. {
  926. internalType: "uint256",
  927. name: "amount",
  928. type: "uint256",
  929. },
  930. {
  931. internalType: "uint256",
  932. name: "createTime",
  933. type: "uint256",
  934. },
  935. {
  936. internalType: "uint256",
  937. name: "tokenId",
  938. type: "uint256",
  939. },
  940. {
  941. internalType: "uint256",
  942. name: "pledgeDay",
  943. type: "uint256",
  944. },
  945. {
  946. internalType: "uint256",
  947. name: "_type",
  948. type: "uint256",
  949. },
  950. ],
  951. stateMutability: "view",
  952. type: "function",
  953. },
  954. {
  955. inputs: [
  956. {
  957. internalType: "uint256",
  958. name: "",
  959. type: "uint256",
  960. },
  961. ],
  962. name: "productInfo",
  963. outputs: [
  964. {
  965. internalType: "uint256",
  966. name: "day",
  967. type: "uint256",
  968. },
  969. {
  970. internalType: "uint256",
  971. name: "rate",
  972. type: "uint256",
  973. },
  974. ],
  975. stateMutability: "view",
  976. type: "function",
  977. },
  978. {
  979. inputs: [
  980. {
  981. internalType: "address",
  982. name: "",
  983. type: "address",
  984. },
  985. ],
  986. name: "recommendObj",
  987. outputs: [
  988. {
  989. internalType: "address",
  990. name: "key",
  991. type: "address",
  992. },
  993. {
  994. internalType: "address",
  995. name: "referrer",
  996. type: "address",
  997. },
  998. {
  999. internalType: "uint256",
  1000. name: "bindTime",
  1001. type: "uint256",
  1002. },
  1003. {
  1004. internalType: "uint256",
  1005. name: "contribute",
  1006. type: "uint256",
  1007. },
  1008. ],
  1009. stateMutability: "view",
  1010. type: "function",
  1011. },
  1012. {
  1013. inputs: [
  1014. {
  1015. internalType: "address[]",
  1016. name: "_blacks",
  1017. type: "address[]",
  1018. },
  1019. {
  1020. internalType: "bool",
  1021. name: "_status",
  1022. type: "bool",
  1023. },
  1024. ],
  1025. name: "setBlackList",
  1026. outputs: [],
  1027. stateMutability: "nonpayable",
  1028. type: "function",
  1029. },
  1030. {
  1031. inputs: [
  1032. {
  1033. internalType: "uint256",
  1034. name: "",
  1035. type: "uint256",
  1036. },
  1037. ],
  1038. name: "setCurrentTime",
  1039. outputs: [],
  1040. stateMutability: "nonpayable",
  1041. type: "function",
  1042. },
  1043. {
  1044. inputs: [
  1045. {
  1046. internalType: "uint256",
  1047. name: "_time",
  1048. type: "uint256",
  1049. },
  1050. ],
  1051. name: "setDayTime",
  1052. outputs: [],
  1053. stateMutability: "nonpayable",
  1054. type: "function",
  1055. },
  1056. {
  1057. inputs: [
  1058. {
  1059. internalType: "uint256",
  1060. name: "_rate",
  1061. type: "uint256",
  1062. },
  1063. ],
  1064. name: "setInvitationRate",
  1065. outputs: [],
  1066. stateMutability: "nonpayable",
  1067. type: "function",
  1068. },
  1069. {
  1070. inputs: [
  1071. {
  1072. internalType: "bool",
  1073. name: "_status",
  1074. type: "bool",
  1075. },
  1076. ],
  1077. name: "setPledgeStatus",
  1078. outputs: [],
  1079. stateMutability: "nonpayable",
  1080. type: "function",
  1081. },
  1082. {
  1083. inputs: [],
  1084. name: "withdraAllInterest",
  1085. outputs: [],
  1086. stateMutability: "nonpayable",
  1087. type: "function",
  1088. },
  1089. {
  1090. inputs: [],
  1091. name: "withdraInvitationAllInterest",
  1092. outputs: [],
  1093. stateMutability: "nonpayable",
  1094. type: "function",
  1095. },
  1096. {
  1097. inputs: [
  1098. {
  1099. internalType: "uint256",
  1100. name: "tokenId",
  1101. type: "uint256",
  1102. },
  1103. ],
  1104. name: "withdrawInterest",
  1105. outputs: [],
  1106. stateMutability: "nonpayable",
  1107. type: "function",
  1108. },
  1109. {
  1110. inputs: [
  1111. {
  1112. internalType: "uint256",
  1113. name: "tokenId",
  1114. type: "uint256",
  1115. },
  1116. ],
  1117. name: "withdrawInvitationInterest",
  1118. outputs: [],
  1119. stateMutability: "nonpayable",
  1120. type: "function",
  1121. },
  1122. ]
  1123. const private = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'
  1124. const provider = new ethers.JsonRpcProvider("http://127.0.0.1:8545")
  1125. const contractAddress = "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0";
  1126. const wallet = new ethers.Wallet(private, provider);
  1127. const contract = new ethers.Contract(contractAddress, _abi, wallet)
  1128. let a = 1
  1129. async function sync() {
  1130. console.log(`同步第${a}`);
  1131. const res = await contract.setDayTime(ethers.toBigInt(1))
  1132. a++
  1133. }
  1134. // 0x2ADDed672bacEfe857a408B577CB7DF1f6687c07
  1135. setInterval(() => {
  1136. sync()
  1137. }, 5000)