/ src / main.js
main.js
   1  // import './assets/main.css'
   2  
   3  import { createApp } from 'vue'
   4  import { createPinia } from 'pinia'
   5  import { createPersistedState } from 'pinia-plugin-persistedstate'
   6  import uniqueId from '@/plugins/UniqueIdPlugin'
   7  
   8  import App from '@/App.vue'
   9  import router from '@/router'
  10  import ethersPlugin from '@/plugins/EthersPlugin'
  11  import codexPlugin from '@/plugins/CodexPlugin'
  12  import marketplacePlugin from '@/plugins/MarketplacePlugin'
  13  import testTokenPlugin from '@/plugins/TestTokenPlugin'
  14  
  15  import './index.css'
  16  import { crossTabSync } from './plugins/pinia/crosstabsync'
  17  
  18  const app = createApp(App)
  19  
  20  const pinia = createPinia()
  21  
  22  const getLocalStorageKey = (id) => `__persisted__${id}__${ENV.marketplaceAddress}`
  23  app.provide('getLocalStorageKey', getLocalStorageKey)
  24  pinia.use(
  25    crossTabSync({
  26      key: getLocalStorageKey
  27    })
  28  )
  29  
  30  app.use(pinia)
  31  app.use(router)
  32  const environments = {
  33    localhost: {
  34      marketplaceAddress: '0x80CC244f93569DAbdC18D182aAF382824Ddf2d96',
  35      testTokenAddress: '0x0C7c8CC92A994918b05eBbc4CBdF9f58b901162d',
  36      myAddress: '0xE3b2588a05260caC3EEAbfBFd7937BbC14eB0aC7',
  37      rpcUrl: 'http://localhost:8545',
  38      codexRestUrl: 'http://localhost:8080/api/codex/v1'
  39    },
  40    devnet: {
  41      marketplaceAddress: '0x9C88D67c7C745D2F0A4E411c18A6a22c15b37EaA', // new devnet contracts
  42      // marketplaceAddress: '0x4cBDfab37baB0AA3AC69A7b12C4396907dfF5227', // old devnet contracts
  43      // testTokenAddress: '0x150493837F923E71Ad8289742Ae8f2Bd7a478964',
  44      testTokenAddress: '0x2B16F50C501246400279b225268E513E161a97b4', // new token address
  45      myAddress: '0xE3b2588a05260caC3EEAbfBFd7937BbC14eB0aC7',
  46      rpcUrl: 'https://rpc.testnet.codex.storage',
  47      codexRestUrl: 'http://localhost:8080/api/codex/v1'
  48    }
  49  }
  50  
  51  // NOTE: setting current environment to localhost requires manual steps:
  52  // 1. double-check token and marketplace/token contract addresses haven't
  53  //    changed in deployment-localhost.json. If they have:
  54  //      a. update in `environments`
  55  //      b. update --marketplace-address cli param in codex.sh
  56  // 2. in hardhat.config.js used to run the local node, add your PK to the local
  57  //    network:
  58  // ```json
  59  // networks: {
  60  //   hardhat: {
  61  //     tags: ["local"],
  62  //     accounts: [
  63  //       {
  64  //         privateKey: "<my pk>",
  65  //         balance: ethers.utils.parseEther('10000').toString()
  66  //       }
  67  //     ]
  68  //   }
  69  // ```
  70  const ENV = environments.devnet // FOR LOCALHOST, SEE ABOVE
  71  app.config.globalProperties.rpcUrl = ENV.rpcUrl
  72  
  73  app.use(ethersPlugin, {})
  74  app.use(marketplacePlugin, {
  75    abi: [
  76      {
  77        inputs: [
  78          {
  79            components: [
  80              {
  81                components: [
  82                  {
  83                    internalType: 'uint8',
  84                    name: 'repairRewardPercentage',
  85                    type: 'uint8'
  86                  },
  87                  {
  88                    internalType: 'uint8',
  89                    name: 'maxNumberOfSlashes',
  90                    type: 'uint8'
  91                  },
  92                  {
  93                    internalType: 'uint16',
  94                    name: 'slashCriterion',
  95                    type: 'uint16'
  96                  },
  97                  {
  98                    internalType: 'uint8',
  99                    name: 'slashPercentage',
 100                    type: 'uint8'
 101                  }
 102                ],
 103                internalType: 'struct CollateralConfig',
 104                name: 'collateral',
 105                type: 'tuple'
 106              },
 107              {
 108                components: [
 109                  {
 110                    internalType: 'uint256',
 111                    name: 'period',
 112                    type: 'uint256'
 113                  },
 114                  {
 115                    internalType: 'uint256',
 116                    name: 'timeout',
 117                    type: 'uint256'
 118                  },
 119                  {
 120                    internalType: 'uint8',
 121                    name: 'downtime',
 122                    type: 'uint8'
 123                  },
 124                  {
 125                    internalType: 'string',
 126                    name: 'zkeyHash',
 127                    type: 'string'
 128                  }
 129                ],
 130                internalType: 'struct ProofConfig',
 131                name: 'proofs',
 132                type: 'tuple'
 133              }
 134            ],
 135            internalType: 'struct MarketplaceConfig',
 136            name: 'configuration',
 137            type: 'tuple'
 138          },
 139          {
 140            internalType: 'contract IERC20',
 141            name: 'token_',
 142            type: 'address'
 143          },
 144          {
 145            internalType: 'contract IGroth16Verifier',
 146            name: 'verifier',
 147            type: 'address'
 148          }
 149        ],
 150        stateMutability: 'nonpayable',
 151        type: 'constructor'
 152      },
 153      {
 154        anonymous: false,
 155        inputs: [
 156          {
 157            indexed: false,
 158            internalType: 'SlotId',
 159            name: 'id',
 160            type: 'bytes32'
 161          }
 162        ],
 163        name: 'ProofSubmitted',
 164        type: 'event'
 165      },
 166      {
 167        anonymous: false,
 168        inputs: [
 169          {
 170            indexed: true,
 171            internalType: 'RequestId',
 172            name: 'requestId',
 173            type: 'bytes32'
 174          }
 175        ],
 176        name: 'RequestCancelled',
 177        type: 'event'
 178      },
 179      {
 180        anonymous: false,
 181        inputs: [
 182          {
 183            indexed: true,
 184            internalType: 'RequestId',
 185            name: 'requestId',
 186            type: 'bytes32'
 187          }
 188        ],
 189        name: 'RequestFailed',
 190        type: 'event'
 191      },
 192      {
 193        anonymous: false,
 194        inputs: [
 195          {
 196            indexed: true,
 197            internalType: 'RequestId',
 198            name: 'requestId',
 199            type: 'bytes32'
 200          }
 201        ],
 202        name: 'RequestFulfilled',
 203        type: 'event'
 204      },
 205      {
 206        anonymous: false,
 207        inputs: [
 208          {
 209            indexed: true,
 210            internalType: 'RequestId',
 211            name: 'requestId',
 212            type: 'bytes32'
 213          },
 214          {
 215            indexed: false,
 216            internalType: 'uint256',
 217            name: 'slotIndex',
 218            type: 'uint256'
 219          }
 220        ],
 221        name: 'SlotFilled',
 222        type: 'event'
 223      },
 224      {
 225        anonymous: false,
 226        inputs: [
 227          {
 228            indexed: true,
 229            internalType: 'RequestId',
 230            name: 'requestId',
 231            type: 'bytes32'
 232          },
 233          {
 234            indexed: false,
 235            internalType: 'uint256',
 236            name: 'slotIndex',
 237            type: 'uint256'
 238          }
 239        ],
 240        name: 'SlotFreed',
 241        type: 'event'
 242      },
 243      {
 244        anonymous: false,
 245        inputs: [
 246          {
 247            indexed: false,
 248            internalType: 'RequestId',
 249            name: 'requestId',
 250            type: 'bytes32'
 251          },
 252          {
 253            components: [
 254              {
 255                internalType: 'uint64',
 256                name: 'slots',
 257                type: 'uint64'
 258              },
 259              {
 260                internalType: 'uint256',
 261                name: 'slotSize',
 262                type: 'uint256'
 263              },
 264              {
 265                internalType: 'uint256',
 266                name: 'duration',
 267                type: 'uint256'
 268              },
 269              {
 270                internalType: 'uint256',
 271                name: 'proofProbability',
 272                type: 'uint256'
 273              },
 274              {
 275                internalType: 'uint256',
 276                name: 'reward',
 277                type: 'uint256'
 278              },
 279              {
 280                internalType: 'uint256',
 281                name: 'collateral',
 282                type: 'uint256'
 283              },
 284              {
 285                internalType: 'uint64',
 286                name: 'maxSlotLoss',
 287                type: 'uint64'
 288              }
 289            ],
 290            indexed: false,
 291            internalType: 'struct Ask',
 292            name: 'ask',
 293            type: 'tuple'
 294          },
 295          {
 296            indexed: false,
 297            internalType: 'uint256',
 298            name: 'expiry',
 299            type: 'uint256'
 300          }
 301        ],
 302        name: 'StorageRequested',
 303        type: 'event'
 304      },
 305      {
 306        inputs: [],
 307        name: 'config',
 308        outputs: [
 309          {
 310            components: [
 311              {
 312                components: [
 313                  {
 314                    internalType: 'uint8',
 315                    name: 'repairRewardPercentage',
 316                    type: 'uint8'
 317                  },
 318                  {
 319                    internalType: 'uint8',
 320                    name: 'maxNumberOfSlashes',
 321                    type: 'uint8'
 322                  },
 323                  {
 324                    internalType: 'uint16',
 325                    name: 'slashCriterion',
 326                    type: 'uint16'
 327                  },
 328                  {
 329                    internalType: 'uint8',
 330                    name: 'slashPercentage',
 331                    type: 'uint8'
 332                  }
 333                ],
 334                internalType: 'struct CollateralConfig',
 335                name: 'collateral',
 336                type: 'tuple'
 337              },
 338              {
 339                components: [
 340                  {
 341                    internalType: 'uint256',
 342                    name: 'period',
 343                    type: 'uint256'
 344                  },
 345                  {
 346                    internalType: 'uint256',
 347                    name: 'timeout',
 348                    type: 'uint256'
 349                  },
 350                  {
 351                    internalType: 'uint8',
 352                    name: 'downtime',
 353                    type: 'uint8'
 354                  },
 355                  {
 356                    internalType: 'string',
 357                    name: 'zkeyHash',
 358                    type: 'string'
 359                  }
 360                ],
 361                internalType: 'struct ProofConfig',
 362                name: 'proofs',
 363                type: 'tuple'
 364              }
 365            ],
 366            internalType: 'struct MarketplaceConfig',
 367            name: '',
 368            type: 'tuple'
 369          }
 370        ],
 371        stateMutability: 'view',
 372        type: 'function'
 373      },
 374      {
 375        inputs: [
 376          {
 377            internalType: 'RequestId',
 378            name: 'requestId',
 379            type: 'bytes32'
 380          },
 381          {
 382            internalType: 'uint256',
 383            name: 'slotIndex',
 384            type: 'uint256'
 385          },
 386          {
 387            components: [
 388              {
 389                components: [
 390                  {
 391                    internalType: 'uint256',
 392                    name: 'x',
 393                    type: 'uint256'
 394                  },
 395                  {
 396                    internalType: 'uint256',
 397                    name: 'y',
 398                    type: 'uint256'
 399                  }
 400                ],
 401                internalType: 'struct G1Point',
 402                name: 'a',
 403                type: 'tuple'
 404              },
 405              {
 406                components: [
 407                  {
 408                    components: [
 409                      {
 410                        internalType: 'uint256',
 411                        name: 'real',
 412                        type: 'uint256'
 413                      },
 414                      {
 415                        internalType: 'uint256',
 416                        name: 'imag',
 417                        type: 'uint256'
 418                      }
 419                    ],
 420                    internalType: 'struct Fp2Element',
 421                    name: 'x',
 422                    type: 'tuple'
 423                  },
 424                  {
 425                    components: [
 426                      {
 427                        internalType: 'uint256',
 428                        name: 'real',
 429                        type: 'uint256'
 430                      },
 431                      {
 432                        internalType: 'uint256',
 433                        name: 'imag',
 434                        type: 'uint256'
 435                      }
 436                    ],
 437                    internalType: 'struct Fp2Element',
 438                    name: 'y',
 439                    type: 'tuple'
 440                  }
 441                ],
 442                internalType: 'struct G2Point',
 443                name: 'b',
 444                type: 'tuple'
 445              },
 446              {
 447                components: [
 448                  {
 449                    internalType: 'uint256',
 450                    name: 'x',
 451                    type: 'uint256'
 452                  },
 453                  {
 454                    internalType: 'uint256',
 455                    name: 'y',
 456                    type: 'uint256'
 457                  }
 458                ],
 459                internalType: 'struct G1Point',
 460                name: 'c',
 461                type: 'tuple'
 462              }
 463            ],
 464            internalType: 'struct Groth16Proof',
 465            name: 'proof',
 466            type: 'tuple'
 467          }
 468        ],
 469        name: 'fillSlot',
 470        outputs: [],
 471        stateMutability: 'nonpayable',
 472        type: 'function'
 473      },
 474      {
 475        inputs: [
 476          {
 477            internalType: 'SlotId',
 478            name: 'slotId',
 479            type: 'bytes32'
 480          }
 481        ],
 482        name: 'freeSlot',
 483        outputs: [],
 484        stateMutability: 'nonpayable',
 485        type: 'function'
 486      },
 487      {
 488        inputs: [
 489          {
 490            internalType: 'SlotId',
 491            name: 'slotId',
 492            type: 'bytes32'
 493          }
 494        ],
 495        name: 'getActiveSlot',
 496        outputs: [
 497          {
 498            components: [
 499              {
 500                components: [
 501                  {
 502                    internalType: 'address',
 503                    name: 'client',
 504                    type: 'address'
 505                  },
 506                  {
 507                    components: [
 508                      {
 509                        internalType: 'uint64',
 510                        name: 'slots',
 511                        type: 'uint64'
 512                      },
 513                      {
 514                        internalType: 'uint256',
 515                        name: 'slotSize',
 516                        type: 'uint256'
 517                      },
 518                      {
 519                        internalType: 'uint256',
 520                        name: 'duration',
 521                        type: 'uint256'
 522                      },
 523                      {
 524                        internalType: 'uint256',
 525                        name: 'proofProbability',
 526                        type: 'uint256'
 527                      },
 528                      {
 529                        internalType: 'uint256',
 530                        name: 'reward',
 531                        type: 'uint256'
 532                      },
 533                      {
 534                        internalType: 'uint256',
 535                        name: 'collateral',
 536                        type: 'uint256'
 537                      },
 538                      {
 539                        internalType: 'uint64',
 540                        name: 'maxSlotLoss',
 541                        type: 'uint64'
 542                      }
 543                    ],
 544                    internalType: 'struct Ask',
 545                    name: 'ask',
 546                    type: 'tuple'
 547                  },
 548                  {
 549                    components: [
 550                      {
 551                        internalType: 'string',
 552                        name: 'cid',
 553                        type: 'string'
 554                      },
 555                      {
 556                        internalType: 'bytes32',
 557                        name: 'merkleRoot',
 558                        type: 'bytes32'
 559                      }
 560                    ],
 561                    internalType: 'struct Content',
 562                    name: 'content',
 563                    type: 'tuple'
 564                  },
 565                  {
 566                    internalType: 'uint256',
 567                    name: 'expiry',
 568                    type: 'uint256'
 569                  },
 570                  {
 571                    internalType: 'bytes32',
 572                    name: 'nonce',
 573                    type: 'bytes32'
 574                  }
 575                ],
 576                internalType: 'struct Request',
 577                name: 'request',
 578                type: 'tuple'
 579              },
 580              {
 581                internalType: 'uint256',
 582                name: 'slotIndex',
 583                type: 'uint256'
 584              }
 585            ],
 586            internalType: 'struct Marketplace.ActiveSlot',
 587            name: '',
 588            type: 'tuple'
 589          }
 590        ],
 591        stateMutability: 'view',
 592        type: 'function'
 593      },
 594      {
 595        inputs: [
 596          {
 597            internalType: 'SlotId',
 598            name: 'id',
 599            type: 'bytes32'
 600          }
 601        ],
 602        name: 'getChallenge',
 603        outputs: [
 604          {
 605            internalType: 'bytes32',
 606            name: '',
 607            type: 'bytes32'
 608          }
 609        ],
 610        stateMutability: 'view',
 611        type: 'function'
 612      },
 613      {
 614        inputs: [
 615          {
 616            internalType: 'SlotId',
 617            name: 'slotId',
 618            type: 'bytes32'
 619          }
 620        ],
 621        name: 'getHost',
 622        outputs: [
 623          {
 624            internalType: 'address',
 625            name: '',
 626            type: 'address'
 627          }
 628        ],
 629        stateMutability: 'view',
 630        type: 'function'
 631      },
 632      {
 633        inputs: [
 634          {
 635            internalType: 'SlotId',
 636            name: 'id',
 637            type: 'bytes32'
 638          }
 639        ],
 640        name: 'getPointer',
 641        outputs: [
 642          {
 643            internalType: 'uint8',
 644            name: '',
 645            type: 'uint8'
 646          }
 647        ],
 648        stateMutability: 'view',
 649        type: 'function'
 650      },
 651      {
 652        inputs: [
 653          {
 654            internalType: 'RequestId',
 655            name: 'requestId',
 656            type: 'bytes32'
 657          }
 658        ],
 659        name: 'getRequest',
 660        outputs: [
 661          {
 662            components: [
 663              {
 664                internalType: 'address',
 665                name: 'client',
 666                type: 'address'
 667              },
 668              {
 669                components: [
 670                  {
 671                    internalType: 'uint64',
 672                    name: 'slots',
 673                    type: 'uint64'
 674                  },
 675                  {
 676                    internalType: 'uint256',
 677                    name: 'slotSize',
 678                    type: 'uint256'
 679                  },
 680                  {
 681                    internalType: 'uint256',
 682                    name: 'duration',
 683                    type: 'uint256'
 684                  },
 685                  {
 686                    internalType: 'uint256',
 687                    name: 'proofProbability',
 688                    type: 'uint256'
 689                  },
 690                  {
 691                    internalType: 'uint256',
 692                    name: 'reward',
 693                    type: 'uint256'
 694                  },
 695                  {
 696                    internalType: 'uint256',
 697                    name: 'collateral',
 698                    type: 'uint256'
 699                  },
 700                  {
 701                    internalType: 'uint64',
 702                    name: 'maxSlotLoss',
 703                    type: 'uint64'
 704                  }
 705                ],
 706                internalType: 'struct Ask',
 707                name: 'ask',
 708                type: 'tuple'
 709              },
 710              {
 711                components: [
 712                  {
 713                    internalType: 'string',
 714                    name: 'cid',
 715                    type: 'string'
 716                  },
 717                  {
 718                    internalType: 'bytes32',
 719                    name: 'merkleRoot',
 720                    type: 'bytes32'
 721                  }
 722                ],
 723                internalType: 'struct Content',
 724                name: 'content',
 725                type: 'tuple'
 726              },
 727              {
 728                internalType: 'uint256',
 729                name: 'expiry',
 730                type: 'uint256'
 731              },
 732              {
 733                internalType: 'bytes32',
 734                name: 'nonce',
 735                type: 'bytes32'
 736              }
 737            ],
 738            internalType: 'struct Request',
 739            name: '',
 740            type: 'tuple'
 741          }
 742        ],
 743        stateMutability: 'view',
 744        type: 'function'
 745      },
 746      {
 747        inputs: [
 748          {
 749            internalType: 'SlotId',
 750            name: 'id',
 751            type: 'bytes32'
 752          }
 753        ],
 754        name: 'isProofRequired',
 755        outputs: [
 756          {
 757            internalType: 'bool',
 758            name: '',
 759            type: 'bool'
 760          }
 761        ],
 762        stateMutability: 'view',
 763        type: 'function'
 764      },
 765      {
 766        inputs: [
 767          {
 768            internalType: 'SlotId',
 769            name: 'slotId',
 770            type: 'bytes32'
 771          },
 772          {
 773            internalType: 'Periods.Period',
 774            name: 'period',
 775            type: 'uint256'
 776          }
 777        ],
 778        name: 'markProofAsMissing',
 779        outputs: [],
 780        stateMutability: 'nonpayable',
 781        type: 'function'
 782      },
 783      {
 784        inputs: [
 785          {
 786            internalType: 'SlotId',
 787            name: 'slotId',
 788            type: 'bytes32'
 789          }
 790        ],
 791        name: 'missingProofs',
 792        outputs: [
 793          {
 794            internalType: 'uint256',
 795            name: '',
 796            type: 'uint256'
 797          }
 798        ],
 799        stateMutability: 'view',
 800        type: 'function'
 801      },
 802      {
 803        inputs: [],
 804        name: 'myRequests',
 805        outputs: [
 806          {
 807            internalType: 'RequestId[]',
 808            name: '',
 809            type: 'bytes32[]'
 810          }
 811        ],
 812        stateMutability: 'view',
 813        type: 'function'
 814      },
 815      {
 816        inputs: [],
 817        name: 'mySlots',
 818        outputs: [
 819          {
 820            internalType: 'SlotId[]',
 821            name: '',
 822            type: 'bytes32[]'
 823          }
 824        ],
 825        stateMutability: 'view',
 826        type: 'function'
 827      },
 828      {
 829        inputs: [
 830          {
 831            internalType: 'RequestId',
 832            name: 'requestId',
 833            type: 'bytes32'
 834          }
 835        ],
 836        name: 'requestEnd',
 837        outputs: [
 838          {
 839            internalType: 'uint256',
 840            name: '',
 841            type: 'uint256'
 842          }
 843        ],
 844        stateMutability: 'view',
 845        type: 'function'
 846      },
 847      {
 848        inputs: [
 849          {
 850            internalType: 'RequestId',
 851            name: 'requestId',
 852            type: 'bytes32'
 853          }
 854        ],
 855        name: 'requestExpiry',
 856        outputs: [
 857          {
 858            internalType: 'uint256',
 859            name: '',
 860            type: 'uint256'
 861          }
 862        ],
 863        stateMutability: 'view',
 864        type: 'function'
 865      },
 866      {
 867        inputs: [
 868          {
 869            internalType: 'RequestId',
 870            name: 'requestId',
 871            type: 'bytes32'
 872          }
 873        ],
 874        name: 'requestState',
 875        outputs: [
 876          {
 877            internalType: 'enum RequestState',
 878            name: '',
 879            type: 'uint8'
 880          }
 881        ],
 882        stateMutability: 'view',
 883        type: 'function'
 884      },
 885      {
 886        inputs: [
 887          {
 888            components: [
 889              {
 890                internalType: 'address',
 891                name: 'client',
 892                type: 'address'
 893              },
 894              {
 895                components: [
 896                  {
 897                    internalType: 'uint64',
 898                    name: 'slots',
 899                    type: 'uint64'
 900                  },
 901                  {
 902                    internalType: 'uint256',
 903                    name: 'slotSize',
 904                    type: 'uint256'
 905                  },
 906                  {
 907                    internalType: 'uint256',
 908                    name: 'duration',
 909                    type: 'uint256'
 910                  },
 911                  {
 912                    internalType: 'uint256',
 913                    name: 'proofProbability',
 914                    type: 'uint256'
 915                  },
 916                  {
 917                    internalType: 'uint256',
 918                    name: 'reward',
 919                    type: 'uint256'
 920                  },
 921                  {
 922                    internalType: 'uint256',
 923                    name: 'collateral',
 924                    type: 'uint256'
 925                  },
 926                  {
 927                    internalType: 'uint64',
 928                    name: 'maxSlotLoss',
 929                    type: 'uint64'
 930                  }
 931                ],
 932                internalType: 'struct Ask',
 933                name: 'ask',
 934                type: 'tuple'
 935              },
 936              {
 937                components: [
 938                  {
 939                    internalType: 'string',
 940                    name: 'cid',
 941                    type: 'string'
 942                  },
 943                  {
 944                    internalType: 'bytes32',
 945                    name: 'merkleRoot',
 946                    type: 'bytes32'
 947                  }
 948                ],
 949                internalType: 'struct Content',
 950                name: 'content',
 951                type: 'tuple'
 952              },
 953              {
 954                internalType: 'uint256',
 955                name: 'expiry',
 956                type: 'uint256'
 957              },
 958              {
 959                internalType: 'bytes32',
 960                name: 'nonce',
 961                type: 'bytes32'
 962              }
 963            ],
 964            internalType: 'struct Request',
 965            name: 'request',
 966            type: 'tuple'
 967          }
 968        ],
 969        name: 'requestStorage',
 970        outputs: [],
 971        stateMutability: 'nonpayable',
 972        type: 'function'
 973      },
 974      {
 975        inputs: [
 976          {
 977            internalType: 'SlotId',
 978            name: 'slotId',
 979            type: 'bytes32'
 980          }
 981        ],
 982        name: 'slotState',
 983        outputs: [
 984          {
 985            internalType: 'enum SlotState',
 986            name: '',
 987            type: 'uint8'
 988          }
 989        ],
 990        stateMutability: 'view',
 991        type: 'function'
 992      },
 993      {
 994        inputs: [
 995          {
 996            internalType: 'SlotId',
 997            name: 'id',
 998            type: 'bytes32'
 999          },
1000          {
1001            components: [
1002              {
1003                components: [
1004                  {
1005                    internalType: 'uint256',
1006                    name: 'x',
1007                    type: 'uint256'
1008                  },
1009                  {
1010                    internalType: 'uint256',
1011                    name: 'y',
1012                    type: 'uint256'
1013                  }
1014                ],
1015                internalType: 'struct G1Point',
1016                name: 'a',
1017                type: 'tuple'
1018              },
1019              {
1020                components: [
1021                  {
1022                    components: [
1023                      {
1024                        internalType: 'uint256',
1025                        name: 'real',
1026                        type: 'uint256'
1027                      },
1028                      {
1029                        internalType: 'uint256',
1030                        name: 'imag',
1031                        type: 'uint256'
1032                      }
1033                    ],
1034                    internalType: 'struct Fp2Element',
1035                    name: 'x',
1036                    type: 'tuple'
1037                  },
1038                  {
1039                    components: [
1040                      {
1041                        internalType: 'uint256',
1042                        name: 'real',
1043                        type: 'uint256'
1044                      },
1045                      {
1046                        internalType: 'uint256',
1047                        name: 'imag',
1048                        type: 'uint256'
1049                      }
1050                    ],
1051                    internalType: 'struct Fp2Element',
1052                    name: 'y',
1053                    type: 'tuple'
1054                  }
1055                ],
1056                internalType: 'struct G2Point',
1057                name: 'b',
1058                type: 'tuple'
1059              },
1060              {
1061                components: [
1062                  {
1063                    internalType: 'uint256',
1064                    name: 'x',
1065                    type: 'uint256'
1066                  },
1067                  {
1068                    internalType: 'uint256',
1069                    name: 'y',
1070                    type: 'uint256'
1071                  }
1072                ],
1073                internalType: 'struct G1Point',
1074                name: 'c',
1075                type: 'tuple'
1076              }
1077            ],
1078            internalType: 'struct Groth16Proof',
1079            name: 'proof',
1080            type: 'tuple'
1081          }
1082        ],
1083        name: 'submitProof',
1084        outputs: [],
1085        stateMutability: 'nonpayable',
1086        type: 'function'
1087      },
1088      {
1089        inputs: [],
1090        name: 'token',
1091        outputs: [
1092          {
1093            internalType: 'contract IERC20',
1094            name: '',
1095            type: 'address'
1096          }
1097        ],
1098        stateMutability: 'view',
1099        type: 'function'
1100      },
1101      {
1102        inputs: [
1103          {
1104            internalType: 'SlotId',
1105            name: 'id',
1106            type: 'bytes32'
1107          }
1108        ],
1109        name: 'willProofBeRequired',
1110        outputs: [
1111          {
1112            internalType: 'bool',
1113            name: '',
1114            type: 'bool'
1115          }
1116        ],
1117        stateMutability: 'view',
1118        type: 'function'
1119      },
1120      {
1121        inputs: [
1122          {
1123            internalType: 'RequestId',
1124            name: 'requestId',
1125            type: 'bytes32'
1126          }
1127        ],
1128        name: 'withdrawFunds',
1129        outputs: [],
1130        stateMutability: 'nonpayable',
1131        type: 'function'
1132      }
1133    ],
1134    address: ENV.marketplaceAddress
1135  })
1136  app.use(testTokenPlugin, {
1137    abi: [
1138      {
1139        inputs: [],
1140        stateMutability: 'nonpayable',
1141        type: 'constructor'
1142      },
1143      {
1144        anonymous: false,
1145        inputs: [
1146          {
1147            indexed: true,
1148            internalType: 'address',
1149            name: 'owner',
1150            type: 'address'
1151          },
1152          {
1153            indexed: true,
1154            internalType: 'address',
1155            name: 'spender',
1156            type: 'address'
1157          },
1158          {
1159            indexed: false,
1160            internalType: 'uint256',
1161            name: 'value',
1162            type: 'uint256'
1163          }
1164        ],
1165        name: 'Approval',
1166        type: 'event'
1167      },
1168      {
1169        anonymous: false,
1170        inputs: [
1171          {
1172            indexed: true,
1173            internalType: 'address',
1174            name: 'from',
1175            type: 'address'
1176          },
1177          {
1178            indexed: true,
1179            internalType: 'address',
1180            name: 'to',
1181            type: 'address'
1182          },
1183          {
1184            indexed: false,
1185            internalType: 'uint256',
1186            name: 'value',
1187            type: 'uint256'
1188          }
1189        ],
1190        name: 'Transfer',
1191        type: 'event'
1192      },
1193      {
1194        inputs: [
1195          {
1196            internalType: 'address',
1197            name: 'owner',
1198            type: 'address'
1199          },
1200          {
1201            internalType: 'address',
1202            name: 'spender',
1203            type: 'address'
1204          }
1205        ],
1206        name: 'allowance',
1207        outputs: [
1208          {
1209            internalType: 'uint256',
1210            name: '',
1211            type: 'uint256'
1212          }
1213        ],
1214        stateMutability: 'view',
1215        type: 'function'
1216      },
1217      {
1218        inputs: [
1219          {
1220            internalType: 'address',
1221            name: 'spender',
1222            type: 'address'
1223          },
1224          {
1225            internalType: 'uint256',
1226            name: 'amount',
1227            type: 'uint256'
1228          }
1229        ],
1230        name: 'approve',
1231        outputs: [
1232          {
1233            internalType: 'bool',
1234            name: '',
1235            type: 'bool'
1236          }
1237        ],
1238        stateMutability: 'nonpayable',
1239        type: 'function'
1240      },
1241      {
1242        inputs: [
1243          {
1244            internalType: 'address',
1245            name: 'account',
1246            type: 'address'
1247          }
1248        ],
1249        name: 'balanceOf',
1250        outputs: [
1251          {
1252            internalType: 'uint256',
1253            name: '',
1254            type: 'uint256'
1255          }
1256        ],
1257        stateMutability: 'view',
1258        type: 'function'
1259      },
1260      {
1261        inputs: [],
1262        name: 'decimals',
1263        outputs: [
1264          {
1265            internalType: 'uint8',
1266            name: '',
1267            type: 'uint8'
1268          }
1269        ],
1270        stateMutability: 'view',
1271        type: 'function'
1272      },
1273      {
1274        inputs: [
1275          {
1276            internalType: 'address',
1277            name: 'spender',
1278            type: 'address'
1279          },
1280          {
1281            internalType: 'uint256',
1282            name: 'subtractedValue',
1283            type: 'uint256'
1284          }
1285        ],
1286        name: 'decreaseAllowance',
1287        outputs: [
1288          {
1289            internalType: 'bool',
1290            name: '',
1291            type: 'bool'
1292          }
1293        ],
1294        stateMutability: 'nonpayable',
1295        type: 'function'
1296      },
1297      {
1298        inputs: [
1299          {
1300            internalType: 'address',
1301            name: 'spender',
1302            type: 'address'
1303          },
1304          {
1305            internalType: 'uint256',
1306            name: 'addedValue',
1307            type: 'uint256'
1308          }
1309        ],
1310        name: 'increaseAllowance',
1311        outputs: [
1312          {
1313            internalType: 'bool',
1314            name: '',
1315            type: 'bool'
1316          }
1317        ],
1318        stateMutability: 'nonpayable',
1319        type: 'function'
1320      },
1321      {
1322        inputs: [
1323          {
1324            internalType: 'address',
1325            name: 'holder',
1326            type: 'address'
1327          },
1328          {
1329            internalType: 'uint256',
1330            name: 'amount',
1331            type: 'uint256'
1332          }
1333        ],
1334        name: 'mint',
1335        outputs: [],
1336        stateMutability: 'nonpayable',
1337        type: 'function'
1338      },
1339      {
1340        inputs: [],
1341        name: 'name',
1342        outputs: [
1343          {
1344            internalType: 'string',
1345            name: '',
1346            type: 'string'
1347          }
1348        ],
1349        stateMutability: 'view',
1350        type: 'function'
1351      },
1352      {
1353        inputs: [],
1354        name: 'symbol',
1355        outputs: [
1356          {
1357            internalType: 'string',
1358            name: '',
1359            type: 'string'
1360          }
1361        ],
1362        stateMutability: 'view',
1363        type: 'function'
1364      },
1365      {
1366        inputs: [],
1367        name: 'totalSupply',
1368        outputs: [
1369          {
1370            internalType: 'uint256',
1371            name: '',
1372            type: 'uint256'
1373          }
1374        ],
1375        stateMutability: 'view',
1376        type: 'function'
1377      },
1378      {
1379        inputs: [
1380          {
1381            internalType: 'address',
1382            name: 'to',
1383            type: 'address'
1384          },
1385          {
1386            internalType: 'uint256',
1387            name: 'amount',
1388            type: 'uint256'
1389          }
1390        ],
1391        name: 'transfer',
1392        outputs: [
1393          {
1394            internalType: 'bool',
1395            name: '',
1396            type: 'bool'
1397          }
1398        ],
1399        stateMutability: 'nonpayable',
1400        type: 'function'
1401      },
1402      {
1403        inputs: [
1404          {
1405            internalType: 'address',
1406            name: 'from',
1407            type: 'address'
1408          },
1409          {
1410            internalType: 'address',
1411            name: 'to',
1412            type: 'address'
1413          },
1414          {
1415            internalType: 'uint256',
1416            name: 'amount',
1417            type: 'uint256'
1418          }
1419        ],
1420        name: 'transferFrom',
1421        outputs: [
1422          {
1423            internalType: 'bool',
1424            name: '',
1425            type: 'bool'
1426          }
1427        ],
1428        stateMutability: 'nonpayable',
1429        type: 'function'
1430      }
1431    ],
1432    address: ENV.testTokenAddress
1433  })
1434  app.use(codexPlugin, {
1435    codexRestUrl: ENV.codexRestUrl,
1436    myAddress: ENV.myAddress
1437  })
1438  app.use(uniqueId)
1439  app.mount('#app')