From 89009f1fcd072aaedd06ede8ba264623277244e9 Mon Sep 17 00:00:00 2001 From: Jip Stavenuiter Date: Thu, 7 Dec 2023 18:55:37 +0100 Subject: [PATCH] Chore/lets merge together (#1221) * Fix/package build (#1124) * chore(npm): sdk to workspace to stop link: * chore(npm): contracts in workspace, no link: * chore(bump): 0.8.7 * chore(bump): contracts 0.8.7 into sdk 0.8.8 * fix(ci): linting errors from updated ws * fix(doc): optimism chainId to 10 from 100 * chore(build): remove type module from package.json * chore(contracts): package sol files * chore(pack): add sol files to contracts package * chore(bump): contract 0.8.9 * chore(pack): exports setup * chore(pack): contracts dir in package * chore(pack): cleanup build scripts * chore(bump): contracts 0.8.10 * chore(pack): add all contracts for inheritence * chore(bump): contracts 0.8.11 * chore(bump): sdk 0.8.10 with updated contracts package * chore(bump): updated packages in frontend * chore(gha): run action on pr and push to develop * Feat/deploy to celo (#1135) * Add HC contracts to OpenZeppelin Defender (#1134) * Fix/package build (#1124) * chore(npm): sdk to workspace to stop link: * chore(npm): contracts in workspace, no link: * chore(bump): 0.8.7 * chore(bump): contracts 0.8.7 into sdk 0.8.8 * fix(ci): linting errors from updated ws * fix(doc): optimism chainId to 10 from 100 * chore(build): remove type module from package.json * chore(contracts): package sol files * chore(pack): add sol files to contracts package * chore(bump): contract 0.8.9 * chore(pack): exports setup * chore(pack): contracts dir in package * chore(pack): cleanup build scripts * chore(bump): contracts 0.8.10 * chore(pack): add all contracts for inheritence * chore(bump): contracts 0.8.11 * chore(bump): sdk 0.8.10 with updated contracts package * chore(bump): updated packages in frontend * chore(gha): run action on pr and push to develop * feat(defender): use hc packages in oz defender * feat(celo): graph deploy, sdk and defender config * chore(bump): SDK 0.8.14 Celo deployment * feat(celo): add celo support to frontend * chore(graph): fix turbo test flow * chore(graph): add comment to p.json * fix(gha): use pnpm cache in graph gha (#1138) * chore: add wrapper components for split and merge functionality * Fix/handle batch transfers graph (#1149) * feat(batch): add batch transfers to grap * SDK remove default chainID dependency (#1146) * Feat/batch burn (#1051) * feat(batch_burn): add batch burn function * fix(docs): update SemiFungible1155 docs * chore(lint): cleanup lint ignores * chore(lint): defender lint errors * chore(deploy): reduce optimizer run for kb limit * chore(script): update upgrade script * feat(gha): split graph deploy develop-main * chore(lint): line length rule to warn from err * chore(gha): run CI on PR to develop * chore(gha): run e2e,ci on pr,push to develop * feat(graph): update graph for burn methods * chore(turbo): split graph deploys (#1055) * Fix/workspace label (#1060) chore(yarn): update workspace label * 1052 subgraph a claimed token should indicate whether it was claimed from an allowlist (#1058) * fix(graph): link claim with allowlist * chore(tweak): yada * fix(graph): update mapping to claim (#1061) * nitial trader implementation (#1063) * feat(iface): draft of trader interface * feat(trader): simple offer, buy, cancel flow * feat(db): update allowlist query (#1057) * feat(test): tweaks and initial tests for Trader * chore(gha): remove hardcoded foundry nightly * feat(test): add initial test for trader sales * feat(test): sales tests * feat(deploy): deployed to goerli * chore(ci): updated hh scripts for trader contract * feat(pause): pausable controls and tests * feat(trader): init trader graph * feat(tokens): surface accepted tokens (#1065) * feat(tokens): surface accepted tokens * fix(tokens): acceptedTokens test and fix * Feat/accepted tokens (#1066) * feat(tokens): surface accepted tokens * fix(tokens): acceptedTokens test and fix * chore(address): update trader address graph * fix(import): add bigint to import * Feat/accepted tokens (#1067) * feat(tokens): surface accepted tokens * fix(tokens): acceptedTokens test and fix * chore(address): update trader address graph * fix(import): add bigint to import * fix(log): add logging to trader mapping * [Prod]:Deployed to Celo, updated Defender, version bumps for everyone (#1137) * Fix/package build (#1124) * chore(npm): sdk to workspace to stop link: * chore(npm): contracts in workspace, no link: * chore(bump): 0.8.7 * chore(bump): contracts 0.8.7 into sdk 0.8.8 * fix(ci): linting errors from updated ws * fix(doc): optimism chainId to 10 from 100 * chore(build): remove type module from package.json * chore(contracts): package sol files * chore(pack): add sol files to contracts package * chore(bump): contract 0.8.9 * chore(pack): exports setup * chore(pack): contracts dir in package * chore(pack): cleanup build scripts * chore(bump): contracts 0.8.10 * chore(pack): add all contracts for inheritence * chore(bump): contracts 0.8.11 * chore(bump): sdk 0.8.10 with updated contracts package * chore(bump): updated packages in frontend * chore(gha): run action on pr and push to develop * Feat/deploy to celo (#1135) * Add HC contracts to OpenZeppelin Defender (#1134) * Fix/package build (#1124) * chore(npm): sdk to workspace to stop link: * chore(npm): contracts in workspace, no link: * chore(bump): 0.8.7 * chore(bump): contracts 0.8.7 into sdk 0.8.8 * fix(ci): linting errors from updated ws * fix(doc): optimism chainId to 10 from 100 * chore(build): remove type module from package.json * chore(contracts): package sol files * chore(pack): add sol files to contracts package * chore(bump): contract 0.8.9 * chore(pack): exports setup * chore(pack): contracts dir in package * chore(pack): cleanup build scripts * chore(bump): contracts 0.8.10 * chore(pack): add all contracts for inheritence * chore(bump): contracts 0.8.11 * chore(bump): sdk 0.8.10 with updated contracts package * chore(bump): updated packages in frontend * chore(gha): run action on pr and push to develop * feat(defender): use hc packages in oz defender * feat(celo): graph deploy, sdk and defender config * chore(bump): SDK 0.8.14 Celo deployment * feat(celo): add celo support to frontend * chore(graph): fix turbo test flow * chore(graph): add comment to p.json * fix(gha): use pnpm cache in graph gha (#1138) * chore(prep): protocol contracts to protocol dir * chore(prep): tests to protocol dir and remappings * chore(license): MIT license * Feat/init marketplace (#1139) * chore(prep): protocol contracts to protocol dir * chore(prep): tests to protocol dir and remappings * chore(license): MIT license * feat(marketplace): inject, build, refactor, test * chore(gha): run gha on push and develop-branches * fix(build): build and lint errors * chore(pnpm): refresh lock file * chore(build): reduce turbo concurrency * fix(build): whac a mole * chore(build): restore prettier in solhint * chore(build): env.template vars * chore(dist): clean and remap output contracts * chore(clean): last tests * fix(build): ignore cors-proxy type errors * chore(gha): add rpc env vars for fork testing --------- Co-authored-by: jipstavenuiter * chore(lint): cleanup config and affiliate flows (#1140) * chore(license): dual licensing contracts + repo (#1141) * feat(config): updated sdk init config * feat(tests): fix all tests to use updated init * feat(test): uncommented all SDK tests * fix(log): remove result logging * [Test] Release marketplace contracts on testnet and add to contracts package (#1150) * feat(deploy): deploy to testnets * chore(build): hardhat build * feat(pack): release, test, bump updated contracts * chore(gha): updated env vars * chore(pnpm): updated lock file * fix(build): build error, replaced util with viem * fix(pnpm): root dir ethers resolution * chore(pnpm): updated lockfile * fix(pnpm): overrides * chore(build): resolving build issues sdk * chore(refactor): dep resolution bug - del eth v5 * fix(test): mock ipfs in minting, remove timeout * chore(build): fresh build * chore(clean): remove contracts/contracts dir * fix(gha): non-next env var in gha for sdk * chore(run): kick * fix(jest): forceExit hanging async call * chore(build): fresh run for sanity * fix(lint): ignore **/abi instead of **/src/abi * feat(fe): integrate in FE and SDK 0.9.1 * chore(bump): sdk 0.9.1-viem * feat(fe): update FE to use SDK 0.9.1 * chore(cleanup): code cleanup SDK * chore(bump): sdk version bump * chore(fe): update SDK dep version * fix(sdk): chainId config * chore(parse): fix parse calc * fix parse allowlist csv tests * fix injected chain id in config * update component config.tsx * chore(bump): updated sdk alpha * chore(run): sanity check passed * chore(build): graphSDK * feat(fe): plasmic rendering issues. * feat(sdk): web3 token * chore(defender): removed api_key sep network conf * chore(defender): remove verbose log batch action * chore(gha): deduplicate runs - now on all push * chore(lint): lint fe lib * chore(gha): cleaned up env vars --------- Co-authored-by: jipstavenuiter * Fix/gha graph (#1165) * Feat/allowlist proof util (#1168) * feat(util): allowlist utils and updated docs * feat(test): updated test and docs * chore(bump): alpha-7 * feat(merkle): test merkleProof fetcher * chore(bump): 1.0.0-alpha.8 * fix(import): allowlist default export * chore(run): local validation run * Add hypercerts to marketplace functionality (#1170) * Feat/batch burn (#1051) * feat(batch_burn): add batch burn function * fix(docs): update SemiFungible1155 docs * chore(lint): cleanup lint ignores * chore(lint): defender lint errors * chore(deploy): reduce optimizer run for kb limit * chore(script): update upgrade script * feat(gha): split graph deploy develop-main * chore(lint): line length rule to warn from err * chore(gha): run CI on PR to develop * chore(gha): run e2e,ci on pr,push to develop * feat(graph): update graph for burn methods * chore(turbo): split graph deploys (#1055) * Fix/workspace label (#1060) chore(yarn): update workspace label * 1052 subgraph a claimed token should indicate whether it was claimed from an allowlist (#1058) * fix(graph): link claim with allowlist * chore(tweak): yada * fix(graph): update mapping to claim (#1061) * nitial trader implementation (#1063) * feat(iface): draft of trader interface * feat(trader): simple offer, buy, cancel flow * feat(db): update allowlist query (#1057) * feat(test): tweaks and initial tests for Trader * chore(gha): remove hardcoded foundry nightly * feat(test): add initial test for trader sales * feat(test): sales tests * feat(deploy): deployed to goerli * chore(ci): updated hh scripts for trader contract * feat(pause): pausable controls and tests * feat(trader): init trader graph * feat(tokens): surface accepted tokens (#1065) * feat(tokens): surface accepted tokens * fix(tokens): acceptedTokens test and fix * Feat/accepted tokens (#1066) * feat(tokens): surface accepted tokens * fix(tokens): acceptedTokens test and fix * chore(address): update trader address graph * fix(import): add bigint to import * Feat/accepted tokens (#1067) * feat(tokens): surface accepted tokens * fix(tokens): acceptedTokens test and fix * chore(address): update trader address graph * fix(import): add bigint to import * fix(log): add logging to trader mapping * chore(prep): protocol contracts to protocol dir * chore(prep): tests to protocol dir and remappings * chore(license): MIT license * Feat/init marketplace (#1139) * chore(prep): protocol contracts to protocol dir * chore(prep): tests to protocol dir and remappings * chore(license): MIT license * feat(marketplace): inject, build, refactor, test * chore(gha): run gha on push and develop-branches * fix(build): build and lint errors * chore(pnpm): refresh lock file * chore(build): reduce turbo concurrency * fix(build): whac a mole * chore(build): restore prettier in solhint * chore(build): env.template vars * chore(dist): clean and remap output contracts * chore(clean): last tests * fix(build): ignore cors-proxy type errors * chore(gha): add rpc env vars for fork testing --------- Co-authored-by: jipstavenuiter * chore(lint): cleanup config and affiliate flows (#1140) * chore(license): dual licensing contracts + repo (#1141) * [Test] Release marketplace contracts on testnet and add to contracts package (#1150) * feat(deploy): deploy to testnets * chore(build): hardhat build * feat(pack): release, test, bump updated contracts * chore(gha): updated env vars * chore(pnpm): updated lock file * fix(build): build error, replaced util with viem * fix(pnpm): root dir ethers resolution * chore(pnpm): updated lockfile * fix(pnpm): overrides * chore(build): resolving build issues sdk * chore(refactor): dep resolution bug - del eth v5 * fix(test): mock ipfs in minting, remove timeout * Direct Hypercert fraction sale (#1142) * feat(tranfer): transfer single hypercert fraction * feat(transfer): batch transfers and across collections * feat(transfer): reduce cyclomatic complexity * feat(offers): hypercert offer signatures * feat(transfer): standard txs tests hypercerts * chore(gha): only run on every push * fix(merge): merge artifacts --------- Co-authored-by: jipstavenuiter * feat(restriction): add transfer restriction to fe (#1173) * feat(metadata): add application name (#1174) * feat(deployments): typed deployment contracts * fix(props): props from plas to form (#1176) * format external url in case it is a direct ipfs link (#1182) * fix(fix formatting of ipfs urls on hypercert page) (#1183) * Feat/split and merge (#1185) * Add split and merge functionality to plasmic and add component logic. * Feat/hardhat deploy script (#1177) * feat(init): first pass hh script marketplace * feat(deploy): marketplace deploy and verify script * chore(deploy): add feerecipient to deploy * chore(scripts): remove scripts * feat(pack): deployment data and fresh pack * 1.0.0-alpha.0 * chore(npm): release 1.0.0-alpha.0 contracts * chore(npm): update contracts and sdk releases * fix(build): viem update fe * fix(default): remove default_chain_id * remove usage of NEXT_PUBLIC_DEFAULT_CHAIN_ID * fix build error --------- Co-authored-by: jipstavenuiter * feat(merkle): account allowlist strategy (#1186) * Added strategy and tests for hypercert functionality (#1188) * feat(fractions): added strategy and tests * feat(tests): update tests and tweak strat * feat(test): fix all the test and clean comms * fix(dist): moar contracts * fix(tweak): little cleanups * chore(lint): fix lint errors * fix(lint): updated foundry lint * Feat/partial fraction sale (#1190) * feat(fractions): added strategy and tests * feat(tests): update tests and tweak strat * feat(test): fix all the test and clean comms * fix(dist): moar contracts * fix(tweak): little cleanups * chore(lint): fix lint errors * fix(lint): updated foundry lint * feat(test): uncomment unused tests * Feat/sdk common js (#1191) * feat(fractions): added strategy and tests * feat(tests): update tests and tweak strat * feat(test): fix all the test and clean comms * fix(dist): moar contracts * fix(tweak): little cleanups * chore(lint): fix lint errors * fix(lint): updated foundry lint * feat(test): uncomment unused tests * feat(bugs): cjs build and import alpha.13 * fix(only): unexpected only in sdk test * feat(abis): updated SDK abis and restored tests (#1193) * feat(abis): updated SDK abis and restored tests * chore(bump): viem in fe * fix(test): add currency admin to test (#1197) * fix build error - set output:export in next config (#1199) * fix build error * lock nextjs version to 13.x.x * add placeholder for transfer fraction button (#1201) * add placeholder for transfer fraction button * remove unnecessary logic from transfer-fraction-button.tsx * change next build back to next export (#1202) remove unnecessary logic from transfer-fraction-button.tsx * Feature/transfer fraction button (#1203) * add transfer fraction button inside split fraction button * add confirmation dialog when transferring fraction * use override chain id in hypercert fetcher within plasmic * add reading of transfer restrictions to transfer fraction button * add override chain id functionality for plasmic editing (#1204) * Bugfix/add override chain id for plasmit editing (#1205) * add override chain id functionality for plasmic editing * add override chain id to effect dependencies * remove transfer fraction button from split fraction button (#1206) * Bugfix/only show transfer button for fraction owned (#1207) * only show transfer button for fractions owned * only show transfer button for fractions owned * Feat/more robust split transfer logic with hc strategy (#1208) * feat(hc): split NFT HC flow * feat(hc): hypercert order routing and validation * fix(e2e): disable faulty E2E tests * Feat/docs tests cleanup (#1210) * feat(checks): checkValidityHC, error code, 0.8.17 * feat(validator): overvalidator HC tests * fix(clean): remove hyperboard references * fix(lint): pragma protocol tests * fix(pragma): restore FeeManagerRoy.. pragma * feat(docs): updated version * feat(build): docs 1.0.0-alpha * Feat/docs tests cleanup (#1211) * feat(checks): checkValidityHC, error code, 0.8.17 * feat(validator): overvalidator HC tests * fix(clean): remove hyperboard references * fix(lint): pragma protocol tests * fix(pragma): restore FeeManagerRoy.. pragma * feat(docs): updated version * feat(build): docs 1.0.0-alpha * chore(docs): natspec tweaks * Feat/docs tests cleanup (#1212) * feat(checks): checkValidityHC, error code, 0.8.17 * feat(validator): overvalidator HC tests * fix(clean): remove hyperboard references * fix(lint): pragma protocol tests * fix(pragma): restore FeeManagerRoy.. pragma * feat(docs): updated version * feat(build): docs 1.0.0-alpha * chore(docs): natspec tweaks * feat(docs): docs sidebar * Feat/add batch transfer method to client methods (#1215) * feat(transfer): add method to client and type * feat(err): simulation and tx error handlers * feat(err): error handling test * chore(pack): dep cleanup and updates * merge fixes --------- Co-authored-by: bitbeckers --- .github/workflows/ci-default.yml | 13 +- .github/workflows/e2e-tests.yml | 8 - .lintstagedignore | 10 + .lintstagedrc | 2 +- LICENSE | 203 +- LICENSE-APACHE | 13 + LICENSE-MIT | 21 + contracts/.env.example | 11 +- contracts/.eslintrc.yml | 10 - contracts/.gitignore | 3 +- contracts/.lintstagedrc | 5 +- contracts/.openzeppelin/goerli.json | 1500 ++ contracts/.prettierignore | 4 +- contracts/.prettierrc.yml | 23 - contracts/.solcover.js | 7 - contracts/.solhint.json | 9 +- contracts/.vscode/settings.json | 2 - contracts/LICENSE | 4 + contracts/LICENSE-APACHE | 10 + contracts/{LICENSE.md => LICENSE-MIT} | 7 +- contracts/README.md | 4 +- contracts/contracts/AllowlistMinter.sol | 20 +- contracts/contracts/HypercertMinter.sol | 51 +- contracts/contracts/SemiFungible1155.sol | 67 +- contracts/contracts/interfaces/IAllowlist.sol | 9 +- contracts/foundry.toml | 39 +- contracts/hardhat.config.ts | 113 +- .../.eslintrc | 31 +- contracts/package.json | 62 +- contracts/remappings.txt | 6 + contracts/rollup.config.mjs | 4 +- contracts/src/SemiFungible1155.sol | 433 - .../deployment-marketplace-goerli.json | 49 + .../deployment-marketplace-sepolia.json | 1296 ++ .../src/deployments/deployments-protocol.json | 24 + contracts/src/deployments/index.ts | 10 + contracts/src/index.ts | 106 +- .../BatchOrderTypehashRegistry.sol | 62 + .../CreatorFeeManagerWithRebates.sol | 93 + .../CreatorFeeManagerWithRoyalties.sol | 95 + contracts/src/marketplace/CurrencyManager.sol | 37 + .../src/marketplace/ExecutionManager.sol | 305 + .../src/marketplace/InheritedStrategy.sol | 89 + .../src/marketplace/LooksRareProtocol.sol | 665 + contracts/src/marketplace/NonceManager.sol | 115 + .../src/marketplace/ProtocolFeeRecipient.sol | 54 + contracts/src/marketplace/StrategyManager.sol | 124 + contracts/src/marketplace/TransferManager.sol | 419 + .../src/marketplace/TransferSelectorNFT.sol | 104 + .../constants/AssemblyConstants.sol | 42 + .../constants/NumericConstants.sol | 14 + .../constants/ValidationCodeConstants.sol | 331 + .../src/marketplace/enums/CollectionType.sol | 11 + contracts/src/marketplace/enums/QuoteType.sol | 10 + .../marketplace/errors/ChainlinkErrors.sol | 41 + .../marketplace/errors/HypercertErrors.sol | 10 + .../src/marketplace/errors/SharedErrors.sol | 65 + .../executionStrategies/BaseStrategy.sol | 46 + .../BaseStrategyChainlinkPriceLatency.sol | 33 + .../StrategyChainlinkUSDDynamicAsk.sol | 164 + .../StrategyCollectionOffer.sol | 180 + .../StrategyDutchAuction.sol | 102 + .../StrategyHypercertFractionOffer.sol | 217 + .../StrategyItemIdsRange.sol | 110 + .../marketplace/helpers/OrderValidatorV2A.sol | 910 ++ .../marketplace/helpers/ProtocolHelpers.sol | 89 + .../interfaces/ICreatorFeeManager.sol | 35 + .../interfaces/ICurrencyManager.sol | 15 + .../interfaces/IExecutionManager.sol | 53 + .../interfaces/IImmutableCreate2Factory.sol | 14 + .../interfaces/ILooksRareProtocol.sol | 166 + .../marketplace/interfaces/INonceManager.sol | 40 + .../interfaces/IRoyaltyFeeRegistry.sol | 20 + .../src/marketplace/interfaces/IStrategy.sol | 30 + .../interfaces/IStrategyManager.sol | 80 + .../interfaces/ITransferManager.sol | 84 + .../libraries/CurrencyValidator.sol | 38 + .../libraries/LowLevelHypercertCaller.sol | 37 + .../MerkleProofCalldataWithNodes.sol | 61 + .../OpenZeppelin/MerkleProofMemory.sol | 50 + .../marketplace/libraries/OrderStructs.sol | 152 + .../src/{ => protocol}/AllowlistMinter.sol | 22 +- .../src/{ => protocol}/HypercertMinter.sol | 82 +- contracts/src/protocol/SemiFungible1155.sol | 641 + .../{ => protocol}/interfaces/IAllowlist.sol | 11 +- .../interfaces/IHypercertToken.sol | 6 +- contracts/src/{ => protocol}/libs/Errors.sol | 2 +- contracts/tasks/deploy-marketplace.ts | 529 + contracts/tasks/deploy.ts | 2 +- contracts/tasks/index.ts | 1 + contracts/tasks/transfer-owner.ts | 36 +- contracts/tasks/upgrade.ts | 71 +- contracts/test/HypercertMinter.test.ts | 10 +- .../foundry/SemiFungible1155.burning.t.sol | 56 - .../BatchMakerCollectionOrders.t.sol | 111 + .../marketplace/BatchMakerOrders.t.sol | 333 + .../BatchOrderTypehashRegistry.t.sol | 120 + .../marketplace/BundleTransactions.t.sol | 260 + .../CreatorFeeManagerWithRebates.t.sol | 233 + .../CreatorFeeManagerWithRoyalties.t.sol | 350 + .../foundry/marketplace/CurrencyManager.t.sol | 42 + .../DelegationRecipientsTaker.t.sol | 171 + .../marketplace/DomainSeparatorUpdates.t.sol | 97 + .../marketplace/ExecutionManager.t.sol | 211 + .../foundry/marketplace/GasGriefing.t.sol | 135 + .../foundry/marketplace/InitialStates.t.sol | 55 + .../marketplace/LooksRareProtocol.t.sol | 278 + .../marketplace/NonceInvalidation.t.sol | 353 + .../marketplace/OrderValidatorV2A.t.sol | 450 + .../foundry/marketplace/ProtocolBase.t.sol | 266 + .../marketplace/ProtocolFeeRecipient.t.sol | 110 + .../test/foundry/marketplace/Sandbox.t.sol | 142 + .../marketplace/SignaturesEIP2098.t.sol | 66 + .../SignaturesERC1271WalletForERC1155.t.sol | 438 + .../SignaturesERC1271WalletForERC721.t.sol | 275 + .../SignaturesERC1271WalletForHypercert.t.sol | 447 + .../marketplace/SignaturesRevertions.t.sol | 173 + .../marketplace/StandardTransactions.t.sol | 507 + .../StandardTransactionsHypercerts.t.sol | 522 + .../foundry/marketplace/StrategyManager.t.sol | 213 + .../foundry/marketplace/TransferManager.t.sol | 787 + ...ifyOrderTimestampValidityEquivalence.t.sol | 91 + .../Chainlink/USDDynamicAskOrders.t.sol | 488 + .../CollectionOffers.t.sol | 566 + .../DutchAuctionOrders.t.sol | 407 + .../HypercertFractionOffers.t.sol | 604 + .../ItemIdsRangeOrders.t.sol | 486 + .../MultiFillCollectionOrders.t.sol | 187 + .../foundry/marketplace/utils/BytesLib.sol | 71 + .../marketplace/utils/EIP712MerkleTree.sol | 103 + .../marketplace/utils/ERC1271Wallet.sol | 20 + .../foundry/marketplace/utils/GasGriefer.sol | 15 + .../utils/MaliciousERC1271Wallet.sol | 66 + ...MaliciousIsValidSignatureERC1271Wallet.sol | 20 + ...aliciousOnERC1155ReceivedERC1271Wallet.sol | 36 + ...C1155ReceivedTheThirdTimeERC1271Wallet.sol | 24 + .../foundry/marketplace/utils/MathLib.sol | 50 + .../marketplace/utils/MerkleWithPosition.sol | 157 + .../marketplace/utils/MockOrderGenerator.sol | 182 + .../marketplace/utils/ProtocolHelpers.sol | 107 + .../StrategyTestMultiFillCollectionOrder.sol | 77 + .../foundry/marketplace/utils/TestHelpers.sol | 26 + .../marketplace/utils/TestParameters.sol | 55 + .../{ => protocol}/AllowlistMinter.t.sol | 29 +- .../foundry/{ => protocol}/Bitshifting.t.sol | 19 +- .../HypercertMinter.batchminting.t.sol | 50 +- .../HypercertMinter.pausable.t.sol | 20 +- .../{ => protocol}/HypercertMinter.t.sol | 55 +- .../HypercertMinter.transfers.t.sol | 16 +- .../{ => protocol}/PerformanceTesting.t.sol | 51 +- .../SemiFungible1155.allowances.t.sol | 10 +- .../protocol/SemiFungible1155.burning.t.sol | 121 + .../SemiFungible1155.minting.t.sol | 26 +- .../{ => protocol}/SemiFungible1155.t.sol | 16 +- .../SemiFungible1155.transfers.t.sol | 20 +- .../{ => protocol}/SemiFungible1155.units.sol | 16 +- .../{ => protocol}/SemiFungibleHelper.sol | 27 +- .../test/mock/MockChainlinkAggregator.sol | 31 + contracts/test/mock/MockERC1155.sol | 29 + .../mock/MockERC1155SupportsNoInterface.sol | 10 + .../mock/MockERC1155WithoutAnyBalanceOf.sol | 21 + .../mock/MockERC1155WithoutBalanceOfBatch.sol | 10 + .../MockERC1155WithoutIsApprovedForAll.sol | 21 + contracts/test/mock/MockERC20.sol | 10 + contracts/test/mock/MockERC721.sol | 31 + .../mock/MockERC721SupportsNoInterface.sol | 10 + .../test/mock/MockERC721WithRoyalties.sol | 53 + contracts/test/mock/MockHypercertMinter.sol | 73 + ...MockHypercertMinterSupportsNoInterface.sol | 10 + .../test/mock/MockHypercertMinterUUPS.sol | 21 + ...MockHypercertMinterWithoutAnyBalanceOf.sol | 12 + .../MockHypercertMinterWithoutAnyUnitsOf.sol | 10 + .../test/mock/MockRoyaltyFeeRegistry.sol | 95 + contracts/test/mock/MockSmartWallet.sol | 65 + contracts/tsconfig.build.json | 18 +- contracts/tsconfig.json | 21 +- cors-proxy/src/index.ts | 3 + defender/.eslintrc.yml | 2 +- defender/package.json | 8 +- .../batch-mint-claims-from-allowlists.ts | 8 - defender/src/networks.ts | 1 - defender/src/update.ts | 6 +- docs/.eslintrc.yml | 27 + .../api/contracts/HypercertMinter.md | 47 +- .../api/contracts/HypercertTrader.md | 434 + .../api/contracts/IHypercertMinter.md | 39 + .../api/contracts/SemiFungible1155.md | 28 +- .../v0.8/interfaces/AggregatorV3Interface.md | 77 + .../api/contracts/forge-std/src/console.md | 1 + .../api/contracts/forge-std/src/console2.md | 3 + .../contracts/interfaces/IHypercertToken.md | 17 + .../contracts/interfaces/IHypercertTrader.md | 133 + .../marketplace/BatchOrderTypehashRegistry.md | 46 + .../CreatorFeeManagerWithRebates.md | 76 + .../CreatorFeeManagerWithRoyalties.md | 64 + .../contracts/marketplace/CurrencyManager.md | 250 + .../contracts/marketplace/ExecutionManager.md | 751 + .../marketplace/InheritedStrategy.md | 9 + .../marketplace/LooksRareProtocol.md | 1157 ++ .../api/contracts/marketplace/NonceManager.md | 193 + .../marketplace/ProtocolFeeRecipient.md | 75 + .../contracts/marketplace/StrategyManager.md | 391 + .../contracts/marketplace/TransferManager.md | 553 + .../marketplace/TransferSelectorNFT.md | 779 + .../executionStrategies/BaseStrategy.md | 41 + .../BaseStrategyChainlinkPriceLatency.md | 212 + .../StrategyChainlinkUSDDynamicAsk.md | 342 + .../StrategyCollectionOffer.md | 127 + .../StrategyDutchAuction.md | 83 + .../StrategyHypercertFractionOffer.md | 123 + .../StrategyItemIdsRange.md | 75 + .../marketplace/helpers/OrderValidatorV2A.md | 215 + .../marketplace/helpers/ProtocolHelpers.md | 159 + .../interfaces/ICreatorFeeManager.md | 60 + .../interfaces/ICurrencyManager.md | 22 + .../interfaces/IExecutionManager.md | 99 + .../interfaces/IImmutableCreate2Factory.md | 41 + .../interfaces/ILooksRareProtocol.md | 157 + .../marketplace/interfaces/INonceManager.md | 53 + .../interfaces/IRoyaltyFeeRegistry.md | 29 + .../marketplace/interfaces/IStrategy.md | 41 + .../interfaces/IStrategyManager.md | 84 + .../interfaces/ITransferManager.md | 111 + .../libraries/CurrencyValidator.md | 7 + .../libraries/LowLevelHypercertCaller.md | 21 + .../MerkleProofCalldataWithNodes.md | 7 + .../OpenZeppelin/MerkleProofMemory.md | 7 + .../marketplace/libraries/OrderStructs.md | 7 + .../api/contracts/protocol/AllowlistMinter.md | 84 + .../api/contracts/protocol/HypercertMinter.md | 895 ++ .../contracts/protocol/SemiFungible1155.md | 457 + .../protocol/interfaces/IAllowlist.md | 29 + .../protocol/interfaces/IHypercertToken.md | 192 + .../api/contracts/protocol/libs/Errors.md | 59 + docs/docs/developer/config.md | 4 +- docs/package.json | 1 + .../version-1.0.0-alpha.0/about.md | 24 + .../developer/allowlists.md | 101 + .../api/contracts/AllowlistMinter.md | 84 + .../api/contracts/HypercertMinter.md | 895 ++ .../api/contracts/HypercertTrader.md | 434 + .../api/contracts/IHypercertMinter.md | 39 + .../api/contracts/SemiFungible1155.md | 457 + .../v0.8/interfaces/AggregatorV3Interface.md | 77 + .../api/contracts/forge-std/src/console.md | 1 + .../api/contracts/forge-std/src/console2.md | 3 + .../api/contracts/interfaces/IAllowlist.md | 29 + .../contracts/interfaces/IHypercertToken.md | 192 + .../contracts/interfaces/IHypercertTrader.md | 133 + .../developer/api/contracts/libs/Errors.md | 59 + .../marketplace/BatchOrderTypehashRegistry.md | 46 + .../CreatorFeeManagerWithRebates.md | 76 + .../CreatorFeeManagerWithRoyalties.md | 64 + .../contracts/marketplace/CurrencyManager.md | 250 + .../contracts/marketplace/ExecutionManager.md | 751 + .../marketplace/InheritedStrategy.md | 9 + .../marketplace/LooksRareProtocol.md | 1157 ++ .../api/contracts/marketplace/NonceManager.md | 193 + .../marketplace/ProtocolFeeRecipient.md | 75 + .../contracts/marketplace/StrategyManager.md | 391 + .../contracts/marketplace/TransferManager.md | 553 + .../marketplace/TransferSelectorNFT.md | 779 + .../executionStrategies/BaseStrategy.md | 41 + .../BaseStrategyChainlinkPriceLatency.md | 212 + .../StrategyChainlinkUSDDynamicAsk.md | 342 + .../StrategyCollectionOffer.md | 127 + .../StrategyDutchAuction.md | 83 + .../StrategyHypercertFractionOffer.md | 123 + .../StrategyItemIdsRange.md | 75 + .../marketplace/helpers/OrderValidatorV2A.md | 215 + .../marketplace/helpers/ProtocolHelpers.md | 159 + .../interfaces/ICreatorFeeManager.md | 60 + .../interfaces/ICurrencyManager.md | 22 + .../interfaces/IExecutionManager.md | 99 + .../interfaces/IImmutableCreate2Factory.md | 41 + .../interfaces/ILooksRareProtocol.md | 157 + .../marketplace/interfaces/INonceManager.md | 53 + .../interfaces/IRoyaltyFeeRegistry.md | 29 + .../marketplace/interfaces/IStrategy.md | 41 + .../interfaces/IStrategyManager.md | 84 + .../interfaces/ITransferManager.md | 111 + .../libraries/CurrencyValidator.md | 7 + .../libraries/LowLevelHypercertCaller.md | 21 + .../MerkleProofCalldataWithNodes.md | 7 + .../OpenZeppelin/MerkleProofMemory.md | 7 + .../marketplace/libraries/OrderStructs.md | 7 + .../api/contracts/protocol/AllowlistMinter.md | 84 + .../api/contracts/protocol/HypercertMinter.md | 895 ++ .../contracts/protocol/SemiFungible1155.md | 457 + .../protocol/interfaces/IAllowlist.md | 29 + .../protocol/interfaces/IHypercertToken.md | 192 + .../api/contracts/protocol/libs/Errors.md | 59 + .../developer/api/sdk/.nojekyll | 1 + .../developer/api/sdk/README.md | 185 + .../developer/api/sdk/classes/ClientError.md | 68 + .../api/sdk/classes/ConfigurationError.md | 66 + .../developer/api/sdk/classes/FetchError.md | 68 + .../api/sdk/classes/HypercertClient.md | 493 + .../api/sdk/classes/HypercertsStorage.md | 250 + .../api/sdk/classes/InvalidOrMissingError.md | 68 + .../api/sdk/classes/MalformedDataError.md | 68 + .../developer/api/sdk/classes/MintingError.md | 68 + .../developer/api/sdk/classes/StorageError.md | 68 + .../api/sdk/classes/UnknownSchemaError.md | 71 + .../api/sdk/classes/UnsupportedChainError.md | 72 + .../api/sdk/classes/internal.default-1.md | 278 + .../api/sdk/classes/internal.default-2.md | 131 + .../api/sdk/classes/internal.default.md | 110 + .../api/sdk/interfaces/CustomError.md | 39 + .../api/sdk/interfaces/DuplicateEvaluation.md | 56 + .../api/sdk/interfaces/EASEvaluation.md | 56 + .../api/sdk/interfaces/HypercertClaimdata.md | 167 + .../interfaces/HypercertClientInterface.md | 341 + .../sdk/interfaces/HypercertClientMethods.md | 239 + .../sdk/interfaces/HypercertClientState.md | 68 + .../interfaces/HypercertEvaluationSchema.md | 47 + .../interfaces/HypercertIndexerInterface.md | 176 + .../api/sdk/interfaces/HypercertMetadata.md | 123 + .../api/sdk/interfaces/HypercertPointer.md | 45 + .../interfaces/HypercertStorageInterface.md | 130 + .../api/sdk/interfaces/IPFSEvaluation.md | 34 + .../sdk/interfaces/SimpleTextEvaluation.md | 45 + .../interfaces/internal.EvaluatorInterface.md | 43 + .../interfaces/internal.HypercertClaimdata.md | 169 + .../interfaces/internal.HypercertMinter.md | 17 + .../developer/api/sdk/modules.md | 638 + .../developer/api/sdk/modules/internal.md | 307 + .../developer/burning.md | 12 + .../version-1.0.0-alpha.0/developer/config.md | 112 + .../version-1.0.0-alpha.0/developer/errors.md | 18 + .../developer/evaluations.md | 13 + .../developer/minting.md | 57 + .../developer/querying.md | 306 + .../developer/quickstart-javascript.md | 101 + .../developer/quickstart-solidity.md | 41 + .../developer/split-merge.md | 29 + .../developer/supported-networks.md | 13 + .../devops/deploy-proxy.md | 120 + .../version-1.0.0-alpha.0/devops/errors.md | 45 + .../version-1.0.0-alpha.0/devops/index.md | 18 + .../version-1.0.0-alpha.0/devops/pause.md | 29 + .../version-1.0.0-alpha.0/devops/plasmic.md | 76 + .../version-1.0.0-alpha.0/devops/setup.md | 41 + .../version-1.0.0-alpha.0/devops/upgrade.md | 35 + .../version-1.0.0-alpha.0/faq.md | 139 + .../further-resources.md | 37 + .../implementation/glossary.md | 139 + .../implementation/metadata.md | 188 + .../implementation/token-standard.md | 29 + .../version-1.0.0-alpha.0/intro.md | 58 + .../minting-guide/gitcoin-round.md | 166 + .../minting-guide/minting-guide-start.md | 44 + .../minting-guide/step-by-step.md | 130 + .../whitepaper/evaluation.md | 23 + .../whitepaper/hypercerts-intro.md | 104 + .../version-1.0.0-alpha.0/whitepaper/ifs.md | 103 + .../whitepaper/impact-space.md | 35 + .../whitepaper/retrospective-funding.md | 42 + .../whitepaper/whitepaper-intro.md | 24 + .../version-1.0.0-alpha.1/about.md | 24 + .../developer/allowlists.md | 101 + .../api/contracts/AllowlistMinter.md | 84 + .../api/contracts/HypercertMinter.md | 895 ++ .../api/contracts/HypercertTrader.md | 434 + .../api/contracts/IHypercertMinter.md | 39 + .../api/contracts/SemiFungible1155.md | 457 + .../v0.8/interfaces/AggregatorV3Interface.md | 77 + .../api/contracts/forge-std/src/console.md | 1 + .../api/contracts/forge-std/src/console2.md | 3 + .../api/contracts/interfaces/IAllowlist.md | 29 + .../contracts/interfaces/IHypercertToken.md | 192 + .../contracts/interfaces/IHypercertTrader.md | 133 + .../developer/api/contracts/libs/Errors.md | 59 + .../marketplace/BatchOrderTypehashRegistry.md | 46 + .../CreatorFeeManagerWithRebates.md | 76 + .../CreatorFeeManagerWithRoyalties.md | 64 + .../contracts/marketplace/CurrencyManager.md | 250 + .../contracts/marketplace/ExecutionManager.md | 751 + .../marketplace/InheritedStrategy.md | 9 + .../marketplace/LooksRareProtocol.md | 1157 ++ .../api/contracts/marketplace/NonceManager.md | 193 + .../marketplace/ProtocolFeeRecipient.md | 75 + .../contracts/marketplace/StrategyManager.md | 391 + .../contracts/marketplace/TransferManager.md | 553 + .../marketplace/TransferSelectorNFT.md | 779 + .../executionStrategies/BaseStrategy.md | 41 + .../BaseStrategyChainlinkPriceLatency.md | 212 + .../StrategyChainlinkUSDDynamicAsk.md | 342 + .../StrategyCollectionOffer.md | 127 + .../StrategyDutchAuction.md | 83 + .../StrategyHypercertFractionOffer.md | 123 + .../StrategyItemIdsRange.md | 75 + .../marketplace/helpers/OrderValidatorV2A.md | 215 + .../marketplace/helpers/ProtocolHelpers.md | 159 + .../interfaces/ICreatorFeeManager.md | 60 + .../interfaces/ICurrencyManager.md | 22 + .../interfaces/IExecutionManager.md | 99 + .../interfaces/IImmutableCreate2Factory.md | 41 + .../interfaces/ILooksRareProtocol.md | 157 + .../marketplace/interfaces/INonceManager.md | 53 + .../interfaces/IRoyaltyFeeRegistry.md | 29 + .../marketplace/interfaces/IStrategy.md | 41 + .../interfaces/IStrategyManager.md | 84 + .../interfaces/ITransferManager.md | 111 + .../libraries/CurrencyValidator.md | 7 + .../libraries/LowLevelHypercertCaller.md | 21 + .../MerkleProofCalldataWithNodes.md | 7 + .../OpenZeppelin/MerkleProofMemory.md | 7 + .../marketplace/libraries/OrderStructs.md | 7 + .../api/contracts/protocol/AllowlistMinter.md | 84 + .../api/contracts/protocol/HypercertMinter.md | 895 ++ .../contracts/protocol/SemiFungible1155.md | 457 + .../protocol/interfaces/IAllowlist.md | 29 + .../protocol/interfaces/IHypercertToken.md | 192 + .../api/contracts/protocol/libs/Errors.md | 59 + .../developer/api/sdk/.nojekyll | 1 + .../developer/api/sdk/README.md | 185 + .../developer/api/sdk/classes/ClientError.md | 68 + .../api/sdk/classes/ConfigurationError.md | 66 + .../developer/api/sdk/classes/FetchError.md | 68 + .../api/sdk/classes/HypercertClient.md | 493 + .../api/sdk/classes/HypercertsStorage.md | 250 + .../api/sdk/classes/InvalidOrMissingError.md | 68 + .../api/sdk/classes/MalformedDataError.md | 68 + .../developer/api/sdk/classes/MintingError.md | 68 + .../developer/api/sdk/classes/StorageError.md | 68 + .../api/sdk/classes/UnknownSchemaError.md | 71 + .../api/sdk/classes/UnsupportedChainError.md | 72 + .../api/sdk/classes/internal.default-1.md | 278 + .../api/sdk/classes/internal.default-2.md | 131 + .../api/sdk/classes/internal.default.md | 110 + .../api/sdk/interfaces/CustomError.md | 39 + .../api/sdk/interfaces/DuplicateEvaluation.md | 56 + .../api/sdk/interfaces/EASEvaluation.md | 56 + .../api/sdk/interfaces/HypercertClaimdata.md | 167 + .../interfaces/HypercertClientInterface.md | 341 + .../sdk/interfaces/HypercertClientMethods.md | 239 + .../sdk/interfaces/HypercertClientState.md | 68 + .../interfaces/HypercertEvaluationSchema.md | 47 + .../interfaces/HypercertIndexerInterface.md | 176 + .../api/sdk/interfaces/HypercertMetadata.md | 123 + .../api/sdk/interfaces/HypercertPointer.md | 45 + .../interfaces/HypercertStorageInterface.md | 130 + .../api/sdk/interfaces/IPFSEvaluation.md | 34 + .../sdk/interfaces/SimpleTextEvaluation.md | 45 + .../interfaces/internal.EvaluatorInterface.md | 43 + .../interfaces/internal.HypercertClaimdata.md | 169 + .../interfaces/internal.HypercertMinter.md | 17 + .../developer/api/sdk/modules.md | 638 + .../developer/api/sdk/modules/internal.md | 307 + .../developer/burning.md | 12 + .../version-1.0.0-alpha.1/developer/config.md | 110 + .../version-1.0.0-alpha.1/developer/errors.md | 18 + .../developer/evaluations.md | 13 + .../developer/minting.md | 57 + .../developer/querying.md | 306 + .../developer/quickstart-javascript.md | 101 + .../developer/quickstart-solidity.md | 41 + .../developer/split-merge.md | 29 + .../developer/supported-networks.md | 13 + .../devops/deploy-proxy.md | 120 + .../version-1.0.0-alpha.1/devops/errors.md | 45 + .../version-1.0.0-alpha.1/devops/index.md | 18 + .../version-1.0.0-alpha.1/devops/pause.md | 29 + .../version-1.0.0-alpha.1/devops/plasmic.md | 76 + .../version-1.0.0-alpha.1/devops/setup.md | 41 + .../version-1.0.0-alpha.1/devops/upgrade.md | 35 + .../version-1.0.0-alpha.1/faq.md | 139 + .../further-resources.md | 37 + .../implementation/glossary.md | 139 + .../implementation/metadata.md | 188 + .../implementation/token-standard.md | 29 + .../version-1.0.0-alpha.1/intro.md | 58 + .../minting-guide/gitcoin-round.md | 166 + .../minting-guide/minting-guide-start.md | 44 + .../minting-guide/step-by-step.md | 130 + .../whitepaper/evaluation.md | 23 + .../whitepaper/hypercerts-intro.md | 104 + .../version-1.0.0-alpha.1/whitepaper/ifs.md | 103 + .../whitepaper/impact-space.md | 35 + .../whitepaper/retrospective-funding.md | 42 + .../whitepaper/whitepaper-intro.md | 24 + .../version-1.0.0-alpha.0-sidebars.json | 162 + .../version-1.0.0-alpha.1-sidebars.json | 165 + docs/versions.json | 3 +- frontend/.env.local.example | 2 - frontend/.eslintrc.json | 5 - frontend/components/blueprint-create.tsx | 487 - frontend/components/config.tsx | 12 +- .../contribution-blueprint-create.tsx | 28 - frontend/components/dapp-state.tsx | 4 - frontend/components/hypercert-create.tsx | 25 +- frontend/components/hypercert-fetcher.tsx | 15 +- .../merge-all-claim-fractions-button.tsx | 90 +- frontend/components/split-fraction-button.tsx | 178 +- .../components/transfer-fraction-button.tsx | 249 + frontend/hooks/burnFraction.ts | 21 +- frontend/hooks/claims.ts | 23 - frontend/hooks/fractions.ts | 66 +- frontend/hooks/hypercerts-client.ts | 104 +- frontend/hooks/mergeFractionUnits.ts | 23 +- frontend/hooks/mintClaim.ts | 34 +- frontend/hooks/mintClaimAllowlist.ts | 27 +- frontend/hooks/mintFractionAllowlist.ts | 26 +- frontend/hooks/mintFractionAllowlistBatch.ts | 20 +- frontend/hooks/readTransferRestriction.ts | 28 + frontend/hooks/splitClaimUnits.ts | 28 +- frontend/hooks/transferFraction.ts | 102 + frontend/hooks/verifyFractionClaim.ts | 13 +- frontend/lib/config.ts | 13 - frontend/lib/formatting.ts | 16 +- frontend/lib/hypercert.test.ts | 4 +- frontend/lib/hypercert.ts | 11 +- frontend/lib/parse-blockchain-error.ts | 13 +- frontend/lib/parsing.test.ts | 44 +- frontend/lib/parsing.ts | 26 +- frontend/next.config.mjs | 1 + frontend/package.json | 14 +- frontend/plasmic-init.ts | 63 +- graph/.eslintrc.yml | 11 + graph/abis/HypercertMinter.json | 2189 +-- .../HypercertMinter/HypercertMinter.ts | 255 +- graph/generated/schema.ts | 430 + graph/schema.graphql | 41 + graph/src/hypercert-minter.ts | 88 +- graph/src/utils.ts | 142 +- graph/subgraph.yaml | 6 +- graph/tests/.latest.json | 2 +- graph/tests/hypercert-minter-burn.test.ts | 189 + graph/tests/hypercert-minter-claim.test.ts | 6 +- graph/tests/hypercert-minter-utils.ts | 147 +- package.json | 14 +- pnpm-lock.yaml | 9244 +++++++---- pnpm-workspace.yaml | 2 +- sdk/.eslintrc.yml | 2 +- sdk/.graphclient/index.ts | 747 +- sdk/.graphclient/schema.graphql | 642 +- .../sources/Hypercerts/introspectionSchema.ts | 12948 +++++++++++++--- .../sources/Hypercerts/schema.graphql | 638 + sdk/.graphclient/sources/Hypercerts/types.ts | 641 +- sdk/.graphclientrc.yml | 12 +- sdk/README.md | 92 +- sdk/global.d.ts | 1 - sdk/jest.config.ts | 20 - sdk/package.json | 97 +- sdk/src/client.ts | 583 +- sdk/src/constants.ts | 21 +- sdk/src/evaluations/eas.ts | 155 - sdk/src/evaluations/index.ts | 55 +- sdk/src/index.ts | 18 +- sdk/src/indexer.ts | 110 +- sdk/src/indexer/queries/claims.graphql | 6 +- sdk/src/indexer/queries/fractions.graphql | 6 +- sdk/src/indexer/utils.ts | 2 +- sdk/src/storage.ts | 140 +- sdk/src/types/client.ts | 121 +- sdk/src/types/errors.ts | 22 + sdk/src/types/hypercerts.ts | 22 +- sdk/src/types/index.ts | 16 +- sdk/src/utils/adapters.ts | 66 + sdk/src/utils/allowlist.ts | 46 + sdk/src/utils/config.ts | 233 +- sdk/src/utils/errors.ts | 47 +- sdk/src/utils/fetchers.ts | 47 + sdk/src/utils/formatter.ts | 4 +- sdk/src/utils/index.ts | 18 + sdk/src/utils/logger.ts | 2 +- sdk/src/utils/resolvers.ts | 10 +- sdk/src/validator/index.ts | 148 +- sdk/test/client.test.ts | 104 +- sdk/test/client/allowlist.minting.test.ts | 279 +- sdk/test/client/burn.test.ts | 126 +- sdk/test/client/minting.test.ts | 123 +- sdk/test/client/split.merge.test.ts | 388 +- sdk/test/evaluations/easEvaluator.test.ts | 90 - sdk/test/evaluations/evaluator.test.ts | 104 +- sdk/test/helpers.ts | 126 +- sdk/test/indexer.test.ts | 15 +- sdk/test/indexer/queries.test.ts | 49 +- sdk/test/resources/HypercertMinter.json | 1139 ++ sdk/test/setup-env.ts | 11 + sdk/test/storage.test.ts | 28 +- sdk/test/storage/nft.storage.test.ts | 85 +- sdk/test/storage/web3.storage.test.ts | 50 +- sdk/test/types/errors.test.ts | 6 +- sdk/test/utils/allowlist.test.ts | 52 + sdk/test/utils/config.test.ts | 183 +- sdk/test/utils/errors.test.ts | 92 +- sdk/test/utils/fetchers.test.ts | 39 + sdk/test/utils/formatter.test.ts | 5 +- sdk/test/utils/logger.test.ts | 3 +- sdk/test/validator.test.ts | 20 +- sdk/tsconfig.json | 2 +- sdk/vitest.config.mts | 7 + 594 files changed, 92491 insertions(+), 11070 deletions(-) create mode 100644 .lintstagedignore create mode 100644 LICENSE-APACHE create mode 100644 LICENSE-MIT delete mode 100644 contracts/.solcover.js create mode 100644 contracts/LICENSE create mode 100644 contracts/LICENSE-APACHE rename contracts/{LICENSE.md => LICENSE-MIT} (77%) delete mode 100644 contracts/src/SemiFungible1155.sol create mode 100644 contracts/src/deployments/deployment-marketplace-goerli.json create mode 100644 contracts/src/deployments/deployment-marketplace-sepolia.json create mode 100644 contracts/src/deployments/deployments-protocol.json create mode 100644 contracts/src/deployments/index.ts create mode 100644 contracts/src/marketplace/BatchOrderTypehashRegistry.sol create mode 100644 contracts/src/marketplace/CreatorFeeManagerWithRebates.sol create mode 100644 contracts/src/marketplace/CreatorFeeManagerWithRoyalties.sol create mode 100644 contracts/src/marketplace/CurrencyManager.sol create mode 100644 contracts/src/marketplace/ExecutionManager.sol create mode 100644 contracts/src/marketplace/InheritedStrategy.sol create mode 100644 contracts/src/marketplace/LooksRareProtocol.sol create mode 100644 contracts/src/marketplace/NonceManager.sol create mode 100644 contracts/src/marketplace/ProtocolFeeRecipient.sol create mode 100644 contracts/src/marketplace/StrategyManager.sol create mode 100644 contracts/src/marketplace/TransferManager.sol create mode 100644 contracts/src/marketplace/TransferSelectorNFT.sol create mode 100644 contracts/src/marketplace/constants/AssemblyConstants.sol create mode 100644 contracts/src/marketplace/constants/NumericConstants.sol create mode 100644 contracts/src/marketplace/constants/ValidationCodeConstants.sol create mode 100644 contracts/src/marketplace/enums/CollectionType.sol create mode 100644 contracts/src/marketplace/enums/QuoteType.sol create mode 100644 contracts/src/marketplace/errors/ChainlinkErrors.sol create mode 100644 contracts/src/marketplace/errors/HypercertErrors.sol create mode 100644 contracts/src/marketplace/errors/SharedErrors.sol create mode 100644 contracts/src/marketplace/executionStrategies/BaseStrategy.sol create mode 100644 contracts/src/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.sol create mode 100644 contracts/src/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.sol create mode 100644 contracts/src/marketplace/executionStrategies/StrategyCollectionOffer.sol create mode 100644 contracts/src/marketplace/executionStrategies/StrategyDutchAuction.sol create mode 100644 contracts/src/marketplace/executionStrategies/StrategyHypercertFractionOffer.sol create mode 100644 contracts/src/marketplace/executionStrategies/StrategyItemIdsRange.sol create mode 100644 contracts/src/marketplace/helpers/OrderValidatorV2A.sol create mode 100644 contracts/src/marketplace/helpers/ProtocolHelpers.sol create mode 100644 contracts/src/marketplace/interfaces/ICreatorFeeManager.sol create mode 100644 contracts/src/marketplace/interfaces/ICurrencyManager.sol create mode 100644 contracts/src/marketplace/interfaces/IExecutionManager.sol create mode 100644 contracts/src/marketplace/interfaces/IImmutableCreate2Factory.sol create mode 100644 contracts/src/marketplace/interfaces/ILooksRareProtocol.sol create mode 100644 contracts/src/marketplace/interfaces/INonceManager.sol create mode 100644 contracts/src/marketplace/interfaces/IRoyaltyFeeRegistry.sol create mode 100644 contracts/src/marketplace/interfaces/IStrategy.sol create mode 100644 contracts/src/marketplace/interfaces/IStrategyManager.sol create mode 100644 contracts/src/marketplace/interfaces/ITransferManager.sol create mode 100644 contracts/src/marketplace/libraries/CurrencyValidator.sol create mode 100644 contracts/src/marketplace/libraries/LowLevelHypercertCaller.sol create mode 100644 contracts/src/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.sol create mode 100644 contracts/src/marketplace/libraries/OpenZeppelin/MerkleProofMemory.sol create mode 100644 contracts/src/marketplace/libraries/OrderStructs.sol rename contracts/src/{ => protocol}/AllowlistMinter.sol (83%) rename contracts/src/{ => protocol}/HypercertMinter.sol (78%) create mode 100644 contracts/src/protocol/SemiFungible1155.sol rename contracts/src/{ => protocol}/interfaces/IAllowlist.sol (61%) rename contracts/src/{ => protocol}/interfaces/IHypercertToken.sol (91%) rename contracts/src/{ => protocol}/libs/Errors.sol (92%) create mode 100644 contracts/tasks/deploy-marketplace.ts delete mode 100644 contracts/test/foundry/SemiFungible1155.burning.t.sol create mode 100644 contracts/test/foundry/marketplace/BatchMakerCollectionOrders.t.sol create mode 100644 contracts/test/foundry/marketplace/BatchMakerOrders.t.sol create mode 100644 contracts/test/foundry/marketplace/BatchOrderTypehashRegistry.t.sol create mode 100644 contracts/test/foundry/marketplace/BundleTransactions.t.sol create mode 100644 contracts/test/foundry/marketplace/CreatorFeeManagerWithRebates.t.sol create mode 100644 contracts/test/foundry/marketplace/CreatorFeeManagerWithRoyalties.t.sol create mode 100644 contracts/test/foundry/marketplace/CurrencyManager.t.sol create mode 100644 contracts/test/foundry/marketplace/DelegationRecipientsTaker.t.sol create mode 100644 contracts/test/foundry/marketplace/DomainSeparatorUpdates.t.sol create mode 100644 contracts/test/foundry/marketplace/ExecutionManager.t.sol create mode 100644 contracts/test/foundry/marketplace/GasGriefing.t.sol create mode 100644 contracts/test/foundry/marketplace/InitialStates.t.sol create mode 100644 contracts/test/foundry/marketplace/LooksRareProtocol.t.sol create mode 100644 contracts/test/foundry/marketplace/NonceInvalidation.t.sol create mode 100644 contracts/test/foundry/marketplace/OrderValidatorV2A.t.sol create mode 100644 contracts/test/foundry/marketplace/ProtocolBase.t.sol create mode 100644 contracts/test/foundry/marketplace/ProtocolFeeRecipient.t.sol create mode 100644 contracts/test/foundry/marketplace/Sandbox.t.sol create mode 100644 contracts/test/foundry/marketplace/SignaturesEIP2098.t.sol create mode 100644 contracts/test/foundry/marketplace/SignaturesERC1271WalletForERC1155.t.sol create mode 100644 contracts/test/foundry/marketplace/SignaturesERC1271WalletForERC721.t.sol create mode 100644 contracts/test/foundry/marketplace/SignaturesERC1271WalletForHypercert.t.sol create mode 100644 contracts/test/foundry/marketplace/SignaturesRevertions.t.sol create mode 100644 contracts/test/foundry/marketplace/StandardTransactions.t.sol create mode 100644 contracts/test/foundry/marketplace/StandardTransactionsHypercerts.t.sol create mode 100644 contracts/test/foundry/marketplace/StrategyManager.t.sol create mode 100644 contracts/test/foundry/marketplace/TransferManager.t.sol create mode 100644 contracts/test/foundry/marketplace/assembly/VerifyOrderTimestampValidityEquivalence.t.sol create mode 100644 contracts/test/foundry/marketplace/executionStrategies/Chainlink/USDDynamicAskOrders.t.sol create mode 100644 contracts/test/foundry/marketplace/executionStrategies/CollectionOffers.t.sol create mode 100644 contracts/test/foundry/marketplace/executionStrategies/DutchAuctionOrders.t.sol create mode 100644 contracts/test/foundry/marketplace/executionStrategies/HypercertFractionOffers.t.sol create mode 100644 contracts/test/foundry/marketplace/executionStrategies/ItemIdsRangeOrders.t.sol create mode 100644 contracts/test/foundry/marketplace/executionStrategies/MultiFillCollectionOrders.t.sol create mode 100644 contracts/test/foundry/marketplace/utils/BytesLib.sol create mode 100644 contracts/test/foundry/marketplace/utils/EIP712MerkleTree.sol create mode 100644 contracts/test/foundry/marketplace/utils/ERC1271Wallet.sol create mode 100644 contracts/test/foundry/marketplace/utils/GasGriefer.sol create mode 100644 contracts/test/foundry/marketplace/utils/MaliciousERC1271Wallet.sol create mode 100644 contracts/test/foundry/marketplace/utils/MaliciousIsValidSignatureERC1271Wallet.sol create mode 100644 contracts/test/foundry/marketplace/utils/MaliciousOnERC1155ReceivedERC1271Wallet.sol create mode 100644 contracts/test/foundry/marketplace/utils/MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet.sol create mode 100644 contracts/test/foundry/marketplace/utils/MathLib.sol create mode 100644 contracts/test/foundry/marketplace/utils/MerkleWithPosition.sol create mode 100644 contracts/test/foundry/marketplace/utils/MockOrderGenerator.sol create mode 100644 contracts/test/foundry/marketplace/utils/ProtocolHelpers.sol create mode 100644 contracts/test/foundry/marketplace/utils/StrategyTestMultiFillCollectionOrder.sol create mode 100644 contracts/test/foundry/marketplace/utils/TestHelpers.sol create mode 100644 contracts/test/foundry/marketplace/utils/TestParameters.sol rename contracts/test/foundry/{ => protocol}/AllowlistMinter.t.sol (90%) rename contracts/test/foundry/{ => protocol}/Bitshifting.t.sol (86%) rename contracts/test/foundry/{ => protocol}/HypercertMinter.batchminting.t.sol (85%) rename contracts/test/foundry/{ => protocol}/HypercertMinter.pausable.t.sol (87%) rename contracts/test/foundry/{ => protocol}/HypercertMinter.t.sol (75%) rename contracts/test/foundry/{ => protocol}/HypercertMinter.transfers.t.sol (92%) rename contracts/test/foundry/{ => protocol}/PerformanceTesting.t.sol (82%) rename contracts/test/foundry/{ => protocol}/SemiFungible1155.allowances.t.sol (94%) create mode 100644 contracts/test/foundry/protocol/SemiFungible1155.burning.t.sol rename contracts/test/foundry/{ => protocol}/SemiFungible1155.minting.t.sol (88%) rename contracts/test/foundry/{ => protocol}/SemiFungible1155.t.sol (91%) rename contracts/test/foundry/{ => protocol}/SemiFungible1155.transfers.t.sol (93%) rename contracts/test/foundry/{ => protocol}/SemiFungible1155.units.sol (88%) rename contracts/test/foundry/{ => protocol}/SemiFungibleHelper.sol (86%) create mode 100644 contracts/test/mock/MockChainlinkAggregator.sol create mode 100644 contracts/test/mock/MockERC1155.sol create mode 100644 contracts/test/mock/MockERC1155SupportsNoInterface.sol create mode 100644 contracts/test/mock/MockERC1155WithoutAnyBalanceOf.sol create mode 100644 contracts/test/mock/MockERC1155WithoutBalanceOfBatch.sol create mode 100644 contracts/test/mock/MockERC1155WithoutIsApprovedForAll.sol create mode 100644 contracts/test/mock/MockERC20.sol create mode 100644 contracts/test/mock/MockERC721.sol create mode 100644 contracts/test/mock/MockERC721SupportsNoInterface.sol create mode 100644 contracts/test/mock/MockERC721WithRoyalties.sol create mode 100644 contracts/test/mock/MockHypercertMinter.sol create mode 100644 contracts/test/mock/MockHypercertMinterSupportsNoInterface.sol create mode 100644 contracts/test/mock/MockHypercertMinterUUPS.sol create mode 100644 contracts/test/mock/MockHypercertMinterWithoutAnyBalanceOf.sol create mode 100644 contracts/test/mock/MockHypercertMinterWithoutAnyUnitsOf.sol create mode 100644 contracts/test/mock/MockRoyaltyFeeRegistry.sol create mode 100644 contracts/test/mock/MockSmartWallet.sol create mode 100644 docs/.eslintrc.yml create mode 100644 docs/docs/developer/api/contracts/HypercertTrader.md create mode 100644 docs/docs/developer/api/contracts/IHypercertMinter.md create mode 100644 docs/docs/developer/api/contracts/ainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.md create mode 100644 docs/docs/developer/api/contracts/forge-std/src/console.md create mode 100644 docs/docs/developer/api/contracts/forge-std/src/console2.md create mode 100644 docs/docs/developer/api/contracts/interfaces/IHypercertTrader.md create mode 100644 docs/docs/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md create mode 100644 docs/docs/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md create mode 100644 docs/docs/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md create mode 100644 docs/docs/developer/api/contracts/marketplace/CurrencyManager.md create mode 100644 docs/docs/developer/api/contracts/marketplace/ExecutionManager.md create mode 100644 docs/docs/developer/api/contracts/marketplace/InheritedStrategy.md create mode 100644 docs/docs/developer/api/contracts/marketplace/LooksRareProtocol.md create mode 100644 docs/docs/developer/api/contracts/marketplace/NonceManager.md create mode 100644 docs/docs/developer/api/contracts/marketplace/ProtocolFeeRecipient.md create mode 100644 docs/docs/developer/api/contracts/marketplace/StrategyManager.md create mode 100644 docs/docs/developer/api/contracts/marketplace/TransferManager.md create mode 100644 docs/docs/developer/api/contracts/marketplace/TransferSelectorNFT.md create mode 100644 docs/docs/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md create mode 100644 docs/docs/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md create mode 100644 docs/docs/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md create mode 100644 docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md create mode 100644 docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md create mode 100644 docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md create mode 100644 docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md create mode 100644 docs/docs/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md create mode 100644 docs/docs/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md create mode 100644 docs/docs/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md create mode 100644 docs/docs/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md create mode 100644 docs/docs/developer/api/contracts/marketplace/interfaces/IExecutionManager.md create mode 100644 docs/docs/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md create mode 100644 docs/docs/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md create mode 100644 docs/docs/developer/api/contracts/marketplace/interfaces/INonceManager.md create mode 100644 docs/docs/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md create mode 100644 docs/docs/developer/api/contracts/marketplace/interfaces/IStrategy.md create mode 100644 docs/docs/developer/api/contracts/marketplace/interfaces/IStrategyManager.md create mode 100644 docs/docs/developer/api/contracts/marketplace/interfaces/ITransferManager.md create mode 100644 docs/docs/developer/api/contracts/marketplace/libraries/CurrencyValidator.md create mode 100644 docs/docs/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md create mode 100644 docs/docs/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md create mode 100644 docs/docs/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md create mode 100644 docs/docs/developer/api/contracts/marketplace/libraries/OrderStructs.md create mode 100644 docs/docs/developer/api/contracts/protocol/AllowlistMinter.md create mode 100644 docs/docs/developer/api/contracts/protocol/HypercertMinter.md create mode 100644 docs/docs/developer/api/contracts/protocol/SemiFungible1155.md create mode 100644 docs/docs/developer/api/contracts/protocol/interfaces/IAllowlist.md create mode 100644 docs/docs/developer/api/contracts/protocol/interfaces/IHypercertToken.md create mode 100644 docs/docs/developer/api/contracts/protocol/libs/Errors.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/about.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/allowlists.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/AllowlistMinter.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/HypercertMinter.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/HypercertTrader.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/IHypercertMinter.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/SemiFungible1155.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/ainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/forge-std/src/console.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/forge-std/src/console2.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/interfaces/IAllowlist.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/interfaces/IHypercertToken.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/interfaces/IHypercertTrader.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/libs/Errors.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/CurrencyManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/ExecutionManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/InheritedStrategy.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/LooksRareProtocol.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/NonceManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/ProtocolFeeRecipient.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/StrategyManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/TransferManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/TransferSelectorNFT.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IExecutionManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/INonceManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IStrategy.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IStrategyManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ITransferManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/CurrencyValidator.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/OrderStructs.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/AllowlistMinter.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/HypercertMinter.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/SemiFungible1155.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/interfaces/IAllowlist.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/interfaces/IHypercertToken.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/libs/Errors.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/.nojekyll create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/README.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/ClientError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/ConfigurationError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/FetchError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/HypercertClient.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/HypercertsStorage.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/InvalidOrMissingError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/MalformedDataError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/MintingError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/StorageError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/UnknownSchemaError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/UnsupportedChainError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/internal.default-1.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/internal.default-2.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/internal.default.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/CustomError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/DuplicateEvaluation.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/EASEvaluation.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClaimdata.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClientInterface.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClientMethods.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClientState.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertEvaluationSchema.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertIndexerInterface.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertMetadata.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertPointer.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertStorageInterface.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/IPFSEvaluation.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/SimpleTextEvaluation.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/internal.EvaluatorInterface.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/internal.HypercertClaimdata.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/internal.HypercertMinter.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/modules.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/modules/internal.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/burning.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/config.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/errors.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/evaluations.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/minting.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/querying.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/quickstart-javascript.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/quickstart-solidity.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/split-merge.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/developer/supported-networks.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/devops/deploy-proxy.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/devops/errors.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/devops/index.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/devops/pause.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/devops/plasmic.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/devops/setup.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/devops/upgrade.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/faq.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/further-resources.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/implementation/glossary.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/implementation/metadata.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/implementation/token-standard.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/intro.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/minting-guide/gitcoin-round.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/minting-guide/minting-guide-start.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/minting-guide/step-by-step.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/evaluation.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/hypercerts-intro.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/ifs.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/impact-space.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/retrospective-funding.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/whitepaper-intro.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/about.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/allowlists.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/AllowlistMinter.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/HypercertMinter.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/HypercertTrader.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/IHypercertMinter.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/SemiFungible1155.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/ainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/forge-std/src/console.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/forge-std/src/console2.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/interfaces/IAllowlist.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/interfaces/IHypercertToken.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/interfaces/IHypercertTrader.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/libs/Errors.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/CurrencyManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/ExecutionManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/InheritedStrategy.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/LooksRareProtocol.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/NonceManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/ProtocolFeeRecipient.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/StrategyManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/TransferManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/TransferSelectorNFT.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IExecutionManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/INonceManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IStrategy.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IStrategyManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ITransferManager.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/CurrencyValidator.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/OrderStructs.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/AllowlistMinter.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/HypercertMinter.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/SemiFungible1155.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/interfaces/IAllowlist.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/interfaces/IHypercertToken.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/libs/Errors.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/.nojekyll create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/README.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/ClientError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/ConfigurationError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/FetchError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/HypercertClient.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/HypercertsStorage.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/InvalidOrMissingError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/MalformedDataError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/MintingError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/StorageError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/UnknownSchemaError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/UnsupportedChainError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/internal.default-1.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/internal.default-2.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/internal.default.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/CustomError.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/DuplicateEvaluation.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/EASEvaluation.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClaimdata.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClientInterface.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClientMethods.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClientState.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertEvaluationSchema.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertIndexerInterface.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertMetadata.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertPointer.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertStorageInterface.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/IPFSEvaluation.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/SimpleTextEvaluation.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/internal.EvaluatorInterface.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/internal.HypercertClaimdata.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/internal.HypercertMinter.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/modules.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/modules/internal.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/burning.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/config.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/errors.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/evaluations.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/minting.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/querying.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/quickstart-javascript.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/quickstart-solidity.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/split-merge.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/developer/supported-networks.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/devops/deploy-proxy.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/devops/errors.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/devops/index.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/devops/pause.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/devops/plasmic.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/devops/setup.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/devops/upgrade.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/faq.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/further-resources.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/implementation/glossary.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/implementation/metadata.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/implementation/token-standard.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/intro.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/minting-guide/gitcoin-round.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/minting-guide/minting-guide-start.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/minting-guide/step-by-step.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/evaluation.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/hypercerts-intro.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/ifs.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/impact-space.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/retrospective-funding.md create mode 100644 docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/whitepaper-intro.md create mode 100644 docs/versioned_sidebars/version-1.0.0-alpha.0-sidebars.json create mode 100644 docs/versioned_sidebars/version-1.0.0-alpha.1-sidebars.json delete mode 100644 frontend/components/blueprint-create.tsx delete mode 100644 frontend/components/contribution-blueprint-create.tsx create mode 100644 frontend/components/transfer-fraction-button.tsx delete mode 100644 frontend/hooks/claims.ts create mode 100644 frontend/hooks/readTransferRestriction.ts create mode 100644 frontend/hooks/transferFraction.ts create mode 100644 graph/.eslintrc.yml create mode 100644 graph/tests/hypercert-minter-burn.test.ts delete mode 100644 sdk/global.d.ts delete mode 100644 sdk/jest.config.ts delete mode 100644 sdk/src/evaluations/eas.ts create mode 100644 sdk/src/utils/adapters.ts create mode 100644 sdk/src/utils/allowlist.ts create mode 100644 sdk/src/utils/fetchers.ts create mode 100644 sdk/src/utils/index.ts delete mode 100644 sdk/test/evaluations/easEvaluator.test.ts create mode 100644 sdk/test/resources/HypercertMinter.json create mode 100644 sdk/test/utils/allowlist.test.ts create mode 100644 sdk/test/utils/fetchers.test.ts create mode 100644 sdk/vitest.config.mts diff --git a/.github/workflows/ci-default.yml b/.github/workflows/ci-default.yml index a7242d72..a52e21bf 100644 --- a/.github/workflows/ci-default.yml +++ b/.github/workflows/ci-default.yml @@ -7,27 +7,22 @@ env: NEXT_PUBLIC_DEFAULT_CHAIN_ID: ${{ vars.NEXT_PUBLIC_DEFAULT_CHAIN_ID }} NEXT_PUBLIC_CONTRACT_ADDRESS: ${{ vars.NEXT_PUBLIC_CONTRACT_ADDRESS }} NEXT_PUBLIC_GRAPH_URL: ${{ vars.NEXT_PUBLIC_GRAPH_URL }} + NFT_STORAGE_TOKEN: ${{ secrets.NEXT_PUBLIC_NFT_STORAGE_TOKEN }} + WEB3_STORAGE_TOKEN: ${{ secrets.NEXT_PUBLIC_NFT_STORAGE_TOKEN }} NEXT_PUBLIC_NFT_STORAGE_TOKEN: ${{ secrets.NEXT_PUBLIC_NFT_STORAGE_TOKEN }} NEXT_PUBLIC_WEB3_STORAGE_TOKEN: ${{ secrets.NEXT_PUBLIC_NFT_STORAGE_TOKEN }} NEXT_PUBLIC_SUPABASE_URL: ${{ vars.NEXT_PUBLIC_SUPABASE_URL }} NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }} NEXT_PUBLIC_SUPABASE_TABLE: ${{ vars.NEXT_PUBLIC_SUPABASE_TABLE }} NEXT_PUBLIC_WALLETCONNECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_ID }} + INFURA_API_KEY: ${{ vars.INFURA_API_KEY }} + ALCHEMY_API_KEY: ${{ vars.ALCHEMY_API_KEY }} DOCKER_PLATFORM: "amd64" # Trigger the workflow when: on: # A push occurs to one of the matched branches. push: - branches: - - main - - develop - # Or when a pull request event occurs for a pull request against one of the - # matched branches. - pull_request: - branches: - - main - - develop # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 33c3be37..8a81eda9 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -13,14 +13,6 @@ env: # Trigger the workflow when: on: - push: - branches: - - main - # Or when a pull request event occurs for a pull request against one of the - # matched branches. - pull_request: - branches: - - main # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.lintstagedignore b/.lintstagedignore new file mode 100644 index 00000000..339baae4 --- /dev/null +++ b/.lintstagedignore @@ -0,0 +1,10 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# root config +playwright.config.ts + +# patterns +graph/generated/ +e2e +docs +vendor \ No newline at end of file diff --git a/.lintstagedrc b/.lintstagedrc index 327ce68e..ad678de5 100644 --- a/.lintstagedrc +++ b/.lintstagedrc @@ -1,6 +1,6 @@ { "**/*.{js,jsx,ts,tsx,sol}": [ - "eslint --ignore-path .gitignore --ignore-pattern sdk/ --ignore-pattern graph/generated/", + "eslint --ignore-path .gitignore --ignore-path .lintstagedignore", "prettier --write" ], "**/*.{md,json}": ["prettier --write"] diff --git a/LICENSE b/LICENSE index 261eeb9e..dba11665 100644 --- a/LICENSE +++ b/LICENSE @@ -1,201 +1,4 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ +This project is dual licensed under MIT and Apache-2.0. - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +MIT: https://www.opensource.org/licenses/mit +Apache-2.0: https://www.apache.org/licenses/license-2.0 \ No newline at end of file diff --git a/LICENSE-APACHE b/LICENSE-APACHE new file mode 100644 index 00000000..103c2143 --- /dev/null +++ b/LICENSE-APACHE @@ -0,0 +1,13 @@ +Copyright 2023 Hypercerts Foundation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/LICENSE-MIT b/LICENSE-MIT new file mode 100644 index 00000000..d67b8580 --- /dev/null +++ b/LICENSE-MIT @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright © 2023 Hypercerts Foundation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/contracts/.env.example b/contracts/.env.example index b7c57fac..235bb631 100644 --- a/contracts/.env.example +++ b/contracts/.env.example @@ -2,7 +2,7 @@ MNEMONIC="test test test test test test test test test test test junk" MNEMONIC_CELO=="test test test test test test test test test test test junk" INFURA_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" -ALCHEMY_OPTIMISM_URL="https://opt-mainnet.g.alchemy.com/v2/zzzzzzzzzzzzzzzzzzz" +ALCHEMY_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" # OpenZeppelin OPENZEPPELIN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" @@ -14,6 +14,13 @@ OPTIMISTIC_ETHERSCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" CELOSCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" # Unused, ignore below -POLYGONSCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" REPORT_GAS=false CMC_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" + +# Marketplace +OWNER_ADDRESS="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +TRANSFER_MANAGER_SALT="bbbbbbbbbbbbbb" +LOOKSRARE_PROTOCOL_SALT="cccccccccccccc" +STRATEGY_COLLECTION_OFFER_SALT="dddddddddddddd" +PROTOCOL_FEE_RECIPIENT_ADDRESS="eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" + diff --git a/contracts/.eslintrc.yml b/contracts/.eslintrc.yml index a6c77c81..bc63dc32 100644 --- a/contracts/.eslintrc.yml +++ b/contracts/.eslintrc.yml @@ -8,13 +8,3 @@ parserOptions: project: "./contracts/tsconfig.json" plugins: - "@typescript-eslint" -rules: - "@typescript-eslint/no-floating-promises": - - error - - ignoreIIFE: true - ignoreVoid: true - "@typescript-eslint/no-inferrable-types": "off" - "@typescript-eslint/no-unused-vars": - - error - - argsIgnorePattern: "_" - varsIgnorePattern: "_" diff --git a/contracts/.gitignore b/contracts/.gitignore index 41c2623f..2d812b19 100644 --- a/contracts/.gitignore +++ b/contracts/.gitignore @@ -18,7 +18,7 @@ **/deployments/localhost **/out* **/typechain -**/src/types +**/types **/cache** **/abi **/rollup-cache @@ -35,6 +35,7 @@ yarn-error.log* .DS_Store /.idea test*.svg +lcov.info # broadcasts !/broadcast diff --git a/contracts/.lintstagedrc b/contracts/.lintstagedrc index 45a7492d..0e2564c9 100644 --- a/contracts/.lintstagedrc +++ b/contracts/.lintstagedrc @@ -1,5 +1,4 @@ { - "*.{js,json,md,sol,ts,yml}": [ - "prettier --config ./.prettierrc.yml --write" - ] + "*.{js,json,md,ts,yml}": ["prettier --config ./.prettierrc.yml --write"], + "*.{sol}": ["forge fmt"] } diff --git a/contracts/.openzeppelin/goerli.json b/contracts/.openzeppelin/goerli.json index e9968158..4058c77b 100644 --- a/contracts/.openzeppelin/goerli.json +++ b/contracts/.openzeppelin/goerli.json @@ -30,6 +30,11 @@ "address": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", "txHash": "0xeeb032f25fb656971f835204d0bd825f766593afadfe420110903420bb4f7071", "kind": "uups" + }, + { + "address": "0x689587461AA3103D3D7975c5e4B352Ab711C14C2", + "txHash": "0x236119a264468c853263e067fbde6781c2c4109a5a3027a9adcfdca56b9bdacb", + "kind": "uups" } ], "impls": { @@ -4403,6 +4408,1501 @@ } } } + }, + "a74a0b26cd000c4d5c3717e7e2b2c4060405bf4c2f315356073581f711bf134d": { + "address": "0xDb77A1fDC905685B4052a512522D502638DdA5E3", + "txHash": "0xfe64805f07143e91ce6d02ce69e95c21f688a0cc083495baafba764274de05ff", + "layout": { + "solcVersion": "0.8.16", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_balances", + "offset": 0, + "slot": "101", + "type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:25" + }, + { + "label": "_operatorApprovals", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_address,t_mapping(t_address,t_bool))", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:28" + }, + { + "label": "_uri", + "offset": 0, + "slot": "103", + "type": "t_string_storage", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:31" + }, + { + "label": "__gap", + "offset": 0, + "slot": "104", + "type": "t_array(t_uint256)47_storage", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:528" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1155BurnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol:52" + }, + { + "label": "_baseURI", + "offset": 0, + "slot": "201", + "type": "t_string_storage", + "contract": "ERC1155URIStorageUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol:27" + }, + { + "label": "_tokenURIs", + "offset": 0, + "slot": "202", + "type": "t_mapping(t_uint256,t_string_storage)", + "contract": "ERC1155URIStorageUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol:30" + }, + { + "label": "__gap", + "offset": 0, + "slot": "203", + "type": "t_array(t_uint256)48_storage", + "contract": "ERC1155URIStorageUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol:77" + }, + { + "label": "_owner", + "offset": 0, + "slot": "251", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:94" + }, + { + "label": "__gap", + "offset": 0, + "slot": "301", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:211" + }, + { + "label": "__gap", + "offset": 0, + "slot": "351", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol:107" + }, + { + "label": "typeCounter", + "offset": 0, + "slot": "401", + "type": "t_uint256", + "contract": "SemiFungible1155", + "src": "src/SemiFungible1155.sol:27" + }, + { + "label": "owners", + "offset": 0, + "slot": "402", + "type": "t_mapping(t_uint256,t_address)", + "contract": "SemiFungible1155", + "src": "src/SemiFungible1155.sol:38" + }, + { + "label": "creators", + "offset": 0, + "slot": "403", + "type": "t_mapping(t_uint256,t_address)", + "contract": "SemiFungible1155", + "src": "src/SemiFungible1155.sol:41" + }, + { + "label": "tokenValues", + "offset": 0, + "slot": "404", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "SemiFungible1155", + "src": "src/SemiFungible1155.sol:44" + }, + { + "label": "maxIndex", + "offset": 0, + "slot": "405", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "SemiFungible1155", + "src": "src/SemiFungible1155.sol:47" + }, + { + "label": "__gap", + "offset": 0, + "slot": "406", + "type": "t_array(t_uint256)25_storage", + "contract": "SemiFungible1155", + "src": "src/SemiFungible1155.sol:612" + }, + { + "label": "merkleRoots", + "offset": 0, + "slot": "431", + "type": "t_mapping(t_uint256,t_bytes32)", + "contract": "AllowlistMinter", + "src": "src/AllowlistMinter.sol:17" + }, + { + "label": "hasBeenClaimed", + "offset": 0, + "slot": "432", + "type": "t_mapping(t_uint256,t_mapping(t_bytes32,t_bool))", + "contract": "AllowlistMinter", + "src": "src/AllowlistMinter.sol:18" + }, + { + "label": "maxUnits", + "offset": 0, + "slot": "433", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "AllowlistMinter", + "src": "src/AllowlistMinter.sol:19" + }, + { + "label": "minted", + "offset": 0, + "slot": "434", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "AllowlistMinter", + "src": "src/AllowlistMinter.sol:20" + }, + { + "label": "__gap", + "offset": 0, + "slot": "435", + "type": "t_array(t_uint256)26_storage", + "contract": "AllowlistMinter", + "src": "src/AllowlistMinter.sol:69" + }, + { + "label": "_paused", + "offset": 0, + "slot": "461", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "462", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:116" + }, + { + "label": "typeRestrictions", + "offset": 0, + "slot": "511", + "type": "t_mapping(t_uint256,t_enum(TransferRestrictions)6957)", + "contract": "HypercertMinter", + "src": "src/HypercertMinter.sol:20" + }, + { + "label": "__gap", + "offset": 0, + "slot": "512", + "type": "t_array(t_uint256)29_storage", + "contract": "HypercertMinter", + "src": "src/HypercertMinter.sol:246" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)25_storage": { + "label": "uint256[25]", + "numberOfBytes": "800" + }, + "t_array(t_uint256)26_storage": { + "label": "uint256[26]", + "numberOfBytes": "832" + }, + "t_array(t_uint256)29_storage": { + "label": "uint256[29]", + "numberOfBytes": "928" + }, + "t_array(t_uint256)47_storage": { + "label": "uint256[47]", + "numberOfBytes": "1504" + }, + "t_array(t_uint256)48_storage": { + "label": "uint256[48]", + "numberOfBytes": "1536" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_enum(TransferRestrictions)6957": { + "label": "enum IHypercertToken.TransferRestrictions", + "members": [ + "AllowAll", + "DisallowAll", + "FromCreatorOnly" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_address,t_bool))": { + "label": "mapping(address => mapping(address => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bool)": { + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_address)": { + "label": "mapping(uint256 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_bytes32)": { + "label": "mapping(uint256 => bytes32)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_enum(TransferRestrictions)6957)": { + "label": "mapping(uint256 => enum IHypercertToken.TransferRestrictions)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_mapping(t_address,t_uint256))": { + "label": "mapping(uint256 => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_mapping(t_bytes32,t_bool))": { + "label": "mapping(uint256 => mapping(bytes32 => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_string_storage)": { + "label": "mapping(uint256 => string)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_uint256)": { + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "d1832c305d4610ff816070ba0b32f8fcbb0e86cead29b4261acf08bd5c0836e6": { + "address": "0x8561eAE9962FA3af19e2E972Ea717d4AD407BDbF", + "txHash": "0x0bcef85a53eb6fdec51cfa3c817e013b1ecf19f0a9387384202fae0ef66985a2", + "layout": { + "solcVersion": "0.8.16", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:116" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:211" + }, + { + "label": "__gap", + "offset": 0, + "slot": "201", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol:107" + }, + { + "label": "totalUnitsForSale", + "offset": 0, + "slot": "251", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))", + "contract": "HypercertTrader", + "src": "src/HypercertTrader.sol:30" + }, + { + "label": "offers", + "offset": 0, + "slot": "252", + "type": "t_mapping(t_uint256,t_struct(Offer)7905_storage)", + "contract": "HypercertTrader", + "src": "src/HypercertTrader.sol:31" + }, + { + "label": "_offerCounter", + "offset": 0, + "slot": "253", + "type": "t_uint256", + "contract": "HypercertTrader", + "src": "src/HypercertTrader.sol:32" + }, + { + "label": "__gap", + "offset": 0, + "slot": "254", + "type": "t_array(t_uint256)27_storage", + "contract": "HypercertTrader", + "src": "src/HypercertTrader.sol:359" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(AcceptedToken)7917_storage)dyn_storage": { + "label": "struct IHypercertTrader.AcceptedToken[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)27_storage": { + "label": "uint256[27]", + "numberOfBytes": "864" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_enum(OfferStatus)7912": { + "label": "enum IHypercertTrader.OfferStatus", + "members": [ + "Open", + "Fulfilled", + "Cancelled" + ], + "numberOfBytes": "1" + }, + "t_enum(OfferType)7908": { + "label": "enum IHypercertTrader.OfferType", + "members": [ + "Units", + "Fraction" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_uint256))": { + "label": "mapping(address => mapping(uint256 => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Offer)7905_storage)": { + "label": "mapping(uint256 => struct IHypercertTrader.Offer)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_uint256)": { + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(AcceptedToken)7917_storage": { + "label": "struct IHypercertTrader.AcceptedToken", + "members": [ + { + "label": "token", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "minimumAmountPerUnit", + "type": "t_uint256", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Offer)7905_storage": { + "label": "struct IHypercertTrader.Offer", + "members": [ + { + "label": "offerer", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "hypercertContract", + "type": "t_address", + "offset": 0, + "slot": "1" + }, + { + "label": "fractionID", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "unitsAvailable", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "minUnitsPerTrade", + "type": "t_uint256", + "offset": 0, + "slot": "4" + }, + { + "label": "maxUnitsPerTrade", + "type": "t_uint256", + "offset": 0, + "slot": "5" + }, + { + "label": "offerType", + "type": "t_enum(OfferType)7908", + "offset": 0, + "slot": "6" + }, + { + "label": "status", + "type": "t_enum(OfferStatus)7912", + "offset": 1, + "slot": "6" + }, + { + "label": "acceptedTokens", + "type": "t_array(t_struct(AcceptedToken)7917_storage)dyn_storage", + "offset": 0, + "slot": "7" + } + ], + "numberOfBytes": "256" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "dd332b99b39b573f44ffeb5c8685891923934c7ddf4763cc7767f224483eff8a": { + "address": "0x0A00a2f09cd37B24E7429c5238323bfebCfF3Ed9", + "txHash": "0xa2c8831ddf933b36362efd3e4cd6a0f2ba640d0a4908f3f97ae43c4661077ead", + "layout": { + "solcVersion": "0.8.16", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_balances", + "offset": 0, + "slot": "101", + "type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:25" + }, + { + "label": "_operatorApprovals", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_address,t_mapping(t_address,t_bool))", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:28" + }, + { + "label": "_uri", + "offset": 0, + "slot": "103", + "type": "t_string_storage", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:31" + }, + { + "label": "__gap", + "offset": 0, + "slot": "104", + "type": "t_array(t_uint256)47_storage", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:528" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1155BurnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol:52" + }, + { + "label": "_baseURI", + "offset": 0, + "slot": "201", + "type": "t_string_storage", + "contract": "ERC1155URIStorageUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol:27" + }, + { + "label": "_tokenURIs", + "offset": 0, + "slot": "202", + "type": "t_mapping(t_uint256,t_string_storage)", + "contract": "ERC1155URIStorageUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol:30" + }, + { + "label": "__gap", + "offset": 0, + "slot": "203", + "type": "t_array(t_uint256)48_storage", + "contract": "ERC1155URIStorageUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol:77" + }, + { + "label": "_owner", + "offset": 0, + "slot": "251", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:94" + }, + { + "label": "__gap", + "offset": 0, + "slot": "301", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:211" + }, + { + "label": "__gap", + "offset": 0, + "slot": "351", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol:107" + }, + { + "label": "typeCounter", + "offset": 0, + "slot": "401", + "type": "t_uint256", + "contract": "SemiFungible1155", + "src": "src/SemiFungible1155.sol:27" + }, + { + "label": "owners", + "offset": 0, + "slot": "402", + "type": "t_mapping(t_uint256,t_address)", + "contract": "SemiFungible1155", + "src": "src/SemiFungible1155.sol:38" + }, + { + "label": "creators", + "offset": 0, + "slot": "403", + "type": "t_mapping(t_uint256,t_address)", + "contract": "SemiFungible1155", + "src": "src/SemiFungible1155.sol:41" + }, + { + "label": "tokenValues", + "offset": 0, + "slot": "404", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "SemiFungible1155", + "src": "src/SemiFungible1155.sol:44" + }, + { + "label": "maxIndex", + "offset": 0, + "slot": "405", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "SemiFungible1155", + "src": "src/SemiFungible1155.sol:47" + }, + { + "label": "__gap", + "offset": 0, + "slot": "406", + "type": "t_array(t_uint256)25_storage", + "contract": "SemiFungible1155", + "src": "src/SemiFungible1155.sol:612" + }, + { + "label": "merkleRoots", + "offset": 0, + "slot": "431", + "type": "t_mapping(t_uint256,t_bytes32)", + "contract": "AllowlistMinter", + "src": "src/AllowlistMinter.sol:17" + }, + { + "label": "hasBeenClaimed", + "offset": 0, + "slot": "432", + "type": "t_mapping(t_uint256,t_mapping(t_bytes32,t_bool))", + "contract": "AllowlistMinter", + "src": "src/AllowlistMinter.sol:18" + }, + { + "label": "maxUnits", + "offset": 0, + "slot": "433", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "AllowlistMinter", + "src": "src/AllowlistMinter.sol:19" + }, + { + "label": "minted", + "offset": 0, + "slot": "434", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "AllowlistMinter", + "src": "src/AllowlistMinter.sol:20" + }, + { + "label": "__gap", + "offset": 0, + "slot": "435", + "type": "t_array(t_uint256)26_storage", + "contract": "AllowlistMinter", + "src": "src/AllowlistMinter.sol:69" + }, + { + "label": "_paused", + "offset": 0, + "slot": "461", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "462", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:116" + }, + { + "label": "typeRestrictions", + "offset": 0, + "slot": "511", + "type": "t_mapping(t_uint256,t_enum(TransferRestrictions)7777)", + "contract": "HypercertMinter", + "src": "src/HypercertMinter.sol:20" + }, + { + "label": "__gap", + "offset": 0, + "slot": "512", + "type": "t_array(t_uint256)29_storage", + "contract": "HypercertMinter", + "src": "src/HypercertMinter.sol:246" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)25_storage": { + "label": "uint256[25]", + "numberOfBytes": "800" + }, + "t_array(t_uint256)26_storage": { + "label": "uint256[26]", + "numberOfBytes": "832" + }, + "t_array(t_uint256)29_storage": { + "label": "uint256[29]", + "numberOfBytes": "928" + }, + "t_array(t_uint256)47_storage": { + "label": "uint256[47]", + "numberOfBytes": "1504" + }, + "t_array(t_uint256)48_storage": { + "label": "uint256[48]", + "numberOfBytes": "1536" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_enum(TransferRestrictions)7777": { + "label": "enum IHypercertToken.TransferRestrictions", + "members": [ + "AllowAll", + "DisallowAll", + "FromCreatorOnly" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_address,t_bool))": { + "label": "mapping(address => mapping(address => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bool)": { + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_address)": { + "label": "mapping(uint256 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_bytes32)": { + "label": "mapping(uint256 => bytes32)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_enum(TransferRestrictions)7777)": { + "label": "mapping(uint256 => enum IHypercertToken.TransferRestrictions)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_mapping(t_address,t_uint256))": { + "label": "mapping(uint256 => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_mapping(t_bytes32,t_bool))": { + "label": "mapping(uint256 => mapping(bytes32 => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_string_storage)": { + "label": "mapping(uint256 => string)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_uint256)": { + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "18f4479dd70171f19657f8c092580a0d6e9ec28cf1867e45d3e9e87aff3e1ee2": { + "address": "0xFf3F27c6132c30d1098b97FfeC05C3150dA90432", + "txHash": "0xaf2c9d0708fafea03a10da1e6b25f340c4a2847b09032d2890d40167496c7b49", + "layout": { + "solcVersion": "0.8.16", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:116" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:211" + }, + { + "label": "__gap", + "offset": 0, + "slot": "201", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol:107" + }, + { + "label": "totalUnitsForSale", + "offset": 0, + "slot": "251", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))", + "contract": "HypercertTrader", + "src": "src/HypercertTrader.sol:36" + }, + { + "label": "offers", + "offset": 0, + "slot": "252", + "type": "t_mapping(t_uint256,t_struct(Offer)2510_storage)", + "contract": "HypercertTrader", + "src": "src/HypercertTrader.sol:37" + }, + { + "label": "_offerCounter", + "offset": 0, + "slot": "253", + "type": "t_uint256", + "contract": "HypercertTrader", + "src": "src/HypercertTrader.sol:38" + }, + { + "label": "__gap", + "offset": 0, + "slot": "254", + "type": "t_array(t_uint256)27_storage", + "contract": "HypercertTrader", + "src": "src/HypercertTrader.sol:387" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(AcceptedToken)2522_storage)dyn_storage": { + "label": "struct IHypercertTrader.AcceptedToken[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)27_storage": { + "label": "uint256[27]", + "numberOfBytes": "864" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_enum(OfferStatus)2517": { + "label": "enum IHypercertTrader.OfferStatus", + "members": [ + "Open", + "Fulfilled", + "Cancelled" + ], + "numberOfBytes": "1" + }, + "t_enum(OfferType)2513": { + "label": "enum IHypercertTrader.OfferType", + "members": [ + "Units", + "Fraction" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_uint256))": { + "label": "mapping(address => mapping(uint256 => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Offer)2510_storage)": { + "label": "mapping(uint256 => struct IHypercertTrader.Offer)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_uint256)": { + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(AcceptedToken)2522_storage": { + "label": "struct IHypercertTrader.AcceptedToken", + "members": [ + { + "label": "token", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "minimumAmountPerUnit", + "type": "t_uint256", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Offer)2510_storage": { + "label": "struct IHypercertTrader.Offer", + "members": [ + { + "label": "offerer", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "hypercertContract", + "type": "t_address", + "offset": 0, + "slot": "1" + }, + { + "label": "fractionID", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "unitsAvailable", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "minUnitsPerTrade", + "type": "t_uint256", + "offset": 0, + "slot": "4" + }, + { + "label": "maxUnitsPerTrade", + "type": "t_uint256", + "offset": 0, + "slot": "5" + }, + { + "label": "offerType", + "type": "t_enum(OfferType)2513", + "offset": 0, + "slot": "6" + }, + { + "label": "status", + "type": "t_enum(OfferStatus)2517", + "offset": 1, + "slot": "6" + }, + { + "label": "acceptedTokens", + "type": "t_array(t_struct(AcceptedToken)2522_storage)dyn_storage", + "offset": 0, + "slot": "7" + } + ], + "numberOfBytes": "256" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "c448a5dca6b776aedb55eb5857ea7c6a03d1ccd3ff709786879396d71bf7dbb2": { + "address": "0x038c990018b9Aab4aA2496E592E668EAD77aF72B", + "txHash": "0xe07f42a41b70affd1fdd08ce8011f55a35b0e62a9ef67d0b5c4daa04b6028f60", + "layout": { + "solcVersion": "0.8.16", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:116" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:211" + }, + { + "label": "__gap", + "offset": 0, + "slot": "201", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol:107" + }, + { + "label": "totalUnitsForSale", + "offset": 0, + "slot": "251", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))", + "contract": "HypercertTrader", + "src": "src/HypercertTrader.sol:36" + }, + { + "label": "offers", + "offset": 0, + "slot": "252", + "type": "t_mapping(t_uint256,t_struct(Offer)8003_storage)", + "contract": "HypercertTrader", + "src": "src/HypercertTrader.sol:37" + }, + { + "label": "_offerCounter", + "offset": 0, + "slot": "253", + "type": "t_uint256", + "contract": "HypercertTrader", + "src": "src/HypercertTrader.sol:38" + }, + { + "label": "__gap", + "offset": 0, + "slot": "254", + "type": "t_array(t_uint256)27_storage", + "contract": "HypercertTrader", + "src": "src/HypercertTrader.sol:392" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(AcceptedToken)8015_storage)dyn_storage": { + "label": "struct IHypercertTrader.AcceptedToken[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)27_storage": { + "label": "uint256[27]", + "numberOfBytes": "864" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_enum(OfferStatus)8010": { + "label": "enum IHypercertTrader.OfferStatus", + "members": [ + "Open", + "Fulfilled", + "Cancelled" + ], + "numberOfBytes": "1" + }, + "t_enum(OfferType)8006": { + "label": "enum IHypercertTrader.OfferType", + "members": [ + "Units", + "Fraction" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_uint256))": { + "label": "mapping(address => mapping(uint256 => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Offer)8003_storage)": { + "label": "mapping(uint256 => struct IHypercertTrader.Offer)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_uint256)": { + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(AcceptedToken)8015_storage": { + "label": "struct IHypercertTrader.AcceptedToken", + "members": [ + { + "label": "token", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "minimumAmountPerUnit", + "type": "t_uint256", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Offer)8003_storage": { + "label": "struct IHypercertTrader.Offer", + "members": [ + { + "label": "offerer", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "hypercertContract", + "type": "t_address", + "offset": 0, + "slot": "1" + }, + { + "label": "fractionID", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "unitsAvailable", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "minUnitsPerTrade", + "type": "t_uint256", + "offset": 0, + "slot": "4" + }, + { + "label": "maxUnitsPerTrade", + "type": "t_uint256", + "offset": 0, + "slot": "5" + }, + { + "label": "offerType", + "type": "t_enum(OfferType)8006", + "offset": 0, + "slot": "6" + }, + { + "label": "status", + "type": "t_enum(OfferStatus)8010", + "offset": 1, + "slot": "6" + }, + { + "label": "acceptedTokens", + "type": "t_array(t_struct(AcceptedToken)8015_storage)dyn_storage", + "offset": 0, + "slot": "7" + } + ], + "numberOfBytes": "256" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/contracts/.prettierignore b/contracts/.prettierignore index 406d1f27..87bdd5b4 100644 --- a/contracts/.prettierignore +++ b/contracts/.prettierignore @@ -17,13 +17,15 @@ **/deployments **/.openzeppelin **/docs -**/src/abi/ +**/abi # files *.env *.log +*.sol .pnp.* coverage.json npm-debug.log* yarn-debug.log* yarn-error.log* +.DS_Store diff --git a/contracts/.prettierrc.yml b/contracts/.prettierrc.yml index 0f125e7c..b8ea7e0f 100644 --- a/contracts/.prettierrc.yml +++ b/contracts/.prettierrc.yml @@ -6,26 +6,3 @@ singleQuote: false tabWidth: 2 trailingComma: "all" useTabs: false - -plugins: - - prettier-plugin-solidity - -overrides: - - files: "**/*.t.sol" - rules: - max-state-count": "off" - state-visibility": "off" - max-line-length": "off" - options: - tabWidth: 4 - - files: "*.sol" - rules: - compiler-version: "0.8.16" - options: - tabWidth: 4 - - files: "*.ts" - options: - importOrder: ["", "^[./]"] - importOrderParserPlugins: ["importAssertions", "typescript"] - importOrderSeparation: true - importOrderSortSpecifiers: true diff --git a/contracts/.solcover.js b/contracts/.solcover.js deleted file mode 100644 index a6b8e642..00000000 --- a/contracts/.solcover.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - istanbulReporter: ["html", "lcov"], - providerOptions: { - mnemonic: process.env.MNEMONIC, - }, - skipFiles: ["test", "mocks", "lib"], -}; diff --git a/contracts/.solhint.json b/contracts/.solhint.json index 48849103..142a2076 100644 --- a/contracts/.solhint.json +++ b/contracts/.solhint.json @@ -1,13 +1,14 @@ { - "plugins": ["prettier"], "extends": "solhint:recommended", "rules": { - "code-complexity": ["error", 8], - "compiler-version": ["error", "0.8.16"], + "avoid-low-level-calls": "off", + "code-complexity": ["error", 12], + "compiler-version": ["error", "0.8.17"], "func-visibility": ["error", { "ignoreConstructors": true }], - "max-line-length": ["error", 120], "no-console": "off", + "no-empty-blocks": "off", "not-rely-on-time": "off", + "private-vars-leading-underscore": "off", "reason-string": ["warn", { "maxLength": 64 }], "one-contract-per-file": "off" } diff --git a/contracts/.vscode/settings.json b/contracts/.vscode/settings.json index 5a74fb60..ea8a1e8a 100644 --- a/contracts/.vscode/settings.json +++ b/contracts/.vscode/settings.json @@ -1,10 +1,8 @@ { "editor.formatOnSave": true, - "solidity.formatter": "prettier", "solidity.packageDefaultDependenciesContractsDirectory": "src", "solidity.packageDefaultDependenciesDirectory": "lib", "solidity.remappings": ["./remappings.txt"], - "solidity.defaultCompiler": "remoteFile", "files.exclude": { "**/.git": true, "**/.svn": true, diff --git a/contracts/LICENSE b/contracts/LICENSE new file mode 100644 index 00000000..dba11665 --- /dev/null +++ b/contracts/LICENSE @@ -0,0 +1,4 @@ +This project is dual licensed under MIT and Apache-2.0. + +MIT: https://www.opensource.org/licenses/mit +Apache-2.0: https://www.apache.org/licenses/license-2.0 \ No newline at end of file diff --git a/contracts/LICENSE-APACHE b/contracts/LICENSE-APACHE new file mode 100644 index 00000000..d4cc5a41 --- /dev/null +++ b/contracts/LICENSE-APACHE @@ -0,0 +1,10 @@ +Copyright 2023 Hypercerts Foundation + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the +License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +language governing permissions and limitations under the License. diff --git a/contracts/LICENSE.md b/contracts/LICENSE-MIT similarity index 77% rename from contracts/LICENSE.md rename to contracts/LICENSE-MIT index 054bdbe3..4e9e555e 100644 --- a/contracts/LICENSE.md +++ b/contracts/LICENSE-MIT @@ -1,6 +1,11 @@ MIT License -Copyright (c) 2022 Paul Razvan Berg +Copyright (c) 2022 Hypercerts Foundation: Hypercerts protocol and marketplace. + +Copyright (c) 2022 LooksRare for portions of marketplace: https://github.com/LooksRare/contracts-exchange-v2 commit: +7fca565 + +Copyright (c) 2022 Paul Razvan Berg for inital template: https://github.com/paulrberg/foundry-template Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the diff --git a/contracts/README.md b/contracts/README.md index 6320a762..fc293242 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -88,7 +88,7 @@ yarn hardhat deploy --network goerli To transfer ownership of the proxy contract for upgrades, run the following: ```sh -yarn hardhat transfer-owner --network goerli --proxy PROXY_CONTRACT_ADDRESS --owner NEW_OWNER_ADDRESS +yarn hardhat transfer-owner-minter --network goerli --proxy PROXY_CONTRACT_ADDRESS --owner NEW_OWNER_ADDRESS ``` This is typically done to transfer control to a multi-sig (i.e. Gnosis Safe). @@ -110,7 +110,7 @@ Propose an upgrade via OpenZeppelin Defender. For more information, see this ```sh yarn build:hardhat -yarn hardhat propose-upgrade --network goerli --proxy PROXY_CONTRACT_ADDRESS --multisig OWNER_MULTISIG_ADDRESS +yarn hardhat propose-upgrade-minter --network goerli --proxy PROXY_CONTRACT_ADDRESS --multisig OWNER_MULTISIG_ADDRESS ``` This will output an OpenZeppelin URL that multi-sig members can use to approve/reject the upgrade. diff --git a/contracts/contracts/AllowlistMinter.sol b/contracts/contracts/AllowlistMinter.sol index 576b45ee..599831cb 100644 --- a/contracts/contracts/AllowlistMinter.sol +++ b/contracts/contracts/AllowlistMinter.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.16; -import { MerkleProofUpgradeable } from "oz-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; -import { IAllowlist } from "./interfaces/IAllowlist.sol"; +import {MerkleProofUpgradeable} from "oz-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; +import {IAllowlist} from "./interfaces/IAllowlist.sol"; -import { Errors } from "./libs/Errors.sol"; +import {Errors} from "./libs/Errors.sol"; /// @title Interface for hypercert token interactions /// @author bitbeckers @@ -19,11 +19,11 @@ contract AllowlistMinter is IAllowlist { mapping(uint256 => uint256) internal maxUnits; mapping(uint256 => uint256) internal minted; - function isAllowedToClaim( - bytes32[] calldata proof, - uint256 claimID, - bytes32 leaf - ) external view returns (bool isAllowed) { + function isAllowedToClaim(bytes32[] calldata proof, uint256 claimID, bytes32 leaf) + external + view + returns (bool isAllowed) + { if (merkleRoots[claimID].length == 0) revert Errors.DoesNotExist(); isAllowed = MerkleProofUpgradeable.verifyCalldata(proof, merkleRoots[claimID], leaf); } @@ -44,8 +44,8 @@ contract AllowlistMinter is IAllowlist { if (hasBeenClaimed[claimID][leaf]) revert Errors.AlreadyClaimed(); if ( - !MerkleProofUpgradeable.verifyCalldata(proof, merkleRoots[claimID], leaf) || - (minted[claimID] + amount) > maxUnits[claimID] + !MerkleProofUpgradeable.verifyCalldata(proof, merkleRoots[claimID], leaf) + || (minted[claimID] + amount) > maxUnits[claimID] ) revert Errors.Invalid(); hasBeenClaimed[claimID][leaf] = true; diff --git a/contracts/contracts/HypercertMinter.sol b/contracts/contracts/HypercertMinter.sol index 917c02c5..4679ddb3 100644 --- a/contracts/contracts/HypercertMinter.sol +++ b/contracts/contracts/HypercertMinter.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.16; -import { IHypercertToken } from "./interfaces/IHypercertToken.sol"; -import { SemiFungible1155 } from "./SemiFungible1155.sol"; -import { AllowlistMinter } from "./AllowlistMinter.sol"; -import { PausableUpgradeable } from "oz-upgradeable/security/PausableUpgradeable.sol"; +import {IHypercertToken} from "./interfaces/IHypercertToken.sol"; +import {SemiFungible1155} from "./SemiFungible1155.sol"; +import {AllowlistMinter} from "./AllowlistMinter.sol"; +import {PausableUpgradeable} from "oz-upgradeable/security/PausableUpgradeable.sol"; -import { Errors } from "./libs/Errors.sol"; +import {Errors} from "./libs/Errors.sol"; /// @title Contract for managing hypercert claims and whitelists /// @author bitbeckers @@ -37,12 +37,11 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, /// @notice Mint a semi-fungible token for the impact claim referenced via `uri` /// @dev see {IHypercertToken} - function mintClaim( - address account, - uint256 units, - string memory _uri, - TransferRestrictions restrictions - ) external override whenNotPaused { + function mintClaim(address account, uint256 units, string memory _uri, TransferRestrictions restrictions) + external + override + whenNotPaused + { // This enables us to release this restriction in the future if (msg.sender != account) revert Errors.NotAllowed(); uint256 claimID = _mintNewTypeWithToken(account, units, _uri); @@ -72,12 +71,10 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, /// @notice Mint a semi-fungible token representing a fraction of the claim /// @dev Calls AllowlistMinter to verify `proof`. /// @dev Mints the `amount` of units for the hypercert stored under `claimID` - function mintClaimFromAllowlist( - address account, - bytes32[] calldata proof, - uint256 claimID, - uint256 units - ) external whenNotPaused { + function mintClaimFromAllowlist(address account, bytes32[] calldata proof, uint256 claimID, uint256 units) + external + whenNotPaused + { _processClaim(proof, claimID, units); _mintToken(account, claimID, units); } @@ -92,7 +89,7 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, uint256[] calldata units ) external whenNotPaused { uint256 len = claimIDs.length; - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { _processClaim(proofs[i], claimIDs[i], units[i]); unchecked { ++i; @@ -119,11 +116,10 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, /// @notice Split a claimtokens value into parts with summed value equal to the original /// @dev see {IHypercertToken} - function splitFraction( - address _account, - uint256 _tokenID, - uint256[] calldata _newFractions - ) external whenNotPaused { + function splitFraction(address _account, uint256 _tokenID, uint256[] calldata _newFractions) + external + whenNotPaused + { _splitTokenUnits(_account, _tokenID, _newFractions); } @@ -162,7 +158,12 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, /// METADATA /// @dev see { IHypercertMetadata} - function uri(uint256 tokenID) public view override(IHypercertToken, SemiFungible1155) returns (string memory _uri) { + function uri(uint256 tokenID) + public + view + override(IHypercertToken, SemiFungible1155) + returns (string memory _uri) + { _uri = SemiFungible1155.uri(tokenID); } @@ -204,7 +205,7 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, // Transfer case, where to and from are non-zero uint256 len = ids.length; - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { uint256 typeID = getBaseType(ids[i]); TransferRestrictions policy = typeRestrictions[typeID]; if (policy == TransferRestrictions.DisallowAll) { diff --git a/contracts/contracts/SemiFungible1155.sol b/contracts/contracts/SemiFungible1155.sol index cd88714a..1add3178 100644 --- a/contracts/contracts/SemiFungible1155.sol +++ b/contracts/contracts/SemiFungible1155.sol @@ -3,13 +3,13 @@ // https://github.com/enjin/erc-1155/blob/master/contracts/ERC1155MixedFungibleMintable.sol pragma solidity 0.8.16; -import { ERC1155Upgradeable } from "oz-upgradeable/token/ERC1155/ERC1155Upgradeable.sol"; -import { ERC1155BurnableUpgradeable } from "oz-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol"; -import { ERC1155URIStorageUpgradeable } from "oz-upgradeable/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol"; -import { OwnableUpgradeable } from "oz-upgradeable/access/OwnableUpgradeable.sol"; -import { Initializable } from "oz-upgradeable/proxy/utils/Initializable.sol"; -import { UUPSUpgradeable } from "oz-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -import { Errors } from "./libs/Errors.sol"; +import {ERC1155Upgradeable} from "oz-upgradeable/token/ERC1155/ERC1155Upgradeable.sol"; +import {ERC1155BurnableUpgradeable} from "oz-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol"; +import {ERC1155URIStorageUpgradeable} from "oz-upgradeable/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol"; +import {OwnableUpgradeable} from "oz-upgradeable/access/OwnableUpgradeable.sol"; +import {Initializable} from "oz-upgradeable/proxy/utils/Initializable.sol"; +import {UUPSUpgradeable} from "oz-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import {Errors} from "./libs/Errors.sol"; /// @title Contract for minting semi-fungible EIP1155 tokens /// @author bitbeckers @@ -121,11 +121,10 @@ contract SemiFungible1155 is } /// @dev Mint a new token type and the initial units - function _mintNewTypeWithToken( - address _account, - uint256 _units, - string memory _uri - ) internal returns (uint256 typeID) { + function _mintNewTypeWithToken(address _account, uint256 _units, string memory _uri) + internal + returns (uint256 typeID) + { if (_units == 0) { revert Errors.NotAllowed(); } @@ -140,11 +139,10 @@ contract SemiFungible1155 is } /// @dev Mint a new token type and the initial fractions - function _mintNewTypeWithTokens( - address _account, - uint256[] calldata _fractions, - string memory _uri - ) internal returns (uint256 typeID) { + function _mintNewTypeWithTokens(address _account, uint256[] calldata _fractions, string memory _uri) + internal + returns (uint256 typeID) + { typeID = _mintNewTypeWithToken(_account, _getSum(_fractions), _uri); _splitTokenUnits(_account, typeID + maxIndex[typeID], _fractions); } @@ -167,18 +165,17 @@ contract SemiFungible1155 is /// @dev Mint new tokens for existing types /// @notice Enables batch claiming from multiple allowlists - function _batchMintTokens( - address _account, - uint256[] calldata _typeIDs, - uint256[] calldata _units - ) internal returns (uint256[] memory tokenIDs) { + function _batchMintTokens(address _account, uint256[] calldata _typeIDs, uint256[] calldata _units) + internal + returns (uint256[] memory tokenIDs) + { uint256 len = _typeIDs.length; tokenIDs = new uint256[](len); uint256[] memory amounts = new uint256[](len); uint256[] memory zeroes = new uint256[](len); - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { uint256 _typeID = _typeIDs[i]; if (!isBaseType(_typeID)) revert Errors.NotAllowed(); _notMaxItem(maxIndex[_typeID]); @@ -221,7 +218,7 @@ contract SemiFungible1155 is _valuesCache[len] = _valuesCache[0]; _valuesCache[0] = swapValue; - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { _notMaxItem(maxIndex[_typeID]); typeIDs[i] = _typeID; @@ -238,7 +235,7 @@ contract SemiFungible1155 is _beforeUnitTransfer(_msgSender(), _account, fromIDs, toIDs, values, ""); - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { valueLeft -= values[i]; tokenValues[toIDs[i]] = values[i]; @@ -272,7 +269,7 @@ contract SemiFungible1155 is uint256[] memory amounts = new uint256[](len); { - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { uint256 _fractionID = _fractionIDs[i]; fromIDs[i] = _fractionID; toIDs[i] = target; @@ -287,7 +284,7 @@ contract SemiFungible1155 is _beforeUnitTransfer(_msgSender(), _account, fromIDs, toIDs, values, ""); - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { _totalValue += values[i]; delete tokenValues[fromIDs[i]]; @@ -330,7 +327,7 @@ contract SemiFungible1155 is uint256 len = ids.length; - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { owners[ids[i]] = to; unchecked { ++i; @@ -348,7 +345,7 @@ contract SemiFungible1155 is ) internal virtual { uint256 len = fromIDs.length; - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { uint256 _from = fromIDs[i]; uint256 _to = toIDs[i]; @@ -365,9 +362,13 @@ contract SemiFungible1155 is /// @dev see { openzeppelin-contracts-upgradeable/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol } /// @dev Always returns the URI for the basetype so that it's managed in one place. - function uri( - uint256 tokenID - ) public view virtual override(ERC1155Upgradeable, ERC1155URIStorageUpgradeable) returns (string memory _uri) { + function uri(uint256 tokenID) + public + view + virtual + override(ERC1155Upgradeable, ERC1155URIStorageUpgradeable) + returns (string memory _uri) + { // All tokens share the same metadata at the moment _uri = ERC1155URIStorageUpgradeable.uri(getBaseType(tokenID)); } @@ -395,7 +396,7 @@ contract SemiFungible1155 is */ function _getSum(uint256[] memory array) internal pure returns (uint256 sum) { uint256 len = array.length; - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { if (array[i] == 0) revert Errors.NotAllowed(); sum += array[i]; unchecked { diff --git a/contracts/contracts/interfaces/IAllowlist.sol b/contracts/contracts/interfaces/IAllowlist.sol index fe4a9ec4..2ce9a044 100644 --- a/contracts/contracts/interfaces/IAllowlist.sol +++ b/contracts/contracts/interfaces/IAllowlist.sol @@ -6,9 +6,8 @@ pragma solidity 0.8.16; /// @notice This interface declares the required functionality for a hypercert token /// @notice This interface does not specify the underlying token type (e.g. 721 or 1155) interface IAllowlist { - function isAllowedToClaim( - bytes32[] calldata proof, - uint256 tokenID, - bytes32 leaf - ) external view returns (bool isAllowed); + function isAllowedToClaim(bytes32[] calldata proof, uint256 tokenID, bytes32 leaf) + external + view + returns (bool isAllowed); } diff --git a/contracts/foundry.toml b/contracts/foundry.toml index 20f19235..b85161c5 100644 --- a/contracts/foundry.toml +++ b/contracts/foundry.toml @@ -1,19 +1,46 @@ # Full reference https://github.com/foundry-rs/foundry/tree/master/config [profile.default] -auto_detect_solc = false +auto_detect_solc = true +allow_paths = ["../node_modules", "node_modules", "lib"] +block_base_fee_per_gas = 0 +block_coinbase = '0x0000000000000000000000000000000000000000' +block_difficulty = 0 +block_number = 0 +block_timestamp = 0 bytecode_hash = "none" +force = false fuzz = { runs = 1025 } -gas_reports = ["*"] -libs = ["lib"] +gas_reports = ["LookRareProtocol", "HypercertMinter"] +libraries = [] +libs = ["node_modules", "lib"] optimizer = true -optimizer_runs = 10_000 +optimizer_runs = 10000 out = "out" -solc = "0.8.16" src = "src" +script = "scripts/deployment" test = "test/foundry" - +via_ir = false +no_match_test = "testCannotExecuteOrderIfInvalidUserGlobal" [profile.ci] fuzz = { runs = 1024 } verbosity = 1 + +[etherscan] +mainnet = { key = "${ETHERSCAN_API_KEY}" } +goerli = { key = "${ETHERSCAN_API_KEY}" } +optimism = { key = "${OPTIMISTIC_ETHERSCAN_API_KEY}" } +sepolia = { key = "${ETHERSCAN_API_KEY}" } +celo = { key = "${CELOSCAN_API_KEY}" } + +[rpc_endpoints] +mainnet = "https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" +goerli = "https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}" +optimism = "https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" +sepolia = "https://sepolia.infura.io/v3/${INFURA_API_KEY}" +celo = "https://forno.celo.org" + +[fmt] +number_underscore = "thousands" +wrap_comments = true diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 48f3d3d6..9958691f 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -1,8 +1,9 @@ -import "@nomicfoundation/hardhat-chai-matchers"; +import { HardhatUserConfig } from "hardhat/config"; import "@nomicfoundation/hardhat-toolbox"; -import "@nomiclabs/hardhat-ethers"; +import "@nomicfoundation/hardhat-chai-matchers"; +import "@nomicfoundation/hardhat-ethers"; +import "@nomicfoundation/hardhat-viem"; import "@openzeppelin/hardhat-upgrades"; -import "@openzeppelin/hardhat-defender"; import "@primitivefi/hardhat-dodoc"; import { config as dotenvConfig } from "dotenv"; @@ -11,6 +12,8 @@ import "hardhat-abi-exporter"; import "hardhat-preprocessor"; import { resolve } from "path"; +import "xdeployer"; + import "./tasks"; function getRemappings() { @@ -34,17 +37,20 @@ const dotenvConfigPath: string = process.env.DOTENV_PATH ?? fs.existsSync("./.en dotenvConfig({ path: resolve(__dirname, dotenvConfigPath) }); // Ensure that we have all the environment variables we need. -const mnemonic = requireEnv(process.env.MNEMONIC, "MNEMONIC"); -const mnemonic_celo = requireEnv(process.env.MNEMONIC_CELO, "MNEMONIC_CELO"); -const infuraApiKey = requireEnv(process.env.INFURA_API_KEY, "INFURA_API_KEY"); -const alchemyOptimismUrl = requireEnv(process.env.ALCHEMY_OPTIMISM_URL, "ALCHEMY_OPTIMISM_URL"); +const MNEMONIC = requireEnv(process.env.MNEMONIC, "MNEMONIC"); +const MNEMONIC_CELO = requireEnv(process.env.MNEMONIC_CELO, "MNEMONIC_CELO"); +const INFURA_API_KEY = requireEnv(process.env.INFURA_API_KEY, "INFURA_API_KEY"); +const ALCHEMY_API_KEY = requireEnv(process.env.ALCHEMY_API_KEY, "ALCHEMY_API_KEY"); -const etherscanApiKey = requireEnv(process.env.ETHERSCAN_API_KEY, "ETHERSCAN_API_KEY"); -const optimisticEtherscanApiKey = requireEnv(process.env.OPTIMISTIC_ETHERSCAN_API_KEY, "OPTIMISTIC_ETHERSCAN_API_KEY"); -const celoscanApiKey = requireEnv(process.env.CELOSCAN_API_KEY, "CELOSCAN_API_KEY"); +const ETHERSCAN_API_KEY = requireEnv(process.env.ETHERSCAN_API_KEY, "ETHERSCAN_API_KEY"); +const OPTIMISTIC_ETHERSCAN_API_KEY = requireEnv( + process.env.OPTIMISTIC_ETHERSCAN_API_KEY, + "OPTIMISTIC_ETHERSCAN_API_KEY", +); +const CELOSCAN_API_KEY = requireEnv(process.env.CELOSCAN_API_KEY, "CELOSCAN_API_KEY"); -const ozApiKey = requireEnv(process.env.OPENZEPPELIN_API_KEY, "OPENZEPPELIN_API_KEY"); -const ozSecretKey = requireEnv(process.env.OPENZEPPELIN_SECRET_KEY, "OPENZEPPELIN_SECRET_KEY"); +const OPENZEPPELIN_API_KEY = requireEnv(process.env.OPENZEPPELIN_API_KEY, "OPENZEPPELIN_API_KEY"); +const OPENZEPPELIN_SECRET_KEY = requireEnv(process.env.OPENZEPPELIN_SECRET_KEY, "OPENZEPPELIN_SECRET_KEY"); /** * Maps a key to the chain ID @@ -64,23 +70,30 @@ const chainIds = { }; function getChainConfig(chain: keyof typeof chainIds) { - const jsonRpcUrl = "https://" + chain + ".infura.io/v3/" + infuraApiKey; + const jsonRpcUrl = "https://" + chain + ".infura.io/v3/" + INFURA_API_KEY; let config = { accounts: { count: 10, - mnemonic, + mnemonic: MNEMONIC, path: "m/44'/60'/0'/0", }, chainId: chainIds[chain], url: jsonRpcUrl, }; + if (chain === "optimism-mainnet") { + config = { + ...config, + url: `https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}`, + }; + } + if (chain === "celo-mainnet") { config = { ...config, accounts: { count: 10, - mnemonic: mnemonic_celo, + mnemonic: MNEMONIC_CELO, path: "m/44'/52752'/0'/0", }, }; @@ -89,19 +102,28 @@ function getChainConfig(chain: keyof typeof chainIds) { return config; } -const config = { +const config: HardhatUserConfig = { abiExporter: { - path: "./src/abi", + path: "./abi", runOnCompile: true, clear: true, - flat: true, - format: "minimal", + only: [ + "CurrencyManager", + "ExecutionManager", + "HypercertMinter", + "LooksRareProtocol", + "OrderValidatorV2A", + "StrategyManager", + "TransferManager", + "StrategyCollectionOffer", + "StrategyHypercertFractionOffer", + "CreatorFeeManagerWithRoyalties", + ], except: ["@openzeppelin"], }, defender: { - apiKey: ozApiKey!, - apiSecret: ozSecretKey!, - useDefenderDeploy: true, + apiKey: OPENZEPPELIN_API_KEY!, + apiSecret: OPENZEPPELIN_SECRET_KEY!, }, dodoc: { runOnCompile: true, @@ -111,10 +133,10 @@ const config = { }, etherscan: { apiKey: { - goerli: etherscanApiKey!, - sepolia: etherscanApiKey!, - optimisticEthereum: optimisticEtherscanApiKey!, - celo: celoscanApiKey!, + goerli: ETHERSCAN_API_KEY!, + sepolia: ETHERSCAN_API_KEY!, + optimisticEthereum: OPTIMISTIC_ETHERSCAN_API_KEY!, + celo: CELOSCAN_API_KEY!, }, customChains: [ { @@ -133,22 +155,28 @@ const config = { // metamask can't transfer when connected to hardhat's network. initialBaseFeePerGas: 0, accounts: { - mnemonic, + count: 10, + mnemonic: MNEMONIC, + path: "m/44'/60'/0'/0", }, chainId: chainIds.hardhat, + forking: { + url: `https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}`, + }, }, localhost: { - url: process.env.LOCALHOST_NETWORK_URL || "http://127.0.0.1:8545", + accounts: { + count: 10, + mnemonic: MNEMONIC, + path: "m/44'/60'/0'/0", + }, }, "celo-mainnet": getChainConfig("celo-mainnet"), goerli: getChainConfig("goerli"), sepolia: getChainConfig("sepolia"), mainnet: getChainConfig("mainnet"), "optimism-goerli": getChainConfig("optimism-goerli"), - "optimism-mainnet": { - ...getChainConfig("optimism-mainnet"), - url: alchemyOptimismUrl, - }, + "optimism-mainnet": getChainConfig("optimism-mainnet"), }, paths: { cache: "./cache_hardhat", // Use a different cache for Hardhat than Foundry @@ -156,31 +184,34 @@ const config = { tests: "./test", }, preprocess: { - eachLine: () => ({ + eachLine: (hre) => ({ transform: (line: string) => { if (line.match(/^\s*import /i)) { - getRemappings().forEach(([find, replace]) => { - if (line.match(find)) { - line = line.replace(find, replace); + for (const [from, to] of getRemappings()) { + if (line.includes(from)) { + line = line.replace(from, to); + break; } - }); + } } return line; }, }), }, solidity: { - version: "0.8.16", + version: "0.8.17", settings: { + metadata: { + bytecodeHash: "none", + }, optimizer: { enabled: true, - runs: 10_000, + runs: 5_000, }, }, }, typechain: { - outDir: "./src/types", - target: "ethers-v5", + outDir: "./types", }, }; diff --git a/contracts/lib/openzeppelin-contracts-upgradeable/.eslintrc b/contracts/lib/openzeppelin-contracts-upgradeable/.eslintrc index 095d2754..22fb715f 100644 --- a/contracts/lib/openzeppelin-contracts-upgradeable/.eslintrc +++ b/contracts/lib/openzeppelin-contracts-upgradeable/.eslintrc @@ -1,35 +1,30 @@ { - "extends" : [ - "standard" - ], - "plugins": [ - "mocha" - ], + "extends": ["standard"], + "plugins": ["mocha"], "env": { - "browser" : true, - "node" : true, - "mocha" : true, - "jest" : true, + "browser": true, + "node": true, + "mocha": true, + "jest": true }, - "globals" : { + "globals": { "artifacts": false, "contract": false, "assert": false, "web3": false, "usePlugin": false, - "extendEnvironment": false, + "extendEnvironment": false }, "rules": { - // Strict mode "strict": ["error", "global"], // Code style "array-bracket-spacing": ["off"], - "camelcase": ["error", {"properties": "always"}], + "camelcase": ["error", { "properties": "always" }], "comma-dangle": ["error", "always-multiline"], - "comma-spacing": ["error", {"before": false, "after": true}], - "dot-notation": ["error", {"allowKeywords": true, "allowPattern": ""}], + "comma-spacing": ["error", { "before": false, "after": true }], + "dot-notation": ["error", { "allowKeywords": true, "allowPattern": "" }], "eol-last": ["error", "always"], "eqeqeq": ["error", "smart"], "generator-star-spacing": ["error", "before"], @@ -40,7 +35,7 @@ "no-dupe-args": "error", "no-dupe-keys": "error", "no-mixed-spaces-and-tabs": ["error", "smart-tabs"], - "no-redeclare": ["error", {"builtinGlobals": true}], + "no-redeclare": ["error", { "builtinGlobals": true }], "no-trailing-spaces": ["error", { "skipBlankLines": false }], "no-undef": "error", "no-use-before-define": "off", @@ -54,7 +49,7 @@ "mocha/no-exclusive-tests": ["error"], "promise/always-return": "off", - "promise/avoid-new": "off", + "promise/avoid-new": "off" }, "parserOptions": { "ecmaVersion": 2020 diff --git a/contracts/package.json b/contracts/package.json index a54becd4..2b7597b1 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,7 +1,7 @@ { "name": "@hypercerts-org/contracts", "description": "EVM compatible protocol for managing impact claims", - "version": "0.8.11", + "version": "1.0.0-alpha.7", "author": { "name": "Hypercerts Foundation", "url": "https://github.com/hypercerts-org/hypercerts" @@ -26,47 +26,37 @@ "files": [ "dist", "README.md", - "package.json", - "contracts" + "package.json" ], "devDependencies": { + "@chainlink/contracts": "^0.8.0", "@commitlint/cli": "^17.1.2", "@commitlint/config-conventional": "^17.1.0", "@dlsl/hardhat-markup": "^1.0.0-rc.7", - "@ethersproject/abi": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/providers": "^5.7.2", - "@nomicfoundation/hardhat-chai-matchers": "^1.0.5", - "@nomicfoundation/hardhat-network-helpers": "^1.0.7", - "@nomicfoundation/hardhat-toolbox": "^2.0.0", - "@nomiclabs/hardhat-ethers": "^2.2.1", - "@nomiclabs/hardhat-etherscan": "^3.1.3", - "@openzeppelin/hardhat-defender": "^1.8.2", - "@openzeppelin/hardhat-upgrades": "^1.28", + "@looksrare/contracts-libs": "^3.4.0", + "@nomicfoundation/hardhat-chai-matchers": "^2.0.2", + "@nomicfoundation/hardhat-ethers": "^3.0.4", + "@nomicfoundation/hardhat-toolbox": "^3.0.0", + "@nomicfoundation/hardhat-viem": "^1.0.0", + "@openzeppelin/contracts": "^4.9.3", + "@openzeppelin/defender-sdk": "^1.4.0", + "@openzeppelin/hardhat-upgrades": "2.3.3", "@primitivefi/hardhat-dodoc": "^0.2.3", "@rollup/plugin-commonjs": "^24.0.1", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@trivago/prettier-plugin-sort-imports": "^3.3.0", - "@typechain/ethers-v5": "^11.1.1", - "@typechain/hardhat": "^9.0.0", - "@types/chai": "^4.3.4", - "@types/mocha": "9.1.0", "@types/node": "^18.11.11", "@typescript-eslint/eslint-plugin": "^5.38.0", "@typescript-eslint/parser": "^5.38.0", - "chai": "^4.3.7", "commitizen": "^4.2.5", - "copyfiles": "^2.4.1", "cross-env": "^7.0.3", "cz-conventional-changelog": "^3.3.0", "dotenv": "^16.0.2", "eslint": "^8.23.1", "eslint-config-prettier": "^8.5.0", - "ethers": "^5.7.2", - "hardhat": "2.13.1", + "ethers": "^6.8.0", "hardhat-abi-exporter": "^2.10.1", - "hardhat-gas-reporter": "^1.0.9", "hardhat-preprocessor": "^0.1.5", "husky": "^8.0.1", "lint-staged": "^13.0.3", @@ -75,16 +65,19 @@ "rimraf": "^5.0.5", "rollup": "^4.0.2", "rollup-plugin-auto-external": "^2.0.0", + "rollup-plugin-copy": "^3.5.0", "rollup-plugin-dts": "^6.1.0", "rollup-plugin-esbuild": "^6.1.0", "rollup-plugin-node-polyfills": "^0.2.1", "shx": "^0.3.4", "solhint": "^3.6.2", "solhint-plugin-prettier": "^0.0.5", - "solidity-coverage": "^0.8.2", + "solmate": "^6.2.0", "ts-node": "^10.9.1", "typechain": "^8.3.1", - "typescript": "^4.9.4" + "typescript": "^4.9.4", + "viem": "^1.18.9", + "xdeployer": "^2.1.13" }, "keywords": [ "blockchain", @@ -97,22 +90,27 @@ "template" ], "scripts": { - "build": "hardhat compile && pnpm tsc -p tsconfig.build.json && rollup -c && pnpm copy:contracts", - "build:forge": "forge build", - "clean": "rimraf cache out dist typechain abi", - "copy:contracts": "copyfiles -u 1 ./src/**/*.sol ./src/*.sol ./contracts", + "build": "pnpm clean && forge compile && hardhat compile && pnpm tsc -p tsconfig.build.json && rollup -c", + "build:forge": "pnpm clean && forge build", + "clean": "rimraf abi artifacts build cache cache_hardhat dist out types", + "deploy:marketplace:goerli": "forge script scripts/deployment/Deployment.s.sol:Deployment --broadcast --verify --fork-url goerli", + "deploy:marketplace:sepolia": "forge script scripts/deployment/Deployment.s.sol:Deployment --broadcast --verify --fork-url sepolia", + "deploy:marketplace:test": "pnpm deploy:marketplace:goerli && pnpm deploy:marketplace:sepolia", + "deploy:marketplace:dryrun": "forge script scripts/deployment/Deployment.s.sol:Deployment --fork-url", "docs": "hardhat dodoc", "lint": "pnpm lint:sol && pnpm prettier:check", - "lint:sol": "solhint -w 5 \"./{src,test}/**/*.sol\"", - "prebuild": "pnpm clean", + "lint:sol": "forge fmt --check && solhint \"./{src,test/foundry/protocol,test/foundry/marketplace}/**/*.sol\"", "prepublish": "pnpm build", - "prettier": "prettier --config \"./.prettierrc.yml\" --write \"**/*.{json,md,sol,yml}\"", - "prettier:check": "prettier --config \"./.prettierrc.yml\" --check \"**/*.{json,md,sol,yml}\"", + "prettier": "prettier --config \"./.prettierrc.yml\" --write \"**/*.{json,md,ts,yml}\"", + "prettier:check": "prettier --config \"./.prettierrc.yml\" --check \"**/*.{json,md,ts,yml}\"", "slither": "slither ./src", "test": "pnpm test:hardhat && pnpm test:forge", "test:forge": "forge test", "test:hardhat": "hardhat test", "test:gas": "forge test --match-path test/foundry/PerformanceTesting.t.sol --gas-report", "hardhat": "hardhat" + }, + "dependencies": { + "hardhat": "^2.18.3" } } diff --git a/contracts/remappings.txt b/contracts/remappings.txt index bb8f23eb..bd34895c 100644 --- a/contracts/remappings.txt +++ b/contracts/remappings.txt @@ -4,3 +4,9 @@ murky/=lib/murky/src/ oz-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/ oz-contracts/=lib/murky/lib/openzeppelin-contracts/ prb-test/=lib/prb-test/src/ +@hypercerts/protocol/=src/protocol/ +@hypercerts/marketplace/=src/marketplace/ +@looksrare/=node_modules/@looksrare/ +hardhat/=node_modules/hardhat/ +solmate/=node_modules/solmate/ +@openzeppelin/=node_modules/@openzeppelin/ diff --git a/contracts/rollup.config.mjs b/contracts/rollup.config.mjs index f6e55c8b..77c81300 100644 --- a/contracts/rollup.config.mjs +++ b/contracts/rollup.config.mjs @@ -8,7 +8,7 @@ import nodePolyfills from "rollup-plugin-node-polyfills"; export default [ { - input: `build/index.js`, + input: `build/src/index.js`, plugins: [ autoExternal(), nodePolyfills(), @@ -33,7 +33,7 @@ export default [ ], }, { - input: `build/index.d.ts`, + input: `build/src/index.d.ts`, plugins: [json(), dts()], output: { file: `dist/index.d.ts`, diff --git a/contracts/src/SemiFungible1155.sol b/contracts/src/SemiFungible1155.sol deleted file mode 100644 index cd88714a..00000000 --- a/contracts/src/SemiFungible1155.sol +++ /dev/null @@ -1,433 +0,0 @@ -// SPDX-License-Identifier: MIT -// Used components of Enjin example implementation for mixed fungibility -// https://github.com/enjin/erc-1155/blob/master/contracts/ERC1155MixedFungibleMintable.sol -pragma solidity 0.8.16; - -import { ERC1155Upgradeable } from "oz-upgradeable/token/ERC1155/ERC1155Upgradeable.sol"; -import { ERC1155BurnableUpgradeable } from "oz-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol"; -import { ERC1155URIStorageUpgradeable } from "oz-upgradeable/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol"; -import { OwnableUpgradeable } from "oz-upgradeable/access/OwnableUpgradeable.sol"; -import { Initializable } from "oz-upgradeable/proxy/utils/Initializable.sol"; -import { UUPSUpgradeable } from "oz-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -import { Errors } from "./libs/Errors.sol"; - -/// @title Contract for minting semi-fungible EIP1155 tokens -/// @author bitbeckers -/// @notice Extends { Upgradeable1155 } token with semi-fungible properties and the concept of `units` -/// @dev Adds split bit strategy as described in [EIP-1155](https://eips.ethereum.org/EIPS/eip-1155#non-fungible-tokens) -contract SemiFungible1155 is - Initializable, - ERC1155Upgradeable, - ERC1155BurnableUpgradeable, - ERC1155URIStorageUpgradeable, - OwnableUpgradeable, - UUPSUpgradeable -{ - /// @dev Counter used to generate next typeID. - uint256 internal typeCounter; - - /// @dev Bitmask used to expose only upper 128 bits of uint256 - uint256 internal constant TYPE_MASK = type(uint256).max << 128; - - /// @dev Bitmask used to expose only lower 128 bits of uint256 - uint256 internal constant NF_INDEX_MASK = type(uint256).max >> 128; - - uint256 internal constant FRACTION_LIMIT = 253; - - /// @dev Mapping of `tokenID` to address of `owner` - mapping(uint256 => address) internal owners; - - /// @dev Mapping of `tokenID` to address of `creator` - mapping(uint256 => address) internal creators; - - /// @dev Used to determine amount of `units` stored in token at `tokenID` - mapping(uint256 => uint256) internal tokenValues; - - /// @dev Used to find highest index of token belonging to token at `typeID` - mapping(uint256 => uint256) internal maxIndex; - - /// @dev Emitted on transfer of `value` between `fromTokenID` to `toTokenID` of the same `claimID` - event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value); - - /// @dev Emitted on transfer of `values` between `fromTokenIDs` to `toTokenIDs` of `claimIDs` - event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values); - - /// @dev see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol } - // solhint-disable-next-line func-name-mixedcase - function __SemiFungible1155_init() public virtual onlyInitializing { - __ERC1155_init(""); - __ERC1155Burnable_init(); - __ERC1155URIStorage_init(); - __Ownable_init(); - __UUPSUpgradeable_init(); - } - - /// @dev Get index of fractional token at `_id` by returning lower 128 bit values - /// @dev Returns 0 if `_id` is a baseType - function getItemIndex(uint256 tokenID) internal pure returns (uint256) { - return tokenID & NF_INDEX_MASK; - } - - /// @dev Get base type ID for token at `_id` by returning upper 128 bit values - function getBaseType(uint256 tokenID) internal pure returns (uint256) { - return tokenID & TYPE_MASK; - } - - /// @dev Identify that token at `_id` is base type. - /// @dev Upper 128 bits identify base type ID, lower bits should be 0 - function isBaseType(uint256 tokenID) internal pure returns (bool) { - return (tokenID & TYPE_MASK == tokenID) && (tokenID & NF_INDEX_MASK == 0); - } - - /// @dev Identify that token at `_id` is fraction of a claim. - /// @dev Upper 128 bits identify base type ID, lower bits should be > 0 - function isTypedItem(uint256 tokenID) internal pure returns (bool) { - return (tokenID & TYPE_MASK != 0) && (tokenID & NF_INDEX_MASK != 0); - } - - /// READ - function ownerOf(uint256 tokenID) public view returns (address _owner) { - _owner = owners[tokenID]; - } - - /// @dev see {IHypercertToken} - function _unitsOf(uint256 tokenID) internal view returns (uint256 units) { - units = tokenValues[tokenID]; - } - - /// @dev see {IHypercertToken} - function _unitsOf(address account, uint256 tokenID) internal view returns (uint256 units) { - // Check if fraction token and accounts owns it - if (ownerOf(tokenID) == account) { - units = tokenValues[tokenID]; - } - } - - /// MUTATE - - /// @dev create token type ID based of token counter - - function _createTokenType(address _account, uint256 units, string memory _uri) internal returns (uint256 typeID) { - _notMaxType(typeCounter); - typeID = ++typeCounter << 128; - - creators[typeID] = _account; - tokenValues[typeID] = units; - - _setURI(typeID, _uri); - - //Event emitted for indexing purposes - emit TransferSingle(_account, address(0), address(0), typeID, 0); - } - - /// @dev Mint a new token type and the initial units - function _mintNewTypeWithToken( - address _account, - uint256 _units, - string memory _uri - ) internal returns (uint256 typeID) { - if (_units == 0) { - revert Errors.NotAllowed(); - } - typeID = _createTokenType(_account, _units, _uri); - - uint256 tokenID = typeID + ++maxIndex[typeID]; //1 based indexing, 0 holds type data - - tokenValues[tokenID] = _units; - - _mint(_account, tokenID, 1, ""); - emit ValueTransfer(typeID, 0, tokenID, _units); - } - - /// @dev Mint a new token type and the initial fractions - function _mintNewTypeWithTokens( - address _account, - uint256[] calldata _fractions, - string memory _uri - ) internal returns (uint256 typeID) { - typeID = _mintNewTypeWithToken(_account, _getSum(_fractions), _uri); - _splitTokenUnits(_account, typeID + maxIndex[typeID], _fractions); - } - - /// @dev Mint a new token for an existing type - function _mintToken(address _account, uint256 _typeID, uint256 _units) internal returns (uint256 tokenID) { - if (!isBaseType(_typeID)) revert Errors.NotAllowed(); - - _notMaxItem(maxIndex[_typeID]); - - unchecked { - tokenID = _typeID + ++maxIndex[_typeID]; //1 based indexing, 0 holds type data - } - - tokenValues[tokenID] = _units; - - _mint(_account, tokenID, 1, ""); - emit ValueTransfer(_typeID, 0, tokenID, _units); - } - - /// @dev Mint new tokens for existing types - /// @notice Enables batch claiming from multiple allowlists - function _batchMintTokens( - address _account, - uint256[] calldata _typeIDs, - uint256[] calldata _units - ) internal returns (uint256[] memory tokenIDs) { - uint256 len = _typeIDs.length; - - tokenIDs = new uint256[](len); - uint256[] memory amounts = new uint256[](len); - uint256[] memory zeroes = new uint256[](len); - - for (uint256 i; i < len; ) { - uint256 _typeID = _typeIDs[i]; - if (!isBaseType(_typeID)) revert Errors.NotAllowed(); - _notMaxItem(maxIndex[_typeID]); - - unchecked { - uint256 tokenID = _typeID + ++maxIndex[_typeID]; //1 based indexing, 0 holds type data - tokenValues[tokenID] = _units[i]; - tokenIDs[i] = tokenID; - amounts[i] = 1; - ++i; - } - } - - _mintBatch(_account, tokenIDs, amounts, ""); - emit BatchValueTransfer(_typeIDs, zeroes, tokenIDs, _units); - } - - /// @dev Split the units of `_tokenID` owned by `account` across `_values` - /// @dev `_values` must sum to total `units` held at `_tokenID` - function _splitTokenUnits(address _account, uint256 _tokenID, uint256[] calldata _values) internal { - if (_values.length > FRACTION_LIMIT || _values.length < 2) revert Errors.ArraySize(); - if (tokenValues[_tokenID] != _getSum(_values)) revert Errors.NotAllowed(); - - // Current token - uint256 _typeID = getBaseType(_tokenID); - uint256 valueLeft = tokenValues[_tokenID]; - - // Prepare batch processing, we want to skip the first entry - uint256 len = _values.length - 1; - - uint256[] memory typeIDs = new uint256[](len); - uint256[] memory fromIDs = new uint256[](len); - uint256[] memory toIDs = new uint256[](len); - uint256[] memory amounts = new uint256[](len); - uint256[] memory values = new uint256[](len); - - { - uint256[] memory _valuesCache = _values; - uint256 swapValue = _valuesCache[len]; - _valuesCache[len] = _valuesCache[0]; - _valuesCache[0] = swapValue; - - for (uint256 i; i < len; ) { - _notMaxItem(maxIndex[_typeID]); - - typeIDs[i] = _typeID; - fromIDs[i] = _tokenID; - toIDs[i] = _typeID + ++maxIndex[_typeID]; - amounts[i] = 1; - values[i] = _valuesCache[i]; - - unchecked { - ++i; - } - } - } - - _beforeUnitTransfer(_msgSender(), _account, fromIDs, toIDs, values, ""); - - for (uint256 i; i < len; ) { - valueLeft -= values[i]; - - tokenValues[toIDs[i]] = values[i]; - - unchecked { - ++i; - } - } - - tokenValues[_tokenID] = valueLeft; - - _mintBatch(_account, toIDs, amounts, ""); - - emit BatchValueTransfer(typeIDs, fromIDs, toIDs, values); - } - - /// @dev Merge the units of `_fractionIDs`. - /// @dev Base type of `_fractionIDs` must be identical for all tokens. - function _mergeTokensUnits(address _account, uint256[] memory _fractionIDs) internal { - if (_fractionIDs.length > FRACTION_LIMIT || _fractionIDs.length < 2) { - revert Errors.ArraySize(); - } - uint256 len = _fractionIDs.length - 1; - - uint256 target = _fractionIDs[len]; - - uint256 _totalValue; - uint256[] memory fromIDs = new uint256[](len); - uint256[] memory toIDs = new uint256[](len); - uint256[] memory values = new uint256[](len); - uint256[] memory amounts = new uint256[](len); - - { - for (uint256 i; i < len; ) { - uint256 _fractionID = _fractionIDs[i]; - fromIDs[i] = _fractionID; - toIDs[i] = target; - amounts[i] = 1; - values[i] = tokenValues[_fractionID]; - - unchecked { - ++i; - } - } - } - - _beforeUnitTransfer(_msgSender(), _account, fromIDs, toIDs, values, ""); - - for (uint256 i; i < len; ) { - _totalValue += values[i]; - - delete tokenValues[fromIDs[i]]; - unchecked { - ++i; - } - } - - tokenValues[target] += _totalValue; - - _burnBatch(_account, fromIDs, amounts); - } - - /// @dev Burn the token at `_tokenID` owned by `_account` - /// @dev Not allowed to burn base type. - /// @dev `_tokenID` must hold all value declared at base type - function _burnToken(address _account, uint256 _tokenID) internal { - if (_account != _msgSender() && !isApprovedForAll(_account, _msgSender())) revert Errors.NotApprovedOrOwner(); - - uint256 value = tokenValues[_tokenID]; - - delete tokenValues[_tokenID]; - - _burn(_account, _tokenID, 1); - emit ValueTransfer(getBaseType(_tokenID), _tokenID, 0, value); - } - - /// TRANSFERS - - // The following functions are overrides required by Solidity. - function _afterTokenTransfer( - address operator, - address from, - address to, - uint256[] memory ids, - uint256[] memory amounts, - bytes memory data - ) internal virtual override { - super._afterTokenTransfer(operator, from, to, ids, amounts, data); - - uint256 len = ids.length; - - for (uint256 i; i < len; ) { - owners[ids[i]] = to; - unchecked { - ++i; - } - } - } - - function _beforeUnitTransfer( - address operator, - address from, - uint256[] memory fromIDs, - uint256[] memory toIDs, - uint256[] memory values, - bytes memory data - ) internal virtual { - uint256 len = fromIDs.length; - - for (uint256 i; i < len; ) { - uint256 _from = fromIDs[i]; - uint256 _to = toIDs[i]; - - if (isBaseType(_from)) revert Errors.NotAllowed(); - if (getBaseType(_from) != getBaseType(_to)) revert Errors.TypeMismatch(); - if (from != _msgSender() && !isApprovedForAll(from, _msgSender())) revert Errors.NotApprovedOrOwner(); - unchecked { - ++i; - } - } - } - - /// METADATA - - /// @dev see { openzeppelin-contracts-upgradeable/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol } - /// @dev Always returns the URI for the basetype so that it's managed in one place. - function uri( - uint256 tokenID - ) public view virtual override(ERC1155Upgradeable, ERC1155URIStorageUpgradeable) returns (string memory _uri) { - // All tokens share the same metadata at the moment - _uri = ERC1155URIStorageUpgradeable.uri(getBaseType(tokenID)); - } - - /// UTILS - - /** - * @dev Check if value is below max item index - */ - function _notMaxItem(uint256 tokenID) private pure { - uint128 _count = uint128(tokenID); - ++_count; - } - - /** - * @dev Check if value is below max type index - */ - function _notMaxType(uint256 tokenID) private pure { - uint128 _count = uint128(tokenID >> 128); - ++_count; - } - - /** - * @dev calculate the sum of the elements of an array - */ - function _getSum(uint256[] memory array) internal pure returns (uint256 sum) { - uint256 len = array.length; - for (uint256 i; i < len; ) { - if (array[i] == 0) revert Errors.NotAllowed(); - sum += array[i]; - unchecked { - ++i; - } - } - } - - function _getSingletonArray(uint256 element) private pure returns (uint256[] memory) { - uint256[] memory array = new uint256[](1); - array[0] = element; - - return array; - } - - // UUPS PROXY - - /// @dev see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol } - function _authorizeUpgrade(address newImplementation) internal virtual override onlyOwner { - // solhint-disable-previous-line no-empty-blocks - } - - /** - * @dev This empty reserved space is put in place to allow future versions to add new - * variables without shifting down storage in the inheritance chain. - * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps - * Assuming 30 available slots (slots cost space, cost gas) - * 1. typeCounter - * 2. owners - * 3. creators - * 4. tokenValues - * 5. maxIndex - */ - uint256[25] private __gap; -} diff --git a/contracts/src/deployments/deployment-marketplace-goerli.json b/contracts/src/deployments/deployment-marketplace-goerli.json new file mode 100644 index 00000000..2c3c30ca --- /dev/null +++ b/contracts/src/deployments/deployment-marketplace-goerli.json @@ -0,0 +1,49 @@ +{ + "HypercertExchange": { + "address": "0x89524d8a0B1D7742579A7d8AE46D7679a4de1198", + "fullNamespace": "LooksRareProtocol", + "args": [ + "0xdf2c3dace6f31e650fd03b8ff72bee82cb1c199a", + "0xfB4A7359d3767781dB5dF63789c478E2F007bD6A", + "0x61eDE0F0CaD4D51Df761DccDaB08B57e6Cb8f712", + "0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6" + ], + "encodedArgs": "0xdf2c3dace6f31e650fd03b8ff72bee82cb1c199afb4a7359d3767781db5df63789c478e2f007bd6a61ede0f0cad4d51df761dccdab08b57e6cb8f712b4fbf271143f4fbf7b91a5ded31805e42b2208d6", + "tx": "0x97facbd3ee5637e05b2b49d6535d2cc8e5a6607d16e728922bc5890cf76d0a86" + }, + "ProtocolFeeRecipient": { + "address": "0xfB4A7359d3767781dB5dF63789c478E2F007bD6A", + "fullNamespace": "ProtocolFeeRecipient", + "args": ["0xdf2c3dace6f31e650fd03b8ff72bee82cb1c199a", "0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6"], + "encodedArgs": "0xdf2c3dace6f31e650fd03b8ff72bee82cb1c199ab4fbf271143f4fbf7b91a5ded31805e42b2208d6", + "tx": "0xbdfdcec3db949405f2531ed0d1ef1c3fcf43d127be8ff7bbb51c27a466349c50" + }, + "TransferManager": { + "address": "0x61eDE0F0CaD4D51Df761DccDaB08B57e6Cb8f712", + "fullNamespace": "TransferManager", + "args": ["0xdf2c3dace6f31e650fd03b8ff72bee82cb1c199a"], + "encodedArgs": "0xdf2c3dace6f31e650fd03b8ff72bee82cb1c199a", + "tx": "0xa16188ed346db49d99d5d2005214084fc15a09843a20a20f6b8532ae65b50530" + }, + "OrderValidator": { + "address": "0x51c9277d2b3e7ae460eb710053367bfe3872027b", + "fullNamespace": "OrderValidatorV2A", + "args": ["0x89524d8a0B1D7742579A7d8AE46D7679a4de1198"], + "encodedArgs": "0x89524d8a0b1d7742579a7d8ae46d7679a4de1198", + "tx": "0xa245695a4f6be256e68b83f1cd1f2503106126894053812ad6297f412a74359d" + }, + "StrategyCollectionOffer": { + "address": "0x947bbd2e69e8d777171139c3fd242638e4e78bf0", + "fullNamespace": "StrategyCollectionOffer", + "args": [], + "encodedArgs": "0x", + "tx": "0x94aaa40fc99eb28853a34160143d5e856f57e323b029dfddd919e46534b8fb17" + }, + "StrategyHypercertFractionOffer": { + "address": "0x9f233a07bd4ce69c0d7ed6553e796dba41892cf6", + "fullNamespace": "StrategyCollectionOffer", + "args": [], + "encodedArgs": "0x", + "tx": "0xf87db995c8c325a2d2663b51fadbfdc8ac8bb733ae5a0aae58566309a2aff674" + } +} diff --git a/contracts/src/deployments/deployment-marketplace-sepolia.json b/contracts/src/deployments/deployment-marketplace-sepolia.json new file mode 100644 index 00000000..904ace20 --- /dev/null +++ b/contracts/src/deployments/deployment-marketplace-sepolia.json @@ -0,0 +1,1296 @@ +{ + "hypercerts-exchange": { + "address": "0x4072ABD45a95c56372eAA00059B101C95191ea2A", + "abi": [ + { + "inputs": [ + { "internalType": "address", "name": "_owner", "type": "address" }, + { "internalType": "address", "name": "_protocolFeeRecipient", "type": "address" }, + { "internalType": "address", "name": "_transferManager", "type": "address" }, + { "internalType": "address", "name": "_weth", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "CallerInvalid", "type": "error" }, + { "inputs": [], "name": "ChainIdInvalid", "type": "error" }, + { "inputs": [], "name": "CreatorFeeBpTooHigh", "type": "error" }, + { "inputs": [], "name": "CurrencyInvalid", "type": "error" }, + { "inputs": [], "name": "ERC20TransferFromFail", "type": "error" }, + { "inputs": [], "name": "LengthsInvalid", "type": "error" }, + { "inputs": [], "name": "MerkleProofInvalid", "type": "error" }, + { + "inputs": [{ "internalType": "uint256", "name": "length", "type": "uint256" }], + "name": "MerkleProofTooLarge", + "type": "error" + }, + { "inputs": [], "name": "NewGasLimitETHTransferTooLow", "type": "error" }, + { "inputs": [], "name": "NewProtocolFeeRecipientCannotBeNullAddress", "type": "error" }, + { "inputs": [], "name": "NoOngoingTransferInProgress", "type": "error" }, + { "inputs": [], "name": "NoSelectorForStrategy", "type": "error" }, + { "inputs": [], "name": "NoncesInvalid", "type": "error" }, + { "inputs": [], "name": "NotAContract", "type": "error" }, + { "inputs": [], "name": "NotOwner", "type": "error" }, + { "inputs": [], "name": "NotV2Strategy", "type": "error" }, + { "inputs": [], "name": "NullSignerAddress", "type": "error" }, + { "inputs": [], "name": "OutsideOfTimeRange", "type": "error" }, + { "inputs": [], "name": "QuoteTypeInvalid", "type": "error" }, + { "inputs": [], "name": "ReentrancyFail", "type": "error" }, + { "inputs": [], "name": "RenouncementNotInProgress", "type": "error" }, + { "inputs": [], "name": "SameDomainSeparator", "type": "error" }, + { "inputs": [], "name": "SignatureEOAInvalid", "type": "error" }, + { "inputs": [], "name": "SignatureERC1271Invalid", "type": "error" }, + { + "inputs": [{ "internalType": "uint256", "name": "length", "type": "uint256" }], + "name": "SignatureLengthInvalid", + "type": "error" + }, + { "inputs": [], "name": "SignatureParameterSInvalid", "type": "error" }, + { + "inputs": [{ "internalType": "uint8", "name": "v", "type": "uint8" }], + "name": "SignatureParameterVInvalid", + "type": "error" + }, + { "inputs": [], "name": "StrategyHasNoSelector", "type": "error" }, + { + "inputs": [{ "internalType": "uint256", "name": "strategyId", "type": "uint256" }], + "name": "StrategyNotAvailable", + "type": "error" + }, + { "inputs": [], "name": "StrategyNotUsed", "type": "error" }, + { "inputs": [], "name": "StrategyProtocolFeeTooHigh", "type": "error" }, + { "inputs": [], "name": "TransferAlreadyInProgress", "type": "error" }, + { "inputs": [], "name": "TransferNotInProgress", "type": "error" }, + { "inputs": [], "name": "UnsupportedCollectionType", "type": "error" }, + { "inputs": [], "name": "WrongPotentialOwner", "type": "error" }, + { "anonymous": false, "inputs": [], "name": "CancelOwnershipTransfer", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "currency", "type": "address" }, + { "indexed": false, "internalType": "bool", "name": "isAllowed", "type": "bool" } + ], + "name": "CurrencyStatusUpdated", + "type": "event" + }, + { "anonymous": false, "inputs": [], "name": "InitiateOwnershipRenouncement", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "potentialOwner", "type": "address" } + ], + "name": "InitiateOwnershipTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "bidNonce", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "askNonce", "type": "uint256" } + ], + "name": "NewBidAskNonces", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "creatorFeeManager", "type": "address" }], + "name": "NewCreatorFeeManager", + "type": "event" + }, + { "anonymous": false, "inputs": [], "name": "NewDomainSeparator", "type": "event" }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "gasLimitETHTransfer", "type": "uint256" }], + "name": "NewGasLimitETHTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "maxCreatorFeeBp", "type": "uint256" }], + "name": "NewMaxCreatorFeeBp", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "NewOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "protocolFeeRecipient", "type": "address" }], + "name": "NewProtocolFeeRecipient", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "indexed": false, "internalType": "uint16", "name": "standardProtocolFeeBp", "type": "uint16" }, + { "indexed": false, "internalType": "uint16", "name": "minTotalFeeBp", "type": "uint16" }, + { "indexed": false, "internalType": "uint16", "name": "maxProtocolFeeBp", "type": "uint16" }, + { "indexed": false, "internalType": "bytes4", "name": "selector", "type": "bytes4" }, + { "indexed": false, "internalType": "bool", "name": "isMakerBid", "type": "bool" }, + { "indexed": false, "internalType": "address", "name": "implementation", "type": "address" } + ], + "name": "NewStrategy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256[]", "name": "orderNonces", "type": "uint256[]" } + ], + "name": "OrderNoncesCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "indexed": false, "internalType": "bool", "name": "isActive", "type": "bool" }, + { "indexed": false, "internalType": "uint16", "name": "standardProtocolFeeBp", "type": "uint16" }, + { "indexed": false, "internalType": "uint16", "name": "minTotalFeeBp", "type": "uint16" } + ], + "name": "StrategyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256[]", "name": "subsetNonces", "type": "uint256[]" } + ], + "name": "SubsetNoncesCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { "internalType": "bytes32", "name": "orderHash", "type": "bytes32" }, + { "internalType": "uint256", "name": "orderNonce", "type": "uint256" }, + { "internalType": "bool", "name": "isNonceInvalidated", "type": "bool" } + ], + "indexed": false, + "internalType": "struct ILooksRareProtocol.NonceInvalidationParameters", + "name": "nonceInvalidationParameters", + "type": "tuple" + }, + { "indexed": false, "internalType": "address", "name": "askUser", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "bidUser", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "indexed": false, "internalType": "address", "name": "currency", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "collection", "type": "address" }, + { "indexed": false, "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "indexed": false, "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "indexed": false, "internalType": "address[2]", "name": "feeRecipients", "type": "address[2]" }, + { "indexed": false, "internalType": "uint256[3]", "name": "feeAmounts", "type": "uint256[3]" } + ], + "name": "TakerAsk", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { "internalType": "bytes32", "name": "orderHash", "type": "bytes32" }, + { "internalType": "uint256", "name": "orderNonce", "type": "uint256" }, + { "internalType": "bool", "name": "isNonceInvalidated", "type": "bool" } + ], + "indexed": false, + "internalType": "struct ILooksRareProtocol.NonceInvalidationParameters", + "name": "nonceInvalidationParameters", + "type": "tuple" + }, + { "indexed": false, "internalType": "address", "name": "bidUser", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "bidRecipient", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "indexed": false, "internalType": "address", "name": "currency", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "collection", "type": "address" }, + { "indexed": false, "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "indexed": false, "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "indexed": false, "internalType": "address[2]", "name": "feeRecipients", "type": "address[2]" }, + { "indexed": false, "internalType": "uint256[3]", "name": "feeAmounts", "type": "uint256[3]" } + ], + "name": "TakerBid", + "type": "event" + }, + { + "inputs": [], + "name": "MAGIC_VALUE_ORDER_NONCE_EXECUTED", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WETH", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "standardProtocolFeeBp", "type": "uint16" }, + { "internalType": "uint16", "name": "minTotalFeeBp", "type": "uint16" }, + { "internalType": "uint16", "name": "maxProtocolFeeBp", "type": "uint16" }, + { "internalType": "bytes4", "name": "selector", "type": "bytes4" }, + { "internalType": "bool", "name": "isMakerBid", "type": "bool" }, + { "internalType": "address", "name": "implementation", "type": "address" } + ], + "name": "addStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256[]", "name": "orderNonces", "type": "uint256[]" }], + "name": "cancelOrderNonces", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "cancelOwnershipTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256[]", "name": "subsetNonces", "type": "uint256[]" }], + "name": "cancelSubsetNonces", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "chainId", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "confirmOwnershipRenouncement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "confirmOwnershipTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "creatorFeeManager", + "outputs": [{ "internalType": "contract ICreatorFeeManager", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "domainSeparator", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Taker[]", + "name": "takerBids", + "type": "tuple[]" + }, + { + "components": [ + { "internalType": "enum QuoteType", "name": "quoteType", "type": "uint8" }, + { "internalType": "uint256", "name": "globalNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "subsetNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "orderNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "internalType": "enum CollectionType", "name": "collectionType", "type": "uint8" }, + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "address", "name": "currency", "type": "address" }, + { "internalType": "address", "name": "signer", "type": "address" }, + { "internalType": "uint256", "name": "startTime", "type": "uint256" }, + { "internalType": "uint256", "name": "endTime", "type": "uint256" }, + { "internalType": "uint256", "name": "price", "type": "uint256" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Maker[]", + "name": "makerAsks", + "type": "tuple[]" + }, + { "internalType": "bytes[]", "name": "makerSignatures", "type": "bytes[]" }, + { + "components": [ + { "internalType": "bytes32", "name": "root", "type": "bytes32" }, + { + "components": [ + { "internalType": "bytes32", "name": "value", "type": "bytes32" }, + { "internalType": "enum OrderStructs.MerkleTreeNodePosition", "name": "position", "type": "uint8" } + ], + "internalType": "struct OrderStructs.MerkleTreeNode[]", + "name": "proof", + "type": "tuple[]" + } + ], + "internalType": "struct OrderStructs.MerkleTree[]", + "name": "merkleTrees", + "type": "tuple[]" + }, + { "internalType": "bool", "name": "isAtomic", "type": "bool" } + ], + "name": "executeMultipleTakerBids", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Taker", + "name": "takerAsk", + "type": "tuple" + }, + { + "components": [ + { "internalType": "enum QuoteType", "name": "quoteType", "type": "uint8" }, + { "internalType": "uint256", "name": "globalNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "subsetNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "orderNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "internalType": "enum CollectionType", "name": "collectionType", "type": "uint8" }, + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "address", "name": "currency", "type": "address" }, + { "internalType": "address", "name": "signer", "type": "address" }, + { "internalType": "uint256", "name": "startTime", "type": "uint256" }, + { "internalType": "uint256", "name": "endTime", "type": "uint256" }, + { "internalType": "uint256", "name": "price", "type": "uint256" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Maker", + "name": "makerBid", + "type": "tuple" + }, + { "internalType": "bytes", "name": "makerSignature", "type": "bytes" }, + { + "components": [ + { "internalType": "bytes32", "name": "root", "type": "bytes32" }, + { + "components": [ + { "internalType": "bytes32", "name": "value", "type": "bytes32" }, + { "internalType": "enum OrderStructs.MerkleTreeNodePosition", "name": "position", "type": "uint8" } + ], + "internalType": "struct OrderStructs.MerkleTreeNode[]", + "name": "proof", + "type": "tuple[]" + } + ], + "internalType": "struct OrderStructs.MerkleTree", + "name": "merkleTree", + "type": "tuple" + } + ], + "name": "executeTakerAsk", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Taker", + "name": "takerBid", + "type": "tuple" + }, + { + "components": [ + { "internalType": "enum QuoteType", "name": "quoteType", "type": "uint8" }, + { "internalType": "uint256", "name": "globalNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "subsetNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "orderNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "internalType": "enum CollectionType", "name": "collectionType", "type": "uint8" }, + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "address", "name": "currency", "type": "address" }, + { "internalType": "address", "name": "signer", "type": "address" }, + { "internalType": "uint256", "name": "startTime", "type": "uint256" }, + { "internalType": "uint256", "name": "endTime", "type": "uint256" }, + { "internalType": "uint256", "name": "price", "type": "uint256" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Maker", + "name": "makerAsk", + "type": "tuple" + }, + { "internalType": "bytes", "name": "makerSignature", "type": "bytes" }, + { + "components": [ + { "internalType": "bytes32", "name": "root", "type": "bytes32" }, + { + "components": [ + { "internalType": "bytes32", "name": "value", "type": "bytes32" }, + { "internalType": "enum OrderStructs.MerkleTreeNodePosition", "name": "position", "type": "uint8" } + ], + "internalType": "struct OrderStructs.MerkleTreeNode[]", + "name": "proof", + "type": "tuple[]" + } + ], + "internalType": "struct OrderStructs.MerkleTree", + "name": "merkleTree", + "type": "tuple" + } + ], + "name": "executeTakerBid", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "root", "type": "bytes32" }, + { "internalType": "uint256", "name": "proofLength", "type": "uint256" } + ], + "name": "hashBatchOrder", + "outputs": [{ "internalType": "bytes32", "name": "batchOrderHash", "type": "bytes32" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bool", "name": "bid", "type": "bool" }, + { "internalType": "bool", "name": "ask", "type": "bool" } + ], + "name": "incrementBidAskNonces", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initiateOwnershipRenouncement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newPotentialOwner", "type": "address" }], + "name": "initiateOwnershipTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "isCurrencyAllowed", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxCreatorFeeBp", + "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ownershipStatus", + "outputs": [{ "internalType": "enum IOwnableTwoSteps.Status", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "potentialOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolFeeRecipient", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Taker", + "name": "takerBid", + "type": "tuple" + }, + { + "components": [ + { "internalType": "enum QuoteType", "name": "quoteType", "type": "uint8" }, + { "internalType": "uint256", "name": "globalNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "subsetNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "orderNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "internalType": "enum CollectionType", "name": "collectionType", "type": "uint8" }, + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "address", "name": "currency", "type": "address" }, + { "internalType": "address", "name": "signer", "type": "address" }, + { "internalType": "uint256", "name": "startTime", "type": "uint256" }, + { "internalType": "uint256", "name": "endTime", "type": "uint256" }, + { "internalType": "uint256", "name": "price", "type": "uint256" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Maker", + "name": "makerAsk", + "type": "tuple" + }, + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "bytes32", "name": "orderHash", "type": "bytes32" } + ], + "name": "restrictedExecuteTakerBid", + "outputs": [{ "internalType": "uint256", "name": "protocolFeeAmount", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "strategyInfo", + "outputs": [ + { "internalType": "bool", "name": "isActive", "type": "bool" }, + { "internalType": "uint16", "name": "standardProtocolFeeBp", "type": "uint16" }, + { "internalType": "uint16", "name": "minTotalFeeBp", "type": "uint16" }, + { "internalType": "uint16", "name": "maxProtocolFeeBp", "type": "uint16" }, + { "internalType": "bytes4", "name": "selector", "type": "bytes4" }, + { "internalType": "bool", "name": "isMakerBid", "type": "bool" }, + { "internalType": "address", "name": "implementation", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "transferManager", + "outputs": [{ "internalType": "contract TransferManager", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newCreatorFeeManager", "type": "address" }], + "name": "updateCreatorFeeManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "currency", "type": "address" }, + { "internalType": "bool", "name": "isAllowed", "type": "bool" } + ], + "name": "updateCurrencyStatus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateDomainSeparator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newGasLimitETHTransfer", "type": "uint256" }], + "name": "updateETHGasLimitForTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "newMaxCreatorFeeBp", "type": "uint16" }], + "name": "updateMaxCreatorFeeBp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newProtocolFeeRecipient", "type": "address" }], + "name": "updateProtocolFeeRecipient", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "internalType": "bool", "name": "isActive", "type": "bool" }, + { "internalType": "uint16", "name": "newStandardProtocolFee", "type": "uint16" }, + { "internalType": "uint16", "name": "newMinTotalFee", "type": "uint16" } + ], + "name": "updateStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "userBidAskNonces", + "outputs": [ + { "internalType": "uint256", "name": "bidNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "askNonce", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "userOrderNonce", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "userSubsetNonce", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + } + ], + "fullNamespace": "LooksRareProtocol", + "args": [ + "0xdf2c3dace6f31e650fd03b8ff72bee82cb1c199a", + "0xdf2c3dace6f31e650fd03b8ff72bee82cb1c199a", + "0x7AAC4C1407f5F83256581eCc913dC8b20F7bdab1", + "0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6" + ], + "encodedArgs": "0xdf2c3dace6f31e650fd03b8ff72bee82cb1c199adf2c3dace6f31e650fd03b8ff72bee82cb1c199a7aac4c1407f5f83256581ecc913dc8b20f7bdab1b4fbf271143f4fbf7b91a5ded31805e42b2208d6", + "tx": "0xaf695468ed6ad7ce6cdf04fb553e658dc268f45dea036119e636b272bf2db9ce" + }, + "transfer-manager": { + "address": "0x7AAC4C1407f5F83256581eCc913dC8b20F7bdab1", + "abi": [ + { + "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "AmountInvalid", "type": "error" }, + { "inputs": [], "name": "ERC1155SafeBatchTransferFromFail", "type": "error" }, + { "inputs": [], "name": "ERC1155SafeTransferFromFail", "type": "error" }, + { "inputs": [], "name": "ERC721TransferFromFail", "type": "error" }, + { "inputs": [], "name": "LengthsInvalid", "type": "error" }, + { "inputs": [], "name": "NoOngoingTransferInProgress", "type": "error" }, + { "inputs": [], "name": "NotAContract", "type": "error" }, + { "inputs": [], "name": "NotOwner", "type": "error" }, + { "inputs": [], "name": "OperatorAlreadyAllowed", "type": "error" }, + { "inputs": [], "name": "OperatorAlreadyApprovedByUser", "type": "error" }, + { "inputs": [], "name": "OperatorNotAllowed", "type": "error" }, + { "inputs": [], "name": "OperatorNotApprovedByUser", "type": "error" }, + { "inputs": [], "name": "RenouncementNotInProgress", "type": "error" }, + { "inputs": [], "name": "TransferAlreadyInProgress", "type": "error" }, + { "inputs": [], "name": "TransferCallerInvalid", "type": "error" }, + { "inputs": [], "name": "TransferNotInProgress", "type": "error" }, + { "inputs": [], "name": "WrongPotentialOwner", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "address[]", "name": "operators", "type": "address[]" } + ], + "name": "ApprovalsGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "address[]", "name": "operators", "type": "address[]" } + ], + "name": "ApprovalsRemoved", + "type": "event" + }, + { "anonymous": false, "inputs": [], "name": "CancelOwnershipTransfer", "type": "event" }, + { "anonymous": false, "inputs": [], "name": "InitiateOwnershipRenouncement", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "potentialOwner", "type": "address" } + ], + "name": "InitiateOwnershipTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "NewOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "operator", "type": "address" }], + "name": "OperatorAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "operator", "type": "address" }], + "name": "OperatorRemoved", + "type": "event" + }, + { + "inputs": [{ "internalType": "address", "name": "operator", "type": "address" }], + "name": "allowOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "cancelOwnershipTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "confirmOwnershipRenouncement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "confirmOwnershipTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address[]", "name": "operators", "type": "address[]" }], + "name": "grantApprovals", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "hasUserApprovedOperator", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initiateOwnershipRenouncement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newPotentialOwner", "type": "address" }], + "name": "initiateOwnershipTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "isOperatorAllowed", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ownershipStatus", + "outputs": [{ "internalType": "enum IOwnableTwoSteps.Status", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "potentialOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "operator", "type": "address" }], + "name": "removeOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address[]", "name": "operators", "type": "address[]" }], + "name": "revokeApprovals", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "enum CollectionType", "name": "collectionType", "type": "uint8" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" } + ], + "internalType": "struct ITransferManager.BatchTransferItem[]", + "name": "items", + "type": "tuple[]" + }, + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" } + ], + "name": "transferBatchItemsAcrossCollections", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" } + ], + "name": "transferItemsERC1155", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" } + ], + "name": "transferItemsERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" } + ], + "name": "transferItemsHyperboard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" } + ], + "name": "transferItemsHypercert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "fullNamespace": "TransferManager", + "args": ["0xdf2c3dace6f31e650fd03b8ff72bee82cb1c199a"], + "encodedArgs": "0xdf2c3dace6f31e650fd03b8ff72bee82cb1c199a", + "tx": "0xdd3e6cf435bd446c9d53d74968396e82560443ca9629c4c2cfd521e389a85f1e" + }, + "order-validator": { + "address": "0x11cf91a633b292e90afc1dd063db9ce0b94a89ae", + "abi": [ + { + "inputs": [{ "internalType": "address", "name": "_looksRareProtocol", "type": "address" }], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "CRITERIA_GROUPS", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ERC1155_INTERFACE_ID", + "outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ERC721_INTERFACE_ID_1", + "outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ERC721_INTERFACE_ID_2", + "outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAGIC_VALUE_ORDER_NONCE_EXECUTED", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "enum QuoteType", "name": "quoteType", "type": "uint8" }, + { "internalType": "uint256", "name": "globalNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "subsetNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "orderNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "internalType": "enum CollectionType", "name": "collectionType", "type": "uint8" }, + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "address", "name": "currency", "type": "address" }, + { "internalType": "address", "name": "signer", "type": "address" }, + { "internalType": "uint256", "name": "startTime", "type": "uint256" }, + { "internalType": "uint256", "name": "endTime", "type": "uint256" }, + { "internalType": "uint256", "name": "price", "type": "uint256" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Maker", + "name": "makerOrder", + "type": "tuple" + }, + { "internalType": "bytes", "name": "signature", "type": "bytes" }, + { + "components": [ + { "internalType": "bytes32", "name": "root", "type": "bytes32" }, + { + "components": [ + { "internalType": "bytes32", "name": "value", "type": "bytes32" }, + { "internalType": "enum OrderStructs.MerkleTreeNodePosition", "name": "position", "type": "uint8" } + ], + "internalType": "struct OrderStructs.MerkleTreeNode[]", + "name": "proof", + "type": "tuple[]" + } + ], + "internalType": "struct OrderStructs.MerkleTree", + "name": "merkleTree", + "type": "tuple" + } + ], + "name": "checkMakerOrderValidity", + "outputs": [{ "internalType": "uint256[9]", "name": "validationCodes", "type": "uint256[9]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "enum QuoteType", "name": "quoteType", "type": "uint8" }, + { "internalType": "uint256", "name": "globalNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "subsetNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "orderNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "internalType": "enum CollectionType", "name": "collectionType", "type": "uint8" }, + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "address", "name": "currency", "type": "address" }, + { "internalType": "address", "name": "signer", "type": "address" }, + { "internalType": "uint256", "name": "startTime", "type": "uint256" }, + { "internalType": "uint256", "name": "endTime", "type": "uint256" }, + { "internalType": "uint256", "name": "price", "type": "uint256" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Maker[]", + "name": "makerOrders", + "type": "tuple[]" + }, + { "internalType": "bytes[]", "name": "signatures", "type": "bytes[]" }, + { + "components": [ + { "internalType": "bytes32", "name": "root", "type": "bytes32" }, + { + "components": [ + { "internalType": "bytes32", "name": "value", "type": "bytes32" }, + { "internalType": "enum OrderStructs.MerkleTreeNodePosition", "name": "position", "type": "uint8" } + ], + "internalType": "struct OrderStructs.MerkleTreeNode[]", + "name": "proof", + "type": "tuple[]" + } + ], + "internalType": "struct OrderStructs.MerkleTree[]", + "name": "merkleTrees", + "type": "tuple[]" + } + ], + "name": "checkMultipleMakerOrderValidities", + "outputs": [{ "internalType": "uint256[9][]", "name": "validationCodes", "type": "uint256[9][]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "creatorFeeManager", + "outputs": [{ "internalType": "contract ICreatorFeeManager", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "deriveProtocolParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "domainSeparator", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "looksRareProtocol", + "outputs": [{ "internalType": "contract LooksRareProtocol", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxCreatorFeeBp", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "transferManager", + "outputs": [{ "internalType": "contract TransferManager", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + } + ], + "fullNamespace": "OrderValidatorV2A", + "args": ["0x4072ABD45a95c56372eAA00059B101C95191ea2A"], + "encodedArgs": "0x4072abd45a95c56372eaa00059b101c95191ea2a", + "tx": "0xebbaed0b616b5e4acce94c7de515f99722fec238e7cb3d2a6b6e6c102e9606b3" + }, + "strategy-collection-offer": { + "address": "0x478b6d99efa2689649762a4b4e2590872184078f", + "abi": [ + { "inputs": [], "name": "MerkleProofInvalid", "type": "error" }, + { "inputs": [], "name": "OrderInvalid", "type": "error" }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Taker", + "name": "takerAsk", + "type": "tuple" + }, + { + "components": [ + { "internalType": "enum QuoteType", "name": "quoteType", "type": "uint8" }, + { "internalType": "uint256", "name": "globalNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "subsetNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "orderNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "internalType": "enum CollectionType", "name": "collectionType", "type": "uint8" }, + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "address", "name": "currency", "type": "address" }, + { "internalType": "address", "name": "signer", "type": "address" }, + { "internalType": "uint256", "name": "startTime", "type": "uint256" }, + { "internalType": "uint256", "name": "endTime", "type": "uint256" }, + { "internalType": "uint256", "name": "price", "type": "uint256" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Maker", + "name": "makerBid", + "type": "tuple" + } + ], + "name": "executeCollectionStrategyWithTakerAsk", + "outputs": [ + { "internalType": "uint256", "name": "price", "type": "uint256" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "bool", "name": "isNonceInvalidated", "type": "bool" } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Taker", + "name": "takerAsk", + "type": "tuple" + }, + { + "components": [ + { "internalType": "enum QuoteType", "name": "quoteType", "type": "uint8" }, + { "internalType": "uint256", "name": "globalNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "subsetNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "orderNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "internalType": "enum CollectionType", "name": "collectionType", "type": "uint8" }, + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "address", "name": "currency", "type": "address" }, + { "internalType": "address", "name": "signer", "type": "address" }, + { "internalType": "uint256", "name": "startTime", "type": "uint256" }, + { "internalType": "uint256", "name": "endTime", "type": "uint256" }, + { "internalType": "uint256", "name": "price", "type": "uint256" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Maker", + "name": "makerBid", + "type": "tuple" + } + ], + "name": "executeCollectionStrategyWithTakerAskWithProof", + "outputs": [ + { "internalType": "uint256", "name": "price", "type": "uint256" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "bool", "name": "isNonceInvalidated", "type": "bool" } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "isLooksRareV2Strategy", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "enum QuoteType", "name": "quoteType", "type": "uint8" }, + { "internalType": "uint256", "name": "globalNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "subsetNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "orderNonce", "type": "uint256" }, + { "internalType": "uint256", "name": "strategyId", "type": "uint256" }, + { "internalType": "enum CollectionType", "name": "collectionType", "type": "uint8" }, + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "address", "name": "currency", "type": "address" }, + { "internalType": "address", "name": "signer", "type": "address" }, + { "internalType": "uint256", "name": "startTime", "type": "uint256" }, + { "internalType": "uint256", "name": "endTime", "type": "uint256" }, + { "internalType": "uint256", "name": "price", "type": "uint256" }, + { "internalType": "uint256[]", "name": "itemIds", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "bytes", "name": "additionalParameters", "type": "bytes" } + ], + "internalType": "struct OrderStructs.Maker", + "name": "makerBid", + "type": "tuple" + }, + { "internalType": "bytes4", "name": "functionSelector", "type": "bytes4" } + ], + "name": "isMakerOrderValid", + "outputs": [ + { "internalType": "bool", "name": "isValid", "type": "bool" }, + { "internalType": "bytes4", "name": "errorSelector", "type": "bytes4" } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "fullNamespace": "StrategyCollectionOffer", + "args": [], + "encodedArgs": "0x", + "tx": "0xbd5e6bbb524df8747ef58974f6dd68f5ad41db59183d1849e6b9b588d777eefa" + } +} diff --git a/contracts/src/deployments/deployments-protocol.json b/contracts/src/deployments/deployments-protocol.json new file mode 100644 index 00000000..1ed7832c --- /dev/null +++ b/contracts/src/deployments/deployments-protocol.json @@ -0,0 +1,24 @@ +{ + "5": { + "HypercertMinterUUPS": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", + "HypercertMinterImplementation": "0x0a00a2f09cd37b24e7429c5238323bfebcff3ed9", + "TransferManager": "0xeec4DFb4A230e92c854a643130BA7F89617CD8e6", + "HypercertExchange": "0x54E196903c7E71182025aBa9DBE5Dd136755D05a", + "OrderValidatorV2A": "0x9626265537c50528a6579e23d44f4d877d27af0b" + }, + "11155111": { + "HypercertMinterUUPS": "0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941", + "HypercertMinterImplementation": "0x0a0df97bddb36eef95fef089a4aeb7aceabf2101", + "TransferManager": "0x7AAC4C1407f5F83256581eCc913dC8b20F7bdab1", + "HypercertExchange": "0x4072ABD45a95c56372eAA00059B101C95191ea2A", + "OrderValidatorV2A": "0x11cf91a633b292e90afc1dd063db9ce0b94a89ae" + }, + "10": { + "HypercertMinterUUPS": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", + "HypercertMinterImplementation": "0x396d5f1ef3aa92ddad4dead04388374a03bc5577" + }, + "42220": { + "HypercertMinterUUPS": "0x16bA53B74c234C870c61EFC04cD418B8f2865959", + "HypercertMinterImplementation": "0x620257e9301a813be7cc5b75aae8dda3f6a926d2" + } +} diff --git a/contracts/src/deployments/index.ts b/contracts/src/deployments/index.ts new file mode 100644 index 00000000..8adbeb2c --- /dev/null +++ b/contracts/src/deployments/index.ts @@ -0,0 +1,10 @@ +import deployments_marketplace_goerli from "./deployment-marketplace-goerli.json"; +import deployments_marketplace_sepolia from "./deployment-marketplace-sepolia.json"; +import deployments_protocol from "./deployments-protocol.json"; + +const deployments_marketplace = { + "5": deployments_marketplace_goerli, + "11155111": deployments_marketplace_sepolia, +}; + +export default { marketplace: deployments_marketplace, protocol: deployments_protocol }; diff --git a/contracts/src/index.ts b/contracts/src/index.ts index 486b728b..ee478287 100644 --- a/contracts/src/index.ts +++ b/contracts/src/index.ts @@ -1,10 +1,28 @@ -import HypercertMinterAbi from "./abi/HypercertMinter.json"; -// import { HypercertMinter__factory } from "./types/factories/src/HypercertMinter__factory"; -import type { AllowlistMinter } from "./types/src/AllowlistMinter"; -import type { HypercertMinter } from "./types/src/HypercertMinter"; -import type { IAllowlist } from "./types/src/interfaces/IAllowlist"; -import type { IHypercertToken } from "./types/src/interfaces/IHypercertToken"; -import type { Errors } from "./types/src/libs/Errors"; +import DEPLOYMENTS from "./deployments"; + +import HypercertMinterAbi from "../abi/src/protocol/HypercertMinter.sol/HypercertMinter.json"; +import HypercertExchangeAbi from "../abi/src/marketplace/LooksRareProtocol.sol/LooksRareProtocol.json"; +import OrderValidatorV2AAbi from "../abi/src/marketplace/helpers/OrderValidatorV2A.sol/OrderValidatorV2A.json"; +import StrategyManagerAbi from "../abi/src/marketplace/StrategyManager.sol/StrategyManager.json"; +import TransferManagerAbi from "../abi/src/marketplace/TransferManager.sol/TransferManager.json"; +import StrategyCollectionOfferAbi from "../abi/src/marketplace/executionStrategies/StrategyCollectionOffer.sol/StrategyCollectionOffer.json"; +import StrategyHypercertFractionOfferAbi from "../abi/src/marketplace/executionStrategies/StrategyHypercertFractionOffer.sol/StrategyHypercertFractionOffer.json"; +import CreatorFeeManagerWithRoyaltiesAbi from "../abi/src/marketplace/CreatorFeeManagerWithRoyalties.sol/CreatorFeeManagerWithRoyalties.json"; +import ExecutionManagerAbi from "../abi/src/marketplace/ExecutionManager.sol/ExecutionManager.json"; + +import { + ExecutionManager, + HypercertMinter, + IHypercertToken, + LooksRareProtocol as HypercertExchange, + ILooksRareProtocol as IHypercertExchange, + TransferManager, + StrategyCollectionOffer, + StrategyHypercertFractionOffer, + CreatorFeeManagerWithRoyalties, + OrderValidatorV2A, +} from "types"; + /* in order to adjust the build folder: 1) import any files here you want in the final build package. @@ -13,15 +31,71 @@ import type { Errors } from "./types/src/libs/Errors"; 4) bump package.json version to publish a new package to npm. */ -// Factory -// export { HypercertMinter__factory }; +export type DeploymentProtocol = { + HypercertMinterUUPS: `0x${string}`; + HypercertMinterImplementation: `0x${string}`; + TransferManager?: `0x${string}`; + HypercertExchange?: `0x${string}`; +}; -// Interfaces -export { IAllowlist, IHypercertToken }; -export { HypercertMinterAbi }; +export type DeploymentMarketplace = { + HypercertExchange: `0x${string}`; + TransferManager: `0x${string}`; + OrderValidatorV2A: `0x${string}`; +}; + +export type Deployment = DeploymentProtocol & Partial; +export type DeployedChains = keyof typeof DEPLOYMENTS.protocol; -// Contracts -export { HypercertMinter, AllowlistMinter }; +// Deployments +const deployments = { + 5: { + ...DEPLOYMENTS.protocol["5"], + HypercertExchange: DEPLOYMENTS.marketplace[5].HypercertExchange.address, + TransferManager: DEPLOYMENTS.marketplace[5].TransferManager.address, + OrderValidatorV2A: DEPLOYMENTS.marketplace[5].OrderValidator.address, + }, + 10: { + ...DEPLOYMENTS.protocol["10"], + }, + 42220: { + ...DEPLOYMENTS.protocol[42220], + }, + 11155111: { + ...DEPLOYMENTS.protocol["11155111"], + }, +} as Record; -// Libs -export { Errors }; +const asDeployedChain = (chainId: string | number) => { + if (chainId in deployments) return chainId as DeployedChains; + throw new Error(`Chain ${chainId} not deployed`); +}; + +export { deployments, asDeployedChain }; + +// Abis +export { + CreatorFeeManagerWithRoyaltiesAbi, + ExecutionManagerAbi, + HypercertMinterAbi, + HypercertExchangeAbi, + OrderValidatorV2AAbi, + StrategyManagerAbi, + StrategyCollectionOfferAbi, + StrategyHypercertFractionOfferAbi, + TransferManagerAbi, +}; + +// Interfaces +export type { + CreatorFeeManagerWithRoyalties, + ExecutionManager, + IHypercertExchange, + IHypercertToken, + HypercertExchange, + HypercertMinter, + OrderValidatorV2A, + TransferManager, + StrategyCollectionOffer, + StrategyHypercertFractionOffer, +}; diff --git a/contracts/src/marketplace/BatchOrderTypehashRegistry.sol b/contracts/src/marketplace/BatchOrderTypehashRegistry.sol new file mode 100644 index 00000000..9710a735 --- /dev/null +++ b/contracts/src/marketplace/BatchOrderTypehashRegistry.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Shared errors +import {MerkleProofTooLarge} from "./errors/SharedErrors.sol"; + +/** + * @title BatchOrderTypehashRegistry + * @notice The contract generates the batch order hash that is used to compute the digest for signature verification. + * @author LooksRare protocol team (👀,💎) + */ +contract BatchOrderTypehashRegistry { + /** + * @notice This function returns the hash of the concatenation of batch order type hash and merkle root. + * @param root Merkle root + * @param proofLength Merkle proof length + * @return batchOrderHash The batch order hash + */ + function hashBatchOrder(bytes32 root, uint256 proofLength) public pure returns (bytes32 batchOrderHash) { + batchOrderHash = keccak256(abi.encode(_getBatchOrderTypehash(proofLength), root)); + } + + /** + * @dev It looks like this for each height + * height == 1: BatchOrder(Maker[2] tree)Maker(uint8 quoteType,uint256 globalNonce,uint256 subsetNonce,uint256 + * orderNonce,uint256 strategyId,uint8 collectionType,address collection,address currency,address signer,uint256 + * startTime,uint256 endTime,uint256 price,uint256[] itemIds,uint256[] amounts,bytes additionalParameters) + * height == 2: BatchOrder(Maker[2][2] tree)Maker(uint8 quoteType,uint256 globalNonce,uint256 + * subsetNonce,uint256 orderNonce,uint256 strategyId,uint8 collectionType,address collection,address + * currency,address signer,uint256 startTime,uint256 endTime,uint256 price,uint256[] itemIds,uint256[] amounts,bytes + * additionalParameters) + * height == n: BatchOrder(Maker[2]...[2] tree)Maker(uint8 quoteType,uint256 globalNonce,uint256 + * subsetNonce,uint256 orderNonce,uint256 strategyId,uint8 collectionType,address collection,address + * currency,address signer,uint256 startTime,uint256 endTime,uint256 price,uint256[] itemIds,uint256[] amounts,bytes + * additionalParameters) + */ + function _getBatchOrderTypehash(uint256 height) internal pure returns (bytes32 typehash) { + if (height == 1) { + typehash = hex"9661287f7a4aa4867db46a2453ee15bebac4e8fc25667a58718da658f15de643"; + } else if (height == 2) { + typehash = hex"a54ab330ea9e1dfccee2b86f3666989e7fbd479704416c757c8de8e820142a08"; + } else if (height == 3) { + typehash = hex"93390f5d45ede9dea305f16aec86b2472af4f823851637f1b7019ad0775cea49"; + } else if (height == 4) { + typehash = hex"9dda2c8358da895e43d574bb15954ce5727b22e923a2d8f28261f297bce42f0b"; + } else if (height == 5) { + typehash = hex"92dc717124e161262f9d10c7079e7d54dc51271893fba54aa4a0f270fecdcc98"; + } else if (height == 6) { + typehash = hex"ce02aee5a7a35d40d974463c4c6e5534954fb07a7e7bc966fee268a15337bfd8"; + } else if (height == 7) { + typehash = hex"f7a65efd167a18f7091b2bb929d687dd94503cf0a43620487055ed7d6b727559"; + } else if (height == 8) { + typehash = hex"def24acacad1318b664520f7c10e8bc6d1e7f6f6f7c8b031e70624ceb42266a6"; + } else if (height == 9) { + typehash = hex"4cb4080dc4e7bae88b4dc4307ad5117fa4f26195998a1b5f40368809d7f4c7f2"; + } else if (height == 10) { + typehash = hex"f8b1f864164d8d6e0b45f1399bd711223117a4ab0b057a9c2d7779e86a7c88db"; + } else { + revert MerkleProofTooLarge(height); + } + } +} diff --git a/contracts/src/marketplace/CreatorFeeManagerWithRebates.sol b/contracts/src/marketplace/CreatorFeeManagerWithRebates.sol new file mode 100644 index 00000000..3a1de368 --- /dev/null +++ b/contracts/src/marketplace/CreatorFeeManagerWithRebates.sol @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {IERC2981} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC2981.sol"; + +// Interfaces +import {ICreatorFeeManager} from "./interfaces/ICreatorFeeManager.sol"; +import {IRoyaltyFeeRegistry} from "./interfaces/IRoyaltyFeeRegistry.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "./constants/NumericConstants.sol"; + +/** + * @title CreatorFeeManagerWithRebates + * @notice This contract returns the creator fee address and the creator rebate amount. + * @author LooksRare protocol team (👀,💎) + */ +contract CreatorFeeManagerWithRebates is ICreatorFeeManager { + /** + * @notice Standard royalty fee (in basis point). + */ + uint256 public constant STANDARD_ROYALTY_FEE_BP = 50; + + /** + * @notice Royalty fee registry interface. + */ + IRoyaltyFeeRegistry public immutable royaltyFeeRegistry; + + /** + * @notice Constructor + * @param _royaltyFeeRegistry Royalty fee registry address. + */ + constructor(address _royaltyFeeRegistry) { + royaltyFeeRegistry = IRoyaltyFeeRegistry(_royaltyFeeRegistry); + } + + /** + * @inheritdoc ICreatorFeeManager + */ + function viewCreatorFeeInfo(address collection, uint256 price, uint256[] memory itemIds) + external + view + returns (address creator, uint256 creatorFeeAmount) + { + // Check if there is a royalty info in the system + (creator,) = royaltyFeeRegistry.royaltyInfo(collection, price); + + if (creator == address(0)) { + if (IERC2981(collection).supportsInterface(IERC2981.royaltyInfo.selector)) { + uint256 length = itemIds.length; + + for (uint256 i; i < length;) { + try IERC2981(collection).royaltyInfo(itemIds[i], price) returns ( + address newCreator, uint256 /* newCreatorFeeAmount */ + ) { + if (i == 0) { + creator = newCreator; + + unchecked { + ++i; + } + continue; + } + + if (newCreator != creator) { + revert BundleEIP2981NotAllowed(collection); + } + } catch { + // If creator address is not 0, that means there was at least 1 + // successful call. If all royaltyInfo calls fail, it should assume + // 0 royalty. + // If the first call reverts, even if creator is address(0), subsequent + // successful calls will still revert above with BundleEIP2981NotAllowed + // because newCreator will be different from creator. + if (creator != address(0)) { + revert BundleEIP2981NotAllowed(collection); + } + } + + unchecked { + ++i; + } + } + } + } + + // A fixed royalty fee is applied + if (creator != address(0)) { + creatorFeeAmount = (STANDARD_ROYALTY_FEE_BP * price) / ONE_HUNDRED_PERCENT_IN_BP; + } + } +} diff --git a/contracts/src/marketplace/CreatorFeeManagerWithRoyalties.sol b/contracts/src/marketplace/CreatorFeeManagerWithRoyalties.sol new file mode 100644 index 00000000..a50dde6a --- /dev/null +++ b/contracts/src/marketplace/CreatorFeeManagerWithRoyalties.sol @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {IERC2981} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC2981.sol"; + +// Interfaces +import {ICreatorFeeManager} from "./interfaces/ICreatorFeeManager.sol"; +import {IRoyaltyFeeRegistry} from "./interfaces/IRoyaltyFeeRegistry.sol"; + +/** + * @title CreatorFeeManagerWithRoyalties + * @notice This contract returns the creator fee address and the creator fee amount. + * @author LooksRare protocol team (👀,💎) + */ +contract CreatorFeeManagerWithRoyalties is ICreatorFeeManager { + /** + * @notice Royalty fee registry interface. + */ + IRoyaltyFeeRegistry public immutable royaltyFeeRegistry; + + /** + * @notice Constructor + * @param _royaltyFeeRegistry Royalty fee registry address. + */ + constructor(address _royaltyFeeRegistry) { + royaltyFeeRegistry = IRoyaltyFeeRegistry(_royaltyFeeRegistry); + } + + /** + * @inheritdoc ICreatorFeeManager + * @dev There are two on-chain sources for the royalty fee to distribute. + * 1. RoyaltyFeeRegistry: It is an on-chain registry where creator fee is defined + * for all items of a collection. + * 2. ERC2981: The NFT Royalty Standard where royalty fee is defined at a itemId level in a collection. + * The on-chain logic looks up the registry first. If it does not find anything, + * it checks if a collection is ERC2981. If so, it fetches the proper royalty information for the itemId. + * For a bundle that contains multiple itemIds (for a collection using ERC2981), if the royalty fee/recipient + * differ among the itemIds part of the bundle, the trade reverts. + * This contract DOES NOT enforce any restriction for extremely high creator fee, + * nor verifies the creator fee fetched is inferior to the total price. + * If any contract relies on it to build an on-chain royalty logic, + * it should implement protection against: + * (1) high royalties + * (2) potential unexpected royalty changes that can occur after the creation of the order. + */ + function viewCreatorFeeInfo(address collection, uint256 price, uint256[] memory itemIds) + external + view + returns (address creator, uint256 creatorFeeAmount) + { + // Check if there is a royalty info in the system + (creator, creatorFeeAmount) = royaltyFeeRegistry.royaltyInfo(collection, price); + + if (creator == address(0)) { + if (IERC2981(collection).supportsInterface(IERC2981.royaltyInfo.selector)) { + uint256 length = itemIds.length; + + for (uint256 i; i < length;) { + try IERC2981(collection).royaltyInfo(itemIds[i], price) returns ( + address newCreator, uint256 newCreatorFeeAmount + ) { + if (i == 0) { + creator = newCreator; + creatorFeeAmount = newCreatorFeeAmount; + + unchecked { + ++i; + } + continue; + } + + if (newCreator != creator || newCreatorFeeAmount != creatorFeeAmount) { + revert BundleEIP2981NotAllowed(collection); + } + } catch { + // If creator address is not 0, that means there was at least 1 + // successful call. If all royaltyInfo calls fail, it should assume + // 0 royalty. + // If the first call reverts, even if creator is address(0), subsequent + // successful calls will still revert above with BundleEIP2981NotAllowed + // because newCreator/newCreatorFeeAmount will be different from creator/creatorFeeAmount. + if (creator != address(0)) { + revert BundleEIP2981NotAllowed(collection); + } + } + + unchecked { + ++i; + } + } + } + } + } +} diff --git a/contracts/src/marketplace/CurrencyManager.sol b/contracts/src/marketplace/CurrencyManager.sol new file mode 100644 index 00000000..f72b5471 --- /dev/null +++ b/contracts/src/marketplace/CurrencyManager.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {OwnableTwoSteps} from "@looksrare/contracts-libs/contracts/OwnableTwoSteps.sol"; + +// Interfaces +import {ICurrencyManager} from "./interfaces/ICurrencyManager.sol"; + +/** + * @title CurrencyManager + * @notice This contract manages the list of valid fungible currencies. + * @author LooksRare protocol team (👀,💎) + */ +contract CurrencyManager is ICurrencyManager, OwnableTwoSteps { + /** + * @notice It checks whether the currency is allowed for transacting. + */ + mapping(address => bool) public isCurrencyAllowed; + + /** + * @notice Constructor + * @param _owner Owner address + */ + constructor(address _owner) OwnableTwoSteps(_owner) {} + + /** + * @notice This function allows the owner to update the status of a currency. + * @param currency Currency address (address(0) for ETH) + * @param isAllowed Whether the currency should be allowed for trading + * @dev Only callable by owner. + */ + function updateCurrencyStatus(address currency, bool isAllowed) external onlyOwner { + isCurrencyAllowed[currency] = isAllowed; + emit CurrencyStatusUpdated(currency, isAllowed); + } +} diff --git a/contracts/src/marketplace/ExecutionManager.sol b/contracts/src/marketplace/ExecutionManager.sol new file mode 100644 index 00000000..ab421a71 --- /dev/null +++ b/contracts/src/marketplace/ExecutionManager.sol @@ -0,0 +1,305 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries +import {OrderStructs} from "./libraries/OrderStructs.sol"; + +// Interfaces +import {IExecutionManager} from "./interfaces/IExecutionManager.sol"; +import {ICreatorFeeManager} from "./interfaces/ICreatorFeeManager.sol"; +import {IHypercertToken} from "../protocol/interfaces/IHypercertToken.sol"; + +// Direct dependencies +import {InheritedStrategy} from "./InheritedStrategy.sol"; +import {NonceManager} from "./NonceManager.sol"; +import {StrategyManager} from "./StrategyManager.sol"; + +// Assembly +import { + NoSelectorForStrategy_error_selector, + NoSelectorForStrategy_error_length, + OutsideOfTimeRange_error_selector, + OutsideOfTimeRange_error_length, + Error_selector_offset +} from "./constants/AssemblyConstants.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "./constants/NumericConstants.sol"; + +// Enums +import {QuoteType} from "./enums/QuoteType.sol"; +import {CollectionType} from "./enums/CollectionType.sol"; + +/** + * @title ExecutionManager + * @notice This contract handles the execution and resolution of transactions. A transaction is executed on-chain + * when an off-chain maker order is matched by on-chain taker order of a different kind. + * For instance, a taker ask is executed against a maker bid (or a taker bid against a maker ask). + * @author LooksRare protocol team (👀,💎); bitbeckers; + */ +contract ExecutionManager is InheritedStrategy, NonceManager, StrategyManager, IExecutionManager { + /** + * @notice Protocol fee recipient. + */ + address public protocolFeeRecipient; + + /** + * @notice Maximum creator fee (in basis point). + */ + uint16 public maxCreatorFeeBp = 1000; + + /** + * @notice Creator fee manager. + */ + ICreatorFeeManager public creatorFeeManager; + + /** + * @notice Constructor + * @param _owner Owner address + * @param _protocolFeeRecipient Protocol fee recipient address + */ + constructor(address _owner, address _protocolFeeRecipient) StrategyManager(_owner) { + _updateProtocolFeeRecipient(_protocolFeeRecipient); + } + + /** + * @notice This function allows the owner to update the creator fee manager address. + * @param newCreatorFeeManager Address of the creator fee manager + * @dev Only callable by owner. + */ + function updateCreatorFeeManager(address newCreatorFeeManager) external onlyOwner { + creatorFeeManager = ICreatorFeeManager(newCreatorFeeManager); + emit NewCreatorFeeManager(newCreatorFeeManager); + } + + /** + * @notice This function allows the owner to update the maximum creator fee (in basis point). + * @param newMaxCreatorFeeBp New maximum creator fee (in basis point) + * @dev The maximum value that can be set is 25%. + * Only callable by owner. + */ + function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external onlyOwner { + if (newMaxCreatorFeeBp > 2500) { + revert CreatorFeeBpTooHigh(); + } + + maxCreatorFeeBp = newMaxCreatorFeeBp; + + emit NewMaxCreatorFeeBp(newMaxCreatorFeeBp); + } + + /** + * @notice This function allows the owner to update the protocol fee recipient. + * @param newProtocolFeeRecipient New protocol fee recipient address + * @dev Only callable by owner. + */ + function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external onlyOwner { + _updateProtocolFeeRecipient(newProtocolFeeRecipient); + } + + /** + * @notice This function is internal and is used to execute a transaction initiated by a taker order. + * @param takerOrder Taker order struct (taker specific parameters for the execution) + * @param makerOrder Maker order struct (maker specific parameter for the execution) + * @param sender The address that sent the transaction + * @return itemIds Array of item ids to be traded + * @return amounts Array of amounts for each item id + * @return recipients Array of recipient addresses + * @return feeAmounts Array of fee amounts + * @return isNonceInvalidated Whether the order's nonce will be invalidated after executing the order + */ + function _executeStrategyForTakerOrder( + OrderStructs.Taker calldata takerOrder, + OrderStructs.Maker calldata makerOrder, + address sender + ) + internal + returns ( + uint256[] memory itemIds, + uint256[] memory amounts, + address[2] memory recipients, + uint256[3] memory feeAmounts, + bool isNonceInvalidated + ) + { + uint256 price; + + // Verify the order validity for timestamps + _verifyOrderTimestampValidity(makerOrder.startTime, makerOrder.endTime); + + if (makerOrder.strategyId == 0) { + _verifyItemIdsAndAmountsEqualLengthsAndValidAmounts(makerOrder.amounts, makerOrder.itemIds); + (price, itemIds, amounts) = (makerOrder.price, makerOrder.itemIds, makerOrder.amounts); + isNonceInvalidated = true; + } else { + if (strategyInfo[makerOrder.strategyId].isActive) { + /** + * @dev This is equivalent to + * + * if (makerOrder.quoteType == QuoteType.Bid) { + * if (!strategyInfo[makerOrder.strategyId].isMakerBid) { + * revert NoSelectorForStrategy(); + * } + * } else { + * if (strategyInfo[makerOrder.strategyId].isMakerBid) { + * revert NoSelectorForStrategy(); + * } + * } + * + * because one must be 0 and another must be 1 for the function + * to not revert. + * + * Both quoteType (an enum with 2 values) and isMakerBid (a bool) + * can only be 0 or 1. + */ + QuoteType quoteType = makerOrder.quoteType; + bool isMakerBid = strategyInfo[makerOrder.strategyId].isMakerBid; + assembly { + if eq(quoteType, isMakerBid) { + mstore(0x00, NoSelectorForStrategy_error_selector) + revert(Error_selector_offset, NoSelectorForStrategy_error_length) + } + } + + (bool status, bytes memory data) = strategyInfo[makerOrder.strategyId].implementation.call( + abi.encodeWithSelector(strategyInfo[makerOrder.strategyId].selector, takerOrder, makerOrder) + ); + + if (!status) { + // @dev It forwards the revertion message from the low-level call + assembly { + revert(add(data, 32), mload(data)) + } + } + + (price, itemIds, amounts, isNonceInvalidated) = abi.decode(data, (uint256, uint256[], uint256[], bool)); + } else { + revert StrategyNotAvailable(makerOrder.strategyId); + } + } + + // Creator fee and adjustment of protocol fee + (recipients[1], feeAmounts[1]) = + _getCreatorRecipientAndCalculateFeeAmount(makerOrder.collection, price, itemIds); + if (makerOrder.quoteType == QuoteType.Bid) { + _setTheRestOfFeeAmountsAndRecipients( + makerOrder.strategyId, + price, + takerOrder.recipient == address(0) ? sender : takerOrder.recipient, + feeAmounts, + recipients + ); + } else { + _setTheRestOfFeeAmountsAndRecipients( + makerOrder.strategyId, price, makerOrder.signer, feeAmounts, recipients + ); + } + } + + /** + * @notice This private function updates the protocol fee recipient. + * @param newProtocolFeeRecipient New protocol fee recipient address + */ + function _updateProtocolFeeRecipient(address newProtocolFeeRecipient) private { + if (newProtocolFeeRecipient == address(0)) { + revert NewProtocolFeeRecipientCannotBeNullAddress(); + } + + protocolFeeRecipient = newProtocolFeeRecipient; + emit NewProtocolFeeRecipient(newProtocolFeeRecipient); + } + + /** + * @notice This function is internal and is used to calculate + * the protocol fee amount for a set of fee amounts. + * @param price Transaction price + * @param strategyId Strategy id + * @param creatorFeeAmount Creator fee amount + * @param minTotalFeeAmount Min total fee amount + * @return protocolFeeAmount Protocol fee amount + */ + function _calculateProtocolFeeAmount( + uint256 price, + uint256 strategyId, + uint256 creatorFeeAmount, + uint256 minTotalFeeAmount + ) private view returns (uint256 protocolFeeAmount) { + protocolFeeAmount = (price * strategyInfo[strategyId].standardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP; + + if (protocolFeeAmount + creatorFeeAmount < minTotalFeeAmount) { + protocolFeeAmount = minTotalFeeAmount - creatorFeeAmount; + } + } + + /** + * @notice This function is internal and is used to get the creator fee address + * and calculate the creator fee amount. + * @param collection Collection address + * @param price Transaction price + * @param itemIds Array of item ids + * @return creator Creator recipient + * @return creatorFeeAmount Creator fee amount + */ + function _getCreatorRecipientAndCalculateFeeAmount(address collection, uint256 price, uint256[] memory itemIds) + private + view + returns (address creator, uint256 creatorFeeAmount) + { + if (address(creatorFeeManager) != address(0)) { + (creator, creatorFeeAmount) = creatorFeeManager.viewCreatorFeeInfo(collection, price, itemIds); + + if (creator == address(0)) { + // If recipient is null address, creator fee is set to 0 + creatorFeeAmount = 0; + } else if (creatorFeeAmount * ONE_HUNDRED_PERCENT_IN_BP > (price * uint256(maxCreatorFeeBp))) { + // If creator fee is higher than tolerated, it reverts + revert CreatorFeeBpTooHigh(); + } + } + } + + /** + * @dev This function does not need to return feeAmounts and recipients as they are modified + * in memory. + */ + function _setTheRestOfFeeAmountsAndRecipients( + uint256 strategyId, + uint256 price, + address askRecipient, + uint256[3] memory feeAmounts, + address[2] memory recipients + ) private view { + // Compute minimum total fee amount + uint256 minTotalFeeAmount = (price * strategyInfo[strategyId].minTotalFeeBp) / ONE_HUNDRED_PERCENT_IN_BP; + + if (feeAmounts[1] == 0) { + // If creator fee is null, protocol fee is set as the minimum total fee amount + feeAmounts[2] = minTotalFeeAmount; + // Net fee amount for seller + feeAmounts[0] = price - feeAmounts[2]; + } else { + // If there is a creator fee information, the protocol fee amount can be calculated + feeAmounts[2] = _calculateProtocolFeeAmount(price, strategyId, feeAmounts[1], minTotalFeeAmount); + // Net fee amount for seller + feeAmounts[0] = price - feeAmounts[1] - feeAmounts[2]; + } + + recipients[0] = askRecipient; + } + + /** + * @notice This function is internal and is used to verify the validity of an order + * in the context of the current block timestamps. + * @param startTime Start timestamp + * @param endTime End timestamp + */ + function _verifyOrderTimestampValidity(uint256 startTime, uint256 endTime) private view { + // if (startTime > block.timestamp || endTime < block.timestamp) revert OutsideOfTimeRange(); + assembly { + if or(gt(startTime, timestamp()), lt(endTime, timestamp())) { + mstore(0x00, OutsideOfTimeRange_error_selector) + revert(Error_selector_offset, OutsideOfTimeRange_error_length) + } + } + } +} diff --git a/contracts/src/marketplace/InheritedStrategy.sol b/contracts/src/marketplace/InheritedStrategy.sol new file mode 100644 index 00000000..93d09414 --- /dev/null +++ b/contracts/src/marketplace/InheritedStrategy.sol @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries +import {OrderStructs} from "./libraries/OrderStructs.sol"; + +// Shared errors +import {OrderInvalid} from "./errors/SharedErrors.sol"; + +// Assembly +import { + OrderInvalid_error_selector, + OrderInvalid_error_length, + Error_selector_offset, + OneWord +} from "./constants/AssemblyConstants.sol"; + +/** + * @title InheritedStrategy + * @notice This contract handles the verification of parameters for standard transactions. + * It does not verify the taker struct's itemIds and amounts array as well as + * minPrice (taker ask) / maxPrice (taker bid) because before the taker executes the + * transaction and the maker itemIds/amounts/price should have already been confirmed off-chain. + * @dev A standard transaction (bid or ask) is mapped to strategyId = 0. + * @author LooksRare protocol team (👀,💎) + */ +contract InheritedStrategy { + /** + * @notice This function is internal and is used to validate the parameters for a standard sale strategy + * when the standard transaction is initiated by a taker bid. + * @param amounts Array of amounts + * @param itemIds Array of item ids + */ + function _verifyItemIdsAndAmountsEqualLengthsAndValidAmounts(uint256[] calldata amounts, uint256[] calldata itemIds) + internal + pure + { + assembly { + let end + { + /* + * @dev If A == B, then A XOR B == 0. + * + * if (amountsLength == 0 || amountsLength != itemIdsLength) { + * revert OrderInvalid(); + * } + */ + let amountsLength := amounts.length + let itemIdsLength := itemIds.length + + if or(iszero(amountsLength), xor(amountsLength, itemIdsLength)) { + mstore(0x00, OrderInvalid_error_selector) + revert(Error_selector_offset, OrderInvalid_error_length) + } + + /** + * @dev Shifting left 5 times is equivalent to amountsLength * 32 bytes + */ + end := shl(5, amountsLength) + } + + let amountsOffset := amounts.offset + + for {} end {} { + /** + * @dev Starting from the end of the array minus 32 bytes to load the last item, + * ending with `end` equal to 0 to load the first item + * + * uint256 end = amountsLength; + * + * for (uint256 i = end - 1; i >= 0; i--) { + * uint256 amount = amounts[i]; + * if (amount == 0) { + * revert OrderInvalid(); + * } + * } + */ + end := sub(end, OneWord) + + let amount := calldataload(add(amountsOffset, end)) + + if iszero(amount) { + mstore(0x00, OrderInvalid_error_selector) + revert(Error_selector_offset, OrderInvalid_error_length) + } + } + } + } +} diff --git a/contracts/src/marketplace/LooksRareProtocol.sol b/contracts/src/marketplace/LooksRareProtocol.sol new file mode 100644 index 00000000..9f3eb107 --- /dev/null +++ b/contracts/src/marketplace/LooksRareProtocol.sol @@ -0,0 +1,665 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {SignatureCheckerCalldata} from "@looksrare/contracts-libs/contracts/SignatureCheckerCalldata.sol"; +import {LowLevelETHReturnETHIfAnyExceptOneWei} from + "@looksrare/contracts-libs/contracts/lowLevelCallers/LowLevelETHReturnETHIfAnyExceptOneWei.sol"; +import {LowLevelWETH} from "@looksrare/contracts-libs/contracts/lowLevelCallers/LowLevelWETH.sol"; +import {LowLevelERC20Transfer} from "@looksrare/contracts-libs/contracts/lowLevelCallers/LowLevelERC20Transfer.sol"; + +// OpenZeppelin's library (adjusted) for verifying Merkle proofs +import {MerkleProofCalldataWithNodes} from "./libraries/OpenZeppelin/MerkleProofCalldataWithNodes.sol"; + +// Libraries +import {OrderStructs} from "./libraries/OrderStructs.sol"; + +// Interfaces +import {ILooksRareProtocol} from "./interfaces/ILooksRareProtocol.sol"; +import {IHypercertToken} from "../protocol/interfaces/IHypercertToken.sol"; + +// Shared errors +import { + CallerInvalid, + CurrencyInvalid, + LengthsInvalid, + MerkleProofInvalid, + MerkleProofTooLarge, + QuoteTypeInvalid +} from "./errors/SharedErrors.sol"; + +// Direct dependencies +import {TransferSelectorNFT} from "./TransferSelectorNFT.sol"; +import {BatchOrderTypehashRegistry} from "./BatchOrderTypehashRegistry.sol"; + +// Constants +import {MAX_CALLDATA_PROOF_LENGTH, ONE_HUNDRED_PERCENT_IN_BP} from "./constants/NumericConstants.sol"; + +// Enums +import {QuoteType} from "./enums/QuoteType.sol"; +import {CollectionType} from "./enums/CollectionType.sol"; + +/** + * @title LooksRareProtocol + * @notice This contract is the core smart contract of the LooksRare protocol ("v2"). + * It is the main entry point for users to initiate transactions with taker orders + * and manage the cancellation of maker orders, which exist off-chain. + * ~~~~~~ + * ~~~~ ~~~~ + * ~~~ ~~~ + * ~~~ ~~~ + * ~~~ ~~~ + * ~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~ + * ~~~ ~~~~~~~~~ ~~~~ ~~~~ ~~~~~~~~~ ~~~ + * ~~~ ~~~~~~~ ~~~~~~~ ~~~ + * ~~~- ~~~~~~~~ ~~~~ + * ~~~ ~~~~ ~~~~ ~~~ + * ~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~ + * ~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~ + * ~~~ ~~~ ~~~ ~~~ + * ~~~ ~~~ ~~~~~~~~~~ ~~~ ~~~ + * ~~~~~ ~~~ ~~~~~~ ~~~~~~ ~~~ ~~~~~ + * ~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~ + * ~~~~~~ ~~~~ ~~~ ~~~ ~~~~ ~~~~~~ + * ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ + * ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ + * ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ + * ~~~~~~ ~~~~ ~~~ ~~~ ~~~~~ ~~~~~~ + * ~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~ + * ~~~~~ ~~~ ~~~~~~ ~~~~~~ ~~~ ~~~~~ + * ~~~ ~~~ ~~~~~~~~~~ ~~~ ~~~ + * ~~ ~~~ ~~~ ~~~ + * ~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~ + * ~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~ + * ~~~ ~~~~ ~~~~ ~~~ + * ~~~~ ~~~~~~~~ ~~~~ + * ~~~ ~~~~~~~ ~~~~~~~ ~~~ + * ~~~ ~~~~~~~~ ~~~~ ~~~~ ~~~~~~~~ ~~~ + * ~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~ + * ~~~ ~~~ + * ~~~ ~~~ + * ~~~ ~~~ + * ~~~~ ~~~~ + * ~~~~~~ + * @author LooksRare protocol team (👀,💎); bitbeckers + */ + +contract LooksRareProtocol is + ILooksRareProtocol, + TransferSelectorNFT, + LowLevelETHReturnETHIfAnyExceptOneWei, + LowLevelWETH, + LowLevelERC20Transfer, + BatchOrderTypehashRegistry +{ + using OrderStructs for OrderStructs.Maker; + + /** + * @notice Wrapped ETH. + */ + address public immutable WETH; + + /** + * @notice Current chainId. + */ + uint256 public chainId; + + /** + * @notice Current domain separator. + */ + bytes32 public domainSeparator; + + /** + * @notice This variable is used as the gas limit for a ETH transfer. + * If a standard ETH transfer fails within this gas limit, ETH will get wrapped to WETH + * and transferred to the initial recipient. + */ + uint256 private _gasLimitETHTransfer = 2300; + + /** + * @notice Constructor + * @param _owner Owner address + * @param _protocolFeeRecipient Protocol fee recipient address + * @param _transferManager Transfer manager address + * @param _weth Wrapped ETH address + */ + constructor(address _owner, address _protocolFeeRecipient, address _transferManager, address _weth) + TransferSelectorNFT(_owner, _protocolFeeRecipient, _transferManager) + { + _updateDomainSeparator(); + WETH = _weth; + } + + /** + * @inheritdoc ILooksRareProtocol + */ + function executeTakerAsk( + OrderStructs.Taker calldata takerAsk, + OrderStructs.Maker calldata makerBid, + bytes calldata makerSignature, + OrderStructs.MerkleTree calldata merkleTree + ) external nonReentrant { + address currency = makerBid.currency; + + // Verify whether the currency is allowed and is not ETH (address(0)) + if (!isCurrencyAllowed[currency] || currency == address(0)) { + revert CurrencyInvalid(); + } + + address signer = makerBid.signer; + bytes32 orderHash = makerBid.hash(); + _verifyMerkleProofOrOrderHash(merkleTree, orderHash, makerSignature, signer); + + // Execute the transaction and fetch protocol fee amount + uint256 totalProtocolFeeAmount = _executeTakerAsk(takerAsk, makerBid, orderHash); + + // Pay protocol fee (and affiliate fee if any) + _payProtocolFeeAndAffiliateFee(currency, signer, totalProtocolFeeAmount); + } + + /** + * @inheritdoc ILooksRareProtocol + */ + function executeTakerBid( + OrderStructs.Taker calldata takerBid, + OrderStructs.Maker calldata makerAsk, + bytes calldata makerSignature, + OrderStructs.MerkleTree calldata merkleTree + ) external payable nonReentrant { + address currency = makerAsk.currency; + + // Verify whether the currency is allowed for trading. + if (!isCurrencyAllowed[currency]) { + revert CurrencyInvalid(); + } + + bytes32 orderHash = makerAsk.hash(); + _verifyMerkleProofOrOrderHash(merkleTree, orderHash, makerSignature, makerAsk.signer); + + // Execute the transaction and fetch protocol fee amount + uint256 totalProtocolFeeAmount = _executeTakerBid(takerBid, makerAsk, msg.sender, orderHash); + + // Pay protocol fee amount + _payProtocolFeeAndAffiliateFee(currency, msg.sender, totalProtocolFeeAmount); + + // Return ETH if any + _returnETHIfAnyWithOneWeiLeft(); + } + + /** + * @inheritdoc ILooksRareProtocol + */ + function executeMultipleTakerBids( + OrderStructs.Taker[] calldata takerBids, + OrderStructs.Maker[] calldata makerAsks, + bytes[] calldata makerSignatures, + OrderStructs.MerkleTree[] calldata merkleTrees, + bool isAtomic + ) external payable nonReentrant { + uint256 length = takerBids.length; + if ( + length == 0 + || (makerAsks.length ^ length) | (makerSignatures.length ^ length) | (merkleTrees.length ^ length) != 0 + ) { + revert LengthsInvalid(); + } + + // Verify whether the currency at index = 0 is allowed for trading + address currency = makerAsks[0].currency; + if (!isCurrencyAllowed[currency]) { + revert CurrencyInvalid(); + } + + { + // Initialize protocol fee amount + uint256 totalProtocolFeeAmount; + + // If atomic, it uses the executeTakerBid function. + // If not atomic, it uses a catch/revert pattern with external function. + if (isAtomic) { + for (uint256 i; i < length;) { + OrderStructs.Maker calldata makerAsk = makerAsks[i]; + + // Verify the currency is the same + if (i != 0) { + if (makerAsk.currency != currency) { + revert CurrencyInvalid(); + } + } + + OrderStructs.Taker calldata takerBid = takerBids[i]; + bytes32 orderHash = makerAsk.hash(); + + { + _verifyMerkleProofOrOrderHash(merkleTrees[i], orderHash, makerSignatures[i], makerAsk.signer); + + // Execute the transaction and add protocol fee + totalProtocolFeeAmount += _executeTakerBid(takerBid, makerAsk, msg.sender, orderHash); + + unchecked { + ++i; + } + } + } + } else { + for (uint256 i; i < length;) { + OrderStructs.Maker calldata makerAsk = makerAsks[i]; + + // Verify the currency is the same + if (i != 0) { + if (makerAsk.currency != currency) { + revert CurrencyInvalid(); + } + } + + OrderStructs.Taker calldata takerBid = takerBids[i]; + bytes32 orderHash = makerAsk.hash(); + + { + _verifyMerkleProofOrOrderHash(merkleTrees[i], orderHash, makerSignatures[i], makerAsk.signer); + + try this.restrictedExecuteTakerBid(takerBid, makerAsk, msg.sender, orderHash) returns ( + uint256 protocolFeeAmount + ) { + totalProtocolFeeAmount += protocolFeeAmount; + } catch {} + + unchecked { + ++i; + } + } + } + } + + // Pay protocol fee (and affiliate fee if any) + _payProtocolFeeAndAffiliateFee(currency, msg.sender, totalProtocolFeeAmount); + } + + // Return ETH if any + _returnETHIfAnyWithOneWeiLeft(); + } + + /** + * @notice This function is used to do a non-atomic matching in the context of a batch taker bid. + * @param takerBid Taker bid struct + * @param makerAsk Maker ask struct + * @param sender Sender address (i.e. the initial msg sender) + * @param orderHash Hash of the maker ask order + * @return protocolFeeAmount Protocol fee amount + * @dev This function is only callable by this contract. It is used for non-atomic batch order matching. + */ + function restrictedExecuteTakerBid( + OrderStructs.Taker calldata takerBid, + OrderStructs.Maker calldata makerAsk, + address sender, + bytes32 orderHash + ) external returns (uint256 protocolFeeAmount) { + if (msg.sender != address(this)) { + revert CallerInvalid(); + } + + protocolFeeAmount = _executeTakerBid(takerBid, makerAsk, sender, orderHash); + } + + /** + * @notice This function allows the owner to update the domain separator (if possible). + * @dev Only callable by owner. If there is a fork of the network with a new chainId, + * it allows the owner to reset the domain separator for the new chain id. + */ + function updateDomainSeparator() external onlyOwner { + if (block.chainid != chainId) { + _updateDomainSeparator(); + emit NewDomainSeparator(); + } else { + revert SameDomainSeparator(); + } + } + + /** + * @notice This function allows the owner to update the maximum ETH gas limit for a standard transfer. + * @param newGasLimitETHTransfer New gas limit for ETH transfer + * @dev Only callable by owner. + */ + function updateETHGasLimitForTransfer(uint256 newGasLimitETHTransfer) external onlyOwner { + if (newGasLimitETHTransfer < 2300) { + revert NewGasLimitETHTransferTooLow(); + } + + _gasLimitETHTransfer = newGasLimitETHTransfer; + + emit NewGasLimitETHTransfer(newGasLimitETHTransfer); + } + + /** + * @notice This function is internal and is used to execute a taker ask (against a maker bid). + * @param takerAsk Taker ask order struct + * @param makerBid Maker bid order struct + * @param orderHash Hash of the maker bid order + * @return protocolFeeAmount Protocol fee amount + */ + function _executeTakerAsk( + OrderStructs.Taker calldata takerAsk, + OrderStructs.Maker calldata makerBid, + bytes32 orderHash + ) internal returns (uint256) { + if (makerBid.quoteType != QuoteType.Bid) { + revert QuoteTypeInvalid(); + } + + address signer = makerBid.signer; + { + bytes32 userOrderNonceStatus = userOrderNonce[signer][makerBid.orderNonce]; + // Verify nonces + if ( + userBidAskNonces[signer].bidNonce != makerBid.globalNonce + || userSubsetNonce[signer][makerBid.subsetNonce] + || (userOrderNonceStatus != bytes32(0) && userOrderNonceStatus != orderHash) + ) { + revert NoncesInvalid(); + } + } + + ( + uint256[] memory itemIds, + uint256[] memory amounts, + address[2] memory recipients, + uint256[3] memory feeAmounts, + bool isNonceInvalidated + ) = _executeStrategyForTakerOrder(takerAsk, makerBid, msg.sender); + + // Order nonce status is updated + _updateUserOrderNonce(isNonceInvalidated, signer, makerBid.orderNonce, orderHash); + + // Taker action goes first + _executeTakerAskTakerAction(makerBid, takerAsk, msg.sender, signer, itemIds, amounts); + + // Maker action goes second + _transferToAskRecipientAndCreatorIfAny(recipients, feeAmounts, makerBid.currency, signer); + + emit TakerAsk( + NonceInvalidationParameters({ + orderHash: orderHash, + orderNonce: makerBid.orderNonce, + isNonceInvalidated: isNonceInvalidated + }), + msg.sender, + signer, + makerBid.strategyId, + makerBid.currency, + makerBid.collection, + itemIds, + amounts, + recipients, + feeAmounts + ); + + // It returns the protocol fee amount + return feeAmounts[2]; + } + + /** + * @notice This function is internal and is used to execute a taker bid (against a maker ask). + * @param takerBid Taker bid order struct + * @param makerAsk Maker ask order struct + * @param sender Sender of the transaction (i.e. msg.sender) + * @param orderHash Hash of the maker ask order + * @return protocolFeeAmount Protocol fee amount + */ + function _executeTakerBid( + OrderStructs.Taker calldata takerBid, + OrderStructs.Maker calldata makerAsk, + address sender, + bytes32 orderHash + ) internal returns (uint256) { + if (makerAsk.quoteType != QuoteType.Ask) { + revert QuoteTypeInvalid(); + } + + address signer = makerAsk.signer; + { + // Verify nonces + bytes32 userOrderNonceStatus = userOrderNonce[signer][makerAsk.orderNonce]; + + if ( + userBidAskNonces[signer].askNonce != makerAsk.globalNonce + || userSubsetNonce[signer][makerAsk.subsetNonce] + || (userOrderNonceStatus != bytes32(0) && userOrderNonceStatus != orderHash) + ) { + revert NoncesInvalid(); + } + } + + ( + uint256[] memory itemIds, + uint256[] memory amounts, + address[2] memory recipients, + uint256[3] memory feeAmounts, + bool isNonceInvalidated + ) = _executeStrategyForTakerOrder(takerBid, makerAsk, msg.sender); + + // Order nonce status is updated + _updateUserOrderNonce(isNonceInvalidated, signer, makerAsk.orderNonce, orderHash); + + // Taker action goes first + _transferToAskRecipientAndCreatorIfAny(recipients, feeAmounts, makerAsk.currency, sender); + + // Maker action goes second + _executeTakerBidMakerAction(makerAsk, takerBid, signer, sender, itemIds, amounts); + + emit TakerBid( + NonceInvalidationParameters({ + orderHash: orderHash, + orderNonce: makerAsk.orderNonce, + isNonceInvalidated: isNonceInvalidated + }), + sender, + takerBid.recipient == address(0) ? sender : takerBid.recipient, + makerAsk.strategyId, + makerAsk.currency, + makerAsk.collection, + itemIds, + amounts, + recipients, + feeAmounts + ); + + // It returns the protocol fee amount + return feeAmounts[2]; + } + + function _executeTakerAskTakerAction( + OrderStructs.Maker calldata makerBid, + OrderStructs.Taker calldata takerAsk, + address sender, + address recipient, + uint256[] memory itemIds, + uint256[] memory amounts + ) internal { + if (makerBid.collectionType == CollectionType.Hypercert) { + _transferHypercertFraction( + makerBid.collection, makerBid.collectionType, makerBid.strategyId, sender, recipient, itemIds, amounts + ); + } else { + _transferNFT(makerBid.collection, makerBid.collectionType, sender, recipient, itemIds, amounts); + } + } + + function _executeTakerBidMakerAction( + OrderStructs.Maker calldata makerAsk, + OrderStructs.Taker calldata takerBid, + address sender, + address recipient, + uint256[] memory itemIds, + uint256[] memory amounts + ) internal { + if (makerAsk.collectionType == CollectionType.Hypercert) { + _transferHypercertFraction( + makerAsk.collection, + makerAsk.collectionType, + makerAsk.strategyId, + sender, + takerBid.recipient == address(0) ? recipient : takerBid.recipient, + itemIds, + amounts + ); + } else { + _transferNFT( + makerAsk.collection, + makerAsk.collectionType, + sender, + takerBid.recipient == address(0) ? recipient : takerBid.recipient, + itemIds, + amounts + ); + } + } + + /** + * @notice This function is internal and is used to pay the protocol fee and affiliate fee (if any). + * @param currency Currency address to transfer (address(0) is ETH) + * @param bidUser Bid user address + * @param totalProtocolFeeAmount Total protocol fee amount (denominated in the currency) + */ + function _payProtocolFeeAndAffiliateFee(address currency, address bidUser, uint256 totalProtocolFeeAmount) + internal + { + if (totalProtocolFeeAmount != 0) { + // Transfer remaining protocol fee to the protocol fee recipient + _transferFungibleTokens(currency, bidUser, protocolFeeRecipient, totalProtocolFeeAmount); + } + } + + /** + * @notice This function is internal and is used to transfer fungible tokens. + * @param currency Currency address + * @param sender Sender address + * @param recipient Recipient address + * @param amount Amount (in fungible tokens) + */ + function _transferFungibleTokens(address currency, address sender, address recipient, uint256 amount) internal { + if (currency == address(0)) { + _transferETHAndWrapIfFailWithGasLimit(WETH, recipient, amount, _gasLimitETHTransfer); + } else { + _executeERC20TransferFrom(currency, sender, recipient, amount); + } + } + + /** + * @notice This function is private and used to transfer funds to + * (1) creator recipient (if any) + * (2) ask recipient. + * @param recipients Recipient addresses + * @param feeAmounts Fees + * @param currency Currency address + * @param bidUser Bid user address + * @dev It does not send to the 0-th element in the array since it is the protocol fee, + * which is paid later in the execution flow. + */ + function _transferToAskRecipientAndCreatorIfAny( + address[2] memory recipients, + uint256[3] memory feeAmounts, + address currency, + address bidUser + ) private { + // @dev There is no check for address(0) since the ask recipient can never be address(0) + // If ask recipient is the maker --> the signer cannot be the null address + // If ask is the taker --> either it is the sender address or + // if the recipient (in TakerAsk) is set to address(0), it is adjusted to the original taker address + uint256 sellerProceed = feeAmounts[0]; + if (sellerProceed != 0) { + _transferFungibleTokens(currency, bidUser, recipients[0], sellerProceed); + } + + // @dev There is no check for address(0), if the creator recipient is address(0), the fee is set to 0 + uint256 creatorFeeAmount = feeAmounts[1]; + if (creatorFeeAmount != 0) { + _transferFungibleTokens(currency, bidUser, recipients[1], creatorFeeAmount); + } + } + + /** + * @notice This function is private and used to compute the domain separator and store the current chain id. + */ + function _updateDomainSeparator() private { + domainSeparator = keccak256( + abi.encode( + keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), + keccak256("LooksRareProtocol"), + keccak256(bytes("2")), + block.chainid, + address(this) + ) + ); + chainId = block.chainid; + } + + /** + * @notice This function is internal and is called during the execution of a transaction to decide + * how to map the user's order nonce. + * @param isNonceInvalidated Whether the nonce is being invalidated + * @param signer Signer address + * @param orderNonce Maker user order nonce + * @param orderHash Hash of the order struct + * @dev If isNonceInvalidated is true, this function invalidates the user order nonce for future execution. + * If it is equal to false, this function maps the order hash for this user order nonce + * to prevent other order structs sharing the same order nonce to be executed. + */ + function _updateUserOrderNonce(bool isNonceInvalidated, address signer, uint256 orderNonce, bytes32 orderHash) + private + { + userOrderNonce[signer][orderNonce] = (isNonceInvalidated ? MAGIC_VALUE_ORDER_NONCE_EXECUTED : orderHash); + } + + /** + * @notice This function is private and used to verify the chain id, compute the digest, and verify the signature. + * @dev If chainId is not equal to the cached chain id, it would revert. + * @param computedHash Hash of order (maker bid or maker ask) or merkle root + * @param makerSignature Signature of the maker + * @param signer Signer address + */ + function _computeDigestAndVerify(bytes32 computedHash, bytes calldata makerSignature, address signer) + private + view + { + if (chainId == block.chainid) { + // \x19\x01 is the standard encoding prefix + SignatureCheckerCalldata.verify( + keccak256(abi.encodePacked("\x19\x01", domainSeparator, computedHash)), signer, makerSignature + ); + } else { + revert ChainIdInvalid(); + } + } + + /** + * @notice This function is private and called to verify whether the merkle proofs provided for the order hash + * are correct or verify the order hash if the order is not part of a merkle tree. + * @param merkleTree Merkle tree + * @param orderHash Order hash (can be maker bid hash or maker ask hash) + * @param signature Maker order signature + * @param signer Maker address + * @dev It verifies (1) merkle proof (if necessary) (2) signature is from the expected signer + */ + function _verifyMerkleProofOrOrderHash( + OrderStructs.MerkleTree calldata merkleTree, + bytes32 orderHash, + bytes calldata signature, + address signer + ) private view { + uint256 proofLength = merkleTree.proof.length; + + if (proofLength != 0) { + if (proofLength > MAX_CALLDATA_PROOF_LENGTH) { + revert MerkleProofTooLarge(proofLength); + } + + if (!MerkleProofCalldataWithNodes.verifyCalldata(merkleTree.proof, merkleTree.root, orderHash)) { + revert MerkleProofInvalid(); + } + + orderHash = hashBatchOrder(merkleTree.root, proofLength); + } + + _computeDigestAndVerify(orderHash, signature, signer); + } +} diff --git a/contracts/src/marketplace/NonceManager.sol b/contracts/src/marketplace/NonceManager.sol new file mode 100644 index 00000000..d9a94cfc --- /dev/null +++ b/contracts/src/marketplace/NonceManager.sol @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Interfaces and errors +import {INonceManager} from "./interfaces/INonceManager.sol"; +import {LengthsInvalid} from "./errors/SharedErrors.sol"; + +/** + * @title NonceManager + * @notice This contract handles the nonce logic that is used for invalidating maker orders that exist off-chain. + * The nonce logic revolves around three parts at the user level: + * - order nonce (orders sharing an order nonce are conditional, OCO-like) + * - subset (orders can be grouped under a same subset) + * - bid/ask (all orders can be executed only if the bid/ask nonce matches the user's one on-chain) + * Only the order nonce is invalidated at the time of the execution of a maker order that contains it. + * @author LooksRare protocol team (👀,💎) + */ +contract NonceManager is INonceManager { + /** + * @notice Magic value nonce returned if executed (or cancelled). + */ + bytes32 public constant MAGIC_VALUE_ORDER_NONCE_EXECUTED = keccak256("ORDER_NONCE_EXECUTED"); + + /** + * @notice This tracks the bid and ask nonces for a user address. + */ + mapping(address => UserBidAskNonces) public userBidAskNonces; + + /** + * @notice This checks whether the order nonce for a user was executed or cancelled. + */ + mapping(address => mapping(uint256 => bytes32)) public userOrderNonce; + + /** + * @notice This checks whether the subset nonce for a user was cancelled. + */ + mapping(address => mapping(uint256 => bool)) public userSubsetNonce; + + /** + * @notice This function allows a user to cancel an array of order nonces. + * @param orderNonces Array of order nonces + * @dev It does not check the status of the nonces to save gas + * and to prevent revertion if one of the orders is filled in the same + * block. + */ + function cancelOrderNonces(uint256[] calldata orderNonces) external { + uint256 length = orderNonces.length; + if (length == 0) { + revert LengthsInvalid(); + } + + for (uint256 i; i < length;) { + userOrderNonce[msg.sender][orderNonces[i]] = MAGIC_VALUE_ORDER_NONCE_EXECUTED; + unchecked { + ++i; + } + } + + emit OrderNoncesCancelled(msg.sender, orderNonces); + } + + /** + * @notice This function allows a user to cancel an array of subset nonces. + * @param subsetNonces Array of subset nonces + * @dev It does not check the status of the nonces to save gas. + */ + function cancelSubsetNonces(uint256[] calldata subsetNonces) external { + uint256 length = subsetNonces.length; + + if (length == 0) { + revert LengthsInvalid(); + } + + for (uint256 i; i < length;) { + userSubsetNonce[msg.sender][subsetNonces[i]] = true; + unchecked { + ++i; + } + } + + emit SubsetNoncesCancelled(msg.sender, subsetNonces); + } + + /** + * @notice This function increments a user's bid/ask nonces. + * @param bid Whether to increment the user bid nonce + * @param ask Whether to increment the user ask nonce + * @dev The logic for computing the quasi-random number is inspired by Seaport v1.2. + * The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. + * A deterministic increment would make the cancel-all process non-effective in certain cases + * (orders signed with a greater ask/bid nonce). + * The same quasi-random number is used for incrementing both the bid and ask nonces if both values + * are incremented in the same transaction. + * If this function is used twice in the same block, it will return the same quasiRandomNumber + * but this will not impact the overall business logic. + */ + function incrementBidAskNonces(bool bid, bool ask) external { + // Use second half of the previous block hash as a quasi-random number + uint256 quasiRandomNumber = uint256(blockhash(block.number - 1) >> 128); + uint256 newBidNonce = userBidAskNonces[msg.sender].bidNonce; + uint256 newAskNonce = userBidAskNonces[msg.sender].askNonce; + + if (bid) { + newBidNonce += quasiRandomNumber; + userBidAskNonces[msg.sender].bidNonce = newBidNonce; + } + + if (ask) { + newAskNonce += quasiRandomNumber; + userBidAskNonces[msg.sender].askNonce = newAskNonce; + } + + emit NewBidAskNonces(msg.sender, newBidNonce, newAskNonce); + } +} diff --git a/contracts/src/marketplace/ProtocolFeeRecipient.sol b/contracts/src/marketplace/ProtocolFeeRecipient.sol new file mode 100644 index 00000000..33cfceb4 --- /dev/null +++ b/contracts/src/marketplace/ProtocolFeeRecipient.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {LowLevelERC20Transfer} from "@looksrare/contracts-libs/contracts/lowLevelCallers/LowLevelERC20Transfer.sol"; +import {IWETH} from "@looksrare/contracts-libs/contracts/interfaces/generic/IWETH.sol"; +import {IERC20} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC20.sol"; + +/** + * @title ProtocolFeeRecipient + * @notice This contract is used to receive protocol fees and transfer them to the fee sharing setter. + * Fee sharing setter cannot receive ETH directly, so we need to use this contract as a middleman + * to convert ETH into WETH before sending it. + * @author LooksRare protocol team (👀,💎) + */ +contract ProtocolFeeRecipient is LowLevelERC20Transfer { + address public immutable FEE_SHARING_SETTER; + IWETH public immutable WETH; + + error NothingToTransfer(); + + constructor(address _feeSharingSetter, address _weth) { + FEE_SHARING_SETTER = _feeSharingSetter; + WETH = IWETH(_weth); + } + + function transferETH() external { + uint256 ethBalance = address(this).balance; + + if (ethBalance != 0) { + WETH.deposit{value: ethBalance}(); + } + + uint256 wethBalance = IERC20(address(WETH)).balanceOf(address(this)); + + if (wethBalance == 0) { + revert NothingToTransfer(); + } + _executeERC20DirectTransfer(address(WETH), FEE_SHARING_SETTER, wethBalance); + } + + /** + * @param currency ERC20 currency address + */ + function transferERC20(address currency) external { + uint256 balance = IERC20(currency).balanceOf(address(this)); + if (balance == 0) { + revert NothingToTransfer(); + } + _executeERC20DirectTransfer(currency, FEE_SHARING_SETTER, balance); + } + + receive() external payable {} +} diff --git a/contracts/src/marketplace/StrategyManager.sol b/contracts/src/marketplace/StrategyManager.sol new file mode 100644 index 00000000..4edb9d66 --- /dev/null +++ b/contracts/src/marketplace/StrategyManager.sol @@ -0,0 +1,124 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {CurrencyManager} from "./CurrencyManager.sol"; + +// Interfaces +import {IStrategy} from "./interfaces/IStrategy.sol"; +import {IStrategyManager} from "./interfaces/IStrategyManager.sol"; + +/** + * @title StrategyManager + * @notice This contract handles the addition and the update of execution strategies. + * @author LooksRare protocol team (👀,💎) + */ +contract StrategyManager is IStrategyManager, CurrencyManager { + /** + * @notice This variable keeps the count of how many strategies exist. + * It includes strategies that have been removed. + */ + uint256 private _countStrategies = 1; + + /** + * @notice This returns the strategy information for a strategy id. + */ + mapping(uint256 => Strategy) public strategyInfo; + + /** + * @notice Constructor + * @param _owner Owner address + */ + constructor(address _owner) CurrencyManager(_owner) { + strategyInfo[0] = Strategy({ + isActive: true, + standardProtocolFeeBp: 50, + minTotalFeeBp: 50, + maxProtocolFeeBp: 200, + selector: bytes4(0), + isMakerBid: false, + implementation: address(0) + }); + + emit NewStrategy(0, 50, 50, 200, bytes4(0), false, address(0)); + } + + /** + * @notice This function allows the owner to add a new execution strategy to the protocol. + * @param standardProtocolFeeBp Standard protocol fee (in basis point) + * @param minTotalFeeBp Minimum total fee (in basis point) + * @param maxProtocolFeeBp Maximum protocol fee (in basis point) + * @param selector Function selector for the strategy + * @param isMakerBid Whether the function selector is for maker bid + * @param implementation Implementation address + * @dev Strategies have an id that is incremental. + * Only callable by owner. + */ + function addStrategy( + uint16 standardProtocolFeeBp, + uint16 minTotalFeeBp, + uint16 maxProtocolFeeBp, + bytes4 selector, + bool isMakerBid, + address implementation + ) external onlyOwner { + if (minTotalFeeBp > maxProtocolFeeBp || standardProtocolFeeBp > minTotalFeeBp || maxProtocolFeeBp > 500) { + revert StrategyProtocolFeeTooHigh(); + } + + if (selector == bytes4(0)) { + revert StrategyHasNoSelector(); + } + + if (!IStrategy(implementation).isLooksRareV2Strategy()) { + revert NotV2Strategy(); + } + + strategyInfo[_countStrategies] = Strategy({ + isActive: true, + standardProtocolFeeBp: standardProtocolFeeBp, + minTotalFeeBp: minTotalFeeBp, + maxProtocolFeeBp: maxProtocolFeeBp, + selector: selector, + isMakerBid: isMakerBid, + implementation: implementation + }); + + emit NewStrategy( + _countStrategies++, + standardProtocolFeeBp, + minTotalFeeBp, + maxProtocolFeeBp, + selector, + isMakerBid, + implementation + ); + } + + /** + * @notice This function allows the owner to update parameters for an existing execution strategy. + * @param strategyId Strategy id + * @param isActive Whether the strategy must be active + * @param newStandardProtocolFee New standard protocol fee (in basis point) + * @param newMinTotalFee New minimum total fee (in basis point) + * @dev Only callable by owner. + */ + function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) + external + onlyOwner + { + if (strategyId >= _countStrategies) { + revert StrategyNotUsed(); + } + + if (newMinTotalFee > strategyInfo[strategyId].maxProtocolFeeBp || newStandardProtocolFee > newMinTotalFee) { + revert StrategyProtocolFeeTooHigh(); + } + + strategyInfo[strategyId].isActive = isActive; + strategyInfo[strategyId].standardProtocolFeeBp = newStandardProtocolFee; + strategyInfo[strategyId].minTotalFeeBp = newMinTotalFee; + + emit StrategyUpdated(strategyId, isActive, newStandardProtocolFee, newMinTotalFee); + } +} diff --git a/contracts/src/marketplace/TransferManager.sol b/contracts/src/marketplace/TransferManager.sol new file mode 100644 index 00000000..eaa5231e --- /dev/null +++ b/contracts/src/marketplace/TransferManager.sol @@ -0,0 +1,419 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {OwnableTwoSteps} from "@looksrare/contracts-libs/contracts/OwnableTwoSteps.sol"; +import {LowLevelERC721Transfer} from "@looksrare/contracts-libs/contracts/lowLevelCallers/LowLevelERC721Transfer.sol"; +import {LowLevelERC1155Transfer} from "@looksrare/contracts-libs/contracts/lowLevelCallers/LowLevelERC1155Transfer.sol"; + +// Hypercert low-level callers +import {LowLevelHypercertCaller} from "./libraries/LowLevelHypercertCaller.sol"; + +// Interfaces and errors +import {ITransferManager} from "./interfaces/ITransferManager.sol"; +import {AmountInvalid, LengthsInvalid} from "./errors/SharedErrors.sol"; +import {UnitAmountInvalid} from "./errors/HypercertErrors.sol"; +import {IHypercertToken} from "../protocol/interfaces/IHypercertToken.sol"; + +// Libraries +import {OrderStructs} from "./libraries/OrderStructs.sol"; + +// Enums +import {CollectionType} from "./enums/CollectionType.sol"; + +/** + * @title TransferManager + * @notice This contract provides the transfer functions for ERC721/ERC1155/Hypercert for contracts that + * require them. + * Collection type "0" refers to ERC721 transfer functions. + * Collection type "1" refers to ERC1155 transfer functions. + * Collection type "2" refers to Hypercert transfer functions. + * @dev "Safe" transfer functions for ERC721 are not implemented since they come with added gas costs + * to verify if the recipient is a contract as it requires verifying the receiver interface is valid. + * @author LooksRare protocol team (👀,💎); bitbeckers + */ +contract TransferManager is + ITransferManager, + LowLevelERC721Transfer, + LowLevelERC1155Transfer, + LowLevelHypercertCaller, + OwnableTwoSteps +{ + /** + * @notice This returns whether the user has approved the operator address. + * The first address is the user and the second address is the operator (e.g. LooksRareProtocol). + */ + mapping(address => mapping(address => bool)) public hasUserApprovedOperator; + + /** + * @notice This returns whether the operator address is allowed by this contract's owner. + */ + mapping(address => bool) public isOperatorAllowed; + + /** + * @notice Constructor + * @param _owner Owner address + */ + constructor(address _owner) OwnableTwoSteps(_owner) {} + + /** + * @notice This function transfers items for a single ERC721 collection. + * @param collection Collection address + * @param from Sender address + * @param to Recipient address + * @param itemIds Array of itemIds + * @param amounts Array of amounts + */ + function transferItemsERC721( + address collection, + address from, + address to, + uint256[] calldata itemIds, + uint256[] calldata amounts + ) external { + uint256 length = itemIds.length; + if (length == 0) { + revert LengthsInvalid(); + } + + _isOperatorValidForTransfer(from, msg.sender); + + for (uint256 i; i < length;) { + if (amounts[i] != 1) { + revert AmountInvalid(); + } + _executeERC721TransferFrom(collection, from, to, itemIds[i]); + unchecked { + ++i; + } + } + } + + /** + * @notice This function transfers items for a single ERC1155 collection. + * @param collection Collection address + * @param from Sender address + * @param to Recipient address + * @param itemIds Array of itemIds + * @param amounts Array of amounts + * @dev It does not allow batch transferring if from = msg.sender since native function should be used. + */ + function transferItemsERC1155( + address collection, + address from, + address to, + uint256[] calldata itemIds, + uint256[] calldata amounts + ) external { + uint256 length = itemIds.length; + + if (length == 0 || amounts.length != length) { + revert LengthsInvalid(); + } + + _isOperatorValidForTransfer(from, msg.sender); + + if (length == 1) { + if (amounts[0] == 0) { + revert AmountInvalid(); + } + _executeERC1155SafeTransferFrom(collection, from, to, itemIds[0], amounts[0]); + } else { + for (uint256 i; i < length;) { + if (amounts[i] == 0) { + revert AmountInvalid(); + } + + unchecked { + ++i; + } + } + _executeERC1155SafeBatchTransferFrom(collection, from, to, itemIds, amounts); + } + } + + /** + * @notice This function transfers items for a single Hypercert. + * @param collection Collection address + * @param from Sender address + * @param to Recipient address + * @param itemIds Array of itemIds + * @param amounts Array of amounts + * @dev It does not allow batch transferring if from = msg.sender since native function should be used. + */ + function transferItemsHypercert( + address collection, + address from, + address to, + uint256[] calldata itemIds, + uint256[] calldata amounts + ) external { + uint256 length = itemIds.length; + + if (length == 0 || amounts.length != length) { + revert LengthsInvalid(); + } + + _isOperatorValidForTransfer(from, msg.sender); + + if (length == 1) { + if (amounts[0] == 0) { + revert AmountInvalid(); + } + _executeERC1155SafeTransferFrom(collection, from, to, itemIds[0], amounts[0]); + } else { + for (uint256 i; i < length;) { + if (amounts[i] == 0) { + revert AmountInvalid(); + } + + unchecked { + ++i; + } + } + _executeERC1155SafeBatchTransferFrom(collection, from, to, itemIds, amounts); + } + } + + /** + * @notice This function splits and transfers a fraction of a hypercert. + * @param collection Collection address + * @param from Sender address + * @param to Recipient address + * @param itemIds Array of itemIds + * @param amounts Array of amounts + * @dev It does not allow batch transferring. + */ + function splitItemsHypercert( + address collection, + address from, + address to, + uint256[] calldata itemIds, + uint256[] calldata amounts + ) external { + if (itemIds.length != 1 || amounts.length != 1) { + revert LengthsInvalid(); + } + + _isOperatorValidForTransfer(from, msg.sender); + + if (amounts[0] == 0) { + revert AmountInvalid(); + } + + uint256[] memory newAmounts = new uint256[](2); + + //The new amount is the difference between the total amount and the amount being split. + //This will underflow if the amount being split is greater than the total amount. + newAmounts[0] = IHypercertToken(collection).unitsOf(itemIds[0]) - amounts[0]; + newAmounts[1] = amounts[0]; + + // If the new amount is 0, then the split is will revert but the whole fraction can be transferred. + if (newAmounts[0] == 0) { + _executeERC1155SafeTransferFrom(collection, from, to, itemIds[0], 1); + } else { + _executeHypercertSplitFraction(collection, to, itemIds[0], newAmounts); + } + } + + /** + * @notice This function transfers items across an array of collections that can be both ERC721 and ERC1155. + * @param items Array of BatchTransferItem + * @param from Sender address + * @param to Recipient address + */ + function transferBatchItemsAcrossCollections(BatchTransferItem[] calldata items, address from, address to) + external + { + uint256 itemsLength = items.length; + + if (itemsLength == 0) { + revert LengthsInvalid(); + } + + if (from != msg.sender) { + _isOperatorValidForTransfer(from, msg.sender); + } + + for (uint256 i; i < itemsLength;) { + uint256[] calldata itemIds = items[i].itemIds; + uint256 itemIdsLengthForSingleCollection = itemIds.length; + uint256[] calldata amounts = items[i].amounts; + + if (itemIdsLengthForSingleCollection == 0 || amounts.length != itemIdsLengthForSingleCollection) { + revert LengthsInvalid(); + } + + CollectionType collectionType = items[i].collectionType; + if (collectionType == CollectionType.ERC721) { + _processBatch721Collection(items[i], from, to); + } else if (collectionType == CollectionType.ERC1155) { + _processBatch1155Collection(items[i], from, to); + } else if (collectionType == CollectionType.Hypercert) { + _processBatchHypercertCollection(items[i], from, to); + } + + unchecked { + ++i; + } + } + } + + /** + * @notice This function allows a user to grant approvals for an array of operators. + * Users cannot grant approvals if the operator is not allowed by this contract's owner. + * @param operators Array of operator addresses + * @dev Each operator address must be globally allowed to be approved. + */ + function grantApprovals(address[] calldata operators) external { + uint256 length = operators.length; + + if (length == 0) { + revert LengthsInvalid(); + } + + for (uint256 i; i < length;) { + address operator = operators[i]; + + if (!isOperatorAllowed[operator]) { + revert OperatorNotAllowed(); + } + + if (hasUserApprovedOperator[msg.sender][operator]) { + revert OperatorAlreadyApprovedByUser(); + } + + hasUserApprovedOperator[msg.sender][operator] = true; + + unchecked { + ++i; + } + } + + emit ApprovalsGranted(msg.sender, operators); + } + + /** + * @notice This function allows a user to revoke existing approvals for an array of operators. + * @param operators Array of operator addresses + * @dev Each operator address must be approved at the user level to be revoked. + */ + function revokeApprovals(address[] calldata operators) external { + uint256 length = operators.length; + if (length == 0) { + revert LengthsInvalid(); + } + + for (uint256 i; i < length;) { + address operator = operators[i]; + + if (!hasUserApprovedOperator[msg.sender][operator]) { + revert OperatorNotApprovedByUser(); + } + + delete hasUserApprovedOperator[msg.sender][operator]; + unchecked { + ++i; + } + } + + emit ApprovalsRemoved(msg.sender, operators); + } + + /** + * @notice This function allows an operator to be added for the shared transfer system. + * Once the operator is allowed, users can grant NFT approvals to this operator. + * @param operator Operator address to allow + * @dev Only callable by owner. + */ + function allowOperator(address operator) external onlyOwner { + if (isOperatorAllowed[operator]) { + revert OperatorAlreadyAllowed(); + } + + isOperatorAllowed[operator] = true; + + emit OperatorAllowed(operator); + } + + /** + * @notice This function allows the user to remove an operator for the shared transfer system. + * @param operator Operator address to remove + * @dev Only callable by owner. + */ + function removeOperator(address operator) external onlyOwner { + if (!isOperatorAllowed[operator]) { + revert OperatorNotAllowed(); + } + + delete isOperatorAllowed[operator]; + + emit OperatorRemoved(operator); + } + + /** + * @notice This function is internal and verifies whether the transfer + * (by an operator on behalf of a user) is valid. If not, it reverts. + * @param user User address + * @param operator Operator address + */ + function _isOperatorValidForTransfer(address user, address operator) private view { + if (isOperatorAllowed[operator] && hasUserApprovedOperator[user][operator]) { + return; + } + + revert TransferCallerInvalid(); + } + + function _processBatch721Collection(BatchTransferItem calldata batchItems, address from, address to) private { + uint256[] calldata itemIds = batchItems.itemIds; + uint256[] calldata amounts = batchItems.amounts; + uint256 length = itemIds.length; + + for (uint256 j; j < length;) { + if (amounts[j] != 1) { + revert AmountInvalid(); + } + _executeERC721TransferFrom(batchItems.collection, from, to, itemIds[j]); + unchecked { + ++j; + } + } + } + + function _processBatch1155Collection(BatchTransferItem calldata batchItems, address from, address to) private { + uint256[] calldata itemIds = batchItems.itemIds; + uint256[] calldata amounts = batchItems.amounts; + uint256 length = itemIds.length; + + for (uint256 j; j < length;) { + if (amounts[j] == 0) { + revert AmountInvalid(); + } + + unchecked { + ++j; + } + } + _executeERC1155SafeBatchTransferFrom(batchItems.collection, from, to, itemIds, amounts); + } + + function _processBatchHypercertCollection(BatchTransferItem calldata batchItems, address from, address to) + private + { + uint256[] calldata itemIds = batchItems.itemIds; + uint256[] calldata amounts = batchItems.amounts; + uint256 length = itemIds.length; + + for (uint256 j; j < length;) { + if (amounts[j] == 0) { + revert AmountInvalid(); + } + + unchecked { + ++j; + } + } + _executeERC1155SafeBatchTransferFrom(batchItems.collection, from, to, itemIds, amounts); + } +} diff --git a/contracts/src/marketplace/TransferSelectorNFT.sol b/contracts/src/marketplace/TransferSelectorNFT.sol new file mode 100644 index 00000000..d66d40b4 --- /dev/null +++ b/contracts/src/marketplace/TransferSelectorNFT.sol @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Direct dependencies +import {PackableReentrancyGuard} from "@looksrare/contracts-libs/contracts/PackableReentrancyGuard.sol"; +import {ExecutionManager} from "./ExecutionManager.sol"; +import {TransferManager} from "./TransferManager.sol"; +import {StrategyHypercertFractionOffer} from "./executionStrategies/StrategyHypercertFractionOffer.sol"; + +// Libraries +import {OrderStructs} from "./libraries/OrderStructs.sol"; + +// Enums +import {CollectionType} from "./enums/CollectionType.sol"; + +// Interfaces +import {IHypercertToken} from "../protocol/interfaces/IHypercertToken.sol"; + +/** + * @title TransferSelectorNFT + * @notice This contract handles the logic for transferring non-fungible items. + * @author LooksRare protocol team (👀,💎); bitbeckers; + */ +contract TransferSelectorNFT is ExecutionManager, PackableReentrancyGuard { + error UnsupportedCollectionType(); + /** + * @notice Transfer manager for ERC721, ERC1155 and Hypercerts. + */ + + TransferManager public immutable transferManager; + + /** + * @notice Constructor + * @param _owner Owner address + * @param _protocolFeeRecipient Protocol fee recipient address + * @param _transferManager Address of the transfer manager for ERC721/ERC1155/Hypercerts + */ + constructor(address _owner, address _protocolFeeRecipient, address _transferManager) + ExecutionManager(_owner, _protocolFeeRecipient) + { + transferManager = TransferManager(_transferManager); + } + + /** + * @notice This function is internal and used to transfer non-fungible tokens. + * @param collection Collection address + * @param collectionType Collection type (e.g. 0 = ERC721, 1 = ERC1155, 2 = Hypercert); only 0 and 1 are supported. + * @param sender Sender address + * @param recipient Recipient address + * @param itemIds Array of itemIds + * @param amounts Array of amounts + */ + function _transferNFT( + address collection, + CollectionType collectionType, + address sender, + address recipient, + uint256[] memory itemIds, + uint256[] memory amounts + ) internal { + if (collectionType == CollectionType.ERC721) { + transferManager.transferItemsERC721(collection, sender, recipient, itemIds, amounts); + } else if (collectionType == CollectionType.ERC1155) { + transferManager.transferItemsERC1155(collection, sender, recipient, itemIds, amounts); + } else { + revert UnsupportedCollectionType(); + } + } + + /** + * @notice This function is internal and used to split a hypercert fraction or execute a transfer of the fraction. + * @param collection Collection address + * @param collectionType Collection type (e.g. 0 = ERC721, 1 = ERC1155, 2 = Hypercert); only 2 is supported. + * @param sender Sender address + * @param recipient Recipient address + * @param itemIds Array of itemIds + * @param amounts Array of amounts + */ + function _transferHypercertFraction( + address collection, + CollectionType collectionType, + uint256 strategyId, + address sender, + address recipient, + uint256[] memory itemIds, + uint256[] memory amounts + ) internal { + if (collectionType != CollectionType.Hypercert) { + revert UnsupportedCollectionType(); + } + + // Check if split strategies + if ( + strategyInfo[strategyId].selector + == StrategyHypercertFractionOffer.executeHypercertFractionStrategyWithTakerBid.selector + || strategyInfo[strategyId].selector + == StrategyHypercertFractionOffer.executeHypercertFractionStrategyWithTakerBidWithAllowlist.selector + ) { + transferManager.splitItemsHypercert(collection, sender, recipient, itemIds, amounts); + } else { + transferManager.transferItemsHypercert(collection, sender, recipient, itemIds, amounts); + } + } +} diff --git a/contracts/src/marketplace/constants/AssemblyConstants.sol b/contracts/src/marketplace/constants/AssemblyConstants.sol new file mode 100644 index 00000000..8557dece --- /dev/null +++ b/contracts/src/marketplace/constants/AssemblyConstants.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/* + * @dev error OrderInvalid() + * Memory layout: + * - 0x00: Left-padded selector (data begins at 0x1c) + * Revert buffer is memory[0x1c:0x20] + */ +uint256 constant OrderInvalid_error_selector = 0x2e0c0f71; +uint256 constant OrderInvalid_error_length = 0x04; + +/* + * @dev error CurrencyInvalid() + * Memory layout: + * - 0x00: Left-padded selector (data begins at 0x1c) + * Revert buffer is memory[0x1c:0x20] + */ +uint256 constant CurrencyInvalid_error_selector = 0x4f795487; +uint256 constant CurrencyInvalid_error_length = 0x04; + +/* + * @dev error OutsideOfTimeRange() + * Memory layout: + * - 0x00: Left-padded selector (data begins at 0x1c) + * Revert buffer is memory[0x1c:0x20] + */ +uint256 constant OutsideOfTimeRange_error_selector = 0x7476320f; +uint256 constant OutsideOfTimeRange_error_length = 0x04; + +/* + * @dev error NoSelectorForStrategy() + * Memory layout: + * - 0x00: Left-padded selector (data begins at 0x1c) + * Revert buffer is memory[0x1c:0x20] + */ +uint256 constant NoSelectorForStrategy_error_selector = 0xab984846; +uint256 constant NoSelectorForStrategy_error_length = 0x04; + +uint256 constant Error_selector_offset = 0x1c; + +uint256 constant OneWord = 0x20; diff --git a/contracts/src/marketplace/constants/NumericConstants.sol b/contracts/src/marketplace/constants/NumericConstants.sol new file mode 100644 index 00000000..63029eea --- /dev/null +++ b/contracts/src/marketplace/constants/NumericConstants.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * @dev 100% represented in basis point is 10_000. + */ +uint256 constant ONE_HUNDRED_PERCENT_IN_BP = 10_000; + +/** + * @dev The maximum length of a proof for a batch order is 10. + * The maximum merkle tree that can used for signing has a height of + * 2**10 = 1_024. + */ +uint256 constant MAX_CALLDATA_PROOF_LENGTH = 10; diff --git a/contracts/src/marketplace/constants/ValidationCodeConstants.sol b/contracts/src/marketplace/constants/ValidationCodeConstants.sol new file mode 100644 index 00000000..5c23fd1a --- /dev/null +++ b/contracts/src/marketplace/constants/ValidationCodeConstants.sol @@ -0,0 +1,331 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * 0. No error + */ + +/** + * @dev The maker order is expected to be valid. + * There can be other reasons that cause makers orders to be + * invalid (e.g. trading restrictions for the protocol, fallbacks). + */ +uint256 constant ORDER_EXPECTED_TO_BE_VALID = 0; + +/** + * 1. Strategy & currency-related codes + */ + +/** + * @dev The currency is not allowed in the protocol. + * This maker order could become valid only with owner action. + * If the order is a maker bid and currency = address(0), it is permanently invalid. + */ +uint256 constant CURRENCY_NOT_ALLOWED = 101; + +/** + * @dev The strategy is not implemented in the protocol. + * This maker order can become valid only with owner action. + */ +uint256 constant STRATEGY_NOT_IMPLEMENTED = 111; + +/** + * @dev The strategy is not for this quote type. + * This maker order can never become valid. + */ +uint256 constant STRATEGY_INVALID_QUOTE_TYPE = 112; + +/** + * @dev The strategy exists but is not currently active. + * This maker order can become valid again only with owner action. + */ +uint256 constant STRATEGY_NOT_ACTIVE = 113; + +/** + * 2. Maker order struct-related codes + */ + +/** + * @dev The maker order is permanently invalid for a standard sale (e.g. invalid collection type or amounts) + * This maker order cannot become valid again. + */ +uint256 constant MAKER_ORDER_INVALID_STANDARD_SALE = 201; + +/** + * @dev The maker order is permanently invalid for a non-standard sale strategy. + * This maker order cannot become valid again. + */ +uint256 constant MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE = 211; + +/** + * @dev The maker order is invalid due to a currency support. + * This maker order may become valid in the future depending on the strategy's currency support. + * Please refer to the strategy's implementation code. + */ +uint256 constant MAKER_ORDER_INVALID_CURRENCY_NON_STANDARD_SALE = 212; + +/** + * @dev The maker order is temporarily invalid due to a strategy-specific reason. + * This maker order may become valid in the future. + * Please refer to the strategy's implementation code. + */ +uint256 constant MAKER_ORDER_TEMPORARILY_INVALID_NON_STANDARD_SALE = 213; + +/** + * 3. Nonce-related codes + */ + +/** + * @dev The signer's subset nonce is cancelled. + * This maker order will not become valid again. + */ +uint256 constant USER_SUBSET_NONCE_CANCELLED = 301; + +/** + * @dev The signer's order nonce is executed or cancelled. + * This maker order will not become valid again. + */ +uint256 constant USER_ORDER_NONCE_EXECUTED_OR_CANCELLED = 311; + +/** + * @dev The signer's order nonce is in partial fill status with an other order hash. + * This maker order will not become valid again. + */ +uint256 constant USER_ORDER_NONCE_IN_EXECUTION_WITH_OTHER_HASH = 312; + +/** + * @dev The signer's global bid nonce is not matching the order's bid nonce. + * This maker order will not become valid again. + */ +uint256 constant INVALID_USER_GLOBAL_BID_NONCE = 321; + +/** + * @dev The signer's global ask nonce is not matching the order's ask nonce. + * This maker order will not become valid again. + */ +uint256 constant INVALID_USER_GLOBAL_ASK_NONCE = 322; + +/** + * 4. Codes related to signatures (EOA, EIP-1271) and merkle tree computations + */ + +/** + * @dev The order hash proof is not in the merkle tree. + * This maker order is not valid with the set of merkle root and proofs. + * It cannot become valid with the current merkle proof and root. + */ +uint256 constant ORDER_HASH_PROOF_NOT_IN_MERKLE_TREE = 401; + +/** + * @dev The merkle proof is too large to be verified according. + * There is a proof's size limit defined in the MerkleProofCalldataWithNodes. + * It cannot become valid with the current merkle proof and root. + */ +uint256 constant MERKLE_PROOF_PROOF_TOO_LARGE = 402; + +/** + * @dev The signature's length is invalid. + * The signature's length must be either 64 or 65 bytes. + * This maker order will never be valid. + */ +uint256 constant INVALID_SIGNATURE_LENGTH = 411; + +/** + * @dev The signature's s parameter is invalid. + * This maker order will never be valid. + */ +uint256 constant INVALID_S_PARAMETER_EOA = 412; + +/** + * @dev The signature's v parameter is invalid. + * It must be either equal to 27 or 28. + * This maker order will never be valid with this signature. + */ +uint256 constant INVALID_V_PARAMETER_EOA = 413; + +/** + * @dev The signer recovered (using ecrecover) is the null address. + * This maker order will never be valid with this signature. + */ +uint256 constant NULL_SIGNER_EOA = 414; + +/** + * @dev The recovered signer is not the target signer. + * This maker order will never be valid with this signature. + */ +uint256 constant INVALID_SIGNER_EOA = 415; + +/** + * @dev The signature is generated by a EIP1271 signer contract but the + * contract does not implement the required function to verify the signature. + */ +uint256 constant MISSING_IS_VALID_SIGNATURE_FUNCTION_EIP1271 = 421; + +/** + * @dev The signature by the EIP1271 signer contract is invalid. + * This maker order may become valid again depending on the implementation of the + * contract signing the order. + */ +uint256 constant SIGNATURE_INVALID_EIP1271 = 422; + +/** + * 5. Timestamp-related codes + */ + +/** + * @dev The start time is greater than the end time. + * This maker order will never be valid. + */ +uint256 constant START_TIME_GREATER_THAN_END_TIME = 501; + +/** + * @dev The block time is greater than the end time. + * This maker order will never be valid. + */ +uint256 constant TOO_LATE_TO_EXECUTE_ORDER = 502; + +/** + * @dev The block time is earlier than the start time. + * A buffer of 5 minutes is included for orders that are about to be valid. + * This maker order will become valid without any user action. + */ +uint256 constant TOO_EARLY_TO_EXECUTE_ORDER = 503; + +/** + * 6. Transfer-related (ERC20, ERC721, ERC1155, Hypercert tokens), including transfers and approvals, codes. + */ + +/** + * @dev The same itemId is twice in the bundle. + * This maker order can be valid for ERC1155 collections but will never be valid for ERC721. + */ +uint256 constant SAME_ITEM_ID_IN_BUNDLE = 601; + +/** + * @dev The ERC20 balance of the signer (maker bid user) is inferior to the order bid price. + * This maker order can become valid without any user's action. + */ +uint256 constant ERC20_BALANCE_INFERIOR_TO_PRICE = 611; + +/** + * @dev The ERC20 approval amount of the signer (maker bid user) is inferior to the order bid price. + * This maker order can become valid only with the user's action. + */ +uint256 constant ERC20_APPROVAL_INFERIOR_TO_PRICE = 612; + +/** + * @dev The ERC721 itemId does not exist. + * This maker order can become valid if the item is created later. + */ +uint256 constant ERC721_ITEM_ID_DOES_NOT_EXIST = 621; + +/** + * @dev The ERC721 itemId is not owned by the signer (maker ask user). + * This maker order can become valid without any user's action. + */ +uint256 constant ERC721_ITEM_ID_NOT_IN_BALANCE = 622; + +/** + * @dev The transfer manager contract has not been approved by the ERC721 collection + * contract, either for the entire collection or the itemId. + * This maker order can become valid only with the user's action. + * The collection may not follow the ERC721 standard. + */ +uint256 constant ERC721_NO_APPROVAL_FOR_ALL_OR_ITEM_ID = 623; + +/** + * @dev The ERC1155 collection contract does not implement balanceOf. + */ +uint256 constant ERC1155_BALANCE_OF_DOES_NOT_EXIST = 631; + +/** + * @dev The ERC20 balance of the signer (maker ask user) is inferior to the amount + * required to be sold. + * This maker order can become valid without any user's action. + */ +uint256 constant ERC1155_BALANCE_OF_ITEM_ID_INFERIOR_TO_AMOUNT = 632; + +/** + * @dev The ERC1155 collection contract does not implement isApprovedForAll. + * The collection may not follow the ERC1155 standard. + */ +uint256 constant ERC1155_IS_APPROVED_FOR_ALL_DOES_NOT_EXIST = 633; + +/** + * @dev The transfer manager contract has not been approved by the ERC1155 + * collection contract. + * This maker order can become valid only with the user's action. + */ +uint256 constant ERC1155_NO_APPROVAL_FOR_ALL = 634; + +/* + * @dev The Hypercert collaction does not support balanceOf. + * This maker order can become valid without any user's action. + */ +uint256 constant HYPERCERT_UNITS_OF_DOES_NOT_EXIST = 641; + +/* + * @dev The Hypercert fractionId is not owned by the signer (maker ask user). + * This maker order can become valid without any user's action. + */ +uint256 constant HYPERCERT_UNITS_NOT_HELD_BY_USER = 642; + +/** + * 7. Asset-type codes + */ + +/** + * @dev The collection type specified in the order seems incorrect. + * It is expected to be collectionType = 0. + */ +uint256 constant POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_ERC721 = 701; + +/** + * @dev The collection type specified in the order seems incorrect. + * It is expected to be collectionType = 1. + */ +uint256 constant POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_ERC1155 = 702; + +/** + * @dev The collection type specified in the order seems incorrect. + * It is expected to be collectionType = 2. + */ +uint256 constant POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_HYPERCERT = 703; + +/** + * 8. Transfer manager-related codes + */ + +/** + * @dev The user has not approved the protocol to transfer NFTs on behalf + * of the user. + * This maker order can become valid only with the user's action. + */ +uint256 constant NO_TRANSFER_MANAGER_APPROVAL_BY_USER_FOR_EXCHANGE = 801; + +/** + * @dev The transfer manager's owner has revoked the ability to transfer NFTs + * on behalf of all users that have also approved the protocol. + * This maker order can become valid again only with owner action. + */ +uint256 constant TRANSFER_MANAGER_APPROVAL_REVOKED_BY_OWNER_FOR_EXCHANGE = 802; + +/** + * 9. Creator fee-related codes + */ + +/** + * @dev The collection contract has a flexible royalty fee structure that + * prevents this bundle to be traded. + * It applies at the protocol level. + * For instance, 2 items in a bundle have different creator recipients. + */ +uint256 constant BUNDLE_ERC2981_NOT_SUPPORTED = 901; + +/** + * @dev The creator fee applied at the protocol is higher than the threshold + * allowed. The transaction will revert. + * It applies at the protocol level. + * This maker order can become valid only with the creator's action. + */ +uint256 constant CREATOR_FEE_TOO_HIGH = 902; diff --git a/contracts/src/marketplace/enums/CollectionType.sol b/contracts/src/marketplace/enums/CollectionType.sol new file mode 100644 index 00000000..89c79c81 --- /dev/null +++ b/contracts/src/marketplace/enums/CollectionType.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * @notice CollectionType is used in OrderStructs.Maker's collectionType to determine the collection type being traded. + */ +enum CollectionType { + ERC721, + ERC1155, + Hypercert +} diff --git a/contracts/src/marketplace/enums/QuoteType.sol b/contracts/src/marketplace/enums/QuoteType.sol new file mode 100644 index 00000000..2cb766d7 --- /dev/null +++ b/contracts/src/marketplace/enums/QuoteType.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * @notice QuoteType is used in OrderStructs.Maker's quoteType to determine whether the maker order is a bid or an ask. + */ +enum QuoteType { + Bid, + Ask +} diff --git a/contracts/src/marketplace/errors/ChainlinkErrors.sol b/contracts/src/marketplace/errors/ChainlinkErrors.sol new file mode 100644 index 00000000..bb21b470 --- /dev/null +++ b/contracts/src/marketplace/errors/ChainlinkErrors.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * @notice It is returned if the Chainlink price is invalid (e.g. negative). + */ +error ChainlinkPriceInvalid(); + +/** + * @notice It is returned if the decimals from the NFT floor price feed is invalid. + * Chainlink price feeds are expected to have 18 decimals. + * @dev It can only be returned for owner operations. + */ +error DecimalsInvalid(); + +/** + * @notice It is returned if the fixed discount for a maker bid is greater than floor price. + */ +error DiscountGreaterThanFloorPrice(); + +/** + * @notice It is returned if the latency tolerance is set too high (i.e. greater than 3,600 sec). + */ +error LatencyToleranceTooHigh(); + +/** + * @notice It is returned if the price feed for a collection is already set. + * @dev It can only be returned for owner operations. + */ +error PriceFeedAlreadySet(); + +/** + * @notice It is returned when the price feed is not available. + */ +error PriceFeedNotAvailable(); + +/** + * @notice It is returned if the current block time relative to the latest price's update time + * is greater than the latency tolerance. + */ +error PriceNotRecentEnough(); diff --git a/contracts/src/marketplace/errors/HypercertErrors.sol b/contracts/src/marketplace/errors/HypercertErrors.sol new file mode 100644 index 00000000..f71638d6 --- /dev/null +++ b/contracts/src/marketplace/errors/HypercertErrors.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * @notice It is returned if the available amount of fraction units is not available + * for the selected type of transaction. + * For instance, a split transaction cannot be executed if the amount of fraction units + * is not higher than the amount of fraction units available. + */ +error UnitAmountInvalid(); diff --git a/contracts/src/marketplace/errors/SharedErrors.sol b/contracts/src/marketplace/errors/SharedErrors.sol new file mode 100644 index 00000000..9ac87690 --- /dev/null +++ b/contracts/src/marketplace/errors/SharedErrors.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * @notice It is returned if the amount is invalid. + * For ERC721, any number that is not 1. For ERC1155 and Hypercert, if amount is 0. + */ +error AmountInvalid(); + +/** + * @notice It is returned if the ask price is too high for the bid user. + */ +error AskTooHigh(); + +/** + * @notice It is returned if the bid price is too low for the ask user. + */ +error BidTooLow(); + +/** + * @notice It is returned if the function cannot be called by the sender. + */ +error CallerInvalid(); + +/** + * @notice It is returned if the currency is invalid. + */ +error CurrencyInvalid(); + +/** + * @notice The function selector is invalid for this strategy implementation. + */ +error FunctionSelectorInvalid(); + +/** + * @notice It is returned if there is either a mismatch or an error in the length of the array(s). + */ +error LengthsInvalid(); + +/** + * @notice It is returned if the merkle proof provided is invalid. + */ +error MerkleProofInvalid(); + +/** + * @notice It is returned if the length of the merkle proof provided is greater than tolerated. + * @param length Proof length + */ +error MerkleProofTooLarge(uint256 length); + +/** + * @notice It is emitted if the call recipient is not a contract. + */ +error NotAContract(); + +/** + * @notice It is returned if the order is permanently invalid. + * There may be an issue with the order formatting. + */ +error OrderInvalid(); + +/** + * @notice It is returned if the maker quote type is invalid. + */ +error QuoteTypeInvalid(); diff --git a/contracts/src/marketplace/executionStrategies/BaseStrategy.sol b/contracts/src/marketplace/executionStrategies/BaseStrategy.sol new file mode 100644 index 00000000..9d0bec3c --- /dev/null +++ b/contracts/src/marketplace/executionStrategies/BaseStrategy.sol @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Interfaces +import {IStrategy} from "../interfaces/IStrategy.sol"; + +// Assembly constants +import {OrderInvalid_error_selector} from "../constants/AssemblyConstants.sol"; + +// Libraries +import {OrderStructs} from "../libraries/OrderStructs.sol"; + +// Enums +import {CollectionType} from "../enums/CollectionType.sol"; + +/** + * @title BaseStrategy + * @author LooksRare protocol team (👀,💎) + */ +abstract contract BaseStrategy is IStrategy { + /** + * @inheritdoc IStrategy + */ + function isLooksRareV2Strategy() external pure override returns (bool) { + return true; + } + + /** + * @dev This is equivalent to + * if (amount == 0 || (amount != 1 && collectionType == 0)) { + * return (0, OrderInvalid.selector); + * } + * @dev OrderInvalid_error_selector is a left-padded 4 bytes. If the error selector is returned + * instead of reverting, the error selector needs to be right-padded by + * 28 bytes. Therefore it needs to be left shifted by 28 x 8 = 224 bits. + */ + function _validateAmountNoRevert(uint256 amount, CollectionType collectionType) internal pure { + assembly { + if or(iszero(amount), and(xor(amount, 1), iszero(collectionType))) { + mstore(0x00, 0x00) + mstore(0x20, shl(224, OrderInvalid_error_selector)) + return(0, 0x40) + } + } + } +} diff --git a/contracts/src/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.sol b/contracts/src/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.sol new file mode 100644 index 00000000..09cb3dc3 --- /dev/null +++ b/contracts/src/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.sol @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {OwnableTwoSteps} from "@looksrare/contracts-libs/contracts/OwnableTwoSteps.sol"; + +/** + * @title BaseStrategyChainlinkPriceLatency + * @notice This contract allows the owner to define the maximum acceptable Chainlink price latency. + * @author LooksRare protocol team (👀,💎) + */ +contract BaseStrategyChainlinkPriceLatency is OwnableTwoSteps { + /** + * @notice Maximum latency accepted after which + * the execution strategy rejects the retrieved price. + * + * For ETH, it cannot be higher than 3,600 as Chainlink will at least update the + * price every 3,600 seconds, provided ETH's price does not deviate more than 0.5%. + * + * For NFTs, it cannot be higher than 86,400 as Chainlink will at least update the + * price every 86,400 seconds, provided ETH's price does not deviate more than 2%. + */ + uint256 public immutable maxLatency; + + /** + * @notice Constructor + * @param _owner Owner address + * @param _maxLatency Maximum price latency allowed + */ + constructor(address _owner, uint256 _maxLatency) OwnableTwoSteps(_owner) { + maxLatency = _maxLatency; + } +} diff --git a/contracts/src/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.sol b/contracts/src/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.sol new file mode 100644 index 00000000..137c1e86 --- /dev/null +++ b/contracts/src/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.sol @@ -0,0 +1,164 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries +import {OrderStructs} from "../../libraries/OrderStructs.sol"; +import {CurrencyValidator} from "../../libraries/CurrencyValidator.sol"; + +// Interfaces +import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; + +// Enums +import {QuoteType} from "../../enums/QuoteType.sol"; + +// Shared errors +import { + BidTooLow, + OrderInvalid, + CurrencyInvalid, + FunctionSelectorInvalid, + QuoteTypeInvalid +} from "../../errors/SharedErrors.sol"; +import {ChainlinkPriceInvalid, PriceFeedNotAvailable, PriceNotRecentEnough} from "../../errors/ChainlinkErrors.sol"; + +// Base strategy contracts +import {BaseStrategy, IStrategy} from "../BaseStrategy.sol"; +import {BaseStrategyChainlinkPriceLatency} from "./BaseStrategyChainlinkPriceLatency.sol"; + +/** + * @title StrategyChainlinkUSDDynamicAsk + * @notice This contract allows a seller to sell an NFT priced in USD and the receivable amount to be in ETH. + * @author LooksRare protocol team (👀,💎) + */ +contract StrategyChainlinkUSDDynamicAsk is BaseStrategy, BaseStrategyChainlinkPriceLatency { + /** + * @dev It is possible to call priceFeed.decimals() to get the decimals, + * but to save gas, it is hard coded instead. + */ + uint256 public constant ETH_USD_PRICE_FEED_DECIMALS = 1e8; + + /** + * @notice Wrapped ether (WETH) address. + */ + address public immutable WETH; + + /** + * @notice ETH/USD Chainlink price feed + */ + AggregatorV3Interface public immutable priceFeed; + + /** + * @notice Constructor + * @param _weth Wrapped ether address + * @param _owner Owner address + * @param _priceFeed Address of the ETH/USD price feed + */ + constructor(address _owner, address _weth, address _priceFeed) BaseStrategyChainlinkPriceLatency(_owner, 3600) { + WETH = _weth; + priceFeed = AggregatorV3Interface(_priceFeed); + } + + /** + * @notice This function validates the order under the context of the chosen strategy + * and returns the fulfillable items/amounts/price/nonce invalidation status. + * This strategy looks at the seller's desired sale price in USD and minimum sale price in ETH, + * converts the USD value into ETH using Chainlink's price feed and chooses the higher price. + * @param takerBid Taker bid struct (taker bid-specific parameters for the execution) + * @param makerAsk Maker ask struct (maker ask-specific parameters for the execution) + * @dev The client has to provide the seller's desired sale price in USD as the additionalParameters + */ + function executeStrategyWithTakerBid(OrderStructs.Taker calldata takerBid, OrderStructs.Maker calldata makerAsk) + external + view + returns (uint256 price, uint256[] memory itemIds, uint256[] memory amounts, bool isNonceInvalidated) + { + uint256 itemIdsLength = makerAsk.itemIds.length; + + if (itemIdsLength == 0 || itemIdsLength != makerAsk.amounts.length) { + revert OrderInvalid(); + } + + CurrencyValidator.allowNativeOrAllowedCurrency(makerAsk.currency, WETH); + + (, int256 answer,, uint256 updatedAt,) = priceFeed.latestRoundData(); + + if (answer <= 0) { + revert ChainlinkPriceInvalid(); + } + + if (block.timestamp - updatedAt > maxLatency) { + revert PriceNotRecentEnough(); + } + + // The client has to provide a USD value that is augmented by 1e18. + uint256 desiredSalePriceInUSD = abi.decode(makerAsk.additionalParameters, (uint256)); + + uint256 ethPriceInUSD = uint256(answer); + uint256 minPriceInETH = makerAsk.price; + uint256 desiredSalePriceInETH = (desiredSalePriceInUSD * ETH_USD_PRICE_FEED_DECIMALS) / ethPriceInUSD; + + if (minPriceInETH >= desiredSalePriceInETH) { + price = minPriceInETH; + } else { + price = desiredSalePriceInETH; + } + + uint256 maxPrice = abi.decode(takerBid.additionalParameters, (uint256)); + if (maxPrice < price) { + revert BidTooLow(); + } + + itemIds = makerAsk.itemIds; + amounts = makerAsk.amounts; + isNonceInvalidated = true; + } + + /** + * @inheritdoc IStrategy + */ + function isMakerOrderValid(OrderStructs.Maker calldata makerAsk, bytes4 functionSelector) + external + view + override + returns (bool isValid, bytes4 errorSelector) + { + if (functionSelector != StrategyChainlinkUSDDynamicAsk.executeStrategyWithTakerBid.selector) { + return (isValid, FunctionSelectorInvalid.selector); + } + + if (makerAsk.quoteType != QuoteType.Ask) { + return (isValid, QuoteTypeInvalid.selector); + } + + uint256 itemIdsLength = makerAsk.itemIds.length; + + if (itemIdsLength == 0 || itemIdsLength != makerAsk.amounts.length) { + return (isValid, OrderInvalid.selector); + } + + for (uint256 i; i < itemIdsLength;) { + _validateAmountNoRevert(makerAsk.amounts[i], makerAsk.collectionType); + unchecked { + ++i; + } + } + + if (makerAsk.currency != address(0)) { + if (makerAsk.currency != WETH) { + return (isValid, CurrencyInvalid.selector); + } + } + + (, int256 answer,, uint256 updatedAt,) = priceFeed.latestRoundData(); + + if (answer <= 0) { + return (isValid, ChainlinkPriceInvalid.selector); + } + + if (block.timestamp - updatedAt > maxLatency) { + return (isValid, PriceNotRecentEnough.selector); + } + + isValid = true; + } +} diff --git a/contracts/src/marketplace/executionStrategies/StrategyCollectionOffer.sol b/contracts/src/marketplace/executionStrategies/StrategyCollectionOffer.sol new file mode 100644 index 00000000..9a8f2ff7 --- /dev/null +++ b/contracts/src/marketplace/executionStrategies/StrategyCollectionOffer.sol @@ -0,0 +1,180 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries +import {OrderStructs} from "../libraries/OrderStructs.sol"; + +// OpenZeppelin's library for verifying Merkle proofs +import {MerkleProofMemory} from "../libraries/OpenZeppelin/MerkleProofMemory.sol"; + +// Enums +import {QuoteType} from "../enums/QuoteType.sol"; + +// Shared errors +import {OrderInvalid, FunctionSelectorInvalid, MerkleProofInvalid, QuoteTypeInvalid} from "../errors/SharedErrors.sol"; + +// Base strategy contracts +import {BaseStrategy, IStrategy} from "./BaseStrategy.sol"; + +/** + * @title StrategyCollectionOffer + * @notice This contract offers execution strategies for users to create maker bid offers for items in a collection. + * There are two available functions: + * 1. executeCollectionStrategyWithTakerAsk --> it applies to all itemIds in a collection + * 2. executeCollectionStrategyWithTakerAskWithProof --> it allows adding merkle proof criteria for tokenIds. + * 2. executeCollectionStrategyWithTakerAskWithAllowlist --> it allows adding merkle proof criteria for + * accounts. + * @notice The bidder can only bid on 1 item id at a time. + * 1. If ERC721, the amount must be 1. + * 2. If ERC1155, the amount can be greater than 1. + * 3. If Hypercert, the amount must be 1 (fractions are NFTs) + * @author LooksRare protocol team (👀,💎); bitbeckers + */ +contract StrategyCollectionOffer is BaseStrategy { + /** + * @notice This function validates the order under the context of the chosen strategy and + * returns the fulfillable items/amounts/price/nonce invalidation status. + * This strategy executes a collection offer against a taker ask order without the need of merkle proofs. + * @param takerAsk Taker ask struct (taker ask-specific parameters for the execution) + * @param makerBid Maker bid struct (maker bid-specific parameters for the execution) + */ + function executeCollectionStrategyWithTakerAsk( + OrderStructs.Taker calldata takerAsk, + OrderStructs.Maker calldata makerBid + ) + external + pure + returns (uint256 price, uint256[] memory itemIds, uint256[] calldata amounts, bool isNonceInvalidated) + { + price = makerBid.price; + amounts = makerBid.amounts; + + // A collection order can only be executable for 1 itemId but quantity to fill can vary + if (amounts.length != 1) { + revert OrderInvalid(); + } + + uint256 offeredItemId = abi.decode(takerAsk.additionalParameters, (uint256)); + itemIds = new uint256[](1); + itemIds[0] = offeredItemId; + isNonceInvalidated = true; + } + + /** + * @notice This function validates the order under the context of the chosen strategy + * and returns the fulfillable items/amounts/price/nonce invalidation status. + * This strategy executes a collection offer against a taker ask order with the need of a merkle proof. + * @param takerAsk Taker ask struct (taker ask-specific parameters for the execution) + * @param makerBid Maker bid struct (maker bid-specific parameters for the execution) + * @dev The transaction reverts if the maker does not include a merkle root in the additionalParameters. + */ + function executeCollectionStrategyWithTakerAskWithProof( + OrderStructs.Taker calldata takerAsk, + OrderStructs.Maker calldata makerBid + ) + external + pure + returns (uint256 price, uint256[] memory itemIds, uint256[] calldata amounts, bool isNonceInvalidated) + { + price = makerBid.price; + amounts = makerBid.amounts; + + // A collection order can only be executable for 1 itemId but the actual quantity to fill can vary + if (amounts.length != 1) { + revert OrderInvalid(); + } + + (uint256 offeredItemId, bytes32[] memory proof) = + abi.decode(takerAsk.additionalParameters, (uint256, bytes32[])); + itemIds = new uint256[](1); + itemIds[0] = offeredItemId; + isNonceInvalidated = true; + + bytes32 root = abi.decode(makerBid.additionalParameters, (bytes32)); + bytes32 node = keccak256(abi.encodePacked(offeredItemId)); + + // Verify the merkle root for the given merkle proof + if (!MerkleProofMemory.verify(proof, root, node)) { + revert MerkleProofInvalid(); + } + } + + /** + * @notice This function validates the order under the context of the chosen strategy + * and returns the fulfillable items/amounts/price/nonce invalidation status. + * This strategy executes a collection offer against a taker ask order with the need of a merkle proof + * that the address is allowed to fullfil the ask. + * @param takerAsk Taker ask struct (taker ask-specific parameters for the execution) + * @param makerBid Maker bid struct (maker bid-specific parameters for the execution) + * @dev The transaction reverts if the maker does not include a merkle root in the additionalParameters. + */ + function executeCollectionStrategyWithTakerAskWithAllowlist( + OrderStructs.Taker calldata takerAsk, + OrderStructs.Maker calldata makerBid + ) + external + pure + returns (uint256 price, uint256[] memory itemIds, uint256[] calldata amounts, bool isNonceInvalidated) + { + price = makerBid.price; + amounts = makerBid.amounts; + + // A collection order can only be executable for 1 itemId but the actual quantity to fill can vary + if (amounts.length != 1) { + revert OrderInvalid(); + } + + (uint256 offeredItemId, bytes32[] memory proof) = + abi.decode(takerAsk.additionalParameters, (uint256, bytes32[])); + itemIds = new uint256[](1); + itemIds[0] = offeredItemId; + isNonceInvalidated = true; + + bytes32 root = abi.decode(makerBid.additionalParameters, (bytes32)); + bytes32 node = keccak256(abi.encodePacked(takerAsk.recipient)); + + // Verify the merkle root for the given merkle proof + if (!MerkleProofMemory.verify(proof, root, node)) { + revert MerkleProofInvalid(); + } + } + + /** + * @inheritdoc IStrategy + */ + function isMakerOrderValid(OrderStructs.Maker calldata makerBid, bytes4 functionSelector) + external + pure + override + returns (bool isValid, bytes4 errorSelector) + { + if ( + functionSelector != StrategyCollectionOffer.executeCollectionStrategyWithTakerAskWithProof.selector + && functionSelector != StrategyCollectionOffer.executeCollectionStrategyWithTakerAsk.selector + && functionSelector != StrategyCollectionOffer.executeCollectionStrategyWithTakerAskWithAllowlist.selector + ) { + return (isValid, FunctionSelectorInvalid.selector); + } + + if (makerBid.quoteType != QuoteType.Bid) { + return (isValid, QuoteTypeInvalid.selector); + } + + if (makerBid.amounts.length != 1) { + return (isValid, OrderInvalid.selector); + } + + _validateAmountNoRevert(makerBid.amounts[0], makerBid.collectionType); + + // If no root is provided or invalid length, it should be invalid. + // @dev It does not mean the merkle root is valid against a specific itemId that exists in the collection. + if ( + functionSelector == StrategyCollectionOffer.executeCollectionStrategyWithTakerAskWithProof.selector + && makerBid.additionalParameters.length != 32 + ) { + return (isValid, OrderInvalid.selector); + } + + isValid = true; + } +} diff --git a/contracts/src/marketplace/executionStrategies/StrategyDutchAuction.sol b/contracts/src/marketplace/executionStrategies/StrategyDutchAuction.sol new file mode 100644 index 00000000..3c4fcf27 --- /dev/null +++ b/contracts/src/marketplace/executionStrategies/StrategyDutchAuction.sol @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries +import {OrderStructs} from "../libraries/OrderStructs.sol"; + +// Enums +import {QuoteType} from "../enums/QuoteType.sol"; + +// Shared errors +import {BidTooLow, OrderInvalid, FunctionSelectorInvalid, QuoteTypeInvalid} from "../errors/SharedErrors.sol"; + +// Base strategy contracts +import {BaseStrategy, IStrategy} from "./BaseStrategy.sol"; + +/** + * @title StrategyDutchAuction + * @notice This contract offers a single execution strategy for users to create Dutch auctions. + * @author LooksRare protocol team (👀,💎) + */ +contract StrategyDutchAuction is BaseStrategy { + /** + * @notice This function validates the order under the context of the chosen strategy + * and returns the fulfillable items/amounts/price/nonce invalidation status. + * The execution price set by the seller decreases linearly within the defined period. + * @param takerBid Taker bid struct (taker ask-specific parameters for the execution) + * @param makerAsk Maker ask struct (maker bid-specific parameters for the execution) + * @dev The client has to provide the seller's desired initial start price as the additionalParameters. + */ + function executeStrategyWithTakerBid(OrderStructs.Taker calldata takerBid, OrderStructs.Maker calldata makerAsk) + external + view + returns (uint256 price, uint256[] memory itemIds, uint256[] memory amounts, bool isNonceInvalidated) + { + uint256 itemIdsLength = makerAsk.itemIds.length; + + if (itemIdsLength == 0 || itemIdsLength != makerAsk.amounts.length) { + revert OrderInvalid(); + } + + uint256 startPrice = abi.decode(makerAsk.additionalParameters, (uint256)); + + if (startPrice < makerAsk.price) { + revert OrderInvalid(); + } + + uint256 startTime = makerAsk.startTime; + uint256 endTime = makerAsk.endTime; + + price = ((endTime - block.timestamp) * startPrice + (block.timestamp - startTime) * makerAsk.price) + / (endTime - startTime); + + uint256 maxPrice = abi.decode(takerBid.additionalParameters, (uint256)); + if (maxPrice < price) { + revert BidTooLow(); + } + + isNonceInvalidated = true; + + itemIds = makerAsk.itemIds; + amounts = makerAsk.amounts; + } + + /** + * @inheritdoc IStrategy + */ + function isMakerOrderValid(OrderStructs.Maker calldata makerAsk, bytes4 functionSelector) + external + pure + override + returns (bool isValid, bytes4 errorSelector) + { + if (functionSelector != StrategyDutchAuction.executeStrategyWithTakerBid.selector) { + return (isValid, FunctionSelectorInvalid.selector); + } + + if (makerAsk.quoteType != QuoteType.Ask) { + return (isValid, QuoteTypeInvalid.selector); + } + + uint256 itemIdsLength = makerAsk.itemIds.length; + + if (itemIdsLength == 0 || itemIdsLength != makerAsk.amounts.length) { + return (isValid, OrderInvalid.selector); + } + + for (uint256 i; i < itemIdsLength;) { + _validateAmountNoRevert(makerAsk.amounts[i], makerAsk.collectionType); + unchecked { + ++i; + } + } + + uint256 startPrice = abi.decode(makerAsk.additionalParameters, (uint256)); + + if (startPrice < makerAsk.price) { + return (isValid, OrderInvalid.selector); + } + + isValid = true; + } +} diff --git a/contracts/src/marketplace/executionStrategies/StrategyHypercertFractionOffer.sol b/contracts/src/marketplace/executionStrategies/StrategyHypercertFractionOffer.sol new file mode 100644 index 00000000..84972b4c --- /dev/null +++ b/contracts/src/marketplace/executionStrategies/StrategyHypercertFractionOffer.sol @@ -0,0 +1,217 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Interface +import {IHypercertToken} from "@hypercerts/protocol/interfaces/IHypercertToken.sol"; + +// Libraries +import {OrderStructs} from "../libraries/OrderStructs.sol"; + +// OpenZeppelin's library for verifying Merkle proofs +import {MerkleProofMemory} from "../libraries/OpenZeppelin/MerkleProofMemory.sol"; + +// Enums +import {QuoteType} from "../enums/QuoteType.sol"; + +// Shared errors +import { + AmountInvalid, + LengthsInvalid, + OrderInvalid, + FunctionSelectorInvalid, + MerkleProofInvalid, + QuoteTypeInvalid +} from "../errors/SharedErrors.sol"; + +// Base strategy contracts +import {BaseStrategy, IStrategy} from "./BaseStrategy.sol"; + +/** + * @title StrategyHypercertFractionOffer + * @notice This contract offers a single execution strategy for users to bid on + * a specific amount of units in an hypercerts that's for sale. + * Example: + * Alice has 100 units of a hypercert (id: 42) for sale at a minimum price of 0.001 ETH/unit. + * Bob wants to buy 10 units. + * Bob can create a taker bid order with the following parameters: + * - unitAmount: 10000 // Total amount for sale; in `amounts` array + * - minUnitAmount: 100 // Minimum amount to buy; in `additionalParameters` + * - maxUnitAmount: 1000 // Maximum amount to buy; in `additionalParameters` + * - acceptedTokenAmount: 1000000000000000 (0.001 ETH in wei) + * - acceptedTokenAddress: 0x0000000000000000000000000000000000000000 + * - proof: [0xsdadfa....s9fds,0xdasdas...asff8e] + * This strategy will validate the available units and the price. + * @notice This contract offers execution strategies for users to create maker bid offers for items in a collection. + * There are three available functions: + * 1. executeCollectionStrategyWithTakerAsk --> it applies to all itemIds in a collection + * 2. executeCollectionStrategyWithTakerAskWithAllowlist --> it allows adding merkle proof criteria for + * accounts. + * @notice The bidder can only bid on 1 item id at a time. + * 1. If ERC721, the amount must be 1. + * 2. If ERC1155, the amount can be greater than 1. + * 3. If Hypercert, the amount can be greater than 1 because they represent units held by the hypercert. + * @dev Use cases can include tiered pricing; think early bird tickets. + * @author LooksRare protocol team (👀,💎); bitbeckers; + */ +contract StrategyHypercertFractionOffer is BaseStrategy { + /** + * @notice This function validates the order under the context of the chosen strategy and + * returns the fulfillable items/amounts/price/nonce invalidation status. + * This strategy executes a collection offer against a taker ask order without the need of merkle proofs. + * @param takerBid Taker ask struct (taker ask-specific parameters for the execution) + * @param makerAsk Maker bid struct (maker bid-specific parameters for the execution) + */ + function executeHypercertFractionStrategyWithTakerBid( + OrderStructs.Taker calldata takerBid, + OrderStructs.Maker calldata makerAsk + ) + external + view + returns (uint256 price, uint256[] memory itemIds, uint256[] memory amounts, bool isNonceInvalidated) + { + itemIds = makerAsk.itemIds; + + // A collection order can only be executable for 1 itemId but the actual quantity to fill can vary + if (makerAsk.amounts.length != 1 || itemIds.length != 1) { + revert LengthsInvalid(); + } + + if (makerAsk.amounts[0] == 0) { + revert AmountInvalid(); + } + + //units, pricePerUnit + (uint256 unitAmount, uint256 pricePerUnit) = abi.decode(takerBid.additionalParameters, (uint256, uint256)); + + //minUnitAmount, maxUnitAmount, root + (uint256 minUnitAmount, uint256 maxUnitAmount) = abi.decode(makerAsk.additionalParameters, (uint256, uint256)); + + // A collection order can only be executable for 1 itemId but quantity to fill can vary + if ( + minUnitAmount > maxUnitAmount || unitAmount == 0 || unitAmount < minUnitAmount || unitAmount > maxUnitAmount + || pricePerUnit < makerAsk.price || makerAsk.price == 0 + || IHypercertToken(makerAsk.collection).unitsOf(itemIds[0]) < unitAmount + ) { + revert OrderInvalid(); + } + + uint256[] memory amountsToFill = new uint256[](1); + amountsToFill[0] = unitAmount; + amounts = amountsToFill; + + price = unitAmount * pricePerUnit; + // If the amount to fill is equal to the amount of units in the hypercert, we transfer the fraction. + // Otherwise, we do not invalidate the nonce because it is a partial fill. + isNonceInvalidated = IHypercertToken(makerAsk.collection).unitsOf(itemIds[0]) == unitAmount; + } + + /** + * @notice This function validates the order under the context of the chosen strategy + * and returns the fulfillable items/amounts/price/nonce invalidation status. + * This strategy executes a fraction offer against a taker bid order with the need of a merkle proof + * that the address is allowed to fullfil the ask. + * @param takerBid Taker bid struct (taker bid-specific parameters for the execution) + * @param makerAsk Maker ask struct (maker ask-specific parameters for the execution) + * @dev The transaction reverts if the maker does not include a merkle root in the additionalParameters. + */ + function executeHypercertFractionStrategyWithTakerBidWithAllowlist( + OrderStructs.Taker calldata takerBid, + OrderStructs.Maker calldata makerAsk + ) + external + view + returns (uint256 price, uint256[] memory itemIds, uint256[] memory amounts, bool isNonceInvalidated) + { + itemIds = makerAsk.itemIds; + + // A collection order can only be executable for 1 itemId but the actual quantity to fill can vary + if (makerAsk.amounts.length != 1 || itemIds.length != 1) { + revert LengthsInvalid(); + } + + if (makerAsk.amounts[0] == 0) { + revert AmountInvalid(); + } + + //units, pricePerUnit, proof[] + (uint256 unitAmount, uint256 pricePerUnit, bytes32[] memory proof) = + abi.decode(takerBid.additionalParameters, (uint256, uint256, bytes32[])); + + //minUnitAmount, maxUnitAmount, root + (uint256 minUnitAmount, uint256 maxUnitAmount, bytes32 root) = + abi.decode(makerAsk.additionalParameters, (uint256, uint256, bytes32)); + + // A collection order can only be executable for 1 itemId but quantity to fill can vary + if ( + minUnitAmount > maxUnitAmount || unitAmount == 0 || unitAmount < minUnitAmount || unitAmount > maxUnitAmount + || pricePerUnit < makerAsk.price || makerAsk.price == 0 + || IHypercertToken(makerAsk.collection).unitsOf(itemIds[0]) < unitAmount + ) { + revert OrderInvalid(); + } + + uint256[] memory amountsToFill = new uint256[](1); + amountsToFill[0] = unitAmount; + amounts = amountsToFill; + + price = unitAmount * pricePerUnit; + + // If the amount to fill is equal to the amount of units in the hypercert, we transfer the fraction. + // Otherwise, we do not invalidate the nonce because it is a partial fill. + isNonceInvalidated = IHypercertToken(makerAsk.collection).unitsOf(itemIds[0]) == unitAmount; + + bytes32 node = keccak256(abi.encodePacked(takerBid.recipient)); + + // Verify the merkle root for the given merkle proof + if (!MerkleProofMemory.verify(proof, root, node)) { + revert MerkleProofInvalid(); + } + } + + /** + * @inheritdoc IStrategy + */ + function isMakerOrderValid(OrderStructs.Maker calldata makerAsk, bytes4 functionSelector) + external + view + override + returns (bool isValid, bytes4 errorSelector) + { + if ( + functionSelector != StrategyHypercertFractionOffer.executeHypercertFractionStrategyWithTakerBid.selector + && functionSelector + != StrategyHypercertFractionOffer.executeHypercertFractionStrategyWithTakerBidWithAllowlist.selector + ) { + return (isValid, FunctionSelectorInvalid.selector); + } + + if (makerAsk.quoteType != QuoteType.Ask) { + return (isValid, QuoteTypeInvalid.selector); + } + + (uint256 minUnitAmount, uint256 maxUnitAmount) = abi.decode(makerAsk.additionalParameters, (uint256, uint256)); + + if ( + makerAsk.amounts.length != 1 || makerAsk.amounts[0] == 0 + || IHypercertToken(makerAsk.collection).unitsOf(makerAsk.itemIds[0]) < makerAsk.amounts[0] + || makerAsk.itemIds.length != 1 || minUnitAmount > maxUnitAmount || makerAsk.price == 0 + || maxUnitAmount == 0 + ) { + return (isValid, OrderInvalid.selector); + } + + // If no root is provided or invalid length, it should be invalid. + // @dev It does not mean the merkle root is valid against a specific itemId that exists in the collection. + // @dev 96 is the length of the bytes32 array when the merkle root is provided together with two uint256 params + // declared in the additionalParameters. + if ( + functionSelector + == StrategyHypercertFractionOffer.executeHypercertFractionStrategyWithTakerBidWithAllowlist.selector + && makerAsk.additionalParameters.length != 96 + ) { + return (isValid, OrderInvalid.selector); + } + + isValid = true; + } +} diff --git a/contracts/src/marketplace/executionStrategies/StrategyItemIdsRange.sol b/contracts/src/marketplace/executionStrategies/StrategyItemIdsRange.sol new file mode 100644 index 00000000..b2f5de20 --- /dev/null +++ b/contracts/src/marketplace/executionStrategies/StrategyItemIdsRange.sol @@ -0,0 +1,110 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries +import {OrderStructs} from "../libraries/OrderStructs.sol"; + +// Enums +import {QuoteType} from "../enums/QuoteType.sol"; + +// Shared errors +import {OrderInvalid, FunctionSelectorInvalid, QuoteTypeInvalid} from "../errors/SharedErrors.sol"; + +// Base strategy contracts +import {BaseStrategy, IStrategy} from "./BaseStrategy.sol"; + +/** + * @title StrategyItemIdsRange + * @notice This contract offers a single execution strategy for users to bid on + * a specific amount of items in a range bounded by 2 item ids. + * @author LooksRare protocol team (👀,💎) + */ +contract StrategyItemIdsRange is BaseStrategy { + /** + * @notice This function validates the order under the context of the chosen strategy + * and returns the fulfillable items/amounts/price/nonce invalidation status. + * With this strategy, the bidder picks a item id range (e.g. 1-100) + * and a seller can fulfill the order with any tokens within the specified id range. + * @param takerAsk Taker ask struct (taker ask-specific parameters for the execution) + * @param makerBid Maker bid struct (maker bid-specific parameters for the execution) + */ + function executeStrategyWithTakerAsk(OrderStructs.Taker calldata takerAsk, OrderStructs.Maker calldata makerBid) + external + pure + returns (uint256 price, uint256[] memory itemIds, uint256[] memory amounts, bool isNonceInvalidated) + { + (itemIds, amounts) = abi.decode(takerAsk.additionalParameters, (uint256[], uint256[])); + uint256 length = itemIds.length; + if (length != amounts.length) { + revert OrderInvalid(); + } + + (uint256 minItemId, uint256 maxItemId, uint256 desiredAmount) = + abi.decode(makerBid.additionalParameters, (uint256, uint256, uint256)); + + if (minItemId >= maxItemId || desiredAmount == 0) { + revert OrderInvalid(); + } + + uint256 totalOfferedAmount; + uint256 lastItemId; + + for (uint256 i; i < length;) { + uint256 offeredItemId = itemIds[i]; + // Force the client to sort the item ids in ascending order, + // in order to prevent taker ask from providing duplicated + // item ids + if (offeredItemId <= lastItemId) { + if (i != 0) { + revert OrderInvalid(); + } + } + + if (offeredItemId < minItemId || offeredItemId > maxItemId) { + revert OrderInvalid(); + } + + totalOfferedAmount += amounts[i]; + + lastItemId = offeredItemId; + + unchecked { + ++i; + } + } + + if (totalOfferedAmount != desiredAmount) { + revert OrderInvalid(); + } + + price = makerBid.price; + isNonceInvalidated = true; + } + + /** + * @inheritdoc IStrategy + */ + function isMakerOrderValid(OrderStructs.Maker calldata makerBid, bytes4 functionSelector) + external + pure + override + returns (bool isValid, bytes4 errorSelector) + { + if (functionSelector != StrategyItemIdsRange.executeStrategyWithTakerAsk.selector) { + return (isValid, FunctionSelectorInvalid.selector); + } + + if (makerBid.quoteType != QuoteType.Bid) { + return (isValid, QuoteTypeInvalid.selector); + } + + (uint256 minItemId, uint256 maxItemId, uint256 desiredAmount) = + abi.decode(makerBid.additionalParameters, (uint256, uint256, uint256)); + + if (minItemId >= maxItemId || desiredAmount == 0) { + return (isValid, OrderInvalid.selector); + } + + isValid = true; + } +} diff --git a/contracts/src/marketplace/helpers/OrderValidatorV2A.sol b/contracts/src/marketplace/helpers/OrderValidatorV2A.sol new file mode 100644 index 00000000..e25ed1ca --- /dev/null +++ b/contracts/src/marketplace/helpers/OrderValidatorV2A.sol @@ -0,0 +1,910 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {IERC165} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC165.sol"; +import {IERC20} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC20.sol"; +import {IERC721} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC721.sol"; +import {IERC1155} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC1155.sol"; +import {IERC1271} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC1271.sol"; + +// Libraries +import {OrderStructs} from "../libraries/OrderStructs.sol"; +import {MerkleProofCalldataWithNodes} from "../libraries/OpenZeppelin/MerkleProofCalldataWithNodes.sol"; + +// Interfaces +import {ICreatorFeeManager} from "../interfaces/ICreatorFeeManager.sol"; +import {IStrategy} from "../interfaces/IStrategy.sol"; +import {IRoyaltyFeeRegistry} from "../interfaces/IRoyaltyFeeRegistry.sol"; +import {IHypercertToken} from "@hypercerts/protocol/interfaces/IHypercertToken.sol"; + +// Shared errors +import {OrderInvalid} from "../errors/SharedErrors.sol"; + +// Other dependencies +import {LooksRareProtocol} from "../LooksRareProtocol.sol"; +import {TransferManager} from "../TransferManager.sol"; + +// Constants +import "../constants/ValidationCodeConstants.sol"; +import {MAX_CALLDATA_PROOF_LENGTH, ONE_HUNDRED_PERCENT_IN_BP} from "../constants/NumericConstants.sol"; + +// Enums +import {CollectionType} from "../enums/CollectionType.sol"; +import {QuoteType} from "../enums/QuoteType.sol"; + +/** + * @title OrderValidatorV2A + * @notice This contract is used to check the validity of maker ask/bid orders in the LooksRareProtocol (v2). + * It performs checks for: + * 1. Protocol allowlist issues (i.e. currency or strategy not allowed) + * 2. Maker order-specific issues (e.g., order invalid due to format or other-strategy specific issues) + * 3. Nonce related issues (e.g., nonce executed or cancelled) + * 4. Signature related issues and merkle tree parameters + * 5. Timestamp related issues (e.g., order expired) + * 6. Asset-related issues for ERC20/ERC721/ERC1155/Hypercerts (approvals and balances) + * 7. Collection-type suggestions + * 8. Transfer manager related issues + * 9. Creator fee related issues (e.g., creator fee too high, ERC2981 bundles) + * @dev This version does not handle strategies with partial fills. + * @author LooksRare protocol team (👀,💎); bitbeckers + */ +contract OrderValidatorV2A { + using OrderStructs for OrderStructs.Maker; + + /** + * @notice ERC721 potential interfaceId. + */ + bytes4 public constant ERC721_INTERFACE_ID_1 = 0x5b5e139f; + + /** + * @notice ERC721 potential interfaceId. + */ + bytes4 public constant ERC721_INTERFACE_ID_2 = 0x80ac58cd; + + /** + * @notice ERC1155 interfaceId. + */ + bytes4 public constant ERC1155_INTERFACE_ID = 0xd9b67a26; + + /** + * @notice Hypercert interfaceId + */ + bytes4 public constant HYPERCERT_INTERFACE_ID = 0xda69bafa; + + /** + * @notice Magic value nonce returned if executed (or cancelled). + */ + bytes32 public constant MAGIC_VALUE_ORDER_NONCE_EXECUTED = keccak256("ORDER_NONCE_EXECUTED"); + + /** + * @notice Number of distinct criteria groups checked to evaluate the validity of an order. + */ + uint256 public constant CRITERIA_GROUPS = 9; + + /** + * @notice LooksRareProtocol domain separator. + */ + bytes32 public domainSeparator; + + /** + * @notice Maximum creator fee (in basis point). + */ + uint256 public maxCreatorFeeBp; + + /** + * @notice CreatorFeeManager. + */ + ICreatorFeeManager public creatorFeeManager; + + /** + * @notice LooksRareProtocol. + */ + LooksRareProtocol public looksRareProtocol; + + /** + * @notice TransferManager + */ + TransferManager public transferManager; + + /** + * @notice Constructor + * @param _looksRareProtocol LooksRare protocol address + * @dev It derives automatically other external variables such as the creator fee manager and domain separator. + */ + constructor(address _looksRareProtocol) { + looksRareProtocol = LooksRareProtocol(_looksRareProtocol); + transferManager = looksRareProtocol.transferManager(); + + _deriveProtocolParameters(); + } + + /** + * @notice Derive protocol parameters. Anyone can call this function. + * @dev It allows adjusting if the domain separator or creator fee manager address were to change. + */ + function deriveProtocolParameters() external { + _deriveProtocolParameters(); + } + + /** + * @notice This function verifies the validity of an array of maker orders. + * @param makerOrders Array of maker orders + * @param signatures Array of signatures + * @param merkleTrees Array of merkle trees + * @return validationCodes Arrays of validation codes + */ + function checkMultipleMakerOrderValidities( + OrderStructs.Maker[] calldata makerOrders, + bytes[] calldata signatures, + OrderStructs.MerkleTree[] calldata merkleTrees + ) external view returns (uint256[9][] memory validationCodes) { + uint256 length = makerOrders.length; + + validationCodes = new uint256[CRITERIA_GROUPS][](length); + + for (uint256 i; i < length;) { + validationCodes[i] = checkMakerOrderValidity(makerOrders[i], signatures[i], merkleTrees[i]); + unchecked { + ++i; + } + } + } + + /** + * @notice This function verifies the validity of a maker order. + * @param makerOrder Maker struct + * @param signature Signature + * @param merkleTree Merkle tree + * @return validationCodes Array of validation codes + */ + function checkMakerOrderValidity( + OrderStructs.Maker calldata makerOrder, + bytes calldata signature, + OrderStructs.MerkleTree calldata merkleTree + ) public view returns (uint256[9] memory validationCodes) { + bytes32 orderHash = makerOrder.hash(); + + validationCodes[0] = + _checkValidityCurrencyAndStrategy(makerOrder.quoteType, makerOrder.currency, makerOrder.strategyId); + + // It will exit here if the strategy does not exist. + // However, if the strategy is implemented but invalid (except if wrong quote type), + // it can continue the validation process. + if (validationCodes[0] == STRATEGY_NOT_IMPLEMENTED || validationCodes[0] == STRATEGY_INVALID_QUOTE_TYPE) { + return validationCodes; + } + + uint256 validationCode1; + uint256[] memory itemIds; + uint256[] memory amounts; + uint256 price; + + if (makerOrder.quoteType == QuoteType.Ask) { + (validationCode1, itemIds, amounts, price) = _checkValidityMakerAskItemIdsAndAmountsAndPrice(makerOrder); + } else { + (validationCode1, itemIds,, price) = _checkValidityMakerBidItemIdsAndAmountsAndPrice(makerOrder); + } + + validationCodes[1] = validationCode1; + + validationCodes[2] = _checkValidityNonces( + makerOrder.quoteType, + makerOrder.signer, + makerOrder.globalNonce, + makerOrder.orderNonce, + makerOrder.subsetNonce, + orderHash + ); + + validationCodes[3] = _checkValidityMerkleProofAndOrderHash(merkleTree, orderHash, signature, makerOrder.signer); + validationCodes[4] = _checkValidityTimestamps(makerOrder.startTime, makerOrder.endTime); + + validationCodes[3] = _checkValidityMerkleProofAndOrderHash(merkleTree, orderHash, signature, makerOrder.signer); + validationCodes[4] = _checkValidityTimestamps(makerOrder.startTime, makerOrder.endTime); + + if (makerOrder.quoteType == QuoteType.Bid) { + validationCodes[5] = _checkValidityMakerBidERC20Assets(makerOrder.currency, makerOrder.signer, price); + } else { + validationCodes[5] = _checkValidityMakerAskNFTAssets( + makerOrder.collection, makerOrder.collectionType, makerOrder.signer, itemIds, amounts + ); + } + + validationCodes[6] = _checkIfPotentialInvalidCollectionTypes(makerOrder.collection, makerOrder.collectionType); + + if (makerOrder.quoteType == QuoteType.Bid) { + validationCodes[7] = ORDER_EXPECTED_TO_BE_VALID; + } else { + validationCodes[7] = _checkValidityTransferManagerApprovals(makerOrder.signer); + } + + validationCodes[8] = _checkValidityCreatorFee(makerOrder.collection, price, itemIds); + } + + /** + * @notice This function is private and is used to adjust the protocol parameters. + */ + function _deriveProtocolParameters() private { + domainSeparator = looksRareProtocol.domainSeparator(); + creatorFeeManager = looksRareProtocol.creatorFeeManager(); + maxCreatorFeeBp = looksRareProtocol.maxCreatorFeeBp(); + } + + /** + * @notice This function is private and verifies the validity of nonces for maker order. + * @param makerSigner Address of the maker signer + * @param globalNonce Global nonce + * @param orderNonce Order nonce + * @param subsetNonce Subset nonce + * @param orderHash Order hash + * @return validationCode Validation code + */ + function _checkValidityNonces( + QuoteType quoteType, + address makerSigner, + uint256 globalNonce, + uint256 orderNonce, + uint256 subsetNonce, + bytes32 orderHash + ) private view returns (uint256 validationCode) { + // 1. Check subset nonce + if (looksRareProtocol.userSubsetNonce(makerSigner, subsetNonce)) { + return USER_SUBSET_NONCE_CANCELLED; + } + + // 2. Check order nonce + bytes32 orderNonceStatus = looksRareProtocol.userOrderNonce(makerSigner, orderNonce); + + if (orderNonceStatus == MAGIC_VALUE_ORDER_NONCE_EXECUTED) { + return USER_ORDER_NONCE_EXECUTED_OR_CANCELLED; + } + + if (orderNonceStatus != bytes32(0) && orderNonceStatus != orderHash) { + return USER_ORDER_NONCE_IN_EXECUTION_WITH_OTHER_HASH; + } + + // 3. Check global nonces + (uint256 globalBidNonce, uint256 globalAskNonce) = looksRareProtocol.userBidAskNonces(makerSigner); + + if (quoteType == QuoteType.Bid && globalNonce != globalBidNonce) { + return INVALID_USER_GLOBAL_BID_NONCE; + } + if (quoteType == QuoteType.Ask && globalNonce != globalAskNonce) { + return INVALID_USER_GLOBAL_ASK_NONCE; + } + } + + /** + * @notice This function is private and verifies the validity of the currency and strategy. + * @param quoteType Quote type + * @param currency Address of the currency + * @param strategyId Strategy id + * @return validationCode Validation code + */ + function _checkValidityCurrencyAndStrategy(QuoteType quoteType, address currency, uint256 strategyId) + private + view + returns (uint256 validationCode) + { + // 1. Verify whether the currency is allowed + if (!looksRareProtocol.isCurrencyAllowed(currency)) { + return CURRENCY_NOT_ALLOWED; + } + + if (currency == address(0) && quoteType == QuoteType.Bid) { + return CURRENCY_NOT_ALLOWED; + } + + // 2. Verify whether the strategy is valid + (bool strategyIsActive,,,,, bool strategyIsMakerBid, address strategyImplementation) = + looksRareProtocol.strategyInfo(strategyId); + + if (strategyId != 0 && strategyImplementation == address(0)) { + return STRATEGY_NOT_IMPLEMENTED; + } + + if (strategyId != 0) { + if ( + (strategyIsMakerBid && quoteType != QuoteType.Bid) + || (!strategyIsMakerBid && quoteType != QuoteType.Ask) + ) { + return STRATEGY_INVALID_QUOTE_TYPE; + } + } + + if (!strategyIsActive) { + return STRATEGY_NOT_ACTIVE; + } + } + + /** + * @notice This function verifies the validity for order timestamps. + * @param startTime Start time + * @param endTime End time + * @return validationCode Validation code + */ + function _checkValidityTimestamps(uint256 startTime, uint256 endTime) + private + view + returns (uint256 validationCode) + { + // @dev It is possible for startTime to be equal to endTime. + // If so, the execution only succeeds when the startTime = endTime = block.timestamp. + // For order invalidation, if the call succeeds, it is already too late for later execution since the + // next block will have a greater timestamp than the current one. + if (startTime >= endTime) { + return START_TIME_GREATER_THAN_END_TIME; + } + + if (endTime <= block.timestamp) { + return TOO_LATE_TO_EXECUTE_ORDER; + } + if (startTime >= block.timestamp + 5 minutes) { + return TOO_EARLY_TO_EXECUTE_ORDER; + } + } + + /** + * @notice This function is private and checks if the collection type may be potentially invalid. + * @param collection Address of the collection + * @param collectionType Collection type in the maker order + * @return validationCode Validation code + * @dev This function may return false positives. + * (i.e. collections that are tradable but do not implement the proper interfaceId). + * If ERC165 is not implemented, it will revert. + */ + function _checkIfPotentialInvalidCollectionTypes(address collection, CollectionType collectionType) + private + view + returns (uint256 validationCode) + { + if (collectionType == CollectionType.ERC721) { + bool isERC721 = IERC165(collection).supportsInterface(ERC721_INTERFACE_ID_1) + || IERC165(collection).supportsInterface(ERC721_INTERFACE_ID_2); + + if (!isERC721) { + return POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_ERC721; + } + } else if (collectionType == CollectionType.ERC1155) { + if (!IERC165(collection).supportsInterface(ERC1155_INTERFACE_ID)) { + return POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_ERC1155; + } + } else if (collectionType == CollectionType.Hypercert) { + if (!IERC165(collection).supportsInterface(HYPERCERT_INTERFACE_ID)) { + return POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_HYPERCERT; + } + } + } + + /** + * @notice This function verifies that (1) ERC20 approvals + * and (2) balances are sufficient to process the maker bid order. + * @param currency Currency address + * @param user User address + * @param price Price (defined by the maker order) + * @return validationCode Validation code + */ + function _checkValidityMakerBidERC20Assets(address currency, address user, uint256 price) + private + view + returns (uint256 validationCode) + { + if (currency != address(0)) { + if (IERC20(currency).balanceOf(user) < price) { + return ERC20_BALANCE_INFERIOR_TO_PRICE; + } + + if (IERC20(currency).allowance(user, address(looksRareProtocol)) < price) { + return ERC20_APPROVAL_INFERIOR_TO_PRICE; + } + } + } + + /** + * @notice This function verifies the validity of NFT assets (approvals, balances, and others). + * @param collection Collection address + * @param collectionType Collection type + * @param user User address + * @param itemIds Array of item ids + * @param amounts Array of amounts + * @return validationCode Validation code + */ + function _checkValidityMakerAskNFTAssets( + address collection, + CollectionType collectionType, + address user, + uint256[] memory itemIds, + uint256[] memory amounts + ) private view returns (uint256 validationCode) { + validationCode = _checkIfItemIdsDiffer(itemIds); + + if (validationCode != ORDER_EXPECTED_TO_BE_VALID) { + return validationCode; + } + + if (collectionType == CollectionType.ERC721) { + validationCode = _checkValidityERC721AndEquivalents(collection, user, itemIds); + } else if (collectionType == CollectionType.ERC1155) { + validationCode = _checkValidityERC1155(collection, user, itemIds, amounts); + } else if (collectionType == CollectionType.Hypercert) { + validationCode = _checkValidityHypercert(collection, user, itemIds, amounts); + } + } + + /** + * @notice This function verifies the validity of (1) ERC721 approvals + * and (2) balances to process the maker ask order. + * @param collection Collection address + * @param user User address + * @param itemIds Array of item ids + * @return validationCode Validation code + */ + function _checkValidityERC721AndEquivalents(address collection, address user, uint256[] memory itemIds) + private + view + returns (uint256 validationCode) + { + // 1. Verify itemId is owned by user and catch revertion if ERC721 ownerOf fails + uint256 length = itemIds.length; + + bool success; + bytes memory data; + + for (uint256 i; i < length;) { + (success, data) = collection.staticcall(abi.encodeCall(IERC721.ownerOf, (itemIds[i]))); + + if (!success) { + return ERC721_ITEM_ID_DOES_NOT_EXIST; + } + + if (abi.decode(data, (address)) != user) { + return ERC721_ITEM_ID_NOT_IN_BALANCE; + } + + unchecked { + ++i; + } + } + + // 2. Verify if collection is approved by transfer manager + (success, data) = + collection.staticcall(abi.encodeCall(IERC721.isApprovedForAll, (user, address(transferManager)))); + + bool isApprovedAll; + if (success) { + isApprovedAll = abi.decode(data, (bool)); + } + + if (!isApprovedAll) { + for (uint256 i; i < length;) { + // 3. If collection is not approved by transfer manager, try to see if it is approved individually + (success, data) = collection.staticcall(abi.encodeCall(IERC721.getApproved, (itemIds[i]))); + + address approvedAddress; + + if (success) { + approvedAddress = abi.decode(data, (address)); + } + + if (approvedAddress != address(transferManager)) { + return ERC721_NO_APPROVAL_FOR_ALL_OR_ITEM_ID; + } + + unchecked { + ++i; + } + } + } + } + + /** + * @notice This function verifies the validity of (1) ERC1155 approvals + * (2) and balances to process the maker ask order. + * @param collection Collection address + * @param user User address + * @param itemIds Array of item ids + * @param amounts Array of amounts + * @return validationCode Validation code + */ + function _checkValidityERC1155(address collection, address user, uint256[] memory itemIds, uint256[] memory amounts) + private + view + returns (uint256 validationCode) + { + // 1. Verify each itemId is owned by user and catch revertion if ERC1155 ownerOf fails + address[] memory users = new address[](1); + users[0] = user; + + uint256 length = itemIds.length; + + // 1.1 Use balanceOfBatch + (bool success, bytes memory data) = + collection.staticcall(abi.encodeCall(IERC1155.balanceOfBatch, (users, itemIds))); + + if (success) { + uint256[] memory balances = abi.decode(data, (uint256[])); + for (uint256 i; i < length;) { + if (balances[i] < amounts[i]) { + return ERC1155_BALANCE_OF_ITEM_ID_INFERIOR_TO_AMOUNT; + } + unchecked { + ++i; + } + } + } else { + // 1.2 If the balanceOfBatch does not work, use loop with balanceOf function + for (uint256 i; i < length;) { + (success, data) = collection.staticcall(abi.encodeCall(IERC1155.balanceOf, (user, itemIds[i]))); + + if (!success) { + return ERC1155_BALANCE_OF_DOES_NOT_EXIST; + } + + if (abi.decode(data, (uint256)) < amounts[i]) { + return ERC1155_BALANCE_OF_ITEM_ID_INFERIOR_TO_AMOUNT; + } + + unchecked { + ++i; + } + } + } + + // 2. Verify if collection is approved by transfer manager + (success, data) = + collection.staticcall(abi.encodeCall(IERC1155.isApprovedForAll, (user, address(transferManager)))); + + if (!success) { + return ERC1155_IS_APPROVED_FOR_ALL_DOES_NOT_EXIST; + } + + if (!abi.decode(data, (bool))) { + return ERC1155_NO_APPROVAL_FOR_ALL; + } + } + + /** + * @notice This function verifies the validity of (1) Hypercerts + 1155 approvals + * (2) and balances to process the maker ask order. + * @param collection Collection address + * @param user User address + * @param itemIds Array of fraction ids + * @param amounts Array of units held by each fraction + * @return validationCode Validation code + */ + function _checkValidityHypercert( + address collection, + address user, + uint256[] memory itemIds, + uint256[] memory amounts + ) private view returns (uint256 validationCode) { + // 1. Verify each itemId is owned by user and catch revertion if ERC1155 ownerOf fails + address[] memory users = new address[](1); + users[0] = user; + + uint256 length = itemIds.length; + + bool success; + bytes memory data; + + bytes4 selector = bytes4(keccak256(bytes("unitsOf(address,uint256)"))); + for (uint256 i; i < length;) { + (success, data) = collection.staticcall(abi.encodeWithSelector(selector, user, itemIds[i])); + + if (!success) { + return HYPERCERT_UNITS_OF_DOES_NOT_EXIST; + } + + if (abi.decode(data, (uint256)) < amounts[i]) { + return HYPERCERT_UNITS_NOT_HELD_BY_USER; + } + + unchecked { + ++i; + } + } + + // 3. Verify if collection is approved by transfer manager + (success, data) = + collection.staticcall(abi.encodeCall(IERC1155.isApprovedForAll, (user, address(transferManager)))); + + if (!success) { + return ERC1155_IS_APPROVED_FOR_ALL_DOES_NOT_EXIST; + } + + if (!abi.decode(data, (bool))) { + return ERC1155_NO_APPROVAL_FOR_ALL; + } + } + + /** + * @notice This function verifies the validity of a Merkle proof and the order hash. + * @param merkleTree Merkle tree struct + * @param orderHash Order hash + * @param signature Signature + * @param signer Signer address + * @return validationCode Validation code + */ + function _checkValidityMerkleProofAndOrderHash( + OrderStructs.MerkleTree calldata merkleTree, + bytes32 orderHash, + bytes calldata signature, + address signer + ) private view returns (uint256 validationCode) { + if (merkleTree.proof.length != 0) { + if (merkleTree.proof.length > MAX_CALLDATA_PROOF_LENGTH) { + return MERKLE_PROOF_PROOF_TOO_LARGE; + } + + if (!MerkleProofCalldataWithNodes.verifyCalldata(merkleTree.proof, merkleTree.root, orderHash)) { + return ORDER_HASH_PROOF_NOT_IN_MERKLE_TREE; + } + + bytes32 batchOrderHash = looksRareProtocol.hashBatchOrder(merkleTree.root, merkleTree.proof.length); + + return _computeDigestAndVerify(batchOrderHash, signature, signer); + } else { + return _computeDigestAndVerify(orderHash, signature, signer); + } + } + + /** + * @notice Check the validity of creator fee + * @param collection Collection address + * @param itemIds Item ids + * @return validationCode Validation code + */ + function _checkValidityCreatorFee(address collection, uint256 price, uint256[] memory itemIds) + private + view + returns (uint256 validationCode) + { + if (address(creatorFeeManager) != address(0)) { + (bool status, bytes memory data) = address(creatorFeeManager).staticcall( + abi.encodeCall(ICreatorFeeManager.viewCreatorFeeInfo, (collection, price, itemIds)) + ); + + // The only path possible (to revert) in the fee manager is the bundle being not supported. + if (!status) { + return BUNDLE_ERC2981_NOT_SUPPORTED; + } + + (address creator, uint256 creatorFeeAmount) = abi.decode(data, (address, uint256)); + + if (creator != address(0)) { + if (creatorFeeAmount * ONE_HUNDRED_PERCENT_IN_BP > (price * uint256(maxCreatorFeeBp))) { + return CREATOR_FEE_TOO_HIGH; + } + } + } + } + + /** + * @notice This function computes the digest and verify the signature. + * @param computedHash Hash of order or merkle root + * @param makerSignature Signature of the maker + * @param signer Signer address + * @return validationCode Validation code + */ + function _computeDigestAndVerify(bytes32 computedHash, bytes calldata makerSignature, address signer) + private + view + returns (uint256 validationCode) + { + return _validateSignature( + keccak256(abi.encodePacked("\x19\x01", domainSeparator, computedHash)), makerSignature, signer + ); + } + + /** + * @notice This function checks the validity of the signature. + * @param hash Message hash + * @param signature A 64 or 65 bytes signature + * @param signer Signer address + * @return validationCode Validation code + */ + function _validateSignature(bytes32 hash, bytes calldata signature, address signer) + private + view + returns (uint256 validationCode) + { + // Logic if EOA + if (signer.code.length == 0) { + bytes32 r; + bytes32 s; + uint8 v; + + if (signature.length == 64) { + bytes32 vs; + assembly { + r := calldataload(signature.offset) + vs := calldataload(add(signature.offset, 0x20)) + s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) + v := add(shr(255, vs), 27) + } + } else if (signature.length == 65) { + assembly { + r := calldataload(signature.offset) + s := calldataload(add(signature.offset, 0x20)) + v := byte(0, calldataload(add(signature.offset, 0x40))) + } + } else { + return INVALID_SIGNATURE_LENGTH; + } + + if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { + return INVALID_S_PARAMETER_EOA; + } + + if (v != 27 && v != 28) { + return INVALID_V_PARAMETER_EOA; + } + + address recoveredSigner = ecrecover(hash, v, r, s); + + if (recoveredSigner == address(0)) { + return NULL_SIGNER_EOA; + } + + if (signer != recoveredSigner) { + return INVALID_SIGNER_EOA; + } + } else { + // Logic if ERC1271 + (bool success, bytes memory data) = + signer.staticcall(abi.encodeCall(IERC1271.isValidSignature, (hash, signature))); + + if (!success) { + return MISSING_IS_VALID_SIGNATURE_FUNCTION_EIP1271; + } + + if (abi.decode(data, (bytes4)) != IERC1271.isValidSignature.selector) { + return SIGNATURE_INVALID_EIP1271; + } + } + } + + /** + * @dev This function checks if transfer manager approvals are not revoked by user, nor by the owner + * @param user Address of the user + * @return validationCode Validation code + */ + function _checkValidityTransferManagerApprovals(address user) private view returns (uint256 validationCode) { + if (!transferManager.hasUserApprovedOperator(user, address(looksRareProtocol))) { + return NO_TRANSFER_MANAGER_APPROVAL_BY_USER_FOR_EXCHANGE; + } + + if (!transferManager.isOperatorAllowed(address(looksRareProtocol))) { + return TRANSFER_MANAGER_APPROVAL_REVOKED_BY_OWNER_FOR_EXCHANGE; + } + } + + function _checkValidityMakerAskItemIdsAndAmountsAndPrice(OrderStructs.Maker memory makerAsk) + private + view + returns (uint256 validationCode, uint256[] memory itemIds, uint256[] memory amounts, uint256 price) + { + if (makerAsk.strategyId == 0) { + itemIds = makerAsk.itemIds; + amounts = makerAsk.amounts; + price = makerAsk.price; + + validationCode = + _getOrderValidationCodeForStandardStrategy(makerAsk.collectionType, itemIds.length, amounts); + } else { + itemIds = makerAsk.itemIds; + amounts = makerAsk.amounts; + // @dev It should ideally be adjusted by real price + price = makerAsk.price; + + (,,,, bytes4 strategySelector,, address strategyImplementation) = + looksRareProtocol.strategyInfo(makerAsk.strategyId); + + (bool isValid, bytes4 errorSelector) = + IStrategy(strategyImplementation).isMakerOrderValid(makerAsk, strategySelector); + + validationCode = _getOrderValidationCodeForNonStandardStrategies(isValid, errorSelector); + } + } + + function _checkValidityMakerBidItemIdsAndAmountsAndPrice(OrderStructs.Maker memory makerBid) + private + view + returns (uint256 validationCode, uint256[] memory itemIds, uint256[] memory amounts, uint256 price) + { + if (makerBid.strategyId == 0) { + itemIds = makerBid.itemIds; + amounts = makerBid.amounts; + price = makerBid.price; + + validationCode = + _getOrderValidationCodeForStandardStrategy(makerBid.collectionType, itemIds.length, amounts); + } else { + // @dev It should ideally be adjusted by real price + // amounts and itemIds are not used since most non-native maker bids won't target a single item + price = makerBid.price; + + (,,,, bytes4 strategySelector,, address strategyImplementation) = + looksRareProtocol.strategyInfo(makerBid.strategyId); + + (bool isValid, bytes4 errorSelector) = + IStrategy(strategyImplementation).isMakerOrderValid(makerBid, strategySelector); + + validationCode = _getOrderValidationCodeForNonStandardStrategies(isValid, errorSelector); + } + } + + /** + * @notice This function checks if the same itemId is repeated + * in an array of item ids. + * @param itemIds Array of item ids + * @dev This is for bundles. + * For example, if itemIds = [1,2,1], it will return SAME_ITEM_ID_IN_BUNDLE. + * @return validationCode Validation code + */ + function _checkIfItemIdsDiffer(uint256[] memory itemIds) private pure returns (uint256 validationCode) { + uint256 length = itemIds.length; + + // Only check if length of array is greater than 1 + if (length > 1) { + for (uint256 i = 0; i < length - 1;) { + for (uint256 j = i + 1; j < length;) { + if (itemIds[i] == itemIds[j]) { + return SAME_ITEM_ID_IN_BUNDLE; + } + + unchecked { + ++j; + } + } + + unchecked { + ++i; + } + } + } + } + + function _getOrderValidationCodeForStandardStrategy( + CollectionType collectionType, + uint256 expectedLength, + uint256[] memory amounts + ) private pure returns (uint256 validationCode) { + if (expectedLength == 0 || (amounts.length != expectedLength)) { + validationCode = MAKER_ORDER_INVALID_STANDARD_SALE; + } else { + for (uint256 i; i < expectedLength;) { + uint256 amount = amounts[i]; + + if (amount == 0) { + validationCode = MAKER_ORDER_INVALID_STANDARD_SALE; + } + + if (collectionType == CollectionType.ERC721 && amount != 1) { + validationCode = MAKER_ORDER_INVALID_STANDARD_SALE; + } + + unchecked { + ++i; + } + } + } + } + + function _getOrderValidationCodeForNonStandardStrategies(bool isValid, bytes4 errorSelector) + private + pure + returns (uint256 validationCode) + { + if (isValid) { + validationCode = ORDER_EXPECTED_TO_BE_VALID; + } else { + if (errorSelector == OrderInvalid.selector) { + validationCode = MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE; + } else { + validationCode = MAKER_ORDER_TEMPORARILY_INVALID_NON_STANDARD_SALE; + } + } + } +} diff --git a/contracts/src/marketplace/helpers/ProtocolHelpers.sol b/contracts/src/marketplace/helpers/ProtocolHelpers.sol new file mode 100644 index 00000000..99c37c0d --- /dev/null +++ b/contracts/src/marketplace/helpers/ProtocolHelpers.sol @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {SignatureCheckerCalldata} from "@looksrare/contracts-libs/contracts/SignatureCheckerCalldata.sol"; + +// Libraries +import {OrderStructs} from "../libraries/OrderStructs.sol"; + +// Other dependencies +import {LooksRareProtocol} from "../LooksRareProtocol.sol"; + +/** + * @title ProtocolHelpers + * @notice This contract contains helper view functions for order creation. + * @author LooksRare protocol team (👀,💎) + */ +contract ProtocolHelpers { + using OrderStructs for OrderStructs.Maker; + + // Encoding prefix for EIP-712 signatures + string internal constant _ENCODING_PREFIX = "\x19\x01"; + + // LooksRareProtocol + LooksRareProtocol public looksRareProtocol; + + /** + * @notice Constructor + * @param _looksRareProtocol LooksRare protocol address + */ + constructor(address _looksRareProtocol) { + looksRareProtocol = LooksRareProtocol(_looksRareProtocol); + } + + /** + * @notice Compute digest for maker bid struct + * @param maker Maker struct + * @return digest Digest + */ + function computeMakerDigest(OrderStructs.Maker memory maker) public view returns (bytes32 digest) { + bytes32 domainSeparator = looksRareProtocol.domainSeparator(); + return keccak256(abi.encodePacked(_ENCODING_PREFIX, domainSeparator, maker.hash())); + } + + /** + * @notice Compute digest for merkle tree struct + * @param merkleTree Merkle tree struct + * @return digest Digest + */ + function computeDigestMerkleTree(OrderStructs.MerkleTree memory merkleTree) public view returns (bytes32 digest) { + bytes32 domainSeparator = looksRareProtocol.domainSeparator(); + bytes32 batchOrderHash = looksRareProtocol.hashBatchOrder(merkleTree.root, merkleTree.proof.length); + return keccak256(abi.encodePacked(_ENCODING_PREFIX, domainSeparator, batchOrderHash)); + } + + /** + * @notice Verify maker order signature + * @param maker Maker struct + * @param makerSignature Maker signature + * @param signer Signer address + * @dev It returns true only if the SignatureCheckerCalldata does not revert before. + */ + function verifyMakerSignature(OrderStructs.Maker memory maker, bytes calldata makerSignature, address signer) + public + view + returns (bool) + { + bytes32 digest = computeMakerDigest(maker); + SignatureCheckerCalldata.verify(digest, signer, makerSignature); + return true; + } + + /** + * @notice Verify merkle tree signature + * @param merkleTree Merkle tree struct + * @param makerSignature Maker signature + * @param signer Signer address + * @dev It returns true only if the SignatureCheckerCalldata does not revert before. + */ + function verifyMerkleTree(OrderStructs.MerkleTree memory merkleTree, bytes calldata makerSignature, address signer) + public + view + returns (bool) + { + bytes32 digest = computeDigestMerkleTree(merkleTree); + SignatureCheckerCalldata.verify(digest, signer, makerSignature); + return true; + } +} diff --git a/contracts/src/marketplace/interfaces/ICreatorFeeManager.sol b/contracts/src/marketplace/interfaces/ICreatorFeeManager.sol new file mode 100644 index 00000000..6b6728e7 --- /dev/null +++ b/contracts/src/marketplace/interfaces/ICreatorFeeManager.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Interfaces +import {IRoyaltyFeeRegistry} from "./IRoyaltyFeeRegistry.sol"; + +/** + * @title ICreatorFeeManager + * @author LooksRare protocol team (👀,💎) + */ +interface ICreatorFeeManager { + /** + * @notice It is returned if the bundle contains multiple itemIds with different creator fee structure. + */ + error BundleEIP2981NotAllowed(address collection); + + /** + * @notice It returns the royalty fee registry address/interface. + * @return royaltyFeeRegistry Interface of the royalty fee registry + */ + function royaltyFeeRegistry() external view returns (IRoyaltyFeeRegistry royaltyFeeRegistry); + + /** + * @notice This function returns the creator address and calculates the creator fee amount. + * @param collection Collection address + * @param price Transaction price + * @param itemIds Array of item ids + * @return creator Creator address + * @return creatorFeeAmount Creator fee amount + */ + function viewCreatorFeeInfo(address collection, uint256 price, uint256[] memory itemIds) + external + view + returns (address creator, uint256 creatorFeeAmount); +} diff --git a/contracts/src/marketplace/interfaces/ICurrencyManager.sol b/contracts/src/marketplace/interfaces/ICurrencyManager.sol new file mode 100644 index 00000000..72d50d2e --- /dev/null +++ b/contracts/src/marketplace/interfaces/ICurrencyManager.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * @title ICurrencyManager + * @author LooksRare protocol team (👀,💎) + */ +interface ICurrencyManager { + /** + * @notice It is emitted if the currency status in the allowlist is updated. + * @param currency Currency address (address(0) = ETH) + * @param isAllowed Whether the currency is allowed + */ + event CurrencyStatusUpdated(address currency, bool isAllowed); +} diff --git a/contracts/src/marketplace/interfaces/IExecutionManager.sol b/contracts/src/marketplace/interfaces/IExecutionManager.sol new file mode 100644 index 00000000..945637b5 --- /dev/null +++ b/contracts/src/marketplace/interfaces/IExecutionManager.sol @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * @title IExecutionManager + * @author LooksRare protocol team (👀,💎) + */ +interface IExecutionManager { + /** + * @notice It is issued when there is a new creator fee manager. + * @param creatorFeeManager Address of the new creator fee manager + */ + event NewCreatorFeeManager(address creatorFeeManager); + + /** + * @notice It is issued when there is a new maximum creator fee (in basis point). + * @param maxCreatorFeeBp New maximum creator fee (in basis point) + */ + event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp); + + /** + * @notice It is issued when there is a new protocol fee recipient address. + * @param protocolFeeRecipient Address of the new protocol fee recipient + */ + event NewProtocolFeeRecipient(address protocolFeeRecipient); + + /** + * @notice It is returned if the creator fee (in basis point) is too high. + */ + error CreatorFeeBpTooHigh(); + + /** + * @notice It is returned if the new protocol fee recipient is set to address(0). + */ + error NewProtocolFeeRecipientCannotBeNullAddress(); + + /** + * @notice It is returned if there is no selector for maker ask/bid for a given strategyId, + * depending on the quote type. + */ + error NoSelectorForStrategy(); + + /** + * @notice It is returned if the current block timestamp is not between start and end times in the maker order. + */ + error OutsideOfTimeRange(); + + /** + * @notice It is returned if the strategy id has no implementation. + * @dev It is returned if there is no implementation address and the strategyId is strictly greater than 0. + */ + error StrategyNotAvailable(uint256 strategyId); +} diff --git a/contracts/src/marketplace/interfaces/IImmutableCreate2Factory.sol b/contracts/src/marketplace/interfaces/IImmutableCreate2Factory.sol new file mode 100644 index 00000000..eefb6dfe --- /dev/null +++ b/contracts/src/marketplace/interfaces/IImmutableCreate2Factory.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +interface IImmutableCreate2Factory { + function safeCreate2(bytes32 salt, bytes calldata initializationCode) + external + payable + returns (address deploymentAddress); + + function findCreate2Address(bytes32 salt, bytes calldata initializationCode) + external + view + returns (address deploymentAddress); +} diff --git a/contracts/src/marketplace/interfaces/ILooksRareProtocol.sol b/contracts/src/marketplace/interfaces/ILooksRareProtocol.sol new file mode 100644 index 00000000..e2a52119 --- /dev/null +++ b/contracts/src/marketplace/interfaces/ILooksRareProtocol.sol @@ -0,0 +1,166 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries +import {OrderStructs} from "../libraries/OrderStructs.sol"; + +/** + * @title ILooksRareProtocol + * @author LooksRare protocol team (👀,💎) + */ +interface ILooksRareProtocol { + /** + * @notice This struct contains an order nonce's invalidation status + * and the order hash that triggered the status change. + * @param orderHash Maker order hash + * @param orderNonce Order nonce + * @param isNonceInvalidated Whether this transaction invalidated the maker user's order nonce at the protocol level + */ + struct NonceInvalidationParameters { + bytes32 orderHash; + uint256 orderNonce; + bool isNonceInvalidated; + } + + /** + * @notice It is emitted if there is a change in the domain separator. + */ + event NewDomainSeparator(); + + /** + * @notice It is emitted when there is a new gas limit for a ETH transfer (before it is wrapped to WETH). + * @param gasLimitETHTransfer Gas limit for an ETH transfer + */ + event NewGasLimitETHTransfer(uint256 gasLimitETHTransfer); + + /** + * @notice It is emitted when a taker ask transaction is completed. + * @param nonceInvalidationParameters Struct about nonce invalidation parameters + * @param askUser Address of the ask user + * @param bidUser Address of the bid user + * @param strategyId Id of the strategy + * @param currency Address of the currency + * @param collection Address of the collection + * @param itemIds Array of item ids + * @param amounts Array of amounts (for item ids) + * @param feeRecipients Array of fee recipients + * feeRecipients[0] User who receives the proceeds of the sale (it can be the taker ask user or different) + * feeRecipients[1] Creator fee recipient (if none, address(0)) + * @param feeAmounts Array of fee amounts + * feeAmounts[0] Fee amount for the user receiving sale proceeds + * feeAmounts[1] Creator fee amount + * feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment + */ + // maker (receives the NFT) + // taker (initiates the transaction) + event TakerAsk( + NonceInvalidationParameters nonceInvalidationParameters, + address askUser, + address bidUser, + uint256 strategyId, + address currency, + address collection, + uint256[] itemIds, + uint256[] amounts, + address[2] feeRecipients, + uint256[3] feeAmounts + ); + + /** + * @notice It is emitted when a taker bid transaction is completed. + * @param nonceInvalidationParameters Struct about nonce invalidation parameters + * @param bidUser Address of the bid user + * @param bidRecipient Address of the recipient of the bid + * @param strategyId Id of the strategy + * @param currency Address of the currency + * @param collection Address of the collection + * @param itemIds Array of item ids + * @param amounts Array of amounts (for item ids) + * @param feeRecipients Array of fee recipients + * feeRecipients[0] User who receives the proceeds of the sale (it is the maker ask user) + * feeRecipients[1] Creator fee recipient (if none, address(0)) + * @param feeAmounts Array of fee amounts + * feeAmounts[0] Fee amount for the user receiving sale proceeds + * feeAmounts[1] Creator fee amount + * feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment + */ + // taker (receives the NFT) + // taker (initiates the transaction) + event TakerBid( + NonceInvalidationParameters nonceInvalidationParameters, + address bidUser, + address bidRecipient, + uint256 strategyId, + address currency, + address collection, + uint256[] itemIds, + uint256[] amounts, + address[2] feeRecipients, + uint256[3] feeAmounts + ); + + /** + * @notice It is returned if the gas limit for a standard ETH transfer is too low. + */ + error NewGasLimitETHTransferTooLow(); + + /** + * @notice It is returned if the domain separator cannot be updated (i.e. the chainId is the same). + */ + error SameDomainSeparator(); + + /** + * @notice It is returned if the domain separator should change. + */ + error ChainIdInvalid(); + + /** + * @notice It is returned if the nonces are invalid. + */ + error NoncesInvalid(); + + /** + * @notice This function allows a user to execute a taker ask (against a maker bid). + * @param takerAsk Taker ask struct + * @param makerBid Maker bid struct + * @param makerSignature Maker signature + * @param merkleTree Merkle tree struct (if the signature contains multiple maker orders) + */ + function executeTakerAsk( + OrderStructs.Taker calldata takerAsk, + OrderStructs.Maker calldata makerBid, + bytes calldata makerSignature, + OrderStructs.MerkleTree calldata merkleTree + ) external; + + /** + * @notice This function allows a user to execute a taker bid (against a maker ask). + * @param takerBid Taker bid struct + * @param makerAsk Maker ask struct + * @param makerSignature Maker signature + * @param merkleTree Merkle tree struct (if the signature contains multiple maker orders) + */ + function executeTakerBid( + OrderStructs.Taker calldata takerBid, + OrderStructs.Maker calldata makerAsk, + bytes calldata makerSignature, + OrderStructs.MerkleTree calldata merkleTree + ) external payable; + + /** + * @notice This function allows a user to batch buy with an array of taker bids (against an array of maker asks). + * @param takerBids Array of taker bid structs + * @param makerAsks Array of maker ask structs + * @param makerSignatures Array of maker signatures + * @param merkleTrees Array of merkle tree structs if the signature contains multiple maker orders + * @param isAtomic Whether the execution should be atomic + * i.e. whether it should revert if 1 or more transactions fail + */ + function executeMultipleTakerBids( + OrderStructs.Taker[] calldata takerBids, + OrderStructs.Maker[] calldata makerAsks, + bytes[] calldata makerSignatures, + OrderStructs.MerkleTree[] calldata merkleTrees, + bool isAtomic + ) external payable; +} diff --git a/contracts/src/marketplace/interfaces/INonceManager.sol b/contracts/src/marketplace/interfaces/INonceManager.sol new file mode 100644 index 00000000..6011291d --- /dev/null +++ b/contracts/src/marketplace/interfaces/INonceManager.sol @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * @title INonceManager + * @author LooksRare protocol team (👀,💎) + */ +interface INonceManager { + /** + * @notice This struct contains the global bid and ask nonces of a user. + * @param bidNonce Bid nonce + * @param askNonce Ask nonce + */ + struct UserBidAskNonces { + uint256 bidNonce; + uint256 askNonce; + } + + /** + * @notice It is emitted when there is an update of the global bid/ask nonces for a user. + * @param user Address of the user + * @param bidNonce New bid nonce + * @param askNonce New ask nonce + */ + event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce); + + /** + * @notice It is emitted when order nonces are cancelled for a user. + * @param user Address of the user + * @param orderNonces Array of order nonces cancelled + */ + event OrderNoncesCancelled(address user, uint256[] orderNonces); + + /** + * @notice It is emitted when subset nonces are cancelled for a user. + * @param user Address of the user + * @param subsetNonces Array of subset nonces cancelled + */ + event SubsetNoncesCancelled(address user, uint256[] subsetNonces); +} diff --git a/contracts/src/marketplace/interfaces/IRoyaltyFeeRegistry.sol b/contracts/src/marketplace/interfaces/IRoyaltyFeeRegistry.sol new file mode 100644 index 00000000..766d4603 --- /dev/null +++ b/contracts/src/marketplace/interfaces/IRoyaltyFeeRegistry.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * @title IRoyaltyFeeRegistry + * @author LooksRare protocol team (👀,💎) + */ +interface IRoyaltyFeeRegistry { + /** + * @notice This function returns the royalty information for a collection at a given transaction price. + * @param collection Collection address + * @param price Transaction price + * @return receiver Receiver address + * @return royaltyFee Royalty fee amount + */ + function royaltyInfo(address collection, uint256 price) + external + view + returns (address receiver, uint256 royaltyFee); +} diff --git a/contracts/src/marketplace/interfaces/IStrategy.sol b/contracts/src/marketplace/interfaces/IStrategy.sol new file mode 100644 index 00000000..a9b7e450 --- /dev/null +++ b/contracts/src/marketplace/interfaces/IStrategy.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries +import {OrderStructs} from "../libraries/OrderStructs.sol"; + +/** + * @title IStrategy + * @author LooksRare protocol team (👀,💎) + */ +interface IStrategy { + /** + * @notice Validate *only the maker* order under the context of the chosen strategy. It does not revert if + * the maker order is invalid. Instead it returns false and the error's 4 bytes selector. + * @param makerOrder Maker struct (maker specific parameters for the execution) + * @param functionSelector Function selector for the strategy + * @return isValid Whether the maker struct is valid + * @return errorSelector If isValid is false, it returns the error's 4 bytes selector + */ + function isMakerOrderValid(OrderStructs.Maker calldata makerOrder, bytes4 functionSelector) + external + view + returns (bool isValid, bytes4 errorSelector); + + /** + * @notice This function acts as a safety check for the protocol's owner when adding new execution strategies. + * @return isStrategy Whether it is a LooksRare V2 protocol strategy + */ + function isLooksRareV2Strategy() external pure returns (bool isStrategy); +} diff --git a/contracts/src/marketplace/interfaces/IStrategyManager.sol b/contracts/src/marketplace/interfaces/IStrategyManager.sol new file mode 100644 index 00000000..283431a2 --- /dev/null +++ b/contracts/src/marketplace/interfaces/IStrategyManager.sol @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * @title IStrategyManager + * @author LooksRare protocol team (👀,💎) + */ +interface IStrategyManager { + /** + * @notice This struct contains the parameter of an execution strategy. + * @param strategyId Id of the new strategy + * @param standardProtocolFeeBp Standard protocol fee (in basis point) + * @param minTotalFeeBp Minimum total fee (in basis point) + * @param maxProtocolFeeBp Maximum protocol fee (in basis point) + * @param selector Function selector for the transaction to be executed + * @param isMakerBid Whether the strategyId is for maker bid + * @param implementation Address of the implementation of the strategy + */ + struct Strategy { + bool isActive; + uint16 standardProtocolFeeBp; + uint16 minTotalFeeBp; + uint16 maxProtocolFeeBp; + bytes4 selector; + bool isMakerBid; + address implementation; + } + + /** + * @notice It is emitted when a new strategy is added. + * @param strategyId Id of the new strategy + * @param standardProtocolFeeBp Standard protocol fee (in basis point) + * @param minTotalFeeBp Minimum total fee (in basis point) + * @param maxProtocolFeeBp Maximum protocol fee (in basis point) + * @param selector Function selector for the transaction to be executed + * @param isMakerBid Whether the strategyId is for maker bid + * @param implementation Address of the implementation of the strategy + */ + event NewStrategy( + uint256 strategyId, + uint16 standardProtocolFeeBp, + uint16 minTotalFeeBp, + uint16 maxProtocolFeeBp, + bytes4 selector, + bool isMakerBid, + address implementation + ); + + /** + * @notice It is emitted when an existing strategy is updated. + * @param strategyId Id of the strategy + * @param isActive Whether the strategy is active (or not) after the update + * @param standardProtocolFeeBp Standard protocol fee (in basis point) + * @param minTotalFeeBp Minimum total fee (in basis point) + */ + event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp); + + /** + * @notice If the strategy has not set properly its implementation contract. + * @dev It can only be returned for owner operations. + */ + error NotV2Strategy(); + + /** + * @notice It is returned if the strategy has no selector. + * @dev It can only be returned for owner operations. + */ + error StrategyHasNoSelector(); + + /** + * @notice It is returned if the strategyId is invalid. + */ + error StrategyNotUsed(); + + /** + * @notice It is returned if the strategy's protocol fee is too high. + * @dev It can only be returned for owner operations. + */ + error StrategyProtocolFeeTooHigh(); +} diff --git a/contracts/src/marketplace/interfaces/ITransferManager.sol b/contracts/src/marketplace/interfaces/ITransferManager.sol new file mode 100644 index 00000000..ec05a0ba --- /dev/null +++ b/contracts/src/marketplace/interfaces/ITransferManager.sol @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries +import {OrderStructs} from "../libraries/OrderStructs.sol"; + +// Enums +import {CollectionType} from "../enums/CollectionType.sol"; + +/** + * @title ITransferManager + * @author LooksRare protocol team (👀,💎) + */ +interface ITransferManager { + /** + * @notice This struct is only used for transferBatchItemsAcrossCollections. + * @param collection Collection address + * @param collectionType 0 for ERC721, 1 for ERC1155, 2 for Hypercert + * @param itemIds Array of item ids to transfer + * @param amounts Array of amounts to transfer + */ + struct BatchTransferItem { + address collection; + CollectionType collectionType; + uint256[] itemIds; + uint256[] amounts; + } + + /** + * @notice It is emitted if operators' approvals to transfer NFTs are granted by a user. + * @param user Address of the user + * @param operators Array of operator addresses + */ + event ApprovalsGranted(address user, address[] operators); + + /** + * @notice It is emitted if operators' approvals to transfer NFTs are revoked by a user. + * @param user Address of the user + * @param operators Array of operator addresses + */ + event ApprovalsRemoved(address user, address[] operators); + + /** + * @notice It is emitted if a new operator is added to the global allowlist. + * @param operator Operator address + */ + event OperatorAllowed(address operator); + + /** + * @notice It is emitted if an operator is removed from the global allowlist. + * @param operator Operator address + */ + event OperatorRemoved(address operator); + + /** + * @notice It is returned if the operator to approve has already been approved by the user. + */ + error OperatorAlreadyApprovedByUser(); + + /** + * @notice It is returned if the operator to revoke has not been previously approved by the user. + */ + error OperatorNotApprovedByUser(); + + /** + * @notice It is returned if the transfer caller is already allowed by the owner. + * @dev This error can only be returned for owner operations. + */ + error OperatorAlreadyAllowed(); + + /** + * @notice It is returned if the operator to approve is not in the global allowlist defined by the owner. + * @dev This error can be returned if the user tries to grant approval to an operator address not in the + * allowlist or if the owner tries to remove the operator from the global allowlist. + */ + error OperatorNotAllowed(); + + /** + * @notice It is returned if the transfer caller is invalid. + * For a transfer called to be valid, the operator must be in the global allowlist and + * approved by the 'from' user. + */ + error TransferCallerInvalid(); +} diff --git a/contracts/src/marketplace/libraries/CurrencyValidator.sol b/contracts/src/marketplace/libraries/CurrencyValidator.sol new file mode 100644 index 00000000..61208646 --- /dev/null +++ b/contracts/src/marketplace/libraries/CurrencyValidator.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Assembly +import { + CurrencyInvalid_error_selector, + CurrencyInvalid_error_length, + Error_selector_offset +} from "../constants/AssemblyConstants.sol"; + +/** + * @title CurrencyValidator + * @notice This library validates the order currency to be the + * chain's native currency or the specified ERC20 token. + * @author LooksRare protocol team (👀,💎) + */ +library CurrencyValidator { + /** + * @dev This is equivalent to + * if (orderCurrency != address(0)) { + * if (orderCurrency != allowedCurrency) { + * revert CurrencyInvalid(); + * } + * } + * + * 1. If orderCurrency == WETH, allowedCurrency == WETH -> WETH * 0 == 0 + * 2. If orderCurrency == ETH, allowedCurrency == WETH -> 0 * 1 == 0 + * 3. If orderCurrency == USDC, allowedCurrency == WETH -> USDC * 1 != 0 + */ + function allowNativeOrAllowedCurrency(address orderCurrency, address allowedCurrency) internal pure { + assembly { + if mul(orderCurrency, iszero(eq(orderCurrency, allowedCurrency))) { + mstore(0x00, CurrencyInvalid_error_selector) + revert(Error_selector_offset, CurrencyInvalid_error_length) + } + } + } +} diff --git a/contracts/src/marketplace/libraries/LowLevelHypercertCaller.sol b/contracts/src/marketplace/libraries/LowLevelHypercertCaller.sol new file mode 100644 index 00000000..5c330c38 --- /dev/null +++ b/contracts/src/marketplace/libraries/LowLevelHypercertCaller.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Interfaces +import {IHypercertToken} from "../../protocol/interfaces/IHypercertToken.sol"; + +/** + * @title LowLevelHypercertCaller + * @notice This contract contains low-level calls to transfer ERC1155 tokens. + * @author bitbeckers + */ +contract LowLevelHypercertCaller { + error NotAContract(); + error HypercertSplitFractionError(); + + /** + * @notice Execute Hypercert splitFraction + * @param collection Address of the collection + * @param to Address of the recipient + * @param tokenId tokenId to transfer + * @param amounts split distribution + */ + + function _executeHypercertSplitFraction(address collection, address to, uint256 tokenId, uint256[] memory amounts) + internal + { + if (collection.code.length == 0) { + revert NotAContract(); + } + + (bool status,) = collection.call(abi.encodeCall(IHypercertToken.splitFraction, (to, tokenId, amounts))); + + if (!status) { + revert HypercertSplitFractionError(); + } + } +} diff --git a/contracts/src/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.sol b/contracts/src/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.sol new file mode 100644 index 00000000..f3af4e8b --- /dev/null +++ b/contracts/src/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries +import {OrderStructs} from "../../libraries/OrderStructs.sol"; + +/** + * @title MerkleProofCalldataWithNodes + * @notice This library is adjusted from the work of OpenZeppelin. + * It is based on the 4.7.0 (utils/cryptography/MerkleProof.sol). + * @author OpenZeppelin (adjusted by LooksRare) + */ +library MerkleProofCalldataWithNodes { + /** + * @notice This returns true if a `leaf` can be proved to be a part of a Merkle tree defined by `root`. + * For this, a `proof` must be provided, containing sibling hashes on the branch from the leaf to the + * root of the tree. Each pair of leaves and each pair of pre-images are assumed to be sorted. + */ + function verifyCalldata(OrderStructs.MerkleTreeNode[] calldata proof, bytes32 root, bytes32 leaf) + internal + pure + returns (bool) + { + return processProofCalldata(proof, leaf) == root; + } + + /** + * @notice This returns the rebuilt hash obtained by traversing a Merkle tree up from `leaf` using `proof`. + * A `proof` is valid if and only if the rebuilt hash matches the root of the tree. + * When processing the proof, the pairs of leafs & pre-images are assumed to be sorted. + */ + function processProofCalldata(OrderStructs.MerkleTreeNode[] calldata proof, bytes32 leaf) + internal + pure + returns (bytes32) + { + bytes32 computedHash = leaf; + uint256 length = proof.length; + + for (uint256 i = 0; i < length;) { + if (proof[i].position == OrderStructs.MerkleTreeNodePosition.Left) { + computedHash = _efficientHash(proof[i].value, computedHash); + } else { + computedHash = _efficientHash(computedHash, proof[i].value); + } + unchecked { + ++i; + } + } + return computedHash; + } + + function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { + /// @solidity memory-safe-assembly + assembly { + mstore(0x00, a) + mstore(0x20, b) + value := keccak256(0x00, 0x40) + } + } +} diff --git a/contracts/src/marketplace/libraries/OpenZeppelin/MerkleProofMemory.sol b/contracts/src/marketplace/libraries/OpenZeppelin/MerkleProofMemory.sol new file mode 100644 index 00000000..442e138f --- /dev/null +++ b/contracts/src/marketplace/libraries/OpenZeppelin/MerkleProofMemory.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * @title MerkleProofMemory + * @notice This library is adjusted from the work of OpenZeppelin. + * It is based on the 4.7.0 (utils/cryptography/MerkleProof.sol). + * @author OpenZeppelin (adjusted by LooksRare) + */ +library MerkleProofMemory { + /** + * @notice This returns true if a `leaf` can be proved to be a part of a Merkle tree defined by `root`. + * For this, a `proof` must be provided, containing sibling hashes on the branch from the leaf to the + * root of the tree. Each pair of leaves and each pair of pre-images are assumed to be sorted. + */ + function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { + return processProof(proof, leaf) == root; + } + + /** + * @notice This returns the rebuilt hash obtained by traversing a Merkle tree up from `leaf` using `proof`. + * A `proof` is valid if and only if the rebuilt hash matches the root of the tree. + * When processing the proof, the pairs of leafs & pre-images are assumed to be sorted. + */ + function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { + bytes32 computedHash = leaf; + uint256 length = proof.length; + + for (uint256 i = 0; i < length;) { + computedHash = _hashPair(computedHash, proof[i]); + unchecked { + ++i; + } + } + return computedHash; + } + + function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { + return a < b ? _efficientHash(a, b) : _efficientHash(b, a); + } + + function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { + /// @solidity memory-safe-assembly + assembly { + mstore(0x00, a) + mstore(0x20, b) + value := keccak256(0x00, 0x40) + } + } +} diff --git a/contracts/src/marketplace/libraries/OrderStructs.sol b/contracts/src/marketplace/libraries/OrderStructs.sol new file mode 100644 index 00000000..38c632b2 --- /dev/null +++ b/contracts/src/marketplace/libraries/OrderStructs.sol @@ -0,0 +1,152 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Enums +import {CollectionType} from "../enums/CollectionType.sol"; +import {QuoteType} from "../enums/QuoteType.sol"; + +/** + * @title OrderStructs + * @notice This library contains all order struct types for the LooksRare protocol (v2). + * @author LooksRare protocol team (👀,💎); bitbeckers + */ +library OrderStructs { + /** + * 1. Maker struct + */ + + /** + * @notice Maker is the struct for a maker order. + * @param quoteType Quote type (i.e. 0 = BID, 1 = ASK) + * @param globalNonce Global user order nonce for maker orders + * @param subsetNonce Subset nonce (shared across bid/ask maker orders) + * @param orderNonce Order nonce (it can be shared across bid/ask maker orders) + * @param strategyId Strategy id + * @param collectionType Collection type (i.e. 0 = ERC721, 1 = ERC1155, 2 = Hypercert) + * @param collection Collection address + * @param currency Currency address (@dev address(0) = ETH) + * @param signer Signer address + * @param startTime Start timestamp + * @param endTime End timestamp + * @param price Minimum price for maker ask, maximum price for maker bid + * @param itemIds Array of itemIds + * @param amounts Array of amounts + * @param additionalParameters Extra data specific for the order + */ + struct Maker { + QuoteType quoteType; + uint256 globalNonce; + uint256 subsetNonce; + uint256 orderNonce; + uint256 strategyId; + CollectionType collectionType; + address collection; + address currency; + address signer; + uint256 startTime; + uint256 endTime; + uint256 price; + uint256[] itemIds; + uint256[] amounts; + bytes additionalParameters; + } + + /** + * 2. Taker struct + */ + + /** + * @notice Taker is the struct for a taker ask/bid order. It contains the parameters required for a direct purchase. + * @dev Taker struct is matched against MakerAsk/MakerBid structs at the protocol level. + * @param recipient Recipient address (to receive NFTs or non-fungible tokens) + * @param additionalParameters Extra data specific for the order + */ + struct Taker { + address recipient; + bytes additionalParameters; + } + + /** + * 3. Merkle tree struct + */ + + enum MerkleTreeNodePosition { + Left, + Right + } + + /** + * @notice MerkleTreeNode is a MerkleTree's node. + * @param value It can be an order hash or a proof + * @param position The node's position in its branch. + * It can be left or right or none + * (before the tree is sorted). + */ + struct MerkleTreeNode { + bytes32 value; + MerkleTreeNodePosition position; + } + + /** + * @notice MerkleTree is the struct for a merkle tree of order hashes. + * @dev A Merkle tree can be computed with order hashes. + * It can contain order hashes from both maker bid and maker ask structs. + * @param root Merkle root + * @param proof Array containing the merkle proof + */ + struct MerkleTree { + bytes32 root; + MerkleTreeNode[] proof; + } + + /** + * 4. Constants + */ + + /** + * @notice This is the type hash constant used to compute the maker order hash. + */ + bytes32 internal constant _MAKER_TYPEHASH = keccak256( + "Maker(" "uint8 quoteType," "uint256 globalNonce," "uint256 subsetNonce," "uint256 orderNonce," + "uint256 strategyId," "uint8 collectionType," "address collection," "address currency," "address signer," + "uint256 startTime," "uint256 endTime," "uint256 price," "uint256[] itemIds," "uint256[] amounts," + "bytes additionalParameters" ")" + ); + + /** + * 5. Hash functions + */ + + /** + * @notice This function is used to compute the order hash for a maker struct. + * @param maker Maker order struct + * @return makerHash Hash of the maker struct + */ + function hash(Maker memory maker) internal pure returns (bytes32) { + // Encoding is done into two parts to avoid stack too deep issues + return keccak256( + bytes.concat( + abi.encode( + _MAKER_TYPEHASH, + maker.quoteType, + maker.globalNonce, + maker.subsetNonce, + maker.orderNonce, + maker.strategyId, + maker.collectionType, + maker.collection, + maker.currency + ), + abi.encode( + maker.signer, + maker.startTime, + maker.endTime, + maker.price, + keccak256(abi.encodePacked(maker.itemIds)), + keccak256(abi.encodePacked(maker.amounts)), + keccak256(maker.additionalParameters) + ) + ) + ); + } +} diff --git a/contracts/src/AllowlistMinter.sol b/contracts/src/protocol/AllowlistMinter.sol similarity index 83% rename from contracts/src/AllowlistMinter.sol rename to contracts/src/protocol/AllowlistMinter.sol index 576b45ee..78f1a592 100644 --- a/contracts/src/AllowlistMinter.sol +++ b/contracts/src/protocol/AllowlistMinter.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.17; -import { MerkleProofUpgradeable } from "oz-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; -import { IAllowlist } from "./interfaces/IAllowlist.sol"; +import {MerkleProofUpgradeable} from "oz-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; +import {IAllowlist} from "./interfaces/IAllowlist.sol"; -import { Errors } from "./libs/Errors.sol"; +import {Errors} from "./libs/Errors.sol"; /// @title Interface for hypercert token interactions /// @author bitbeckers @@ -19,11 +19,11 @@ contract AllowlistMinter is IAllowlist { mapping(uint256 => uint256) internal maxUnits; mapping(uint256 => uint256) internal minted; - function isAllowedToClaim( - bytes32[] calldata proof, - uint256 claimID, - bytes32 leaf - ) external view returns (bool isAllowed) { + function isAllowedToClaim(bytes32[] calldata proof, uint256 claimID, bytes32 leaf) + external + view + returns (bool isAllowed) + { if (merkleRoots[claimID].length == 0) revert Errors.DoesNotExist(); isAllowed = MerkleProofUpgradeable.verifyCalldata(proof, merkleRoots[claimID], leaf); } @@ -44,8 +44,8 @@ contract AllowlistMinter is IAllowlist { if (hasBeenClaimed[claimID][leaf]) revert Errors.AlreadyClaimed(); if ( - !MerkleProofUpgradeable.verifyCalldata(proof, merkleRoots[claimID], leaf) || - (minted[claimID] + amount) > maxUnits[claimID] + !MerkleProofUpgradeable.verifyCalldata(proof, merkleRoots[claimID], leaf) + || (minted[claimID] + amount) > maxUnits[claimID] ) revert Errors.Invalid(); hasBeenClaimed[claimID][leaf] = true; diff --git a/contracts/src/HypercertMinter.sol b/contracts/src/protocol/HypercertMinter.sol similarity index 78% rename from contracts/src/HypercertMinter.sol rename to contracts/src/protocol/HypercertMinter.sol index 917c02c5..e6df9756 100644 --- a/contracts/src/HypercertMinter.sol +++ b/contracts/src/protocol/HypercertMinter.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.17; -import { IHypercertToken } from "./interfaces/IHypercertToken.sol"; -import { SemiFungible1155 } from "./SemiFungible1155.sol"; -import { AllowlistMinter } from "./AllowlistMinter.sol"; -import { PausableUpgradeable } from "oz-upgradeable/security/PausableUpgradeable.sol"; +import {IHypercertToken} from "./interfaces/IHypercertToken.sol"; +import {SemiFungible1155} from "./SemiFungible1155.sol"; +import {AllowlistMinter} from "./AllowlistMinter.sol"; +import {PausableUpgradeable} from "oz-upgradeable/security/PausableUpgradeable.sol"; -import { Errors } from "./libs/Errors.sol"; +import {Errors} from "./libs/Errors.sol"; /// @title Contract for managing hypercert claims and whitelists /// @author bitbeckers @@ -37,12 +37,11 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, /// @notice Mint a semi-fungible token for the impact claim referenced via `uri` /// @dev see {IHypercertToken} - function mintClaim( - address account, - uint256 units, - string memory _uri, - TransferRestrictions restrictions - ) external override whenNotPaused { + function mintClaim(address account, uint256 units, string memory _uri, TransferRestrictions restrictions) + external + override + whenNotPaused + { // This enables us to release this restriction in the future if (msg.sender != account) revert Errors.NotAllowed(); uint256 claimID = _mintNewTypeWithToken(account, units, _uri); @@ -72,12 +71,10 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, /// @notice Mint a semi-fungible token representing a fraction of the claim /// @dev Calls AllowlistMinter to verify `proof`. /// @dev Mints the `amount` of units for the hypercert stored under `claimID` - function mintClaimFromAllowlist( - address account, - bytes32[] calldata proof, - uint256 claimID, - uint256 units - ) external whenNotPaused { + function mintClaimFromAllowlist(address account, bytes32[] calldata proof, uint256 claimID, uint256 units) + external + whenNotPaused + { _processClaim(proof, claimID, units); _mintToken(account, claimID, units); } @@ -92,7 +89,7 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, uint256[] calldata units ) external whenNotPaused { uint256 len = claimIDs.length; - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { _processClaim(proofs[i], claimIDs[i], units[i]); unchecked { ++i; @@ -119,11 +116,10 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, /// @notice Split a claimtokens value into parts with summed value equal to the original /// @dev see {IHypercertToken} - function splitFraction( - address _account, - uint256 _tokenID, - uint256[] calldata _newFractions - ) external whenNotPaused { + function splitFraction(address _account, uint256 _tokenID, uint256[] calldata _newFractions) + external + whenNotPaused + { _splitTokenUnits(_account, _tokenID, _newFractions); } @@ -139,6 +135,28 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, _burnToken(_account, _tokenID); } + /// @notice Burn a claimtoken + /// @dev see {IHypercertToken} + function batchBurnFraction(address _account, uint256[] memory _tokenIDs) external whenNotPaused { + _batchBurnToken(_account, _tokenIDs); + } + + /// @notice Burn a claimtoken; override is needed to update units/values + /// @dev see {ERC1155Burnable} + function burn(address account, uint256 id, uint256 /*value*/ ) public override whenNotPaused { + _burnToken(account, id); + } + + /// @notice Batch burn claimtokens; override is needed to update units/values + /// @dev see {ERC1155Burnable} + function burnBatch(address account, uint256[] memory ids, uint256[] memory /*values*/ ) + public + override + whenNotPaused + { + _batchBurnToken(account, ids); + } + /// @dev see {IHypercertToken} function unitsOf(uint256 tokenID) external view override returns (uint256 units) { units = _unitsOf(tokenID); @@ -162,7 +180,12 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, /// METADATA /// @dev see { IHypercertMetadata} - function uri(uint256 tokenID) public view override(IHypercertToken, SemiFungible1155) returns (string memory _uri) { + function uri(uint256 tokenID) + public + view + override(IHypercertToken, SemiFungible1155) + returns (string memory _uri) + { _uri = SemiFungible1155.uri(tokenID); } @@ -204,7 +227,7 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, // Transfer case, where to and from are non-zero uint256 len = ids.length; - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { uint256 typeID = getBaseType(ids[i]); TransferRestrictions policy = typeRestrictions[typeID]; if (policy == TransferRestrictions.DisallowAll) { @@ -218,6 +241,13 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter, } } + /** + * @dev See {IERC165-supportsInterface}. + */ + function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { + return interfaceId == type(IHypercertToken).interfaceId || super.supportsInterface(interfaceId); + } + /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. diff --git a/contracts/src/protocol/SemiFungible1155.sol b/contracts/src/protocol/SemiFungible1155.sol new file mode 100644 index 00000000..ff6c94f2 --- /dev/null +++ b/contracts/src/protocol/SemiFungible1155.sol @@ -0,0 +1,641 @@ +// SPDX-License-Identifier: MIT +// Used components of Enjin example implementation for mixed fungibility +// https://github.com/enjin/erc-1155/blob/master/contracts/ERC1155MixedFungibleMintable.sol +pragma solidity 0.8.17; + +import {ERC1155Upgradeable} from "oz-upgradeable/token/ERC1155/ERC1155Upgradeable.sol"; +import {ERC1155BurnableUpgradeable} from "oz-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol"; +import {ERC1155URIStorageUpgradeable} from "oz-upgradeable/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol"; +import {OwnableUpgradeable} from "oz-upgradeable/access/OwnableUpgradeable.sol"; +import {Initializable} from "oz-upgradeable/proxy/utils/Initializable.sol"; +import {UUPSUpgradeable} from "oz-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import {Errors} from "./libs/Errors.sol"; + +/// @title Contract for minting semi-fungible EIP1155 tokens +/// @author bitbeckers +/// @notice Extends { Upgradeable1155 } token with semi-fungible properties and the concept of `units` +/// @dev Adds split bit strategy as described in [EIP-1155](https://eips.ethereum.org/EIPS/eip-1155#non-fungible-tokens) +contract SemiFungible1155 is + Initializable, + ERC1155Upgradeable, + ERC1155BurnableUpgradeable, + ERC1155URIStorageUpgradeable, + OwnableUpgradeable, + UUPSUpgradeable +{ + /// @dev Counter used to generate next typeID. + uint256 internal typeCounter; + + /// @dev Bitmask used to expose only upper 128 bits of uint256 + uint256 internal constant TYPE_MASK = type(uint256).max << 128; + + /// @dev Bitmask used to expose only lower 128 bits of uint256 + uint256 internal constant NF_INDEX_MASK = type(uint256).max >> 128; + + uint256 internal constant FRACTION_LIMIT = 253; + + /// @dev Mapping of `tokenID` to address of `owner` + mapping(uint256 => address) internal owners; + + /// @dev Mapping of `tokenID` to address of `creator` + mapping(uint256 => address) internal creators; + + /// @dev Used to determine amount of `units` stored in token at `tokenID` + mapping(uint256 => uint256) internal tokenValues; + + /// @dev Used to find highest index of token belonging to token at `typeID` + mapping(uint256 => uint256) internal maxIndex; + + /// @dev Emitted on transfer of `value` between `fromTokenID` to `toTokenID` of the same `claimID` + event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value); + + /// @dev Emitted on transfer of `values` between `fromTokenIDs` to `toTokenIDs` of `claimIDs` + event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values); + + /// @dev see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol } + // solhint-disable-next-line func-name-mixedcase + function __SemiFungible1155_init() public virtual onlyInitializing { + __ERC1155_init(""); + __ERC1155Burnable_init(); + __ERC1155URIStorage_init(); + __Ownable_init(); + __UUPSUpgradeable_init(); + } + + /** + * @dev Returns the index of the fractional token at `_id` by returning lower 128 bit values. + * @param tokenID The ID of the token to query. + * @return The index of the fractional token. + * @dev This function returns 0 if `_id` is a baseType. + */ + function getItemIndex(uint256 tokenID) internal pure returns (uint256) { + return tokenID & NF_INDEX_MASK; + } + + /** + * @dev Get base type ID for token at `_id` by returning upper 128 bit values. + * @param tokenID The ID of the token to query. + * @return The base type ID of the token. + */ + function getBaseType(uint256 tokenID) internal pure returns (uint256) { + return tokenID & TYPE_MASK; + } + + /** + * @dev Identify that token at `_id` is base type. + * @param tokenID The ID of the token to query. + * @return A boolean indicating whether the token is a base type. + * @dev Upper 128 bits identify base type ID, lower bits should be 0. + */ + function isBaseType(uint256 tokenID) internal pure returns (bool) { + return (tokenID & TYPE_MASK == tokenID) && (tokenID & NF_INDEX_MASK == 0); + } + + /** + * @dev Returns a boolean indicating whether the token at `_id` belongs to a base type. + * @param tokenID The ID of the token to query. + * @return A boolean indicating whether the token is a typed item. + * @dev Upper 128 bits identify the type ID, lower bits identify the index of the typed item. + */ + function isTypedItem(uint256 tokenID) internal pure returns (bool) { + return (tokenID & TYPE_MASK != 0) && (tokenID & NF_INDEX_MASK != 0); + } + + /// READ + /** + * @dev Returns the owner of a given token ID. + * @param tokenID The ID of the token to query. + * @return _owner The address of the owner of the token. + */ + function ownerOf(uint256 tokenID) public view returns (address _owner) { + _owner = owners[tokenID]; + } + + /** + * @dev Returns the number of units of a given token ID. + * @param tokenID The ID of the token to query. + * @return units The number of units of the token. + * @dev This function is used internally to get the number of units of a token. + */ + function _unitsOf(uint256 tokenID) internal view returns (uint256 units) { + units = tokenValues[tokenID]; + } + + /** + * @dev Returns the number of units of a given token ID owned by a given account. + * @param account The address of the account to query. + * @param tokenID The ID of the token to query. + * @return units The number of units of the token owned by the account. + * @dev This function is used internally to get the number of units of a token owned by an account. + */ + function _unitsOf(address account, uint256 tokenID) internal view returns (uint256 units) { + // Check if fraction token and accounts owns it + if (ownerOf(tokenID) == account) { + units = tokenValues[tokenID]; + } + } + + /// MUTATE + + /** + * @dev Creates a new token type ID based on the token counter. + * @param _account The address of the account that will own the new token type. + * @param units The number of units associated with the new token type. + * @param _uri The URI for the metadata associated with the new token type. + * @return typeID The new token type ID. + */ + function _createTokenType(address _account, uint256 units, string memory _uri) internal returns (uint256 typeID) { + _notMaxType(typeCounter); + typeID = ++typeCounter << 128; + + creators[typeID] = _account; + tokenValues[typeID] = units; + + _setURI(typeID, _uri); + + //Event emitted for indexing purposes + emit TransferSingle(_account, address(0), address(0), typeID, 0); + } + + /** + * @dev Mints a new token with a new token type ID and assigns it to the specified account. + * @param _account The address of the account that will receive the new token. + * @param _units The number of units associated with the new token. + * @param _uri The URI for the metadata associated with the new token. + * @return typeID The new token type ID. + * @dev This function creates a new token type ID by calling the `_createTokenType` function and then mints a new + * token with the new type ID. + * @dev The `tokenID` is calculated by adding the `typeID` to the current maximum index for the `typeID`. + * @dev The `tokenValues` mapping is updated with the number of units associated with the new token. + * @dev A `ValueTransfer` event is emitted to indicate that a new token has been minted and assigned to the + * specified account. + * @dev If `_units` is zero, the function will revert with an error. + */ + function _mintNewTypeWithToken(address _account, uint256 _units, string memory _uri) + internal + returns (uint256 typeID) + { + if (_units == 0) { + revert Errors.NotAllowed(); + } + typeID = _createTokenType(_account, _units, _uri); + + uint256 tokenID = typeID + ++maxIndex[typeID]; //1 based indexing, 0 holds type data + + tokenValues[tokenID] = _units; + + _mint(_account, tokenID, 1, ""); + emit ValueTransfer(typeID, 0, tokenID, _units); + } + + /** + * @dev Mints a new token with a new token type ID and assigns it to the specified account. + * @param _account The address of the account that will receive the new token. + * @param _fractions An array of values associated with the new token. + * @param _uri The URI for the metadata associated with the new token. + * @return typeID The new token type ID. + * @dev This function creates a new token type ID by calling the `_createTokenType` function and then mints a new + * token with the new type ID. + * @dev The `tokenID` is calculated by adding the `typeID` to the current maximum index for the `typeID`. + * @dev The `tokenValues` mapping is updated with the number of units associated with the new token. + * @dev A `ValueTransfer` event is emitted to indicate that a new token has been minted and assigned to the + * specified account. + * @dev If any of the fractional values in `_fractions` are zero, the function will revert with an error. + * @dev This function also calls the `_splitTokenUnits` function to split the new token into multiple sub-tokens + * with the specified fractional values. + */ + function _mintNewTypeWithTokens(address _account, uint256[] calldata _fractions, string memory _uri) + internal + returns (uint256 typeID) + { + typeID = _mintNewTypeWithToken(_account, _getSum(_fractions), _uri); + _splitTokenUnits(_account, typeID + maxIndex[typeID], _fractions); + } + + /** + * @dev Mints a new token with the specified token type ID and assigns it to the specified account. + * @param _account The address of the account that will receive the new token. + * @param _typeID The ID of the token type to mint. + * @param _units The number of units associated with the new token. + * @return tokenID The ID of the newly minted token. + * @dev This function checks that the specified token type ID is a base type and that the maximum number of tokens + * for the token type has not been reached. + * @dev The function then calculates the new token ID by adding the specified token type ID to the current maximum + * index for the token type. + * @dev The `tokenValues` mapping is updated with the number of units associated with the new token. + * @dev A `ValueTransfer` event is emitted to indicate that a new token has been minted and assigned to the + * specified account. + */ + function _mintToken(address _account, uint256 _typeID, uint256 _units) internal returns (uint256 tokenID) { + if (!isBaseType(_typeID)) revert Errors.NotAllowed(); + + _notMaxItem(maxIndex[_typeID]); + + unchecked { + tokenID = _typeID + ++maxIndex[_typeID]; //1 based indexing, 0 holds type data + } + + tokenValues[tokenID] = _units; + + _mint(_account, tokenID, 1, ""); + emit ValueTransfer(_typeID, 0, tokenID, _units); + } + + /** + * @dev Mints multiple tokens with the specified token type IDs and assigns them to the specified account. + * @param _account The address of the account that will receive the new tokens. + * @param _typeIDs An array of token type IDs to mint. + * @param _units An array of numbers of units associated with the new tokens. + * @return tokenIDs An array of the IDs of the newly minted tokens. + * @dev This function checks that each specified token type ID is a base type and that the maximum number of tokens + * for each token type has not been reached. + * @dev The function then calculates the new token IDs by adding the specified token type IDs to the current maximum + * index for each token type. + * @dev The `tokenValues` mapping is updated with the number of units associated with each new token. + * @dev A `BatchValueTransfer` event is emitted to indicate that new tokens have been minted and assigned to the + * specified account. + */ + function _batchMintTokens(address _account, uint256[] calldata _typeIDs, uint256[] calldata _units) + internal + returns (uint256[] memory tokenIDs) + { + uint256 len = _typeIDs.length; + + tokenIDs = new uint256[](len); + uint256[] memory amounts = new uint256[](len); + uint256[] memory zeroes = new uint256[](len); + + for (uint256 i; i < len;) { + uint256 _typeID = _typeIDs[i]; + if (!isBaseType(_typeID)) revert Errors.NotAllowed(); + _notMaxItem(maxIndex[_typeID]); + + unchecked { + uint256 tokenID = _typeID + ++maxIndex[_typeID]; //1 based indexing, 0 holds type data + tokenValues[tokenID] = _units[i]; + tokenIDs[i] = tokenID; + amounts[i] = 1; + ++i; + } + } + + _mintBatch(_account, tokenIDs, amounts, ""); + emit BatchValueTransfer(_typeIDs, zeroes, tokenIDs, _units); + } + + /** + * @dev Splits a token into multiple tokens with different unit values. + * @param _account The address of the account that will receive the new tokens. + * @param _tokenID The ID of the token to split. + * @param _values An array of numbers of units associated with the new tokens. + * @dev This function splits a token into multiple tokens with different unit values. + * @dev The `_values` array specifies the number of units associated with each new token. + * @dev The function checks that the length of the `_values` array is between 2 and `FRACTION_LIMIT`, and that the + * sum of the values in the `_values` array is equal to the number of units associated with the original token. + * @dev The function then creates new tokens with the specified unit values and assigns them to the specified + * account. + * @dev A `BatchValueTransfer` event is emitted to indicate that the original token has been split into multiple + * tokens. + */ + function _splitTokenUnits(address _account, uint256 _tokenID, uint256[] calldata _values) internal { + if (_values.length > FRACTION_LIMIT || _values.length < 2) revert Errors.ArraySize(); + if (tokenValues[_tokenID] != _getSum(_values)) revert Errors.NotAllowed(); + + // Current token + uint256 _typeID = getBaseType(_tokenID); + uint256 valueLeft = tokenValues[_tokenID]; + + // Prepare batch processing, we want to skip the first entry + uint256 len = _values.length - 1; + + uint256[] memory typeIDs = new uint256[](len); + uint256[] memory fromIDs = new uint256[](len); + uint256[] memory toIDs = new uint256[](len); + uint256[] memory amounts = new uint256[](len); + uint256[] memory values = new uint256[](len); + + { + uint256[] memory _valuesCache = _values; + uint256 swapValue = _valuesCache[len]; + _valuesCache[len] = _valuesCache[0]; + _valuesCache[0] = swapValue; + + for (uint256 i; i < len;) { + _notMaxItem(maxIndex[_typeID]); + + typeIDs[i] = _typeID; + fromIDs[i] = _tokenID; + toIDs[i] = _typeID + ++maxIndex[_typeID]; + amounts[i] = 1; + values[i] = _valuesCache[i]; + + unchecked { + ++i; + } + } + } + + _beforeUnitTransfer(_msgSender(), owners[_tokenID], fromIDs, toIDs, values, ""); + + for (uint256 i; i < len;) { + valueLeft -= values[i]; + + tokenValues[toIDs[i]] = values[i]; + + unchecked { + ++i; + } + } + + tokenValues[_tokenID] = valueLeft; + + _mintBatch(_account, toIDs, amounts, ""); + + emit BatchValueTransfer(typeIDs, fromIDs, toIDs, values); + } + + /** + * @dev Merges the units of multiple tokens into a single token. + * @param _account The address of the account that will receive the merged token. + * @param _fractionIDs An array of token IDs to merge. + * @dev This function merges the units of multiple tokens into a single token. + * @dev The `_fractionIDs` array specifies the IDs of the tokens to merge. + * @dev The function checks that the length of the `_fractionIDs` array is between 2 and `FRACTION_LIMIT`. + * @dev The function then calculates the total value of the merged token by summing the values of the tokens to be + * merged. + * @dev The `tokenValues` mapping is updated with the total value of the merged token. + * @dev The tokens to be merged are burned except the last one that receives all the units. + * @dev A `BatchValueTransfer` event is emitted to indicate that the tokens have been merged into a single token. + */ + function _mergeTokensUnits(address _account, uint256[] memory _fractionIDs) internal { + if (_fractionIDs.length > FRACTION_LIMIT || _fractionIDs.length < 2) { + revert Errors.ArraySize(); + } + uint256 len = _fractionIDs.length - 1; + + uint256 target = _fractionIDs[len]; + + uint256 _totalValue; + uint256[] memory fromIDs = new uint256[](len); + uint256[] memory toIDs = new uint256[](len); + uint256[] memory values = new uint256[](len); + uint256[] memory amounts = new uint256[](len); + + { + for (uint256 i; i < len;) { + uint256 _fractionID = _fractionIDs[i]; + fromIDs[i] = _fractionID; + toIDs[i] = target; + amounts[i] = 1; + values[i] = tokenValues[_fractionID]; + + unchecked { + ++i; + } + } + } + + _beforeUnitTransfer(_msgSender(), _account, fromIDs, toIDs, values, ""); + + for (uint256 i; i < len;) { + _totalValue += values[i]; + + delete tokenValues[fromIDs[i]]; + unchecked { + ++i; + } + } + + tokenValues[target] += _totalValue; + + _burnBatch(_account, fromIDs, amounts); + } + + /** + * @dev Burns a single token and emits a `ValueTransfer` event with a value of 0. + * @param _account The address of the account that owns the token to burn. + * @param _tokenID The ID of the token to burn. + * @dev This function burns a single token with the specified ID and emits a `ValueTransfer` event `toTokenID` 0. + * @dev The function checks that the caller is the owner of the token or is approved to burn the token on behalf of + * the owner. + * @dev The function then deletes the token from the `tokenValues` mapping and calls the `_burn` function to burn + * the token. + */ + function _burnToken(address _account, uint256 _tokenID) internal { + if (_account != _msgSender() && !isApprovedForAll(_account, _msgSender())) revert Errors.NotApprovedOrOwner(); + + uint256 value = tokenValues[_tokenID]; + + delete tokenValues[_tokenID]; + + _burn(_account, _tokenID, 1); + emit ValueTransfer(getBaseType(_tokenID), _tokenID, 0, value); + } + + /** + * @dev Burns multiple tokens and emits a `BatchValueTransfer` event with a value of 0 for each token burned. + * @param _account The address of the account that owns the tokens to burn. + * @param _tokenIDs An array of token IDs to burn. + * @dev This function burns multiple tokens with the specified IDs and emits a `BatchValueTransfer` event. + * @dev The function checks that the caller is the owner of the tokens or is approved to burn the tokens on behalf + * of the owner. + * @dev The function then deletes the tokens from the `tokenValues` mapping and calls the `_burnBatch` function to + * burn the tokens. + * @dev Finally, the function emits a `BatchValueTransfer` event with a value of 1 and `toTokenIDs` as 0 for each + * token burned to indicate that the tokens have been burned. + */ + function _batchBurnToken(address _account, uint256[] memory _tokenIDs) internal { + if (_account != _msgSender() && !isApprovedForAll(_account, _msgSender())) revert Errors.NotApprovedOrOwner(); + + uint256 len = _tokenIDs.length; + + // ERC115 requires values + uint256[] memory claimIDs = new uint256[](len); + uint256[] memory toTokens = new uint256[](len); + uint256[] memory claimUnits = new uint256[](len); + uint256[] memory values = new uint256[](len); + + for (uint256 i; i < len; i++) { + uint256 _tokenId = _tokenIDs[i]; + uint256 value = tokenValues[_tokenId]; + + delete tokenValues[_tokenId]; + + claimIDs[i] = getBaseType(_tokenId); + claimUnits[i] = value; + values[i] = 1; + } + + _burnBatch(_account, _tokenIDs, values); + emit BatchValueTransfer(claimIDs, _tokenIDs, toTokens, claimUnits); + } + + /// TRANSFERS + + // The following functions are overrides required by Solidity. + /** + * @dev Called after a token transfer has been completed. + * @param operator The address of the operator performing the transfer. + * @param from The address of the sender of the tokens. + * @param to The address of the recipient of the tokens. + * @param ids An array of token IDs that were transferred. + * @param amounts An array of token amounts that were transferred. + * @param data Additional data that was passed along with the transfer. + * @dev This function updates the `owners` mapping to reflect the new owner of each token that was transferred. + */ + function _afterTokenTransfer( + address operator, + address from, + address to, + uint256[] memory ids, + uint256[] memory amounts, + bytes memory data + ) internal virtual override { + super._afterTokenTransfer(operator, from, to, ids, amounts, data); + + uint256 len = ids.length; + + for (uint256 i; i < len;) { + owners[ids[i]] = to; + unchecked { + ++i; + } + } + } + + /** + * @dev Called before a batch of tokens is transferred. + * @param {operator} The address of the operator performing the transfer. + * @param from The address of the sender of the tokens. + * @param fromIDs An array of token IDs that are being transferred. + * @param toIDs An array of token IDs that the tokens are being transferred to. + * @param {values} An array of token amounts that are being transferred. + * @param {data} Additional data that was passed along with the transfer. + * @dev This function checks that the transfer is allowed by verifying that the sender is approved to transfer the + * tokens and that the tokens being transferred are of the same base type. + */ + function _beforeUnitTransfer( + address, /*operator*/ + address from, + uint256[] memory fromIDs, + uint256[] memory toIDs, + uint256[] memory, /*values*/ + bytes memory /*data*/ + ) internal virtual { + uint256 len = fromIDs.length; + + for (uint256 i; i < len;) { + uint256 _from = fromIDs[i]; + uint256 _to = toIDs[i]; + + if (isBaseType(_from)) revert Errors.NotAllowed(); + if (getBaseType(_from) != getBaseType(_to)) revert Errors.TypeMismatch(); + if (from != _msgSender() && !isApprovedForAll(from, _msgSender())) revert Errors.NotApprovedOrOwner(); + unchecked { + ++i; + } + } + } + + /// METADATA + + /** + * @dev Returns the metadata URI for a given token ID. + * @param tokenID The ID of the token to retrieve the metadata URI for. + * @return _uri The metadata URI for the specified token ID. + * @dev This function retrieves the metadata URI for the specified token ID by calling the `uri` function of the + * `ERC1155URIStorageUpgradeable` contract. + * @dev The metadata URI is a string that points to a JSON file containing information about the token, such as its + * name, symbol, and image. + * @dev This function always returns the URI for the basetype so that it's managed in one place. + */ + function uri(uint256 tokenID) + public + view + virtual + override(ERC1155Upgradeable, ERC1155URIStorageUpgradeable) + returns (string memory _uri) + { + // All tokens share the same metadata at the moment + _uri = ERC1155URIStorageUpgradeable.uri(getBaseType(tokenID)); + } + + /// UTILS + + /** + * @dev Checks if the specified token ID is below the maximum item index. + * @param tokenID The ID of the token to check. + * @dev This function checks if the specified token ID is below the maximum item index by converting the token ID to + * a `uint128` value and incrementing it. + * @dev If the token ID is greater than or equal to the maximum item index, the function will revert with an error. + */ + function _notMaxItem(uint256 tokenID) private pure { + uint128 _count = uint128(tokenID); + ++_count; + } + + /** + * @dev Checks if the specified token ID is below the maximum type index. + * @param tokenID The ID of the token to check. + * @dev This function checks if the specified token ID is below the maximum type index by shifting the token ID + * right by 128 bits to get the type ID and converting it to a `uint128` value. + * @dev If the type ID is greater than or equal to the maximum type index, the function will revert with an error. + */ + function _notMaxType(uint256 tokenID) private pure { + uint128 _count = uint128(tokenID >> 128); + ++_count; + } + + /** + * @dev Calculates the sum of the elements of an array. + * @param array The array of uint256 values to sum. + * @return sum The sum of the elements of the array. + * @dev This function calculates the sum of the elements of the specified array by iterating over the array and + * adding each element to a running total. + * @dev If an element in the array is 0, the function will revert with an error. + */ + function _getSum(uint256[] memory array) internal pure returns (uint256 sum) { + uint256 len = array.length; + for (uint256 i; i < len;) { + if (array[i] == 0) revert Errors.NotAllowed(); + sum += array[i]; + unchecked { + ++i; + } + } + } + + /** + * @dev Returns an array containing a single element. + * @param element The element to include in the array. + * @return An array containing a single element. + * @dev This function returns an array containing a single element by creating a new array with a length of 1 and + * setting the first element to the specified value. + */ + function _getSingletonArray(uint256 element) private pure returns (uint256[] memory) { + uint256[] memory array = new uint256[](1); + array[0] = element; + + return array; + } + + // UUPS PROXY + + /// @dev see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol } + function _authorizeUpgrade(address newImplementation) internal virtual override onlyOwner { + // solhint-disable-previous-line no-empty-blocks + } + + /** + * @dev This empty reserved space is put in place to allow future versions to add new + * variables without shifting down storage in the inheritance chain. + * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps + * Assuming 30 available slots (slots cost space, cost gas) + * 1. typeCounter + * 2. owners + * 3. creators + * 4. tokenValues + * 5. maxIndex + */ + uint256[25] private __gap; +} diff --git a/contracts/src/interfaces/IAllowlist.sol b/contracts/src/protocol/interfaces/IAllowlist.sol similarity index 61% rename from contracts/src/interfaces/IAllowlist.sol rename to contracts/src/protocol/interfaces/IAllowlist.sol index fe4a9ec4..a29da784 100644 --- a/contracts/src/interfaces/IAllowlist.sol +++ b/contracts/src/protocol/interfaces/IAllowlist.sol @@ -1,14 +1,13 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.17; /// @title Interface for allowlist /// @author bitbeckers /// @notice This interface declares the required functionality for a hypercert token /// @notice This interface does not specify the underlying token type (e.g. 721 or 1155) interface IAllowlist { - function isAllowedToClaim( - bytes32[] calldata proof, - uint256 tokenID, - bytes32 leaf - ) external view returns (bool isAllowed); + function isAllowedToClaim(bytes32[] calldata proof, uint256 tokenID, bytes32 leaf) + external + view + returns (bool isAllowed); } diff --git a/contracts/src/interfaces/IHypercertToken.sol b/contracts/src/protocol/interfaces/IHypercertToken.sol similarity index 91% rename from contracts/src/interfaces/IHypercertToken.sol rename to contracts/src/protocol/interfaces/IHypercertToken.sol index 1ed1e34e..3e7738b4 100644 --- a/contracts/src/interfaces/IHypercertToken.sol +++ b/contracts/src/protocol/interfaces/IHypercertToken.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.16; +pragma solidity 0.8.17; /// @title Interface for hypercert token interactions /// @author bitbeckers @@ -46,6 +46,10 @@ interface IHypercertToken { /// @notice Operator must be allowed by `creator` and the token must represent the total amount of available units. function burnFraction(address account, uint256 tokenID) external; + /// @dev Function to burn the tokens at `tokenIDs` for `account` + /// @notice Operator must be allowed by `creator` and the tokens must represent the total amount of available units. + function batchBurnFraction(address account, uint256[] memory tokenIDs) external; + /// @dev Returns the `units` held by a (fractional) token at `claimID` /// @dev If `tokenID` is a base type, the total amount of `units` for the claim is returned. /// @dev If `tokenID` is a fractional token, the `units` held by the token is returned diff --git a/contracts/src/libs/Errors.sol b/contracts/src/protocol/libs/Errors.sol similarity index 92% rename from contracts/src/libs/Errors.sol rename to contracts/src/protocol/libs/Errors.sol index e19d6b5c..e807d828 100644 --- a/contracts/src/libs/Errors.sol +++ b/contracts/src/protocol/libs/Errors.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.16; +pragma solidity 0.8.17; /// @author bitbeckers library Errors { diff --git a/contracts/tasks/deploy-marketplace.ts b/contracts/tasks/deploy-marketplace.ts new file mode 100644 index 00000000..2e75931b --- /dev/null +++ b/contracts/tasks/deploy-marketplace.ts @@ -0,0 +1,529 @@ +import { task } from "hardhat/config"; +import { solidityPacked } from "ethers"; +import { getContractAddress, slice, encodeDeployData, getContract, WalletClient, encodePacked } from "viem"; +import { writeFile } from "node:fs/promises"; +import creatorFeeManagerContract from "../out/CreatorFeeManagerWithRoyalties.sol/CreatorFeeManagerWithRoyalties.json"; +import exchangeContract from "../out/LooksRareProtocol.sol/LooksRareProtocol.json"; +import transferManagerContract from "../out/TransferManager.sol/TransferManager.json"; +import orderValidatorContract from "../out/OrderValidatorV2A.sol/OrderValidatorV2A.json"; +import strategyCollectionOfferContract from "../out/StrategyCollectionOffer.sol/StrategyCollectionOffer.json"; +import strategyHypercertFractionOfferContract from "../out/StrategyHypercertFractionOffer.sol/StrategyHypercertFractionOffer.json"; +import protocolFeeRecipientContract from "../out/ProtocolFeeRecipient.sol/ProtocolFeeRecipient.json"; + +const getCreate2Address = async ( + deployer: WalletClient, + factory: `0x${string}`, + bytecode: `0x${string}`, + salt: `0x${string}`, +) => { + if (!deployer.account?.address) { + throw new Error("Deployer account is undefined"); + } + + const address = getContractAddress({ + from: factory, + salt, + opcode: "CREATE2", + bytecode, + }); + return { address, salt, deployData: bytecode }; +}; + +task("deploy-marketplace", "Deploy marketplace contracts and verify") + .addOptionalParam("output", "write the details of the deployment to this file if this is set") + .setAction(async ({ output }, hre) => { + //TODO multichain support + const { ethers, network, run, viem } = hre; + const owner = "0xdf2C3dacE6F31e650FD03B8Ff72beE82Cb1C199A"; + const create2Address = "0x0000000000ffe8b47b3e2130213b802212439497"; + const wethAddress = "0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6"; + + const publicClient = await viem.getPublicClient(); + const [deployer] = await viem.getWalletClients(); + const create2Instance = await viem.getContractAt("IImmutableCreate2Factory", create2Address, { + walletClient: deployer, + }); + + console.log("Deployer: ", deployer.account.address); + + const _standardProtocolFeeBP = 50; + const _minTotalFeeBp = 50; + const _maxProtocolFeeBp = 200; + + const releaseCounter = "h"; + + const salt = slice( + encodePacked(["address", "string", "address"], [deployer.account?.address, releaseCounter, create2Address]), + 0, + 32, + ); + console.log("Calculated salt: ", salt); + + // Create2 Transfermanager + const transferManagerArgs = [deployer.account.address]; + const transferManagerCreate2 = await getCreate2Address( + deployer, + create2Address, + encodeDeployData({ + abi: transferManagerContract.abi, + bytecode: transferManagerContract.bytecode.object as `0x${string}`, + args: transferManagerArgs, + }), + salt, + ); + + // read findCreate2Address from IImmutableCreate2Factory + const findCreate2Address = await create2Instance.read.findCreate2Address([ + salt, + encodeDeployData({ + abi: transferManagerContract.abi, + bytecode: transferManagerContract.bytecode.object as `0x${string}`, + args: transferManagerArgs, + }), + ]); + + console.log(`Comparing calculated address: ${transferManagerCreate2.address} with ${findCreate2Address}`); + + // Create2 ProtocolFeeRecipient + const protocolFeeRecipientArgs = [deployer.account.address, wethAddress]; + const protocolFeeRecipientCreate2 = await getCreate2Address( + deployer, + create2Address, + encodeDeployData({ + abi: protocolFeeRecipientContract.abi, + bytecode: protocolFeeRecipientContract.bytecode.object as `0x${string}`, + args: protocolFeeRecipientArgs, + }), + salt, + ); + + // Create2 HypercertsExchange + const hypercertsExchangeArgs = [ + deployer.account.address, + protocolFeeRecipientCreate2.address, + transferManagerCreate2.address, + wethAddress, + ]; + + const hypercertsExchangeCreate2 = await getCreate2Address( + deployer, + create2Address, + encodeDeployData({ + abi: exchangeContract.abi, + bytecode: exchangeContract.bytecode.object as `0x${string}`, + args: hypercertsExchangeArgs, + }), + salt, + ); + + const orderValidatorArgs = [hypercertsExchangeCreate2.address]; + + const strategyCollectionOfferCreate2 = await getCreate2Address( + deployer, + create2Address, + encodeDeployData({ + abi: strategyCollectionOfferContract.abi, + bytecode: strategyCollectionOfferContract.bytecode.object as `0x${string}`, + args: [], + }), + salt, + ); + + console.log("Calculated exchange address using CREATE2: ", hypercertsExchangeCreate2.address); + console.log("Calculated transferManager address using CREATE2: ", transferManagerCreate2.address); + console.log("Calculated protocolFeeRecipient address using CREATE2: ", protocolFeeRecipientCreate2.address); + console.log("Calculated strategyCollectionOffer address using CREATE2: ", strategyCollectionOfferCreate2.address); + + // Deploy transferManager + console.log("Deploying TransferManager..."); + const transferManagerCreation = await create2Instance.write.safeCreate2([salt, transferManagerCreate2.deployData]); + const transferManagerTx = await publicClient.waitForTransactionReceipt({ + hash: transferManagerCreation, + }); + + console.log( + transferManagerTx.status === "success" + ? "Deployed TransferManager successfully" + : "Failed to deploy TransferManager", + ); + + // // Transfer 1 wei to hypercertsExchange + await deployer.sendTransaction({ + to: hypercertsExchangeCreate2.address, + value: 1n, + }); + + // Deploy ProtocolFeeRecipient + console.log("Deploying ProtocolFeeRecipient..."); + const protocolFeeRecipientCreation = await create2Instance.write.safeCreate2([ + salt, + protocolFeeRecipientCreate2.deployData, + ]); + + const protocolFeeRecipientTx = await publicClient.waitForTransactionReceipt({ + hash: protocolFeeRecipientCreation, + }); + + console.log( + protocolFeeRecipientTx.status === "success" + ? "Deployed ProtocolFeeRecipient successfully" + : "Failed to deploy ProtocolFeeRecipient", + ); + + // Deploy HypercertsExchange + console.log("Deploying HypercertsExchange..."); + const hypercertsExchange = await create2Instance.write.safeCreate2([salt, hypercertsExchangeCreate2.deployData]); + const hypercertsExchangeTx = await publicClient.waitForTransactionReceipt({ + hash: hypercertsExchange, + }); + + console.log( + hypercertsExchangeTx.status === "success" + ? "Deployed HypercertsExchange successfully" + : "Failed to deploy HypercertsExchange", + ); + + // Parse logs to get the address of the deployed HypercertsExchange + console.log("Deploying HypercertsExchange... done!"); + + // Allow Exchange as operator on transferManager + const transferManagerInstance = getContract({ + address: transferManagerCreate2.address, + abi: transferManagerContract.abi, + publicClient, + walletClient: deployer, + }); + + // Deploy CreatorFeeManager + const deployCreatorFeeManager = await deployer.deployContract({ + abi: creatorFeeManagerContract.abi, + account: deployer.account, + args: ["0x12405dB79325D06a973aD913D6e9BdA1343cD526"], + bytecode: creatorFeeManagerContract.bytecode.object as `0x${string}`, + }); + + const creatorFeeManagerTx = await publicClient.waitForTransactionReceipt({ + hash: deployCreatorFeeManager, + }); + + console.log( + creatorFeeManagerTx.status === "success" + ? "Deployed CreatorFeeManager successfully" + : "Failed to deploy CreatorFeeManager", + ); + + await transferManagerInstance.write.allowOperator([hypercertsExchangeCreate2.address]); + + const hypercertsExchangeInstance = getContract({ + address: hypercertsExchangeCreate2.address, + abi: exchangeContract.abi, + publicClient, + walletClient: deployer, + }); + + // read transferManager from HypercertsExchange + const transferManager = await hypercertsExchangeInstance.read.transferManager(); + console.log("TransferManager address: ", transferManager); + + // read deriveProtocolParams from HypercertsExchange + // + // domainSeparator = looksRareProtocol.domainSeparator(); + // creatorFeeManager = looksRareProtocol.creatorFeeManager(); + // maxCreatorFeeBp = looksRareProtocol.maxCreatorFeeBp(); + + const domainSeparator = await hypercertsExchangeInstance.read.domainSeparator(); + console.log("domainSeparator: ", domainSeparator); + + const creatorFeeManager = await hypercertsExchangeInstance.read.creatorFeeManager(); + console.log("creatorFeeManager: ", creatorFeeManager); + + const maxCreatorFeeBp = await hypercertsExchangeInstance.read.maxCreatorFeeBp(); + console.log("maxCreatorFeeBp: ", maxCreatorFeeBp); + + // Update currencyStatus address(0) to true + const updateCurrencyStatusEth = await hypercertsExchangeInstance.write.updateCurrencyStatus([ + "0x0000000000000000000000000000000000000000", + true, + ]); + const updateCurrencyStatusEthTx = await publicClient.waitForTransactionReceipt({ + hash: updateCurrencyStatusEth, + }); + + // Update currencyStatus address(weth) to true + const updateCurrencyStatusTxWeth = await hypercertsExchangeInstance.write.updateCurrencyStatus([wethAddress, true]); + const updateCurrencyStatusTxWethTx = await publicClient.waitForTransactionReceipt({ + hash: updateCurrencyStatusTxWeth, + }); + + // Update creatorFeeManager address + const updateCreatorFeeManager = await hypercertsExchangeInstance.write.updateCreatorFeeManager([ + creatorFeeManagerTx.contractAddress, + ]); + + const updateCreatorFeeManagerTx = await publicClient.waitForTransactionReceipt({ + hash: updateCreatorFeeManager, + }); + + console.log( + updateCreatorFeeManagerTx.status === "success" + ? "Updated creatorFeeManager successfully" + : "Failed to update creatorFeeManager", + ); + + console.log( + updateCurrencyStatusEthTx.status === "success" + ? "Updated currency status for ETH successfully" + : "Failed to update currency status for ETH", + ); + + console.log( + updateCurrencyStatusTxWethTx.status === "success" + ? "Updated currency status for WETH successfully" + : "Failed to update currency status for WETH", + ); + + // Deploy OrderValidator + + const deployOrderValidator = await deployer.deployContract({ + abi: orderValidatorContract.abi, + account: deployer.account, + args: orderValidatorArgs, + bytecode: orderValidatorContract.bytecode.object as `0x${string}`, + }); + + const orderValidatorTx = await publicClient.waitForTransactionReceipt({ + hash: deployOrderValidator, + }); + + console.log( + orderValidatorTx.status === "success" + ? "Deployed OrderValidator successfully" + : "Failed to deploy OrderValidator", + ); + + // DEPLOYING STRATEGIES + + console.log("Deploying and adding strategies...."); + + // Deploy strategyCollectionOffer + + const deployStrategyCollectionOffer = await deployer.deployContract({ + abi: strategyCollectionOfferContract.abi, + account: deployer.account, + args: [], + bytecode: strategyCollectionOfferContract.bytecode.object as `0x${string}`, + }); + + const strategyCollectionOfferTx = await publicClient.waitForTransactionReceipt({ + hash: deployStrategyCollectionOffer, + }); + + console.log( + strategyCollectionOfferTx.status === "success" + ? "Deployed StrategyCollectionOffer successfully" + : "Failed to deploy StrategyCollectionOffer", + ); + + // Add executeCollectionStrategyWithTakerAsk strategy to HypercertsExchange + + const strategyCollectionOfferFactory = await ethers.getContractFactory("StrategyCollectionOffer"); + + const addStratTakerAsk = await hypercertsExchangeInstance.write.addStrategy([ + _standardProtocolFeeBP, + _minTotalFeeBp, + _maxProtocolFeeBp, + strategyCollectionOfferFactory.interface.getFunction("executeCollectionStrategyWithTakerAsk")?.selector, + true, + strategyCollectionOfferTx.contractAddress, + ]); + + console.log("Adding strategy CollectionWithTakerAsk [strategyId 1] to exchange..."); + const addStratTakerAskTx = await publicClient.waitForTransactionReceipt({ + hash: addStratTakerAsk, + }); + + console.log( + addStratTakerAskTx.status === "success" + ? "Added strategy executeCollectionStrategyWithTakerAsk to exchange successfully" + : "Failed to add strategy executeCollectionStrategyWithTakerAsk to exchange", + ); + + // Add executeCollectionStrategyWithTakerAskWithProof strategy to HypercertsExchange + + const addStratTakerAskProof = await hypercertsExchangeInstance.write.addStrategy([ + _standardProtocolFeeBP, + _minTotalFeeBp, + _maxProtocolFeeBp, + strategyCollectionOfferFactory.interface.getFunction("executeCollectionStrategyWithTakerAskWithProof")?.selector, + true, + strategyCollectionOfferTx.contractAddress, + ]); + + console.log("Adding strategy CollectionWithTakerAskWithProof [strategyId 2] to exchange..."); + const addStratTakerAskProofTx = await publicClient.waitForTransactionReceipt({ + hash: addStratTakerAskProof, + }); + + console.log( + addStratTakerAskProofTx.status === "success" + ? "Added strategy executeCollectionStrategyWithTakerAskWithProof to exchange successfully" + : "Failed to add strategy executeCollectionStrategyWithTakerAskWithProof to exchange", + ); + + // Deploy strategyHypercertFractionOffer + + const deployStrategyHypercertFractionOffer = await deployer.deployContract({ + abi: strategyHypercertFractionOfferContract.abi, + account: deployer.account, + args: [], + bytecode: strategyHypercertFractionOfferContract.bytecode.object as `0x${string}`, + }); + + const strategyHypercertFractionOfferTx = await publicClient.waitForTransactionReceipt({ + hash: deployStrategyHypercertFractionOffer, + }); + + console.log( + strategyHypercertFractionOfferTx.status === "success" + ? "Deployed StrategyHypercertOffer successfully" + : "Failed to deploy StrategyHypercertOffer", + ); + + // Add executeHypercertFractionStrategyWithTakerBid strategy to HypercertsExchange + + const strategyHypercertFractionOfferFactory = await ethers.getContractFactory("StrategyHypercertFractionOffer"); + + const addHypercertFractionStrategyWithTakerBid = await hypercertsExchangeInstance.write.addStrategy([ + _standardProtocolFeeBP, + _minTotalFeeBp, + _maxProtocolFeeBp, + strategyHypercertFractionOfferFactory.interface.getFunction("executeHypercertFractionStrategyWithTakerBid") + ?.selector, + true, + strategyHypercertFractionOfferTx.contractAddress, + ]); + + console.log("Adding strategy HypercertFraction to exchange..."); + const addHypercertFractionStrategyWithTakerBidTx = await publicClient.waitForTransactionReceipt({ + hash: addHypercertFractionStrategyWithTakerBid, + }); + + console.log( + addHypercertFractionStrategyWithTakerBidTx.status === "success" + ? "Added strategy executeHypercertFractionStrategyWithTakerBid to exchange successfully" + : "Failed to add strategy executeHypercertFractionStrategyWithTakerBid to exchange", + ); + + // Add executeHypercertFractionStrategyWithTakerBidWithAllowlist strategy to HypercertsExchange + + const addHypercertFractionStrategyWithTakerBidWithAllowlist = await hypercertsExchangeInstance.write.addStrategy([ + _standardProtocolFeeBP, + _minTotalFeeBp, + _maxProtocolFeeBp, + strategyHypercertFractionOfferFactory.interface.getFunction( + "executeHypercertFractionStrategyWithTakerBidWithAllowlist", + )?.selector, + true, + strategyHypercertFractionOfferTx.contractAddress, + ]); + + console.log("Adding strategy HypercertFraction WithAllowlist to exchange..."); + const addHypercertFractionStrategyWithTakerBidWithAllowlistTx = await publicClient.waitForTransactionReceipt({ + hash: addHypercertFractionStrategyWithTakerBidWithAllowlist, + }); + + console.log( + addHypercertFractionStrategyWithTakerBidWithAllowlistTx.status === "success" + ? "Added strategy executeHypercertFractionStrategyWithTakerBidWithAllowlist to exchange successfully" + : "Failed to add strategy executeHypercertFractionStrategyWithTakerBidWithAllowlist to exchange", + ); + + console.log("🚀 Done!"); + + interface ContractDeployment { + address: string; + fullNamespace: string; + args: string[]; + encodedArgs: string; + tx: `0x${string}`; + } + + type ContractDeployments = { + [name: string]: ContractDeployment; + }; + + const contracts: ContractDeployments = { + HypercertExchange: { + address: hypercertsExchangeCreate2.address, + fullNamespace: "LooksRareProtocol", + args: hypercertsExchangeArgs, + encodedArgs: solidityPacked(["address", "address", "address", "address"], hypercertsExchangeArgs), + tx: hypercertsExchangeTx.transactionHash, + }, + ProtocolFeeRecipient: { + address: protocolFeeRecipientCreate2.address, + fullNamespace: "ProtocolFeeRecipient", + args: [deployer.account.address, wethAddress], + encodedArgs: solidityPacked(["address", "address"], [deployer.account.address, wethAddress]), + tx: protocolFeeRecipientTx.transactionHash, + }, + TransferManager: { + address: transferManagerCreate2.address, + fullNamespace: "TransferManager", + args: transferManagerArgs, + encodedArgs: solidityPacked(["address"], transferManagerArgs), + tx: transferManagerTx.transactionHash, + }, + OrderValidator: { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + address: orderValidatorTx.contractAddress!, + fullNamespace: "OrderValidatorV2A", + args: orderValidatorArgs, + encodedArgs: solidityPacked(["address"], orderValidatorArgs), + tx: orderValidatorTx.transactionHash, + }, + StrategyCollectionOffer: { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + address: strategyCollectionOfferTx.contractAddress!, + fullNamespace: "StrategyCollectionOffer", + args: [], + encodedArgs: solidityPacked([], []), + tx: strategyCollectionOfferTx.transactionHash, + }, + StrategyHypercertFractionOffer: { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + address: strategyHypercertFractionOfferTx.contractAddress!, + fullNamespace: "StrategyCollectionOffer", + args: [], + encodedArgs: solidityPacked([], []), + tx: strategyHypercertFractionOfferTx.transactionHash, + }, + }; + + await writeFile(`src/deployments/deployment-marketplace-${network.name}.json`, JSON.stringify(contracts), "utf-8"); + if (network.name !== "hardhat" && network.name !== "localhost") { + // Verify contracts + for (const [name, { address, tx }] of Object.entries(contracts)) { + try { + const code = await publicClient.getBytecode({ address: address as `0x${string}` }); + if (code === "0x") { + console.log(`${name} contract deployment has not completed. waiting to verify...`); + await publicClient.waitForTransactionReceipt({ + hash: tx, + }); + } + await run("verify:verify", { + address, + constructorArguments: contracts[name].args, + }); + } catch (error) { + const errorMessage = (error as Error).message; + + if (errorMessage.includes("Reason: Already Verified")) { + console.log("Reason: Already Verified"); + } + console.error(errorMessage); + } + } + } + }); diff --git a/contracts/tasks/deploy.ts b/contracts/tasks/deploy.ts index 30927db5..28767a74 100644 --- a/contracts/tasks/deploy.ts +++ b/contracts/tasks/deploy.ts @@ -1,7 +1,7 @@ import { task } from "hardhat/config"; import { writeFile } from "node:fs/promises"; -task("deploy", "Deploy contracts and verify") +task("deploy-minter", "Deploy contracts and verify") .addOptionalParam("output", "write the details of the deployment to this file if this is set") .setAction(async ({ output }, { ethers, upgrades, network, run }) => { console.log("Using address: ", await ethers.getSigners().then((res) => res[0])); diff --git a/contracts/tasks/index.ts b/contracts/tasks/index.ts index a60a09ad..71c1f98d 100644 --- a/contracts/tasks/index.ts +++ b/contracts/tasks/index.ts @@ -8,3 +8,4 @@ export * from "./test-tx-client"; export * from "./upgrade"; export * from "./unpause"; export * from "./validate-upgrade"; +export * from "./deploy-marketplace"; diff --git a/contracts/tasks/transfer-owner.ts b/contracts/tasks/transfer-owner.ts index 03421503..20c80c66 100644 --- a/contracts/tasks/transfer-owner.ts +++ b/contracts/tasks/transfer-owner.ts @@ -1,13 +1,13 @@ import { task } from "hardhat/config"; -task("transfer-owner", "Transfer ownership of ProxyAdmin contract") +task("transfer-owner-minter", "Transfer ownership of ProxyAdmin contract HypercertMinter") .addParam("proxy", "Proxy contract address") .addParam("owner", "Address of new owner") .setAction(async ({ proxy, owner }, { ethers, upgrades }) => { const HypercertMinter = await ethers.getContractFactory("HypercertMinter"); const hypercertMinter = await HypercertMinter.attach(proxy); - console.log('Transferring ownership of proxy contract...'); + console.log("Transferring ownership of proxy contract..."); const transferTransaction = await hypercertMinter.transferOwnership(owner); console.log("Sent transfer transaction, waiting for transaction receipt..."); @@ -27,5 +27,33 @@ task("transfer-owner", "Transfer ownership of ProxyAdmin contract") } console.log(`Successfully verified that the HypercertMinter contract was transferred. Contract address: ${proxy}`); - } -); + }); + +task("transfer-owner-trader", "Transfer ownership of ProxyAdmin contract HypercertTrader") + .addParam("proxy", "Proxy contract address") + .addParam("owner", "Address of new owner") + .setAction(async ({ proxy, owner }, { ethers, upgrades }) => { + const HypercertTrader = await ethers.getContractFactory("HypercertTrader"); + const hypercertTrader = await HypercertTrader.attach(proxy); + + console.log("Transferring ownership of proxy contract..."); + const transferTransaction = await hypercertTrader.transferOwnership(owner); + console.log("Sent transfer transaction, waiting for transaction receipt..."); + + const transferReceipt = await transferTransaction.wait(); + if (transferReceipt == null || transferReceipt.status == 0) { + console.error(transferReceipt); + console.error("Transaction failed, failed to transfer contract"); + return; + } + + console.log(`Transaction succeeded. Transaction Hash: ${transferReceipt.transactionHash}`); + + const newOwner = await hypercertTrader.owner(); + if (newOwner !== owner) { + console.error(`Verification failed: the contract is owned by ${newOwner}.`); + return; + } + + console.log(`Successfully verified that the HypercertTrader contract was transferred. Contract address: ${proxy}`); + }); diff --git a/contracts/tasks/upgrade.ts b/contracts/tasks/upgrade.ts index 9f547d43..082e36a4 100644 --- a/contracts/tasks/upgrade.ts +++ b/contracts/tasks/upgrade.ts @@ -3,7 +3,7 @@ import { task } from "hardhat/config"; /** * Used to upgrade a contract directly via local keys */ -task("upgrade", "Upgrade implementation contract and verify") +task("upgrade-minter", "Upgrade implementation contract of Minter and verify") .addParam("proxy", "Provider proxy address") .setAction(async ({ proxy }, { ethers, upgrades, run }) => { const HypercertMinter = await ethers.getContractFactory("HypercertMinter"); @@ -40,16 +40,77 @@ task("upgrade", "Upgrade implementation contract and verify") }); /** - * Used to propose a multi-sig upgrade via OpenZeppelin Defender + * Used to upgrade a contract directly via local keys */ -task("propose-upgrade", "Propose an upgrade to OpenZeppelin Defender") +task("upgrade-trader", "Upgrade implementation contract of Trader and verify") + .addParam("proxy", "Provider proxy address") + .setAction(async ({ proxy }, { ethers, upgrades, run }) => { + const HypercertTrader = await ethers.getContractFactory("HypercertTrader"); + + // Validate (redundant?) + console.log("Validating upgrade.."); + await upgrades.validateUpgrade(proxy, HypercertTrader).then(() => console.log("Valid upgrade. Deploying..")); + + // Upgrade + const hypercertTraderUpgrade = await upgrades.upgradeProxy(proxy, HypercertTrader, { + kind: "uups", + unsafeAllow: ["constructor"], + }); + await hypercertTraderUpgrade.deployed(); + console.log(`HypercertTrader at proxy address ${hypercertTraderUpgrade.address} was upgraded`); + + try { + const code = await hypercertTraderUpgrade.instance?.provider.getCode(hypercertTraderUpgrade.address); + if (code === "0x") { + console.log(`${hypercertTraderUpgrade.name} contract upgrade has not completed. waiting to verify...`); + await hypercertTraderUpgrade.instance?.deployed(); + } + await run("verify:verify", { + address: hypercertTraderUpgrade.address, + }); + } catch (error) { + const errorMessage = (error as Error).message; + if (errorMessage.includes("Reason: Already Verified")) { + console.log("Reason: Already Verified"); + } + console.error(errorMessage); + } + }); + +/** + * Used to propose a multi-sig upgrade via OpenZeppelin Defender for HypercertMinter + */ +task("propose-upgrade-minter", "Propose an upgrade to OpenZeppelin Defender") .addParam("proxy", "Proxy contract address") .addParam("multisig", "Owner multisig address") - .setAction(async ({ proxy, multisig }, { ethers, defender }) => { + .addOptionalParam("description", "Description of upgrade") + .setAction(async ({ proxy, multisig, description = "Upgrade Minter contract" }, { ethers, defender }) => { const HypercertMinter = await ethers.getContractFactory("HypercertMinter"); - console.log("Proposing upgrade.."); + console.log(`Proposing upgrade to multisig ${multisig} as address ${proxy}`); const proposal = await defender.proposeUpgrade(proxy, HypercertMinter, { + description, + multisig, + multisigType: "Gnosis Safe", + title: "Upgrade Minter contract", + }); + console.log("Upgrade proposal created at: ", proposal.url); + }); + +/** + * Used to propose a multi-sig upgrade via OpenZeppelin Defender for HypercertTrader + */ +task("propose-upgrade-trader", "Propose an upgrade to OpenZeppelin Defender") + .addParam("proxy", "Proxy contract address") + .addParam("multisig", "Owner multisig address") + .addOptionalParam("description", "Description of upgrade") + .setAction(async ({ proxy, multisig, description = "Upgrade Trader contract" }, { ethers, defender }) => { + const HypercertTrader = await ethers.getContractFactory("HypercertTrader"); + console.log(`Proposing upgrade to multisig ${multisig} as address ${proxy}`); + const proposal = await defender.proposeUpgrade(proxy, HypercertTrader, { + description, multisig, + multisigType: "Gnosis Safe", + title: "Upgrade Trader contract", }); console.log("Upgrade proposal created at: ", proposal.url); }); diff --git a/contracts/test/HypercertMinter.test.ts b/contracts/test/HypercertMinter.test.ts index 9cb0af6f..437b1fe4 100644 --- a/contracts/test/HypercertMinter.test.ts +++ b/contracts/test/HypercertMinter.test.ts @@ -1,16 +1,16 @@ -import { expect } from "chai"; import { ethers, upgrades } from "hardhat"; +import { expect } from "chai"; -import { HypercertMinter } from "../src/types"; - -describe("Hypercert Minter", function () { +describe("HypercertMinter", function () { it("is upgradeable", async () => { const HypercertMinter = await ethers.getContractFactory("HypercertMinter"); - const instance = await upgrades.deployProxy(HypercertMinter, { + const instance = await upgrades.deployProxy(HypercertMinter, { kind: "uups", unsafeAllow: ["constructor"], + useDefenderDeploy: false, }); + await instance.waitForDeployment(); const name = await instance.name(); expect(name).to.equal("HypercertMinter"); await expect(instance.initialize()).to.be.revertedWith("Initializable: contract is already initialized"); diff --git a/contracts/test/foundry/SemiFungible1155.burning.t.sol b/contracts/test/foundry/SemiFungible1155.burning.t.sol deleted file mode 100644 index e816d35f..00000000 --- a/contracts/test/foundry/SemiFungible1155.burning.t.sol +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.16; - -import { PRBTest } from "prb-test/PRBTest.sol"; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; -import { SemiFungible1155Helper } from "./SemiFungibleHelper.sol"; - -/// @dev See the "Writing Tests" section in the Foundry Book if this is your first time with Forge. -/// https://book.getfoundry.sh/forge/writing-tests -contract SemiFungible1155BurnTest is PRBTest, StdCheats, StdUtils, SemiFungible1155Helper { - SemiFungible1155Helper internal semiFungible; - string internal _uri; - address internal alice; - address internal bob; - - function setUp() public { - semiFungible = new SemiFungible1155Helper(); - _uri = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi"; - alice = address(1); - bob = address(2); - } - - function testBurnFraction() public { - uint256 baseID = 1 << 128; - - uint256 size = 20; - uint256 value = 2000; - uint256[] memory values = semiFungible.buildValues(size, value); - uint256[] memory tokenIDs = semiFungible.buildIDs(baseID, size); - - startHoax(alice, 100 ether); - - semiFungible.mintValue(alice, values, _uri); - semiFungible.validateOwnerBalanceUnits(tokenIDs[1], alice, 1, values[1]); - - vm.expectEmit(true, true, true, true); - emit TransferSingle(alice, alice, address(0), tokenIDs[1], 1); - semiFungible.burnValue(alice, tokenIDs[1]); - - semiFungible.validateNotOwnerNoBalanceNoUnits(tokenIDs[1], alice); - } - - function testCannotBurnClaim() public { - uint256 size = 20; - uint256 value = 2000; - uint256[] memory values = semiFungible.buildValues(size, value); - - startHoax(alice, 100 ether); - - uint256 baseID = semiFungible.mintValue(alice, values, _uri); - - vm.expectRevert("ERC1155: burn amount exceeds balance"); - semiFungible.burnValue(alice, baseID); - } -} diff --git a/contracts/test/foundry/marketplace/BatchMakerCollectionOrders.t.sol b/contracts/test/foundry/marketplace/BatchMakerCollectionOrders.t.sol new file mode 100644 index 00000000..8810028b --- /dev/null +++ b/contracts/test/foundry/marketplace/BatchMakerCollectionOrders.t.sol @@ -0,0 +1,111 @@ +/// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Strategies +import {StrategyCollectionOffer} from "@hypercerts/marketplace/executionStrategies/StrategyCollectionOffer.sol"; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Helpers +import {EIP712MerkleTree} from "./utils/EIP712MerkleTree.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract BatchMakerCollectionOrdersTest is ProtocolBase { + StrategyCollectionOffer private strategy; + uint256 private constant price = 1 ether; // Fixed price of sale + EIP712MerkleTree private eip712MerkleTree; + + function setUp() public { + _setUp(); + + strategy = new StrategyCollectionOffer(); + vm.prank(_owner); + looksRareProtocol.addStrategy( + _standardProtocolFeeBp, + _minTotalFeeBp, + _maxProtocolFeeBp, + StrategyCollectionOffer.executeCollectionStrategyWithTakerAsk.selector, + true, + address(strategy) + ); + + _setUpUsers(); + eip712MerkleTree = new EIP712MerkleTree(looksRareProtocol); + } + + function testTakerAskMultipleOrdersSignedERC721(uint256 numberOrders) public { + vm.assume(numberOrders > 0 && numberOrders <= 10); + + mockERC721.batchMint(takerUser, numberOrders); + + OrderStructs.Maker[] memory makerBids = _createBatchMakerBids(numberOrders); + + (bytes memory signature,) = eip712MerkleTree.sign(makerUserPK, makerBids, 0); + + for (uint256 i; i < numberOrders; i++) { + // To prove that we only need 1 signature for multiple collection offers, + // we are not using the signature from the sign call in the loop. + (, OrderStructs.MerkleTree memory merkleTree) = eip712MerkleTree.sign(makerUserPK, makerBids, i); + + OrderStructs.Maker memory makerBidToExecute = makerBids[i]; + + // Verify validity + _assertValidMakerOrderWithMerkleTree(makerBidToExecute, signature, merkleTree); + + OrderStructs.Taker memory takerOrder = OrderStructs.Taker(takerUser, abi.encode(i)); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerOrder, makerBidToExecute, signature, merkleTree); + + // Maker user has received the asset + assertEq(mockERC721.ownerOf(i), makerUser); + + // Verify the nonce is marked as executed + assertEq( + looksRareProtocol.userOrderNonce(makerUser, makerBidToExecute.orderNonce), + MAGIC_VALUE_ORDER_NONCE_EXECUTED + ); + } + + uint256 totalValue = price * numberOrders; + assertEq( + weth.balanceOf(makerUser), _initialWETHBalanceUser - totalValue, "Maker bid user should pay the whole price" + ); + assertEq( + weth.balanceOf(takerUser), + _initialWETHBalanceUser + + (totalValue * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP, + "Taker ask user should receive 99.5% of the whole price (0.5% protocol)" + ); + } + + function _createBatchMakerBids(uint256 numberOrders) private view returns (OrderStructs.Maker[] memory makerBids) { + makerBids = new OrderStructs.Maker[](numberOrders); + for (uint256 i; i < numberOrders; i++) { + makerBids[i] = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 1, + collectionType: CollectionType.ERC721, + orderNonce: i, // incremental + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemId: 0 // Not used + }); + } + } +} diff --git a/contracts/test/foundry/marketplace/BatchMakerOrders.t.sol b/contracts/test/foundry/marketplace/BatchMakerOrders.t.sol new file mode 100644 index 00000000..35bb3570 --- /dev/null +++ b/contracts/test/foundry/marketplace/BatchMakerOrders.t.sol @@ -0,0 +1,333 @@ +/// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Murky (third-party) library is used to compute Merkle trees in Solidity +import {Merkle} from "murky/Merkle.sol"; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Errors and constants +import {MerkleProofTooLarge, MerkleProofInvalid} from "@hypercerts/marketplace/errors/SharedErrors.sol"; +import { + MERKLE_PROOF_PROOF_TOO_LARGE, + ORDER_HASH_PROOF_NOT_IN_MERKLE_TREE +} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; +import { + ONE_HUNDRED_PERCENT_IN_BP, + MAX_CALLDATA_PROOF_LENGTH +} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Helpers +import {EIP712MerkleTree} from "./utils/EIP712MerkleTree.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract BatchMakerOrdersTest is ProtocolBase { + uint256 private constant price = 1.2222 ether; // Fixed price of sale + EIP712MerkleTree private eip712MerkleTree; + + function setUp() public { + _setUp(); + _setUpUsers(); + eip712MerkleTree = new EIP712MerkleTree(looksRareProtocol); + } + + function testTakerBidMultipleOrdersSignedERC721(uint256 numberOrders, uint256 orderIndex) public { + _assertMerkleTreeAssumptions(numberOrders, orderIndex); + + mockERC721.batchMint(makerUser, numberOrders); + + OrderStructs.Maker[] memory makerAsks = _createBatchMakerAsks(numberOrders); + + (bytes memory signature, OrderStructs.MerkleTree memory merkleTree) = + eip712MerkleTree.sign(makerUserPK, makerAsks, orderIndex); + + OrderStructs.Maker memory makerAskToExecute = makerAsks[orderIndex]; + + // Verify validity + _assertValidMakerOrderWithMerkleTree(makerAskToExecute, signature, merkleTree); + + // Execute taker bid transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(_genericTakerOrder(), makerAskToExecute, signature, merkleTree); + + // Taker user has received the asset + assertEq(mockERC721.ownerOf(orderIndex), takerUser); + // Taker bid user pays the whole price + assertEq(address(takerUser).balance, _initialETHBalanceUser - price); + // Maker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq( + address(makerUser).balance, + _initialETHBalanceUser + (price * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP + ); + // No leftover in the balance of the contract + assertEq(address(looksRareProtocol).balance, 0); + // Verify the nonce is marked as executed + assertEq( + looksRareProtocol.userOrderNonce(makerUser, makerAskToExecute.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED + ); + } + + function testTakerAskMultipleOrdersSignedERC721(uint256 numberOrders, uint256 orderIndex) public { + _assertMerkleTreeAssumptions(numberOrders, orderIndex); + + mockERC721.batchMint(takerUser, numberOrders); + + OrderStructs.Maker[] memory makerBids = _createBatchMakerBids(numberOrders); + + (bytes memory signature, OrderStructs.MerkleTree memory merkleTree) = + eip712MerkleTree.sign(makerUserPK, makerBids, orderIndex); + + OrderStructs.Maker memory makerBidToExecute = makerBids[orderIndex]; + + // Verify validity + _assertValidMakerOrderWithMerkleTree(makerBidToExecute, signature, merkleTree); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(_genericTakerOrder(), makerBidToExecute, signature, merkleTree); + + // Maker user has received the asset + assertEq(mockERC721.ownerOf(orderIndex), makerUser); + // Maker bid user pays the whole price + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser - price); + // Taker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq( + weth.balanceOf(takerUser), + _initialWETHBalanceUser + (price * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP + ); + // Verify the nonce is marked as executed + assertEq( + looksRareProtocol.userOrderNonce(makerUser, makerBidToExecute.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED + ); + } + + function testTakerBidMultipleOrdersSignedERC721MerkleProofInvalid(uint256 numberOrders, uint256 orderIndex) + public + { + _assertMerkleTreeAssumptions(numberOrders, orderIndex); + + mockERC721.batchMint(makerUser, numberOrders); + + OrderStructs.Maker[] memory makerAsks = _createBatchMakerAsks(numberOrders); + + (bytes memory signature, OrderStructs.MerkleTree memory merkleTree) = + eip712MerkleTree.sign(makerUserPK, makerAsks, orderIndex); + + bytes32 tamperedRoot = bytes32(uint256(merkleTree.root) + 1); + merkleTree.root = tamperedRoot; + + OrderStructs.Maker memory makerAskToExecute = makerAsks[orderIndex]; + + // Verify invalidity of maker ask order + _assertMakerOrderReturnValidationCodeWithMerkleTree( + makerAskToExecute, signature, merkleTree, ORDER_HASH_PROOF_NOT_IN_MERKLE_TREE + ); + + vm.prank(takerUser); + vm.expectRevert(MerkleProofInvalid.selector); + looksRareProtocol.executeTakerBid{value: price}(_genericTakerOrder(), makerAskToExecute, signature, merkleTree); + } + + function testTakerAskMultipleOrdersSignedERC721MerkleProofInvalid(uint256 numberOrders, uint256 orderIndex) + public + { + _assertMerkleTreeAssumptions(numberOrders, orderIndex); + + mockERC721.batchMint(takerUser, numberOrders); + + OrderStructs.Maker[] memory makerBids = _createBatchMakerBids(numberOrders); + + (bytes memory signature, OrderStructs.MerkleTree memory merkleTree) = + eip712MerkleTree.sign(makerUserPK, makerBids, orderIndex); + + bytes32 tamperedRoot = bytes32(uint256(merkleTree.root) + 1); + merkleTree.root = tamperedRoot; + + OrderStructs.Maker memory makerBidToExecute = makerBids[orderIndex]; + + // Verify invalidity of maker bid order + _assertMakerOrderReturnValidationCodeWithMerkleTree( + makerBidToExecute, signature, merkleTree, ORDER_HASH_PROOF_NOT_IN_MERKLE_TREE + ); + + vm.prank(takerUser); + vm.expectRevert(MerkleProofInvalid.selector); + looksRareProtocol.executeTakerAsk(_genericTakerOrder(), makerBidToExecute, signature, merkleTree); + } + + function testTakerBidMultipleOrdersSignedERC721MerkleProofWrongPosition(uint256 numberOrders, uint256 orderIndex) + public + { + _assertMerkleTreeAssumptions(numberOrders, orderIndex); + + mockERC721.batchMint(makerUser, numberOrders); + + OrderStructs.Maker[] memory makerAsks = _createBatchMakerAsks(numberOrders); + + (bytes memory signature, OrderStructs.MerkleTree memory merkleTree) = + eip712MerkleTree.sign(makerUserPK, makerAsks, orderIndex); + + // Swap every node's position + OrderStructs.MerkleTreeNode[] memory proof = merkleTree.proof; + for (uint256 i; i < proof.length; i++) { + if (proof[i].position == OrderStructs.MerkleTreeNodePosition.Left) { + proof[i].position = OrderStructs.MerkleTreeNodePosition.Right; + } else { + proof[i].position = OrderStructs.MerkleTreeNodePosition.Left; + } + } + + OrderStructs.Maker memory makerAskToExecute = makerAsks[orderIndex]; + + // Verify invalidity of maker ask order + _assertMakerOrderReturnValidationCodeWithMerkleTree( + makerAskToExecute, signature, merkleTree, ORDER_HASH_PROOF_NOT_IN_MERKLE_TREE + ); + + vm.prank(takerUser); + vm.expectRevert(MerkleProofInvalid.selector); + looksRareProtocol.executeTakerBid{value: price}(_genericTakerOrder(), makerAskToExecute, signature, merkleTree); + } + + function testTakerAskMultipleOrdersSignedERC721MerkleProofWrongPosition(uint256 numberOrders, uint256 orderIndex) + public + { + _assertMerkleTreeAssumptions(numberOrders, orderIndex); + + mockERC721.batchMint(takerUser, numberOrders); + + OrderStructs.Maker[] memory makerBids = _createBatchMakerBids(numberOrders); + + (bytes memory signature, OrderStructs.MerkleTree memory merkleTree) = + eip712MerkleTree.sign(makerUserPK, makerBids, orderIndex); + + // Swap every node's position + OrderStructs.MerkleTreeNode[] memory proof = merkleTree.proof; + for (uint256 i; i < proof.length; i++) { + if (proof[i].position == OrderStructs.MerkleTreeNodePosition.Left) { + proof[i].position = OrderStructs.MerkleTreeNodePosition.Right; + } else { + proof[i].position = OrderStructs.MerkleTreeNodePosition.Left; + } + } + + OrderStructs.Maker memory makerBidToExecute = makerBids[orderIndex]; + + // Verify invalidity of maker bid order + _assertMakerOrderReturnValidationCodeWithMerkleTree( + makerBidToExecute, signature, merkleTree, ORDER_HASH_PROOF_NOT_IN_MERKLE_TREE + ); + + vm.prank(takerUser); + vm.expectRevert(MerkleProofInvalid.selector); + looksRareProtocol.executeTakerAsk(_genericTakerOrder(), makerBidToExecute, signature, merkleTree); + } + + function testTakerBidRevertsIfProofTooLarge() public { + uint256 testProofLengthUpTo = MAX_CALLDATA_PROOF_LENGTH + 3; + mockERC721.batchMint(makerUser, 2 ** testProofLengthUpTo); + + // Keep it reasonably large + for (uint256 proofLength = MAX_CALLDATA_PROOF_LENGTH + 1; proofLength <= testProofLengthUpTo; proofLength++) { + uint256 numberOrders = 2 ** proofLength; + uint256 orderIndex = numberOrders - 1; + + OrderStructs.Maker[] memory makerAsks = _createBatchMakerAsks(numberOrders); + + (bytes memory signature, OrderStructs.MerkleTree memory merkleTree) = + eip712MerkleTree.sign(makerUserPK, makerAsks, orderIndex); + + OrderStructs.Maker memory makerAskToExecute = makerAsks[orderIndex]; + + // Verify validity + _assertMakerOrderReturnValidationCodeWithMerkleTree( + makerAskToExecute, signature, merkleTree, MERKLE_PROOF_PROOF_TOO_LARGE + ); + + vm.prank(takerUser); + vm.expectRevert(abi.encodeWithSelector(MerkleProofTooLarge.selector, proofLength)); + looksRareProtocol.executeTakerBid{value: price}( + _genericTakerOrder(), makerAskToExecute, signature, merkleTree + ); + } + } + + function testTakerAskRevertsIfProofTooLarge() public { + uint256 testProofLengthUpTo = MAX_CALLDATA_PROOF_LENGTH + 3; + mockERC721.batchMint(takerUser, 2 ** testProofLengthUpTo); + + // Keep it reasonably large + for (uint256 proofLength = MAX_CALLDATA_PROOF_LENGTH + 1; proofLength <= testProofLengthUpTo; proofLength++) { + uint256 numberOrders = 2 ** proofLength; + uint256 orderIndex = numberOrders - 1; + + OrderStructs.Maker[] memory makerBids = _createBatchMakerBids(numberOrders); + + (bytes memory signature, OrderStructs.MerkleTree memory merkleTree) = + eip712MerkleTree.sign(makerUserPK, makerBids, orderIndex); + + OrderStructs.Maker memory makerBidToExecute = makerBids[orderIndex]; + + // Verify validity + _assertMakerOrderReturnValidationCodeWithMerkleTree( + makerBidToExecute, signature, merkleTree, MERKLE_PROOF_PROOF_TOO_LARGE + ); + + vm.prank(takerUser); + vm.expectRevert(abi.encodeWithSelector(MerkleProofTooLarge.selector, proofLength)); + looksRareProtocol.executeTakerBid{value: price}( + _genericTakerOrder(), makerBidToExecute, signature, merkleTree + ); + } + } + + function _createBatchMakerAsks(uint256 numberOrders) private view returns (OrderStructs.Maker[] memory makerAsks) { + makerAsks = new OrderStructs.Maker[](numberOrders); + for (uint256 i; i < numberOrders; i++) { + makerAsks[i] = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: i, // incremental + collection: address(mockERC721), + currency: ETH, + signer: makerUser, + price: price, + itemId: i + }); + } + } + + function _createBatchMakerBids(uint256 numberOrders) private view returns (OrderStructs.Maker[] memory makerBids) { + makerBids = new OrderStructs.Maker[](numberOrders); + for (uint256 i; i < numberOrders; i++) { + makerBids[i] = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: i, // incremental + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemId: i + }); + } + } + + function _assertMerkleTreeAssumptions(uint256 numberOrders, uint256 orderIndex) private pure { + vm.assume(numberOrders > 0 && numberOrders <= 2 ** MAX_CALLDATA_PROOF_LENGTH); + vm.assume(orderIndex < numberOrders); + } +} diff --git a/contracts/test/foundry/marketplace/BatchOrderTypehashRegistry.t.sol b/contracts/test/foundry/marketplace/BatchOrderTypehashRegistry.t.sol new file mode 100644 index 00000000..e44c2af4 --- /dev/null +++ b/contracts/test/foundry/marketplace/BatchOrderTypehashRegistry.t.sol @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {Test} from "forge-std/Test.sol"; + +import {BatchOrderTypehashRegistry} from "@hypercerts/marketplace/BatchOrderTypehashRegistry.sol"; + +// Shared errors +import {MerkleProofTooLarge} from "@hypercerts/marketplace/errors/SharedErrors.sol"; + +contract BatchOrderTypehashRegistryInheriter is BatchOrderTypehashRegistry { + function getBatchOrderTypehash(uint256 height) external pure returns (bytes32 typehash) { + return _getBatchOrderTypehash(height); + } +} + +contract BatchOrderTypehashRegistryTest is Test { + function testHash() public { + BatchOrderTypehashRegistryInheriter registry = new BatchOrderTypehashRegistryInheriter(); + bytes32 root = hex"6942000000000000000000000000000000000000000000000000000000000000"; + assertEq( + registry.hashBatchOrder(root, 1), hex"8f0c85a215cff55fe39cf62ee7a1e0b5205a8ade02ff12ffee9ece02d626ffc3" + ); + assertEq( + registry.hashBatchOrder(root, 2), hex"f04a7d8a4688cf084b00b51ed583de7e5a19e59b073635e00a45a474899e89ec" + ); + assertEq( + registry.hashBatchOrder(root, 3), hex"56ef3bb8c564d19cfe494776934aa5e7ed84c41ae609d5f10e726f76281dd30b" + ); + assertEq( + registry.hashBatchOrder(root, 4), hex"2b0cb021eacab73e36d9ac9a04c1cf58589ff5bb4dc0d9b88ec29f67358ca812" + ); + assertEq( + registry.hashBatchOrder(root, 5), hex"253b3cc8d591a8b01fc8967cefe3ac3d0e078b884d96aa589f1ffd4536921bbb" + ); + assertEq( + registry.hashBatchOrder(root, 6), hex"7e4c4a2c5806fc4765bca325e8b78ccf9633bd1c7643144a56210293daefcbca" + ); + assertEq( + registry.hashBatchOrder(root, 7), hex"e8e39cebe7137f0fadf6b88ba611044ac79c0168444eab66ca53bddd0c5fb717" + ); + assertEq( + registry.hashBatchOrder(root, 8), hex"6e02f123509255ed381c7552de5e2ac1c1ea401a23e026e2452f01b70564affb" + ); + assertEq( + registry.hashBatchOrder(root, 9), hex"7eeb4a7fe4655841fdd66f8ecfcf6cd261d50eafabbaebb10f63f5fe84ddddc9" + ); + assertEq( + registry.hashBatchOrder(root, 10), hex"a96dee8b7b88deda5d50b55f641ca08c1ee00825eeb1db7a324f392fa0b8bb83" + ); + } + + function testGetTypehash() public { + BatchOrderTypehashRegistryInheriter registry = new BatchOrderTypehashRegistryInheriter(); + bytes memory makerOrderString = bytes( + "Maker(" "uint8 quoteType," "uint256 globalNonce," "uint256 subsetNonce," "uint256 orderNonce," + "uint256 strategyId," "uint8 collectionType," "address collection," "address currency," "address signer," + "uint256 startTime," "uint256 endTime," "uint256 price," "uint256[] itemIds," "uint256[] amounts," + "bytes additionalParameters" ")" + ); + + assertEq( + registry.getBatchOrderTypehash(1), + keccak256(bytes.concat(bytes("BatchOrder(Maker[2] tree)"), makerOrderString)) + ); + + assertEq( + registry.getBatchOrderTypehash(2), + keccak256(bytes.concat(bytes("BatchOrder(Maker[2][2] tree)"), makerOrderString)) + ); + + assertEq( + registry.getBatchOrderTypehash(3), + keccak256(bytes.concat(bytes("BatchOrder(Maker[2][2][2] tree)"), makerOrderString)) + ); + + assertEq( + registry.getBatchOrderTypehash(4), + keccak256(bytes.concat(bytes("BatchOrder(Maker[2][2][2][2] tree)"), makerOrderString)) + ); + + assertEq( + registry.getBatchOrderTypehash(5), + keccak256(bytes.concat(bytes("BatchOrder(Maker[2][2][2][2][2] tree)"), makerOrderString)) + ); + + assertEq( + registry.getBatchOrderTypehash(6), + keccak256(bytes.concat(bytes("BatchOrder(Maker[2][2][2][2][2][2] tree)"), makerOrderString)) + ); + + assertEq( + registry.getBatchOrderTypehash(7), + keccak256(bytes.concat(bytes("BatchOrder(Maker[2][2][2][2][2][2][2] tree)"), makerOrderString)) + ); + + assertEq( + registry.getBatchOrderTypehash(8), + keccak256(bytes.concat(bytes("BatchOrder(Maker[2][2][2][2][2][2][2][2] tree)"), makerOrderString)) + ); + + assertEq( + registry.getBatchOrderTypehash(9), + keccak256(bytes.concat(bytes("BatchOrder(Maker[2][2][2][2][2][2][2][2][2] tree)"), makerOrderString)) + ); + + assertEq( + registry.getBatchOrderTypehash(10), + keccak256(bytes.concat(bytes("BatchOrder(Maker[2][2][2][2][2][2][2][2][2][2] tree)"), makerOrderString)) + ); + } + + function testGetTypehashMerkleProofTooLarge(uint256 height) public { + vm.assume(height > 10); + + BatchOrderTypehashRegistryInheriter registry = new BatchOrderTypehashRegistryInheriter(); + vm.expectRevert(abi.encodeWithSelector(MerkleProofTooLarge.selector, height)); + registry.getBatchOrderTypehash(height); + } +} diff --git a/contracts/test/foundry/marketplace/BundleTransactions.t.sol b/contracts/test/foundry/marketplace/BundleTransactions.t.sol new file mode 100644 index 00000000..62ffccf9 --- /dev/null +++ b/contracts/test/foundry/marketplace/BundleTransactions.t.sol @@ -0,0 +1,260 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Other tests +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +contract BundleTransactionsTest is ProtocolBase { + function setUp() public { + _setUp(); + } + + function testTakerAskERC721BundleNoRoyalties() public { + _setUpUsers(); + uint256 numberItemsInBundle = 5; + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAskWithBundle(address(mockERC721), address(weth), numberItemsInBundle); + + // Sign the order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Verify validity + _assertValidMakerOrder(makerBid, signature); + + // Mint the items + mockERC721.batchMint(takerUser, makerBid.itemIds); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + _assertMockERC721Ownership(makerBid.itemIds, makerUser); + + _assertSuccessfulTakerAskNoRoyalties(makerBid); + } + + function testTakerAskERC1155BundleNoRoyalties() public { + _setUpUsers(); + uint256 numberItemsInBundle = 5; + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAskWithBundle(address(mockERC1155), address(weth), numberItemsInBundle); + + // Sign the order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Verify validity + _assertValidMakerOrder(makerBid, signature); + + // Mint the items + mockERC1155.batchMint(takerUser, makerBid.itemIds, makerBid.amounts); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + for (uint256 i; i < makerBid.itemIds.length; i++) { + // Maker user has received all the assets in the bundle + assertEq(mockERC1155.balanceOf(makerUser, makerBid.itemIds[i]), makerBid.amounts[i]); + } + + _assertSuccessfulTakerAskNoRoyalties(makerBid); + } + + function testTakerAskERC721BundleWithRoyaltiesFromRegistry() public { + _setUpUsers(); + _setupRegistryRoyalties(address(mockERC721), _standardRoyaltyFee); + uint256 numberItemsInBundle = 5; + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAskWithBundle(address(mockERC721), address(weth), numberItemsInBundle); + + uint256 price = makerBid.price; + + // Sign the order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Verify validity + _assertValidMakerOrder(makerBid, signature); + + // Mint the items + mockERC721.batchMint(takerUser, makerBid.itemIds); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + _assertMockERC721Ownership(makerBid.itemIds, makerUser); + + // Maker bid user pays the whole price + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser - price); + // Royalty recipient receives royalties + assertEq( + weth.balanceOf(_royaltyRecipient), + _initialWETHBalanceRoyaltyRecipient + (price * _standardRoyaltyFee) / ONE_HUNDRED_PERCENT_IN_BP + ); + assertEq( + weth.balanceOf(address(protocolFeeRecipient)), + (price * _standardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP, + "ProtocolFeeRecipient should receive protocol fee" + ); + // Taker ask user receives 99.5% of the whole price + assertEq( + weth.balanceOf(takerUser), + _initialWETHBalanceUser + (price * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP + ); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerBid.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + function testTakerBidERC721BundleNoRoyalties() public { + _setUpUsers(); + uint256 numberItemsInBundle = 5; + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBidWithBundle(address(mockERC721), numberItemsInBundle); + + uint256 price = makerAsk.price; + + // Mint the items and sign the order + mockERC721.batchMint(makerUser, makerAsk.itemIds); + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Verify validity + _assertValidMakerOrder(makerAsk, signature); + + // Execute taker bid transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + _assertMockERC721Ownership(makerAsk.itemIds, takerUser); + + _assertSuccessfulTakerBidNoRoyalties(makerAsk); + } + + function testTakerBidERC1155BundleNoRoyalties() public { + _setUpUsers(); + uint256 numberItemsInBundle = 5; + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBidWithBundle(address(mockERC1155), numberItemsInBundle); + + uint256 price = makerAsk.price; + + // Mint the items and sign the order + mockERC1155.batchMint(makerUser, makerAsk.itemIds, makerAsk.amounts); + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Verify validity + _assertValidMakerOrder(makerAsk, signature); + + // Execute taker bid transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + for (uint256 i; i < makerAsk.itemIds.length; i++) { + // Taker user has received all the assets in the bundle + assertEq(mockERC1155.balanceOf(takerUser, makerAsk.itemIds[i]), makerAsk.amounts[i]); + } + + _assertSuccessfulTakerBidNoRoyalties(makerAsk); + } + + function testTakerBidERC721BundleWithRoyaltiesFromRegistry() public { + _setUpUsers(); + _setupRegistryRoyalties(address(mockERC721), _standardRoyaltyFee); + uint256 numberItemsInBundle = 5; + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBidWithBundle(address(mockERC721), numberItemsInBundle); + + uint256 price = makerAsk.price; + + // Mint the items and sign the order + mockERC721.batchMint(makerUser, makerAsk.itemIds); + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Verify validity + _assertValidMakerOrder(makerAsk, signature); + + // Execute taker bid transaction + vm.prank(takerUser); + + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + _assertMockERC721Ownership(makerAsk.itemIds, takerUser); + + // Taker bid user pays the whole price + assertEq(address(takerUser).balance, _initialETHBalanceUser - price); + // Royalty recipient receives the royalties + assertEq( + address(_royaltyRecipient).balance, + _initialETHBalanceRoyaltyRecipient + (price * _standardRoyaltyFee) / ONE_HUNDRED_PERCENT_IN_BP + ); + assertEq( + address(protocolFeeRecipient).balance, + (price * _standardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP, + "ProtocolFeeRecipient should receive protocol fee" + ); + // Maker ask user receives 99.5% of the whole price + assertEq( + address(makerUser).balance, + _initialETHBalanceUser + (price * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP + ); + // No leftover in the balance of the contract + assertEq(address(looksRareProtocol).balance, 0); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerAsk.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + function _assertSuccessfulTakerAskNoRoyalties(OrderStructs.Maker memory makerBid) private { + uint256 price = makerBid.price; + + // Maker bid user pays the whole price + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser - price); + // Royalty recipient receives no royalty + assertEq(weth.balanceOf(_royaltyRecipient), _initialWETHBalanceRoyaltyRecipient); + assertEq( + weth.balanceOf(address(protocolFeeRecipient)), + (price * _minTotalFeeBp) / ONE_HUNDRED_PERCENT_IN_BP, + "ProtocolFeeRecipient should receive protocol fee" + ); + // Taker ask user receives 99.5% of the whole price (no royalties are paid) + assertEq( + weth.balanceOf(takerUser), + _initialWETHBalanceUser + (price * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP + ); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerBid.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + function _assertSuccessfulTakerBidNoRoyalties(OrderStructs.Maker memory makerAsk) private { + uint256 price = makerAsk.price; + + // Taker bid user pays the whole price + assertEq(address(takerUser).balance, _initialETHBalanceUser - price); + // Royalty recipient receives no royalty + assertEq(address(_royaltyRecipient).balance, _initialETHBalanceRoyaltyRecipient); + assertEq( + address(protocolFeeRecipient).balance, + (price * _minTotalFeeBp) / ONE_HUNDRED_PERCENT_IN_BP, + "ProtocolFeeRecipient should receive protocol fee" + ); + // Maker ask user receives 99.5% of the whole price (no royalties are paid) + assertEq( + address(makerUser).balance, + _initialETHBalanceUser + (price * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP + ); + // No leftover in the balance of the contract + assertEq(address(looksRareProtocol).balance, 0); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerAsk.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } +} diff --git a/contracts/test/foundry/marketplace/CreatorFeeManagerWithRebates.t.sol b/contracts/test/foundry/marketplace/CreatorFeeManagerWithRebates.t.sol new file mode 100644 index 00000000..93a552db --- /dev/null +++ b/contracts/test/foundry/marketplace/CreatorFeeManagerWithRebates.t.sol @@ -0,0 +1,233 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {IERC721} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC721.sol"; + +import {CreatorFeeManagerWithRebates} from "@hypercerts/marketplace/CreatorFeeManagerWithRebates.sol"; + +// Libraries and interfaces +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; +import {ICreatorFeeManager} from "@hypercerts/marketplace/interfaces/ICreatorFeeManager.sol"; +import {IExecutionManager} from "@hypercerts/marketplace/interfaces/IExecutionManager.sol"; + +// Shared errors +import {BUNDLE_ERC2981_NOT_SUPPORTED} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +contract CreatorFeeManagerWithRebatesTest is ProtocolBase { + function setUp() public { + _setUp(); + CreatorFeeManagerWithRebates creatorFeeManager = new CreatorFeeManagerWithRebates(address(royaltyFeeRegistry)); + vm.prank(_owner); + looksRareProtocol.updateCreatorFeeManager(address(creatorFeeManager)); + orderValidator.deriveProtocolParameters(); + } + + function _setUpRoyaltiesRegistry(uint256 fee) private { + vm.prank(_owner); + royaltyFeeRegistry.updateRoyaltyInfoForCollection( + address(mockERC721), _royaltyRecipient, _royaltyRecipient, fee + ); + } + + function _testCreatorFeeRebatesArePaid(address erc721) private { + _setUpUsers(); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(erc721, address(weth)); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + if (erc721 == address(mockERC721)) { + // Adjust royalties + _setUpRoyaltiesRegistry(_standardRoyaltyFee); + // Mint asset + mockERC721.mint(takerUser, makerBid.itemIds[0]); + } else if (erc721 == address(mockERC721WithRoyalties)) { + // Adjust ERC721 with royalties + mockERC721WithRoyalties.addCustomRoyaltyInformationForTokenId( + makerBid.itemIds[0], _royaltyRecipient, _standardRoyaltyFee + ); + // Mint asset + mockERC721WithRoyalties.mint(takerUser, makerBid.itemIds[0]); + } + + _assertValidMakerOrder(makerBid, signature); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // Verify ownership is transferred + assertEq(IERC721(erc721).ownerOf(makerBid.itemIds[0]), makerUser); + _assertSuccessfulTakerAsk(makerBid); + } + + function _testCreatorFeeRebatesArePaidForBundles(address erc721) private { + _setUpUsers(); + _setUpRoyaltiesRegistry(_standardRoyaltyFee); + + // Parameters + uint256 numberItemsInBundle = 5; + + // Create order + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAskWithBundle(erc721, address(weth), numberItemsInBundle); + + if (erc721 == address(mockERC721)) { + // Adjust royalties + _setUpRoyaltiesRegistry(_standardRoyaltyFee); + // Mint the items + mockERC721.batchMint(takerUser, makerBid.itemIds); + } else if (erc721 == address(mockERC721WithRoyalties)) { + // Adjust ERC721 with royalties + for (uint256 i; i < makerBid.itemIds.length; i++) { + mockERC721WithRoyalties.addCustomRoyaltyInformationForTokenId( + makerBid.itemIds[i], _royaltyRecipient, _standardRoyaltyFee + ); + } + // Mint the items + mockERC721WithRoyalties.batchMint(takerUser, makerBid.itemIds); + } + + // Sign the order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + _assertValidMakerOrder(makerBid, signature); + + // Taker user actions + vm.prank(takerUser); + + // Execute taker ask transaction + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // Verify ownership is transferred + for (uint256 i; i < makerBid.itemIds.length; i++) { + // Maker user has received all the assets in the bundle + assertEq(IERC721(erc721).ownerOf(makerBid.itemIds[i]), makerUser); + } + _assertSuccessfulTakerAsk(makerBid); + } + + function testCreatorRebatesArePaidForRoyaltyFeeManager() public { + _testCreatorFeeRebatesArePaid(address(mockERC721)); + } + + function testCreatorRebatesArePaidForERC2981() public { + _testCreatorFeeRebatesArePaid(address(mockERC721WithRoyalties)); + } + + function testCreatorRebatesArePaidForRoyaltyFeeManagerWithBundles() public { + _testCreatorFeeRebatesArePaidForBundles(address(mockERC721)); + } + + function testCreatorRoyaltiesGetPaidForERC2981WithBundles() public { + _testCreatorFeeRebatesArePaidForBundles(address(mockERC721WithRoyalties)); + } + + function testCreatorRoyaltiesRevertForEIP2981WithBundlesIfInfoDiffer() public { + _setUpUsers(); + + uint256 numberItemsInBundle = 5; + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAskWithBundle(address(mockERC721WithRoyalties), address(weth), numberItemsInBundle); + + // Sign the order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Mint the items + mockERC721WithRoyalties.batchMint(takerUser, makerBid.itemIds); + + _assertValidMakerOrder(makerBid, signature); + + /** + * Different recipient + */ + + // Adjust ERC721 with royalties + for (uint256 i; i < makerBid.itemIds.length; i++) { + mockERC721WithRoyalties.addCustomRoyaltyInformationForTokenId( + makerBid.itemIds[i], i == 0 ? _royaltyRecipient : address(50), 50 + ); + } + + _assertMakerOrderReturnValidationCode(makerBid, signature, BUNDLE_ERC2981_NOT_SUPPORTED); + + vm.prank(takerUser); + vm.expectRevert( + abi.encodeWithSelector( + ICreatorFeeManager.BundleEIP2981NotAllowed.selector, address(mockERC721WithRoyalties) + ) + ); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testCreatorRoyaltiesRevertForEIP2981WithBundlesIfAtLeastOneCallReverts(uint256 revertIndex) public { + _setUpUsers(); + + uint256 numberItemsInBundle = 5; + vm.assume(revertIndex < numberItemsInBundle); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAskWithBundle(address(mockERC721WithRoyalties), address(weth), numberItemsInBundle); + + // Sign the order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Mint the items + mockERC721WithRoyalties.batchMint(takerUser, makerBid.itemIds); + + _assertValidMakerOrder(makerBid, signature); + + // Adjust ERC721 with royalties + for (uint256 i; i < makerBid.itemIds.length; i++) { + mockERC721WithRoyalties.addCustomRoyaltyInformationForTokenId( + makerBid.itemIds[i], + _royaltyRecipient, + // if greater than 10,000, will revert in royaltyInfo + i == revertIndex ? 10_001 : 50 + ); + } + + _assertMakerOrderReturnValidationCode(makerBid, signature, BUNDLE_ERC2981_NOT_SUPPORTED); + + vm.prank(takerUser); + vm.expectRevert( + abi.encodeWithSelector( + ICreatorFeeManager.BundleEIP2981NotAllowed.selector, address(mockERC721WithRoyalties) + ) + ); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function _assertSuccessfulTakerAsk(OrderStructs.Maker memory makerBid) private { + uint256 price = makerBid.price; + + // Maker bid user pays the whole price + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser - price); + assertEq( + weth.balanceOf(address(protocolFeeRecipient)), + (price * _standardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP, + "Protocol fee recipient should receive 0.5% of the whole price" + ); + assertEq( + weth.balanceOf(takerUser), + _initialWETHBalanceUser + (price * 9900) / ONE_HUNDRED_PERCENT_IN_BP, + "Taker ask user should receive 99% of the whole price" + ); + assertEq( + weth.balanceOf(_royaltyRecipient), + _initialWETHBalanceRoyaltyRecipient + (price * 50) / ONE_HUNDRED_PERCENT_IN_BP, + "Royalty recipient receives 0.5% of the whole price" + ); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerBid.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } +} diff --git a/contracts/test/foundry/marketplace/CreatorFeeManagerWithRoyalties.t.sol b/contracts/test/foundry/marketplace/CreatorFeeManagerWithRoyalties.t.sol new file mode 100644 index 00000000..3ba84222 --- /dev/null +++ b/contracts/test/foundry/marketplace/CreatorFeeManagerWithRoyalties.t.sol @@ -0,0 +1,350 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries and interfaces +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; +import {ICreatorFeeManager} from "@hypercerts/marketplace/interfaces/ICreatorFeeManager.sol"; +import {IExecutionManager} from "@hypercerts/marketplace/interfaces/IExecutionManager.sol"; + +// Core contract +import {CreatorFeeManagerWithRoyalties} from "@hypercerts/marketplace/CreatorFeeManagerWithRoyalties.sol"; + +// Shared errors +import { + BUNDLE_ERC2981_NOT_SUPPORTED, + CREATOR_FEE_TOO_HIGH +} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +contract CreatorFeeManagerWithRoyaltiesTest is ProtocolBase { + CreatorFeeManagerWithRoyalties public creatorFeeManagerWithRoyalties; + + // New protocol fee + uint16 internal constant _newProtocolFee = 200; + + // New creator royalty fee + uint256 internal constant _newCreatorRoyaltyFee = 300; + + function _setUpRoyaltiesRegistry(uint256 fee) internal { + vm.prank(_owner); + royaltyFeeRegistry.updateRoyaltyInfoForCollection( + address(mockERC721), _royaltyRecipient, _royaltyRecipient, fee + ); + } + + function setUp() public { + _setUp(); + creatorFeeManagerWithRoyalties = new CreatorFeeManagerWithRoyalties(address(royaltyFeeRegistry)); + vm.startPrank(_owner); + looksRareProtocol.updateCreatorFeeManager(address(creatorFeeManagerWithRoyalties)); + // Set up 2% as protocol fee, which is now equal to minimum fee + looksRareProtocol.updateStrategy(0, true, _newProtocolFee, _newProtocolFee); + vm.stopPrank(); + + // Adjust for new creator fee manager + orderValidator.deriveProtocolParameters(); + } + + function testCreatorRoyaltiesGetPaidForRoyaltyFeeManager() public { + _setUpUsers(); + + // Adjust royalties + _setUpRoyaltiesRegistry(_newCreatorRoyaltyFee); + + (OrderStructs.Maker memory makerBid,) = _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Mint asset + mockERC721.mint(takerUser, makerBid.itemIds[0]); + + _assertValidMakerOrder(makerBid, signature); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(_genericTakerOrder(), makerBid, signature, _EMPTY_MERKLE_TREE); + + // Taker user has received the asset + assertEq(mockERC721.ownerOf(makerBid.itemIds[0]), makerUser); + _assertSuccessfulTakerAsk(makerBid); + } + + function testCreatorRoyaltiesGetPaidForERC2981() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerBid,) = + _createMockMakerBidAndTakerAsk(address(mockERC721WithRoyalties), address(weth)); + + // Adjust ERC721 with royalties + mockERC721WithRoyalties.addCustomRoyaltyInformationForTokenId( + makerBid.itemIds[0], _royaltyRecipient, _newCreatorRoyaltyFee + ); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Mint asset + mockERC721WithRoyalties.mint(takerUser, makerBid.itemIds[0]); + + _assertValidMakerOrder(makerBid, signature); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(_genericTakerOrder(), makerBid, signature, _EMPTY_MERKLE_TREE); + + // Taker user has received the asset + assertEq(mockERC721WithRoyalties.ownerOf(makerBid.itemIds[0]), makerUser); + _assertSuccessfulTakerAsk(makerBid); + } + + function testCreatorRoyaltiesGetPaidForRoyaltyFeeManagerWithBundles() public { + _setUpUsers(); + + // Adjust royalties + _setUpRoyaltiesRegistry(_newCreatorRoyaltyFee); + + uint256 numberItemsInBundle = 5; + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAskWithBundle(address(mockERC721), address(weth), numberItemsInBundle); + + // Sign the order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Mint the items + mockERC721.batchMint(takerUser, makerBid.itemIds); + + // Check order validity + _assertValidMakerOrder(makerBid, signature); + + // Taker user actions + vm.prank(takerUser); + + // Execute taker ask transaction + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + _assertMockERC721Ownership(makerBid.itemIds, makerUser); + + _assertSuccessfulTakerAskBundle(makerBid); + } + + function testCreatorRoyaltiesGetPaidForERC2981WithBundles() public { + _setUpUsers(); + + uint256 numberItemsInBundle = 5; + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAskWithBundle(address(mockERC721WithRoyalties), address(weth), numberItemsInBundle); + + // Sign the order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Mint the items + mockERC721WithRoyalties.batchMint(takerUser, makerBid.itemIds); + + // Adjust ERC721 with royalties + for (uint256 i; i < makerBid.itemIds.length; i++) { + mockERC721WithRoyalties.addCustomRoyaltyInformationForTokenId( + makerBid.itemIds[i], _royaltyRecipient, _newCreatorRoyaltyFee + ); + } + + _assertValidMakerOrder(makerBid, signature); + + // Taker user actions + vm.prank(takerUser); + + // Execute taker ask transaction + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulTakerAskBundle(makerBid); + } + + function testCreatorRoyaltiesRevertForEIP2981WithBundlesIfInfoDiffer() public { + _setUpUsers(); + + uint256 numberItemsInBundle = 5; + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAskWithBundle(address(mockERC721WithRoyalties), address(weth), numberItemsInBundle); + + // Sign the order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Mint the items + mockERC721WithRoyalties.batchMint(takerUser, makerBid.itemIds); + + /** + * 1. Different fee structure but same recipient + */ + + // Adjust ERC721 with royalties + for (uint256 i; i < makerBid.itemIds.length; i++) { + mockERC721WithRoyalties.addCustomRoyaltyInformationForTokenId( + makerBid.itemIds[i], + _royaltyRecipient, + _newCreatorRoyaltyFee - i // It is not equal + ); + } + + _assertMakerOrderReturnValidationCode(makerBid, signature, BUNDLE_ERC2981_NOT_SUPPORTED); + + // Taker user action should revert + vm.prank(takerUser); + vm.expectRevert( + abi.encodeWithSelector( + ICreatorFeeManager.BundleEIP2981NotAllowed.selector, address(mockERC721WithRoyalties) + ) + ); + + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + /** + * 2. Same fee structure but different recipient + */ + // Adjust ERC721 with royalties + for (uint256 i; i < makerBid.itemIds.length; i++) { + mockERC721WithRoyalties.addCustomRoyaltyInformationForTokenId( + makerBid.itemIds[i], i == 0 ? _royaltyRecipient : address(50), _newCreatorRoyaltyFee + ); + } + + _assertMakerOrderReturnValidationCode(makerBid, signature, BUNDLE_ERC2981_NOT_SUPPORTED); + + vm.prank(takerUser); + vm.expectRevert( + abi.encodeWithSelector( + ICreatorFeeManager.BundleEIP2981NotAllowed.selector, address(mockERC721WithRoyalties) + ) + ); + + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testCreatorRoyaltiesRevertForEIP2981WithBundlesIfAtLeastOneCallReverts(uint256 revertIndex) public { + _setUpUsers(); + + uint256 numberItemsInBundle = 5; + vm.assume(revertIndex < numberItemsInBundle); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAskWithBundle(address(mockERC721WithRoyalties), address(weth), numberItemsInBundle); + + // Sign the order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Mint the items + mockERC721WithRoyalties.batchMint(takerUser, makerBid.itemIds); + + // Adjust ERC721 with royalties + for (uint256 i; i < makerBid.itemIds.length; i++) { + mockERC721WithRoyalties.addCustomRoyaltyInformationForTokenId( + makerBid.itemIds[i], + _royaltyRecipient, + // if greater than 10,000, will revert in royaltyInfo + i == revertIndex ? 10_001 : _newCreatorRoyaltyFee + ); + } + + _assertMakerOrderReturnValidationCode(makerBid, signature, BUNDLE_ERC2981_NOT_SUPPORTED); + + // Taker user action should revert + vm.prank(takerUser); + vm.expectRevert( + abi.encodeWithSelector( + ICreatorFeeManager.BundleEIP2981NotAllowed.selector, address(mockERC721WithRoyalties) + ) + ); + + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testCreatorRoyaltiesRevertIfFeeHigherThanLimit() public { + _setUpUsers(); + uint256 _creatorRoyaltyFeeTooHigh = looksRareProtocol.maxCreatorFeeBp() + 1; + + // Adjust royalties + _setUpRoyaltiesRegistry(_creatorRoyaltyFeeTooHigh); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Mint asset + mockERC721.mint(takerUser, makerBid.itemIds[0]); + + _assertMakerOrderReturnValidationCode(makerBid, signature, CREATOR_FEE_TOO_HIGH); + + vm.expectRevert(IExecutionManager.CreatorFeeBpTooHigh.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // 2. Maker ask + + // Mint asset + mockERC721.mint(makerUser, 1); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + // The itemId changes as it is already minted before + makerAsk.itemIds[0] = 1; + + signature = _signMakerOrder(makerAsk, makerUserPK); + + _assertMakerOrderReturnValidationCode(makerAsk, signature, CREATOR_FEE_TOO_HIGH); + + vm.expectRevert(IExecutionManager.CreatorFeeBpTooHigh.selector); + vm.prank(takerUser); + + looksRareProtocol.executeTakerBid{value: 1 ether}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function _assertSuccessfulTakerAsk(OrderStructs.Maker memory makerBid) private { + uint256 price = makerBid.price; + + // Maker bid user pays the whole price + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser - price); + assertEq( + weth.balanceOf(address(protocolFeeRecipient)), + (price * _newProtocolFee) / ONE_HUNDRED_PERCENT_IN_BP, + "ProtocolFeeRecipient should receive 2% of the whole price" + ); + // Taker ask user receives 95% of the whole price + assertEq(weth.balanceOf(takerUser), _initialWETHBalanceUser + (price * 9500) / ONE_HUNDRED_PERCENT_IN_BP); + // Royalty recipient receives 3% of the whole price + assertEq( + weth.balanceOf(_royaltyRecipient), + _initialWETHBalanceRoyaltyRecipient + (price * _newCreatorRoyaltyFee) / ONE_HUNDRED_PERCENT_IN_BP + ); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerBid.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + function _assertSuccessfulTakerAskBundle(OrderStructs.Maker memory makerBid) private { + uint256 price = makerBid.price; + + // Maker bid user pays the whole price + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser - price); + // Royalty recipient receives royalties + assertEq( + weth.balanceOf(_royaltyRecipient), + _initialWETHBalanceRoyaltyRecipient + (price * _newCreatorRoyaltyFee) / ONE_HUNDRED_PERCENT_IN_BP + ); + assertEq( + weth.balanceOf(address(protocolFeeRecipient)), + (price * _newProtocolFee) / ONE_HUNDRED_PERCENT_IN_BP, + "ProtocolFeeRecipient should receive protocol fee" + ); + // Taker ask user receives 95% of the whole price + assertEq(weth.balanceOf(takerUser), _initialWETHBalanceUser + (price * 9500) / ONE_HUNDRED_PERCENT_IN_BP); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerBid.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } +} diff --git a/contracts/test/foundry/marketplace/CurrencyManager.t.sol b/contracts/test/foundry/marketplace/CurrencyManager.t.sol new file mode 100644 index 00000000..8c410dca --- /dev/null +++ b/contracts/test/foundry/marketplace/CurrencyManager.t.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {IOwnableTwoSteps} from "@looksrare/contracts-libs/contracts/interfaces/IOwnableTwoSteps.sol"; + +// Core contracts +import {CurrencyManager, ICurrencyManager} from "@hypercerts/marketplace/CurrencyManager.sol"; + +// Other mocks and utils +import {TestHelpers} from "./utils/TestHelpers.sol"; +import {TestParameters} from "./utils/TestParameters.sol"; +import {MockERC20} from "../../mock/MockERC20.sol"; + +contract CurrencyManagerTest is TestHelpers, TestParameters, ICurrencyManager { + CurrencyManager private currencyManager; + MockERC20 private mockERC20; + + function setUp() public asPrankedUser(_owner) { + currencyManager = new CurrencyManager(_owner); + mockERC20 = new MockERC20(); + } + + function testUpdateCurrencyStatus() public asPrankedUser(_owner) { + // Set to true + vm.expectEmit(true, false, false, true); + emit CurrencyStatusUpdated(address(mockERC20), true); + currencyManager.updateCurrencyStatus(address(mockERC20), true); + assertTrue(currencyManager.isCurrencyAllowed(address(mockERC20))); + + // Set to false + vm.expectEmit(true, false, false, true); + emit CurrencyStatusUpdated(address(mockERC20), false); + currencyManager.updateCurrencyStatus(address(mockERC20), false); + assertFalse(currencyManager.isCurrencyAllowed(address(mockERC20))); + } + + function testUpdateCurrencyStatusNotOwner() public { + vm.expectRevert(IOwnableTwoSteps.NotOwner.selector); + currencyManager.updateCurrencyStatus(address(mockERC20), true); + } +} diff --git a/contracts/test/foundry/marketplace/DelegationRecipientsTaker.t.sol b/contracts/test/foundry/marketplace/DelegationRecipientsTaker.t.sol new file mode 100644 index 00000000..acc35305 --- /dev/null +++ b/contracts/test/foundry/marketplace/DelegationRecipientsTaker.t.sol @@ -0,0 +1,171 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries and interfaces +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; +import {CreatorFeeManagerWithRoyalties} from "@hypercerts/marketplace/CreatorFeeManagerWithRoyalties.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +contract DelegationRecipientsTakerTest is ProtocolBase { + function setUp() public { + _setUp(); + CreatorFeeManagerWithRoyalties creatorFeeManager = + new CreatorFeeManagerWithRoyalties(address(royaltyFeeRegistry)); + vm.prank(_owner); + looksRareProtocol.updateCreatorFeeManager(address(creatorFeeManager)); + } + + // Fixed price of sale + uint256 private constant price = 1 ether; + + /** + * One ERC721 is sold through a taker ask using WETH and the proceeds of the sale goes to a random recipient. + */ + function testTakerAskERC721WithRoyaltiesFromRegistryWithDelegation() public { + _setUpUsers(); + _setupRegistryRoyalties(address(mockERC721), _standardRoyaltyFee); + address randomRecipientSaleProceeds = address(420); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Mint asset + mockERC721.mint(takerUser, makerBid.itemIds[0]); + + // Adjust recipient + takerAsk.recipient = randomRecipientSaleProceeds; + + // Verify maker bid order + _assertValidMakerOrder(makerBid, signature); + + // Arrays for events + address[2] memory expectedRecipients; + expectedRecipients[0] = randomRecipientSaleProceeds; + expectedRecipients[1] = _royaltyRecipient; + + uint256[3] memory expectedFees; + expectedFees[2] = (price * _standardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP; + expectedFees[1] = (price * _standardRoyaltyFee) / ONE_HUNDRED_PERCENT_IN_BP; + expectedFees[0] = price - (expectedFees[1] + expectedFees[2]); + + vm.prank(takerUser); + vm.expectEmit(true, false, false, true); + + emit TakerAsk( + NonceInvalidationParameters({ + orderHash: _computeOrderHash(makerBid), + orderNonce: makerBid.orderNonce, + isNonceInvalidated: true + }), + takerUser, + makerUser, + makerBid.strategyId, + makerBid.currency, + makerBid.collection, + makerBid.itemIds, + makerBid.amounts, + expectedRecipients, + expectedFees + ); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // Taker user has received the asset + assertEq(mockERC721.ownerOf(makerBid.itemIds[0]), makerUser); + // Maker bid user pays the whole price + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser - price); + // Random recipient user receives 99.5% of the whole price and taker user receives nothing. + assertEq(weth.balanceOf(takerUser), _initialWETHBalanceUser); + assertEq( + weth.balanceOf(randomRecipientSaleProceeds), + (price * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP + ); + // Royalty recipient receives 0.5% of the whole price + assertEq( + weth.balanceOf(_royaltyRecipient), + _initialWETHBalanceRoyaltyRecipient + (price * _standardRoyaltyFee) / ONE_HUNDRED_PERCENT_IN_BP + ); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerBid.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + /** + * One ERC721 is sold through a taker bid and the NFT transfer goes to a random recipient. + */ + function testTakerBidERC721WithRoyaltiesFromRegistryWithDelegation() public { + address randomRecipientNFT = address(420); + + _setUpUsers(); + _setupRegistryRoyalties(address(mockERC721), _standardRoyaltyFee); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + + // Mint asset + mockERC721.mint(makerUser, makerAsk.itemIds[0]); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Adjust recipient to random recipient + takerBid.recipient = randomRecipientNFT; + + // Verify validity of maker ask order + _assertValidMakerOrder(makerAsk, signature); + + // Arrays for events + address[2] memory expectedRecipients; + expectedRecipients[0] = makerUser; + expectedRecipients[1] = _royaltyRecipient; + + uint256[3] memory expectedFees; + expectedFees[0] = price - (expectedFees[1] + expectedFees[0]); + expectedFees[1] = (price * _standardRoyaltyFee) / ONE_HUNDRED_PERCENT_IN_BP; + expectedFees[2] = (price * _standardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP; + + vm.prank(takerUser); + + emit TakerBid( + NonceInvalidationParameters({ + orderHash: _computeOrderHash(makerAsk), + orderNonce: makerAsk.orderNonce, + isNonceInvalidated: true + }), + takerUser, + randomRecipientNFT, + makerAsk.strategyId, + makerAsk.currency, + makerAsk.collection, + makerAsk.itemIds, + makerAsk.amounts, + expectedRecipients, + expectedFees + ); + + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + // Random recipient user has received the asset + assertEq(mockERC721.ownerOf(makerAsk.itemIds[0]), randomRecipientNFT); + // Taker bid user pays the whole price + assertEq(address(takerUser).balance, _initialETHBalanceUser - price); + // Maker ask user receives 99.5% of the whole price + assertEq( + address(makerUser).balance, + _initialETHBalanceUser + (price * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP + ); + // Royalty recipient receives 0.5% of the whole price + assertEq( + address(_royaltyRecipient).balance, + _initialETHBalanceRoyaltyRecipient + (price * _standardRoyaltyFee) / ONE_HUNDRED_PERCENT_IN_BP + ); + // No leftover in the balance of the contract + assertEq(address(looksRareProtocol).balance, 0); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerAsk.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } +} diff --git a/contracts/test/foundry/marketplace/DomainSeparatorUpdates.t.sol b/contracts/test/foundry/marketplace/DomainSeparatorUpdates.t.sol new file mode 100644 index 00000000..c1ed9701 --- /dev/null +++ b/contracts/test/foundry/marketplace/DomainSeparatorUpdates.t.sol @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {IOwnableTwoSteps} from "@looksrare/contracts-libs/contracts/interfaces/IOwnableTwoSteps.sol"; +import {SignatureEOAInvalid} from "@looksrare/contracts-libs/contracts/errors/SignatureCheckerErrors.sol"; + +// Libraries and interfaces +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; +import {ILooksRareProtocol} from "@hypercerts/marketplace/interfaces/ILooksRareProtocol.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +contract DomainSeparatorUpdatesTest is ProtocolBase { + function setUp() public { + _setUp(); + } + + function testUpdateDomainSeparator(uint64 newChainId) public asPrankedUser(_owner) { + vm.assume(newChainId != block.chainid); + + vm.chainId(newChainId); + vm.expectEmit(true, false, false, true); + emit NewDomainSeparator(); + looksRareProtocol.updateDomainSeparator(); + assertEq(looksRareProtocol.chainId(), newChainId); + assertEq( + looksRareProtocol.domainSeparator(), + keccak256( + abi.encode( + keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), + keccak256("LooksRareProtocol"), + keccak256(bytes("2")), + newChainId, + address(looksRareProtocol) + ) + ) + ); + } + + function testCannotTradeIfDomainSeparatorHasBeenUpdated(uint64 newChainId) public { + vm.assume(newChainId != block.chainid); + + _setUpUsers(); + + // ChainId update + vm.chainId(newChainId); + + // Owner updates the domain separator + vm.prank(_owner); + looksRareProtocol.updateDomainSeparator(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Mint asset + mockERC721.mint(makerUser, makerAsk.itemIds[0]); + + vm.prank(takerUser); + vm.expectRevert(SignatureEOAInvalid.selector); + looksRareProtocol.executeTakerBid{value: makerAsk.price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testCannotTradeIfChainIdHasChanged(uint64 newChainId) public { + vm.assume(newChainId != block.chainid); + + _setUpUsers(); + + // ChainId update + vm.chainId(newChainId); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Mint asset + mockERC721.mint(makerUser, makerAsk.itemIds[0]); + + vm.prank(takerUser); + vm.expectRevert(ILooksRareProtocol.ChainIdInvalid.selector); + looksRareProtocol.executeTakerBid{value: makerAsk.price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testUpdateDomainSeparatorSameDomainSeparator() public asPrankedUser(_owner) { + vm.expectRevert(SameDomainSeparator.selector); + looksRareProtocol.updateDomainSeparator(); + } + + function testUpdateDomainSeparatorNotOwner() public { + vm.expectRevert(IOwnableTwoSteps.NotOwner.selector); + looksRareProtocol.updateDomainSeparator(); + } +} diff --git a/contracts/test/foundry/marketplace/ExecutionManager.t.sol b/contracts/test/foundry/marketplace/ExecutionManager.t.sol new file mode 100644 index 00000000..317f1f84 --- /dev/null +++ b/contracts/test/foundry/marketplace/ExecutionManager.t.sol @@ -0,0 +1,211 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.17; + +// LooksRare unopinionated libraries +import {IOwnableTwoSteps} from "@looksrare/contracts-libs/contracts/interfaces/IOwnableTwoSteps.sol"; + +// Libraries and interfaces +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; +import {IExecutionManager} from "@hypercerts/marketplace/interfaces/IExecutionManager.sol"; +import {IStrategyManager} from "@hypercerts/marketplace/interfaces/IStrategyManager.sol"; + +// Shared errors +import {OrderInvalid} from "@hypercerts/marketplace/errors/SharedErrors.sol"; +import { + MAKER_ORDER_INVALID_STANDARD_SALE, + STRATEGY_INVALID_QUOTE_TYPE, + STRATEGY_INVALID_QUOTE_TYPE, + STRATEGY_NOT_ACTIVE, + START_TIME_GREATER_THAN_END_TIME, + TOO_LATE_TO_EXECUTE_ORDER, + TOO_EARLY_TO_EXECUTE_ORDER +} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +contract ExecutionManagerTest is ProtocolBase, IExecutionManager, IStrategyManager { + function setUp() public { + _setUp(); + } + + function testUpdateCreatorFeeManager() public asPrankedUser(_owner) { + vm.expectEmit(true, false, false, true); + emit NewCreatorFeeManager(address(1)); + looksRareProtocol.updateCreatorFeeManager(address(1)); + assertEq(address(looksRareProtocol.creatorFeeManager()), address(1)); + } + + function testUpdateCreatorFeeManagerNotOwner() public { + vm.expectRevert(IOwnableTwoSteps.NotOwner.selector); + looksRareProtocol.updateCreatorFeeManager(address(1)); + } + + function testUpdateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) public asPrankedUser(_owner) { + vm.assume(newMaxCreatorFeeBp <= 2500); + vm.expectEmit(true, false, false, true); + emit NewMaxCreatorFeeBp(newMaxCreatorFeeBp); + looksRareProtocol.updateMaxCreatorFeeBp(newMaxCreatorFeeBp); + assertEq(looksRareProtocol.maxCreatorFeeBp(), newMaxCreatorFeeBp); + } + + function testUpdateMaxCreatorFeeBpNotOwner() public { + vm.expectRevert(IOwnableTwoSteps.NotOwner.selector); + looksRareProtocol.updateMaxCreatorFeeBp(uint16(2500)); + } + + function testUpdateMaxCreatorFeeBpTooHigh(uint16 newMaxCreatorFeeBp) public asPrankedUser(_owner) { + vm.assume(newMaxCreatorFeeBp > 2500); + vm.expectRevert(CreatorFeeBpTooHigh.selector); + looksRareProtocol.updateMaxCreatorFeeBp(newMaxCreatorFeeBp); + } + + function testUpdateProtocolFeeRecipient() public asPrankedUser(_owner) { + vm.expectEmit(true, false, false, true); + emit NewProtocolFeeRecipient(address(1)); + looksRareProtocol.updateProtocolFeeRecipient(address(1)); + assertEq(looksRareProtocol.protocolFeeRecipient(), address(1)); + } + + function testUpdateProtocolFeeRecipientCannotBeNullAddress() public asPrankedUser(_owner) { + vm.expectRevert(IExecutionManager.NewProtocolFeeRecipientCannotBeNullAddress.selector); + looksRareProtocol.updateProtocolFeeRecipient(address(0)); + } + + function testUpdateProtocolFeeRecipientNotOwner() public { + vm.expectRevert(IOwnableTwoSteps.NotOwner.selector); + looksRareProtocol.updateProtocolFeeRecipient(address(1)); + } + + function testCannotValidateOrderIfTooEarlyToExecute(uint256 timestamp) public asPrankedUser(takerUser) { + // 300 because because it is deducted by 5 minutes + 1 second + vm.assume(timestamp > 300 && timestamp < type(uint256).max); + // Change timestamp to avoid underflow issues + vm.warp(timestamp); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + + makerBid.startTime = block.timestamp; + makerBid.endTime = block.timestamp + 1 seconds; + + // Maker bid is valid if its start time is within 5 minutes into the future + vm.warp(makerBid.startTime - 5 minutes); + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + _assertMakerOrderReturnValidationCode(makerBid, signature, TOO_EARLY_TO_EXECUTE_ORDER); + + // Maker bid is invalid if its start time is not within 5 minutes into the future + vm.warp(makerBid.startTime - 5 minutes - 1 seconds); + vm.expectRevert(OutsideOfTimeRange.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testCannotValidateOrderIfTooLateToExecute(uint256 timestamp) public asPrankedUser(takerUser) { + vm.assume(timestamp > 0 && timestamp < type(uint256).max); + // Change timestamp to avoid underflow issues + vm.warp(timestamp); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + + makerBid.startTime = block.timestamp - 1 seconds; + makerBid.endTime = block.timestamp; + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + vm.warp(block.timestamp); + _assertMakerOrderReturnValidationCode(makerBid, signature, TOO_LATE_TO_EXECUTE_ORDER); + + vm.warp(block.timestamp + 1 seconds); + vm.expectRevert(OutsideOfTimeRange.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testCannotValidateOrderIfStartTimeLaterThanEndTime(uint256 timestamp) public asPrankedUser(takerUser) { + vm.assume(timestamp < type(uint256).max); + // Change timestamp to avoid underflow issues + vm.warp(timestamp); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + + makerBid.startTime = block.timestamp + 1 seconds; + makerBid.endTime = block.timestamp; + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + _assertMakerOrderReturnValidationCode(makerBid, signature, START_TIME_GREATER_THAN_END_TIME); + + vm.expectRevert(OutsideOfTimeRange.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testCannotValidateOrderIfMakerBidItemIdsIsEmpty() public { + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + + uint256[] memory itemIds = new uint256[](0); + makerBid.itemIds = itemIds; + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + _assertMakerOrderReturnValidationCode(makerBid, signature, MAKER_ORDER_INVALID_STANDARD_SALE); + + vm.expectRevert(OrderInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testCannotValidateOrderIfMakerBidItemIdsLengthMismatch(uint256 makerBidItemIdsLength) + public + asPrankedUser(takerUser) + { + vm.assume(makerBidItemIdsLength > 1 && makerBidItemIdsLength < 100_000); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + + uint256[] memory itemIds = new uint256[](makerBidItemIdsLength); + makerBid.itemIds = itemIds; + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + _assertMakerOrderReturnValidationCode(makerBid, signature, MAKER_ORDER_INVALID_STANDARD_SALE); + + vm.expectRevert(OrderInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testCannotValidateOrderIfMakerAskItemIdsIsEmpty() public asPrankedUser(takerUser) { + vm.deal(takerUser, 100 ether); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + + // Change maker itemIds array to make its length equal to 0 + uint256[] memory itemIds = new uint256[](0); + makerAsk.itemIds = itemIds; + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_INVALID_STANDARD_SALE); + + vm.expectRevert(OrderInvalid.selector); + looksRareProtocol.executeTakerBid{value: makerAsk.price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testCannotValidateOrderIfMakerAskItemIdsLengthMismatch(uint256 makerAskItemIdsLength) + public + asPrankedUser(takerUser) + { + vm.deal(takerUser, 100 ether); + + vm.assume(makerAskItemIdsLength > 1 && makerAskItemIdsLength < 100_000); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + + uint256[] memory itemIds = new uint256[](makerAskItemIdsLength); + makerAsk.itemIds = itemIds; + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_INVALID_STANDARD_SALE); + + vm.expectRevert(OrderInvalid.selector); + looksRareProtocol.executeTakerBid{value: makerAsk.price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } +} diff --git a/contracts/test/foundry/marketplace/GasGriefing.t.sol b/contracts/test/foundry/marketplace/GasGriefing.t.sol new file mode 100644 index 00000000..b973ddff --- /dev/null +++ b/contracts/test/foundry/marketplace/GasGriefing.t.sol @@ -0,0 +1,135 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries and interfaces +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; +import {WETH} from "solmate/src/tokens/WETH.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Mocks and other utils +import {GasGriefer} from "./utils/GasGriefer.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract GasGriefingTest is ProtocolBase { + uint256 private constant price = 1 ether; // Fixed price of sale + address private gasGriefer; + + // WETH events + event Deposit(address indexed from, uint256 amount); + event Transfer(address indexed from, address indexed to, uint256 amount); + + function setUp() public { + _setUp(); + gasGriefer = address(new GasGriefer()); + _setUpUser(gasGriefer); + _setUpUser(takerUser); + } + + function testTakerBidGasGriefing() public { + _setupRegistryRoyalties(address(mockERC721), _standardRoyaltyFee); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + makerAsk.signer = gasGriefer; + + // Mint asset + mockERC721.mint(gasGriefer, makerAsk.itemIds[0]); + + bytes memory signature; + + uint256 sellerProceed = (price * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP; + + vm.expectEmit(true, true, false, true); + emit Deposit(address(looksRareProtocol), sellerProceed); + + vm.expectEmit(true, true, true, true); + emit Transfer(address(looksRareProtocol), gasGriefer, sellerProceed); + + vm.prank(takerUser); + // Execute taker bid transaction + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + // Taker user has received the asset + assertEq(mockERC721.ownerOf(makerAsk.itemIds[0]), takerUser); + // Taker bid user pays the whole price + assertEq(address(takerUser).balance, _initialETHBalanceUser - price); + // Maker ask user receives 99.5% of the whole price + assertEq(weth.balanceOf(gasGriefer), _initialWETHBalanceUser + sellerProceed); + // Royalty recipient receives 0.5% of the whole price + assertEq( + address(_royaltyRecipient).balance, + _initialETHBalanceRoyaltyRecipient + (price * _standardRoyaltyFee) / ONE_HUNDRED_PERCENT_IN_BP + ); + // No leftover in the balance of the contract + assertEq(address(looksRareProtocol).balance, 0); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(gasGriefer, makerAsk.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + function testThreeTakerBidsGasGriefing() public { + uint256 numberPurchases = 3; + + OrderStructs.Maker[] memory makerAsks = new OrderStructs.Maker[](numberPurchases); + OrderStructs.Taker[] memory takerBids = new OrderStructs.Taker[](numberPurchases); + bytes[] memory signatures = new bytes[](numberPurchases); + + for (uint256 i; i < numberPurchases; i++) { + // Mint asset + mockERC721.mint(gasGriefer, i); + + makerAsks[i] = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: i, + collection: address(mockERC721), + currency: ETH, + signer: gasGriefer, + price: price, // Fixed + itemId: i // (0, 1, etc.) + }); + + takerBids[i] = _genericTakerOrder(); + } + + // Other execution parameters + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](numberPurchases); + + uint256 sellerProceedPerItem = (price * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP; + + vm.expectEmit(true, true, false, true); + emit Deposit(address(looksRareProtocol), sellerProceedPerItem); + + vm.expectEmit(true, true, true, true); + emit Transfer(address(looksRareProtocol), gasGriefer, sellerProceedPerItem); + + vm.prank(takerUser); + // Execute taker bid transaction + looksRareProtocol.executeMultipleTakerBids{value: price * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + for (uint256 i; i < numberPurchases; i++) { + // Taker user has received the asset + assertEq(mockERC721.ownerOf(i), takerUser); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(gasGriefer, i), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + // Taker bid user pays the whole price + assertEq(address(takerUser).balance, _initialETHBalanceUser - (numberPurchases * price)); + // Maker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq(weth.balanceOf(gasGriefer), _initialWETHBalanceUser + sellerProceedPerItem * numberPurchases); + // No leftover in the balance of the contract + assertEq(address(looksRareProtocol).balance, 0); + } +} diff --git a/contracts/test/foundry/marketplace/InitialStates.t.sol b/contracts/test/foundry/marketplace/InitialStates.t.sol new file mode 100644 index 00000000..5817a403 --- /dev/null +++ b/contracts/test/foundry/marketplace/InitialStates.t.sol @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Interfaces +import {IStrategyManager} from "@hypercerts/marketplace/interfaces/IStrategyManager.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +contract InitialStatesTest is ProtocolBase, IStrategyManager { + function setUp() public { + _setUp(); + } + + /** + * Verify initial post-deployment states are as expected + */ + function testInitialStates() public { + assertEq(looksRareProtocol.owner(), _owner); + assertEq(looksRareProtocol.protocolFeeRecipient(), address(protocolFeeRecipient)); + assertEq(address(looksRareProtocol.transferManager()), address(transferManager)); + assertEq(looksRareProtocol.WETH(), address(weth)); + assertEq(looksRareProtocol.chainId(), block.chainid); + + bytes32 domainSeparator = looksRareProtocol.domainSeparator(); + bytes32 expectedDomainSeparator = keccak256( + abi.encode( + keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), + keccak256("LooksRareProtocol"), + keccak256(bytes("2")), + block.chainid, + address(looksRareProtocol) + ) + ); + assertEq(domainSeparator, expectedDomainSeparator); + + ( + bool strategyIsActive, + uint16 strategyStandardProtocolFee, + uint16 strategyMinTotalFee, + uint16 strategyMaxProtocolFee, + bytes4 strategySelector, + bool strategyIsMakerBid, + address strategyImplementation + ) = looksRareProtocol.strategyInfo(0); + + assertTrue(strategyIsActive); + assertEq(strategyStandardProtocolFee, _standardProtocolFeeBp); + assertEq(strategyMinTotalFee, _minTotalFeeBp); + assertEq(strategyMaxProtocolFee, _maxProtocolFeeBp); + assertEq(strategySelector, _EMPTY_BYTES4); + assertFalse(strategyIsMakerBid); + assertEq(strategyImplementation, address(0)); + } +} diff --git a/contracts/test/foundry/marketplace/LooksRareProtocol.t.sol b/contracts/test/foundry/marketplace/LooksRareProtocol.t.sol new file mode 100644 index 00000000..eae62a48 --- /dev/null +++ b/contracts/test/foundry/marketplace/LooksRareProtocol.t.sol @@ -0,0 +1,278 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {IOwnableTwoSteps} from "@looksrare/contracts-libs/contracts/interfaces/IOwnableTwoSteps.sol"; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Shared errors +import { + AmountInvalid, + CallerInvalid, + CurrencyInvalid, + OrderInvalid, + QuoteTypeInvalid +} from "@hypercerts/marketplace/errors/SharedErrors.sol"; +import { + CURRENCY_NOT_ALLOWED, + MAKER_ORDER_INVALID_STANDARD_SALE +} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Other mocks and utils +import {MockERC20} from "../../mock/MockERC20.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract LooksRareProtocolTest is ProtocolBase { + // Fixed price of sale + uint256 private constant price = 1 ether; + + // Mock files + MockERC20 private mockERC20; + + function setUp() public { + _setUp(); + vm.prank(_owner); + mockERC20 = new MockERC20(); + } + + function testCannotTradeIfInvalidAmounts() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + + // Mint asset + mockERC721.mint(makerUser, makerAsk.itemIds[0]); + + // 1. Amount = 0 + makerAsk.amounts[0] = 0; + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_INVALID_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(OrderInvalid.selector); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + // 2. Amount > 1 for ERC721 + makerAsk.amounts[0] = 2; + + // Sign order + signature = _signMakerOrder(makerAsk, makerUserPK); + + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_INVALID_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(AmountInvalid.selector); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testCannotTradeIfCurrencyInvalid() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + makerAsk.currency = address(mockERC20); + + mockERC20.mint(takerUser, 10 ether); + vm.prank(takerUser); + mockERC20.approve(address(looksRareProtocol), 10 ether); + + // Mint asset + mockERC721.mint(makerUser, makerAsk.itemIds[0]); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Verify validity of maker ask order + _assertMakerOrderReturnValidationCode(makerAsk, signature, CURRENCY_NOT_ALLOWED); + + vm.prank(takerUser); + vm.expectRevert(CurrencyInvalid.selector); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + OrderStructs.Maker[] memory makerAsks = new OrderStructs.Maker[](1); + OrderStructs.Taker[] memory takerBids = new OrderStructs.Taker[](1); + bytes[] memory signatures = new bytes[](1); + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](1); + + makerAsks[0] = makerAsk; + takerBids[0] = takerBid; + signatures[0] = signature; + + vm.prank(takerUser); + vm.expectRevert(CurrencyInvalid.selector); + looksRareProtocol.executeMultipleTakerBids{value: price}( + takerBids, + makerAsks, + signatures, + merkleTrees, + true // Atomic + ); + + vm.prank(takerUser); + vm.expectRevert(CurrencyInvalid.selector); + looksRareProtocol.executeMultipleTakerBids{value: price}( + takerBids, + makerAsks, + signatures, + merkleTrees, + false // Non-atomic + ); + + vm.prank(_owner); + looksRareProtocol.updateCurrencyStatus(address(mockERC20), true); + + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testCannotTradeIfETHIsUsedForMakerBid() public { + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), ETH); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Verify maker bid order + _assertMakerOrderReturnValidationCode(makerBid, signature, CURRENCY_NOT_ALLOWED); + + // Mint asset + mockERC721.mint(takerUser, makerBid.itemIds[0]); + + // Execute taker ask transaction + vm.prank(takerUser); + vm.expectRevert(CurrencyInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testCannotTradeIfInvalidQuoteType() public { + // 1. QuoteType = BID but executeTakerBid + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + vm.prank(takerUser); + vm.expectRevert(QuoteTypeInvalid.selector); + looksRareProtocol.executeTakerBid(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // 2. QuoteType = ASK but executeTakerAsk + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + makerAsk.currency = address(weth); + + // Sign order + signature = _signMakerOrder(makerAsk, makerUserPK); + + vm.prank(takerUser); + vm.expectRevert(QuoteTypeInvalid.selector); + looksRareProtocol.executeTakerAsk(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testUpdateETHGasLimitForTransfer() public asPrankedUser(_owner) { + vm.expectEmit(true, false, false, true); + emit NewGasLimitETHTransfer(10_000); + looksRareProtocol.updateETHGasLimitForTransfer(10_000); + assertEq(uint256(vm.load(address(looksRareProtocol), bytes32(uint256(12)))), 10_000); + } + + function testUpdateETHGasLimitForTransferRevertsIfTooLow() public asPrankedUser(_owner) { + uint256 newGasLimitETHTransfer = 2300; + vm.expectRevert(NewGasLimitETHTransferTooLow.selector); + looksRareProtocol.updateETHGasLimitForTransfer(newGasLimitETHTransfer - 1); + + looksRareProtocol.updateETHGasLimitForTransfer(newGasLimitETHTransfer); + assertEq(uint256(vm.load(address(looksRareProtocol), bytes32(uint256(12)))), newGasLimitETHTransfer); + } + + function testUpdateETHGasLimitForTransferNotOwner() public { + vm.expectRevert(IOwnableTwoSteps.NotOwner.selector); + looksRareProtocol.updateETHGasLimitForTransfer(10_000); + } + + function testCannotCallRestrictedExecuteTakerBid() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + + // Mint asset + mockERC721.mint(makerUser, makerAsk.itemIds[0]); + + vm.prank(takerUser); + vm.expectRevert(CallerInvalid.selector); + looksRareProtocol.restrictedExecuteTakerBid(takerBid, makerAsk, takerUser, _computeOrderHash(makerAsk)); + } + + /** + * Cannot execute two or more taker bids if the currencies are different + */ + function testCannotExecuteMultipleTakerBidsIfDifferentCurrenciesIsAtomic() public { + _testCannotExecuteMultipleTakerBidsIfDifferentCurrencies(true); + } + + function testCannotExecuteMultipleTakerBidsIfDifferentCurrenciesIsNonAtomic() public { + _testCannotExecuteMultipleTakerBidsIfDifferentCurrencies(false); + } + + function _testCannotExecuteMultipleTakerBidsIfDifferentCurrencies(bool isAtomic) public { + _setUpUsers(); + vm.prank(_owner); + looksRareProtocol.updateCurrencyStatus(address(mockERC20), true); + + uint256 numberPurchases = 2; + + OrderStructs.Maker[] memory makerAsks = new OrderStructs.Maker[](numberPurchases); + OrderStructs.Taker[] memory takerBids = new OrderStructs.Taker[](numberPurchases); + bytes[] memory signatures = new bytes[](numberPurchases); + + for (uint256 i; i < numberPurchases; i++) { + // Mint asset + mockERC721.mint(makerUser, i); + + makerAsks[i] = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: i, + collection: address(mockERC721), + currency: ETH, + signer: makerUser, + price: price, // Fixed + itemId: i // (0, 1, etc.) + }); + + if (i == 1) { + makerAsks[i].currency = address(mockERC20); + } + + // Sign order + signatures[i] = _signMakerOrder(makerAsks[i], makerUserPK); + + takerBids[i] = _genericTakerOrder(); + } + + // Other execution parameters + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](numberPurchases); + + vm.prank(takerUser); + vm.expectRevert(CurrencyInvalid.selector); + looksRareProtocol.executeMultipleTakerBids{value: price}( + takerBids, makerAsks, signatures, merkleTrees, isAtomic + ); + } +} diff --git a/contracts/test/foundry/marketplace/NonceInvalidation.t.sol b/contracts/test/foundry/marketplace/NonceInvalidation.t.sol new file mode 100644 index 00000000..c2268c6c --- /dev/null +++ b/contracts/test/foundry/marketplace/NonceInvalidation.t.sol @@ -0,0 +1,353 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries, interfaces, errors +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; +import {INonceManager} from "@hypercerts/marketplace/interfaces/INonceManager.sol"; +import {LengthsInvalid} from "@hypercerts/marketplace/errors/SharedErrors.sol"; +import { + INVALID_USER_GLOBAL_BID_NONCE, + INVALID_USER_GLOBAL_ASK_NONCE, + USER_SUBSET_NONCE_CANCELLED, + USER_ORDER_NONCE_IN_EXECUTION_WITH_OTHER_HASH, + USER_ORDER_NONCE_EXECUTED_OR_CANCELLED +} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Other utils and tests +import {StrategyTestMultiFillCollectionOrder} from "./utils/StrategyTestMultiFillCollectionOrder.sol"; +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract NonceInvalidationTest is INonceManager, ProtocolBase { + uint256 private constant price = 1 ether; // Fixed price of sale + + function setUp() public { + _setUp(); + } + + /** + * Cannot execute an order if subset nonce is used + */ + function testCannotExecuteOrderIfSubsetNonceIsUsed(uint256 subsetNonce) public { + uint256 itemId = 420; + + // Mint asset + mockERC721.mint(makerUser, itemId); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + makerAsk.subsetNonce = subsetNonce; + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + uint256[] memory subsetNonces = new uint256[](1); + subsetNonces[0] = subsetNonce; + + vm.prank(makerUser); + vm.expectEmit(false, false, false, true); + emit SubsetNoncesCancelled(makerUser, subsetNonces); + looksRareProtocol.cancelSubsetNonces(subsetNonces); + + _assertMakerOrderReturnValidationCode(makerAsk, signature, USER_SUBSET_NONCE_CANCELLED); + + vm.deal(takerUser, price); + + // Execute taker bid transaction + // Taker user actions + vm.prank(takerUser); + vm.expectRevert(NoncesInvalid.selector); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + /** + * Cannot execute an order if maker is at a different global ask nonce than signed + */ + function testCannotExecuteOrderIfInvalidUserGlobalAskNonce(uint256 userGlobalAskNonce) public { + uint256 quasiRandomNumber = 54_570_651_553_685_478_358_117_286_254_199_992_264; + vm.assume(userGlobalAskNonce < quasiRandomNumber); + // Change block number + vm.roll(1); + assertEq(quasiRandomNumber, uint256(blockhash(block.number - 1) >> 128)); + + uint256 newAskNonce = 0 + quasiRandomNumber; + + vm.prank(makerUser); + vm.expectEmit(false, false, false, true); + emit NewBidAskNonces(makerUser, 0, newAskNonce); + looksRareProtocol.incrementBidAskNonces(false, true); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + + // Mint asset + mockERC721.mint(makerUser, makerAsk.itemIds[0]); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + _assertMakerOrderReturnValidationCode(makerAsk, signature, INVALID_USER_GLOBAL_ASK_NONCE); + + vm.deal(takerUser, price); + + // Execute taker bid transaction + // Taker user actions + vm.prank(takerUser); + vm.expectRevert(NoncesInvalid.selector); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + /** + * Cannot execute an order if maker is at a different global bid nonce than signed + */ + function testCannotExecuteOrderIfInvalidUserGlobalBidNonce(uint256 userGlobalBidNonce) public { + uint256 quasiRandomNumber = 54_570_651_553_685_478_358_117_286_254_199_992_264; + vm.assume(userGlobalBidNonce < quasiRandomNumber); + // Change block number + vm.roll(1); + assertEq(quasiRandomNumber, uint256(blockhash(block.number - 1) >> 128)); + + uint256 newBidNonce = 0 + quasiRandomNumber; + + vm.prank(makerUser); + vm.expectEmit(false, false, false, true); + emit NewBidAskNonces(makerUser, newBidNonce, 0); + looksRareProtocol.incrementBidAskNonces(true, false); + + uint256 itemId = 420; + + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: userGlobalBidNonce, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemId: itemId + }); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + _assertMakerOrderReturnValidationCode(makerBid, signature, INVALID_USER_GLOBAL_BID_NONCE); + + // Mint asset + mockERC721.mint(takerUser, itemId); + + // Execute taker ask transaction + // Taker user actions + vm.prank(takerUser); + vm.expectRevert(NoncesInvalid.selector); + looksRareProtocol.executeTakerAsk(_genericTakerOrder(), makerBid, signature, _EMPTY_MERKLE_TREE); + } + + /** + * Cannot execute an order twice + */ + function testCannotExecuteAnOrderTwice() public { + _setUpUsers(); + _setupRegistryRoyalties(address(mockERC721), _standardRoyaltyFee); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Mint asset + mockERC721.mint(takerUser, makerBid.itemIds[0]); + + // Taker user actions + vm.startPrank(takerUser); + + { + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + _assertMakerOrderReturnValidationCode(makerBid, signature, USER_ORDER_NONCE_EXECUTED_OR_CANCELLED); + + // Second one fails + vm.expectRevert(NoncesInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + vm.stopPrank(); + } + + /** + * Cannot execute an order sharing the same order nonce as another that is being partially filled + */ + function testCannotExecuteAnotherOrderAtNonceIfExecutionIsInProgress(uint256 orderNonce) public { + _setUpUsers(); + + // 0. Add the new strategy + bytes4 selector = StrategyTestMultiFillCollectionOrder.executeStrategyWithTakerAsk.selector; + + StrategyTestMultiFillCollectionOrder strategyMultiFillCollectionOrder = + new StrategyTestMultiFillCollectionOrder(address(looksRareProtocol)); + + vm.prank(_owner); + _addStrategy(address(strategyMultiFillCollectionOrder), selector, true); + + // 1. Maker signs a message and execute a partial fill on it + uint256 amountsToFill = 4; + + uint256[] memory itemIds = new uint256[](0); + uint256[] memory amounts = new uint256[](1); + amounts[0] = amountsToFill; + + // Prepare the first order + OrderStructs.Maker memory makerBid = _createMultiItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 1, // Multi-fill bid offer + collectionType: CollectionType.ERC721, + orderNonce: orderNonce, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemIds: itemIds, + amounts: amounts + }); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // First taker user actions + { + itemIds = new uint256[](1); + amounts = new uint256[](1); + itemIds[0] = 0; + amounts[0] = 1; + + mockERC721.mint(takerUser, itemIds[0]); + + // Prepare the taker ask + OrderStructs.Taker memory takerAsk = OrderStructs.Taker(takerUser, abi.encode(itemIds, amounts)); + + vm.prank(takerUser); + + // Execute taker ask transaction + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + // 2. Second maker order is signed sharing the same order nonce as the first one + { + uint256 itemId = 420; + + itemIds = new uint256[](1); + amounts = new uint256[](1); + itemIds[0] = itemId; + amounts[0] = 1; + + // Prepare the second order + makerBid = _createMultiItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: orderNonce, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemIds: itemIds, + amounts: amounts + }); + + // Sign order + signature = _signMakerOrder(makerBid, makerUserPK); + + _assertMakerOrderReturnValidationCode(makerBid, signature, USER_ORDER_NONCE_IN_EXECUTION_WITH_OTHER_HASH); + + // Prepare the taker ask + OrderStructs.Taker memory takerAsk = + OrderStructs.Taker(takerUser, abi.encode(new uint256[](0), new uint256[](0))); + + vm.prank(takerUser); + + // Second one fails when a taker user tries to execute + vm.expectRevert(NoncesInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + } + + function testCancelOrderNonces(uint256 nonceOne, uint256 nonceTwo) public asPrankedUser(makerUser) { + assertEq(looksRareProtocol.userOrderNonce(makerUser, nonceOne), bytes32(0)); + assertEq(looksRareProtocol.userOrderNonce(makerUser, nonceTwo), bytes32(0)); + + uint256[] memory orderNonces = new uint256[](2); + orderNonces[0] = nonceOne; + orderNonces[1] = nonceTwo; + vm.expectEmit(true, false, false, true); + emit OrderNoncesCancelled(makerUser, orderNonces); + looksRareProtocol.cancelOrderNonces(orderNonces); + + assertEq(looksRareProtocol.userOrderNonce(makerUser, nonceOne), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + assertEq(looksRareProtocol.userOrderNonce(makerUser, nonceTwo), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + /** + * Cannot execute an order if its nonce has been cancelled + */ + function testCannotExecuteAnOrderWhoseNonceIsCancelled(uint256 orderNonce) public { + _setUpUsers(); + _setupRegistryRoyalties(address(mockERC721), _standardRoyaltyFee); + + uint256 itemId = 0; + + uint256[] memory orderNonces = new uint256[](1); + orderNonces[0] = orderNonce; + vm.prank(makerUser); + looksRareProtocol.cancelOrderNonces(orderNonces); + + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: orderNonce, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemId: itemId + }); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + _assertMakerOrderReturnValidationCode(makerBid, signature, USER_ORDER_NONCE_EXECUTED_OR_CANCELLED); + + // Mint asset + mockERC721.mint(takerUser, itemId); + + // Prepare the taker ask + OrderStructs.Taker memory takerAsk = + OrderStructs.Taker(takerUser, abi.encode(new uint256[](0), new uint256[](0))); + + vm.prank(takerUser); + vm.expectRevert(NoncesInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testCancelNoncesRevertIfEmptyArrays() public { + uint256[] memory nonces = new uint256[](0); + + vm.expectRevert(LengthsInvalid.selector); + looksRareProtocol.cancelSubsetNonces(nonces); + + vm.expectRevert(LengthsInvalid.selector); + looksRareProtocol.cancelOrderNonces(nonces); + } +} diff --git a/contracts/test/foundry/marketplace/OrderValidatorV2A.t.sol b/contracts/test/foundry/marketplace/OrderValidatorV2A.t.sol new file mode 100644 index 00000000..90dc0281 --- /dev/null +++ b/contracts/test/foundry/marketplace/OrderValidatorV2A.t.sol @@ -0,0 +1,450 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {LooksRareProtocol} from "@hypercerts/marketplace/LooksRareProtocol.sol"; +import {TransferManager} from "@hypercerts/marketplace/TransferManager.sol"; +import {CreatorFeeManagerWithRoyalties} from "@hypercerts/marketplace/CreatorFeeManagerWithRoyalties.sol"; + +import {OrderValidatorV2A} from "@hypercerts/marketplace/helpers/OrderValidatorV2A.sol"; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Shared errors +import { + ERC20_APPROVAL_INFERIOR_TO_PRICE, + ERC721_ITEM_ID_NOT_IN_BALANCE, + ERC721_NO_APPROVAL_FOR_ALL_OR_ITEM_ID, + ERC1155_BALANCE_OF_DOES_NOT_EXIST, + ERC1155_BALANCE_OF_ITEM_ID_INFERIOR_TO_AMOUNT, + ERC1155_IS_APPROVED_FOR_ALL_DOES_NOT_EXIST, + ERC1155_NO_APPROVAL_FOR_ALL, + HYPERCERT_UNITS_NOT_HELD_BY_USER, + HYPERCERT_UNITS_OF_DOES_NOT_EXIST, + MAKER_ORDER_INVALID_STANDARD_SALE, + MISSING_IS_VALID_SIGNATURE_FUNCTION_EIP1271, + POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_ERC721, + POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_ERC1155, + POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_HYPERCERT, + STRATEGY_NOT_IMPLEMENTED, + TRANSFER_MANAGER_APPROVAL_REVOKED_BY_OWNER_FOR_EXCHANGE +} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Utils +import {TestParameters} from "./utils/TestParameters.sol"; + +// Mocks +import {MockRoyaltyFeeRegistry} from "../../mock/MockRoyaltyFeeRegistry.sol"; +import {MockERC721} from "../../mock/MockERC721.sol"; +import {MockERC1155} from "../../mock/MockERC1155.sol"; +import {MockERC1155WithoutBalanceOfBatch} from "../../mock/MockERC1155WithoutBalanceOfBatch.sol"; +import {MockERC1155WithoutAnyBalanceOf} from "../../mock/MockERC1155WithoutAnyBalanceOf.sol"; +import {MockERC1155WithoutIsApprovedForAll} from "../../mock/MockERC1155WithoutIsApprovedForAll.sol"; +import {MockERC721SupportsNoInterface} from "../../mock/MockERC721SupportsNoInterface.sol"; +import {MockERC1155SupportsNoInterface} from "../../mock/MockERC1155SupportsNoInterface.sol"; +import {MockHypercertMinter} from "../../mock/MockHypercertMinter.sol"; +import {MockHypercertMinterSupportsNoInterface} from "../../mock/MockHypercertMinterSupportsNoInterface.sol"; +import {MockHypercertMinterWithoutAnyBalanceOf} from "../../mock/MockHypercertMinterWithoutAnyBalanceOf.sol"; +import {MockHypercertMinterWithoutAnyUnitsOf} from "../../mock/MockHypercertMinterWithoutAnyUnitsOf.sol"; +import {MockERC20} from "../../mock/MockERC20.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +/** + * @dev Not everything is tested in this file. Most tests live in other files + * with the assert functions living in ProtocolBase.t.sol. + */ +contract OrderValidatorV2ATest is TestParameters { + CreatorFeeManagerWithRoyalties private creatorFeeManager; + LooksRareProtocol private looksRareProtocol; + MockRoyaltyFeeRegistry private royaltyFeeRegistry; + OrderValidatorV2A private orderValidator; + TransferManager private transferManager; + + function setUp() public { + transferManager = new TransferManager(address(this)); + looksRareProtocol = new LooksRareProtocol( + address(this), address(this), address(transferManager), 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 + ); + royaltyFeeRegistry = new MockRoyaltyFeeRegistry(address(this), 9500); + creatorFeeManager = new CreatorFeeManagerWithRoyalties(address(royaltyFeeRegistry)); + looksRareProtocol.updateCreatorFeeManager(address(creatorFeeManager)); + looksRareProtocol.updateCurrencyStatus(ETH, true); + orderValidator = new OrderValidatorV2A(address(looksRareProtocol)); + } + + function testDeriveProtocolParameters() public { + orderValidator.deriveProtocolParameters(); + assertEq( + orderValidator.domainSeparator(), + keccak256( + abi.encode( + keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), + keccak256("LooksRareProtocol"), + keccak256(bytes("2")), + block.chainid, + address(looksRareProtocol) + ) + ) + ); + + assertEq(address(orderValidator.creatorFeeManager()), address(creatorFeeManager)); + assertEq(orderValidator.maxCreatorFeeBp(), 1000); + } + + function testMakerAskStrategyNotImplemented() public { + OrderStructs.Maker memory makerAsk; + makerAsk.quoteType = QuoteType.Ask; + makerAsk.strategyId = 1; + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerAsk, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[0], STRATEGY_NOT_IMPLEMENTED); + } + + function testMakerBidStrategyNotImplemented() public { + OrderStructs.Maker memory makerBid; + makerBid.quoteType = QuoteType.Bid; + address currency = address(1); // it cannot be 0 + looksRareProtocol.updateCurrencyStatus(currency, true); + makerBid.currency = currency; + makerBid.strategyId = 1; + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerBid, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[0], STRATEGY_NOT_IMPLEMENTED); + } + + function testMakerAskLooksRareProtocolIsNotAWhitelistedOperator() public { + OrderStructs.Maker memory makerAsk; + makerAsk.quoteType = QuoteType.Ask; + makerAsk.signer = makerUser; + makerAsk.collectionType = CollectionType.ERC721; + makerAsk.collection = address(new MockERC721()); + + address[] memory operators = new address[](1); + operators[0] = address(orderValidator.looksRareProtocol()); + + transferManager.allowOperator(operators[0]); + + vm.prank(makerUser); + transferManager.grantApprovals(operators); + + transferManager.removeOperator(operators[0]); + + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerAsk, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[7], TRANSFER_MANAGER_APPROVAL_REVOKED_BY_OWNER_FOR_EXCHANGE); + } + + function testMakerAskWrongCollectionTypeERC721() public { + OrderStructs.Maker memory makerAsk; + makerAsk.quoteType = QuoteType.Ask; + makerAsk.collectionType = CollectionType.ERC721; + makerAsk.collection = address(new MockERC721SupportsNoInterface()); + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerAsk, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[6], POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_ERC721); + } + + function testMakerBidWrongCollectionTypeERC721() public { + OrderStructs.Maker memory makerBid; + makerBid.quoteType = QuoteType.Bid; + makerBid.collectionType = CollectionType.ERC721; + makerBid.collection = address(new MockERC721SupportsNoInterface()); + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerBid, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[6], POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_ERC721); + } + + function testMakerBidZeroAmount() public { + _testMakerBidERC721InvalidAmount(0); + } + + function testMakerBidERC721AmountNotEqualToOne() public { + _testMakerBidERC721InvalidAmount(2); + } + + function _testMakerBidERC721InvalidAmount(uint256 amount) public { + OrderStructs.Maker memory makerBid; + makerBid.quoteType = QuoteType.Bid; + makerBid.collectionType = CollectionType.ERC721; + makerBid.collection = address(new MockERC721()); + uint256[] memory itemIds = new uint256[](1); + itemIds[0] = amount; + makerBid.itemIds = itemIds; + uint256[] memory amounts = new uint256[](1); + amounts[0] = amount; + makerBid.amounts = amounts; + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerBid, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[1], MAKER_ORDER_INVALID_STANDARD_SALE); + } + + function testMakerBidMissingIsValidSignature() public { + OrderStructs.Maker memory makerBid; + // This contract does not have isValidSignature implemented + makerBid.quoteType = QuoteType.Bid; + makerBid.signer = address(this); + makerBid.collectionType = CollectionType.ERC721; + makerBid.collection = address(new MockERC721()); + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerBid, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[3], MISSING_IS_VALID_SIGNATURE_FUNCTION_EIP1271); + } + + function testMakerAskWrongCollectionTypeERC1155() public { + OrderStructs.Maker memory makerAsk; + makerAsk.collectionType = CollectionType.ERC1155; + makerAsk.collection = address(new MockERC1155SupportsNoInterface()); + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerAsk, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[6], POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_ERC1155); + } + + function testMakerBidWrongCollectionTypeERC1155() public { + OrderStructs.Maker memory makerBid; + makerBid.quoteType = QuoteType.Bid; + makerBid.collectionType = CollectionType.ERC1155; + makerBid.collection = address(new MockERC1155SupportsNoInterface()); + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerBid, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[6], POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_ERC1155); + } + + function testMakerAskWrongCollectionTypeHypercert() public { + OrderStructs.Maker memory makerAsk; + makerAsk.collectionType = CollectionType.Hypercert; + makerAsk.collection = address(new MockHypercertMinterSupportsNoInterface()); + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerAsk, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[6], POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_HYPERCERT); + } + + function testMakerBidWrongCollectionTypeHypercert() public { + OrderStructs.Maker memory makerBid; + makerBid.quoteType = QuoteType.Bid; + makerBid.collectionType = CollectionType.Hypercert; + makerBid.collection = address(new MockHypercertMinterSupportsNoInterface()); + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerBid, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[6], POTENTIAL_INVALID_COLLECTION_TYPE_SHOULD_BE_HYPERCERT); + } + + function testMakerBidInsufficientERC20Allowance() public { + OrderStructs.Maker memory makerBid; + makerBid.quoteType = QuoteType.Bid; + MockERC20 mockERC20 = new MockERC20(); + makerBid.collectionType = CollectionType.ERC721; + makerBid.collection = address(new MockERC721()); + makerBid.signer = makerUser; + makerBid.currency = address(mockERC20); + makerBid.collectionType = CollectionType.ERC721; + makerBid.price = 1 ether; + + mockERC20.mint(makerUser, 1 ether); + + vm.startPrank(makerUser); + mockERC20.approve(address(orderValidator.looksRareProtocol()), makerBid.price - 1 wei); + vm.stopPrank(); + + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerBid, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[5], ERC20_APPROVAL_INFERIOR_TO_PRICE); + } + + function testMakerAskERC721NotAllTokensAreApproved() public { + MockERC721 mockERC721 = new MockERC721(); + mockERC721.mint(makerUser, 0); + mockERC721.mint(makerUser, 1); + + OrderStructs.Maker memory makerAsk; + makerAsk.quoteType = QuoteType.Ask; + makerAsk.collectionType = CollectionType.ERC721; + makerAsk.collection = address(mockERC721); + makerAsk.signer = makerUser; + makerAsk.collectionType = CollectionType.ERC721; + + // Only approve token 0 but not token 1, this is to test the loop + vm.prank(makerUser); + mockERC721.approve(address(transferManager), 0); + + uint256[] memory itemIds = new uint256[](2); + itemIds[0] = 0; + itemIds[1] = 1; + makerAsk.itemIds = itemIds; + + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1; + amounts[1] = 1; + makerAsk.amounts = amounts; + + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerAsk, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[5], ERC721_NO_APPROVAL_FOR_ALL_OR_ITEM_ID); + } + + function testMakerAskDoesNotOwnERC721() public { + OrderStructs.Maker memory makerAsk; + makerAsk.quoteType = QuoteType.Ask; + makerAsk.collectionType = CollectionType.ERC721; + MockERC721 mockERC721 = new MockERC721(); + mockERC721.mint(address(this), 0); + makerAsk.collection = address(mockERC721); + makerAsk.signer = makerUser; + makerAsk.collectionType = CollectionType.ERC721; + uint256[] memory itemIds = new uint256[](1); + makerAsk.itemIds = itemIds; + + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerAsk, new bytes(65), _EMPTY_MERKLE_TREE); + + assertEq(validationCodes[5], ERC721_ITEM_ID_NOT_IN_BALANCE); + } + + function testMakerAskERC1155BalanceInferiorToAmountThroughBalanceOfBatch() public { + _testMakerAskERC1155BalanceInferiorToAmount(true); + } + + function testMakerAskERC1155BalanceInferiorToAmountThroughBalanceOf() public { + _testMakerAskERC1155BalanceInferiorToAmount(false); + } + + function _testMakerAskERC1155BalanceInferiorToAmount(bool revertBalanceOfBatch) public { + address collection; + if (revertBalanceOfBatch) { + MockERC1155WithoutBalanceOfBatch mockERC1155 = new MockERC1155WithoutBalanceOfBatch(); + collection = address(mockERC1155); + } else { + MockERC1155 mockERC1155 = new MockERC1155(); + collection = address(mockERC1155); + } + + OrderStructs.Maker memory makerAsk; + makerAsk.quoteType = QuoteType.Ask; + makerAsk.collectionType = CollectionType.ERC1155; + makerAsk.collection = collection; + makerAsk.signer = makerUser; + makerAsk.collectionType = CollectionType.ERC1155; + uint256[] memory itemIds = new uint256[](1); + makerAsk.itemIds = itemIds; + uint256[] memory amounts = new uint256[](1); + amounts[0] = 1; + makerAsk.amounts = amounts; + + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerAsk, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[5], ERC1155_BALANCE_OF_ITEM_ID_INFERIOR_TO_AMOUNT); + } + + function testMakerAskERC1155BalanceOfDoesNotExist() public { + MockERC1155WithoutAnyBalanceOf mockERC1155 = new MockERC1155WithoutAnyBalanceOf(); + + OrderStructs.Maker memory makerAsk; + makerAsk.quoteType = QuoteType.Ask; + makerAsk.collectionType = CollectionType.ERC1155; + makerAsk.collection = address(mockERC1155); + makerAsk.signer = makerUser; + makerAsk.collectionType = CollectionType.ERC1155; + uint256[] memory itemIds = new uint256[](1); + makerAsk.itemIds = itemIds; + uint256[] memory amounts = new uint256[](1); + amounts[0] = 1; + makerAsk.amounts = amounts; + + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerAsk, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[5], ERC1155_BALANCE_OF_DOES_NOT_EXIST); + } + + function testMakerAskERC1155IsApprovedForAllDoesNotExist() public { + MockERC1155WithoutIsApprovedForAll mockERC1155 = new MockERC1155WithoutIsApprovedForAll(); + mockERC1155.mint({to: makerUser, tokenId: 0, amount: 1}); + + OrderStructs.Maker memory makerAsk; + makerAsk.quoteType = QuoteType.Ask; + makerAsk.collectionType = CollectionType.ERC1155; + makerAsk.collection = address(mockERC1155); + makerAsk.signer = makerUser; + makerAsk.collectionType = CollectionType.ERC1155; + uint256[] memory itemIds = new uint256[](1); + makerAsk.itemIds = itemIds; + uint256[] memory amounts = new uint256[](1); + amounts[0] = 1; + makerAsk.amounts = amounts; + + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerAsk, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[5], ERC1155_IS_APPROVED_FOR_ALL_DOES_NOT_EXIST); + } + + function testMakerAskERC1155IsApprovedForAllReturnsFalse() public { + MockERC1155 mockERC1155 = new MockERC1155(); + mockERC1155.mint({to: makerUser, tokenId: 0, amount: 1}); + + OrderStructs.Maker memory makerAsk; + makerAsk.quoteType = QuoteType.Ask; + makerAsk.collectionType = CollectionType.ERC1155; + makerAsk.collection = address(mockERC1155); + makerAsk.signer = makerUser; + makerAsk.collectionType = CollectionType.ERC1155; + uint256[] memory itemIds = new uint256[](1); + makerAsk.itemIds = itemIds; + uint256[] memory amounts = new uint256[](1); + amounts[0] = 1; + makerAsk.amounts = amounts; + + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerAsk, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[5], ERC1155_NO_APPROVAL_FOR_ALL); + } + + // HYPERCERTS + + function _testMakerAskHypercertUnitsInferiorToAmount(bool revertBalanceOf) public { + address collection; + if (revertBalanceOf) { + MockHypercertMinterWithoutAnyBalanceOf mockHypercert = new MockHypercertMinterWithoutAnyBalanceOf(); + collection = address(mockHypercert); + } else { + MockHypercertMinter mockHypercert = new MockHypercertMinter(); + collection = address(mockHypercert); + } + + OrderStructs.Maker memory makerAsk; + makerAsk.quoteType = QuoteType.Ask; + makerAsk.collectionType = CollectionType.Hypercert; + makerAsk.collection = collection; + makerAsk.signer = makerUser; + makerAsk.collectionType = CollectionType.Hypercert; + uint256[] memory itemIds = new uint256[](1); + makerAsk.itemIds = itemIds; + uint256[] memory amounts = new uint256[](1); + amounts[0] = 1; + makerAsk.amounts = amounts; + + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerAsk, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[5], HYPERCERT_UNITS_NOT_HELD_BY_USER); + } + + function testMakerAskHypercertUnitsOfDoesNotExist() public { + MockHypercertMinterWithoutAnyUnitsOf mockHypercert = new MockHypercertMinterWithoutAnyUnitsOf(); + + OrderStructs.Maker memory makerAsk; + makerAsk.quoteType = QuoteType.Ask; + makerAsk.collectionType = CollectionType.Hypercert; + makerAsk.collection = address(mockHypercert); + makerAsk.signer = makerUser; + makerAsk.collectionType = CollectionType.Hypercert; + uint256[] memory itemIds = new uint256[](1); + makerAsk.itemIds = itemIds; + uint256[] memory amounts = new uint256[](1); + amounts[0] = 1; + makerAsk.amounts = amounts; + + uint256[9] memory validationCodes = + orderValidator.checkMakerOrderValidity(makerAsk, new bytes(65), _EMPTY_MERKLE_TREE); + assertEq(validationCodes[5], HYPERCERT_UNITS_OF_DOES_NOT_EXIST); + } +} diff --git a/contracts/test/foundry/marketplace/ProtocolBase.t.sol b/contracts/test/foundry/marketplace/ProtocolBase.t.sol new file mode 100644 index 00000000..e1928945 --- /dev/null +++ b/contracts/test/foundry/marketplace/ProtocolBase.t.sol @@ -0,0 +1,266 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.17; + +// WETH +import {WETH} from "solmate/src/tokens/WETH.sol"; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Core contracts +import {LooksRareProtocol, ILooksRareProtocol} from "@hypercerts/marketplace/LooksRareProtocol.sol"; +import {TransferManager} from "@hypercerts/marketplace/TransferManager.sol"; +import {ProtocolFeeRecipient} from "@hypercerts/marketplace/ProtocolFeeRecipient.sol"; +import {HypercertMinter} from "@hypercerts/protocol/HypercertMinter.sol"; +import {IHypercertToken} from "@hypercerts/protocol/interfaces/IHypercertToken.sol"; + +// Other contracts +import {OrderValidatorV2A} from "@hypercerts/marketplace/helpers/OrderValidatorV2A.sol"; + +// Mock files +import {MockERC20} from "../../mock/MockERC20.sol"; +import {MockERC721} from "../../mock/MockERC721.sol"; +import {MockERC721WithRoyalties} from "../../mock/MockERC721WithRoyalties.sol"; +import {MockERC1155} from "../../mock/MockERC1155.sol"; +import {MockRoyaltyFeeRegistry} from "../../mock/MockRoyaltyFeeRegistry.sol"; +import {MockHypercertMinterUUPS} from "../../mock/MockHypercertMinterUUPS.sol"; + +// Utils +import {MockOrderGenerator} from "./utils/MockOrderGenerator.sol"; + +contract ProtocolBase is MockOrderGenerator, ILooksRareProtocol { + address[] public operators; + + MockERC20 public looksRareToken; + MockERC721WithRoyalties public mockERC721WithRoyalties; + MockERC721 public mockERC721; + MockERC1155 public mockERC1155; + MockHypercertMinterUUPS public mockHypercertMinterUUPS; + HypercertMinter public mockHypercertMinter; + + IHypercertToken.TransferRestrictions public constant FROM_CREATOR_ONLY = + IHypercertToken.TransferRestrictions.FromCreatorOnly; + + ProtocolFeeRecipient public protocolFeeRecipient; + LooksRareProtocol public looksRareProtocol; + TransferManager public transferManager; + MockRoyaltyFeeRegistry public royaltyFeeRegistry; + OrderValidatorV2A public orderValidator; + + WETH public weth; + + function _assertMakerOrderReturnValidationCode( + OrderStructs.Maker memory makerOrder, + bytes memory signature, + uint256 expectedValidationCode + ) internal { + _assertMakerOrderReturnValidationCode(makerOrder, signature, _EMPTY_MERKLE_TREE, expectedValidationCode); + } + + function _assertMakerOrderReturnValidationCodeWithMerkleTree( + OrderStructs.Maker memory makerOrder, + bytes memory signature, + OrderStructs.MerkleTree memory merkleTree, + uint256 expectedValidationCode + ) internal { + _assertMakerOrderReturnValidationCode(makerOrder, signature, merkleTree, expectedValidationCode); + } + + function _assertMakerOrderReturnValidationCode( + OrderStructs.Maker memory makerOrder, + bytes memory signature, + OrderStructs.MerkleTree memory merkleTree, + uint256 expectedValidationCode + ) private { + OrderStructs.Maker[] memory makerOrders = new OrderStructs.Maker[](1); + makerOrders[0] = makerOrder; + + bytes[] memory signatures = new bytes[](1); + signatures[0] = signature; + + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](1); + merkleTrees[0] = merkleTree; + + uint256[9][] memory validationCodes = + orderValidator.checkMultipleMakerOrderValidities(makerOrders, signatures, merkleTrees); + + uint256 index = expectedValidationCode / 100; + assertEq(validationCodes[0][index - 1], expectedValidationCode); + } + + function _assertValidMakerOrder(OrderStructs.Maker memory makerOrder, bytes memory signature) internal { + _assertValidMakerOrder(makerOrder, signature, _EMPTY_MERKLE_TREE); + } + + function _assertValidMakerOrderWithMerkleTree( + OrderStructs.Maker memory makerOrder, + bytes memory signature, + OrderStructs.MerkleTree memory merkleTree + ) internal { + _assertValidMakerOrder(makerOrder, signature, merkleTree); + } + + function _assertValidMakerOrder( + OrderStructs.Maker memory makerOrder, + bytes memory signature, + OrderStructs.MerkleTree memory merkleTree + ) private { + OrderStructs.Maker[] memory makerOrders = new OrderStructs.Maker[](1); + makerOrders[0] = makerOrder; + + bytes[] memory signatures = new bytes[](1); + signatures[0] = signature; + + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](1); + merkleTrees[0] = merkleTree; + + uint256[9][] memory validationCodes = + orderValidator.checkMultipleMakerOrderValidities(makerOrders, signatures, merkleTrees); + + _assertValidationCodesAllZeroes(validationCodes); + } + + function _assertValidationCodesAllZeroes(uint256[9][] memory validationCodes) private { + for (uint256 i; i < validationCodes.length; i++) { + for (uint256 j; j < 9; j++) { + assertEq(validationCodes[i][j], 0); + } + } + } + + function _setUpUser(address user) internal asPrankedUser(user) { + // Do approvals for collections and WETH + mockERC721.setApprovalForAll(address(transferManager), true); + mockERC1155.setApprovalForAll(address(transferManager), true); + mockERC721WithRoyalties.setApprovalForAll(address(transferManager), true); + mockHypercertMinter.setApprovalForAll(address(transferManager), true); + + weth.approve(address(looksRareProtocol), type(uint256).max); + + // Grant approvals for transfer manager + transferManager.grantApprovals(operators); + + // Receive ETH and WETH + vm.deal(user, _initialETHBalanceUser + _initialWETHBalanceUser); + weth.deposit{value: _initialWETHBalanceUser}(); + } + + function _setUpUsers() internal { + _setUpUser(makerUser); + _setUpUser(takerUser); + } + + function _setupRegistryRoyalties(address collection, uint256 standardRoyaltyFee) internal { + vm.prank(royaltyFeeRegistry.owner()); + royaltyFeeRegistry.updateRoyaltyInfoForCollection( + collection, _royaltyRecipient, _royaltyRecipient, standardRoyaltyFee + ); + } + + function _setUp() internal { + vm.startPrank(_owner); + weth = new WETH(); + looksRareToken = new MockERC20(); + mockERC721 = new MockERC721(); + mockERC1155 = new MockERC1155(); + mockHypercertMinterUUPS = new MockHypercertMinterUUPS(); + mockHypercertMinterUUPS.setUp(); + mockHypercertMinter = mockHypercertMinterUUPS.minter(); + + transferManager = new TransferManager(_owner); + royaltyFeeRegistry = new MockRoyaltyFeeRegistry(_owner, 9500); + protocolFeeRecipient = new ProtocolFeeRecipient(0x5924A28caAF1cc016617874a2f0C3710d881f3c1, address(weth)); + looksRareProtocol = + new LooksRareProtocol(_owner, address(protocolFeeRecipient), address(transferManager), address(weth)); + mockERC721WithRoyalties = new MockERC721WithRoyalties(_royaltyRecipient, _standardRoyaltyFee); + + // Operations + transferManager.allowOperator(address(looksRareProtocol)); + looksRareProtocol.updateCurrencyStatus(ETH, true); + looksRareProtocol.updateCurrencyStatus(address(weth), true); + + // Fetch domain separator and store it as one of the operators + _domainSeparator = looksRareProtocol.domainSeparator(); + operators.push(address(looksRareProtocol)); + + // Deploy order validator contract + orderValidator = new OrderValidatorV2A(address(looksRareProtocol)); + + // Distribute ETH and WETH to protocol owner + vm.deal(_owner, _initialETHBalanceOwner + _initialWETHBalanceOwner); + weth.deposit{value: _initialWETHBalanceOwner}(); + vm.stopPrank(); + + // Distribute ETH and WETH to royalty recipient + vm.deal(_royaltyRecipient, _initialETHBalanceRoyaltyRecipient + _initialWETHBalanceRoyaltyRecipient); + vm.startPrank(_royaltyRecipient); + weth.deposit{value: _initialWETHBalanceRoyaltyRecipient}(); + vm.stopPrank(); + } + + function _genericTakerOrder() internal pure returns (OrderStructs.Taker memory takerOrder) { + takerOrder = OrderStructs.Taker(takerUser, abi.encode()); + } + + function _addStrategy(address strategy, bytes4 selector, bool isMakerBid) internal { + looksRareProtocol.addStrategy( + _standardProtocolFeeBp, _minTotalFeeBp, _maxProtocolFeeBp, selector, isMakerBid, strategy + ); + } + + function _assertStrategyAttributes( + address expectedStrategyAddress, + bytes4 expectedSelector, + bool expectedIsMakerBid + ) internal { + ( + bool strategyIsActive, + uint16 strategyStandardProtocolFee, + uint16 strategyMinTotalFee, + uint16 strategyMaxProtocolFee, + bytes4 strategySelector, + bool strategyIsMakerBid, + address strategyImplementation + ) = looksRareProtocol.strategyInfo(1); + + assertTrue(strategyIsActive); + assertEq(strategyStandardProtocolFee, _standardProtocolFeeBp); + assertEq(strategyMinTotalFee, _minTotalFeeBp); + assertEq(strategyMaxProtocolFee, _maxProtocolFeeBp); + assertEq(strategySelector, expectedSelector); + assertEq(strategyIsMakerBid, expectedIsMakerBid); + assertEq(strategyImplementation, expectedStrategyAddress); + } + + function _assertMockERC721Ownership(uint256[] memory itemIds, address owner) internal { + for (uint256 i; i < itemIds.length; i++) { + assertEq(mockERC721.ownerOf(itemIds[i]), owner); + } + } + + /** + * NOTE: It inherits from ILooksRareProtocol, so it + * needs to at least define the functions below. + */ + function executeTakerAsk( + OrderStructs.Taker calldata takerAsk, + OrderStructs.Maker calldata makerBid, + bytes calldata makerSignature, + OrderStructs.MerkleTree calldata merkleTree + ) external {} + + function executeTakerBid( + OrderStructs.Taker calldata takerBid, + OrderStructs.Maker calldata makerAsk, + bytes calldata makerSignature, + OrderStructs.MerkleTree calldata merkleTree + ) external payable {} + + function executeMultipleTakerBids( + OrderStructs.Taker[] calldata takerBids, + OrderStructs.Maker[] calldata makerAsks, + bytes[] calldata makerSignatures, + OrderStructs.MerkleTree[] calldata merkleTrees, + bool isAtomic + ) external payable {} +} diff --git a/contracts/test/foundry/marketplace/ProtocolFeeRecipient.t.sol b/contracts/test/foundry/marketplace/ProtocolFeeRecipient.t.sol new file mode 100644 index 00000000..0b30803f --- /dev/null +++ b/contracts/test/foundry/marketplace/ProtocolFeeRecipient.t.sol @@ -0,0 +1,110 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.17; + +// LooksRare unopinionated libraries +import {IERC20} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC20.sol"; +import {IWETH} from "@looksrare/contracts-libs/contracts/interfaces/generic/IWETH.sol"; + +// Core contracts +import {ProtocolFeeRecipient} from "@hypercerts/marketplace/ProtocolFeeRecipient.sol"; + +// Other mocks and utils +import {MockERC20} from "../../mock/MockERC20.sol"; +import {TestParameters} from "./utils/TestParameters.sol"; + +contract ProtocolFeeRecipientTest is TestParameters { + ProtocolFeeRecipient private protocolFeeRecipient; + uint256 private feeSharingSetterInitialWETHBalance; + + address private constant FEE_SHARING_SETTER = 0x5924A28caAF1cc016617874a2f0C3710d881f3c1; + uint256 private constant DUST = 0.6942 ether; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl("mainnet")); + protocolFeeRecipient = new ProtocolFeeRecipient(FEE_SHARING_SETTER, WETH_MAINNET); + feeSharingSetterInitialWETHBalance = IERC20(WETH_MAINNET).balanceOf(FEE_SHARING_SETTER); + + vm.deal(address(protocolFeeRecipient), 0); + deal(WETH_MAINNET, address(protocolFeeRecipient), 0); + } + + function test_TransferETH_NoWETHBalance_WithETHBalance() public { + _sendETHToProtocolFeeRecipient(); + + protocolFeeRecipient.transferETH(); + + assertEq(address(protocolFeeRecipient).balance, 0); + assertEq(IERC20(WETH_MAINNET).balanceOf(address(protocolFeeRecipient)), 0); + assertEq(IERC20(WETH_MAINNET).balanceOf(FEE_SHARING_SETTER), feeSharingSetterInitialWETHBalance + 1 ether); + } + + function test_TransferETH_WithWETHBalance_WithETHBalance() public { + _sendETHToProtocolFeeRecipient(); + _sendWETHToProtocolFeeRecipient(); + + protocolFeeRecipient.transferETH(); + + assertEq(address(protocolFeeRecipient).balance, 0); + assertEq(IERC20(WETH_MAINNET).balanceOf(address(protocolFeeRecipient)), 0); + assertEq( + IERC20(WETH_MAINNET).balanceOf(FEE_SHARING_SETTER), feeSharingSetterInitialWETHBalance + 1 ether + DUST + ); + } + + function test_TransferETH_WithWETHBalance_NoETHBalance() public { + _sendWETHToProtocolFeeRecipient(); + + protocolFeeRecipient.transferETH(); + + assertEq(address(protocolFeeRecipient).balance, 0); + assertEq(IERC20(WETH_MAINNET).balanceOf(address(protocolFeeRecipient)), 0); + assertEq(IERC20(WETH_MAINNET).balanceOf(FEE_SHARING_SETTER), feeSharingSetterInitialWETHBalance + DUST); + } + + function test_TransferETH_RevertIf_NothingToTransfer() public { + vm.expectRevert(ProtocolFeeRecipient.NothingToTransfer.selector); + protocolFeeRecipient.transferETH(); + } + + function test_TransferWETH() public { + _sendWETHToProtocolFeeRecipient(); + + protocolFeeRecipient.transferERC20(WETH_MAINNET); + + assertEq(IERC20(WETH_MAINNET).balanceOf(address(protocolFeeRecipient)), 0); + assertEq(IERC20(WETH_MAINNET).balanceOf(FEE_SHARING_SETTER), feeSharingSetterInitialWETHBalance + DUST); + } + + function test_TransferWETH_RevertIf_NothingToTransfer() public { + vm.expectRevert(ProtocolFeeRecipient.NothingToTransfer.selector); + protocolFeeRecipient.transferERC20(WETH_MAINNET); + } + + function test_TransferERC20() public { + MockERC20 mockERC20 = new MockERC20(); + mockERC20.mint(address(protocolFeeRecipient), DUST); + + protocolFeeRecipient.transferERC20(address(mockERC20)); + + assertEq(mockERC20.balanceOf(address(protocolFeeRecipient)), 0); + assertEq(mockERC20.balanceOf(FEE_SHARING_SETTER), DUST); + } + + function test_TransferERC20_RevertIf_NothingToTransfer() public { + MockERC20 mockERC20 = new MockERC20(); + vm.expectRevert(ProtocolFeeRecipient.NothingToTransfer.selector); + protocolFeeRecipient.transferERC20(address(mockERC20)); + } + + function _sendETHToProtocolFeeRecipient() private { + (bool success,) = address(protocolFeeRecipient).call{value: 1 ether}(""); + assertTrue(success); + assertEq(address(protocolFeeRecipient).balance, 1 ether); + } + + function _sendWETHToProtocolFeeRecipient() private { + IWETH(WETH_MAINNET).deposit{value: DUST}(); + IERC20(WETH_MAINNET).transfer(address(protocolFeeRecipient), DUST); + assertEq(IERC20(WETH_MAINNET).balanceOf(address(protocolFeeRecipient)), DUST); + } +} diff --git a/contracts/test/foundry/marketplace/Sandbox.t.sol b/contracts/test/foundry/marketplace/Sandbox.t.sol new file mode 100644 index 00000000..9a349fd5 --- /dev/null +++ b/contracts/test/foundry/marketplace/Sandbox.t.sol @@ -0,0 +1,142 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {IERC721} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC721.sol"; +import {IERC1155} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC1155.sol"; + +// Libraries and interfaces +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract SandboxTest is ProtocolBase { + error ERC721TransferFromFail(); + + // Fixed price of sale + uint256 private constant price = 1 ether; + + // Sandbox on Ethereum mainnet + address private constant SANDBOX = 0xa342f5D851E866E18ff98F351f2c6637f4478dB5; + + // Forked block number to run the tests + uint256 private constant FORKED_BLOCK_NUMBER = 16_268_000; + + function _transferItemIdToUser(address user) private returns (uint256 itemId) { + // @dev This user had 23 of the itemId at the forked block number + address ownerOfItemId = 0x7A9fe22691c811ea339D9B73150e6911a5343DcA; + itemId = 55_464_657_044_963_196_816_950_587_289_035_428_064_568_320_970_692_304_673_817_341_489_688_428_423_171; + vm.prank(ownerOfItemId); + IERC1155(SANDBOX).safeTransferFrom(ownerOfItemId, user, itemId, 23, ""); + } + + function _setUpApprovalsForSandbox(address user) internal { + vm.prank(user); + IERC1155(SANDBOX).setApprovalForAll(address(transferManager), true); + } + + function setUp() public { + vm.createSelectFork(vm.rpcUrl("mainnet"), FORKED_BLOCK_NUMBER); + _setUp(); + _setUpUsers(); + } + + /** + * @notice Sandbox implements both ERC721 and ERC1155 interfaceIds. + * This test verifies that only collectionType = 1 works. + * It is for taker ask (matching maker bid). + */ + function testTakerAskCannotTransferSandboxWithERC721CollectionTypeButERC1155CollectionTypeWorks() public { + // Taker user is the one selling the item + _setUpApprovalsForSandbox(takerUser); + uint256 itemId = _transferItemIdToUser(takerUser); + + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, // it should be ERC1155 + orderNonce: 0, + collection: SANDBOX, + currency: address(weth), + signer: makerUser, + price: price, + itemId: itemId + }); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Prepare the taker ask + OrderStructs.Taker memory takerAsk = _genericTakerOrder(); + + // It should fail with collectionType = 0 + vm.expectRevert(abi.encodeWithSelector(ERC721TransferFromFail.selector)); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // Adjust the collection type and sign order again + makerBid.collectionType = CollectionType.ERC1155; + signature = _signMakerOrder(makerBid, makerUserPK); + + // It shouldn't fail with collectionType = 0 + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // Maker user has received the Sandbox asset + assertEq(IERC1155(SANDBOX).balanceOf(makerUser, itemId), makerBid.amounts[0]); + } + + /** + * @notice Sandbox implements both ERC721 and ERC1155 interfaceIds. + * This test verifies that only collectionType = 1 works. + * It is for taker bid (matching maker ask). + */ + function testTakerBidCannotTransferSandboxWithERC721CollectionTypeButERC1155CollectionTypeWorks() public { + // Maker user is the one selling the item + _setUpApprovalsForSandbox(makerUser); + uint256 itemId = _transferItemIdToUser(makerUser); + + OrderStructs.Maker memory makerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, // it should be ERC1155 + orderNonce: 0, + collection: SANDBOX, + currency: ETH, + signer: makerUser, + price: price, + itemId: itemId + }); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Prepare the taker bid + OrderStructs.Taker memory takerBid = _genericTakerOrder(); + + // It should fail with collectionType = 0 + vm.expectRevert(abi.encodeWithSelector(ERC721TransferFromFail.selector)); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + // Adjust the collection type and sign order again + makerAsk.collectionType = CollectionType.ERC1155; + signature = _signMakerOrder(makerAsk, makerUserPK); + + // It shouldn't fail with collectionType = 0 + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + // Taker user has received the Sandbox asset + assertEq(IERC1155(SANDBOX).balanceOf(takerUser, itemId), makerAsk.amounts[0]); + } +} diff --git a/contracts/test/foundry/marketplace/SignaturesEIP2098.t.sol b/contracts/test/foundry/marketplace/SignaturesEIP2098.t.sol new file mode 100644 index 00000000..ea02561a --- /dev/null +++ b/contracts/test/foundry/marketplace/SignaturesEIP2098.t.sol @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries, interfaces, errors +import "@looksrare/contracts-libs/contracts/errors/SignatureCheckerErrors.sol"; +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract SignaturesEIP2098Test is ProtocolBase { + function setUp() public { + _setUp(); + } + + function testCanSignValidMakerAskEIP2098(uint256 price, uint256 itemId) public { + vm.assume(price <= 2 ether); + + _setUpUsers(); + _setupRegistryRoyalties(address(mockERC721), _standardRoyaltyFee); + + (OrderStructs.Maker memory makerAsk,) = _createMockMakerAskAndTakerBid(address(mockERC721)); + makerAsk.price = price; + makerAsk.itemIds[0] = itemId; + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Mint asset + mockERC721.mint(makerUser, makerAsk.itemIds[0]); + + // Adjust the signature + signature = _eip2098Signature(signature); + + // Verify validity of maker ask order + _assertValidMakerOrder(makerAsk, signature); + } + + function testCanSignValidMakerBidEIP2098(uint256 price, uint256 itemId) public { + vm.assume(price <= 2 ether); + + _setUpUsers(); + _setupRegistryRoyalties(address(mockERC721), _standardRoyaltyFee); + + (OrderStructs.Maker memory makerBid,) = _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + makerBid.price = price; + makerBid.itemIds[0] = itemId; + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Adjust the signature + signature = _eip2098Signature(signature); + + // Mint asset + mockERC721.mint(takerUser, makerBid.itemIds[0]); + + // Verify validity of maker bid order + _assertValidMakerOrder(makerBid, signature); + } +} diff --git a/contracts/test/foundry/marketplace/SignaturesERC1271WalletForERC1155.t.sol b/contracts/test/foundry/marketplace/SignaturesERC1271WalletForERC1155.t.sol new file mode 100644 index 00000000..739b131a --- /dev/null +++ b/contracts/test/foundry/marketplace/SignaturesERC1271WalletForERC1155.t.sol @@ -0,0 +1,438 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries and interfaces +import {IReentrancyGuard} from "@looksrare/contracts-libs/contracts/interfaces/IReentrancyGuard.sol"; +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Mocks and other utils +import {ERC1271Wallet} from "./utils/ERC1271Wallet.sol"; +import {MaliciousERC1271Wallet} from "./utils/MaliciousERC1271Wallet.sol"; +import {MaliciousOnERC1155ReceivedERC1271Wallet} from "./utils/MaliciousOnERC1155ReceivedERC1271Wallet.sol"; +import {MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet} from + "./utils/MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet.sol"; +import {MaliciousIsValidSignatureERC1271Wallet} from "./utils/MaliciousIsValidSignatureERC1271Wallet.sol"; + +// Errors +import {SignatureERC1271Invalid} from "@looksrare/contracts-libs/contracts/errors/SignatureCheckerErrors.sol"; +import { + ERC1155SafeTransferFromFail, + ERC1155SafeBatchTransferFromFail +} from "@looksrare/contracts-libs/contracts/errors/LowLevelErrors.sol"; +import {SIGNATURE_INVALID_EIP1271} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +/** + * @dev ERC1271Wallet recovers a signature's signer using ECDSA. If it matches the mock wallet's + * owner, it returns the magic value. Otherwise it returns an empty bytes4 value. + */ +contract SignaturesERC1271WalletForERC1155Test is ProtocolBase { + uint256 private constant price = 1 ether; // Fixed price of sale + uint256 private constant itemId = 0; + bytes private constant _EMPTY_SIGNATURE = new bytes(0); + + function setUp() public { + _setUp(); + _setUpUser(takerUser); + _setupRegistryRoyalties(address(mockERC1155), _standardRoyaltyFee); + } + + function testTakerBid() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _takerBidSetup(address(wallet)); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + vm.startPrank(address(wallet)); + mockERC1155.setApprovalForAll(address(transferManager), true); + transferManager.grantApprovals(operators); + vm.stopPrank(); + + _assertValidMakerOrder(makerAsk, signature); + + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + assertEq(mockERC1155.balanceOf(takerUser, itemId), 1); + } + + function testTakerBidInvalidSignature() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _takerBidSetup(address(wallet)); + + // Signed by a different private key + bytes memory signature = _signMakerOrder(makerAsk, takerUserPK); + + vm.startPrank(address(wallet)); + mockERC1155.setApprovalForAll(address(transferManager), true); + transferManager.grantApprovals(operators); + vm.stopPrank(); + + _assertMakerOrderReturnValidationCode(makerAsk, signature, SIGNATURE_INVALID_EIP1271); + + vm.expectRevert(SignatureERC1271Invalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerBidIsInvalidSignatureReentrancy() public { + MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = + new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol)); + _setUpUser(address(maliciousERC1271Wallet)); + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerBid); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _takerBidSetup(address(maliciousERC1271Wallet)); + + vm.expectRevert(IReentrancyGuard.ReentrancyFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, _EMPTY_SIGNATURE, _EMPTY_MERKLE_TREE); + } + + function testTakerAsk() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = _takerAskSetup(address(wallet)); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Wallet needs to hold WETH and have given WETH approval + deal(address(weth), address(wallet), price); + vm.prank(address(wallet)); + weth.approve(address(looksRareProtocol), price); + + _assertValidMakerOrder(makerBid, signature); + + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + assertEq(mockERC1155.balanceOf(address(wallet), itemId), 1); + } + + function testTakerAskInvalidSignature() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = _takerAskSetup(address(wallet)); + + // Signed by a different private key + bytes memory signature = _signMakerOrder(makerBid, takerUserPK); + + // Wallet needs to hold WETH and have given WETH approval + deal(address(weth), address(wallet), price); + vm.prank(address(wallet)); + weth.approve(address(looksRareProtocol), price); + + _assertMakerOrderReturnValidationCode(makerBid, signature, SIGNATURE_INVALID_EIP1271); + + vm.expectRevert(SignatureERC1271Invalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerAskIsValidSignatureReentrancy() public { + MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = + new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol)); + _setUpUser(address(maliciousERC1271Wallet)); + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerAsk); + + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = + _takerAskSetup(address(maliciousERC1271Wallet)); + + vm.expectRevert(IReentrancyGuard.ReentrancyFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, _EMPTY_SIGNATURE, _EMPTY_MERKLE_TREE); + } + + function testTakerAskOnERC1155ReceivedReentrancy() public { + MaliciousOnERC1155ReceivedERC1271Wallet maliciousERC1271Wallet = + new MaliciousOnERC1155ReceivedERC1271Wallet(address(looksRareProtocol)); + _setUpUser(address(maliciousERC1271Wallet)); + + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = + _takerAskSetup(address(maliciousERC1271Wallet)); + + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerAsk); + + vm.expectRevert(ERC1155SafeTransferFromFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, _EMPTY_SIGNATURE, _EMPTY_MERKLE_TREE); + } + + function testBatchTakerAsk() public { + ERC1271Wallet wallet = new ERC1271Wallet(makerUser); + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = _batchTakerAskSetup(address(wallet)); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Wallet needs to hold WETH and have given WETH approval + deal(address(weth), address(wallet), price); + vm.prank(address(wallet)); + weth.approve(address(looksRareProtocol), price); + + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + for (uint256 i; i < 10; i++) { + assertEq(mockERC1155.balanceOf(address(wallet), i), 1); + } + } + + function testBatchTakerAskOnERC1155BatchReceivedReentrancy() public { + MaliciousOnERC1155ReceivedERC1271Wallet maliciousERC1271Wallet = + new MaliciousOnERC1155ReceivedERC1271Wallet(address(looksRareProtocol)); + _setUpUser(address(maliciousERC1271Wallet)); + + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = + _batchTakerAskSetup(address(maliciousERC1271Wallet)); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Wallet needs to hold WETH and have given WETH approval + deal(address(weth), address(maliciousERC1271Wallet), price); + vm.prank(address(maliciousERC1271Wallet)); + weth.approve(address(looksRareProtocol), price); + + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerAsk); + + vm.expectRevert(ERC1155SafeBatchTransferFromFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + uint256 private constant numberOfPurchases = 3; + + function testExecuteMultipleTakerBids() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + + ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) = _multipleTakerBidsSetup(address(wallet)); + + vm.startPrank(address(wallet)); + mockERC1155.setApprovalForAll(address(transferManager), true); + transferManager.grantApprovals(operators); + vm.stopPrank(); + + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberOfPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + for (uint256 i; i < numberOfPurchases; i++) { + assertEq(mockERC1155.balanceOf(takerUser, i), 1); + } + } + + function testExecuteMultipleTakerBidsInvalidSignatures() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + + ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) = _multipleTakerBidsSetup(address(wallet)); + + // Signed by a different private key + for (uint256 i; i < signatures.length; i++) { + signatures[i] = _signMakerOrder(makerAsks[i], takerUserPK); + } + + vm.startPrank(address(wallet)); + mockERC1155.setApprovalForAll(address(transferManager), true); + transferManager.grantApprovals(operators); + vm.stopPrank(); + + vm.expectRevert(SignatureERC1271Invalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberOfPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + } + + function testExecuteMultipleTakerBidsIsValidSignatureReentrancy() public { + MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = + new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol)); + _setUpUser(address(maliciousERC1271Wallet)); + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteMultipleTakerBids); + + ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) = _multipleTakerBidsSetup(address(maliciousERC1271Wallet)); + + vm.expectRevert(IReentrancyGuard.ReentrancyFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberOfPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + for (uint256 i; i < numberOfPurchases - 1; i++) { + assertEq(mockERC1155.balanceOf(takerUser, i), 0); + } + } + + function testExecuteMultipleTakerBidsOnERC1155ReceivedReentrancyOnlyInTheLastCall() public { + MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet maliciousERC1271Wallet = + new MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet(takerUser); + _setUpUser(makerUser); + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteMultipleTakerBids); + + ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) = _multipleTakerBidsSetup(makerUser); + + // Set the NFT recipient as the ERC1271 wallet to trigger onERC1155Received + for (uint256 i; i < numberOfPurchases; i++) { + takerBids[i].recipient = address(maliciousERC1271Wallet); + } + + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberOfPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + // First 2 purchases should go through, but the last one fails silently + for (uint256 i; i < numberOfPurchases - 1; i++) { + assertEq(mockERC1155.balanceOf(address(maliciousERC1271Wallet), i), 1); + } + assertEq(mockERC1155.balanceOf(address(maliciousERC1271Wallet), numberOfPurchases - 1), 0); + } + + function _takerBidSetup(address signer) + private + returns (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) + { + // Mint asset + mockERC1155.mint(signer, itemId, 1); + + makerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC1155, + orderNonce: 0, + collection: address(mockERC1155), + currency: ETH, + signer: signer, + price: price, + itemId: itemId + }); + + // Prepare the taker bid + takerBid = _genericTakerOrder(); + } + + function _takerAskSetup(address signer) + private + returns (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) + { + makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC1155, + orderNonce: 0, + collection: address(mockERC1155), + currency: address(weth), + signer: signer, + price: price, + itemId: itemId + }); + + // Mint asset + mockERC1155.mint(takerUser, itemId, 1); + + // Prepare the taker ask + takerAsk = _genericTakerOrder(); + } + + function _batchTakerAskSetup(address signer) + private + returns (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) + { + uint256[] memory itemIds = new uint256[](10); + uint256[] memory amounts = new uint256[](10); + + for (uint256 i; i < 10; i++) { + itemIds[i] = i; + amounts[i] = 1; + + // Mint asset + mockERC1155.mint(takerUser, i, 1); + } + + // Prepare the first order + makerBid = _createMultiItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC1155, + orderNonce: 0, + collection: address(mockERC1155), + currency: address(weth), + signer: signer, + price: price, + itemIds: itemIds, + amounts: amounts + }); + + // Prepare the taker ask + takerAsk = _genericTakerOrder(); + } + + function _multipleTakerBidsSetup(address signer) + private + returns ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) + { + makerAsks = new OrderStructs.Maker[](numberOfPurchases); + takerBids = new OrderStructs.Taker[](numberOfPurchases); + signatures = new bytes[](numberOfPurchases); + + for (uint256 i; i < numberOfPurchases; i++) { + // Mint asset + mockERC1155.mint(signer, i, 1); + + makerAsks[i] = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC1155, + orderNonce: i, + collection: address(mockERC1155), + currency: ETH, + signer: signer, + price: price, + itemId: i // 0, 1, etc. + }); + + signatures[i] = _signMakerOrder(makerAsks[i], makerUserPK); + + takerBids[i] = _genericTakerOrder(); + } + + // Other execution parameters + merkleTrees = new OrderStructs.MerkleTree[](numberOfPurchases); + } +} diff --git a/contracts/test/foundry/marketplace/SignaturesERC1271WalletForERC721.t.sol b/contracts/test/foundry/marketplace/SignaturesERC1271WalletForERC721.t.sol new file mode 100644 index 00000000..28a09020 --- /dev/null +++ b/contracts/test/foundry/marketplace/SignaturesERC1271WalletForERC721.t.sol @@ -0,0 +1,275 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries and interfaces +import {IReentrancyGuard} from "@looksrare/contracts-libs/contracts/interfaces/IReentrancyGuard.sol"; +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Mocks and other utils +import {ERC1271Wallet} from "./utils/ERC1271Wallet.sol"; +import {MaliciousERC1271Wallet} from "./utils/MaliciousERC1271Wallet.sol"; +import {MaliciousIsValidSignatureERC1271Wallet} from "./utils/MaliciousIsValidSignatureERC1271Wallet.sol"; + +// Errors +import {SignatureERC1271Invalid} from "@looksrare/contracts-libs/contracts/errors/SignatureCheckerErrors.sol"; +import {SIGNATURE_INVALID_EIP1271} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +/** + * @dev ERC1271Wallet recovers a signature's signer using ECDSA. If it matches the mock wallet's + * owner, it returns the magic value. Otherwise it returns an empty bytes4 value. + */ +contract SignaturesERC1271WalletForERC721Test is ProtocolBase { + uint256 private constant price = 1 ether; // Fixed price of sale + bytes private constant _EMPTY_SIGNATURE = new bytes(0); + + function setUp() public { + _setUp(); + _setUpUser(takerUser); + _setupRegistryRoyalties(address(mockERC721), _standardRoyaltyFee); + } + + function testTakerBid() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _takerBidSetup(address(wallet)); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + vm.startPrank(address(wallet)); + mockERC721.setApprovalForAll(address(transferManager), true); + transferManager.grantApprovals(operators); + vm.stopPrank(); + + _assertValidMakerOrder(makerAsk, signature); + + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + assertEq(mockERC721.ownerOf(makerAsk.itemIds[0]), takerUser); + } + + function testTakerBidInvalidSignature() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _takerBidSetup(address(wallet)); + + // Signed by a different private key + bytes memory signature = _signMakerOrder(makerAsk, takerUserPK); + + vm.startPrank(address(wallet)); + mockERC721.setApprovalForAll(address(transferManager), true); + transferManager.grantApprovals(operators); + vm.stopPrank(); + + _assertMakerOrderReturnValidationCode(makerAsk, signature, SIGNATURE_INVALID_EIP1271); + + vm.expectRevert(SignatureERC1271Invalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerBidReentrancy() public { + MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = + new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol)); + _setUpUser(address(maliciousERC1271Wallet)); + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerBid); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _takerBidSetup(address(maliciousERC1271Wallet)); + + vm.expectRevert(IReentrancyGuard.ReentrancyFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, _EMPTY_SIGNATURE, _EMPTY_MERKLE_TREE); + } + + function testTakerAsk() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = _takerAskSetup(address(wallet)); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Wallet needs to hold WETH and have given WETH approval + deal(address(weth), address(wallet), price); + vm.prank(address(wallet)); + weth.approve(address(looksRareProtocol), price); + + _assertValidMakerOrder(makerBid, signature); + + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + assertEq(mockERC721.ownerOf(makerBid.itemIds[0]), address(wallet)); + } + + function testTakerAskInvalidSignature() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = _takerAskSetup(address(wallet)); + + // Signed by a different private key + bytes memory signature = _signMakerOrder(makerBid, takerUserPK); + + // Wallet needs to hold WETH and have given WETH approval + deal(address(weth), address(wallet), price); + vm.prank(address(wallet)); + weth.approve(address(looksRareProtocol), price); + + _assertMakerOrderReturnValidationCode(makerBid, signature, SIGNATURE_INVALID_EIP1271); + + vm.expectRevert(SignatureERC1271Invalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerAskReentrancy() public { + MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = + new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol)); + _setUpUser(address(maliciousERC1271Wallet)); + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerAsk); + + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = + _takerAskSetup(address(maliciousERC1271Wallet)); + + vm.expectRevert(IReentrancyGuard.ReentrancyFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, _EMPTY_SIGNATURE, _EMPTY_MERKLE_TREE); + } + + uint256 private constant numberPurchases = 3; + + function testExecuteMultipleTakerBids() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + + ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) = _multipleTakerBidsSetup(address(wallet)); + + vm.startPrank(address(wallet)); + mockERC721.setApprovalForAll(address(transferManager), true); + transferManager.grantApprovals(operators); + vm.stopPrank(); + + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + for (uint256 i; i < numberPurchases; i++) { + assertEq(mockERC721.ownerOf(i), takerUser); + } + } + + function testExecuteMultipleTakerBidsInvalidSignatures() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + + ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) = _multipleTakerBidsSetup(address(wallet)); + + // Signed by a different private key + for (uint256 i; i < signatures.length; i++) { + signatures[i] = _signMakerOrder(makerAsks[i], takerUserPK); + } + + vm.startPrank(address(wallet)); + mockERC721.setApprovalForAll(address(transferManager), true); + transferManager.grantApprovals(operators); + vm.stopPrank(); + + vm.expectRevert(SignatureERC1271Invalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + } + + function testExecuteMultipleTakerBidsReentrancy() public { + MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = + new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol)); + _setUpUser(address(maliciousERC1271Wallet)); + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteMultipleTakerBids); + + ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) = _multipleTakerBidsSetup(address(maliciousERC1271Wallet)); + + vm.expectRevert(IReentrancyGuard.ReentrancyFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + } + + function _takerBidSetup(address signer) + private + returns (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) + { + (makerAsk, takerBid) = _createMockMakerAskAndTakerBid(address(mockERC721)); + makerAsk.signer = signer; + // Mint asset + mockERC721.mint(signer, makerAsk.itemIds[0]); + } + + function _takerAskSetup(address signer) + private + returns (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) + { + (makerBid, takerAsk) = _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + makerBid.signer = signer; + // Mint asset + mockERC721.mint(takerUser, makerBid.itemIds[0]); + } + + function _multipleTakerBidsSetup(address signer) + private + returns ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) + { + makerAsks = new OrderStructs.Maker[](numberPurchases); + takerBids = new OrderStructs.Taker[](numberPurchases); + signatures = new bytes[](numberPurchases); + + for (uint256 i; i < numberPurchases; i++) { + // Mint asset + mockERC721.mint(signer, i); + + makerAsks[i] = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: i, + collection: address(mockERC721), + currency: ETH, + signer: signer, + price: price, + itemId: i // 0, 1, etc. + }); + + signatures[i] = _signMakerOrder(makerAsks[i], makerUserPK); + + takerBids[i] = _genericTakerOrder(); + } + + // Other execution parameters + merkleTrees = new OrderStructs.MerkleTree[](numberPurchases); + } +} diff --git a/contracts/test/foundry/marketplace/SignaturesERC1271WalletForHypercert.t.sol b/contracts/test/foundry/marketplace/SignaturesERC1271WalletForHypercert.t.sol new file mode 100644 index 00000000..77f15033 --- /dev/null +++ b/contracts/test/foundry/marketplace/SignaturesERC1271WalletForHypercert.t.sol @@ -0,0 +1,447 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries and interfaces +import {IReentrancyGuard} from "@looksrare/contracts-libs/contracts/interfaces/IReentrancyGuard.sol"; +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Mocks and other utils +import {ERC1271Wallet} from "./utils/ERC1271Wallet.sol"; +import {MaliciousERC1271Wallet} from "./utils/MaliciousERC1271Wallet.sol"; +import {MaliciousOnERC1155ReceivedERC1271Wallet} from "./utils/MaliciousOnERC1155ReceivedERC1271Wallet.sol"; +import {MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet} from + "./utils/MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet.sol"; +import {MaliciousIsValidSignatureERC1271Wallet} from "./utils/MaliciousIsValidSignatureERC1271Wallet.sol"; + +// Errors +import {SignatureERC1271Invalid} from "@looksrare/contracts-libs/contracts/errors/SignatureCheckerErrors.sol"; +import { + ERC1155SafeTransferFromFail, + ERC1155SafeBatchTransferFromFail +} from "@looksrare/contracts-libs/contracts/errors/LowLevelErrors.sol"; +import {SIGNATURE_INVALID_EIP1271} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +/** + * @dev ERC1271Wallet recovers a signature's signer using ECDSA. If it matches the mock wallet's + * owner, it returns the magic value. Otherwise it returns an empty bytes4 value. + */ +contract SignaturesERC1271WalletForHypercertTest is ProtocolBase { + uint256 private constant price = 1 ether; // Fixed price of sale + uint256 private constant fractionId = (1 << 128) + 1; + bytes private constant _EMPTY_SIGNATURE = new bytes(0); + + function setUp() public { + _setUp(); + _setUpUser(takerUser); + _setupRegistryRoyalties(address(mockHypercertMinter), _standardRoyaltyFee); + } + + function testTakerBid() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _takerBidSetup(address(wallet)); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + vm.startPrank(address(wallet)); + mockHypercertMinter.setApprovalForAll(address(transferManager), true); + transferManager.grantApprovals(operators); + vm.stopPrank(); + + _assertValidMakerOrder(makerAsk, signature); + + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + assertEq(mockHypercertMinter.balanceOf(takerUser, fractionId), 1); + } + + function testTakerBidInvalidSignature() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _takerBidSetup(address(wallet)); + + // Signed by a different private key + bytes memory signature = _signMakerOrder(makerAsk, takerUserPK); + + vm.startPrank(address(wallet)); + mockHypercertMinter.setApprovalForAll(address(transferManager), true); + transferManager.grantApprovals(operators); + vm.stopPrank(); + + _assertMakerOrderReturnValidationCode(makerAsk, signature, SIGNATURE_INVALID_EIP1271); + + vm.expectRevert(SignatureERC1271Invalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerBidIsInvalidSignatureReentrancy() public { + MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = + new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol)); + _setUpUser(address(maliciousERC1271Wallet)); + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerBid); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _takerBidSetup(address(maliciousERC1271Wallet)); + + vm.expectRevert(IReentrancyGuard.ReentrancyFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, _EMPTY_SIGNATURE, _EMPTY_MERKLE_TREE); + } + + function testTakerAsk() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = _takerAskSetup(address(wallet)); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Wallet needs to hold WETH and have given WETH approval + deal(address(weth), address(wallet), price); + vm.prank(address(wallet)); + weth.approve(address(looksRareProtocol), price); + + _assertValidMakerOrder(makerBid, signature); + + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + assertEq(mockHypercertMinter.balanceOf(address(wallet), fractionId), 1); + } + + function testTakerAskInvalidSignature() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = _takerAskSetup(address(wallet)); + + // Signed by a different private key + bytes memory signature = _signMakerOrder(makerBid, takerUserPK); + + // Wallet needs to hold WETH and have given WETH approval + deal(address(weth), address(wallet), price); + vm.prank(address(wallet)); + weth.approve(address(looksRareProtocol), price); + + _assertMakerOrderReturnValidationCode(makerBid, signature, SIGNATURE_INVALID_EIP1271); + + vm.expectRevert(SignatureERC1271Invalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerAskIsValidSignatureReentrancy() public { + MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = + new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol)); + _setUpUser(address(maliciousERC1271Wallet)); + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerAsk); + + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = + _takerAskSetup(address(maliciousERC1271Wallet)); + + vm.expectRevert(IReentrancyGuard.ReentrancyFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, _EMPTY_SIGNATURE, _EMPTY_MERKLE_TREE); + } + + function testTakerAskOnERC1155ReceivedReentrancy() public { + MaliciousOnERC1155ReceivedERC1271Wallet maliciousERC1271Wallet = + new MaliciousOnERC1155ReceivedERC1271Wallet(address(looksRareProtocol)); + _setUpUser(address(maliciousERC1271Wallet)); + + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = + _takerAskSetup(address(maliciousERC1271Wallet)); + + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerAsk); + + vm.expectRevert(ERC1155SafeTransferFromFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, _EMPTY_SIGNATURE, _EMPTY_MERKLE_TREE); + } + + function testBatchTakerAsk() public { + ERC1271Wallet wallet = new ERC1271Wallet(makerUser); + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = _batchTakerAskSetup(address(wallet)); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Wallet needs to hold WETH and have given WETH approval + deal(address(weth), address(wallet), price); + vm.prank(address(wallet)); + weth.approve(address(looksRareProtocol), price); + + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + for (uint256 i; i < 10; i++) { + assertEq(mockHypercertMinter.balanceOf(address(wallet), (((1 + i) << 128) + 1)), 1); + } + } + + function testBatchTakerAskOnERC1155BatchReceivedReentrancy() public { + MaliciousOnERC1155ReceivedERC1271Wallet maliciousERC1271Wallet = + new MaliciousOnERC1155ReceivedERC1271Wallet(address(looksRareProtocol)); + _setUpUser(address(maliciousERC1271Wallet)); + + (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) = + _batchTakerAskSetup(address(maliciousERC1271Wallet)); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Wallet needs to hold WETH and have given WETH approval + deal(address(weth), address(maliciousERC1271Wallet), price); + vm.prank(address(maliciousERC1271Wallet)); + weth.approve(address(looksRareProtocol), price); + + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerAsk); + + vm.expectRevert(ERC1155SafeBatchTransferFromFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + uint256 private constant numberOfPurchases = 3; + + function testExecuteMultipleTakerBids() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + + ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) = _multipleTakerBidsSetup(address(wallet)); + + vm.startPrank(address(wallet)); + mockHypercertMinter.setApprovalForAll(address(transferManager), true); + transferManager.grantApprovals(operators); + vm.stopPrank(); + + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberOfPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + for (uint256 i; i < numberOfPurchases; i++) { + assertEq(mockHypercertMinter.balanceOf(takerUser, (((1 + i) << 128) + 1)), 1); + } + } + + function testExecuteMultipleTakerBidsInvalidSignatures() public { + ERC1271Wallet wallet = new ERC1271Wallet(address(makerUser)); + + ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) = _multipleTakerBidsSetup(address(wallet)); + + // Signed by a different private key + for (uint256 i; i < signatures.length; i++) { + signatures[i] = _signMakerOrder(makerAsks[i], takerUserPK); + } + + vm.startPrank(address(wallet)); + mockHypercertMinter.setApprovalForAll(address(transferManager), true); + transferManager.grantApprovals(operators); + vm.stopPrank(); + + vm.expectRevert(SignatureERC1271Invalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberOfPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + } + + function testExecuteMultipleTakerBidsIsValidSignatureReentrancy() public { + MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = + new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol)); + _setUpUser(address(maliciousERC1271Wallet)); + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteMultipleTakerBids); + + ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) = _multipleTakerBidsSetup(address(maliciousERC1271Wallet)); + + vm.expectRevert(IReentrancyGuard.ReentrancyFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberOfPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + for (uint256 i; i < numberOfPurchases - 1; i++) { + assertEq(mockHypercertMinter.balanceOf(takerUser, i), 0); + } + } + + function testExecuteMultipleTakerBidsOnERC1155ReceivedReentrancyOnlyInTheLastCall() public { + MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet maliciousERC1271Wallet = + new MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet(takerUser); + _setUpUser(makerUser); + maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteMultipleTakerBids); + + ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) = _multipleTakerBidsSetup(makerUser); + + // Set the NFT recipient as the ERC1271 wallet to trigger onERC1155Received + for (uint256 i; i < numberOfPurchases; i++) { + takerBids[i].recipient = address(maliciousERC1271Wallet); + } + + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberOfPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + // First 2 purchases should go through, but the last one fails silently + for (uint256 i; i < numberOfPurchases - 1; i++) { + assertEq(mockHypercertMinter.balanceOf(address(maliciousERC1271Wallet), (((1 + i) << 128) + 1)), 1); + } + assertEq(mockHypercertMinter.balanceOf(address(maliciousERC1271Wallet), numberOfPurchases - 1), 0); + } + + function _takerBidSetup(address signer) + private + returns (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) + { + // Mint asset + vm.prank(signer); + mockHypercertMinter.mintClaim(signer, 10_000, "http://example.com/takerBid", FROM_CREATOR_ONLY); + + makerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.Hypercert, + orderNonce: 0, + collection: address(mockHypercertMinter), + currency: ETH, + signer: signer, + price: price, + itemId: fractionId + }); + + // Prepare the taker bid + takerBid = _genericTakerOrder(); + } + + function _takerAskSetup(address signer) + private + returns (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) + { + makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.Hypercert, + orderNonce: 0, + collection: address(mockHypercertMinter), + currency: address(weth), + signer: signer, + price: price, + itemId: fractionId + }); + + // Mint asset + vm.prank(takerUser); + mockHypercertMinter.mintClaim(takerUser, 10_000, "http://example.com/takerBid", FROM_CREATOR_ONLY); + + // Prepare the taker ask + takerAsk = _genericTakerOrder(); + } + + function _batchTakerAskSetup(address signer) + private + returns (OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) + { + uint256[] memory itemIds = new uint256[](10); + uint256[] memory amounts = new uint256[](10); + + vm.startPrank(takerUser); + for (uint256 i; i < 10; i++) { + uint256 claimID = (1 + i) << 128; + itemIds[i] = claimID + 1; + amounts[i] = 1; + + // Mint asset + mockHypercertMinter.mintClaim(takerUser, 10_000, "http://example.com/takerBid", FROM_CREATOR_ONLY); + } + vm.stopPrank(); + + // Prepare the first order + makerBid = _createMultiItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.Hypercert, + orderNonce: 0, + collection: address(mockHypercertMinter), + currency: address(weth), + signer: signer, + price: price, + itemIds: itemIds, + amounts: amounts + }); + + // Prepare the taker ask + takerAsk = _genericTakerOrder(); + } + + function _multipleTakerBidsSetup(address signer) + private + returns ( + OrderStructs.Maker[] memory makerAsks, + OrderStructs.Taker[] memory takerBids, + OrderStructs.MerkleTree[] memory merkleTrees, + bytes[] memory signatures + ) + { + makerAsks = new OrderStructs.Maker[](numberOfPurchases); + takerBids = new OrderStructs.Taker[](numberOfPurchases); + signatures = new bytes[](numberOfPurchases); + + vm.startPrank(signer); + for (uint256 i; i < numberOfPurchases; i++) { + // Mint asset + mockHypercertMinter.mintClaim(signer, 10_000, "http://example.com/takerBid", FROM_CREATOR_ONLY); + + uint256 fractionID = ((1 + i) << 128) + 1; + + makerAsks[i] = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC1155, + orderNonce: i, + collection: address(mockHypercertMinter), + currency: ETH, + signer: signer, + price: price, + itemId: fractionID // 0, 1, etc. + }); + + signatures[i] = _signMakerOrder(makerAsks[i], makerUserPK); + + takerBids[i] = _genericTakerOrder(); + } + vm.stopPrank(); + + // Other execution parameters + merkleTrees = new OrderStructs.MerkleTree[](numberOfPurchases); + } +} diff --git a/contracts/test/foundry/marketplace/SignaturesRevertions.t.sol b/contracts/test/foundry/marketplace/SignaturesRevertions.t.sol new file mode 100644 index 00000000..c5f1ef18 --- /dev/null +++ b/contracts/test/foundry/marketplace/SignaturesRevertions.t.sol @@ -0,0 +1,173 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries, interfaces, errors +import { + SignatureParameterVInvalid, + SignatureParameterSInvalid, + SignatureEOAInvalid, + NullSignerAddress, + SignatureLengthInvalid +} from "@looksrare/contracts-libs/contracts/errors/SignatureCheckerErrors.sol"; +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; +import { + INVALID_S_PARAMETER_EOA, + INVALID_V_PARAMETER_EOA, + NULL_SIGNER_EOA, + INVALID_SIGNATURE_LENGTH, + INVALID_SIGNER_EOA +} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract SignaturesRevertionsTest is ProtocolBase { + uint256 internal constant _MAX_PRIVATE_KEY = + 115_792_089_237_316_195_423_570_985_008_687_907_852_837_564_279_074_904_382_605_163_141_518_161_494_337; + + function setUp() public { + _setUp(); + } + + function testRevertIfSignatureEOAInvalid(uint256 itemId, uint256 price, uint256 randomPK) public { + // @dev Private keys 1 and 2 are used for maker/taker users + vm.assume(randomPK > 2 && randomPK < _MAX_PRIVATE_KEY); + + OrderStructs.Maker memory makerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: ETH, + signer: makerUser, + price: price, + itemId: itemId + }); + + address randomUser = vm.addr(randomPK); + _setUpUser(randomUser); + bytes memory signature = _signMakerOrder(makerAsk, randomPK); + _assertMakerOrderReturnValidationCode(makerAsk, signature, INVALID_SIGNER_EOA); + + vm.expectRevert(SignatureEOAInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(_genericTakerOrder(), makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testRevertIfInvalidVParameter(uint256 itemId, uint256 price, uint8 v) public { + vm.assume(v != 27 && v != 28); + + OrderStructs.Maker memory makerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: ETH, + signer: makerUser, + price: price, + itemId: itemId + }); + + // Sign but replace v by the fuzzed v + bytes32 orderHash = _computeOrderHash(makerAsk); + (, bytes32 r, bytes32 s) = + vm.sign(makerUserPK, keccak256(abi.encodePacked("\x19\x01", _domainSeparator, orderHash))); + bytes memory signature = abi.encodePacked(r, s, v); + + _assertMakerOrderReturnValidationCode(makerAsk, signature, INVALID_V_PARAMETER_EOA); + + vm.expectRevert(abi.encodeWithSelector(SignatureParameterVInvalid.selector, v)); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(_genericTakerOrder(), makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testRevertIfInvalidSParameter(uint256 itemId, uint256 price, bytes32 s) public { + vm.assume(uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0); + + OrderStructs.Maker memory makerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: ETH, + signer: makerUser, + price: price, + itemId: itemId + }); + + // Sign but replace s by the fuzzed s + bytes32 orderHash = _computeOrderHash(makerAsk); + (uint8 v, bytes32 r,) = + vm.sign(makerUserPK, keccak256(abi.encodePacked("\x19\x01", _domainSeparator, orderHash))); + bytes memory signature = abi.encodePacked(r, s, v); + + _assertMakerOrderReturnValidationCode(makerAsk, signature, INVALID_S_PARAMETER_EOA); + + vm.expectRevert(abi.encodeWithSelector(SignatureParameterSInvalid.selector)); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(_genericTakerOrder(), makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testRevertIfRecoveredSignerIsNullAddress(uint256 itemId, uint256 price) public { + OrderStructs.Maker memory makerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: ETH, + signer: makerUser, + price: price, + itemId: itemId + }); + + // Sign but replace r by empty bytes32 + bytes32 orderHash = _computeOrderHash(makerAsk); + (uint8 v,, bytes32 s) = + vm.sign(makerUserPK, keccak256(abi.encodePacked("\x19\x01", _domainSeparator, orderHash))); + + bytes32 r; + bytes memory signature = abi.encodePacked(r, s, v); + + _assertMakerOrderReturnValidationCode(makerAsk, signature, NULL_SIGNER_EOA); + + vm.expectRevert(abi.encodeWithSelector(NullSignerAddress.selector)); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(_genericTakerOrder(), makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testRevertIfInvalidSignatureLength(uint256 itemId, uint256 price, uint256 length) public { + // @dev Getting OutOfGas starting from 16,776,985, probably due to memory cost + vm.assume(length != 64 && length != 65 && length < 16_776_985); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + makerAsk.itemIds[0] = itemId; + makerAsk.price = price; + + bytes memory signature = new bytes(length); + _assertMakerOrderReturnValidationCode(makerAsk, signature, INVALID_SIGNATURE_LENGTH); + + vm.expectRevert(abi.encodeWithSelector(SignatureLengthInvalid.selector, length)); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } +} diff --git a/contracts/test/foundry/marketplace/StandardTransactions.t.sol b/contracts/test/foundry/marketplace/StandardTransactions.t.sol new file mode 100644 index 00000000..927818b0 --- /dev/null +++ b/contracts/test/foundry/marketplace/StandardTransactions.t.sol @@ -0,0 +1,507 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.17; + +// Libraries, interfaces, errors +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; +import {LengthsInvalid} from "@hypercerts/marketplace/errors/SharedErrors.sol"; + +import {CreatorFeeManagerWithRoyalties} from "@hypercerts/marketplace/CreatorFeeManagerWithRoyalties.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract StandardTransactionsTest is ProtocolBase { + error ERC721TransferFromFail(); + + uint256 private constant itemId = 420; + uint16 private constant NEW_ROYALTY_FEE = uint16(50); + + function setUp() public { + _setUp(); + CreatorFeeManagerWithRoyalties creatorFeeManager = + new CreatorFeeManagerWithRoyalties(address(royaltyFeeRegistry)); + vm.prank(_owner); + looksRareProtocol.updateCreatorFeeManager(address(creatorFeeManager)); + } + + /** + * One ERC721 (where royalties come from the registry) is sold through a taker bid + */ + function testTakerBidERC721WithRoyaltiesFromRegistry(uint256 price) public { + vm.assume(price <= 2 ether); + _setUpUsers(); + _setupRegistryRoyalties(address(mockERC721), NEW_ROYALTY_FEE); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + makerAsk.price = price; + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Mint asset + mockERC721.mint(makerUser, makerAsk.itemIds[0]); + + // Verify validity of maker ask order + _assertValidMakerOrder(makerAsk, signature); + + // Arrays for events + uint256[3] memory expectedFees = _calculateExpectedFees({price: price, royaltyFeeBp: NEW_ROYALTY_FEE}); + address[2] memory expectedRecipients; + + expectedRecipients[0] = makerUser; + expectedRecipients[1] = _royaltyRecipient; + + // Execute taker bid transaction + vm.prank(takerUser); + vm.expectEmit(true, false, false, true); + + emit TakerBid( + NonceInvalidationParameters({ + orderHash: _computeOrderHash(makerAsk), + orderNonce: makerAsk.orderNonce, + isNonceInvalidated: true + }), + takerUser, + takerUser, + makerAsk.strategyId, + makerAsk.currency, + makerAsk.collection, + makerAsk.itemIds, + makerAsk.amounts, + expectedRecipients, + expectedFees + ); + + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulExecutionThroughETH(takerUser, makerUser, price, expectedFees); + + // No leftover in the balance of the contract + assertEq(address(looksRareProtocol).balance, 0); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerAsk.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + /** + * One ERC721 is sold through taker bid. Address zero is specified as the recipient in the taker struct. + */ + function testTakerBidERC721WithAddressZeroSpecifiedAsRecipient(uint256 price) public { + vm.assume(price <= 2 ether); + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockERC721)); + makerAsk.price = price; + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Mint asset + mockERC721.mint(makerUser, makerAsk.itemIds[0]); + + // Adjustment + takerBid.recipient = address(0); + + // Verify validity of maker ask order + _assertValidMakerOrder(makerAsk, signature); + + // Arrays for events + uint256[3] memory expectedFees = _calculateExpectedFees({price: price, royaltyFeeBp: 0}); + address[2] memory expectedRecipients; + + expectedRecipients[0] = makerUser; + expectedRecipients[1] = address(0); // No royalties + + // Execute taker bid transaction + vm.prank(takerUser); + vm.expectEmit(true, false, false, true); + + emit TakerBid( + NonceInvalidationParameters({ + orderHash: _computeOrderHash(makerAsk), + orderNonce: makerAsk.orderNonce, + isNonceInvalidated: true + }), + takerUser, + takerUser, + makerAsk.strategyId, + makerAsk.currency, + makerAsk.collection, + makerAsk.itemIds, + makerAsk.amounts, + expectedRecipients, + expectedFees + ); + + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulExecutionThroughETH(takerUser, makerUser, price, expectedFees); + } + + /** + * One ERC721 (where royalties come from the registry) is sold through a taker ask using WETH + */ + function testTakerAskERC721WithRoyaltiesFromRegistry(uint256 price) public { + vm.assume(price <= 2 ether); + + _setUpUsers(); + _setupRegistryRoyalties(address(mockERC721), NEW_ROYALTY_FEE); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + makerBid.price = price; + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Verify maker bid order + _assertValidMakerOrder(makerBid, signature); + + // Mint asset + mockERC721.mint(takerUser, makerBid.itemIds[0]); + + // Arrays for events + uint256[3] memory expectedFees = _calculateExpectedFees({price: price, royaltyFeeBp: NEW_ROYALTY_FEE}); + address[2] memory expectedRecipients; + + expectedRecipients[0] = takerUser; + expectedRecipients[1] = _royaltyRecipient; + + // Execute taker ask transaction + vm.prank(takerUser); + + vm.expectEmit(true, false, false, true); + + emit TakerAsk( + NonceInvalidationParameters({ + orderHash: _computeOrderHash(makerBid), + orderNonce: makerBid.orderNonce, + isNonceInvalidated: true + }), + takerUser, + makerUser, + makerBid.strategyId, + makerBid.currency, + makerBid.collection, + makerBid.itemIds, + makerBid.amounts, + expectedRecipients, + expectedFees + ); + + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulExecutionThroughWETH(makerUser, takerUser, price, expectedFees); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerBid.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + /** + * One ERC721 is sold through a taker ask using WETH. Address zero is specified as the recipient in the taker + * struct. + */ + function testTakerAskERC721WithAddressZeroSpecifiedAsRecipient(uint256 price) public { + vm.assume(price <= 2 ether); + _setUpUsers(); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + makerBid.price = price; + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Verify maker bid order + _assertValidMakerOrder(makerBid, signature); + + // Adjustment + takerAsk.recipient = address(0); + + // Mint asset + mockERC721.mint(takerUser, makerBid.itemIds[0]); + + // Arrays for events + uint256[3] memory expectedFees = _calculateExpectedFees({price: price, royaltyFeeBp: 0}); + address[2] memory expectedRecipients; + + expectedRecipients[0] = takerUser; + expectedRecipients[1] = address(0); // No royalties + + // Execute taker ask transaction + vm.prank(takerUser); + vm.expectEmit(true, false, false, true); + + emit TakerAsk( + NonceInvalidationParameters({ + orderHash: _computeOrderHash(makerBid), + orderNonce: makerBid.orderNonce, + isNonceInvalidated: true + }), + takerUser, + makerUser, + makerBid.strategyId, + makerBid.currency, + makerBid.collection, + makerBid.itemIds, + makerBid.amounts, + expectedRecipients, + expectedFees + ); + + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulExecutionThroughWETH(makerUser, takerUser, price, expectedFees); + } + + /** + * Three ERC721 are sold through 3 taker bids in one transaction with non-atomicity. + */ + function testThreeTakerBidsERC721() public { + uint256 price = 0.015 ether; + _setUpUsers(); + + uint256 numberPurchases = 3; + + OrderStructs.Maker[] memory makerAsks = new OrderStructs.Maker[](numberPurchases); + OrderStructs.Taker[] memory takerBids = new OrderStructs.Taker[](numberPurchases); + bytes[] memory signatures = new bytes[](numberPurchases); + + for (uint256 i; i < numberPurchases; i++) { + // Mint asset + mockERC721.mint(makerUser, i); + + makerAsks[i] = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: i, + collection: address(mockERC721), + currency: ETH, + signer: makerUser, + price: price, // Fixed + itemId: i // (0, 1, etc.) + }); + + // Sign order + signatures[i] = _signMakerOrder(makerAsks[i], makerUserPK); + + takerBids[i] = _genericTakerOrder(); + } + + // Other execution parameters + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](numberPurchases); + + // Execute taker bid transaction + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + for (uint256 i; i < numberPurchases; i++) { + // Taker user has received the asset + assertEq(mockERC721.ownerOf(i), takerUser); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, i), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + // Taker bid user pays the whole price + assertEq(address(takerUser).balance, _initialETHBalanceUser - (numberPurchases * price)); + // Maker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq( + address(makerUser).balance, + _initialETHBalanceUser + + ((price * _sellerProceedBpWithStandardProtocolFeeBp) * numberPurchases) / ONE_HUNDRED_PERCENT_IN_BP + ); + // No leftover in the balance of the contract + assertEq(address(looksRareProtocol).balance, 0); + } + + /** + * Transaction cannot go through if atomic, goes through if non-atomic (fund returns to buyer). + */ + function testThreeTakerBidsERC721OneFails() public { + _setUpUsers(); + + uint256 numberPurchases = 3; + uint256 faultyTokenId = numberPurchases - 1; + + OrderStructs.Maker[] memory makerAsks = new OrderStructs.Maker[](numberPurchases); + OrderStructs.Taker[] memory takerBids = new OrderStructs.Taker[](numberPurchases); + bytes[] memory signatures = new bytes[](numberPurchases); + + for (uint256 i; i < numberPurchases; i++) { + // Mint asset + mockERC721.mint(makerUser, i); + + makerAsks[i] = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.ERC721, + orderNonce: i, + collection: address(mockERC721), + currency: ETH, + signer: makerUser, + price: 1.4 ether, // Fixed + itemId: i // (0, 1, etc.) + }); + + // Sign order + signatures[i] = _signMakerOrder(makerAsks[i], makerUserPK); + + takerBids[i] = _genericTakerOrder(); + } + + // Transfer tokenId = 2 to random user + address randomUser = address(55); + vm.prank(makerUser); + mockERC721.transferFrom(makerUser, randomUser, faultyTokenId); + + /** + * 1. The whole purchase fails if execution is atomic + */ + { + // Other execution parameters + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](numberPurchases); + + vm.expectRevert(abi.encodeWithSelector(ERC721TransferFromFail.selector)); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: 1.4 ether * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, true + ); + } + + /** + * 2. The whole purchase doesn't fail if execution is not-atomic + */ + { + // Other execution parameters + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](numberPurchases); + + vm.prank(takerUser); + // Execute taker bid transaction + looksRareProtocol.executeMultipleTakerBids{value: 1.4 ether * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + } + + for (uint256 i; i < faultyTokenId; i++) { + // Taker user has received the first two assets + assertEq(mockERC721.ownerOf(i), takerUser); + // Verify the first two nonces are marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, i), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + // Taker user has not received the asset + assertEq(mockERC721.ownerOf(faultyTokenId), randomUser); + // Verify the nonce is NOT marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, faultyTokenId), bytes32(0)); + // Taker bid user pays the whole price + assertEq(address(takerUser).balance, _initialETHBalanceUser - 1 - ((numberPurchases - 1) * 1.4 ether)); + // Maker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq( + address(makerUser).balance, + _initialETHBalanceUser + + ((1.4 ether * _sellerProceedBpWithStandardProtocolFeeBp) * (numberPurchases - 1)) + / ONE_HUNDRED_PERCENT_IN_BP + ); + // 1 wei left in the balance of the contract + assertEq(address(looksRareProtocol).balance, 1); + } + + function testThreeTakerBidsERC721LengthsInvalid() public { + _setUpUsers(); + + uint256 price = 1.12121111111 ether; + uint256 numberPurchases = 3; + + OrderStructs.Taker[] memory takerBids = new OrderStructs.Taker[](numberPurchases); + bytes[] memory signatures = new bytes[](numberPurchases); + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](numberPurchases); + + // 1. Invalid maker asks length + OrderStructs.Maker[] memory makerAsks = new OrderStructs.Maker[](numberPurchases - 1); + + vm.expectRevert(LengthsInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + // 2. Invalid signatures length + makerAsks = new OrderStructs.Maker[](numberPurchases); + signatures = new bytes[](numberPurchases - 1); + + vm.expectRevert(LengthsInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + // 3. Invalid merkle trees length + signatures = new bytes[](numberPurchases); + merkleTrees = new OrderStructs.MerkleTree[](numberPurchases - 1); + + vm.expectRevert(LengthsInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + } + + function _calculateExpectedFees(uint256 price, uint256 royaltyFeeBp) + private + pure + returns (uint256[3] memory expectedFees) + { + expectedFees[2] = (price * _standardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP; + expectedFees[1] = (price * royaltyFeeBp) / ONE_HUNDRED_PERCENT_IN_BP; + if (expectedFees[2] + expectedFees[1] < ((price * _minTotalFeeBp) / ONE_HUNDRED_PERCENT_IN_BP)) { + expectedFees[2] = ((price * _minTotalFeeBp) / ONE_HUNDRED_PERCENT_IN_BP) - expectedFees[1]; + } + expectedFees[0] = price - (expectedFees[1] + expectedFees[2]); + } + + function _assertSuccessfulExecutionThroughWETH( + address buyer, + address seller, + uint256 price, + uint256[3] memory expectedFees + ) private { + // Buyer has received the asset + assertEq(mockERC721.ownerOf(itemId), buyer); + // Buyer pays the whole price + assertEq(weth.balanceOf(buyer), _initialWETHBalanceUser - price); + // Seller receives 99.5% of the whole price + assertEq(weth.balanceOf(seller), _initialWETHBalanceUser + expectedFees[0]); + assertEq( + weth.balanceOf(address(protocolFeeRecipient)), + expectedFees[2], + "ProtocolFeeRecipient should receive 1.5% of the whole price" + ); + // Royalty recipient receives 0.5% of the whole price + assertEq(weth.balanceOf(_royaltyRecipient), _initialWETHBalanceRoyaltyRecipient + expectedFees[1]); + } + + function _assertSuccessfulExecutionThroughETH( + address buyer, + address seller, + uint256 price, + uint256[3] memory expectedFees + ) private { + assertEq(mockERC721.ownerOf(itemId), buyer); + // Buyer pays the whole price + assertEq(address(buyer).balance, _initialETHBalanceUser - price); + // Seller receives 99.5% of the whole price + assertEq(address(seller).balance, _initialETHBalanceUser + expectedFees[0]); + // Royalty recipient receives 0.5% of the whole price + assertEq(address(_royaltyRecipient).balance, _initialETHBalanceRoyaltyRecipient + expectedFees[1]); + } +} diff --git a/contracts/test/foundry/marketplace/StandardTransactionsHypercerts.t.sol b/contracts/test/foundry/marketplace/StandardTransactionsHypercerts.t.sol new file mode 100644 index 00000000..372317fa --- /dev/null +++ b/contracts/test/foundry/marketplace/StandardTransactionsHypercerts.t.sol @@ -0,0 +1,522 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.17; + +// Libraries, interfaces, errors +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; +import {LengthsInvalid} from "@hypercerts/marketplace/errors/SharedErrors.sol"; + +import {CreatorFeeManagerWithRoyalties} from "@hypercerts/marketplace/CreatorFeeManagerWithRoyalties.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract StandardTransactionsHypercertsTest is ProtocolBase { + error ERC1155SafeTransferFromFail(); + + uint256 private constant fractionId = (1 << 128) + 1; + uint256[] private fractionUnits; + uint16 private constant NEW_ROYALTY_FEE = uint16(50); + + function setUp() public { + _setUp(); + CreatorFeeManagerWithRoyalties creatorFeeManager = + new CreatorFeeManagerWithRoyalties(address(royaltyFeeRegistry)); + vm.prank(_owner); + looksRareProtocol.updateCreatorFeeManager(address(creatorFeeManager)); + + fractionUnits = new uint256[](3); + fractionUnits[0] = 5000; + fractionUnits[1] = 3000; + fractionUnits[2] = 2000; + } + + /** + * One Hypercert fraction (where royalties come from the registry) is sold through a taker bid + */ + function testTakerBidHypercertWithRoyaltiesFromRegistry(uint256 price) public { + vm.assume(price <= 2 ether); + _setUpUsers(); + _setupRegistryRoyalties(address(mockHypercertMinter), NEW_ROYALTY_FEE); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockHypercertMinter), true); + makerAsk.price = price; + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Mint asset + vm.prank(makerUser); + mockHypercertMinter.mintClaim(makerUser, 10_000, "https://example.com/1", FROM_CREATOR_ONLY); + + // Verify validity of maker ask order + _assertValidMakerOrder(makerAsk, signature); + + // Arrays for events + uint256[3] memory expectedFees = _calculateExpectedFees({price: price, royaltyFeeBp: NEW_ROYALTY_FEE}); + address[2] memory expectedRecipients; + + expectedRecipients[0] = makerUser; + expectedRecipients[1] = _royaltyRecipient; + + // Execute taker bid transaction + vm.prank(takerUser); + vm.expectEmit(true, false, false, true); + + emit TakerBid( + NonceInvalidationParameters({ + orderHash: _computeOrderHash(makerAsk), + orderNonce: makerAsk.orderNonce, + isNonceInvalidated: true + }), + takerUser, + takerUser, + makerAsk.strategyId, + makerAsk.currency, + makerAsk.collection, + makerAsk.itemIds, + makerAsk.amounts, + expectedRecipients, + expectedFees + ); + + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulExecutionThroughETH(takerUser, makerUser, price, expectedFees); + + // No leftover in the balance of the contract + assertEq(address(looksRareProtocol).balance, 0); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerAsk.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + /** + * One Hypercert fraction is sold through taker bid. Address zero is specified as the recipient in the taker struct. + */ + function testTakerBidHypercertsWithAddressZeroSpecifiedAsRecipient(uint256 price) public { + vm.assume(price <= 2 ether); + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMockMakerAskAndTakerBid(address(mockHypercertMinter), true); + makerAsk.price = price; + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Mint asset + vm.prank(makerUser); + mockHypercertMinter.mintClaim(makerUser, 10_000, "https://example.com/1", FROM_CREATOR_ONLY); + + // Adjustment + takerBid.recipient = address(0); + + // Verify validity of maker ask order + _assertValidMakerOrder(makerAsk, signature); + + // Arrays for events + uint256[3] memory expectedFees = _calculateExpectedFees({price: price, royaltyFeeBp: 0}); + address[2] memory expectedRecipients; + + expectedRecipients[0] = makerUser; + expectedRecipients[1] = address(0); // No royalties + + // Execute taker bid transaction + vm.prank(takerUser); + vm.expectEmit(true, false, false, true); + + emit TakerBid( + NonceInvalidationParameters({ + orderHash: _computeOrderHash(makerAsk), + orderNonce: makerAsk.orderNonce, + isNonceInvalidated: true + }), + takerUser, + takerUser, + makerAsk.strategyId, + makerAsk.currency, + makerAsk.collection, + makerAsk.itemIds, + makerAsk.amounts, + expectedRecipients, + expectedFees + ); + + looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulExecutionThroughETH(takerUser, makerUser, price, expectedFees); + } + + /** + * One Hypercert fraction (where royalties come from the registry) is sold through a taker ask using WETH + */ + function testTakerAskHypercertWithRoyaltiesFromRegistry(uint256 price) public { + vm.assume(price <= 2 ether); + + _setUpUsers(); + _setupRegistryRoyalties(address(mockHypercertMinter), NEW_ROYALTY_FEE); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockHypercertMinter), address(weth), true); + makerBid.price = price; + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Verify maker bid order + _assertValidMakerOrder(makerBid, signature); + + // Mint asset + vm.prank(takerUser); + mockHypercertMinter.mintClaim(takerUser, 10_000, "https://example.com/1", FROM_CREATOR_ONLY); + + // Arrays for events + uint256[3] memory expectedFees = _calculateExpectedFees({price: price, royaltyFeeBp: NEW_ROYALTY_FEE}); + address[2] memory expectedRecipients; + + expectedRecipients[0] = takerUser; + expectedRecipients[1] = _royaltyRecipient; + + // Execute taker ask transaction + vm.prank(takerUser); + + vm.expectEmit(true, false, false, true); + + emit TakerAsk( + NonceInvalidationParameters({ + orderHash: _computeOrderHash(makerBid), + orderNonce: makerBid.orderNonce, + isNonceInvalidated: true + }), + takerUser, + makerUser, + makerBid.strategyId, + makerBid.currency, + makerBid.collection, + makerBid.itemIds, + makerBid.amounts, + expectedRecipients, + expectedFees + ); + + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulExecutionThroughWETH(makerUser, takerUser, price, expectedFees); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerBid.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + /** + * One Hypercert is sold through a taker ask using WETH. Address zero is specified as the recipient in the taker + * struct. + */ + function testTakerAskHypercertWithAddressZeroSpecifiedAsRecipient(uint256 price) public { + vm.assume(price <= 2 ether); + _setUpUsers(); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockHypercertMinter), address(weth), true); + makerBid.price = price; + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Verify maker bid order + _assertValidMakerOrder(makerBid, signature); + + // Adjustment + takerAsk.recipient = address(0); + + // Mint asset + vm.prank(takerUser); + mockHypercertMinter.mintClaim(takerUser, 10_000, "https://example.com/1", FROM_CREATOR_ONLY); + + // Arrays for events + uint256[3] memory expectedFees = _calculateExpectedFees({price: price, royaltyFeeBp: 0}); + address[2] memory expectedRecipients; + + expectedRecipients[0] = takerUser; + expectedRecipients[1] = address(0); // No royalties + + // Execute taker ask transaction + vm.prank(takerUser); + vm.expectEmit(true, false, false, true); + + emit TakerAsk( + NonceInvalidationParameters({ + orderHash: _computeOrderHash(makerBid), + orderNonce: makerBid.orderNonce, + isNonceInvalidated: true + }), + takerUser, + makerUser, + makerBid.strategyId, + makerBid.currency, + makerBid.collection, + makerBid.itemIds, + makerBid.amounts, + expectedRecipients, + expectedFees + ); + + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulExecutionThroughWETH(makerUser, takerUser, price, expectedFees); + } + + /** + * Three Hypercert fractions are sold through 3 taker bids in one transaction with non-atomicity. + */ + function testThreeTakerBidsHypercerts() public { + uint256 price = 0.015 ether; + _setUpUsers(); + + uint256 numberPurchases = 3; + + OrderStructs.Maker[] memory makerAsks = new OrderStructs.Maker[](numberPurchases); + OrderStructs.Taker[] memory takerBids = new OrderStructs.Taker[](numberPurchases); + bytes[] memory signatures = new bytes[](numberPurchases); + + for (uint256 i; i < numberPurchases; i++) { + // Mint asset + vm.prank(makerUser); + mockHypercertMinter.mintClaimWithFractions( + makerUser, 10_000, fractionUnits, "https://example.com/1", FROM_CREATOR_ONLY + ); + + makerAsks[i] = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.Hypercert, + orderNonce: i, + collection: address(mockHypercertMinter), + currency: ETH, + signer: makerUser, + price: price, // Fixed + itemId: (1 << 128) + 1 + i + }); + + // Sign order + signatures[i] = _signMakerOrder(makerAsks[i], makerUserPK); + + takerBids[i] = _genericTakerOrder(); + } + + // Other execution parameters + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](numberPurchases); + + // Execute taker bid transaction + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + for (uint256 i; i < numberPurchases; i++) { + // Taker user has received the asset + assertEq(mockHypercertMinter.ownerOf((1 << 128) + 1 + i), takerUser); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, i), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + // Taker bid user pays the whole price + assertEq(address(takerUser).balance, _initialETHBalanceUser - (numberPurchases * price)); + // Maker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq( + address(makerUser).balance, + _initialETHBalanceUser + + ((price * _sellerProceedBpWithStandardProtocolFeeBp) * numberPurchases) / ONE_HUNDRED_PERCENT_IN_BP + ); + // No leftover in the balance of the contract + assertEq(address(looksRareProtocol).balance, 0); + } + + /** + * Transaction cannot go through if atomic, goes through if non-atomic (fund returns to buyer). + */ + function testThreeTakerBidsHypercertsOneFails() public { + _setUpUsers(); + + uint256 numberPurchases = 3; + uint256 faultyPurchase = numberPurchases - 1; + uint256 faultyTokenId = (numberPurchases << 128) + 1; + + OrderStructs.Maker[] memory makerAsks = new OrderStructs.Maker[](numberPurchases); + OrderStructs.Taker[] memory takerBids = new OrderStructs.Taker[](numberPurchases); + bytes[] memory signatures = new bytes[](numberPurchases); + + for (uint256 i; i < numberPurchases; i++) { + // Mint asset + vm.prank(makerUser); + mockHypercertMinter.mintClaim(makerUser, 10_000, "https://example.com/1", FROM_CREATOR_ONLY); + + makerAsks[i] = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: CollectionType.Hypercert, + orderNonce: i, + collection: address(mockHypercertMinter), + currency: ETH, + signer: makerUser, + price: 1.4 ether, // Fixed + itemId: ((i + 1) << 128) + 1 // First fraction of the i-th minted asset + }); + + // Sign order + signatures[i] = _signMakerOrder(makerAsks[i], makerUserPK); + + takerBids[i] = _genericTakerOrder(); + } + + // Transfer tokenId = 2 to random user + address randomUser = address(55); + vm.prank(makerUser); + mockHypercertMinter.safeTransferFrom(makerUser, randomUser, faultyTokenId, 1, ""); + + /** + * 1. The whole purchase fails if execution is atomic + */ + { + // Other execution parameters + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](numberPurchases); + + vm.expectRevert(ERC1155SafeTransferFromFail.selector); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: 1.4 ether * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, true + ); + } + + /** + * 2. The whole purchase doesn't fail if execution is not-atomic + */ + { + // Other execution parameters + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](numberPurchases); + + vm.prank(takerUser); + // Execute taker bid transaction + looksRareProtocol.executeMultipleTakerBids{value: 1.4 ether * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + } + + for (uint256 i; i < faultyPurchase; i++) { + // Taker user has received the first two assets + assertEq(mockHypercertMinter.ownerOf(((i + 1) << 128) + 1), takerUser); + // Verify the first two nonces are marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, i), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + // Taker user has not received the asset + assertEq(mockHypercertMinter.ownerOf(faultyTokenId), randomUser); + // Verify the nonce is NOT marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, faultyTokenId), bytes32(0)); + // Taker bid user pays the whole price + assertEq(address(takerUser).balance, _initialETHBalanceUser - 1 - ((numberPurchases - 1) * 1.4 ether)); + // Maker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq( + address(makerUser).balance, + _initialETHBalanceUser + + ((1.4 ether * _sellerProceedBpWithStandardProtocolFeeBp) * (numberPurchases - 1)) + / ONE_HUNDRED_PERCENT_IN_BP + ); + // 1 wei left in the balance of the contract + assertEq(address(looksRareProtocol).balance, 1); + } + + function testThreeTakerBidsHypercertsLengthsInvalid() public { + _setUpUsers(); + + uint256 price = 1.12121111111 ether; + uint256 numberPurchases = 3; + + OrderStructs.Taker[] memory takerBids = new OrderStructs.Taker[](numberPurchases); + bytes[] memory signatures = new bytes[](numberPurchases); + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](numberPurchases); + + // 1. Invalid maker asks length + OrderStructs.Maker[] memory makerAsks = new OrderStructs.Maker[](numberPurchases - 1); + + vm.expectRevert(LengthsInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + // 2. Invalid signatures length + makerAsks = new OrderStructs.Maker[](numberPurchases); + signatures = new bytes[](numberPurchases - 1); + + vm.expectRevert(LengthsInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + + // 3. Invalid merkle trees length + signatures = new bytes[](numberPurchases); + merkleTrees = new OrderStructs.MerkleTree[](numberPurchases - 1); + + vm.expectRevert(LengthsInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeMultipleTakerBids{value: price * numberPurchases}( + takerBids, makerAsks, signatures, merkleTrees, false + ); + } + + function _calculateExpectedFees(uint256 price, uint256 royaltyFeeBp) + private + pure + returns (uint256[3] memory expectedFees) + { + expectedFees[2] = (price * _standardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP; + expectedFees[1] = (price * royaltyFeeBp) / ONE_HUNDRED_PERCENT_IN_BP; + if (expectedFees[2] + expectedFees[1] < ((price * _minTotalFeeBp) / ONE_HUNDRED_PERCENT_IN_BP)) { + expectedFees[2] = ((price * _minTotalFeeBp) / ONE_HUNDRED_PERCENT_IN_BP) - expectedFees[1]; + } + expectedFees[0] = price - (expectedFees[1] + expectedFees[2]); + } + + function _assertSuccessfulExecutionThroughWETH( + address buyer, + address seller, + uint256 price, + uint256[3] memory expectedFees + ) private { + // Buyer has received the asset + assertEq(mockHypercertMinter.ownerOf(fractionId), buyer); + // Buyer pays the whole price + assertEq(weth.balanceOf(buyer), _initialWETHBalanceUser - price); + // Seller receives 99.5% of the whole price + assertEq(weth.balanceOf(seller), _initialWETHBalanceUser + expectedFees[0]); + assertEq( + weth.balanceOf(address(protocolFeeRecipient)), + expectedFees[2], + "ProtocolFeeRecipient should receive 1.5% of the whole price" + ); + // Royalty recipient receives 0.5% of the whole price + assertEq(weth.balanceOf(_royaltyRecipient), _initialWETHBalanceRoyaltyRecipient + expectedFees[1]); + } + + function _assertSuccessfulExecutionThroughETH( + address buyer, + address seller, + uint256 price, + uint256[3] memory expectedFees + ) private { + assertEq(mockHypercertMinter.ownerOf(fractionId), buyer); + // Buyer pays the whole price + assertEq(address(buyer).balance, _initialETHBalanceUser - price); + // Seller receives 99.5% of the whole price + assertEq(address(seller).balance, _initialETHBalanceUser + expectedFees[0]); + // Royalty recipient receives 0.5% of the whole price + assertEq(address(_royaltyRecipient).balance, _initialETHBalanceRoyaltyRecipient + expectedFees[1]); + } +} diff --git a/contracts/test/foundry/marketplace/StrategyManager.t.sol b/contracts/test/foundry/marketplace/StrategyManager.t.sol new file mode 100644 index 00000000..2962afb1 --- /dev/null +++ b/contracts/test/foundry/marketplace/StrategyManager.t.sol @@ -0,0 +1,213 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.17; + +// LooksRare unopinionated libraries +import {IOwnableTwoSteps} from "@looksrare/contracts-libs/contracts/interfaces/IOwnableTwoSteps.sol"; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Interfaces +import {IStrategyManager} from "@hypercerts/marketplace/interfaces/IStrategyManager.sol"; +import {IStrategy} from "@hypercerts/marketplace/interfaces/IStrategy.sol"; + +// Random strategy +import {StrategyCollectionOffer} from "@hypercerts/marketplace/executionStrategies/StrategyCollectionOffer.sol"; + +// Base test +import {ProtocolBase} from "./ProtocolBase.t.sol"; + +contract FalseBaseStrategy is IStrategy { + /** + * @inheritdoc IStrategy + */ + function isMakerOrderValid(OrderStructs.Maker calldata, bytes4) + external + view + override + returns (bool isValid, bytes4 errorSelector) + { + // + } + + /** + * @inheritdoc IStrategy + */ + function isLooksRareV2Strategy() external pure override returns (bool) { + return false; + } +} + +contract StrategyManagerTest is ProtocolBase, IStrategyManager { + function setUp() public { + _setUp(); + } + + /** + * Owner can discontinue strategy + */ + function testOwnerCanDiscontinueStrategy() public asPrankedUser(_owner) { + uint256 strategyId = 0; + uint16 standardProtocolFeeBp = 100; + uint16 minTotalFeeBp = 200; + bool isActive = false; + + vm.expectEmit(false, false, false, true); + emit StrategyUpdated(strategyId, isActive, standardProtocolFeeBp, minTotalFeeBp); + looksRareProtocol.updateStrategy(strategyId, isActive, standardProtocolFeeBp, minTotalFeeBp); + + ( + bool strategyIsActive, + uint16 strategyStandardProtocolFee, + uint16 strategyMinTotalFee, + uint16 strategyMaxProtocolFee, + bytes4 strategySelector, + bool strategyIsMakerBid, + address strategyImplementation + ) = looksRareProtocol.strategyInfo(strategyId); + + assertFalse(strategyIsActive); + assertEq(strategyStandardProtocolFee, standardProtocolFeeBp); + assertEq(strategyMinTotalFee, minTotalFeeBp); + assertEq(strategyMaxProtocolFee, _maxProtocolFeeBp); + assertEq(strategySelector, _EMPTY_BYTES4); + assertFalse(strategyIsMakerBid); + assertEq(strategyImplementation, address(0)); + } + + function testNewStrategyEventIsEmitted() public asPrankedUser(_owner) { + StrategyCollectionOffer strategy = new StrategyCollectionOffer(); + + uint256 strategyId = 1; + bytes4 selector = StrategyCollectionOffer.executeCollectionStrategyWithTakerAsk.selector; + bool isMakerBid = true; + address implementation = address(strategy); + + vm.expectEmit(true, false, false, true); + emit NewStrategy( + strategyId, _standardProtocolFeeBp, _minTotalFeeBp, _maxProtocolFeeBp, selector, isMakerBid, implementation + ); + + _addStrategy(implementation, selector, isMakerBid); + } + + /** + * Owner can change protocol fee information + */ + function testOwnerCanChangeStrategyProtocolFees() public asPrankedUser(_owner) { + uint256 strategyId = 0; + uint16 newStandardProtocolFeeBp = 100; + uint16 newMinTotalFeeBp = 200; + bool isActive = true; + + vm.expectEmit(false, false, false, true); + emit StrategyUpdated(strategyId, isActive, newStandardProtocolFeeBp, newMinTotalFeeBp); + looksRareProtocol.updateStrategy(strategyId, isActive, newStandardProtocolFeeBp, newMinTotalFeeBp); + + ( + bool strategyIsActive, + uint16 strategyStandardProtocolFee, + uint16 strategyMinTotalFee, + uint16 strategyMaxProtocolFee, + bytes4 strategySelector, + bool strategyIsMakerBid, + address strategyImplementation + ) = looksRareProtocol.strategyInfo(strategyId); + + assertTrue(strategyIsActive); + assertEq(strategyStandardProtocolFee, newStandardProtocolFeeBp); + assertEq(strategyMinTotalFee, newMinTotalFeeBp); + assertEq(strategyMaxProtocolFee, _maxProtocolFeeBp); + assertEq(strategySelector, _EMPTY_BYTES4); + assertFalse(strategyIsMakerBid); + assertEq(strategyImplementation, address(0)); + } + + /** + * Owner functions for strategy updates revert as expected under multiple revertion scenarios + */ + function testOwnerRevertionsForInvalidParametersUpdateStrategy() public asPrankedUser(_owner) { + (, uint16 currentStandardProtocolFee, uint16 currentMinTotalFee, uint16 maxProtocolFeeBp,,,) = + looksRareProtocol.strategyInfo(0); + + // 1. newStandardProtocolFee is higher than maxProtocolFeeBp + uint16 newStandardProtocolFee = maxProtocolFeeBp + 1; + uint16 newMinTotalFee = currentMinTotalFee; + vm.expectRevert(StrategyProtocolFeeTooHigh.selector); + looksRareProtocol.updateStrategy(0, true, newStandardProtocolFee, newMinTotalFee); + + // 2. newMinTotalFee is higher than maxProtocolFeeBp + newStandardProtocolFee = currentStandardProtocolFee; + newMinTotalFee = maxProtocolFeeBp + 1; + vm.expectRevert(StrategyProtocolFeeTooHigh.selector); + looksRareProtocol.updateStrategy(0, true, newStandardProtocolFee, newMinTotalFee); + + // 3. It reverts if strategy doesn't exist + vm.expectRevert(StrategyNotUsed.selector); + looksRareProtocol.updateStrategy(1, true, currentStandardProtocolFee, currentMinTotalFee); + } + + /** + * Owner functions for strategy additions revert as expected under multiple revertion scenarios + */ + function testOwnerRevertionsForInvalidParametersAddStrategy() public asPrankedUser(_owner) { + uint16 standardProtocolFeeBp = 250; + uint16 minTotalFeeBp = 300; + uint16 maxProtocolFeeBp = 300; + address implementation = address(0); + + // 1. standardProtocolFeeBp is higher than maxProtocolFeeBp + maxProtocolFeeBp = standardProtocolFeeBp - 1; + vm.expectRevert(abi.encodeWithSelector(IStrategyManager.StrategyProtocolFeeTooHigh.selector)); + looksRareProtocol.addStrategy( + standardProtocolFeeBp, minTotalFeeBp, maxProtocolFeeBp, _EMPTY_BYTES4, true, implementation + ); + + // 2. minTotalFeeBp is higher than maxProtocolFeeBp + maxProtocolFeeBp = minTotalFeeBp - 1; + vm.expectRevert(abi.encodeWithSelector(IStrategyManager.StrategyProtocolFeeTooHigh.selector)); + looksRareProtocol.addStrategy( + standardProtocolFeeBp, minTotalFeeBp, maxProtocolFeeBp, _EMPTY_BYTES4, true, implementation + ); + + // 3. maxProtocolFeeBp is higher than _MAX_PROTOCOL_FEE + maxProtocolFeeBp = 500 + 1; + vm.expectRevert(abi.encodeWithSelector(IStrategyManager.StrategyProtocolFeeTooHigh.selector)); + looksRareProtocol.addStrategy( + standardProtocolFeeBp, minTotalFeeBp, maxProtocolFeeBp, _EMPTY_BYTES4, true, implementation + ); + } + + function testAddStrategyNoSelector() public asPrankedUser(_owner) { + vm.expectRevert(IStrategyManager.StrategyHasNoSelector.selector); + _addStrategy(address(0), _EMPTY_BYTES4, true); + } + + function testAddStrategyNotV2Strategy() public asPrankedUser(_owner) { + bytes4 randomSelector = StrategyCollectionOffer.executeCollectionStrategyWithTakerAsk.selector; + + // 1. EOA + vm.expectRevert(); + _addStrategy(address(0), randomSelector, true); + + // 2. Invalid contract (e.g. LooksRareProtocol) + vm.expectRevert(); + _addStrategy(address(looksRareProtocol), randomSelector, true); + + // 3. Contract that implements the function but returns false + FalseBaseStrategy falseStrategy = new FalseBaseStrategy(); + + vm.expectRevert(NotV2Strategy.selector); + _addStrategy(address(falseStrategy), randomSelector, true); + } + + function testAddStrategyNotOwner() public { + vm.expectRevert(IOwnableTwoSteps.NotOwner.selector); + _addStrategy(address(0), _EMPTY_BYTES4, true); + } + + function testUpdateStrategyNotOwner() public { + vm.expectRevert(IOwnableTwoSteps.NotOwner.selector); + looksRareProtocol.updateStrategy(0, false, 299, 100); + } +} diff --git a/contracts/test/foundry/marketplace/TransferManager.t.sol b/contracts/test/foundry/marketplace/TransferManager.t.sol new file mode 100644 index 00000000..e9e56855 --- /dev/null +++ b/contracts/test/foundry/marketplace/TransferManager.t.sol @@ -0,0 +1,787 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.17; + +// LooksRare unopinionated libraries +import {IOwnableTwoSteps} from "@looksrare/contracts-libs/contracts/interfaces/IOwnableTwoSteps.sol"; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Core contracts +import {LooksRareProtocol} from "@hypercerts/marketplace/LooksRareProtocol.sol"; +import {ITransferManager, TransferManager} from "@hypercerts/marketplace/TransferManager.sol"; +import {AmountInvalid, LengthsInvalid} from "@hypercerts/marketplace/errors/SharedErrors.sol"; +import {HypercertMinter} from "@hypercerts/protocol/HypercertMinter.sol"; +import {IHypercertToken} from "@hypercerts/protocol/interfaces/IHypercertToken.sol"; + +// Mocks and other utils +import {MockERC721} from "../../mock/MockERC721.sol"; +import {MockERC1155} from "../../mock/MockERC1155.sol"; +import {MockHypercertMinterUUPS} from "../../mock/MockHypercertMinterUUPS.sol"; +import {TestHelpers} from "./utils/TestHelpers.sol"; +import {TestParameters} from "./utils/TestParameters.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; + +contract TransferManagerTest is ITransferManager, TestHelpers, TestParameters { + address[] public operators; + MockERC721 public mockERC721; + MockERC1155 public mockERC1155; + MockHypercertMinterUUPS public mockHypercertMinterUUPS; + + TransferManager public transferManager; + HypercertMinter public mockHypercertMinter; + + uint256 private constant tokenIdERC721 = 55; + uint256 private constant tokenId1ERC1155 = 1; + uint256 private constant amount1ERC1155 = 2; + uint256 private constant tokenId2ERC1155 = 2; + uint256 private constant amount2ERC1155 = 5; + + // Set the hypercert claim and first fraction id + uint256 private constant claimId1Hypercert = 1 << 128; + uint256 private constant amount1Hypercert = 1; + uint256 private constant units1Hypercert = 10_000; + uint256 private constant fractionId1Hypercert = claimId1Hypercert + 1; + + uint256 private constant claimId2Hypercert = 2 << 128; + uint256 private constant amount2Hypercert = 1; + uint256 private constant units2Hypercert = 10_000; + uint256 private constant fractionId2Hypercert = claimId2Hypercert + 1; + + IHypercertToken.TransferRestrictions private constant FROM_CREATOR_ONLY = + IHypercertToken.TransferRestrictions.FromCreatorOnly; + + /** + * 0. Internal helper functions + */ + + function _grantApprovals(address user) private asPrankedUser(user) { + mockERC721.setApprovalForAll(address(transferManager), true); + mockERC1155.setApprovalForAll(address(transferManager), true); + mockHypercertMinter.setApprovalForAll(address(transferManager), true); + + address[] memory approvedOperators = new address[](1); + approvedOperators[0] = _transferrer; + + vm.expectEmit(true, false, false, true); + emit ApprovalsGranted(user, approvedOperators); + transferManager.grantApprovals(approvedOperators); + } + + function _allowOperator(address transferrer) private { + vm.prank(_owner); + vm.expectEmit(true, false, false, true); + emit OperatorAllowed(transferrer); + transferManager.allowOperator(transferrer); + } + + function setUp() public asPrankedUser(_owner) { + transferManager = new TransferManager(_owner); + mockERC721 = new MockERC721(); + mockERC1155 = new MockERC1155(); + mockHypercertMinterUUPS = new MockHypercertMinterUUPS(); + mockHypercertMinterUUPS.setUp(); + mockHypercertMinter = mockHypercertMinterUUPS.minter(); + operators.push(_transferrer); + + vm.deal(_transferrer, 100 ether); + vm.deal(_sender, 100 ether); + } + + /** + * 1. Happy cases + */ + + function testTransferSingleItemERC721() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + uint256 itemId = 500; + + vm.prank(_sender); + mockERC721.mint(_sender, itemId); + + uint256[] memory itemIds = new uint256[](1); + itemIds[0] = itemId; + uint256[] memory amounts = new uint256[](1); + amounts[0] = 1; + + vm.prank(_transferrer); + transferManager.transferItemsERC721(address(mockERC721), _sender, _recipient, itemIds, amounts); + + assertEq(mockERC721.ownerOf(itemId), _recipient); + } + + function testTransferSingleItemERC1155() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + uint256 itemId = 1; + uint256 amount = 2; + + mockERC1155.mint(_sender, itemId, amount); + + uint256[] memory itemIds = new uint256[](1); + itemIds[0] = itemId; + uint256[] memory amounts = new uint256[](1); + amounts[0] = amount; + + vm.prank(_transferrer); + transferManager.transferItemsERC1155(address(mockERC1155), _sender, _recipient, itemIds, amounts); + + assertEq(mockERC1155.balanceOf(_recipient, itemId), amount); + } + + function testTransferSingleItemHypercert() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + uint256 itemId = fractionId1Hypercert; + uint256 amount = amount1Hypercert; + + vm.prank(_sender); + mockHypercertMinter.mintClaim(_sender, units1Hypercert, "https://example.com/1", FROM_CREATOR_ONLY); + + uint256[] memory itemIds = new uint256[](1); + itemIds[0] = itemId; + uint256[] memory amounts = new uint256[](1); + amounts[0] = amount; + + vm.prank(_transferrer); + transferManager.transferItemsHypercert(address(mockHypercertMinter), _sender, _recipient, itemIds, amounts); + + assertEq(mockHypercertMinter.balanceOf(_recipient, itemId), amount); + } + + function testTransferBatchItemsERC721() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + uint256 tokenId1 = 1; + uint256 tokenId2 = 2; + + uint256[] memory itemIds = new uint256[](2); + itemIds[0] = tokenId1; + itemIds[1] = tokenId2; + + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1; + amounts[1] = 1; + + mockERC721.batchMint(_sender, itemIds); + + vm.prank(_transferrer); + transferManager.transferItemsERC721(address(mockERC721), _sender, _recipient, itemIds, amounts); + + assertEq(mockERC721.ownerOf(tokenId1), _recipient); + assertEq(mockERC721.ownerOf(tokenId2), _recipient); + } + + function testTransferBatchItemsERC1155() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + uint256 tokenId1 = 1; + uint256 amount1 = 2; + uint256 tokenId2 = 2; + uint256 amount2 = 5; + + mockERC1155.mint(_sender, tokenId1, amount1); + mockERC1155.mint(_sender, tokenId2, amount2); + + uint256[] memory itemIds = new uint256[](2); + itemIds[0] = tokenId1; + itemIds[1] = tokenId2; + + uint256[] memory amounts = new uint256[](2); + amounts[0] = amount1; + amounts[1] = amount2; + + vm.prank(_transferrer); + transferManager.transferItemsERC1155(address(mockERC1155), _sender, _recipient, itemIds, amounts); + + assertEq(mockERC1155.balanceOf(_recipient, tokenId1), amount1); + assertEq(mockERC1155.balanceOf(_recipient, tokenId2), amount2); + } + + function testTransferBatchItemsHypercerts() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + uint256 tokenId1 = fractionId1Hypercert; + uint256 amount1 = amount1Hypercert; + uint256 tokenId2 = fractionId2Hypercert; + uint256 amount2 = amount2Hypercert; + + vm.startPrank(_sender); + mockHypercertMinter.mintClaim(_sender, units1Hypercert, "https://example.com/1", FROM_CREATOR_ONLY); + mockHypercertMinter.mintClaim(_sender, units2Hypercert, "https://example.com/2", FROM_CREATOR_ONLY); + vm.stopPrank(); + + uint256[] memory itemIds = new uint256[](2); + itemIds[0] = tokenId1; + itemIds[1] = tokenId2; + + uint256[] memory amounts = new uint256[](2); + amounts[0] = amount1; + amounts[1] = amount2; + + vm.prank(_transferrer); + transferManager.transferItemsHypercert(address(mockHypercertMinter), _sender, _recipient, itemIds, amounts); + + assertEq(mockHypercertMinter.balanceOf(_recipient, tokenId1), amount1); + assertEq(mockHypercertMinter.balanceOf(_recipient, tokenId2), amount2); + } + + function testTransferBatchItemsAcrossCollectionERC721AndERC1155AndHypercert() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + ITransferManager.BatchTransferItem[] memory items = _generateValidBatchTransferItemsPranked(_sender); + + vm.prank(_transferrer); + transferManager.transferBatchItemsAcrossCollections(items, _sender, _recipient); + + assertEq(mockERC721.ownerOf(tokenIdERC721), _recipient); + assertEq(mockERC1155.balanceOf(_recipient, tokenId1ERC1155), amount1ERC1155); + assertEq(mockERC1155.balanceOf(_recipient, tokenId2ERC1155), amount2ERC1155); + assertEq(mockHypercertMinter.balanceOf(_recipient, fractionId1Hypercert), amount1Hypercert); + assertEq(mockHypercertMinter.balanceOf(_recipient, fractionId2Hypercert), amount2Hypercert); + } + + function testTransferBatchItemsAcrossCollectionERC721AndERC1155AndHypercertByOwner() + public + asPrankedUser(_sender) + { + mockERC721.setApprovalForAll(address(transferManager), true); + mockERC1155.setApprovalForAll(address(transferManager), true); + mockHypercertMinter.setApprovalForAll(address(transferManager), true); + + ITransferManager.BatchTransferItem[] memory items = _generateValidBatchTransferItems(); + + transferManager.transferBatchItemsAcrossCollections(items, _sender, _recipient); + + assertEq(mockERC721.ownerOf(tokenIdERC721), _recipient); + assertEq(mockERC1155.balanceOf(_recipient, tokenId1ERC1155), amount1ERC1155); + assertEq(mockERC1155.balanceOf(_recipient, tokenId2ERC1155), amount2ERC1155); + assertEq(mockHypercertMinter.balanceOf(_recipient, fractionId1Hypercert), amount1Hypercert); + assertEq(mockHypercertMinter.balanceOf(_recipient, fractionId2Hypercert), amount2Hypercert); + } + + /** + * 2. Revertion patterns + */ + function testTransferItemsERC721AmountIsNotOne(uint256 amount) public { + vm.assume(amount != 1); + + _allowOperator(_transferrer); + _grantApprovals(_sender); + + uint256 itemId = 500; + + mockERC721.mint(_sender, itemId); + + uint256[] memory itemIds = new uint256[](1); + itemIds[0] = itemId; + uint256[] memory amounts = new uint256[](1); + amounts[0] = amount; + + vm.expectRevert(AmountInvalid.selector); + vm.prank(_transferrer); + transferManager.transferItemsERC721(address(mockERC721), _sender, _recipient, itemIds, amounts); + } + + function testTransferSingleItemERC1155AmountIsZero() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + uint256 itemId = 500; + + mockERC1155.mint(_sender, itemId, 1); + + uint256[] memory itemIds = new uint256[](1); + itemIds[0] = itemId; + uint256[] memory amounts = new uint256[](1); + amounts[0] = 0; + + vm.expectRevert(AmountInvalid.selector); + vm.prank(_transferrer); + transferManager.transferItemsERC1155(address(mockERC1155), _sender, _recipient, itemIds, amounts); + } + + function testTransferSingleItemHypercertAmountIsZero() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + uint256 itemId = fractionId1Hypercert; + + vm.prank(_sender); + mockHypercertMinter.mintClaim(_sender, 1, "https://example.com/1", FROM_CREATOR_ONLY); + + uint256[] memory itemIds = new uint256[](1); + itemIds[0] = itemId; + uint256[] memory amounts = new uint256[](1); + amounts[0] = 0; + + vm.expectRevert(AmountInvalid.selector); + vm.prank(_transferrer); + transferManager.transferItemsHypercert(address(mockHypercertMinter), _sender, _recipient, itemIds, amounts); + } + + function testTransferMultipleItemsERC1155AmountIsZero() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + uint256 itemIdOne = 500; + uint256 itemIdTwo = 501; + + mockERC1155.mint(_sender, itemIdOne, 1); + mockERC1155.mint(_sender, itemIdTwo, 1); + + uint256[] memory itemIds = new uint256[](2); + itemIds[0] = itemIdOne; + itemIds[1] = itemIdTwo; + uint256[] memory amounts = new uint256[](2); + amounts[0] = 0; + amounts[1] = 0; + + vm.expectRevert(AmountInvalid.selector); + vm.prank(_transferrer); + transferManager.transferItemsERC1155(address(mockERC1155), _sender, _recipient, itemIds, amounts); + } + + function testTransferMultipleItemsHypercertAmountIsZero() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + uint256 itemIdOne = fractionId1Hypercert; + uint256 itemIdTwo = fractionId2Hypercert; + + vm.prank(_sender); + mockHypercertMinter.mintClaim(_sender, 1, "https://example.com/1", FROM_CREATOR_ONLY); + vm.prank(_sender); + mockHypercertMinter.mintClaim(_sender, 1, "https://example.com/2", FROM_CREATOR_ONLY); + + uint256[] memory itemIds = new uint256[](2); + itemIds[0] = itemIdOne; + itemIds[1] = itemIdTwo; + uint256[] memory amounts = new uint256[](2); + amounts[0] = 0; + amounts[1] = 0; + + vm.expectRevert(AmountInvalid.selector); + vm.prank(_transferrer); + transferManager.transferItemsHypercert(address(mockHypercertMinter), _sender, _recipient, itemIds, amounts); + } + + function testTransferBatchItemsAcrossCollectionZeroLength() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + ITransferManager.BatchTransferItem[] memory items = new ITransferManager.BatchTransferItem[](0); + + vm.expectRevert(LengthsInvalid.selector); + vm.prank(_transferrer); + transferManager.transferBatchItemsAcrossCollections(items, _sender, _recipient); + } + + function testCannotBatchTransferIfERC721AmountIsNotOne(uint256 amount) public { + vm.assume(amount != 1); + + _allowOperator(_transferrer); + _grantApprovals(_sender); + + ITransferManager.BatchTransferItem[] memory items = _generateValidBatchTransferItemsPranked(_sender); + items[1].amounts[0] = amount; + + vm.expectRevert(AmountInvalid.selector); + vm.prank(_sender); + transferManager.transferBatchItemsAcrossCollections(items, _sender, _recipient); + } + + function testCannotBatchTransferIfERC1155AmountIsZero() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + ITransferManager.BatchTransferItem[] memory items = _generateValidBatchTransferItemsPranked(_sender); + items[0].amounts[0] = 0; + + vm.expectRevert(AmountInvalid.selector); + vm.prank(_sender); + transferManager.transferBatchItemsAcrossCollections(items, _sender, _recipient); + } + + function testCannotBatchTransferIfHypercertAmountIsZero() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + ITransferManager.BatchTransferItem[] memory items = _generateValidBatchTransferItemsPranked(_sender); + items[2].amounts[0] = 0; + + vm.expectRevert(AmountInvalid.selector); + vm.prank(_sender); + transferManager.transferBatchItemsAcrossCollections(items, _sender, _recipient); + } + + function testTransferBatchItemsAcrossCollectionPerCollectionItemIdsLengthZero() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + ITransferManager.BatchTransferItem[] memory items = _generateValidBatchTransferItemsPranked(_sender); + items[0].itemIds = new uint256[](0); + items[0].amounts = new uint256[](0); + + vm.prank(_transferrer); + vm.expectRevert(LengthsInvalid.selector); + transferManager.transferBatchItemsAcrossCollections(items, _sender, _recipient); + } + + function testCannotTransferERC721IfOperatorApprovalsRevokedByUserOrOperatorRemovedByOwner() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + // 1. User revokes the operator + vm.prank(_sender); + vm.expectEmit(false, false, false, true); + emit ApprovalsRemoved(_sender, operators); + transferManager.revokeApprovals(operators); + + uint256 itemId = 500; + uint256[] memory itemIds = new uint256[](1); + itemIds[0] = itemId; + uint256[] memory amounts = new uint256[](1); + amounts[0] = 1; + + vm.prank(_transferrer); + vm.expectRevert(ITransferManager.TransferCallerInvalid.selector); + transferManager.transferItemsERC721(address(mockERC721), _sender, _recipient, itemIds, amounts); + + // 2. Sender grants again approvals but owner removes the operators + _grantApprovals(_sender); + vm.prank(_owner); + vm.expectEmit(false, false, false, true); + emit OperatorRemoved(_transferrer); + transferManager.removeOperator(_transferrer); + + vm.prank(_transferrer); + vm.expectRevert(ITransferManager.TransferCallerInvalid.selector); + transferManager.transferItemsERC721(address(mockERC721), _sender, _recipient, itemIds, amounts); + } + + function testCannotTransferERC1155IfOperatorApprovalsRevokedByUserOrOperatorRemovedByOwner() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + // 1. User revokes the operator + vm.prank(_sender); + vm.expectEmit(false, false, false, true); + emit ApprovalsRemoved(_sender, operators); + transferManager.revokeApprovals(operators); + + uint256 itemId = 500; + uint256[] memory itemIds = new uint256[](1); + itemIds[0] = itemId; + uint256[] memory amounts = new uint256[](1); + amounts[0] = 5; + + vm.prank(_transferrer); + vm.expectRevert(ITransferManager.TransferCallerInvalid.selector); + transferManager.transferItemsERC1155(address(mockERC1155), _sender, _recipient, itemIds, amounts); + + // 2. Sender grants again approvals but owner removes the operators + _grantApprovals(_sender); + vm.prank(_owner); + vm.expectEmit(false, false, false, true); + emit OperatorRemoved(_transferrer); + transferManager.removeOperator(_transferrer); + + vm.prank(_transferrer); + vm.expectRevert(ITransferManager.TransferCallerInvalid.selector); + transferManager.transferItemsERC1155(address(mockERC1155), _sender, _recipient, itemIds, amounts); + } + + function testCannotTransferHypercertIfOperatorApprovalsRevokedByUserOrOperatorRemovedByOwner() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + // 1. User revokes the operator + vm.prank(_sender); + vm.expectEmit(false, false, false, true); + emit ApprovalsRemoved(_sender, operators); + transferManager.revokeApprovals(operators); + + uint256 itemId = fractionId1Hypercert; + uint256[] memory itemIds = new uint256[](1); + itemIds[0] = itemId; + uint256[] memory amounts = new uint256[](1); + amounts[0] = 5; + + vm.prank(_transferrer); + vm.expectRevert(ITransferManager.TransferCallerInvalid.selector); + transferManager.transferItemsHypercert(address(mockHypercertMinter), _sender, _recipient, itemIds, amounts); + + // 2. Sender grants again approvals but owner removes the operators + _grantApprovals(_sender); + vm.prank(_owner); + vm.expectEmit(false, false, false, true); + emit OperatorRemoved(_transferrer); + transferManager.removeOperator(_transferrer); + + vm.prank(_transferrer); + vm.expectRevert(ITransferManager.TransferCallerInvalid.selector); + transferManager.transferItemsHypercert(address(mockHypercertMinter), _sender, _recipient, itemIds, amounts); + } + + function testCannotBatchTransferIfOperatorApprovalsRevoked() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + // 1. User revokes the operator + vm.prank(_sender); + vm.expectEmit(false, false, false, true); + emit ApprovalsRemoved(_sender, operators); + transferManager.revokeApprovals(operators); + + ITransferManager.BatchTransferItem[] memory items = _generateValidBatchTransferItemsPranked(_sender); + + vm.prank(_transferrer); + vm.expectRevert(ITransferManager.TransferCallerInvalid.selector); + transferManager.transferBatchItemsAcrossCollections(items, _sender, _recipient); + + // 2. Sender grants again approvals but owner removes the operators + _grantApprovals(_sender); + vm.prank(_owner); + vm.expectEmit(false, false, false, true); + emit OperatorRemoved(_transferrer); + transferManager.removeOperator(_transferrer); + + vm.prank(_transferrer); + vm.expectRevert(ITransferManager.TransferCallerInvalid.selector); + transferManager.transferBatchItemsAcrossCollections(items, _sender, _recipient); + } + + function testCannotTransferERC721OrERC1155orHypercertIfArrayLengthIs0() public { + uint256[] memory emptyArrayUint256 = new uint256[](0); + + // 1. ERC721 + vm.expectRevert(LengthsInvalid.selector); + transferManager.transferItemsERC721( + address(mockERC721), _sender, _recipient, emptyArrayUint256, emptyArrayUint256 + ); + + // 2. ERC1155 length is 0 + vm.expectRevert(LengthsInvalid.selector); + transferManager.transferItemsERC1155( + address(mockERC1155), _sender, _recipient, emptyArrayUint256, emptyArrayUint256 + ); + + // 3. Hypercert length is 0 + vm.expectRevert(LengthsInvalid.selector); + transferManager.transferItemsHypercert( + address(mockHypercertMinter), _sender, _recipient, emptyArrayUint256, emptyArrayUint256 + ); + } + + function testCannotTransferERC1155IfArrayLengthDiffers() public { + uint256[] memory itemIds = new uint256[](2); + uint256[] memory amounts = new uint256[](3); + + vm.expectRevert(LengthsInvalid.selector); + transferManager.transferItemsERC1155(address(mockERC1155), _sender, _recipient, itemIds, amounts); + } + + function testCannotTransferHypercertsIfArrayLengthDiffers() public { + uint256[] memory itemIds = new uint256[](2); + uint256[] memory amounts = new uint256[](3); + + vm.expectRevert(LengthsInvalid.selector); + transferManager.transferItemsHypercert(address(mockHypercertMinter), _sender, _recipient, itemIds, amounts); + } + + function testUserCannotGrantOrRevokeApprovalsIfArrayLengthIs0() public { + address[] memory emptyArrayAddresses = new address[](0); + + // 1. Grant approvals + vm.expectRevert(LengthsInvalid.selector); + transferManager.grantApprovals(emptyArrayAddresses); + + // 2. Revoke approvals + vm.expectRevert(LengthsInvalid.selector); + transferManager.revokeApprovals(emptyArrayAddresses); + } + + function testUserCannotGrantApprovalIfOperatorOperatorNotAllowed() public asPrankedUser(_owner) { + address randomOperator = address(420); + transferManager.allowOperator(randomOperator); + vm.expectRevert(ITransferManager.OperatorAlreadyAllowed.selector); + transferManager.allowOperator(randomOperator); + } + + function testAllowOperatorNotOwner() public { + vm.expectRevert(IOwnableTwoSteps.NotOwner.selector); + transferManager.allowOperator(address(0)); + } + + function testOwnerCannotallowOperatorIfOperatorAlreadyAllowed() public asPrankedUser(_owner) { + address randomOperator = address(420); + transferManager.allowOperator(randomOperator); + vm.expectRevert(ITransferManager.OperatorAlreadyAllowed.selector); + transferManager.allowOperator(randomOperator); + } + + function testOwnerCannotRemoveOperatorIfOperatorNotAllowed() public asPrankedUser(_owner) { + address notOperator = address(420); + vm.expectRevert(ITransferManager.OperatorNotAllowed.selector); + transferManager.removeOperator(notOperator); + } + + function testUserCannotGrantApprovalsIfOperatorNotAllowed() public { + address[] memory approvedOperators = new address[](1); + approvedOperators[0] = _transferrer; + + vm.expectRevert(ITransferManager.OperatorNotAllowed.selector); + vm.prank(_sender); + transferManager.grantApprovals(approvedOperators); + } + + function testUserCannotGrantApprovalsIfOperatorAlreadyApprovedByUser() public { + _allowOperator(_transferrer); + _grantApprovals(_sender); + + address[] memory approvedOperators = new address[](1); + approvedOperators[0] = _transferrer; + + vm.expectRevert(ITransferManager.OperatorAlreadyApprovedByUser.selector); + vm.prank(_sender); + transferManager.grantApprovals(approvedOperators); + } + + function testUserCannotRevokeApprovalsIfOperatorNotApprovedByUser() public { + address[] memory approvedOperators = new address[](1); + approvedOperators[0] = _transferrer; + + vm.expectRevert(ITransferManager.OperatorNotApprovedByUser.selector); + vm.prank(_sender); + transferManager.revokeApprovals(approvedOperators); + } + + function testRemoveOperatorNotOwner() public { + vm.expectRevert(IOwnableTwoSteps.NotOwner.selector); + transferManager.removeOperator(address(0)); + } + + function _generateValidBatchTransferItems() private returns (BatchTransferItem[] memory items) { + items = new ITransferManager.BatchTransferItem[](3); + + { + mockERC721.mint(_sender, tokenIdERC721); + mockERC1155.mint(_sender, tokenId1ERC1155, amount1ERC1155); + mockERC1155.mint(_sender, tokenId2ERC1155, amount2ERC1155); + + mockHypercertMinter.mintClaim(_sender, units1Hypercert, "https://example.com/1", FROM_CREATOR_ONLY); + mockHypercertMinter.mintClaim(_sender, units2Hypercert, "https://example.com/2", FROM_CREATOR_ONLY); + + uint256[] memory fractionIdsHypercerts = new uint256[](2); + fractionIdsHypercerts[0] = fractionId1Hypercert; + fractionIdsHypercerts[1] = fractionId2Hypercert; + + uint256[] memory amountsHypercerts = new uint256[](2); + amountsHypercerts[0] = amount1Hypercert; + amountsHypercerts[1] = amount2Hypercert; + + uint256[] memory tokenIdsERC1155 = new uint256[](2); + tokenIdsERC1155[0] = tokenId1ERC1155; + tokenIdsERC1155[1] = tokenId2ERC1155; + + uint256[] memory amountsERC1155 = new uint256[](2); + amountsERC1155[0] = amount1ERC1155; + amountsERC1155[1] = amount2ERC1155; + + uint256[] memory tokenIdsERC721 = new uint256[](1); + tokenIdsERC721[0] = tokenIdERC721; + + uint256[] memory amountsERC721 = new uint256[](1); + amountsERC721[0] = 1; + + items[0] = ITransferManager.BatchTransferItem({ + collection: address(mockERC1155), + collectionType: CollectionType.ERC1155, + itemIds: tokenIdsERC1155, + amounts: amountsERC1155 + }); + items[1] = ITransferManager.BatchTransferItem({ + collection: address(mockERC721), + collectionType: CollectionType.ERC721, + itemIds: tokenIdsERC721, + amounts: amountsERC721 + }); + items[2] = ITransferManager.BatchTransferItem({ + collection: address(mockHypercertMinter), + collectionType: CollectionType.Hypercert, + itemIds: fractionIdsHypercerts, + amounts: amountsHypercerts + }); + } + } + + function _generateValidBatchTransferItemsPranked(address pranker) + private + returns (BatchTransferItem[] memory items) + { + items = new ITransferManager.BatchTransferItem[](3); + + { + mockERC721.mint(_sender, tokenIdERC721); + mockERC1155.mint(_sender, tokenId1ERC1155, amount1ERC1155); + mockERC1155.mint(_sender, tokenId2ERC1155, amount2ERC1155); + + vm.startPrank(pranker); + mockHypercertMinter.mintClaim(pranker, units1Hypercert, "https://example.com/1", FROM_CREATOR_ONLY); + mockHypercertMinter.mintClaim(pranker, units2Hypercert, "https://example.com/2", FROM_CREATOR_ONLY); + vm.stopPrank(); + + uint256[] memory fractionIdsHypercerts = new uint256[](2); + fractionIdsHypercerts[0] = fractionId1Hypercert; + fractionIdsHypercerts[1] = fractionId2Hypercert; + + uint256[] memory amountsHypercerts = new uint256[](2); + amountsHypercerts[0] = amount1Hypercert; + amountsHypercerts[1] = amount2Hypercert; + + uint256[] memory tokenIdsERC1155 = new uint256[](2); + tokenIdsERC1155[0] = tokenId1ERC1155; + tokenIdsERC1155[1] = tokenId2ERC1155; + + uint256[] memory amountsERC1155 = new uint256[](2); + amountsERC1155[0] = amount1ERC1155; + amountsERC1155[1] = amount2ERC1155; + + uint256[] memory tokenIdsERC721 = new uint256[](1); + tokenIdsERC721[0] = tokenIdERC721; + + uint256[] memory amountsERC721 = new uint256[](1); + amountsERC721[0] = 1; + + items[0] = ITransferManager.BatchTransferItem({ + collection: address(mockERC1155), + collectionType: CollectionType.ERC1155, + itemIds: tokenIdsERC1155, + amounts: amountsERC1155 + }); + items[1] = ITransferManager.BatchTransferItem({ + collection: address(mockERC721), + collectionType: CollectionType.ERC721, + itemIds: tokenIdsERC721, + amounts: amountsERC721 + }); + items[2] = ITransferManager.BatchTransferItem({ + collection: address(mockHypercertMinter), + collectionType: CollectionType.Hypercert, + itemIds: fractionIdsHypercerts, + amounts: amountsHypercerts + }); + } + } +} diff --git a/contracts/test/foundry/marketplace/assembly/VerifyOrderTimestampValidityEquivalence.t.sol b/contracts/test/foundry/marketplace/assembly/VerifyOrderTimestampValidityEquivalence.t.sol new file mode 100644 index 00000000..504f0049 --- /dev/null +++ b/contracts/test/foundry/marketplace/assembly/VerifyOrderTimestampValidityEquivalence.t.sol @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {Test} from "forge-std/Test.sol"; + +// Assembly +import { + OutsideOfTimeRange_error_selector, + OutsideOfTimeRange_error_length, + Error_selector_offset +} from "@hypercerts/marketplace/constants/AssemblyConstants.sol"; + +contract NonAssemblyCode { + error OutsideOfTimeRange(); + + function run(uint256 startTime, uint256 endTime) external view returns (bool) { + if (startTime > block.timestamp || endTime < block.timestamp) revert OutsideOfTimeRange(); + return true; + } +} + +contract AssemblyCode { + function run(uint256 startTime, uint256 endTime) external view returns (bool) { + assembly { + if or(gt(startTime, timestamp()), lt(endTime, timestamp())) { + mstore(0x00, OutsideOfTimeRange_error_selector) + revert(Error_selector_offset, OutsideOfTimeRange_error_length) + } + } + return true; + } +} + +contract VerifyOrderTimestampValidityEquivalenceTest is Test { + AssemblyCode private assemblyCode; + NonAssemblyCode private nonAssemblyCode; + + function setUp() public { + assemblyCode = new AssemblyCode(); + nonAssemblyCode = new NonAssemblyCode(); + } + + /** + * @dev The gap between start and end time is always at least + * 3 seconds so that we can test the 2 boundaries as well + * as the 2 timestamps inside the boundaries + */ + function testEquivalenceWithinBoundaries(uint256 startTime, uint256 endTime) public { + vm.assume(endTime > 3 && startTime < endTime - 3); + + vm.warp(startTime); + assertTrue(assemblyCode.run(startTime, endTime)); + assertTrue(nonAssemblyCode.run(startTime, endTime)); + + vm.warp(startTime + 1); + assertTrue(assemblyCode.run(startTime, endTime)); + assertTrue(nonAssemblyCode.run(startTime, endTime)); + + vm.warp(endTime - 1); + assertTrue(assemblyCode.run(startTime, endTime)); + assertTrue(nonAssemblyCode.run(startTime, endTime)); + + vm.warp(endTime); + assertTrue(assemblyCode.run(startTime, endTime)); + assertTrue(nonAssemblyCode.run(startTime, endTime)); + } + + function testEquivalenceTooEarly(uint256 startTime, uint256 endTime) public { + vm.assume(startTime > 0 && startTime < endTime); + + vm.warp(startTime - 1); + + vm.expectRevert(NonAssemblyCode.OutsideOfTimeRange.selector); + assemblyCode.run(startTime, endTime); + + vm.expectRevert(NonAssemblyCode.OutsideOfTimeRange.selector); + nonAssemblyCode.run(startTime, endTime); + } + + function testEquivalenceTooLate(uint256 startTime, uint256 endTime) public { + vm.assume(endTime > 0 && endTime < type(uint256).max && startTime < endTime); + + vm.warp(endTime + 1); + + vm.expectRevert(NonAssemblyCode.OutsideOfTimeRange.selector); + assemblyCode.run(startTime, endTime); + + vm.expectRevert(NonAssemblyCode.OutsideOfTimeRange.selector); + nonAssemblyCode.run(startTime, endTime); + } +} diff --git a/contracts/test/foundry/marketplace/executionStrategies/Chainlink/USDDynamicAskOrders.t.sol b/contracts/test/foundry/marketplace/executionStrategies/Chainlink/USDDynamicAskOrders.t.sol new file mode 100644 index 00000000..40a74239 --- /dev/null +++ b/contracts/test/foundry/marketplace/executionStrategies/Chainlink/USDDynamicAskOrders.t.sol @@ -0,0 +1,488 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.17; + +// Libraries and interfaces +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; +import {IExecutionManager} from "@hypercerts/marketplace/interfaces/IExecutionManager.sol"; +import {IStrategyManager} from "@hypercerts/marketplace/interfaces/IStrategyManager.sol"; + +// Errors and constants +import { + AmountInvalid, + BidTooLow, + OrderInvalid, + CurrencyInvalid, + FunctionSelectorInvalid, + QuoteTypeInvalid +} from "@hypercerts/marketplace/errors/SharedErrors.sol"; +import {ChainlinkPriceInvalid, PriceNotRecentEnough} from "@hypercerts/marketplace/errors/ChainlinkErrors.sol"; +import { + MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE, + MAKER_ORDER_TEMPORARILY_INVALID_NON_STANDARD_SALE, + STRATEGY_NOT_ACTIVE +} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Strategies +import {StrategyChainlinkUSDDynamicAsk} from + "@hypercerts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.sol"; + +// Mocks and other tests +import {MockChainlinkAggregator} from "../../../../mock/MockChainlinkAggregator.sol"; +import {MockERC20} from "../../../../mock/MockERC20.sol"; +import {ProtocolBase} from "../../ProtocolBase.t.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract USDDynamicAskOrdersTest is ProtocolBase, IStrategyManager { + StrategyChainlinkUSDDynamicAsk public strategyUSDDynamicAsk; + bytes4 public selector = StrategyChainlinkUSDDynamicAsk.executeStrategyWithTakerBid.selector; + + // At block 15740567 + // roundId uint80 : 92233720368547793259 + // answer int256 : 126533075631 + // startedAt uint256 : 1665680123 + // updatedAt uint256 : 1665680123 + // answeredInRound uint80 : 92233720368547793259 + uint256 private constant CHAINLINK_PRICE_UPDATED_AT = 1_665_680_123; + uint256 private constant FORKED_BLOCK_NUMBER = 15_740_567; + uint256 private constant LATEST_CHAINLINK_ANSWER_IN_WAD = 126_533_075_631 * 1e10; + uint256 private constant MAXIMUM_LATENCY = 3600 seconds; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl("mainnet"), FORKED_BLOCK_NUMBER); + _setUp(); + _setUpUsers(); + _setUpNewStrategy(); + } + + function _setUpNewStrategy() private asPrankedUser(_owner) { + strategyUSDDynamicAsk = new StrategyChainlinkUSDDynamicAsk( + _owner, + address(weth), + 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 // Mainnet address of the Chainlink price feed + ); + _addStrategy(address(strategyUSDDynamicAsk), selector, false); + } + + function _createMakerAskAndTakerBid(uint256 numberOfItems, uint256 numberOfAmounts, uint256 desiredSalePriceInUSD) + private + returns (OrderStructs.Maker memory newMakerAsk, OrderStructs.Taker memory newTakerBid) + { + uint256[] memory itemIds = new uint256[](numberOfItems); + for (uint256 i; i < numberOfItems;) { + mockERC721.mint(makerUser, i + 1); + itemIds[i] = i + 1; + unchecked { + ++i; + } + } + + uint256[] memory amounts = new uint256[](numberOfAmounts); + for (uint256 i; i < numberOfAmounts;) { + amounts[i] = 1; + unchecked { + ++i; + } + } + + newMakerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: 1, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: 0.99 ether, + itemId: 1 + }); + + newMakerAsk.itemIds = itemIds; + newMakerAsk.amounts = amounts; + newMakerAsk.additionalParameters = abi.encode(desiredSalePriceInUSD); + + newTakerBid = OrderStructs.Taker(takerUser, abi.encode(1 ether)); + } + + function testNewStrategy() public { + _assertStrategyAttributes(address(strategyUSDDynamicAsk), selector, false); + } + + function testMaxLatency() public { + assertEq(strategyUSDDynamicAsk.maxLatency(), 3600); + } + + function testUSDDynamicAskChainlinkPriceInvalid() public { + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + desiredSalePriceInUSD: LATEST_CHAINLINK_ANSWER_IN_WAD + }); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + MockChainlinkAggregator priceFeed = new MockChainlinkAggregator(); + vm.etch(CHAINLINK_ETH_USD_PRICE_FEED, address(priceFeed).code); + + MockChainlinkAggregator(CHAINLINK_ETH_USD_PRICE_FEED).setAnswer(-1); + (bool isValid, bytes4 errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerAsk, selector); + assertFalse(isValid); + assertEq(errorSelector, ChainlinkPriceInvalid.selector); + + vm.expectRevert(errorSelector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + MockChainlinkAggregator(CHAINLINK_ETH_USD_PRICE_FEED).setAnswer(0); + (isValid, errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerAsk, selector); + assertFalse(isValid); + assertEq(errorSelector, ChainlinkPriceInvalid.selector); + + vm.expectRevert(errorSelector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testUSDDynamicAskUSDValueGreaterThanOrEqualToMinAcceptedEthValue() public { + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + desiredSalePriceInUSD: LATEST_CHAINLINK_ANSWER_IN_WAD + }); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + (bool isValid, bytes4 errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerAsk, selector); + assertTrue(isValid); + assertEq(errorSelector, _EMPTY_BYTES4); + + // Execute taker bid transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + // Taker user has received the asset + assertEq(mockERC721.ownerOf(1), takerUser); + // Taker bid user pays the whole price + assertEq(weth.balanceOf(takerUser), _initialWETHBalanceUser - 1 ether); + // Maker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser + 0.995 ether); + } + + function testUSDDynamicAskUSDValueLessThanMinAcceptedEthValue() public { + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + desiredSalePriceInUSD: (LATEST_CHAINLINK_ANSWER_IN_WAD * 98) / 100 + }); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + (bool isValid, bytes4 errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerAsk, selector); + assertTrue(isValid); + assertEq(errorSelector, _EMPTY_BYTES4); + + // Execute taker bid transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + // Taker user has received the asset + assertEq(mockERC721.ownerOf(1), takerUser); + + // Taker bid user pays the whole price + assertEq(weth.balanceOf(takerUser), _initialWETHBalanceUser - 0.99 ether); + // Maker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser + 0.98505 ether); + } + + // This tests that we can handle fractions + function testUSDDynamicAskUSDValueLessThanOneETH() public { + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + desiredSalePriceInUSD: LATEST_CHAINLINK_ANSWER_IN_WAD / 2 + }); + + makerAsk.price = 0.49 ether; + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + (bool isValid, bytes4 errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerAsk, selector); + assertTrue(isValid); + assertEq(errorSelector, _EMPTY_BYTES4); + + // Execute taker bid transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + // Taker user has received the asset + assertEq(mockERC721.ownerOf(1), takerUser); + + // Taker bid user pays the whole price + assertEq(weth.balanceOf(takerUser), _initialWETHBalanceUser - 0.5 ether); + // Maker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser + 0.4975 ether); + } + + function testUSDDynamicAskBidderOverpaid() public { + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + desiredSalePriceInUSD: LATEST_CHAINLINK_ANSWER_IN_WAD + }); + + makerAsk.currency = ETH; + // Bidder overpays by 0.1 ETH + uint256 maxPrice = 1.1 ether; + takerBid.additionalParameters = abi.encode(maxPrice); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + uint256 initialETHBalanceTakerUser = address(takerUser).balance; + uint256 initialETHBalanceMakerUser = address(makerUser).balance; + + (bool isValid, bytes4 errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerAsk, selector); + assertTrue(isValid); + assertEq(errorSelector, _EMPTY_BYTES4); + + // Execute taker bid transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerBid{value: maxPrice}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + // Taker user has received the asset + assertEq(mockERC721.ownerOf(1), takerUser); + // Taker bid user pays the whole price, but without overpaying + assertEq(address(takerUser).balance, initialETHBalanceTakerUser - 1 ether - 1); + // Maker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq(address(makerUser).balance, initialETHBalanceMakerUser + 0.995 ether); + } + + function testOraclePriceNotRecentEnough() public { + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + desiredSalePriceInUSD: LATEST_CHAINLINK_ANSWER_IN_WAD + }); + + makerAsk.startTime = CHAINLINK_PRICE_UPDATED_AT; + uint256 latencyViolationTimestamp = CHAINLINK_PRICE_UPDATED_AT + MAXIMUM_LATENCY + 1 seconds; + makerAsk.endTime = latencyViolationTimestamp; + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + vm.warp(latencyViolationTimestamp); + + bytes4 errorSelector = PriceNotRecentEnough.selector; + + _assertOrderIsInvalid(makerAsk, errorSelector); + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_TEMPORARILY_INVALID_NON_STANDARD_SALE); + + vm.expectRevert(errorSelector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testCannotExecuteIfNotWETHOrETH() public { + MockERC20 fakeCurrency = new MockERC20(); + vm.prank(_owner); + looksRareProtocol.updateCurrencyStatus(address(fakeCurrency), true); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + desiredSalePriceInUSD: LATEST_CHAINLINK_ANSWER_IN_WAD + }); + + // Adjust the currency to something creative + makerAsk.currency = address(fakeCurrency); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + (bool isValid, bytes4 errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerAsk, selector); + assertFalse(isValid); + assertEq(errorSelector, CurrencyInvalid.selector); + + vm.expectRevert(errorSelector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testZeroItemIdsLength() public { + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 0, + numberOfAmounts: 0, + desiredSalePriceInUSD: LATEST_CHAINLINK_ANSWER_IN_WAD + }); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + (bool isValid, bytes4 errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerAsk, selector); + assertFalse(isValid); + assertEq(errorSelector, OrderInvalid.selector); + + vm.expectRevert(errorSelector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testItemIdsAndAmountsLengthMismatch() public { + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 2, + desiredSalePriceInUSD: LATEST_CHAINLINK_ANSWER_IN_WAD + }); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + (bool isValid, bytes4 errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerAsk, selector); + assertFalse(isValid); + assertEq(errorSelector, OrderInvalid.selector); + + vm.expectRevert(errorSelector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testWrongQuoteType() public { + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 1, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: 1 ether, + itemId: 420 + }); + + (bool orderIsValid, bytes4 errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerBid, selector); + + assertFalse(orderIsValid); + assertEq(errorSelector, QuoteTypeInvalid.selector); + } + + function testZeroAmount() public { + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + desiredSalePriceInUSD: LATEST_CHAINLINK_ANSWER_IN_WAD + }); + + uint256[] memory amounts = new uint256[](1); + amounts[0] = 0; + makerAsk.amounts = amounts; + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Valid, taker struct validation only happens during execution + (bool isValid, bytes4 errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerAsk, selector); + assertFalse(isValid); + assertEq(errorSelector, OrderInvalid.selector); + + vm.prank(takerUser); + vm.expectRevert(AmountInvalid.selector); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testAmountGreaterThanOneForERC721() public { + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + desiredSalePriceInUSD: LATEST_CHAINLINK_ANSWER_IN_WAD + }); + + uint256[] memory amounts = new uint256[](1); + amounts[0] = 2; + makerAsk.amounts = amounts; + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Valid, taker struct validation only happens during execution + _assertOrderIsInvalid(makerAsk, OrderInvalid.selector); + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(AmountInvalid.selector); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerBidTooLow() public { + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + desiredSalePriceInUSD: LATEST_CHAINLINK_ANSWER_IN_WAD + }); + + takerBid.additionalParameters = abi.encode(0.99 ether); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Valid, taker struct validation only happens during execution + _assertOrderIsValid(makerAsk); + _assertValidMakerOrder(makerAsk, signature); + + vm.expectRevert(BidTooLow.selector); + vm.prank(takerUser); + + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testInactiveStrategy() public { + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + desiredSalePriceInUSD: LATEST_CHAINLINK_ANSWER_IN_WAD + }); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + vm.prank(_owner); + looksRareProtocol.updateStrategy(1, false, _standardProtocolFeeBp, _minTotalFeeBp); + + _assertOrderIsValid(makerAsk); + _assertMakerOrderReturnValidationCode(makerAsk, signature, STRATEGY_NOT_ACTIVE); + + vm.expectRevert(abi.encodeWithSelector(IExecutionManager.StrategyNotAvailable.selector, 1)); + vm.prank(takerUser); + + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testInvalidSelector() public { + OrderStructs.Maker memory makerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: 2, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: 1 ether, + itemId: 420 + }); + + (bool orderIsValid, bytes4 errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerAsk, bytes4(0)); + assertFalse(orderIsValid); + assertEq(errorSelector, FunctionSelectorInvalid.selector); + } + + function _assertOrderIsInvalid(OrderStructs.Maker memory makerAsk, bytes4 expectedErrorSelector) private { + (bool isValid, bytes4 errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerAsk, selector); + assertFalse(isValid); + assertEq(errorSelector, expectedErrorSelector); + } + + function _assertOrderIsValid(OrderStructs.Maker memory makerAsk) private { + (bool isValid, bytes4 errorSelector) = strategyUSDDynamicAsk.isMakerOrderValid(makerAsk, selector); + assertTrue(isValid); + assertEq(errorSelector, _EMPTY_BYTES4); + } +} diff --git a/contracts/test/foundry/marketplace/executionStrategies/CollectionOffers.t.sol b/contracts/test/foundry/marketplace/executionStrategies/CollectionOffers.t.sol new file mode 100644 index 00000000..a147ede7 --- /dev/null +++ b/contracts/test/foundry/marketplace/executionStrategies/CollectionOffers.t.sol @@ -0,0 +1,566 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.17; + +// Murky (third-party) library is used to compute Merkle trees in Solidity +import {Merkle} from "murky/Merkle.sol"; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Shared errors +import { + AmountInvalid, + OrderInvalid, + FunctionSelectorInvalid, + MerkleProofInvalid, + QuoteTypeInvalid +} from "@hypercerts/marketplace/errors/SharedErrors.sol"; +import {MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE} from + "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Strategies +import {StrategyCollectionOffer} from "@hypercerts/marketplace/executionStrategies/StrategyCollectionOffer.sol"; + +// Base test +import {ProtocolBase} from "../ProtocolBase.t.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract CollectionOrdersTest is ProtocolBase { + StrategyCollectionOffer public strategyCollectionOffer; + bytes4 public selectorNoProof = strategyCollectionOffer.executeCollectionStrategyWithTakerAsk.selector; + bytes4 public selectorWithProof = strategyCollectionOffer.executeCollectionStrategyWithTakerAskWithProof.selector; + bytes4 public selectorWithProofAllowlist = + strategyCollectionOffer.executeCollectionStrategyWithTakerAskWithAllowlist.selector; + + uint256 private constant price = 1 ether; // Fixed price of sale + bytes32 private constant mockMerkleRoot = bytes32(keccak256("Mock")); // Mock merkle root + + function setUp() public { + _setUp(); + _setUpNewStrategies(); + } + + function _setUpNewStrategies() private asPrankedUser(_owner) { + strategyCollectionOffer = new StrategyCollectionOffer(); + _addStrategy(address(strategyCollectionOffer), selectorNoProof, true); + _addStrategy(address(strategyCollectionOffer), selectorWithProof, true); + _addStrategy(address(strategyCollectionOffer), selectorWithProofAllowlist, true); + } + + function testNewStrategies() public { + _assertStrategyAttributes(address(strategyCollectionOffer), selectorNoProof, true); + + ( + bool strategyIsActive, + uint16 strategyStandardProtocolFee, + uint16 strategyMinTotalFee, + uint16 strategyMaxProtocolFee, + bytes4 strategySelector, + bool strategyIsMakerBid, + address strategyImplementation + ) = looksRareProtocol.strategyInfo(2); + + assertTrue(strategyIsActive); + assertEq(strategyStandardProtocolFee, _standardProtocolFeeBp); + assertEq(strategyMinTotalFee, _minTotalFeeBp); + assertEq(strategyMaxProtocolFee, _maxProtocolFeeBp); + assertEq(strategySelector, selectorWithProof); + assertTrue(strategyIsMakerBid); + assertEq(strategyImplementation, address(strategyCollectionOffer)); + } + + function testMakerBidAmountsLengthNotOne() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + + // Adjust strategy for collection order and sign order + // Change array to make it bigger than expected + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1; + makerBid.strategyId = 1; + makerBid.amounts = amounts; + takerAsk.additionalParameters = abi.encode(1, 1); + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + _assertOrderIsInvalid(makerBid, false); + _assertMakerOrderReturnValidationCode(makerBid, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.expectRevert(OrderInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // With proof + makerBid.strategyId = 2; + makerBid.additionalParameters = abi.encode(mockMerkleRoot); + signature = _signMakerOrder(makerBid, makerUserPK); + + _assertOrderIsInvalid(makerBid, true); + _assertMakerOrderReturnValidationCode(makerBid, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.expectRevert(OrderInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testZeroAmount() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMockMakerBidAndTakerAsk(address(mockERC721), address(weth)); + + uint256[] memory amounts = new uint256[](1); + amounts[0] = 0; + makerBid.amounts = amounts; + makerBid.strategyId = 1; + makerBid.additionalParameters = abi.encode(mockMerkleRoot); + takerAsk.additionalParameters = abi.encode(1, 1); + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + _assertOrderIsInvalid(makerBid, false); + _assertMakerOrderReturnValidationCode(makerBid, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(AmountInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + /** + * Any itemId for ERC721 (where royalties come from the registry) is sold through a collection taker ask using WETH. + * We use fuzzing to generate the tokenId that is sold. + */ + function testTakerAskCollectionOrderERC721(uint256 tokenId) public { + _setUpUsers(); + + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 1, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemId: 0 // Not used + }); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Mint asset + mockERC721.mint(takerUser, tokenId); + + // Prepare the taker ask + OrderStructs.Taker memory takerAsk = OrderStructs.Taker(takerUser, abi.encode(tokenId, 1)); + + _assertOrderIsValid(makerBid, false); + _assertValidMakerOrder(makerBid, signature); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulTakerAsk(makerBid, tokenId); + } + + /** + * A collection offer with merkle tree criteria + * + * COLLECTION TOKEN IDs + */ + function testTakerAskCollectionOrderWithMerkleTreeERC721() public { + _setUpUsers(); + + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 2, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemId: 0 // Not used + }); + + uint256 itemIdInMerkleTree = 2; + (bytes32 merkleRoot, bytes32[] memory proof) = _mintNFTsToOwnerAndGetMerkleRootAndProof({ + owner: takerUser, + numberOfItemsInMerkleTree: 5, + itemIdInMerkleTree: itemIdInMerkleTree + }); + + makerBid.additionalParameters = abi.encode(merkleRoot); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Prepare the taker ask + OrderStructs.Taker memory takerAsk = OrderStructs.Taker(takerUser, abi.encode(itemIdInMerkleTree, proof)); + + // Verify validity of maker bid order + _assertOrderIsValid(makerBid, true); + _assertValidMakerOrder(makerBid, signature); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulTakerAsk(makerBid, itemIdInMerkleTree); + } + + function testTakerAskCannotExecuteWithInvalidProof(uint256 itemIdSold) public { + vm.assume(itemIdSold > 5); + _setUpUsers(); + + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 2, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemId: 0 // Not used + }); + + (bytes32 merkleRoot, bytes32[] memory proof) = _mintNFTsToOwnerAndGetMerkleRootAndProof({ + owner: takerUser, + numberOfItemsInMerkleTree: 5, + // Doesn't matter what itemIdInMerkleTree is as we are are going to tamper with the proof + itemIdInMerkleTree: 4 + }); + makerBid.additionalParameters = abi.encode(merkleRoot); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Prepare the taker ask + proof[0] = bytes32(0); // Tamper with the proof + OrderStructs.Taker memory takerAsk = OrderStructs.Taker(takerUser, abi.encode(itemIdSold, proof)); + + // Verify validity of maker bid order + _assertOrderIsValid(makerBid, true); + _assertValidMakerOrder(makerBid, signature); + + vm.prank(takerUser); + vm.expectRevert(MerkleProofInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + /** + * TAKER ALLOWLIST + */ + function testTakerAskCollectionOrderWithMerkleTreeERC721AccountAllowlist() public { + _setUpUsers(); + + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 3, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemId: 0 // Not used + }); + + address accountInMerkleTree = takerUser; + uint256 tokenIdInMerkleTree = 2; + (bytes32 merkleRoot, bytes32[] memory proof) = _mintNFTsToOwnerAndGetMerkleRootAndProofAccountAllowlist({ + owner: takerUser, + numberOfAccountsInMerkleTree: 5, + accountInMerkleTree: accountInMerkleTree + }); + + makerBid.additionalParameters = abi.encode(merkleRoot); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Prepare the taker ask + OrderStructs.Taker memory takerAsk = OrderStructs.Taker(takerUser, abi.encode(tokenIdInMerkleTree, proof)); + + // Verify validity of maker bid order + _assertOrderIsValid(makerBid, true); + _assertValidMakerOrder(makerBid, signature); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulTakerAsk(makerBid, tokenIdInMerkleTree); + } + + function testTakerAskCannotExecuteWithInvalidProofAccountAllowlist(uint256 itemIdSold) public { + vm.assume(itemIdSold > 5); + _setUpUsers(); + + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 3, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemId: 0 // Not used + }); + + address accountInMerkleTree = takerUser; + uint256 tokenIdInMerkleTree = 2; + (bytes32 merkleRoot, bytes32[] memory proof) = _mintNFTsToOwnerAndGetMerkleRootAndProofAccountAllowlist({ + owner: takerUser, + numberOfAccountsInMerkleTree: 5, + // Doesn't matter what itemIdInMerkleTree is as we are are going to tamper with the proof + accountInMerkleTree: accountInMerkleTree + }); + makerBid.additionalParameters = abi.encode(merkleRoot); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Prepare the taker ask + proof[0] = bytes32(0); // Tamper with the proof + OrderStructs.Taker memory takerAsk = OrderStructs.Taker(takerUser, abi.encode(tokenIdInMerkleTree, proof)); + + // Verify validity of maker bid order + _assertOrderIsValid(makerBid, true); + _assertValidMakerOrder(makerBid, signature); + + vm.prank(takerUser); + vm.expectRevert(MerkleProofInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testInvalidAmounts() public { + _setUpUsers(); + + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 1, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemId: 0 + }); + + // Prepare the taker ask + OrderStructs.Taker memory takerAsk = OrderStructs.Taker(takerUser, abi.encode(5)); + + // 1. Amount is 0 (without merkle proof) + makerBid.amounts[0] = 0; + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + _assertOrderIsInvalid(makerBid, false); + _assertMakerOrderReturnValidationCode(makerBid, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(AmountInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // 2. Amount is too high for ERC721 (without merkle proof) + makerBid.amounts[0] = 2; + signature = _signMakerOrder(makerBid, makerUserPK); + _assertOrderIsInvalid(makerBid, false); + _assertMakerOrderReturnValidationCode(makerBid, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(AmountInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // 3. Amount is 0 (with merkle proof) + makerBid.strategyId = 2; + uint256 itemIdInMerkleTree = 5; + (bytes32 merkleRoot, bytes32[] memory proof) = _mintNFTsToOwnerAndGetMerkleRootAndProof({ + owner: takerUser, + numberOfItemsInMerkleTree: 6, + itemIdInMerkleTree: itemIdInMerkleTree + }); + + makerBid.additionalParameters = abi.encode(merkleRoot); + makerBid.amounts[0] = 0; + signature = _signMakerOrder(makerBid, makerUserPK); + + takerAsk.additionalParameters = abi.encode(itemIdInMerkleTree, proof); + + _assertOrderIsInvalid(makerBid, true); + _assertMakerOrderReturnValidationCode(makerBid, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(AmountInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // 4. Amount is too high for ERC721 (with merkle proof) + makerBid.amounts[0] = 2; + signature = _signMakerOrder(makerBid, makerUserPK); + _assertOrderIsInvalid(makerBid, true); + _assertMakerOrderReturnValidationCode(makerBid, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(AmountInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testMerkleRootLengthIsNot32() public { + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 2, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemId: 0 + }); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + _assertOrderIsInvalid(makerBid, true); + _assertMakerOrderReturnValidationCode(makerBid, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(); // It should revert without data (since the root cannot be extracted since the + // additionalParameters length is 0) + looksRareProtocol.executeTakerAsk(_genericTakerOrder(), makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testInvalidSelector() public { + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 3, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemId: 0 + }); + + (bool orderIsValid, bytes4 errorSelector) = strategyCollectionOffer.isMakerOrderValid(makerBid, bytes4(0)); + assertFalse(orderIsValid); + assertEq(errorSelector, FunctionSelectorInvalid.selector); + } + + function testWrongQuoteType() public { + OrderStructs.Maker memory makerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: 2, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemId: 0 + }); + + (bool orderIsValid, bytes4 errorSelector) = strategyCollectionOffer.isMakerOrderValid(makerAsk, selectorNoProof); + + assertFalse(orderIsValid); + assertEq(errorSelector, QuoteTypeInvalid.selector); + } + + function _assertOrderIsValid(OrderStructs.Maker memory makerBid, bool withProof) private { + (bool orderIsValid, bytes4 errorSelector) = + strategyCollectionOffer.isMakerOrderValid(makerBid, withProof ? selectorWithProof : selectorNoProof); + assertTrue(orderIsValid); + assertEq(errorSelector, _EMPTY_BYTES4); + } + + function _assertOrderIsInvalid(OrderStructs.Maker memory makerBid, bool withProof) private { + (bool orderIsValid, bytes4 errorSelector) = + strategyCollectionOffer.isMakerOrderValid(makerBid, withProof ? selectorWithProof : selectorNoProof); + + assertFalse(orderIsValid); + assertEq(errorSelector, OrderInvalid.selector); + } + + function _mintNFTsToOwnerAndGetMerkleRootAndProof( + address owner, + uint256 numberOfItemsInMerkleTree, + uint256 itemIdInMerkleTree + ) private returns (bytes32 merkleRoot, bytes32[] memory proof) { + require(itemIdInMerkleTree < numberOfItemsInMerkleTree, "Invalid itemIdInMerkleTree"); + + // Initialize Merkle Tree + Merkle m = new Merkle(); + + bytes32[] memory merkleTreeIds = new bytes32[](numberOfItemsInMerkleTree); + for (uint256 i; i < numberOfItemsInMerkleTree; i++) { + mockERC721.mint(owner, i); + merkleTreeIds[i] = keccak256(abi.encodePacked(i)); + } + + // Compute merkle root + merkleRoot = m.getRoot(merkleTreeIds); + proof = m.getProof(merkleTreeIds, itemIdInMerkleTree); + + assertTrue(m.verifyProof(merkleRoot, proof, merkleTreeIds[itemIdInMerkleTree])); + } + + function _mintNFTsToOwnerAndGetMerkleRootAndProofAccountAllowlist( + address owner, + uint256 numberOfAccountsInMerkleTree, + address accountInMerkleTree + ) private returns (bytes32 merkleRoot, bytes32[] memory proof) { + // Initialize Merkle Tree + Merkle m = new Merkle(); + + bytes32[] memory merkleTreeAccounts = new bytes32[](numberOfAccountsInMerkleTree); + for (uint256 i; i < numberOfAccountsInMerkleTree; i++) { + mockERC721.mint(owner, i); + merkleTreeAccounts[i] = keccak256(abi.encodePacked(accountInMerkleTree)); + } + + // Compute merkle root + merkleRoot = m.getRoot(merkleTreeAccounts); + proof = m.getProof(merkleTreeAccounts, 2); + + assertTrue(m.verifyProof(merkleRoot, proof, merkleTreeAccounts[0])); + } + + function _assertSuccessfulTakerAsk(OrderStructs.Maker memory makerBid, uint256 tokenId) private { + // Taker user has received the asset + assertEq(mockERC721.ownerOf(tokenId), makerUser); + // Maker bid user pays the whole price + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser - price); + // Taker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq( + weth.balanceOf(takerUser), + _initialWETHBalanceUser + (price * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP + ); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerBid.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } +} diff --git a/contracts/test/foundry/marketplace/executionStrategies/DutchAuctionOrders.t.sol b/contracts/test/foundry/marketplace/executionStrategies/DutchAuctionOrders.t.sol new file mode 100644 index 00000000..4370cb3d --- /dev/null +++ b/contracts/test/foundry/marketplace/executionStrategies/DutchAuctionOrders.t.sol @@ -0,0 +1,407 @@ +/// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries and interfaces +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; +import {IExecutionManager} from "@hypercerts/marketplace/interfaces/IExecutionManager.sol"; +import {IStrategyManager} from "@hypercerts/marketplace/interfaces/IStrategyManager.sol"; + +// Shared errors +import { + AmountInvalid, + BidTooLow, + OrderInvalid, + FunctionSelectorInvalid, + QuoteTypeInvalid +} from "@hypercerts/marketplace/errors/SharedErrors.sol"; +import { + STRATEGY_NOT_ACTIVE, + MAKER_ORDER_TEMPORARILY_INVALID_NON_STANDARD_SALE, + MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE +} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Strategies +import {StrategyDutchAuction} from "@hypercerts/marketplace/executionStrategies/StrategyDutchAuction.sol"; + +// Other tests +import {ProtocolBase} from "../ProtocolBase.t.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract DutchAuctionOrdersTest is ProtocolBase, IStrategyManager { + StrategyDutchAuction public strategyDutchAuction; + bytes4 public selector = StrategyDutchAuction.executeStrategyWithTakerBid.selector; + + function setUp() public { + _setUp(); + } + + function _setUpNewStrategy() private asPrankedUser(_owner) { + strategyDutchAuction = new StrategyDutchAuction(); + _addStrategy(address(strategyDutchAuction), selector, false); + } + + function _createMakerAskAndTakerBid( + uint256 numberOfItems, + uint256 numberOfAmounts, + uint256 startPrice, + uint256 endPrice, + uint256 endTime + ) private returns (OrderStructs.Maker memory newMakerAsk, OrderStructs.Taker memory newTakerBid) { + uint256[] memory itemIds = new uint256[](numberOfItems); + for (uint256 i; i < numberOfItems;) { + mockERC721.mint(makerUser, i + 1); + itemIds[i] = i + 1; + unchecked { + ++i; + } + } + + uint256[] memory amounts = new uint256[](numberOfAmounts); + for (uint256 i; i < numberOfAmounts;) { + amounts[i] = 1; + unchecked { + ++i; + } + } + + newMakerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: 1, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: endPrice, + itemId: 1 + }); + + newMakerAsk.itemIds = itemIds; + newMakerAsk.amounts = amounts; + + newMakerAsk.endTime = endTime; + newMakerAsk.additionalParameters = abi.encode(startPrice); + + // Using startPrice as the maxPrice + newTakerBid = OrderStructs.Taker(takerUser, abi.encode(startPrice)); + } + + function testNewStrategy() public { + _setUpNewStrategy(); + _assertStrategyAttributes(address(strategyDutchAuction), selector, false); + } + + function _fuzzAssumptions(uint256 _startPrice, uint256 _duration, uint256 _decayPerSecond, uint256 _elapsedTime) + private + returns (uint256 startPrice, uint256 duration, uint256 decayPerSecond, uint256 elapsedTime) + { + // Bound instead of assume to handle too many rejections + // These limits should be realistically way more than enough + // vm.assume(duration > 0 && duration <= 31_536_000); + // Assume the NFT is worth at least 0.01 USD at today's ETH price (2023-01-13 18:00:00 UTC) + // vm.assume(startPrice > 1e12 && startPrice <= 100_000 ether); + // vm.assume(decayPerSecond > 0 && decayPerSecond < startPrice); + // vm.assume(elapsedTime <= duration && startPrice > decayPerSecond * duration); + + duration = bound(_duration, 1, 31_536_600); + startPrice = bound(_startPrice, 1e12, 100_000 ether); + decayPerSecond = bound(_decayPerSecond, 1, startPrice); + + vm.assume(_elapsedTime <= duration && startPrice > decayPerSecond * duration); + elapsedTime = _elapsedTime; + } + + function _calculatePrices(uint256 startPrice, uint256 duration, uint256 decayPerSecond, uint256 elapsedTime) + private + pure + returns (uint256 endPrice, uint256 executionPrice) + { + endPrice = startPrice - decayPerSecond * duration; + uint256 discount = decayPerSecond * elapsedTime; + executionPrice = startPrice - discount; + } + + function testDutchAuction(uint256 _startPrice, uint256 _duration, uint256 _decayPerSecond, uint256 _elapsedTime) + public + { + (uint256 startPrice, uint256 duration, uint256 decayPerSecond, uint256 elapsedTime) = + _fuzzAssumptions(_startPrice, _duration, _decayPerSecond, _elapsedTime); + _setUpUsers(); + _setUpNewStrategy(); + + (uint256 endPrice, uint256 executionPrice) = _calculatePrices(startPrice, duration, decayPerSecond, elapsedTime); + + deal(address(weth), takerUser, executionPrice); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + startPrice: startPrice, + endPrice: endPrice, + endTime: block.timestamp + duration + }); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + _assertOrderIsValid(makerAsk); + _assertValidMakerOrder(makerAsk, signature); + + vm.warp(block.timestamp + elapsedTime); + + // Execute taker bid transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + // Taker user has received the asset + assertEq(mockERC721.ownerOf(1), takerUser); + + // Taker bid user pays the whole price + assertEq(weth.balanceOf(takerUser), 0, "taker balance incorrect"); + // Maker ask user receives 99.5% of the whole price (0.5% protocol) + uint256 protocolFee = (executionPrice * _standardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP; + assertEq( + weth.balanceOf(makerUser), + _initialWETHBalanceUser + (executionPrice - protocolFee), + "maker balance incorrect" + ); + } + + function testStartPriceTooLow(uint256 _startPrice, uint256 _duration, uint256 _decayPerSecond, uint256 _elapsedTime) + public + { + (uint256 startPrice, uint256 duration, uint256 decayPerSecond, uint256 elapsedTime) = + _fuzzAssumptions(_startPrice, _duration, _decayPerSecond, _elapsedTime); + _setUpUsers(); + _setUpNewStrategy(); + + (uint256 endPrice, uint256 executionPrice) = _calculatePrices(startPrice, duration, decayPerSecond, elapsedTime); + deal(address(weth), takerUser, executionPrice); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + startPrice: startPrice, + endPrice: endPrice, + endTime: block.timestamp + duration + }); + + makerAsk.price = startPrice + 1 wei; + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + bytes4 errorSelector = _assertOrderIsInvalid(makerAsk); + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.expectRevert(errorSelector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerBidTooLow(uint256 _startPrice, uint256 _duration, uint256 _decayPerSecond, uint256 _elapsedTime) + public + { + (uint256 startPrice, uint256 duration, uint256 decayPerSecond, uint256 elapsedTime) = + _fuzzAssumptions(_startPrice, _duration, _decayPerSecond, _elapsedTime); + _setUpUsers(); + _setUpNewStrategy(); + + (uint256 endPrice, uint256 executionPrice) = _calculatePrices(startPrice, duration, decayPerSecond, elapsedTime); + deal(address(weth), takerUser, executionPrice); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + startPrice: startPrice, + endPrice: endPrice, + endTime: block.timestamp + duration + }); + + takerBid.additionalParameters = abi.encode(executionPrice - 1 wei); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Valid, taker struct validation only happens during execution + _assertOrderIsValid(makerAsk); + _assertValidMakerOrder(makerAsk, signature); + + vm.expectRevert(BidTooLow.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testInactiveStrategy() public { + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + startPrice: 10 ether, + endPrice: 1 ether, + endTime: block.timestamp + 1 hours + }); + + vm.prank(_owner); + looksRareProtocol.updateStrategy(1, false, _standardProtocolFeeBp, _minTotalFeeBp); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + _assertOrderIsValid(makerAsk); + _assertMakerOrderReturnValidationCode(makerAsk, signature, STRATEGY_NOT_ACTIVE); + + vm.prank(takerUser); + vm.expectRevert(abi.encodeWithSelector(IExecutionManager.StrategyNotAvailable.selector, 1)); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testZeroItemIdsLength() public { + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 0, + numberOfAmounts: 0, + startPrice: 10 ether, + endPrice: 1 ether, + endTime: block.timestamp + 1 hours + }); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + bytes4 errorSelector = _assertOrderIsInvalid(makerAsk); + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.expectRevert(errorSelector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testItemIdsAndAmountsLengthMismatch() public { + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 2, + startPrice: 10 ether, + endPrice: 1 ether, + endTime: block.timestamp + 1 hours + }); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + bytes4 errorSelector = _assertOrderIsInvalid(makerAsk); + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.expectRevert(errorSelector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testInvalidAmounts() public { + _setUpUsers(); + _setUpNewStrategy(); + + // 1. Amount = 0 + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = _createMakerAskAndTakerBid({ + numberOfItems: 1, + numberOfAmounts: 1, + startPrice: 10 ether, + endPrice: 1 ether, + endTime: block.timestamp + 1 hours + }); + + makerAsk.amounts[0] = 0; + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + bytes4 errorSelector = _assertOrderIsInvalid(makerAsk); + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.expectRevert(AmountInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + // 2. ERC721 amount > 1 + makerAsk.amounts[0] = 2; + signature = _signMakerOrder(makerAsk, makerUserPK); + + errorSelector = _assertOrderIsInvalid(makerAsk); + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(AmountInvalid.selector); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testWrongQuoteType() public { + _setUpNewStrategy(); + + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 1, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: 1 ether, + itemId: 420 + }); + + (bool orderIsValid, bytes4 errorSelector) = strategyDutchAuction.isMakerOrderValid(makerBid, selector); + + assertFalse(orderIsValid); + assertEq(errorSelector, QuoteTypeInvalid.selector); + } + + function testInvalidSelector() public { + _setUpNewStrategy(); + + OrderStructs.Maker memory makerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: 2, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: 1 ether, + itemId: 420 + }); + + (bool orderIsValid, bytes4 errorSelector) = strategyDutchAuction.isMakerOrderValid(makerAsk, bytes4(0)); + assertFalse(orderIsValid); + assertEq(errorSelector, FunctionSelectorInvalid.selector); + } + + function _assertOrderIsValid(OrderStructs.Maker memory makerAsk) private { + (bool isValid, bytes4 errorSelector) = strategyDutchAuction.isMakerOrderValid(makerAsk, selector); + assertTrue(isValid); + assertEq(errorSelector, _EMPTY_BYTES4); + } + + function _assertOrderIsInvalid(OrderStructs.Maker memory makerAsk) private returns (bytes4) { + (bool isValid, bytes4 errorSelector) = strategyDutchAuction.isMakerOrderValid(makerAsk, selector); + assertFalse(isValid); + assertEq(errorSelector, OrderInvalid.selector); + + return errorSelector; + } +} diff --git a/contracts/test/foundry/marketplace/executionStrategies/HypercertFractionOffers.t.sol b/contracts/test/foundry/marketplace/executionStrategies/HypercertFractionOffers.t.sol new file mode 100644 index 00000000..c04a128a --- /dev/null +++ b/contracts/test/foundry/marketplace/executionStrategies/HypercertFractionOffers.t.sol @@ -0,0 +1,604 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.17; + +// Murky (third-party) library is used to compute Merkle trees in Solidity +import {Merkle} from "murky/Merkle.sol"; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Shared errors +import { + AmountInvalid, + LengthsInvalid, + OrderInvalid, + FunctionSelectorInvalid, + MerkleProofInvalid, + QuoteTypeInvalid +} from "@hypercerts/marketplace/errors/SharedErrors.sol"; +import {MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE} from + "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Strategies +import {StrategyHypercertFractionOffer} from + "@hypercerts/marketplace/executionStrategies/StrategyHypercertFractionOffer.sol"; + +// Base test +import {ProtocolBase} from "../ProtocolBase.t.sol"; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract HypercertFractionOffersTest is ProtocolBase { + using OrderStructs for OrderStructs.Maker; + + StrategyHypercertFractionOffer public strategyHypercertFractionOffer; + bytes4 public selectorNoProof = StrategyHypercertFractionOffer.executeHypercertFractionStrategyWithTakerBid.selector; + bytes4 public selectorWithProofAllowlist = + StrategyHypercertFractionOffer.executeHypercertFractionStrategyWithTakerBidWithAllowlist.selector; + + uint256 private constant price = 0.001 ether; // Fixed price of sale + bytes32 private constant mockMerkleRoot = bytes32(keccak256("Mock")); // Mock merkle root + + uint256 private constant minUnitAmount = 1; + uint256 private constant maxUnitAmount = 100; + + function _createMakerAskAndTakerBidHypercert(bool mint) + private + returns (OrderStructs.Maker memory newMakerAsk, OrderStructs.Taker memory newTakerBid) + { + vm.prank(makerUser); + // Mint asset + if (mint == true) mockHypercertMinter.mintClaim(makerUser, 10_000, "https://examle.com", FROM_CREATOR_ONLY); + + uint256[] memory itemIds = new uint256[](1); + itemIds[0] = (1 << 128) + 1; + + uint256[] memory amounts = new uint256[](1); + amounts[0] = 5000; + + newMakerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: 1, + collectionType: CollectionType.Hypercert, + orderNonce: 0, + collection: address(mockHypercertMinter), + currency: address(weth), + signer: makerUser, + price: price, + itemId: 0 + }); + + newMakerAsk.itemIds = itemIds; + newMakerAsk.amounts = amounts; + newMakerAsk.additionalParameters = abi.encode(minUnitAmount, maxUnitAmount, mockMerkleRoot); + + // Using startPrice as the maxPrice + bytes32[] memory proofs = new bytes32[](0); + + newTakerBid = OrderStructs.Taker(takerUser, abi.encode(minUnitAmount, price, proofs)); + } + + function setUp() public { + _setUp(); + _setUpNewStrategies(); + } + + function _setUpNewStrategies() private asPrankedUser(_owner) { + strategyHypercertFractionOffer = new StrategyHypercertFractionOffer(); + _addStrategy(address(strategyHypercertFractionOffer), selectorNoProof, false); + _addStrategy(address(strategyHypercertFractionOffer), selectorWithProofAllowlist, false); + } + + function testNewStrategies() public { + _assertStrategyAttributes(address(strategyHypercertFractionOffer), selectorNoProof, false); + + ( + bool strategyIsActive, + uint16 strategyStandardProtocolFee, + uint16 strategyMinTotalFee, + uint16 strategyMaxProtocolFee, + bytes4 strategySelector, + bool strategyIsMakerBid, + address strategyImplementation + ) = looksRareProtocol.strategyInfo(2); + + assertTrue(strategyIsActive); + assertEq(strategyStandardProtocolFee, _standardProtocolFeeBp); + assertEq(strategyMinTotalFee, _minTotalFeeBp); + assertEq(strategyMaxProtocolFee, _maxProtocolFeeBp); + assertEq(strategySelector, selectorWithProofAllowlist); + assertFalse(strategyIsMakerBid); + assertEq(strategyImplementation, address(strategyHypercertFractionOffer)); + } + + function testmakerAskAmountsLengthNotOne() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMakerAskAndTakerBidHypercert(true); + + // Adjust strategy for collection order and sign order + // Change array to make it bigger than expected + uint256[] memory amounts = new uint256[](2); + amounts[0] = 1; + makerAsk.amounts = amounts; + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + _assertOrderIsInvalid(makerAsk, false); + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.expectRevert(LengthsInvalid.selector); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + // // With proof + makerAsk.strategyId = 2; + signature = _signMakerOrder(makerAsk, makerUserPK); + + _assertOrderIsInvalid(makerAsk, true); + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.expectRevert(LengthsInvalid.selector); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testZeroAmount() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMakerAskAndTakerBidHypercert(true); + + uint256[] memory amounts = new uint256[](1); + amounts[0] = 0; + makerAsk.amounts = amounts; + makerAsk.strategyId = 1; + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + _assertOrderIsInvalid(makerAsk, false); + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(AmountInvalid.selector); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + /** + * A collection offer without merkle tree criteria + */ + + function testTakerBidHypercertFractionOrderPartialFill() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMakerAskAndTakerBidHypercert(true); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Verify validity of maker bid order + _assertOrderIsValid(makerAsk, false); + _assertValidMakerOrder(makerAsk, signature); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulTakerBid(makerAsk, takerBid, (1 << 128) + 1); + } + + function testTakerBidHypercertFractionOrderFullFill() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMakerAskAndTakerBidHypercert(true); + + makerAsk.additionalParameters = abi.encode(minUnitAmount, 10_000); + takerBid.additionalParameters = abi.encode(10_000, price); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Verify validity of maker bid order + _assertOrderIsValid(makerAsk, false); + _assertValidMakerOrder(makerAsk, signature); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulTakerBidFullFraction(makerAsk, takerBid, (1 << 128) + 1); + } + + function testTakerBidHypercertFractionOrderPartialAndFullFill() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMakerAskAndTakerBidHypercert(true); + + makerAsk.amounts[0] = 10_000; + makerAsk.additionalParameters = abi.encode(minUnitAmount, 10_000); + + takerBid.additionalParameters = abi.encode(3000, price); + + uint256 fractionId = (1 << 128) + 1; + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Verify validity of maker bid order + _assertOrderIsValid(makerAsk, false); + _assertValidMakerOrder(makerAsk, signature); + + // Execute taker ask transaction partial fill; buy 3000 units + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulTakerBid(makerAsk, takerBid, fractionId); + + makerAsk.additionalParameters = abi.encode(minUnitAmount, 10_000); + takerBid.additionalParameters = abi.encode(7000, price); + + // Execute taker ask transaction full fill; buy remaining 7000 units + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + //units, amount, currency, proof[] + (uint256 unitAmount, uint256 bidPrice) = abi.decode(takerBid.additionalParameters, (uint256, uint256)); + + // Taker user has received the asset + assertEq(mockHypercertMinter.ownerOf(fractionId), takerUser); + + // Units have been transfered + assertEq(mockHypercertMinter.unitsOf(fractionId), unitAmount); + + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerAsk.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + function testTakerBidHypercertFractionOrderUnitsOutOfMaxRange() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMakerAskAndTakerBidHypercert(true); + + makerAsk.additionalParameters = abi.encode(minUnitAmount, 100); + takerBid.additionalParameters = abi.encode(101, price); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Verify validity of maker bid order + _assertOrderIsValid(makerAsk, false); + _assertValidMakerOrder(makerAsk, signature); + + // Execute taker ask transaction + vm.prank(takerUser); + vm.expectRevert(OrderInvalid.selector); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerBidHypercertFractionOrderUnitsOutOfMinRange() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMakerAskAndTakerBidHypercert(true); + + makerAsk.additionalParameters = abi.encode(5, 100); + takerBid.additionalParameters = abi.encode(2, price); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Verify validity of maker bid order + _assertOrderIsValid(makerAsk, false); + _assertValidMakerOrder(makerAsk, signature); + + // Execute taker ask transaction + vm.prank(takerUser); + vm.expectRevert(OrderInvalid.selector); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerBidHypercertFractionOrderBidPriceTooLow() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMakerAskAndTakerBidHypercert(true); + + makerAsk.additionalParameters = abi.encode(minUnitAmount, maxUnitAmount); + takerBid.additionalParameters = abi.encode(maxUnitAmount, price - 1); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Verify validity of maker bid order + _assertOrderIsValid(makerAsk, false); + _assertValidMakerOrder(makerAsk, signature); + + // Execute taker ask transaction + vm.prank(takerUser); + vm.expectRevert(OrderInvalid.selector); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + /** + * A collection offer with merkle tree criteria + */ + /** + * TAKER ALLOWLIST + */ + function testTakerBidHypercertFractionOrderWithMerkleTreeHypercertAccountAllowlist() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMakerAskAndTakerBidHypercert(false); + + address accountInMerkleTree = takerUser; + (bytes32 merkleRoot, bytes32[] memory proof) = _mintNFTsToOwnerAndGetMerkleRootAndProofAccountAllowlist({ + owner: makerUser, + numberOfAccountsInMerkleTree: 5, + accountInMerkleTree: accountInMerkleTree + }); + + makerAsk.strategyId = 2; + makerAsk.additionalParameters = abi.encode(minUnitAmount, maxUnitAmount, merkleRoot); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Prepare the taker ask + takerBid.additionalParameters = abi.encode(100, price, proof); + + // Verify validity of maker bid order + _assertOrderIsValid(makerAsk, true); + _assertValidMakerOrder(makerAsk, signature); + + // // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + _assertSuccessfulTakerBid(makerAsk, takerBid, (1 << 128) + 1); + } + + function testTakerAskCannotExecuteWithInvalidProofAccountAllowlist(uint256 itemIdSold) public { + vm.assume(itemIdSold > 5); + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMakerAskAndTakerBidHypercert(false); + + address accountInMerkleTree = takerUser; + (bytes32 merkleRoot, bytes32[] memory proof) = _mintNFTsToOwnerAndGetMerkleRootAndProofAccountAllowlist({ + owner: makerUser, + numberOfAccountsInMerkleTree: 5, + accountInMerkleTree: accountInMerkleTree + }); + + makerAsk.strategyId = 2; + makerAsk.additionalParameters = abi.encode(minUnitAmount, maxUnitAmount, merkleRoot); + + // Sign order + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + // Prepare the taker ask + proof[0] = bytes32(0); // Tamper with the proof + takerBid.additionalParameters = abi.encode(100, price, proof); + + // Verify validity of maker bid order + _assertOrderIsValid(makerAsk, true); + _assertValidMakerOrder(makerAsk, signature); + + vm.prank(takerUser); + vm.expectRevert(MerkleProofInvalid.selector); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testInvalidAmounts() public { + _setUpUsers(); + + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMakerAskAndTakerBidHypercert(true); + + // Prepare the taker ask + takerBid.additionalParameters = abi.encode(1, price); + + // 1. Amount is 0 (without merkle proof) + makerAsk.amounts[0] = 0; + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + _assertOrderIsInvalid(makerAsk, false); + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(AmountInvalid.selector); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + + // 2. Amount is 0 (with merkle proof) + makerAsk.strategyId = 2; + address accountInMerkleTree = takerUser; + (bytes32 merkleRoot, bytes32[] memory proof) = _mintNFTsToOwnerAndGetMerkleRootAndProofAccountAllowlist({ + owner: makerUser, + numberOfAccountsInMerkleTree: 5, + accountInMerkleTree: accountInMerkleTree + }); + + makerAsk.additionalParameters = abi.encode(minUnitAmount, maxUnitAmount, merkleRoot); + makerAsk.amounts[0] = 0; + signature = _signMakerOrder(makerAsk, makerUserPK); + + takerBid.additionalParameters = abi.encode(0, price, proof); + + _assertOrderIsInvalid(makerAsk, true); + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(AmountInvalid.selector); + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testMerkleRootLengthIsNot200() public { + (OrderStructs.Maker memory makerAsk, OrderStructs.Taker memory takerBid) = + _createMakerAskAndTakerBidHypercert(true); + + // Set to use allowlist + makerAsk.strategyId = 2; + // Only encode min-max units + makerAsk.additionalParameters = abi.encode(1, 1); + + bytes memory signature = _signMakerOrder(makerAsk, makerUserPK); + + _assertOrderIsInvalid(makerAsk, true); + _assertMakerOrderReturnValidationCode(makerAsk, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.prank(takerUser); + vm.expectRevert(); // It should revert without data (since the root cannot be extracted since the + // additionalParameters length is 0) + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE); + } + + function testInvalidSelector() public { + OrderStructs.Maker memory makerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: 3, + collectionType: CollectionType.Hypercert, + orderNonce: 0, + collection: address(mockHypercertMinter), + currency: address(weth), + signer: makerUser, + price: price, + itemId: 0 + }); + + (bool orderIsValid, bytes4 errorSelector) = + strategyHypercertFractionOffer.isMakerOrderValid(makerAsk, bytes4(0)); + assertFalse(orderIsValid); + assertEq(errorSelector, FunctionSelectorInvalid.selector); + } + + function testWrongQuoteType() public { + OrderStructs.Maker memory makerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 2, + collectionType: CollectionType.Hypercert, + orderNonce: 0, + collection: address(mockHypercertMinter), + currency: address(weth), + signer: makerUser, + price: price, + itemId: 0 + }); + + (bool orderIsValid, bytes4 errorSelector) = + strategyHypercertFractionOffer.isMakerOrderValid(makerAsk, selectorNoProof); + + assertFalse(orderIsValid); + assertEq(errorSelector, QuoteTypeInvalid.selector); + } + + function _assertOrderIsValid(OrderStructs.Maker memory makerAsk, bool withProof) private { + (bool orderIsValid, bytes4 errorSelector) = strategyHypercertFractionOffer.isMakerOrderValid( + makerAsk, withProof ? selectorWithProofAllowlist : selectorNoProof + ); + + assertTrue(orderIsValid); + assertEq(errorSelector, _EMPTY_BYTES4); + } + + function _assertOrderIsInvalid(OrderStructs.Maker memory makerAsk, bool withProof) private { + (bool orderIsValid, bytes4 errorSelector) = strategyHypercertFractionOffer.isMakerOrderValid( + makerAsk, withProof ? selectorWithProofAllowlist : selectorNoProof + ); + + assertFalse(orderIsValid); + assertEq(errorSelector, OrderInvalid.selector); + } + + function _mintNFTsToOwnerAndGetMerkleRootAndProofAccountAllowlist( + address owner, + uint256 numberOfAccountsInMerkleTree, + address accountInMerkleTree + ) private returns (bytes32 merkleRoot, bytes32[] memory proof) { + // Initialize Merkle Tree + Merkle m = new Merkle(); + + bytes32[] memory merkleTreeAccounts = new bytes32[](numberOfAccountsInMerkleTree); + vm.startPrank(owner); + for (uint256 i; i < numberOfAccountsInMerkleTree; i++) { + mockHypercertMinter.mintClaim(owner, 10_000, "https://examle.com", FROM_CREATOR_ONLY); + merkleTreeAccounts[i] = keccak256(abi.encodePacked(accountInMerkleTree)); + } + vm.stopPrank(); + + // Compute merkle root + merkleRoot = m.getRoot(merkleTreeAccounts); + proof = m.getProof(merkleTreeAccounts, 2); + + assertTrue(m.verifyProof(merkleRoot, proof, merkleTreeAccounts[0])); + } + + function _assertSuccessfulTakerBid( + OrderStructs.Maker memory makerAsk, + OrderStructs.Taker memory takerBid, + uint256 fractionId + ) private { + //units, amount, currency, proof[] + (uint256 unitAmount, uint256 bidPrice) = abi.decode(takerBid.additionalParameters, (uint256, uint256)); + + // Taker user has received the asset + assertEq(mockHypercertMinter.ownerOf(fractionId), makerUser); + assertEq(mockHypercertMinter.ownerOf(fractionId + 1), takerUser); + + // Units have been transfered + assertEq(mockHypercertMinter.unitsOf(fractionId), 10_000 - unitAmount); + assertEq(mockHypercertMinter.unitsOf(fractionId + 1), unitAmount); + + // Maker bid user pays the whole price + assertEq(weth.balanceOf(takerUser), _initialWETHBalanceUser - (unitAmount * bidPrice)); + // Taker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq( + weth.balanceOf(makerUser), + _initialWETHBalanceUser + + (unitAmount * bidPrice * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP + ); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerAsk.orderNonce), _computeOrderHash(makerAsk)); + } + + function _assertSuccessfulTakerBidFullFraction( + OrderStructs.Maker memory makerAsk, + OrderStructs.Taker memory takerBid, + uint256 fractionId + ) private { + //units, amount, currency, proof[] + (uint256 unitAmount, uint256 bidPrice) = abi.decode(takerBid.additionalParameters, (uint256, uint256)); + + // Taker user has received the asset + assertEq(mockHypercertMinter.ownerOf(fractionId), takerUser); + + // Units have been transfered + assertEq(mockHypercertMinter.unitsOf(fractionId), unitAmount); + + // Maker bid user pays the whole price + assertEq(weth.balanceOf(takerUser), _initialWETHBalanceUser - (unitAmount * bidPrice)); + // Taker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq( + weth.balanceOf(makerUser), + _initialWETHBalanceUser + + (unitAmount * bidPrice * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP + ); + // Verify the nonce is marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerAsk.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } +} diff --git a/contracts/test/foundry/marketplace/executionStrategies/ItemIdsRangeOrders.t.sol b/contracts/test/foundry/marketplace/executionStrategies/ItemIdsRangeOrders.t.sol new file mode 100644 index 00000000..07199143 --- /dev/null +++ b/contracts/test/foundry/marketplace/executionStrategies/ItemIdsRangeOrders.t.sol @@ -0,0 +1,486 @@ +/// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries and interfaces +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; +import {IExecutionManager} from "@hypercerts/marketplace/interfaces/IExecutionManager.sol"; +import {IStrategyManager} from "@hypercerts/marketplace/interfaces/IStrategyManager.sol"; + +// Shared errors +import { + OrderInvalid, FunctionSelectorInvalid, QuoteTypeInvalid +} from "@hypercerts/marketplace/errors/SharedErrors.sol"; +import { + STRATEGY_NOT_ACTIVE, + MAKER_ORDER_TEMPORARILY_INVALID_NON_STANDARD_SALE, + MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE +} from "@hypercerts/marketplace/constants/ValidationCodeConstants.sol"; + +// Strategies +import {StrategyItemIdsRange} from "@hypercerts/marketplace/executionStrategies/StrategyItemIdsRange.sol"; + +// Base test +import {ProtocolBase} from "../ProtocolBase.t.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract ItemIdsRangeOrdersTest is ProtocolBase, IStrategyManager { + StrategyItemIdsRange public strategyItemIdsRange; + bytes4 public selector = StrategyItemIdsRange.executeStrategyWithTakerAsk.selector; + + function setUp() public { + _setUp(); + } + + function _setUpNewStrategy() private asPrankedUser(_owner) { + strategyItemIdsRange = new StrategyItemIdsRange(); + _addStrategy(address(strategyItemIdsRange), selector, true); + } + + function _offeredAmounts(uint256 length, uint256 amount) private pure returns (uint256[] memory offeredAmounts) { + offeredAmounts = new uint256[](length); + for (uint256 i; i < length; i++) { + offeredAmounts[i] = amount; + } + } + + function _createMakerBidAndTakerAsk(uint256 lowerBound, uint256 upperBound) + private + returns (OrderStructs.Maker memory newMakerBid, OrderStructs.Taker memory newTakerAsk) + { + uint256 mid = (lowerBound + upperBound) / 2; + + newMakerBid = _createMultiItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 1, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: 1 ether, + itemIds: new uint256[](0), + amounts: new uint256[](0) + }); + + newMakerBid.additionalParameters = abi.encode(lowerBound, upperBound, 3); + + // This way, we can test + // 1. lower bound is 0 + // 2. lower bound is > 0, and 0 is excluded + if (lowerBound > 0) { + mockERC721.mint(takerUser, lowerBound - 1); + } + + mockERC721.mint(takerUser, lowerBound); + mockERC721.mint(takerUser, mid); + mockERC721.mint(takerUser, upperBound); + mockERC721.mint(takerUser, upperBound + 1); + + uint256[] memory takerAskItemIds = new uint256[](3); + takerAskItemIds[0] = lowerBound; + takerAskItemIds[1] = mid; + takerAskItemIds[2] = upperBound; + + newTakerAsk = OrderStructs.Taker({ + recipient: takerUser, + additionalParameters: abi.encode(takerAskItemIds, _offeredAmounts({length: 3, amount: 1})) + }); + } + + function testNewStrategy() public { + _setUpNewStrategy(); + _assertStrategyAttributes(address(strategyItemIdsRange), selector, true); + } + + function testTokenIdsRangeERC721(uint256 lowerBound, uint256 upperBound) public { + vm.assume(lowerBound < type(uint128).max && upperBound < type(uint128).max && lowerBound + 1 < upperBound); + + uint256 mid = (lowerBound + upperBound) / 2; + + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = + _createMakerBidAndTakerAsk(lowerBound, upperBound); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + _assertOrderIsValid(makerBid); + _assertValidMakerOrder(makerBid, signature); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // Maker user has received the asset + assertEq(mockERC721.ownerOf(lowerBound), makerUser); + assertEq(mockERC721.ownerOf(mid), makerUser); + assertEq(mockERC721.ownerOf(upperBound), makerUser); + + // Maker bid user pays the whole price + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser - 1 ether); + // Taker ask user receives 99.5% of the whole price (0.5% protocol fee) + assertEq(weth.balanceOf(takerUser), _initialWETHBalanceUser + 0.995 ether); + } + + function testTokenIdsRangeERC1155(uint256 lowerBound, uint256 upperBound) public { + vm.assume(lowerBound < type(uint128).max && upperBound < type(uint128).max && lowerBound + 1 < upperBound); + + uint256 mid = (lowerBound + upperBound) / 2; + + _setUpUsers(); + _setUpNewStrategy(); + + OrderStructs.Maker memory makerBid = _createMultiItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 1, + collectionType: CollectionType.ERC1155, + orderNonce: 0, + collection: address(mockERC1155), + currency: address(weth), + signer: makerUser, + price: 1 ether, + itemIds: new uint256[](0), + amounts: new uint256[](0) + }); + + makerBid.additionalParameters = abi.encode(lowerBound, upperBound, 6); + + mockERC1155.mint(takerUser, lowerBound, 2); + mockERC1155.mint(takerUser, mid, 2); + mockERC1155.mint(takerUser, upperBound, 2); + + uint256[] memory takerAskItemIds = new uint256[](3); + takerAskItemIds[0] = lowerBound; + takerAskItemIds[1] = mid; + takerAskItemIds[2] = upperBound; + + OrderStructs.Taker memory takerAsk = OrderStructs.Taker({ + recipient: takerUser, + additionalParameters: abi.encode(takerAskItemIds, _offeredAmounts({length: 3, amount: 2})) + }); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + _assertOrderIsValid(makerBid); + _assertValidMakerOrder(makerBid, signature); + + // Execute taker ask transaction + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // Maker user has received the asset + assertEq(mockERC1155.balanceOf(makerUser, lowerBound), 2); + assertEq(mockERC1155.balanceOf(makerUser, mid), 2); + assertEq(mockERC1155.balanceOf(makerUser, upperBound), 2); + + // Maker bid user pays the whole price + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser - 1 ether); + // Taker ask user receives 99.5% of the whole price (0.5% protocol fee) + assertEq(weth.balanceOf(takerUser), _initialWETHBalanceUser + 0.995 ether); + } + + function testInvalidMakerBidAdditionalParameters() public { + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = _createMakerBidAndTakerAsk(5, 10); + + makerBid.additionalParameters = abi.encode(6, 9); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + vm.expectRevert(); // EVM revert + strategyItemIdsRange.isMakerOrderValid(makerBid, selector); + + vm.expectRevert(); // EVM revert + orderValidator.checkMakerOrderValidity(makerBid, signature, _EMPTY_MERKLE_TREE); + + vm.expectRevert(); // EVM revert + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testZeroDesiredAmount() public { + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = _createMakerBidAndTakerAsk(5, 10); + + makerBid.additionalParameters = abi.encode(5, 10, 0); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + bytes4 errorSelector = _assertOrderIsInvalid(makerBid); + _assertMakerOrderReturnValidationCode(makerBid, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.expectRevert(errorSelector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testWrongQuoteType() public { + _setUpNewStrategy(); + (OrderStructs.Maker memory makerBid,) = _createMakerBidAndTakerAsk(5, 10); + makerBid.quoteType = QuoteType.Ask; + + (bool isValid, bytes4 errorSelector) = strategyItemIdsRange.isMakerOrderValid(makerBid, selector); + + assertFalse(isValid); + assertEq(errorSelector, QuoteTypeInvalid.selector); + } + + function testTakerAskItemIdsAmountsLengthMismatch() public { + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = _createMakerBidAndTakerAsk(5, 10); + + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + _assertOrderIsValid(makerBid); + _assertValidMakerOrder(makerBid, signature); + + uint256[] memory takerAskItemIds = new uint256[](3); + takerAskItemIds[0] = 5; + takerAskItemIds[1] = 7; + takerAskItemIds[2] = 10; + takerAsk.additionalParameters = abi.encode(takerAskItemIds, _offeredAmounts({length: 4, amount: 1})); + + vm.prank(takerUser); + vm.expectRevert(OrderInvalid.selector); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerAskRevertIfAmountIsZeroOrGreaterThanOneERC721() public { + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = _createMakerBidAndTakerAsk(5, 10); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + uint256[] memory takerAskItemIds = new uint256[](3); + takerAskItemIds[0] = 5; + takerAskItemIds[1] = 7; + takerAskItemIds[2] = 10; + + uint256[] memory invalidAmounts = new uint256[](3); + invalidAmounts[0] = 1; + invalidAmounts[1] = 2; + invalidAmounts[2] = 2; + + takerAsk.additionalParameters = abi.encode(takerAskItemIds, invalidAmounts); + + // The maker bid order is still valid since the error comes from the taker ask amounts + _assertOrderIsValid(makerBid); + _assertValidMakerOrder(makerBid, signature); + + // It fails at 2nd item in the array (greater than 1) + vm.expectRevert(OrderInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // Re-adjust the amounts + invalidAmounts[0] = 0; + invalidAmounts[1] = 1; + invalidAmounts[2] = 1; + + takerAsk.additionalParameters = abi.encode(takerAskItemIds, invalidAmounts); + + // It now fails at 1st item in the array (equal to 0) + vm.expectRevert(OrderInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testMakerBidItemIdsLowerBandHigherThanOrEqualToUpperBand() public { + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = _createMakerBidAndTakerAsk(5, 10); + + // lower band > upper band + makerBid.additionalParameters = abi.encode(5, 4, 1); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + bytes4 errorSelector = _assertOrderIsInvalid(makerBid); + _assertMakerOrderReturnValidationCode(makerBid, signature, MAKER_ORDER_PERMANENTLY_INVALID_NON_STANDARD_SALE); + + vm.expectRevert(errorSelector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // lower band == upper band + makerBid.additionalParameters = abi.encode(5, 5, 1); + + // Sign order + signature = _signMakerOrder(makerBid, makerUserPK); + + vm.expectRevert(OrderInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerAskDuplicatedItemIds() public { + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = _createMakerBidAndTakerAsk(5, 10); + + uint256[] memory invalidItemIds = new uint256[](3); + invalidItemIds[0] = 5; + invalidItemIds[1] = 7; + invalidItemIds[2] = 7; + + takerAsk.additionalParameters = abi.encode(invalidItemIds, _offeredAmounts({length: 3, amount: 1})); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Valid, taker struct validation only happens during execution + _assertOrderIsValid(makerBid); + _assertValidMakerOrder(makerBid, signature); + + vm.expectRevert(OrderInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerAskUnsortedItemIds() public { + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = _createMakerBidAndTakerAsk(5, 10); + + uint256[] memory invalidItemIds = new uint256[](3); + invalidItemIds[0] = 5; + invalidItemIds[1] = 10; + invalidItemIds[2] = 7; + + takerAsk.additionalParameters = abi.encode(invalidItemIds, _offeredAmounts({length: 3, amount: 1})); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Valid, taker struct validation only happens during execution + _assertOrderIsValid(makerBid); + _assertValidMakerOrder(makerBid, signature); + + vm.expectRevert(OrderInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerAskOfferedAmountNotEqualToDesiredAmount() public { + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = _createMakerBidAndTakerAsk(5, 10); + + uint256[] memory itemIds = new uint256[](2); + itemIds[0] = 5; + itemIds[1] = 10; + + takerAsk.additionalParameters = abi.encode(itemIds, _offeredAmounts({length: 2, amount: 1})); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + // Valid, taker struct validation only happens during execution + _assertOrderIsValid(makerBid); + _assertValidMakerOrder(makerBid, signature); + + vm.expectRevert(OrderInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testTakerAskOfferedItemIdTooLow() public { + _testTakerAskOfferedItemIdOutOfRange(3, 4); + } + + function testTakerAskOfferedItemIdTooHigh() public { + _testTakerAskOfferedItemIdOutOfRange(11, 12); + } + + function _testTakerAskOfferedItemIdOutOfRange(uint256 itemIdOne, uint256 itemIdTwo) private { + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = _createMakerBidAndTakerAsk(5, 10); + uint256[] memory itemIds = new uint256[](2); + itemIds[0] = itemIdOne; + itemIds[1] = itemIdTwo; + + takerAsk.additionalParameters = abi.encode(itemIds, _offeredAmounts({length: 2, amount: 1})); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + _assertOrderIsValid(makerBid); + _assertValidMakerOrder(makerBid, signature); + + vm.expectRevert(OrderInvalid.selector); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testInactiveStrategy() public { + _setUpUsers(); + _setUpNewStrategy(); + (OrderStructs.Maker memory makerBid, OrderStructs.Taker memory takerAsk) = _createMakerBidAndTakerAsk(5, 10); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + vm.prank(_owner); + looksRareProtocol.updateStrategy(1, false, _standardProtocolFeeBp, _minTotalFeeBp); + + // Valid, taker struct validation only happens during execution + _assertOrderIsValid(makerBid); + // but... the OrderValidator catches this + _assertMakerOrderReturnValidationCode(makerBid, signature, STRATEGY_NOT_ACTIVE); + + vm.expectRevert(abi.encodeWithSelector(IExecutionManager.StrategyNotAvailable.selector, 1)); + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + } + + function testInvalidSelector() public { + _setUpNewStrategy(); + + OrderStructs.Maker memory makerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 2, + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: 1 ether, + itemId: 0 + }); + + (bool orderIsValid, bytes4 errorSelector) = strategyItemIdsRange.isMakerOrderValid(makerBid, bytes4(0)); + assertFalse(orderIsValid); + assertEq(errorSelector, FunctionSelectorInvalid.selector); + } + + function _assertOrderIsValid(OrderStructs.Maker memory makerBid) private { + (bool isValid, bytes4 errorSelector) = strategyItemIdsRange.isMakerOrderValid(makerBid, selector); + assertTrue(isValid); + assertEq(errorSelector, _EMPTY_BYTES4); + } + + function _assertOrderIsInvalid(OrderStructs.Maker memory makerBid) private returns (bytes4) { + (bool isValid, bytes4 errorSelector) = strategyItemIdsRange.isMakerOrderValid(makerBid, selector); + assertFalse(isValid); + assertEq(errorSelector, OrderInvalid.selector); + return errorSelector; + } +} diff --git a/contracts/test/foundry/marketplace/executionStrategies/MultiFillCollectionOrders.t.sol b/contracts/test/foundry/marketplace/executionStrategies/MultiFillCollectionOrders.t.sol new file mode 100644 index 00000000..c5a3c8f0 --- /dev/null +++ b/contracts/test/foundry/marketplace/executionStrategies/MultiFillCollectionOrders.t.sol @@ -0,0 +1,187 @@ +/// SPDX-License-Identifier: MIT +pragma solidity >=0.8.17; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Interfaces +import {IExecutionManager} from "@hypercerts/marketplace/interfaces/IExecutionManager.sol"; +import {IStrategyManager} from "@hypercerts/marketplace/interfaces/IStrategyManager.sol"; + +// Mock files and other tests +import {StrategyTestMultiFillCollectionOrder} from "../utils/StrategyTestMultiFillCollectionOrder.sol"; +import {ProtocolBase} from "../ProtocolBase.t.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract MultiFillCollectionOrdersTest is ProtocolBase, IStrategyManager { + uint256 private constant price = 1 ether; // Fixed price of sale + + bytes4 public selector = StrategyTestMultiFillCollectionOrder.executeStrategyWithTakerAsk.selector; + + StrategyTestMultiFillCollectionOrder public strategyMultiFillCollectionOrder; + + function setUp() public { + _setUp(); + } + + function _setUpNewStrategy() private asPrankedUser(_owner) { + strategyMultiFillCollectionOrder = new StrategyTestMultiFillCollectionOrder(address(looksRareProtocol)); + _addStrategy(address(strategyMultiFillCollectionOrder), selector, true); + } + + function testNewStrategy() public { + _setUpNewStrategy(); + _assertStrategyAttributes(address(strategyMultiFillCollectionOrder), selector, true); + } + + /** + * Maker bid user wants to buy 4 ERC721 items in a collection. The order can be filled in multiple parts. + * First takerUser sells 1 item. + * Second takerUser sells 3 items. + */ + function testMultiFill() public { + _setUpUsers(); + _setUpNewStrategy(); + + uint256 amountsToFill = 4; + + uint256[] memory itemIds = new uint256[](0); + uint256[] memory amounts = new uint256[](1); + amounts[0] = amountsToFill; + + OrderStructs.Maker memory makerBid = _createMultiItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 1, // Multi-fill bid offer + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemIds: itemIds, + amounts: amounts + }); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + itemIds = new uint256[](1); + amounts = new uint256[](1); + itemIds[0] = 0; + amounts[0] = 1; + + mockERC721.mint(takerUser, itemIds[0]); + + // Prepare the taker ask + OrderStructs.Taker memory takerAsk = OrderStructs.Taker(takerUser, abi.encode(itemIds, amounts)); + + // Execute the first taker ask transaction by the first taker user + vm.prank(takerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // Taker user has received the asset + assertEq(mockERC721.ownerOf(0), makerUser); + // Maker bid user pays the whole price + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser - price); + // Taker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq( + weth.balanceOf(takerUser), + _initialWETHBalanceUser + (price * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP + ); + // Verify the nonce is not marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerBid.orderNonce), _computeOrderHash(makerBid)); + + // Second taker user actions + address secondTakerUser = address(420); + _setUpUser(secondTakerUser); + + itemIds = new uint256[](3); + amounts = new uint256[](3); + + itemIds[0] = 1; // tokenId = 1 + itemIds[1] = 2; // tokenId = 2 + itemIds[2] = 3; // tokenId = 3 + amounts[0] = 1; + amounts[1] = 1; + amounts[2] = 1; + + mockERC721.batchMint(secondTakerUser, itemIds); + + // Prepare the taker ask + takerAsk = OrderStructs.Taker(secondTakerUser, abi.encode(itemIds, amounts)); + + // Execute a second taker ask transaction from the second taker user + vm.prank(secondTakerUser); + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, _EMPTY_MERKLE_TREE); + + // Taker user has received the 3 assets + assertEq(mockERC721.ownerOf(1), makerUser); + assertEq(mockERC721.ownerOf(2), makerUser); + assertEq(mockERC721.ownerOf(3), makerUser); + + // Maker bid user pays the whole price + assertEq(weth.balanceOf(makerUser), _initialWETHBalanceUser - 4 * price); + // Taker ask user receives 99.5% of the whole price (0.5% protocol) + assertEq( + weth.balanceOf(secondTakerUser), + _initialWETHBalanceUser + + 3 * ((price * _sellerProceedBpWithStandardProtocolFeeBp) / ONE_HUNDRED_PERCENT_IN_BP) + ); + // Verify the nonce is now marked as executed + assertEq(looksRareProtocol.userOrderNonce(makerUser, makerBid.orderNonce), MAGIC_VALUE_ORDER_NONCE_EXECUTED); + } + + function testInactiveStrategy() public { + _setUpUsers(); + _setUpNewStrategy(); + + uint256 amountsToFill = 4; + + uint256[] memory itemIds = new uint256[](0); + uint256[] memory amounts = new uint256[](1); + amounts[0] = amountsToFill; + + OrderStructs.Maker memory makerBid = _createMultiItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: 1, // Multi-fill bid offer + collectionType: CollectionType.ERC721, + orderNonce: 0, + collection: address(mockERC721), + currency: address(weth), + signer: makerUser, + price: price, + itemIds: itemIds, + amounts: amounts + }); + + // Sign order + bytes memory signature = _signMakerOrder(makerBid, makerUserPK); + + vm.prank(_owner); + looksRareProtocol.updateStrategy(1, false, _standardProtocolFeeBp, _minTotalFeeBp); + + { + itemIds = new uint256[](1); + amounts = new uint256[](1); + itemIds[0] = 0; + amounts[0] = 1; + + mockERC721.mint(takerUser, itemIds[0]); + + // It should revert if strategy is not available + vm.prank(takerUser); + vm.expectRevert(abi.encodeWithSelector(IExecutionManager.StrategyNotAvailable.selector, 1)); + looksRareProtocol.executeTakerAsk(_genericTakerOrder(), makerBid, signature, _EMPTY_MERKLE_TREE); + } + } +} diff --git a/contracts/test/foundry/marketplace/utils/BytesLib.sol b/contracts/test/foundry/marketplace/utils/BytesLib.sol new file mode 100644 index 00000000..7d0a3ffa --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/BytesLib.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/* + * @title Solidity Bytes Arrays Utils + * @author Gonçalo Sá + * @notice We only copied the `slice` function from the original https://github.com/GNSPS/solidity-bytes-utils + * as that's the only function needed. + * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity. + * The library lets you slice bytes arrays in memory. + */ +library BytesLib { + function slice(bytes memory _bytes, uint256 _start, uint256 _length) internal pure returns (bytes memory) { + require(_length + 31 >= _length, "slice_overflow"); + require(_bytes.length >= _start + _length, "slice_outOfBounds"); + + bytes memory tempBytes; + + assembly { + switch iszero(_length) + case 0 { + // Get a location of some free memory and store it in tempBytes as + // Solidity does for memory variables. + tempBytes := mload(0x40) + + // The first word of the slice result is potentially a partial + // word read from the original array. To read it, we calculate + // the length of that partial word and start copying that many + // bytes into the array. The first word we copy will start with + // data we don't care about, but the last `lengthmod` bytes will + // land at the beginning of the contents of the new array. When + // we're done copying, we overwrite the full first word with + // the actual length of the slice. + let lengthmod := and(_length, 31) + + // The multiplication in the next line is necessary + // because when slicing multiples of 32 bytes (lengthmod == 0) + // the following copy loop was copying the origin's length + // and then ending prematurely not copying everything it should. + let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod))) + let end := add(mc, _length) + + for { + // The multiplication in the next line has the same exact purpose + // as the one above. + let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start) + } lt(mc, end) { + mc := add(mc, 0x20) + cc := add(cc, 0x20) + } { mstore(mc, mload(cc)) } + + mstore(tempBytes, _length) + + //update free-memory pointer + //allocating the array padded to 32 bytes like the compiler does now + mstore(0x40, and(add(mc, 31), not(31))) + } + //if we want a zero-length slice let's just return a zero-length array + default { + tempBytes := mload(0x40) + //zero out the 32 bytes slice we are about to return + //we need to do it because Solidity does not garbage collect + mstore(tempBytes, 0) + + mstore(0x40, add(tempBytes, 0x20)) + } + } + + return tempBytes; + } +} diff --git a/contracts/test/foundry/marketplace/utils/EIP712MerkleTree.sol b/contracts/test/foundry/marketplace/utils/EIP712MerkleTree.sol new file mode 100644 index 00000000..dd8dba2f --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/EIP712MerkleTree.sol @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Forge test +import {Test} from "forge-std/Test.sol"; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Core contracts +import {LooksRareProtocol} from "@hypercerts/marketplace/LooksRareProtocol.sol"; + +// Utils +import {MerkleWithPosition} from "./MerkleWithPosition.sol"; +import {MathLib} from "./MathLib.sol"; + +// Constants +import {MAX_CALLDATA_PROOF_LENGTH} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +contract EIP712MerkleTree is Test { + using OrderStructs for OrderStructs.Maker; + + LooksRareProtocol private looksRareProtocol; + + constructor(LooksRareProtocol _looksRareProtocol) { + looksRareProtocol = _looksRareProtocol; + } + + function sign(uint256 privateKey, OrderStructs.Maker[] memory makerOrders, uint256 makerOrderIndex) + external + returns (bytes memory signature, OrderStructs.MerkleTree memory merkleTree) + { + uint256 bidCount = makerOrders.length; + uint256 treeHeight = MathLib.log2(bidCount); + if (2 ** treeHeight != bidCount || treeHeight == 0) { + treeHeight += 1; + } + bytes32 batchOrderTypehash = _getBatchOrderTypehash(treeHeight); + uint256 leafCount = 2 ** treeHeight; + OrderStructs.MerkleTreeNode[] memory leaves = new OrderStructs.MerkleTreeNode[](leafCount); + + for (uint256 i; i < bidCount; i++) { + leaves[i] = OrderStructs.MerkleTreeNode({ + value: makerOrders[i].hash(), + position: i % 2 == 0 ? OrderStructs.MerkleTreeNodePosition.Left : OrderStructs.MerkleTreeNodePosition.Right + }); + } + + bytes32 emptyMakerOrderHash = _emptyMakerOrderHash(); + for (uint256 i = bidCount; i < leafCount; i++) { + leaves[i] = OrderStructs.MerkleTreeNode({ + value: emptyMakerOrderHash, + position: i % 2 == 0 ? OrderStructs.MerkleTreeNodePosition.Left : OrderStructs.MerkleTreeNodePosition.Right + }); + } + + MerkleWithPosition merkle = new MerkleWithPosition(); + OrderStructs.MerkleTreeNode[] memory proof = merkle.getProof(leaves, makerOrderIndex); + bytes32 root = merkle.getRoot(leaves); + + signature = _sign(privateKey, batchOrderTypehash, root); + merkleTree = OrderStructs.MerkleTree({root: root, proof: proof}); + } + + function _emptyMakerOrderHash() private pure returns (bytes32 makerOrderHash) { + OrderStructs.Maker memory makerOrder; + makerOrderHash = makerOrder.hash(); + } + + function _sign(uint256 privateKey, bytes32 batchOrderTypehash, bytes32 root) + private + view + returns (bytes memory signature) + { + bytes32 digest = keccak256(abi.encode(batchOrderTypehash, root)); + + bytes32 domainSeparator = looksRareProtocol.domainSeparator(); + + (uint8 v, bytes32 r, bytes32 s) = + vm.sign(privateKey, keccak256(abi.encodePacked("\x19\x01", domainSeparator, digest))); + + signature = abi.encodePacked(r, s, v); + } + + function _getBatchOrderTypehash(uint256 treeHeight) private pure returns (bytes32 batchOrderTypehash) { + bytes32[] memory batchOrderTypehashes = new bytes32[](14); + batchOrderTypehashes[1] = hex"9661287f7a4aa4867db46a2453ee15bebac4e8fc25667a58718da658f15de643"; + batchOrderTypehashes[2] = hex"a54ab330ea9e1dfccee2b86f3666989e7fbd479704416c757c8de8e820142a08"; + batchOrderTypehashes[3] = hex"93390f5d45ede9dea305f16aec86b2472af4f823851637f1b7019ad0775cea49"; + batchOrderTypehashes[4] = hex"9dda2c8358da895e43d574bb15954ce5727b22e923a2d8f28261f297bce42f0b"; + batchOrderTypehashes[5] = hex"92dc717124e161262f9d10c7079e7d54dc51271893fba54aa4a0f270fecdcc98"; + batchOrderTypehashes[6] = hex"ce02aee5a7a35d40d974463c4c6e5534954fb07a7e7bc966fee268a15337bfd8"; + batchOrderTypehashes[7] = hex"f7a65efd167a18f7091b2bb929d687dd94503cf0a43620487055ed7d6b727559"; + batchOrderTypehashes[8] = hex"def24acacad1318b664520f7c10e8bc6d1e7f6f6f7c8b031e70624ceb42266a6"; + batchOrderTypehashes[9] = hex"4cb4080dc4e7bae88b4dc4307ad5117fa4f26195998a1b5f40368809d7f4c7f2"; + batchOrderTypehashes[10] = hex"f8b1f864164d8d6e0b45f1399bd711223117a4ab0b057a9c2d7779e86a7c88db"; + batchOrderTypehashes[11] = hex"4787f505db237e03a7193c312d5159add8a5705278e1c7dcf92ab87126cbe490"; + batchOrderTypehashes[12] = hex"7a6517e5a16c56b29947b57b748aa91736987376e1a366d948e7a802a9df3431"; + batchOrderTypehashes[13] = hex"35806d347e9929042ce209d143da48f100f0ff0cbdb1fde68cf13af8059d79df"; + + batchOrderTypehash = batchOrderTypehashes[treeHeight]; + } +} diff --git a/contracts/test/foundry/marketplace/utils/ERC1271Wallet.sol b/contracts/test/foundry/marketplace/utils/ERC1271Wallet.sol new file mode 100644 index 00000000..f6eaf418 --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/ERC1271Wallet.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {ERC1271WalletMock} from "openzeppelin-contracts/contracts/mocks/ERC1271WalletMock.sol"; + +contract ERC1271Wallet is ERC1271WalletMock { + constructor(address originalOwner) ERC1271WalletMock(originalOwner) {} + + function onERC1155Received(address, address, uint256, uint256, bytes calldata) external pure returns (bytes4) { + return this.onERC1155Received.selector; + } + + function onERC1155BatchReceived(address, address, uint256[] calldata, uint256[] calldata, bytes calldata) + external + pure + returns (bytes4) + { + return this.onERC1155BatchReceived.selector; + } +} diff --git a/contracts/test/foundry/marketplace/utils/GasGriefer.sol b/contracts/test/foundry/marketplace/utils/GasGriefer.sol new file mode 100644 index 00000000..2589681c --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/GasGriefer.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +contract GasGriefer { + receive() external payable { + uint256 count; + while (true) { + count += 1; + } + } + + function isValidSignature(bytes32, bytes memory) external pure returns (bytes4 magicValue) { + magicValue = this.isValidSignature.selector; + } +} diff --git a/contracts/test/foundry/marketplace/utils/MaliciousERC1271Wallet.sol b/contracts/test/foundry/marketplace/utils/MaliciousERC1271Wallet.sol new file mode 100644 index 00000000..c13ff909 --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/MaliciousERC1271Wallet.sol @@ -0,0 +1,66 @@ +/// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {ILooksRareProtocol} from "@hypercerts/marketplace/interfaces/ILooksRareProtocol.sol"; +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +abstract contract MaliciousERC1271Wallet { + enum FunctionToReenter { + None, + ExecuteTakerAsk, + ExecuteTakerBid, + ExecuteMultipleTakerBids + } + + ILooksRareProtocol internal immutable looksRareProtocol; + FunctionToReenter internal functionToReenter; + + constructor(address _looksRareProtocol) { + looksRareProtocol = ILooksRareProtocol(_looksRareProtocol); + } + + function setFunctionToReenter(FunctionToReenter _functionToReenter) external { + functionToReenter = _functionToReenter; + } + + function isValidSignature(bytes32, bytes calldata) external virtual returns (bytes4 magicValue) { + magicValue = this.isValidSignature.selector; + } + + function onERC1155Received(address, address, uint256, uint256, bytes calldata) external virtual returns (bytes4) { + return this.onERC1155Received.selector; + } + + function onERC1155BatchReceived(address, address, uint256[] calldata, uint256[] calldata, bytes calldata) + external + virtual + returns (bytes4) + { + return this.onERC1155BatchReceived.selector; + } + + function _executeTakerAsk(bytes memory signature) internal { + OrderStructs.Taker memory takerAsk; + OrderStructs.Maker memory makerBid; + OrderStructs.MerkleTree memory merkleTree; + + looksRareProtocol.executeTakerAsk(takerAsk, makerBid, signature, merkleTree); + } + + function _executeTakerBid(bytes memory signature) internal { + OrderStructs.Taker memory takerBid; + OrderStructs.Maker memory makerAsk; + OrderStructs.MerkleTree memory merkleTree; + + looksRareProtocol.executeTakerBid(takerBid, makerAsk, signature, merkleTree); + } + + function _executeMultipleTakerBids() internal { + OrderStructs.Taker[] memory takerBids = new OrderStructs.Taker[](2); + OrderStructs.Maker[] memory makerAsks = new OrderStructs.Maker[](2); + bytes[] memory signatures = new bytes[](2); + OrderStructs.MerkleTree[] memory merkleTrees = new OrderStructs.MerkleTree[](2); + + looksRareProtocol.executeMultipleTakerBids(takerBids, makerAsks, signatures, merkleTrees, false); + } +} diff --git a/contracts/test/foundry/marketplace/utils/MaliciousIsValidSignatureERC1271Wallet.sol b/contracts/test/foundry/marketplace/utils/MaliciousIsValidSignatureERC1271Wallet.sol new file mode 100644 index 00000000..c8aaf1ef --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/MaliciousIsValidSignatureERC1271Wallet.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {MaliciousERC1271Wallet} from "./MaliciousERC1271Wallet.sol"; + +contract MaliciousIsValidSignatureERC1271Wallet is MaliciousERC1271Wallet { + constructor(address _looksRareProtocol) MaliciousERC1271Wallet(_looksRareProtocol) {} + + function isValidSignature(bytes32, bytes calldata signature) external override returns (bytes4 magicValue) { + if (functionToReenter == FunctionToReenter.ExecuteTakerAsk) { + _executeTakerAsk(signature); + } else if (functionToReenter == FunctionToReenter.ExecuteTakerBid) { + _executeTakerBid(signature); + } else if (functionToReenter == FunctionToReenter.ExecuteMultipleTakerBids) { + _executeMultipleTakerBids(); + } + + magicValue = this.isValidSignature.selector; + } +} diff --git a/contracts/test/foundry/marketplace/utils/MaliciousOnERC1155ReceivedERC1271Wallet.sol b/contracts/test/foundry/marketplace/utils/MaliciousOnERC1155ReceivedERC1271Wallet.sol new file mode 100644 index 00000000..cc790326 --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/MaliciousOnERC1155ReceivedERC1271Wallet.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {MaliciousERC1271Wallet} from "./MaliciousERC1271Wallet.sol"; + +contract MaliciousOnERC1155ReceivedERC1271Wallet is MaliciousERC1271Wallet { + constructor(address _looksRareProtocol) MaliciousERC1271Wallet(_looksRareProtocol) {} + + function onERC1155Received(address, address, uint256, uint256, bytes memory) external override returns (bytes4) { + if (functionToReenter == FunctionToReenter.ExecuteTakerAsk) { + _executeTakerAsk(new bytes(0)); + } else if (functionToReenter == FunctionToReenter.ExecuteTakerBid) { + _executeTakerBid(new bytes(0)); + } else if (functionToReenter == FunctionToReenter.ExecuteMultipleTakerBids) { + _executeMultipleTakerBids(); + } + + return this.onERC1155Received.selector; + } + + function onERC1155BatchReceived(address, address, uint256[] calldata, uint256[] calldata, bytes calldata) + external + override + returns (bytes4) + { + if (functionToReenter == FunctionToReenter.ExecuteTakerAsk) { + _executeTakerAsk(new bytes(0)); + } else if (functionToReenter == FunctionToReenter.ExecuteTakerBid) { + _executeTakerBid(new bytes(0)); + } else if (functionToReenter == FunctionToReenter.ExecuteMultipleTakerBids) { + _executeMultipleTakerBids(); + } + + return this.onERC1155BatchReceived.selector; + } +} diff --git a/contracts/test/foundry/marketplace/utils/MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet.sol b/contracts/test/foundry/marketplace/utils/MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet.sol new file mode 100644 index 00000000..95ba4347 --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {MaliciousERC1271Wallet} from "./MaliciousERC1271Wallet.sol"; + +contract MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet is MaliciousERC1271Wallet { + uint256 private isValidSignatureEnterCount; + + constructor(address _looksRareProtocol) MaliciousERC1271Wallet(_looksRareProtocol) {} + + function onERC1155Received(address, address, uint256, uint256, bytes memory) external override returns (bytes4) { + if (++isValidSignatureEnterCount == 3) { + if (functionToReenter == FunctionToReenter.ExecuteTakerAsk) { + _executeTakerAsk(new bytes(0)); + } else if (functionToReenter == FunctionToReenter.ExecuteTakerBid) { + _executeTakerBid(new bytes(0)); + } else if (functionToReenter == FunctionToReenter.ExecuteMultipleTakerBids) { + _executeMultipleTakerBids(); + } + } + + return this.onERC1155Received.selector; + } +} diff --git a/contracts/test/foundry/marketplace/utils/MathLib.sol b/contracts/test/foundry/marketplace/utils/MathLib.sol new file mode 100644 index 00000000..f0897c30 --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/MathLib.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +/** + * @author OpenZeppelin (last updated v4.8.0) (utils/math/Math.sol) + * @dev Standard math utilities missing in the Solidity language. + */ +library MathLib { + /** + * @dev Return the log in base 2, rounded down, of a positive value. + * Returns 0 if given 0. + */ + function log2(uint256 value) internal pure returns (uint256) { + uint256 result = 0; + unchecked { + if (value >> 128 > 0) { + value >>= 128; + result += 128; + } + if (value >> 64 > 0) { + value >>= 64; + result += 64; + } + if (value >> 32 > 0) { + value >>= 32; + result += 32; + } + if (value >> 16 > 0) { + value >>= 16; + result += 16; + } + if (value >> 8 > 0) { + value >>= 8; + result += 8; + } + if (value >> 4 > 0) { + value >>= 4; + result += 4; + } + if (value >> 2 > 0) { + value >>= 2; + result += 2; + } + if (value >> 1 > 0) { + result += 1; + } + } + return result; + } +} diff --git a/contracts/test/foundry/marketplace/utils/MerkleWithPosition.sol b/contracts/test/foundry/marketplace/utils/MerkleWithPosition.sol new file mode 100644 index 00000000..43857193 --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/MerkleWithPosition.sol @@ -0,0 +1,157 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +/** + * @dev Modified from MurkyBase to add each node's position after hashing. + * hashLeafPair does not sort the nodes to match EIP-712. + */ +contract MerkleWithPosition { + /** + * + * PROOF GENERATION * + * + */ + + function getRoot(OrderStructs.MerkleTreeNode[] memory data) public pure returns (bytes32) { + require(data.length > 1, "won't generate root for single leaf"); + while (data.length > 1) { + data = hashLevel(data); + } + return data[0].value; + } + + function getProof(OrderStructs.MerkleTreeNode[] memory data, uint256 node) + public + pure + returns (OrderStructs.MerkleTreeNode[] memory result) + { + require(data.length > 1, "won't generate proof for single leaf"); + // The size of the proof is equal to the ceiling of log2(numLeaves) + result = new OrderStructs.MerkleTreeNode[](log2ceilBitMagic(data.length)); + uint256 pos = 0; + + // Two overflow risks: node, pos + // node: max array size is 2**256-1. Largest index in the array will be 1 less than that. Also, + // for dynamic arrays, size is limited to 2**64-1 + // pos: pos is bounded by log2(data.length), which should be less than type(uint256).max + while (data.length > 1) { + unchecked { + if (node & 0x1 == 1) { + result[pos] = data[node - 1]; + } else if (node + 1 == data.length) { + result[pos] = OrderStructs.MerkleTreeNode({ + value: bytes32(0), + position: OrderStructs.MerkleTreeNodePosition.Left + }); + } else { + result[pos] = data[node + 1]; + } + ++pos; + node /= 2; + } + data = hashLevel(data); + } + return result; + } + + ///@dev function is private to prevent unsafe data from being passed + function hashLevel(OrderStructs.MerkleTreeNode[] memory data) + private + pure + returns (OrderStructs.MerkleTreeNode[] memory result) + { + // Function is private, and all internal callers check that data.length >=2. + // Underflow is not possible as lowest possible value for data/result index is 1 + // overflow should be safe as length is / 2 always. + unchecked { + uint256 length = data.length; + if (length & 0x1 == 1) { + result = new OrderStructs.MerkleTreeNode[](length / 2 + 1); + bytes32 hashed = hashLeafPairs(data[length - 1].value, bytes32(0)); + result[result.length - 1] = + OrderStructs.MerkleTreeNode({value: hashed, position: OrderStructs.MerkleTreeNodePosition.Left}); + } else { + result = new OrderStructs.MerkleTreeNode[](length / 2); + } + // pos is upper bounded by data.length / 2, so safe even if array is at max size + uint256 pos = 0; + bool nextIsLeft = true; + for (uint256 i = 0; i < length - 1; i += 2) { + bytes32 hashed = hashLeafPairs(data[i].value, data[i + 1].value); + result[pos] = OrderStructs.MerkleTreeNode({ + value: hashed, + position: nextIsLeft + ? OrderStructs.MerkleTreeNodePosition.Left + : OrderStructs.MerkleTreeNodePosition.Right + }); + nextIsLeft = !nextIsLeft; + ++pos; + } + } + return result; + } + + /** + * + * MATH "LIBRARY" * + * + */ + + /// Original bitmagic adapted from https://github.com/paulrberg/prb-math/blob/main/contracts/PRBMath.sol + /// @dev Note that x assumed > 1 + function log2ceilBitMagic(uint256 x) public pure returns (uint256) { + if (x <= 1) { + return 0; + } + uint256 msb = 0; + uint256 _x = x; + if (x >= 2 ** 128) { + x >>= 128; + msb += 128; + } + if (x >= 2 ** 64) { + x >>= 64; + msb += 64; + } + if (x >= 2 ** 32) { + x >>= 32; + msb += 32; + } + if (x >= 2 ** 16) { + x >>= 16; + msb += 16; + } + if (x >= 2 ** 8) { + x >>= 8; + msb += 8; + } + if (x >= 2 ** 4) { + x >>= 4; + msb += 4; + } + if (x >= 2 ** 2) { + x >>= 2; + msb += 2; + } + if (x >= 2 ** 1) { + msb += 1; + } + + uint256 lsb = (~_x + 1) & _x; + if ((lsb == _x) && (msb > 0)) { + return msb; + } else { + return msb + 1; + } + } + + function hashLeafPairs(bytes32 left, bytes32 right) public pure returns (bytes32 _hash) { + assembly { + mstore(0x0, left) + mstore(0x20, right) + _hash := keccak256(0x0, 0x40) + } + } +} diff --git a/contracts/test/foundry/marketplace/utils/MockOrderGenerator.sol b/contracts/test/foundry/marketplace/utils/MockOrderGenerator.sol new file mode 100644 index 00000000..f0cc0b9e --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/MockOrderGenerator.sol @@ -0,0 +1,182 @@ +/// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Generic interfaces +import {IERC165} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC165.sol"; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Other helpers +import {ProtocolHelpers} from "../utils/ProtocolHelpers.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract MockOrderGenerator is ProtocolHelpers { + function _createMockMakerAskAndTakerBid(address collection) + internal + view + returns (OrderStructs.Maker memory newMakerAsk, OrderStructs.Taker memory newTakerBid) + { + return _createMockMakerAskAndTakerBid(collection, false); + } + + function _createMockMakerAskAndTakerBid(address collection, bool hypercerts) + internal + view + returns (OrderStructs.Maker memory newMakerAsk, OrderStructs.Taker memory newTakerBid) + { + CollectionType collectionType = hypercerts ? CollectionType.Hypercert : _getCollectionType(collection); + uint256 itemId = hypercerts ? ((1 << 128) + 1) : 420; + newMakerAsk = _createSingleItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: collectionType, + orderNonce: 0, + collection: collection, + currency: ETH, + signer: makerUser, + price: 1 ether, + itemId: itemId + }); + + newTakerBid = OrderStructs.Taker(takerUser, abi.encode()); + } + + function _createMockMakerBidAndTakerAsk(address collection, address currency) + internal + view + returns (OrderStructs.Maker memory newMakerBid, OrderStructs.Taker memory newTakerAsk) + { + return _createMockMakerBidAndTakerAsk(collection, currency, false); + } + + function _createMockMakerBidAndTakerAsk(address collection, address currency, bool hypercerts) + internal + view + returns (OrderStructs.Maker memory newMakerBid, OrderStructs.Taker memory newTakerAsk) + { + CollectionType collectionType = hypercerts ? CollectionType.Hypercert : _getCollectionType(collection); + + newMakerBid = _createSingleItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: collectionType, + orderNonce: 0, + collection: collection, + currency: currency, + signer: makerUser, + price: 1 ether, + itemId: hypercerts ? (1 << 128) + 1 : 420 + }); + + newTakerAsk = OrderStructs.Taker(takerUser, abi.encode()); + } + + function _createMockMakerAskAndTakerBidWithBundle(address collection, uint256 numberTokens) + internal + view + returns (OrderStructs.Maker memory newMakerAsk, OrderStructs.Taker memory newTakerBid) + { + return _createMockMakerAskAndTakerBidWithBundle(collection, numberTokens, false); + } + + function _createMockMakerAskAndTakerBidWithBundle(address collection, uint256 numberTokens, bool hypercerts) + internal + view + returns (OrderStructs.Maker memory newMakerAsk, OrderStructs.Taker memory newTakerBid) + { + CollectionType collectionType = hypercerts ? CollectionType.Hypercert : _getCollectionType(collection); + + (uint256[] memory itemIds, uint256[] memory amounts) = _setBundleItemIdsAndAmounts(collectionType, numberTokens); + + newMakerAsk = _createMultiItemMakerOrder({ + quoteType: QuoteType.Ask, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: collectionType, + orderNonce: 0, + collection: collection, + currency: ETH, + signer: makerUser, + price: 1 ether, + itemIds: itemIds, + amounts: amounts + }); + + newTakerBid = OrderStructs.Taker(takerUser, abi.encode()); + } + + function _createMockMakerBidAndTakerAskWithBundle(address collection, address currency, uint256 numberTokens) + internal + view + returns (OrderStructs.Maker memory newMakerBid, OrderStructs.Taker memory newTakerAsk) + { + return _createMockMakerBidAndTakerAskWithBundle(collection, currency, numberTokens, false); + } + + function _createMockMakerBidAndTakerAskWithBundle( + address collection, + address currency, + uint256 numberTokens, + bool hypercerts + ) internal view returns (OrderStructs.Maker memory newMakerBid, OrderStructs.Taker memory newTakerAsk) { + CollectionType collectionType = hypercerts ? CollectionType.Hypercert : _getCollectionType(collection); + + (uint256[] memory itemIds, uint256[] memory amounts) = _setBundleItemIdsAndAmounts(collectionType, numberTokens); + + newMakerBid = _createMultiItemMakerOrder({ + quoteType: QuoteType.Bid, + globalNonce: 0, + subsetNonce: 0, + strategyId: STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY, + collectionType: collectionType, + orderNonce: 0, + collection: collection, + currency: currency, + signer: makerUser, + price: 1 ether, + itemIds: itemIds, + amounts: amounts + }); + + newTakerAsk = OrderStructs.Taker(takerUser, abi.encode()); + } + + function _getCollectionType(address collection) private view returns (CollectionType collectionType) { + collectionType = CollectionType.ERC721; + + // If ERC1155, adjust the collection type + if (IERC165(collection).supportsInterface(0xd9b67a26)) { + collectionType = CollectionType.ERC1155; + } + } + + function _setBundleItemIdsAndAmounts(CollectionType collectionType, uint256 numberTokens) + private + pure + returns (uint256[] memory itemIds, uint256[] memory amounts) + { + itemIds = new uint256[](numberTokens); + amounts = new uint256[](numberTokens); + + for (uint256 i; i < itemIds.length; i++) { + itemIds[i] = i; + if (collectionType != CollectionType.ERC1155) { + amounts[i] = 1; + } else if (collectionType == CollectionType.Hypercert) { + itemIds[i] = (1 << 128) + 1 + i; + amounts[i] = 1; + } else { + amounts[i] = 1 + i; + } + } + } +} diff --git a/contracts/test/foundry/marketplace/utils/ProtocolHelpers.sol b/contracts/test/foundry/marketplace/utils/ProtocolHelpers.sol new file mode 100644 index 00000000..51c55d94 --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/ProtocolHelpers.sol @@ -0,0 +1,107 @@ +/// SPDX-License-Identifier: MIT +pragma solidity ^0.8.17; + +// Dependencies +import {BatchOrderTypehashRegistry} from "@hypercerts/marketplace/BatchOrderTypehashRegistry.sol"; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Other tests +import {TestHelpers} from "./TestHelpers.sol"; +import {TestParameters} from "./TestParameters.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; +import {QuoteType} from "@hypercerts/marketplace/enums/QuoteType.sol"; + +contract ProtocolHelpers is TestHelpers, TestParameters { + using OrderStructs for OrderStructs.Maker; + + bytes32 internal _domainSeparator; + + receive() external payable {} + + function _createSingleItemMakerOrder( + QuoteType quoteType, + uint256 globalNonce, + uint256 subsetNonce, + uint256 strategyId, + CollectionType collectionType, + uint256 orderNonce, + address collection, + address currency, + address signer, + uint256 price, + uint256 itemId + ) internal view returns (OrderStructs.Maker memory makerOrder) { + uint256[] memory itemIds = new uint256[](1); + itemIds[0] = itemId; + uint256[] memory amounts = new uint256[](1); + amounts[0] = 1; + + makerOrder = OrderStructs.Maker({ + quoteType: quoteType, + globalNonce: globalNonce, + subsetNonce: subsetNonce, + orderNonce: orderNonce, + strategyId: strategyId, + collectionType: collectionType, + collection: collection, + currency: currency, + signer: signer, + startTime: block.timestamp, + endTime: block.timestamp + 1, + price: price, + itemIds: itemIds, + amounts: amounts, + additionalParameters: abi.encode() + }); + } + + function _createMultiItemMakerOrder( + QuoteType quoteType, + uint256 globalNonce, + uint256 subsetNonce, + uint256 strategyId, + CollectionType collectionType, + uint256 orderNonce, + address collection, + address currency, + address signer, + uint256 price, + uint256[] memory itemIds, + uint256[] memory amounts + ) internal view returns (OrderStructs.Maker memory newMakerBid) { + newMakerBid = OrderStructs.Maker({ + quoteType: quoteType, + globalNonce: globalNonce, + subsetNonce: subsetNonce, + orderNonce: orderNonce, + strategyId: strategyId, + collectionType: collectionType, + collection: collection, + currency: currency, + signer: signer, + startTime: block.timestamp, + endTime: block.timestamp + 1, + price: price, + itemIds: itemIds, + amounts: amounts, + additionalParameters: abi.encode() + }); + } + + function _signMakerOrder(OrderStructs.Maker memory maker, uint256 signerKey) internal view returns (bytes memory) { + bytes32 orderHash = _computeOrderHash(maker); + + (uint8 v, bytes32 r, bytes32 s) = + vm.sign(signerKey, keccak256(abi.encodePacked("\x19\x01", _domainSeparator, orderHash))); + + return abi.encodePacked(r, s, v); + } + + function _computeOrderHash(OrderStructs.Maker memory maker) internal pure returns (bytes32) { + return maker.hash(); + } +} diff --git a/contracts/test/foundry/marketplace/utils/StrategyTestMultiFillCollectionOrder.sol b/contracts/test/foundry/marketplace/utils/StrategyTestMultiFillCollectionOrder.sol new file mode 100644 index 00000000..80323455 --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/StrategyTestMultiFillCollectionOrder.sol @@ -0,0 +1,77 @@ +/// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// Libraries +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +// Custom errors +import {OrderInvalid} from "@hypercerts/marketplace/errors/SharedErrors.sol"; + +// Base strategy contracts +import {BaseStrategy, IStrategy} from "@hypercerts/marketplace/executionStrategies/BaseStrategy.sol"; + +// Enums +import {CollectionType} from "@hypercerts/marketplace/enums/CollectionType.sol"; + +contract StrategyTestMultiFillCollectionOrder is BaseStrategy { + using OrderStructs for OrderStructs.Maker; + + // Address of the protocol + address public immutable LOOKSRARE_PROTOCOL; + + // Tracks historical fills + mapping(bytes32 => uint256) internal countItemsFilledForOrderHash; + + /** + * @notice Constructor + * @param _looksRareProtocol Address of the LooksRare protocol + */ + constructor(address _looksRareProtocol) { + LOOKSRARE_PROTOCOL = _looksRareProtocol; + } + + /** + * @notice Execute collection strategy with taker ask order + * @param takerAsk Taker ask struct (taker ask-specific parameters for the execution) + * @param makerBid Maker bid struct (maker bid-specific parameters for the execution) + */ + function executeStrategyWithTakerAsk(OrderStructs.Taker calldata takerAsk, OrderStructs.Maker calldata makerBid) + external + returns (uint256 price, uint256[] memory itemIds, uint256[] memory amounts, bool isNonceInvalidated) + { + if (msg.sender != LOOKSRARE_PROTOCOL) revert OrderInvalid(); + // Only available for ERC721 + if (makerBid.collectionType != CollectionType.ERC721) revert OrderInvalid(); + + bytes32 orderHash = makerBid.hash(); + uint256 countItemsFilled = countItemsFilledForOrderHash[orderHash]; + uint256 countItemsFillable = makerBid.amounts[0]; + + price = makerBid.price; + (itemIds, amounts) = abi.decode(takerAsk.additionalParameters, (uint256[], uint256[])); + uint256 countItemsToFill = amounts.length; + + if ( + countItemsToFill == 0 || makerBid.amounts.length != 1 || itemIds.length != countItemsToFill + || countItemsFillable < countItemsToFill + countItemsFilled + ) revert OrderInvalid(); + + price *= countItemsToFill; + + if (countItemsToFill + countItemsFilled == countItemsFillable) { + delete countItemsFilledForOrderHash[orderHash]; + isNonceInvalidated = true; + } else { + countItemsFilledForOrderHash[orderHash] += countItemsToFill; + } + } + + function isMakerOrderValid(OrderStructs.Maker calldata, bytes4) + external + view + override + returns (bool isValid, bytes4 errorSelector) + { + // + } +} diff --git a/contracts/test/foundry/marketplace/utils/TestHelpers.sol b/contracts/test/foundry/marketplace/utils/TestHelpers.sol new file mode 100644 index 00000000..66270688 --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/TestHelpers.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {Test} from "forge-std/Test.sol"; +import {BytesLib} from "./BytesLib.sol"; + +abstract contract TestHelpers is Test { + using BytesLib for bytes; + + modifier asPrankedUser(address user) { + vm.startPrank(user); + _; + vm.stopPrank(); + } + + /** + * @dev Transforms a standard signature into an EIP2098 compliant signature + * @param signature The secp256k1 65-bytes signature + * @return eip2098Signature The 64-bytes EIP2098 compliant signature + */ + function _eip2098Signature(bytes memory signature) internal pure returns (bytes memory eip2098Signature) { + eip2098Signature = signature.slice(0, 64); + uint8 parityBit = uint8(eip2098Signature[32]) | ((uint8(signature[64]) % 27) << 7); + eip2098Signature[32] = bytes1(parityBit); + } +} diff --git a/contracts/test/foundry/marketplace/utils/TestParameters.sol b/contracts/test/foundry/marketplace/utils/TestParameters.sol new file mode 100644 index 00000000..44d29cf9 --- /dev/null +++ b/contracts/test/foundry/marketplace/utils/TestParameters.sol @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {Test} from "forge-std/Test.sol"; +import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol"; + +abstract contract TestParameters is Test { + // Empty constants + OrderStructs.MerkleTree internal _EMPTY_MERKLE_TREE; + bytes4 internal constant _EMPTY_BYTES4 = bytes4(0); + bytes32 public constant MAGIC_VALUE_ORDER_NONCE_EXECUTED = keccak256("ORDER_NONCE_EXECUTED"); + + // Addresses + address internal constant _owner = address(42); + address internal constant _sender = address(88); + address internal constant _recipient = address(90); + address internal constant _transferrer = address(100); + address internal constant _royaltyRecipient = address(22); + + // Currencies + address internal constant ETH = address(0); + address internal constant WETH_MAINNET = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; + + // Generic fee parameters + uint16 internal constant _standardProtocolFeeBp = uint16(50); + uint16 internal constant _minTotalFeeBp = uint16(50); + uint16 internal constant _maxProtocolFeeBp = uint16(200); + uint16 internal constant _standardRoyaltyFee = uint16(0); + + uint256 internal constant _sellerProceedBpWithStandardProtocolFeeBp = 9950; + + // Public/Private keys for maker/taker user + uint256 internal constant makerUserPK = 1; + uint256 internal constant takerUserPK = 2; + // it is equal to vm.addr(makerUserPK) + address internal constant makerUser = 0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf; + // it is equal to vm.addr(takerUserPK) + address internal constant takerUser = 0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF; + + // Initial balances + // @dev The balances are on purpose different across users to make sure the tests are properly checking the + // assertion + uint256 internal constant _initialETHBalanceUser = 100 ether; + uint256 internal constant _initialWETHBalanceUser = 10 ether; + uint256 internal constant _initialETHBalanceRoyaltyRecipient = 10 ether; + uint256 internal constant _initialWETHBalanceRoyaltyRecipient = 25 ether; + uint256 internal constant _initialETHBalanceOwner = 50 ether; + uint256 internal constant _initialWETHBalanceOwner = 15 ether; + + // Chainlink ETH/USD price feed (Ethereum mainnet) + address internal constant CHAINLINK_ETH_USD_PRICE_FEED = 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419; + + // Strategy id + uint256 internal constant STANDARD_SALE_FOR_FIXED_PRICE_STRATEGY = 0; +} diff --git a/contracts/test/foundry/AllowlistMinter.t.sol b/contracts/test/foundry/protocol/AllowlistMinter.t.sol similarity index 90% rename from contracts/test/foundry/AllowlistMinter.t.sol rename to contracts/test/foundry/protocol/AllowlistMinter.t.sol index 7ccb3aa9..a5be53c6 100644 --- a/contracts/test/foundry/AllowlistMinter.t.sol +++ b/contracts/test/foundry/protocol/AllowlistMinter.t.sol @@ -1,20 +1,21 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; +pragma solidity 0.8.17; -import { PRBTest } from "prb-test/PRBTest.sol"; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; +import {PRBTest} from "prb-test/PRBTest.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; -import { AllowlistMinter } from "../../src/AllowlistMinter.sol"; -import { Errors } from "../../src/libs/Errors.sol"; +import {AllowlistMinter} from "@hypercerts/protocol/AllowlistMinter.sol"; +import {Errors} from "@hypercerts/protocol/libs/Errors.sol"; -import { Merkle } from "murky/Merkle.sol"; +import {Merkle} from "murky/Merkle.sol"; contract MerkleHelper is AllowlistMinter, Merkle { - function generateCustomData( - address[] calldata addresses, - uint256[] calldata units - ) public pure returns (bytes32[] memory data) { + function generateCustomData(address[] calldata addresses, uint256[] calldata units) + public + pure + returns (bytes32[] memory data) + { data = new bytes32[](addresses.length); for (uint256 i = 0; i < addresses.length; i++) { data[i] = _calculateLeaf(addresses[i], units[i]); @@ -39,7 +40,7 @@ contract MerkleHelper is AllowlistMinter, Merkle { function _getSum(uint256[] memory array) public pure returns (uint256 sum) { uint256 len = array.length; - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { sum += array[i]; unchecked { ++i; @@ -159,7 +160,7 @@ contract AllowlistTest is PRBTest, StdCheats, StdUtils { } function testBasicAllowlistFuzz(uint256 size) public { - size = bound(size, 4, 5_000); + size = bound(size, 4, 5000); uint256 units = 10_000; bytes32[] memory data = merkle.generateData(size, 10_000); bytes32 root = merkle.getRoot(data); @@ -173,7 +174,7 @@ contract AllowlistTest is PRBTest, StdCheats, StdUtils { } function testProcessClaimFuzz(uint256 size) public { - size = bound(size, 4, 5_000); + size = bound(size, 4, 5000); uint256 value = 10_000; bytes32[] memory data = merkle.generateData(size, value); bytes32 root = merkle.getRoot(data); diff --git a/contracts/test/foundry/Bitshifting.t.sol b/contracts/test/foundry/protocol/Bitshifting.t.sol similarity index 86% rename from contracts/test/foundry/Bitshifting.t.sol rename to contracts/test/foundry/protocol/Bitshifting.t.sol index 68bc2cc8..4c3aba56 100644 --- a/contracts/test/foundry/Bitshifting.t.sol +++ b/contracts/test/foundry/protocol/Bitshifting.t.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; +pragma solidity 0.8.17; -import { PRBTest } from "prb-test/PRBTest.sol"; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; +import {PRBTest} from "prb-test/PRBTest.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; contract Bitshifter { /// @dev Bitmask used to expose only upper 128 bits of uint256 @@ -47,21 +47,24 @@ contract BitshiftingTest is PRBTest, StdCheats, StdUtils, Bitshifter { function testTypeMask() public { // 128 1s, 128 0s - assertEq(TYPE_MASK, 115792089237316195423570985008687907852929702298719625575994209400481361428480); + assertEq( + TYPE_MASK, + 115_792_089_237_316_195_423_570_985_008_687_907_852_929_702_298_719_625_575_994_209_400_481_361_428_480 + ); // 128 0s, 128 1s - assertEq(NF_INDEX_MASK, 340282366920938463463374607431768211455); + assertEq(NF_INDEX_MASK, 340_282_366_920_938_463_463_374_607_431_768_211_455); } function testBaseType() public { uint256 baseID = 1 << 128; uint256 baseType = getBaseType(baseID); assertEq(baseID, baseType); - assertEq(baseID, 340282366920938463463374607431768211456); + assertEq(baseID, 340_282_366_920_938_463_463_374_607_431_768_211_456); assertTrue(isBaseType(baseID)); assertEq(getItemIndex(baseID), 0); - assertEq(getBaseType(baseID), 340282366920938463463374607431768211456); + assertEq(getBaseType(baseID), 340_282_366_920_938_463_463_374_607_431_768_211_456); assertFalse(isTypedItem(baseID)); } diff --git a/contracts/test/foundry/HypercertMinter.batchminting.t.sol b/contracts/test/foundry/protocol/HypercertMinter.batchminting.t.sol similarity index 85% rename from contracts/test/foundry/HypercertMinter.batchminting.t.sol rename to contracts/test/foundry/protocol/HypercertMinter.batchminting.t.sol index b5349919..e861dc9c 100644 --- a/contracts/test/foundry/HypercertMinter.batchminting.t.sol +++ b/contracts/test/foundry/protocol/HypercertMinter.batchminting.t.sol @@ -1,14 +1,15 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; +pragma solidity 0.8.17; -import { PRBTest } from "prb-test/PRBTest.sol"; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; -import { HypercertMinter } from "../../src/HypercertMinter.sol"; +import {PRBTest} from "prb-test/PRBTest.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; +import {HypercertMinter} from "@hypercerts/protocol/HypercertMinter.sol"; //solhint-disable-next-line max-line-length -import { ERC1155HolderUpgradeable } from "openzeppelin-contracts-upgradeable/contracts/token/ERC1155/utils/ERC1155HolderUpgradeable.sol"; -import { Merkle } from "murky/Merkle.sol"; -import { IHypercertToken } from "../../src/interfaces/IHypercertToken.sol"; +import {ERC1155HolderUpgradeable} from + "openzeppelin-contracts-upgradeable/contracts/token/ERC1155/utils/ERC1155HolderUpgradeable.sol"; +import {Merkle} from "murky/Merkle.sol"; +import {IHypercertToken} from "@hypercerts/protocol/interfaces/IHypercertToken.sol"; contract BatchMintingHelper is Merkle, ERC1155HolderUpgradeable { event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values); @@ -20,10 +21,11 @@ contract BatchMintingHelper is Merkle, ERC1155HolderUpgradeable { bytes32 root; } - function generateCustomData( - address[] memory addresses, - uint256[] memory units - ) public pure returns (bytes32[] memory data) { + function generateCustomData(address[] memory addresses, uint256[] memory units) + public + pure + returns (bytes32[] memory data) + { data = new bytes32[](addresses.length); for (uint256 i = 0; i < addresses.length; i++) { data[i] = _calculateLeaf(addresses[i], units[i]); @@ -62,7 +64,7 @@ contract BatchMintingHelper is Merkle, ERC1155HolderUpgradeable { function _getSum(uint256[] memory array) public pure returns (uint256 sum) { uint256 len = array.length; - for (uint256 i; i < len; ) { + for (uint256 i; i < len;) { sum += array[i]; unchecked { ++i; @@ -107,7 +109,7 @@ contract HypercertBatchMintingTest is PRBTest, StdCheats, StdUtils, BatchMinting proofs[i] = getProof(dataset.data, index); ids[i] = (i + 1) << 128; units[i] = dataset.units[index]; - minter.createAllowlist(user, 10000, dataset.root, _uri, IHypercertToken.TransferRestrictions.AllowAll); + minter.createAllowlist(user, 10_000, dataset.root, _uri, IHypercertToken.TransferRestrictions.AllowAll); } units[3] = 0; @@ -151,8 +153,8 @@ contract HypercertBatchMintingTest is PRBTest, StdCheats, StdUtils, BatchMinting uint256[] memory zeroes = new uint256[](2); - minter.createAllowlist(user, 10000, one.root, _uri, IHypercertToken.TransferRestrictions.AllowAll); - minter.createAllowlist(user, 10000, two.root, _uri, IHypercertToken.TransferRestrictions.AllowAll); + minter.createAllowlist(user, 10_000, one.root, _uri, IHypercertToken.TransferRestrictions.AllowAll); + minter.createAllowlist(user, 10_000, two.root, _uri, IHypercertToken.TransferRestrictions.AllowAll); startHoax(user, 10 ether); @@ -179,7 +181,7 @@ contract HypercertBatchMintingTest is PRBTest, StdCheats, StdUtils, BatchMinting ids[i] = (i + 1) << 128; tokenIDs[i] = ids[i] + 1; units[i] = dataset.units[index]; - minter.createAllowlist(user, 10000, dataset.root, _uri, IHypercertToken.TransferRestrictions.AllowAll); + minter.createAllowlist(user, 10_000, dataset.root, _uri, IHypercertToken.TransferRestrictions.AllowAll); } startHoax(user, 10 ether); @@ -215,11 +217,7 @@ contract HypercertBatchMintingTest is PRBTest, StdCheats, StdUtils, BatchMinting tokenIDs[i] = ids[i] + 1; units[i] = dataset.units[index]; minter.createAllowlist( - user, - _getSum(units), - dataset.root, - _uri, - IHypercertToken.TransferRestrictions.AllowAll + user, _getSum(units), dataset.root, _uri, IHypercertToken.TransferRestrictions.AllowAll ); } @@ -254,7 +252,7 @@ contract HypercertBatchMintingTest is PRBTest, StdCheats, StdUtils, BatchMinting ids[i] = (i + 1) << 128; tokenIDs[i] = ids[i] + 1; units[i] = dataset.units[index]; - minter.createAllowlist(user, 10000, dataset.root, _uri, IHypercertToken.TransferRestrictions.DisallowAll); + minter.createAllowlist(user, 10_000, dataset.root, _uri, IHypercertToken.TransferRestrictions.DisallowAll); } startHoax(user, 10 ether); @@ -289,11 +287,7 @@ contract HypercertBatchMintingTest is PRBTest, StdCheats, StdUtils, BatchMinting tokenIDs[i] = ids[i] + 1; units[i] = dataset.units[index]; minter.createAllowlist( - user, - 10000, - dataset.root, - _uri, - IHypercertToken.TransferRestrictions.FromCreatorOnly + user, 10_000, dataset.root, _uri, IHypercertToken.TransferRestrictions.FromCreatorOnly ); } diff --git a/contracts/test/foundry/HypercertMinter.pausable.t.sol b/contracts/test/foundry/protocol/HypercertMinter.pausable.t.sol similarity index 87% rename from contracts/test/foundry/HypercertMinter.pausable.t.sol rename to contracts/test/foundry/protocol/HypercertMinter.pausable.t.sol index 716c8c5f..0253ea7a 100644 --- a/contracts/test/foundry/HypercertMinter.pausable.t.sol +++ b/contracts/test/foundry/protocol/HypercertMinter.pausable.t.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; +pragma solidity 0.8.17; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; -import { PRBTest } from "prb-test/PRBTest.sol"; -import { HypercertMinter } from "../../src/HypercertMinter.sol"; -import { IHypercertToken } from "../../src/interfaces/IHypercertToken.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; +import {PRBTest} from "prb-test/PRBTest.sol"; +import {HypercertMinter} from "@hypercerts/protocol/HypercertMinter.sol"; +import {IHypercertToken} from "@hypercerts/protocol/interfaces/IHypercertToken.sol"; contract PausableTestHelper { /** @@ -86,13 +86,7 @@ contract HypercertMinterPausableTest is PRBTest, StdCheats, StdUtils, PausableTe hypercertMinter.mintClaim(owner, 1, _uri, IHypercertToken.TransferRestrictions.AllowAll); vm.expectRevert("Pausable: paused"); - hypercertMinter.mintClaimWithFractions( - owner, - 1, - fractions, - _uri, - IHypercertToken.TransferRestrictions.AllowAll - ); + hypercertMinter.mintClaimWithFractions(owner, 1, fractions, _uri, IHypercertToken.TransferRestrictions.AllowAll); vm.expectRevert("Pausable: paused"); hypercertMinter.mintClaimFromAllowlist(owner, proofs, 2, 1000); diff --git a/contracts/test/foundry/HypercertMinter.t.sol b/contracts/test/foundry/protocol/HypercertMinter.t.sol similarity index 75% rename from contracts/test/foundry/HypercertMinter.t.sol rename to contracts/test/foundry/protocol/HypercertMinter.t.sol index ad15aada..e286c153 100644 --- a/contracts/test/foundry/HypercertMinter.t.sol +++ b/contracts/test/foundry/protocol/HypercertMinter.t.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; +pragma solidity 0.8.17; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; -import { Merkle } from "murky/Merkle.sol"; -import { PRBTest } from "prb-test/PRBTest.sol"; -import { HypercertMinter } from "../../src/HypercertMinter.sol"; -import { IHypercertToken } from "../../src/interfaces/IHypercertToken.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; +import {Merkle} from "murky/Merkle.sol"; +import {PRBTest} from "prb-test/PRBTest.sol"; +import {HypercertMinter} from "@hypercerts/protocol/HypercertMinter.sol"; +import {IHypercertToken} from "@hypercerts/protocol/interfaces/IHypercertToken.sol"; contract MinterTestHelper { event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits); @@ -38,7 +38,9 @@ contract MinterTestHelper { return 0; } sum = 0; - for (uint256 i = 0; i < array.length; i++) sum += array[i]; + for (uint256 i = 0; i < array.length; i++) { + sum += array[i]; + } } function buildFractions(uint256 size) public pure returns (uint256[] memory) { @@ -66,6 +68,17 @@ contract HypercertMinterTest is PRBTest, StdCheats, StdUtils, MinterTestHelper { startHoax(alice, 10 ether); } + function testSupportsInterface() public { + // 721 + assertEq(hypercertMinter.supportsInterface(0x80ac58cd), false); + + // 1155 + assertEq(hypercertMinter.supportsInterface(0xd9b67a26), true); + + // IHypercertToken + assertEq(hypercertMinter.supportsInterface(0xda69bafa), true); + } + /// @dev Run Forge with `-vvvv` to see console logs. function testFailInitialize() public { hypercertMinter.initialize(); @@ -76,7 +89,7 @@ contract HypercertMinterTest is PRBTest, StdCheats, StdUtils, MinterTestHelper { } function testClaimSingleFraction() public { - uint256 units = 10000; + uint256 units = 10_000; vm.expectEmit(true, true, true, true); emit ClaimStored(1 << 128, _uri, units); @@ -89,11 +102,7 @@ contract HypercertMinterTest is PRBTest, StdCheats, StdUtils, MinterTestHelper { vm.expectEmit(true, true, true, true); emit ClaimStored(1 << 128, _uri, totalUnits); hypercertMinter.mintClaimWithFractions( - alice, - totalUnits, - fractions, - _uri, - IHypercertToken.TransferRestrictions.AllowAll + alice, totalUnits, fractions, _uri, IHypercertToken.TransferRestrictions.AllowAll ); } @@ -104,11 +113,7 @@ contract HypercertMinterTest is PRBTest, StdCheats, StdUtils, MinterTestHelper { vm.expectEmit(true, true, true, true); emit ClaimStored(1 << 128, _uri, totalUnits); hypercertMinter.mintClaimWithFractions( - alice, - totalUnits, - fractions, - _uri, - IHypercertToken.TransferRestrictions.AllowAll + alice, totalUnits, fractions, _uri, IHypercertToken.TransferRestrictions.AllowAll ); } @@ -118,11 +123,7 @@ contract HypercertMinterTest is PRBTest, StdCheats, StdUtils, MinterTestHelper { vm.expectEmit(true, true, true, true); emit ClaimStored(1 << 128, _uri, totalUnits); hypercertMinter.mintClaimWithFractions( - alice, - totalUnits, - fractions, - _uri, - IHypercertToken.TransferRestrictions.DisallowAll + alice, totalUnits, fractions, _uri, IHypercertToken.TransferRestrictions.DisallowAll ); } @@ -132,11 +133,7 @@ contract HypercertMinterTest is PRBTest, StdCheats, StdUtils, MinterTestHelper { vm.expectEmit(true, true, true, true); emit ClaimStored(1 << 128, _uri, totalUnits); hypercertMinter.mintClaimWithFractions( - alice, - totalUnits, - fractions, - _uri, - IHypercertToken.TransferRestrictions.FromCreatorOnly + alice, totalUnits, fractions, _uri, IHypercertToken.TransferRestrictions.FromCreatorOnly ); } } diff --git a/contracts/test/foundry/HypercertMinter.transfers.t.sol b/contracts/test/foundry/protocol/HypercertMinter.transfers.t.sol similarity index 92% rename from contracts/test/foundry/HypercertMinter.transfers.t.sol rename to contracts/test/foundry/protocol/HypercertMinter.transfers.t.sol index 7c74edb1..5533296e 100644 --- a/contracts/test/foundry/HypercertMinter.transfers.t.sol +++ b/contracts/test/foundry/protocol/HypercertMinter.transfers.t.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; +pragma solidity 0.8.17; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; -import { PRBTest } from "prb-test/PRBTest.sol"; -import { Errors } from "../../src/libs/Errors.sol"; -import { HypercertMinter } from "../../src/HypercertMinter.sol"; -import { IHypercertToken } from "../../src/interfaces/IHypercertToken.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; +import {PRBTest} from "prb-test/PRBTest.sol"; +import {Errors} from "@hypercerts/protocol/libs/Errors.sol"; +import {HypercertMinter} from "@hypercerts/protocol/HypercertMinter.sol"; +import {IHypercertToken} from "@hypercerts/protocol/interfaces/IHypercertToken.sol"; /// @dev Testing transfer restrictions on hypercerts contract HypercertMinterTransferTest is PRBTest, StdCheats, StdUtils { @@ -22,7 +22,7 @@ contract HypercertMinterTransferTest is PRBTest, StdCheats, StdUtils { function setUp() public { hypercertMinter = new HypercertMinter(); _uri = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi"; - _units = 10000; + _units = 10_000; baseID = 1 << 128; tokenIndex = 1; tokenID = baseID + tokenIndex; diff --git a/contracts/test/foundry/PerformanceTesting.t.sol b/contracts/test/foundry/protocol/PerformanceTesting.t.sol similarity index 82% rename from contracts/test/foundry/PerformanceTesting.t.sol rename to contracts/test/foundry/protocol/PerformanceTesting.t.sol index 7ed5b2df..d1ce85d1 100644 --- a/contracts/test/foundry/PerformanceTesting.t.sol +++ b/contracts/test/foundry/protocol/PerformanceTesting.t.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; +pragma solidity 0.8.17; -import { PRBTest } from "prb-test/PRBTest.sol"; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; -import { HypercertMinter } from "../../src/HypercertMinter.sol"; -import { Merkle } from "murky/Merkle.sol"; -import { IHypercertToken } from "../../src/interfaces/IHypercertToken.sol"; +import {PRBTest} from "prb-test/PRBTest.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; +import {HypercertMinter} from "@hypercerts/protocol/HypercertMinter.sol"; +import {Merkle} from "murky/Merkle.sol"; +import {IHypercertToken} from "@hypercerts/protocol/interfaces/IHypercertToken.sol"; // forge test -vv --match-path test/foundry/PerformanceTesting.t.sol @@ -78,10 +78,11 @@ contract PerformanceTestHelper is Merkle { leaf = keccak256(bytes.concat(keccak256(abi.encode(account, amount)))); } - function generateCustomData( - address[] memory addresses, - uint256[] memory units - ) public pure returns (bytes32[] memory data) { + function generateCustomData(address[] memory addresses, uint256[] memory units) + public + pure + returns (bytes32[] memory data) + { data = new bytes32[](addresses.length); for (uint256 i = 0; i < addresses.length; i++) { data[i] = _calculateLeaf(addresses[i], units[i]); @@ -129,7 +130,7 @@ contract PerformanceTesting is PRBTest, StdCheats, StdUtils, PerformanceTestHelp function setUp() public { alice = address(1); hypercertMinter = new HypercertMinter(); - bytes32[] memory data = generateData(12, 10000); + bytes32[] memory data = generateData(12, 10_000); rootHash = getRoot(data); proof = getProof(data, 6); @@ -149,11 +150,7 @@ contract PerformanceTesting is PRBTest, StdCheats, StdUtils, PerformanceTestHelp ids[i] = (i + 1) << 128; units[i] = dataset.units[index]; hypercertMinter.createAllowlist( - alice, - dataset.units[index], - dataset.root, - _uri, - IHypercertToken.TransferRestrictions.AllowAll + alice, dataset.units[index], dataset.root, _uri, IHypercertToken.TransferRestrictions.AllowAll ); } } @@ -170,7 +167,7 @@ contract PerformanceTesting is PRBTest, StdCheats, StdUtils, PerformanceTestHelp // Mint Hypercert with 1 fraction function testClaimSingleFraction() public { - hypercertMinter.mintClaim(alice, 10000, _uri, IHypercertToken.TransferRestrictions.AllowAll); + hypercertMinter.mintClaim(alice, 10_000, _uri, IHypercertToken.TransferRestrictions.AllowAll); } function testClaimSingleFractionFuzz(address account, uint256 value) public { @@ -188,11 +185,7 @@ contract PerformanceTesting is PRBTest, StdCheats, StdUtils, PerformanceTestHelp uint256 totalUnits = getSum(fractions); hypercertMinter.mintClaimWithFractions( - alice, - totalUnits, - fractions, - _uri, - IHypercertToken.TransferRestrictions.AllowAll + alice, totalUnits, fractions, _uri, IHypercertToken.TransferRestrictions.AllowAll ); } @@ -201,11 +194,7 @@ contract PerformanceTesting is PRBTest, StdCheats, StdUtils, PerformanceTestHelp uint256 totalUnits = getSum(fractions); hypercertMinter.mintClaimWithFractions( - alice, - totalUnits, - fractions, - _uri, - IHypercertToken.TransferRestrictions.AllowAll + alice, totalUnits, fractions, _uri, IHypercertToken.TransferRestrictions.AllowAll ); } @@ -215,11 +204,7 @@ contract PerformanceTesting is PRBTest, StdCheats, StdUtils, PerformanceTestHelp uint256 totalUnits = getSum(fractions); hypercertMinter.mintClaimWithFractions( - alice, - totalUnits, - fractions, - "https://example.com/ipfsHash", - IHypercertToken.TransferRestrictions.AllowAll + alice, totalUnits, fractions, "https://example.com/ipfsHash", IHypercertToken.TransferRestrictions.AllowAll ); } diff --git a/contracts/test/foundry/SemiFungible1155.allowances.t.sol b/contracts/test/foundry/protocol/SemiFungible1155.allowances.t.sol similarity index 94% rename from contracts/test/foundry/SemiFungible1155.allowances.t.sol rename to contracts/test/foundry/protocol/SemiFungible1155.allowances.t.sol index 438b1893..0f715b6c 100644 --- a/contracts/test/foundry/SemiFungible1155.allowances.t.sol +++ b/contracts/test/foundry/protocol/SemiFungible1155.allowances.t.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; +pragma solidity 0.8.17; -import { PRBTest } from "prb-test/PRBTest.sol"; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; -import { SemiFungible1155Helper } from "./SemiFungibleHelper.sol"; +import {PRBTest} from "prb-test/PRBTest.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; +import {SemiFungible1155Helper} from "./SemiFungibleHelper.sol"; /// @dev See the "Writing Tests" section in the Foundry Book if this is your first time with Forge. /// https://book.getfoundry.sh/forge/writing-tests diff --git a/contracts/test/foundry/protocol/SemiFungible1155.burning.t.sol b/contracts/test/foundry/protocol/SemiFungible1155.burning.t.sol new file mode 100644 index 00000000..2b454992 --- /dev/null +++ b/contracts/test/foundry/protocol/SemiFungible1155.burning.t.sol @@ -0,0 +1,121 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.17; + +import {PRBTest} from "prb-test/PRBTest.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; +import {SemiFungible1155Helper} from "./SemiFungibleHelper.sol"; + +/// @dev See the "Writing Tests" section in the Foundry Book if this is your first time with Forge. +/// https://book.getfoundry.sh/forge/writing-tests +contract SemiFungible1155BurnTest is PRBTest, StdCheats, StdUtils, SemiFungible1155Helper { + SemiFungible1155Helper internal semiFungible; + string internal _uri; + address internal alice; + address internal bob; + + function setUp() public { + semiFungible = new SemiFungible1155Helper(); + _uri = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi"; + alice = address(1); + bob = address(2); + } + + function testBurnFraction() public { + uint256 baseID = 1 << 128; + + uint256 size = 20; + uint256 value = 2000; + uint256[] memory values = semiFungible.buildValues(size, value); + uint256[] memory tokenIDs = semiFungible.buildIDs(baseID, size); + + startHoax(alice, 100 ether); + + semiFungible.mintValue(alice, values, _uri); + semiFungible.validateOwnerBalanceUnits(tokenIDs[1], alice, 1, values[1]); + + changePrank(bob); + vm.expectRevert(NotApprovedOrOwner.selector); + semiFungible.burnValue(alice, tokenIDs[1]); + + changePrank(alice); + vm.expectEmit(true, true, true, true); + emit TransferSingle(alice, alice, address(0), tokenIDs[1], 1); + semiFungible.burnValue(alice, tokenIDs[1]); + + semiFungible.validateNotOwnerNoBalanceNoUnits(tokenIDs[1], alice); + } + + function testBatchBurnFractions() public { + uint256 baseID = 1 << 128; + + uint256 size = 20; + uint256 value = 2000; + uint256[] memory values = semiFungible.buildValues(size, value); + uint256[] memory tokenIDs = semiFungible.buildIDs(baseID, size); + + uint256[] memory valueToBurn = new uint256[](2); + valueToBurn[0] = 1; + valueToBurn[1] = 1; + uint256[] memory idsToBurn = new uint256[](2); + idsToBurn[0] = tokenIDs[1]; + idsToBurn[1] = tokenIDs[7]; + uint256[] memory toTokens = new uint256[](2); + toTokens[0] = 0; + toTokens[1] = 0; + + startHoax(alice, 100 ether); + + semiFungible.mintValue(alice, values, _uri); + semiFungible.validateOwnerBalanceUnits(tokenIDs[1], alice, 1, values[1]); + + assertEq(semiFungible.unitsOf(tokenIDs[7]), 2000); + assertEq(semiFungible.unitsOf(baseID), size * value); + + changePrank(bob); + vm.expectRevert(NotApprovedOrOwner.selector); + semiFungible.batchBurnValues(alice, idsToBurn); + + changePrank(alice); + vm.expectEmit(true, true, true, true); + emit TransferBatch(alice, alice, address(0), idsToBurn, valueToBurn); + semiFungible.batchBurnValues(alice, idsToBurn); + + semiFungible.validateNotOwnerNoBalanceNoUnits(tokenIDs[1], alice); + assertEq(semiFungible.unitsOf(tokenIDs[1]), 0); + + semiFungible.validateNotOwnerNoBalanceNoUnits(tokenIDs[7], alice); + assertEq(semiFungible.unitsOf(tokenIDs[7]), 0); + + assertEq(semiFungible.unitsOf(baseID), size * value); + } + + function testCannotBurnClaim() public { + uint256 size = 20; + uint256 value = 2000; + uint256[] memory values = semiFungible.buildValues(size, value); + + startHoax(alice, 100 ether); + + uint256 baseID = semiFungible.mintValue(alice, values, _uri); + + vm.expectRevert("ERC1155: burn amount exceeds balance"); + semiFungible.burnValue(alice, baseID); + } + + function testCannotBatchBurnClaim() public { + uint256 size = 20; + uint256 value = 2000; + uint256[] memory values = semiFungible.buildValues(size, value); + + startHoax(alice, 100 ether); + + uint256 baseID = semiFungible.mintValue(alice, values, _uri); + + uint256[] memory idsToBurn = new uint256[](1); + idsToBurn[0] = baseID; + + vm.expectRevert("ERC1155: burn amount exceeds balance"); + semiFungible.batchBurnValues(alice, idsToBurn); + } +} diff --git a/contracts/test/foundry/SemiFungible1155.minting.t.sol b/contracts/test/foundry/protocol/SemiFungible1155.minting.t.sol similarity index 88% rename from contracts/test/foundry/SemiFungible1155.minting.t.sol rename to contracts/test/foundry/protocol/SemiFungible1155.minting.t.sol index ae7f78d6..0e01f6b4 100644 --- a/contracts/test/foundry/SemiFungible1155.minting.t.sol +++ b/contracts/test/foundry/protocol/SemiFungible1155.minting.t.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; +pragma solidity 0.8.17; -import { PRBTest } from "prb-test/PRBTest.sol"; -import { stdError } from "forge-std/StdError.sol"; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; -import { SemiFungible1155Helper } from "./SemiFungibleHelper.sol"; +import {PRBTest} from "prb-test/PRBTest.sol"; +import {stdError} from "forge-std/StdError.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; +import {SemiFungible1155Helper} from "./SemiFungibleHelper.sol"; /// @dev See the "Writing Tests" section in the Foundry Book if this is your first time with Forge. /// https://book.getfoundry.sh/forge/writing-tests @@ -64,7 +64,7 @@ contract SemiFungible1155MintingTest is PRBTest, StdCheats, StdUtils, SemiFungib semiFungible.setMaxType(); vm.expectRevert(stdError.arithmeticError); - semiFungible.mintValue(alice, 10000, _uri); + semiFungible.mintValue(alice, 10_000, _uri); } // HAPPY MINTING @@ -81,17 +81,17 @@ contract SemiFungible1155MintingTest is PRBTest, StdCheats, StdUtils, SemiFungib // uint256 value vm.expectEmit(true, true, true, true); emit TransferSingle(alice, address(0), address(0), _baseID, 0); - uint256 baseID = semiFungible.mintValue(alice, 10000, _uri); + uint256 baseID = semiFungible.mintValue(alice, 10_000, _uri); assertEq(baseID, _baseID); assertEq(semiFungible.ownerOf(baseID), address(0)); assertEq(semiFungible.creator(baseID), alice); - assertEq(semiFungible.unitsOf(baseID), 10000); + assertEq(semiFungible.unitsOf(baseID), 10_000); - semiFungible.validateOwnerBalanceUnits(baseID + 1, alice, 1, 10000); + semiFungible.validateOwnerBalanceUnits(baseID + 1, alice, 1, 10_000); - assertEq(semiFungible.tokenValue(baseID), 10000); - assertEq(semiFungible.tokenValue(baseID + 1), 10000); + assertEq(semiFungible.tokenValue(baseID), 10_000); + assertEq(semiFungible.tokenValue(baseID + 1), 10_000); assertEq(semiFungible.tokenValue(baseID + 2), 0); } @@ -123,7 +123,7 @@ contract SemiFungible1155MintingTest is PRBTest, StdCheats, StdUtils, SemiFungib values[2] = 5000; uint256 baseID = semiFungible.mintValue(alice, values, _uri); - assertEq(semiFungible.unitsOf(baseID), 15000); + assertEq(semiFungible.unitsOf(baseID), 15_000); assertEq(semiFungible.ownerOf(baseID), address(0)); // Swap because of splitting logic diff --git a/contracts/test/foundry/SemiFungible1155.t.sol b/contracts/test/foundry/protocol/SemiFungible1155.t.sol similarity index 91% rename from contracts/test/foundry/SemiFungible1155.t.sol rename to contracts/test/foundry/protocol/SemiFungible1155.t.sol index 09918e69..3ad7df59 100644 --- a/contracts/test/foundry/SemiFungible1155.t.sol +++ b/contracts/test/foundry/protocol/SemiFungible1155.t.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; +pragma solidity 0.8.17; -import { PRBTest } from "prb-test/PRBTest.sol"; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; -import { SemiFungible1155Helper } from "./SemiFungibleHelper.sol"; +import {PRBTest} from "prb-test/PRBTest.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; +import {SemiFungible1155Helper} from "./SemiFungibleHelper.sol"; /// @dev See the "Writing Tests" section in the Foundry Book if this is your first time with Forge. /// https://book.getfoundry.sh/forge/writing-tests @@ -35,16 +35,16 @@ contract SemiFungible1155DefaultTest is PRBTest, StdCheats, StdUtils, SemiFungib startHoax(alice, 100 ether); - semiFungible.mintValue(alice, 10000, _uri); + semiFungible.mintValue(alice, 10_000, _uri); semiFungible.splitValue(alice, tokenID, values); - assertEq(semiFungible.unitsOf(baseID), 10000); + assertEq(semiFungible.unitsOf(baseID), 10_000); semiFungible.validateOwnerBalanceUnits(tokenID, alice, 1, values[0]); semiFungible.validateOwnerBalanceUnits(tokenID + 1, alice, 1, values[1]); // Units - assertEq(semiFungible.unitsOf(baseID), 10000); + assertEq(semiFungible.unitsOf(baseID), 10_000); assertEq(semiFungible.unitsOf(tokenID), 7000); assertEq(semiFungible.unitsOf(tokenID + 1), 3000); } diff --git a/contracts/test/foundry/SemiFungible1155.transfers.t.sol b/contracts/test/foundry/protocol/SemiFungible1155.transfers.t.sol similarity index 93% rename from contracts/test/foundry/SemiFungible1155.transfers.t.sol rename to contracts/test/foundry/protocol/SemiFungible1155.transfers.t.sol index 5a910740..ce19bb64 100644 --- a/contracts/test/foundry/SemiFungible1155.transfers.t.sol +++ b/contracts/test/foundry/protocol/SemiFungible1155.transfers.t.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; +pragma solidity 0.8.17; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; -import { PRBTest } from "prb-test/PRBTest.sol"; -import { SemiFungible1155Helper } from "./SemiFungibleHelper.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; +import {PRBTest} from "prb-test/PRBTest.sol"; +import {SemiFungible1155Helper} from "./SemiFungibleHelper.sol"; /// @dev See the "Writing Tests" section in the Foundry Book if this is your first time with Forge. /// https://book.getfoundry.sh/forge/writing-tests @@ -24,14 +24,14 @@ contract SemiFungible1155TransferTest is PRBTest, StdCheats, StdUtils { // UNHAPPY PATHS function testFailTransferTypeIDToken() public { - semiFungible.mintValue(alice, 10000, _uri); + semiFungible.mintValue(alice, 10_000, _uri); //NotApprovedOrOWner, since no owner semiFungible.safeTransferFrom(alice, bob, 1 << 128, 1, ""); } function testFailTransferNonExistingFractionToken() public { - semiFungible.mintValue(alice, 10000, _uri); + semiFungible.mintValue(alice, 10_000, _uri); //NotApprovedOrOWner, since no owner semiFungible.safeTransferFrom(alice, bob, 1 << (128 + 2), 1, ""); @@ -59,10 +59,10 @@ contract SemiFungible1155TransferTest is PRBTest, StdCheats, StdUtils { uint256 baseID = 1 << 128; uint128 tokenID = 1; - semiFungible.mintValue(alice, 10000, _uri); + semiFungible.mintValue(alice, 10_000, _uri); assertEq(semiFungible.balanceOf(alice, baseID), 0); - semiFungible.validateOwnerBalanceUnits(baseID + tokenID, alice, 1, 10000); + semiFungible.validateOwnerBalanceUnits(baseID + tokenID, alice, 1, 10_000); assertEq(semiFungible.balanceOf(bob, baseID), 0); semiFungible.validateNotOwnerNoBalanceNoUnits(baseID + tokenID, bob); @@ -78,7 +78,7 @@ contract SemiFungible1155TransferTest is PRBTest, StdCheats, StdUtils { semiFungible.validateNotOwnerNoBalanceNoUnits(baseID + tokenID, alice); // Updates token ownership - semiFungible.validateOwnerBalanceUnits(baseID + tokenID, bob, 1, 10000); + semiFungible.validateOwnerBalanceUnits(baseID + tokenID, bob, 1, 10_000); } function testFuzzTransferFullToken(address from, address to, uint256 units) public { diff --git a/contracts/test/foundry/SemiFungible1155.units.sol b/contracts/test/foundry/protocol/SemiFungible1155.units.sol similarity index 88% rename from contracts/test/foundry/SemiFungible1155.units.sol rename to contracts/test/foundry/protocol/SemiFungible1155.units.sol index 654c1dbb..e462ecd4 100644 --- a/contracts/test/foundry/SemiFungible1155.units.sol +++ b/contracts/test/foundry/protocol/SemiFungible1155.units.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; +pragma solidity 0.8.17; -import { PRBTest } from "prb-test/PRBTest.sol"; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; -import { SemiFungible1155Helper } from "./SemiFungibleHelper.sol"; +import {PRBTest} from "prb-test/PRBTest.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; +import {SemiFungible1155Helper} from "./SemiFungibleHelper.sol"; /// @dev See the "Writing Tests" section in the Foundry Book if this is your first time with Forge. /// https://book.getfoundry.sh/forge/writing-tests @@ -28,11 +28,11 @@ contract SemiFungible1155UnitsTest is PRBTest, StdCheats, StdUtils { uint256 baseID = 1 << 128; uint128 tokenID = 1; - semiFungible.mintValue(alice, 10000, _uri); + semiFungible.mintValue(alice, 10_000, _uri); assertEq(semiFungible.unitsOf(baseID), 10_000); - semiFungible.validateOwnerBalanceUnits(baseID + tokenID, alice, 1, 10000); + semiFungible.validateOwnerBalanceUnits(baseID + tokenID, alice, 1, 10_000); semiFungible.validateNotOwnerNoBalanceNoUnits(baseID + tokenID, bob); @@ -51,7 +51,7 @@ contract SemiFungible1155UnitsTest is PRBTest, StdCheats, StdUtils { semiFungible.validateNotOwnerNoBalanceNoUnits(baseID + tokenID, alice); assertEq(semiFungible.balanceOf(bob, baseID), 0); - semiFungible.validateOwnerBalanceUnits(baseID + tokenID, bob, 1, 10000); + semiFungible.validateOwnerBalanceUnits(baseID + tokenID, bob, 1, 10_000); } function testUnitsMultipleFractions() public { diff --git a/contracts/test/foundry/SemiFungibleHelper.sol b/contracts/test/foundry/protocol/SemiFungibleHelper.sol similarity index 86% rename from contracts/test/foundry/SemiFungibleHelper.sol rename to contracts/test/foundry/protocol/SemiFungibleHelper.sol index 4d43a810..5cc9c863 100644 --- a/contracts/test/foundry/SemiFungibleHelper.sol +++ b/contracts/test/foundry/protocol/SemiFungibleHelper.sol @@ -1,9 +1,10 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.16; -import { SemiFungible1155 } from "../../src/SemiFungible1155.sol"; -import { PRBTest } from "prb-test/PRBTest.sol"; -import { StdCheats } from "forge-std/StdCheats.sol"; -import { StdUtils } from "forge-std/StdUtils.sol"; +pragma solidity 0.8.17; + +import {SemiFungible1155} from "@hypercerts/protocol/SemiFungible1155.sol"; +import {PRBTest} from "prb-test/PRBTest.sol"; +import {StdCheats} from "forge-std/StdCheats.sol"; +import {StdUtils} from "forge-std/StdUtils.sol"; contract SemiFungible1155Helper is SemiFungible1155, PRBTest, StdCheats, StdUtils { error FractionalBurn(); @@ -51,6 +52,10 @@ contract SemiFungible1155Helper is SemiFungible1155, PRBTest, StdCheats, StdUtil _burnToken(account, tokenID); } + function batchBurnValues(address account, uint256[] memory tokenIDs) public { + _batchBurnToken(account, tokenIDs); + } + function unitsOf(uint256 tokenID) public view returns (uint256) { return _unitsOf(tokenID); } @@ -86,18 +91,24 @@ contract SemiFungible1155Helper is SemiFungible1155, PRBTest, StdCheats, StdUtil return 0; } sum = 0; - for (uint256 i = 0; i < array.length; i++) sum += array[i]; + for (uint256 i = 0; i < array.length; i++) { + sum += array[i]; + } } function buildValues(uint256 size, uint256 base) public pure returns (uint256[] memory) { uint256[] memory _values = new uint256[](size); - for (uint256 i = 0; i < size; i++) _values[i] = base; + for (uint256 i = 0; i < size; i++) { + _values[i] = base; + } return _values; } function buildIDs(uint256 baseID, uint256 size) public pure returns (uint256[] memory) { uint256[] memory _values = new uint256[](size); - for (uint256 i = 0; i < size; i++) _values[i] = baseID + i + 1; + for (uint256 i = 0; i < size; i++) { + _values[i] = baseID + i + 1; + } return _values; } diff --git a/contracts/test/mock/MockChainlinkAggregator.sol b/contracts/test/mock/MockChainlinkAggregator.sol new file mode 100644 index 00000000..a102b079 --- /dev/null +++ b/contracts/test/mock/MockChainlinkAggregator.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.17; + +contract MockChainlinkAggregator { + int256 private _answer; + uint8 private _decimals = 18; + + function setDecimals(uint8 newDecimals) external { + _decimals = newDecimals; + } + + function decimals() external view returns (uint8) { + return _decimals; + } + + function setAnswer(int256 answer) external { + _answer = answer; + } + + function latestRoundData() + external + view + returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) + { + roundId = 1; + answer = _answer; + startedAt = block.timestamp; + updatedAt = block.timestamp; + answeredInRound = 1; + } +} diff --git a/contracts/test/mock/MockERC1155.sol b/contracts/test/mock/MockERC1155.sol new file mode 100644 index 00000000..4bbfdccd --- /dev/null +++ b/contracts/test/mock/MockERC1155.sol @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.7; + +import {ERC1155} from "solmate/src/tokens/ERC1155.sol"; + +// LooksRare unopinionated libraries +import {IERC2981} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC2981.sol"; + +contract MockERC1155 is ERC1155 { + function batchMint(address to, uint256[] memory tokenIds, uint256[] memory amounts) public { + _batchMint(to, tokenIds, amounts, ""); + } + + function mint(address to, uint256 tokenId, uint256 amount) public { + _mint(to, tokenId, amount, ""); + } + + function uri(uint256) public pure override returns (string memory) { + return "uri"; + } + + function royaltyInfo(uint256, uint256) external pure returns (address, uint256) { + return (address(0), 0); + } + + function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { + return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); + } +} diff --git a/contracts/test/mock/MockERC1155SupportsNoInterface.sol b/contracts/test/mock/MockERC1155SupportsNoInterface.sol new file mode 100644 index 00000000..34b9da89 --- /dev/null +++ b/contracts/test/mock/MockERC1155SupportsNoInterface.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.7; + +import {MockERC1155} from "./MockERC1155.sol"; + +contract MockERC1155SupportsNoInterface is MockERC1155 { + function supportsInterface(bytes4) public view virtual override returns (bool) { + return false; + } +} diff --git a/contracts/test/mock/MockERC1155WithoutAnyBalanceOf.sol b/contracts/test/mock/MockERC1155WithoutAnyBalanceOf.sol new file mode 100644 index 00000000..4474f875 --- /dev/null +++ b/contracts/test/mock/MockERC1155WithoutAnyBalanceOf.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.7; + +import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; + +/** + * @dev This contract has to inherit from OZ instead of Solmate because + * Solmate's implementation defines balanceOf as a public mapping + * and it cannot be overridden. + */ +contract MockERC1155WithoutAnyBalanceOf is ERC1155 { + constructor() ERC1155("https://example.com") {} + + function balanceOf(address, uint256) public view virtual override returns (uint256) { + revert("Not implemented"); + } + + function balanceOfBatch(address[] memory, uint256[] memory) public pure override returns (uint256[] memory) { + revert("Not implemented"); + } +} diff --git a/contracts/test/mock/MockERC1155WithoutBalanceOfBatch.sol b/contracts/test/mock/MockERC1155WithoutBalanceOfBatch.sol new file mode 100644 index 00000000..1c010cae --- /dev/null +++ b/contracts/test/mock/MockERC1155WithoutBalanceOfBatch.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.7; + +import {MockERC1155} from "./MockERC1155.sol"; + +contract MockERC1155WithoutBalanceOfBatch is MockERC1155 { + function balanceOfBatch(address[] calldata, uint256[] calldata) public pure override returns (uint256[] memory) { + revert("Not implemented"); + } +} diff --git a/contracts/test/mock/MockERC1155WithoutIsApprovedForAll.sol b/contracts/test/mock/MockERC1155WithoutIsApprovedForAll.sol new file mode 100644 index 00000000..c02c4192 --- /dev/null +++ b/contracts/test/mock/MockERC1155WithoutIsApprovedForAll.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.7; + +import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; + +/** + * @dev This contract has to inherit from OZ instead of Solmate because + * Solmate's implementation defines isApprovedForAll as a public mapping + * and it cannot be overridden. + */ +contract MockERC1155WithoutIsApprovedForAll is ERC1155 { + constructor() ERC1155("https://example.com") {} + + function mint(address to, uint256 tokenId, uint256 amount) public { + _mint(to, tokenId, amount, ""); + } + + function isApprovedForAll(address, address) public view virtual override returns (bool) { + revert("Not implemented"); + } +} diff --git a/contracts/test/mock/MockERC20.sol b/contracts/test/mock/MockERC20.sol new file mode 100644 index 00000000..019bed0e --- /dev/null +++ b/contracts/test/mock/MockERC20.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.7; + +import {ERC20} from "solmate/src/tokens/ERC20.sol"; + +contract MockERC20 is ERC20("MockERC20", "MockERC20", 18) { + function mint(address to, uint256 amount) public { + _mint(to, amount); + } +} diff --git a/contracts/test/mock/MockERC721.sol b/contracts/test/mock/MockERC721.sol new file mode 100644 index 00000000..4db2eed7 --- /dev/null +++ b/contracts/test/mock/MockERC721.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.7; + +import {ERC721} from "solmate/src/tokens/ERC721.sol"; +import {IERC165} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC165.sol"; + +contract MockERC721 is ERC721("MockERC721", "MockERC721") { + function mint(address to, uint256 tokenId) public { + _mint(to, tokenId); + } + + function batchMint(address to, uint256 amount) external { + for (uint256 i; i < amount; i++) { + _mint(to, i); + } + } + + function batchMint(address to, uint256[] memory tokenIds) public { + for (uint256 i; i < tokenIds.length; i++) { + _mint(to, tokenIds[i]); + } + } + + function tokenURI(uint256) public pure override returns (string memory) { + return "tokenURI"; + } + + function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { + return super.supportsInterface(interfaceId); + } +} diff --git a/contracts/test/mock/MockERC721SupportsNoInterface.sol b/contracts/test/mock/MockERC721SupportsNoInterface.sol new file mode 100644 index 00000000..e5a6c5e3 --- /dev/null +++ b/contracts/test/mock/MockERC721SupportsNoInterface.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.7; + +import {MockERC721} from "./MockERC721.sol"; + +contract MockERC721SupportsNoInterface is MockERC721 { + function supportsInterface(bytes4) public view virtual override returns (bool) { + return false; + } +} diff --git a/contracts/test/mock/MockERC721WithRoyalties.sol b/contracts/test/mock/MockERC721WithRoyalties.sol new file mode 100644 index 00000000..071e2432 --- /dev/null +++ b/contracts/test/mock/MockERC721WithRoyalties.sol @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {IERC165, IERC2981} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC2981.sol"; +import {MockERC721} from "./MockERC721.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +/** + * @dev This contract allows adding a royalty basis points higher than 10,000, which + * reverts during the royaltyInfo call. The purpose is to create a scenario where + * royaltyInfo returns the correct response for some token IDs and reverts for some + * other token IDs. This can potentially happen in a bundle transaction. + */ +contract MockERC721WithRoyalties is MockERC721, IERC2981 { + address public immutable DEFAULT_ROYALTY_RECIPIENT; + uint256 public immutable DEFAULT_ROYALTY_FEE; + + mapping(uint256 => uint256) internal _royaltyFeeForTokenId; + mapping(uint256 => address) internal _royaltyRecipientForTokenId; + + constructor(address _royaltyFeeRecipient, uint256 _royaltyFee) { + DEFAULT_ROYALTY_RECIPIENT = _royaltyFeeRecipient; + DEFAULT_ROYALTY_FEE = _royaltyFee; + } + + function addCustomRoyaltyInformationForTokenId(uint256 tokenId, address royaltyRecipient, uint256 royaltyFee) + external + { + _royaltyRecipientForTokenId[tokenId] = royaltyRecipient; + _royaltyFeeForTokenId[tokenId] = royaltyFee; + } + + function royaltyInfo(uint256 tokenId, uint256 salePrice) + external + view + override + returns (address royaltyRecipient, uint256 royaltyAmount) + { + royaltyRecipient = _royaltyRecipientForTokenId[tokenId] == address(0) + ? DEFAULT_ROYALTY_RECIPIENT + : _royaltyRecipientForTokenId[tokenId]; + uint256 _royaltyFee = _royaltyFeeForTokenId[tokenId]; + uint256 royaltyFee = _royaltyFee == 0 ? DEFAULT_ROYALTY_FEE : _royaltyFee; + require(royaltyFee <= ONE_HUNDRED_PERCENT_IN_BP, "Royalty too high"); + royaltyAmount = (royaltyFee * salePrice) / ONE_HUNDRED_PERCENT_IN_BP; + } + + function supportsInterface(bytes4 interfaceId) public view override(MockERC721, IERC165) returns (bool) { + return interfaceId == 0x2a55205a || super.supportsInterface(interfaceId); + } +} diff --git a/contracts/test/mock/MockHypercertMinter.sol b/contracts/test/mock/MockHypercertMinter.sol new file mode 100644 index 00000000..417fe794 --- /dev/null +++ b/contracts/test/mock/MockHypercertMinter.sol @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {IHypercertToken} from "@hypercerts/protocol/interfaces/IHypercertToken.sol"; + +contract MockHypercertMinter is IHypercertToken { + constructor() IHypercertToken() {} + + /// @dev Function called to store a claim referenced via `uri` with a maximum number of fractions `units`. + function mintClaim(address account, uint256 units, string memory uri, TransferRestrictions restrictions) external { + return; + } + + /// @dev Function called to store a claim referenced via `uri` with a set of `fractions`. + /// @dev Fractions are internally summed to total units. + function mintClaimWithFractions( + address account, + uint256 units, + uint256[] memory fractions, + string memory uri, + TransferRestrictions restrictions + ) external { + return; + } + + /// @dev Function called to split `tokenID` owned by `account` into units declared in `values`. + /// @notice The sum of `values` must equal the current value of `_tokenID`. + function splitFraction(address account, uint256 tokenID, uint256[] memory _values) external { + return; + } + + /// @dev Function called to merge tokens within `tokenIDs`. + /// @notice Tokens that have been merged are burned. + function mergeFractions(address account, uint256[] memory tokenIDs) external { + return; + } + + /// @dev Function to burn the token at `tokenID` for `account` + /// @notice Operator must be allowed by `creator` and the token must represent the total amount of available units. + function burnFraction(address account, uint256 tokenID) external { + return; + } + + /// @dev Function to burn the tokens at `tokenIDs` for `account` + /// @notice Operator must be allowed by `creator` and the tokens must represent the total amount of available units. + function batchBurnFraction(address account, uint256[] memory tokenIDs) external { + return; + } + + /// @dev Returns the `units` held by a (fractional) token at `claimID` + /// @dev If `tokenID` is a base type, the total amount of `units` for the claim is returned. + /// @dev If `tokenID` is a fractional token, the `units` held by the token is returned + function unitsOf(uint256 tokenID) external view virtual returns (uint256 units) { + return 0; + } + + /// @dev Returns the `units` held by `account` of a (fractional) token at `claimID` + /// @dev If `tokenID` is a base type, the total amount of `units` held by `account` for the claim is returned. + /// @dev If `tokenID` is a fractional token, the `units` held by `account` the token is returned + function unitsOf(address account, uint256 tokenID) external view virtual returns (uint256 units) { + return 0; + } + + /// @dev Returns the `uri` for metadata of the claim represented by `tokenID` + /// @dev Metadata must conform to { Hypercert Metadata } spec (based on ERC1155 Metadata) + function uri(uint256 tokenID) external view returns (string memory metadata) { + return "metadata"; + } + + function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { + return interfaceId == type(IHypercertToken).interfaceId; + } +} diff --git a/contracts/test/mock/MockHypercertMinterSupportsNoInterface.sol b/contracts/test/mock/MockHypercertMinterSupportsNoInterface.sol new file mode 100644 index 00000000..4f2aac87 --- /dev/null +++ b/contracts/test/mock/MockHypercertMinterSupportsNoInterface.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {MockHypercertMinter} from "./MockHypercertMinter.sol"; + +contract MockHypercertMinterSupportsNoInterface is MockHypercertMinter { + function supportsInterface(bytes4) public view virtual override returns (bool) { + return false; + } +} diff --git a/contracts/test/mock/MockHypercertMinterUUPS.sol b/contracts/test/mock/MockHypercertMinterUUPS.sol new file mode 100644 index 00000000..e883600e --- /dev/null +++ b/contracts/test/mock/MockHypercertMinterUUPS.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.16; + +import {HypercertMinter} from "@hypercerts/protocol/HypercertMinter.sol"; +import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; + +contract UUPSProxy is ERC1967Proxy { + constructor(address implementation, bytes memory data) ERC1967Proxy(implementation, data) {} +} + +contract MockHypercertMinterUUPS { + HypercertMinter public instance; + UUPSProxy public proxy; + HypercertMinter public minter; + + function setUp() public { + instance = new HypercertMinter(); + proxy = new UUPSProxy(address(instance), ""); + minter = HypercertMinter(address(proxy)); + } +} diff --git a/contracts/test/mock/MockHypercertMinterWithoutAnyBalanceOf.sol b/contracts/test/mock/MockHypercertMinterWithoutAnyBalanceOf.sol new file mode 100644 index 00000000..d8743699 --- /dev/null +++ b/contracts/test/mock/MockHypercertMinterWithoutAnyBalanceOf.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {HypercertMinter} from "@hypercerts/protocol/HypercertMinter.sol"; + +contract MockHypercertMinterWithoutAnyBalanceOf is HypercertMinter { + constructor() HypercertMinter() {} + + function balanceOf(address, uint256) public view virtual override returns (uint256) { + revert("Not implemented"); + } +} diff --git a/contracts/test/mock/MockHypercertMinterWithoutAnyUnitsOf.sol b/contracts/test/mock/MockHypercertMinterWithoutAnyUnitsOf.sol new file mode 100644 index 00000000..d50128f4 --- /dev/null +++ b/contracts/test/mock/MockHypercertMinterWithoutAnyUnitsOf.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +import {MockHypercertMinter} from "./MockHypercertMinter.sol"; + +contract MockHypercertMinterWithoutAnyUnitsOf is MockHypercertMinter { + function unitsOf(address, uint256) public view virtual override returns (uint256) { + revert("Not implemented"); + } +} diff --git a/contracts/test/mock/MockRoyaltyFeeRegistry.sol b/contracts/test/mock/MockRoyaltyFeeRegistry.sol new file mode 100644 index 00000000..d9700825 --- /dev/null +++ b/contracts/test/mock/MockRoyaltyFeeRegistry.sol @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.17; + +// LooksRare unopinionated libraries +import {OwnableTwoSteps} from "@looksrare/contracts-libs/contracts/OwnableTwoSteps.sol"; + +// Royalty Fee Registry interface +import {IRoyaltyFeeRegistry} from "@hypercerts/marketplace/interfaces/IRoyaltyFeeRegistry.sol"; + +// Constants +import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/NumericConstants.sol"; + +/** + * @title MockRoyaltyFeeRegistry + * @notice It is a royalty fee registry for the LooksRare exchange. + * @dev The original one used the standard Ownable library from OpenZeppelin. + */ +contract MockRoyaltyFeeRegistry is IRoyaltyFeeRegistry, OwnableTwoSteps { + struct FeeInfo { + address setter; + address receiver; + uint256 fee; + } + + // Limit (if enforced for fee royalty in basis point (10,000 = 100%) + uint256 public royaltyFeeLimit; + + mapping(address => FeeInfo) private _royaltyFeeInfoCollection; + + event NewRoyaltyFeeLimit(uint256 royaltyFeeLimit); + event RoyaltyFeeUpdate(address indexed collection, address indexed setter, address indexed receiver, uint256 fee); + + /** + * @notice Constructor + * @param _owner Owner address + * @param _royaltyFeeLimit new royalty fee limit (500 = 5%, 1,000 = 10%) + */ + constructor(address _owner, uint256 _royaltyFeeLimit) OwnableTwoSteps(_owner) { + require(_royaltyFeeLimit <= 9500, "Owner: Royalty fee limit too high"); + royaltyFeeLimit = _royaltyFeeLimit; + } + + /** + * @notice Update royalty info for collection + * @param _royaltyFeeLimit new royalty fee limit (500 = 5%, 1,000 = 10%) + */ + function updateRoyaltyFeeLimit(uint256 _royaltyFeeLimit) external onlyOwner { + require(_royaltyFeeLimit <= 9500, "Owner: Royalty fee limit too high"); + royaltyFeeLimit = _royaltyFeeLimit; + + emit NewRoyaltyFeeLimit(_royaltyFeeLimit); + } + + /** + * @notice Update royalty info for collection + * @param collection address of the NFT contract + * @param setter address that sets the receiver + * @param receiver receiver for the royalty fee + * @param fee fee (500 = 5%, 1,000 = 10%) + */ + function updateRoyaltyInfoForCollection(address collection, address setter, address receiver, uint256 fee) + external + onlyOwner + { + require(fee <= royaltyFeeLimit, "Registry: Royalty fee too high"); + _royaltyFeeInfoCollection[collection] = FeeInfo({setter: setter, receiver: receiver, fee: fee}); + + emit RoyaltyFeeUpdate(collection, setter, receiver, fee); + } + + /** + * @notice Calculate royalty info for a collection address and a sale gross amount + * @param collection collection address + * @param amount amount + * @return receiver address and amount received by royalty recipient + */ + function royaltyInfo(address collection, uint256 amount) external view returns (address, uint256) { + return ( + _royaltyFeeInfoCollection[collection].receiver, + (amount * _royaltyFeeInfoCollection[collection].fee) / ONE_HUNDRED_PERCENT_IN_BP + ); + } + + /** + * @notice View royalty info for a collection address + * @param collection collection address + */ + function royaltyFeeInfoCollection(address collection) external view returns (address, address, uint256) { + return ( + _royaltyFeeInfoCollection[collection].setter, + _royaltyFeeInfoCollection[collection].receiver, + _royaltyFeeInfoCollection[collection].fee + ); + } +} diff --git a/contracts/test/mock/MockSmartWallet.sol b/contracts/test/mock/MockSmartWallet.sol new file mode 100644 index 00000000..77d02b61 --- /dev/null +++ b/contracts/test/mock/MockSmartWallet.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.17; + +contract MockSmartWallet { + address public owner; + + bytes4 internal constant MAGICVALUE = bytes4(keccak256("isValidSignature(bytes32,bytes)")); + + modifier onlyOwner() { + if (msg.sender != owner) { + revert("Unauthorized"); + } + _; + } + + constructor() { + owner = msg.sender; + } + + receive() external payable {} + + function transferOwnership(address _newOwner) external onlyOwner { + owner = _newOwner; + } + + function executeBatch(address[] calldata dest, bytes[] calldata calldata_) external onlyOwner { + if (dest.length != calldata_.length) { + revert("Invalid array length"); + } + for (uint256 i = 0; i < dest.length; ++i) { + execute(dest[i], 0, calldata_[i]); + } + } + + function isValidSignature(bytes32 _hash, bytes memory _signature) external view returns (bytes4 magicValue) { + bytes32 r; + bytes32 s; + uint8 v; + + assembly { + r := mload(add(_signature, 0x20)) + s := mload(add(_signature, 0x40)) + v := byte(0, mload(add(_signature, 0x60))) + } + address recovered = ecrecover(_hash, v, r, s); + if (recovered == address(0)) { + revert("Invalid signature"); + } + if (owner != recovered) { + revert("Invalid signer"); + } + + return MAGICVALUE; + } + + function execute(address dest, uint256 value, bytes calldata calldata_) public onlyOwner { + (bool success, bytes memory result) = dest.call{value: value}(calldata_); + + if (!success) { + assembly { + revert(add(result, 32), mload(result)) + } + } + } +} diff --git a/contracts/tsconfig.build.json b/contracts/tsconfig.build.json index d2a57421..e9929279 100644 --- a/contracts/tsconfig.build.json +++ b/contracts/tsconfig.build.json @@ -22,11 +22,17 @@ }, "include": ["./src"], "files": [ - "src/abi/HypercertMinter.json", - "src/types/src/AllowlistMinter.ts", - "src/types/src/HypercertMinter.ts", - "src/types/src/interfaces/IAllowlist.ts", - "src/types/src/interfaces/IHypercertToken.ts", - "src/types/src/libs/Errors.ts" + "types/src/marketplace/CurrencyManager.ts", + "types/src/marketplace/ExecutionManager.ts", + "types/src/marketplace/LooksRareProtocol.ts", + "types/src/marketplace/NonceManager.ts", + "types/src/marketplace/helpers/OrderValidatorV2A.ts", + "types/src/marketplace/StrategyManager.ts", + "types/src/marketplace/TransferManager.ts", + "types/src/protocol/AllowlistMinter.ts", + "types/src/protocol/HypercertMinter.ts", + "types/src/protocol/interfaces/IAllowlist.ts", + "types/src/protocol/interfaces/IHypercertToken.ts", + "types/src/protocol/libs/Errors.ts" ] } diff --git a/contracts/tsconfig.json b/contracts/tsconfig.json index 8d0a6cfc..a3e3d8dc 100644 --- a/contracts/tsconfig.json +++ b/contracts/tsconfig.json @@ -20,14 +20,19 @@ "target": "ESNext", "outDir": "dist" }, - "include": ["./tasks", "./test", "./types", "./src"], + "include": ["./tasks", "./test", "./src"], "files": [ - "hardhat.config.ts", - "src/abi/HypercertMinter.json", - "src/types/src/AllowlistMinter.ts", - "src/types/src/HypercertMinter.ts", - "src/types/src/interfaces/IAllowlist.ts", - "src/types/src/interfaces/IHypercertToken.ts", - "src/types/src/libs/Errors.ts" + "types/src/marketplace/CurrencyManager.ts", + "types/src/marketplace/ExecutionManager.ts", + "types/src/marketplace/LooksRareProtocol.ts", + "types/src/marketplace/NonceManager.ts", + "types/src/marketplace/helpers/OrderValidatorV2A.ts", + "types/src/marketplace/StrategyManager.ts", + "types/src/marketplace/TransferManager.ts", + "types/src/protocol/AllowlistMinter.ts", + "types/src/protocol/HypercertMinter.ts", + "types/src/protocol/interfaces/IAllowlist.ts", + "types/src/protocol/interfaces/IHypercertToken.ts", + "types/src/protocol/libs/Errors.ts" ] } diff --git a/cors-proxy/src/index.ts b/cors-proxy/src/index.ts index e88e6e3d..aaa9a400 100644 --- a/cors-proxy/src/index.ts +++ b/cors-proxy/src/index.ts @@ -69,6 +69,9 @@ export default { // Rewrite request to point to API URL. This also makes the request mutable // so you can add the correct Origin header to make the API server think // that this request is not cross-site. + // TODO: Never use ts ignore + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore request = new Request(apiUrl, request); request.headers.set("Origin", new URL(apiUrl).origin); let response = await fetch(request); diff --git a/defender/.eslintrc.yml b/defender/.eslintrc.yml index fb4528bd..07ab4df0 100644 --- a/defender/.eslintrc.yml +++ b/defender/.eslintrc.yml @@ -9,7 +9,7 @@ parserOptions: plugins: - "@typescript-eslint" root: true -ignorePatterns: ["rollup.config.js", "jest.config.ts", "build/"] +ignorePatterns: ["build/"] rules: "@typescript-eslint/semi": - warn diff --git a/defender/package.json b/defender/package.json index f2da4c70..2d8a57f4 100644 --- a/defender/package.json +++ b/defender/package.json @@ -14,10 +14,10 @@ }, "dependencies": { "@hypercerts-org/contracts": "0.8.11", - "@openzeppelin/defender-autotask-client": "^1.48.0", - "@openzeppelin/defender-autotask-utils": "^1.48.0", - "@openzeppelin/defender-base-client": "^1.48.0", - "@openzeppelin/defender-sentinel-client": "^1.48.0", + "@openzeppelin/defender-autotask-client": "1.50.0", + "@openzeppelin/defender-autotask-utils": "1.50.0", + "@openzeppelin/defender-base-client": "1.49.0", + "@openzeppelin/defender-sentinel-client": "1.49.0", "@openzeppelin/merkle-tree": "^1.0.2", "@supabase/supabase-js": "^2.4.1", "axios": "^1.2.6", diff --git a/defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts b/defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts index 558983f6..578f6aa8 100644 --- a/defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts +++ b/defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts @@ -13,14 +13,6 @@ import { BigNumber, ethers } from "ethers"; import fetch from "node-fetch"; export async function handler(event: AutotaskEvent) { - console.log( - "Event: ", - JSON.stringify( - { ...event, secrets: "HIDDEN", credentials: "HIDDEN" }, - null, - 2, - ), - ); const network = getNetworkConfigFromName(event.autotaskName); const { SUPABASE_URL, SUPABASE_SECRET_API_KEY } = event.secrets; const ALCHEMY_KEY = event.secrets[network.alchemyKeyEnvName]; diff --git a/defender/src/networks.ts b/defender/src/networks.ts index ffbc1fba..80aa187b 100644 --- a/defender/src/networks.ts +++ b/defender/src/networks.ts @@ -30,7 +30,6 @@ export const NETWORKS: SupportedNetworks = { { networkKey: "sepolia", contractAddress: "0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941", - alchemyKeyEnvName: "ALCHEMY_SEPOLIA_KEY", chainId: 11155111, rpc: "https://rpc.sepolia.org", }, diff --git a/defender/src/update.ts b/defender/src/update.ts index 874b2d00..f7fbf463 100644 --- a/defender/src/update.ts +++ b/defender/src/update.ts @@ -27,8 +27,9 @@ export const updateAutotask = async (networks: NetworkConfig[]) => { autotaskClient .updateCodeFromFolder(autoTask.autotaskId, `./build/relay/${name}`) - .then((_) => { + .then((res) => { console.log(`Updated ${autoTask.autotaskId}`); + console.log(res); }) .catch((err) => { console.error(`Failed to update ${autoTask.autotaskId}`); @@ -67,8 +68,9 @@ export const updateSentinel = async (networks: NetworkConfig[]) => { addresses: [network.contractAddress], abi, }) - .then((_) => { + .then((res) => { console.log(`Updated: ", ${sentinel.subscriberId}`); + console.log(res); }) .catch((err) => { console.error(`Failed to update ${sentinel.subscriberId}`); diff --git a/docs/.eslintrc.yml b/docs/.eslintrc.yml new file mode 100644 index 00000000..c1258f9f --- /dev/null +++ b/docs/.eslintrc.yml @@ -0,0 +1,27 @@ +extends: + - "eslint:recommended" + - "plugin:@typescript-eslint/eslint-recommended" + - "plugin:@typescript-eslint/recommended" + - "prettier" +parser: "@typescript-eslint/parser" +parserOptions: + project: "./docs/tsconfig.json" +plugins: + - "@docusaurus" + - "@typescript-eslint" +root: true +ignorePatterns: ["build/"] +rules: + "@typescript-eslint/semi": + - warn + "@typescript-eslint/switch-exhaustiveness-check": + - warn + "@typescript-eslint/no-floating-promises": + - error + - ignoreIIFE: true + ignoreVoid: true + "@typescript-eslint/no-inferrable-types": "off" + "@typescript-eslint/no-unused-vars": + - error + - argsIgnorePattern: "_" + varsIgnorePattern: "_" diff --git a/docs/docs/developer/api/contracts/HypercertMinter.md b/docs/docs/developer/api/contracts/HypercertMinter.md index 785dd5cf..518efa42 100644 --- a/docs/docs/developer/api/contracts/HypercertMinter.md +++ b/docs/docs/developer/api/contracts/HypercertMinter.md @@ -60,6 +60,23 @@ _See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have t | ---- | --------- | ----------- | | \_0 | uint256[] | undefined | +### batchBurnFraction + +```solidity +function batchBurnFraction(address _account, uint256[] _tokenIDs) external nonpayable +``` + +Burn a claimtoken + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ----------- | +| \_account | address | undefined | +| \_tokenIDs | uint256[] | undefined | + ### batchMintClaimsFromAllowlists ```solidity @@ -82,30 +99,38 @@ _Calls AllowlistMinter to verify `proofs`.Mints the `amount` of units for the hy ### burn ```solidity -function burn(address account, uint256 id, uint256 value) external nonpayable +function burn(address account, uint256 id, uint256) external nonpayable ``` +Burn a claimtoken; override is needed to update units/values + +_see {ERC1155Burnable}_ + #### Parameters | Name | Type | Description | | ------- | ------- | ----------- | | account | address | undefined | | id | uint256 | undefined | -| value | uint256 | undefined | +| \_2 | uint256 | undefined | ### burnBatch ```solidity -function burnBatch(address account, uint256[] ids, uint256[] values) external nonpayable +function burnBatch(address account, uint256[] ids, uint256[]) external nonpayable ``` +Batch burn claimtokens; override is needed to update units/values + +_see {ERC1155Burnable}_ + #### Parameters | Name | Type | Description | | ------- | --------- | ----------- | | account | address | undefined | | ids | uint256[] | undefined | -| values | uint256[] | undefined | +| \_2 | uint256[] | undefined | ### burnFraction @@ -319,19 +344,19 @@ _Returns the address of the current owner._ function ownerOf(uint256 tokenID) external view returns (address _owner) ``` -READ +_Returns the owner of a given token ID._ #### Parameters -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| tokenID | uint256 | The ID of the token to query. | #### Returns -| Name | Type | Description | -| ------- | ------- | ----------- | -| \_owner | address | undefined | +| Name | Type | Description | +| ------- | ------- | -------------------------------------- | +| \_owner | address | The address of the owner of the token. | ### pause diff --git a/docs/docs/developer/api/contracts/HypercertTrader.md b/docs/docs/developer/api/contracts/HypercertTrader.md new file mode 100644 index 00000000..e31e8840 --- /dev/null +++ b/docs/docs/developer/api/contracts/HypercertTrader.md @@ -0,0 +1,434 @@ +# HypercertTrader + +_bitbeckers_ + +> Contract for managing hypercert trades + +Implementation of the HypercertTrader Interface + +## Methods + +### batchBuyUnits + +```solidity +function batchBuyUnits(address recipient, uint256[] offerIDs, uint256[] unitAmounts, address[] buyTokens, uint256[] tokenAmountsPerUnit) external payable +``` + +This function allows a user to buy Hypercert tokens from multiple existing offers in a single transaction. The function takes in several arrays of parameters, including the IDs of the offers to buy from, the number of units to buy for each offer, the tokens used for payment for each offer, and the amounts of tokens to pay per unit for each offer. The function then executes the trades and transfers the Hypercert tokens to the specified recipient. + +_Buys Hypercert tokens from multiple existing offers in a single transaction._ + +#### Parameters + +| Name | Type | Description | +| ------------------- | --------- | -------------------------------------------------------------------- | +| recipient | address | The address that will receive the Hypercert tokens. | +| offerIDs | uint256[] | The list of IDs of the offers to buy from. | +| unitAmounts | uint256[] | The list of numbers of units to buy for each offer. | +| buyTokens | address[] | The list of addresses of the tokens used for payment for each offer. | +| tokenAmountsPerUnit | uint256[] | The list of amounts of tokens to pay per unit for each offer. | + +### buyUnits + +```solidity +function buyUnits(address recipient, uint256 offerID, uint256 unitAmount, address buyToken, uint256 tokenAmountPerUnit) external payable +``` + +This function buys Hypercert tokens from an existing offer. The function verifies that the offer is valid and that the buyer has provided enough payment in the specified token. If the offer is for a fraction of a Hypercert token, the function splits the fraction and transfers the appropriate number of units to the buyer. If the offer is for a fixed number of units, the function transfers the units to the buyer. The function also transfers the payment to the offerer and emits a `Trade` event. + +_Buys Hypercert tokens from an existing offer._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | --------------------------------------------------- | +| recipient | address | The address that will receive the Hypercert tokens. | +| offerID | uint256 | The ID of the offer to buy from. | +| unitAmount | uint256 | The number of units to buy. | +| buyToken | address | The address of the token used for payment. | +| tokenAmountPerUnit | uint256 | The amount of tokens to pay per unit. | + +### cancelOffer + +```solidity +function cancelOffer(uint256 offerID) external nonpayable +``` + +This function cancels an existing offer. The function verifies that the offer exists and that the caller is the offerer. The function sets the offer status to `Cancelled` and emits an `OfferCancelled` event. + +_Cancels an existing offer._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------------ | +| offerID | uint256 | The ID of the offer to cancel. | + +### createOffer + +```solidity +function createOffer(address hypercertContract, uint256 fractionID, uint256 unitsForSale, uint256 minUnitsPerTrade, uint256 maxUnitsPerTrade, IHypercertTrader.AcceptedToken[] acceptedTokens) external payable returns (uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------- | -------------------------------- | ----------- | +| hypercertContract | address | undefined | +| fractionID | uint256 | undefined | +| unitsForSale | uint256 | undefined | +| minUnitsPerTrade | uint256 | undefined | +| maxUnitsPerTrade | uint256 | undefined | +| acceptedTokens | IHypercertTrader.AcceptedToken[] | undefined | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | ----------- | +| offerID | uint256 | undefined | + +### getOffer + +```solidity +function getOffer(uint256 offerID) external view returns (struct IHypercertTrader.Offer) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| offerID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------- | ----------- | +| \_0 | IHypercertTrader.Offer | undefined | + +### initialize + +```solidity +function initialize() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### offers + +```solidity +function offers(uint256) external view returns (address offerer, address hypercertContract, uint256 fractionID, uint256 unitsAvailable, uint256 minUnitsPerTrade, uint256 maxUnitsPerTrade, enum IHypercertTrader.OfferType offerType, enum IHypercertTrader.OfferStatus status) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----------------- | --------------------------------- | ----------- | +| offerer | address | undefined | +| hypercertContract | address | undefined | +| fractionID | uint256 | undefined | +| unitsAvailable | uint256 | undefined | +| minUnitsPerTrade | uint256 | undefined | +| maxUnitsPerTrade | uint256 | undefined | +| offerType | enum IHypercertTrader.OfferType | undefined | +| status | enum IHypercertTrader.OfferStatus | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +_Returns the address of the current owner._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### pause + +```solidity +function pause() external nonpayable +``` + +PAUSABLE + +### paused + +```solidity +function paused() external view returns (bool) +``` + +_Returns true if the contract is paused, and false otherwise._ + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### proxiableUUID + +```solidity +function proxiableUUID() external view returns (bytes32) +``` + +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ + +### totalUnitsForSale + +```solidity +function totalUnitsForSale(address, uint256) external view returns (uint256) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### unpause + +```solidity +function unpause() external nonpayable +``` + +### upgradeTo + +```solidity +function upgradeTo(address newImplementation) external nonpayable +``` + +_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | + +### upgradeToAndCall + +```solidity +function upgradeToAndCall(address newImplementation, bytes data) external payable +``` + +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | + +## Events + +### AdminChanged + +```solidity +event AdminChanged(address previousAdmin, address newAdmin) +``` + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | ----------- | +| previousAdmin | address | undefined | +| newAdmin | address | undefined | + +### BeaconUpgraded + +```solidity +event BeaconUpgraded(address indexed beacon) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| beacon `indexed` | address | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ----- | ----------- | +| version | uint8 | undefined | + +### OfferCancelled + +```solidity +event OfferCancelled(address indexed creator, address indexed hypercertContract, uint256 indexed fractionID, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| creator `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID `indexed` | uint256 | undefined | +| offerID | uint256 | undefined | + +### OfferCreated + +```solidity +event OfferCreated(address indexed offerer, address indexed hypercertContract, uint256 indexed fractionID, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| offerer `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID `indexed` | uint256 | undefined | +| offerID | uint256 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### Paused + +```solidity +event Paused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### Trade + +```solidity +event Trade(address indexed seller, address indexed buyer, address indexed hypercertContract, uint256 fractionID, uint256 unitsBought, address buyToken, uint256 tokenAmountPerUnit, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| seller `indexed` | address | undefined | +| buyer `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID | uint256 | undefined | +| unitsBought | uint256 | undefined | +| buyToken | address | undefined | +| tokenAmountPerUnit | uint256 | undefined | +| offerID | uint256 | undefined | + +### Unpaused + +```solidity +event Unpaused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### Upgraded + +```solidity +event Upgraded(address indexed implementation) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | + +## Errors + +### InvalidBuy + +```solidity +error InvalidBuy(string) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### InvalidOffer + +```solidity +error InvalidOffer(string) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### NotAllowed + +```solidity +error NotAllowed() +``` diff --git a/docs/docs/developer/api/contracts/IHypercertMinter.md b/docs/docs/developer/api/contracts/IHypercertMinter.md new file mode 100644 index 00000000..13a84632 --- /dev/null +++ b/docs/docs/developer/api/contracts/IHypercertMinter.md @@ -0,0 +1,39 @@ +# IHypercertMinter + +## Methods + +### ownerOf + +```solidity +function ownerOf(uint256 id) external view returns (address) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### unitsOf + +```solidity +function unitsOf(uint256 id) external view returns (uint256) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | diff --git a/docs/docs/developer/api/contracts/SemiFungible1155.md b/docs/docs/developer/api/contracts/SemiFungible1155.md index 444dfe22..a4086e37 100644 --- a/docs/docs/developer/api/contracts/SemiFungible1155.md +++ b/docs/docs/developer/api/contracts/SemiFungible1155.md @@ -129,19 +129,19 @@ _Returns the address of the current owner._ function ownerOf(uint256 tokenID) external view returns (address _owner) ``` -READ +_Returns the owner of a given token ID._ #### Parameters -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| tokenID | uint256 | The ID of the token to query. | #### Returns -| Name | Type | Description | -| ------- | ------- | ----------- | -| \_owner | address | undefined | +| Name | Type | Description | +| ------- | ------- | -------------------------------------- | +| \_owner | address | The address of the owner of the token. | ### proxiableUUID @@ -285,19 +285,19 @@ _Upgrade the implementation of the proxy to `newImplementation`, and subsequentl function uri(uint256 tokenID) external view returns (string _uri) ``` -_see { openzeppelin-contracts-upgradeable/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol }Always returns the URI for the basetype so that it's managed in one place._ +_Returns the metadata URI for a given token ID.This function retrieves the metadata URI for the specified token ID by calling the `uri` function of the `ERC1155URIStorageUpgradeable` contract.The metadata URI is a string that points to a JSON file containing information about the token, such as its name, symbol, and image.This function always returns the URI for the basetype so that it's managed in one place._ #### Parameters -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------------------------------------------------- | +| tokenID | uint256 | The ID of the token to retrieve the metadata URI for. | #### Returns -| Name | Type | Description | -| ----- | ------ | ----------- | -| \_uri | string | undefined | +| Name | Type | Description | +| ----- | ------ | -------------------------------------------- | +| \_uri | string | The metadata URI for the specified token ID. | ## Events diff --git a/docs/docs/developer/api/contracts/ainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.md b/docs/docs/developer/api/contracts/ainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.md new file mode 100644 index 00000000..6be07157 --- /dev/null +++ b/docs/docs/developer/api/contracts/ainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.md @@ -0,0 +1,77 @@ +# AggregatorV3Interface + +## Methods + +### decimals + +```solidity +function decimals() external view returns (uint8) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ----- | ----------- | +| \_0 | uint8 | undefined | + +### description + +```solidity +function description() external view returns (string) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### getRoundData + +```solidity +function getRoundData(uint80 _roundId) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) +``` + +#### Parameters + +| Name | Type | Description | +| --------- | ------ | ----------- | +| \_roundId | uint80 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| roundId | uint80 | undefined | +| answer | int256 | undefined | +| startedAt | uint256 | undefined | +| updatedAt | uint256 | undefined | +| answeredInRound | uint80 | undefined | + +### latestRoundData + +```solidity +function latestRoundData() external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) +``` + +#### Returns + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| roundId | uint80 | undefined | +| answer | int256 | undefined | +| startedAt | uint256 | undefined | +| updatedAt | uint256 | undefined | +| answeredInRound | uint80 | undefined | + +### version + +```solidity +function version() external view returns (uint256) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | diff --git a/docs/docs/developer/api/contracts/forge-std/src/console.md b/docs/docs/developer/api/contracts/forge-std/src/console.md new file mode 100644 index 00000000..8d14ad8c --- /dev/null +++ b/docs/docs/developer/api/contracts/forge-std/src/console.md @@ -0,0 +1 @@ +# console diff --git a/docs/docs/developer/api/contracts/forge-std/src/console2.md b/docs/docs/developer/api/contracts/forge-std/src/console2.md new file mode 100644 index 00000000..cb666cd3 --- /dev/null +++ b/docs/docs/developer/api/contracts/forge-std/src/console2.md @@ -0,0 +1,3 @@ +# console2 + +_The original console.sol uses `int` and `uint` for computing function selectors, but it should use `int256` and `uint256`. This modified version fixes that. This version is recommended over `console.sol` if you don't need compatibility with Hardhat as the logs will show up in forge stack traces. If you do need compatibility with Hardhat, you must use `console.sol`. Reference: https://github.com/NomicFoundation/hardhat/issues/2178_ diff --git a/docs/docs/developer/api/contracts/interfaces/IHypercertToken.md b/docs/docs/developer/api/contracts/interfaces/IHypercertToken.md index 6bd5a931..30ed6f95 100644 --- a/docs/docs/developer/api/contracts/interfaces/IHypercertToken.md +++ b/docs/docs/developer/api/contracts/interfaces/IHypercertToken.md @@ -8,6 +8,23 @@ This interface declares the required functionality for a hypercert tokenThis int ## Methods +### batchBurnFraction + +```solidity +function batchBurnFraction(address account, uint256[] tokenIDs) external nonpayable +``` + +Operator must be allowed by `creator` and the tokens must represent the total amount of available units. + +_Function to burn the tokens at `tokenIDs` for `account`_ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenIDs | uint256[] | undefined | + ### burnFraction ```solidity diff --git a/docs/docs/developer/api/contracts/interfaces/IHypercertTrader.md b/docs/docs/developer/api/contracts/interfaces/IHypercertTrader.md new file mode 100644 index 00000000..06fb700c --- /dev/null +++ b/docs/docs/developer/api/contracts/interfaces/IHypercertTrader.md @@ -0,0 +1,133 @@ +# IHypercertTrader + +_bitbeckers_ + +> Interface for hypercert token trading + +This interface declares the required functionality to interact with the hypercert marketplace + +## Methods + +### batchBuyUnits + +```solidity +function batchBuyUnits(address recipient, uint256[] offerIDs, uint256[] unitAmounts, address[] buyTokens, uint256[] tokenAmountsPerUnit) external payable +``` + +_Buys Hypercert tokens from multiple existing offers in a single transaction._ + +#### Parameters + +| Name | Type | Description | +| ------------------- | --------- | -------------------------------------------------------------------- | +| recipient | address | The address that will receive the Hypercert tokens. | +| offerIDs | uint256[] | The list of IDs of the offers to buy from. | +| unitAmounts | uint256[] | The list of numbers of units to buy for each offer. | +| buyTokens | address[] | The list of addresses of the tokens used for payment for each offer. | +| tokenAmountsPerUnit | uint256[] | The list of amounts of tokens to pay per unit for each offer. | + +### buyUnits + +```solidity +function buyUnits(address recipient, uint256 offerID, uint256 unitAmount, address buyToken, uint256 tokenAmountPerUnit) external payable +``` + +_Buys Hypercert tokens from an existing offer._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | --------------------------------------------------- | +| recipient | address | The address that will receive the Hypercert tokens. | +| offerID | uint256 | The ID of the offer to buy from. | +| unitAmount | uint256 | The number of units to buy. | +| buyToken | address | The address of the token used for payment. | +| tokenAmountPerUnit | uint256 | The amount of tokens to pay per unit. | + +### cancelOffer + +```solidity +function cancelOffer(uint256 offerID) external nonpayable +``` + +_Cancels an existing offer._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------------ | +| offerID | uint256 | The ID of the offer to cancel. | + +### createOffer + +```solidity +function createOffer(address hypercertContract, uint256 fractionID, uint256 units, uint256 minUnitsPerTrade, uint256 maxUnitsPerTrade, IHypercertTrader.AcceptedToken[] acceptedTokens) external payable returns (uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------- | -------------------------------- | ----------- | +| hypercertContract | address | undefined | +| fractionID | uint256 | undefined | +| units | uint256 | undefined | +| minUnitsPerTrade | uint256 | undefined | +| maxUnitsPerTrade | uint256 | undefined | +| acceptedTokens | IHypercertTrader.AcceptedToken[] | undefined | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | ----------- | +| offerID | uint256 | undefined | + +## Events + +### OfferCancelled + +```solidity +event OfferCancelled(address indexed creator, address indexed hypercertContract, uint256 indexed fractionID, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| creator `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID `indexed` | uint256 | undefined | +| offerID | uint256 | undefined | + +### OfferCreated + +```solidity +event OfferCreated(address indexed offerer, address indexed hypercertContract, uint256 indexed fractionID, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| offerer `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID `indexed` | uint256 | undefined | +| offerID | uint256 | undefined | + +### Trade + +```solidity +event Trade(address indexed seller, address indexed buyer, address indexed hypercertContract, uint256 fractionID, uint256 unitsBought, address buyToken, uint256 tokenAmountPerUnit, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| seller `indexed` | address | undefined | +| buyer `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID | uint256 | undefined | +| unitsBought | uint256 | undefined | +| buyToken | address | undefined | +| tokenAmountPerUnit | uint256 | undefined | +| offerID | uint256 | undefined | diff --git a/docs/docs/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md b/docs/docs/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md new file mode 100644 index 00000000..4cb96bfc --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md @@ -0,0 +1,46 @@ +# BatchOrderTypehashRegistry + +_LooksRare protocol team (👀,💎)_ + +> BatchOrderTypehashRegistry + +The contract generates the batch order hash that is used to compute the digest for signature verification. + +## Methods + +### hashBatchOrder + +```solidity +function hashBatchOrder(bytes32 root, uint256 proofLength) external pure returns (bytes32 batchOrderHash) +``` + +This function returns the hash of the concatenation of batch order type hash and merkle root. + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ------------------- | +| root | bytes32 | Merkle root | +| proofLength | uint256 | Merkle proof length | + +#### Returns + +| Name | Type | Description | +| -------------- | ------- | -------------------- | +| batchOrderHash | bytes32 | The batch order hash | + +## Errors + +### MerkleProofTooLarge + +```solidity +error MerkleProofTooLarge(uint256 length) +``` + +It is returned if the length of the merkle proof provided is greater than tolerated. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ------------ | +| length | uint256 | Proof length | diff --git a/docs/docs/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md b/docs/docs/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md new file mode 100644 index 00000000..a32aef65 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md @@ -0,0 +1,76 @@ +# CreatorFeeManagerWithRebates + +_LooksRare protocol team (👀,💎)_ + +> CreatorFeeManagerWithRebates + +This contract returns the creator fee address and the creator rebate amount. + +## Methods + +### STANDARD_ROYALTY_FEE_BP + +```solidity +function STANDARD_ROYALTY_FEE_BP() external view returns (uint256) +``` + +Standard royalty fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### royaltyFeeRegistry + +```solidity +function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry) +``` + +Royalty fee registry interface. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | contract IRoyaltyFeeRegistry | undefined | + +### viewCreatorFeeInfo + +```solidity +function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) +``` + +This function returns the creator address and calculates the creator fee amount. + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| price | uint256 | Transaction price | +| itemIds | uint256[] | Array of item ids | + +#### Returns + +| Name | Type | Description | +| ---------------- | ------- | ------------------ | +| creator | address | Creator address | +| creatorFeeAmount | uint256 | Creator fee amount | + +## Errors + +### BundleEIP2981NotAllowed + +```solidity +error BundleEIP2981NotAllowed(address collection) +``` + +It is returned if the bundle contains multiple itemIds with different creator fee structure. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| collection | address | undefined | diff --git a/docs/docs/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md b/docs/docs/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md new file mode 100644 index 00000000..41cab900 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md @@ -0,0 +1,64 @@ +# CreatorFeeManagerWithRoyalties + +_LooksRare protocol team (👀,💎)_ + +> CreatorFeeManagerWithRoyalties + +This contract returns the creator fee address and the creator fee amount. + +## Methods + +### royaltyFeeRegistry + +```solidity +function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry) +``` + +Royalty fee registry interface. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | contract IRoyaltyFeeRegistry | undefined | + +### viewCreatorFeeInfo + +```solidity +function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) +``` + +This function returns the creator address and calculates the creator fee amount. + +_There are two on-chain sources for the royalty fee to distribute. 1. RoyaltyFeeRegistry: It is an on-chain registry where creator fee is defined for all items of a collection. 2. ERC2981: The NFT Royalty Standard where royalty fee is defined at a itemId level in a collection. The on-chain logic looks up the registry first. If it does not find anything, it checks if a collection is ERC2981. If so, it fetches the proper royalty information for the itemId. For a bundle that contains multiple itemIds (for a collection using ERC2981), if the royalty fee/recipient differ among the itemIds part of the bundle, the trade reverts. This contract DOES NOT enforce any restriction for extremely high creator fee, nor verifies the creator fee fetched is inferior to the total price. If any contract relies on it to build an on-chain royalty logic, it should implement protection against: (1) high royalties (2) potential unexpected royalty changes that can occur after the creation of the order._ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| price | uint256 | Transaction price | +| itemIds | uint256[] | Array of item ids | + +#### Returns + +| Name | Type | Description | +| ---------------- | ------- | ------------------ | +| creator | address | Creator address | +| creatorFeeAmount | uint256 | Creator fee amount | + +## Errors + +### BundleEIP2981NotAllowed + +```solidity +error BundleEIP2981NotAllowed(address collection) +``` + +It is returned if the bundle contains multiple itemIds with different creator fee structure. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| collection | address | undefined | diff --git a/docs/docs/developer/api/contracts/marketplace/CurrencyManager.md b/docs/docs/developer/api/contracts/marketplace/CurrencyManager.md new file mode 100644 index 00000000..9ff1c0fc --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/CurrencyManager.md @@ -0,0 +1,250 @@ +# CurrencyManager + +_LooksRare protocol team (👀,💎)_ + +> CurrencyManager + +This contract manages the list of valid fungible currencies. + +## Methods + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +## Errors + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/docs/developer/api/contracts/marketplace/ExecutionManager.md b/docs/docs/developer/api/contracts/marketplace/ExecutionManager.md new file mode 100644 index 00000000..83eefc37 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/ExecutionManager.md @@ -0,0 +1,751 @@ +# ExecutionManager + +_LooksRare protocol team (👀,💎); bitbeckers;_ + +> ExecutionManager + +This contract handles the execution and resolution of transactions. A transaction is executed on-chain when an off-chain maker order is matched by on-chain taker order of a different kind. For instance, a taker ask is executed against a maker bid (or a taker bid against a maker ask). + +## Methods + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### addStrategy + +```solidity +function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable +``` + +This function allows the owner to add a new execution strategy to the protocol. + +_Strategies have an id that is incremental. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------- | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the strategy | +| isMakerBid | bool | Whether the function selector is for maker bid | +| implementation | address | Implementation address | + +### cancelOrderNonces + +```solidity +function cancelOrderNonces(uint256[] orderNonces) external nonpayable +``` + +This function allows a user to cancel an array of order nonces. + +_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | --------------------- | +| orderNonces | uint256[] | Array of order nonces | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### cancelSubsetNonces + +```solidity +function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable +``` + +This function allows a user to cancel an array of subset nonces. + +_It does not check the status of the nonces to save gas._ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ---------------------- | +| subsetNonces | uint256[] | Array of subset nonces | + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### creatorFeeManager + +```solidity +function creatorFeeManager() external view returns (contract ICreatorFeeManager) +``` + +Creator fee manager. + +#### Returns + +| Name | Type | Description | +| ---- | --------------------------- | ----------- | +| \_0 | contract ICreatorFeeManager | undefined | + +### incrementBidAskNonces + +```solidity +function incrementBidAskNonces(bool bid, bool ask) external nonpayable +``` + +This function increments a user's bid/ask nonces. + +_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | --------------------------------------- | +| bid | bool | Whether to increment the user bid nonce | +| ask | bool | Whether to increment the user ask nonce | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### maxCreatorFeeBp + +```solidity +function maxCreatorFeeBp() external view returns (uint16) +``` + +Maximum creator fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | uint16 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### protocolFeeRecipient + +```solidity +function protocolFeeRecipient() external view returns (address) +``` + +Protocol fee recipient. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### strategyInfo + +```solidity +function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +This returns the strategy information for a strategy id. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### updateCreatorFeeManager + +```solidity +function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable +``` + +This function allows the owner to update the creator fee manager address. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ---------------------------------- | +| newCreatorFeeManager | address | Address of the creator fee manager | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +### updateMaxCreatorFeeBp + +```solidity +function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable +``` + +This function allows the owner to update the maximum creator fee (in basis point). + +_The maximum value that can be set is 25%. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------ | ---------------------------------------- | +| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | + +### updateProtocolFeeRecipient + +```solidity +function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable +``` + +This function allows the owner to update the protocol fee recipient. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ---------------------------------- | +| newProtocolFeeRecipient | address | New protocol fee recipient address | + +### updateStrategy + +```solidity +function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable +``` + +This function allows the owner to update parameters for an existing execution strategy. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------------------ | +| strategyId | uint256 | Strategy id | +| isActive | bool | Whether the strategy must be active | +| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | +| newMinTotalFee | uint16 | New minimum total fee (in basis point) | + +### userBidAskNonces + +```solidity +function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) +``` + +This tracks the bid and ask nonces for a user address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------- | ----------- | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### userOrderNonce + +```solidity +function userOrderNonce(address, uint256) external view returns (bytes32) +``` + +This checks whether the order nonce for a user was executed or cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### userSubsetNonce + +```solidity +function userSubsetNonce(address, uint256) external view returns (bool) +``` + +This checks whether the subset nonce for a user was cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| user | address | undefined | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### NewCreatorFeeManager + +```solidity +event NewCreatorFeeManager(address creatorFeeManager) +``` + +It is issued when there is a new creator fee manager. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| creatorFeeManager | address | undefined | + +### NewMaxCreatorFeeBp + +```solidity +event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) +``` + +It is issued when there is a new maximum creator fee (in basis point). + +#### Parameters + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| maxCreatorFeeBp | uint256 | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### NewProtocolFeeRecipient + +```solidity +event NewProtocolFeeRecipient(address protocolFeeRecipient) +``` + +It is issued when there is a new protocol fee recipient address. + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ----------- | +| protocolFeeRecipient | address | undefined | + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ----------- | +| user | address | undefined | +| orderNonces | uint256[] | undefined | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| user | address | undefined | +| subsetNonces | uint256[] | undefined | + +## Errors + +### CreatorFeeBpTooHigh + +```solidity +error CreatorFeeBpTooHigh() +``` + +It is returned if the creator fee (in basis point) is too high. + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### NewProtocolFeeRecipientCannotBeNullAddress + +```solidity +error NewProtocolFeeRecipientCannotBeNullAddress() +``` + +It is returned if the new protocol fee recipient is set to address(0). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NoSelectorForStrategy + +```solidity +error NoSelectorForStrategy() +``` + +It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### OutsideOfTimeRange + +```solidity +error OutsideOfTimeRange() +``` + +It is returned if the current block timestamp is not between start and end times in the maker order. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotAvailable + +```solidity +error StrategyNotAvailable(uint256 strategyId) +``` + +It is returned if the strategy id has no implementation. + +_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| strategyId | uint256 | undefined | + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/docs/developer/api/contracts/marketplace/InheritedStrategy.md b/docs/docs/developer/api/contracts/marketplace/InheritedStrategy.md new file mode 100644 index 00000000..022cce57 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/InheritedStrategy.md @@ -0,0 +1,9 @@ +# InheritedStrategy + +_LooksRare protocol team (👀,💎)_ + +> InheritedStrategy + +This contract handles the verification of parameters for standard transactions. It does not verify the taker struct's itemIds and amounts array as well as minPrice (taker ask) / maxPrice (taker bid) because before the taker executes the transaction and the maker itemIds/amounts/price should have already been confirmed off-chain. + +_A standard transaction (bid or ask) is mapped to strategyId = 0._ diff --git a/docs/docs/developer/api/contracts/marketplace/LooksRareProtocol.md b/docs/docs/developer/api/contracts/marketplace/LooksRareProtocol.md new file mode 100644 index 00000000..cc542c7e --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/LooksRareProtocol.md @@ -0,0 +1,1157 @@ +# LooksRareProtocol + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> LooksRareProtocol + +This contract is the core smart contract of the LooksRare protocol ("v2"). It is the main entry point for users to initiate transactions with taker orders and manage the cancellation of maker orders, which exist off-chain. ~~~~~~ ~~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~~~~~~~ ~~~~ ~~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~ ~~~~~~~ ~~~ ~~~- ~~~~~~~~ ~~~~ ~~~ ~~~~ ~~~~ ~~~ ~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~~ ~~~ ~~~ ~~~~~ ~~~ ~~~~~~ ~~~~~~ ~~~ ~~~~~ ~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~~~ ~~~~~~ ~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~ ~~~~~ ~~~ ~~~~~~ ~~~~~~ ~~~ ~~~~~ ~~~ ~~~ ~~~~~~~~~~ ~~~ ~~~ ~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~ ~~~ ~~~~ ~~~~ ~~~ ~~~~ ~~~~~~~~ ~~~~ ~~~ ~~~~~~~ ~~~~~~~ ~~~ ~~~ ~~~~~~~~ ~~~~ ~~~~ ~~~~~~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~~ ~~~~~~ + +## Methods + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### WETH + +```solidity +function WETH() external view returns (address) +``` + +Wrapped ETH. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### addStrategy + +```solidity +function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable +``` + +This function allows the owner to add a new execution strategy to the protocol. + +_Strategies have an id that is incremental. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------- | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the strategy | +| isMakerBid | bool | Whether the function selector is for maker bid | +| implementation | address | Implementation address | + +### cancelOrderNonces + +```solidity +function cancelOrderNonces(uint256[] orderNonces) external nonpayable +``` + +This function allows a user to cancel an array of order nonces. + +_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | --------------------- | +| orderNonces | uint256[] | Array of order nonces | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### cancelSubsetNonces + +```solidity +function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable +``` + +This function allows a user to cancel an array of subset nonces. + +_It does not check the status of the nonces to save gas._ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ---------------------- | +| subsetNonces | uint256[] | Array of subset nonces | + +### chainId + +```solidity +function chainId() external view returns (uint256) +``` + +Current chainId. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### creatorFeeManager + +```solidity +function creatorFeeManager() external view returns (contract ICreatorFeeManager) +``` + +Creator fee manager. + +#### Returns + +| Name | Type | Description | +| ---- | --------------------------- | ----------- | +| \_0 | contract ICreatorFeeManager | undefined | + +### domainSeparator + +```solidity +function domainSeparator() external view returns (bytes32) +``` + +Current domain separator. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### executeMultipleTakerBids + +```solidity +function executeMultipleTakerBids(OrderStructs.Taker[] takerBids, OrderStructs.Maker[] makerAsks, bytes[] makerSignatures, OrderStructs.MerkleTree[] merkleTrees, bool isAtomic) external payable +``` + +#### Parameters + +| Name | Type | Description | +| --------------- | ------------------------- | ----------- | +| takerBids | OrderStructs.Taker[] | undefined | +| makerAsks | OrderStructs.Maker[] | undefined | +| makerSignatures | bytes[] | undefined | +| merkleTrees | OrderStructs.MerkleTree[] | undefined | +| isAtomic | bool | undefined | + +### executeTakerAsk + +```solidity +function executeTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +### executeTakerBid + +```solidity +function executeTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external payable +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +### hashBatchOrder + +```solidity +function hashBatchOrder(bytes32 root, uint256 proofLength) external pure returns (bytes32 batchOrderHash) +``` + +This function returns the hash of the concatenation of batch order type hash and merkle root. + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ------------------- | +| root | bytes32 | Merkle root | +| proofLength | uint256 | Merkle proof length | + +#### Returns + +| Name | Type | Description | +| -------------- | ------- | -------------------- | +| batchOrderHash | bytes32 | The batch order hash | + +### incrementBidAskNonces + +```solidity +function incrementBidAskNonces(bool bid, bool ask) external nonpayable +``` + +This function increments a user's bid/ask nonces. + +_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | --------------------------------------- | +| bid | bool | Whether to increment the user bid nonce | +| ask | bool | Whether to increment the user ask nonce | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### maxCreatorFeeBp + +```solidity +function maxCreatorFeeBp() external view returns (uint16) +``` + +Maximum creator fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | uint16 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### protocolFeeRecipient + +```solidity +function protocolFeeRecipient() external view returns (address) +``` + +Protocol fee recipient. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### restrictedExecuteTakerBid + +```solidity +function restrictedExecuteTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, address sender, bytes32 orderHash) external nonpayable returns (uint256 protocolFeeAmount) +``` + +#### Parameters + +| Name | Type | Description | +| --------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | +| sender | address | undefined | +| orderHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| protocolFeeAmount | uint256 | undefined | + +### strategyInfo + +```solidity +function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +This returns the strategy information for a strategy id. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### transferManager + +```solidity +function transferManager() external view returns (contract TransferManager) +``` + +Transfer manager for ERC721, ERC1155 and Hypercerts. + +#### Returns + +| Name | Type | Description | +| ---- | ------------------------ | ----------- | +| \_0 | contract TransferManager | undefined | + +### updateCreatorFeeManager + +```solidity +function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable +``` + +This function allows the owner to update the creator fee manager address. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ---------------------------------- | +| newCreatorFeeManager | address | Address of the creator fee manager | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +### updateDomainSeparator + +```solidity +function updateDomainSeparator() external nonpayable +``` + +This function allows the owner to update the domain separator (if possible). + +_Only callable by owner. If there is a fork of the network with a new chainId, it allows the owner to reset the domain separator for the new chain id._ + +### updateETHGasLimitForTransfer + +```solidity +function updateETHGasLimitForTransfer(uint256 newGasLimitETHTransfer) external nonpayable +``` + +This function allows the owner to update the maximum ETH gas limit for a standard transfer. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------ | +| newGasLimitETHTransfer | uint256 | New gas limit for ETH transfer | + +### updateMaxCreatorFeeBp + +```solidity +function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable +``` + +This function allows the owner to update the maximum creator fee (in basis point). + +_The maximum value that can be set is 25%. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------ | ---------------------------------------- | +| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | + +### updateProtocolFeeRecipient + +```solidity +function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable +``` + +This function allows the owner to update the protocol fee recipient. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ---------------------------------- | +| newProtocolFeeRecipient | address | New protocol fee recipient address | + +### updateStrategy + +```solidity +function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable +``` + +This function allows the owner to update parameters for an existing execution strategy. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------------------ | +| strategyId | uint256 | Strategy id | +| isActive | bool | Whether the strategy must be active | +| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | +| newMinTotalFee | uint16 | New minimum total fee (in basis point) | + +### userBidAskNonces + +```solidity +function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) +``` + +This tracks the bid and ask nonces for a user address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------- | ----------- | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### userOrderNonce + +```solidity +function userOrderNonce(address, uint256) external view returns (bytes32) +``` + +This checks whether the order nonce for a user was executed or cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### userSubsetNonce + +```solidity +function userSubsetNonce(address, uint256) external view returns (bool) +``` + +This checks whether the subset nonce for a user was cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| user | address | undefined | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### NewCreatorFeeManager + +```solidity +event NewCreatorFeeManager(address creatorFeeManager) +``` + +It is issued when there is a new creator fee manager. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| creatorFeeManager | address | undefined | + +### NewDomainSeparator + +```solidity +event NewDomainSeparator() +``` + +It is emitted if there is a change in the domain separator. + +### NewGasLimitETHTransfer + +```solidity +event NewGasLimitETHTransfer(uint256 gasLimitETHTransfer) +``` + +It is emitted when there is a new gas limit for a ETH transfer (before it is wrapped to WETH). + +#### Parameters + +| Name | Type | Description | +| ------------------- | ------- | ----------- | +| gasLimitETHTransfer | uint256 | undefined | + +### NewMaxCreatorFeeBp + +```solidity +event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) +``` + +It is issued when there is a new maximum creator fee (in basis point). + +#### Parameters + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| maxCreatorFeeBp | uint256 | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### NewProtocolFeeRecipient + +```solidity +event NewProtocolFeeRecipient(address protocolFeeRecipient) +``` + +It is issued when there is a new protocol fee recipient address. + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ----------- | +| protocolFeeRecipient | address | undefined | + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ----------- | +| user | address | undefined | +| orderNonces | uint256[] | undefined | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| user | address | undefined | +| subsetNonces | uint256[] | undefined | + +### TakerAsk + +```solidity +event TakerAsk(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address askUser, address bidUser, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) +``` + +It is emitted when a taker ask transaction is completed. + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ---------------------------------------------- | ----------- | +| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | undefined | +| askUser | address | undefined | +| bidUser | address | undefined | +| strategyId | uint256 | undefined | +| currency | address | undefined | +| collection | address | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| feeRecipients | address[2] | undefined | +| feeAmounts | uint256[3] | undefined | + +### TakerBid + +```solidity +event TakerBid(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address bidUser, address bidRecipient, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) +``` + +It is emitted when a taker bid transaction is completed. + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ---------------------------------------------- | ----------- | +| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | undefined | +| bidUser | address | undefined | +| bidRecipient | address | undefined | +| strategyId | uint256 | undefined | +| currency | address | undefined | +| collection | address | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| feeRecipients | address[2] | undefined | +| feeAmounts | uint256[3] | undefined | + +## Errors + +### CallerInvalid + +```solidity +error CallerInvalid() +``` + +It is returned if the function cannot be called by the sender. + +### ChainIdInvalid + +```solidity +error ChainIdInvalid() +``` + +It is returned if the domain separator should change. + +### CreatorFeeBpTooHigh + +```solidity +error CreatorFeeBpTooHigh() +``` + +It is returned if the creator fee (in basis point) is too high. + +### CurrencyInvalid + +```solidity +error CurrencyInvalid() +``` + +It is returned if the currency is invalid. + +### ERC20TransferFromFail + +```solidity +error ERC20TransferFromFail() +``` + +It is emitted if the ERC20 transferFrom fails. + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### MerkleProofInvalid + +```solidity +error MerkleProofInvalid() +``` + +It is returned if the merkle proof provided is invalid. + +### MerkleProofTooLarge + +```solidity +error MerkleProofTooLarge(uint256 length) +``` + +It is returned if the length of the merkle proof provided is greater than tolerated. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ------------ | +| length | uint256 | Proof length | + +### NewGasLimitETHTransferTooLow + +```solidity +error NewGasLimitETHTransferTooLow() +``` + +It is returned if the gas limit for a standard ETH transfer is too low. + +### NewProtocolFeeRecipientCannotBeNullAddress + +```solidity +error NewProtocolFeeRecipientCannotBeNullAddress() +``` + +It is returned if the new protocol fee recipient is set to address(0). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NoSelectorForStrategy + +```solidity +error NoSelectorForStrategy() +``` + +It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. + +### NoncesInvalid + +```solidity +error NoncesInvalid() +``` + +It is returned if the nonces are invalid. + +### NotAContract + +```solidity +error NotAContract() +``` + +It is emitted if the call recipient is not a contract. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### NullSignerAddress + +```solidity +error NullSignerAddress() +``` + +It is emitted if the signer is null. + +### OutsideOfTimeRange + +```solidity +error OutsideOfTimeRange() +``` + +It is returned if the current block timestamp is not between start and end times in the maker order. + +### QuoteTypeInvalid + +```solidity +error QuoteTypeInvalid() +``` + +It is returned if the maker quote type is invalid. + +### ReentrancyFail + +```solidity +error ReentrancyFail() +``` + +This is returned when there is a reentrant call. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### SameDomainSeparator + +```solidity +error SameDomainSeparator() +``` + +It is returned if the domain separator cannot be updated (i.e. the chainId is the same). + +### SignatureEOAInvalid + +```solidity +error SignatureEOAInvalid() +``` + +It is emitted if the signature is invalid for an EOA (the address recovered is not the expected one). + +### SignatureERC1271Invalid + +```solidity +error SignatureERC1271Invalid() +``` + +It is emitted if the signature is invalid for a ERC1271 contract signer. + +### SignatureLengthInvalid + +```solidity +error SignatureLengthInvalid(uint256 length) +``` + +It is emitted if the signature's length is neither 64 nor 65 bytes. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| length | uint256 | undefined | + +### SignatureParameterSInvalid + +```solidity +error SignatureParameterSInvalid() +``` + +It is emitted if the signature is invalid due to S parameter. + +### SignatureParameterVInvalid + +```solidity +error SignatureParameterVInvalid(uint8 v) +``` + +It is emitted if the signature is invalid due to V parameter. + +#### Parameters + +| Name | Type | Description | +| ---- | ----- | ----------- | +| v | uint8 | undefined | + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotAvailable + +```solidity +error StrategyNotAvailable(uint256 strategyId) +``` + +It is returned if the strategy id has no implementation. + +_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| strategyId | uint256 | undefined | + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### UnsupportedCollectionType + +```solidity +error UnsupportedCollectionType() +``` + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/docs/developer/api/contracts/marketplace/NonceManager.md b/docs/docs/developer/api/contracts/marketplace/NonceManager.md new file mode 100644 index 00000000..fea95495 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/NonceManager.md @@ -0,0 +1,193 @@ +# NonceManager + +_LooksRare protocol team (👀,💎)_ + +> NonceManager + +This contract handles the nonce logic that is used for invalidating maker orders that exist off-chain. The nonce logic revolves around three parts at the user level: - order nonce (orders sharing an order nonce are conditional, OCO-like) - subset (orders can be grouped under a same subset) - bid/ask (all orders can be executed only if the bid/ask nonce matches the user's one on-chain) Only the order nonce is invalidated at the time of the execution of a maker order that contains it. + +## Methods + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### cancelOrderNonces + +```solidity +function cancelOrderNonces(uint256[] orderNonces) external nonpayable +``` + +This function allows a user to cancel an array of order nonces. + +_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | --------------------- | +| orderNonces | uint256[] | Array of order nonces | + +### cancelSubsetNonces + +```solidity +function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable +``` + +This function allows a user to cancel an array of subset nonces. + +_It does not check the status of the nonces to save gas._ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ---------------------- | +| subsetNonces | uint256[] | Array of subset nonces | + +### incrementBidAskNonces + +```solidity +function incrementBidAskNonces(bool bid, bool ask) external nonpayable +``` + +This function increments a user's bid/ask nonces. + +_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | --------------------------------------- | +| bid | bool | Whether to increment the user bid nonce | +| ask | bool | Whether to increment the user ask nonce | + +### userBidAskNonces + +```solidity +function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) +``` + +This tracks the bid and ask nonces for a user address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------- | ----------- | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### userOrderNonce + +```solidity +function userOrderNonce(address, uint256) external view returns (bytes32) +``` + +This checks whether the order nonce for a user was executed or cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### userSubsetNonce + +```solidity +function userSubsetNonce(address, uint256) external view returns (bool) +``` + +This checks whether the subset nonce for a user was cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Events + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| user | address | undefined | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ----------- | +| user | address | undefined | +| orderNonces | uint256[] | undefined | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| user | address | undefined | +| subsetNonces | uint256[] | undefined | + +## Errors + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). diff --git a/docs/docs/developer/api/contracts/marketplace/ProtocolFeeRecipient.md b/docs/docs/developer/api/contracts/marketplace/ProtocolFeeRecipient.md new file mode 100644 index 00000000..36f6a35c --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/ProtocolFeeRecipient.md @@ -0,0 +1,75 @@ +# ProtocolFeeRecipient + +_LooksRare protocol team (👀,💎)_ + +> ProtocolFeeRecipient + +This contract is used to receive protocol fees and transfer them to the fee sharing setter. Fee sharing setter cannot receive ETH directly, so we need to use this contract as a middleman to convert ETH into WETH before sending it. + +## Methods + +### FEE_SHARING_SETTER + +```solidity +function FEE_SHARING_SETTER() external view returns (address) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### WETH + +```solidity +function WETH() external view returns (contract IWETH) +``` + +#### Returns + +| Name | Type | Description | +| ---- | -------------- | ----------- | +| \_0 | contract IWETH | undefined | + +### transferERC20 + +```solidity +function transferERC20(address currency) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ---------------------- | +| currency | address | ERC20 currency address | + +### transferETH + +```solidity +function transferETH() external nonpayable +``` + +## Errors + +### ERC20TransferFail + +```solidity +error ERC20TransferFail() +``` + +It is emitted if the ERC20 transfer fails. + +### NotAContract + +```solidity +error NotAContract() +``` + +It is emitted if the call recipient is not a contract. + +### NothingToTransfer + +```solidity +error NothingToTransfer() +``` diff --git a/docs/docs/developer/api/contracts/marketplace/StrategyManager.md b/docs/docs/developer/api/contracts/marketplace/StrategyManager.md new file mode 100644 index 00000000..a55f3985 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/StrategyManager.md @@ -0,0 +1,391 @@ +# StrategyManager + +_LooksRare protocol team (👀,💎)_ + +> StrategyManager + +This contract handles the addition and the update of execution strategies. + +## Methods + +### addStrategy + +```solidity +function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable +``` + +This function allows the owner to add a new execution strategy to the protocol. + +_Strategies have an id that is incremental. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------- | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the strategy | +| isMakerBid | bool | Whether the function selector is for maker bid | +| implementation | address | Implementation address | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### strategyInfo + +```solidity +function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +This returns the strategy information for a strategy id. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +### updateStrategy + +```solidity +function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable +``` + +This function allows the owner to update parameters for an existing execution strategy. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------------------ | +| strategyId | uint256 | Strategy id | +| isActive | bool | Whether the strategy must be active | +| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | +| newMinTotalFee | uint16 | New minimum total fee (in basis point) | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | + +## Errors + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/docs/developer/api/contracts/marketplace/TransferManager.md b/docs/docs/developer/api/contracts/marketplace/TransferManager.md new file mode 100644 index 00000000..c6766114 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/TransferManager.md @@ -0,0 +1,553 @@ +# TransferManager + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> TransferManager + +This contract provides the transfer functions for ERC721/ERC1155/Hypercert for contracts that require them. Collection type "0" refers to ERC721 transfer functions. Collection type "1" refers to ERC1155 transfer functions. Collection type "2" refers to Hypercert transfer functions. + +_"Safe" transfer functions for ERC721 are not implemented since they come with added gas costs to verify if the recipient is a contract as it requires verifying the receiver interface is valid._ + +## Methods + +### allowOperator + +```solidity +function allowOperator(address operator) external nonpayable +``` + +This function allows an operator to be added for the shared transfer system. Once the operator is allowed, users can grant NFT approvals to this operator. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ------------------------- | +| operator | address | Operator address to allow | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### grantApprovals + +```solidity +function grantApprovals(address[] operators) external nonpayable +``` + +This function allows a user to grant approvals for an array of operators. Users cannot grant approvals if the operator is not allowed by this contract's owner. + +_Each operator address must be globally allowed to be approved._ + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | --------------------------- | +| operators | address[] | Array of operator addresses | + +### hasUserApprovedOperator + +```solidity +function hasUserApprovedOperator(address, address) external view returns (bool) +``` + +This returns whether the user has approved the operator address. The first address is the user and the second address is the operator (e.g. LooksRareProtocol). + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isOperatorAllowed + +```solidity +function isOperatorAllowed(address) external view returns (bool) +``` + +This returns whether the operator address is allowed by this contract's owner. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### removeOperator + +```solidity +function removeOperator(address operator) external nonpayable +``` + +This function allows the user to remove an operator for the shared transfer system. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | -------------------------- | +| operator | address | Operator address to remove | + +### revokeApprovals + +```solidity +function revokeApprovals(address[] operators) external nonpayable +``` + +This function allows a user to revoke existing approvals for an array of operators. + +_Each operator address must be approved at the user level to be revoked._ + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | --------------------------- | +| operators | address[] | Array of operator addresses | + +### splitItemsHypercert + +```solidity +function splitItemsHypercert(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable +``` + +This function splits and transfers a fraction of a hypercert. + +_It does not allow batch transferring._ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| from | address | Sender address | +| to | address | Recipient address | +| itemIds | uint256[] | Array of itemIds | +| amounts | uint256[] | Array of amounts | + +### transferBatchItemsAcrossCollections + +```solidity +function transferBatchItemsAcrossCollections(ITransferManager.BatchTransferItem[] items, address from, address to) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| ----- | ------------------------------------ | ----------- | +| items | ITransferManager.BatchTransferItem[] | undefined | +| from | address | undefined | +| to | address | undefined | + +### transferItemsERC1155 + +```solidity +function transferItemsERC1155(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable +``` + +This function transfers items for a single ERC1155 collection. + +_It does not allow batch transferring if from = msg.sender since native function should be used._ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| from | address | Sender address | +| to | address | Recipient address | +| itemIds | uint256[] | Array of itemIds | +| amounts | uint256[] | Array of amounts | + +### transferItemsERC721 + +```solidity +function transferItemsERC721(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable +``` + +This function transfers items for a single ERC721 collection. + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| from | address | Sender address | +| to | address | Recipient address | +| itemIds | uint256[] | Array of itemIds | +| amounts | uint256[] | Array of amounts | + +### transferItemsHypercert + +```solidity +function transferItemsHypercert(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable +``` + +This function transfers items for a single Hypercert. + +_It does not allow batch transferring if from = msg.sender since native function should be used._ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| from | address | Sender address | +| to | address | Recipient address | +| itemIds | uint256[] | Array of itemIds | +| amounts | uint256[] | Array of amounts | + +## Events + +### ApprovalsGranted + +```solidity +event ApprovalsGranted(address user, address[] operators) +``` + +It is emitted if operators' approvals to transfer NFTs are granted by a user. + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | ----------- | +| user | address | undefined | +| operators | address[] | undefined | + +### ApprovalsRemoved + +```solidity +event ApprovalsRemoved(address user, address[] operators) +``` + +It is emitted if operators' approvals to transfer NFTs are revoked by a user. + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | ----------- | +| user | address | undefined | +| operators | address[] | undefined | + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### OperatorAllowed + +```solidity +event OperatorAllowed(address operator) +``` + +It is emitted if a new operator is added to the global allowlist. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | + +### OperatorRemoved + +```solidity +event OperatorRemoved(address operator) +``` + +It is emitted if an operator is removed from the global allowlist. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | + +## Errors + +### AmountInvalid + +```solidity +error AmountInvalid() +``` + +It is returned if the amount is invalid. For ERC721, any number that is not 1. For ERC1155 and Hypercert, if amount is 0. + +### ERC1155SafeBatchTransferFromFail + +```solidity +error ERC1155SafeBatchTransferFromFail() +``` + +It is emitted if the ERC1155 safeBatchTransferFrom fails. + +### ERC1155SafeTransferFromFail + +```solidity +error ERC1155SafeTransferFromFail() +``` + +It is emitted if the ERC1155 safeTransferFrom fails. + +### ERC721TransferFromFail + +```solidity +error ERC721TransferFromFail() +``` + +It is emitted if the ERC721 transferFrom fails. + +### HypercertSplitFractionError + +```solidity +error HypercertSplitFractionError() +``` + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotAContract + +```solidity +error NotAContract() +``` + +It is emitted if the call recipient is not a contract. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### OperatorAlreadyAllowed + +```solidity +error OperatorAlreadyAllowed() +``` + +It is returned if the transfer caller is already allowed by the owner. + +_This error can only be returned for owner operations._ + +### OperatorAlreadyApprovedByUser + +```solidity +error OperatorAlreadyApprovedByUser() +``` + +It is returned if the operator to approve has already been approved by the user. + +### OperatorNotAllowed + +```solidity +error OperatorNotAllowed() +``` + +It is returned if the operator to approve is not in the global allowlist defined by the owner. + +_This error can be returned if the user tries to grant approval to an operator address not in the allowlist or if the owner tries to remove the operator from the global allowlist._ + +### OperatorNotApprovedByUser + +```solidity +error OperatorNotApprovedByUser() +``` + +It is returned if the operator to revoke has not been previously approved by the user. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferCallerInvalid + +```solidity +error TransferCallerInvalid() +``` + +It is returned if the transfer caller is invalid. For a transfer called to be valid, the operator must be in the global allowlist and approved by the 'from' user. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/docs/developer/api/contracts/marketplace/TransferSelectorNFT.md b/docs/docs/developer/api/contracts/marketplace/TransferSelectorNFT.md new file mode 100644 index 00000000..9011bd50 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/TransferSelectorNFT.md @@ -0,0 +1,779 @@ +# TransferSelectorNFT + +_LooksRare protocol team (👀,💎); bitbeckers;_ + +> TransferSelectorNFT + +This contract handles the logic for transferring non-fungible items. + +## Methods + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### addStrategy + +```solidity +function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable +``` + +This function allows the owner to add a new execution strategy to the protocol. + +_Strategies have an id that is incremental. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------- | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the strategy | +| isMakerBid | bool | Whether the function selector is for maker bid | +| implementation | address | Implementation address | + +### cancelOrderNonces + +```solidity +function cancelOrderNonces(uint256[] orderNonces) external nonpayable +``` + +This function allows a user to cancel an array of order nonces. + +_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | --------------------- | +| orderNonces | uint256[] | Array of order nonces | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### cancelSubsetNonces + +```solidity +function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable +``` + +This function allows a user to cancel an array of subset nonces. + +_It does not check the status of the nonces to save gas._ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ---------------------- | +| subsetNonces | uint256[] | Array of subset nonces | + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### creatorFeeManager + +```solidity +function creatorFeeManager() external view returns (contract ICreatorFeeManager) +``` + +Creator fee manager. + +#### Returns + +| Name | Type | Description | +| ---- | --------------------------- | ----------- | +| \_0 | contract ICreatorFeeManager | undefined | + +### incrementBidAskNonces + +```solidity +function incrementBidAskNonces(bool bid, bool ask) external nonpayable +``` + +This function increments a user's bid/ask nonces. + +_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | --------------------------------------- | +| bid | bool | Whether to increment the user bid nonce | +| ask | bool | Whether to increment the user ask nonce | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### maxCreatorFeeBp + +```solidity +function maxCreatorFeeBp() external view returns (uint16) +``` + +Maximum creator fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | uint16 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### protocolFeeRecipient + +```solidity +function protocolFeeRecipient() external view returns (address) +``` + +Protocol fee recipient. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### strategyInfo + +```solidity +function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +This returns the strategy information for a strategy id. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### transferManager + +```solidity +function transferManager() external view returns (contract TransferManager) +``` + +Transfer manager for ERC721, ERC1155 and Hypercerts. + +#### Returns + +| Name | Type | Description | +| ---- | ------------------------ | ----------- | +| \_0 | contract TransferManager | undefined | + +### updateCreatorFeeManager + +```solidity +function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable +``` + +This function allows the owner to update the creator fee manager address. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ---------------------------------- | +| newCreatorFeeManager | address | Address of the creator fee manager | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +### updateMaxCreatorFeeBp + +```solidity +function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable +``` + +This function allows the owner to update the maximum creator fee (in basis point). + +_The maximum value that can be set is 25%. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------ | ---------------------------------------- | +| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | + +### updateProtocolFeeRecipient + +```solidity +function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable +``` + +This function allows the owner to update the protocol fee recipient. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ---------------------------------- | +| newProtocolFeeRecipient | address | New protocol fee recipient address | + +### updateStrategy + +```solidity +function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable +``` + +This function allows the owner to update parameters for an existing execution strategy. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------------------ | +| strategyId | uint256 | Strategy id | +| isActive | bool | Whether the strategy must be active | +| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | +| newMinTotalFee | uint16 | New minimum total fee (in basis point) | + +### userBidAskNonces + +```solidity +function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) +``` + +This tracks the bid and ask nonces for a user address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------- | ----------- | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### userOrderNonce + +```solidity +function userOrderNonce(address, uint256) external view returns (bytes32) +``` + +This checks whether the order nonce for a user was executed or cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### userSubsetNonce + +```solidity +function userSubsetNonce(address, uint256) external view returns (bool) +``` + +This checks whether the subset nonce for a user was cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| user | address | undefined | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### NewCreatorFeeManager + +```solidity +event NewCreatorFeeManager(address creatorFeeManager) +``` + +It is issued when there is a new creator fee manager. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| creatorFeeManager | address | undefined | + +### NewMaxCreatorFeeBp + +```solidity +event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) +``` + +It is issued when there is a new maximum creator fee (in basis point). + +#### Parameters + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| maxCreatorFeeBp | uint256 | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### NewProtocolFeeRecipient + +```solidity +event NewProtocolFeeRecipient(address protocolFeeRecipient) +``` + +It is issued when there is a new protocol fee recipient address. + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ----------- | +| protocolFeeRecipient | address | undefined | + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ----------- | +| user | address | undefined | +| orderNonces | uint256[] | undefined | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| user | address | undefined | +| subsetNonces | uint256[] | undefined | + +## Errors + +### CreatorFeeBpTooHigh + +```solidity +error CreatorFeeBpTooHigh() +``` + +It is returned if the creator fee (in basis point) is too high. + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### NewProtocolFeeRecipientCannotBeNullAddress + +```solidity +error NewProtocolFeeRecipientCannotBeNullAddress() +``` + +It is returned if the new protocol fee recipient is set to address(0). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NoSelectorForStrategy + +```solidity +error NoSelectorForStrategy() +``` + +It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### OutsideOfTimeRange + +```solidity +error OutsideOfTimeRange() +``` + +It is returned if the current block timestamp is not between start and end times in the maker order. + +### ReentrancyFail + +```solidity +error ReentrancyFail() +``` + +This is returned when there is a reentrant call. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotAvailable + +```solidity +error StrategyNotAvailable(uint256 strategyId) +``` + +It is returned if the strategy id has no implementation. + +_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| strategyId | uint256 | undefined | + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### UnsupportedCollectionType + +```solidity +error UnsupportedCollectionType() +``` + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/docs/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md b/docs/docs/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md new file mode 100644 index 00000000..37866658 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md @@ -0,0 +1,41 @@ +# BaseStrategy + +_LooksRare protocol team (👀,💎)_ + +> BaseStrategy + +## Methods + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerOrder, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerOrder | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | diff --git a/docs/docs/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md b/docs/docs/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md new file mode 100644 index 00000000..c9503939 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md @@ -0,0 +1,212 @@ +# BaseStrategyChainlinkPriceLatency + +_LooksRare protocol team (👀,💎)_ + +> BaseStrategyChainlinkPriceLatency + +This contract allows the owner to define the maximum acceptable Chainlink price latency. + +## Methods + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### maxLatency + +```solidity +function maxLatency() external view returns (uint256) +``` + +Maximum latency accepted after which the execution strategy rejects the retrieved price. For ETH, it cannot be higher than 3,600 as Chainlink will at least update the price every 3,600 seconds, provided ETH's price does not deviate more than 0.5%. For NFTs, it cannot be higher than 86,400 as Chainlink will at least update the price every 86,400 seconds, provided ETH's price does not deviate more than 2%. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +## Errors + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/docs/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md b/docs/docs/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md new file mode 100644 index 00000000..e2d77dd3 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md @@ -0,0 +1,342 @@ +# StrategyChainlinkUSDDynamicAsk + +_LooksRare protocol team (👀,💎)_ + +> StrategyChainlinkUSDDynamicAsk + +This contract allows a seller to sell an NFT priced in USD and the receivable amount to be in ETH. + +## Methods + +### ETH_USD_PRICE_FEED_DECIMALS + +```solidity +function ETH_USD_PRICE_FEED_DECIMALS() external view returns (uint256) +``` + +_It is possible to call priceFeed.decimals() to get the decimals, but to save gas, it is hard coded instead._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### WETH + +```solidity +function WETH() external view returns (address) +``` + +Wrapped ether (WETH) address. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### executeStrategyWithTakerBid + +```solidity +function executeStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerAsk | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +### maxLatency + +```solidity +function maxLatency() external view returns (uint256) +``` + +Maximum latency accepted after which the execution strategy rejects the retrieved price. For ETH, it cannot be higher than 3,600 as Chainlink will at least update the price every 3,600 seconds, provided ETH's price does not deviate more than 0.5%. For NFTs, it cannot be higher than 86,400 as Chainlink will at least update the price every 86,400 seconds, provided ETH's price does not deviate more than 2%. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### priceFeed + +```solidity +function priceFeed() external view returns (contract AggregatorV3Interface) +``` + +ETH/USD Chainlink price feed + +#### Returns + +| Name | Type | Description | +| ---- | ------------------------------ | ----------- | +| \_0 | contract AggregatorV3Interface | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +## Errors + +### BidTooLow + +```solidity +error BidTooLow() +``` + +It is returned if the bid price is too low for the ask user. + +### ChainlinkPriceInvalid + +```solidity +error ChainlinkPriceInvalid() +``` + +It is returned if the Chainlink price is invalid (e.g. negative). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. + +### PriceNotRecentEnough + +```solidity +error PriceNotRecentEnough() +``` + +It is returned if the current block time relative to the latest price's update time is greater than the latency tolerance. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md b/docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md new file mode 100644 index 00000000..ddec4495 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md @@ -0,0 +1,127 @@ +# StrategyCollectionOffer + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> StrategyCollectionOffer + +This contract offers execution strategies for users to create maker bid offers for items in a collection. There are two available functions: 1. executeCollectionStrategyWithTakerAsk --> it applies to all itemIds in a collection 2. executeCollectionStrategyWithTakerAskWithProof --> it allows adding merkle proof criteria for tokenIds. 2. executeCollectionStrategyWithTakerAskWithAllowlist --> it allows adding merkle proof criteria for accounts.The bidder can only bid on 1 item id at a time. 1. If ERC721, the amount must be 1. 2. If ERC1155, the amount can be greater than 1. 3. If Hypercert, the amount must be 1 (fractions are NFTs) + +## Methods + +### executeCollectionStrategyWithTakerAsk + +```solidity +function executeCollectionStrategyWithTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### executeCollectionStrategyWithTakerAskWithAllowlist + +```solidity +function executeCollectionStrategyWithTakerAskWithAllowlist(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### executeCollectionStrategyWithTakerAskWithProof + +```solidity +function executeCollectionStrategyWithTakerAskWithProof(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerBid, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerBid | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +## Errors + +### MerkleProofInvalid + +```solidity +error MerkleProofInvalid() +``` + +It is returned if the merkle proof provided is invalid. + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md b/docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md new file mode 100644 index 00000000..1227878d --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md @@ -0,0 +1,83 @@ +# StrategyDutchAuction + +_LooksRare protocol team (👀,💎)_ + +> StrategyDutchAuction + +This contract offers a single execution strategy for users to create Dutch auctions. + +## Methods + +### executeStrategyWithTakerBid + +```solidity +function executeStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerAsk | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +## Errors + +### BidTooLow + +```solidity +error BidTooLow() +``` + +It is returned if the bid price is too low for the ask user. + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md b/docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md new file mode 100644 index 00000000..43f14059 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md @@ -0,0 +1,123 @@ +# StrategyHypercertFractionOffer + +_LooksRare protocol team (👀,💎); bitbeckers;_ + +> StrategyHypercertFractionOffer + +This contract offers a single execution strategy for users to bid on a specific amount of units in an hypercerts that's for sale. Example: Alice has 100 units of a hypercert (id: 42) for sale at a minimum price of 0.001 ETH/unit. Bob wants to buy 10 units. Bob can create a taker bid order with the following parameters: - unitAmount: 10000 // Total amount for sale; in `amounts` array - minUnitAmount: 100 // Minimum amount to buy; in `additionalParameters` - maxUnitAmount: 1000 // Maximum amount to buy; in `additionalParameters` - acceptedTokenAmount: 1000000000000000 (0.001 ETH in wei) - acceptedTokenAddress: 0x0000000000000000000000000000000000000000 - proof: [0xsdadfa....s9fds,0xdasdas...asff8e] This strategy will validate the available units and the price.This contract offers execution strategies for users to create maker bid offers for items in a collection. There are three available functions: 1. executeCollectionStrategyWithTakerAsk --> it applies to all itemIds in a collection 2. executeCollectionStrategyWithTakerAskWithAllowlist --> it allows adding merkle proof criteria for accounts.The bidder can only bid on 1 item id at a time. 1. If ERC721, the amount must be 1. 2. If ERC1155, the amount can be greater than 1. 3. If Hypercert, the amount can be greater than 1 because they represent units held by the hypercert. + +_Use cases can include tiered pricing; think early bird tickets._ + +## Methods + +### executeHypercertFractionStrategyWithTakerBid + +```solidity +function executeHypercertFractionStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### executeHypercertFractionStrategyWithTakerBidWithAllowlist + +```solidity +function executeHypercertFractionStrategyWithTakerBidWithAllowlist(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerAsk | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +## Errors + +### AmountInvalid + +```solidity +error AmountInvalid() +``` + +It is returned if the amount is invalid. For ERC721, any number that is not 1. For ERC1155 and Hypercert, if amount is 0. + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### MerkleProofInvalid + +```solidity +error MerkleProofInvalid() +``` + +It is returned if the merkle proof provided is invalid. + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md b/docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md new file mode 100644 index 00000000..6a1f0cd5 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md @@ -0,0 +1,75 @@ +# StrategyItemIdsRange + +_LooksRare protocol team (👀,💎)_ + +> StrategyItemIdsRange + +This contract offers a single execution strategy for users to bid on a specific amount of items in a range bounded by 2 item ids. + +## Methods + +### executeStrategyWithTakerAsk + +```solidity +function executeStrategyWithTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerBid, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerBid | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +## Errors + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/docs/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md b/docs/docs/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md new file mode 100644 index 00000000..76918fc5 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md @@ -0,0 +1,215 @@ +# OrderValidatorV2A + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> OrderValidatorV2A + +This contract is used to check the validity of maker ask/bid orders in the LooksRareProtocol (v2). It performs checks for: 1. Protocol allowlist issues (i.e. currency or strategy not allowed) 2. Maker order-specific issues (e.g., order invalid due to format or other-strategy specific issues) 3. Nonce related issues (e.g., nonce executed or cancelled) 4. Signature related issues and merkle tree parameters 5. Timestamp related issues (e.g., order expired) 6. Asset-related issues for ERC20/ERC721/ERC1155/Hypercerts (approvals and balances) 7. Collection-type suggestions 8. Transfer manager related issues 9. Creator fee related issues (e.g., creator fee too high, ERC2981 bundles) + +_This version does not handle strategies with partial fills._ + +## Methods + +### CRITERIA_GROUPS + +```solidity +function CRITERIA_GROUPS() external view returns (uint256) +``` + +Number of distinct criteria groups checked to evaluate the validity of an order. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### ERC1155_INTERFACE_ID + +```solidity +function ERC1155_INTERFACE_ID() external view returns (bytes4) +``` + +ERC1155 interfaceId. + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | + +### ERC721_INTERFACE_ID_1 + +```solidity +function ERC721_INTERFACE_ID_1() external view returns (bytes4) +``` + +ERC721 potential interfaceId. + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | + +### ERC721_INTERFACE_ID_2 + +```solidity +function ERC721_INTERFACE_ID_2() external view returns (bytes4) +``` + +ERC721 potential interfaceId. + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | + +### HYPERCERT_INTERFACE_ID + +```solidity +function HYPERCERT_INTERFACE_ID() external view returns (bytes4) +``` + +Hypercert interfaceId + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### checkMakerOrderValidity + +```solidity +function checkMakerOrderValidity(OrderStructs.Maker makerOrder, bytes signature, OrderStructs.MerkleTree merkleTree) external view returns (uint256[9] validationCodes) +``` + +#### Parameters + +| Name | Type | Description | +| ---------- | ----------------------- | ----------- | +| makerOrder | OrderStructs.Maker | undefined | +| signature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +#### Returns + +| Name | Type | Description | +| --------------- | ---------- | ----------- | +| validationCodes | uint256[9] | undefined | + +### checkMultipleMakerOrderValidities + +```solidity +function checkMultipleMakerOrderValidities(OrderStructs.Maker[] makerOrders, bytes[] signatures, OrderStructs.MerkleTree[] merkleTrees) external view returns (uint256[9][] validationCodes) +``` + +#### Parameters + +| Name | Type | Description | +| ----------- | ------------------------- | ----------- | +| makerOrders | OrderStructs.Maker[] | undefined | +| signatures | bytes[] | undefined | +| merkleTrees | OrderStructs.MerkleTree[] | undefined | + +#### Returns + +| Name | Type | Description | +| --------------- | ------------ | ----------- | +| validationCodes | uint256[9][] | undefined | + +### creatorFeeManager + +```solidity +function creatorFeeManager() external view returns (contract ICreatorFeeManager) +``` + +CreatorFeeManager. + +#### Returns + +| Name | Type | Description | +| ---- | --------------------------- | ----------- | +| \_0 | contract ICreatorFeeManager | undefined | + +### deriveProtocolParameters + +```solidity +function deriveProtocolParameters() external nonpayable +``` + +Derive protocol parameters. Anyone can call this function. + +_It allows adjusting if the domain separator or creator fee manager address were to change._ + +### domainSeparator + +```solidity +function domainSeparator() external view returns (bytes32) +``` + +LooksRareProtocol domain separator. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### looksRareProtocol + +```solidity +function looksRareProtocol() external view returns (contract LooksRareProtocol) +``` + +LooksRareProtocol. + +#### Returns + +| Name | Type | Description | +| ---- | -------------------------- | ----------- | +| \_0 | contract LooksRareProtocol | undefined | + +### maxCreatorFeeBp + +```solidity +function maxCreatorFeeBp() external view returns (uint256) +``` + +Maximum creator fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### transferManager + +```solidity +function transferManager() external view returns (contract TransferManager) +``` + +TransferManager + +#### Returns + +| Name | Type | Description | +| ---- | ------------------------ | ----------- | +| \_0 | contract TransferManager | undefined | diff --git a/docs/docs/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md b/docs/docs/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md new file mode 100644 index 00000000..91be29a9 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md @@ -0,0 +1,159 @@ +# ProtocolHelpers + +_LooksRare protocol team (👀,💎)_ + +> ProtocolHelpers + +This contract contains helper view functions for order creation. + +## Methods + +### computeDigestMerkleTree + +```solidity +function computeDigestMerkleTree(OrderStructs.MerkleTree merkleTree) external view returns (bytes32 digest) +``` + +#### Parameters + +| Name | Type | Description | +| ---------- | ----------------------- | ----------- | +| merkleTree | OrderStructs.MerkleTree | undefined | + +#### Returns + +| Name | Type | Description | +| ------ | ------- | ----------- | +| digest | bytes32 | undefined | + +### computeMakerDigest + +```solidity +function computeMakerDigest(OrderStructs.Maker maker) external view returns (bytes32 digest) +``` + +#### Parameters + +| Name | Type | Description | +| ----- | ------------------ | ----------- | +| maker | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------ | ------- | ----------- | +| digest | bytes32 | undefined | + +### looksRareProtocol + +```solidity +function looksRareProtocol() external view returns (contract LooksRareProtocol) +``` + +#### Returns + +| Name | Type | Description | +| ---- | -------------------------- | ----------- | +| \_0 | contract LooksRareProtocol | undefined | + +### verifyMakerSignature + +```solidity +function verifyMakerSignature(OrderStructs.Maker maker, bytes makerSignature, address signer) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ------------------ | ----------- | +| maker | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| signer | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### verifyMerkleTree + +```solidity +function verifyMerkleTree(OrderStructs.MerkleTree merkleTree, bytes makerSignature, address signer) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| merkleTree | OrderStructs.MerkleTree | undefined | +| makerSignature | bytes | undefined | +| signer | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Errors + +### NullSignerAddress + +```solidity +error NullSignerAddress() +``` + +It is emitted if the signer is null. + +### SignatureEOAInvalid + +```solidity +error SignatureEOAInvalid() +``` + +It is emitted if the signature is invalid for an EOA (the address recovered is not the expected one). + +### SignatureERC1271Invalid + +```solidity +error SignatureERC1271Invalid() +``` + +It is emitted if the signature is invalid for a ERC1271 contract signer. + +### SignatureLengthInvalid + +```solidity +error SignatureLengthInvalid(uint256 length) +``` + +It is emitted if the signature's length is neither 64 nor 65 bytes. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| length | uint256 | undefined | + +### SignatureParameterSInvalid + +```solidity +error SignatureParameterSInvalid() +``` + +It is emitted if the signature is invalid due to S parameter. + +### SignatureParameterVInvalid + +```solidity +error SignatureParameterVInvalid(uint8 v) +``` + +It is emitted if the signature is invalid due to V parameter. + +#### Parameters + +| Name | Type | Description | +| ---- | ----- | ----------- | +| v | uint8 | undefined | diff --git a/docs/docs/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md b/docs/docs/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md new file mode 100644 index 00000000..b832744e --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md @@ -0,0 +1,60 @@ +# ICreatorFeeManager + +_LooksRare protocol team (👀,💎)_ + +> ICreatorFeeManager + +## Methods + +### royaltyFeeRegistry + +```solidity +function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry royaltyFeeRegistry) +``` + +It returns the royalty fee registry address/interface. + +#### Returns + +| Name | Type | Description | +| ------------------ | ---------------------------- | ------------------------------------- | +| royaltyFeeRegistry | contract IRoyaltyFeeRegistry | Interface of the royalty fee registry | + +### viewCreatorFeeInfo + +```solidity +function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) +``` + +This function returns the creator address and calculates the creator fee amount. + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| price | uint256 | Transaction price | +| itemIds | uint256[] | Array of item ids | + +#### Returns + +| Name | Type | Description | +| ---------------- | ------- | ------------------ | +| creator | address | Creator address | +| creatorFeeAmount | uint256 | Creator fee amount | + +## Errors + +### BundleEIP2981NotAllowed + +```solidity +error BundleEIP2981NotAllowed(address collection) +``` + +It is returned if the bundle contains multiple itemIds with different creator fee structure. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| collection | address | undefined | diff --git a/docs/docs/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md b/docs/docs/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md new file mode 100644 index 00000000..da683d8c --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md @@ -0,0 +1,22 @@ +# ICurrencyManager + +_LooksRare protocol team (👀,💎)_ + +> ICurrencyManager + +## Events + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------------------------------- | +| currency | address | Currency address (address(0) = ETH) | +| isAllowed | bool | Whether the currency is allowed | diff --git a/docs/docs/developer/api/contracts/marketplace/interfaces/IExecutionManager.md b/docs/docs/developer/api/contracts/marketplace/interfaces/IExecutionManager.md new file mode 100644 index 00000000..0e86c75b --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/interfaces/IExecutionManager.md @@ -0,0 +1,99 @@ +# IExecutionManager + +_LooksRare protocol team (👀,💎)_ + +> IExecutionManager + +## Events + +### NewCreatorFeeManager + +```solidity +event NewCreatorFeeManager(address creatorFeeManager) +``` + +It is issued when there is a new creator fee manager. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | -------------------------------------- | +| creatorFeeManager | address | Address of the new creator fee manager | + +### NewMaxCreatorFeeBp + +```solidity +event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) +``` + +It is issued when there is a new maximum creator fee (in basis point). + +#### Parameters + +| Name | Type | Description | +| --------------- | ------- | ---------------------------------------- | +| maxCreatorFeeBp | uint256 | New maximum creator fee (in basis point) | + +### NewProtocolFeeRecipient + +```solidity +event NewProtocolFeeRecipient(address protocolFeeRecipient) +``` + +It is issued when there is a new protocol fee recipient address. + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ----------------------------------------- | +| protocolFeeRecipient | address | Address of the new protocol fee recipient | + +## Errors + +### CreatorFeeBpTooHigh + +```solidity +error CreatorFeeBpTooHigh() +``` + +It is returned if the creator fee (in basis point) is too high. + +### NewProtocolFeeRecipientCannotBeNullAddress + +```solidity +error NewProtocolFeeRecipientCannotBeNullAddress() +``` + +It is returned if the new protocol fee recipient is set to address(0). + +### NoSelectorForStrategy + +```solidity +error NoSelectorForStrategy() +``` + +It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. + +### OutsideOfTimeRange + +```solidity +error OutsideOfTimeRange() +``` + +It is returned if the current block timestamp is not between start and end times in the maker order. + +### StrategyNotAvailable + +```solidity +error StrategyNotAvailable(uint256 strategyId) +``` + +It is returned if the strategy id has no implementation. + +_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| strategyId | uint256 | undefined | diff --git a/docs/docs/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md b/docs/docs/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md new file mode 100644 index 00000000..393cb24b --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md @@ -0,0 +1,41 @@ +# IImmutableCreate2Factory + +## Methods + +### findCreate2Address + +```solidity +function findCreate2Address(bytes32 salt, bytes initializationCode) external view returns (address deploymentAddress) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| salt | bytes32 | undefined | +| initializationCode | bytes | undefined | + +#### Returns + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| deploymentAddress | address | undefined | + +### safeCreate2 + +```solidity +function safeCreate2(bytes32 salt, bytes initializationCode) external payable returns (address deploymentAddress) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| salt | bytes32 | undefined | +| initializationCode | bytes | undefined | + +#### Returns + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| deploymentAddress | address | undefined | diff --git a/docs/docs/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md b/docs/docs/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md new file mode 100644 index 00000000..e7414f54 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md @@ -0,0 +1,157 @@ +# ILooksRareProtocol + +_LooksRare protocol team (👀,💎)_ + +> ILooksRareProtocol + +## Methods + +### executeMultipleTakerBids + +```solidity +function executeMultipleTakerBids(OrderStructs.Taker[] takerBids, OrderStructs.Maker[] makerAsks, bytes[] makerSignatures, OrderStructs.MerkleTree[] merkleTrees, bool isAtomic) external payable +``` + +#### Parameters + +| Name | Type | Description | +| --------------- | ------------------------- | ----------- | +| takerBids | OrderStructs.Taker[] | undefined | +| makerAsks | OrderStructs.Maker[] | undefined | +| makerSignatures | bytes[] | undefined | +| merkleTrees | OrderStructs.MerkleTree[] | undefined | +| isAtomic | bool | undefined | + +### executeTakerAsk + +```solidity +function executeTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +### executeTakerBid + +```solidity +function executeTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external payable +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +## Events + +### NewDomainSeparator + +```solidity +event NewDomainSeparator() +``` + +It is emitted if there is a change in the domain separator. + +### NewGasLimitETHTransfer + +```solidity +event NewGasLimitETHTransfer(uint256 gasLimitETHTransfer) +``` + +It is emitted when there is a new gas limit for a ETH transfer (before it is wrapped to WETH). + +#### Parameters + +| Name | Type | Description | +| ------------------- | ------- | ----------------------------- | +| gasLimitETHTransfer | uint256 | Gas limit for an ETH transfer | + +### TakerAsk + +```solidity +event TakerAsk(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address askUser, address bidUser, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) +``` + +It is emitted when a taker ask transaction is completed. + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | Struct about nonce invalidation parameters | +| askUser | address | Address of the ask user | +| bidUser | address | Address of the bid user | +| strategyId | uint256 | Id of the strategy | +| currency | address | Address of the currency | +| collection | address | Address of the collection | +| itemIds | uint256[] | Array of item ids | +| amounts | uint256[] | Array of amounts (for item ids) | +| feeRecipients | address[2] | Array of fee recipients feeRecipients[0] User who receives the proceeds of the sale (it can be the taker ask user or different) feeRecipients[1] Creator fee recipient (if none, address(0)) | +| feeAmounts | uint256[3] | Array of fee amounts feeAmounts[0] Fee amount for the user receiving sale proceeds feeAmounts[1] Creator fee amount feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment | + +### TakerBid + +```solidity +event TakerBid(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address bidUser, address bidRecipient, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) +``` + +It is emitted when a taker bid transaction is completed. + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | Struct about nonce invalidation parameters | +| bidUser | address | Address of the bid user | +| bidRecipient | address | Address of the recipient of the bid | +| strategyId | uint256 | Id of the strategy | +| currency | address | Address of the currency | +| collection | address | Address of the collection | +| itemIds | uint256[] | Array of item ids | +| amounts | uint256[] | Array of amounts (for item ids) | +| feeRecipients | address[2] | Array of fee recipients feeRecipients[0] User who receives the proceeds of the sale (it is the maker ask user) feeRecipients[1] Creator fee recipient (if none, address(0)) | +| feeAmounts | uint256[3] | Array of fee amounts feeAmounts[0] Fee amount for the user receiving sale proceeds feeAmounts[1] Creator fee amount feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment | + +## Errors + +### ChainIdInvalid + +```solidity +error ChainIdInvalid() +``` + +It is returned if the domain separator should change. + +### NewGasLimitETHTransferTooLow + +```solidity +error NewGasLimitETHTransferTooLow() +``` + +It is returned if the gas limit for a standard ETH transfer is too low. + +### NoncesInvalid + +```solidity +error NoncesInvalid() +``` + +It is returned if the nonces are invalid. + +### SameDomainSeparator + +```solidity +error SameDomainSeparator() +``` + +It is returned if the domain separator cannot be updated (i.e. the chainId is the same). diff --git a/docs/docs/developer/api/contracts/marketplace/interfaces/INonceManager.md b/docs/docs/developer/api/contracts/marketplace/interfaces/INonceManager.md new file mode 100644 index 00000000..eaa3f977 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/interfaces/INonceManager.md @@ -0,0 +1,53 @@ +# INonceManager + +_LooksRare protocol team (👀,💎)_ + +> INonceManager + +## Events + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ------------------- | +| user | address | Address of the user | +| bidNonce | uint256 | New bid nonce | +| askNonce | uint256 | New ask nonce | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ------------------------------- | +| user | address | Address of the user | +| orderNonces | uint256[] | Array of order nonces cancelled | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | -------------------------------- | +| user | address | Address of the user | +| subsetNonces | uint256[] | Array of subset nonces cancelled | diff --git a/docs/docs/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md b/docs/docs/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md new file mode 100644 index 00000000..5ed0ef6c --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md @@ -0,0 +1,29 @@ +# IRoyaltyFeeRegistry + +_LooksRare protocol team (👀,💎)_ + +> IRoyaltyFeeRegistry + +## Methods + +### royaltyInfo + +```solidity +function royaltyInfo(address collection, uint256 price) external view returns (address receiver, uint256 royaltyFee) +``` + +This function returns the royalty information for a collection at a given transaction price. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ------------------ | +| collection | address | Collection address | +| price | uint256 | Transaction price | + +#### Returns + +| Name | Type | Description | +| ---------- | ------- | ------------------ | +| receiver | address | Receiver address | +| royaltyFee | uint256 | Royalty fee amount | diff --git a/docs/docs/developer/api/contracts/marketplace/interfaces/IStrategy.md b/docs/docs/developer/api/contracts/marketplace/interfaces/IStrategy.md new file mode 100644 index 00000000..2b4a45bc --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/interfaces/IStrategy.md @@ -0,0 +1,41 @@ +# IStrategy + +_LooksRare protocol team (👀,💎)_ + +> IStrategy + +## Methods + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool isStrategy) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---------- | ---- | ---------------------------------------------- | +| isStrategy | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerOrder, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerOrder | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | diff --git a/docs/docs/developer/api/contracts/marketplace/interfaces/IStrategyManager.md b/docs/docs/developer/api/contracts/marketplace/interfaces/IStrategyManager.md new file mode 100644 index 00000000..ae6ea7b1 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/interfaces/IStrategyManager.md @@ -0,0 +1,84 @@ +# IStrategyManager + +_LooksRare protocol team (👀,💎)_ + +> IStrategyManager + +## Events + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------------- | +| strategyId | uint256 | Id of the new strategy | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the transaction to be executed | +| isMakerBid | bool | Whether the strategyId is for maker bid | +| implementation | address | Address of the implementation of the strategy | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | -------------------------------------------------------- | +| strategyId | uint256 | Id of the strategy | +| isActive | bool | Whether the strategy is active (or not) after the update | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | + +## Errors + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ diff --git a/docs/docs/developer/api/contracts/marketplace/interfaces/ITransferManager.md b/docs/docs/developer/api/contracts/marketplace/interfaces/ITransferManager.md new file mode 100644 index 00000000..3ba8ca81 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/interfaces/ITransferManager.md @@ -0,0 +1,111 @@ +# ITransferManager + +_LooksRare protocol team (👀,💎)_ + +> ITransferManager + +## Events + +### ApprovalsGranted + +```solidity +event ApprovalsGranted(address user, address[] operators) +``` + +It is emitted if operators' approvals to transfer NFTs are granted by a user. + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | --------------------------- | +| user | address | Address of the user | +| operators | address[] | Array of operator addresses | + +### ApprovalsRemoved + +```solidity +event ApprovalsRemoved(address user, address[] operators) +``` + +It is emitted if operators' approvals to transfer NFTs are revoked by a user. + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | --------------------------- | +| user | address | Address of the user | +| operators | address[] | Array of operator addresses | + +### OperatorAllowed + +```solidity +event OperatorAllowed(address operator) +``` + +It is emitted if a new operator is added to the global allowlist. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ---------------- | +| operator | address | Operator address | + +### OperatorRemoved + +```solidity +event OperatorRemoved(address operator) +``` + +It is emitted if an operator is removed from the global allowlist. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ---------------- | +| operator | address | Operator address | + +## Errors + +### OperatorAlreadyAllowed + +```solidity +error OperatorAlreadyAllowed() +``` + +It is returned if the transfer caller is already allowed by the owner. + +_This error can only be returned for owner operations._ + +### OperatorAlreadyApprovedByUser + +```solidity +error OperatorAlreadyApprovedByUser() +``` + +It is returned if the operator to approve has already been approved by the user. + +### OperatorNotAllowed + +```solidity +error OperatorNotAllowed() +``` + +It is returned if the operator to approve is not in the global allowlist defined by the owner. + +_This error can be returned if the user tries to grant approval to an operator address not in the allowlist or if the owner tries to remove the operator from the global allowlist._ + +### OperatorNotApprovedByUser + +```solidity +error OperatorNotApprovedByUser() +``` + +It is returned if the operator to revoke has not been previously approved by the user. + +### TransferCallerInvalid + +```solidity +error TransferCallerInvalid() +``` + +It is returned if the transfer caller is invalid. For a transfer called to be valid, the operator must be in the global allowlist and approved by the 'from' user. diff --git a/docs/docs/developer/api/contracts/marketplace/libraries/CurrencyValidator.md b/docs/docs/developer/api/contracts/marketplace/libraries/CurrencyValidator.md new file mode 100644 index 00000000..1b1f41a2 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/libraries/CurrencyValidator.md @@ -0,0 +1,7 @@ +# CurrencyValidator + +_LooksRare protocol team (👀,💎)_ + +> CurrencyValidator + +This library validates the order currency to be the chain's native currency or the specified ERC20 token. diff --git a/docs/docs/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md b/docs/docs/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md new file mode 100644 index 00000000..5951cc56 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md @@ -0,0 +1,21 @@ +# LowLevelHypercertCaller + +_bitbeckers_ + +> LowLevelHypercertCaller + +This contract contains low-level calls to transfer ERC1155 tokens. + +## Errors + +### HypercertSplitFractionError + +```solidity +error HypercertSplitFractionError() +``` + +### NotAContract + +```solidity +error NotAContract() +``` diff --git a/docs/docs/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md b/docs/docs/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md new file mode 100644 index 00000000..943a54cd --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md @@ -0,0 +1,7 @@ +# MerkleProofCalldataWithNodes + +_OpenZeppelin (adjusted by LooksRare)_ + +> MerkleProofCalldataWithNodes + +This library is adjusted from the work of OpenZeppelin. It is based on the 4.7.0 (utils/cryptography/MerkleProof.sol). diff --git a/docs/docs/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md b/docs/docs/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md new file mode 100644 index 00000000..37529181 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md @@ -0,0 +1,7 @@ +# MerkleProofMemory + +_OpenZeppelin (adjusted by LooksRare)_ + +> MerkleProofMemory + +This library is adjusted from the work of OpenZeppelin. It is based on the 4.7.0 (utils/cryptography/MerkleProof.sol). diff --git a/docs/docs/developer/api/contracts/marketplace/libraries/OrderStructs.md b/docs/docs/developer/api/contracts/marketplace/libraries/OrderStructs.md new file mode 100644 index 00000000..6ffa83e2 --- /dev/null +++ b/docs/docs/developer/api/contracts/marketplace/libraries/OrderStructs.md @@ -0,0 +1,7 @@ +# OrderStructs + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> OrderStructs + +This library contains all order struct types for the LooksRare protocol (v2). diff --git a/docs/docs/developer/api/contracts/protocol/AllowlistMinter.md b/docs/docs/developer/api/contracts/protocol/AllowlistMinter.md new file mode 100644 index 00000000..4684053c --- /dev/null +++ b/docs/docs/developer/api/contracts/protocol/AllowlistMinter.md @@ -0,0 +1,84 @@ +# AllowlistMinter + +_bitbeckers_ + +> Interface for hypercert token interactions + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### hasBeenClaimed + +```solidity +function hasBeenClaimed(uint256, bytes32) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | +| \_1 | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | + +## Events + +### AllowlistCreated + +```solidity +event AllowlistCreated(uint256 tokenID, bytes32 root) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| root | bytes32 | undefined | + +### LeafClaimed + +```solidity +event LeafClaimed(uint256 tokenID, bytes32 leaf) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +## Errors + +### DoesNotExist + +```solidity +error DoesNotExist() +``` diff --git a/docs/docs/developer/api/contracts/protocol/HypercertMinter.md b/docs/docs/developer/api/contracts/protocol/HypercertMinter.md new file mode 100644 index 00000000..518efa42 --- /dev/null +++ b/docs/docs/developer/api/contracts/protocol/HypercertMinter.md @@ -0,0 +1,895 @@ +# HypercertMinter + +_bitbeckers_ + +> Contract for managing hypercert claims and whitelists + +Implementation of the HypercertTokenInterface using { SemiFungible1155 } as underlying token.This contract supports whitelisted minting via { AllowlistMinter }. + +_Wrapper contract to expose and chain functions._ + +## Methods + +### \_\_SemiFungible1155_init + +```solidity +function __SemiFungible1155_init() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### balanceOf + +```solidity +function balanceOf(address account, uint256 id) external view returns (uint256) +``` + +_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### balanceOfBatch + +```solidity +function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) +``` + +_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| accounts | address[] | undefined | +| ids | uint256[] | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | --------- | ----------- | +| \_0 | uint256[] | undefined | + +### batchBurnFraction + +```solidity +function batchBurnFraction(address _account, uint256[] _tokenIDs) external nonpayable +``` + +Burn a claimtoken + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ----------- | +| \_account | address | undefined | +| \_tokenIDs | uint256[] | undefined | + +### batchMintClaimsFromAllowlists + +```solidity +function batchMintClaimsFromAllowlists(address account, bytes32[][] proofs, uint256[] claimIDs, uint256[] units) external nonpayable +``` + +Mint semi-fungible tokens representing a fraction of the claims in `claimIDs` + +_Calls AllowlistMinter to verify `proofs`.Mints the `amount` of units for the hypercert stored under `claimIDs`_ + +#### Parameters + +| Name | Type | Description | +| -------- | ----------- | ----------- | +| account | address | undefined | +| proofs | bytes32[][] | undefined | +| claimIDs | uint256[] | undefined | +| units | uint256[] | undefined | + +### burn + +```solidity +function burn(address account, uint256 id, uint256) external nonpayable +``` + +Burn a claimtoken; override is needed to update units/values + +_see {ERC1155Burnable}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | +| \_2 | uint256 | undefined | + +### burnBatch + +```solidity +function burnBatch(address account, uint256[] ids, uint256[]) external nonpayable +``` + +Batch burn claimtokens; override is needed to update units/values + +_see {ERC1155Burnable}_ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| ids | uint256[] | undefined | +| \_2 | uint256[] | undefined | + +### burnFraction + +```solidity +function burnFraction(address _account, uint256 _tokenID) external nonpayable +``` + +Burn a claimtoken + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| \_account | address | undefined | +| \_tokenID | uint256 | undefined | + +### createAllowlist + +```solidity +function createAllowlist(address account, uint256 units, bytes32 merkleRoot, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Register a claim and the whitelist for minting token(s) belonging to that claim + +_Calls SemiFungible1155 to store the claim referenced in `uri` with amount of `units`Calls AllowlistMinter to store the `merkleRoot` as proof to authorize claims_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| merkleRoot | bytes32 | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### hasBeenClaimed + +```solidity +function hasBeenClaimed(uint256, bytes32) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | +| \_1 | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### initialize + +```solidity +function initialize() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | + +### isApprovedForAll + +```solidity +function isApprovedForAll(address account, address operator) external view returns (bool) +``` + +_See {IERC1155-isApprovedForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| account | address | undefined | +| operator | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### mergeFractions + +```solidity +function mergeFractions(address _account, uint256[] _fractionIDs) external nonpayable +``` + +Merge the value of tokens belonging to the same claim + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------- | --------- | ----------- | +| \_account | address | undefined | +| \_fractionIDs | uint256[] | undefined | + +### mintClaim + +```solidity +function mintClaim(address account, uint256 units, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Mint a semi-fungible token for the impact claim referenced via `uri` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### mintClaimFromAllowlist + +```solidity +function mintClaimFromAllowlist(address account, bytes32[] proof, uint256 claimID, uint256 units) external nonpayable +``` + +Mint a semi-fungible token representing a fraction of the claim + +_Calls AllowlistMinter to verify `proof`.Mints the `amount` of units for the hypercert stored under `claimID`_ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| units | uint256 | undefined | + +### mintClaimWithFractions + +```solidity +function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Mint semi-fungible tokens for the impact claim referenced via `uri` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| fractions | uint256[] | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### name + +```solidity +function name() external view returns (string) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +_Returns the address of the current owner._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownerOf + +```solidity +function ownerOf(uint256 tokenID) external view returns (address _owner) +``` + +_Returns the owner of a given token ID._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| tokenID | uint256 | The ID of the token to query. | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | -------------------------------------- | +| \_owner | address | The address of the owner of the token. | + +### pause + +```solidity +function pause() external nonpayable +``` + +PAUSABLE + +### paused + +```solidity +function paused() external view returns (bool) +``` + +_Returns true if the contract is paused, and false otherwise._ + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### proxiableUUID + +```solidity +function proxiableUUID() external view returns (bytes32) +``` + +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### readTransferRestriction + +```solidity +function readTransferRestriction(uint256 tokenID) external view returns (string) +``` + +TRANSFER RESTRICTIONS + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ + +### safeBatchTransferFrom + +```solidity +function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable +``` + +_See {IERC1155-safeBatchTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| ids | uint256[] | undefined | +| amounts | uint256[] | undefined | +| data | bytes | undefined | + +### safeTransferFrom + +```solidity +function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable +``` + +_See {IERC1155-safeTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| id | uint256 | undefined | +| amount | uint256 | undefined | +| data | bytes | undefined | + +### setApprovalForAll + +```solidity +function setApprovalForAll(address operator, bool approved) external nonpayable +``` + +_See {IERC1155-setApprovalForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | +| approved | bool | undefined | + +### splitFraction + +```solidity +function splitFraction(address _account, uint256 _tokenID, uint256[] _newFractions) external nonpayable +``` + +Split a claimtokens value into parts with summed value equal to the original + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| -------------- | --------- | ----------- | +| \_account | address | undefined | +| \_tokenID | uint256 | undefined | +| \_newFractions | uint256[] | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + +_See {IERC165-supportsInterface}._ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------ | ----------- | +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### unitsOf + +```solidity +function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) +``` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unitsOf + +```solidity +function unitsOf(uint256 tokenID) external view returns (uint256 units) +``` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unpause + +```solidity +function unpause() external nonpayable +``` + +### upgradeTo + +```solidity +function upgradeTo(address newImplementation) external nonpayable +``` + +_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | + +### upgradeToAndCall + +```solidity +function upgradeToAndCall(address newImplementation, bytes data) external payable +``` + +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string _uri) +``` + +_see { IHypercertMetadata}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------ | ----------- | +| \_uri | string | undefined | + +## Events + +### AdminChanged + +```solidity +event AdminChanged(address previousAdmin, address newAdmin) +``` + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | ----------- | +| previousAdmin | address | undefined | +| newAdmin | address | undefined | + +### AllowlistCreated + +```solidity +event AllowlistCreated(uint256 tokenID, bytes32 root) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| root | bytes32 | undefined | + +### ApprovalForAll + +```solidity +event ApprovalForAll(address indexed account, address indexed operator, bool approved) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| account `indexed` | address | undefined | +| operator `indexed` | address | undefined | +| approved | bool | undefined | + +### BatchValueTransfer + +```solidity +event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| claimIDs | uint256[] | undefined | +| fromTokenIDs | uint256[] | undefined | +| toTokenIDs | uint256[] | undefined | +| values | uint256[] | undefined | + +### BeaconUpgraded + +```solidity +event BeaconUpgraded(address indexed beacon) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| beacon `indexed` | address | undefined | + +### ClaimStored + +```solidity +event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| claimID `indexed` | uint256 | undefined | +| uri | string | undefined | +| totalUnits | uint256 | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ----- | ----------- | +| version | uint8 | undefined | + +### LeafClaimed + +```solidity +event LeafClaimed(uint256 tokenID, bytes32 leaf) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### Paused + +```solidity +event Paused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### TransferBatch + +```solidity +event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### TransferSingle + +```solidity +event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### URI + +```solidity +event URI(string value, uint256 indexed id) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | ------- | ----------- | +| value | string | undefined | +| id `indexed` | uint256 | undefined | + +### Unpaused + +```solidity +event Unpaused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### Upgraded + +```solidity +event Upgraded(address indexed implementation) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | + +### ValueTransfer + +```solidity +event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------- | +| claimID | uint256 | undefined | +| fromTokenID | uint256 | undefined | +| toTokenID | uint256 | undefined | +| value | uint256 | undefined | + +## Errors + +### AlreadyClaimed + +```solidity +error AlreadyClaimed() +``` + +### ArraySize + +```solidity +error ArraySize() +``` + +### DoesNotExist + +```solidity +error DoesNotExist() +``` + +### DuplicateEntry + +```solidity +error DuplicateEntry() +``` + +### Invalid + +```solidity +error Invalid() +``` + +### NotAllowed + +```solidity +error NotAllowed() +``` + +### NotApprovedOrOwner + +```solidity +error NotApprovedOrOwner() +``` + +### TransfersNotAllowed + +```solidity +error TransfersNotAllowed() +``` + +### TypeMismatch + +```solidity +error TypeMismatch() +``` diff --git a/docs/docs/developer/api/contracts/protocol/SemiFungible1155.md b/docs/docs/developer/api/contracts/protocol/SemiFungible1155.md new file mode 100644 index 00000000..a4086e37 --- /dev/null +++ b/docs/docs/developer/api/contracts/protocol/SemiFungible1155.md @@ -0,0 +1,457 @@ +# SemiFungible1155 + +_bitbeckers_ + +> Contract for minting semi-fungible EIP1155 tokens + +Extends { Upgradeable1155 } token with semi-fungible properties and the concept of `units` + +_Adds split bit strategy as described in [EIP-1155](https://eips.ethereum.org/EIPS/eip-1155#non-fungible-tokens)_ + +## Methods + +### \_\_SemiFungible1155_init + +```solidity +function __SemiFungible1155_init() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### balanceOf + +```solidity +function balanceOf(address account, uint256 id) external view returns (uint256) +``` + +_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### balanceOfBatch + +```solidity +function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) +``` + +_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| accounts | address[] | undefined | +| ids | uint256[] | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | --------- | ----------- | +| \_0 | uint256[] | undefined | + +### burn + +```solidity +function burn(address account, uint256 id, uint256 value) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### burnBatch + +```solidity +function burnBatch(address account, uint256[] ids, uint256[] values) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### isApprovedForAll + +```solidity +function isApprovedForAll(address account, address operator) external view returns (bool) +``` + +_See {IERC1155-isApprovedForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| account | address | undefined | +| operator | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +_Returns the address of the current owner._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownerOf + +```solidity +function ownerOf(uint256 tokenID) external view returns (address _owner) +``` + +_Returns the owner of a given token ID._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| tokenID | uint256 | The ID of the token to query. | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | -------------------------------------- | +| \_owner | address | The address of the owner of the token. | + +### proxiableUUID + +```solidity +function proxiableUUID() external view returns (bytes32) +``` + +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ + +### safeBatchTransferFrom + +```solidity +function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable +``` + +_See {IERC1155-safeBatchTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| ids | uint256[] | undefined | +| amounts | uint256[] | undefined | +| data | bytes | undefined | + +### safeTransferFrom + +```solidity +function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable +``` + +_See {IERC1155-safeTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| id | uint256 | undefined | +| amount | uint256 | undefined | +| data | bytes | undefined | + +### setApprovalForAll + +```solidity +function setApprovalForAll(address operator, bool approved) external nonpayable +``` + +_See {IERC1155-setApprovalForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | +| approved | bool | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + +_See {IERC165-supportsInterface}._ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------ | ----------- | +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### upgradeTo + +```solidity +function upgradeTo(address newImplementation) external nonpayable +``` + +_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | + +### upgradeToAndCall + +```solidity +function upgradeToAndCall(address newImplementation, bytes data) external payable +``` + +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string _uri) +``` + +_Returns the metadata URI for a given token ID.This function retrieves the metadata URI for the specified token ID by calling the `uri` function of the `ERC1155URIStorageUpgradeable` contract.The metadata URI is a string that points to a JSON file containing information about the token, such as its name, symbol, and image.This function always returns the URI for the basetype so that it's managed in one place._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------------------------------- | +| tokenID | uint256 | The ID of the token to retrieve the metadata URI for. | + +#### Returns + +| Name | Type | Description | +| ----- | ------ | -------------------------------------------- | +| \_uri | string | The metadata URI for the specified token ID. | + +## Events + +### AdminChanged + +```solidity +event AdminChanged(address previousAdmin, address newAdmin) +``` + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | ----------- | +| previousAdmin | address | undefined | +| newAdmin | address | undefined | + +### ApprovalForAll + +```solidity +event ApprovalForAll(address indexed account, address indexed operator, bool approved) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| account `indexed` | address | undefined | +| operator `indexed` | address | undefined | +| approved | bool | undefined | + +### BatchValueTransfer + +```solidity +event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) +``` + +_Emitted on transfer of `values` between `fromTokenIDs` to `toTokenIDs` of `claimIDs`_ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| claimIDs | uint256[] | undefined | +| fromTokenIDs | uint256[] | undefined | +| toTokenIDs | uint256[] | undefined | +| values | uint256[] | undefined | + +### BeaconUpgraded + +```solidity +event BeaconUpgraded(address indexed beacon) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| beacon `indexed` | address | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ----- | ----------- | +| version | uint8 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### TransferBatch + +```solidity +event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### TransferSingle + +```solidity +event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### URI + +```solidity +event URI(string value, uint256 indexed id) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | ------- | ----------- | +| value | string | undefined | +| id `indexed` | uint256 | undefined | + +### Upgraded + +```solidity +event Upgraded(address indexed implementation) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | + +### ValueTransfer + +```solidity +event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) +``` + +_Emitted on transfer of `value` between `fromTokenID` to `toTokenID` of the same `claimID`_ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------- | +| claimID | uint256 | undefined | +| fromTokenID | uint256 | undefined | +| toTokenID | uint256 | undefined | +| value | uint256 | undefined | diff --git a/docs/docs/developer/api/contracts/protocol/interfaces/IAllowlist.md b/docs/docs/developer/api/contracts/protocol/interfaces/IAllowlist.md new file mode 100644 index 00000000..72455b43 --- /dev/null +++ b/docs/docs/developer/api/contracts/protocol/interfaces/IAllowlist.md @@ -0,0 +1,29 @@ +# IAllowlist + +_bitbeckers_ + +> Interface for allowlist + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 tokenID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | diff --git a/docs/docs/developer/api/contracts/protocol/interfaces/IHypercertToken.md b/docs/docs/developer/api/contracts/protocol/interfaces/IHypercertToken.md new file mode 100644 index 00000000..30ed6f95 --- /dev/null +++ b/docs/docs/developer/api/contracts/protocol/interfaces/IHypercertToken.md @@ -0,0 +1,192 @@ +# IHypercertToken + +_bitbeckers_ + +> Interface for hypercert token interactions + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### batchBurnFraction + +```solidity +function batchBurnFraction(address account, uint256[] tokenIDs) external nonpayable +``` + +Operator must be allowed by `creator` and the tokens must represent the total amount of available units. + +_Function to burn the tokens at `tokenIDs` for `account`_ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenIDs | uint256[] | undefined | + +### burnFraction + +```solidity +function burnFraction(address account, uint256 tokenID) external nonpayable +``` + +Operator must be allowed by `creator` and the token must represent the total amount of available units. + +_Function to burn the token at `tokenID` for `account`_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +### mergeFractions + +```solidity +function mergeFractions(address account, uint256[] tokenIDs) external nonpayable +``` + +Tokens that have been merged are burned. + +_Function called to merge tokens within `tokenIDs`._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenIDs | uint256[] | undefined | + +### mintClaim + +```solidity +function mintClaim(address account, uint256 units, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +_Function called to store a claim referenced via `uri` with a maximum number of fractions `units`._ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### mintClaimWithFractions + +```solidity +function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +_Function called to store a claim referenced via `uri` with a set of `fractions`.Fractions are internally summed to total units._ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| fractions | uint256[] | undefined | +| uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### splitFraction + +```solidity +function splitFraction(address account, uint256 tokenID, uint256[] _values) external nonpayable +``` + +The sum of `values` must equal the current value of `_tokenID`. + +_Function called to split `tokenID` owned by `account` into units declared in `values`._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | +| \_values | uint256[] | undefined | + +### unitsOf + +```solidity +function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) +``` + +_Returns the `units` held by `account` of a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` held by `account` for the claim is returned.If `tokenID` is a fractional token, the `units` held by `account` the token is returned_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unitsOf + +```solidity +function unitsOf(uint256 tokenID) external view returns (uint256 units) +``` + +_Returns the `units` held by a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` for the claim is returned.If `tokenID` is a fractional token, the `units` held by the token is returned_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string metadata) +``` + +_Returns the `uri` for metadata of the claim represented by `tokenID`Metadata must conform to { Hypercert Metadata } spec (based on ERC1155 Metadata)_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------ | ----------- | +| metadata | string | undefined | + +## Events + +### ClaimStored + +```solidity +event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) +``` + +_Emitted when token with tokenID `claimID` is stored, with external data reference via `uri`._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| claimID `indexed` | uint256 | undefined | +| uri | string | undefined | +| totalUnits | uint256 | undefined | diff --git a/docs/docs/developer/api/contracts/protocol/libs/Errors.md b/docs/docs/developer/api/contracts/protocol/libs/Errors.md new file mode 100644 index 00000000..93fe0124 --- /dev/null +++ b/docs/docs/developer/api/contracts/protocol/libs/Errors.md @@ -0,0 +1,59 @@ +# Errors + +_bitbeckers_ + +## Errors + +### AlreadyClaimed + +```solidity +error AlreadyClaimed() +``` + +### ArraySize + +```solidity +error ArraySize() +``` + +### DoesNotExist + +```solidity +error DoesNotExist() +``` + +### DuplicateEntry + +```solidity +error DuplicateEntry() +``` + +### Invalid + +```solidity +error Invalid() +``` + +### NotAllowed + +```solidity +error NotAllowed() +``` + +### NotApprovedOrOwner + +```solidity +error NotApprovedOrOwner() +``` + +### TransfersNotAllowed + +```solidity +error TransfersNotAllowed() +``` + +### TypeMismatch + +```solidity +error TypeMismatch() +``` diff --git a/docs/docs/developer/config.md b/docs/docs/developer/config.md index b26fc0e8..0be153cb 100644 --- a/docs/docs/developer/config.md +++ b/docs/docs/developer/config.md @@ -9,7 +9,6 @@ The client provides a high level interface that communicates with the Graph, IPF The SDK allows for minimal configuration, explicit overrides and defining values in environment variables. We apply the following hierarchy: 1. Overrides declared in `Partial` -2. Environment variables exposed via `process.env` Based on the chainID (either 5 or 10) we load the default config for Goerli or Optimism. @@ -17,8 +16,7 @@ We then process the rest of the overrides and possible environment variables to To get started quickly you can either: -- set `process.env.DEFAULT_CHAIN_ID` to 5 or 10 -- initialize a new client by calling `new HypercertClient({chainId: 5})` (or 10) +- initialize a new client by calling `new HypercertClient({chain: {id: 5})` (or 10) Using either of the options above will launch the client in `read only` mode using the defaults in [constants.ts](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/constants.ts) diff --git a/docs/package.json b/docs/package.json index 7225bde0..674a836e 100644 --- a/docs/package.json +++ b/docs/package.json @@ -30,6 +30,7 @@ "react-dom": "^18.2.0" }, "devDependencies": { + "@docusaurus/eslint-plugin": "^2.4.1", "@docusaurus/module-type-aliases": "^2.4.1", "@tsconfig/docusaurus": "^1.0.6", "typescript": "^4.9.4" diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/about.md b/docs/versioned_docs/version-1.0.0-alpha.0/about.md new file mode 100644 index 00000000..e2d4eb79 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/about.md @@ -0,0 +1,24 @@ +--- +title: The Hypercerts Foundation +id: about +--- + +# The Hypercerts Foundation + +### Mission + +The mission of the Hypercerts Foundation is to advance the development and adoption of open-source protocols for funding and rewarding positive impact. + +### Organization + +The Hypercerts Foundation is a fully independent organisation working closely with stakeholders in the open source, scientific research, and cryptography communities to develop and promote additional protocols that are decentralized, secure, and transparent. The Foundation will also provide support and resources to help drive the wider adoption of these protocols. + +### History + +Research on hypercerts was first presented to the public by David A. Dalrymple at the conference series Funding the Commons in March 2022. However, the concept of “impact certificates” has been a recurring theme at conferences and in online discussion forums since at least 2014. In late 2022, a small team of research scientists, developers, and practitioners began implementing hypercerts as a set of Ethereum-based smart contracts that could be used to assert and fund impact claims. The Hypercerts Foundation will now serve as the long-term home for this work. + +The new foundation is supported in part by Protocol Labs and is part of the broader Protocol Labs Network of hundreds of companies and organizations. The Foundation will complement Protocol Labs Network’s mission of enabling a more secure, open, and accessible internet. The Hypercerts Foundation, however, is fully independent and will focus on protocol development and cultivating a community of developers and impact entrepreneurs well beyond the Protocol Labs Network. + +### Further links + +Read the full [announcement of the Hypercerts Foundation](https://hypercerts.notion.site/Introducing-the-Hypercerts-Foundation-d956203fe0fc4792980da138015e770a). diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/allowlists.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/allowlists.md new file mode 100644 index 00000000..bc65b116 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/allowlists.md @@ -0,0 +1,101 @@ +# Allowlists + +Allowlists are an efficient way to enable distribution of hypercert fractions amongst a group. +First, the creator will create the hypercert with the metadata and an immutable allowlist. +With the `claimId`, every account specified in the allowlist can later mint their fraction token from that allowlist. + +## Create an allowlist + +First specify an allowlist, mapping addresses to the number of units they should receive. + +```js +import { + TransferRestrictions, + formatHypercertData, + Allowlist, +} from "@hypercerts-org/sdk"; + +const allowlist: Allowlist = [ + { address: "0x123", units: 100 }, + { address: "0xabc", units: 100 }, +]; +``` + +Then, call `createAllowlist` with the metadata and allowlist. + +```js +const { metadata } = formatHypercertData(...); +const totalUnits = "10000"; +const transferRestrictions = TransferRestrictions.FromCreatorOnly + +const { claimId } = await hypercerts.createAllowlist({ + allowList, + metaData, + totalUnits, + transferRestrictions: TransferRestrictions.FromCreatorOnly, +}); +``` + +> **note** We store the allowlist and the Merkle tree in the metadata of the Hypercert. To understand the Merkle tree generation and data structures, check out the [OpenZeppelin merkle tree library](https://github.com/OpenZeppelin/merkle-tree) + +It first checks if the client is writable and if the operator is a signer. If the operator is not a signer, it throws an `InvalidOrMissingError`. + +Next, it validates the allowlist and metadata by calling the `validateAllowlist` and `validateMetaData` functions respectively. If either the allowlist or metadata is invalid, it throws a `MalformedDataError`. + +Once the allowlist and metadata are validated, the method creates a Merkle tree from the allowlist and stores it on IPFS. It then stores the metadata on IPFS as well. + +Finally, the method invokes the `createAllowlist` function on the contract with the signer's `address`, the total number of `units`, the Merkle tree `root`, the metadata `CID`, and the `transfer restrictions`. If the method is called with `overrides`, it passes them to the createAllowlist function. + +## Claiming a fraction token + +Users can claim their fraction tokens for many hypercerts at once using `mintClaimFractionFromAllowlist`. To determine the input the following information is required: + +| Variable | Type | Source | +| -------- | ------------ | ------------ | +| claimId | BigNumberish | Hypercert ID | +| units | BigNumberish | Allowlist | +| proof | BytesLike[] | Merkle tree | + +We store the allowlist and the Merkle tree in the metadata of the Hypercert. To understand the Merkle tree data structures, check out the [OpenZeppelin merkle tree library](https://github.com/OpenZeppelin/merkle-tree). You can get the `proof` and `units` by traversing the merkle tree. + +Then, call `mintClaimFractionFromAllowlist` with the required data. The contracts will also verify the proofs. However, when providing the `root` in the function input, the proofs will be verified before a transaction is submitted. + +```js +import { StandardMerkleTree } from "@openzeppelin/merkle-tree"; + +const claimId = "0x822f17a9a5eecfd...85254363386255337"; +const address = "0xc0ffee254729296a45a3885639AC7E10F9d54979"; + +const { indexer, storage } = hypercertsClient; +const claimById = await indexer.claimById(claimId); +const { uri, tokenID: _id } = claimById.claim; +const metadata = await storage.getMetadata(uri || ""); +const treeResponse = await storage.getData(metadata.allowList); +const tree = StandardMerkleTree.load(JSON.parse(treeResponse)); + +let args; +// Find the proof in the allowlist +for (const [leaf, value] of tree.entries()) { + if (value[0] === address) { + args = { + proofs: tree.getProof(leaf), + units: Number(value[1]), + claimId: _id, + }; + break; + } +} + +// Mint fraction token +const tx = await hypercerts.mintClaimFractionFromAllowlist({ + ...args, +}); +``` + +Let's see what happens under the hood: + +First, the method checks that the client is not `read only` and that the operator is a signer. If not, it throws an `InvalidOrMissingError`. + +Next, the method verifies the Merkle `proof` using the OpenZeppelin Merkle tree library. If a `root` is provided, the method uses it to verify the proof. If the proof is invalid, it throws an error. + +Finally, the method calls the `mintClaimFromAllowlist` function on the contract with the signer `address`, Merkle `proof`, `claim ID`, and number of `units` as parameters. If overrides are provided, the method uses them to send the transaction. Otherwise, it sends the transaction without overrides. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/AllowlistMinter.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/AllowlistMinter.md new file mode 100644 index 00000000..4684053c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/AllowlistMinter.md @@ -0,0 +1,84 @@ +# AllowlistMinter + +_bitbeckers_ + +> Interface for hypercert token interactions + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### hasBeenClaimed + +```solidity +function hasBeenClaimed(uint256, bytes32) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | +| \_1 | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | + +## Events + +### AllowlistCreated + +```solidity +event AllowlistCreated(uint256 tokenID, bytes32 root) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| root | bytes32 | undefined | + +### LeafClaimed + +```solidity +event LeafClaimed(uint256 tokenID, bytes32 leaf) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +## Errors + +### DoesNotExist + +```solidity +error DoesNotExist() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/HypercertMinter.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/HypercertMinter.md new file mode 100644 index 00000000..518efa42 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/HypercertMinter.md @@ -0,0 +1,895 @@ +# HypercertMinter + +_bitbeckers_ + +> Contract for managing hypercert claims and whitelists + +Implementation of the HypercertTokenInterface using { SemiFungible1155 } as underlying token.This contract supports whitelisted minting via { AllowlistMinter }. + +_Wrapper contract to expose and chain functions._ + +## Methods + +### \_\_SemiFungible1155_init + +```solidity +function __SemiFungible1155_init() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### balanceOf + +```solidity +function balanceOf(address account, uint256 id) external view returns (uint256) +``` + +_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### balanceOfBatch + +```solidity +function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) +``` + +_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| accounts | address[] | undefined | +| ids | uint256[] | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | --------- | ----------- | +| \_0 | uint256[] | undefined | + +### batchBurnFraction + +```solidity +function batchBurnFraction(address _account, uint256[] _tokenIDs) external nonpayable +``` + +Burn a claimtoken + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ----------- | +| \_account | address | undefined | +| \_tokenIDs | uint256[] | undefined | + +### batchMintClaimsFromAllowlists + +```solidity +function batchMintClaimsFromAllowlists(address account, bytes32[][] proofs, uint256[] claimIDs, uint256[] units) external nonpayable +``` + +Mint semi-fungible tokens representing a fraction of the claims in `claimIDs` + +_Calls AllowlistMinter to verify `proofs`.Mints the `amount` of units for the hypercert stored under `claimIDs`_ + +#### Parameters + +| Name | Type | Description | +| -------- | ----------- | ----------- | +| account | address | undefined | +| proofs | bytes32[][] | undefined | +| claimIDs | uint256[] | undefined | +| units | uint256[] | undefined | + +### burn + +```solidity +function burn(address account, uint256 id, uint256) external nonpayable +``` + +Burn a claimtoken; override is needed to update units/values + +_see {ERC1155Burnable}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | +| \_2 | uint256 | undefined | + +### burnBatch + +```solidity +function burnBatch(address account, uint256[] ids, uint256[]) external nonpayable +``` + +Batch burn claimtokens; override is needed to update units/values + +_see {ERC1155Burnable}_ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| ids | uint256[] | undefined | +| \_2 | uint256[] | undefined | + +### burnFraction + +```solidity +function burnFraction(address _account, uint256 _tokenID) external nonpayable +``` + +Burn a claimtoken + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| \_account | address | undefined | +| \_tokenID | uint256 | undefined | + +### createAllowlist + +```solidity +function createAllowlist(address account, uint256 units, bytes32 merkleRoot, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Register a claim and the whitelist for minting token(s) belonging to that claim + +_Calls SemiFungible1155 to store the claim referenced in `uri` with amount of `units`Calls AllowlistMinter to store the `merkleRoot` as proof to authorize claims_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| merkleRoot | bytes32 | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### hasBeenClaimed + +```solidity +function hasBeenClaimed(uint256, bytes32) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | +| \_1 | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### initialize + +```solidity +function initialize() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | + +### isApprovedForAll + +```solidity +function isApprovedForAll(address account, address operator) external view returns (bool) +``` + +_See {IERC1155-isApprovedForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| account | address | undefined | +| operator | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### mergeFractions + +```solidity +function mergeFractions(address _account, uint256[] _fractionIDs) external nonpayable +``` + +Merge the value of tokens belonging to the same claim + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------- | --------- | ----------- | +| \_account | address | undefined | +| \_fractionIDs | uint256[] | undefined | + +### mintClaim + +```solidity +function mintClaim(address account, uint256 units, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Mint a semi-fungible token for the impact claim referenced via `uri` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### mintClaimFromAllowlist + +```solidity +function mintClaimFromAllowlist(address account, bytes32[] proof, uint256 claimID, uint256 units) external nonpayable +``` + +Mint a semi-fungible token representing a fraction of the claim + +_Calls AllowlistMinter to verify `proof`.Mints the `amount` of units for the hypercert stored under `claimID`_ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| units | uint256 | undefined | + +### mintClaimWithFractions + +```solidity +function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Mint semi-fungible tokens for the impact claim referenced via `uri` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| fractions | uint256[] | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### name + +```solidity +function name() external view returns (string) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +_Returns the address of the current owner._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownerOf + +```solidity +function ownerOf(uint256 tokenID) external view returns (address _owner) +``` + +_Returns the owner of a given token ID._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| tokenID | uint256 | The ID of the token to query. | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | -------------------------------------- | +| \_owner | address | The address of the owner of the token. | + +### pause + +```solidity +function pause() external nonpayable +``` + +PAUSABLE + +### paused + +```solidity +function paused() external view returns (bool) +``` + +_Returns true if the contract is paused, and false otherwise._ + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### proxiableUUID + +```solidity +function proxiableUUID() external view returns (bytes32) +``` + +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### readTransferRestriction + +```solidity +function readTransferRestriction(uint256 tokenID) external view returns (string) +``` + +TRANSFER RESTRICTIONS + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ + +### safeBatchTransferFrom + +```solidity +function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable +``` + +_See {IERC1155-safeBatchTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| ids | uint256[] | undefined | +| amounts | uint256[] | undefined | +| data | bytes | undefined | + +### safeTransferFrom + +```solidity +function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable +``` + +_See {IERC1155-safeTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| id | uint256 | undefined | +| amount | uint256 | undefined | +| data | bytes | undefined | + +### setApprovalForAll + +```solidity +function setApprovalForAll(address operator, bool approved) external nonpayable +``` + +_See {IERC1155-setApprovalForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | +| approved | bool | undefined | + +### splitFraction + +```solidity +function splitFraction(address _account, uint256 _tokenID, uint256[] _newFractions) external nonpayable +``` + +Split a claimtokens value into parts with summed value equal to the original + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| -------------- | --------- | ----------- | +| \_account | address | undefined | +| \_tokenID | uint256 | undefined | +| \_newFractions | uint256[] | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + +_See {IERC165-supportsInterface}._ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------ | ----------- | +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### unitsOf + +```solidity +function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) +``` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unitsOf + +```solidity +function unitsOf(uint256 tokenID) external view returns (uint256 units) +``` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unpause + +```solidity +function unpause() external nonpayable +``` + +### upgradeTo + +```solidity +function upgradeTo(address newImplementation) external nonpayable +``` + +_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | + +### upgradeToAndCall + +```solidity +function upgradeToAndCall(address newImplementation, bytes data) external payable +``` + +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string _uri) +``` + +_see { IHypercertMetadata}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------ | ----------- | +| \_uri | string | undefined | + +## Events + +### AdminChanged + +```solidity +event AdminChanged(address previousAdmin, address newAdmin) +``` + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | ----------- | +| previousAdmin | address | undefined | +| newAdmin | address | undefined | + +### AllowlistCreated + +```solidity +event AllowlistCreated(uint256 tokenID, bytes32 root) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| root | bytes32 | undefined | + +### ApprovalForAll + +```solidity +event ApprovalForAll(address indexed account, address indexed operator, bool approved) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| account `indexed` | address | undefined | +| operator `indexed` | address | undefined | +| approved | bool | undefined | + +### BatchValueTransfer + +```solidity +event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| claimIDs | uint256[] | undefined | +| fromTokenIDs | uint256[] | undefined | +| toTokenIDs | uint256[] | undefined | +| values | uint256[] | undefined | + +### BeaconUpgraded + +```solidity +event BeaconUpgraded(address indexed beacon) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| beacon `indexed` | address | undefined | + +### ClaimStored + +```solidity +event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| claimID `indexed` | uint256 | undefined | +| uri | string | undefined | +| totalUnits | uint256 | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ----- | ----------- | +| version | uint8 | undefined | + +### LeafClaimed + +```solidity +event LeafClaimed(uint256 tokenID, bytes32 leaf) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### Paused + +```solidity +event Paused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### TransferBatch + +```solidity +event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### TransferSingle + +```solidity +event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### URI + +```solidity +event URI(string value, uint256 indexed id) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | ------- | ----------- | +| value | string | undefined | +| id `indexed` | uint256 | undefined | + +### Unpaused + +```solidity +event Unpaused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### Upgraded + +```solidity +event Upgraded(address indexed implementation) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | + +### ValueTransfer + +```solidity +event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------- | +| claimID | uint256 | undefined | +| fromTokenID | uint256 | undefined | +| toTokenID | uint256 | undefined | +| value | uint256 | undefined | + +## Errors + +### AlreadyClaimed + +```solidity +error AlreadyClaimed() +``` + +### ArraySize + +```solidity +error ArraySize() +``` + +### DoesNotExist + +```solidity +error DoesNotExist() +``` + +### DuplicateEntry + +```solidity +error DuplicateEntry() +``` + +### Invalid + +```solidity +error Invalid() +``` + +### NotAllowed + +```solidity +error NotAllowed() +``` + +### NotApprovedOrOwner + +```solidity +error NotApprovedOrOwner() +``` + +### TransfersNotAllowed + +```solidity +error TransfersNotAllowed() +``` + +### TypeMismatch + +```solidity +error TypeMismatch() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/HypercertTrader.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/HypercertTrader.md new file mode 100644 index 00000000..e31e8840 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/HypercertTrader.md @@ -0,0 +1,434 @@ +# HypercertTrader + +_bitbeckers_ + +> Contract for managing hypercert trades + +Implementation of the HypercertTrader Interface + +## Methods + +### batchBuyUnits + +```solidity +function batchBuyUnits(address recipient, uint256[] offerIDs, uint256[] unitAmounts, address[] buyTokens, uint256[] tokenAmountsPerUnit) external payable +``` + +This function allows a user to buy Hypercert tokens from multiple existing offers in a single transaction. The function takes in several arrays of parameters, including the IDs of the offers to buy from, the number of units to buy for each offer, the tokens used for payment for each offer, and the amounts of tokens to pay per unit for each offer. The function then executes the trades and transfers the Hypercert tokens to the specified recipient. + +_Buys Hypercert tokens from multiple existing offers in a single transaction._ + +#### Parameters + +| Name | Type | Description | +| ------------------- | --------- | -------------------------------------------------------------------- | +| recipient | address | The address that will receive the Hypercert tokens. | +| offerIDs | uint256[] | The list of IDs of the offers to buy from. | +| unitAmounts | uint256[] | The list of numbers of units to buy for each offer. | +| buyTokens | address[] | The list of addresses of the tokens used for payment for each offer. | +| tokenAmountsPerUnit | uint256[] | The list of amounts of tokens to pay per unit for each offer. | + +### buyUnits + +```solidity +function buyUnits(address recipient, uint256 offerID, uint256 unitAmount, address buyToken, uint256 tokenAmountPerUnit) external payable +``` + +This function buys Hypercert tokens from an existing offer. The function verifies that the offer is valid and that the buyer has provided enough payment in the specified token. If the offer is for a fraction of a Hypercert token, the function splits the fraction and transfers the appropriate number of units to the buyer. If the offer is for a fixed number of units, the function transfers the units to the buyer. The function also transfers the payment to the offerer and emits a `Trade` event. + +_Buys Hypercert tokens from an existing offer._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | --------------------------------------------------- | +| recipient | address | The address that will receive the Hypercert tokens. | +| offerID | uint256 | The ID of the offer to buy from. | +| unitAmount | uint256 | The number of units to buy. | +| buyToken | address | The address of the token used for payment. | +| tokenAmountPerUnit | uint256 | The amount of tokens to pay per unit. | + +### cancelOffer + +```solidity +function cancelOffer(uint256 offerID) external nonpayable +``` + +This function cancels an existing offer. The function verifies that the offer exists and that the caller is the offerer. The function sets the offer status to `Cancelled` and emits an `OfferCancelled` event. + +_Cancels an existing offer._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------------ | +| offerID | uint256 | The ID of the offer to cancel. | + +### createOffer + +```solidity +function createOffer(address hypercertContract, uint256 fractionID, uint256 unitsForSale, uint256 minUnitsPerTrade, uint256 maxUnitsPerTrade, IHypercertTrader.AcceptedToken[] acceptedTokens) external payable returns (uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------- | -------------------------------- | ----------- | +| hypercertContract | address | undefined | +| fractionID | uint256 | undefined | +| unitsForSale | uint256 | undefined | +| minUnitsPerTrade | uint256 | undefined | +| maxUnitsPerTrade | uint256 | undefined | +| acceptedTokens | IHypercertTrader.AcceptedToken[] | undefined | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | ----------- | +| offerID | uint256 | undefined | + +### getOffer + +```solidity +function getOffer(uint256 offerID) external view returns (struct IHypercertTrader.Offer) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| offerID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------- | ----------- | +| \_0 | IHypercertTrader.Offer | undefined | + +### initialize + +```solidity +function initialize() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### offers + +```solidity +function offers(uint256) external view returns (address offerer, address hypercertContract, uint256 fractionID, uint256 unitsAvailable, uint256 minUnitsPerTrade, uint256 maxUnitsPerTrade, enum IHypercertTrader.OfferType offerType, enum IHypercertTrader.OfferStatus status) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----------------- | --------------------------------- | ----------- | +| offerer | address | undefined | +| hypercertContract | address | undefined | +| fractionID | uint256 | undefined | +| unitsAvailable | uint256 | undefined | +| minUnitsPerTrade | uint256 | undefined | +| maxUnitsPerTrade | uint256 | undefined | +| offerType | enum IHypercertTrader.OfferType | undefined | +| status | enum IHypercertTrader.OfferStatus | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +_Returns the address of the current owner._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### pause + +```solidity +function pause() external nonpayable +``` + +PAUSABLE + +### paused + +```solidity +function paused() external view returns (bool) +``` + +_Returns true if the contract is paused, and false otherwise._ + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### proxiableUUID + +```solidity +function proxiableUUID() external view returns (bytes32) +``` + +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ + +### totalUnitsForSale + +```solidity +function totalUnitsForSale(address, uint256) external view returns (uint256) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### unpause + +```solidity +function unpause() external nonpayable +``` + +### upgradeTo + +```solidity +function upgradeTo(address newImplementation) external nonpayable +``` + +_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | + +### upgradeToAndCall + +```solidity +function upgradeToAndCall(address newImplementation, bytes data) external payable +``` + +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | + +## Events + +### AdminChanged + +```solidity +event AdminChanged(address previousAdmin, address newAdmin) +``` + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | ----------- | +| previousAdmin | address | undefined | +| newAdmin | address | undefined | + +### BeaconUpgraded + +```solidity +event BeaconUpgraded(address indexed beacon) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| beacon `indexed` | address | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ----- | ----------- | +| version | uint8 | undefined | + +### OfferCancelled + +```solidity +event OfferCancelled(address indexed creator, address indexed hypercertContract, uint256 indexed fractionID, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| creator `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID `indexed` | uint256 | undefined | +| offerID | uint256 | undefined | + +### OfferCreated + +```solidity +event OfferCreated(address indexed offerer, address indexed hypercertContract, uint256 indexed fractionID, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| offerer `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID `indexed` | uint256 | undefined | +| offerID | uint256 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### Paused + +```solidity +event Paused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### Trade + +```solidity +event Trade(address indexed seller, address indexed buyer, address indexed hypercertContract, uint256 fractionID, uint256 unitsBought, address buyToken, uint256 tokenAmountPerUnit, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| seller `indexed` | address | undefined | +| buyer `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID | uint256 | undefined | +| unitsBought | uint256 | undefined | +| buyToken | address | undefined | +| tokenAmountPerUnit | uint256 | undefined | +| offerID | uint256 | undefined | + +### Unpaused + +```solidity +event Unpaused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### Upgraded + +```solidity +event Upgraded(address indexed implementation) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | + +## Errors + +### InvalidBuy + +```solidity +error InvalidBuy(string) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### InvalidOffer + +```solidity +error InvalidOffer(string) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### NotAllowed + +```solidity +error NotAllowed() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/IHypercertMinter.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/IHypercertMinter.md new file mode 100644 index 00000000..13a84632 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/IHypercertMinter.md @@ -0,0 +1,39 @@ +# IHypercertMinter + +## Methods + +### ownerOf + +```solidity +function ownerOf(uint256 id) external view returns (address) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### unitsOf + +```solidity +function unitsOf(uint256 id) external view returns (uint256) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/SemiFungible1155.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/SemiFungible1155.md new file mode 100644 index 00000000..a4086e37 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/SemiFungible1155.md @@ -0,0 +1,457 @@ +# SemiFungible1155 + +_bitbeckers_ + +> Contract for minting semi-fungible EIP1155 tokens + +Extends { Upgradeable1155 } token with semi-fungible properties and the concept of `units` + +_Adds split bit strategy as described in [EIP-1155](https://eips.ethereum.org/EIPS/eip-1155#non-fungible-tokens)_ + +## Methods + +### \_\_SemiFungible1155_init + +```solidity +function __SemiFungible1155_init() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### balanceOf + +```solidity +function balanceOf(address account, uint256 id) external view returns (uint256) +``` + +_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### balanceOfBatch + +```solidity +function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) +``` + +_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| accounts | address[] | undefined | +| ids | uint256[] | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | --------- | ----------- | +| \_0 | uint256[] | undefined | + +### burn + +```solidity +function burn(address account, uint256 id, uint256 value) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### burnBatch + +```solidity +function burnBatch(address account, uint256[] ids, uint256[] values) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### isApprovedForAll + +```solidity +function isApprovedForAll(address account, address operator) external view returns (bool) +``` + +_See {IERC1155-isApprovedForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| account | address | undefined | +| operator | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +_Returns the address of the current owner._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownerOf + +```solidity +function ownerOf(uint256 tokenID) external view returns (address _owner) +``` + +_Returns the owner of a given token ID._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| tokenID | uint256 | The ID of the token to query. | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | -------------------------------------- | +| \_owner | address | The address of the owner of the token. | + +### proxiableUUID + +```solidity +function proxiableUUID() external view returns (bytes32) +``` + +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ + +### safeBatchTransferFrom + +```solidity +function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable +``` + +_See {IERC1155-safeBatchTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| ids | uint256[] | undefined | +| amounts | uint256[] | undefined | +| data | bytes | undefined | + +### safeTransferFrom + +```solidity +function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable +``` + +_See {IERC1155-safeTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| id | uint256 | undefined | +| amount | uint256 | undefined | +| data | bytes | undefined | + +### setApprovalForAll + +```solidity +function setApprovalForAll(address operator, bool approved) external nonpayable +``` + +_See {IERC1155-setApprovalForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | +| approved | bool | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + +_See {IERC165-supportsInterface}._ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------ | ----------- | +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### upgradeTo + +```solidity +function upgradeTo(address newImplementation) external nonpayable +``` + +_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | + +### upgradeToAndCall + +```solidity +function upgradeToAndCall(address newImplementation, bytes data) external payable +``` + +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string _uri) +``` + +_Returns the metadata URI for a given token ID.This function retrieves the metadata URI for the specified token ID by calling the `uri` function of the `ERC1155URIStorageUpgradeable` contract.The metadata URI is a string that points to a JSON file containing information about the token, such as its name, symbol, and image.This function always returns the URI for the basetype so that it's managed in one place._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------------------------------- | +| tokenID | uint256 | The ID of the token to retrieve the metadata URI for. | + +#### Returns + +| Name | Type | Description | +| ----- | ------ | -------------------------------------------- | +| \_uri | string | The metadata URI for the specified token ID. | + +## Events + +### AdminChanged + +```solidity +event AdminChanged(address previousAdmin, address newAdmin) +``` + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | ----------- | +| previousAdmin | address | undefined | +| newAdmin | address | undefined | + +### ApprovalForAll + +```solidity +event ApprovalForAll(address indexed account, address indexed operator, bool approved) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| account `indexed` | address | undefined | +| operator `indexed` | address | undefined | +| approved | bool | undefined | + +### BatchValueTransfer + +```solidity +event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) +``` + +_Emitted on transfer of `values` between `fromTokenIDs` to `toTokenIDs` of `claimIDs`_ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| claimIDs | uint256[] | undefined | +| fromTokenIDs | uint256[] | undefined | +| toTokenIDs | uint256[] | undefined | +| values | uint256[] | undefined | + +### BeaconUpgraded + +```solidity +event BeaconUpgraded(address indexed beacon) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| beacon `indexed` | address | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ----- | ----------- | +| version | uint8 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### TransferBatch + +```solidity +event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### TransferSingle + +```solidity +event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### URI + +```solidity +event URI(string value, uint256 indexed id) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | ------- | ----------- | +| value | string | undefined | +| id `indexed` | uint256 | undefined | + +### Upgraded + +```solidity +event Upgraded(address indexed implementation) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | + +### ValueTransfer + +```solidity +event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) +``` + +_Emitted on transfer of `value` between `fromTokenID` to `toTokenID` of the same `claimID`_ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------- | +| claimID | uint256 | undefined | +| fromTokenID | uint256 | undefined | +| toTokenID | uint256 | undefined | +| value | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/ainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/ainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.md new file mode 100644 index 00000000..6be07157 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/ainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.md @@ -0,0 +1,77 @@ +# AggregatorV3Interface + +## Methods + +### decimals + +```solidity +function decimals() external view returns (uint8) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ----- | ----------- | +| \_0 | uint8 | undefined | + +### description + +```solidity +function description() external view returns (string) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### getRoundData + +```solidity +function getRoundData(uint80 _roundId) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) +``` + +#### Parameters + +| Name | Type | Description | +| --------- | ------ | ----------- | +| \_roundId | uint80 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| roundId | uint80 | undefined | +| answer | int256 | undefined | +| startedAt | uint256 | undefined | +| updatedAt | uint256 | undefined | +| answeredInRound | uint80 | undefined | + +### latestRoundData + +```solidity +function latestRoundData() external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) +``` + +#### Returns + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| roundId | uint80 | undefined | +| answer | int256 | undefined | +| startedAt | uint256 | undefined | +| updatedAt | uint256 | undefined | +| answeredInRound | uint80 | undefined | + +### version + +```solidity +function version() external view returns (uint256) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/forge-std/src/console.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/forge-std/src/console.md new file mode 100644 index 00000000..8d14ad8c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/forge-std/src/console.md @@ -0,0 +1 @@ +# console diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/forge-std/src/console2.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/forge-std/src/console2.md new file mode 100644 index 00000000..cb666cd3 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/forge-std/src/console2.md @@ -0,0 +1,3 @@ +# console2 + +_The original console.sol uses `int` and `uint` for computing function selectors, but it should use `int256` and `uint256`. This modified version fixes that. This version is recommended over `console.sol` if you don't need compatibility with Hardhat as the logs will show up in forge stack traces. If you do need compatibility with Hardhat, you must use `console.sol`. Reference: https://github.com/NomicFoundation/hardhat/issues/2178_ diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/interfaces/IAllowlist.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/interfaces/IAllowlist.md new file mode 100644 index 00000000..72455b43 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/interfaces/IAllowlist.md @@ -0,0 +1,29 @@ +# IAllowlist + +_bitbeckers_ + +> Interface for allowlist + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 tokenID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/interfaces/IHypercertToken.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/interfaces/IHypercertToken.md new file mode 100644 index 00000000..30ed6f95 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/interfaces/IHypercertToken.md @@ -0,0 +1,192 @@ +# IHypercertToken + +_bitbeckers_ + +> Interface for hypercert token interactions + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### batchBurnFraction + +```solidity +function batchBurnFraction(address account, uint256[] tokenIDs) external nonpayable +``` + +Operator must be allowed by `creator` and the tokens must represent the total amount of available units. + +_Function to burn the tokens at `tokenIDs` for `account`_ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenIDs | uint256[] | undefined | + +### burnFraction + +```solidity +function burnFraction(address account, uint256 tokenID) external nonpayable +``` + +Operator must be allowed by `creator` and the token must represent the total amount of available units. + +_Function to burn the token at `tokenID` for `account`_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +### mergeFractions + +```solidity +function mergeFractions(address account, uint256[] tokenIDs) external nonpayable +``` + +Tokens that have been merged are burned. + +_Function called to merge tokens within `tokenIDs`._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenIDs | uint256[] | undefined | + +### mintClaim + +```solidity +function mintClaim(address account, uint256 units, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +_Function called to store a claim referenced via `uri` with a maximum number of fractions `units`._ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### mintClaimWithFractions + +```solidity +function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +_Function called to store a claim referenced via `uri` with a set of `fractions`.Fractions are internally summed to total units._ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| fractions | uint256[] | undefined | +| uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### splitFraction + +```solidity +function splitFraction(address account, uint256 tokenID, uint256[] _values) external nonpayable +``` + +The sum of `values` must equal the current value of `_tokenID`. + +_Function called to split `tokenID` owned by `account` into units declared in `values`._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | +| \_values | uint256[] | undefined | + +### unitsOf + +```solidity +function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) +``` + +_Returns the `units` held by `account` of a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` held by `account` for the claim is returned.If `tokenID` is a fractional token, the `units` held by `account` the token is returned_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unitsOf + +```solidity +function unitsOf(uint256 tokenID) external view returns (uint256 units) +``` + +_Returns the `units` held by a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` for the claim is returned.If `tokenID` is a fractional token, the `units` held by the token is returned_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string metadata) +``` + +_Returns the `uri` for metadata of the claim represented by `tokenID`Metadata must conform to { Hypercert Metadata } spec (based on ERC1155 Metadata)_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------ | ----------- | +| metadata | string | undefined | + +## Events + +### ClaimStored + +```solidity +event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) +``` + +_Emitted when token with tokenID `claimID` is stored, with external data reference via `uri`._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| claimID `indexed` | uint256 | undefined | +| uri | string | undefined | +| totalUnits | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/interfaces/IHypercertTrader.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/interfaces/IHypercertTrader.md new file mode 100644 index 00000000..06fb700c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/interfaces/IHypercertTrader.md @@ -0,0 +1,133 @@ +# IHypercertTrader + +_bitbeckers_ + +> Interface for hypercert token trading + +This interface declares the required functionality to interact with the hypercert marketplace + +## Methods + +### batchBuyUnits + +```solidity +function batchBuyUnits(address recipient, uint256[] offerIDs, uint256[] unitAmounts, address[] buyTokens, uint256[] tokenAmountsPerUnit) external payable +``` + +_Buys Hypercert tokens from multiple existing offers in a single transaction._ + +#### Parameters + +| Name | Type | Description | +| ------------------- | --------- | -------------------------------------------------------------------- | +| recipient | address | The address that will receive the Hypercert tokens. | +| offerIDs | uint256[] | The list of IDs of the offers to buy from. | +| unitAmounts | uint256[] | The list of numbers of units to buy for each offer. | +| buyTokens | address[] | The list of addresses of the tokens used for payment for each offer. | +| tokenAmountsPerUnit | uint256[] | The list of amounts of tokens to pay per unit for each offer. | + +### buyUnits + +```solidity +function buyUnits(address recipient, uint256 offerID, uint256 unitAmount, address buyToken, uint256 tokenAmountPerUnit) external payable +``` + +_Buys Hypercert tokens from an existing offer._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | --------------------------------------------------- | +| recipient | address | The address that will receive the Hypercert tokens. | +| offerID | uint256 | The ID of the offer to buy from. | +| unitAmount | uint256 | The number of units to buy. | +| buyToken | address | The address of the token used for payment. | +| tokenAmountPerUnit | uint256 | The amount of tokens to pay per unit. | + +### cancelOffer + +```solidity +function cancelOffer(uint256 offerID) external nonpayable +``` + +_Cancels an existing offer._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------------ | +| offerID | uint256 | The ID of the offer to cancel. | + +### createOffer + +```solidity +function createOffer(address hypercertContract, uint256 fractionID, uint256 units, uint256 minUnitsPerTrade, uint256 maxUnitsPerTrade, IHypercertTrader.AcceptedToken[] acceptedTokens) external payable returns (uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------- | -------------------------------- | ----------- | +| hypercertContract | address | undefined | +| fractionID | uint256 | undefined | +| units | uint256 | undefined | +| minUnitsPerTrade | uint256 | undefined | +| maxUnitsPerTrade | uint256 | undefined | +| acceptedTokens | IHypercertTrader.AcceptedToken[] | undefined | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | ----------- | +| offerID | uint256 | undefined | + +## Events + +### OfferCancelled + +```solidity +event OfferCancelled(address indexed creator, address indexed hypercertContract, uint256 indexed fractionID, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| creator `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID `indexed` | uint256 | undefined | +| offerID | uint256 | undefined | + +### OfferCreated + +```solidity +event OfferCreated(address indexed offerer, address indexed hypercertContract, uint256 indexed fractionID, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| offerer `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID `indexed` | uint256 | undefined | +| offerID | uint256 | undefined | + +### Trade + +```solidity +event Trade(address indexed seller, address indexed buyer, address indexed hypercertContract, uint256 fractionID, uint256 unitsBought, address buyToken, uint256 tokenAmountPerUnit, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| seller `indexed` | address | undefined | +| buyer `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID | uint256 | undefined | +| unitsBought | uint256 | undefined | +| buyToken | address | undefined | +| tokenAmountPerUnit | uint256 | undefined | +| offerID | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/libs/Errors.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/libs/Errors.md new file mode 100644 index 00000000..93fe0124 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/libs/Errors.md @@ -0,0 +1,59 @@ +# Errors + +_bitbeckers_ + +## Errors + +### AlreadyClaimed + +```solidity +error AlreadyClaimed() +``` + +### ArraySize + +```solidity +error ArraySize() +``` + +### DoesNotExist + +```solidity +error DoesNotExist() +``` + +### DuplicateEntry + +```solidity +error DuplicateEntry() +``` + +### Invalid + +```solidity +error Invalid() +``` + +### NotAllowed + +```solidity +error NotAllowed() +``` + +### NotApprovedOrOwner + +```solidity +error NotApprovedOrOwner() +``` + +### TransfersNotAllowed + +```solidity +error TransfersNotAllowed() +``` + +### TypeMismatch + +```solidity +error TypeMismatch() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md new file mode 100644 index 00000000..4cb96bfc --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md @@ -0,0 +1,46 @@ +# BatchOrderTypehashRegistry + +_LooksRare protocol team (👀,💎)_ + +> BatchOrderTypehashRegistry + +The contract generates the batch order hash that is used to compute the digest for signature verification. + +## Methods + +### hashBatchOrder + +```solidity +function hashBatchOrder(bytes32 root, uint256 proofLength) external pure returns (bytes32 batchOrderHash) +``` + +This function returns the hash of the concatenation of batch order type hash and merkle root. + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ------------------- | +| root | bytes32 | Merkle root | +| proofLength | uint256 | Merkle proof length | + +#### Returns + +| Name | Type | Description | +| -------------- | ------- | -------------------- | +| batchOrderHash | bytes32 | The batch order hash | + +## Errors + +### MerkleProofTooLarge + +```solidity +error MerkleProofTooLarge(uint256 length) +``` + +It is returned if the length of the merkle proof provided is greater than tolerated. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ------------ | +| length | uint256 | Proof length | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md new file mode 100644 index 00000000..a32aef65 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md @@ -0,0 +1,76 @@ +# CreatorFeeManagerWithRebates + +_LooksRare protocol team (👀,💎)_ + +> CreatorFeeManagerWithRebates + +This contract returns the creator fee address and the creator rebate amount. + +## Methods + +### STANDARD_ROYALTY_FEE_BP + +```solidity +function STANDARD_ROYALTY_FEE_BP() external view returns (uint256) +``` + +Standard royalty fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### royaltyFeeRegistry + +```solidity +function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry) +``` + +Royalty fee registry interface. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | contract IRoyaltyFeeRegistry | undefined | + +### viewCreatorFeeInfo + +```solidity +function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) +``` + +This function returns the creator address and calculates the creator fee amount. + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| price | uint256 | Transaction price | +| itemIds | uint256[] | Array of item ids | + +#### Returns + +| Name | Type | Description | +| ---------------- | ------- | ------------------ | +| creator | address | Creator address | +| creatorFeeAmount | uint256 | Creator fee amount | + +## Errors + +### BundleEIP2981NotAllowed + +```solidity +error BundleEIP2981NotAllowed(address collection) +``` + +It is returned if the bundle contains multiple itemIds with different creator fee structure. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| collection | address | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md new file mode 100644 index 00000000..41cab900 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md @@ -0,0 +1,64 @@ +# CreatorFeeManagerWithRoyalties + +_LooksRare protocol team (👀,💎)_ + +> CreatorFeeManagerWithRoyalties + +This contract returns the creator fee address and the creator fee amount. + +## Methods + +### royaltyFeeRegistry + +```solidity +function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry) +``` + +Royalty fee registry interface. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | contract IRoyaltyFeeRegistry | undefined | + +### viewCreatorFeeInfo + +```solidity +function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) +``` + +This function returns the creator address and calculates the creator fee amount. + +_There are two on-chain sources for the royalty fee to distribute. 1. RoyaltyFeeRegistry: It is an on-chain registry where creator fee is defined for all items of a collection. 2. ERC2981: The NFT Royalty Standard where royalty fee is defined at a itemId level in a collection. The on-chain logic looks up the registry first. If it does not find anything, it checks if a collection is ERC2981. If so, it fetches the proper royalty information for the itemId. For a bundle that contains multiple itemIds (for a collection using ERC2981), if the royalty fee/recipient differ among the itemIds part of the bundle, the trade reverts. This contract DOES NOT enforce any restriction for extremely high creator fee, nor verifies the creator fee fetched is inferior to the total price. If any contract relies on it to build an on-chain royalty logic, it should implement protection against: (1) high royalties (2) potential unexpected royalty changes that can occur after the creation of the order._ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| price | uint256 | Transaction price | +| itemIds | uint256[] | Array of item ids | + +#### Returns + +| Name | Type | Description | +| ---------------- | ------- | ------------------ | +| creator | address | Creator address | +| creatorFeeAmount | uint256 | Creator fee amount | + +## Errors + +### BundleEIP2981NotAllowed + +```solidity +error BundleEIP2981NotAllowed(address collection) +``` + +It is returned if the bundle contains multiple itemIds with different creator fee structure. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| collection | address | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/CurrencyManager.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/CurrencyManager.md new file mode 100644 index 00000000..9ff1c0fc --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/CurrencyManager.md @@ -0,0 +1,250 @@ +# CurrencyManager + +_LooksRare protocol team (👀,💎)_ + +> CurrencyManager + +This contract manages the list of valid fungible currencies. + +## Methods + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +## Errors + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/ExecutionManager.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/ExecutionManager.md new file mode 100644 index 00000000..83eefc37 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/ExecutionManager.md @@ -0,0 +1,751 @@ +# ExecutionManager + +_LooksRare protocol team (👀,💎); bitbeckers;_ + +> ExecutionManager + +This contract handles the execution and resolution of transactions. A transaction is executed on-chain when an off-chain maker order is matched by on-chain taker order of a different kind. For instance, a taker ask is executed against a maker bid (or a taker bid against a maker ask). + +## Methods + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### addStrategy + +```solidity +function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable +``` + +This function allows the owner to add a new execution strategy to the protocol. + +_Strategies have an id that is incremental. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------- | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the strategy | +| isMakerBid | bool | Whether the function selector is for maker bid | +| implementation | address | Implementation address | + +### cancelOrderNonces + +```solidity +function cancelOrderNonces(uint256[] orderNonces) external nonpayable +``` + +This function allows a user to cancel an array of order nonces. + +_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | --------------------- | +| orderNonces | uint256[] | Array of order nonces | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### cancelSubsetNonces + +```solidity +function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable +``` + +This function allows a user to cancel an array of subset nonces. + +_It does not check the status of the nonces to save gas._ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ---------------------- | +| subsetNonces | uint256[] | Array of subset nonces | + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### creatorFeeManager + +```solidity +function creatorFeeManager() external view returns (contract ICreatorFeeManager) +``` + +Creator fee manager. + +#### Returns + +| Name | Type | Description | +| ---- | --------------------------- | ----------- | +| \_0 | contract ICreatorFeeManager | undefined | + +### incrementBidAskNonces + +```solidity +function incrementBidAskNonces(bool bid, bool ask) external nonpayable +``` + +This function increments a user's bid/ask nonces. + +_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | --------------------------------------- | +| bid | bool | Whether to increment the user bid nonce | +| ask | bool | Whether to increment the user ask nonce | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### maxCreatorFeeBp + +```solidity +function maxCreatorFeeBp() external view returns (uint16) +``` + +Maximum creator fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | uint16 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### protocolFeeRecipient + +```solidity +function protocolFeeRecipient() external view returns (address) +``` + +Protocol fee recipient. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### strategyInfo + +```solidity +function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +This returns the strategy information for a strategy id. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### updateCreatorFeeManager + +```solidity +function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable +``` + +This function allows the owner to update the creator fee manager address. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ---------------------------------- | +| newCreatorFeeManager | address | Address of the creator fee manager | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +### updateMaxCreatorFeeBp + +```solidity +function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable +``` + +This function allows the owner to update the maximum creator fee (in basis point). + +_The maximum value that can be set is 25%. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------ | ---------------------------------------- | +| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | + +### updateProtocolFeeRecipient + +```solidity +function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable +``` + +This function allows the owner to update the protocol fee recipient. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ---------------------------------- | +| newProtocolFeeRecipient | address | New protocol fee recipient address | + +### updateStrategy + +```solidity +function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable +``` + +This function allows the owner to update parameters for an existing execution strategy. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------------------ | +| strategyId | uint256 | Strategy id | +| isActive | bool | Whether the strategy must be active | +| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | +| newMinTotalFee | uint16 | New minimum total fee (in basis point) | + +### userBidAskNonces + +```solidity +function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) +``` + +This tracks the bid and ask nonces for a user address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------- | ----------- | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### userOrderNonce + +```solidity +function userOrderNonce(address, uint256) external view returns (bytes32) +``` + +This checks whether the order nonce for a user was executed or cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### userSubsetNonce + +```solidity +function userSubsetNonce(address, uint256) external view returns (bool) +``` + +This checks whether the subset nonce for a user was cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| user | address | undefined | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### NewCreatorFeeManager + +```solidity +event NewCreatorFeeManager(address creatorFeeManager) +``` + +It is issued when there is a new creator fee manager. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| creatorFeeManager | address | undefined | + +### NewMaxCreatorFeeBp + +```solidity +event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) +``` + +It is issued when there is a new maximum creator fee (in basis point). + +#### Parameters + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| maxCreatorFeeBp | uint256 | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### NewProtocolFeeRecipient + +```solidity +event NewProtocolFeeRecipient(address protocolFeeRecipient) +``` + +It is issued when there is a new protocol fee recipient address. + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ----------- | +| protocolFeeRecipient | address | undefined | + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ----------- | +| user | address | undefined | +| orderNonces | uint256[] | undefined | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| user | address | undefined | +| subsetNonces | uint256[] | undefined | + +## Errors + +### CreatorFeeBpTooHigh + +```solidity +error CreatorFeeBpTooHigh() +``` + +It is returned if the creator fee (in basis point) is too high. + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### NewProtocolFeeRecipientCannotBeNullAddress + +```solidity +error NewProtocolFeeRecipientCannotBeNullAddress() +``` + +It is returned if the new protocol fee recipient is set to address(0). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NoSelectorForStrategy + +```solidity +error NoSelectorForStrategy() +``` + +It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### OutsideOfTimeRange + +```solidity +error OutsideOfTimeRange() +``` + +It is returned if the current block timestamp is not between start and end times in the maker order. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotAvailable + +```solidity +error StrategyNotAvailable(uint256 strategyId) +``` + +It is returned if the strategy id has no implementation. + +_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| strategyId | uint256 | undefined | + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/InheritedStrategy.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/InheritedStrategy.md new file mode 100644 index 00000000..022cce57 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/InheritedStrategy.md @@ -0,0 +1,9 @@ +# InheritedStrategy + +_LooksRare protocol team (👀,💎)_ + +> InheritedStrategy + +This contract handles the verification of parameters for standard transactions. It does not verify the taker struct's itemIds and amounts array as well as minPrice (taker ask) / maxPrice (taker bid) because before the taker executes the transaction and the maker itemIds/amounts/price should have already been confirmed off-chain. + +_A standard transaction (bid or ask) is mapped to strategyId = 0._ diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/LooksRareProtocol.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/LooksRareProtocol.md new file mode 100644 index 00000000..cc542c7e --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/LooksRareProtocol.md @@ -0,0 +1,1157 @@ +# LooksRareProtocol + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> LooksRareProtocol + +This contract is the core smart contract of the LooksRare protocol ("v2"). It is the main entry point for users to initiate transactions with taker orders and manage the cancellation of maker orders, which exist off-chain. ~~~~~~ ~~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~~~~~~~ ~~~~ ~~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~ ~~~~~~~ ~~~ ~~~- ~~~~~~~~ ~~~~ ~~~ ~~~~ ~~~~ ~~~ ~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~~ ~~~ ~~~ ~~~~~ ~~~ ~~~~~~ ~~~~~~ ~~~ ~~~~~ ~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~~~ ~~~~~~ ~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~ ~~~~~ ~~~ ~~~~~~ ~~~~~~ ~~~ ~~~~~ ~~~ ~~~ ~~~~~~~~~~ ~~~ ~~~ ~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~ ~~~ ~~~~ ~~~~ ~~~ ~~~~ ~~~~~~~~ ~~~~ ~~~ ~~~~~~~ ~~~~~~~ ~~~ ~~~ ~~~~~~~~ ~~~~ ~~~~ ~~~~~~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~~ ~~~~~~ + +## Methods + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### WETH + +```solidity +function WETH() external view returns (address) +``` + +Wrapped ETH. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### addStrategy + +```solidity +function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable +``` + +This function allows the owner to add a new execution strategy to the protocol. + +_Strategies have an id that is incremental. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------- | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the strategy | +| isMakerBid | bool | Whether the function selector is for maker bid | +| implementation | address | Implementation address | + +### cancelOrderNonces + +```solidity +function cancelOrderNonces(uint256[] orderNonces) external nonpayable +``` + +This function allows a user to cancel an array of order nonces. + +_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | --------------------- | +| orderNonces | uint256[] | Array of order nonces | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### cancelSubsetNonces + +```solidity +function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable +``` + +This function allows a user to cancel an array of subset nonces. + +_It does not check the status of the nonces to save gas._ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ---------------------- | +| subsetNonces | uint256[] | Array of subset nonces | + +### chainId + +```solidity +function chainId() external view returns (uint256) +``` + +Current chainId. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### creatorFeeManager + +```solidity +function creatorFeeManager() external view returns (contract ICreatorFeeManager) +``` + +Creator fee manager. + +#### Returns + +| Name | Type | Description | +| ---- | --------------------------- | ----------- | +| \_0 | contract ICreatorFeeManager | undefined | + +### domainSeparator + +```solidity +function domainSeparator() external view returns (bytes32) +``` + +Current domain separator. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### executeMultipleTakerBids + +```solidity +function executeMultipleTakerBids(OrderStructs.Taker[] takerBids, OrderStructs.Maker[] makerAsks, bytes[] makerSignatures, OrderStructs.MerkleTree[] merkleTrees, bool isAtomic) external payable +``` + +#### Parameters + +| Name | Type | Description | +| --------------- | ------------------------- | ----------- | +| takerBids | OrderStructs.Taker[] | undefined | +| makerAsks | OrderStructs.Maker[] | undefined | +| makerSignatures | bytes[] | undefined | +| merkleTrees | OrderStructs.MerkleTree[] | undefined | +| isAtomic | bool | undefined | + +### executeTakerAsk + +```solidity +function executeTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +### executeTakerBid + +```solidity +function executeTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external payable +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +### hashBatchOrder + +```solidity +function hashBatchOrder(bytes32 root, uint256 proofLength) external pure returns (bytes32 batchOrderHash) +``` + +This function returns the hash of the concatenation of batch order type hash and merkle root. + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ------------------- | +| root | bytes32 | Merkle root | +| proofLength | uint256 | Merkle proof length | + +#### Returns + +| Name | Type | Description | +| -------------- | ------- | -------------------- | +| batchOrderHash | bytes32 | The batch order hash | + +### incrementBidAskNonces + +```solidity +function incrementBidAskNonces(bool bid, bool ask) external nonpayable +``` + +This function increments a user's bid/ask nonces. + +_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | --------------------------------------- | +| bid | bool | Whether to increment the user bid nonce | +| ask | bool | Whether to increment the user ask nonce | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### maxCreatorFeeBp + +```solidity +function maxCreatorFeeBp() external view returns (uint16) +``` + +Maximum creator fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | uint16 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### protocolFeeRecipient + +```solidity +function protocolFeeRecipient() external view returns (address) +``` + +Protocol fee recipient. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### restrictedExecuteTakerBid + +```solidity +function restrictedExecuteTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, address sender, bytes32 orderHash) external nonpayable returns (uint256 protocolFeeAmount) +``` + +#### Parameters + +| Name | Type | Description | +| --------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | +| sender | address | undefined | +| orderHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| protocolFeeAmount | uint256 | undefined | + +### strategyInfo + +```solidity +function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +This returns the strategy information for a strategy id. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### transferManager + +```solidity +function transferManager() external view returns (contract TransferManager) +``` + +Transfer manager for ERC721, ERC1155 and Hypercerts. + +#### Returns + +| Name | Type | Description | +| ---- | ------------------------ | ----------- | +| \_0 | contract TransferManager | undefined | + +### updateCreatorFeeManager + +```solidity +function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable +``` + +This function allows the owner to update the creator fee manager address. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ---------------------------------- | +| newCreatorFeeManager | address | Address of the creator fee manager | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +### updateDomainSeparator + +```solidity +function updateDomainSeparator() external nonpayable +``` + +This function allows the owner to update the domain separator (if possible). + +_Only callable by owner. If there is a fork of the network with a new chainId, it allows the owner to reset the domain separator for the new chain id._ + +### updateETHGasLimitForTransfer + +```solidity +function updateETHGasLimitForTransfer(uint256 newGasLimitETHTransfer) external nonpayable +``` + +This function allows the owner to update the maximum ETH gas limit for a standard transfer. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------ | +| newGasLimitETHTransfer | uint256 | New gas limit for ETH transfer | + +### updateMaxCreatorFeeBp + +```solidity +function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable +``` + +This function allows the owner to update the maximum creator fee (in basis point). + +_The maximum value that can be set is 25%. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------ | ---------------------------------------- | +| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | + +### updateProtocolFeeRecipient + +```solidity +function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable +``` + +This function allows the owner to update the protocol fee recipient. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ---------------------------------- | +| newProtocolFeeRecipient | address | New protocol fee recipient address | + +### updateStrategy + +```solidity +function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable +``` + +This function allows the owner to update parameters for an existing execution strategy. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------------------ | +| strategyId | uint256 | Strategy id | +| isActive | bool | Whether the strategy must be active | +| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | +| newMinTotalFee | uint16 | New minimum total fee (in basis point) | + +### userBidAskNonces + +```solidity +function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) +``` + +This tracks the bid and ask nonces for a user address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------- | ----------- | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### userOrderNonce + +```solidity +function userOrderNonce(address, uint256) external view returns (bytes32) +``` + +This checks whether the order nonce for a user was executed or cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### userSubsetNonce + +```solidity +function userSubsetNonce(address, uint256) external view returns (bool) +``` + +This checks whether the subset nonce for a user was cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| user | address | undefined | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### NewCreatorFeeManager + +```solidity +event NewCreatorFeeManager(address creatorFeeManager) +``` + +It is issued when there is a new creator fee manager. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| creatorFeeManager | address | undefined | + +### NewDomainSeparator + +```solidity +event NewDomainSeparator() +``` + +It is emitted if there is a change in the domain separator. + +### NewGasLimitETHTransfer + +```solidity +event NewGasLimitETHTransfer(uint256 gasLimitETHTransfer) +``` + +It is emitted when there is a new gas limit for a ETH transfer (before it is wrapped to WETH). + +#### Parameters + +| Name | Type | Description | +| ------------------- | ------- | ----------- | +| gasLimitETHTransfer | uint256 | undefined | + +### NewMaxCreatorFeeBp + +```solidity +event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) +``` + +It is issued when there is a new maximum creator fee (in basis point). + +#### Parameters + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| maxCreatorFeeBp | uint256 | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### NewProtocolFeeRecipient + +```solidity +event NewProtocolFeeRecipient(address protocolFeeRecipient) +``` + +It is issued when there is a new protocol fee recipient address. + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ----------- | +| protocolFeeRecipient | address | undefined | + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ----------- | +| user | address | undefined | +| orderNonces | uint256[] | undefined | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| user | address | undefined | +| subsetNonces | uint256[] | undefined | + +### TakerAsk + +```solidity +event TakerAsk(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address askUser, address bidUser, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) +``` + +It is emitted when a taker ask transaction is completed. + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ---------------------------------------------- | ----------- | +| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | undefined | +| askUser | address | undefined | +| bidUser | address | undefined | +| strategyId | uint256 | undefined | +| currency | address | undefined | +| collection | address | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| feeRecipients | address[2] | undefined | +| feeAmounts | uint256[3] | undefined | + +### TakerBid + +```solidity +event TakerBid(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address bidUser, address bidRecipient, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) +``` + +It is emitted when a taker bid transaction is completed. + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ---------------------------------------------- | ----------- | +| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | undefined | +| bidUser | address | undefined | +| bidRecipient | address | undefined | +| strategyId | uint256 | undefined | +| currency | address | undefined | +| collection | address | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| feeRecipients | address[2] | undefined | +| feeAmounts | uint256[3] | undefined | + +## Errors + +### CallerInvalid + +```solidity +error CallerInvalid() +``` + +It is returned if the function cannot be called by the sender. + +### ChainIdInvalid + +```solidity +error ChainIdInvalid() +``` + +It is returned if the domain separator should change. + +### CreatorFeeBpTooHigh + +```solidity +error CreatorFeeBpTooHigh() +``` + +It is returned if the creator fee (in basis point) is too high. + +### CurrencyInvalid + +```solidity +error CurrencyInvalid() +``` + +It is returned if the currency is invalid. + +### ERC20TransferFromFail + +```solidity +error ERC20TransferFromFail() +``` + +It is emitted if the ERC20 transferFrom fails. + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### MerkleProofInvalid + +```solidity +error MerkleProofInvalid() +``` + +It is returned if the merkle proof provided is invalid. + +### MerkleProofTooLarge + +```solidity +error MerkleProofTooLarge(uint256 length) +``` + +It is returned if the length of the merkle proof provided is greater than tolerated. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ------------ | +| length | uint256 | Proof length | + +### NewGasLimitETHTransferTooLow + +```solidity +error NewGasLimitETHTransferTooLow() +``` + +It is returned if the gas limit for a standard ETH transfer is too low. + +### NewProtocolFeeRecipientCannotBeNullAddress + +```solidity +error NewProtocolFeeRecipientCannotBeNullAddress() +``` + +It is returned if the new protocol fee recipient is set to address(0). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NoSelectorForStrategy + +```solidity +error NoSelectorForStrategy() +``` + +It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. + +### NoncesInvalid + +```solidity +error NoncesInvalid() +``` + +It is returned if the nonces are invalid. + +### NotAContract + +```solidity +error NotAContract() +``` + +It is emitted if the call recipient is not a contract. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### NullSignerAddress + +```solidity +error NullSignerAddress() +``` + +It is emitted if the signer is null. + +### OutsideOfTimeRange + +```solidity +error OutsideOfTimeRange() +``` + +It is returned if the current block timestamp is not between start and end times in the maker order. + +### QuoteTypeInvalid + +```solidity +error QuoteTypeInvalid() +``` + +It is returned if the maker quote type is invalid. + +### ReentrancyFail + +```solidity +error ReentrancyFail() +``` + +This is returned when there is a reentrant call. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### SameDomainSeparator + +```solidity +error SameDomainSeparator() +``` + +It is returned if the domain separator cannot be updated (i.e. the chainId is the same). + +### SignatureEOAInvalid + +```solidity +error SignatureEOAInvalid() +``` + +It is emitted if the signature is invalid for an EOA (the address recovered is not the expected one). + +### SignatureERC1271Invalid + +```solidity +error SignatureERC1271Invalid() +``` + +It is emitted if the signature is invalid for a ERC1271 contract signer. + +### SignatureLengthInvalid + +```solidity +error SignatureLengthInvalid(uint256 length) +``` + +It is emitted if the signature's length is neither 64 nor 65 bytes. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| length | uint256 | undefined | + +### SignatureParameterSInvalid + +```solidity +error SignatureParameterSInvalid() +``` + +It is emitted if the signature is invalid due to S parameter. + +### SignatureParameterVInvalid + +```solidity +error SignatureParameterVInvalid(uint8 v) +``` + +It is emitted if the signature is invalid due to V parameter. + +#### Parameters + +| Name | Type | Description | +| ---- | ----- | ----------- | +| v | uint8 | undefined | + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotAvailable + +```solidity +error StrategyNotAvailable(uint256 strategyId) +``` + +It is returned if the strategy id has no implementation. + +_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| strategyId | uint256 | undefined | + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### UnsupportedCollectionType + +```solidity +error UnsupportedCollectionType() +``` + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/NonceManager.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/NonceManager.md new file mode 100644 index 00000000..fea95495 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/NonceManager.md @@ -0,0 +1,193 @@ +# NonceManager + +_LooksRare protocol team (👀,💎)_ + +> NonceManager + +This contract handles the nonce logic that is used for invalidating maker orders that exist off-chain. The nonce logic revolves around three parts at the user level: - order nonce (orders sharing an order nonce are conditional, OCO-like) - subset (orders can be grouped under a same subset) - bid/ask (all orders can be executed only if the bid/ask nonce matches the user's one on-chain) Only the order nonce is invalidated at the time of the execution of a maker order that contains it. + +## Methods + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### cancelOrderNonces + +```solidity +function cancelOrderNonces(uint256[] orderNonces) external nonpayable +``` + +This function allows a user to cancel an array of order nonces. + +_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | --------------------- | +| orderNonces | uint256[] | Array of order nonces | + +### cancelSubsetNonces + +```solidity +function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable +``` + +This function allows a user to cancel an array of subset nonces. + +_It does not check the status of the nonces to save gas._ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ---------------------- | +| subsetNonces | uint256[] | Array of subset nonces | + +### incrementBidAskNonces + +```solidity +function incrementBidAskNonces(bool bid, bool ask) external nonpayable +``` + +This function increments a user's bid/ask nonces. + +_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | --------------------------------------- | +| bid | bool | Whether to increment the user bid nonce | +| ask | bool | Whether to increment the user ask nonce | + +### userBidAskNonces + +```solidity +function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) +``` + +This tracks the bid and ask nonces for a user address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------- | ----------- | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### userOrderNonce + +```solidity +function userOrderNonce(address, uint256) external view returns (bytes32) +``` + +This checks whether the order nonce for a user was executed or cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### userSubsetNonce + +```solidity +function userSubsetNonce(address, uint256) external view returns (bool) +``` + +This checks whether the subset nonce for a user was cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Events + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| user | address | undefined | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ----------- | +| user | address | undefined | +| orderNonces | uint256[] | undefined | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| user | address | undefined | +| subsetNonces | uint256[] | undefined | + +## Errors + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/ProtocolFeeRecipient.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/ProtocolFeeRecipient.md new file mode 100644 index 00000000..36f6a35c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/ProtocolFeeRecipient.md @@ -0,0 +1,75 @@ +# ProtocolFeeRecipient + +_LooksRare protocol team (👀,💎)_ + +> ProtocolFeeRecipient + +This contract is used to receive protocol fees and transfer them to the fee sharing setter. Fee sharing setter cannot receive ETH directly, so we need to use this contract as a middleman to convert ETH into WETH before sending it. + +## Methods + +### FEE_SHARING_SETTER + +```solidity +function FEE_SHARING_SETTER() external view returns (address) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### WETH + +```solidity +function WETH() external view returns (contract IWETH) +``` + +#### Returns + +| Name | Type | Description | +| ---- | -------------- | ----------- | +| \_0 | contract IWETH | undefined | + +### transferERC20 + +```solidity +function transferERC20(address currency) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ---------------------- | +| currency | address | ERC20 currency address | + +### transferETH + +```solidity +function transferETH() external nonpayable +``` + +## Errors + +### ERC20TransferFail + +```solidity +error ERC20TransferFail() +``` + +It is emitted if the ERC20 transfer fails. + +### NotAContract + +```solidity +error NotAContract() +``` + +It is emitted if the call recipient is not a contract. + +### NothingToTransfer + +```solidity +error NothingToTransfer() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/StrategyManager.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/StrategyManager.md new file mode 100644 index 00000000..a55f3985 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/StrategyManager.md @@ -0,0 +1,391 @@ +# StrategyManager + +_LooksRare protocol team (👀,💎)_ + +> StrategyManager + +This contract handles the addition and the update of execution strategies. + +## Methods + +### addStrategy + +```solidity +function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable +``` + +This function allows the owner to add a new execution strategy to the protocol. + +_Strategies have an id that is incremental. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------- | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the strategy | +| isMakerBid | bool | Whether the function selector is for maker bid | +| implementation | address | Implementation address | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### strategyInfo + +```solidity +function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +This returns the strategy information for a strategy id. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +### updateStrategy + +```solidity +function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable +``` + +This function allows the owner to update parameters for an existing execution strategy. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------------------ | +| strategyId | uint256 | Strategy id | +| isActive | bool | Whether the strategy must be active | +| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | +| newMinTotalFee | uint16 | New minimum total fee (in basis point) | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | + +## Errors + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/TransferManager.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/TransferManager.md new file mode 100644 index 00000000..c6766114 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/TransferManager.md @@ -0,0 +1,553 @@ +# TransferManager + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> TransferManager + +This contract provides the transfer functions for ERC721/ERC1155/Hypercert for contracts that require them. Collection type "0" refers to ERC721 transfer functions. Collection type "1" refers to ERC1155 transfer functions. Collection type "2" refers to Hypercert transfer functions. + +_"Safe" transfer functions for ERC721 are not implemented since they come with added gas costs to verify if the recipient is a contract as it requires verifying the receiver interface is valid._ + +## Methods + +### allowOperator + +```solidity +function allowOperator(address operator) external nonpayable +``` + +This function allows an operator to be added for the shared transfer system. Once the operator is allowed, users can grant NFT approvals to this operator. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ------------------------- | +| operator | address | Operator address to allow | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### grantApprovals + +```solidity +function grantApprovals(address[] operators) external nonpayable +``` + +This function allows a user to grant approvals for an array of operators. Users cannot grant approvals if the operator is not allowed by this contract's owner. + +_Each operator address must be globally allowed to be approved._ + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | --------------------------- | +| operators | address[] | Array of operator addresses | + +### hasUserApprovedOperator + +```solidity +function hasUserApprovedOperator(address, address) external view returns (bool) +``` + +This returns whether the user has approved the operator address. The first address is the user and the second address is the operator (e.g. LooksRareProtocol). + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isOperatorAllowed + +```solidity +function isOperatorAllowed(address) external view returns (bool) +``` + +This returns whether the operator address is allowed by this contract's owner. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### removeOperator + +```solidity +function removeOperator(address operator) external nonpayable +``` + +This function allows the user to remove an operator for the shared transfer system. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | -------------------------- | +| operator | address | Operator address to remove | + +### revokeApprovals + +```solidity +function revokeApprovals(address[] operators) external nonpayable +``` + +This function allows a user to revoke existing approvals for an array of operators. + +_Each operator address must be approved at the user level to be revoked._ + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | --------------------------- | +| operators | address[] | Array of operator addresses | + +### splitItemsHypercert + +```solidity +function splitItemsHypercert(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable +``` + +This function splits and transfers a fraction of a hypercert. + +_It does not allow batch transferring._ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| from | address | Sender address | +| to | address | Recipient address | +| itemIds | uint256[] | Array of itemIds | +| amounts | uint256[] | Array of amounts | + +### transferBatchItemsAcrossCollections + +```solidity +function transferBatchItemsAcrossCollections(ITransferManager.BatchTransferItem[] items, address from, address to) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| ----- | ------------------------------------ | ----------- | +| items | ITransferManager.BatchTransferItem[] | undefined | +| from | address | undefined | +| to | address | undefined | + +### transferItemsERC1155 + +```solidity +function transferItemsERC1155(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable +``` + +This function transfers items for a single ERC1155 collection. + +_It does not allow batch transferring if from = msg.sender since native function should be used._ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| from | address | Sender address | +| to | address | Recipient address | +| itemIds | uint256[] | Array of itemIds | +| amounts | uint256[] | Array of amounts | + +### transferItemsERC721 + +```solidity +function transferItemsERC721(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable +``` + +This function transfers items for a single ERC721 collection. + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| from | address | Sender address | +| to | address | Recipient address | +| itemIds | uint256[] | Array of itemIds | +| amounts | uint256[] | Array of amounts | + +### transferItemsHypercert + +```solidity +function transferItemsHypercert(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable +``` + +This function transfers items for a single Hypercert. + +_It does not allow batch transferring if from = msg.sender since native function should be used._ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| from | address | Sender address | +| to | address | Recipient address | +| itemIds | uint256[] | Array of itemIds | +| amounts | uint256[] | Array of amounts | + +## Events + +### ApprovalsGranted + +```solidity +event ApprovalsGranted(address user, address[] operators) +``` + +It is emitted if operators' approvals to transfer NFTs are granted by a user. + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | ----------- | +| user | address | undefined | +| operators | address[] | undefined | + +### ApprovalsRemoved + +```solidity +event ApprovalsRemoved(address user, address[] operators) +``` + +It is emitted if operators' approvals to transfer NFTs are revoked by a user. + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | ----------- | +| user | address | undefined | +| operators | address[] | undefined | + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### OperatorAllowed + +```solidity +event OperatorAllowed(address operator) +``` + +It is emitted if a new operator is added to the global allowlist. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | + +### OperatorRemoved + +```solidity +event OperatorRemoved(address operator) +``` + +It is emitted if an operator is removed from the global allowlist. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | + +## Errors + +### AmountInvalid + +```solidity +error AmountInvalid() +``` + +It is returned if the amount is invalid. For ERC721, any number that is not 1. For ERC1155 and Hypercert, if amount is 0. + +### ERC1155SafeBatchTransferFromFail + +```solidity +error ERC1155SafeBatchTransferFromFail() +``` + +It is emitted if the ERC1155 safeBatchTransferFrom fails. + +### ERC1155SafeTransferFromFail + +```solidity +error ERC1155SafeTransferFromFail() +``` + +It is emitted if the ERC1155 safeTransferFrom fails. + +### ERC721TransferFromFail + +```solidity +error ERC721TransferFromFail() +``` + +It is emitted if the ERC721 transferFrom fails. + +### HypercertSplitFractionError + +```solidity +error HypercertSplitFractionError() +``` + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotAContract + +```solidity +error NotAContract() +``` + +It is emitted if the call recipient is not a contract. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### OperatorAlreadyAllowed + +```solidity +error OperatorAlreadyAllowed() +``` + +It is returned if the transfer caller is already allowed by the owner. + +_This error can only be returned for owner operations._ + +### OperatorAlreadyApprovedByUser + +```solidity +error OperatorAlreadyApprovedByUser() +``` + +It is returned if the operator to approve has already been approved by the user. + +### OperatorNotAllowed + +```solidity +error OperatorNotAllowed() +``` + +It is returned if the operator to approve is not in the global allowlist defined by the owner. + +_This error can be returned if the user tries to grant approval to an operator address not in the allowlist or if the owner tries to remove the operator from the global allowlist._ + +### OperatorNotApprovedByUser + +```solidity +error OperatorNotApprovedByUser() +``` + +It is returned if the operator to revoke has not been previously approved by the user. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferCallerInvalid + +```solidity +error TransferCallerInvalid() +``` + +It is returned if the transfer caller is invalid. For a transfer called to be valid, the operator must be in the global allowlist and approved by the 'from' user. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/TransferSelectorNFT.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/TransferSelectorNFT.md new file mode 100644 index 00000000..9011bd50 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/TransferSelectorNFT.md @@ -0,0 +1,779 @@ +# TransferSelectorNFT + +_LooksRare protocol team (👀,💎); bitbeckers;_ + +> TransferSelectorNFT + +This contract handles the logic for transferring non-fungible items. + +## Methods + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### addStrategy + +```solidity +function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable +``` + +This function allows the owner to add a new execution strategy to the protocol. + +_Strategies have an id that is incremental. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------- | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the strategy | +| isMakerBid | bool | Whether the function selector is for maker bid | +| implementation | address | Implementation address | + +### cancelOrderNonces + +```solidity +function cancelOrderNonces(uint256[] orderNonces) external nonpayable +``` + +This function allows a user to cancel an array of order nonces. + +_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | --------------------- | +| orderNonces | uint256[] | Array of order nonces | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### cancelSubsetNonces + +```solidity +function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable +``` + +This function allows a user to cancel an array of subset nonces. + +_It does not check the status of the nonces to save gas._ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ---------------------- | +| subsetNonces | uint256[] | Array of subset nonces | + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### creatorFeeManager + +```solidity +function creatorFeeManager() external view returns (contract ICreatorFeeManager) +``` + +Creator fee manager. + +#### Returns + +| Name | Type | Description | +| ---- | --------------------------- | ----------- | +| \_0 | contract ICreatorFeeManager | undefined | + +### incrementBidAskNonces + +```solidity +function incrementBidAskNonces(bool bid, bool ask) external nonpayable +``` + +This function increments a user's bid/ask nonces. + +_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | --------------------------------------- | +| bid | bool | Whether to increment the user bid nonce | +| ask | bool | Whether to increment the user ask nonce | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### maxCreatorFeeBp + +```solidity +function maxCreatorFeeBp() external view returns (uint16) +``` + +Maximum creator fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | uint16 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### protocolFeeRecipient + +```solidity +function protocolFeeRecipient() external view returns (address) +``` + +Protocol fee recipient. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### strategyInfo + +```solidity +function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +This returns the strategy information for a strategy id. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### transferManager + +```solidity +function transferManager() external view returns (contract TransferManager) +``` + +Transfer manager for ERC721, ERC1155 and Hypercerts. + +#### Returns + +| Name | Type | Description | +| ---- | ------------------------ | ----------- | +| \_0 | contract TransferManager | undefined | + +### updateCreatorFeeManager + +```solidity +function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable +``` + +This function allows the owner to update the creator fee manager address. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ---------------------------------- | +| newCreatorFeeManager | address | Address of the creator fee manager | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +### updateMaxCreatorFeeBp + +```solidity +function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable +``` + +This function allows the owner to update the maximum creator fee (in basis point). + +_The maximum value that can be set is 25%. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------ | ---------------------------------------- | +| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | + +### updateProtocolFeeRecipient + +```solidity +function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable +``` + +This function allows the owner to update the protocol fee recipient. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ---------------------------------- | +| newProtocolFeeRecipient | address | New protocol fee recipient address | + +### updateStrategy + +```solidity +function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable +``` + +This function allows the owner to update parameters for an existing execution strategy. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------------------ | +| strategyId | uint256 | Strategy id | +| isActive | bool | Whether the strategy must be active | +| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | +| newMinTotalFee | uint16 | New minimum total fee (in basis point) | + +### userBidAskNonces + +```solidity +function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) +``` + +This tracks the bid and ask nonces for a user address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------- | ----------- | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### userOrderNonce + +```solidity +function userOrderNonce(address, uint256) external view returns (bytes32) +``` + +This checks whether the order nonce for a user was executed or cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### userSubsetNonce + +```solidity +function userSubsetNonce(address, uint256) external view returns (bool) +``` + +This checks whether the subset nonce for a user was cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| user | address | undefined | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### NewCreatorFeeManager + +```solidity +event NewCreatorFeeManager(address creatorFeeManager) +``` + +It is issued when there is a new creator fee manager. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| creatorFeeManager | address | undefined | + +### NewMaxCreatorFeeBp + +```solidity +event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) +``` + +It is issued when there is a new maximum creator fee (in basis point). + +#### Parameters + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| maxCreatorFeeBp | uint256 | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### NewProtocolFeeRecipient + +```solidity +event NewProtocolFeeRecipient(address protocolFeeRecipient) +``` + +It is issued when there is a new protocol fee recipient address. + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ----------- | +| protocolFeeRecipient | address | undefined | + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ----------- | +| user | address | undefined | +| orderNonces | uint256[] | undefined | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| user | address | undefined | +| subsetNonces | uint256[] | undefined | + +## Errors + +### CreatorFeeBpTooHigh + +```solidity +error CreatorFeeBpTooHigh() +``` + +It is returned if the creator fee (in basis point) is too high. + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### NewProtocolFeeRecipientCannotBeNullAddress + +```solidity +error NewProtocolFeeRecipientCannotBeNullAddress() +``` + +It is returned if the new protocol fee recipient is set to address(0). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NoSelectorForStrategy + +```solidity +error NoSelectorForStrategy() +``` + +It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### OutsideOfTimeRange + +```solidity +error OutsideOfTimeRange() +``` + +It is returned if the current block timestamp is not between start and end times in the maker order. + +### ReentrancyFail + +```solidity +error ReentrancyFail() +``` + +This is returned when there is a reentrant call. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotAvailable + +```solidity +error StrategyNotAvailable(uint256 strategyId) +``` + +It is returned if the strategy id has no implementation. + +_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| strategyId | uint256 | undefined | + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### UnsupportedCollectionType + +```solidity +error UnsupportedCollectionType() +``` + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md new file mode 100644 index 00000000..37866658 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md @@ -0,0 +1,41 @@ +# BaseStrategy + +_LooksRare protocol team (👀,💎)_ + +> BaseStrategy + +## Methods + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerOrder, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerOrder | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md new file mode 100644 index 00000000..c9503939 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md @@ -0,0 +1,212 @@ +# BaseStrategyChainlinkPriceLatency + +_LooksRare protocol team (👀,💎)_ + +> BaseStrategyChainlinkPriceLatency + +This contract allows the owner to define the maximum acceptable Chainlink price latency. + +## Methods + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### maxLatency + +```solidity +function maxLatency() external view returns (uint256) +``` + +Maximum latency accepted after which the execution strategy rejects the retrieved price. For ETH, it cannot be higher than 3,600 as Chainlink will at least update the price every 3,600 seconds, provided ETH's price does not deviate more than 0.5%. For NFTs, it cannot be higher than 86,400 as Chainlink will at least update the price every 86,400 seconds, provided ETH's price does not deviate more than 2%. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +## Errors + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md new file mode 100644 index 00000000..e2d77dd3 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md @@ -0,0 +1,342 @@ +# StrategyChainlinkUSDDynamicAsk + +_LooksRare protocol team (👀,💎)_ + +> StrategyChainlinkUSDDynamicAsk + +This contract allows a seller to sell an NFT priced in USD and the receivable amount to be in ETH. + +## Methods + +### ETH_USD_PRICE_FEED_DECIMALS + +```solidity +function ETH_USD_PRICE_FEED_DECIMALS() external view returns (uint256) +``` + +_It is possible to call priceFeed.decimals() to get the decimals, but to save gas, it is hard coded instead._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### WETH + +```solidity +function WETH() external view returns (address) +``` + +Wrapped ether (WETH) address. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### executeStrategyWithTakerBid + +```solidity +function executeStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerAsk | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +### maxLatency + +```solidity +function maxLatency() external view returns (uint256) +``` + +Maximum latency accepted after which the execution strategy rejects the retrieved price. For ETH, it cannot be higher than 3,600 as Chainlink will at least update the price every 3,600 seconds, provided ETH's price does not deviate more than 0.5%. For NFTs, it cannot be higher than 86,400 as Chainlink will at least update the price every 86,400 seconds, provided ETH's price does not deviate more than 2%. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### priceFeed + +```solidity +function priceFeed() external view returns (contract AggregatorV3Interface) +``` + +ETH/USD Chainlink price feed + +#### Returns + +| Name | Type | Description | +| ---- | ------------------------------ | ----------- | +| \_0 | contract AggregatorV3Interface | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +## Errors + +### BidTooLow + +```solidity +error BidTooLow() +``` + +It is returned if the bid price is too low for the ask user. + +### ChainlinkPriceInvalid + +```solidity +error ChainlinkPriceInvalid() +``` + +It is returned if the Chainlink price is invalid (e.g. negative). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. + +### PriceNotRecentEnough + +```solidity +error PriceNotRecentEnough() +``` + +It is returned if the current block time relative to the latest price's update time is greater than the latency tolerance. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md new file mode 100644 index 00000000..ddec4495 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md @@ -0,0 +1,127 @@ +# StrategyCollectionOffer + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> StrategyCollectionOffer + +This contract offers execution strategies for users to create maker bid offers for items in a collection. There are two available functions: 1. executeCollectionStrategyWithTakerAsk --> it applies to all itemIds in a collection 2. executeCollectionStrategyWithTakerAskWithProof --> it allows adding merkle proof criteria for tokenIds. 2. executeCollectionStrategyWithTakerAskWithAllowlist --> it allows adding merkle proof criteria for accounts.The bidder can only bid on 1 item id at a time. 1. If ERC721, the amount must be 1. 2. If ERC1155, the amount can be greater than 1. 3. If Hypercert, the amount must be 1 (fractions are NFTs) + +## Methods + +### executeCollectionStrategyWithTakerAsk + +```solidity +function executeCollectionStrategyWithTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### executeCollectionStrategyWithTakerAskWithAllowlist + +```solidity +function executeCollectionStrategyWithTakerAskWithAllowlist(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### executeCollectionStrategyWithTakerAskWithProof + +```solidity +function executeCollectionStrategyWithTakerAskWithProof(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerBid, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerBid | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +## Errors + +### MerkleProofInvalid + +```solidity +error MerkleProofInvalid() +``` + +It is returned if the merkle proof provided is invalid. + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md new file mode 100644 index 00000000..1227878d --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md @@ -0,0 +1,83 @@ +# StrategyDutchAuction + +_LooksRare protocol team (👀,💎)_ + +> StrategyDutchAuction + +This contract offers a single execution strategy for users to create Dutch auctions. + +## Methods + +### executeStrategyWithTakerBid + +```solidity +function executeStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerAsk | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +## Errors + +### BidTooLow + +```solidity +error BidTooLow() +``` + +It is returned if the bid price is too low for the ask user. + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md new file mode 100644 index 00000000..daa427e4 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md @@ -0,0 +1,123 @@ +# StrategyHypercertFractionOffer + +_LooksRare protocol team (👀,💎); bitbeckers;_ + +> StrategyHypercertFractionOffer + +This contract offers a single execution strategy for users to bid on a specific amount of units in an hypercerts that's for sale. Example: Alice has 100 units of a hypercert (id: 42) for sale at a minimum price of 0.001 ETH/unit. Bob wants to buy 10 units. Bob can create a taker bid order with the following parameters: - unitAmount: 10 - acceptedTokenAmount: 1000000000000000 (0.001 ETH in wei) - acceptedTokenAddress: 0x0000000000000000000000000000000000000000 - proof: [0xsdadfa....s9fds,0xdasdas...asff8e] This strategy will validate the available units and the price.This contract offers execution strategies for users to create maker bid offers for items in a collection. There are three available functions: 1. executeCollectionStrategyWithTakerAsk --> it applies to all itemIds in a collection 2. executeCollectionStrategyWithTakerAskWithAllowlist --> it allows adding merkle proof criteria for accounts.The bidder can only bid on 1 item id at a time. 1. If ERC721, the amount must be 1. 2. If ERC1155, the amount can be greater than 1. 3. If Hypercert, the amount can be greater than 1 because they represent units held by the hypercert. + +_Use cases can include tiered pricing; think early bird tickets._ + +## Methods + +### executeHypercertFractionStrategyWithTakerBid + +```solidity +function executeHypercertFractionStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### executeHypercertFractionStrategyWithTakerBidWithAllowlist + +```solidity +function executeHypercertFractionStrategyWithTakerBidWithAllowlist(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerAsk | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +## Errors + +### AmountInvalid + +```solidity +error AmountInvalid() +``` + +It is returned if the amount is invalid. For ERC721, any number that is not 1. For ERC1155 and Hypercert, if amount is 0. + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### MerkleProofInvalid + +```solidity +error MerkleProofInvalid() +``` + +It is returned if the merkle proof provided is invalid. + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md new file mode 100644 index 00000000..6a1f0cd5 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md @@ -0,0 +1,75 @@ +# StrategyItemIdsRange + +_LooksRare protocol team (👀,💎)_ + +> StrategyItemIdsRange + +This contract offers a single execution strategy for users to bid on a specific amount of items in a range bounded by 2 item ids. + +## Methods + +### executeStrategyWithTakerAsk + +```solidity +function executeStrategyWithTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerBid, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerBid | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +## Errors + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md new file mode 100644 index 00000000..76918fc5 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md @@ -0,0 +1,215 @@ +# OrderValidatorV2A + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> OrderValidatorV2A + +This contract is used to check the validity of maker ask/bid orders in the LooksRareProtocol (v2). It performs checks for: 1. Protocol allowlist issues (i.e. currency or strategy not allowed) 2. Maker order-specific issues (e.g., order invalid due to format or other-strategy specific issues) 3. Nonce related issues (e.g., nonce executed or cancelled) 4. Signature related issues and merkle tree parameters 5. Timestamp related issues (e.g., order expired) 6. Asset-related issues for ERC20/ERC721/ERC1155/Hypercerts (approvals and balances) 7. Collection-type suggestions 8. Transfer manager related issues 9. Creator fee related issues (e.g., creator fee too high, ERC2981 bundles) + +_This version does not handle strategies with partial fills._ + +## Methods + +### CRITERIA_GROUPS + +```solidity +function CRITERIA_GROUPS() external view returns (uint256) +``` + +Number of distinct criteria groups checked to evaluate the validity of an order. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### ERC1155_INTERFACE_ID + +```solidity +function ERC1155_INTERFACE_ID() external view returns (bytes4) +``` + +ERC1155 interfaceId. + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | + +### ERC721_INTERFACE_ID_1 + +```solidity +function ERC721_INTERFACE_ID_1() external view returns (bytes4) +``` + +ERC721 potential interfaceId. + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | + +### ERC721_INTERFACE_ID_2 + +```solidity +function ERC721_INTERFACE_ID_2() external view returns (bytes4) +``` + +ERC721 potential interfaceId. + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | + +### HYPERCERT_INTERFACE_ID + +```solidity +function HYPERCERT_INTERFACE_ID() external view returns (bytes4) +``` + +Hypercert interfaceId + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### checkMakerOrderValidity + +```solidity +function checkMakerOrderValidity(OrderStructs.Maker makerOrder, bytes signature, OrderStructs.MerkleTree merkleTree) external view returns (uint256[9] validationCodes) +``` + +#### Parameters + +| Name | Type | Description | +| ---------- | ----------------------- | ----------- | +| makerOrder | OrderStructs.Maker | undefined | +| signature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +#### Returns + +| Name | Type | Description | +| --------------- | ---------- | ----------- | +| validationCodes | uint256[9] | undefined | + +### checkMultipleMakerOrderValidities + +```solidity +function checkMultipleMakerOrderValidities(OrderStructs.Maker[] makerOrders, bytes[] signatures, OrderStructs.MerkleTree[] merkleTrees) external view returns (uint256[9][] validationCodes) +``` + +#### Parameters + +| Name | Type | Description | +| ----------- | ------------------------- | ----------- | +| makerOrders | OrderStructs.Maker[] | undefined | +| signatures | bytes[] | undefined | +| merkleTrees | OrderStructs.MerkleTree[] | undefined | + +#### Returns + +| Name | Type | Description | +| --------------- | ------------ | ----------- | +| validationCodes | uint256[9][] | undefined | + +### creatorFeeManager + +```solidity +function creatorFeeManager() external view returns (contract ICreatorFeeManager) +``` + +CreatorFeeManager. + +#### Returns + +| Name | Type | Description | +| ---- | --------------------------- | ----------- | +| \_0 | contract ICreatorFeeManager | undefined | + +### deriveProtocolParameters + +```solidity +function deriveProtocolParameters() external nonpayable +``` + +Derive protocol parameters. Anyone can call this function. + +_It allows adjusting if the domain separator or creator fee manager address were to change._ + +### domainSeparator + +```solidity +function domainSeparator() external view returns (bytes32) +``` + +LooksRareProtocol domain separator. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### looksRareProtocol + +```solidity +function looksRareProtocol() external view returns (contract LooksRareProtocol) +``` + +LooksRareProtocol. + +#### Returns + +| Name | Type | Description | +| ---- | -------------------------- | ----------- | +| \_0 | contract LooksRareProtocol | undefined | + +### maxCreatorFeeBp + +```solidity +function maxCreatorFeeBp() external view returns (uint256) +``` + +Maximum creator fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### transferManager + +```solidity +function transferManager() external view returns (contract TransferManager) +``` + +TransferManager + +#### Returns + +| Name | Type | Description | +| ---- | ------------------------ | ----------- | +| \_0 | contract TransferManager | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md new file mode 100644 index 00000000..91be29a9 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md @@ -0,0 +1,159 @@ +# ProtocolHelpers + +_LooksRare protocol team (👀,💎)_ + +> ProtocolHelpers + +This contract contains helper view functions for order creation. + +## Methods + +### computeDigestMerkleTree + +```solidity +function computeDigestMerkleTree(OrderStructs.MerkleTree merkleTree) external view returns (bytes32 digest) +``` + +#### Parameters + +| Name | Type | Description | +| ---------- | ----------------------- | ----------- | +| merkleTree | OrderStructs.MerkleTree | undefined | + +#### Returns + +| Name | Type | Description | +| ------ | ------- | ----------- | +| digest | bytes32 | undefined | + +### computeMakerDigest + +```solidity +function computeMakerDigest(OrderStructs.Maker maker) external view returns (bytes32 digest) +``` + +#### Parameters + +| Name | Type | Description | +| ----- | ------------------ | ----------- | +| maker | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------ | ------- | ----------- | +| digest | bytes32 | undefined | + +### looksRareProtocol + +```solidity +function looksRareProtocol() external view returns (contract LooksRareProtocol) +``` + +#### Returns + +| Name | Type | Description | +| ---- | -------------------------- | ----------- | +| \_0 | contract LooksRareProtocol | undefined | + +### verifyMakerSignature + +```solidity +function verifyMakerSignature(OrderStructs.Maker maker, bytes makerSignature, address signer) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ------------------ | ----------- | +| maker | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| signer | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### verifyMerkleTree + +```solidity +function verifyMerkleTree(OrderStructs.MerkleTree merkleTree, bytes makerSignature, address signer) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| merkleTree | OrderStructs.MerkleTree | undefined | +| makerSignature | bytes | undefined | +| signer | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Errors + +### NullSignerAddress + +```solidity +error NullSignerAddress() +``` + +It is emitted if the signer is null. + +### SignatureEOAInvalid + +```solidity +error SignatureEOAInvalid() +``` + +It is emitted if the signature is invalid for an EOA (the address recovered is not the expected one). + +### SignatureERC1271Invalid + +```solidity +error SignatureERC1271Invalid() +``` + +It is emitted if the signature is invalid for a ERC1271 contract signer. + +### SignatureLengthInvalid + +```solidity +error SignatureLengthInvalid(uint256 length) +``` + +It is emitted if the signature's length is neither 64 nor 65 bytes. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| length | uint256 | undefined | + +### SignatureParameterSInvalid + +```solidity +error SignatureParameterSInvalid() +``` + +It is emitted if the signature is invalid due to S parameter. + +### SignatureParameterVInvalid + +```solidity +error SignatureParameterVInvalid(uint8 v) +``` + +It is emitted if the signature is invalid due to V parameter. + +#### Parameters + +| Name | Type | Description | +| ---- | ----- | ----------- | +| v | uint8 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md new file mode 100644 index 00000000..b832744e --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md @@ -0,0 +1,60 @@ +# ICreatorFeeManager + +_LooksRare protocol team (👀,💎)_ + +> ICreatorFeeManager + +## Methods + +### royaltyFeeRegistry + +```solidity +function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry royaltyFeeRegistry) +``` + +It returns the royalty fee registry address/interface. + +#### Returns + +| Name | Type | Description | +| ------------------ | ---------------------------- | ------------------------------------- | +| royaltyFeeRegistry | contract IRoyaltyFeeRegistry | Interface of the royalty fee registry | + +### viewCreatorFeeInfo + +```solidity +function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) +``` + +This function returns the creator address and calculates the creator fee amount. + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| price | uint256 | Transaction price | +| itemIds | uint256[] | Array of item ids | + +#### Returns + +| Name | Type | Description | +| ---------------- | ------- | ------------------ | +| creator | address | Creator address | +| creatorFeeAmount | uint256 | Creator fee amount | + +## Errors + +### BundleEIP2981NotAllowed + +```solidity +error BundleEIP2981NotAllowed(address collection) +``` + +It is returned if the bundle contains multiple itemIds with different creator fee structure. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| collection | address | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md new file mode 100644 index 00000000..da683d8c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md @@ -0,0 +1,22 @@ +# ICurrencyManager + +_LooksRare protocol team (👀,💎)_ + +> ICurrencyManager + +## Events + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------------------------------- | +| currency | address | Currency address (address(0) = ETH) | +| isAllowed | bool | Whether the currency is allowed | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IExecutionManager.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IExecutionManager.md new file mode 100644 index 00000000..0e86c75b --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IExecutionManager.md @@ -0,0 +1,99 @@ +# IExecutionManager + +_LooksRare protocol team (👀,💎)_ + +> IExecutionManager + +## Events + +### NewCreatorFeeManager + +```solidity +event NewCreatorFeeManager(address creatorFeeManager) +``` + +It is issued when there is a new creator fee manager. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | -------------------------------------- | +| creatorFeeManager | address | Address of the new creator fee manager | + +### NewMaxCreatorFeeBp + +```solidity +event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) +``` + +It is issued when there is a new maximum creator fee (in basis point). + +#### Parameters + +| Name | Type | Description | +| --------------- | ------- | ---------------------------------------- | +| maxCreatorFeeBp | uint256 | New maximum creator fee (in basis point) | + +### NewProtocolFeeRecipient + +```solidity +event NewProtocolFeeRecipient(address protocolFeeRecipient) +``` + +It is issued when there is a new protocol fee recipient address. + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ----------------------------------------- | +| protocolFeeRecipient | address | Address of the new protocol fee recipient | + +## Errors + +### CreatorFeeBpTooHigh + +```solidity +error CreatorFeeBpTooHigh() +``` + +It is returned if the creator fee (in basis point) is too high. + +### NewProtocolFeeRecipientCannotBeNullAddress + +```solidity +error NewProtocolFeeRecipientCannotBeNullAddress() +``` + +It is returned if the new protocol fee recipient is set to address(0). + +### NoSelectorForStrategy + +```solidity +error NoSelectorForStrategy() +``` + +It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. + +### OutsideOfTimeRange + +```solidity +error OutsideOfTimeRange() +``` + +It is returned if the current block timestamp is not between start and end times in the maker order. + +### StrategyNotAvailable + +```solidity +error StrategyNotAvailable(uint256 strategyId) +``` + +It is returned if the strategy id has no implementation. + +_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| strategyId | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md new file mode 100644 index 00000000..393cb24b --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md @@ -0,0 +1,41 @@ +# IImmutableCreate2Factory + +## Methods + +### findCreate2Address + +```solidity +function findCreate2Address(bytes32 salt, bytes initializationCode) external view returns (address deploymentAddress) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| salt | bytes32 | undefined | +| initializationCode | bytes | undefined | + +#### Returns + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| deploymentAddress | address | undefined | + +### safeCreate2 + +```solidity +function safeCreate2(bytes32 salt, bytes initializationCode) external payable returns (address deploymentAddress) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| salt | bytes32 | undefined | +| initializationCode | bytes | undefined | + +#### Returns + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| deploymentAddress | address | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md new file mode 100644 index 00000000..e7414f54 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md @@ -0,0 +1,157 @@ +# ILooksRareProtocol + +_LooksRare protocol team (👀,💎)_ + +> ILooksRareProtocol + +## Methods + +### executeMultipleTakerBids + +```solidity +function executeMultipleTakerBids(OrderStructs.Taker[] takerBids, OrderStructs.Maker[] makerAsks, bytes[] makerSignatures, OrderStructs.MerkleTree[] merkleTrees, bool isAtomic) external payable +``` + +#### Parameters + +| Name | Type | Description | +| --------------- | ------------------------- | ----------- | +| takerBids | OrderStructs.Taker[] | undefined | +| makerAsks | OrderStructs.Maker[] | undefined | +| makerSignatures | bytes[] | undefined | +| merkleTrees | OrderStructs.MerkleTree[] | undefined | +| isAtomic | bool | undefined | + +### executeTakerAsk + +```solidity +function executeTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +### executeTakerBid + +```solidity +function executeTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external payable +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +## Events + +### NewDomainSeparator + +```solidity +event NewDomainSeparator() +``` + +It is emitted if there is a change in the domain separator. + +### NewGasLimitETHTransfer + +```solidity +event NewGasLimitETHTransfer(uint256 gasLimitETHTransfer) +``` + +It is emitted when there is a new gas limit for a ETH transfer (before it is wrapped to WETH). + +#### Parameters + +| Name | Type | Description | +| ------------------- | ------- | ----------------------------- | +| gasLimitETHTransfer | uint256 | Gas limit for an ETH transfer | + +### TakerAsk + +```solidity +event TakerAsk(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address askUser, address bidUser, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) +``` + +It is emitted when a taker ask transaction is completed. + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | Struct about nonce invalidation parameters | +| askUser | address | Address of the ask user | +| bidUser | address | Address of the bid user | +| strategyId | uint256 | Id of the strategy | +| currency | address | Address of the currency | +| collection | address | Address of the collection | +| itemIds | uint256[] | Array of item ids | +| amounts | uint256[] | Array of amounts (for item ids) | +| feeRecipients | address[2] | Array of fee recipients feeRecipients[0] User who receives the proceeds of the sale (it can be the taker ask user or different) feeRecipients[1] Creator fee recipient (if none, address(0)) | +| feeAmounts | uint256[3] | Array of fee amounts feeAmounts[0] Fee amount for the user receiving sale proceeds feeAmounts[1] Creator fee amount feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment | + +### TakerBid + +```solidity +event TakerBid(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address bidUser, address bidRecipient, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) +``` + +It is emitted when a taker bid transaction is completed. + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | Struct about nonce invalidation parameters | +| bidUser | address | Address of the bid user | +| bidRecipient | address | Address of the recipient of the bid | +| strategyId | uint256 | Id of the strategy | +| currency | address | Address of the currency | +| collection | address | Address of the collection | +| itemIds | uint256[] | Array of item ids | +| amounts | uint256[] | Array of amounts (for item ids) | +| feeRecipients | address[2] | Array of fee recipients feeRecipients[0] User who receives the proceeds of the sale (it is the maker ask user) feeRecipients[1] Creator fee recipient (if none, address(0)) | +| feeAmounts | uint256[3] | Array of fee amounts feeAmounts[0] Fee amount for the user receiving sale proceeds feeAmounts[1] Creator fee amount feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment | + +## Errors + +### ChainIdInvalid + +```solidity +error ChainIdInvalid() +``` + +It is returned if the domain separator should change. + +### NewGasLimitETHTransferTooLow + +```solidity +error NewGasLimitETHTransferTooLow() +``` + +It is returned if the gas limit for a standard ETH transfer is too low. + +### NoncesInvalid + +```solidity +error NoncesInvalid() +``` + +It is returned if the nonces are invalid. + +### SameDomainSeparator + +```solidity +error SameDomainSeparator() +``` + +It is returned if the domain separator cannot be updated (i.e. the chainId is the same). diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/INonceManager.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/INonceManager.md new file mode 100644 index 00000000..eaa3f977 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/INonceManager.md @@ -0,0 +1,53 @@ +# INonceManager + +_LooksRare protocol team (👀,💎)_ + +> INonceManager + +## Events + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ------------------- | +| user | address | Address of the user | +| bidNonce | uint256 | New bid nonce | +| askNonce | uint256 | New ask nonce | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ------------------------------- | +| user | address | Address of the user | +| orderNonces | uint256[] | Array of order nonces cancelled | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | -------------------------------- | +| user | address | Address of the user | +| subsetNonces | uint256[] | Array of subset nonces cancelled | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md new file mode 100644 index 00000000..5ed0ef6c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md @@ -0,0 +1,29 @@ +# IRoyaltyFeeRegistry + +_LooksRare protocol team (👀,💎)_ + +> IRoyaltyFeeRegistry + +## Methods + +### royaltyInfo + +```solidity +function royaltyInfo(address collection, uint256 price) external view returns (address receiver, uint256 royaltyFee) +``` + +This function returns the royalty information for a collection at a given transaction price. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ------------------ | +| collection | address | Collection address | +| price | uint256 | Transaction price | + +#### Returns + +| Name | Type | Description | +| ---------- | ------- | ------------------ | +| receiver | address | Receiver address | +| royaltyFee | uint256 | Royalty fee amount | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IStrategy.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IStrategy.md new file mode 100644 index 00000000..2b4a45bc --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IStrategy.md @@ -0,0 +1,41 @@ +# IStrategy + +_LooksRare protocol team (👀,💎)_ + +> IStrategy + +## Methods + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool isStrategy) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---------- | ---- | ---------------------------------------------- | +| isStrategy | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerOrder, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerOrder | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IStrategyManager.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IStrategyManager.md new file mode 100644 index 00000000..ae6ea7b1 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/IStrategyManager.md @@ -0,0 +1,84 @@ +# IStrategyManager + +_LooksRare protocol team (👀,💎)_ + +> IStrategyManager + +## Events + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------------- | +| strategyId | uint256 | Id of the new strategy | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the transaction to be executed | +| isMakerBid | bool | Whether the strategyId is for maker bid | +| implementation | address | Address of the implementation of the strategy | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | -------------------------------------------------------- | +| strategyId | uint256 | Id of the strategy | +| isActive | bool | Whether the strategy is active (or not) after the update | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | + +## Errors + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ITransferManager.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ITransferManager.md new file mode 100644 index 00000000..3ba8ca81 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/interfaces/ITransferManager.md @@ -0,0 +1,111 @@ +# ITransferManager + +_LooksRare protocol team (👀,💎)_ + +> ITransferManager + +## Events + +### ApprovalsGranted + +```solidity +event ApprovalsGranted(address user, address[] operators) +``` + +It is emitted if operators' approvals to transfer NFTs are granted by a user. + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | --------------------------- | +| user | address | Address of the user | +| operators | address[] | Array of operator addresses | + +### ApprovalsRemoved + +```solidity +event ApprovalsRemoved(address user, address[] operators) +``` + +It is emitted if operators' approvals to transfer NFTs are revoked by a user. + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | --------------------------- | +| user | address | Address of the user | +| operators | address[] | Array of operator addresses | + +### OperatorAllowed + +```solidity +event OperatorAllowed(address operator) +``` + +It is emitted if a new operator is added to the global allowlist. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ---------------- | +| operator | address | Operator address | + +### OperatorRemoved + +```solidity +event OperatorRemoved(address operator) +``` + +It is emitted if an operator is removed from the global allowlist. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ---------------- | +| operator | address | Operator address | + +## Errors + +### OperatorAlreadyAllowed + +```solidity +error OperatorAlreadyAllowed() +``` + +It is returned if the transfer caller is already allowed by the owner. + +_This error can only be returned for owner operations._ + +### OperatorAlreadyApprovedByUser + +```solidity +error OperatorAlreadyApprovedByUser() +``` + +It is returned if the operator to approve has already been approved by the user. + +### OperatorNotAllowed + +```solidity +error OperatorNotAllowed() +``` + +It is returned if the operator to approve is not in the global allowlist defined by the owner. + +_This error can be returned if the user tries to grant approval to an operator address not in the allowlist or if the owner tries to remove the operator from the global allowlist._ + +### OperatorNotApprovedByUser + +```solidity +error OperatorNotApprovedByUser() +``` + +It is returned if the operator to revoke has not been previously approved by the user. + +### TransferCallerInvalid + +```solidity +error TransferCallerInvalid() +``` + +It is returned if the transfer caller is invalid. For a transfer called to be valid, the operator must be in the global allowlist and approved by the 'from' user. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/CurrencyValidator.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/CurrencyValidator.md new file mode 100644 index 00000000..1b1f41a2 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/CurrencyValidator.md @@ -0,0 +1,7 @@ +# CurrencyValidator + +_LooksRare protocol team (👀,💎)_ + +> CurrencyValidator + +This library validates the order currency to be the chain's native currency or the specified ERC20 token. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md new file mode 100644 index 00000000..5951cc56 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md @@ -0,0 +1,21 @@ +# LowLevelHypercertCaller + +_bitbeckers_ + +> LowLevelHypercertCaller + +This contract contains low-level calls to transfer ERC1155 tokens. + +## Errors + +### HypercertSplitFractionError + +```solidity +error HypercertSplitFractionError() +``` + +### NotAContract + +```solidity +error NotAContract() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md new file mode 100644 index 00000000..943a54cd --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md @@ -0,0 +1,7 @@ +# MerkleProofCalldataWithNodes + +_OpenZeppelin (adjusted by LooksRare)_ + +> MerkleProofCalldataWithNodes + +This library is adjusted from the work of OpenZeppelin. It is based on the 4.7.0 (utils/cryptography/MerkleProof.sol). diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md new file mode 100644 index 00000000..37529181 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md @@ -0,0 +1,7 @@ +# MerkleProofMemory + +_OpenZeppelin (adjusted by LooksRare)_ + +> MerkleProofMemory + +This library is adjusted from the work of OpenZeppelin. It is based on the 4.7.0 (utils/cryptography/MerkleProof.sol). diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/OrderStructs.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/OrderStructs.md new file mode 100644 index 00000000..6ffa83e2 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/marketplace/libraries/OrderStructs.md @@ -0,0 +1,7 @@ +# OrderStructs + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> OrderStructs + +This library contains all order struct types for the LooksRare protocol (v2). diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/AllowlistMinter.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/AllowlistMinter.md new file mode 100644 index 00000000..4684053c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/AllowlistMinter.md @@ -0,0 +1,84 @@ +# AllowlistMinter + +_bitbeckers_ + +> Interface for hypercert token interactions + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### hasBeenClaimed + +```solidity +function hasBeenClaimed(uint256, bytes32) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | +| \_1 | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | + +## Events + +### AllowlistCreated + +```solidity +event AllowlistCreated(uint256 tokenID, bytes32 root) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| root | bytes32 | undefined | + +### LeafClaimed + +```solidity +event LeafClaimed(uint256 tokenID, bytes32 leaf) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +## Errors + +### DoesNotExist + +```solidity +error DoesNotExist() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/HypercertMinter.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/HypercertMinter.md new file mode 100644 index 00000000..518efa42 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/HypercertMinter.md @@ -0,0 +1,895 @@ +# HypercertMinter + +_bitbeckers_ + +> Contract for managing hypercert claims and whitelists + +Implementation of the HypercertTokenInterface using { SemiFungible1155 } as underlying token.This contract supports whitelisted minting via { AllowlistMinter }. + +_Wrapper contract to expose and chain functions._ + +## Methods + +### \_\_SemiFungible1155_init + +```solidity +function __SemiFungible1155_init() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### balanceOf + +```solidity +function balanceOf(address account, uint256 id) external view returns (uint256) +``` + +_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### balanceOfBatch + +```solidity +function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) +``` + +_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| accounts | address[] | undefined | +| ids | uint256[] | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | --------- | ----------- | +| \_0 | uint256[] | undefined | + +### batchBurnFraction + +```solidity +function batchBurnFraction(address _account, uint256[] _tokenIDs) external nonpayable +``` + +Burn a claimtoken + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ----------- | +| \_account | address | undefined | +| \_tokenIDs | uint256[] | undefined | + +### batchMintClaimsFromAllowlists + +```solidity +function batchMintClaimsFromAllowlists(address account, bytes32[][] proofs, uint256[] claimIDs, uint256[] units) external nonpayable +``` + +Mint semi-fungible tokens representing a fraction of the claims in `claimIDs` + +_Calls AllowlistMinter to verify `proofs`.Mints the `amount` of units for the hypercert stored under `claimIDs`_ + +#### Parameters + +| Name | Type | Description | +| -------- | ----------- | ----------- | +| account | address | undefined | +| proofs | bytes32[][] | undefined | +| claimIDs | uint256[] | undefined | +| units | uint256[] | undefined | + +### burn + +```solidity +function burn(address account, uint256 id, uint256) external nonpayable +``` + +Burn a claimtoken; override is needed to update units/values + +_see {ERC1155Burnable}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | +| \_2 | uint256 | undefined | + +### burnBatch + +```solidity +function burnBatch(address account, uint256[] ids, uint256[]) external nonpayable +``` + +Batch burn claimtokens; override is needed to update units/values + +_see {ERC1155Burnable}_ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| ids | uint256[] | undefined | +| \_2 | uint256[] | undefined | + +### burnFraction + +```solidity +function burnFraction(address _account, uint256 _tokenID) external nonpayable +``` + +Burn a claimtoken + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| \_account | address | undefined | +| \_tokenID | uint256 | undefined | + +### createAllowlist + +```solidity +function createAllowlist(address account, uint256 units, bytes32 merkleRoot, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Register a claim and the whitelist for minting token(s) belonging to that claim + +_Calls SemiFungible1155 to store the claim referenced in `uri` with amount of `units`Calls AllowlistMinter to store the `merkleRoot` as proof to authorize claims_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| merkleRoot | bytes32 | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### hasBeenClaimed + +```solidity +function hasBeenClaimed(uint256, bytes32) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | +| \_1 | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### initialize + +```solidity +function initialize() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | + +### isApprovedForAll + +```solidity +function isApprovedForAll(address account, address operator) external view returns (bool) +``` + +_See {IERC1155-isApprovedForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| account | address | undefined | +| operator | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### mergeFractions + +```solidity +function mergeFractions(address _account, uint256[] _fractionIDs) external nonpayable +``` + +Merge the value of tokens belonging to the same claim + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------- | --------- | ----------- | +| \_account | address | undefined | +| \_fractionIDs | uint256[] | undefined | + +### mintClaim + +```solidity +function mintClaim(address account, uint256 units, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Mint a semi-fungible token for the impact claim referenced via `uri` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### mintClaimFromAllowlist + +```solidity +function mintClaimFromAllowlist(address account, bytes32[] proof, uint256 claimID, uint256 units) external nonpayable +``` + +Mint a semi-fungible token representing a fraction of the claim + +_Calls AllowlistMinter to verify `proof`.Mints the `amount` of units for the hypercert stored under `claimID`_ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| units | uint256 | undefined | + +### mintClaimWithFractions + +```solidity +function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Mint semi-fungible tokens for the impact claim referenced via `uri` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| fractions | uint256[] | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### name + +```solidity +function name() external view returns (string) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +_Returns the address of the current owner._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownerOf + +```solidity +function ownerOf(uint256 tokenID) external view returns (address _owner) +``` + +_Returns the owner of a given token ID._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| tokenID | uint256 | The ID of the token to query. | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | -------------------------------------- | +| \_owner | address | The address of the owner of the token. | + +### pause + +```solidity +function pause() external nonpayable +``` + +PAUSABLE + +### paused + +```solidity +function paused() external view returns (bool) +``` + +_Returns true if the contract is paused, and false otherwise._ + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### proxiableUUID + +```solidity +function proxiableUUID() external view returns (bytes32) +``` + +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### readTransferRestriction + +```solidity +function readTransferRestriction(uint256 tokenID) external view returns (string) +``` + +TRANSFER RESTRICTIONS + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ + +### safeBatchTransferFrom + +```solidity +function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable +``` + +_See {IERC1155-safeBatchTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| ids | uint256[] | undefined | +| amounts | uint256[] | undefined | +| data | bytes | undefined | + +### safeTransferFrom + +```solidity +function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable +``` + +_See {IERC1155-safeTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| id | uint256 | undefined | +| amount | uint256 | undefined | +| data | bytes | undefined | + +### setApprovalForAll + +```solidity +function setApprovalForAll(address operator, bool approved) external nonpayable +``` + +_See {IERC1155-setApprovalForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | +| approved | bool | undefined | + +### splitFraction + +```solidity +function splitFraction(address _account, uint256 _tokenID, uint256[] _newFractions) external nonpayable +``` + +Split a claimtokens value into parts with summed value equal to the original + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| -------------- | --------- | ----------- | +| \_account | address | undefined | +| \_tokenID | uint256 | undefined | +| \_newFractions | uint256[] | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + +_See {IERC165-supportsInterface}._ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------ | ----------- | +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### unitsOf + +```solidity +function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) +``` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unitsOf + +```solidity +function unitsOf(uint256 tokenID) external view returns (uint256 units) +``` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unpause + +```solidity +function unpause() external nonpayable +``` + +### upgradeTo + +```solidity +function upgradeTo(address newImplementation) external nonpayable +``` + +_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | + +### upgradeToAndCall + +```solidity +function upgradeToAndCall(address newImplementation, bytes data) external payable +``` + +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string _uri) +``` + +_see { IHypercertMetadata}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------ | ----------- | +| \_uri | string | undefined | + +## Events + +### AdminChanged + +```solidity +event AdminChanged(address previousAdmin, address newAdmin) +``` + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | ----------- | +| previousAdmin | address | undefined | +| newAdmin | address | undefined | + +### AllowlistCreated + +```solidity +event AllowlistCreated(uint256 tokenID, bytes32 root) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| root | bytes32 | undefined | + +### ApprovalForAll + +```solidity +event ApprovalForAll(address indexed account, address indexed operator, bool approved) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| account `indexed` | address | undefined | +| operator `indexed` | address | undefined | +| approved | bool | undefined | + +### BatchValueTransfer + +```solidity +event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| claimIDs | uint256[] | undefined | +| fromTokenIDs | uint256[] | undefined | +| toTokenIDs | uint256[] | undefined | +| values | uint256[] | undefined | + +### BeaconUpgraded + +```solidity +event BeaconUpgraded(address indexed beacon) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| beacon `indexed` | address | undefined | + +### ClaimStored + +```solidity +event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| claimID `indexed` | uint256 | undefined | +| uri | string | undefined | +| totalUnits | uint256 | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ----- | ----------- | +| version | uint8 | undefined | + +### LeafClaimed + +```solidity +event LeafClaimed(uint256 tokenID, bytes32 leaf) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### Paused + +```solidity +event Paused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### TransferBatch + +```solidity +event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### TransferSingle + +```solidity +event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### URI + +```solidity +event URI(string value, uint256 indexed id) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | ------- | ----------- | +| value | string | undefined | +| id `indexed` | uint256 | undefined | + +### Unpaused + +```solidity +event Unpaused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### Upgraded + +```solidity +event Upgraded(address indexed implementation) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | + +### ValueTransfer + +```solidity +event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------- | +| claimID | uint256 | undefined | +| fromTokenID | uint256 | undefined | +| toTokenID | uint256 | undefined | +| value | uint256 | undefined | + +## Errors + +### AlreadyClaimed + +```solidity +error AlreadyClaimed() +``` + +### ArraySize + +```solidity +error ArraySize() +``` + +### DoesNotExist + +```solidity +error DoesNotExist() +``` + +### DuplicateEntry + +```solidity +error DuplicateEntry() +``` + +### Invalid + +```solidity +error Invalid() +``` + +### NotAllowed + +```solidity +error NotAllowed() +``` + +### NotApprovedOrOwner + +```solidity +error NotApprovedOrOwner() +``` + +### TransfersNotAllowed + +```solidity +error TransfersNotAllowed() +``` + +### TypeMismatch + +```solidity +error TypeMismatch() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/SemiFungible1155.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/SemiFungible1155.md new file mode 100644 index 00000000..a4086e37 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/SemiFungible1155.md @@ -0,0 +1,457 @@ +# SemiFungible1155 + +_bitbeckers_ + +> Contract for minting semi-fungible EIP1155 tokens + +Extends { Upgradeable1155 } token with semi-fungible properties and the concept of `units` + +_Adds split bit strategy as described in [EIP-1155](https://eips.ethereum.org/EIPS/eip-1155#non-fungible-tokens)_ + +## Methods + +### \_\_SemiFungible1155_init + +```solidity +function __SemiFungible1155_init() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### balanceOf + +```solidity +function balanceOf(address account, uint256 id) external view returns (uint256) +``` + +_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### balanceOfBatch + +```solidity +function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) +``` + +_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| accounts | address[] | undefined | +| ids | uint256[] | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | --------- | ----------- | +| \_0 | uint256[] | undefined | + +### burn + +```solidity +function burn(address account, uint256 id, uint256 value) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### burnBatch + +```solidity +function burnBatch(address account, uint256[] ids, uint256[] values) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### isApprovedForAll + +```solidity +function isApprovedForAll(address account, address operator) external view returns (bool) +``` + +_See {IERC1155-isApprovedForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| account | address | undefined | +| operator | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +_Returns the address of the current owner._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownerOf + +```solidity +function ownerOf(uint256 tokenID) external view returns (address _owner) +``` + +_Returns the owner of a given token ID._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| tokenID | uint256 | The ID of the token to query. | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | -------------------------------------- | +| \_owner | address | The address of the owner of the token. | + +### proxiableUUID + +```solidity +function proxiableUUID() external view returns (bytes32) +``` + +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ + +### safeBatchTransferFrom + +```solidity +function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable +``` + +_See {IERC1155-safeBatchTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| ids | uint256[] | undefined | +| amounts | uint256[] | undefined | +| data | bytes | undefined | + +### safeTransferFrom + +```solidity +function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable +``` + +_See {IERC1155-safeTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| id | uint256 | undefined | +| amount | uint256 | undefined | +| data | bytes | undefined | + +### setApprovalForAll + +```solidity +function setApprovalForAll(address operator, bool approved) external nonpayable +``` + +_See {IERC1155-setApprovalForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | +| approved | bool | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + +_See {IERC165-supportsInterface}._ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------ | ----------- | +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### upgradeTo + +```solidity +function upgradeTo(address newImplementation) external nonpayable +``` + +_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | + +### upgradeToAndCall + +```solidity +function upgradeToAndCall(address newImplementation, bytes data) external payable +``` + +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string _uri) +``` + +_Returns the metadata URI for a given token ID.This function retrieves the metadata URI for the specified token ID by calling the `uri` function of the `ERC1155URIStorageUpgradeable` contract.The metadata URI is a string that points to a JSON file containing information about the token, such as its name, symbol, and image.This function always returns the URI for the basetype so that it's managed in one place._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------------------------------- | +| tokenID | uint256 | The ID of the token to retrieve the metadata URI for. | + +#### Returns + +| Name | Type | Description | +| ----- | ------ | -------------------------------------------- | +| \_uri | string | The metadata URI for the specified token ID. | + +## Events + +### AdminChanged + +```solidity +event AdminChanged(address previousAdmin, address newAdmin) +``` + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | ----------- | +| previousAdmin | address | undefined | +| newAdmin | address | undefined | + +### ApprovalForAll + +```solidity +event ApprovalForAll(address indexed account, address indexed operator, bool approved) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| account `indexed` | address | undefined | +| operator `indexed` | address | undefined | +| approved | bool | undefined | + +### BatchValueTransfer + +```solidity +event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) +``` + +_Emitted on transfer of `values` between `fromTokenIDs` to `toTokenIDs` of `claimIDs`_ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| claimIDs | uint256[] | undefined | +| fromTokenIDs | uint256[] | undefined | +| toTokenIDs | uint256[] | undefined | +| values | uint256[] | undefined | + +### BeaconUpgraded + +```solidity +event BeaconUpgraded(address indexed beacon) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| beacon `indexed` | address | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ----- | ----------- | +| version | uint8 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### TransferBatch + +```solidity +event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### TransferSingle + +```solidity +event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### URI + +```solidity +event URI(string value, uint256 indexed id) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | ------- | ----------- | +| value | string | undefined | +| id `indexed` | uint256 | undefined | + +### Upgraded + +```solidity +event Upgraded(address indexed implementation) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | + +### ValueTransfer + +```solidity +event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) +``` + +_Emitted on transfer of `value` between `fromTokenID` to `toTokenID` of the same `claimID`_ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------- | +| claimID | uint256 | undefined | +| fromTokenID | uint256 | undefined | +| toTokenID | uint256 | undefined | +| value | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/interfaces/IAllowlist.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/interfaces/IAllowlist.md new file mode 100644 index 00000000..72455b43 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/interfaces/IAllowlist.md @@ -0,0 +1,29 @@ +# IAllowlist + +_bitbeckers_ + +> Interface for allowlist + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 tokenID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/interfaces/IHypercertToken.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/interfaces/IHypercertToken.md new file mode 100644 index 00000000..30ed6f95 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/interfaces/IHypercertToken.md @@ -0,0 +1,192 @@ +# IHypercertToken + +_bitbeckers_ + +> Interface for hypercert token interactions + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### batchBurnFraction + +```solidity +function batchBurnFraction(address account, uint256[] tokenIDs) external nonpayable +``` + +Operator must be allowed by `creator` and the tokens must represent the total amount of available units. + +_Function to burn the tokens at `tokenIDs` for `account`_ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenIDs | uint256[] | undefined | + +### burnFraction + +```solidity +function burnFraction(address account, uint256 tokenID) external nonpayable +``` + +Operator must be allowed by `creator` and the token must represent the total amount of available units. + +_Function to burn the token at `tokenID` for `account`_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +### mergeFractions + +```solidity +function mergeFractions(address account, uint256[] tokenIDs) external nonpayable +``` + +Tokens that have been merged are burned. + +_Function called to merge tokens within `tokenIDs`._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenIDs | uint256[] | undefined | + +### mintClaim + +```solidity +function mintClaim(address account, uint256 units, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +_Function called to store a claim referenced via `uri` with a maximum number of fractions `units`._ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### mintClaimWithFractions + +```solidity +function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +_Function called to store a claim referenced via `uri` with a set of `fractions`.Fractions are internally summed to total units._ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| fractions | uint256[] | undefined | +| uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### splitFraction + +```solidity +function splitFraction(address account, uint256 tokenID, uint256[] _values) external nonpayable +``` + +The sum of `values` must equal the current value of `_tokenID`. + +_Function called to split `tokenID` owned by `account` into units declared in `values`._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | +| \_values | uint256[] | undefined | + +### unitsOf + +```solidity +function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) +``` + +_Returns the `units` held by `account` of a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` held by `account` for the claim is returned.If `tokenID` is a fractional token, the `units` held by `account` the token is returned_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unitsOf + +```solidity +function unitsOf(uint256 tokenID) external view returns (uint256 units) +``` + +_Returns the `units` held by a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` for the claim is returned.If `tokenID` is a fractional token, the `units` held by the token is returned_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string metadata) +``` + +_Returns the `uri` for metadata of the claim represented by `tokenID`Metadata must conform to { Hypercert Metadata } spec (based on ERC1155 Metadata)_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------ | ----------- | +| metadata | string | undefined | + +## Events + +### ClaimStored + +```solidity +event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) +``` + +_Emitted when token with tokenID `claimID` is stored, with external data reference via `uri`._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| claimID `indexed` | uint256 | undefined | +| uri | string | undefined | +| totalUnits | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/libs/Errors.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/libs/Errors.md new file mode 100644 index 00000000..93fe0124 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/contracts/protocol/libs/Errors.md @@ -0,0 +1,59 @@ +# Errors + +_bitbeckers_ + +## Errors + +### AlreadyClaimed + +```solidity +error AlreadyClaimed() +``` + +### ArraySize + +```solidity +error ArraySize() +``` + +### DoesNotExist + +```solidity +error DoesNotExist() +``` + +### DuplicateEntry + +```solidity +error DuplicateEntry() +``` + +### Invalid + +```solidity +error Invalid() +``` + +### NotAllowed + +```solidity +error NotAllowed() +``` + +### NotApprovedOrOwner + +```solidity +error NotApprovedOrOwner() +``` + +### TransfersNotAllowed + +```solidity +error TransfersNotAllowed() +``` + +### TypeMismatch + +```solidity +error TypeMismatch() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/.nojekyll b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/.nojekyll new file mode 100644 index 00000000..e2ac6616 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/README.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/README.md new file mode 100644 index 00000000..b1434ab0 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/README.md @@ -0,0 +1,185 @@ +Hypercerts SDK Documentation / [Exports](modules.md) + +# Hypercert SDK + +## Quickstart Guide + +1. Install the SDK using npm or yarn: + +```bash +npm install @hypercerts-org/sdk +``` + +or + +```bash + yarn add @hypercerts-org/sdk +``` + +2. Import the SDK into your project: + +```bash +import { HypercertClient } from "@hypercerts-org/sdk"; +``` + +3. Create a new instance of the HypercertClient class with your configuration options: + +```js +const client = new HypercertClient({ + chainId: 5, + provider, + signer, + nftStorageToken, + web3StorageToken, +}); +``` + +> **Note** If there's no `signer`, `provider`, `nftStorageToken` or `web3StorageToken` provided, the client will run in +> [read-only mode](#read-only-mode) + +4. Use the client object to interact with the Hypercert network. + +For example, you can use the `client.mintClaim` method to create a new claim: + +```js +const tx = await client.mintClaim( + metaData, + totalUnits, + transferRestriction, + overrides, +); +``` + +This will validate the metadata, store it on IPFS, create a new hypercert on-chain and return a transaction receipt. + +You can also use the client to query the subgraph and retrieve which claims an address owns: + +```js +const claims = await client.indexer.fractionsByOwner(owner), +``` + +For more information on how to use the SDK, check out the +[developer documentation](https://hypercerts.org/docs/developer/) and the +[Graph playground](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-testnet). + +That's it! With these simple steps, you can start using the Hypercert SDK in your own projects. Don't forget to set your +environment variables for your NFT.storage and web3.storage API keys in your .env file. + +## Config + +The SDK will try to determine the `DEFAULT_CHAIN_ID` and use that to inform the configuration. We allow for `overrides` +when creating the SDK by passing configuration variables. Finally, when not defaults or overrides are found, we check +the environment variables. + +### Read-only mode + +The SDK client will be in read-only mode if any of the following conditions are true: + +- The client was initialized without a signer or provider. +- The client was initialized with a provider but not a signer. +- The client was initialized with a signer but not a provider. +- The contract address is not set. +- The storage layer is in read-only mode. + +If any of these conditions are true, the readonly property of the HypercertClient instance will be set to true, and a +warning message will be logged indicating that the client is in read-only mode. + +### Defaults + +The constants.ts file defines various constants that are used throughout the Hypercert system. Here's a brief +explanation of each constant: + +`DEFAULT_CHAIN_ID`: This constant defines the default chain ID to use if no chain ID is specified. In this case, the +default chain ID is set to 5, which corresponds to the Goerli testnet. + +Based on `DEFAULT_CHAIN_ID` the SDK will select a `DEPLOYMENT`. + +`DEPLOYMENTS`: This constant defines the deployments that are managed by the Hypercert system. Each Deployment object +contains information about a specific deployment, including the chain ID, chain name, contract address, and graph name. + +For example: + +```json +{ + "5": { + "chainId": 5, + "chainName": "goerli", + "contractAddress": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", + "graphName": "hypercerts-testnet" + } +} +``` + +### Client config properties + +| \| Property | Type | Description | +| ------------------ | -------------------- | -------------------------------------- | +| `chainId` | `number` | The chain ID of the network to use. | +| `chainName` | `string` | The name of the network to use. | +| `contractAddress` | `string` | The address of the Hypercert contract. | +| `rpcUrl` | `string` | The URL of the RPC endpoint to use. | +| `graphName` | `string` | The name of the Gsubgraph to use. | +| `provider` | `providers.Provider` | A custom provider to use. | +| `signer` | `Signer` | A custom signer to use. | +| `nftStorageToken` | `string` | Your NFT.storage API key. | +| `web3StorageToken` | `string` | Your web3.storage API key. | + +### Environment variables + +To determine the missing configuration values the SDK defaults to the following environment variables: + +| Environment Variable | Description | +| -------------------------------- | --------------------------------------------------------------------------------------------------- | +| `DEFAULT_CHAIN_ID` | Specifies the default chain ID to use if no chain ID is specified. | +| `CONTRACT_ADDRESS` | Specifies the contract address to use for the Hypercert protocol. | +| `RPC_URL` | Specifies the RPC URL to use for the evm-compatible network. | +| `PRIVATE_KEY` | Specifies the private key to use for signing transactions. | +| `NFT_STORAGE_TOKEN` | Specifies the NFT.storage API token to use for storing Hypercert metadata. | +| `NEXT_PUBLIC_NFT_STORAGE_TOKEN` | Specifies the NFT.storage API token to use for storing Hypercert metadata in a Next.js application. | +| `WEB3_STORAGE_TOKEN` | Specifies the Web3.storage API token to use for storing Hypercert data. | +| `NEXT_PUBLIC_WEB3_STORAGE_TOKEN` | Specifies the Web3.storage API token to use for storing Hypercert data in a Next.js application. | + +### Logging + +The logger for the SDK uses the log level based on the value of the LOG_LEVEL environment variable. The log level +determines which log messages are printed to the console. By default, the logger is configured to log messages with a +level of info or higher to the console. + +## Client modules + +The `HypercertClient` provides a high-level interface for interacting with the Hypercert ecosystem. The HypercertClient +has three getter methods: `storage`, `indexer`, and `contract`. These methods return instances of the HypercertsStorage, +HypercertIndexer, and HypercertMinter classes, respectively. + +```js +const { + client: { storage }, +} = new HypercertClient({}); +``` + +The `storage` is a utility class that provides methods for storing and retrieving Hypercert metadata on IPFS and +NFT.storage. It is used by the HypercertClient to store metadata when creating new Hypercerts. + +```js +const { + client: { indexer }, +} = new HypercertClient({}); +``` + +The `indexer` is a utility class that provides methods for indexing and searching Hypercerts based on various criteria. +It is used by the HypercertClient to retrieve event-based data via the subgraph + +```js +const { + client: { contract }, +} = new HypercertClient({}); +``` + +Finally we have a `contract` that provides methods for interacting with the HypercertMinter smart contract. It is used +by the HypercertClient to create new Hypercerts and retrieve specific on-chain information. + +By providing instances of these classes through the storage, indexer, and contract getters, the HypercertClient allows +developers to easily interact with the various components of the Hypercert system. For example, a developer could use +the storage instance to store metadata for a new Hypercert, the indexer instance to search for existing Hypercerts based +on various criteria, and the contract instance to create new Hypercerts and retrieve existing Hypercerts from the +contract. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/ClientError.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/ClientError.md new file mode 100644 index 00000000..89f2105f --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/ClientError.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / ClientError + +# Class: ClientError + +An error that is caused by a problem with the client. + +## Hierarchy + +- `Error` + + ↳ **`ClientError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](ClientError.md#constructor) + +### Properties + +- [payload](ClientError.md#payload) + +## Constructors + +### constructor + +• **new ClientError**(`message`, `payload?`) + +Creates a new instance of the ClientError class. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:25](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L25) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:18](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L18) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/ConfigurationError.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/ConfigurationError.md new file mode 100644 index 00000000..03813867 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/ConfigurationError.md @@ -0,0 +1,66 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / ConfigurationError + +# Class: ConfigurationError + +The configuration was invalid + +## Hierarchy + +- `Error` + + ↳ **`ConfigurationError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](ConfigurationError.md#constructor) + +### Properties + +- [payload](ConfigurationError.md#payload) + +## Constructors + +### constructor + +• **new ConfigurationError**(`message`, `payload?`) + +#### Parameters + +| Name | Type | +| :--------- | :------- | +| `message` | `string` | +| `payload?` | `Object` | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:166](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L166) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:165](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L165) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/FetchError.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/FetchError.md new file mode 100644 index 00000000..d4c9f7c9 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/FetchError.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / FetchError + +# Class: FetchError + +Fails fetching a remote resource + +## Hierarchy + +- `Error` + + ↳ **`FetchError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](FetchError.md#constructor) + +### Properties + +- [payload](FetchError.md#payload) + +## Constructors + +### constructor + +• **new FetchError**(`message`, `payload?`) + +Creates a new instance of the FetchError class. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:43](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L43) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:36](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L36) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/HypercertClient.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/HypercertClient.md new file mode 100644 index 00000000..a5a0e900 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/HypercertClient.md @@ -0,0 +1,493 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertClient + +# Class: HypercertClient + +Hypercerts client factory + +**`Dev`** + +Creates a Hypercerts client instance + +**`Notice`** + +The client is readonly if no signer is set or if the contract address is not set + +**`Param`** + +Hypercerts client configuration + +**`Param`** + +Hypercerts storage object + +## Implements + +- [`HypercertClientInterface`](../interfaces/HypercertClientInterface.md) + +## Table of contents + +### Constructors + +- [constructor](HypercertClient.md#constructor) + +### Properties + +- [\_config](HypercertClient.md#_config) +- [\_contract](HypercertClient.md#_contract) +- [\_evaluator](HypercertClient.md#_evaluator) +- [\_indexer](HypercertClient.md#_indexer) +- [\_operator](HypercertClient.md#_operator) +- [\_storage](HypercertClient.md#_storage) +- [readonly](HypercertClient.md#readonly) + +### Accessors + +- [contract](HypercertClient.md#contract) +- [indexer](HypercertClient.md#indexer) +- [storage](HypercertClient.md#storage) + +### Methods + +- [batchMintClaimFractionsFromAllowlists](HypercertClient.md#batchmintclaimfractionsfromallowlists) +- [burnClaimFraction](HypercertClient.md#burnclaimfraction) +- [checkWritable](HypercertClient.md#checkwritable) +- [createAllowlist](HypercertClient.md#createallowlist) +- [mergeClaimUnits](HypercertClient.md#mergeclaimunits) +- [mintClaim](HypercertClient.md#mintclaim) +- [mintClaimFractionFromAllowlist](HypercertClient.md#mintclaimfractionfromallowlist) +- [splitClaimUnits](HypercertClient.md#splitclaimunits) + +## Constructors + +### constructor + +• **new HypercertClient**(`config?`) + +Creates a new instance of the `HypercertClient` class. + +#### Parameters + +| Name | Type | Description | +| :------- | :------------------------------------------------------------------------- | :---------------------------------------- | +| `config` | `Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> | The configuration options for the client. | + +#### Defined in + +[sdk/src/client.ts:45](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L45) + +## Properties + +### \_config + +• `Private` **\_config**: [`HypercertClientConfig`](../modules.md#hypercertclientconfig) + +#### Defined in + +[sdk/src/client.ts:32](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L32) + +--- + +### \_contract + +• `Private` **\_contract**: [`HypercertMinter`](../interfaces/internal.HypercertMinter.md) + +#### Defined in + +[sdk/src/client.ts:38](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L38) + +--- + +### \_evaluator + +• `Private` **\_evaluator**: [`default`](internal.default.md) + +#### Defined in + +[sdk/src/client.ts:34](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L34) + +--- + +### \_indexer + +• `Private` **\_indexer**: [`default`](internal.default-1.md) + +#### Defined in + +[sdk/src/client.ts:35](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L35) + +--- + +### \_operator + +• `Private` **\_operator**: `Provider` \| `Signer` + +#### Defined in + +[sdk/src/client.ts:37](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L37) + +--- + +### \_storage + +• `Private` **\_storage**: [`HypercertsStorage`](HypercertsStorage.md) + +#### Defined in + +[sdk/src/client.ts:33](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L33) + +--- + +### readonly + +• **readonly**: `boolean` + +Whether the client is in read-only mode. + +#### Implementation of + +[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[readonly](../interfaces/HypercertClientInterface.md#readonly) + +#### Defined in + +[sdk/src/client.ts:39](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L39) + +## Accessors + +### contract + +• `get` **contract**(): [`HypercertMinter`](../interfaces/internal.HypercertMinter.md) + +Gets the HypercertMinter contract used by the client. + +#### Returns + +[`HypercertMinter`](../interfaces/internal.HypercertMinter.md) + +The contract. + +#### Implementation of + +[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[contract](../interfaces/HypercertClientInterface.md#contract) + +#### Defined in + +[sdk/src/client.ts:90](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L90) + +--- + +### indexer + +• `get` **indexer**(): [`default`](internal.default-1.md) + +Gets the indexer for the client. + +#### Returns + +[`default`](internal.default-1.md) + +The indexer. + +#### Implementation of + +[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[indexer](../interfaces/HypercertClientInterface.md#indexer) + +#### Defined in + +[sdk/src/client.ts:82](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L82) + +--- + +### storage + +• `get` **storage**(): [`HypercertsStorage`](HypercertsStorage.md) + +Gets the storage layer for the client. + +#### Returns + +[`HypercertsStorage`](HypercertsStorage.md) + +The storage layer. + +#### Implementation of + +[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[storage](../interfaces/HypercertClientInterface.md#storage) + +#### Defined in + +[sdk/src/client.ts:74](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L74) + +## Methods + +### batchMintClaimFractionsFromAllowlists + +▸ **batchMintClaimFractionsFromAllowlists**(`claimIds`, `units`, `proofs`, `roots?`, `overrides?`): `Promise`<`ContractTransaction`\> + +Batch mints a claim fraction from an allowlist + +**`Note`** + +The length of the arrays must be equal. + +**`Note`** + +The order of the arrays must be equal. + +#### Parameters + +| Name | Type | Description | +| :----------- | :--------------- | :---------------------------------------------------- | +| `claimIds` | `BigNumberish`[] | Array of the IDs of the claims to mint fractions for. | +| `units` | `BigNumberish`[] | Array of the number of units for each fraction. | +| `proofs` | `BytesLike`[][] | Array of Merkle proofs for the allowlists. | +| `roots?` | `BytesLike`[] | - | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +A Promise that resolves to the transaction receipt + +#### Implementation of + +HypercertClientInterface.batchMintClaimFractionsFromAllowlists + +#### Defined in + +[sdk/src/client.ts:317](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L317) + +--- + +### burnClaimFraction + +▸ **burnClaimFraction**(`claimId`, `overrides?`): `Promise`<`ContractTransaction`\> + +Burn a Hypercert claim by providing the claim id + +**`Dev`** + +Burns a Hypercert claim + +#### Parameters + +| Name | Type | Description | +| :----------- | :------------- | :----------------- | +| `claimId` | `BigNumberish` | Hypercert claim id | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +Contract transaction + +#### Implementation of + +HypercertClientInterface.burnClaimFraction + +#### Defined in + +[sdk/src/client.ts:251](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L251) + +--- + +### checkWritable + +▸ `Private` **checkWritable**(): `boolean` + +#### Returns + +`boolean` + +#### Defined in + +[sdk/src/client.ts:347](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L347) + +--- + +### createAllowlist + +▸ **createAllowlist**(`allowList`, `metaData`, `totalUnits`, `transferRestriction`, `overrides?`): `Promise`<`ContractTransaction`\> + +Create a Hypercert claim with an allowlist + +**`Dev`** + +Mints a Hypercert claim with the given metadata, total units, transfer restrictions and allowlist + +**`Notice`** + +The total number of units in the allowlist must match the total number of units for the Hypercert + +#### Parameters + +| Name | Type | Description | +| :-------------------- | :------------------------------------------------------------- | :-------------------------------------- | +| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | Allowlist for the Hypercert | +| `metaData` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | Hypercert metadata | +| `totalUnits` | `BigNumberish` | Total number of units for the Hypercert | +| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | Transfer restrictions for the Hypercert | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +Contract transaction + +#### Implementation of + +HypercertClientInterface.createAllowlist + +#### Defined in + +[sdk/src/client.ts:140](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L140) + +--- + +### mergeClaimUnits + +▸ **mergeClaimUnits**(`claimIds`, `overrides?`): `Promise`<`ContractTransaction`\> + +Merge multiple Hypercert claims fractions into one + +**`Dev`** + +Merges multiple Hypercert claims into one + +#### Parameters + +| Name | Type | Description | +| :----------- | :--------------- | :------------------ | +| `claimIds` | `BigNumberish`[] | Hypercert claim ids | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +Contract transaction + +#### Implementation of + +HypercertClientInterface.mergeClaimUnits + +#### Defined in + +[sdk/src/client.ts:221](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L221) + +--- + +### mintClaim + +▸ **mintClaim**(`metaData`, `totalUnits`, `transferRestriction`, `overrides?`): `Promise`<`ContractTransaction`\> + +Mint a Hypercert claim + +**`Dev`** + +Mints a Hypercert claim with the given metadata, total units and transfer restrictions + +#### Parameters + +| Name | Type | Description | +| :-------------------- | :------------------------------------------------------------- | :-------------------------------------- | +| `metaData` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | Hypercert metadata | +| `totalUnits` | `BigNumberish` | Total number of units for the Hypercert | +| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | Transfer restrictions for the Hypercert | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +Contract transaction + +#### Implementation of + +HypercertClientInterface.mintClaim + +#### Defined in + +[sdk/src/client.ts:102](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L102) + +--- + +### mintClaimFractionFromAllowlist + +▸ **mintClaimFractionFromAllowlist**(`claimId`, `units`, `proof`, `root?`, `overrides?`): `Promise`<`ContractTransaction`\> + +Mint a Hypercert claim fraction from an allowlist. + +**`Dev`** + +Verifies the claim proof and mints the claim fraction + +**`Notice`** + +If known, provide the root for client side verification + +#### Parameters + +| Name | Type | Description | +| :----------- | :------------- | :------------------------- | +| `claimId` | `BigNumberish` | Hypercert claim id | +| `units` | `BigNumberish` | Number of units to mint | +| `proof` | `BytesLike`[] | Merkle proof for the claim | +| `root?` | `BytesLike` | - | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +Contract transaction + +#### Implementation of + +HypercertClientInterface.mintClaimFractionFromAllowlist + +#### Defined in + +[sdk/src/client.ts:278](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L278) + +--- + +### splitClaimUnits + +▸ **splitClaimUnits**(`claimId`, `fractions`, `overrides?`): `Promise`<`ContractTransaction`\> + +Split a Hypercert's unit into multiple claims with the given fractions + +**`Dev`** + +Submit the ID of the claim to split and new fraction values. + +**`Notice`** + +The sum of the fractions must be equal to the total units of the claim + +#### Parameters + +| Name | Type | Description | +| :----------- | :--------------- | :---------------------------------------- | +| `claimId` | `BigNumberish` | Hypercert claim id | +| `fractions` | `BigNumberish`[] | Fractions of the Hypercert claim to split | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +Contract transaction + +#### Implementation of + +HypercertClientInterface.splitClaimUnits + +#### Defined in + +[sdk/src/client.ts:190](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L190) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/HypercertsStorage.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/HypercertsStorage.md new file mode 100644 index 00000000..706c14fe --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/HypercertsStorage.md @@ -0,0 +1,250 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertsStorage + +# Class: HypercertsStorage + +A class that provides storage functionality for Hypercerts. + +## Implements + +- [`HypercertStorageInterface`](../interfaces/HypercertStorageInterface.md) + +## Table of contents + +### Constructors + +- [constructor](HypercertsStorage.md#constructor) + +### Properties + +- [nftStorageClient](HypercertsStorage.md#nftstorageclient) +- [readonly](HypercertsStorage.md#readonly) +- [web3StorageClient](HypercertsStorage.md#web3storageclient) + +### Methods + +- [getData](HypercertsStorage.md#getdata) +- [getMetadata](HypercertsStorage.md#getmetadata) +- [getNftStorageGatewayUri](HypercertsStorage.md#getnftstoragegatewayuri) +- [storeData](HypercertsStorage.md#storedata) +- [storeMetadata](HypercertsStorage.md#storemetadata) + +## Constructors + +### constructor + +• **new HypercertsStorage**(`overrides`) + +Creates a new instance of the `HypercertsStorage` class. + +#### Parameters + +| Name | Type | Description | +| :---------- | :--------------------------------------------------------------------------- | :------------------------------------------- | +| `overrides` | `Partial`<[`HypercertStorageConfig`](../modules.md#hypercertstorageconfig)\> | The configuration overrides for the storage. | + +#### Defined in + +[sdk/src/storage.ts:37](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L37) + +## Properties + +### nftStorageClient + +• `Optional` **nftStorageClient**: `NFTStorage` + +The NFT storage client. + +#### Defined in + +[sdk/src/storage.ts:29](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L29) + +--- + +### readonly + +• **readonly**: `boolean` = `true` + +Whether the storage is read-only. + +#### Defined in + +[sdk/src/storage.ts:27](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L27) + +--- + +### web3StorageClient + +• `Optional` **web3StorageClient**: `any` + +The Web3 storage client. + +#### Defined in + +[sdk/src/storage.ts:31](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L31) + +## Methods + +### getData + +▸ **getData**(`cidOrIpfsUri`): `Promise`<`any`\> + +Gets arbitrary data from Web3 storage. + +**`Throws`** + +A `StorageError` if the storage client is not configured or the data cannot be retrieved. + +#### Parameters + +| Name | Type | Description | +| :------------- | :------- | :-------------------------------------- | +| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the data to get. | + +#### Returns + +`Promise`<`any`\> + +A Promise that resolves to the data. + +#### Implementation of + +HypercertStorageInterface.getData + +#### Defined in + +[sdk/src/storage.ts:147](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L147) + +--- + +### getMetadata + +▸ **getMetadata**(`cidOrIpfsUri`): `Promise`<[`HypercertMetadata`](../interfaces/HypercertMetadata.md)\> + +Gets metadata for a Hypercert. + +**`Throws`** + +A `StorageError` if the storage client is not configured or the metadata cannot be retrieved. + +**`Throws`** + +A `MalformedDataError` if the metadata is invalid. E.g. unknown schema + +#### Parameters + +| Name | Type | Description | +| :------------- | :------- | :------------------------------------------ | +| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the metadata to get. | + +#### Returns + +`Promise`<[`HypercertMetadata`](../interfaces/HypercertMetadata.md)\> + +A Promise that resolves to the metadata. + +#### Implementation of + +HypercertStorageInterface.getMetadata + +#### Defined in + +[sdk/src/storage.ts:97](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L97) + +--- + +### getNftStorageGatewayUri + +▸ **getNftStorageGatewayUri**(`cidOrIpfsUri`): `string` + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `cidOrIpfsUri` | `string` | + +#### Returns + +`string` + +#### Defined in + +[sdk/src/storage.ts:181](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L181) + +--- + +### storeData + +▸ **storeData**(`data`): `Promise`<`CIDString`\> + +Stores arbitrary data in Web3 storage. + +**`Throws`** + +A `StorageError` if the storage client is not configured. + +**`Notice`** + +Even though web3.storage takes a list of files, we'll assume we're only storing 1 JSON blob. +Because we pay for storage quotas, this data is stored best effort. +If you are using our default keys, we may delete older data if we hit our storage quota. + +#### Parameters + +| Name | Type | Description | +| :----- | :-------- | :----------------- | +| `data` | `unknown` | The data to store. | + +#### Returns + +`Promise`<`CIDString`\> + +A Promise that resolves to the CID of the stored data. + +#### Implementation of + +HypercertStorageInterface.storeData + +#### Defined in + +[sdk/src/storage.ts:125](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L125) + +--- + +### storeMetadata + +▸ **storeMetadata**(`data`): `Promise`<`CIDString`\> + +Stores metadata for a Hypercert. + +**`Throws`** + +A `StorageError` if the storage client is not configured. + +**`Throws`** + +A `MalformedDataError` if the metadata is invalid. + +**`Notice`** + +Because we pay for storage quotas, this data is stored best effort. +If you are using our default keys, we may delete older data if we hit our storage quota. + +#### Parameters + +| Name | Type | Description | +| :----- | :-------------------------------------------------------- | :--------------------- | +| `data` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | The metadata to store. | + +#### Returns + +`Promise`<`CIDString`\> + +A Promise that resolves to the CID of the stored metadata. + +#### Implementation of + +HypercertStorageInterface.storeMetadata + +#### Defined in + +[sdk/src/storage.ts:67](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L67) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/InvalidOrMissingError.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/InvalidOrMissingError.md new file mode 100644 index 00000000..d12c0653 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/InvalidOrMissingError.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / InvalidOrMissingError + +# Class: InvalidOrMissingError + +The provided value was undefined or empty + +## Hierarchy + +- `Error` + + ↳ **`InvalidOrMissingError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](InvalidOrMissingError.md#constructor) + +### Properties + +- [payload](InvalidOrMissingError.md#payload) + +## Constructors + +### constructor + +• **new InvalidOrMissingError**(`message`, `payload?`) + +Creates a new instance of the InvalidOrMissingError class. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:61](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L61) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:54](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L54) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/MalformedDataError.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/MalformedDataError.md new file mode 100644 index 00000000..028129d8 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/MalformedDataError.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / MalformedDataError + +# Class: MalformedDataError + +Data doesn't conform to expectations + +## Hierarchy + +- `Error` + + ↳ **`MalformedDataError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](MalformedDataError.md#constructor) + +### Properties + +- [payload](MalformedDataError.md#payload) + +## Constructors + +### constructor + +• **new MalformedDataError**(`message`, `payload?`) + +Creates a new instance of the MalformedDataError class. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:133](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L133) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:126](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L126) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/MintingError.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/MintingError.md new file mode 100644 index 00000000..de284494 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/MintingError.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / MintingError + +# Class: MintingError + +Minting transaction failed + +## Hierarchy + +- `Error` + + ↳ **`MintingError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](MintingError.md#constructor) + +### Properties + +- [payload](MintingError.md#payload) + +## Constructors + +### constructor + +• **new MintingError**(`message`, `payload?`) + +Creates a new instance of the MintingError class. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:79](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L79) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:72](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L72) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/StorageError.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/StorageError.md new file mode 100644 index 00000000..0dcf0291 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/StorageError.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / StorageError + +# Class: StorageError + +Fails storing to a remote resource + +## Hierarchy + +- `Error` + + ↳ **`StorageError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](StorageError.md#constructor) + +### Properties + +- [payload](StorageError.md#payload) + +## Constructors + +### constructor + +• **new StorageError**(`message`, `payload?`) + +Creates a new instance of the StorageError class. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:97](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L97) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:90](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L90) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/UnknownSchemaError.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/UnknownSchemaError.md new file mode 100644 index 00000000..5fdb25e0 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/UnknownSchemaError.md @@ -0,0 +1,71 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / UnknownSchemaError + +# Class: UnknownSchemaError + +Schema could not be loaded + +## Hierarchy + +- `Error` + + ↳ **`UnknownSchemaError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](UnknownSchemaError.md#constructor) + +### Properties + +- [payload](UnknownSchemaError.md#payload) + +## Constructors + +### constructor + +• **new UnknownSchemaError**(`message`, `payload?`) + +Creates a new instance of the UnknownSchemaError class. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | +| `payload.schemaName` | `string` | - | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:115](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L115) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Type declaration + +| Name | Type | +| :----------- | :------- | +| `schemaName` | `string` | + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:108](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L108) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/UnsupportedChainError.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/UnsupportedChainError.md new file mode 100644 index 00000000..0964b138 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/UnsupportedChainError.md @@ -0,0 +1,72 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / UnsupportedChainError + +# Class: UnsupportedChainError + +This blockchain is not yet supported +Please file an issue + +## Hierarchy + +- `Error` + + ↳ **`UnsupportedChainError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](UnsupportedChainError.md#constructor) + +### Properties + +- [payload](UnsupportedChainError.md#payload) + +## Constructors + +### constructor + +• **new UnsupportedChainError**(`message`, `payload?`) + +Creates a new instance of the UnsupportedChainError class. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | +| `payload.chainID` | `undefined` \| `string` \| `number` | - | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:152](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L152) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Type declaration + +| Name | Type | +| :-------- | :---------------------------------- | +| `chainID` | `undefined` \| `string` \| `number` | + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:145](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L145) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/internal.default-1.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/internal.default-1.md new file mode 100644 index 00000000..1b94a629 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/internal.default-1.md @@ -0,0 +1,278 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / [internal](../modules/internal.md) / default + +# Class: default + +[internal](../modules/internal.md).default + +A class that provides indexing functionality for Hypercerts. + +## Implements + +- [`HypercertIndexerInterface`](../interfaces/HypercertIndexerInterface.md) + +## Table of contents + +### Constructors + +- [constructor](internal.default-1.md#constructor) + +### Properties + +- [\_graphClient](internal.default-1.md#_graphclient) + +### Accessors + +- [graphClient](internal.default-1.md#graphclient) + +### Methods + +- [claimById](internal.default-1.md#claimbyid) +- [claimsByOwner](internal.default-1.md#claimsbyowner) +- [firstClaims](internal.default-1.md#firstclaims) +- [fractionById](internal.default-1.md#fractionbyid) +- [fractionsByClaim](internal.default-1.md#fractionsbyclaim) +- [fractionsByOwner](internal.default-1.md#fractionsbyowner) + +## Constructors + +### constructor + +• **new default**(`options`) + +Creates a new instance of the `HypercertIndexer` class. + +#### Parameters + +| Name | Type | Description | +| :------------------ | :------- | :----------------------------------------- | +| `options` | `Object` | The configuration options for the indexer. | +| `options.graphUrl?` | `string` | - | + +#### Defined in + +[sdk/src/indexer.ts:17](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L17) + +## Properties + +### \_graphClient + +• `Private` **\_graphClient**: `Object` + +The Graph client used by the indexer. + +#### Type declaration + +| Name | Type | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ClaimById` | (`variables`: [`Exact`](../modules/internal.md#exact)<{ `id`: `string` }\>, `options?`: `unknown`) => `Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> | +| `ClaimTokenById` | (`variables`: [`Exact`](../modules/internal.md#exact)<{ `claimTokenId`: `string` }\>, `options?`: `unknown`) => `Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> | +| `ClaimTokensByClaim` | (`variables`: [`Exact`](../modules/internal.md#exact)<{ `claimId`: `string` ; `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> | +| `ClaimTokensByOwner` | (`variables?`: [`Exact`](../modules/internal.md#exact)<{ `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `owner?`: `any` ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> | +| `ClaimsByOwner` | (`variables?`: [`Exact`](../modules/internal.md#exact)<{ `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `owner?`: `any` ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> | +| `RecentClaims` | (`variables?`: [`Exact`](../modules/internal.md#exact)<{ `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> | + +#### Defined in + +[sdk/src/indexer.ts:11](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L11) + +## Accessors + +### graphClient + +• `get` **graphClient**(): `Object` + +Gets the Graph client used by the indexer. + +#### Returns + +`Object` + +The Graph client. + +| Name | Type | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ClaimById` | (`variables`: [`Exact`](../modules/internal.md#exact)<{ `id`: `string` }\>, `options?`: `unknown`) => `Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> | +| `ClaimTokenById` | (`variables`: [`Exact`](../modules/internal.md#exact)<{ `claimTokenId`: `string` }\>, `options?`: `unknown`) => `Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> | +| `ClaimTokensByClaim` | (`variables`: [`Exact`](../modules/internal.md#exact)<{ `claimId`: `string` ; `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> | +| `ClaimTokensByOwner` | (`variables?`: [`Exact`](../modules/internal.md#exact)<{ `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `owner?`: `any` ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> | +| `ClaimsByOwner` | (`variables?`: [`Exact`](../modules/internal.md#exact)<{ `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `owner?`: `any` ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> | +| `RecentClaims` | (`variables?`: [`Exact`](../modules/internal.md#exact)<{ `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> | + +#### Implementation of + +[HypercertIndexerInterface](../interfaces/HypercertIndexerInterface.md).[graphClient](../interfaces/HypercertIndexerInterface.md#graphclient) + +#### Defined in + +[sdk/src/indexer.ts:27](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L27) + +## Methods + +### claimById + +▸ **claimById**(`id`): `Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> + +Gets a claim by its ID. + +#### Parameters + +| Name | Type | Description | +| :--- | :------- | :------------------- | +| `id` | `string` | The ID of the claim. | + +#### Returns + +`Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> + +A Promise that resolves to the claim. + +#### Implementation of + +HypercertIndexerInterface.claimById + +#### Defined in + +[sdk/src/indexer.ts:48](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L48) + +--- + +### claimsByOwner + +▸ **claimsByOwner**(`owner`, `params?`): `Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> + +Gets the claims owned by a given address. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :----------------------------------------- | :------------------- | :------------------------ | +| `owner` | `string` | `undefined` | The address of the owner. | +| `params` | [`QueryParams`](../modules.md#queryparams) | `defaultQueryParams` | The query parameters. | + +#### Returns + +`Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> + +A Promise that resolves to the claims. + +#### Implementation of + +HypercertIndexerInterface.claimsByOwner + +#### Defined in + +[sdk/src/indexer.ts:37](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L37) + +--- + +### firstClaims + +▸ **firstClaims**(`params?`): `Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> + +Gets the most recent claims. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :----------------------------------------- | :------------------- | :-------------------- | +| `params` | [`QueryParams`](../modules.md#queryparams) | `defaultQueryParams` | The query parameters. | + +#### Returns + +`Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> + +A Promise that resolves to the claims. + +#### Implementation of + +HypercertIndexerInterface.firstClaims + +#### Defined in + +[sdk/src/indexer.ts:58](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L58) + +--- + +### fractionById + +▸ **fractionById**(`fractionId`): `Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> + +Gets a claim token by its ID. + +#### Parameters + +| Name | Type | Description | +| :----------- | :------- | :------------------------- | +| `fractionId` | `string` | The ID of the claim token. | + +#### Returns + +`Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> + +A Promise that resolves to the claim token. + +#### Implementation of + +HypercertIndexerInterface.fractionById + +#### Defined in + +[sdk/src/indexer.ts:92](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L92) + +--- + +### fractionsByClaim + +▸ **fractionsByClaim**(`claimId`, `params?`): `Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> + +Gets the claim tokens for a given claim. + +#### Parameters + +| Name | Type | Default value | Description | +| :-------- | :----------------------------------------- | :------------------- | :-------------------- | +| `claimId` | `string` | `undefined` | The ID of the claim. | +| `params` | [`QueryParams`](../modules.md#queryparams) | `defaultQueryParams` | The query parameters. | + +#### Returns + +`Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> + +A Promise that resolves to the claim tokens. + +#### Implementation of + +HypercertIndexerInterface.fractionsByClaim + +#### Defined in + +[sdk/src/indexer.ts:81](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L81) + +--- + +### fractionsByOwner + +▸ **fractionsByOwner**(`owner`, `params?`): `Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> + +Gets the claim tokens owned by a given address. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :----------------------------------------- | :------------------- | :------------------------ | +| `owner` | `string` | `undefined` | The address of the owner. | +| `params` | [`QueryParams`](../modules.md#queryparams) | `defaultQueryParams` | The query parameters. | + +#### Returns + +`Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> + +A Promise that resolves to the claim tokens. + +#### Implementation of + +HypercertIndexerInterface.fractionsByOwner + +#### Defined in + +[sdk/src/indexer.ts:69](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L69) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/internal.default-2.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/internal.default-2.md new file mode 100644 index 00000000..1538ce61 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/internal.default-2.md @@ -0,0 +1,131 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / [internal](../modules/internal.md) / default + +# Class: default + +[internal](../modules/internal.md).default + +The EasEvaluator class provides methods for signing off-chain attestations of evaluations. +Schemas are stored on-chain in the Ethereum Attestation Service (EAS) contract. + +## Table of contents + +### Constructors + +- [constructor](internal.default-2.md#constructor) + +### Properties + +- [offChain](internal.default-2.md#offchain) +- [readonly](internal.default-2.md#readonly) +- [signer](internal.default-2.md#signer) + +### Methods + +- [getSignature](internal.default-2.md#getsignature) +- [signOfflineEvaluation](internal.default-2.md#signofflineevaluation) + +## Constructors + +### constructor + +• **new default**(`config`) + +Creates a new EasEvaluator instance. + +#### Parameters + +| Name | Type | Description | +| :------- | :------------------------------------------------------------------------- | :------------------------------------------------------- | +| `config` | `Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> | The configuration options for the EasEvaluator instance. | + +#### Defined in + +[sdk/src/evaluations/eas.ts:37](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/eas.ts#L37) + +## Properties + +### offChain + +• **offChain**: `Offchain` + +The Offchain instance used for signing off-chain attestations. + +#### Defined in + +[sdk/src/evaluations/eas.ts:24](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/eas.ts#L24) + +--- + +### readonly + +• **readonly**: `boolean` = `true` + +#### Defined in + +[sdk/src/evaluations/eas.ts:31](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/eas.ts#L31) + +--- + +### signer + +• `Optional` **signer**: `Signer` & `TypedDataSigner` + +The TypedDataSigner instance used for signing typed data. + +#### Defined in + +[sdk/src/evaluations/eas.ts:29](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/eas.ts#L29) + +## Methods + +### getSignature + +▸ **getSignature**(`encodedData`, `recipient`, `schemaUid`): `Promise`<`SignedOffchainAttestation`\> + +Gets a signature for an off-chain attestation. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------------------------------------------ | +| `encodedData` | `string` | The encoded data to sign. | +| `recipient` | `string` | The address of the recipient of the attestation. | +| `schemaUid` | `string` | The UID of the schema to use for the attestation. | + +#### Returns + +`Promise`<`SignedOffchainAttestation`\> + +- The signature for the attestation. + +#### Defined in + +[sdk/src/evaluations/eas.ts:62](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/eas.ts#L62) + +--- + +### signOfflineEvaluation + +▸ **signOfflineEvaluation**(`evaluation`): `Promise`<`undefined` \| `SignedOffchainAttestation`\> + +Signs an offline evaluation. + +**`Throws`** + +- If the evaluation data is malformed. + +#### Parameters + +| Name | Type | Description | +| :----------- | :----------------------------------------------- | :--------------------------- | +| `evaluation` | [`EvaluationData`](../modules.md#evaluationdata) | The evaluation data to sign. | + +#### Returns + +`Promise`<`undefined` \| `SignedOffchainAttestation`\> + +- The signature for the evaluation. + +#### Defined in + +[sdk/src/evaluations/eas.ts:95](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/eas.ts#L95) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/internal.default.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/internal.default.md new file mode 100644 index 00000000..86daa5e4 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/classes/internal.default.md @@ -0,0 +1,110 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / [internal](../modules/internal.md) / default + +# Class: default + +[internal](../modules/internal.md).default + +## Implements + +- [`EvaluatorInterface`](../interfaces/internal.EvaluatorInterface.md) + +## Table of contents + +### Constructors + +- [constructor](internal.default.md#constructor) + +### Properties + +- [eas](internal.default.md#eas) +- [readonly](internal.default.md#readonly) +- [signer](internal.default.md#signer) +- [storage](internal.default.md#storage) + +### Methods + +- [submitEvaluation](internal.default.md#submitevaluation) + +## Constructors + +### constructor + +• **new default**(`config?`) + +#### Parameters + +| Name | Type | +| :------- | :------------------------------------------------------------------------- | +| `config` | `Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> | + +#### Defined in + +[sdk/src/evaluations/index.ts:37](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L37) + +## Properties + +### eas + +• **eas**: [`default`](internal.default-2.md) + +#### Defined in + +[sdk/src/evaluations/index.ts:33](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L33) + +--- + +### readonly + +• **readonly**: `boolean` = `true` + +#### Defined in + +[sdk/src/evaluations/index.ts:35](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L35) + +--- + +### signer + +• `Optional` **signer**: `Signer` & `TypedDataSigner` + +#### Defined in + +[sdk/src/evaluations/index.ts:29](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L29) + +--- + +### storage + +• **storage**: [`HypercertsStorage`](HypercertsStorage.md) + +#### Defined in + +[sdk/src/evaluations/index.ts:31](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L31) + +## Methods + +### submitEvaluation + +▸ **submitEvaluation**(`evaluation`): `Promise`<`CIDString`\> + +Submits an evaluation to the prefered storage system. + +#### Parameters + +| Name | Type | Description | +| :----------- | :------------------------------------------------------------------------ | :------------------------ | +| `evaluation` | [`HypercertEvaluationSchema`](../interfaces/HypercertEvaluationSchema.md) | The evaluation to submit. | + +#### Returns + +`Promise`<`CIDString`\> + +- The CID of the submitted evaluation. + +#### Implementation of + +EvaluatorInterface.submitEvaluation + +#### Defined in + +[sdk/src/evaluations/index.ts:53](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L53) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/CustomError.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/CustomError.md new file mode 100644 index 00000000..b4af6279 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/CustomError.md @@ -0,0 +1,39 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / CustomError + +# Interface: CustomError + +An interface for errors that have a specific type. + +## Implemented by + +- [`ClientError`](../classes/ClientError.md) +- [`ConfigurationError`](../classes/ConfigurationError.md) +- [`FetchError`](../classes/FetchError.md) +- [`InvalidOrMissingError`](../classes/InvalidOrMissingError.md) +- [`MalformedDataError`](../classes/MalformedDataError.md) +- [`MintingError`](../classes/MintingError.md) +- [`StorageError`](../classes/StorageError.md) +- [`UnknownSchemaError`](../classes/UnknownSchemaError.md) +- [`UnsupportedChainError`](../classes/UnsupportedChainError.md) + +## Table of contents + +### Properties + +- [payload](CustomError.md#payload) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Defined in + +[sdk/src/types/errors.ts:8](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L8) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/DuplicateEvaluation.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/DuplicateEvaluation.md new file mode 100644 index 00000000..4606b46e --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/DuplicateEvaluation.md @@ -0,0 +1,56 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / DuplicateEvaluation + +# Interface: DuplicateEvaluation + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [duplicateHypercerts](DuplicateEvaluation.md#duplicatehypercerts) +- [explanation](DuplicateEvaluation.md#explanation) +- [realHypercert](DuplicateEvaluation.md#realhypercert) +- [type](DuplicateEvaluation.md#type) + +## Properties + +### duplicateHypercerts + +• **duplicateHypercerts**: [`HypercertPointer`](HypercertPointer.md)[] + +#### Defined in + +[sdk/src/types/evaluation.d.ts:22](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L22) + +--- + +### explanation + +• **explanation**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:24](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L24) + +--- + +### realHypercert + +• **realHypercert**: [`HypercertPointer`](HypercertPointer.md) + +#### Defined in + +[sdk/src/types/evaluation.d.ts:23](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L23) + +--- + +### type + +• **type**: `"duplicate"` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:21](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L21) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/EASEvaluation.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/EASEvaluation.md new file mode 100644 index 00000000..205b7004 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/EASEvaluation.md @@ -0,0 +1,56 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / EASEvaluation + +# Interface: EASEvaluation + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [chainId](EASEvaluation.md#chainid) +- [contract](EASEvaluation.md#contract) +- [type](EASEvaluation.md#type) +- [uid](EASEvaluation.md#uid) + +## Properties + +### chainId + +• **chainId**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:41](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L41) + +--- + +### contract + +• **contract**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:42](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L42) + +--- + +### type + +• **type**: `"EAS"` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:40](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L40) + +--- + +### uid + +• **uid**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:43](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L43) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClaimdata.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClaimdata.md new file mode 100644 index 00000000..3dcea656 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClaimdata.md @@ -0,0 +1,167 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertClaimdata + +# Interface: HypercertClaimdata + +Properties of an impact claim + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [contributors](HypercertClaimdata.md#contributors) +- [impact_scope](HypercertClaimdata.md#impact_scope) +- [impact_timeframe](HypercertClaimdata.md#impact_timeframe) +- [rights](HypercertClaimdata.md#rights) +- [work_scope](HypercertClaimdata.md#work_scope) +- [work_timeframe](HypercertClaimdata.md#work_timeframe) + +## Properties + +### contributors + +• **contributors**: `Object` + +Contributors + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/claimdata.d.ts:53](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/claimdata.d.ts#L53) + +--- + +### impact_scope + +• **impact_scope**: `Object` + +Scopes of impact + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `excludes?` | `string`[] | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/claimdata.d.ts:15](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/claimdata.d.ts#L15) + +--- + +### impact_timeframe + +• **impact_timeframe**: `Object` + +Impact time period. The value is UNIX time in seconds from epoch. + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `name?` | `string` | +| `value?` | `number`[] | + +#### Defined in + +[sdk/src/types/claimdata.d.ts:44](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/claimdata.d.ts#L44) + +--- + +### rights + +• `Optional` **rights**: `Object` + +Rights + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `excludes?` | `string`[] | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/claimdata.d.ts:62](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/claimdata.d.ts#L62) + +--- + +### work_scope + +• **work_scope**: `Object` + +Scopes of work + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `excludes?` | `string`[] | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/claimdata.d.ts:25](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/claimdata.d.ts#L25) + +--- + +### work_timeframe + +• **work_timeframe**: `Object` + +Work time period. The value is UNIX time in seconds from epoch. + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `name?` | `string` | +| `value?` | `number`[] | + +#### Defined in + +[sdk/src/types/claimdata.d.ts:35](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/claimdata.d.ts#L35) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClientInterface.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClientInterface.md new file mode 100644 index 00000000..0483b520 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClientInterface.md @@ -0,0 +1,341 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertClientInterface + +# Interface: HypercertClientInterface + +The interface for the Hypercert client. + +## Hierarchy + +- [`HypercertClientMethods`](HypercertClientMethods.md) + +- [`HypercertClientState`](HypercertClientState.md) + + ↳ **`HypercertClientInterface`** + +## Implemented by + +- [`HypercertClient`](../classes/HypercertClient.md) + +## Table of contents + +### Properties + +- [batchMintClaimFractionsFromAllowlists](HypercertClientInterface.md#batchmintclaimfractionsfromallowlists) +- [burnClaimFraction](HypercertClientInterface.md#burnclaimfraction) +- [contract](HypercertClientInterface.md#contract) +- [createAllowlist](HypercertClientInterface.md#createallowlist) +- [indexer](HypercertClientInterface.md#indexer) +- [mergeClaimUnits](HypercertClientInterface.md#mergeclaimunits) +- [mintClaim](HypercertClientInterface.md#mintclaim) +- [mintClaimFractionFromAllowlist](HypercertClientInterface.md#mintclaimfractionfromallowlist) +- [readonly](HypercertClientInterface.md#readonly) +- [splitClaimUnits](HypercertClientInterface.md#splitclaimunits) +- [storage](HypercertClientInterface.md#storage) + +## Properties + +### batchMintClaimFractionsFromAllowlists + +• **batchMintClaimFractionsFromAllowlists**: (`claimIds`: `BigNumberish`[], `units`: `BigNumberish`[], `proofs`: `BytesLike`[][]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimIds`, `units`, `proofs`): `Promise`<`ContractTransaction`\> + +Batch mints a claim fraction from an allowlist + +**`Note`** + +The length of the arrays must be equal. + +**`Note`** + +The order of the arrays must be equal. + +##### Parameters + +| Name | Type | Description | +| :--------- | :--------------- | :---------------------------------------------------- | +| `claimIds` | `BigNumberish`[] | Array of the IDs of the claims to mint fractions for. | +| `units` | `BigNumberish`[] | Array of the number of units for each fraction. | +| `proofs` | `BytesLike`[][] | Array of Merkle proofs for the allowlists. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[batchMintClaimFractionsFromAllowlists](HypercertClientMethods.md#batchmintclaimfractionsfromallowlists) + +#### Defined in + +[sdk/src/types/client.ts:200](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L200) + +--- + +### burnClaimFraction + +• **burnClaimFraction**: (`claimId`: `BigNumberish`) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimId`): `Promise`<`ContractTransaction`\> + +Burns a claim fraction. + +##### Parameters + +| Name | Type | Description | +| :-------- | :------------- | :------------------------------------ | +| `claimId` | `BigNumberish` | The ID of the claim fraction to burn. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[burnClaimFraction](HypercertClientMethods.md#burnclaimfraction) + +#### Defined in + +[sdk/src/types/client.ts:175](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L175) + +--- + +### contract + +• **contract**: [`HypercertMinter`](internal.HypercertMinter.md) + +The contract used by the client. + +#### Inherited from + +[HypercertClientState](HypercertClientState.md).[contract](HypercertClientState.md#contract) + +#### Defined in + +[sdk/src/types/client.ts:120](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L120) + +--- + +### createAllowlist + +• **createAllowlist**: (`allowList`: [`AllowlistEntry`](../modules.md#allowlistentry)[], `metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `BigNumberish`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`allowList`, `metaData`, `totalUnits`, `transferRestriction`): `Promise`<`ContractTransaction`\> + +Creates a new allowlist and mints a new claim with the allowlist. + +##### Parameters + +| Name | Type | Description | +| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | +| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The allowlist for the claim. | +| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | +| `totalUnits` | `BigNumberish` | The total number of units for the claim. | +| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[createAllowlist](HypercertClientMethods.md#createallowlist) + +#### Defined in + +[sdk/src/types/client.ts:148](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L148) + +--- + +### indexer + +• **indexer**: [`default`](../classes/internal.default-1.md) + +The indexer used by the client. + +#### Inherited from + +[HypercertClientState](HypercertClientState.md).[indexer](HypercertClientState.md#indexer) + +#### Defined in + +[sdk/src/types/client.ts:118](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L118) + +--- + +### mergeClaimUnits + +• **mergeClaimUnits**: (`claimIds`: `BigNumberish`[]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimIds`): `Promise`<`ContractTransaction`\> + +Merges multiple claim fractions into a single claim. + +##### Parameters + +| Name | Type | Description | +| :--------- | :--------------- | :--------------------------------------- | +| `claimIds` | `BigNumberish`[] | The IDs of the claim fractions to merge. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[mergeClaimUnits](HypercertClientMethods.md#mergeclaimunits) + +#### Defined in + +[sdk/src/types/client.ts:168](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L168) + +--- + +### mintClaim + +• **mintClaim**: (`metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `BigNumberish`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`metaData`, `totalUnits`, `transferRestriction`): `Promise`<`ContractTransaction`\> + +Mints a new claim. + +##### Parameters + +| Name | Type | Description | +| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | +| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | +| `totalUnits` | `BigNumberish` | The total number of units for the claim. | +| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[mintClaim](HypercertClientMethods.md#mintclaim) + +#### Defined in + +[sdk/src/types/client.ts:134](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L134) + +--- + +### mintClaimFractionFromAllowlist + +• **mintClaimFractionFromAllowlist**: (`claimId`: `BigNumberish`, `units`: `BigNumberish`, `proof`: `BytesLike`[]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimId`, `units`, `proof`): `Promise`<`ContractTransaction`\> + +Mints a claim fraction from an allowlist. + +##### Parameters + +| Name | Type | Description | +| :-------- | :------------- | :------------------------------------------ | +| `claimId` | `BigNumberish` | The ID of the claim to mint a fraction for. | +| `units` | `BigNumberish` | The number of units for the fraction. | +| `proof` | `BytesLike`[] | The Merkle proof for the allowlist. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[mintClaimFractionFromAllowlist](HypercertClientMethods.md#mintclaimfractionfromallowlist) + +#### Defined in + +[sdk/src/types/client.ts:184](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L184) + +--- + +### readonly + +• **readonly**: `boolean` + +Whether the client is in read-only mode. + +#### Inherited from + +[HypercertClientState](HypercertClientState.md).[readonly](HypercertClientState.md#readonly) + +#### Defined in + +[sdk/src/types/client.ts:114](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L114) + +--- + +### splitClaimUnits + +• **splitClaimUnits**: (`claimId`: `BigNumberish`, `fractions`: `BigNumberish`[]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimId`, `fractions`): `Promise`<`ContractTransaction`\> + +Splits a claim into multiple fractions. + +##### Parameters + +| Name | Type | Description | +| :---------- | :--------------- | :------------------------------------- | +| `claimId` | `BigNumberish` | The ID of the claim to split. | +| `fractions` | `BigNumberish`[] | The number of units for each fraction. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[splitClaimUnits](HypercertClientMethods.md#splitclaimunits) + +#### Defined in + +[sdk/src/types/client.ts:161](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L161) + +--- + +### storage + +• **storage**: [`HypercertStorageInterface`](HypercertStorageInterface.md) + +The storage layer used by the client. + +#### Inherited from + +[HypercertClientState](HypercertClientState.md).[storage](HypercertClientState.md#storage) + +#### Defined in + +[sdk/src/types/client.ts:116](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L116) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClientMethods.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClientMethods.md new file mode 100644 index 00000000..734ccbee --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClientMethods.md @@ -0,0 +1,239 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertClientMethods + +# Interface: HypercertClientMethods + +The methods for the Hypercert client. + +## Hierarchy + +- **`HypercertClientMethods`** + + ↳ [`HypercertClientInterface`](HypercertClientInterface.md) + +## Table of contents + +### Properties + +- [batchMintClaimFractionsFromAllowlists](HypercertClientMethods.md#batchmintclaimfractionsfromallowlists) +- [burnClaimFraction](HypercertClientMethods.md#burnclaimfraction) +- [createAllowlist](HypercertClientMethods.md#createallowlist) +- [mergeClaimUnits](HypercertClientMethods.md#mergeclaimunits) +- [mintClaim](HypercertClientMethods.md#mintclaim) +- [mintClaimFractionFromAllowlist](HypercertClientMethods.md#mintclaimfractionfromallowlist) +- [splitClaimUnits](HypercertClientMethods.md#splitclaimunits) + +## Properties + +### batchMintClaimFractionsFromAllowlists + +• **batchMintClaimFractionsFromAllowlists**: (`claimIds`: `BigNumberish`[], `units`: `BigNumberish`[], `proofs`: `BytesLike`[][]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimIds`, `units`, `proofs`): `Promise`<`ContractTransaction`\> + +Batch mints a claim fraction from an allowlist + +**`Note`** + +The length of the arrays must be equal. + +**`Note`** + +The order of the arrays must be equal. + +##### Parameters + +| Name | Type | Description | +| :--------- | :--------------- | :---------------------------------------------------- | +| `claimIds` | `BigNumberish`[] | Array of the IDs of the claims to mint fractions for. | +| `units` | `BigNumberish`[] | Array of the number of units for each fraction. | +| `proofs` | `BytesLike`[][] | Array of Merkle proofs for the allowlists. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:200](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L200) + +--- + +### burnClaimFraction + +• **burnClaimFraction**: (`claimId`: `BigNumberish`) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimId`): `Promise`<`ContractTransaction`\> + +Burns a claim fraction. + +##### Parameters + +| Name | Type | Description | +| :-------- | :------------- | :------------------------------------ | +| `claimId` | `BigNumberish` | The ID of the claim fraction to burn. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:175](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L175) + +--- + +### createAllowlist + +• **createAllowlist**: (`allowList`: [`AllowlistEntry`](../modules.md#allowlistentry)[], `metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `BigNumberish`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`allowList`, `metaData`, `totalUnits`, `transferRestriction`): `Promise`<`ContractTransaction`\> + +Creates a new allowlist and mints a new claim with the allowlist. + +##### Parameters + +| Name | Type | Description | +| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | +| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The allowlist for the claim. | +| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | +| `totalUnits` | `BigNumberish` | The total number of units for the claim. | +| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:148](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L148) + +--- + +### mergeClaimUnits + +• **mergeClaimUnits**: (`claimIds`: `BigNumberish`[]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimIds`): `Promise`<`ContractTransaction`\> + +Merges multiple claim fractions into a single claim. + +##### Parameters + +| Name | Type | Description | +| :--------- | :--------------- | :--------------------------------------- | +| `claimIds` | `BigNumberish`[] | The IDs of the claim fractions to merge. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:168](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L168) + +--- + +### mintClaim + +• **mintClaim**: (`metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `BigNumberish`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`metaData`, `totalUnits`, `transferRestriction`): `Promise`<`ContractTransaction`\> + +Mints a new claim. + +##### Parameters + +| Name | Type | Description | +| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | +| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | +| `totalUnits` | `BigNumberish` | The total number of units for the claim. | +| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:134](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L134) + +--- + +### mintClaimFractionFromAllowlist + +• **mintClaimFractionFromAllowlist**: (`claimId`: `BigNumberish`, `units`: `BigNumberish`, `proof`: `BytesLike`[]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimId`, `units`, `proof`): `Promise`<`ContractTransaction`\> + +Mints a claim fraction from an allowlist. + +##### Parameters + +| Name | Type | Description | +| :-------- | :------------- | :------------------------------------------ | +| `claimId` | `BigNumberish` | The ID of the claim to mint a fraction for. | +| `units` | `BigNumberish` | The number of units for the fraction. | +| `proof` | `BytesLike`[] | The Merkle proof for the allowlist. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:184](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L184) + +--- + +### splitClaimUnits + +• **splitClaimUnits**: (`claimId`: `BigNumberish`, `fractions`: `BigNumberish`[]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimId`, `fractions`): `Promise`<`ContractTransaction`\> + +Splits a claim into multiple fractions. + +##### Parameters + +| Name | Type | Description | +| :---------- | :--------------- | :------------------------------------- | +| `claimId` | `BigNumberish` | The ID of the claim to split. | +| `fractions` | `BigNumberish`[] | The number of units for each fraction. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:161](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L161) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClientState.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClientState.md new file mode 100644 index 00000000..2d90a599 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertClientState.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertClientState + +# Interface: HypercertClientState + +The state of the Hypercert client. + +## Hierarchy + +- **`HypercertClientState`** + + ↳ [`HypercertClientInterface`](HypercertClientInterface.md) + +## Table of contents + +### Properties + +- [contract](HypercertClientState.md#contract) +- [indexer](HypercertClientState.md#indexer) +- [readonly](HypercertClientState.md#readonly) +- [storage](HypercertClientState.md#storage) + +## Properties + +### contract + +• **contract**: [`HypercertMinter`](internal.HypercertMinter.md) + +The contract used by the client. + +#### Defined in + +[sdk/src/types/client.ts:120](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L120) + +--- + +### indexer + +• **indexer**: [`default`](../classes/internal.default-1.md) + +The indexer used by the client. + +#### Defined in + +[sdk/src/types/client.ts:118](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L118) + +--- + +### readonly + +• **readonly**: `boolean` + +Whether the client is in read-only mode. + +#### Defined in + +[sdk/src/types/client.ts:114](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L114) + +--- + +### storage + +• **storage**: [`HypercertStorageInterface`](HypercertStorageInterface.md) + +The storage layer used by the client. + +#### Defined in + +[sdk/src/types/client.ts:116](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L116) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertEvaluationSchema.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertEvaluationSchema.md new file mode 100644 index 00000000..6ebed93a --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertEvaluationSchema.md @@ -0,0 +1,47 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertEvaluationSchema + +# Interface: HypercertEvaluationSchema + +Schema for evaluating Hypercerts across different sources and evaluation types + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [creator](HypercertEvaluationSchema.md#creator) +- [evaluationData](HypercertEvaluationSchema.md#evaluationdata) +- [evaluationSource](HypercertEvaluationSchema.md#evaluationsource) + +## Properties + +### creator + +• **creator**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:15](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L15) + +--- + +### evaluationData + +• **evaluationData**: [`EvaluationData`](../modules.md#evaluationdata) + +#### Defined in + +[sdk/src/types/evaluation.d.ts:16](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L16) + +--- + +### evaluationSource + +• **evaluationSource**: [`EvaluationSource`](../modules.md#evaluationsource) + +#### Defined in + +[sdk/src/types/evaluation.d.ts:17](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L17) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertIndexerInterface.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertIndexerInterface.md new file mode 100644 index 00000000..f18c409f --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertIndexerInterface.md @@ -0,0 +1,176 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertIndexerInterface + +# Interface: HypercertIndexerInterface + +## Implemented by + +- [`default`](../classes/internal.default-1.md) + +## Table of contents + +### Properties + +- [claimById](HypercertIndexerInterface.md#claimbyid) +- [claimsByOwner](HypercertIndexerInterface.md#claimsbyowner) +- [firstClaims](HypercertIndexerInterface.md#firstclaims) +- [fractionById](HypercertIndexerInterface.md#fractionbyid) +- [fractionsByClaim](HypercertIndexerInterface.md#fractionsbyclaim) +- [fractionsByOwner](HypercertIndexerInterface.md#fractionsbyowner) +- [graphClient](HypercertIndexerInterface.md#graphclient) + +## Properties + +### claimById + +• **claimById**: (`id`: `string`) => `Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> + +#### Type declaration + +▸ (`id`): `Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> + +##### Parameters + +| Name | Type | +| :--- | :------- | +| `id` | `string` | + +##### Returns + +`Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> + +#### Defined in + +[sdk/src/types/indexer.ts:20](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L20) + +--- + +### claimsByOwner + +• **claimsByOwner**: (`owner`: `string`, `params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> + +#### Type declaration + +▸ (`owner`, `params?`): `Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> + +##### Parameters + +| Name | Type | +| :-------- | :----------------------------------------- | +| `owner` | `string` | +| `params?` | [`QueryParams`](../modules.md#queryparams) | + +##### Returns + +`Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> + +#### Defined in + +[sdk/src/types/indexer.ts:19](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L19) + +--- + +### firstClaims + +• **firstClaims**: (`params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> + +#### Type declaration + +▸ (`params?`): `Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> + +##### Parameters + +| Name | Type | +| :-------- | :----------------------------------------- | +| `params?` | [`QueryParams`](../modules.md#queryparams) | + +##### Returns + +`Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> + +#### Defined in + +[sdk/src/types/indexer.ts:21](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L21) + +--- + +### fractionById + +• **fractionById**: (`fractionId`: `string`) => `Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> + +#### Type declaration + +▸ (`fractionId`): `Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> + +##### Parameters + +| Name | Type | +| :----------- | :------- | +| `fractionId` | `string` | + +##### Returns + +`Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> + +#### Defined in + +[sdk/src/types/indexer.ts:24](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L24) + +--- + +### fractionsByClaim + +• **fractionsByClaim**: (`claimId`: `string`, `params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> + +#### Type declaration + +▸ (`claimId`, `params?`): `Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> + +##### Parameters + +| Name | Type | +| :-------- | :----------------------------------------- | +| `claimId` | `string` | +| `params?` | [`QueryParams`](../modules.md#queryparams) | + +##### Returns + +`Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> + +#### Defined in + +[sdk/src/types/indexer.ts:23](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L23) + +--- + +### fractionsByOwner + +• **fractionsByOwner**: (`owner`: `string`, `params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> + +#### Type declaration + +▸ (`owner`, `params?`): `Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> + +##### Parameters + +| Name | Type | +| :-------- | :----------------------------------------- | +| `owner` | `string` | +| `params?` | [`QueryParams`](../modules.md#queryparams) | + +##### Returns + +`Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> + +#### Defined in + +[sdk/src/types/indexer.ts:22](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L22) + +--- + +### graphClient + +• **graphClient**: `any` + +#### Defined in + +[sdk/src/types/indexer.ts:18](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L18) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertMetadata.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertMetadata.md new file mode 100644 index 00000000..d65362f3 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertMetadata.md @@ -0,0 +1,123 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertMetadata + +# Interface: HypercertMetadata + +Claim data for hypercert. ERC1155 Metadata compliant + +## Table of contents + +### Properties + +- [allowList](HypercertMetadata.md#allowlist) +- [description](HypercertMetadata.md#description) +- [external_url](HypercertMetadata.md#external_url) +- [hypercert](HypercertMetadata.md#hypercert) +- [image](HypercertMetadata.md#image) +- [name](HypercertMetadata.md#name) +- [properties](HypercertMetadata.md#properties) +- [ref](HypercertMetadata.md#ref) +- [version](HypercertMetadata.md#version) + +## Properties + +### allowList + +• `Optional` **allowList**: `string` + +A CID pointer to the merke tree proof json on ipfs + +#### Defined in + +[sdk/src/types/metadata.d.ts:39](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L39) + +--- + +### description + +• **description**: `string` + +Describes the asset to which this token represents + +#### Defined in + +[sdk/src/types/metadata.d.ts:19](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L19) + +--- + +### external_url + +• `Optional` **external_url**: `string` + +An url pointing to the external website of the project + +#### Defined in + +[sdk/src/types/metadata.d.ts:23](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L23) + +--- + +### hypercert + +• `Optional` **hypercert**: [`HypercertClaimdata`](internal.HypercertClaimdata.md) + +#### Defined in + +[sdk/src/types/metadata.d.ts:45](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L45) + +--- + +### image + +• **image**: `string` + +A URI pointing to a resource with mime type image/\* representing the asset to which this token represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive. + +#### Defined in + +[sdk/src/types/metadata.d.ts:27](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L27) + +--- + +### name + +• **name**: `string` + +Identifies the asset to which this token represents + +#### Defined in + +[sdk/src/types/metadata.d.ts:15](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L15) + +--- + +### properties + +• `Optional` **properties**: { `[k: string]`: `unknown`; `trait_type?`: `string` ; `value?`: `string` }[] + +#### Defined in + +[sdk/src/types/metadata.d.ts:40](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L40) + +--- + +### ref + +• `Optional` **ref**: `string` + +Describes the asset to which this token represents + +#### Defined in + +[sdk/src/types/metadata.d.ts:35](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L35) + +--- + +### version + +• `Optional` **version**: `string` + +The version of Hypercert schema used to describe this hypercert + +#### Defined in + +[sdk/src/types/metadata.d.ts:31](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L31) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertPointer.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertPointer.md new file mode 100644 index 00000000..773c41d3 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertPointer.md @@ -0,0 +1,45 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertPointer + +# Interface: HypercertPointer + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [chainId](HypercertPointer.md#chainid) +- [claimId](HypercertPointer.md#claimid) +- [contract](HypercertPointer.md#contract) + +## Properties + +### chainId + +• **chainId**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:28](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L28) + +--- + +### claimId + +• **claimId**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:30](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L30) + +--- + +### contract + +• **contract**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:29](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L29) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertStorageInterface.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertStorageInterface.md new file mode 100644 index 00000000..8ffda51e --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/HypercertStorageInterface.md @@ -0,0 +1,130 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertStorageInterface + +# Interface: HypercertStorageInterface + +The interface for the Hypercert storage layer. + +## Implemented by + +- [`HypercertsStorage`](../classes/HypercertsStorage.md) + +## Table of contents + +### Properties + +- [getData](HypercertStorageInterface.md#getdata) +- [getMetadata](HypercertStorageInterface.md#getmetadata) +- [storeData](HypercertStorageInterface.md#storedata) +- [storeMetadata](HypercertStorageInterface.md#storemetadata) + +## Properties + +### getData + +• **getData**: (`cidOrIpfsUri`: `string`) => `Promise`<`unknown`\> + +#### Type declaration + +▸ (`cidOrIpfsUri`): `Promise`<`unknown`\> + +Retrieves arbitrary data from IPFS. + +##### Parameters + +| Name | Type | Description | +| :------------- | :------- | :------------------------------------------- | +| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the data to retrieve. | + +##### Returns + +`Promise`<`unknown`\> + +A Promise that resolves to the retrieved data. + +#### Defined in + +[sdk/src/types/client.ts:93](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L93) + +--- + +### getMetadata + +• **getMetadata**: (`cidOrIpfsUri`: `string`) => `Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> + +#### Type declaration + +▸ (`cidOrIpfsUri`): `Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> + +Retrieves the metadata for a Hypercert evaluation. + +##### Parameters + +| Name | Type | Description | +| :------------- | :------- | :----------------------------------------------- | +| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the metadata to retrieve. | + +##### Returns + +`Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> + +A Promise that resolves to the retrieved metadata. + +#### Defined in + +[sdk/src/types/client.ts:79](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L79) + +--- + +### storeData + +• **storeData**: (`data`: `unknown`) => `Promise`<`CIDString`\> + +#### Type declaration + +▸ (`data`): `Promise`<`CIDString`\> + +Stores arbitrary data on IPFS. + +##### Parameters + +| Name | Type | Description | +| :----- | :-------- | :----------------- | +| `data` | `unknown` | The data to store. | + +##### Returns + +`Promise`<`CIDString`\> + +A Promise that resolves to the CID of the stored data. + +#### Defined in + +[sdk/src/types/client.ts:86](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L86) + +--- + +### storeMetadata + +• **storeMetadata**: (`metadata`: [`HypercertMetadata`](HypercertMetadata.md)) => `Promise`<`CIDString`\> + +#### Type declaration + +▸ (`metadata`): `Promise`<`CIDString`\> + +Stores the metadata for a Hypercert evaluation. + +##### Parameters + +| Name | Type | Description | +| :--------- | :------------------------------------------ | :--------------------- | +| `metadata` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata to store. | + +##### Returns + +`Promise`<`CIDString`\> + +A Promise that resolves to the CID of the stored metadata. + +#### Defined in + +[sdk/src/types/client.ts:72](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L72) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/IPFSEvaluation.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/IPFSEvaluation.md new file mode 100644 index 00000000..5f5871f2 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/IPFSEvaluation.md @@ -0,0 +1,34 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / IPFSEvaluation + +# Interface: IPFSEvaluation + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [cid](IPFSEvaluation.md#cid) +- [type](IPFSEvaluation.md#type) + +## Properties + +### cid + +• **cid**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:48](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L48) + +--- + +### type + +• **type**: `"IPFS"` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:47](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L47) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/SimpleTextEvaluation.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/SimpleTextEvaluation.md new file mode 100644 index 00000000..3e4b3b92 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/SimpleTextEvaluation.md @@ -0,0 +1,45 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / SimpleTextEvaluation + +# Interface: SimpleTextEvaluation + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [hypercert](SimpleTextEvaluation.md#hypercert) +- [text](SimpleTextEvaluation.md#text) +- [type](SimpleTextEvaluation.md#type) + +## Properties + +### hypercert + +• **hypercert**: [`HypercertPointer`](HypercertPointer.md) + +#### Defined in + +[sdk/src/types/evaluation.d.ts:35](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L35) + +--- + +### text + +• **text**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:36](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L36) + +--- + +### type + +• **type**: `"simpleText"` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:34](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L34) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/internal.EvaluatorInterface.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/internal.EvaluatorInterface.md new file mode 100644 index 00000000..53ac36ed --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/internal.EvaluatorInterface.md @@ -0,0 +1,43 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / [internal](../modules/internal.md) / EvaluatorInterface + +# Interface: EvaluatorInterface + +[internal](../modules/internal.md).EvaluatorInterface + +## Implemented by + +- [`default`](../classes/internal.default.md) + +## Table of contents + +### Properties + +- [submitEvaluation](internal.EvaluatorInterface.md#submitevaluation) + +## Properties + +### submitEvaluation + +• **submitEvaluation**: (`evaluation`: [`HypercertEvaluationSchema`](HypercertEvaluationSchema.md)) => `Promise`<`CIDString`\> + +#### Type declaration + +▸ (`evaluation`): `Promise`<`CIDString`\> + +Submits an evaluation to the prefered storage system. + +##### Parameters + +| Name | Type | Description | +| :----------- | :---------------------------------------------------------- | :------------------------ | +| `evaluation` | [`HypercertEvaluationSchema`](HypercertEvaluationSchema.md) | The evaluation to submit. | + +##### Returns + +`Promise`<`CIDString`\> + +- The CID of the submitted evaluation. + +#### Defined in + +[sdk/src/evaluations/index.ts:25](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L25) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/internal.HypercertClaimdata.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/internal.HypercertClaimdata.md new file mode 100644 index 00000000..273912bc --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/internal.HypercertClaimdata.md @@ -0,0 +1,169 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / [internal](../modules/internal.md) / HypercertClaimdata + +# Interface: HypercertClaimdata + +[internal](../modules/internal.md).HypercertClaimdata + +Properties of an impact claim + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [contributors](internal.HypercertClaimdata.md#contributors) +- [impact_scope](internal.HypercertClaimdata.md#impact_scope) +- [impact_timeframe](internal.HypercertClaimdata.md#impact_timeframe) +- [rights](internal.HypercertClaimdata.md#rights) +- [work_scope](internal.HypercertClaimdata.md#work_scope) +- [work_timeframe](internal.HypercertClaimdata.md#work_timeframe) + +## Properties + +### contributors + +• **contributors**: `Object` + +Contributors + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/metadata.d.ts:92](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L92) + +--- + +### impact_scope + +• **impact_scope**: `Object` + +Scopes of impact + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `excludes?` | `string`[] | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/metadata.d.ts:54](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L54) + +--- + +### impact_timeframe + +• **impact_timeframe**: `Object` + +Impact time period. The value is UNIX time in seconds from epoch. + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `name?` | `string` | +| `value?` | `number`[] | + +#### Defined in + +[sdk/src/types/metadata.d.ts:83](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L83) + +--- + +### rights + +• `Optional` **rights**: `Object` + +Rights + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `excludes?` | `string`[] | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/metadata.d.ts:101](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L101) + +--- + +### work_scope + +• **work_scope**: `Object` + +Scopes of work + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `excludes?` | `string`[] | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/metadata.d.ts:64](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L64) + +--- + +### work_timeframe + +• **work_timeframe**: `Object` + +Work time period. The value is UNIX time in seconds from epoch. + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `name?` | `string` | +| `value?` | `number`[] | + +#### Defined in + +[sdk/src/types/metadata.d.ts:74](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L74) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/internal.HypercertMinter.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/internal.HypercertMinter.md new file mode 100644 index 00000000..3f4ea346 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/interfaces/internal.HypercertMinter.md @@ -0,0 +1,17 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / [internal](../modules/internal.md) / HypercertMinter + +# Interface: HypercertMinter + +[internal](../modules/internal.md).HypercertMinter + +Hypercert contract interface. + +**`Notice`** + +hacky loop to get typedoc to generate all the docs + +## Hierarchy + +- `HypercertMinter` + + ↳ **`HypercertMinter`** diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/modules.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/modules.md new file mode 100644 index 00000000..15998930 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/modules.md @@ -0,0 +1,638 @@ +[Hypercerts SDK Documentation](README.md) / Exports + +# Hypercerts SDK Documentation + +## Table of contents + +### References + +- [Claim](modules.md#claim) +- [ClaimToken](modules.md#claimtoken) +- [ClaimTokensByClaimQuery](modules.md#claimtokensbyclaimquery) + +### Modules + +- [internal](modules/internal.md) + +### Classes + +- [ClientError](classes/ClientError.md) +- [ConfigurationError](classes/ConfigurationError.md) +- [FetchError](classes/FetchError.md) +- [HypercertClient](classes/HypercertClient.md) +- [HypercertsStorage](classes/HypercertsStorage.md) +- [InvalidOrMissingError](classes/InvalidOrMissingError.md) +- [MalformedDataError](classes/MalformedDataError.md) +- [MintingError](classes/MintingError.md) +- [StorageError](classes/StorageError.md) +- [UnknownSchemaError](classes/UnknownSchemaError.md) +- [UnsupportedChainError](classes/UnsupportedChainError.md) + +### Interfaces + +- [CustomError](interfaces/CustomError.md) +- [DuplicateEvaluation](interfaces/DuplicateEvaluation.md) +- [EASEvaluation](interfaces/EASEvaluation.md) +- [HypercertClaimdata](interfaces/HypercertClaimdata.md) +- [HypercertClientInterface](interfaces/HypercertClientInterface.md) +- [HypercertClientMethods](interfaces/HypercertClientMethods.md) +- [HypercertClientState](interfaces/HypercertClientState.md) +- [HypercertEvaluationSchema](interfaces/HypercertEvaluationSchema.md) +- [HypercertIndexerInterface](interfaces/HypercertIndexerInterface.md) +- [HypercertMetadata](interfaces/HypercertMetadata.md) +- [HypercertPointer](interfaces/HypercertPointer.md) +- [HypercertStorageInterface](interfaces/HypercertStorageInterface.md) +- [IPFSEvaluation](interfaces/IPFSEvaluation.md) +- [SimpleTextEvaluation](interfaces/SimpleTextEvaluation.md) + +### Type Aliases + +- [AllowlistEntry](modules.md#allowlistentry) +- [Deployment](modules.md#deployment) +- [EvaluationData](modules.md#evaluationdata) +- [EvaluationSource](modules.md#evaluationsource) +- [HypercertClientConfig](modules.md#hypercertclientconfig) +- [HypercertClientProps](modules.md#hypercertclientprops) +- [HypercertEvaluatorConfig](modules.md#hypercertevaluatorconfig) +- [HypercertStorageConfig](modules.md#hypercertstorageconfig) +- [HypercertsSdkError](modules.md#hypercertssdkerror) +- [QueryParams](modules.md#queryparams) +- [SupportedChainIds](modules.md#supportedchainids) +- [TransferRestrictions](modules.md#transferrestrictions) + +### Properties + +- [ClaimByIdQuery](modules.md#claimbyidquery) + +### Variables + +- [INDEFINITE_DATE_STRING](modules.md#indefinite_date_string) +- [TransferRestrictions](modules.md#transferrestrictions-1) + +### Functions + +- [execute](modules.md#execute) +- [formatDate](modules.md#formatdate) +- [formatHypercertData](modules.md#formathypercertdata) +- [formatUnixTime](modules.md#formatunixtime) +- [validateAllowlist](modules.md#validateallowlist) +- [validateClaimData](modules.md#validateclaimdata) +- [validateDuplicateEvaluationData](modules.md#validateduplicateevaluationdata) +- [validateMetaData](modules.md#validatemetadata) +- [validateSimpleTextEvaluationData](modules.md#validatesimpletextevaluationdata) +- [verifyMerkleProof](modules.md#verifymerkleproof) +- [verifyMerkleProofs](modules.md#verifymerkleproofs) + +## References + +### Claim + +Renames and re-exports [ClaimByIdQuery](modules.md#claimbyidquery) + +--- + +### ClaimToken + +Renames and re-exports [ClaimByIdQuery](modules.md#claimbyidquery) + +--- + +### ClaimTokensByClaimQuery + +Renames and re-exports [ClaimByIdQuery](modules.md#claimbyidquery) + +## Type Aliases + +### AllowlistEntry + +Ƭ **AllowlistEntry**: `Object` + +Allowlist entry for Hypercerts matching the definitions in the Hypercerts protocol + +**`Param`** + +Address of the recipient + +**`Param`** + +Number of units allocated to the recipient + +#### Type declaration + +| Name | Type | +| :-------- | :------------- | +| `address` | `string` | +| `units` | `BigNumberish` | + +#### Defined in + +[sdk/src/types/hypercerts.ts:22](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/hypercerts.ts#L22) + +--- + +### Deployment + +Ƭ **Deployment**: `Object` + +Represents a deployment of a contract on a specific network. + +#### Type declaration + +| Name | Type | Description | +| :---------------- | :------- | :--------------------------------------------------------------------------------------- | +| `chainId` | `number` | The ID of the network on which the contract is deployed. | +| `chainName` | `string` | The name of the network on which the contract is deployed. | +| `contractAddress` | `string` | The address of the deployed contract. | +| `graphUrl` | `string` | The url to the subgraph that indexes the contract events. Override for localized testing | + +#### Defined in + +[sdk/src/types/client.ts:21](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L21) + +--- + +### EvaluationData + +Ƭ **EvaluationData**: [`DuplicateEvaluation`](interfaces/DuplicateEvaluation.md) \| [`SimpleTextEvaluation`](interfaces/SimpleTextEvaluation.md) + +This file was automatically generated by json-schema-to-typescript. +DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +and run json-schema-to-typescript to regenerate this file. + +#### Defined in + +[sdk/src/types/evaluation.d.ts:8](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L8) + +--- + +### EvaluationSource + +Ƭ **EvaluationSource**: [`EASEvaluation`](interfaces/EASEvaluation.md) \| [`IPFSEvaluation`](interfaces/IPFSEvaluation.md) + +#### Defined in + +[sdk/src/types/evaluation.d.ts:9](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L9) + +--- + +### HypercertClientConfig + +Ƭ **HypercertClientConfig**: [`Deployment`](modules.md#deployment) & [`HypercertStorageConfig`](modules.md#hypercertstorageconfig) & [`HypercertEvaluatorConfig`](modules.md#hypercertevaluatorconfig) & { `operator`: `ethers.providers.Provider` \| `ethers.Signer` ; `unsafeForceOverrideConfig?`: `boolean` } + +Configuration options for the Hypercert client. + +#### Defined in + +[sdk/src/types/client.ts:35](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L35) + +--- + +### HypercertClientProps + +Ƭ **HypercertClientProps**: `Object` + +The props for the Hypercert client. + +#### Type declaration + +| Name | Type | Description | +| :-------- | :---------------------------------------------------------------------- | :-------------------------------------------------- | +| `config?` | `Partial`<[`HypercertClientConfig`](modules.md#hypercertclientconfig)\> | The configuration options for the Hypercert client. | + +#### Defined in + +[sdk/src/types/client.ts:99](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L99) + +--- + +### HypercertEvaluatorConfig + +Ƭ **HypercertEvaluatorConfig**: `Omit`<`PartialTypedDataConfig`, `"address"`\> & { `easContractAddress`: `string` } + +Configuration options for the Hypercert evaluator. + +**`Note`** + +The signer is required for submitting evaluations. + +#### Defined in + +[sdk/src/types/client.ts:59](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L59) + +--- + +### HypercertStorageConfig + +Ƭ **HypercertStorageConfig**: `Object` + +Configuration options for the Hypercert storage layer. + +**`Note`** + +The API tokens are optional, but required for storing data on NFT.storage and Web3.storage. + +#### Type declaration + +| Name | Type | Description | +| :------------------ | :------- | :------------------------------ | +| `nftStorageToken?` | `string` | The API token for NFT.storage. | +| `web3StorageToken?` | `string` | The API token for Web3.storage. | + +#### Defined in + +[sdk/src/types/client.ts:48](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L48) + +--- + +### HypercertsSdkError + +Ƭ **HypercertsSdkError**: [`ConfigurationError`](classes/ConfigurationError.md) \| [`FetchError`](classes/FetchError.md) \| [`InvalidOrMissingError`](classes/InvalidOrMissingError.md) \| [`MalformedDataError`](classes/MalformedDataError.md) \| [`MintingError`](classes/MintingError.md) \| [`StorageError`](classes/StorageError.md) \| [`UnsupportedChainError`](classes/UnsupportedChainError.md) \| [`UnknownSchemaError`](classes/UnknownSchemaError.md) + +#### Defined in + +[sdk/src/types/errors.ts:173](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L173) + +--- + +### QueryParams + +Ƭ **QueryParams**: `Object` + +#### Index signature + +▪ [key: `string`]: `any` + +#### Type declaration + +| Name | Type | +| :---------------- | :------------------ | +| `first` | `number` | +| `orderDirections` | `"asc"` \| `"desc"` | +| `skip` | `number` | + +#### Defined in + +[sdk/src/types/indexer.ts:10](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L10) + +--- + +### SupportedChainIds + +Ƭ **SupportedChainIds**: `5` \| `10` + +#### Defined in + +[sdk/src/types/client.ts:10](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L10) + +--- + +### TransferRestrictions + +Ƭ **TransferRestrictions**: typeof [`TransferRestrictions`](modules.md#transferrestrictions-1)[keyof typeof [`TransferRestrictions`](modules.md#transferrestrictions-1)] + +#### Defined in + +[sdk/src/types/hypercerts.ts:9](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/hypercerts.ts#L9) + +[sdk/src/types/hypercerts.ts:15](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/hypercerts.ts#L15) + +## Properties + +### ClaimByIdQuery + +• **ClaimByIdQuery**: `any` + +## Variables + +### INDEFINITE_DATE_STRING + +• `Const` **INDEFINITE_DATE_STRING**: `"indefinite"` + +#### Defined in + +[sdk/src/utils/formatter.ts:4](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/utils/formatter.ts#L4) + +--- + +### TransferRestrictions + +• `Const` **TransferRestrictions**: `Object` + +Transfer restrictions for Hypercerts matching the definitions in the Hypercerts protocol + +**`Dev`** + +AllowAll: All transfers are allowed + +**`Dev`** + +DisallowAll: All transfers are disallowed + +**`Dev`** + +FromCreatorOnly: Only the creator can transfer the Hypercert + +#### Type declaration + +| Name | Type | +| :---------------- | :--- | +| `AllowAll` | `0` | +| `DisallowAll` | `1` | +| `FromCreatorOnly` | `2` | + +#### Defined in + +[sdk/src/types/hypercerts.ts:9](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/hypercerts.ts#L9) + +[sdk/src/types/hypercerts.ts:15](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/hypercerts.ts#L15) + +## Functions + +### execute + +▸ **execute**(`document`, `variables`, `context?`, `rootValue?`, `operationName?`): `Promise`<`ExecutionResult`<`any`, `ObjMap`<`unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :-------------------------------- | +| `document` | `GraphQLOperation`<`any`, `any`\> | +| `variables` | `any` | +| `context?` | `any` | +| `rootValue?` | `any` | +| `operationName?` | `string` | + +#### Returns + +`Promise`<`ExecutionResult`<`any`, `ObjMap`<`unknown`\>\>\> + +#### Defined in + +node_modules/@graphql-mesh/runtime/typings/types.d.ts:25 + +--- + +### formatDate + +▸ **formatDate**(`date`): `string` + +#### Parameters + +| Name | Type | +| :----- | :----- | +| `date` | `Date` | + +#### Returns + +`string` + +#### Defined in + +[sdk/src/utils/formatter.ts:13](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/utils/formatter.ts#L13) + +--- + +### formatHypercertData + +▸ **formatHypercertData**(`«destructured»`): [`FormatResult`](modules/internal.md#formatresult) + +Formats input data to an object containing HypercertMetadata including appropriate labels + +#### Parameters + +| Name | Type | +| :----------------------- | :----------------------------------------------- | +| `«destructured»` | `Object` | +| › `contributors` | `string`[] | +| › `description` | `string` | +| › `excludedImpactScope` | `string`[] | +| › `excludedRights` | `string`[] | +| › `excludedWorkScope` | `string`[] | +| › `external_url?` | `string` | +| › `image` | `string` | +| › `impactScope` | `string`[] | +| › `impactTimeframeEnd` | `number` | +| › `impactTimeframeStart` | `number` | +| › `name` | `string` | +| › `properties?` | { `trait_type`: `string` ; `value`: `string` }[] | +| › `rights` | `string`[] | +| › `version` | `string` | +| › `workScope` | `string`[] | +| › `workTimeframeEnd` | `number` | +| › `workTimeframeStart` | `number` | + +#### Returns + +[`FormatResult`](modules/internal.md#formatresult) + +#### Defined in + +[sdk/src/utils/formatter.ts:27](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/utils/formatter.ts#L27) + +--- + +### formatUnixTime + +▸ **formatUnixTime**(`seconds`): `string` + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `seconds` | `number` | + +#### Returns + +`string` + +#### Defined in + +[sdk/src/utils/formatter.ts:5](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/utils/formatter.ts#L5) + +--- + +### validateAllowlist + +▸ **validateAllowlist**(`data`, `units`): `Object` + +Validates the data for an allowlist. + +#### Parameters + +| Name | Type | Description | +| :------ | :---------------------------------------------- | :------------------------------------------ | +| `data` | [`AllowlistEntry`](modules.md#allowlistentry)[] | The data to validate. | +| `units` | `BigNumberish` | The total number of units in the allowlist. | + +#### Returns + +`Object` + +A `ValidationResult` object indicating whether the data is valid and any errors that were found. + +| Name | Type | +| :------- | :------------------------------------------ | +| `errors` | `Record`<`string`, `string` \| `string`[]\> | +| `valid` | `boolean` | + +#### Defined in + +[sdk/src/validator/index.ts:91](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L91) + +--- + +### validateClaimData + +▸ **validateClaimData**(`data`): [`ValidationResult`](modules/internal.md#validationresult) + +Validates the data for a simple text evaluation. + +#### Parameters + +| Name | Type | Description | +| :----- | :------------------------------------------------------- | :-------------------- | +| `data` | [`HypercertClaimdata`](interfaces/HypercertClaimdata.md) | The data to validate. | + +#### Returns + +[`ValidationResult`](modules/internal.md#validationresult) + +A `ValidationResult` object indicating whether the data is valid and any errors that were found. + +#### Defined in + +[sdk/src/validator/index.ts:64](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L64) + +--- + +### validateDuplicateEvaluationData + +▸ **validateDuplicateEvaluationData**(`data`): [`ValidationResult`](modules/internal.md#validationresult) + +Validates the data for a duplicate evaluation. + +#### Parameters + +| Name | Type | Description | +| :----- | :--------------------------------------------------------- | :-------------------- | +| `data` | [`DuplicateEvaluation`](interfaces/DuplicateEvaluation.md) | The data to validate. | + +#### Returns + +[`ValidationResult`](modules/internal.md#validationresult) + +A `ValidationResult` object indicating whether the data is valid and any errors that were found. + +#### Defined in + +[sdk/src/validator/index.ts:117](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L117) + +--- + +### validateMetaData + +▸ **validateMetaData**(`data`): [`ValidationResult`](modules/internal.md#validationresult) + +Validates the data for a simple text evaluation. + +#### Parameters + +| Name | Type | Description | +| :----- | :----------------------------------------------------- | :-------------------- | +| `data` | [`HypercertMetadata`](interfaces/HypercertMetadata.md) | The data to validate. | + +#### Returns + +[`ValidationResult`](modules/internal.md#validationresult) + +A `ValidationResult` object indicating whether the data is valid and any errors that were found. + +#### Defined in + +[sdk/src/validator/index.ts:38](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L38) + +--- + +### validateSimpleTextEvaluationData + +▸ **validateSimpleTextEvaluationData**(`data`): [`ValidationResult`](modules/internal.md#validationresult) + +Validates the data for a simple text evaluation. + +#### Parameters + +| Name | Type | Description | +| :----- | :----------------------------------------------------------- | :-------------------- | +| `data` | [`SimpleTextEvaluation`](interfaces/SimpleTextEvaluation.md) | The data to validate. | + +#### Returns + +[`ValidationResult`](modules/internal.md#validationresult) + +A `ValidationResult` object indicating whether the data is valid and any errors that were found. + +#### Defined in + +[sdk/src/validator/index.ts:142](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L142) + +--- + +### verifyMerkleProof + +▸ **verifyMerkleProof**(`root`, `signerAddress`, `units`, `proof`): `void` + +Verifies a Merkle proof for a given address and units. + +**`Throws`** + +If the Merkle proof verification fails. + +#### Parameters + +| Name | Type | Description | +| :-------------- | :------------- | :-------------------------------------- | +| `root` | `string` | The Merkle root hash to verify against. | +| `signerAddress` | `string` | The address to verify. | +| `units` | `BigNumberish` | The units to verify. | +| `proof` | `string`[] | The Merkle proof to verify. | + +#### Returns + +`void` + +#### Defined in + +[sdk/src/validator/index.ts:170](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L170) + +--- + +### verifyMerkleProofs + +▸ **verifyMerkleProofs**(`roots`, `signerAddress`, `units`, `proofs`): `void` + +Batch verifies Merkle proofs for multiple roots, units and proofs for a single address + +**`Throws`** + +If the Merkle proof verification fails. + +**`Notice`** + +Wrapper around `verifyMerkleProof` to batch verify multiple proofs + +#### Parameters + +| Name | Type | Description | +| :-------------- | :--------------- | :---------------------------------------- | +| `roots` | `string`[] | The Merkle root hashes to verify against. | +| `signerAddress` | `string` | The address to verify. | +| `units` | `BigNumberish`[] | The units to verify. | +| `proofs` | `string`[][] | The Merkle proofs to verify. | + +#### Returns + +`void` + +#### Defined in + +[sdk/src/validator/index.ts:190](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L190) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/modules/internal.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/modules/internal.md new file mode 100644 index 00000000..d20a3804 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/api/sdk/modules/internal.md @@ -0,0 +1,307 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / internal + +# Module: internal + +## Table of contents + +### Classes + +- [default](../classes/internal.default.md) +- [default](../classes/internal.default-1.md) +- [default](../classes/internal.default-2.md) + +### Interfaces + +- [EvaluatorInterface](../interfaces/internal.EvaluatorInterface.md) +- [HypercertClaimdata](../interfaces/internal.HypercertClaimdata.md) +- [HypercertMinter](../interfaces/internal.HypercertMinter.md) + +### Type Aliases + +- [Claim](internal.md#claim) +- [ClaimByIdQuery](internal.md#claimbyidquery) +- [ClaimToken](internal.md#claimtoken) +- [ClaimTokenByIdQuery](internal.md#claimtokenbyidquery) +- [ClaimTokensByClaimQuery](internal.md#claimtokensbyclaimquery) +- [ClaimTokensByOwnerQuery](internal.md#claimtokensbyownerquery) +- [ClaimsByOwnerQuery](internal.md#claimsbyownerquery) +- [Exact](internal.md#exact) +- [FormatResult](internal.md#formatresult) +- [InputMaybe](internal.md#inputmaybe) +- [Maybe](internal.md#maybe) +- [OrderDirection](internal.md#orderdirection) +- [RecentClaimsQuery](internal.md#recentclaimsquery) +- [Scalars](internal.md#scalars) +- [ValidationResult](internal.md#validationresult) + +## Type Aliases + +### Claim + +Ƭ **Claim**: `Object` + +#### Type declaration + +| Name | Type | +| :------------ | :---------------------------------------------------------------------------- | +| `chainName` | [`Scalars`](internal.md#scalars)[``"String"``] | +| `contract` | [`Scalars`](internal.md#scalars)[``"String"``] | +| `creation` | [`Scalars`](internal.md#scalars)[``"BigInt"``] | +| `creator?` | [`Maybe`](internal.md#maybe)<[`Scalars`](internal.md#scalars)[``"Bytes"``]\> | +| `id` | [`Scalars`](internal.md#scalars)[``"String"``] | +| `owner?` | [`Maybe`](internal.md#maybe)<[`Scalars`](internal.md#scalars)[``"Bytes"``]\> | +| `tokenID` | [`Scalars`](internal.md#scalars)[``"BigInt"``] | +| `totalUnits?` | [`Maybe`](internal.md#maybe)<[`Scalars`](internal.md#scalars)[``"BigInt"``]\> | +| `uri?` | [`Maybe`](internal.md#maybe)<[`Scalars`](internal.md#scalars)[``"String"``]\> | + +#### Defined in + +[sdk/.graphclient/index.ts:275](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L275) + +--- + +### ClaimByIdQuery + +Ƭ **ClaimByIdQuery**: `Object` + +#### Type declaration + +| Name | Type | +| :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `claim?` | [`Maybe`](internal.md#maybe)<`Pick`<[`Claim`](internal.md#claim), `"chainName"` \| `"contract"` \| `"tokenID"` \| `"creator"` \| `"id"` \| `"owner"` \| `"totalUnits"` \| `"uri"`\>\> | + +#### Defined in + +[sdk/.graphclient/index.ts:985](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L985) + +--- + +### ClaimToken + +Ƭ **ClaimToken**: `Object` + +#### Type declaration + +| Name | Type | +| :---------- | :--------------------------------------------- | +| `chainName` | [`Scalars`](internal.md#scalars)[``"String"``] | +| `claim` | [`Claim`](internal.md#claim) | +| `id` | [`Scalars`](internal.md#scalars)[``"String"``] | +| `owner` | [`Scalars`](internal.md#scalars)[``"Bytes"``] | +| `tokenID` | [`Scalars`](internal.md#scalars)[``"BigInt"``] | +| `units` | [`Scalars`](internal.md#scalars)[``"BigInt"``] | + +#### Defined in + +[sdk/.graphclient/index.ts:287](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L287) + +--- + +### ClaimTokenByIdQuery + +Ƭ **ClaimTokenByIdQuery**: `Object` + +#### Type declaration + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `claimToken?` | [`Maybe`](internal.md#maybe)<`Pick`<[`ClaimToken`](internal.md#claimtoken), `"chainName"` \| `"id"` \| `"owner"` \| `"tokenID"` \| `"units"`\> & { `claim`: `Pick`<[`Claim`](internal.md#claim), `"id"` \| `"creation"` \| `"uri"` \| `"totalUnits"`\> }\> | + +#### Defined in + +[sdk/.graphclient/index.ts:1015](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L1015) + +--- + +### ClaimTokensByClaimQuery + +Ƭ **ClaimTokensByClaimQuery**: `Object` + +#### Type declaration + +| Name | Type | +| :------------ | :------------------------------------------------------------------------------------------------------------------ | +| `claimTokens` | `Pick`<[`ClaimToken`](internal.md#claimtoken), `"chainName"` \| `"id"` \| `"owner"` \| `"tokenID"` \| `"units"`\>[] | + +#### Defined in + +[sdk/.graphclient/index.ts:1008](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L1008) + +--- + +### ClaimTokensByOwnerQuery + +Ƭ **ClaimTokensByOwnerQuery**: `Object` + +#### Type declaration + +| Name | Type | +| :------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `claimTokens` | `Pick`<[`ClaimToken`](internal.md#claimtoken), `"chainName"` \| `"id"` \| `"owner"` \| `"tokenID"` \| `"units"`\> & { `claim`: `Pick`<[`Claim`](internal.md#claim), `"id"` \| `"creation"` \| `"uri"` \| `"totalUnits"`\> }[] | + +#### Defined in + +[sdk/.graphclient/index.ts:995](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L995) + +--- + +### ClaimsByOwnerQuery + +Ƭ **ClaimsByOwnerQuery**: `Object` + +#### Type declaration + +| Name | Type | +| :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `claims` | `Pick`<[`Claim`](internal.md#claim), `"chainName"` \| `"contract"` \| `"tokenID"` \| `"creator"` \| `"id"` \| `"owner"` \| `"totalUnits"` \| `"uri"`\>[] | + +#### Defined in + +[sdk/.graphclient/index.ts:969](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L969) + +--- + +### Exact + +Ƭ **Exact**<`T`\>: { [K in keyof T]: T[K] } + +#### Type parameters + +| Name | Type | +| :--- | :--------------- | +| `T` | extends `Object` | + +#### Defined in + +[sdk/.graphclient/index.ts:28](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L28) + +--- + +### FormatResult + +Ƭ **FormatResult**: `Object` + +#### Type declaration + +| Name | Type | +| :------- | :------------------------------------------------------------------ | +| `data` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) \| `null` | +| `errors` | `Record`<`string`, `string`\> \| `null` | +| `valid` | `boolean` | + +#### Defined in + +[sdk/src/utils/formatter.ts:20](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/utils/formatter.ts#L20) + +--- + +### InputMaybe + +Ƭ **InputMaybe**<`T`\>: [`Maybe`](internal.md#maybe)<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Defined in + +[sdk/.graphclient/index.ts:27](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L27) + +--- + +### Maybe + +Ƭ **Maybe**<`T`\>: `T` \| `null` + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Defined in + +[sdk/.graphclient/index.ts:26](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L26) + +--- + +### OrderDirection + +Ƭ **OrderDirection**: `"asc"` \| `"desc"` + +Defines the order direction, either ascending or descending + +#### Defined in + +[sdk/.graphclient/index.ts:507](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L507) + +--- + +### RecentClaimsQuery + +Ƭ **RecentClaimsQuery**: `Object` + +#### Type declaration + +| Name | Type | +| :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `claims` | `Pick`<[`Claim`](internal.md#claim), `"chainName"` \| `"contract"` \| `"tokenID"` \| `"creator"` \| `"id"` \| `"owner"` \| `"totalUnits"` \| `"uri"`\>[] | + +#### Defined in + +[sdk/.graphclient/index.ts:978](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L978) + +--- + +### Scalars + +Ƭ **Scalars**: `Object` + +All built-in and custom scalars, mapped to their actual values + +#### Type declaration + +| Name | Type | +| :----------- | :-------- | +| `BigDecimal` | `any` | +| `BigInt` | `any` | +| `Boolean` | `boolean` | +| `Bytes` | `any` | +| `Float` | `number` | +| `ID` | `string` | +| `Int` | `number` | +| `Int8` | `any` | +| `String` | `string` | + +#### Defined in + +[sdk/.graphclient/index.ts:36](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L36) + +--- + +### ValidationResult + +Ƭ **ValidationResult**: `Object` + +The result of a validation. + +**`Property`** + +Whether the data is valid. + +**`Property`** + +A map of errors, where the key is the field that failed validation and the value is the error message. + +#### Type declaration + +| Name | Type | +| :------- | :---------------------------- | +| `errors` | `Record`<`string`, `string`\> | +| `valid` | `boolean` | + +#### Defined in + +[sdk/src/validator/index.ts:28](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L28) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/burning.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/burning.md new file mode 100644 index 00000000..b591d11d --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/burning.md @@ -0,0 +1,12 @@ +# Burning + +> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. + +## Burning fraction tokens + +You can only burn fraction tokens that you own. Hypercert claims cannot be burned once minted. +You can get a list of all fraction tokens you own with [this query](./querying.md#claimtokensbyowner). + +```js +const txn = await hypercerts.burnFraction({ tokenId }); +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/config.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/config.md new file mode 100644 index 00000000..b26fc0e8 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/config.md @@ -0,0 +1,112 @@ +# Hypercert Client Configuration + +The client provides a high level interface that communicates with the Graph, IPFS and the evm. For easy setup we harmonised the configuration into a flow that allows for configuration with different levels of specificity. + +## Configuration + +### Setup + +The SDK allows for minimal configuration, explicit overrides and defining values in environment variables. We apply the following hierarchy: + +1. Overrides declared in `Partial` +2. Environment variables exposed via `process.env` + +Based on the chainID (either 5 or 10) we load the default config for Goerli or Optimism. + +We then process the rest of the overrides and possible environment variables to customise the default configuration. + +To get started quickly you can either: + +- set `process.env.DEFAULT_CHAIN_ID` to 5 or 10 +- initialize a new client by calling `new HypercertClient({chainId: 5})` (or 10) + +Using either of the options above will launch the client in `read only` mode using the defaults in [constants.ts](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/constants.ts) + +### Read-only mode + +The SDK client will be in read-only mode if any of the following conditions are true: + +- The client was initialized without an operator. +- The client was initialized with an operator without signing abilities. +- The contract address is not set. +- The storage layer is in read-only mode. + +If any of these conditions are true, the read-only property of the `HypercertClient` instance will be set to true, and a warning message will be logged indicating that the client is in read-only mode. + +### Defaults + +The [constants.ts](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/constants.ts) file defines various defaults constants that are used throughout the Hypercert system. + +`DEFAULT_CHAIN_ID`: This constant defines the default chain ID to use if no chain ID is specified. In this case, the +default chain ID is set to 5, which corresponds to the Goerli testnet. + +Based on `DEFAULT_CHAIN_ID` the SDK will select a `DEPLOYMENT`. + +`DEPLOYMENTS`: This constant defines the deployments that are managed by the Hypercert system. Each Deployment object +contains information about a specific deployment, including the chain ID, chain name, contract address, and graph name. + +For example: + +```json +{ + "5": { + "chainId": 5, + "chainName": "goerli", + "contractAddress": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", + "graphUrl": "https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-testnet" + } +} +``` + +You can select which deployment to use by either passing in a `chainId` configuration parameter or setting the `DEFAULT_CHAIN_ID` environment variable. We also allow for `overrides` +when creating the SDK by passing configuration variables. Finally, when not defaults or overrides are found, we check the environment variables. + +### Client config properties + +| Property | Type | Description | +| ------------------ | -------------------------- | -------------------------------------- | ------------------------------ | +| `chainId` | `number` | The chain ID of the network to use. | +| `chainName` | `string` | The name of the network to use. | +| `contractAddress` | `string` | The address of the Hypercert contract. | +| `graphUrl` | `string` | The url of the subgraph to use. | +| `operator` | `ethers.providers.Provider | ethers.Signer` | The provider or signer to use. | +| `nftStorageToken` | `string` | Your NFT.storage API key. | +| `web3StorageToken` | `string` | Your web3.storage API key. | + +- [Get an NFT.Storage API token](https://nft.storage/docs/#get-an-api-token) +- [Get a web3.storage API token](https://web3.storage/docs/how-tos/generate-api-token/) + +### Environment variables + +You can also configure the SDK via environment variables. If you set both the config parameter and environment variable, the config parameter will take precedent. + +We provide a [template file](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/.env.template) in our monorepo. + +| Environment Variable | Description | +| -------------------------------- | --------------------------------------------------------------------------------------------------- | +| `DEFAULT_CHAIN_ID` | Specifies the default chain ID to use if no chain ID is specified. | +| `CONTRACT_ADDRESS` | Specifies the contract address to use for the Hypercert protocol. | +| `PRIVATE_KEY` | Specifies the private key to use for signing transactions. | +| `NFT_STORAGE_TOKEN` | Specifies the NFT.storage API token to use for storing Hypercert metadata. | +| `NEXT_PUBLIC_NFT_STORAGE_TOKEN` | Specifies the NFT.storage API token to use for storing Hypercert metadata in a Next.js application. | +| `WEB3_STORAGE_TOKEN` | Specifies the Web3.storage API token to use for storing Hypercert data. | +| `NEXT_PUBLIC_WEB3_STORAGE_TOKEN` | Specifies the Web3.storage API token to use for storing Hypercert data in a Next.js application. | + +### Logging + +The logger for the SDK uses the log level based on the value of the LOG_LEVEL environment variable. The log level +determines which log messages are printed to the console. By default, the logger is configured to log messages with a +level of info or higher to the console. + +In your `.env` file: + +```bash +LOG_LEVEL="info" +``` + +The SDK logger supports four log levels: `error`, `warn`, `info`, and `debug`. + +- The `error` log level is used to log errors that occur in the SDK. +- The `warn` log level is used to log warnings that do not necessarily indicate an error, but may be important to investigate. +- The `info` log level is used to log general information about the SDK's state or behavior. +- The `debug` log level is used to log detailed information that is useful for debugging purposes. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/errors.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/errors.md new file mode 100644 index 00000000..60f4e5e7 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/errors.md @@ -0,0 +1,18 @@ +# Errors in the SDK + +Generally, we follow the pattern of throwing on errors and letting those surface to the application. This allows for developers to handle any (un)expected errors in a manner they find suitable. + +### Handling Errors + +To support debugging we've implemented some custom errors. + +| Error | Reason | Payload | +| --------------------- | ------------------------------------------------- | ---------------------------- | --------- | +| ClientError | An error caused by the client | `{ [key: string]: unknown }` | +| FetchError | An error caused by a failed API call | `{ [key: string]: unknown }` | +| InvalidOrMissingError | An error caused by a missing environment variable | `{ keyName: string }` | +| MalformedDataError | An error caused by invalid or malformed data | `{ [key: string]: unknown }` | +| MintingError | An error caused by a failed EVM call to mint | `{ [key: string]: unknown }` | +| StorageError | An error caused by NFT-/Web3 Storage | `{ [key: string]: unknown }` | +| UnsupportedChainError | An error caused by an unsupported EVM chain ID | `{ chainID: string | number }` | +| UnknownSchemaError | An error caused by a missing validation schema | `{ schemaName: string }` | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/evaluations.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/evaluations.md new file mode 100644 index 00000000..c5399a4f --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/evaluations.md @@ -0,0 +1,13 @@ +# Evaluations + +> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. + +## Respond / or contest an evaluation + +To create an evaluation of a hypercert + +```js +TODO; +``` + +_Note: Under the hood, we leverage the [Ethereum Attestation Service](https://attest.sh/) for creating evaluations_ diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/minting.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/minting.md new file mode 100644 index 00000000..d5ff1226 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/minting.md @@ -0,0 +1,57 @@ +# Minting + +## Token design + +Hypercerts are semi-fungible tokens. +Thus, each hypercert is represented on-chain by a group of fraction tokens, +each representing a fraction of ownership over the hypercert. +If you want to split your fraction token, or merge multiple tokens into one, +check out the section on [splitting and merging](./split-merge.md). + +## Minting your first hypercert + +To mint a hypercert you need to provide the `metadata`, total amount of `units` and the preferred `TransferRestrictions`. +The resulting hypercert will be wholly owned by the creator. + +```js +import { TransferRestrictions, formatHypercertData } from "@hypercerts-org/sdk" + +const { metadata } = formatHypercertData(...); +const totalUnits = "10000"; + +const tx: Promise = await hypercerts.mintClaim({ + metadata, + totalUnits, + transferRestrictions: TransferRestrictions.FromCreatorOnly, +}); +``` + +> **Note** If you did not initialize your HypercertsClient with an `operator`, `nftStorageToken` and `web3StorageToken`, the client will run in [read-only mode](#read-only-mode) and this will fail. + +Let's see what happens under the hood: + +First, `mintClaim` checks that the client is not `read only` and that the operator is a `Signer`. If not, it throws an `InvalidOrMissingError`. + +Next, the function validates the provided metadata using the `validateMetaData` function. If the metadata is invalid, it throws a `MalformedDataError`. The function then stores the metadata on `IPFS` using the `storeMetadata` method and returns the `CID` for the metadata. + +Finally, we call the mintClaim function on the contract with the signer `address`, total `units`, `CID`, and `transfer restriction` as parameters. If `overrides` are provided, the function uses them to send the transaction. Otherwise, it sends the transaction without overrides. + +## Transfer restrictions + +When minting a Hypercert, you must pass in a `TransferRestriction` policy. For now there are only 3 implemented policies: + +```js +enum TransferRestrictions { + // Unrestricted + AllowAll, + // All transfers disabled after minting + DisallowAll, + // Only the original creator can transfer + FromCreatorOnly +} +``` + +## Reference + +See the [code](https://github.com/hypercerts-org/hypercerts/tree/main/sdk/src/client.ts) +for more details on how we implement minting. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/querying.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/querying.md new file mode 100644 index 00000000..98ebbb83 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/querying.md @@ -0,0 +1,306 @@ +# Querying + +## Overview + +The `HypercertClient` provides a high-level interface for interacting with the Hypercert ecosystem. The HypercertClient +has three getter methods: `storage`, `indexer`, and `contract`. These methods return instances of the HypercertsStorage, +HypercertIndexer, and HypercertMinter classes, respectively. + +```js +const { + client: { storage }, +} = new HypercertClient({}); +``` + +The `storage` is a utility class that provides methods for storing and retrieving Hypercert metadata off-chain on IPFS. It is used by the HypercertClient to store metadata when creating new Hypercerts. + +```js +const { + client: { indexer }, +} = new HypercertClient({}); +``` + +The `indexer` is a utility class that provides methods for indexing and searching Hypercerts based on various criteria. +It is used by the HypercertClient to retrieve event-based data via the subgraph. + +```js +const { + client: { contract }, +} = new HypercertClient({}); +``` + +Finally we have a `contract` that provides methods for interacting with the HypercertMinter smart contract. It is used +by the HypercertClient to create new Hypercerts and retrieve specific on-chain information. + +By providing instances of these classes through the `storage`, `indexer`, and `contract` getters, the HypercertClient allows developers to easily interact with the various components of the Hypercert system directly. +For example, a developer could use the storage instance to store metadata for a new Hypercert, the indexer instance to search for existing Hypercerts based on various criteria, and the contract instance to create new Hypercerts and retrieve existing Hypercerts from the contract. + +## Indexer + +For indexing purposes, we rely on the [Graph](https://thegraph.com/docs/en/) to index Hypercert events. To make the subgraph easily accessible with typed methods and object we wrap the [Graph Client](https://github.com/graphprotocol/graph-client) and its SDK. + +### Live graph playground + +To inspect the subgraph and explore queries, have a look at the Graph playground for Goerli testnet and Optimism mainnet: + +- [Goerli dashboard](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-testnet) +- [Optimism dashboard](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-optimism-mainnet) + +### Graph client + +Since the client is fully typed, it's easy to explore the functionalities using code completion in IDEs. + +Here's one example from our frontend where we let [react-query](https://www.npmjs.com/package/%2540tanstack/react-query) frequently update the call to the graph: + +```js +import { useHypercertClient } from "./hypercerts-client"; +import { useQuery } from "@tanstack/react-query"; + +export const useFractionsByOwner = (owner: string) => { + const { + client: { indexer }, + } = useHypercertClient(); + + return useQuery( + ["hypercerts", "fractions", "owner", owner], + () => indexer.fractionsByOwner(owner), + { enabled: !!owner, refetchInterval: 5000 }, + ); +}; +``` + +### Queries: Claims + +These tables show the input parameters and output fields for each of the GraphQL queries in [claims.graphql](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/indexer/queries/claims.graphql). +A claim represents 1 Hypercert and all of the common data across all claim/fraction tokens. + +#### `ClaimsByOwner` + +The `ClaimsByOwner` query retrieves an array of claims that belong to a specific owner. + +##### Input + +The query takes the following input parameters: + +| Parameter | Type | Description | Default Value | +| ---------------- | ---------------- | -------------------------------------------------- | ------------- | +| `owner` | `Bytes` | The address of the owner whose claims to retrieve. | "" | +| `orderDirection` | `OrderDirection` | The direction to order the claims. | `asc` | +| `first` | `Int` | The number of claims to retrieve. | `100` | +| `skip` | `Int` | The number of claims to skip. | `0` | + +##### Output + +The query returns an array of claim objects that match the input parameters. Each claim object has the following fields: + +| Field | Type | Description | +| ------------ | -------- | ---------------------------------------------- | +| `chainName` | `String` | The name of the chain the claim was minted on. | +| `contract` | `Bytes` | The address of the contract. | +| `tokenID` | `String` | The token ID. | +| `creator` | `Bytes` | The address of the creator. | +| `id` | `ID` | The ID of the claim. | +| `owner` | `Bytes` | The address of the owner. | +| `totalUnits` | `BigInt` | The total number of units. | +| `uri` | `String` | The URI of the claim metadata. | + +#### `RecentClaims` + +The RecentClaims query retrieves an array of the most recent claims on the Hypercert platform. + +##### Input + +The query takes the following input parameters: + +| Parameter | Type | Description | Default Value | +| ---------------- | ---------------- | ---------------------------------- | ------------- | +| `orderDirection` | `OrderDirection` | The direction to order the claims. | `asc` | +| `first` | `Int` | The number of claims to retrieve. | `100` | +| `skip` | `Int` | The number of claims to skip. | `0` | + +##### Output + +The query returns an array of claim objects that match the input parameters. Each claim object has the following fields: + +| Field | Type | Description | +| ------------ | -------- | ---------------------------------------------- | +| `chainName` | `String` | The name of the chain the claim was minted on. | +| `contract` | `Bytes` | The address of the contract. | +| `tokenID` | `String` | The token ID. | +| `creator` | `Bytes` | The address of the creator. | +| `id` | `ID` | The ID of the claim. | +| `owner` | `Bytes` | The address of the owner. | +| `totalUnits` | `BigInt` | The total number of units. | +| `uri` | `String` | The URI of the claim metadata. | + +#### `ClaimByID` + +The ClaimById query retrieves a single claim by its ID on the Hypercert platform. + +##### Input + +The query takes the following input parameters: + +| Parameter | Type | Description | +| --------- | ----- | -------------------------------- | +| `id` | `ID!` | The ID of the claim to retrieve. | + +##### Output + +The query returns a claim object that matches the input parameter. The claim object has the following fields: + +| Field | Type | Description | +| ------------ | -------- | ---------------------------------------------- | +| `chainName` | `String` | The name of the chain the claim was minted on. | +| `contract` | `Bytes` | The address of the contract. | +| `tokenID` | `String` | The token ID. | +| `creator` | `Bytes` | The address of the creator. | +| `id` | `ID` | The ID of the claim. | +| `owner` | `Bytes` | The address of the owner. | +| `totalUnits` | `BigInt` | The total number of units. | +| `uri` | `String` | The URI of the claim metadata. | + +### Queries: Fractions + +These tables show the input parameters and output fields for each of the GraphQL queries in [fractions.graphql](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/indexer/queries/fractions.graphql). +A claim token represents a fraction of ownership of a Hypercert. + +#### `ClaimTokensByOwner` + +The `ClaimTokensByOwner` query retrieves an array of claim tokens that belong to a specific owner on the Hypercert platform. + +##### Input + +The query takes the following input parameters: + +| Parameter | Type | Description | Default Value | +| ---------------- | ---------------- | -------------------------------------------------------------------- | ------------- | +| `owner` | `Bytes` | The address of the owner whose claim tokens to retrieve. | "" | +| `orderDirection` | `OrderDirection` | The direction to order the claim tokens. The default value is `asc`. | `asc` | +| `first` | `Int` | The number of claim tokens to retrieve. The default value is `100`. | `100` | +| `skip` | `Int` | The number of claim tokens to skip. The default value is `0`. | `0` | + +##### Output + +The query returns an array of claim token objects that match the input parameters. Each claim token object has the following fields: + +| Field | Type | Description | +| ----------- | -------- | ------------------------------------------ | +| `chainName` | `String` | The name of the chain. | +| `id` | `ID` | The ID of the claim token. | +| `owner` | `Bytes` | The address of the owner. | +| `tokenID` | `String` | The token ID. | +| `units` | `BigInt` | The number of units. | +| `claim` | `Claim` | The claim associated with the claim token. | + +The Claim object has the following fields: + +| Field | Type | Description | +| ------------ | -------- | ------------------------------------ | +| `id` | `ID` | The ID of the claim. | +| `creation` | `Int` | The timestamp of the claim creation. | +| `uri` | `String` | The URI of the claim metadata. | +| `totalUnits` | `BigInt` | The total number of units. | + +#### `ClaimTokensByClaim` + +The `ClaimTokensByClaim` query retrieves an array of claim tokens that belong to a specific claim on the Hypercert platform. + +##### Input + +The query takes the following input parameters: + +| Parameter | Type | Description | Default Value | +| ---------------- | ---------------- | -------------------------------------------------------------------- | ------------- | +| `claimId` | `String!` | The ID of the claim whose claim tokens to retrieve. | None | +| `orderDirection` | `OrderDirection` | The direction to order the claim tokens. The default value is `asc`. | `asc` | +| `first` | `Int` | The number of claim tokens to retrieve. The default value is `100`. | `100` | +| `skip` | `Int` | The number of claim tokens to skip. The default value is `0`. | `0` | + +##### Output + +The query returns an array of claim token objects that match the input parameters. Each claim token object has the following fields: + +| Field | Type | Description | +| ----------- | -------- | ---------------------------------------------- | +| `chainName` | `String` | The name of the chain the claim was minted on. | +| `id` | `ID` | The ID of the claim token. | +| `owner` | `Bytes` | The address of the owner. | +| `tokenID` | `String` | The token ID. | +| `units` | `BigInt` | The number of units. | + +#### `ClaimTokenById` Query + +The `ClaimTokenById` query retrieves a single claim token by its ID on the Hypercert platform. + +##### Input + +The query takes the following input parameters: + +| Parameter | Type | Description | +| --------- | ----- | -------------------------------------- | +| `id` | `ID!` | The ID of the claim token to retrieve. | + +##### Output + +The query returns a claim token object that matches the input parameter. The claim token object has the following fields: + +| Field | Type | Description | +| ----------- | -------- | ---------------------------------------------- | +| `chainName` | `String` | The name of the chain the claim was minted on. | +| `id` | `ID` | The ID of the claim token. | +| `owner` | `Bytes` | The address of the owner. | +| `tokenID` | `String` | The token ID. | +| `units` | `BigInt` | The number of units. | +| `claim` | `Claim` | The claim associated with the claim token. | + +The Claim object has the following fields: + +| Field | Type | Description | +| ------------ | -------- | ------------------------------------ | +| `id` | `ID` | The ID of the claim. | +| `creation` | `Int` | The timestamp of the claim creation. | +| `uri` | `String` | The URI of the claim metadata. | +| `totalUnits` | `BigInt` | The total number of units. | + +## Storage + +### Hypercert Metadata + +Currently, all metadata is stored off-chain in IPFS. Use the `storage` client to retrieve the metadata + +```js +const claimId = "0x822f17a9a5eecfd...85254363386255337"; +const { indexer, storage } = hypercertsClient; +// Get the on-chain claim +const claimById = await indexer.claimById(claimId); +// Get the off-chain metadata +const metadata = await storage.getMetadata(claimById.claim.uri); +``` + +## Contract + +### Typechain bindings + +We export the [typechain](https://github.com/dethcrypto/TypeChain) bindings, +which you can import and use from your TypeScript/JavaScript codebase. + +For example: + +```js +import { ethers } from "ethers"; +import { + HyperCertMinterFactory, + HypercertMinterABI, + IHypercertTokenABI, +} from "@hypercerts-org/sdk"; + +const provider = new ethers.getDefaultProvider(network); +const contractInterface = new ethers.utils.Interface(HypercertMinterABI); +const contract = new ethers.Contract( + contractAddress, + HypercertMinterABI, + provider, +); +const metadataUri = await contract.functions.uri(tokenId); +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/quickstart-javascript.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/quickstart-javascript.md new file mode 100644 index 00000000..936cc05b --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/quickstart-javascript.md @@ -0,0 +1,101 @@ +# Getting started with JavaScript + +The Hypercerts SDK makes it easy to integrate Hypercerts into your application or backend with JavaScript/TypeScript. + +## Installation + +Install the SDK using npm or yarn: + +```bash +npm install @hypercerts-org/sdk +# OR yarn add @hypercerts-org/sdk +``` + +## Get storage credentials (only required for minting) + +For now, we store all metadata (e.g. Hypercert claim data) on IPFS using [NFT.Storage](https://nft.storage/) and [web3.storage](https://web3.storage/). + +In order to mint a Hypercert, you will need to create API tokens for both services, which you can learn more about from their respective guides: + +- [Get an NFT.Storage API token](https://nft.storage/docs/#get-an-api-token) +- [Get a web3.storage API token](https://web3.storage/docs/how-tos/generate-api-token/) + +_Note: In the future, we want to also support other mechanisms for storing off-chain data._ + +## Initialize + +Import the SDK into your project and create a new instance of `HypercertClient` with your configuration options: + +```js +import { HypercertClient } from "@hypercerts-org/sdk"; +import { ethers } from "ethers"; + +// NOTE: you should replace this with your own JSON-RPC provider to the network +// This should have signing abilities and match the `chainId` passed into HypercertClient +const operator = ethers.providers.getDefaultProvider("goerli"); + +const client = new HypercertClient({ + chainId: 5, // goerli testnet + operator, + nftStorageToken, + web3StorageToken, +}); +``` + +Hypercerts is a multi-chain protocol. +See [here](./supported-networks.md) for a list of currently supported networks. + +> **Note** If there's no `operator`, `nftStorageToken` or `web3StorageToken` provided, the client will run in [read-only mode](#read-only-mode). + +## Make a Hypercert + +Use the client object to interact with the Hypercert network. For example, you can use the `client.mintClaim` method to create a new claim: + +```js +import { + formatHypercertData, + TransferRestrictions, +} from "@hypercerts-org/sdk"; + +// Validate and format your Hypercert metadata +const { data: metadata, valid, errors } = formatHypercertData({ + name, + ... +}) + +// Check on errors +if (!valid) { + return console.error(errors); +} + +// Set the total amount of units available +const totalUnits: BigNumberish = 10_000_000 + +// Define the transfer restriction +const transferRestrictions: TransferRestrictions = TransferRestrictions.FromCreatorOnly + +// Mint your Hypercert! +const tx = await client.mintClaim( + metadata, + totalUnits, + transferRestrictions, +); +``` + +For guidance on how to specify your metadata, see the [minting guide](../minting-guide/step-by-step.md). +This will validate the metadata, store claim metadata on IPFS, create a new hypercert on-chain, and return a transaction receipt. + +For more details, check out the [Minting Guide](./minting.md). + +## Query for Hypercerts + +You can also use the client to query the subgraph and retrieve which claims an address owns: + +```js +const claims = await client.indexer.fractionsByOwner(owner), +``` + +For more details, checkout the [Querying guide](./querying.md) +and our [Graph playground](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-optimism-mainnet). + +That's it! With these simple steps, you can start using the Hypercert SDK in your own projects. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/quickstart-solidity.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/quickstart-solidity.md new file mode 100644 index 00000000..409a1e9d --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/quickstart-solidity.md @@ -0,0 +1,41 @@ +# Getting started with Solidity + +> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. + +If you need the Solidity contracts or interfaces exported from the SDK, +please reach out by [filing an issue](https://github.com/hypercerts-org/hypercerts/issues). + +## Hypercerts deployments + +Hypercerts is a multi-chain protocol and we want to support any network that wants to make positive impact. +We plan to support at most 1 canonical contract deployment per network. +For a complete list of deployments and their contract addresses, see [Supported Networks](./supported-networks.md). + +## Installing the Hypercert contracts + +```bash +npm install @hypercerts-org/contracts +# or yarn add @hypercerts-org/contracts +``` + +## Using the Solidity interface + +If you want to call the Hypercerts contract on your network directly from Solidity, +we export the interface/ABI for you to use from your contract. + +```js +import { IHypercertToken } from "@hypercerts-org/contracts/IHypercertMinter.sol"; + +contract MyContract { + IHypercertToken hypercerts; + + function initialize(address _addr) public virtual initializer { + hypercerts = IHypercertToken(_addr); + } + + function uri(uint256 tokenID) public view returns (string memory _uri) { + _uri = hypercerts.uri(tokenID); + } +} + +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/split-merge.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/split-merge.md new file mode 100644 index 00000000..1ac5556e --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/split-merge.md @@ -0,0 +1,29 @@ +# Split and Merge + +> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. + +## By Token Value + +### Split / merge token values + +```js +const { tokenIds } = await hypercerts.splitFraction({ + tokenId, + units: [10, 12, 15], +}); +const { tokenId } = await hypercerts.mergeFractions({ tokenIds }); +``` + +## By Claim Data + +### Split / merge claim data + +```js +const { claimIds } = await hypercerts.splitClaim({ + claimId, + TODO: somehow specify hypercert subregions +}); +const { claimId} = await hypercerts.mergeClaims({ + claimIds, +}); +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/developer/supported-networks.md b/docs/versioned_docs/version-1.0.0-alpha.0/developer/supported-networks.md new file mode 100644 index 00000000..3bfd0f18 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/developer/supported-networks.md @@ -0,0 +1,13 @@ +# Supported networks + +Hypercerts is developed in public and released under [Apache license](https://github.com/hypercerts-org/hypercerts/blob/main/LICENSE). The Hypercert Foundation currently rolled out on two networks: Goerli for testing and Optimism as the production deployment. + +We want to support every network that wants to support positive impact! +If you want to see Hypercerts deployed on another network, please reach out by [filing an issue](https://github.com/hypercerts-org/hypercerts/issues). + +## Overview + +| Chainname | ChainID | Hypercerts Minter (UUPS Proxy) | Subgraph | Notes | +| --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ---------- | +| Goerli | 5 | [0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07](https://goerli.etherscan.io/address/0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07) | [Goerli Subgraph](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-testnet) | Testnet | +| Optimism | 10 | [0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07](https://optimistic.etherscan.io/address/0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07) | [Optimism Subgraph](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-optimism-mainnet) | Production | diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/devops/deploy-proxy.md b/docs/versioned_docs/version-1.0.0-alpha.0/devops/deploy-proxy.md new file mode 100644 index 00000000..72b3ee2d --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/devops/deploy-proxy.md @@ -0,0 +1,120 @@ +# Deploy a new proxy contract + +This should be done only on rare occasions. For example, when: + +- We want to deploy to a new network +- We have updated the contract in a way that is _NOT_ backwards-compatible. + - For most upgrades, please use UUPS [upgrades](./upgrade.md). + +## Smart Contracts + +### Setup the `contracts/` environment + +Navigate to `contracts/`. Configure your `.env` file by following the instructions in the +[README](https://github.com/hypercerts-org/hypercerts/tree/main/contracts#setup). + +### Build and deploy the smart contracts + +If you are deploying on a new network, configure `contracts/hardhat.config.ts` to support the new network under the `networks` key. + +```javascript + "optimism-goeri": getChainConfig("optimism-goerli"), +``` + +Build the contracts and deploy. Specify the network to match the key used in `hardhat.config.ts`. + +```sh +# Run in contracts/ +yarn build:hardhat +yarn hardhat deploy --network NETWORK +``` + +This will output the new proxy address. Update the root `README.md` with this new address. + +Now transfer ownership over the proxy contract to the multisig: + +```sh +yarn hardhat transfer-owner --network NETWORK --proxy PROXY_CONTRACT_ADDRESS --owner MULTISIG_ADDRESS +``` + +## Subgraph + +### Setup the `graph/` environment + +Navigate to `graph/`. Follow the instructions in the +[README](https://github.com/hypercerts-org/hypercerts/tree/main/graph#setup) +to get set up. + +### Deploy the subgraph + +Update `graph/networks.json` with the new proxy address. To speed up indexing, you set the `startBlock` to the block containing the contract creation. We can add multiple networks that are monitored by the same subgraph. For more details, see the [Graph documentation](https://thegraph.com/docs/en/deploying/deploying-a-subgraph-to-hosted/#deploying-the-subgraph-to-multiple-ethereum-networks). + +Now deploy the subgraph + +```sh +# Run in graph/ +yarn build +yarn deploy:hosted +``` + +## OpenZeppelin Defender + +### Create a new Supabase table + +Log into the [Supabase dashboard](https://app.supabase.com/). +We store all data in a single project, but use different tables for each network. +The table name should be suffixed by the network (e.g. `allowlistCache-goerli`). +If you are deploying to a new network, create a new table. You can copy the table schema and RLS policy from another pre-existing table. + +If you are deploying a new proxy contract to a network for which you already have another deployment, you'll have to make a judgement call as to whether you can reuse the existing table, whether you need to clear the existing table, or create another table. + +Note: We want to merge all the tables in this [issue](https://github.com/hypercerts-org/hypercerts/issues/477). + +### Update the OpenZeppelin Defender scripts + +Modify the Defender scripts to support the new network in `defender/src/networks.ts`. + +If the ABI of the contract has changed, make sure you also update `defender/src/HypercertMinterABI.ts`. + +Note: The entry point for deployment is in `defender/src/setup.ts`. + +### Setup the `defender/` environment + +Navigate to `defender/`. Follow the instructions in the +[README](https://github.com/hypercerts-org/hypercerts/tree/main/defender#setup) +to get set up. + +### Deploy defender scripts + +Deploy to OpenZeppelin Defender via + +```sh +# Run in defender/ +yarn deploy +``` + +## Hypercerts SDK + +TODO: Flesh this out + +Run the build in `contracts/`. + +(Soon to be deprecated) Publish `contracts/` to npm + +Configure the SDK to support the new network via the graphclient. + +Publish SDK to npm + +## Deploy the Dapp frontend + +Each frontend build is configured to run on a different network (e.g. `https://testnet.hypercerts.org`). You can use any CDN to serve the site (e.g. Netlify, Vercel, GitHub Pages, Cloudflare Pages, Fleek, Firebase Hosting). + +1. Configure your build environment with the environment variables specified in `frontend/.env.local.example`. + +2. Configure your builds to the following settings: + +- Build command: `yarn build:site` +- Build output directory: `/build` +- Root directory: `/` + +3. Configure the domain that you want for your build. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/devops/errors.md b/docs/versioned_docs/version-1.0.0-alpha.0/devops/errors.md new file mode 100644 index 00000000..05dc5b0c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/devops/errors.md @@ -0,0 +1,45 @@ +# Errors + +## Deploying + +### Artifact for contract "HypercertMinter" not found + +#### Error message + +`Error HH700: Artifact for contract "HypercertMinter" not found.` + +#### Cause + +Attempting to deploy a contract with `npx hardhat deploy` before the contract has been compiled by hardhat. Contracts compiled by forge are currently not visible to hardhat (this could be a configuration problem). + +### insufficient funds for intrinsic transaction cost + +#### Error message + +`Error: insufficient funds for intrinsic transaction cost` + +#### Cause + +The environment variable `MNEMONIC` is not configured correctly. + +Alternatively, the wallet may not have enough funds for the selected network + +Causing pause twice + +Error: cannot estimate gas; transaction may fail or may require manual gas limit + +reason: 'execution reverted: Pausable: paused', + +#### Etherscan API + +Note: It can take between 5-10 minutes before a newly created etherscan API key becomes valid for queries to goerli. + +When using an etherscan API key that was too recently created, hardhat tasks using etherscan to verify transactions will exit with an error message: + +`Etherscan returned with message: NOTOK, reason: Invalid API Key` + +Despite this error the transaction may have succeeded, the hardhat task just can't confirm it. + +It is unknown if this is a problem for queries to mainnet as well. + +Metamask makes it very difficult to have multiple wallets. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/devops/index.md b/docs/versioned_docs/version-1.0.0-alpha.0/devops/index.md new file mode 100644 index 00000000..9b208595 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/devops/index.md @@ -0,0 +1,18 @@ +# DevOps + +We use this playbook to encapsulate our practices and current setup. + +## Setup dev environment + +- [Setup guide](./setup.md) +- [Plasmic setup](./plasmic.md) + +## Tasks + +- [Deploy new proxy contract](./deploy-proxy.md) +- [Upgrade contract](./upgrade.md) +- [Pause contract](./pause.md) + +## FAQ + +- [Common errors](./errors.md) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/devops/pause.md b/docs/versioned_docs/version-1.0.0-alpha.0/devops/pause.md new file mode 100644 index 00000000..2668f51e --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/devops/pause.md @@ -0,0 +1,29 @@ +# Pause / Unpause + +## Pause + +### Contract owned by an address + +Make sure you have set up your wallets and config from the [setup guide](./setup.md). + +To pause the contract, run the following, where `CONTRACT_ADDRESS` is the proxy address of the HypercertMinter, and `NETWORK` is one of the networks from `hardhat.config.ts`: + +```sh +yarn hardhat pause --network NETWORK --address CONTRACT_ADDRESS +``` + +### Contract owned by a multi-sig + +If we transferred ownership to a multisig, we can use +[OpenZeppelin Defender Admin](https://defender.openzeppelin.com/#/admin) +to propose a pause to be approved by the multisig. + +## Unpause + +Make sure you have set up your wallets and config from the [setup guide](./setup.md). + +To pause the contract, run the following, where `CONTRACT_ADDRESS` is the proxy address of the HypercertMinter, and `NETWORK` is one of the networks from `hardhat.config.ts`: + +```sh +yarn hardhat unpause --network NETWORK --address CONTRACT_ADDRESS +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/devops/plasmic.md b/docs/versioned_docs/version-1.0.0-alpha.0/devops/plasmic.md new file mode 100644 index 00000000..10e52f5b --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/devops/plasmic.md @@ -0,0 +1,76 @@ +# Plasmic setup + +## HypercertImage + +### Props + +hideImpact + +``` +$ctx.currentForm.impactTimeEnd === "indefinite" && ($ctx.currentForm.impactScopes.length === 0 || ($ctx.currentForm.impactScopes.length === 1 && $ctx.currentForm.impactScopes[0] === "all")) +``` + +color + +``` +$ctx.currentForm.backgroundColor +``` + +vectorart + +``` +$ctx.currentForm.backgroundVectorArt +``` + +### Slots + +logoImage Image URL + +``` +$ctx.currentForm.logoUrl +``` + +title Content + +``` +$ctx.currentForm.name +``` + +workPeriod Content + +``` +`${$ctx.currentForm.workTimeStart.format ? $ctx.currentForm.workTimeStart.format("YYYY-MM-DD") : $ctx.currentForm.workTimeStart} → ${$ctx.currentForm.workTimeEnd.format ? $ctx.currentForm.workTimeEnd.format("YYYY-MM-DD") : $ctx.currentForm.workTimeEnd}` +``` + +bannerImage Image URL + +``` +$ctx.currentForm.bannerUrl +``` + +impactPeriod Content + +``` +`${$ctx.currentForm.workTimeStart.format ? $ctx.currentForm.workTimeStart.format("YYYY-MM-DD") : $ctx.currentForm.workTimeStart} → ${$ctx.currentForm.impactTimeEnd.format ? $ctx.currentForm.impactTimeEnd.format("YYYY-MM-DD") : $ctx.currentForm.impactTimeEnd}` +``` + +#### workScopes: repeated ScopeChip + +Collection + +``` +$ctx.currentForm.workScopes.split(/[,\n]/).map(i => i.trim()).filter(i => !!i) +``` + +Element name: `currentWorkScope` +Index name: `currentIndex` +Color variant: `$ctx.currentForm.backgroundColor` +Content: `currentWorkScope` + +#### impactScopes: repeated ScopeChip + +Collection: `$ctx.currentForm.impactScopes` +Element name: `currentImpactScope` +Index name: `currentIndex` +Color variant: `$ctx.currentForm.backgroundColor` +Content: `currentImpactScope` diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/devops/setup.md b/docs/versioned_docs/version-1.0.0-alpha.0/devops/setup.md new file mode 100644 index 00000000..afb95296 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/devops/setup.md @@ -0,0 +1,41 @@ +# Setup + +## Pre-requisites + +1. Install [NodeJS](https://nodejs.org/en/) and [git](https://git-scm.com/) +2. Install [yarn](https://classic.yarnpkg.com/) + +```sh +npm install --global yarn +``` + +3. Clone the repository: + +``` +git clone git@github.com:hypercerts-org/hypercerts.git +cd hypercerts +``` + +4. Install dependancies: + +To install dependencies across all projects in the monorepo workspace: + +```sh +yarn install +``` + +## Setup your wallets + +We need 2 wallets: a multi-sig for administering the contracts, and a hot wallet for setting everything up. + +1. We use a [Gnosis Safe](https://app.safe.global/) multisig for managing and administering the contracts. Set one up with your desired confirmation threshold (e.g. 2 of 3). This wallet will not require any balance. +2. Separately, set up a wallet that we'll use in our developer scripts. + +- If you don't have one, you can goto `contracts/` and run `yarn hardhat generate-address`. +- Make sure there is enough balance in this account to deploy the contract and transfer ownership to the multisig + - [Goerli Faucet](https://goerlifaucet.com/) + - [Optimism Bridge](https://app.optimism.io/bridge/deposit) + +## Next Steps + +Depending on what you want to do (e.g. in `./sdk/` or `./frontend/`), there will be further setup instructions in the respective `README.md` file. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/devops/upgrade.md b/docs/versioned_docs/version-1.0.0-alpha.0/devops/upgrade.md new file mode 100644 index 00000000..820255e7 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/devops/upgrade.md @@ -0,0 +1,35 @@ +# Upgrading the contract + +## Validate upgrade + +Validate contract upgradeability against deployment. + +For example, for the `goerli` deployment: + +```sh +yarn hardhat validate-upgrade --network goerli --proxy PROXY_CONTRACT_ADDRESS +``` + +## Propose Upgrade + +Propose an upgrade via OpenZeppelin Defender. For more information, see this +[guide](https://docs.openzeppelin.com/defender/guide-upgrades) + +For example, for the `goerli` deployment: + +```sh +yarn build:hardhat +yarn hardhat propose-upgrade --network goerli --proxy PROXY_CONTRACT_ADDRESS --multisig OWNER_MULTISIG_ADDRESS +``` + +This will output an OpenZeppelin URL that multi-sig members can use to approve/reject the upgrade. + +## Publish to npm + +After you update the contracts, deploy the `contracts/` package to npm. + +TODO + +Update the dependencies in `frontend/package.json` and `sdk/package.json`. + +If the ABI of the contract has changed, make sure you also update `defender/src/HypercertMinterABI.ts`. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/faq.md b/docs/versioned_docs/version-1.0.0-alpha.0/faq.md new file mode 100644 index 00000000..b9659b5a --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/faq.md @@ -0,0 +1,139 @@ +--- +title: Frequently Asked Questions +id: faq +--- + +# FAQs + +### How do I create a hypercert? + +We've created a step-by-step guide in the documents, which you can find [here](minting-guide/minting-guide-start). + +### Who gets to claim my hypercert? + +There are currently two types of users who are eligible to claim your hypercert. + +1. You as the creator of the hypercert are eligible to claim your hypercert. For projects with an allow list, you are eligible to claim 50% of the total tokens. For projects with no allow list, you will receive 100% of the tokens automatically and can do whatever you like with them. + +2. Anyone on the hypercert's allow list will be eligible to claim your hypercert. The allow list is stored and the time of minting and allocates fractions of the hypercert to specific wallet addresses. These wallet addresses are then allowed to claim these fractions through a separate contract interaction. Creators often use allow lists be used to allocate fractions to previous funders and contributors. + +### How do I claim a hypercert? Can I claim all of the ones I’m eligible for at once? + +After you connect your wallet, you will see a dashboard of hypercerts that you can claim. You can either claim them individually or in a batch transaction. Note that if you perform the batch transaction you will automatically claim _all_ hypercerts you are allow-listed for. (You still pay a gas fee for each claim, however.) If you don't want to claim _all_ at once, then you should claim them one-by-one. + +### What token standard do hypercerts utilize? + +The interface supports both ERC-1155s and 721s. Our current implementation makes use of [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155) (a semi-fungible token). + +### What are the required fields to generate a hypercert? + +There are six required fields: + +1. Set of contributors: An ordered list of all contributors, who claim to do or have done the work described by this hypercert. +2. Scope of work: A conjunction of potentially-negated work scope tags, where an empty string means “all”. +3. Time of work: A date range, from the start to the end of the work being claimed by this hypercert. +4. Scope of impact: A conjunction of potentially-negated impact scope tags, where an empty string means “all”. +5. Time of impact: Date ranges from the start to the end of the impact. +6. Rights of the owners: An unordered list of usage rights tags, which define the rights of the owners of this hypercert over the work being claimed by this hypercert. + +Hypercerts also need a name and description. + +### What should I put for my hypercert's work scope? + +For most projects, it's probably best just to use a single tag that is a short form of your project's name. Given that your project may create numerous hypercerts over time, having a work scope that represents the name of your project will make your claims in the "impact hyperspace" more continuous. + +If you choose to use more than one tag, remember that tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. + +### Are hypercerts the same as impact evaluations? + +No. A hypercert is a claim over a discrete piece of work and the impact that may result from that work. It has no opinion about the legitimacy or quality of the claim. + +An impact evaluation is an opinionated assessment about the legitimacy or quality of a claim. + +For example, a hypercert might represent "Planting trees in the Amazon in 2022". An impact evaluation might point to that hypercert and assert the percent of trees that survived, the amount of CO2 removed by the trees, or the income change among people living around the project. + +Over time, the expectation is that hypercerts that attract multiple, high quality, credibly neutral impact evaluations will be more relevant than ones that do not. + +### What can I do with my hypercert? + +The `rights` dimension specific what an owner can do with their hypercert. Currently, the only `right` that owners have is "Public Display". Over time, we hope the protocol can support various `rights` including transfers, intellectual property, tax-deductibility, carbon offsets, ESG reporting, and more. + +### How is a hypercert different than a POAP or Impact NFT? + +Hypercerts have some things in common with certain POAPs or Impact NFTs, but also a number of crucial differences. + +First, all POAPs and most Impact NFTs are implemented as non-fungible tokens (ERC-721s). Hypercerts are currently being implemented as semi-fungible tokens (ERC-1155s), meaning it is possible to own more than one unit or fraction of a given hypercert. This makes it easy and intuitive to display the share of hypercerts that a given owner has. + +Second, hypercerts have specific metadata requirements and interpretation logic. These include a standard schema for how the six required hypercert dimensions are defined and captured (i.e., work scopes, impact scopes, timeframes, contributors, etc) as well as logic for how to interpret different inputs (e.g., how to include or exclude certain work scopes, create an indefinite time period, etc). POAPs have a completely different schema. Although there is no standard schema for Impact NFTs, an Impact NFT project could choose to adopt the hypercert standard and token interface and thereby achieve compatibility. + +Third, the hypercerts token interface is intended to support several functions that are not possible out of the box with other token standards, chiefly, atomic split and merge capabilities. We also expect other protocols to work with hypercerts for the purposes of prospective and retrospective funding, contributor verification, and impact evaluation. + +For certain use cases, POAPs may be better suited for projects as hypercerts are focused on the funding aspect of impactful work. + +### Where can I purchase a hypercert? + +Currently, it is only possible to purchase a hypercert from a creator or project. This can be facilitated directly by the project or via a third-party marketplace like OpenSea. Currently, hypercerts cannot be resold on secondary markets. + +### What chain(s) is hypercerts running on? + +The hypercerts smart contracts have been deployed on Optimism and Goerli Testnet. We plan to support various EVM chains in the near future. + +### How do I bridge to Optimism? + +There are various bridging services including the official [Optimism Bridge](https://app.optimism.io/bridge/deposit). Note that bridging assets from Ethereum to Optimism will incur a gas fee. + +### How much gas will it cost to create or claim a hypercert? + +In our simulations, the gas fee for minting a hypercert on Ethereum Mainnet ranged from 2,707,282 to 7,515,075 gwei (0.0027 to 0.0075 ETH). Minting costs are significantly cheaper on Optimism (i.e., below 0.0005 ETH or less than $1). Claiming a hypercert should be below 0.0001 ETH or less than $0.10 on Optimism. + +### How do I create a hypercert from a multisig? + +If you are creating a hypercert on Optimism, then you will need an Optimism-based multisig. (Unfortunately, Safe wallets created on Ethereum won't work on Optimism.) + +### Have the smart contracts been audited? + +Yes. The auditor's security report is available [here](https://github.com/pashov/audits/blob/master/solo/Hypercerts-security-review.md). + +### How is the allow list generated? + +For Gitcoin projects, an allow list is generated from a snapshot of all of the on-chain funding received by the project. + +The queries used to generate the allow lists can be viewed here: + +- ETH Infra: https://dune.com/queries/1934656 +- Climate: https://dune.com/queries/1934689 +- OSS: https://dune.com/queries/1934969 + +Once the snapshot is taken, the formula assigns one fraction (rounded down) for every $1 (using the exchange rate at the time of the transaction) that a donor contributed to the project. It also provides a small buffer (of 5%) so that a transaction worth $0.999 or $0.951 remains eligible for one fraction. + +For example: + +- $5.60 donated --> 5 fractions +- $5.20 donated --> 5 fractions +- $0.96 donated --> 1 fraction +- $0.52 donated --> 0 fractions + +### Why am I not on the allow list even though I contributed to the project? + +If you contributed less than $1 DAI to a project, then you will not be eligible to claim a hypercert fraction. + +### I supported a project. Why I don't I see the hypercert in my dashboard? + +In order to your hypercert to appear as "claimable", the project needs to mint the hypercert first. If the project has not minted its hypercert yet, then you will not be able to claim it. We suggest you check back in a few days to see if the project has created the hypercert and is now claimable. + +If the project has created its hypercert, then please try the following solutions: + +1. Confirm the wallet address is correct (some users have multiple wallet addresses and forget which one they donated with) +2. Check that your wallet is included in the Dune Dashboards for each Gitcoin Round + +- ETH Infra: https://dune.com/queries/1934656 +- Climate: https://dune.com/queries/1934689 +- OSS: https://dune.com/queries/1934969 + +3. Confirm you donated more than $1 DAI to the project. + +If the project has created its hypercert, and you have confirmed items 1-3, then please send us a DM over Twitter or Telegram with your wallet address and we will get back to you promptly. + +### How do I retire a hypercert? + +We don't yet have a frontend for retiring hypercerts but you can do this by interacting directly with the smart contract on Etherscan. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/further-resources.md b/docs/versioned_docs/version-1.0.0-alpha.0/further-resources.md new file mode 100644 index 00000000..86c25331 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/further-resources.md @@ -0,0 +1,37 @@ +--- +title: Further Resources +id: further-resources +--- + +# Papers, Articles, Presentations + +## Writings + +- Feb 14, 2023, Whitepaper draft by [@hypercerts](http://twitter.com/hypercerts): [Hypercerts: A new primitive for impact funding systems (draft v0)](../static/pdf/hypercerts_whitepaper_v0.pdf) +- Aug 24, 2022, Blogpost by [@holkeb](https://twitter.com/holkeb): [Hypercerts: A new primitive for public goods funding](https://protocol.ai/blog/hypercert-new-primitive/) +- Jun 2022, Tech report (draft) by [@davidad](https://twitter.com/davidad): [Hypercerts; an Interoperable Datalayer for Impact-Funding Mechanisms](../static/pdf/hypercerts_Tech_Report_draft.pdf) + +## Talks + +#### Jun 24, 2022, Talk at [Funding the Commons](https://fundingthecommons.io/) by [@davidad](https://twitter.com/davidad): [Hypercerts: on-chain primitives for impact markets](https://youtu.be/2hOhOdCbBlU) + + + +#### Jun 23, 2022, Conversation between [@emiyazono](http://twitter.com/emiyazono) and [@owocki](http://twitter.com/owocki) at GreenPill Podcast: [Impact Certificates | Evan Miyazono, Head of Research at Protocol Labs | Green Pill #21](https://youtu.be/kyo5SxtSJ9U) + + + +#### Mar 4, 2022, Talk at [Funding the Commons](https://fundingthecommons.io/) by [@davidad](https://twitter.com/davidad): [Interoperable mechanisms for non-rival goods (Hypercerts)](https://youtu.be/acbBeGcevok) + + + +## Other resources + +Overview of some previous writings on impact certificates, retrospective funding and impact markets: + +- Christiano, Paul (2014) Certificates of impact, Rational Altruist, [https://rationalaltruist.com/2014/11/15/certificates-of-impact/](https://rationalaltruist.com/2014/11/15/certificates-of-impact/) +- Christiano, Paul & Katja Grace (2015) The Impact Purchase, [https://impactpurchase.org/why-certificates/](https://impactpurchase.org/why-certificates/) +- Optimism & Buterin, Vitalik (2021) Retroactive Public Goods Funding, [https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c](https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c) +- Cotton-Barratt, Owen (2021), Impact Certificates and Impact Markets, Funding the Commons November 2021, [https://youtu.be/ZiDV56o5M7Q](https://youtu.be/ZiDV56o5M7Q) +- Drescher, Denis (2022) Towards Impact Markets, [https://forum.effectivealtruism.org/posts/7kqL4G5badqjskYQs/toward-impact-markets-1](https://forum.effectivealtruism.org/posts/7kqL4G5badqjskYQs/toward-impact-markets-1) +- Ofer & Cotton-Barratt, Owen (2022) Impact markets may incentivize predictably net-negative projects, [https://forum.effectivealtruism.org/posts/74rz7b8fztCsKotL6](https://forum.effectivealtruism.org/posts/74rz7b8fztCsKotL6) diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/implementation/glossary.md b/docs/versioned_docs/version-1.0.0-alpha.0/implementation/glossary.md new file mode 100644 index 00000000..b2451310 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/implementation/glossary.md @@ -0,0 +1,139 @@ +--- +title: Glossary +id: glossary +sidebar_position: 3 +--- + +# Glossary of Hypercerts Terms + +## Main Terms + +### Allowlist + +A list that determines how fractions of hypercerts will be allocated to new owners. The current implementation requires a project to specify an allowlist at the time of minting its hypercert. Based on allowlists, designated new owners are able to claim their fractions. + +### Claiming a fraction + +Transferring the ownership of a fraction of a hypercert to a (new) owner. Generally 'claiming' implies minting a new token that represents said fraction by the new owner. + +### Contributor + +An individual or organization that performs some or all of the work described in a hypercert. + +### Creating a hypercert + +Synonymous to minting a hypercert. + +### Fraction + +A token that represents a quantified proportion of a hypercert denominated in units. + +### Funder + +Individual, organization, or algorithm that funds work. There are generally two types: (1) **prospective** funders, who fund work _before_ it is done, and (2) **retrospective** funders, who fund work _after_ it is done. + +### Hypercert + +A token that (1) accounts for work by specified contributors that is supposed to be impactful, (2) represents the – potentially explicitly specified – impact of this work, and (3) assigns right over this work to its owners. If a hypercert is split into multiple fractions, the hypercert refers to the sum of all of its fractions. The term `hypercert` may also refer to an implementation of the hypercert interface and standard. + +### Hypercerts interface + +The hypercerts [contract interface](https://github.com/hypercerts-org/hypercerts/blob/main/contracts/src/interfaces/IHypercertToken.sol), which declares the required functionality for a hypercert token. The current interface includes functions for minting, burning, splitting, and merging of hypercert tokens. + +### Hypercerts implementation + +An implementation that builds on top of the hypercerts interface and conforms to the hypercerts standard. For instance, our initial implementation uses an [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155) token. The first 128 bits of the 256-bit token ID identifies the hypercert, the latter 128 bits identifies the specific fraction. Other implementations are possible (e.g., based on ERC-721) as long as they also conform to the data standard and use the hypercerts interface to support capabilities like splitting and merging of values. + +### Hypercerts standard + +A data standard for hypercerts. It requires the following fields to be defined in the metadata of the token: (1) set of contributors, (2) scope of work, (3) time of work, (4) scope of impact, (5) time of impact, (6) rights. + +### Impact + +Value that is created or destroyed by work. It mostly refers to positive impact, i.e., value that is created. If work destroys value, it is referred to as negative impact. + +### Impact evaluation + +A claim that a specified impact has or will occur – potentially claiming which work was responsible for the impact. + +### Impact Funding System (IFS) + +A system of actors (contributors, evaluators, funders) that interact according to a set of rules (funding mechanisms, coordination mechanisms) to maximize the domain-specific impact. + +### Impact space + +A geometrical space representing all possible work with its associated impact and rights. The space is spanned by the six fields specified in the hypercerts data standard: (1) set of contributors, (2) scope of work, (3) time of work, (4) scope of impact, (5) time of impact, (6) rights. + +### Merging hypercerts + +An operation to combine two or more hypercerts, such that the resulting, merged hypercert covers the exact same region in the impact space that the individual hypercerts covered. + +### Minting a hypercert + +Creating a new record for a hypercert on a blockchain. The properties of the hypercert (e.g., its timeframe and scope of work) are retrievable via this record. + +### Project + +Work by one or more contributors to achieve a goal. A project does not always need to be represented by one hypercert; it can be represented by multiple hypercerts (e.g., one hypercert per phase or milestone of a project). A hypercert can also represent multiple projects or even parts of multiple projects. + +### Prospective funder + +Individual, organization, or algorithm that fund work before it is done. + +### Retrospective funder + +Individual, organization, or algorithm that fund work after it is done. + +### Rights + +An unordered list of usage rights tags, which define the rights of the owners of a hypercert over the work being claimed by a hypercert. One of the axis of the impact space and part of the required fields in the hypercerts data standard. + +### Set of contributors + +An ordered list of all contributors, who claim to do or have done the work described by a hypercert. One axis of the impact space and part of the required fields in the hypercerts data standard. + +### Scope of impact + +A conjunction of potentially-negated impact scope tags, where an empty string means “all”. One axis of the impact space and part of the required fields in the hypercerts data standard. + +### Scope of work + +A conjunction of potentially-negated work scope tags, where an empty string means “all”. One axis of the impact space and part of the required fields in the hypercerts data standard. + +### Splitting hypercerts + +An operation to split one hypercert into two or more separate hypercerts, such that the resulting, separated hypercerts cover the exact same region in the impact space that the previous hypercert covered. + +### Time of impact + +Date ranges from the start to the end of the impact being claimed by a hypercert. One axis of the impact space and part of the required fields in the hypercerts data standard. + +### Time of work + +A date range, from the start to the end of the work being claimed by a hypercert. One axis of the impact space and part of the required fields in the hypercerts data standard. + +### Unit + +The smallest possible fraction of a claim. Generally units are grouped in fractions. + +### Work + +Activities that produce impact. + +## Additional Impact Evaluation Terms + +### Auditor + +Individual, organization, or algorithm that evaluates the impact of work after it is done. + +### Beneficiaries + +People or objects that are impacted by work. + +### Evaluator + +Individual, organization, or algorithm that evaluates the impact of work. There are two types: Scouts evaluate the potential impact before it is done, auditors evaluate the impact after it is done. + +### Scout + +Individual, organization, or algorithm that evaluates the potential impact of work before it is done. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/implementation/metadata.md b/docs/versioned_docs/version-1.0.0-alpha.0/implementation/metadata.md new file mode 100644 index 00000000..08eb9fcb --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/implementation/metadata.md @@ -0,0 +1,188 @@ +--- +title: Metadata Standard +id: metadata +sidebar_position: 2 +--- + +# Hypercert Metadata Structure + +Hypercerts are represented as [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155) tokens. All token instances of a hypercert must share the same ERC-1155 metadata. For sites like OpenSea to pull in off-chain metadata for ERC-1155 assets, your hypercert contract will need to return an IPFS URI that contains all necessary hypercert metadata. + +The hypercert metadata schema follows the [Enjin recommendation](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md#erc-1155-metadata-uri-json-schema) for ERC-1155 metadata. It also includes **six required dimensions** that are necessary to clearly and unambiguously identify the hypercert's impact claim. + +The following are standard ERC-1155 metadata fields. + +## ERC-1155 fields + +| Property | Description | +| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | Name or title of the hypercert. Given that a project may create numerous hypercerts over time, consider giving the hypercert a name that represents a discrete phase or output. | +| `description` | A human readable description of the hypercert. Markdown is supported. Additional external URLs can be added. | +| `image` | A URI pointing to a resource with mime type image/\* that represents the hypercert's artwork, i.e., `ipfs://`. We recommend images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive. | +| `external_url` | [optional] A URL that can be displayed next to the hypercert on webpages like OpenSea and links users to a page that has more information about the project or impact claim. | +| `properties` | [optional] Additional properties (aka attributes) that may be helpful for discovery and curation of hypercerts. Marketplaces like OpenSea will display these properties in the same way as they display rarity traits of NFTs. | + +In order to perform hypercert-specific operations, including split and merge functions, and for your hypercert to robustly claim a set of coordinates in the impact space, there are six additional dimensions that must be included in your metadata. + +## Required Hypercert dimensions + +| Property | Description | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `work_scope` | An _ordered list_ of work scope tags. Work scopes may also be excluded from the claim. The `¬` prefix will be displayed next to any work scope that is explicitly excluded from the claim. | +| `work_timeframe` | Date range from the start to the end of the work in the form of a [UTC timestamp](https://www.utctime.net/utc-timestamp). | +| `impact_scope` | An _ordered list_ of impact scope tags. Impact scopes may also be excluded from the claim. The `¬` prefix will be displayed next to any impact scope that is explicitly excluded from the claim. The default claim is to "all" impact, giving the owner rights to claim all potential impact created by the work that is represented by the hypercert. | +| `impact_timeframe` | Date range from the start to the end of the impact in the form of a [UTC timestamp](https://www.utctime.net/utc-timestamp). The default claim is from the start date of work until `indefinite` (i.e., the impact may occur at any point in time in the future). | +| `contributors` | An _ordered list_ of all contributors. Contributors should be itemized as wallet addresses or ENS names, but may be names / pseudonyms. The default claim is to the wallet address that created the hypercert contract. A multisig wallet can be used to represent a group of contributors. | +| `rights` | An _unordered list_ of usage rights tags. The default claim is solely to "public display" of the hypercert, i.e., all other rights remain with the contributors. | + +## Examples + +### Example 1: hypercert with minimal bounds + +Here is an example of hypercert dimensions for work on IPFS with minimal bounds: + +``` +"hypercert": { + "work_scope": { + "name": "Work Scope", + "value": ["IPFS"], + "excludes": [], + "display_value": "IPFS" + }, + "impact_scope": { + "name": "Impact Scope", + "value": ["All"], + "excludes": [], + "display_value": "All" + }, + "work_timeframe": { + "name": "Work Timeframe", + "value": [1380585600, 1388534399], + "display_value": "2013-10-01 -> 2013-12-31" + }, + "impact_timeframe": { + "name": "Impact Timeframe", + "value": [1380585600, 0], + "display_value": "2013-10-01 -> Indefinite" + }, + "contributors": { + "name": "Contributors", + "value": ["Protocol Labs"], + "display_value": "Protocol Labs" + }, + "rights": { + "name": "Rights", + "value": ["Public Display"], + "display_value": "Public Display" + } +} +``` + +### Example 2: hypercert with bounded impact claims + +This hypercert is for a carbon removal project that provides a bounded impact scope. + +``` +"hypercert": { + "work_scope": { + "name": "Work Scope", + "value": ["Protecting Trees in Amazon"], + "excludes": [], + "display_value": "Protecting Trees in Amazon" + }, + "impact_scope": { + "name": "Impact Scope", + "value": ["CO2 in Atmosphere"], + "excludes": [], + "display_value": "CO2 in Atmosphere" + }, + "work_timeframe": { + "name": "Work Timeframe", + "value": [1356998400, 1388534399], + "display_value": "2013-01-01 -> 2013-12-31" + }, + "impact_timeframe": { + "name": "Impact Timeframe", + "value": [1356998400, 0], + "display_value": "2013-01-01 -> Indefinite" + }, + "contributors": { + "name": "Contributors", + "value": ["0xa1fa1fa000000000000000000000000000000000", "Project Forest Conservation"], + "display_value": "0xa1f...000, Project Forest Conservation" + }, + "rights": { + "name": "Rights", + "value": ["Public Display"], + "display_value": "Public Display" + } +} +``` + +### Example 3: hypercert with excluded impact claims + +Here is an example that explicitly excludes an impact scope to generate a more fine-grained claim. + +``` +"hypercert": { + "work_scope": { + "name": "Work Scope", + "value": ["Protecting Trees in Amazon"], + "excludes": [], + "display_value": "Protecting Trees in Amazon" + }, + "impact_scope": { + "name": "Impact Scope", + "value": ["All"], + "excludes": ["CO2 in Atmosphere"], + "display_value": "All ∧ ¬CO2 in Atmosphere" + }, + "work_timeframe": { + "name": "Work Timeframe", + "value": [1356998400, 1388534399], + "display_value": "2013-01-01 -> 2013-12-31" + }, + "impact_timeframe": { + "name": "Impact Timeframe", + "value": [1356998400, 0], + "display_value": "2013-01-01 -> Indefinite" + }, + "contributors": { + "name": "Contributors", + "value": ["0xa1fa1fa000000000000000000000000000000000", "Project Forest Conservation"], + "display_value": "0xa1f...000, Project Forest Conservation" + }, + "rights": { + "name": "Rights", + "value": ["Public Display"], + "display_value": "Public Display" + } +} +``` + +### Additional guidelines + +Here are some additional guidelines for defining hypercert dimensions. + +- For most hypercerts, the `work_scope` is best represented as the name of the project or activity. Other information contained in the hypercert, namely, the `contributors` and the `work_timeframe` should provide sufficient context to disambiguate multiple claims from the same project. +- Similarly, for most hypercerts, the `impact_scope` will be most clearly represented as "all" (with an indefinite upper bound on the `impact_timeframe` dimensions). This gives the hypercert creator and its owners the flexibility to make claims about impact that may not have been observable or well-understood when the hypercert was created. + +- It is recommended to browse the `impact_scope` and `work_scope` tags that have already been created and are in use by your or other projects. (We are building a catalog to be available at [hypercerts.org](https://hypercerts.org).) Picking established tags can make it easier for users to discover, curate, and interact with your hypercert. In the long-run, we expect different ontologies to emerge in domains like climate solutions, open source software, etc, and picking more established tags will help prevent overlapping or duplicate claims. +- Tags for work scopes and impact scopes are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. +- Scopes that are explicitly excluded from the hypercert claim are enumerated separately and displayed with the `¬` prefix in the tag. Excluded scopes are not currently displayed on hypercert artwork. +- The order of tags matters only for display purposes. The hypercert artwork will only display a limited number of tags in the `impact_scope` and `work_scope` arrays due to image size and stylistic constraints. +- A `contributor` can be identified using any human-readable string. The base case is to set the `contributors` to the wallet address used to create the hypercert. A multisig wallet can be used to represent a group of contributors. + +### Assigning `rights` + +In version 1.0 of the protocol, only one `rights` tag will be enabled: + +> **Public Display**: owners of the hypercert have the right to publicly display and receive social utility from their hypercert. + +This means that any other rights regarding the work described by the hypercert either remain with the original contributors or are governed by other agreements. + +Additional `rights` including the potential for certain types of transfers to be explicitly enabled will be released in subsequent versions. + +## Optional hidden properties + +Creators may wish to add other fields in their metadata that are not a part of the hypercert claim and are not for display on third-party marketplaces like OpenSea. These can be added by creating a `hidden_properties` field in the metadata. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/implementation/token-standard.md b/docs/versioned_docs/version-1.0.0-alpha.0/implementation/token-standard.md new file mode 100644 index 00000000..a767c670 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/implementation/token-standard.md @@ -0,0 +1,29 @@ +--- +title: Token Standard +id: token-standard +sidebar_position: 1 +--- + +### Hypercerts as a semi-fungible token + +In order to make the token identifiable, traceable, and transferable, hypercerts are represented as [ERC-1155 tokens](https://eips.ethereum.org/EIPS/eip-1155). The ERC-1155 standard enables a single deployed contract to store many hypercerts, facilitating simpler creation, transfers, as well as splitting and merging of hypercerts within a single namespace. As a semi-fungible token, each unique token represents a fraction of ownership of a hypercert. Hypercerts are then represented as a group of tokens, where the total ownership sums to 100%. In order to easily identify which hypercert a token belongs to, we utilize the upper 128 bits of a 256-bit token ID to identify the hypercert. All tokens within the same hypercert group should share the same [ERC-1155 Metadata](https://eips.ethereum.org/EIPS/eip-1155#metadata). + +![hypercert id](../../static/img/hypercert_id.png) + +For illustrative purposes, let us assume that token IDs are just 2 bytes long, where the first byte represents the hypercert ID and the last byte represents which fraction of ownership. Alice could create a new hypercert token 0x2301, representing 100% of hypercert 0x23. If Alice wanted to transfer 20% to Bob, Alice could perform a split operation by minting token 0x2302 and transferring 20% of value to it, such that tokens 0x2301 and 0x2302 represent 80% and 20% ownership respectively of hypercert 0x23. Then Alice transfers token 0x2302 to Bob. Similarly, they could merge these 2 tokens together, back to form a token that represented 100% ownership. In this case, the value of 0x2301 would be transferred to 0x2302, and then 0x2301 is subsequently burned. + +Alice can also choose to split or merge hypercerts along some dimension of the impact space. For example, Alice may split hypercert 0x23 into two new hypercerts — 0x24 representing work done before the year 2000, and 0x25 representing work done after 2000. The original hypercert 0x23 is burned and the two new hypercerts store a reference to the previous hypercert. When the history of splits and merges are indexed, we can easily trace through the provenance of any individual hypercert. + +### Claim Data + +Hypercert claim data, such as scope of work and the contributor list, is encoded in JSON format into the [ERC-1155 Metadata](https://eips.ethereum.org/EIPS/eip-1155#metadata). Claim data can be stored on-chain alongside the token, or in off-chain storage such as IPFS. For details on the JSON schema and how off-chain storage can be utilized, see the [hypercerts-sdk repository](https://github.com/hypercerts-org/hypercerts/tree/main/sdk). + +When considering whether to store hypercert metadata on-chain or off-chain, we can consider the different trade-offs to the user experience and cost, which may differ depending on which blockchain is being used. Storing data off-chain saves on costs, but could lead to on-chain claims without the metadata. Storing data on-chain adds additional security that the claims will not be forgotten but can lead to higher gas fees. + +Beyond the standard fields of hypercerts that locate the hypercert in the impact space, additional fields can be added. This allows for different templates in different impact areas, such as AI safety or biodiversity, as different additional information will be useful. Importantly, however, all hypercerts will be located in a single impact space – the additional fields do not change that. + +### Multi-chain support + +We expect hypercerts to exist in a multi-chain ecosystem, where the local deployment can be used to support the unique funding systems of that community. In order to visualize a single global impact space, we index the different contract deployments across chains and surface any potential hypercert claim conflicts. Because different blockchains support different subsets of programming languages, we do expect different implementations of the hypercert protocol to exist. However, they must adhere to the same hypercert data model to be indexed into the impact space. + +In order to decide which deployments to index into the hypercerts impact space, decentralized governance institutions will be used to govern the list of contract addresses used across all blockchains. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/intro.md b/docs/versioned_docs/version-1.0.0-alpha.0/intro.md new file mode 100644 index 00000000..0c4d7ca3 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/intro.md @@ -0,0 +1,58 @@ +--- +title: What Are Hypercerts? +id: intro +--- + +# What are hypercerts? + +### Hypercerts are a new token standard for tracking and rewarding positive impact. + +Each hypercert represents a unique impact claim capturing the following information: + +- a scope of work and its corresponding scope of impact +- a set of time frames for both the work and its impact +- a set of contributors – the organization or people behind the work +- a set of rights you get by owning a hypercert + +The hypercert itself is an ERC-1155 semi-fungible token with the information above stored as metadata on IPFS. Here’s an example. + +### Hypercert example + +#### Graphic representation + +![hypercert design example](../static/img/hypercert_example.png) + +#### Supplementary information (metadata) + +- **Title of hypercert:** Invention of the InterPlanetary Filesystem (IPFS) +- **Description:** The InterPlanetary File System (IPFS) is a set of composable, peer-to-peer protocols for addressing, routing, and transferring content-addressed data in a decentralized file system. +- **Link:** ipns://ipfs.tech/ + +#### Hypercert dimensions (metadata) + +- **Set of contributors:** 0xb794f5ea0ba39494ce839613fffba74279579268 _(example Ethereum address)_ +- **Scope of work:** IPFS ∧ ¬ go-ipfs +- **Time of work:** 2013-01-01 --> 2013-12-31 +- **Scope of impact:** All +- **Time of impact:** 2013-01-01 --> indefinite +- **Rights:** Public display + +### Why should you care? + +We spend trillions of dollars every year on public goods via governmental agencies, foundations, private donations and corporate spendings; however, we don’t effectively track this work – leaving us in the dark, hoping that it actually has the intended positive impact. + +We believe we can do better: + +- We should start by tracking this work consistently – this is what hypercerts are for. +- We should evaluate how impactful that work was – this is what the open evaluation system of hypercerts supports. +- We should reward the work that was exceptionally impactful – this is what the public display of hypercerts and retrospective funding is for. + +Doing this would unfold powerful incentives. Retrospective funding 1) provides incentives for creators to take on public goods projects with a potentially high, but uncertain, impact, 2) enables feedback loops to learn from successes and failures, and 3) attracts more talent to the public goods sector by improving performance-based compensation. + +While we are excited about the prospects of retrospective funding, hypercerts do not impose any specific funding mechanisms, but start with tracking the work that is supposed to be impactful. As a database for many funding mechanisms this facilitates experimentation and interoperability between funding mechanisms. + +### Next + +Curious and want to learn more? Head over to the [whitepaper](whitepaper/whitepaper-intro.md) to dive deeper into the world of hypercerts. + +Or do you want to get started right away? Head to the [minting guide](minting-guide/minting-guide-start.md). diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/minting-guide/gitcoin-round.md b/docs/versioned_docs/version-1.0.0-alpha.0/minting-guide/gitcoin-round.md new file mode 100644 index 00000000..1ad2310a --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/minting-guide/gitcoin-round.md @@ -0,0 +1,166 @@ +--- +title: Gitcoin Alpha Round Instructions +id: gitcoin-round +sidebar_position: 3 +--- + +# Gitcoin Alpha Round Instructions + +## Overview + +- all projects in the Gitcoin Alpha Round are invited to mint a hypercert for their work +- anyone who gave over $1 to a project is automatically allowlisted for that project’s hypercert +- 50% of each hypercert is distributed to the funders, 50% is kept by the project and can be transferred later +- each project has a custom URL to make minting super easy (the link is sent directly to each project) +- everything runs on Optimism (users only need to pay L2 gas costs) + +:::info +If your project participated in the Gitcoin Alpha Round, but you didn't get a message with a custom URL, please reach out to team[at]hypercert.org. +::: + +## Hypercerts x Gitcoin Alpha Round + +Now that Gitcoin’s Alpha Round has officially closed and the funding distribution is finalized, we are inviting all eligible projects that participated to mint a hypercert for their past work and to allocate fractions of their hypercert to a list of supporters. + +We’ve created a dApp that pulls all of the data required to mint your hypercert directly from Gitcoin’s Grant Protocol. You can fine-tune the properties, tweak your artwork, and review the distribution mechanism. Once you’re ready, hit the create button and your hypercert will be released into the ethers! + +Once your hypercert has been minted, the people who supported your project with a contribution of at least $1 DAI on Gitcoin’s Alpha Round will be able to connect and claim their fractions. + +A few important notes about the Alpha Round: + +- The total units of a hypercert is based on the total donations; each funder get awarded units proportional to their donations. +- Transfers will be restricted to one transfer from the project to the supporters. +- There will be no additional rights awarded to the funders except the right to "public display" their support for the project. + +## Instructions + +The following guidance is only for projects that receive a custom URL that pre-populates the hypercerts form based on their Gitcoin Grants' data. + +It explains the default settings in the form and recommends fields that the creator may choose to update or edit. + +:::note +Gitcoin Grant hypercerts are for retrospective work, i.e., they are intended to capture work that happened between Gitcoin Grants Round 15 (September 2022) and the Alpha Round (January 2023). Therefore, the work time period is always set to past dates. (You might need to adjust the name and description to also refer to past work only.) We are focusing solely on retrospective hypercerts for this round as part of broader efforts to promote retrospective funding; you can read more about it [in the whitepaper](whitepaper/retrospective-funding.md). +::: + +### General Fields + +#### Name of Hypercert + +This field is set by default to the name of your project on Gitcoin Grants. You can edit this to be more specific. Given that your project may create numerous hypercerts over time, consider giving each hypercert a name that represents a more discrete phase or output. + +#### Logo + +This field is set to the icon artwork provided for your project on Gitcoin Grants. If there was an error accessing your icon, you will see a generic icon. + +You can update this by providing a new URL and the hypercert artwork should update automatically. + +Logo images look best with an aspect ratio of 1.0 (square-shaped). + +#### Background Banner Image + +This field is set to the banner artwork provided for your project on Gitcoin Grants. If there was an error accessing your banner, you will see a generic Gitcoin banner. + +You can update this by providing a new URL and the hypercert artwork should update automatically. + +Banner images look best with an aspect ratio of 1.5 (e.g., 600 x 400 pixels). The dimensions should be at least 320 pixels wide and 214 pixels high to avoid stretching. + +#### Project Description + +This field is set by default to the description of your project on Gitcoin Grants. Review closely -- a long project description in your Gitcoin Grant description will be truncated. + +You may edit this to provide more details about your work and to remove information that is targeted solely at Gitcoin Grants users. This is also a good place to provide other links, such as Github repos or social media accounts, where the general public can learn more about the work. Please aim for a project description that is less than 500 characters. + +:::note +The project description should refer to **past work**, not future work that you would like to do with additional funding. +::: + +#### Link + +This field is set to the first external URL provided for your project on Gitcoin Grants. You can update this. + +### Hypercert Fields + +#### Work Scope + +This field is set by default to a **shortened version** of the name of your project on Gitcoin Grants. You may edit or add additional work scope tags. + +For most projects, it's probably best just to use a single tag that is a short form of your project's name. Given that your project may create numerous hypercerts over time, having a work scope that represents the name of your project will make your claims in the "impact hyperspace" more continuous. + +If you choose to use more than one tag, remember that tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. + +#### Work Start/End Dates + +The start date has been set by default to the `2022-09-22` for all projects on Gitcoin Grants. This date coincides with the end of Gitcoin Grants Round 15. + +The end date references the last update to your grant page on Gitcoin Grants. + +You may edit or update these fields, however, the end date may not extend beyond `2023-01-31` (the close of the funding round) as all hypercerts will be retrospective in this round. + +#### Set of Contributors + +This field is set by default to the wallet address that is set as the recipient address for receiving Gitcoin Grants funding. + +:::note +You should review this field closely and – if applicable – provide the addresses of additional contributors. +::: + +### Advanced Fields + +#### Impact Scope + +This field is set by default to `all`. + +Updates are currently disabled on the frontend because funding decisions on Gitcoin Grants were not specific to an impact scope or impact time period. + +#### Impact Start/End Dates + +This field is set by default to the work start date of `2022-09-22` (see above) and a work end date of `indefinite`. Updates are currently disabled on the frontend. + +#### Rights + +This field is set by default to `Public Display`, i.e., the owners are allowed to publicly display the hypercert and show their support of the work. + +Updates are currently disabled on the frontend. + +### Distribution + +#### Allowlist + +This field is set by default to a custom allowlist generated for each project based on the funding it received on the Gitcoin Grants Alpha Round. You should not need to update this field. If there is a problem with your allowlist, please contact us. + +50% of the hypercert will be allocated according to this allowlist. The other 50% will be kept by the project, i.e. it is allocated to the address that mints the hypercert. You will be able to transfer or sell these fractions later as long as they are owned by the minter. This means that they can only be transferred or sold once. + +The formula assigns one fraction (rounded down) for every $1 (using the exchange rate at the time of the transaction) that a donor contributed to the project. It also provides a small buffer (of 5%) so that a transaction worth $0.999 or $0.951 remains eligible for one fraction. + +For example: + +- $5.60 donated --> 5 fractions +- $5.20 donated --> 5 fractions +- $0.96 donated --> 1 fraction +- $0.52 donated --> 0 fractions + +The queries used to generate the allowlists can be viewed here: + +- ETH Infra: https://dune.com/queries/1934656 +- Climate: https://dune.com/queries/1934689 +- OSS: https://dune.com/queries/1934969 + +Donors who contributed to the matching pool for each round are also eligible to claim hypercerts. + +:::note +You are free to edit your allowlist. You can do this by following the step-by-step instructions [here](minting-guide/step-by-step.md). Just remember that you will need to upload the new allowlist in a CSV format to a storage site like [web3.storage](https://web3.storage) and then update the link in the allowlist field. Contact team[at]hypercerts.org if you need help. +::: + +### Confirmations + +#### Contributors' permission + +Every contributor needs to agree to have their contribution be represented by a hypercert. This is why the person minting the hypercert has to confirm to have the permission of all listed contributors. + +#### Terms & Conditions + +The terms & Conditions can be found [here](https://hypercerts.org/terms). + +### Final step: Click "Create" + +Make sure your Optimism wallet or multi-sig is connected. Click on "create" and wait for your hypercert to be created. Congratulations! diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/minting-guide/minting-guide-start.md b/docs/versioned_docs/version-1.0.0-alpha.0/minting-guide/minting-guide-start.md new file mode 100644 index 00000000..47e8ad7c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/minting-guide/minting-guide-start.md @@ -0,0 +1,44 @@ +--- +title: Getting Started +id: minting-guide-start +sidebar_position: 1 +--- + +# Getting started + +### How to create a hypercert + +Creating a hypercert is similar to creating an NFT on sites like OpenSea or Zora. + +In this article, we’ll walk through the steps one by one and explain exactly what you need to do to create your first hypercert. + +There are typically two ways of creating a hypercert: + +1. As a project affiliated with a specific funding network (e.g., Gitcoin Grants): In this case, you should receive a custom URL from the funding network that pre-populates most of your hypercert fields. You will still be able to change most of these, so you should review and adjust them as needed to better describe your hypercert. Guidance on how to do so (for Gitcoin Grants projects) is provided at the end of this doc. +2. As a project not affiliated with a specific funding network: In this case, you will be creating a hypercert from scratch and filling in each field on your own. Read on below. + +### Who can create a hypercert? + +Anyone doing work that is intended to have a positive impact can create a hypercert. Your hypercert can be as simple as "I did X on this date and want to claim all future impact from it". + +It can also represent something more, such as a phase in an ongoing team project, an invention or discovery, a research publication, or an important software release. + +Critically, if the work was done by more than one person, then each person should be listed as a contributor to the hypercert and approve the creation of the hypercert. + +_Note: In the future, the approval of each contributor will be verified on-chain._ + +### What do I need to create a hypercert? + +You will need to prepare all of the information required in the form builder (see **Step-by-step instructions for creating a hypercert** below). This includes important metadata, such as a description of the project and the dimensions of your impact claim, as well as a project artwork. You may also want to include an allowlist of wallets that are approved to claim one or more fractions of the hypercert. + +In addition to the information regarding the hypercert itself, you’ll need a crypto wallet to mint your hypercert. “Minting” a hypercert is the process of writing an impact claim to the blockchain. This establishes its immutable record of authenticity and ownership. + +Next, choose a blockchain on which to mint your hypercert. The hypercerts protocol is available on Ethereum, Goerli (testnet), and Optimism. Each of these blockchains has different gas fees associated with transactions on their networks. To reduce gas fees we recommend Optimism for most projects. + +Finally, go ahead and create your hypercert. + +### How much does it cost to create a hypercert? + +You will need enough Ethereum in your wallet to cover gas fees. In our simulations, the gas fee for minting a hypercert on Ethereum Mainnet ranged from 2,707,282 to 7,515,075 gwei (0.0027 to 0.0075 ETH). Minting costs are significantly cheaper on Optimism (i.e., below 0.0005 ETH or less than $1). + +The protocol currently does not offer gas-free or "lazy" minting. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/minting-guide/step-by-step.md b/docs/versioned_docs/version-1.0.0-alpha.0/minting-guide/step-by-step.md new file mode 100644 index 00000000..9f3b6303 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/minting-guide/step-by-step.md @@ -0,0 +1,130 @@ +--- +title: Step-by-step Instructions +id: step-by-step +sidebar_position: 2 +--- + +# Step-by-step instructions + +First, go to the [Create Hypercert](https://hypercerts.org/app/create) site with a wallet-enabled browser or follow the custom URL you received to access a prepopulated form. + +Although the site works on mobile, it is easier to use on desktop because the browser will display a dynamic preview of the hypercert while you fill out the Create form. + +Next, connect your wallet. You will be prompted to switch to the Ethereum or Optimism network. + +Once you've connected, you will see an empty form for creating a hypercert. + +### General fields + +#### Name of Hypercert + +Enter the name or title of the hypercert. This is the place to be verbose and specific about what the project is doing. You'll see on the preview when your title becomes too long. + +Given that a project may create numerous hypercerts over time, consider giving the hypercert a name that represents a discrete phase or output. + +Names are restricted to 100 characters but may include emojis (:smile:), accents (é), non-Latin scripts (表情), and other Unicode characters. + +#### Project Description + +Enter a human readable description of the hypercert. This is the place to share more details about the work and the team or individual behind the work. + +The description field supports [Markdown syntax](https://www.markdownguide.org/cheat-sheet/) and has a limit of 10,000 characters. + +In addition to the main link (see next field) you can add further links in the markdown to help others to understand the work of the project. + +#### Link + +A valid URL for the project, beginning with https:// + +This will be displayed next to the hypercert on webpages like OpenSea and should link users to a page that has more information about the project or impact claim. + +#### Logo + +An icon for the top left part of the card. This could be your project logo. It will be automatically masked to the shape of a circle. + +Logo images look best with an aspect ratio of 1.0 (square-shaped). + +The easiest way is to find an image you like in your web browser, right click "Copy Image Address", and paste it in the field. Images stored on IPFS should be referenced through a hosted URL service, e.g., `https://cloudflare-ipfs.com/ipfs/`. + +#### Background Banner Image + +A background image that will extend across the upper half of the artwork. This could be your project masthead or a unique piece of art. + +Banner images look best with an aspect ratio of 1.5 (e.g., 600 x 400 pixels). The dimensions should be at least 320 pixels wide and 214 pixels high to avoid stretching. + +Currently we don't support zoom / cropping, so you will need to test the look and feel on your own. + +The easiest way is to find an image you like in your web browser, right click "Copy Image Address", and paste it in the field. Images stored on IPFS should be referenced through a hosted URL service, e.g., `https://cloudflare-ipfs.com/ipfs/`. + +### Work Scope fields + +#### Work Scope + +One or multiple tags describe the work that the hypercert represents. This work scope will be used to identify the work that is included in the hypercerts and the work that is not included. + +Multiple tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. + +For most projects, it's probably best just to use a single tag that is a short form of your project's name. Given that your project may create numerous hypercerts over time, having a work scope that represents the name of your project will make your claims in the "impact hyperspace" more continuous. + +_Note: In the future, you will be able to specifically exclude work from the hypercert._ + +#### Start and End Date of Work + +The work time period defines when the work was done that the hypercert represents, i.e., only the work in this time period is included in the hypercert. + +The time period of work doesn't need to be the start and end date of a project, but it can be. One project can be split up into multiple hypercerts, e.g. all hypercerts can have the same `work scope`, but different time periods of work. Of course, the time periods are not allowed to overlap. + +### Impact scope fields + +#### Impact Scope + +The impact scope can be used to limit the impact that a hypercert represents, e.g. for the work scope `Planting trees` a hypercert can represent _only_ the impact on biodiversity by including the impact scope tag `Biodiversity`. This would exclude all other impacts, including the impact on CO2 in the atmosphere, which can be useful if that impact is already captured by a carbon credit. + +By default this is set to "`all`" and we strongly recommend keeping it that way. + +Just like the work scope, multiple impact scope tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction). + +#### Start and End Date of Impact + +The impact time period is another way to limit the impact that a hypercert represents, e.g. inventing a new medical treatment has a positive impact over many years, but we might want to capture the positive impact separately for each year. + +By default the `impact start date` is the same as the `work start date` and the `impact end date` is "`indefinite`", i.e., the impact is not restricted time-wise. We strongly recommend keeping it that way. + +### Set of Contributors + +Provide a list of contributors, one per line, or comma-separated. + +The list should include _all_ contributors that performed the described work. + +Contributors are generally itemized as wallet addresses or ENS names, but can also be names / pseudonyms. Groups of contributors can be represented by a multisig or name of an organization. + +### Owners + +#### Allowlist + +The allowlist allocates fractions of the hypercert to specific wallet addresses. These wallet addresses are then allowed to claim these fractions afterwards. For example, it can be used to allocate fractions to previous funders and contributors. + +The allowlist is implemented as a CSV file specifying `index,address,price,fractions` headers. + +| index | address | price | fractions | +| ----- | ------------------------------------------ | ----- | --------- | +| 0 | 0x5dee7b340764c49a827c60d2b8729e49405fbefc | 0.0 | 100 | +| 1 | 0x1e2dbb9ca3f6d48e085384a821b7259abfdc7d65 | 0.0 | 50 | +| ... | ... | ... | ... | +| 999 | 0x436bad18642f45d3fa5fcaad0a2d81764a9cba85 | 0.0 | 1 | + +The `price` field is denominated in ETH. This should remain at 0.0 for all hypercerts, as primary sales are not currently supported through the app and the secondary sale/transfer of hypercerts is currently not allowed. + +You can store your allowlists on IPFS using [web3.storage](https://web3.storage/). + +:::note +If your allowlist is not properly formatted, you will be unable to mint your hypercert. If you do not include an allowlist, then the creator of the hypercert will receive 100% of the hypercert (set to a default of 10,000 units), which you can then sell or transfer to another wallet a maximum of one time. +::: + +#### Rights + +This field defines the rights that owners of the hypercert have over the work being claimed by this hypercert. + +By default this is set to `Public Display`, i.e., the owners are allowed to publicly display the hypercert and show their support of the work. + +_Note: In the future, additional rights can be included for different hypercerts._ diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/evaluation.md b/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/evaluation.md new file mode 100644 index 00000000..87fb9194 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/evaluation.md @@ -0,0 +1,23 @@ +--- +title: Open Impact Evaluations +id: evaluation +sidebar_position: 5 +--- + +A key design element is that hypercerts themselves do not make a claim about the size of the impact, but only account for the work that is supposed to be impactful. The figure below shows this contrast in a simplified illustration of the example that we introduced above. The open evaluation system allows multiple evaluations to point at the same area of the impact space that a hypercert claims. The evaluations can include self-evaluation from the contributors themselves. Funders observe these and make their funding decisions based on this richer set of information. + +![hypercert evaluations](../../static/img/hypercert_evaluations.png) + +The open evaluation system is also used to provide additional information, e.g. an evaluator or the project itself provides information about the health of the trees. This information can then be used transparently by other evaluators to evaluate the impact on CO2 in the atmosphere. + +An important feature is that the evaluations do not directly point at a hypercert, but rather at an area in the impact space. In practice this area will mostly be the exact same area that a hypercert claims, such that it can be considered an evaluation of the hypercert, but it does not have to. This feature ensures that, if hypercerts are merged or split, previous evaluations will continue to be linked appropriately. + +The form of evaluations can be standardized to simplify handling and comparing multiple evaluations from multiple evaluators. The open evaluation system allows for templates to be created and used by any evaluators. Similar to the emerging ontologies, these are not enforced centrally, but should emerge as useful standards – potentially steered by decentralized governance institutions. + +Important characteristics of the open evaluation system are: + +- Evaluators can submit multiple evaluations of the same area in the impact space as more information becomes available +- Evaluations can challenge other evaluations +- Evaluation methodologies can evolve over time + +These features allow the whole evaluation system to be dynamically improved by each actor. The relevant incentives for this improvement will stem from the funders who will value the signals from some evaluators more than others and evaluators are able to build up reputation. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/hypercerts-intro.md b/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/hypercerts-intro.md new file mode 100644 index 00000000..8acc11d1 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/hypercerts-intro.md @@ -0,0 +1,104 @@ +--- +title: "Hypercerts: a New Primitive for Impact Funding Systems" +id: hypercerts-intro +sidebar_position: 3 +--- + +### Defining hypercerts + +A hypercert is a semi-fungible token that accounts for work that is supposed to be impactful and represents all or parts of that impact. A hypercert has the following fields (one for each dimension): + +1. **Set of contributors:** An ordered list of all contributors, who claim to do or have done the work described by this hypercert. +2. **Scope of work:** A conjunction of potentially-negated work scope tags, where an empty string means “all”: + +``` + ::= AND | " " + ::= | NOT +``` + +3. **Time of work:** A date range, from the start to the end of the work being claimed by this hypercert. +4. **Scope of impact:** A conjunction of potentially-negated impact scope tags, where an empty string means “all”: + +``` + ::= AND | " " + ::= | NOT +``` + +5. **Time of impact:** Date ranges from the start to the end of the impact. +6. **Rights of the owners:** An unordered list of usage rights tags, which define the rights of the owners of this hypercert over the work being claimed by this hypercert. + +Implementing hypercerts as a semi-fungible token allows multiple contributors and funders to own parts of hypercerts. For instance the original contributors can award 10% of a hypercert to a funder, while keeping 90%, which they can award to other funders later. This is why hypercerts are fractionalizable. + +### Examples + +In the simplest cases of hypercerts, the scope of work and impact as well as the time of impact are not restricted and no rights are transferred to owners of the hypercerts, i.e. the hypercerts just define the who (set of contributors) and when (time of work) of the claimed work. Scope of work and impact would be set to all, time of impact to “indefinite” and the rights to only “public display of support”. The latter is always included as the hypercert is a public record, such that owners will always automatically display their support of the work. + +Take for example hypercert 1 below: It represents all work that contributor 1 has performed in 2013 with all the impact that the work had from the beginning of the work; the hypercert doesn’t give any additional rights to the owners of the hypercert. + +The other fields – except the rights field – can be used to limit the work or impact that is represented by the hypercert. Hypercert 2 limits this to the work on IPFS in 2013, i.e. any other work besides IPFS that contributor 1 performed is not included. Hypercert 3 limits it even further as it excludes a specific aspect of IPFS, the go-ipfs implementation. + +| | **Hypercert 1** | **Hypercert 2** | **Hypercert 3** | +| ----------------------- | ------------------------- | ------------------------- | ------------------------- | +| **Set of contributors** | Contributor 1 | Contributor 1 | Contributor 1 | +| **Scope of work** | all | IPFS | IPFS ∧ ¬ go-ipfs | +| **Time of work** | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | +| **Scope of impact** | all | all | all | +| **Time of impact** | 2013-01-01 → indefinite | 2013-01-01 → indefinite | 2013-01-01 → 2013-12-31 | +| **Rights** | Public display of support | Public display of support | Public display of support | + +In the table below we illustrate a use case for limiting the scope of impact. Suppose contributor 1 protects trees in a certain area. This work has positive effects on the CO2 in the atmosphere and could turn into carbon credits; however, the trees have additional positive impacts, such as protecting biodiversity. Instead of including all positive impacts in one hypercert (hypercert 4), the impact can be split between the impact on CO2 in the atmosphere (hypercert 5) and all other positive impacts (hypercert 6). If funders are willing to pay for biodiversity, this would be a new income opportunity. And it would account for the additional positive impact that other methods of reducing CO2 might not have, like industrial carbon capture. Importantly, negative impacts can not be excluded from a hypercert. + +| | **Hypercert 4** | **Hypercert 5** | **Hypercert 6** | +| ----------------------- | -------------------------- | -------------------------- | -------------------------- | +| **Set of contributors** | Contributor 1 | Contributor 1 | Contributor 1 | +| **Scope of work** | Protecting trees in area X | Protecting trees in area X | Protecting trees in area X | +| **Time of work** | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | +| **Scope of impact** | all | CO2 in atmosphere | all ∧ ¬ CO2 in atmosphere | +| **Time of impact** | 2013-01-01 → indefinite | 2013-01-01 → indefinite | 2013-01-01 → indefinite | +| **Rights** | Public display of support | Public display of support | Public display of support | + +Importantly a hypercert does not specify the “size” of the impact, e.g. a hypercert does not state “5 tons of CO2 removed from the atmosphere.” Instead the hypercert only defines the work, e.g. “200 trees protected” (scope of work) in 2022 (time of work). The size of the impact is then left to the evaluations of the “CO2 in the atmosphere” (scope of impact) in 2022 (time of impact) that point towards the covered region of the hypercert. For instance: This allows a self evaluation to claim that 5 tons of CO2 were removed in a given year as well as one or multiple evaluations from independent auditors to confirm or challenge how much CO2 has been removed. An evaluator could detect that some of the trees were not healthy and hence only 4 tons of CO2 were removed. Allowing for multiple evaluation is a defining characteristic of the open evaluation system. + +### Functions of hypercerts + +#### 1. Identifiability + +Hypercerts clearly define the work that is supposed to be impactful by creating a record of who (set of contributors) claims to do or have done what (scope of work) in what time period (time of work). They also allow the creation of multiple records of the same work to identify separate impacts that this work had or will have (scope of impact) over specified time periods (time of impact). + +#### 2. Traceability + +As these records are public and logically monotonic (immutable, except to split or merge hypercerts), records are durable and permanent. + +#### 3. Transferability + +The records are a digital object that can be owned and ownership can be transferred (under specific conditions). As hypercerts can be created as fractionalizable, it is also possible to transfer only a specified fraction of the hypercert. Each hypercert defines the rights over the defined work that owners have, such as rights to retrospective rewards, rights to public display of the support (“bragging rights”) or rights to passive income from intellectual property. + +:::note Transferability restrictions + +Hypercerts are generally transferable. However, there are use cases, in which minters of hypercerts want to restrict how their hypercerts can be transferred. The protocol allows the minter to restrict who can transfer the hypercert and/or to whom the hypercert can be transferred. For instance, by specifying that only the original owner can transfer the hypercert, any future owner is prohibited from selling it, i.e. a secondary market would not exist for this hypercert. + +::: + +### Merging hypercerts + +Besides the fungible dimension, hypercerts can be merged and split on any of the six dimensions as shown in box 1. Let us take the hypercert 1 from the section "Hypercerts definition" and focus only on two of the dimensions, scope of work and time of work. These two dimensions create a simplified impact space. The figure below shows how work on IPFS (InterPlanetary File System) could have been minted over time in separate hypercerts, one for each quarter of work. + +![minting hypercerts example](../../static/img/creating.png) + +We created five hypercerts, one for each quarter of work. As the resulting work of all of these together is IPFS 0.1, the merged hypercert in total is more meaningful and more valuable than just the five individual hypercerts. In this case the proverb is true, the whole is greater than the sum of its parts. Hence, we want to merge them as shown in the next figure. + +![merging hypercerts example](../../static/img/merging.png) + +### Splitting hypercerts + +Conversely, splitting can increase the meaningfulness and value of hypercerts as well. We can split the work on IPFS 0.1 into the conceptual work “invention of IPFS” and the implementation via “go-ipfs 0.1” as shown in the next figure. + +![splitting hypercerts examples](../../static/img/splitting.png) + +Other use cases are where multiple contributors want to combine their work on the same scope of work (merging) or disentangle their work (splitting). Ultimately, splitting and merging allows users to repackage the digital representation of their work and impact. + +Importantly, splitting and merging are the only operations that are permitted to change hypercerts. Once an area in the impact space is claimed, it can not be unclaimed. This ensures that claims are never forgotten. + +### Retiring hypercerts + +While a claim in the impact space can not be unclaimed, it can be retired. Retiring a hypercert means that owners can not transfer and sell it anymore. This way owners prove that they are the final buyers of the impact. Technically retiring hypercerts means that they are sent to a specific null address, which ensures that the retired hypercerts are recorded and traceable. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/ifs.md b/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/ifs.md new file mode 100644 index 00000000..6f71ac50 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/ifs.md @@ -0,0 +1,103 @@ +--- +title: The Need for Interoperable Impact Funding Systems (IFSs) +id: ifs +--- + +# The Need for Interoperable Impact Funding Systems (IFSs) + +### An IFS consists of + +- **Actors:** Contributors, funders, evaluators, and beneficiaries +- **Funding mechanisms:** Grants, bounties, retrospective funding, etc. +- **Coordination mechanisms:** Roadmapping, communication forums, etc. +- **A goal:** Maximize the domain-specific positive value created (impact) + +The goal will be specific to the impact area, e.g. prevent existential risks from artificial intelligence (AI) would be the goal for the impact area “AI safety.” To achieve these goals, skilled contributors must work with high effort on promising projects. Additionally, for those projects that create impact continuously, sufficient income streams are necessary to cover both their ongoing operating expenses and contributors’ upside incentives. + +#### Actors in IFSs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeSubtypeDescription
ContributorsPeople or organizations who do the work
FundersProspective fundersPeople or organizations who fund work before it is done
Retrospective fundersPeople or organizations who fund work after it is done
EvaluatorsScoutsPeople or organizations who evaluate the potential impact of work before it is done
AuditorsPeople or organizations who evaluate the impact of work after it is done
BeneficiariesPeople or objects that are impacted by the work
+ +### Guiding questions for designing IFSs + +1. **Projects:** How can we improve the chances that the most promising projects are worked on? +2. **Talent & resources:** How can we attract top talent to contribute to the most promising projects and provide them with the necessary resources? +3. **Effort:** How can we reward contributors for their impact on outcomes? +4. **Sustainable income:** How can we create recurring income streams and financial sustainability for impactful projects? + +Markets have been proven very powerful in answering these questions if they are directed towards maximizing profits. As we are directing systems towards maximizing impact, these answers become more challenging. In particular, in an IFS we are facing coordination and incentive problems in funding impact, such as the free-rider problem. + +### Example dynamics between actors in an IFS + +In order for impact funding systems to be most effective, they should be interoperable regarding (1) funding mechanisms, (2) funding sources and (3) evaluations. In the diagram below you see a potential dynamic between the actors of an IFS. In that scenario hypercerts can account for the prospective funding (steps 2-3) as well as for the retrospective funding (steps 8-9) from different funders. Evaluations are made public and can be discovered through the hypercerts for all funders (steps 5-7). Retrospective funders can reward not only the contributors but also the prospective funders (steps 10-11). + +```mermaid +sequenceDiagram + autonumber + participant Beneficiaries + participant Contributors + participant Prospective funders + participant Retrospective funders + participant Evaluators + Contributors ->> Contributors: Mint hypercerts + Prospective funders ->> Contributors: Award funding + Contributors ->> Prospective funders: Award fractions of
the hypercert + Contributors ->> Beneficiaries: Create impact + Retrospective funders ->> Evaluators: Fund evaluation + Evaluators ->> Beneficiaries: Evaluate impact on beneficiaries + Evaluators ->> Retrospective funders: Make evaluations public,
esp. for retrospective
funders + Retrospective funders ->> Contributors: Award funding + Contributors ->> Retrospective funders: Award fractions of hypercerts + opt + Retrospective funders ->> Prospective funders: Award funding + Prospective funders ->> Retrospective funders: Transfer fractions
of hypercert + end +``` + +### Hypercerts as a data layer for IFSs + +By serving as a single, open, shared, decentralized database hypercerts lower the transaction costs to coordinate and fund impactful work together. This is important because the optimal funding decisions of a single funder depends on the funding decision of all other funders. For instance, some work is only impactful if a minimum funding is provided: The impact is non-linear in the funding amount, e.g. half a bridge is not half as impactful as a full bridge. Other work might be over-funded, i.e. the impact of an additional dollar is basically zero. Ultimately, funders want to find the highest impact for each additional dollar spend (cf. S-process as in Critch, 2021). Today multi-funder coordination on impact funding is prohibitively expensive, leading to suboptimal efficiency in impact capital allocation. Through hypercerts the funding becomes more transparent and the credits for funding impactful work can be easily shared. Coordinating funding becomes easier. + +Hypercerts don’t solve this coordination problem by themselves, but build the basis for different decision and funding mechanisms as shown below. Quadratic voting, bargaining solutions, DAO-style votes, milestone bounties, and simple unconditional grants all have their strengths, among others. Hypercerts do not lock in any particular decision-making scheme for funders. + +![Hypercerts as a data layer for an IFS](../../static/img/hypercert_data_layer.png) + +Looking farther into the future: If a large majority of funding across an entire IFS ends up flowing through hypercerts, funders have created the transparency that enables each of them to make the best decisions given the funding decision of everyone else. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/impact-space.md b/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/impact-space.md new file mode 100644 index 00000000..f8fed762 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/impact-space.md @@ -0,0 +1,35 @@ +--- +title: A Consistent Impact Space +id: impact-space +sidebar_position: 4 +--- + +Every hypercert represents a claim in the impact space, which itself represents all possible claims. Above we illustrated the impact space with two dimensions, scope and time of work. The complete impact space is spanned by the six dimensions introduced in the definition of hypercerts. + +### Consistency of the impact space + +Every point in the impact space should either be claimed or not be claimed. No point must be claimed twice, or equivalently: + +- If the impact of some work is represented in one hypercert, it must not be part of any other hypercert. +- Hypercerts must not overlap with each other. + +The table below shows two hypercerts that were illustrated in the section on "Hypercerts operations", but now with all six fields. The two hypercerts can represent the exact same work by the same contributor, but they do not overlap because of the difference in the time of work. + +| | **Hypercert 7** | **Hypercert 8** | +| ----------------------- | ------------------------ | ------------------------ | +| **Set of contributors** | Contributor 1 | Contributor 1 | +| **Scope of work** | IPFS | IPFS | +| **Time of work** | 2013-10-01 to 2013-12-31 | 2014-01-01 to 2014-03-31 | +| **Scope of impact** | all | all | +| **Time of impact** | 2013-10-01 → indefinite | 2014-01-01 → indefinite | +| **Rights** | None | None | + +The consistency of the impact space is crucial as it ensures that no rights to an impact claim are sold twice. If for example someone owns the right to retrospective rewards for the impact of some work, the owners must be identifiable unambiguously. + +Because users can create hypercerts with arbitrary data on any chain, on which a hypercert contract is deployed, we provide ways to help users detect collisions in the impact space. For example, if one hypercert on Ethereum points to the work on “IPFS”, and another hypercert on Filecoin points to the work on “https://github.com/ipfs/go-ipfs” both with the same contributor and time of work, which of these overlapping hypercerts is the correct one to support? To surface such overlapping hypercerts, the hypercerts protocol and SDK will support mechanisms to index, search, and visualize neighbors in the impact space. With these tools evaluators can quickly detect potential conflicts and submit the results as evaluations to help disambiguate proper credit and attribution. + +### Emerging ontologies + +Common ontologies for the scope of work and scope of impact are useful to create transparency and improve discoverability. Such ontologies need to be created from the practices and should be adapted over time. They are like emerging norms, instead of fixed rules. However, some larger players or a group of smaller players could enforce certain ontologies, e.g. if multiple funders agree that they only fund projects that follow a specified ontology. + +As some ontologies might be more useful than others, we would ideally see a consensus emerge between participants and experts in each impact area. Decentralized governance institutions can help facilitate this; however, further details on the design are out of the scope of this paper and are left for future work. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/retrospective-funding.md b/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/retrospective-funding.md new file mode 100644 index 00000000..57444581 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/retrospective-funding.md @@ -0,0 +1,42 @@ +--- +title: Retrospective Impact Funding +id: retrospective-funding +sidebar_position: 6 +--- + +### Introducing retrospective funding + +While hypercerts do not impose any specific funding mechanisms, they are especially useful for retrospective funding. The core idea, from the perspective of contributors building impactful goods, is this: if you can reasonably expect to get funded retrospectively for your work once you produce a positive impact, then you can work now, in expectation of a probabilistic future cash flow. In another conception, you are effectively “borrowing” money from this anticipated future cash flow to fund the work in the first place; the expectation of future funding “retro-causes” the impactful work. Retrospective funding may be able to 1) provide incentives for contributors to take on impactful goods projects with a potentially high, but uncertain, impact and 2) create a more efficient IFS by back-propagating signals on what outcomes were impactful post-hoc. + +In addition, contributors are able to receive fair compensation by providing outsized impact that will be highly valued. It incentivizes you to create a positive impact, beyond your intrinsic motivation. This does not mean that the most successful contributors to impactful goods automatically have potential upside comparable to some for-profit startup founders (or that they should), just that their potential upside does depend on how much funders later value their past work. This will attract more talent to the impact sector by improving performance-based compensation. + +The crucial aspect for this to work: funders need to retrospectively fund impact, and send credible signals that they will do so in the future. Based on these signals contributors form expectations about future retrospective rewards and can start working today to receive them in the future. + +Hypercerts facilitate retrospective funding as the impact claims are identifiable, traceable and transferable. Contributors can sell parts of their hypercerts to prospective funders to receive the necessary funding for their project (“activity” in the figure below). The project delivers impact to a larger group (“beneficiaries”), which retrospectively buys the hypercerts from the prospective funder, and from the contributors if they retained some fraction of their hypercerts (the latter is not represented in the figure). + +![Retrospective funding with hypercerts](../../static/img/retrospective_funding.png) + +### Increasing rewards + +Retrospective funding allows us to increase rewards as more impact is created because impact is easier to observe, measure and prove retrospectively. Increasing rewards – as shown in the next figure – incentivizes contributors to put in their highest effort to produce impact and enables contributors to be rewarded for their talent. Moreover, prospective funders are incentivized to select, fund and support the projects with the highest expected impact, if they also receive retrospective rewards. + +![Increasing rewards](../../static/img/increasing_rewards.png) + +Note that retrospective funding should not be used in cases where a significant negative impact is possible since a nongovernmental, permissionless framework can not impose retrospective penalties for negative externalities. See Ofer & Cotton-Barratt (2022) for a discussion of this limitation of retrospective funding. + +In some cases we do not expect the retrospective evaluation to be any different than the prospective evaluation, i.e. there is no uncertainty resolved over time as the impact of an activity is already “known” prospectively. In these cases retrospective funding would only complicate the funding mechanism and funding via grants or milestone bounties would be preferable. Retrospective funding is preferable only if uncertainty is resolved over time. + +### Impact evaluations + +The relevance of impact evaluations will depend on how much their signals influence the funding decisions of retrospective funders (see the potential dynamics in the section on "IFSs"). This is a critical difference to many impact reports today: If a project was funded by a grant, the funders as well as the project want to receive a positive evaluation. If, however, the funding decisions of the retrospective funders are outstanding, they are interested in truthful signals about the impact. Hence, funders value improvements in evaluation methodologies and can fund independent evaluators. Evaluators in turn would build up a reputation for their evaluation methodologies and improve the strength of their signals to retrospective funders. + +Impact evaluators can take on a range of forms ranging forms, such as + +- Voting by relevant communities or beneficiaries +- Expert panels +- Professional evaluators similar to financial rating agencies +- Automatic monitoring and data collection by sensors and oracles + +The most useful form or combinations thereof will depend on the specific requirements of the impact area. For a generalized framework on impact evaluators see Protocol Labs (2023). + +While retrospective funding makes impact evaluations financially relevant for funders and contributors, hypercerts enable to pre-commit funding for those evaluations: As impact claims are never forgotten, any actor can at any time commit funding to a future evaluation of these claims. diff --git a/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/whitepaper-intro.md b/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/whitepaper-intro.md new file mode 100644 index 00000000..4d4648ba --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.0/whitepaper/whitepaper-intro.md @@ -0,0 +1,24 @@ +--- +title: Introduction +id: whitepaper-intro +--- + +# Vision & Whitepaper + +:::note + +If you prefer to read the draft whitepaper (v0) as a pdf, you can find it [here](../../static/pdf/hypercerts_whitepaper_v0.pdf). The content is mostly identical to the following pages. + +::: + +#### The world faces unprecedented challenges, from climate change to safe artificial intelligence, that require billions to trillions of dollars of public goods funding. + +High-upside/high-uncertainty endeavors are often overlooked due to the absence of strong incentives to pursue them in the dominant public goods funding framework of at-cost grants or even a milestone-bounty framework (which directly exposes small contributors to aversive risk levels). Yet these should be pursued when the expected positive value is very high, as it often is. New impact funding mechanisms can address this. One such mechanism is retrospective funding, which rewards projects based on the impact they create after the impact is observable. If projects can reasonably expect such retrospective rewards, they are incentivized to maximize their impact and – together with prospective funders – take risky bets when the expected positive value is high. + +#### In order for Impact Funding Systems (IFSs) to be most effective, they should be interoperable regarding (1) funding mechanisms, (2) funding sources, and (3) evaluations. + +Quadratic voting, bargaining solutions, DAO-style votes, milestone bounties, and simple unconditional grants all have their strengths, among others. We do not wish to lock in any particular decision-making scheme for funders. Without mechanisms like these, multi-funder coordination on impact funding is prohibitively expensive, leading to suboptimal efficiency in impact capital allocation. Funders should be able to easily collaborate with other funders or to intentionally fund different projects to diversify the funded approaches. Evaluators should be able to evaluate the same impact with different methodologies – potentially with conflicting results, to foster rigor and progress of evaluation methodologies. + +#### Hypercerts create this interoperability by serving as a single, open, shared, decentralized database for impact funding mechanisms. + +A single hypercert is a semi-fungible token that accounts for work that is supposed to be impactful and whose ownership is fractionizable and transferable (under specific conditions). Hypercerts do not impose any specific funding mechanisms but provide baseline invariant guarantees such that claims will not be forgotten as different mechanisms come into and out of fashion. This is also why hypercerts are especially useful for any retrospective funding mechanisms – funding can be applied to claims of the past. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/about.md b/docs/versioned_docs/version-1.0.0-alpha.1/about.md new file mode 100644 index 00000000..e2d4eb79 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/about.md @@ -0,0 +1,24 @@ +--- +title: The Hypercerts Foundation +id: about +--- + +# The Hypercerts Foundation + +### Mission + +The mission of the Hypercerts Foundation is to advance the development and adoption of open-source protocols for funding and rewarding positive impact. + +### Organization + +The Hypercerts Foundation is a fully independent organisation working closely with stakeholders in the open source, scientific research, and cryptography communities to develop and promote additional protocols that are decentralized, secure, and transparent. The Foundation will also provide support and resources to help drive the wider adoption of these protocols. + +### History + +Research on hypercerts was first presented to the public by David A. Dalrymple at the conference series Funding the Commons in March 2022. However, the concept of “impact certificates” has been a recurring theme at conferences and in online discussion forums since at least 2014. In late 2022, a small team of research scientists, developers, and practitioners began implementing hypercerts as a set of Ethereum-based smart contracts that could be used to assert and fund impact claims. The Hypercerts Foundation will now serve as the long-term home for this work. + +The new foundation is supported in part by Protocol Labs and is part of the broader Protocol Labs Network of hundreds of companies and organizations. The Foundation will complement Protocol Labs Network’s mission of enabling a more secure, open, and accessible internet. The Hypercerts Foundation, however, is fully independent and will focus on protocol development and cultivating a community of developers and impact entrepreneurs well beyond the Protocol Labs Network. + +### Further links + +Read the full [announcement of the Hypercerts Foundation](https://hypercerts.notion.site/Introducing-the-Hypercerts-Foundation-d956203fe0fc4792980da138015e770a). diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/allowlists.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/allowlists.md new file mode 100644 index 00000000..bc65b116 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/allowlists.md @@ -0,0 +1,101 @@ +# Allowlists + +Allowlists are an efficient way to enable distribution of hypercert fractions amongst a group. +First, the creator will create the hypercert with the metadata and an immutable allowlist. +With the `claimId`, every account specified in the allowlist can later mint their fraction token from that allowlist. + +## Create an allowlist + +First specify an allowlist, mapping addresses to the number of units they should receive. + +```js +import { + TransferRestrictions, + formatHypercertData, + Allowlist, +} from "@hypercerts-org/sdk"; + +const allowlist: Allowlist = [ + { address: "0x123", units: 100 }, + { address: "0xabc", units: 100 }, +]; +``` + +Then, call `createAllowlist` with the metadata and allowlist. + +```js +const { metadata } = formatHypercertData(...); +const totalUnits = "10000"; +const transferRestrictions = TransferRestrictions.FromCreatorOnly + +const { claimId } = await hypercerts.createAllowlist({ + allowList, + metaData, + totalUnits, + transferRestrictions: TransferRestrictions.FromCreatorOnly, +}); +``` + +> **note** We store the allowlist and the Merkle tree in the metadata of the Hypercert. To understand the Merkle tree generation and data structures, check out the [OpenZeppelin merkle tree library](https://github.com/OpenZeppelin/merkle-tree) + +It first checks if the client is writable and if the operator is a signer. If the operator is not a signer, it throws an `InvalidOrMissingError`. + +Next, it validates the allowlist and metadata by calling the `validateAllowlist` and `validateMetaData` functions respectively. If either the allowlist or metadata is invalid, it throws a `MalformedDataError`. + +Once the allowlist and metadata are validated, the method creates a Merkle tree from the allowlist and stores it on IPFS. It then stores the metadata on IPFS as well. + +Finally, the method invokes the `createAllowlist` function on the contract with the signer's `address`, the total number of `units`, the Merkle tree `root`, the metadata `CID`, and the `transfer restrictions`. If the method is called with `overrides`, it passes them to the createAllowlist function. + +## Claiming a fraction token + +Users can claim their fraction tokens for many hypercerts at once using `mintClaimFractionFromAllowlist`. To determine the input the following information is required: + +| Variable | Type | Source | +| -------- | ------------ | ------------ | +| claimId | BigNumberish | Hypercert ID | +| units | BigNumberish | Allowlist | +| proof | BytesLike[] | Merkle tree | + +We store the allowlist and the Merkle tree in the metadata of the Hypercert. To understand the Merkle tree data structures, check out the [OpenZeppelin merkle tree library](https://github.com/OpenZeppelin/merkle-tree). You can get the `proof` and `units` by traversing the merkle tree. + +Then, call `mintClaimFractionFromAllowlist` with the required data. The contracts will also verify the proofs. However, when providing the `root` in the function input, the proofs will be verified before a transaction is submitted. + +```js +import { StandardMerkleTree } from "@openzeppelin/merkle-tree"; + +const claimId = "0x822f17a9a5eecfd...85254363386255337"; +const address = "0xc0ffee254729296a45a3885639AC7E10F9d54979"; + +const { indexer, storage } = hypercertsClient; +const claimById = await indexer.claimById(claimId); +const { uri, tokenID: _id } = claimById.claim; +const metadata = await storage.getMetadata(uri || ""); +const treeResponse = await storage.getData(metadata.allowList); +const tree = StandardMerkleTree.load(JSON.parse(treeResponse)); + +let args; +// Find the proof in the allowlist +for (const [leaf, value] of tree.entries()) { + if (value[0] === address) { + args = { + proofs: tree.getProof(leaf), + units: Number(value[1]), + claimId: _id, + }; + break; + } +} + +// Mint fraction token +const tx = await hypercerts.mintClaimFractionFromAllowlist({ + ...args, +}); +``` + +Let's see what happens under the hood: + +First, the method checks that the client is not `read only` and that the operator is a signer. If not, it throws an `InvalidOrMissingError`. + +Next, the method verifies the Merkle `proof` using the OpenZeppelin Merkle tree library. If a `root` is provided, the method uses it to verify the proof. If the proof is invalid, it throws an error. + +Finally, the method calls the `mintClaimFromAllowlist` function on the contract with the signer `address`, Merkle `proof`, `claim ID`, and number of `units` as parameters. If overrides are provided, the method uses them to send the transaction. Otherwise, it sends the transaction without overrides. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/AllowlistMinter.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/AllowlistMinter.md new file mode 100644 index 00000000..4684053c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/AllowlistMinter.md @@ -0,0 +1,84 @@ +# AllowlistMinter + +_bitbeckers_ + +> Interface for hypercert token interactions + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### hasBeenClaimed + +```solidity +function hasBeenClaimed(uint256, bytes32) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | +| \_1 | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | + +## Events + +### AllowlistCreated + +```solidity +event AllowlistCreated(uint256 tokenID, bytes32 root) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| root | bytes32 | undefined | + +### LeafClaimed + +```solidity +event LeafClaimed(uint256 tokenID, bytes32 leaf) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +## Errors + +### DoesNotExist + +```solidity +error DoesNotExist() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/HypercertMinter.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/HypercertMinter.md new file mode 100644 index 00000000..518efa42 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/HypercertMinter.md @@ -0,0 +1,895 @@ +# HypercertMinter + +_bitbeckers_ + +> Contract for managing hypercert claims and whitelists + +Implementation of the HypercertTokenInterface using { SemiFungible1155 } as underlying token.This contract supports whitelisted minting via { AllowlistMinter }. + +_Wrapper contract to expose and chain functions._ + +## Methods + +### \_\_SemiFungible1155_init + +```solidity +function __SemiFungible1155_init() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### balanceOf + +```solidity +function balanceOf(address account, uint256 id) external view returns (uint256) +``` + +_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### balanceOfBatch + +```solidity +function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) +``` + +_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| accounts | address[] | undefined | +| ids | uint256[] | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | --------- | ----------- | +| \_0 | uint256[] | undefined | + +### batchBurnFraction + +```solidity +function batchBurnFraction(address _account, uint256[] _tokenIDs) external nonpayable +``` + +Burn a claimtoken + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ----------- | +| \_account | address | undefined | +| \_tokenIDs | uint256[] | undefined | + +### batchMintClaimsFromAllowlists + +```solidity +function batchMintClaimsFromAllowlists(address account, bytes32[][] proofs, uint256[] claimIDs, uint256[] units) external nonpayable +``` + +Mint semi-fungible tokens representing a fraction of the claims in `claimIDs` + +_Calls AllowlistMinter to verify `proofs`.Mints the `amount` of units for the hypercert stored under `claimIDs`_ + +#### Parameters + +| Name | Type | Description | +| -------- | ----------- | ----------- | +| account | address | undefined | +| proofs | bytes32[][] | undefined | +| claimIDs | uint256[] | undefined | +| units | uint256[] | undefined | + +### burn + +```solidity +function burn(address account, uint256 id, uint256) external nonpayable +``` + +Burn a claimtoken; override is needed to update units/values + +_see {ERC1155Burnable}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | +| \_2 | uint256 | undefined | + +### burnBatch + +```solidity +function burnBatch(address account, uint256[] ids, uint256[]) external nonpayable +``` + +Batch burn claimtokens; override is needed to update units/values + +_see {ERC1155Burnable}_ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| ids | uint256[] | undefined | +| \_2 | uint256[] | undefined | + +### burnFraction + +```solidity +function burnFraction(address _account, uint256 _tokenID) external nonpayable +``` + +Burn a claimtoken + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| \_account | address | undefined | +| \_tokenID | uint256 | undefined | + +### createAllowlist + +```solidity +function createAllowlist(address account, uint256 units, bytes32 merkleRoot, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Register a claim and the whitelist for minting token(s) belonging to that claim + +_Calls SemiFungible1155 to store the claim referenced in `uri` with amount of `units`Calls AllowlistMinter to store the `merkleRoot` as proof to authorize claims_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| merkleRoot | bytes32 | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### hasBeenClaimed + +```solidity +function hasBeenClaimed(uint256, bytes32) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | +| \_1 | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### initialize + +```solidity +function initialize() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | + +### isApprovedForAll + +```solidity +function isApprovedForAll(address account, address operator) external view returns (bool) +``` + +_See {IERC1155-isApprovedForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| account | address | undefined | +| operator | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### mergeFractions + +```solidity +function mergeFractions(address _account, uint256[] _fractionIDs) external nonpayable +``` + +Merge the value of tokens belonging to the same claim + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------- | --------- | ----------- | +| \_account | address | undefined | +| \_fractionIDs | uint256[] | undefined | + +### mintClaim + +```solidity +function mintClaim(address account, uint256 units, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Mint a semi-fungible token for the impact claim referenced via `uri` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### mintClaimFromAllowlist + +```solidity +function mintClaimFromAllowlist(address account, bytes32[] proof, uint256 claimID, uint256 units) external nonpayable +``` + +Mint a semi-fungible token representing a fraction of the claim + +_Calls AllowlistMinter to verify `proof`.Mints the `amount` of units for the hypercert stored under `claimID`_ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| units | uint256 | undefined | + +### mintClaimWithFractions + +```solidity +function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Mint semi-fungible tokens for the impact claim referenced via `uri` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| fractions | uint256[] | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### name + +```solidity +function name() external view returns (string) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +_Returns the address of the current owner._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownerOf + +```solidity +function ownerOf(uint256 tokenID) external view returns (address _owner) +``` + +_Returns the owner of a given token ID._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| tokenID | uint256 | The ID of the token to query. | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | -------------------------------------- | +| \_owner | address | The address of the owner of the token. | + +### pause + +```solidity +function pause() external nonpayable +``` + +PAUSABLE + +### paused + +```solidity +function paused() external view returns (bool) +``` + +_Returns true if the contract is paused, and false otherwise._ + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### proxiableUUID + +```solidity +function proxiableUUID() external view returns (bytes32) +``` + +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### readTransferRestriction + +```solidity +function readTransferRestriction(uint256 tokenID) external view returns (string) +``` + +TRANSFER RESTRICTIONS + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ + +### safeBatchTransferFrom + +```solidity +function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable +``` + +_See {IERC1155-safeBatchTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| ids | uint256[] | undefined | +| amounts | uint256[] | undefined | +| data | bytes | undefined | + +### safeTransferFrom + +```solidity +function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable +``` + +_See {IERC1155-safeTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| id | uint256 | undefined | +| amount | uint256 | undefined | +| data | bytes | undefined | + +### setApprovalForAll + +```solidity +function setApprovalForAll(address operator, bool approved) external nonpayable +``` + +_See {IERC1155-setApprovalForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | +| approved | bool | undefined | + +### splitFraction + +```solidity +function splitFraction(address _account, uint256 _tokenID, uint256[] _newFractions) external nonpayable +``` + +Split a claimtokens value into parts with summed value equal to the original + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| -------------- | --------- | ----------- | +| \_account | address | undefined | +| \_tokenID | uint256 | undefined | +| \_newFractions | uint256[] | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + +_See {IERC165-supportsInterface}._ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------ | ----------- | +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### unitsOf + +```solidity +function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) +``` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unitsOf + +```solidity +function unitsOf(uint256 tokenID) external view returns (uint256 units) +``` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unpause + +```solidity +function unpause() external nonpayable +``` + +### upgradeTo + +```solidity +function upgradeTo(address newImplementation) external nonpayable +``` + +_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | + +### upgradeToAndCall + +```solidity +function upgradeToAndCall(address newImplementation, bytes data) external payable +``` + +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string _uri) +``` + +_see { IHypercertMetadata}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------ | ----------- | +| \_uri | string | undefined | + +## Events + +### AdminChanged + +```solidity +event AdminChanged(address previousAdmin, address newAdmin) +``` + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | ----------- | +| previousAdmin | address | undefined | +| newAdmin | address | undefined | + +### AllowlistCreated + +```solidity +event AllowlistCreated(uint256 tokenID, bytes32 root) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| root | bytes32 | undefined | + +### ApprovalForAll + +```solidity +event ApprovalForAll(address indexed account, address indexed operator, bool approved) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| account `indexed` | address | undefined | +| operator `indexed` | address | undefined | +| approved | bool | undefined | + +### BatchValueTransfer + +```solidity +event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| claimIDs | uint256[] | undefined | +| fromTokenIDs | uint256[] | undefined | +| toTokenIDs | uint256[] | undefined | +| values | uint256[] | undefined | + +### BeaconUpgraded + +```solidity +event BeaconUpgraded(address indexed beacon) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| beacon `indexed` | address | undefined | + +### ClaimStored + +```solidity +event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| claimID `indexed` | uint256 | undefined | +| uri | string | undefined | +| totalUnits | uint256 | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ----- | ----------- | +| version | uint8 | undefined | + +### LeafClaimed + +```solidity +event LeafClaimed(uint256 tokenID, bytes32 leaf) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### Paused + +```solidity +event Paused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### TransferBatch + +```solidity +event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### TransferSingle + +```solidity +event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### URI + +```solidity +event URI(string value, uint256 indexed id) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | ------- | ----------- | +| value | string | undefined | +| id `indexed` | uint256 | undefined | + +### Unpaused + +```solidity +event Unpaused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### Upgraded + +```solidity +event Upgraded(address indexed implementation) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | + +### ValueTransfer + +```solidity +event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------- | +| claimID | uint256 | undefined | +| fromTokenID | uint256 | undefined | +| toTokenID | uint256 | undefined | +| value | uint256 | undefined | + +## Errors + +### AlreadyClaimed + +```solidity +error AlreadyClaimed() +``` + +### ArraySize + +```solidity +error ArraySize() +``` + +### DoesNotExist + +```solidity +error DoesNotExist() +``` + +### DuplicateEntry + +```solidity +error DuplicateEntry() +``` + +### Invalid + +```solidity +error Invalid() +``` + +### NotAllowed + +```solidity +error NotAllowed() +``` + +### NotApprovedOrOwner + +```solidity +error NotApprovedOrOwner() +``` + +### TransfersNotAllowed + +```solidity +error TransfersNotAllowed() +``` + +### TypeMismatch + +```solidity +error TypeMismatch() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/HypercertTrader.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/HypercertTrader.md new file mode 100644 index 00000000..e31e8840 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/HypercertTrader.md @@ -0,0 +1,434 @@ +# HypercertTrader + +_bitbeckers_ + +> Contract for managing hypercert trades + +Implementation of the HypercertTrader Interface + +## Methods + +### batchBuyUnits + +```solidity +function batchBuyUnits(address recipient, uint256[] offerIDs, uint256[] unitAmounts, address[] buyTokens, uint256[] tokenAmountsPerUnit) external payable +``` + +This function allows a user to buy Hypercert tokens from multiple existing offers in a single transaction. The function takes in several arrays of parameters, including the IDs of the offers to buy from, the number of units to buy for each offer, the tokens used for payment for each offer, and the amounts of tokens to pay per unit for each offer. The function then executes the trades and transfers the Hypercert tokens to the specified recipient. + +_Buys Hypercert tokens from multiple existing offers in a single transaction._ + +#### Parameters + +| Name | Type | Description | +| ------------------- | --------- | -------------------------------------------------------------------- | +| recipient | address | The address that will receive the Hypercert tokens. | +| offerIDs | uint256[] | The list of IDs of the offers to buy from. | +| unitAmounts | uint256[] | The list of numbers of units to buy for each offer. | +| buyTokens | address[] | The list of addresses of the tokens used for payment for each offer. | +| tokenAmountsPerUnit | uint256[] | The list of amounts of tokens to pay per unit for each offer. | + +### buyUnits + +```solidity +function buyUnits(address recipient, uint256 offerID, uint256 unitAmount, address buyToken, uint256 tokenAmountPerUnit) external payable +``` + +This function buys Hypercert tokens from an existing offer. The function verifies that the offer is valid and that the buyer has provided enough payment in the specified token. If the offer is for a fraction of a Hypercert token, the function splits the fraction and transfers the appropriate number of units to the buyer. If the offer is for a fixed number of units, the function transfers the units to the buyer. The function also transfers the payment to the offerer and emits a `Trade` event. + +_Buys Hypercert tokens from an existing offer._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | --------------------------------------------------- | +| recipient | address | The address that will receive the Hypercert tokens. | +| offerID | uint256 | The ID of the offer to buy from. | +| unitAmount | uint256 | The number of units to buy. | +| buyToken | address | The address of the token used for payment. | +| tokenAmountPerUnit | uint256 | The amount of tokens to pay per unit. | + +### cancelOffer + +```solidity +function cancelOffer(uint256 offerID) external nonpayable +``` + +This function cancels an existing offer. The function verifies that the offer exists and that the caller is the offerer. The function sets the offer status to `Cancelled` and emits an `OfferCancelled` event. + +_Cancels an existing offer._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------------ | +| offerID | uint256 | The ID of the offer to cancel. | + +### createOffer + +```solidity +function createOffer(address hypercertContract, uint256 fractionID, uint256 unitsForSale, uint256 minUnitsPerTrade, uint256 maxUnitsPerTrade, IHypercertTrader.AcceptedToken[] acceptedTokens) external payable returns (uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------- | -------------------------------- | ----------- | +| hypercertContract | address | undefined | +| fractionID | uint256 | undefined | +| unitsForSale | uint256 | undefined | +| minUnitsPerTrade | uint256 | undefined | +| maxUnitsPerTrade | uint256 | undefined | +| acceptedTokens | IHypercertTrader.AcceptedToken[] | undefined | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | ----------- | +| offerID | uint256 | undefined | + +### getOffer + +```solidity +function getOffer(uint256 offerID) external view returns (struct IHypercertTrader.Offer) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| offerID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------- | ----------- | +| \_0 | IHypercertTrader.Offer | undefined | + +### initialize + +```solidity +function initialize() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### offers + +```solidity +function offers(uint256) external view returns (address offerer, address hypercertContract, uint256 fractionID, uint256 unitsAvailable, uint256 minUnitsPerTrade, uint256 maxUnitsPerTrade, enum IHypercertTrader.OfferType offerType, enum IHypercertTrader.OfferStatus status) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----------------- | --------------------------------- | ----------- | +| offerer | address | undefined | +| hypercertContract | address | undefined | +| fractionID | uint256 | undefined | +| unitsAvailable | uint256 | undefined | +| minUnitsPerTrade | uint256 | undefined | +| maxUnitsPerTrade | uint256 | undefined | +| offerType | enum IHypercertTrader.OfferType | undefined | +| status | enum IHypercertTrader.OfferStatus | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +_Returns the address of the current owner._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### pause + +```solidity +function pause() external nonpayable +``` + +PAUSABLE + +### paused + +```solidity +function paused() external view returns (bool) +``` + +_Returns true if the contract is paused, and false otherwise._ + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### proxiableUUID + +```solidity +function proxiableUUID() external view returns (bytes32) +``` + +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ + +### totalUnitsForSale + +```solidity +function totalUnitsForSale(address, uint256) external view returns (uint256) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### unpause + +```solidity +function unpause() external nonpayable +``` + +### upgradeTo + +```solidity +function upgradeTo(address newImplementation) external nonpayable +``` + +_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | + +### upgradeToAndCall + +```solidity +function upgradeToAndCall(address newImplementation, bytes data) external payable +``` + +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | + +## Events + +### AdminChanged + +```solidity +event AdminChanged(address previousAdmin, address newAdmin) +``` + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | ----------- | +| previousAdmin | address | undefined | +| newAdmin | address | undefined | + +### BeaconUpgraded + +```solidity +event BeaconUpgraded(address indexed beacon) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| beacon `indexed` | address | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ----- | ----------- | +| version | uint8 | undefined | + +### OfferCancelled + +```solidity +event OfferCancelled(address indexed creator, address indexed hypercertContract, uint256 indexed fractionID, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| creator `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID `indexed` | uint256 | undefined | +| offerID | uint256 | undefined | + +### OfferCreated + +```solidity +event OfferCreated(address indexed offerer, address indexed hypercertContract, uint256 indexed fractionID, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| offerer `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID `indexed` | uint256 | undefined | +| offerID | uint256 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### Paused + +```solidity +event Paused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### Trade + +```solidity +event Trade(address indexed seller, address indexed buyer, address indexed hypercertContract, uint256 fractionID, uint256 unitsBought, address buyToken, uint256 tokenAmountPerUnit, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| seller `indexed` | address | undefined | +| buyer `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID | uint256 | undefined | +| unitsBought | uint256 | undefined | +| buyToken | address | undefined | +| tokenAmountPerUnit | uint256 | undefined | +| offerID | uint256 | undefined | + +### Unpaused + +```solidity +event Unpaused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### Upgraded + +```solidity +event Upgraded(address indexed implementation) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | + +## Errors + +### InvalidBuy + +```solidity +error InvalidBuy(string) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### InvalidOffer + +```solidity +error InvalidOffer(string) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### NotAllowed + +```solidity +error NotAllowed() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/IHypercertMinter.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/IHypercertMinter.md new file mode 100644 index 00000000..13a84632 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/IHypercertMinter.md @@ -0,0 +1,39 @@ +# IHypercertMinter + +## Methods + +### ownerOf + +```solidity +function ownerOf(uint256 id) external view returns (address) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### unitsOf + +```solidity +function unitsOf(uint256 id) external view returns (uint256) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/SemiFungible1155.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/SemiFungible1155.md new file mode 100644 index 00000000..a4086e37 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/SemiFungible1155.md @@ -0,0 +1,457 @@ +# SemiFungible1155 + +_bitbeckers_ + +> Contract for minting semi-fungible EIP1155 tokens + +Extends { Upgradeable1155 } token with semi-fungible properties and the concept of `units` + +_Adds split bit strategy as described in [EIP-1155](https://eips.ethereum.org/EIPS/eip-1155#non-fungible-tokens)_ + +## Methods + +### \_\_SemiFungible1155_init + +```solidity +function __SemiFungible1155_init() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### balanceOf + +```solidity +function balanceOf(address account, uint256 id) external view returns (uint256) +``` + +_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### balanceOfBatch + +```solidity +function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) +``` + +_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| accounts | address[] | undefined | +| ids | uint256[] | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | --------- | ----------- | +| \_0 | uint256[] | undefined | + +### burn + +```solidity +function burn(address account, uint256 id, uint256 value) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### burnBatch + +```solidity +function burnBatch(address account, uint256[] ids, uint256[] values) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### isApprovedForAll + +```solidity +function isApprovedForAll(address account, address operator) external view returns (bool) +``` + +_See {IERC1155-isApprovedForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| account | address | undefined | +| operator | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +_Returns the address of the current owner._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownerOf + +```solidity +function ownerOf(uint256 tokenID) external view returns (address _owner) +``` + +_Returns the owner of a given token ID._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| tokenID | uint256 | The ID of the token to query. | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | -------------------------------------- | +| \_owner | address | The address of the owner of the token. | + +### proxiableUUID + +```solidity +function proxiableUUID() external view returns (bytes32) +``` + +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ + +### safeBatchTransferFrom + +```solidity +function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable +``` + +_See {IERC1155-safeBatchTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| ids | uint256[] | undefined | +| amounts | uint256[] | undefined | +| data | bytes | undefined | + +### safeTransferFrom + +```solidity +function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable +``` + +_See {IERC1155-safeTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| id | uint256 | undefined | +| amount | uint256 | undefined | +| data | bytes | undefined | + +### setApprovalForAll + +```solidity +function setApprovalForAll(address operator, bool approved) external nonpayable +``` + +_See {IERC1155-setApprovalForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | +| approved | bool | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + +_See {IERC165-supportsInterface}._ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------ | ----------- | +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### upgradeTo + +```solidity +function upgradeTo(address newImplementation) external nonpayable +``` + +_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | + +### upgradeToAndCall + +```solidity +function upgradeToAndCall(address newImplementation, bytes data) external payable +``` + +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string _uri) +``` + +_Returns the metadata URI for a given token ID.This function retrieves the metadata URI for the specified token ID by calling the `uri` function of the `ERC1155URIStorageUpgradeable` contract.The metadata URI is a string that points to a JSON file containing information about the token, such as its name, symbol, and image.This function always returns the URI for the basetype so that it's managed in one place._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------------------------------- | +| tokenID | uint256 | The ID of the token to retrieve the metadata URI for. | + +#### Returns + +| Name | Type | Description | +| ----- | ------ | -------------------------------------------- | +| \_uri | string | The metadata URI for the specified token ID. | + +## Events + +### AdminChanged + +```solidity +event AdminChanged(address previousAdmin, address newAdmin) +``` + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | ----------- | +| previousAdmin | address | undefined | +| newAdmin | address | undefined | + +### ApprovalForAll + +```solidity +event ApprovalForAll(address indexed account, address indexed operator, bool approved) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| account `indexed` | address | undefined | +| operator `indexed` | address | undefined | +| approved | bool | undefined | + +### BatchValueTransfer + +```solidity +event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) +``` + +_Emitted on transfer of `values` between `fromTokenIDs` to `toTokenIDs` of `claimIDs`_ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| claimIDs | uint256[] | undefined | +| fromTokenIDs | uint256[] | undefined | +| toTokenIDs | uint256[] | undefined | +| values | uint256[] | undefined | + +### BeaconUpgraded + +```solidity +event BeaconUpgraded(address indexed beacon) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| beacon `indexed` | address | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ----- | ----------- | +| version | uint8 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### TransferBatch + +```solidity +event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### TransferSingle + +```solidity +event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### URI + +```solidity +event URI(string value, uint256 indexed id) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | ------- | ----------- | +| value | string | undefined | +| id `indexed` | uint256 | undefined | + +### Upgraded + +```solidity +event Upgraded(address indexed implementation) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | + +### ValueTransfer + +```solidity +event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) +``` + +_Emitted on transfer of `value` between `fromTokenID` to `toTokenID` of the same `claimID`_ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------- | +| claimID | uint256 | undefined | +| fromTokenID | uint256 | undefined | +| toTokenID | uint256 | undefined | +| value | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/ainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/ainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.md new file mode 100644 index 00000000..6be07157 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/ainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.md @@ -0,0 +1,77 @@ +# AggregatorV3Interface + +## Methods + +### decimals + +```solidity +function decimals() external view returns (uint8) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ----- | ----------- | +| \_0 | uint8 | undefined | + +### description + +```solidity +function description() external view returns (string) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### getRoundData + +```solidity +function getRoundData(uint80 _roundId) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) +``` + +#### Parameters + +| Name | Type | Description | +| --------- | ------ | ----------- | +| \_roundId | uint80 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| roundId | uint80 | undefined | +| answer | int256 | undefined | +| startedAt | uint256 | undefined | +| updatedAt | uint256 | undefined | +| answeredInRound | uint80 | undefined | + +### latestRoundData + +```solidity +function latestRoundData() external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) +``` + +#### Returns + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| roundId | uint80 | undefined | +| answer | int256 | undefined | +| startedAt | uint256 | undefined | +| updatedAt | uint256 | undefined | +| answeredInRound | uint80 | undefined | + +### version + +```solidity +function version() external view returns (uint256) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/forge-std/src/console.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/forge-std/src/console.md new file mode 100644 index 00000000..8d14ad8c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/forge-std/src/console.md @@ -0,0 +1 @@ +# console diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/forge-std/src/console2.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/forge-std/src/console2.md new file mode 100644 index 00000000..cb666cd3 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/forge-std/src/console2.md @@ -0,0 +1,3 @@ +# console2 + +_The original console.sol uses `int` and `uint` for computing function selectors, but it should use `int256` and `uint256`. This modified version fixes that. This version is recommended over `console.sol` if you don't need compatibility with Hardhat as the logs will show up in forge stack traces. If you do need compatibility with Hardhat, you must use `console.sol`. Reference: https://github.com/NomicFoundation/hardhat/issues/2178_ diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/interfaces/IAllowlist.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/interfaces/IAllowlist.md new file mode 100644 index 00000000..72455b43 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/interfaces/IAllowlist.md @@ -0,0 +1,29 @@ +# IAllowlist + +_bitbeckers_ + +> Interface for allowlist + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 tokenID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/interfaces/IHypercertToken.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/interfaces/IHypercertToken.md new file mode 100644 index 00000000..30ed6f95 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/interfaces/IHypercertToken.md @@ -0,0 +1,192 @@ +# IHypercertToken + +_bitbeckers_ + +> Interface for hypercert token interactions + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### batchBurnFraction + +```solidity +function batchBurnFraction(address account, uint256[] tokenIDs) external nonpayable +``` + +Operator must be allowed by `creator` and the tokens must represent the total amount of available units. + +_Function to burn the tokens at `tokenIDs` for `account`_ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenIDs | uint256[] | undefined | + +### burnFraction + +```solidity +function burnFraction(address account, uint256 tokenID) external nonpayable +``` + +Operator must be allowed by `creator` and the token must represent the total amount of available units. + +_Function to burn the token at `tokenID` for `account`_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +### mergeFractions + +```solidity +function mergeFractions(address account, uint256[] tokenIDs) external nonpayable +``` + +Tokens that have been merged are burned. + +_Function called to merge tokens within `tokenIDs`._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenIDs | uint256[] | undefined | + +### mintClaim + +```solidity +function mintClaim(address account, uint256 units, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +_Function called to store a claim referenced via `uri` with a maximum number of fractions `units`._ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### mintClaimWithFractions + +```solidity +function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +_Function called to store a claim referenced via `uri` with a set of `fractions`.Fractions are internally summed to total units._ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| fractions | uint256[] | undefined | +| uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### splitFraction + +```solidity +function splitFraction(address account, uint256 tokenID, uint256[] _values) external nonpayable +``` + +The sum of `values` must equal the current value of `_tokenID`. + +_Function called to split `tokenID` owned by `account` into units declared in `values`._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | +| \_values | uint256[] | undefined | + +### unitsOf + +```solidity +function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) +``` + +_Returns the `units` held by `account` of a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` held by `account` for the claim is returned.If `tokenID` is a fractional token, the `units` held by `account` the token is returned_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unitsOf + +```solidity +function unitsOf(uint256 tokenID) external view returns (uint256 units) +``` + +_Returns the `units` held by a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` for the claim is returned.If `tokenID` is a fractional token, the `units` held by the token is returned_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string metadata) +``` + +_Returns the `uri` for metadata of the claim represented by `tokenID`Metadata must conform to { Hypercert Metadata } spec (based on ERC1155 Metadata)_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------ | ----------- | +| metadata | string | undefined | + +## Events + +### ClaimStored + +```solidity +event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) +``` + +_Emitted when token with tokenID `claimID` is stored, with external data reference via `uri`._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| claimID `indexed` | uint256 | undefined | +| uri | string | undefined | +| totalUnits | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/interfaces/IHypercertTrader.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/interfaces/IHypercertTrader.md new file mode 100644 index 00000000..06fb700c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/interfaces/IHypercertTrader.md @@ -0,0 +1,133 @@ +# IHypercertTrader + +_bitbeckers_ + +> Interface for hypercert token trading + +This interface declares the required functionality to interact with the hypercert marketplace + +## Methods + +### batchBuyUnits + +```solidity +function batchBuyUnits(address recipient, uint256[] offerIDs, uint256[] unitAmounts, address[] buyTokens, uint256[] tokenAmountsPerUnit) external payable +``` + +_Buys Hypercert tokens from multiple existing offers in a single transaction._ + +#### Parameters + +| Name | Type | Description | +| ------------------- | --------- | -------------------------------------------------------------------- | +| recipient | address | The address that will receive the Hypercert tokens. | +| offerIDs | uint256[] | The list of IDs of the offers to buy from. | +| unitAmounts | uint256[] | The list of numbers of units to buy for each offer. | +| buyTokens | address[] | The list of addresses of the tokens used for payment for each offer. | +| tokenAmountsPerUnit | uint256[] | The list of amounts of tokens to pay per unit for each offer. | + +### buyUnits + +```solidity +function buyUnits(address recipient, uint256 offerID, uint256 unitAmount, address buyToken, uint256 tokenAmountPerUnit) external payable +``` + +_Buys Hypercert tokens from an existing offer._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | --------------------------------------------------- | +| recipient | address | The address that will receive the Hypercert tokens. | +| offerID | uint256 | The ID of the offer to buy from. | +| unitAmount | uint256 | The number of units to buy. | +| buyToken | address | The address of the token used for payment. | +| tokenAmountPerUnit | uint256 | The amount of tokens to pay per unit. | + +### cancelOffer + +```solidity +function cancelOffer(uint256 offerID) external nonpayable +``` + +_Cancels an existing offer._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ------------------------------ | +| offerID | uint256 | The ID of the offer to cancel. | + +### createOffer + +```solidity +function createOffer(address hypercertContract, uint256 fractionID, uint256 units, uint256 minUnitsPerTrade, uint256 maxUnitsPerTrade, IHypercertTrader.AcceptedToken[] acceptedTokens) external payable returns (uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------- | -------------------------------- | ----------- | +| hypercertContract | address | undefined | +| fractionID | uint256 | undefined | +| units | uint256 | undefined | +| minUnitsPerTrade | uint256 | undefined | +| maxUnitsPerTrade | uint256 | undefined | +| acceptedTokens | IHypercertTrader.AcceptedToken[] | undefined | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | ----------- | +| offerID | uint256 | undefined | + +## Events + +### OfferCancelled + +```solidity +event OfferCancelled(address indexed creator, address indexed hypercertContract, uint256 indexed fractionID, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| creator `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID `indexed` | uint256 | undefined | +| offerID | uint256 | undefined | + +### OfferCreated + +```solidity +event OfferCreated(address indexed offerer, address indexed hypercertContract, uint256 indexed fractionID, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| offerer `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID `indexed` | uint256 | undefined | +| offerID | uint256 | undefined | + +### Trade + +```solidity +event Trade(address indexed seller, address indexed buyer, address indexed hypercertContract, uint256 fractionID, uint256 unitsBought, address buyToken, uint256 tokenAmountPerUnit, uint256 offerID) +``` + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ------- | ----------- | +| seller `indexed` | address | undefined | +| buyer `indexed` | address | undefined | +| hypercertContract `indexed` | address | undefined | +| fractionID | uint256 | undefined | +| unitsBought | uint256 | undefined | +| buyToken | address | undefined | +| tokenAmountPerUnit | uint256 | undefined | +| offerID | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/libs/Errors.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/libs/Errors.md new file mode 100644 index 00000000..93fe0124 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/libs/Errors.md @@ -0,0 +1,59 @@ +# Errors + +_bitbeckers_ + +## Errors + +### AlreadyClaimed + +```solidity +error AlreadyClaimed() +``` + +### ArraySize + +```solidity +error ArraySize() +``` + +### DoesNotExist + +```solidity +error DoesNotExist() +``` + +### DuplicateEntry + +```solidity +error DuplicateEntry() +``` + +### Invalid + +```solidity +error Invalid() +``` + +### NotAllowed + +```solidity +error NotAllowed() +``` + +### NotApprovedOrOwner + +```solidity +error NotApprovedOrOwner() +``` + +### TransfersNotAllowed + +```solidity +error TransfersNotAllowed() +``` + +### TypeMismatch + +```solidity +error TypeMismatch() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md new file mode 100644 index 00000000..4cb96bfc --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md @@ -0,0 +1,46 @@ +# BatchOrderTypehashRegistry + +_LooksRare protocol team (👀,💎)_ + +> BatchOrderTypehashRegistry + +The contract generates the batch order hash that is used to compute the digest for signature verification. + +## Methods + +### hashBatchOrder + +```solidity +function hashBatchOrder(bytes32 root, uint256 proofLength) external pure returns (bytes32 batchOrderHash) +``` + +This function returns the hash of the concatenation of batch order type hash and merkle root. + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ------------------- | +| root | bytes32 | Merkle root | +| proofLength | uint256 | Merkle proof length | + +#### Returns + +| Name | Type | Description | +| -------------- | ------- | -------------------- | +| batchOrderHash | bytes32 | The batch order hash | + +## Errors + +### MerkleProofTooLarge + +```solidity +error MerkleProofTooLarge(uint256 length) +``` + +It is returned if the length of the merkle proof provided is greater than tolerated. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ------------ | +| length | uint256 | Proof length | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md new file mode 100644 index 00000000..a32aef65 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md @@ -0,0 +1,76 @@ +# CreatorFeeManagerWithRebates + +_LooksRare protocol team (👀,💎)_ + +> CreatorFeeManagerWithRebates + +This contract returns the creator fee address and the creator rebate amount. + +## Methods + +### STANDARD_ROYALTY_FEE_BP + +```solidity +function STANDARD_ROYALTY_FEE_BP() external view returns (uint256) +``` + +Standard royalty fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### royaltyFeeRegistry + +```solidity +function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry) +``` + +Royalty fee registry interface. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | contract IRoyaltyFeeRegistry | undefined | + +### viewCreatorFeeInfo + +```solidity +function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) +``` + +This function returns the creator address and calculates the creator fee amount. + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| price | uint256 | Transaction price | +| itemIds | uint256[] | Array of item ids | + +#### Returns + +| Name | Type | Description | +| ---------------- | ------- | ------------------ | +| creator | address | Creator address | +| creatorFeeAmount | uint256 | Creator fee amount | + +## Errors + +### BundleEIP2981NotAllowed + +```solidity +error BundleEIP2981NotAllowed(address collection) +``` + +It is returned if the bundle contains multiple itemIds with different creator fee structure. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| collection | address | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md new file mode 100644 index 00000000..41cab900 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md @@ -0,0 +1,64 @@ +# CreatorFeeManagerWithRoyalties + +_LooksRare protocol team (👀,💎)_ + +> CreatorFeeManagerWithRoyalties + +This contract returns the creator fee address and the creator fee amount. + +## Methods + +### royaltyFeeRegistry + +```solidity +function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry) +``` + +Royalty fee registry interface. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | contract IRoyaltyFeeRegistry | undefined | + +### viewCreatorFeeInfo + +```solidity +function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) +``` + +This function returns the creator address and calculates the creator fee amount. + +_There are two on-chain sources for the royalty fee to distribute. 1. RoyaltyFeeRegistry: It is an on-chain registry where creator fee is defined for all items of a collection. 2. ERC2981: The NFT Royalty Standard where royalty fee is defined at a itemId level in a collection. The on-chain logic looks up the registry first. If it does not find anything, it checks if a collection is ERC2981. If so, it fetches the proper royalty information for the itemId. For a bundle that contains multiple itemIds (for a collection using ERC2981), if the royalty fee/recipient differ among the itemIds part of the bundle, the trade reverts. This contract DOES NOT enforce any restriction for extremely high creator fee, nor verifies the creator fee fetched is inferior to the total price. If any contract relies on it to build an on-chain royalty logic, it should implement protection against: (1) high royalties (2) potential unexpected royalty changes that can occur after the creation of the order._ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| price | uint256 | Transaction price | +| itemIds | uint256[] | Array of item ids | + +#### Returns + +| Name | Type | Description | +| ---------------- | ------- | ------------------ | +| creator | address | Creator address | +| creatorFeeAmount | uint256 | Creator fee amount | + +## Errors + +### BundleEIP2981NotAllowed + +```solidity +error BundleEIP2981NotAllowed(address collection) +``` + +It is returned if the bundle contains multiple itemIds with different creator fee structure. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| collection | address | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/CurrencyManager.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/CurrencyManager.md new file mode 100644 index 00000000..9ff1c0fc --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/CurrencyManager.md @@ -0,0 +1,250 @@ +# CurrencyManager + +_LooksRare protocol team (👀,💎)_ + +> CurrencyManager + +This contract manages the list of valid fungible currencies. + +## Methods + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +## Errors + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/ExecutionManager.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/ExecutionManager.md new file mode 100644 index 00000000..83eefc37 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/ExecutionManager.md @@ -0,0 +1,751 @@ +# ExecutionManager + +_LooksRare protocol team (👀,💎); bitbeckers;_ + +> ExecutionManager + +This contract handles the execution and resolution of transactions. A transaction is executed on-chain when an off-chain maker order is matched by on-chain taker order of a different kind. For instance, a taker ask is executed against a maker bid (or a taker bid against a maker ask). + +## Methods + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### addStrategy + +```solidity +function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable +``` + +This function allows the owner to add a new execution strategy to the protocol. + +_Strategies have an id that is incremental. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------- | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the strategy | +| isMakerBid | bool | Whether the function selector is for maker bid | +| implementation | address | Implementation address | + +### cancelOrderNonces + +```solidity +function cancelOrderNonces(uint256[] orderNonces) external nonpayable +``` + +This function allows a user to cancel an array of order nonces. + +_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | --------------------- | +| orderNonces | uint256[] | Array of order nonces | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### cancelSubsetNonces + +```solidity +function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable +``` + +This function allows a user to cancel an array of subset nonces. + +_It does not check the status of the nonces to save gas._ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ---------------------- | +| subsetNonces | uint256[] | Array of subset nonces | + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### creatorFeeManager + +```solidity +function creatorFeeManager() external view returns (contract ICreatorFeeManager) +``` + +Creator fee manager. + +#### Returns + +| Name | Type | Description | +| ---- | --------------------------- | ----------- | +| \_0 | contract ICreatorFeeManager | undefined | + +### incrementBidAskNonces + +```solidity +function incrementBidAskNonces(bool bid, bool ask) external nonpayable +``` + +This function increments a user's bid/ask nonces. + +_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | --------------------------------------- | +| bid | bool | Whether to increment the user bid nonce | +| ask | bool | Whether to increment the user ask nonce | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### maxCreatorFeeBp + +```solidity +function maxCreatorFeeBp() external view returns (uint16) +``` + +Maximum creator fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | uint16 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### protocolFeeRecipient + +```solidity +function protocolFeeRecipient() external view returns (address) +``` + +Protocol fee recipient. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### strategyInfo + +```solidity +function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +This returns the strategy information for a strategy id. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### updateCreatorFeeManager + +```solidity +function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable +``` + +This function allows the owner to update the creator fee manager address. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ---------------------------------- | +| newCreatorFeeManager | address | Address of the creator fee manager | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +### updateMaxCreatorFeeBp + +```solidity +function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable +``` + +This function allows the owner to update the maximum creator fee (in basis point). + +_The maximum value that can be set is 25%. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------ | ---------------------------------------- | +| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | + +### updateProtocolFeeRecipient + +```solidity +function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable +``` + +This function allows the owner to update the protocol fee recipient. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ---------------------------------- | +| newProtocolFeeRecipient | address | New protocol fee recipient address | + +### updateStrategy + +```solidity +function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable +``` + +This function allows the owner to update parameters for an existing execution strategy. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------------------ | +| strategyId | uint256 | Strategy id | +| isActive | bool | Whether the strategy must be active | +| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | +| newMinTotalFee | uint16 | New minimum total fee (in basis point) | + +### userBidAskNonces + +```solidity +function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) +``` + +This tracks the bid and ask nonces for a user address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------- | ----------- | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### userOrderNonce + +```solidity +function userOrderNonce(address, uint256) external view returns (bytes32) +``` + +This checks whether the order nonce for a user was executed or cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### userSubsetNonce + +```solidity +function userSubsetNonce(address, uint256) external view returns (bool) +``` + +This checks whether the subset nonce for a user was cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| user | address | undefined | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### NewCreatorFeeManager + +```solidity +event NewCreatorFeeManager(address creatorFeeManager) +``` + +It is issued when there is a new creator fee manager. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| creatorFeeManager | address | undefined | + +### NewMaxCreatorFeeBp + +```solidity +event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) +``` + +It is issued when there is a new maximum creator fee (in basis point). + +#### Parameters + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| maxCreatorFeeBp | uint256 | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### NewProtocolFeeRecipient + +```solidity +event NewProtocolFeeRecipient(address protocolFeeRecipient) +``` + +It is issued when there is a new protocol fee recipient address. + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ----------- | +| protocolFeeRecipient | address | undefined | + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ----------- | +| user | address | undefined | +| orderNonces | uint256[] | undefined | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| user | address | undefined | +| subsetNonces | uint256[] | undefined | + +## Errors + +### CreatorFeeBpTooHigh + +```solidity +error CreatorFeeBpTooHigh() +``` + +It is returned if the creator fee (in basis point) is too high. + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### NewProtocolFeeRecipientCannotBeNullAddress + +```solidity +error NewProtocolFeeRecipientCannotBeNullAddress() +``` + +It is returned if the new protocol fee recipient is set to address(0). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NoSelectorForStrategy + +```solidity +error NoSelectorForStrategy() +``` + +It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### OutsideOfTimeRange + +```solidity +error OutsideOfTimeRange() +``` + +It is returned if the current block timestamp is not between start and end times in the maker order. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotAvailable + +```solidity +error StrategyNotAvailable(uint256 strategyId) +``` + +It is returned if the strategy id has no implementation. + +_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| strategyId | uint256 | undefined | + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/InheritedStrategy.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/InheritedStrategy.md new file mode 100644 index 00000000..022cce57 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/InheritedStrategy.md @@ -0,0 +1,9 @@ +# InheritedStrategy + +_LooksRare protocol team (👀,💎)_ + +> InheritedStrategy + +This contract handles the verification of parameters for standard transactions. It does not verify the taker struct's itemIds and amounts array as well as minPrice (taker ask) / maxPrice (taker bid) because before the taker executes the transaction and the maker itemIds/amounts/price should have already been confirmed off-chain. + +_A standard transaction (bid or ask) is mapped to strategyId = 0._ diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/LooksRareProtocol.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/LooksRareProtocol.md new file mode 100644 index 00000000..cc542c7e --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/LooksRareProtocol.md @@ -0,0 +1,1157 @@ +# LooksRareProtocol + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> LooksRareProtocol + +This contract is the core smart contract of the LooksRare protocol ("v2"). It is the main entry point for users to initiate transactions with taker orders and manage the cancellation of maker orders, which exist off-chain. ~~~~~~ ~~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~~~~~~~ ~~~~ ~~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~ ~~~~~~~ ~~~ ~~~- ~~~~~~~~ ~~~~ ~~~ ~~~~ ~~~~ ~~~ ~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~~ ~~~ ~~~ ~~~~~ ~~~ ~~~~~~ ~~~~~~ ~~~ ~~~~~ ~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~~~ ~~~~~~ ~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~ ~~~~~ ~~~ ~~~~~~ ~~~~~~ ~~~ ~~~~~ ~~~ ~~~ ~~~~~~~~~~ ~~~ ~~~ ~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~ ~~~ ~~~~ ~~~~ ~~~ ~~~~ ~~~~~~~~ ~~~~ ~~~ ~~~~~~~ ~~~~~~~ ~~~ ~~~ ~~~~~~~~ ~~~~ ~~~~ ~~~~~~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~~ ~~~~~~ + +## Methods + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### WETH + +```solidity +function WETH() external view returns (address) +``` + +Wrapped ETH. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### addStrategy + +```solidity +function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable +``` + +This function allows the owner to add a new execution strategy to the protocol. + +_Strategies have an id that is incremental. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------- | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the strategy | +| isMakerBid | bool | Whether the function selector is for maker bid | +| implementation | address | Implementation address | + +### cancelOrderNonces + +```solidity +function cancelOrderNonces(uint256[] orderNonces) external nonpayable +``` + +This function allows a user to cancel an array of order nonces. + +_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | --------------------- | +| orderNonces | uint256[] | Array of order nonces | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### cancelSubsetNonces + +```solidity +function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable +``` + +This function allows a user to cancel an array of subset nonces. + +_It does not check the status of the nonces to save gas._ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ---------------------- | +| subsetNonces | uint256[] | Array of subset nonces | + +### chainId + +```solidity +function chainId() external view returns (uint256) +``` + +Current chainId. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### creatorFeeManager + +```solidity +function creatorFeeManager() external view returns (contract ICreatorFeeManager) +``` + +Creator fee manager. + +#### Returns + +| Name | Type | Description | +| ---- | --------------------------- | ----------- | +| \_0 | contract ICreatorFeeManager | undefined | + +### domainSeparator + +```solidity +function domainSeparator() external view returns (bytes32) +``` + +Current domain separator. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### executeMultipleTakerBids + +```solidity +function executeMultipleTakerBids(OrderStructs.Taker[] takerBids, OrderStructs.Maker[] makerAsks, bytes[] makerSignatures, OrderStructs.MerkleTree[] merkleTrees, bool isAtomic) external payable +``` + +#### Parameters + +| Name | Type | Description | +| --------------- | ------------------------- | ----------- | +| takerBids | OrderStructs.Taker[] | undefined | +| makerAsks | OrderStructs.Maker[] | undefined | +| makerSignatures | bytes[] | undefined | +| merkleTrees | OrderStructs.MerkleTree[] | undefined | +| isAtomic | bool | undefined | + +### executeTakerAsk + +```solidity +function executeTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +### executeTakerBid + +```solidity +function executeTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external payable +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +### hashBatchOrder + +```solidity +function hashBatchOrder(bytes32 root, uint256 proofLength) external pure returns (bytes32 batchOrderHash) +``` + +This function returns the hash of the concatenation of batch order type hash and merkle root. + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ------------------- | +| root | bytes32 | Merkle root | +| proofLength | uint256 | Merkle proof length | + +#### Returns + +| Name | Type | Description | +| -------------- | ------- | -------------------- | +| batchOrderHash | bytes32 | The batch order hash | + +### incrementBidAskNonces + +```solidity +function incrementBidAskNonces(bool bid, bool ask) external nonpayable +``` + +This function increments a user's bid/ask nonces. + +_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | --------------------------------------- | +| bid | bool | Whether to increment the user bid nonce | +| ask | bool | Whether to increment the user ask nonce | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### maxCreatorFeeBp + +```solidity +function maxCreatorFeeBp() external view returns (uint16) +``` + +Maximum creator fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | uint16 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### protocolFeeRecipient + +```solidity +function protocolFeeRecipient() external view returns (address) +``` + +Protocol fee recipient. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### restrictedExecuteTakerBid + +```solidity +function restrictedExecuteTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, address sender, bytes32 orderHash) external nonpayable returns (uint256 protocolFeeAmount) +``` + +#### Parameters + +| Name | Type | Description | +| --------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | +| sender | address | undefined | +| orderHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| protocolFeeAmount | uint256 | undefined | + +### strategyInfo + +```solidity +function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +This returns the strategy information for a strategy id. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### transferManager + +```solidity +function transferManager() external view returns (contract TransferManager) +``` + +Transfer manager for ERC721, ERC1155 and Hypercerts. + +#### Returns + +| Name | Type | Description | +| ---- | ------------------------ | ----------- | +| \_0 | contract TransferManager | undefined | + +### updateCreatorFeeManager + +```solidity +function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable +``` + +This function allows the owner to update the creator fee manager address. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ---------------------------------- | +| newCreatorFeeManager | address | Address of the creator fee manager | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +### updateDomainSeparator + +```solidity +function updateDomainSeparator() external nonpayable +``` + +This function allows the owner to update the domain separator (if possible). + +_Only callable by owner. If there is a fork of the network with a new chainId, it allows the owner to reset the domain separator for the new chain id._ + +### updateETHGasLimitForTransfer + +```solidity +function updateETHGasLimitForTransfer(uint256 newGasLimitETHTransfer) external nonpayable +``` + +This function allows the owner to update the maximum ETH gas limit for a standard transfer. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------ | +| newGasLimitETHTransfer | uint256 | New gas limit for ETH transfer | + +### updateMaxCreatorFeeBp + +```solidity +function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable +``` + +This function allows the owner to update the maximum creator fee (in basis point). + +_The maximum value that can be set is 25%. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------ | ---------------------------------------- | +| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | + +### updateProtocolFeeRecipient + +```solidity +function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable +``` + +This function allows the owner to update the protocol fee recipient. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ---------------------------------- | +| newProtocolFeeRecipient | address | New protocol fee recipient address | + +### updateStrategy + +```solidity +function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable +``` + +This function allows the owner to update parameters for an existing execution strategy. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------------------ | +| strategyId | uint256 | Strategy id | +| isActive | bool | Whether the strategy must be active | +| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | +| newMinTotalFee | uint16 | New minimum total fee (in basis point) | + +### userBidAskNonces + +```solidity +function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) +``` + +This tracks the bid and ask nonces for a user address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------- | ----------- | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### userOrderNonce + +```solidity +function userOrderNonce(address, uint256) external view returns (bytes32) +``` + +This checks whether the order nonce for a user was executed or cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### userSubsetNonce + +```solidity +function userSubsetNonce(address, uint256) external view returns (bool) +``` + +This checks whether the subset nonce for a user was cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| user | address | undefined | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### NewCreatorFeeManager + +```solidity +event NewCreatorFeeManager(address creatorFeeManager) +``` + +It is issued when there is a new creator fee manager. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| creatorFeeManager | address | undefined | + +### NewDomainSeparator + +```solidity +event NewDomainSeparator() +``` + +It is emitted if there is a change in the domain separator. + +### NewGasLimitETHTransfer + +```solidity +event NewGasLimitETHTransfer(uint256 gasLimitETHTransfer) +``` + +It is emitted when there is a new gas limit for a ETH transfer (before it is wrapped to WETH). + +#### Parameters + +| Name | Type | Description | +| ------------------- | ------- | ----------- | +| gasLimitETHTransfer | uint256 | undefined | + +### NewMaxCreatorFeeBp + +```solidity +event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) +``` + +It is issued when there is a new maximum creator fee (in basis point). + +#### Parameters + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| maxCreatorFeeBp | uint256 | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### NewProtocolFeeRecipient + +```solidity +event NewProtocolFeeRecipient(address protocolFeeRecipient) +``` + +It is issued when there is a new protocol fee recipient address. + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ----------- | +| protocolFeeRecipient | address | undefined | + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ----------- | +| user | address | undefined | +| orderNonces | uint256[] | undefined | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| user | address | undefined | +| subsetNonces | uint256[] | undefined | + +### TakerAsk + +```solidity +event TakerAsk(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address askUser, address bidUser, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) +``` + +It is emitted when a taker ask transaction is completed. + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ---------------------------------------------- | ----------- | +| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | undefined | +| askUser | address | undefined | +| bidUser | address | undefined | +| strategyId | uint256 | undefined | +| currency | address | undefined | +| collection | address | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| feeRecipients | address[2] | undefined | +| feeAmounts | uint256[3] | undefined | + +### TakerBid + +```solidity +event TakerBid(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address bidUser, address bidRecipient, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) +``` + +It is emitted when a taker bid transaction is completed. + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ---------------------------------------------- | ----------- | +| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | undefined | +| bidUser | address | undefined | +| bidRecipient | address | undefined | +| strategyId | uint256 | undefined | +| currency | address | undefined | +| collection | address | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| feeRecipients | address[2] | undefined | +| feeAmounts | uint256[3] | undefined | + +## Errors + +### CallerInvalid + +```solidity +error CallerInvalid() +``` + +It is returned if the function cannot be called by the sender. + +### ChainIdInvalid + +```solidity +error ChainIdInvalid() +``` + +It is returned if the domain separator should change. + +### CreatorFeeBpTooHigh + +```solidity +error CreatorFeeBpTooHigh() +``` + +It is returned if the creator fee (in basis point) is too high. + +### CurrencyInvalid + +```solidity +error CurrencyInvalid() +``` + +It is returned if the currency is invalid. + +### ERC20TransferFromFail + +```solidity +error ERC20TransferFromFail() +``` + +It is emitted if the ERC20 transferFrom fails. + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### MerkleProofInvalid + +```solidity +error MerkleProofInvalid() +``` + +It is returned if the merkle proof provided is invalid. + +### MerkleProofTooLarge + +```solidity +error MerkleProofTooLarge(uint256 length) +``` + +It is returned if the length of the merkle proof provided is greater than tolerated. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ------------ | +| length | uint256 | Proof length | + +### NewGasLimitETHTransferTooLow + +```solidity +error NewGasLimitETHTransferTooLow() +``` + +It is returned if the gas limit for a standard ETH transfer is too low. + +### NewProtocolFeeRecipientCannotBeNullAddress + +```solidity +error NewProtocolFeeRecipientCannotBeNullAddress() +``` + +It is returned if the new protocol fee recipient is set to address(0). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NoSelectorForStrategy + +```solidity +error NoSelectorForStrategy() +``` + +It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. + +### NoncesInvalid + +```solidity +error NoncesInvalid() +``` + +It is returned if the nonces are invalid. + +### NotAContract + +```solidity +error NotAContract() +``` + +It is emitted if the call recipient is not a contract. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### NullSignerAddress + +```solidity +error NullSignerAddress() +``` + +It is emitted if the signer is null. + +### OutsideOfTimeRange + +```solidity +error OutsideOfTimeRange() +``` + +It is returned if the current block timestamp is not between start and end times in the maker order. + +### QuoteTypeInvalid + +```solidity +error QuoteTypeInvalid() +``` + +It is returned if the maker quote type is invalid. + +### ReentrancyFail + +```solidity +error ReentrancyFail() +``` + +This is returned when there is a reentrant call. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### SameDomainSeparator + +```solidity +error SameDomainSeparator() +``` + +It is returned if the domain separator cannot be updated (i.e. the chainId is the same). + +### SignatureEOAInvalid + +```solidity +error SignatureEOAInvalid() +``` + +It is emitted if the signature is invalid for an EOA (the address recovered is not the expected one). + +### SignatureERC1271Invalid + +```solidity +error SignatureERC1271Invalid() +``` + +It is emitted if the signature is invalid for a ERC1271 contract signer. + +### SignatureLengthInvalid + +```solidity +error SignatureLengthInvalid(uint256 length) +``` + +It is emitted if the signature's length is neither 64 nor 65 bytes. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| length | uint256 | undefined | + +### SignatureParameterSInvalid + +```solidity +error SignatureParameterSInvalid() +``` + +It is emitted if the signature is invalid due to S parameter. + +### SignatureParameterVInvalid + +```solidity +error SignatureParameterVInvalid(uint8 v) +``` + +It is emitted if the signature is invalid due to V parameter. + +#### Parameters + +| Name | Type | Description | +| ---- | ----- | ----------- | +| v | uint8 | undefined | + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotAvailable + +```solidity +error StrategyNotAvailable(uint256 strategyId) +``` + +It is returned if the strategy id has no implementation. + +_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| strategyId | uint256 | undefined | + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### UnsupportedCollectionType + +```solidity +error UnsupportedCollectionType() +``` + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/NonceManager.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/NonceManager.md new file mode 100644 index 00000000..fea95495 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/NonceManager.md @@ -0,0 +1,193 @@ +# NonceManager + +_LooksRare protocol team (👀,💎)_ + +> NonceManager + +This contract handles the nonce logic that is used for invalidating maker orders that exist off-chain. The nonce logic revolves around three parts at the user level: - order nonce (orders sharing an order nonce are conditional, OCO-like) - subset (orders can be grouped under a same subset) - bid/ask (all orders can be executed only if the bid/ask nonce matches the user's one on-chain) Only the order nonce is invalidated at the time of the execution of a maker order that contains it. + +## Methods + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### cancelOrderNonces + +```solidity +function cancelOrderNonces(uint256[] orderNonces) external nonpayable +``` + +This function allows a user to cancel an array of order nonces. + +_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | --------------------- | +| orderNonces | uint256[] | Array of order nonces | + +### cancelSubsetNonces + +```solidity +function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable +``` + +This function allows a user to cancel an array of subset nonces. + +_It does not check the status of the nonces to save gas._ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ---------------------- | +| subsetNonces | uint256[] | Array of subset nonces | + +### incrementBidAskNonces + +```solidity +function incrementBidAskNonces(bool bid, bool ask) external nonpayable +``` + +This function increments a user's bid/ask nonces. + +_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | --------------------------------------- | +| bid | bool | Whether to increment the user bid nonce | +| ask | bool | Whether to increment the user ask nonce | + +### userBidAskNonces + +```solidity +function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) +``` + +This tracks the bid and ask nonces for a user address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------- | ----------- | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### userOrderNonce + +```solidity +function userOrderNonce(address, uint256) external view returns (bytes32) +``` + +This checks whether the order nonce for a user was executed or cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### userSubsetNonce + +```solidity +function userSubsetNonce(address, uint256) external view returns (bool) +``` + +This checks whether the subset nonce for a user was cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Events + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| user | address | undefined | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ----------- | +| user | address | undefined | +| orderNonces | uint256[] | undefined | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| user | address | undefined | +| subsetNonces | uint256[] | undefined | + +## Errors + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/ProtocolFeeRecipient.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/ProtocolFeeRecipient.md new file mode 100644 index 00000000..36f6a35c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/ProtocolFeeRecipient.md @@ -0,0 +1,75 @@ +# ProtocolFeeRecipient + +_LooksRare protocol team (👀,💎)_ + +> ProtocolFeeRecipient + +This contract is used to receive protocol fees and transfer them to the fee sharing setter. Fee sharing setter cannot receive ETH directly, so we need to use this contract as a middleman to convert ETH into WETH before sending it. + +## Methods + +### FEE_SHARING_SETTER + +```solidity +function FEE_SHARING_SETTER() external view returns (address) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### WETH + +```solidity +function WETH() external view returns (contract IWETH) +``` + +#### Returns + +| Name | Type | Description | +| ---- | -------------- | ----------- | +| \_0 | contract IWETH | undefined | + +### transferERC20 + +```solidity +function transferERC20(address currency) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ---------------------- | +| currency | address | ERC20 currency address | + +### transferETH + +```solidity +function transferETH() external nonpayable +``` + +## Errors + +### ERC20TransferFail + +```solidity +error ERC20TransferFail() +``` + +It is emitted if the ERC20 transfer fails. + +### NotAContract + +```solidity +error NotAContract() +``` + +It is emitted if the call recipient is not a contract. + +### NothingToTransfer + +```solidity +error NothingToTransfer() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/StrategyManager.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/StrategyManager.md new file mode 100644 index 00000000..a55f3985 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/StrategyManager.md @@ -0,0 +1,391 @@ +# StrategyManager + +_LooksRare protocol team (👀,💎)_ + +> StrategyManager + +This contract handles the addition and the update of execution strategies. + +## Methods + +### addStrategy + +```solidity +function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable +``` + +This function allows the owner to add a new execution strategy to the protocol. + +_Strategies have an id that is incremental. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------- | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the strategy | +| isMakerBid | bool | Whether the function selector is for maker bid | +| implementation | address | Implementation address | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### strategyInfo + +```solidity +function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +This returns the strategy information for a strategy id. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +### updateStrategy + +```solidity +function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable +``` + +This function allows the owner to update parameters for an existing execution strategy. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------------------ | +| strategyId | uint256 | Strategy id | +| isActive | bool | Whether the strategy must be active | +| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | +| newMinTotalFee | uint16 | New minimum total fee (in basis point) | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | + +## Errors + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/TransferManager.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/TransferManager.md new file mode 100644 index 00000000..c6766114 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/TransferManager.md @@ -0,0 +1,553 @@ +# TransferManager + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> TransferManager + +This contract provides the transfer functions for ERC721/ERC1155/Hypercert for contracts that require them. Collection type "0" refers to ERC721 transfer functions. Collection type "1" refers to ERC1155 transfer functions. Collection type "2" refers to Hypercert transfer functions. + +_"Safe" transfer functions for ERC721 are not implemented since they come with added gas costs to verify if the recipient is a contract as it requires verifying the receiver interface is valid._ + +## Methods + +### allowOperator + +```solidity +function allowOperator(address operator) external nonpayable +``` + +This function allows an operator to be added for the shared transfer system. Once the operator is allowed, users can grant NFT approvals to this operator. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ------------------------- | +| operator | address | Operator address to allow | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### grantApprovals + +```solidity +function grantApprovals(address[] operators) external nonpayable +``` + +This function allows a user to grant approvals for an array of operators. Users cannot grant approvals if the operator is not allowed by this contract's owner. + +_Each operator address must be globally allowed to be approved._ + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | --------------------------- | +| operators | address[] | Array of operator addresses | + +### hasUserApprovedOperator + +```solidity +function hasUserApprovedOperator(address, address) external view returns (bool) +``` + +This returns whether the user has approved the operator address. The first address is the user and the second address is the operator (e.g. LooksRareProtocol). + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isOperatorAllowed + +```solidity +function isOperatorAllowed(address) external view returns (bool) +``` + +This returns whether the operator address is allowed by this contract's owner. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### removeOperator + +```solidity +function removeOperator(address operator) external nonpayable +``` + +This function allows the user to remove an operator for the shared transfer system. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | -------------------------- | +| operator | address | Operator address to remove | + +### revokeApprovals + +```solidity +function revokeApprovals(address[] operators) external nonpayable +``` + +This function allows a user to revoke existing approvals for an array of operators. + +_Each operator address must be approved at the user level to be revoked._ + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | --------------------------- | +| operators | address[] | Array of operator addresses | + +### splitItemsHypercert + +```solidity +function splitItemsHypercert(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable +``` + +This function splits and transfers a fraction of a hypercert. + +_It does not allow batch transferring._ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| from | address | Sender address | +| to | address | Recipient address | +| itemIds | uint256[] | Array of itemIds | +| amounts | uint256[] | Array of amounts | + +### transferBatchItemsAcrossCollections + +```solidity +function transferBatchItemsAcrossCollections(ITransferManager.BatchTransferItem[] items, address from, address to) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| ----- | ------------------------------------ | ----------- | +| items | ITransferManager.BatchTransferItem[] | undefined | +| from | address | undefined | +| to | address | undefined | + +### transferItemsERC1155 + +```solidity +function transferItemsERC1155(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable +``` + +This function transfers items for a single ERC1155 collection. + +_It does not allow batch transferring if from = msg.sender since native function should be used._ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| from | address | Sender address | +| to | address | Recipient address | +| itemIds | uint256[] | Array of itemIds | +| amounts | uint256[] | Array of amounts | + +### transferItemsERC721 + +```solidity +function transferItemsERC721(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable +``` + +This function transfers items for a single ERC721 collection. + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| from | address | Sender address | +| to | address | Recipient address | +| itemIds | uint256[] | Array of itemIds | +| amounts | uint256[] | Array of amounts | + +### transferItemsHypercert + +```solidity +function transferItemsHypercert(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable +``` + +This function transfers items for a single Hypercert. + +_It does not allow batch transferring if from = msg.sender since native function should be used._ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| from | address | Sender address | +| to | address | Recipient address | +| itemIds | uint256[] | Array of itemIds | +| amounts | uint256[] | Array of amounts | + +## Events + +### ApprovalsGranted + +```solidity +event ApprovalsGranted(address user, address[] operators) +``` + +It is emitted if operators' approvals to transfer NFTs are granted by a user. + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | ----------- | +| user | address | undefined | +| operators | address[] | undefined | + +### ApprovalsRemoved + +```solidity +event ApprovalsRemoved(address user, address[] operators) +``` + +It is emitted if operators' approvals to transfer NFTs are revoked by a user. + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | ----------- | +| user | address | undefined | +| operators | address[] | undefined | + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### OperatorAllowed + +```solidity +event OperatorAllowed(address operator) +``` + +It is emitted if a new operator is added to the global allowlist. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | + +### OperatorRemoved + +```solidity +event OperatorRemoved(address operator) +``` + +It is emitted if an operator is removed from the global allowlist. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | + +## Errors + +### AmountInvalid + +```solidity +error AmountInvalid() +``` + +It is returned if the amount is invalid. For ERC721, any number that is not 1. For ERC1155 and Hypercert, if amount is 0. + +### ERC1155SafeBatchTransferFromFail + +```solidity +error ERC1155SafeBatchTransferFromFail() +``` + +It is emitted if the ERC1155 safeBatchTransferFrom fails. + +### ERC1155SafeTransferFromFail + +```solidity +error ERC1155SafeTransferFromFail() +``` + +It is emitted if the ERC1155 safeTransferFrom fails. + +### ERC721TransferFromFail + +```solidity +error ERC721TransferFromFail() +``` + +It is emitted if the ERC721 transferFrom fails. + +### HypercertSplitFractionError + +```solidity +error HypercertSplitFractionError() +``` + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotAContract + +```solidity +error NotAContract() +``` + +It is emitted if the call recipient is not a contract. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### OperatorAlreadyAllowed + +```solidity +error OperatorAlreadyAllowed() +``` + +It is returned if the transfer caller is already allowed by the owner. + +_This error can only be returned for owner operations._ + +### OperatorAlreadyApprovedByUser + +```solidity +error OperatorAlreadyApprovedByUser() +``` + +It is returned if the operator to approve has already been approved by the user. + +### OperatorNotAllowed + +```solidity +error OperatorNotAllowed() +``` + +It is returned if the operator to approve is not in the global allowlist defined by the owner. + +_This error can be returned if the user tries to grant approval to an operator address not in the allowlist or if the owner tries to remove the operator from the global allowlist._ + +### OperatorNotApprovedByUser + +```solidity +error OperatorNotApprovedByUser() +``` + +It is returned if the operator to revoke has not been previously approved by the user. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferCallerInvalid + +```solidity +error TransferCallerInvalid() +``` + +It is returned if the transfer caller is invalid. For a transfer called to be valid, the operator must be in the global allowlist and approved by the 'from' user. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/TransferSelectorNFT.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/TransferSelectorNFT.md new file mode 100644 index 00000000..9011bd50 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/TransferSelectorNFT.md @@ -0,0 +1,779 @@ +# TransferSelectorNFT + +_LooksRare protocol team (👀,💎); bitbeckers;_ + +> TransferSelectorNFT + +This contract handles the logic for transferring non-fungible items. + +## Methods + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### addStrategy + +```solidity +function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable +``` + +This function allows the owner to add a new execution strategy to the protocol. + +_Strategies have an id that is incremental. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------- | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the strategy | +| isMakerBid | bool | Whether the function selector is for maker bid | +| implementation | address | Implementation address | + +### cancelOrderNonces + +```solidity +function cancelOrderNonces(uint256[] orderNonces) external nonpayable +``` + +This function allows a user to cancel an array of order nonces. + +_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | --------------------- | +| orderNonces | uint256[] | Array of order nonces | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### cancelSubsetNonces + +```solidity +function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable +``` + +This function allows a user to cancel an array of subset nonces. + +_It does not check the status of the nonces to save gas._ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ---------------------- | +| subsetNonces | uint256[] | Array of subset nonces | + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### creatorFeeManager + +```solidity +function creatorFeeManager() external view returns (contract ICreatorFeeManager) +``` + +Creator fee manager. + +#### Returns + +| Name | Type | Description | +| ---- | --------------------------- | ----------- | +| \_0 | contract ICreatorFeeManager | undefined | + +### incrementBidAskNonces + +```solidity +function incrementBidAskNonces(bool bid, bool ask) external nonpayable +``` + +This function increments a user's bid/ask nonces. + +_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | --------------------------------------- | +| bid | bool | Whether to increment the user bid nonce | +| ask | bool | Whether to increment the user ask nonce | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isCurrencyAllowed + +```solidity +function isCurrencyAllowed(address) external view returns (bool) +``` + +It checks whether the currency is allowed for transacting. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### maxCreatorFeeBp + +```solidity +function maxCreatorFeeBp() external view returns (uint16) +``` + +Maximum creator fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | uint16 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### protocolFeeRecipient + +```solidity +function protocolFeeRecipient() external view returns (address) +``` + +Protocol fee recipient. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### strategyInfo + +```solidity +function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +This returns the strategy information for a strategy id. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### transferManager + +```solidity +function transferManager() external view returns (contract TransferManager) +``` + +Transfer manager for ERC721, ERC1155 and Hypercerts. + +#### Returns + +| Name | Type | Description | +| ---- | ------------------------ | ----------- | +| \_0 | contract TransferManager | undefined | + +### updateCreatorFeeManager + +```solidity +function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable +``` + +This function allows the owner to update the creator fee manager address. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ---------------------------------- | +| newCreatorFeeManager | address | Address of the creator fee manager | + +### updateCurrencyStatus + +```solidity +function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable +``` + +This function allows the owner to update the status of a currency. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | -------------------------------------------------- | +| currency | address | Currency address (address(0) for ETH) | +| isAllowed | bool | Whether the currency should be allowed for trading | + +### updateMaxCreatorFeeBp + +```solidity +function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable +``` + +This function allows the owner to update the maximum creator fee (in basis point). + +_The maximum value that can be set is 25%. Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------ | ---------------------------------------- | +| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | + +### updateProtocolFeeRecipient + +```solidity +function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable +``` + +This function allows the owner to update the protocol fee recipient. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ---------------------------------- | +| newProtocolFeeRecipient | address | New protocol fee recipient address | + +### updateStrategy + +```solidity +function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable +``` + +This function allows the owner to update parameters for an existing execution strategy. + +_Only callable by owner._ + +#### Parameters + +| Name | Type | Description | +| ---------------------- | ------- | ------------------------------------------ | +| strategyId | uint256 | Strategy id | +| isActive | bool | Whether the strategy must be active | +| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | +| newMinTotalFee | uint16 | New minimum total fee (in basis point) | + +### userBidAskNonces + +```solidity +function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) +``` + +This tracks the bid and ask nonces for a user address. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------- | ----------- | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### userOrderNonce + +```solidity +function userOrderNonce(address, uint256) external view returns (bytes32) +``` + +This checks whether the order nonce for a user was executed or cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### userSubsetNonce + +```solidity +function userSubsetNonce(address, uint256) external view returns (bool) +``` + +This checks whether the subset nonce for a user was cancelled. + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| currency | address | undefined | +| isAllowed | bool | undefined | + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| user | address | undefined | +| bidNonce | uint256 | undefined | +| askNonce | uint256 | undefined | + +### NewCreatorFeeManager + +```solidity +event NewCreatorFeeManager(address creatorFeeManager) +``` + +It is issued when there is a new creator fee manager. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| creatorFeeManager | address | undefined | + +### NewMaxCreatorFeeBp + +```solidity +event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) +``` + +It is issued when there is a new maximum creator fee (in basis point). + +#### Parameters + +| Name | Type | Description | +| --------------- | ------- | ----------- | +| maxCreatorFeeBp | uint256 | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### NewProtocolFeeRecipient + +```solidity +event NewProtocolFeeRecipient(address protocolFeeRecipient) +``` + +It is issued when there is a new protocol fee recipient address. + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ----------- | +| protocolFeeRecipient | address | undefined | + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | +| maxProtocolFeeBp | uint16 | undefined | +| selector | bytes4 | undefined | +| isMakerBid | bool | undefined | +| implementation | address | undefined | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ----------- | +| user | address | undefined | +| orderNonces | uint256[] | undefined | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ----------- | +| strategyId | uint256 | undefined | +| isActive | bool | undefined | +| standardProtocolFeeBp | uint16 | undefined | +| minTotalFeeBp | uint16 | undefined | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| user | address | undefined | +| subsetNonces | uint256[] | undefined | + +## Errors + +### CreatorFeeBpTooHigh + +```solidity +error CreatorFeeBpTooHigh() +``` + +It is returned if the creator fee (in basis point) is too high. + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### NewProtocolFeeRecipientCannotBeNullAddress + +```solidity +error NewProtocolFeeRecipientCannotBeNullAddress() +``` + +It is returned if the new protocol fee recipient is set to address(0). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NoSelectorForStrategy + +```solidity +error NoSelectorForStrategy() +``` + +It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### OutsideOfTimeRange + +```solidity +error OutsideOfTimeRange() +``` + +It is returned if the current block timestamp is not between start and end times in the maker order. + +### ReentrancyFail + +```solidity +error ReentrancyFail() +``` + +This is returned when there is a reentrant call. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotAvailable + +```solidity +error StrategyNotAvailable(uint256 strategyId) +``` + +It is returned if the strategy id has no implementation. + +_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| strategyId | uint256 | undefined | + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### UnsupportedCollectionType + +```solidity +error UnsupportedCollectionType() +``` + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md new file mode 100644 index 00000000..37866658 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md @@ -0,0 +1,41 @@ +# BaseStrategy + +_LooksRare protocol team (👀,💎)_ + +> BaseStrategy + +## Methods + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerOrder, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerOrder | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md new file mode 100644 index 00000000..c9503939 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md @@ -0,0 +1,212 @@ +# BaseStrategyChainlinkPriceLatency + +_LooksRare protocol team (👀,💎)_ + +> BaseStrategyChainlinkPriceLatency + +This contract allows the owner to define the maximum acceptable Chainlink price latency. + +## Methods + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### maxLatency + +```solidity +function maxLatency() external view returns (uint256) +``` + +Maximum latency accepted after which the execution strategy rejects the retrieved price. For ETH, it cannot be higher than 3,600 as Chainlink will at least update the price every 3,600 seconds, provided ETH's price does not deviate more than 0.5%. For NFTs, it cannot be higher than 86,400 as Chainlink will at least update the price every 86,400 seconds, provided ETH's price does not deviate more than 2%. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +## Errors + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md new file mode 100644 index 00000000..e2d77dd3 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md @@ -0,0 +1,342 @@ +# StrategyChainlinkUSDDynamicAsk + +_LooksRare protocol team (👀,💎)_ + +> StrategyChainlinkUSDDynamicAsk + +This contract allows a seller to sell an NFT priced in USD and the receivable amount to be in ETH. + +## Methods + +### ETH_USD_PRICE_FEED_DECIMALS + +```solidity +function ETH_USD_PRICE_FEED_DECIMALS() external view returns (uint256) +``` + +_It is possible to call priceFeed.decimals() to get the decimals, but to save gas, it is hard coded instead._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### WETH + +```solidity +function WETH() external view returns (address) +``` + +Wrapped ether (WETH) address. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### cancelOwnershipTransfer + +```solidity +function cancelOwnershipTransfer() external nonpayable +``` + +This function is used to cancel the ownership transfer. + +_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ + +### confirmOwnershipRenouncement + +```solidity +function confirmOwnershipRenouncement() external nonpayable +``` + +This function is used to confirm the ownership renouncement. + +### confirmOwnershipTransfer + +```solidity +function confirmOwnershipTransfer() external nonpayable +``` + +This function is used to confirm the ownership transfer. + +_This function can only be called by the current potential owner._ + +### executeStrategyWithTakerBid + +```solidity +function executeStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### initiateOwnershipRenouncement + +```solidity +function initiateOwnershipRenouncement() external nonpayable +``` + +This function is used to initiate the ownership renouncement. + +### initiateOwnershipTransfer + +```solidity +function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable +``` + +This function is used to initiate the transfer of ownership to a new owner. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | --------------------------- | +| newPotentialOwner | address | New potential owner address | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerAsk | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +### maxLatency + +```solidity +function maxLatency() external view returns (uint256) +``` + +Maximum latency accepted after which the execution strategy rejects the retrieved price. For ETH, it cannot be higher than 3,600 as Chainlink will at least update the price every 3,600 seconds, provided ETH's price does not deviate more than 0.5%. For NFTs, it cannot be higher than 86,400 as Chainlink will at least update the price every 86,400 seconds, provided ETH's price does not deviate more than 2%. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +Address of the current owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownershipStatus + +```solidity +function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) +``` + +Ownership status. + +#### Returns + +| Name | Type | Description | +| ---- | ---------------------------- | ----------- | +| \_0 | enum IOwnableTwoSteps.Status | undefined | + +### potentialOwner + +```solidity +function potentialOwner() external view returns (address) +``` + +Address of the potential owner. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### priceFeed + +```solidity +function priceFeed() external view returns (contract AggregatorV3Interface) +``` + +ETH/USD Chainlink price feed + +#### Returns + +| Name | Type | Description | +| ---- | ------------------------------ | ----------- | +| \_0 | contract AggregatorV3Interface | undefined | + +## Events + +### CancelOwnershipTransfer + +```solidity +event CancelOwnershipTransfer() +``` + +This is emitted if the ownership transfer is cancelled. + +### InitiateOwnershipRenouncement + +```solidity +event InitiateOwnershipRenouncement() +``` + +This is emitted if the ownership renouncement is initiated. + +### InitiateOwnershipTransfer + +```solidity +event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) +``` + +This is emitted if the ownership transfer is initiated. + +#### Parameters + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| previousOwner | address | undefined | +| potentialOwner | address | undefined | + +### NewOwner + +```solidity +event NewOwner(address newOwner) +``` + +This is emitted when there is a new owner. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +## Errors + +### BidTooLow + +```solidity +error BidTooLow() +``` + +It is returned if the bid price is too low for the ask user. + +### ChainlinkPriceInvalid + +```solidity +error ChainlinkPriceInvalid() +``` + +It is returned if the Chainlink price is invalid (e.g. negative). + +### NoOngoingTransferInProgress + +```solidity +error NoOngoingTransferInProgress() +``` + +This is returned when there is no transfer of ownership in progress. + +### NotOwner + +```solidity +error NotOwner() +``` + +This is returned when the caller is not the owner. + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. + +### PriceNotRecentEnough + +```solidity +error PriceNotRecentEnough() +``` + +It is returned if the current block time relative to the latest price's update time is greater than the latency tolerance. + +### RenouncementNotInProgress + +```solidity +error RenouncementNotInProgress() +``` + +This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. + +### TransferAlreadyInProgress + +```solidity +error TransferAlreadyInProgress() +``` + +This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. + +### TransferNotInProgress + +```solidity +error TransferNotInProgress() +``` + +This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. + +### WrongPotentialOwner + +```solidity +error WrongPotentialOwner() +``` + +This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md new file mode 100644 index 00000000..ddec4495 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md @@ -0,0 +1,127 @@ +# StrategyCollectionOffer + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> StrategyCollectionOffer + +This contract offers execution strategies for users to create maker bid offers for items in a collection. There are two available functions: 1. executeCollectionStrategyWithTakerAsk --> it applies to all itemIds in a collection 2. executeCollectionStrategyWithTakerAskWithProof --> it allows adding merkle proof criteria for tokenIds. 2. executeCollectionStrategyWithTakerAskWithAllowlist --> it allows adding merkle proof criteria for accounts.The bidder can only bid on 1 item id at a time. 1. If ERC721, the amount must be 1. 2. If ERC1155, the amount can be greater than 1. 3. If Hypercert, the amount must be 1 (fractions are NFTs) + +## Methods + +### executeCollectionStrategyWithTakerAsk + +```solidity +function executeCollectionStrategyWithTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### executeCollectionStrategyWithTakerAskWithAllowlist + +```solidity +function executeCollectionStrategyWithTakerAskWithAllowlist(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### executeCollectionStrategyWithTakerAskWithProof + +```solidity +function executeCollectionStrategyWithTakerAskWithProof(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerBid, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerBid | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +## Errors + +### MerkleProofInvalid + +```solidity +error MerkleProofInvalid() +``` + +It is returned if the merkle proof provided is invalid. + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md new file mode 100644 index 00000000..1227878d --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md @@ -0,0 +1,83 @@ +# StrategyDutchAuction + +_LooksRare protocol team (👀,💎)_ + +> StrategyDutchAuction + +This contract offers a single execution strategy for users to create Dutch auctions. + +## Methods + +### executeStrategyWithTakerBid + +```solidity +function executeStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerAsk | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +## Errors + +### BidTooLow + +```solidity +error BidTooLow() +``` + +It is returned if the bid price is too low for the ask user. + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md new file mode 100644 index 00000000..daa427e4 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md @@ -0,0 +1,123 @@ +# StrategyHypercertFractionOffer + +_LooksRare protocol team (👀,💎); bitbeckers;_ + +> StrategyHypercertFractionOffer + +This contract offers a single execution strategy for users to bid on a specific amount of units in an hypercerts that's for sale. Example: Alice has 100 units of a hypercert (id: 42) for sale at a minimum price of 0.001 ETH/unit. Bob wants to buy 10 units. Bob can create a taker bid order with the following parameters: - unitAmount: 10 - acceptedTokenAmount: 1000000000000000 (0.001 ETH in wei) - acceptedTokenAddress: 0x0000000000000000000000000000000000000000 - proof: [0xsdadfa....s9fds,0xdasdas...asff8e] This strategy will validate the available units and the price.This contract offers execution strategies for users to create maker bid offers for items in a collection. There are three available functions: 1. executeCollectionStrategyWithTakerAsk --> it applies to all itemIds in a collection 2. executeCollectionStrategyWithTakerAskWithAllowlist --> it allows adding merkle proof criteria for accounts.The bidder can only bid on 1 item id at a time. 1. If ERC721, the amount must be 1. 2. If ERC1155, the amount can be greater than 1. 3. If Hypercert, the amount can be greater than 1 because they represent units held by the hypercert. + +_Use cases can include tiered pricing; think early bird tickets._ + +## Methods + +### executeHypercertFractionStrategyWithTakerBid + +```solidity +function executeHypercertFractionStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### executeHypercertFractionStrategyWithTakerBidWithAllowlist + +```solidity +function executeHypercertFractionStrategyWithTakerBidWithAllowlist(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerAsk | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +## Errors + +### AmountInvalid + +```solidity +error AmountInvalid() +``` + +It is returned if the amount is invalid. For ERC721, any number that is not 1. For ERC1155 and Hypercert, if amount is 0. + +### LengthsInvalid + +```solidity +error LengthsInvalid() +``` + +It is returned if there is either a mismatch or an error in the length of the array(s). + +### MerkleProofInvalid + +```solidity +error MerkleProofInvalid() +``` + +It is returned if the merkle proof provided is invalid. + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md new file mode 100644 index 00000000..6a1f0cd5 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md @@ -0,0 +1,75 @@ +# StrategyItemIdsRange + +_LooksRare protocol team (👀,💎)_ + +> StrategyItemIdsRange + +This contract offers a single execution strategy for users to bid on a specific amount of items in a range bounded by 2 item ids. + +## Methods + +### executeStrategyWithTakerAsk + +```solidity +function executeStrategyWithTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) +``` + +#### Parameters + +| Name | Type | Description | +| -------- | ------------------ | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| price | uint256 | undefined | +| itemIds | uint256[] | undefined | +| amounts | uint256[] | undefined | +| isNonceInvalidated | bool | undefined | + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ---------------------------------------------- | +| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerBid, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerBid | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | + +## Errors + +### OrderInvalid + +```solidity +error OrderInvalid() +``` + +It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md new file mode 100644 index 00000000..76918fc5 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md @@ -0,0 +1,215 @@ +# OrderValidatorV2A + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> OrderValidatorV2A + +This contract is used to check the validity of maker ask/bid orders in the LooksRareProtocol (v2). It performs checks for: 1. Protocol allowlist issues (i.e. currency or strategy not allowed) 2. Maker order-specific issues (e.g., order invalid due to format or other-strategy specific issues) 3. Nonce related issues (e.g., nonce executed or cancelled) 4. Signature related issues and merkle tree parameters 5. Timestamp related issues (e.g., order expired) 6. Asset-related issues for ERC20/ERC721/ERC1155/Hypercerts (approvals and balances) 7. Collection-type suggestions 8. Transfer manager related issues 9. Creator fee related issues (e.g., creator fee too high, ERC2981 bundles) + +_This version does not handle strategies with partial fills._ + +## Methods + +### CRITERIA_GROUPS + +```solidity +function CRITERIA_GROUPS() external view returns (uint256) +``` + +Number of distinct criteria groups checked to evaluate the validity of an order. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### ERC1155_INTERFACE_ID + +```solidity +function ERC1155_INTERFACE_ID() external view returns (bytes4) +``` + +ERC1155 interfaceId. + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | + +### ERC721_INTERFACE_ID_1 + +```solidity +function ERC721_INTERFACE_ID_1() external view returns (bytes4) +``` + +ERC721 potential interfaceId. + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | + +### ERC721_INTERFACE_ID_2 + +```solidity +function ERC721_INTERFACE_ID_2() external view returns (bytes4) +``` + +ERC721 potential interfaceId. + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | + +### HYPERCERT_INTERFACE_ID + +```solidity +function HYPERCERT_INTERFACE_ID() external view returns (bytes4) +``` + +Hypercert interfaceId + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | + +### MAGIC_VALUE_ORDER_NONCE_EXECUTED + +```solidity +function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) +``` + +Magic value nonce returned if executed (or cancelled). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### checkMakerOrderValidity + +```solidity +function checkMakerOrderValidity(OrderStructs.Maker makerOrder, bytes signature, OrderStructs.MerkleTree merkleTree) external view returns (uint256[9] validationCodes) +``` + +#### Parameters + +| Name | Type | Description | +| ---------- | ----------------------- | ----------- | +| makerOrder | OrderStructs.Maker | undefined | +| signature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +#### Returns + +| Name | Type | Description | +| --------------- | ---------- | ----------- | +| validationCodes | uint256[9] | undefined | + +### checkMultipleMakerOrderValidities + +```solidity +function checkMultipleMakerOrderValidities(OrderStructs.Maker[] makerOrders, bytes[] signatures, OrderStructs.MerkleTree[] merkleTrees) external view returns (uint256[9][] validationCodes) +``` + +#### Parameters + +| Name | Type | Description | +| ----------- | ------------------------- | ----------- | +| makerOrders | OrderStructs.Maker[] | undefined | +| signatures | bytes[] | undefined | +| merkleTrees | OrderStructs.MerkleTree[] | undefined | + +#### Returns + +| Name | Type | Description | +| --------------- | ------------ | ----------- | +| validationCodes | uint256[9][] | undefined | + +### creatorFeeManager + +```solidity +function creatorFeeManager() external view returns (contract ICreatorFeeManager) +``` + +CreatorFeeManager. + +#### Returns + +| Name | Type | Description | +| ---- | --------------------------- | ----------- | +| \_0 | contract ICreatorFeeManager | undefined | + +### deriveProtocolParameters + +```solidity +function deriveProtocolParameters() external nonpayable +``` + +Derive protocol parameters. Anyone can call this function. + +_It allows adjusting if the domain separator or creator fee manager address were to change._ + +### domainSeparator + +```solidity +function domainSeparator() external view returns (bytes32) +``` + +LooksRareProtocol domain separator. + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### looksRareProtocol + +```solidity +function looksRareProtocol() external view returns (contract LooksRareProtocol) +``` + +LooksRareProtocol. + +#### Returns + +| Name | Type | Description | +| ---- | -------------------------- | ----------- | +| \_0 | contract LooksRareProtocol | undefined | + +### maxCreatorFeeBp + +```solidity +function maxCreatorFeeBp() external view returns (uint256) +``` + +Maximum creator fee (in basis point). + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### transferManager + +```solidity +function transferManager() external view returns (contract TransferManager) +``` + +TransferManager + +#### Returns + +| Name | Type | Description | +| ---- | ------------------------ | ----------- | +| \_0 | contract TransferManager | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md new file mode 100644 index 00000000..91be29a9 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md @@ -0,0 +1,159 @@ +# ProtocolHelpers + +_LooksRare protocol team (👀,💎)_ + +> ProtocolHelpers + +This contract contains helper view functions for order creation. + +## Methods + +### computeDigestMerkleTree + +```solidity +function computeDigestMerkleTree(OrderStructs.MerkleTree merkleTree) external view returns (bytes32 digest) +``` + +#### Parameters + +| Name | Type | Description | +| ---------- | ----------------------- | ----------- | +| merkleTree | OrderStructs.MerkleTree | undefined | + +#### Returns + +| Name | Type | Description | +| ------ | ------- | ----------- | +| digest | bytes32 | undefined | + +### computeMakerDigest + +```solidity +function computeMakerDigest(OrderStructs.Maker maker) external view returns (bytes32 digest) +``` + +#### Parameters + +| Name | Type | Description | +| ----- | ------------------ | ----------- | +| maker | OrderStructs.Maker | undefined | + +#### Returns + +| Name | Type | Description | +| ------ | ------- | ----------- | +| digest | bytes32 | undefined | + +### looksRareProtocol + +```solidity +function looksRareProtocol() external view returns (contract LooksRareProtocol) +``` + +#### Returns + +| Name | Type | Description | +| ---- | -------------------------- | ----------- | +| \_0 | contract LooksRareProtocol | undefined | + +### verifyMakerSignature + +```solidity +function verifyMakerSignature(OrderStructs.Maker maker, bytes makerSignature, address signer) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ------------------ | ----------- | +| maker | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| signer | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### verifyMerkleTree + +```solidity +function verifyMerkleTree(OrderStructs.MerkleTree merkleTree, bytes makerSignature, address signer) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| merkleTree | OrderStructs.MerkleTree | undefined | +| makerSignature | bytes | undefined | +| signer | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +## Errors + +### NullSignerAddress + +```solidity +error NullSignerAddress() +``` + +It is emitted if the signer is null. + +### SignatureEOAInvalid + +```solidity +error SignatureEOAInvalid() +``` + +It is emitted if the signature is invalid for an EOA (the address recovered is not the expected one). + +### SignatureERC1271Invalid + +```solidity +error SignatureERC1271Invalid() +``` + +It is emitted if the signature is invalid for a ERC1271 contract signer. + +### SignatureLengthInvalid + +```solidity +error SignatureLengthInvalid(uint256 length) +``` + +It is emitted if the signature's length is neither 64 nor 65 bytes. + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| length | uint256 | undefined | + +### SignatureParameterSInvalid + +```solidity +error SignatureParameterSInvalid() +``` + +It is emitted if the signature is invalid due to S parameter. + +### SignatureParameterVInvalid + +```solidity +error SignatureParameterVInvalid(uint8 v) +``` + +It is emitted if the signature is invalid due to V parameter. + +#### Parameters + +| Name | Type | Description | +| ---- | ----- | ----------- | +| v | uint8 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md new file mode 100644 index 00000000..b832744e --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md @@ -0,0 +1,60 @@ +# ICreatorFeeManager + +_LooksRare protocol team (👀,💎)_ + +> ICreatorFeeManager + +## Methods + +### royaltyFeeRegistry + +```solidity +function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry royaltyFeeRegistry) +``` + +It returns the royalty fee registry address/interface. + +#### Returns + +| Name | Type | Description | +| ------------------ | ---------------------------- | ------------------------------------- | +| royaltyFeeRegistry | contract IRoyaltyFeeRegistry | Interface of the royalty fee registry | + +### viewCreatorFeeInfo + +```solidity +function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) +``` + +This function returns the creator address and calculates the creator fee amount. + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| collection | address | Collection address | +| price | uint256 | Transaction price | +| itemIds | uint256[] | Array of item ids | + +#### Returns + +| Name | Type | Description | +| ---------------- | ------- | ------------------ | +| creator | address | Creator address | +| creatorFeeAmount | uint256 | Creator fee amount | + +## Errors + +### BundleEIP2981NotAllowed + +```solidity +error BundleEIP2981NotAllowed(address collection) +``` + +It is returned if the bundle contains multiple itemIds with different creator fee structure. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| collection | address | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md new file mode 100644 index 00000000..da683d8c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md @@ -0,0 +1,22 @@ +# ICurrencyManager + +_LooksRare protocol team (👀,💎)_ + +> ICurrencyManager + +## Events + +### CurrencyStatusUpdated + +```solidity +event CurrencyStatusUpdated(address currency, bool isAllowed) +``` + +It is emitted if the currency status in the allowlist is updated. + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------------------------------- | +| currency | address | Currency address (address(0) = ETH) | +| isAllowed | bool | Whether the currency is allowed | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IExecutionManager.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IExecutionManager.md new file mode 100644 index 00000000..0e86c75b --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IExecutionManager.md @@ -0,0 +1,99 @@ +# IExecutionManager + +_LooksRare protocol team (👀,💎)_ + +> IExecutionManager + +## Events + +### NewCreatorFeeManager + +```solidity +event NewCreatorFeeManager(address creatorFeeManager) +``` + +It is issued when there is a new creator fee manager. + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | -------------------------------------- | +| creatorFeeManager | address | Address of the new creator fee manager | + +### NewMaxCreatorFeeBp + +```solidity +event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) +``` + +It is issued when there is a new maximum creator fee (in basis point). + +#### Parameters + +| Name | Type | Description | +| --------------- | ------- | ---------------------------------------- | +| maxCreatorFeeBp | uint256 | New maximum creator fee (in basis point) | + +### NewProtocolFeeRecipient + +```solidity +event NewProtocolFeeRecipient(address protocolFeeRecipient) +``` + +It is issued when there is a new protocol fee recipient address. + +#### Parameters + +| Name | Type | Description | +| -------------------- | ------- | ----------------------------------------- | +| protocolFeeRecipient | address | Address of the new protocol fee recipient | + +## Errors + +### CreatorFeeBpTooHigh + +```solidity +error CreatorFeeBpTooHigh() +``` + +It is returned if the creator fee (in basis point) is too high. + +### NewProtocolFeeRecipientCannotBeNullAddress + +```solidity +error NewProtocolFeeRecipientCannotBeNullAddress() +``` + +It is returned if the new protocol fee recipient is set to address(0). + +### NoSelectorForStrategy + +```solidity +error NoSelectorForStrategy() +``` + +It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. + +### OutsideOfTimeRange + +```solidity +error OutsideOfTimeRange() +``` + +It is returned if the current block timestamp is not between start and end times in the maker order. + +### StrategyNotAvailable + +```solidity +error StrategyNotAvailable(uint256 strategyId) +``` + +It is returned if the strategy id has no implementation. + +_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ----------- | +| strategyId | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md new file mode 100644 index 00000000..393cb24b --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md @@ -0,0 +1,41 @@ +# IImmutableCreate2Factory + +## Methods + +### findCreate2Address + +```solidity +function findCreate2Address(bytes32 salt, bytes initializationCode) external view returns (address deploymentAddress) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| salt | bytes32 | undefined | +| initializationCode | bytes | undefined | + +#### Returns + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| deploymentAddress | address | undefined | + +### safeCreate2 + +```solidity +function safeCreate2(bytes32 salt, bytes initializationCode) external payable returns (address deploymentAddress) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| salt | bytes32 | undefined | +| initializationCode | bytes | undefined | + +#### Returns + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| deploymentAddress | address | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md new file mode 100644 index 00000000..e7414f54 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md @@ -0,0 +1,157 @@ +# ILooksRareProtocol + +_LooksRare protocol team (👀,💎)_ + +> ILooksRareProtocol + +## Methods + +### executeMultipleTakerBids + +```solidity +function executeMultipleTakerBids(OrderStructs.Taker[] takerBids, OrderStructs.Maker[] makerAsks, bytes[] makerSignatures, OrderStructs.MerkleTree[] merkleTrees, bool isAtomic) external payable +``` + +#### Parameters + +| Name | Type | Description | +| --------------- | ------------------------- | ----------- | +| takerBids | OrderStructs.Taker[] | undefined | +| makerAsks | OrderStructs.Maker[] | undefined | +| makerSignatures | bytes[] | undefined | +| merkleTrees | OrderStructs.MerkleTree[] | undefined | +| isAtomic | bool | undefined | + +### executeTakerAsk + +```solidity +function executeTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| takerAsk | OrderStructs.Taker | undefined | +| makerBid | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +### executeTakerBid + +```solidity +function executeTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external payable +``` + +#### Parameters + +| Name | Type | Description | +| -------------- | ----------------------- | ----------- | +| takerBid | OrderStructs.Taker | undefined | +| makerAsk | OrderStructs.Maker | undefined | +| makerSignature | bytes | undefined | +| merkleTree | OrderStructs.MerkleTree | undefined | + +## Events + +### NewDomainSeparator + +```solidity +event NewDomainSeparator() +``` + +It is emitted if there is a change in the domain separator. + +### NewGasLimitETHTransfer + +```solidity +event NewGasLimitETHTransfer(uint256 gasLimitETHTransfer) +``` + +It is emitted when there is a new gas limit for a ETH transfer (before it is wrapped to WETH). + +#### Parameters + +| Name | Type | Description | +| ------------------- | ------- | ----------------------------- | +| gasLimitETHTransfer | uint256 | Gas limit for an ETH transfer | + +### TakerAsk + +```solidity +event TakerAsk(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address askUser, address bidUser, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) +``` + +It is emitted when a taker ask transaction is completed. + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | Struct about nonce invalidation parameters | +| askUser | address | Address of the ask user | +| bidUser | address | Address of the bid user | +| strategyId | uint256 | Id of the strategy | +| currency | address | Address of the currency | +| collection | address | Address of the collection | +| itemIds | uint256[] | Array of item ids | +| amounts | uint256[] | Array of amounts (for item ids) | +| feeRecipients | address[2] | Array of fee recipients feeRecipients[0] User who receives the proceeds of the sale (it can be the taker ask user or different) feeRecipients[1] Creator fee recipient (if none, address(0)) | +| feeAmounts | uint256[3] | Array of fee amounts feeAmounts[0] Fee amount for the user receiving sale proceeds feeAmounts[1] Creator fee amount feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment | + +### TakerBid + +```solidity +event TakerBid(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address bidUser, address bidRecipient, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) +``` + +It is emitted when a taker bid transaction is completed. + +#### Parameters + +| Name | Type | Description | +| --------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | Struct about nonce invalidation parameters | +| bidUser | address | Address of the bid user | +| bidRecipient | address | Address of the recipient of the bid | +| strategyId | uint256 | Id of the strategy | +| currency | address | Address of the currency | +| collection | address | Address of the collection | +| itemIds | uint256[] | Array of item ids | +| amounts | uint256[] | Array of amounts (for item ids) | +| feeRecipients | address[2] | Array of fee recipients feeRecipients[0] User who receives the proceeds of the sale (it is the maker ask user) feeRecipients[1] Creator fee recipient (if none, address(0)) | +| feeAmounts | uint256[3] | Array of fee amounts feeAmounts[0] Fee amount for the user receiving sale proceeds feeAmounts[1] Creator fee amount feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment | + +## Errors + +### ChainIdInvalid + +```solidity +error ChainIdInvalid() +``` + +It is returned if the domain separator should change. + +### NewGasLimitETHTransferTooLow + +```solidity +error NewGasLimitETHTransferTooLow() +``` + +It is returned if the gas limit for a standard ETH transfer is too low. + +### NoncesInvalid + +```solidity +error NoncesInvalid() +``` + +It is returned if the nonces are invalid. + +### SameDomainSeparator + +```solidity +error SameDomainSeparator() +``` + +It is returned if the domain separator cannot be updated (i.e. the chainId is the same). diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/INonceManager.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/INonceManager.md new file mode 100644 index 00000000..eaa3f977 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/INonceManager.md @@ -0,0 +1,53 @@ +# INonceManager + +_LooksRare protocol team (👀,💎)_ + +> INonceManager + +## Events + +### NewBidAskNonces + +```solidity +event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) +``` + +It is emitted when there is an update of the global bid/ask nonces for a user. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ------------------- | +| user | address | Address of the user | +| bidNonce | uint256 | New bid nonce | +| askNonce | uint256 | New ask nonce | + +### OrderNoncesCancelled + +```solidity +event OrderNoncesCancelled(address user, uint256[] orderNonces) +``` + +It is emitted when order nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ----------- | --------- | ------------------------------- | +| user | address | Address of the user | +| orderNonces | uint256[] | Array of order nonces cancelled | + +### SubsetNoncesCancelled + +```solidity +event SubsetNoncesCancelled(address user, uint256[] subsetNonces) +``` + +It is emitted when subset nonces are cancelled for a user. + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | -------------------------------- | +| user | address | Address of the user | +| subsetNonces | uint256[] | Array of subset nonces cancelled | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md new file mode 100644 index 00000000..5ed0ef6c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md @@ -0,0 +1,29 @@ +# IRoyaltyFeeRegistry + +_LooksRare protocol team (👀,💎)_ + +> IRoyaltyFeeRegistry + +## Methods + +### royaltyInfo + +```solidity +function royaltyInfo(address collection, uint256 price) external view returns (address receiver, uint256 royaltyFee) +``` + +This function returns the royalty information for a collection at a given transaction price. + +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | ------------------ | +| collection | address | Collection address | +| price | uint256 | Transaction price | + +#### Returns + +| Name | Type | Description | +| ---------- | ------- | ------------------ | +| receiver | address | Receiver address | +| royaltyFee | uint256 | Royalty fee amount | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IStrategy.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IStrategy.md new file mode 100644 index 00000000..2b4a45bc --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IStrategy.md @@ -0,0 +1,41 @@ +# IStrategy + +_LooksRare protocol team (👀,💎)_ + +> IStrategy + +## Methods + +### isLooksRareV2Strategy + +```solidity +function isLooksRareV2Strategy() external pure returns (bool isStrategy) +``` + +This function acts as a safety check for the protocol's owner when adding new execution strategies. + +#### Returns + +| Name | Type | Description | +| ---------- | ---- | ---------------------------------------------- | +| isStrategy | bool | Whether it is a LooksRare V2 protocol strategy | + +### isMakerOrderValid + +```solidity +function isMakerOrderValid(OrderStructs.Maker makerOrder, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------------------ | ----------- | +| makerOrder | OrderStructs.Maker | undefined | +| functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ------------- | ------ | ----------- | +| isValid | bool | undefined | +| errorSelector | bytes4 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IStrategyManager.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IStrategyManager.md new file mode 100644 index 00000000..ae6ea7b1 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/IStrategyManager.md @@ -0,0 +1,84 @@ +# IStrategyManager + +_LooksRare protocol team (👀,💎)_ + +> IStrategyManager + +## Events + +### NewStrategy + +```solidity +event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) +``` + +It is emitted when a new strategy is added. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | ---------------------------------------------------- | +| strategyId | uint256 | Id of the new strategy | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | +| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | +| selector | bytes4 | Function selector for the transaction to be executed | +| isMakerBid | bool | Whether the strategyId is for maker bid | +| implementation | address | Address of the implementation of the strategy | + +### StrategyUpdated + +```solidity +event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) +``` + +It is emitted when an existing strategy is updated. + +#### Parameters + +| Name | Type | Description | +| --------------------- | ------- | -------------------------------------------------------- | +| strategyId | uint256 | Id of the strategy | +| isActive | bool | Whether the strategy is active (or not) after the update | +| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | +| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | + +## Errors + +### NotV2Strategy + +```solidity +error NotV2Strategy() +``` + +If the strategy has not set properly its implementation contract. + +_It can only be returned for owner operations._ + +### StrategyHasNoSelector + +```solidity +error StrategyHasNoSelector() +``` + +It is returned if the strategy has no selector. + +_It can only be returned for owner operations._ + +### StrategyNotUsed + +```solidity +error StrategyNotUsed() +``` + +It is returned if the strategyId is invalid. + +### StrategyProtocolFeeTooHigh + +```solidity +error StrategyProtocolFeeTooHigh() +``` + +It is returned if the strategy's protocol fee is too high. + +_It can only be returned for owner operations._ diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ITransferManager.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ITransferManager.md new file mode 100644 index 00000000..3ba8ca81 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/interfaces/ITransferManager.md @@ -0,0 +1,111 @@ +# ITransferManager + +_LooksRare protocol team (👀,💎)_ + +> ITransferManager + +## Events + +### ApprovalsGranted + +```solidity +event ApprovalsGranted(address user, address[] operators) +``` + +It is emitted if operators' approvals to transfer NFTs are granted by a user. + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | --------------------------- | +| user | address | Address of the user | +| operators | address[] | Array of operator addresses | + +### ApprovalsRemoved + +```solidity +event ApprovalsRemoved(address user, address[] operators) +``` + +It is emitted if operators' approvals to transfer NFTs are revoked by a user. + +#### Parameters + +| Name | Type | Description | +| --------- | --------- | --------------------------- | +| user | address | Address of the user | +| operators | address[] | Array of operator addresses | + +### OperatorAllowed + +```solidity +event OperatorAllowed(address operator) +``` + +It is emitted if a new operator is added to the global allowlist. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ---------------- | +| operator | address | Operator address | + +### OperatorRemoved + +```solidity +event OperatorRemoved(address operator) +``` + +It is emitted if an operator is removed from the global allowlist. + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ---------------- | +| operator | address | Operator address | + +## Errors + +### OperatorAlreadyAllowed + +```solidity +error OperatorAlreadyAllowed() +``` + +It is returned if the transfer caller is already allowed by the owner. + +_This error can only be returned for owner operations._ + +### OperatorAlreadyApprovedByUser + +```solidity +error OperatorAlreadyApprovedByUser() +``` + +It is returned if the operator to approve has already been approved by the user. + +### OperatorNotAllowed + +```solidity +error OperatorNotAllowed() +``` + +It is returned if the operator to approve is not in the global allowlist defined by the owner. + +_This error can be returned if the user tries to grant approval to an operator address not in the allowlist or if the owner tries to remove the operator from the global allowlist._ + +### OperatorNotApprovedByUser + +```solidity +error OperatorNotApprovedByUser() +``` + +It is returned if the operator to revoke has not been previously approved by the user. + +### TransferCallerInvalid + +```solidity +error TransferCallerInvalid() +``` + +It is returned if the transfer caller is invalid. For a transfer called to be valid, the operator must be in the global allowlist and approved by the 'from' user. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/CurrencyValidator.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/CurrencyValidator.md new file mode 100644 index 00000000..1b1f41a2 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/CurrencyValidator.md @@ -0,0 +1,7 @@ +# CurrencyValidator + +_LooksRare protocol team (👀,💎)_ + +> CurrencyValidator + +This library validates the order currency to be the chain's native currency or the specified ERC20 token. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md new file mode 100644 index 00000000..5951cc56 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md @@ -0,0 +1,21 @@ +# LowLevelHypercertCaller + +_bitbeckers_ + +> LowLevelHypercertCaller + +This contract contains low-level calls to transfer ERC1155 tokens. + +## Errors + +### HypercertSplitFractionError + +```solidity +error HypercertSplitFractionError() +``` + +### NotAContract + +```solidity +error NotAContract() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md new file mode 100644 index 00000000..943a54cd --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md @@ -0,0 +1,7 @@ +# MerkleProofCalldataWithNodes + +_OpenZeppelin (adjusted by LooksRare)_ + +> MerkleProofCalldataWithNodes + +This library is adjusted from the work of OpenZeppelin. It is based on the 4.7.0 (utils/cryptography/MerkleProof.sol). diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md new file mode 100644 index 00000000..37529181 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md @@ -0,0 +1,7 @@ +# MerkleProofMemory + +_OpenZeppelin (adjusted by LooksRare)_ + +> MerkleProofMemory + +This library is adjusted from the work of OpenZeppelin. It is based on the 4.7.0 (utils/cryptography/MerkleProof.sol). diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/OrderStructs.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/OrderStructs.md new file mode 100644 index 00000000..6ffa83e2 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/marketplace/libraries/OrderStructs.md @@ -0,0 +1,7 @@ +# OrderStructs + +_LooksRare protocol team (👀,💎); bitbeckers_ + +> OrderStructs + +This library contains all order struct types for the LooksRare protocol (v2). diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/AllowlistMinter.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/AllowlistMinter.md new file mode 100644 index 00000000..4684053c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/AllowlistMinter.md @@ -0,0 +1,84 @@ +# AllowlistMinter + +_bitbeckers_ + +> Interface for hypercert token interactions + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### hasBeenClaimed + +```solidity +function hasBeenClaimed(uint256, bytes32) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | +| \_1 | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | + +## Events + +### AllowlistCreated + +```solidity +event AllowlistCreated(uint256 tokenID, bytes32 root) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| root | bytes32 | undefined | + +### LeafClaimed + +```solidity +event LeafClaimed(uint256 tokenID, bytes32 leaf) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +## Errors + +### DoesNotExist + +```solidity +error DoesNotExist() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/HypercertMinter.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/HypercertMinter.md new file mode 100644 index 00000000..518efa42 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/HypercertMinter.md @@ -0,0 +1,895 @@ +# HypercertMinter + +_bitbeckers_ + +> Contract for managing hypercert claims and whitelists + +Implementation of the HypercertTokenInterface using { SemiFungible1155 } as underlying token.This contract supports whitelisted minting via { AllowlistMinter }. + +_Wrapper contract to expose and chain functions._ + +## Methods + +### \_\_SemiFungible1155_init + +```solidity +function __SemiFungible1155_init() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### balanceOf + +```solidity +function balanceOf(address account, uint256 id) external view returns (uint256) +``` + +_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### balanceOfBatch + +```solidity +function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) +``` + +_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| accounts | address[] | undefined | +| ids | uint256[] | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | --------- | ----------- | +| \_0 | uint256[] | undefined | + +### batchBurnFraction + +```solidity +function batchBurnFraction(address _account, uint256[] _tokenIDs) external nonpayable +``` + +Burn a claimtoken + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ----------- | +| \_account | address | undefined | +| \_tokenIDs | uint256[] | undefined | + +### batchMintClaimsFromAllowlists + +```solidity +function batchMintClaimsFromAllowlists(address account, bytes32[][] proofs, uint256[] claimIDs, uint256[] units) external nonpayable +``` + +Mint semi-fungible tokens representing a fraction of the claims in `claimIDs` + +_Calls AllowlistMinter to verify `proofs`.Mints the `amount` of units for the hypercert stored under `claimIDs`_ + +#### Parameters + +| Name | Type | Description | +| -------- | ----------- | ----------- | +| account | address | undefined | +| proofs | bytes32[][] | undefined | +| claimIDs | uint256[] | undefined | +| units | uint256[] | undefined | + +### burn + +```solidity +function burn(address account, uint256 id, uint256) external nonpayable +``` + +Burn a claimtoken; override is needed to update units/values + +_see {ERC1155Burnable}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | +| \_2 | uint256 | undefined | + +### burnBatch + +```solidity +function burnBatch(address account, uint256[] ids, uint256[]) external nonpayable +``` + +Batch burn claimtokens; override is needed to update units/values + +_see {ERC1155Burnable}_ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| ids | uint256[] | undefined | +| \_2 | uint256[] | undefined | + +### burnFraction + +```solidity +function burnFraction(address _account, uint256 _tokenID) external nonpayable +``` + +Burn a claimtoken + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| --------- | ------- | ----------- | +| \_account | address | undefined | +| \_tokenID | uint256 | undefined | + +### createAllowlist + +```solidity +function createAllowlist(address account, uint256 units, bytes32 merkleRoot, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Register a claim and the whitelist for minting token(s) belonging to that claim + +_Calls SemiFungible1155 to store the claim referenced in `uri` with amount of `units`Calls AllowlistMinter to store the `merkleRoot` as proof to authorize claims_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| merkleRoot | bytes32 | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### hasBeenClaimed + +```solidity +function hasBeenClaimed(uint256, bytes32) external view returns (bool) +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | +| \_1 | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### initialize + +```solidity +function initialize() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | + +### isApprovedForAll + +```solidity +function isApprovedForAll(address account, address operator) external view returns (bool) +``` + +_See {IERC1155-isApprovedForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| account | address | undefined | +| operator | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### mergeFractions + +```solidity +function mergeFractions(address _account, uint256[] _fractionIDs) external nonpayable +``` + +Merge the value of tokens belonging to the same claim + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------- | --------- | ----------- | +| \_account | address | undefined | +| \_fractionIDs | uint256[] | undefined | + +### mintClaim + +```solidity +function mintClaim(address account, uint256 units, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Mint a semi-fungible token for the impact claim referenced via `uri` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### mintClaimFromAllowlist + +```solidity +function mintClaimFromAllowlist(address account, bytes32[] proof, uint256 claimID, uint256 units) external nonpayable +``` + +Mint a semi-fungible token representing a fraction of the claim + +_Calls AllowlistMinter to verify `proof`.Mints the `amount` of units for the hypercert stored under `claimID`_ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| proof | bytes32[] | undefined | +| claimID | uint256 | undefined | +| units | uint256 | undefined | + +### mintClaimWithFractions + +```solidity +function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +Mint semi-fungible tokens for the impact claim referenced via `uri` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| fractions | uint256[] | undefined | +| \_uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### name + +```solidity +function name() external view returns (string) +``` + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +_Returns the address of the current owner._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownerOf + +```solidity +function ownerOf(uint256 tokenID) external view returns (address _owner) +``` + +_Returns the owner of a given token ID._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| tokenID | uint256 | The ID of the token to query. | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | -------------------------------------- | +| \_owner | address | The address of the owner of the token. | + +### pause + +```solidity +function pause() external nonpayable +``` + +PAUSABLE + +### paused + +```solidity +function paused() external view returns (bool) +``` + +_Returns true if the contract is paused, and false otherwise._ + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### proxiableUUID + +```solidity +function proxiableUUID() external view returns (bytes32) +``` + +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### readTransferRestriction + +```solidity +function readTransferRestriction(uint256 tokenID) external view returns (string) +``` + +TRANSFER RESTRICTIONS + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ + +### safeBatchTransferFrom + +```solidity +function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable +``` + +_See {IERC1155-safeBatchTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| ids | uint256[] | undefined | +| amounts | uint256[] | undefined | +| data | bytes | undefined | + +### safeTransferFrom + +```solidity +function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable +``` + +_See {IERC1155-safeTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| id | uint256 | undefined | +| amount | uint256 | undefined | +| data | bytes | undefined | + +### setApprovalForAll + +```solidity +function setApprovalForAll(address operator, bool approved) external nonpayable +``` + +_See {IERC1155-setApprovalForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | +| approved | bool | undefined | + +### splitFraction + +```solidity +function splitFraction(address _account, uint256 _tokenID, uint256[] _newFractions) external nonpayable +``` + +Split a claimtokens value into parts with summed value equal to the original + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| -------------- | --------- | ----------- | +| \_account | address | undefined | +| \_tokenID | uint256 | undefined | +| \_newFractions | uint256[] | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + +_See {IERC165-supportsInterface}._ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------ | ----------- | +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### unitsOf + +```solidity +function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) +``` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unitsOf + +```solidity +function unitsOf(uint256 tokenID) external view returns (uint256 units) +``` + +_see {IHypercertToken}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unpause + +```solidity +function unpause() external nonpayable +``` + +### upgradeTo + +```solidity +function upgradeTo(address newImplementation) external nonpayable +``` + +_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | + +### upgradeToAndCall + +```solidity +function upgradeToAndCall(address newImplementation, bytes data) external payable +``` + +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string _uri) +``` + +_see { IHypercertMetadata}_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------ | ----------- | +| \_uri | string | undefined | + +## Events + +### AdminChanged + +```solidity +event AdminChanged(address previousAdmin, address newAdmin) +``` + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | ----------- | +| previousAdmin | address | undefined | +| newAdmin | address | undefined | + +### AllowlistCreated + +```solidity +event AllowlistCreated(uint256 tokenID, bytes32 root) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| root | bytes32 | undefined | + +### ApprovalForAll + +```solidity +event ApprovalForAll(address indexed account, address indexed operator, bool approved) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| account `indexed` | address | undefined | +| operator `indexed` | address | undefined | +| approved | bool | undefined | + +### BatchValueTransfer + +```solidity +event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| claimIDs | uint256[] | undefined | +| fromTokenIDs | uint256[] | undefined | +| toTokenIDs | uint256[] | undefined | +| values | uint256[] | undefined | + +### BeaconUpgraded + +```solidity +event BeaconUpgraded(address indexed beacon) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| beacon `indexed` | address | undefined | + +### ClaimStored + +```solidity +event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| claimID `indexed` | uint256 | undefined | +| uri | string | undefined | +| totalUnits | uint256 | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ----- | ----------- | +| version | uint8 | undefined | + +### LeafClaimed + +```solidity +event LeafClaimed(uint256 tokenID, bytes32 leaf) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### Paused + +```solidity +event Paused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### TransferBatch + +```solidity +event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### TransferSingle + +```solidity +event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### URI + +```solidity +event URI(string value, uint256 indexed id) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | ------- | ----------- | +| value | string | undefined | +| id `indexed` | uint256 | undefined | + +### Unpaused + +```solidity +event Unpaused(address account) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | + +### Upgraded + +```solidity +event Upgraded(address indexed implementation) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | + +### ValueTransfer + +```solidity +event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------- | +| claimID | uint256 | undefined | +| fromTokenID | uint256 | undefined | +| toTokenID | uint256 | undefined | +| value | uint256 | undefined | + +## Errors + +### AlreadyClaimed + +```solidity +error AlreadyClaimed() +``` + +### ArraySize + +```solidity +error ArraySize() +``` + +### DoesNotExist + +```solidity +error DoesNotExist() +``` + +### DuplicateEntry + +```solidity +error DuplicateEntry() +``` + +### Invalid + +```solidity +error Invalid() +``` + +### NotAllowed + +```solidity +error NotAllowed() +``` + +### NotApprovedOrOwner + +```solidity +error NotApprovedOrOwner() +``` + +### TransfersNotAllowed + +```solidity +error TransfersNotAllowed() +``` + +### TypeMismatch + +```solidity +error TypeMismatch() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/SemiFungible1155.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/SemiFungible1155.md new file mode 100644 index 00000000..a4086e37 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/SemiFungible1155.md @@ -0,0 +1,457 @@ +# SemiFungible1155 + +_bitbeckers_ + +> Contract for minting semi-fungible EIP1155 tokens + +Extends { Upgradeable1155 } token with semi-fungible properties and the concept of `units` + +_Adds split bit strategy as described in [EIP-1155](https://eips.ethereum.org/EIPS/eip-1155#non-fungible-tokens)_ + +## Methods + +### \_\_SemiFungible1155_init + +```solidity +function __SemiFungible1155_init() external nonpayable +``` + +_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ + +### balanceOf + +```solidity +function balanceOf(address account, uint256 id) external view returns (uint256) +``` + +_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | uint256 | undefined | + +### balanceOfBatch + +```solidity +function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) +``` + +_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| accounts | address[] | undefined | +| ids | uint256[] | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | --------- | ----------- | +| \_0 | uint256[] | undefined | + +### burn + +```solidity +function burn(address account, uint256 id, uint256 value) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### burnBatch + +```solidity +function burnBatch(address account, uint256[] ids, uint256[] values) external nonpayable +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| account | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### isApprovedForAll + +```solidity +function isApprovedForAll(address account, address operator) external view returns (bool) +``` + +_See {IERC1155-isApprovedForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| account | address | undefined | +| operator | address | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + +_Returns the address of the current owner._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | + +### ownerOf + +```solidity +function ownerOf(uint256 tokenID) external view returns (address _owner) +``` + +_Returns the owner of a given token ID._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------- | +| tokenID | uint256 | The ID of the token to query. | + +#### Returns + +| Name | Type | Description | +| ------- | ------- | -------------------------------------- | +| \_owner | address | The address of the owner of the token. | + +### proxiableUUID + +```solidity +function proxiableUUID() external view returns (bytes32) +``` + +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ + +#### Returns + +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ + +### safeBatchTransferFrom + +```solidity +function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable +``` + +_See {IERC1155-safeBatchTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| ids | uint256[] | undefined | +| amounts | uint256[] | undefined | +| data | bytes | undefined | + +### safeTransferFrom + +```solidity +function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable +``` + +_See {IERC1155-safeTransferFrom}._ + +#### Parameters + +| Name | Type | Description | +| ------ | ------- | ----------- | +| from | address | undefined | +| to | address | undefined | +| id | uint256 | undefined | +| amount | uint256 | undefined | +| data | bytes | undefined | + +### setApprovalForAll + +```solidity +function setApprovalForAll(address operator, bool approved) external nonpayable +``` + +_See {IERC1155-setApprovalForAll}._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| operator | address | undefined | +| approved | bool | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + +_See {IERC165-supportsInterface}._ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------ | ----------- | +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ + +#### Parameters + +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | + +### upgradeTo + +```solidity +function upgradeTo(address newImplementation) external nonpayable +``` + +_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | + +### upgradeToAndCall + +```solidity +function upgradeToAndCall(address newImplementation, bytes data) external payable +``` + +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string _uri) +``` + +_Returns the metadata URI for a given token ID.This function retrieves the metadata URI for the specified token ID by calling the `uri` function of the `ERC1155URIStorageUpgradeable` contract.The metadata URI is a string that points to a JSON file containing information about the token, such as its name, symbol, and image.This function always returns the URI for the basetype so that it's managed in one place._ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------------------------------------------------- | +| tokenID | uint256 | The ID of the token to retrieve the metadata URI for. | + +#### Returns + +| Name | Type | Description | +| ----- | ------ | -------------------------------------------- | +| \_uri | string | The metadata URI for the specified token ID. | + +## Events + +### AdminChanged + +```solidity +event AdminChanged(address previousAdmin, address newAdmin) +``` + +#### Parameters + +| Name | Type | Description | +| ------------- | ------- | ----------- | +| previousAdmin | address | undefined | +| newAdmin | address | undefined | + +### ApprovalForAll + +```solidity +event ApprovalForAll(address indexed account, address indexed operator, bool approved) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| account `indexed` | address | undefined | +| operator `indexed` | address | undefined | +| approved | bool | undefined | + +### BatchValueTransfer + +```solidity +event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) +``` + +_Emitted on transfer of `values` between `fromTokenIDs` to `toTokenIDs` of `claimIDs`_ + +#### Parameters + +| Name | Type | Description | +| ------------ | --------- | ----------- | +| claimIDs | uint256[] | undefined | +| fromTokenIDs | uint256[] | undefined | +| toTokenIDs | uint256[] | undefined | +| values | uint256[] | undefined | + +### BeaconUpgraded + +```solidity +event BeaconUpgraded(address indexed beacon) +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| beacon `indexed` | address | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | ----- | ----------- | +| version | uint8 | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + +#### Parameters + +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### TransferBatch + +```solidity +event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | --------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| ids | uint256[] | undefined | +| values | uint256[] | undefined | + +### TransferSingle + +```solidity +event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------ | ------- | ----------- | +| operator `indexed` | address | undefined | +| from `indexed` | address | undefined | +| to `indexed` | address | undefined | +| id | uint256 | undefined | +| value | uint256 | undefined | + +### URI + +```solidity +event URI(string value, uint256 indexed id) +``` + +#### Parameters + +| Name | Type | Description | +| ------------ | ------- | ----------- | +| value | string | undefined | +| id `indexed` | uint256 | undefined | + +### Upgraded + +```solidity +event Upgraded(address indexed implementation) +``` + +#### Parameters + +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | + +### ValueTransfer + +```solidity +event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) +``` + +_Emitted on transfer of `value` between `fromTokenID` to `toTokenID` of the same `claimID`_ + +#### Parameters + +| Name | Type | Description | +| ----------- | ------- | ----------- | +| claimID | uint256 | undefined | +| fromTokenID | uint256 | undefined | +| toTokenID | uint256 | undefined | +| value | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/interfaces/IAllowlist.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/interfaces/IAllowlist.md new file mode 100644 index 00000000..72455b43 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/interfaces/IAllowlist.md @@ -0,0 +1,29 @@ +# IAllowlist + +_bitbeckers_ + +> Interface for allowlist + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### isAllowedToClaim + +```solidity +function isAllowedToClaim(bytes32[] proof, uint256 tokenID, bytes32 leaf) external view returns (bool isAllowed) +``` + +#### Parameters + +| Name | Type | Description | +| ------- | --------- | ----------- | +| proof | bytes32[] | undefined | +| tokenID | uint256 | undefined | +| leaf | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +| --------- | ---- | ----------- | +| isAllowed | bool | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/interfaces/IHypercertToken.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/interfaces/IHypercertToken.md new file mode 100644 index 00000000..30ed6f95 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/interfaces/IHypercertToken.md @@ -0,0 +1,192 @@ +# IHypercertToken + +_bitbeckers_ + +> Interface for hypercert token interactions + +This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) + +## Methods + +### batchBurnFraction + +```solidity +function batchBurnFraction(address account, uint256[] tokenIDs) external nonpayable +``` + +Operator must be allowed by `creator` and the tokens must represent the total amount of available units. + +_Function to burn the tokens at `tokenIDs` for `account`_ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenIDs | uint256[] | undefined | + +### burnFraction + +```solidity +function burnFraction(address account, uint256 tokenID) external nonpayable +``` + +Operator must be allowed by `creator` and the token must represent the total amount of available units. + +_Function to burn the token at `tokenID` for `account`_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +### mergeFractions + +```solidity +function mergeFractions(address account, uint256[] tokenIDs) external nonpayable +``` + +Tokens that have been merged are burned. + +_Function called to merge tokens within `tokenIDs`._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenIDs | uint256[] | undefined | + +### mintClaim + +```solidity +function mintClaim(address account, uint256 units, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +_Function called to store a claim referenced via `uri` with a maximum number of fractions `units`._ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### mintClaimWithFractions + +```solidity +function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable +``` + +_Function called to store a claim referenced via `uri` with a set of `fractions`.Fractions are internally summed to total units._ + +#### Parameters + +| Name | Type | Description | +| ------------ | ----------------------------------------- | ----------- | +| account | address | undefined | +| units | uint256 | undefined | +| fractions | uint256[] | undefined | +| uri | string | undefined | +| restrictions | enum IHypercertToken.TransferRestrictions | undefined | + +### splitFraction + +```solidity +function splitFraction(address account, uint256 tokenID, uint256[] _values) external nonpayable +``` + +The sum of `values` must equal the current value of `_tokenID`. + +_Function called to split `tokenID` owned by `account` into units declared in `values`._ + +#### Parameters + +| Name | Type | Description | +| -------- | --------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | +| \_values | uint256[] | undefined | + +### unitsOf + +```solidity +function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) +``` + +_Returns the `units` held by `account` of a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` held by `account` for the claim is returned.If `tokenID` is a fractional token, the `units` held by `account` the token is returned_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### unitsOf + +```solidity +function unitsOf(uint256 tokenID) external view returns (uint256 units) +``` + +_Returns the `units` held by a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` for the claim is returned.If `tokenID` is a fractional token, the `units` held by the token is returned_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| ----- | ------- | ----------- | +| units | uint256 | undefined | + +### uri + +```solidity +function uri(uint256 tokenID) external view returns (string metadata) +``` + +_Returns the `uri` for metadata of the claim represented by `tokenID`Metadata must conform to { Hypercert Metadata } spec (based on ERC1155 Metadata)_ + +#### Parameters + +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenID | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +| -------- | ------ | ----------- | +| metadata | string | undefined | + +## Events + +### ClaimStored + +```solidity +event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) +``` + +_Emitted when token with tokenID `claimID` is stored, with external data reference via `uri`._ + +#### Parameters + +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| claimID `indexed` | uint256 | undefined | +| uri | string | undefined | +| totalUnits | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/libs/Errors.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/libs/Errors.md new file mode 100644 index 00000000..93fe0124 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/contracts/protocol/libs/Errors.md @@ -0,0 +1,59 @@ +# Errors + +_bitbeckers_ + +## Errors + +### AlreadyClaimed + +```solidity +error AlreadyClaimed() +``` + +### ArraySize + +```solidity +error ArraySize() +``` + +### DoesNotExist + +```solidity +error DoesNotExist() +``` + +### DuplicateEntry + +```solidity +error DuplicateEntry() +``` + +### Invalid + +```solidity +error Invalid() +``` + +### NotAllowed + +```solidity +error NotAllowed() +``` + +### NotApprovedOrOwner + +```solidity +error NotApprovedOrOwner() +``` + +### TransfersNotAllowed + +```solidity +error TransfersNotAllowed() +``` + +### TypeMismatch + +```solidity +error TypeMismatch() +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/.nojekyll b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/.nojekyll new file mode 100644 index 00000000..e2ac6616 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/README.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/README.md new file mode 100644 index 00000000..b1434ab0 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/README.md @@ -0,0 +1,185 @@ +Hypercerts SDK Documentation / [Exports](modules.md) + +# Hypercert SDK + +## Quickstart Guide + +1. Install the SDK using npm or yarn: + +```bash +npm install @hypercerts-org/sdk +``` + +or + +```bash + yarn add @hypercerts-org/sdk +``` + +2. Import the SDK into your project: + +```bash +import { HypercertClient } from "@hypercerts-org/sdk"; +``` + +3. Create a new instance of the HypercertClient class with your configuration options: + +```js +const client = new HypercertClient({ + chainId: 5, + provider, + signer, + nftStorageToken, + web3StorageToken, +}); +``` + +> **Note** If there's no `signer`, `provider`, `nftStorageToken` or `web3StorageToken` provided, the client will run in +> [read-only mode](#read-only-mode) + +4. Use the client object to interact with the Hypercert network. + +For example, you can use the `client.mintClaim` method to create a new claim: + +```js +const tx = await client.mintClaim( + metaData, + totalUnits, + transferRestriction, + overrides, +); +``` + +This will validate the metadata, store it on IPFS, create a new hypercert on-chain and return a transaction receipt. + +You can also use the client to query the subgraph and retrieve which claims an address owns: + +```js +const claims = await client.indexer.fractionsByOwner(owner), +``` + +For more information on how to use the SDK, check out the +[developer documentation](https://hypercerts.org/docs/developer/) and the +[Graph playground](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-testnet). + +That's it! With these simple steps, you can start using the Hypercert SDK in your own projects. Don't forget to set your +environment variables for your NFT.storage and web3.storage API keys in your .env file. + +## Config + +The SDK will try to determine the `DEFAULT_CHAIN_ID` and use that to inform the configuration. We allow for `overrides` +when creating the SDK by passing configuration variables. Finally, when not defaults or overrides are found, we check +the environment variables. + +### Read-only mode + +The SDK client will be in read-only mode if any of the following conditions are true: + +- The client was initialized without a signer or provider. +- The client was initialized with a provider but not a signer. +- The client was initialized with a signer but not a provider. +- The contract address is not set. +- The storage layer is in read-only mode. + +If any of these conditions are true, the readonly property of the HypercertClient instance will be set to true, and a +warning message will be logged indicating that the client is in read-only mode. + +### Defaults + +The constants.ts file defines various constants that are used throughout the Hypercert system. Here's a brief +explanation of each constant: + +`DEFAULT_CHAIN_ID`: This constant defines the default chain ID to use if no chain ID is specified. In this case, the +default chain ID is set to 5, which corresponds to the Goerli testnet. + +Based on `DEFAULT_CHAIN_ID` the SDK will select a `DEPLOYMENT`. + +`DEPLOYMENTS`: This constant defines the deployments that are managed by the Hypercert system. Each Deployment object +contains information about a specific deployment, including the chain ID, chain name, contract address, and graph name. + +For example: + +```json +{ + "5": { + "chainId": 5, + "chainName": "goerli", + "contractAddress": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", + "graphName": "hypercerts-testnet" + } +} +``` + +### Client config properties + +| \| Property | Type | Description | +| ------------------ | -------------------- | -------------------------------------- | +| `chainId` | `number` | The chain ID of the network to use. | +| `chainName` | `string` | The name of the network to use. | +| `contractAddress` | `string` | The address of the Hypercert contract. | +| `rpcUrl` | `string` | The URL of the RPC endpoint to use. | +| `graphName` | `string` | The name of the Gsubgraph to use. | +| `provider` | `providers.Provider` | A custom provider to use. | +| `signer` | `Signer` | A custom signer to use. | +| `nftStorageToken` | `string` | Your NFT.storage API key. | +| `web3StorageToken` | `string` | Your web3.storage API key. | + +### Environment variables + +To determine the missing configuration values the SDK defaults to the following environment variables: + +| Environment Variable | Description | +| -------------------------------- | --------------------------------------------------------------------------------------------------- | +| `DEFAULT_CHAIN_ID` | Specifies the default chain ID to use if no chain ID is specified. | +| `CONTRACT_ADDRESS` | Specifies the contract address to use for the Hypercert protocol. | +| `RPC_URL` | Specifies the RPC URL to use for the evm-compatible network. | +| `PRIVATE_KEY` | Specifies the private key to use for signing transactions. | +| `NFT_STORAGE_TOKEN` | Specifies the NFT.storage API token to use for storing Hypercert metadata. | +| `NEXT_PUBLIC_NFT_STORAGE_TOKEN` | Specifies the NFT.storage API token to use for storing Hypercert metadata in a Next.js application. | +| `WEB3_STORAGE_TOKEN` | Specifies the Web3.storage API token to use for storing Hypercert data. | +| `NEXT_PUBLIC_WEB3_STORAGE_TOKEN` | Specifies the Web3.storage API token to use for storing Hypercert data in a Next.js application. | + +### Logging + +The logger for the SDK uses the log level based on the value of the LOG_LEVEL environment variable. The log level +determines which log messages are printed to the console. By default, the logger is configured to log messages with a +level of info or higher to the console. + +## Client modules + +The `HypercertClient` provides a high-level interface for interacting with the Hypercert ecosystem. The HypercertClient +has three getter methods: `storage`, `indexer`, and `contract`. These methods return instances of the HypercertsStorage, +HypercertIndexer, and HypercertMinter classes, respectively. + +```js +const { + client: { storage }, +} = new HypercertClient({}); +``` + +The `storage` is a utility class that provides methods for storing and retrieving Hypercert metadata on IPFS and +NFT.storage. It is used by the HypercertClient to store metadata when creating new Hypercerts. + +```js +const { + client: { indexer }, +} = new HypercertClient({}); +``` + +The `indexer` is a utility class that provides methods for indexing and searching Hypercerts based on various criteria. +It is used by the HypercertClient to retrieve event-based data via the subgraph + +```js +const { + client: { contract }, +} = new HypercertClient({}); +``` + +Finally we have a `contract` that provides methods for interacting with the HypercertMinter smart contract. It is used +by the HypercertClient to create new Hypercerts and retrieve specific on-chain information. + +By providing instances of these classes through the storage, indexer, and contract getters, the HypercertClient allows +developers to easily interact with the various components of the Hypercert system. For example, a developer could use +the storage instance to store metadata for a new Hypercert, the indexer instance to search for existing Hypercerts based +on various criteria, and the contract instance to create new Hypercerts and retrieve existing Hypercerts from the +contract. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/ClientError.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/ClientError.md new file mode 100644 index 00000000..89f2105f --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/ClientError.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / ClientError + +# Class: ClientError + +An error that is caused by a problem with the client. + +## Hierarchy + +- `Error` + + ↳ **`ClientError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](ClientError.md#constructor) + +### Properties + +- [payload](ClientError.md#payload) + +## Constructors + +### constructor + +• **new ClientError**(`message`, `payload?`) + +Creates a new instance of the ClientError class. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:25](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L25) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:18](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L18) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/ConfigurationError.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/ConfigurationError.md new file mode 100644 index 00000000..03813867 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/ConfigurationError.md @@ -0,0 +1,66 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / ConfigurationError + +# Class: ConfigurationError + +The configuration was invalid + +## Hierarchy + +- `Error` + + ↳ **`ConfigurationError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](ConfigurationError.md#constructor) + +### Properties + +- [payload](ConfigurationError.md#payload) + +## Constructors + +### constructor + +• **new ConfigurationError**(`message`, `payload?`) + +#### Parameters + +| Name | Type | +| :--------- | :------- | +| `message` | `string` | +| `payload?` | `Object` | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:166](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L166) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:165](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L165) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/FetchError.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/FetchError.md new file mode 100644 index 00000000..d4c9f7c9 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/FetchError.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / FetchError + +# Class: FetchError + +Fails fetching a remote resource + +## Hierarchy + +- `Error` + + ↳ **`FetchError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](FetchError.md#constructor) + +### Properties + +- [payload](FetchError.md#payload) + +## Constructors + +### constructor + +• **new FetchError**(`message`, `payload?`) + +Creates a new instance of the FetchError class. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:43](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L43) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:36](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L36) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/HypercertClient.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/HypercertClient.md new file mode 100644 index 00000000..a5a0e900 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/HypercertClient.md @@ -0,0 +1,493 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertClient + +# Class: HypercertClient + +Hypercerts client factory + +**`Dev`** + +Creates a Hypercerts client instance + +**`Notice`** + +The client is readonly if no signer is set or if the contract address is not set + +**`Param`** + +Hypercerts client configuration + +**`Param`** + +Hypercerts storage object + +## Implements + +- [`HypercertClientInterface`](../interfaces/HypercertClientInterface.md) + +## Table of contents + +### Constructors + +- [constructor](HypercertClient.md#constructor) + +### Properties + +- [\_config](HypercertClient.md#_config) +- [\_contract](HypercertClient.md#_contract) +- [\_evaluator](HypercertClient.md#_evaluator) +- [\_indexer](HypercertClient.md#_indexer) +- [\_operator](HypercertClient.md#_operator) +- [\_storage](HypercertClient.md#_storage) +- [readonly](HypercertClient.md#readonly) + +### Accessors + +- [contract](HypercertClient.md#contract) +- [indexer](HypercertClient.md#indexer) +- [storage](HypercertClient.md#storage) + +### Methods + +- [batchMintClaimFractionsFromAllowlists](HypercertClient.md#batchmintclaimfractionsfromallowlists) +- [burnClaimFraction](HypercertClient.md#burnclaimfraction) +- [checkWritable](HypercertClient.md#checkwritable) +- [createAllowlist](HypercertClient.md#createallowlist) +- [mergeClaimUnits](HypercertClient.md#mergeclaimunits) +- [mintClaim](HypercertClient.md#mintclaim) +- [mintClaimFractionFromAllowlist](HypercertClient.md#mintclaimfractionfromallowlist) +- [splitClaimUnits](HypercertClient.md#splitclaimunits) + +## Constructors + +### constructor + +• **new HypercertClient**(`config?`) + +Creates a new instance of the `HypercertClient` class. + +#### Parameters + +| Name | Type | Description | +| :------- | :------------------------------------------------------------------------- | :---------------------------------------- | +| `config` | `Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> | The configuration options for the client. | + +#### Defined in + +[sdk/src/client.ts:45](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L45) + +## Properties + +### \_config + +• `Private` **\_config**: [`HypercertClientConfig`](../modules.md#hypercertclientconfig) + +#### Defined in + +[sdk/src/client.ts:32](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L32) + +--- + +### \_contract + +• `Private` **\_contract**: [`HypercertMinter`](../interfaces/internal.HypercertMinter.md) + +#### Defined in + +[sdk/src/client.ts:38](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L38) + +--- + +### \_evaluator + +• `Private` **\_evaluator**: [`default`](internal.default.md) + +#### Defined in + +[sdk/src/client.ts:34](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L34) + +--- + +### \_indexer + +• `Private` **\_indexer**: [`default`](internal.default-1.md) + +#### Defined in + +[sdk/src/client.ts:35](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L35) + +--- + +### \_operator + +• `Private` **\_operator**: `Provider` \| `Signer` + +#### Defined in + +[sdk/src/client.ts:37](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L37) + +--- + +### \_storage + +• `Private` **\_storage**: [`HypercertsStorage`](HypercertsStorage.md) + +#### Defined in + +[sdk/src/client.ts:33](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L33) + +--- + +### readonly + +• **readonly**: `boolean` + +Whether the client is in read-only mode. + +#### Implementation of + +[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[readonly](../interfaces/HypercertClientInterface.md#readonly) + +#### Defined in + +[sdk/src/client.ts:39](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L39) + +## Accessors + +### contract + +• `get` **contract**(): [`HypercertMinter`](../interfaces/internal.HypercertMinter.md) + +Gets the HypercertMinter contract used by the client. + +#### Returns + +[`HypercertMinter`](../interfaces/internal.HypercertMinter.md) + +The contract. + +#### Implementation of + +[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[contract](../interfaces/HypercertClientInterface.md#contract) + +#### Defined in + +[sdk/src/client.ts:90](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L90) + +--- + +### indexer + +• `get` **indexer**(): [`default`](internal.default-1.md) + +Gets the indexer for the client. + +#### Returns + +[`default`](internal.default-1.md) + +The indexer. + +#### Implementation of + +[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[indexer](../interfaces/HypercertClientInterface.md#indexer) + +#### Defined in + +[sdk/src/client.ts:82](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L82) + +--- + +### storage + +• `get` **storage**(): [`HypercertsStorage`](HypercertsStorage.md) + +Gets the storage layer for the client. + +#### Returns + +[`HypercertsStorage`](HypercertsStorage.md) + +The storage layer. + +#### Implementation of + +[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[storage](../interfaces/HypercertClientInterface.md#storage) + +#### Defined in + +[sdk/src/client.ts:74](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L74) + +## Methods + +### batchMintClaimFractionsFromAllowlists + +▸ **batchMintClaimFractionsFromAllowlists**(`claimIds`, `units`, `proofs`, `roots?`, `overrides?`): `Promise`<`ContractTransaction`\> + +Batch mints a claim fraction from an allowlist + +**`Note`** + +The length of the arrays must be equal. + +**`Note`** + +The order of the arrays must be equal. + +#### Parameters + +| Name | Type | Description | +| :----------- | :--------------- | :---------------------------------------------------- | +| `claimIds` | `BigNumberish`[] | Array of the IDs of the claims to mint fractions for. | +| `units` | `BigNumberish`[] | Array of the number of units for each fraction. | +| `proofs` | `BytesLike`[][] | Array of Merkle proofs for the allowlists. | +| `roots?` | `BytesLike`[] | - | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +A Promise that resolves to the transaction receipt + +#### Implementation of + +HypercertClientInterface.batchMintClaimFractionsFromAllowlists + +#### Defined in + +[sdk/src/client.ts:317](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L317) + +--- + +### burnClaimFraction + +▸ **burnClaimFraction**(`claimId`, `overrides?`): `Promise`<`ContractTransaction`\> + +Burn a Hypercert claim by providing the claim id + +**`Dev`** + +Burns a Hypercert claim + +#### Parameters + +| Name | Type | Description | +| :----------- | :------------- | :----------------- | +| `claimId` | `BigNumberish` | Hypercert claim id | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +Contract transaction + +#### Implementation of + +HypercertClientInterface.burnClaimFraction + +#### Defined in + +[sdk/src/client.ts:251](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L251) + +--- + +### checkWritable + +▸ `Private` **checkWritable**(): `boolean` + +#### Returns + +`boolean` + +#### Defined in + +[sdk/src/client.ts:347](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L347) + +--- + +### createAllowlist + +▸ **createAllowlist**(`allowList`, `metaData`, `totalUnits`, `transferRestriction`, `overrides?`): `Promise`<`ContractTransaction`\> + +Create a Hypercert claim with an allowlist + +**`Dev`** + +Mints a Hypercert claim with the given metadata, total units, transfer restrictions and allowlist + +**`Notice`** + +The total number of units in the allowlist must match the total number of units for the Hypercert + +#### Parameters + +| Name | Type | Description | +| :-------------------- | :------------------------------------------------------------- | :-------------------------------------- | +| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | Allowlist for the Hypercert | +| `metaData` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | Hypercert metadata | +| `totalUnits` | `BigNumberish` | Total number of units for the Hypercert | +| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | Transfer restrictions for the Hypercert | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +Contract transaction + +#### Implementation of + +HypercertClientInterface.createAllowlist + +#### Defined in + +[sdk/src/client.ts:140](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L140) + +--- + +### mergeClaimUnits + +▸ **mergeClaimUnits**(`claimIds`, `overrides?`): `Promise`<`ContractTransaction`\> + +Merge multiple Hypercert claims fractions into one + +**`Dev`** + +Merges multiple Hypercert claims into one + +#### Parameters + +| Name | Type | Description | +| :----------- | :--------------- | :------------------ | +| `claimIds` | `BigNumberish`[] | Hypercert claim ids | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +Contract transaction + +#### Implementation of + +HypercertClientInterface.mergeClaimUnits + +#### Defined in + +[sdk/src/client.ts:221](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L221) + +--- + +### mintClaim + +▸ **mintClaim**(`metaData`, `totalUnits`, `transferRestriction`, `overrides?`): `Promise`<`ContractTransaction`\> + +Mint a Hypercert claim + +**`Dev`** + +Mints a Hypercert claim with the given metadata, total units and transfer restrictions + +#### Parameters + +| Name | Type | Description | +| :-------------------- | :------------------------------------------------------------- | :-------------------------------------- | +| `metaData` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | Hypercert metadata | +| `totalUnits` | `BigNumberish` | Total number of units for the Hypercert | +| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | Transfer restrictions for the Hypercert | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +Contract transaction + +#### Implementation of + +HypercertClientInterface.mintClaim + +#### Defined in + +[sdk/src/client.ts:102](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L102) + +--- + +### mintClaimFractionFromAllowlist + +▸ **mintClaimFractionFromAllowlist**(`claimId`, `units`, `proof`, `root?`, `overrides?`): `Promise`<`ContractTransaction`\> + +Mint a Hypercert claim fraction from an allowlist. + +**`Dev`** + +Verifies the claim proof and mints the claim fraction + +**`Notice`** + +If known, provide the root for client side verification + +#### Parameters + +| Name | Type | Description | +| :----------- | :------------- | :------------------------- | +| `claimId` | `BigNumberish` | Hypercert claim id | +| `units` | `BigNumberish` | Number of units to mint | +| `proof` | `BytesLike`[] | Merkle proof for the claim | +| `root?` | `BytesLike` | - | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +Contract transaction + +#### Implementation of + +HypercertClientInterface.mintClaimFractionFromAllowlist + +#### Defined in + +[sdk/src/client.ts:278](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L278) + +--- + +### splitClaimUnits + +▸ **splitClaimUnits**(`claimId`, `fractions`, `overrides?`): `Promise`<`ContractTransaction`\> + +Split a Hypercert's unit into multiple claims with the given fractions + +**`Dev`** + +Submit the ID of the claim to split and new fraction values. + +**`Notice`** + +The sum of the fractions must be equal to the total units of the claim + +#### Parameters + +| Name | Type | Description | +| :----------- | :--------------- | :---------------------------------------- | +| `claimId` | `BigNumberish` | Hypercert claim id | +| `fractions` | `BigNumberish`[] | Fractions of the Hypercert claim to split | +| `overrides?` | `Overrides` | - | + +#### Returns + +`Promise`<`ContractTransaction`\> + +Contract transaction + +#### Implementation of + +HypercertClientInterface.splitClaimUnits + +#### Defined in + +[sdk/src/client.ts:190](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/client.ts#L190) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/HypercertsStorage.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/HypercertsStorage.md new file mode 100644 index 00000000..706c14fe --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/HypercertsStorage.md @@ -0,0 +1,250 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertsStorage + +# Class: HypercertsStorage + +A class that provides storage functionality for Hypercerts. + +## Implements + +- [`HypercertStorageInterface`](../interfaces/HypercertStorageInterface.md) + +## Table of contents + +### Constructors + +- [constructor](HypercertsStorage.md#constructor) + +### Properties + +- [nftStorageClient](HypercertsStorage.md#nftstorageclient) +- [readonly](HypercertsStorage.md#readonly) +- [web3StorageClient](HypercertsStorage.md#web3storageclient) + +### Methods + +- [getData](HypercertsStorage.md#getdata) +- [getMetadata](HypercertsStorage.md#getmetadata) +- [getNftStorageGatewayUri](HypercertsStorage.md#getnftstoragegatewayuri) +- [storeData](HypercertsStorage.md#storedata) +- [storeMetadata](HypercertsStorage.md#storemetadata) + +## Constructors + +### constructor + +• **new HypercertsStorage**(`overrides`) + +Creates a new instance of the `HypercertsStorage` class. + +#### Parameters + +| Name | Type | Description | +| :---------- | :--------------------------------------------------------------------------- | :------------------------------------------- | +| `overrides` | `Partial`<[`HypercertStorageConfig`](../modules.md#hypercertstorageconfig)\> | The configuration overrides for the storage. | + +#### Defined in + +[sdk/src/storage.ts:37](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L37) + +## Properties + +### nftStorageClient + +• `Optional` **nftStorageClient**: `NFTStorage` + +The NFT storage client. + +#### Defined in + +[sdk/src/storage.ts:29](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L29) + +--- + +### readonly + +• **readonly**: `boolean` = `true` + +Whether the storage is read-only. + +#### Defined in + +[sdk/src/storage.ts:27](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L27) + +--- + +### web3StorageClient + +• `Optional` **web3StorageClient**: `any` + +The Web3 storage client. + +#### Defined in + +[sdk/src/storage.ts:31](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L31) + +## Methods + +### getData + +▸ **getData**(`cidOrIpfsUri`): `Promise`<`any`\> + +Gets arbitrary data from Web3 storage. + +**`Throws`** + +A `StorageError` if the storage client is not configured or the data cannot be retrieved. + +#### Parameters + +| Name | Type | Description | +| :------------- | :------- | :-------------------------------------- | +| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the data to get. | + +#### Returns + +`Promise`<`any`\> + +A Promise that resolves to the data. + +#### Implementation of + +HypercertStorageInterface.getData + +#### Defined in + +[sdk/src/storage.ts:147](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L147) + +--- + +### getMetadata + +▸ **getMetadata**(`cidOrIpfsUri`): `Promise`<[`HypercertMetadata`](../interfaces/HypercertMetadata.md)\> + +Gets metadata for a Hypercert. + +**`Throws`** + +A `StorageError` if the storage client is not configured or the metadata cannot be retrieved. + +**`Throws`** + +A `MalformedDataError` if the metadata is invalid. E.g. unknown schema + +#### Parameters + +| Name | Type | Description | +| :------------- | :------- | :------------------------------------------ | +| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the metadata to get. | + +#### Returns + +`Promise`<[`HypercertMetadata`](../interfaces/HypercertMetadata.md)\> + +A Promise that resolves to the metadata. + +#### Implementation of + +HypercertStorageInterface.getMetadata + +#### Defined in + +[sdk/src/storage.ts:97](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L97) + +--- + +### getNftStorageGatewayUri + +▸ **getNftStorageGatewayUri**(`cidOrIpfsUri`): `string` + +#### Parameters + +| Name | Type | +| :------------- | :------- | +| `cidOrIpfsUri` | `string` | + +#### Returns + +`string` + +#### Defined in + +[sdk/src/storage.ts:181](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L181) + +--- + +### storeData + +▸ **storeData**(`data`): `Promise`<`CIDString`\> + +Stores arbitrary data in Web3 storage. + +**`Throws`** + +A `StorageError` if the storage client is not configured. + +**`Notice`** + +Even though web3.storage takes a list of files, we'll assume we're only storing 1 JSON blob. +Because we pay for storage quotas, this data is stored best effort. +If you are using our default keys, we may delete older data if we hit our storage quota. + +#### Parameters + +| Name | Type | Description | +| :----- | :-------- | :----------------- | +| `data` | `unknown` | The data to store. | + +#### Returns + +`Promise`<`CIDString`\> + +A Promise that resolves to the CID of the stored data. + +#### Implementation of + +HypercertStorageInterface.storeData + +#### Defined in + +[sdk/src/storage.ts:125](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L125) + +--- + +### storeMetadata + +▸ **storeMetadata**(`data`): `Promise`<`CIDString`\> + +Stores metadata for a Hypercert. + +**`Throws`** + +A `StorageError` if the storage client is not configured. + +**`Throws`** + +A `MalformedDataError` if the metadata is invalid. + +**`Notice`** + +Because we pay for storage quotas, this data is stored best effort. +If you are using our default keys, we may delete older data if we hit our storage quota. + +#### Parameters + +| Name | Type | Description | +| :----- | :-------------------------------------------------------- | :--------------------- | +| `data` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | The metadata to store. | + +#### Returns + +`Promise`<`CIDString`\> + +A Promise that resolves to the CID of the stored metadata. + +#### Implementation of + +HypercertStorageInterface.storeMetadata + +#### Defined in + +[sdk/src/storage.ts:67](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/storage.ts#L67) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/InvalidOrMissingError.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/InvalidOrMissingError.md new file mode 100644 index 00000000..d12c0653 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/InvalidOrMissingError.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / InvalidOrMissingError + +# Class: InvalidOrMissingError + +The provided value was undefined or empty + +## Hierarchy + +- `Error` + + ↳ **`InvalidOrMissingError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](InvalidOrMissingError.md#constructor) + +### Properties + +- [payload](InvalidOrMissingError.md#payload) + +## Constructors + +### constructor + +• **new InvalidOrMissingError**(`message`, `payload?`) + +Creates a new instance of the InvalidOrMissingError class. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:61](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L61) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:54](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L54) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/MalformedDataError.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/MalformedDataError.md new file mode 100644 index 00000000..028129d8 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/MalformedDataError.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / MalformedDataError + +# Class: MalformedDataError + +Data doesn't conform to expectations + +## Hierarchy + +- `Error` + + ↳ **`MalformedDataError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](MalformedDataError.md#constructor) + +### Properties + +- [payload](MalformedDataError.md#payload) + +## Constructors + +### constructor + +• **new MalformedDataError**(`message`, `payload?`) + +Creates a new instance of the MalformedDataError class. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:133](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L133) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:126](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L126) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/MintingError.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/MintingError.md new file mode 100644 index 00000000..de284494 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/MintingError.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / MintingError + +# Class: MintingError + +Minting transaction failed + +## Hierarchy + +- `Error` + + ↳ **`MintingError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](MintingError.md#constructor) + +### Properties + +- [payload](MintingError.md#payload) + +## Constructors + +### constructor + +• **new MintingError**(`message`, `payload?`) + +Creates a new instance of the MintingError class. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:79](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L79) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:72](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L72) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/StorageError.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/StorageError.md new file mode 100644 index 00000000..0dcf0291 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/StorageError.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / StorageError + +# Class: StorageError + +Fails storing to a remote resource + +## Hierarchy + +- `Error` + + ↳ **`StorageError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](StorageError.md#constructor) + +### Properties + +- [payload](StorageError.md#payload) + +## Constructors + +### constructor + +• **new StorageError**(`message`, `payload?`) + +Creates a new instance of the StorageError class. + +#### Parameters + +| Name | Type | Description | +| :--------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:97](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L97) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:90](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L90) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/UnknownSchemaError.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/UnknownSchemaError.md new file mode 100644 index 00000000..5fdb25e0 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/UnknownSchemaError.md @@ -0,0 +1,71 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / UnknownSchemaError + +# Class: UnknownSchemaError + +Schema could not be loaded + +## Hierarchy + +- `Error` + + ↳ **`UnknownSchemaError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](UnknownSchemaError.md#constructor) + +### Properties + +- [payload](UnknownSchemaError.md#payload) + +## Constructors + +### constructor + +• **new UnknownSchemaError**(`message`, `payload?`) + +Creates a new instance of the UnknownSchemaError class. + +#### Parameters + +| Name | Type | Description | +| :------------------- | :------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | +| `payload.schemaName` | `string` | - | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:115](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L115) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Type declaration + +| Name | Type | +| :----------- | :------- | +| `schemaName` | `string` | + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:108](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L108) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/UnsupportedChainError.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/UnsupportedChainError.md new file mode 100644 index 00000000..0964b138 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/UnsupportedChainError.md @@ -0,0 +1,72 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / UnsupportedChainError + +# Class: UnsupportedChainError + +This blockchain is not yet supported +Please file an issue + +## Hierarchy + +- `Error` + + ↳ **`UnsupportedChainError`** + +## Implements + +- [`CustomError`](../interfaces/CustomError.md) + +## Table of contents + +### Constructors + +- [constructor](UnsupportedChainError.md#constructor) + +### Properties + +- [payload](UnsupportedChainError.md#payload) + +## Constructors + +### constructor + +• **new UnsupportedChainError**(`message`, `payload?`) + +Creates a new instance of the UnsupportedChainError class. + +#### Parameters + +| Name | Type | Description | +| :---------------- | :---------------------------------- | :------------------------ | +| `message` | `string` | The error message. | +| `payload?` | `Object` | Additional error payload. | +| `payload.chainID` | `undefined` \| `string` \| `number` | - | + +#### Overrides + +Error.constructor + +#### Defined in + +[sdk/src/types/errors.ts:152](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L152) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Type declaration + +| Name | Type | +| :-------- | :---------------------------------- | +| `chainID` | `undefined` \| `string` \| `number` | + +#### Implementation of + +[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) + +#### Defined in + +[sdk/src/types/errors.ts:145](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L145) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/internal.default-1.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/internal.default-1.md new file mode 100644 index 00000000..1b94a629 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/internal.default-1.md @@ -0,0 +1,278 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / [internal](../modules/internal.md) / default + +# Class: default + +[internal](../modules/internal.md).default + +A class that provides indexing functionality for Hypercerts. + +## Implements + +- [`HypercertIndexerInterface`](../interfaces/HypercertIndexerInterface.md) + +## Table of contents + +### Constructors + +- [constructor](internal.default-1.md#constructor) + +### Properties + +- [\_graphClient](internal.default-1.md#_graphclient) + +### Accessors + +- [graphClient](internal.default-1.md#graphclient) + +### Methods + +- [claimById](internal.default-1.md#claimbyid) +- [claimsByOwner](internal.default-1.md#claimsbyowner) +- [firstClaims](internal.default-1.md#firstclaims) +- [fractionById](internal.default-1.md#fractionbyid) +- [fractionsByClaim](internal.default-1.md#fractionsbyclaim) +- [fractionsByOwner](internal.default-1.md#fractionsbyowner) + +## Constructors + +### constructor + +• **new default**(`options`) + +Creates a new instance of the `HypercertIndexer` class. + +#### Parameters + +| Name | Type | Description | +| :------------------ | :------- | :----------------------------------------- | +| `options` | `Object` | The configuration options for the indexer. | +| `options.graphUrl?` | `string` | - | + +#### Defined in + +[sdk/src/indexer.ts:17](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L17) + +## Properties + +### \_graphClient + +• `Private` **\_graphClient**: `Object` + +The Graph client used by the indexer. + +#### Type declaration + +| Name | Type | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ClaimById` | (`variables`: [`Exact`](../modules/internal.md#exact)<{ `id`: `string` }\>, `options?`: `unknown`) => `Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> | +| `ClaimTokenById` | (`variables`: [`Exact`](../modules/internal.md#exact)<{ `claimTokenId`: `string` }\>, `options?`: `unknown`) => `Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> | +| `ClaimTokensByClaim` | (`variables`: [`Exact`](../modules/internal.md#exact)<{ `claimId`: `string` ; `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> | +| `ClaimTokensByOwner` | (`variables?`: [`Exact`](../modules/internal.md#exact)<{ `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `owner?`: `any` ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> | +| `ClaimsByOwner` | (`variables?`: [`Exact`](../modules/internal.md#exact)<{ `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `owner?`: `any` ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> | +| `RecentClaims` | (`variables?`: [`Exact`](../modules/internal.md#exact)<{ `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> | + +#### Defined in + +[sdk/src/indexer.ts:11](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L11) + +## Accessors + +### graphClient + +• `get` **graphClient**(): `Object` + +Gets the Graph client used by the indexer. + +#### Returns + +`Object` + +The Graph client. + +| Name | Type | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ClaimById` | (`variables`: [`Exact`](../modules/internal.md#exact)<{ `id`: `string` }\>, `options?`: `unknown`) => `Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> | +| `ClaimTokenById` | (`variables`: [`Exact`](../modules/internal.md#exact)<{ `claimTokenId`: `string` }\>, `options?`: `unknown`) => `Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> | +| `ClaimTokensByClaim` | (`variables`: [`Exact`](../modules/internal.md#exact)<{ `claimId`: `string` ; `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> | +| `ClaimTokensByOwner` | (`variables?`: [`Exact`](../modules/internal.md#exact)<{ `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `owner?`: `any` ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> | +| `ClaimsByOwner` | (`variables?`: [`Exact`](../modules/internal.md#exact)<{ `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `owner?`: `any` ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> | +| `RecentClaims` | (`variables?`: [`Exact`](../modules/internal.md#exact)<{ `first?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> ; `orderDirection?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<[`OrderDirection`](../modules/internal.md#orderdirection)\> ; `skip?`: [`InputMaybe`](../modules/internal.md#inputmaybe)<`number`\> }\>, `options?`: `unknown`) => `Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> | + +#### Implementation of + +[HypercertIndexerInterface](../interfaces/HypercertIndexerInterface.md).[graphClient](../interfaces/HypercertIndexerInterface.md#graphclient) + +#### Defined in + +[sdk/src/indexer.ts:27](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L27) + +## Methods + +### claimById + +▸ **claimById**(`id`): `Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> + +Gets a claim by its ID. + +#### Parameters + +| Name | Type | Description | +| :--- | :------- | :------------------- | +| `id` | `string` | The ID of the claim. | + +#### Returns + +`Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> + +A Promise that resolves to the claim. + +#### Implementation of + +HypercertIndexerInterface.claimById + +#### Defined in + +[sdk/src/indexer.ts:48](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L48) + +--- + +### claimsByOwner + +▸ **claimsByOwner**(`owner`, `params?`): `Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> + +Gets the claims owned by a given address. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :----------------------------------------- | :------------------- | :------------------------ | +| `owner` | `string` | `undefined` | The address of the owner. | +| `params` | [`QueryParams`](../modules.md#queryparams) | `defaultQueryParams` | The query parameters. | + +#### Returns + +`Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> + +A Promise that resolves to the claims. + +#### Implementation of + +HypercertIndexerInterface.claimsByOwner + +#### Defined in + +[sdk/src/indexer.ts:37](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L37) + +--- + +### firstClaims + +▸ **firstClaims**(`params?`): `Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> + +Gets the most recent claims. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :----------------------------------------- | :------------------- | :-------------------- | +| `params` | [`QueryParams`](../modules.md#queryparams) | `defaultQueryParams` | The query parameters. | + +#### Returns + +`Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> + +A Promise that resolves to the claims. + +#### Implementation of + +HypercertIndexerInterface.firstClaims + +#### Defined in + +[sdk/src/indexer.ts:58](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L58) + +--- + +### fractionById + +▸ **fractionById**(`fractionId`): `Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> + +Gets a claim token by its ID. + +#### Parameters + +| Name | Type | Description | +| :----------- | :------- | :------------------------- | +| `fractionId` | `string` | The ID of the claim token. | + +#### Returns + +`Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> + +A Promise that resolves to the claim token. + +#### Implementation of + +HypercertIndexerInterface.fractionById + +#### Defined in + +[sdk/src/indexer.ts:92](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L92) + +--- + +### fractionsByClaim + +▸ **fractionsByClaim**(`claimId`, `params?`): `Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> + +Gets the claim tokens for a given claim. + +#### Parameters + +| Name | Type | Default value | Description | +| :-------- | :----------------------------------------- | :------------------- | :-------------------- | +| `claimId` | `string` | `undefined` | The ID of the claim. | +| `params` | [`QueryParams`](../modules.md#queryparams) | `defaultQueryParams` | The query parameters. | + +#### Returns + +`Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> + +A Promise that resolves to the claim tokens. + +#### Implementation of + +HypercertIndexerInterface.fractionsByClaim + +#### Defined in + +[sdk/src/indexer.ts:81](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L81) + +--- + +### fractionsByOwner + +▸ **fractionsByOwner**(`owner`, `params?`): `Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> + +Gets the claim tokens owned by a given address. + +#### Parameters + +| Name | Type | Default value | Description | +| :------- | :----------------------------------------- | :------------------- | :------------------------ | +| `owner` | `string` | `undefined` | The address of the owner. | +| `params` | [`QueryParams`](../modules.md#queryparams) | `defaultQueryParams` | The query parameters. | + +#### Returns + +`Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> + +A Promise that resolves to the claim tokens. + +#### Implementation of + +HypercertIndexerInterface.fractionsByOwner + +#### Defined in + +[sdk/src/indexer.ts:69](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/indexer.ts#L69) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/internal.default-2.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/internal.default-2.md new file mode 100644 index 00000000..1538ce61 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/internal.default-2.md @@ -0,0 +1,131 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / [internal](../modules/internal.md) / default + +# Class: default + +[internal](../modules/internal.md).default + +The EasEvaluator class provides methods for signing off-chain attestations of evaluations. +Schemas are stored on-chain in the Ethereum Attestation Service (EAS) contract. + +## Table of contents + +### Constructors + +- [constructor](internal.default-2.md#constructor) + +### Properties + +- [offChain](internal.default-2.md#offchain) +- [readonly](internal.default-2.md#readonly) +- [signer](internal.default-2.md#signer) + +### Methods + +- [getSignature](internal.default-2.md#getsignature) +- [signOfflineEvaluation](internal.default-2.md#signofflineevaluation) + +## Constructors + +### constructor + +• **new default**(`config`) + +Creates a new EasEvaluator instance. + +#### Parameters + +| Name | Type | Description | +| :------- | :------------------------------------------------------------------------- | :------------------------------------------------------- | +| `config` | `Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> | The configuration options for the EasEvaluator instance. | + +#### Defined in + +[sdk/src/evaluations/eas.ts:37](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/eas.ts#L37) + +## Properties + +### offChain + +• **offChain**: `Offchain` + +The Offchain instance used for signing off-chain attestations. + +#### Defined in + +[sdk/src/evaluations/eas.ts:24](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/eas.ts#L24) + +--- + +### readonly + +• **readonly**: `boolean` = `true` + +#### Defined in + +[sdk/src/evaluations/eas.ts:31](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/eas.ts#L31) + +--- + +### signer + +• `Optional` **signer**: `Signer` & `TypedDataSigner` + +The TypedDataSigner instance used for signing typed data. + +#### Defined in + +[sdk/src/evaluations/eas.ts:29](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/eas.ts#L29) + +## Methods + +### getSignature + +▸ **getSignature**(`encodedData`, `recipient`, `schemaUid`): `Promise`<`SignedOffchainAttestation`\> + +Gets a signature for an off-chain attestation. + +#### Parameters + +| Name | Type | Description | +| :------------ | :------- | :------------------------------------------------ | +| `encodedData` | `string` | The encoded data to sign. | +| `recipient` | `string` | The address of the recipient of the attestation. | +| `schemaUid` | `string` | The UID of the schema to use for the attestation. | + +#### Returns + +`Promise`<`SignedOffchainAttestation`\> + +- The signature for the attestation. + +#### Defined in + +[sdk/src/evaluations/eas.ts:62](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/eas.ts#L62) + +--- + +### signOfflineEvaluation + +▸ **signOfflineEvaluation**(`evaluation`): `Promise`<`undefined` \| `SignedOffchainAttestation`\> + +Signs an offline evaluation. + +**`Throws`** + +- If the evaluation data is malformed. + +#### Parameters + +| Name | Type | Description | +| :----------- | :----------------------------------------------- | :--------------------------- | +| `evaluation` | [`EvaluationData`](../modules.md#evaluationdata) | The evaluation data to sign. | + +#### Returns + +`Promise`<`undefined` \| `SignedOffchainAttestation`\> + +- The signature for the evaluation. + +#### Defined in + +[sdk/src/evaluations/eas.ts:95](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/eas.ts#L95) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/internal.default.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/internal.default.md new file mode 100644 index 00000000..86daa5e4 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/classes/internal.default.md @@ -0,0 +1,110 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / [internal](../modules/internal.md) / default + +# Class: default + +[internal](../modules/internal.md).default + +## Implements + +- [`EvaluatorInterface`](../interfaces/internal.EvaluatorInterface.md) + +## Table of contents + +### Constructors + +- [constructor](internal.default.md#constructor) + +### Properties + +- [eas](internal.default.md#eas) +- [readonly](internal.default.md#readonly) +- [signer](internal.default.md#signer) +- [storage](internal.default.md#storage) + +### Methods + +- [submitEvaluation](internal.default.md#submitevaluation) + +## Constructors + +### constructor + +• **new default**(`config?`) + +#### Parameters + +| Name | Type | +| :------- | :------------------------------------------------------------------------- | +| `config` | `Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> | + +#### Defined in + +[sdk/src/evaluations/index.ts:37](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L37) + +## Properties + +### eas + +• **eas**: [`default`](internal.default-2.md) + +#### Defined in + +[sdk/src/evaluations/index.ts:33](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L33) + +--- + +### readonly + +• **readonly**: `boolean` = `true` + +#### Defined in + +[sdk/src/evaluations/index.ts:35](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L35) + +--- + +### signer + +• `Optional` **signer**: `Signer` & `TypedDataSigner` + +#### Defined in + +[sdk/src/evaluations/index.ts:29](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L29) + +--- + +### storage + +• **storage**: [`HypercertsStorage`](HypercertsStorage.md) + +#### Defined in + +[sdk/src/evaluations/index.ts:31](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L31) + +## Methods + +### submitEvaluation + +▸ **submitEvaluation**(`evaluation`): `Promise`<`CIDString`\> + +Submits an evaluation to the prefered storage system. + +#### Parameters + +| Name | Type | Description | +| :----------- | :------------------------------------------------------------------------ | :------------------------ | +| `evaluation` | [`HypercertEvaluationSchema`](../interfaces/HypercertEvaluationSchema.md) | The evaluation to submit. | + +#### Returns + +`Promise`<`CIDString`\> + +- The CID of the submitted evaluation. + +#### Implementation of + +EvaluatorInterface.submitEvaluation + +#### Defined in + +[sdk/src/evaluations/index.ts:53](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L53) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/CustomError.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/CustomError.md new file mode 100644 index 00000000..b4af6279 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/CustomError.md @@ -0,0 +1,39 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / CustomError + +# Interface: CustomError + +An interface for errors that have a specific type. + +## Implemented by + +- [`ClientError`](../classes/ClientError.md) +- [`ConfigurationError`](../classes/ConfigurationError.md) +- [`FetchError`](../classes/FetchError.md) +- [`InvalidOrMissingError`](../classes/InvalidOrMissingError.md) +- [`MalformedDataError`](../classes/MalformedDataError.md) +- [`MintingError`](../classes/MintingError.md) +- [`StorageError`](../classes/StorageError.md) +- [`UnknownSchemaError`](../classes/UnknownSchemaError.md) +- [`UnsupportedChainError`](../classes/UnsupportedChainError.md) + +## Table of contents + +### Properties + +- [payload](CustomError.md#payload) + +## Properties + +### payload + +• `Optional` **payload**: `Object` + +Additional error payload. + +#### Index signature + +▪ [key: `string`]: `unknown` + +#### Defined in + +[sdk/src/types/errors.ts:8](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L8) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/DuplicateEvaluation.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/DuplicateEvaluation.md new file mode 100644 index 00000000..4606b46e --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/DuplicateEvaluation.md @@ -0,0 +1,56 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / DuplicateEvaluation + +# Interface: DuplicateEvaluation + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [duplicateHypercerts](DuplicateEvaluation.md#duplicatehypercerts) +- [explanation](DuplicateEvaluation.md#explanation) +- [realHypercert](DuplicateEvaluation.md#realhypercert) +- [type](DuplicateEvaluation.md#type) + +## Properties + +### duplicateHypercerts + +• **duplicateHypercerts**: [`HypercertPointer`](HypercertPointer.md)[] + +#### Defined in + +[sdk/src/types/evaluation.d.ts:22](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L22) + +--- + +### explanation + +• **explanation**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:24](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L24) + +--- + +### realHypercert + +• **realHypercert**: [`HypercertPointer`](HypercertPointer.md) + +#### Defined in + +[sdk/src/types/evaluation.d.ts:23](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L23) + +--- + +### type + +• **type**: `"duplicate"` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:21](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L21) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/EASEvaluation.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/EASEvaluation.md new file mode 100644 index 00000000..205b7004 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/EASEvaluation.md @@ -0,0 +1,56 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / EASEvaluation + +# Interface: EASEvaluation + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [chainId](EASEvaluation.md#chainid) +- [contract](EASEvaluation.md#contract) +- [type](EASEvaluation.md#type) +- [uid](EASEvaluation.md#uid) + +## Properties + +### chainId + +• **chainId**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:41](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L41) + +--- + +### contract + +• **contract**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:42](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L42) + +--- + +### type + +• **type**: `"EAS"` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:40](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L40) + +--- + +### uid + +• **uid**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:43](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L43) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClaimdata.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClaimdata.md new file mode 100644 index 00000000..3dcea656 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClaimdata.md @@ -0,0 +1,167 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertClaimdata + +# Interface: HypercertClaimdata + +Properties of an impact claim + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [contributors](HypercertClaimdata.md#contributors) +- [impact_scope](HypercertClaimdata.md#impact_scope) +- [impact_timeframe](HypercertClaimdata.md#impact_timeframe) +- [rights](HypercertClaimdata.md#rights) +- [work_scope](HypercertClaimdata.md#work_scope) +- [work_timeframe](HypercertClaimdata.md#work_timeframe) + +## Properties + +### contributors + +• **contributors**: `Object` + +Contributors + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/claimdata.d.ts:53](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/claimdata.d.ts#L53) + +--- + +### impact_scope + +• **impact_scope**: `Object` + +Scopes of impact + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `excludes?` | `string`[] | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/claimdata.d.ts:15](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/claimdata.d.ts#L15) + +--- + +### impact_timeframe + +• **impact_timeframe**: `Object` + +Impact time period. The value is UNIX time in seconds from epoch. + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `name?` | `string` | +| `value?` | `number`[] | + +#### Defined in + +[sdk/src/types/claimdata.d.ts:44](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/claimdata.d.ts#L44) + +--- + +### rights + +• `Optional` **rights**: `Object` + +Rights + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `excludes?` | `string`[] | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/claimdata.d.ts:62](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/claimdata.d.ts#L62) + +--- + +### work_scope + +• **work_scope**: `Object` + +Scopes of work + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `excludes?` | `string`[] | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/claimdata.d.ts:25](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/claimdata.d.ts#L25) + +--- + +### work_timeframe + +• **work_timeframe**: `Object` + +Work time period. The value is UNIX time in seconds from epoch. + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `name?` | `string` | +| `value?` | `number`[] | + +#### Defined in + +[sdk/src/types/claimdata.d.ts:35](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/claimdata.d.ts#L35) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClientInterface.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClientInterface.md new file mode 100644 index 00000000..0483b520 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClientInterface.md @@ -0,0 +1,341 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertClientInterface + +# Interface: HypercertClientInterface + +The interface for the Hypercert client. + +## Hierarchy + +- [`HypercertClientMethods`](HypercertClientMethods.md) + +- [`HypercertClientState`](HypercertClientState.md) + + ↳ **`HypercertClientInterface`** + +## Implemented by + +- [`HypercertClient`](../classes/HypercertClient.md) + +## Table of contents + +### Properties + +- [batchMintClaimFractionsFromAllowlists](HypercertClientInterface.md#batchmintclaimfractionsfromallowlists) +- [burnClaimFraction](HypercertClientInterface.md#burnclaimfraction) +- [contract](HypercertClientInterface.md#contract) +- [createAllowlist](HypercertClientInterface.md#createallowlist) +- [indexer](HypercertClientInterface.md#indexer) +- [mergeClaimUnits](HypercertClientInterface.md#mergeclaimunits) +- [mintClaim](HypercertClientInterface.md#mintclaim) +- [mintClaimFractionFromAllowlist](HypercertClientInterface.md#mintclaimfractionfromallowlist) +- [readonly](HypercertClientInterface.md#readonly) +- [splitClaimUnits](HypercertClientInterface.md#splitclaimunits) +- [storage](HypercertClientInterface.md#storage) + +## Properties + +### batchMintClaimFractionsFromAllowlists + +• **batchMintClaimFractionsFromAllowlists**: (`claimIds`: `BigNumberish`[], `units`: `BigNumberish`[], `proofs`: `BytesLike`[][]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimIds`, `units`, `proofs`): `Promise`<`ContractTransaction`\> + +Batch mints a claim fraction from an allowlist + +**`Note`** + +The length of the arrays must be equal. + +**`Note`** + +The order of the arrays must be equal. + +##### Parameters + +| Name | Type | Description | +| :--------- | :--------------- | :---------------------------------------------------- | +| `claimIds` | `BigNumberish`[] | Array of the IDs of the claims to mint fractions for. | +| `units` | `BigNumberish`[] | Array of the number of units for each fraction. | +| `proofs` | `BytesLike`[][] | Array of Merkle proofs for the allowlists. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[batchMintClaimFractionsFromAllowlists](HypercertClientMethods.md#batchmintclaimfractionsfromallowlists) + +#### Defined in + +[sdk/src/types/client.ts:200](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L200) + +--- + +### burnClaimFraction + +• **burnClaimFraction**: (`claimId`: `BigNumberish`) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimId`): `Promise`<`ContractTransaction`\> + +Burns a claim fraction. + +##### Parameters + +| Name | Type | Description | +| :-------- | :------------- | :------------------------------------ | +| `claimId` | `BigNumberish` | The ID of the claim fraction to burn. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[burnClaimFraction](HypercertClientMethods.md#burnclaimfraction) + +#### Defined in + +[sdk/src/types/client.ts:175](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L175) + +--- + +### contract + +• **contract**: [`HypercertMinter`](internal.HypercertMinter.md) + +The contract used by the client. + +#### Inherited from + +[HypercertClientState](HypercertClientState.md).[contract](HypercertClientState.md#contract) + +#### Defined in + +[sdk/src/types/client.ts:120](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L120) + +--- + +### createAllowlist + +• **createAllowlist**: (`allowList`: [`AllowlistEntry`](../modules.md#allowlistentry)[], `metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `BigNumberish`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`allowList`, `metaData`, `totalUnits`, `transferRestriction`): `Promise`<`ContractTransaction`\> + +Creates a new allowlist and mints a new claim with the allowlist. + +##### Parameters + +| Name | Type | Description | +| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | +| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The allowlist for the claim. | +| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | +| `totalUnits` | `BigNumberish` | The total number of units for the claim. | +| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[createAllowlist](HypercertClientMethods.md#createallowlist) + +#### Defined in + +[sdk/src/types/client.ts:148](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L148) + +--- + +### indexer + +• **indexer**: [`default`](../classes/internal.default-1.md) + +The indexer used by the client. + +#### Inherited from + +[HypercertClientState](HypercertClientState.md).[indexer](HypercertClientState.md#indexer) + +#### Defined in + +[sdk/src/types/client.ts:118](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L118) + +--- + +### mergeClaimUnits + +• **mergeClaimUnits**: (`claimIds`: `BigNumberish`[]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimIds`): `Promise`<`ContractTransaction`\> + +Merges multiple claim fractions into a single claim. + +##### Parameters + +| Name | Type | Description | +| :--------- | :--------------- | :--------------------------------------- | +| `claimIds` | `BigNumberish`[] | The IDs of the claim fractions to merge. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[mergeClaimUnits](HypercertClientMethods.md#mergeclaimunits) + +#### Defined in + +[sdk/src/types/client.ts:168](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L168) + +--- + +### mintClaim + +• **mintClaim**: (`metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `BigNumberish`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`metaData`, `totalUnits`, `transferRestriction`): `Promise`<`ContractTransaction`\> + +Mints a new claim. + +##### Parameters + +| Name | Type | Description | +| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | +| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | +| `totalUnits` | `BigNumberish` | The total number of units for the claim. | +| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[mintClaim](HypercertClientMethods.md#mintclaim) + +#### Defined in + +[sdk/src/types/client.ts:134](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L134) + +--- + +### mintClaimFractionFromAllowlist + +• **mintClaimFractionFromAllowlist**: (`claimId`: `BigNumberish`, `units`: `BigNumberish`, `proof`: `BytesLike`[]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimId`, `units`, `proof`): `Promise`<`ContractTransaction`\> + +Mints a claim fraction from an allowlist. + +##### Parameters + +| Name | Type | Description | +| :-------- | :------------- | :------------------------------------------ | +| `claimId` | `BigNumberish` | The ID of the claim to mint a fraction for. | +| `units` | `BigNumberish` | The number of units for the fraction. | +| `proof` | `BytesLike`[] | The Merkle proof for the allowlist. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[mintClaimFractionFromAllowlist](HypercertClientMethods.md#mintclaimfractionfromallowlist) + +#### Defined in + +[sdk/src/types/client.ts:184](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L184) + +--- + +### readonly + +• **readonly**: `boolean` + +Whether the client is in read-only mode. + +#### Inherited from + +[HypercertClientState](HypercertClientState.md).[readonly](HypercertClientState.md#readonly) + +#### Defined in + +[sdk/src/types/client.ts:114](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L114) + +--- + +### splitClaimUnits + +• **splitClaimUnits**: (`claimId`: `BigNumberish`, `fractions`: `BigNumberish`[]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimId`, `fractions`): `Promise`<`ContractTransaction`\> + +Splits a claim into multiple fractions. + +##### Parameters + +| Name | Type | Description | +| :---------- | :--------------- | :------------------------------------- | +| `claimId` | `BigNumberish` | The ID of the claim to split. | +| `fractions` | `BigNumberish`[] | The number of units for each fraction. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Inherited from + +[HypercertClientMethods](HypercertClientMethods.md).[splitClaimUnits](HypercertClientMethods.md#splitclaimunits) + +#### Defined in + +[sdk/src/types/client.ts:161](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L161) + +--- + +### storage + +• **storage**: [`HypercertStorageInterface`](HypercertStorageInterface.md) + +The storage layer used by the client. + +#### Inherited from + +[HypercertClientState](HypercertClientState.md).[storage](HypercertClientState.md#storage) + +#### Defined in + +[sdk/src/types/client.ts:116](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L116) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClientMethods.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClientMethods.md new file mode 100644 index 00000000..734ccbee --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClientMethods.md @@ -0,0 +1,239 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertClientMethods + +# Interface: HypercertClientMethods + +The methods for the Hypercert client. + +## Hierarchy + +- **`HypercertClientMethods`** + + ↳ [`HypercertClientInterface`](HypercertClientInterface.md) + +## Table of contents + +### Properties + +- [batchMintClaimFractionsFromAllowlists](HypercertClientMethods.md#batchmintclaimfractionsfromallowlists) +- [burnClaimFraction](HypercertClientMethods.md#burnclaimfraction) +- [createAllowlist](HypercertClientMethods.md#createallowlist) +- [mergeClaimUnits](HypercertClientMethods.md#mergeclaimunits) +- [mintClaim](HypercertClientMethods.md#mintclaim) +- [mintClaimFractionFromAllowlist](HypercertClientMethods.md#mintclaimfractionfromallowlist) +- [splitClaimUnits](HypercertClientMethods.md#splitclaimunits) + +## Properties + +### batchMintClaimFractionsFromAllowlists + +• **batchMintClaimFractionsFromAllowlists**: (`claimIds`: `BigNumberish`[], `units`: `BigNumberish`[], `proofs`: `BytesLike`[][]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimIds`, `units`, `proofs`): `Promise`<`ContractTransaction`\> + +Batch mints a claim fraction from an allowlist + +**`Note`** + +The length of the arrays must be equal. + +**`Note`** + +The order of the arrays must be equal. + +##### Parameters + +| Name | Type | Description | +| :--------- | :--------------- | :---------------------------------------------------- | +| `claimIds` | `BigNumberish`[] | Array of the IDs of the claims to mint fractions for. | +| `units` | `BigNumberish`[] | Array of the number of units for each fraction. | +| `proofs` | `BytesLike`[][] | Array of Merkle proofs for the allowlists. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:200](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L200) + +--- + +### burnClaimFraction + +• **burnClaimFraction**: (`claimId`: `BigNumberish`) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimId`): `Promise`<`ContractTransaction`\> + +Burns a claim fraction. + +##### Parameters + +| Name | Type | Description | +| :-------- | :------------- | :------------------------------------ | +| `claimId` | `BigNumberish` | The ID of the claim fraction to burn. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:175](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L175) + +--- + +### createAllowlist + +• **createAllowlist**: (`allowList`: [`AllowlistEntry`](../modules.md#allowlistentry)[], `metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `BigNumberish`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`allowList`, `metaData`, `totalUnits`, `transferRestriction`): `Promise`<`ContractTransaction`\> + +Creates a new allowlist and mints a new claim with the allowlist. + +##### Parameters + +| Name | Type | Description | +| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | +| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The allowlist for the claim. | +| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | +| `totalUnits` | `BigNumberish` | The total number of units for the claim. | +| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:148](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L148) + +--- + +### mergeClaimUnits + +• **mergeClaimUnits**: (`claimIds`: `BigNumberish`[]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimIds`): `Promise`<`ContractTransaction`\> + +Merges multiple claim fractions into a single claim. + +##### Parameters + +| Name | Type | Description | +| :--------- | :--------------- | :--------------------------------------- | +| `claimIds` | `BigNumberish`[] | The IDs of the claim fractions to merge. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:168](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L168) + +--- + +### mintClaim + +• **mintClaim**: (`metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `BigNumberish`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`metaData`, `totalUnits`, `transferRestriction`): `Promise`<`ContractTransaction`\> + +Mints a new claim. + +##### Parameters + +| Name | Type | Description | +| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | +| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | +| `totalUnits` | `BigNumberish` | The total number of units for the claim. | +| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:134](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L134) + +--- + +### mintClaimFractionFromAllowlist + +• **mintClaimFractionFromAllowlist**: (`claimId`: `BigNumberish`, `units`: `BigNumberish`, `proof`: `BytesLike`[]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimId`, `units`, `proof`): `Promise`<`ContractTransaction`\> + +Mints a claim fraction from an allowlist. + +##### Parameters + +| Name | Type | Description | +| :-------- | :------------- | :------------------------------------------ | +| `claimId` | `BigNumberish` | The ID of the claim to mint a fraction for. | +| `units` | `BigNumberish` | The number of units for the fraction. | +| `proof` | `BytesLike`[] | The Merkle proof for the allowlist. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:184](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L184) + +--- + +### splitClaimUnits + +• **splitClaimUnits**: (`claimId`: `BigNumberish`, `fractions`: `BigNumberish`[]) => `Promise`<`ContractTransaction`\> + +#### Type declaration + +▸ (`claimId`, `fractions`): `Promise`<`ContractTransaction`\> + +Splits a claim into multiple fractions. + +##### Parameters + +| Name | Type | Description | +| :---------- | :--------------- | :------------------------------------- | +| `claimId` | `BigNumberish` | The ID of the claim to split. | +| `fractions` | `BigNumberish`[] | The number of units for each fraction. | + +##### Returns + +`Promise`<`ContractTransaction`\> + +A Promise that resolves to the transaction receipt + +#### Defined in + +[sdk/src/types/client.ts:161](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L161) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClientState.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClientState.md new file mode 100644 index 00000000..2d90a599 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertClientState.md @@ -0,0 +1,68 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertClientState + +# Interface: HypercertClientState + +The state of the Hypercert client. + +## Hierarchy + +- **`HypercertClientState`** + + ↳ [`HypercertClientInterface`](HypercertClientInterface.md) + +## Table of contents + +### Properties + +- [contract](HypercertClientState.md#contract) +- [indexer](HypercertClientState.md#indexer) +- [readonly](HypercertClientState.md#readonly) +- [storage](HypercertClientState.md#storage) + +## Properties + +### contract + +• **contract**: [`HypercertMinter`](internal.HypercertMinter.md) + +The contract used by the client. + +#### Defined in + +[sdk/src/types/client.ts:120](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L120) + +--- + +### indexer + +• **indexer**: [`default`](../classes/internal.default-1.md) + +The indexer used by the client. + +#### Defined in + +[sdk/src/types/client.ts:118](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L118) + +--- + +### readonly + +• **readonly**: `boolean` + +Whether the client is in read-only mode. + +#### Defined in + +[sdk/src/types/client.ts:114](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L114) + +--- + +### storage + +• **storage**: [`HypercertStorageInterface`](HypercertStorageInterface.md) + +The storage layer used by the client. + +#### Defined in + +[sdk/src/types/client.ts:116](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L116) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertEvaluationSchema.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertEvaluationSchema.md new file mode 100644 index 00000000..6ebed93a --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertEvaluationSchema.md @@ -0,0 +1,47 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertEvaluationSchema + +# Interface: HypercertEvaluationSchema + +Schema for evaluating Hypercerts across different sources and evaluation types + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [creator](HypercertEvaluationSchema.md#creator) +- [evaluationData](HypercertEvaluationSchema.md#evaluationdata) +- [evaluationSource](HypercertEvaluationSchema.md#evaluationsource) + +## Properties + +### creator + +• **creator**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:15](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L15) + +--- + +### evaluationData + +• **evaluationData**: [`EvaluationData`](../modules.md#evaluationdata) + +#### Defined in + +[sdk/src/types/evaluation.d.ts:16](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L16) + +--- + +### evaluationSource + +• **evaluationSource**: [`EvaluationSource`](../modules.md#evaluationsource) + +#### Defined in + +[sdk/src/types/evaluation.d.ts:17](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L17) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertIndexerInterface.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertIndexerInterface.md new file mode 100644 index 00000000..f18c409f --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertIndexerInterface.md @@ -0,0 +1,176 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertIndexerInterface + +# Interface: HypercertIndexerInterface + +## Implemented by + +- [`default`](../classes/internal.default-1.md) + +## Table of contents + +### Properties + +- [claimById](HypercertIndexerInterface.md#claimbyid) +- [claimsByOwner](HypercertIndexerInterface.md#claimsbyowner) +- [firstClaims](HypercertIndexerInterface.md#firstclaims) +- [fractionById](HypercertIndexerInterface.md#fractionbyid) +- [fractionsByClaim](HypercertIndexerInterface.md#fractionsbyclaim) +- [fractionsByOwner](HypercertIndexerInterface.md#fractionsbyowner) +- [graphClient](HypercertIndexerInterface.md#graphclient) + +## Properties + +### claimById + +• **claimById**: (`id`: `string`) => `Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> + +#### Type declaration + +▸ (`id`): `Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> + +##### Parameters + +| Name | Type | +| :--- | :------- | +| `id` | `string` | + +##### Returns + +`Promise`<[`ClaimByIdQuery`](../modules/internal.md#claimbyidquery)\> + +#### Defined in + +[sdk/src/types/indexer.ts:20](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L20) + +--- + +### claimsByOwner + +• **claimsByOwner**: (`owner`: `string`, `params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> + +#### Type declaration + +▸ (`owner`, `params?`): `Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> + +##### Parameters + +| Name | Type | +| :-------- | :----------------------------------------- | +| `owner` | `string` | +| `params?` | [`QueryParams`](../modules.md#queryparams) | + +##### Returns + +`Promise`<[`ClaimsByOwnerQuery`](../modules/internal.md#claimsbyownerquery)\> + +#### Defined in + +[sdk/src/types/indexer.ts:19](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L19) + +--- + +### firstClaims + +• **firstClaims**: (`params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> + +#### Type declaration + +▸ (`params?`): `Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> + +##### Parameters + +| Name | Type | +| :-------- | :----------------------------------------- | +| `params?` | [`QueryParams`](../modules.md#queryparams) | + +##### Returns + +`Promise`<[`RecentClaimsQuery`](../modules/internal.md#recentclaimsquery)\> + +#### Defined in + +[sdk/src/types/indexer.ts:21](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L21) + +--- + +### fractionById + +• **fractionById**: (`fractionId`: `string`) => `Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> + +#### Type declaration + +▸ (`fractionId`): `Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> + +##### Parameters + +| Name | Type | +| :----------- | :------- | +| `fractionId` | `string` | + +##### Returns + +`Promise`<[`ClaimTokenByIdQuery`](../modules/internal.md#claimtokenbyidquery)\> + +#### Defined in + +[sdk/src/types/indexer.ts:24](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L24) + +--- + +### fractionsByClaim + +• **fractionsByClaim**: (`claimId`: `string`, `params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> + +#### Type declaration + +▸ (`claimId`, `params?`): `Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> + +##### Parameters + +| Name | Type | +| :-------- | :----------------------------------------- | +| `claimId` | `string` | +| `params?` | [`QueryParams`](../modules.md#queryparams) | + +##### Returns + +`Promise`<[`ClaimTokensByClaimQuery`](../modules/internal.md#claimtokensbyclaimquery)\> + +#### Defined in + +[sdk/src/types/indexer.ts:23](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L23) + +--- + +### fractionsByOwner + +• **fractionsByOwner**: (`owner`: `string`, `params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> + +#### Type declaration + +▸ (`owner`, `params?`): `Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> + +##### Parameters + +| Name | Type | +| :-------- | :----------------------------------------- | +| `owner` | `string` | +| `params?` | [`QueryParams`](../modules.md#queryparams) | + +##### Returns + +`Promise`<[`ClaimTokensByOwnerQuery`](../modules/internal.md#claimtokensbyownerquery)\> + +#### Defined in + +[sdk/src/types/indexer.ts:22](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L22) + +--- + +### graphClient + +• **graphClient**: `any` + +#### Defined in + +[sdk/src/types/indexer.ts:18](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L18) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertMetadata.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertMetadata.md new file mode 100644 index 00000000..d65362f3 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertMetadata.md @@ -0,0 +1,123 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertMetadata + +# Interface: HypercertMetadata + +Claim data for hypercert. ERC1155 Metadata compliant + +## Table of contents + +### Properties + +- [allowList](HypercertMetadata.md#allowlist) +- [description](HypercertMetadata.md#description) +- [external_url](HypercertMetadata.md#external_url) +- [hypercert](HypercertMetadata.md#hypercert) +- [image](HypercertMetadata.md#image) +- [name](HypercertMetadata.md#name) +- [properties](HypercertMetadata.md#properties) +- [ref](HypercertMetadata.md#ref) +- [version](HypercertMetadata.md#version) + +## Properties + +### allowList + +• `Optional` **allowList**: `string` + +A CID pointer to the merke tree proof json on ipfs + +#### Defined in + +[sdk/src/types/metadata.d.ts:39](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L39) + +--- + +### description + +• **description**: `string` + +Describes the asset to which this token represents + +#### Defined in + +[sdk/src/types/metadata.d.ts:19](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L19) + +--- + +### external_url + +• `Optional` **external_url**: `string` + +An url pointing to the external website of the project + +#### Defined in + +[sdk/src/types/metadata.d.ts:23](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L23) + +--- + +### hypercert + +• `Optional` **hypercert**: [`HypercertClaimdata`](internal.HypercertClaimdata.md) + +#### Defined in + +[sdk/src/types/metadata.d.ts:45](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L45) + +--- + +### image + +• **image**: `string` + +A URI pointing to a resource with mime type image/\* representing the asset to which this token represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive. + +#### Defined in + +[sdk/src/types/metadata.d.ts:27](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L27) + +--- + +### name + +• **name**: `string` + +Identifies the asset to which this token represents + +#### Defined in + +[sdk/src/types/metadata.d.ts:15](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L15) + +--- + +### properties + +• `Optional` **properties**: { `[k: string]`: `unknown`; `trait_type?`: `string` ; `value?`: `string` }[] + +#### Defined in + +[sdk/src/types/metadata.d.ts:40](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L40) + +--- + +### ref + +• `Optional` **ref**: `string` + +Describes the asset to which this token represents + +#### Defined in + +[sdk/src/types/metadata.d.ts:35](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L35) + +--- + +### version + +• `Optional` **version**: `string` + +The version of Hypercert schema used to describe this hypercert + +#### Defined in + +[sdk/src/types/metadata.d.ts:31](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L31) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertPointer.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertPointer.md new file mode 100644 index 00000000..773c41d3 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertPointer.md @@ -0,0 +1,45 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertPointer + +# Interface: HypercertPointer + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [chainId](HypercertPointer.md#chainid) +- [claimId](HypercertPointer.md#claimid) +- [contract](HypercertPointer.md#contract) + +## Properties + +### chainId + +• **chainId**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:28](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L28) + +--- + +### claimId + +• **claimId**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:30](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L30) + +--- + +### contract + +• **contract**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:29](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L29) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertStorageInterface.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertStorageInterface.md new file mode 100644 index 00000000..8ffda51e --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/HypercertStorageInterface.md @@ -0,0 +1,130 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / HypercertStorageInterface + +# Interface: HypercertStorageInterface + +The interface for the Hypercert storage layer. + +## Implemented by + +- [`HypercertsStorage`](../classes/HypercertsStorage.md) + +## Table of contents + +### Properties + +- [getData](HypercertStorageInterface.md#getdata) +- [getMetadata](HypercertStorageInterface.md#getmetadata) +- [storeData](HypercertStorageInterface.md#storedata) +- [storeMetadata](HypercertStorageInterface.md#storemetadata) + +## Properties + +### getData + +• **getData**: (`cidOrIpfsUri`: `string`) => `Promise`<`unknown`\> + +#### Type declaration + +▸ (`cidOrIpfsUri`): `Promise`<`unknown`\> + +Retrieves arbitrary data from IPFS. + +##### Parameters + +| Name | Type | Description | +| :------------- | :------- | :------------------------------------------- | +| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the data to retrieve. | + +##### Returns + +`Promise`<`unknown`\> + +A Promise that resolves to the retrieved data. + +#### Defined in + +[sdk/src/types/client.ts:93](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L93) + +--- + +### getMetadata + +• **getMetadata**: (`cidOrIpfsUri`: `string`) => `Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> + +#### Type declaration + +▸ (`cidOrIpfsUri`): `Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> + +Retrieves the metadata for a Hypercert evaluation. + +##### Parameters + +| Name | Type | Description | +| :------------- | :------- | :----------------------------------------------- | +| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the metadata to retrieve. | + +##### Returns + +`Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> + +A Promise that resolves to the retrieved metadata. + +#### Defined in + +[sdk/src/types/client.ts:79](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L79) + +--- + +### storeData + +• **storeData**: (`data`: `unknown`) => `Promise`<`CIDString`\> + +#### Type declaration + +▸ (`data`): `Promise`<`CIDString`\> + +Stores arbitrary data on IPFS. + +##### Parameters + +| Name | Type | Description | +| :----- | :-------- | :----------------- | +| `data` | `unknown` | The data to store. | + +##### Returns + +`Promise`<`CIDString`\> + +A Promise that resolves to the CID of the stored data. + +#### Defined in + +[sdk/src/types/client.ts:86](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L86) + +--- + +### storeMetadata + +• **storeMetadata**: (`metadata`: [`HypercertMetadata`](HypercertMetadata.md)) => `Promise`<`CIDString`\> + +#### Type declaration + +▸ (`metadata`): `Promise`<`CIDString`\> + +Stores the metadata for a Hypercert evaluation. + +##### Parameters + +| Name | Type | Description | +| :--------- | :------------------------------------------ | :--------------------- | +| `metadata` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata to store. | + +##### Returns + +`Promise`<`CIDString`\> + +A Promise that resolves to the CID of the stored metadata. + +#### Defined in + +[sdk/src/types/client.ts:72](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L72) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/IPFSEvaluation.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/IPFSEvaluation.md new file mode 100644 index 00000000..5f5871f2 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/IPFSEvaluation.md @@ -0,0 +1,34 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / IPFSEvaluation + +# Interface: IPFSEvaluation + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [cid](IPFSEvaluation.md#cid) +- [type](IPFSEvaluation.md#type) + +## Properties + +### cid + +• **cid**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:48](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L48) + +--- + +### type + +• **type**: `"IPFS"` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:47](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L47) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/SimpleTextEvaluation.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/SimpleTextEvaluation.md new file mode 100644 index 00000000..3e4b3b92 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/SimpleTextEvaluation.md @@ -0,0 +1,45 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / SimpleTextEvaluation + +# Interface: SimpleTextEvaluation + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [hypercert](SimpleTextEvaluation.md#hypercert) +- [text](SimpleTextEvaluation.md#text) +- [type](SimpleTextEvaluation.md#type) + +## Properties + +### hypercert + +• **hypercert**: [`HypercertPointer`](HypercertPointer.md) + +#### Defined in + +[sdk/src/types/evaluation.d.ts:35](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L35) + +--- + +### text + +• **text**: `string` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:36](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L36) + +--- + +### type + +• **type**: `"simpleText"` + +#### Defined in + +[sdk/src/types/evaluation.d.ts:34](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L34) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/internal.EvaluatorInterface.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/internal.EvaluatorInterface.md new file mode 100644 index 00000000..53ac36ed --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/internal.EvaluatorInterface.md @@ -0,0 +1,43 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / [internal](../modules/internal.md) / EvaluatorInterface + +# Interface: EvaluatorInterface + +[internal](../modules/internal.md).EvaluatorInterface + +## Implemented by + +- [`default`](../classes/internal.default.md) + +## Table of contents + +### Properties + +- [submitEvaluation](internal.EvaluatorInterface.md#submitevaluation) + +## Properties + +### submitEvaluation + +• **submitEvaluation**: (`evaluation`: [`HypercertEvaluationSchema`](HypercertEvaluationSchema.md)) => `Promise`<`CIDString`\> + +#### Type declaration + +▸ (`evaluation`): `Promise`<`CIDString`\> + +Submits an evaluation to the prefered storage system. + +##### Parameters + +| Name | Type | Description | +| :----------- | :---------------------------------------------------------- | :------------------------ | +| `evaluation` | [`HypercertEvaluationSchema`](HypercertEvaluationSchema.md) | The evaluation to submit. | + +##### Returns + +`Promise`<`CIDString`\> + +- The CID of the submitted evaluation. + +#### Defined in + +[sdk/src/evaluations/index.ts:25](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/evaluations/index.ts#L25) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/internal.HypercertClaimdata.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/internal.HypercertClaimdata.md new file mode 100644 index 00000000..273912bc --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/internal.HypercertClaimdata.md @@ -0,0 +1,169 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / [internal](../modules/internal.md) / HypercertClaimdata + +# Interface: HypercertClaimdata + +[internal](../modules/internal.md).HypercertClaimdata + +Properties of an impact claim + +## Indexable + +▪ [k: `string`]: `unknown` + +## Table of contents + +### Properties + +- [contributors](internal.HypercertClaimdata.md#contributors) +- [impact_scope](internal.HypercertClaimdata.md#impact_scope) +- [impact_timeframe](internal.HypercertClaimdata.md#impact_timeframe) +- [rights](internal.HypercertClaimdata.md#rights) +- [work_scope](internal.HypercertClaimdata.md#work_scope) +- [work_timeframe](internal.HypercertClaimdata.md#work_timeframe) + +## Properties + +### contributors + +• **contributors**: `Object` + +Contributors + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/metadata.d.ts:92](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L92) + +--- + +### impact_scope + +• **impact_scope**: `Object` + +Scopes of impact + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `excludes?` | `string`[] | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/metadata.d.ts:54](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L54) + +--- + +### impact_timeframe + +• **impact_timeframe**: `Object` + +Impact time period. The value is UNIX time in seconds from epoch. + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `name?` | `string` | +| `value?` | `number`[] | + +#### Defined in + +[sdk/src/types/metadata.d.ts:83](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L83) + +--- + +### rights + +• `Optional` **rights**: `Object` + +Rights + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `excludes?` | `string`[] | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/metadata.d.ts:101](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L101) + +--- + +### work_scope + +• **work_scope**: `Object` + +Scopes of work + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `excludes?` | `string`[] | +| `name?` | `string` | +| `value?` | `string`[] | + +#### Defined in + +[sdk/src/types/metadata.d.ts:64](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L64) + +--- + +### work_timeframe + +• **work_timeframe**: `Object` + +Work time period. The value is UNIX time in seconds from epoch. + +#### Index signature + +▪ [k: `string`]: `unknown` + +#### Type declaration + +| Name | Type | +| :--------------- | :--------- | +| `display_value?` | `string` | +| `name?` | `string` | +| `value?` | `number`[] | + +#### Defined in + +[sdk/src/types/metadata.d.ts:74](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/metadata.d.ts#L74) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/internal.HypercertMinter.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/internal.HypercertMinter.md new file mode 100644 index 00000000..3f4ea346 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/interfaces/internal.HypercertMinter.md @@ -0,0 +1,17 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / [internal](../modules/internal.md) / HypercertMinter + +# Interface: HypercertMinter + +[internal](../modules/internal.md).HypercertMinter + +Hypercert contract interface. + +**`Notice`** + +hacky loop to get typedoc to generate all the docs + +## Hierarchy + +- `HypercertMinter` + + ↳ **`HypercertMinter`** diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/modules.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/modules.md new file mode 100644 index 00000000..15998930 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/modules.md @@ -0,0 +1,638 @@ +[Hypercerts SDK Documentation](README.md) / Exports + +# Hypercerts SDK Documentation + +## Table of contents + +### References + +- [Claim](modules.md#claim) +- [ClaimToken](modules.md#claimtoken) +- [ClaimTokensByClaimQuery](modules.md#claimtokensbyclaimquery) + +### Modules + +- [internal](modules/internal.md) + +### Classes + +- [ClientError](classes/ClientError.md) +- [ConfigurationError](classes/ConfigurationError.md) +- [FetchError](classes/FetchError.md) +- [HypercertClient](classes/HypercertClient.md) +- [HypercertsStorage](classes/HypercertsStorage.md) +- [InvalidOrMissingError](classes/InvalidOrMissingError.md) +- [MalformedDataError](classes/MalformedDataError.md) +- [MintingError](classes/MintingError.md) +- [StorageError](classes/StorageError.md) +- [UnknownSchemaError](classes/UnknownSchemaError.md) +- [UnsupportedChainError](classes/UnsupportedChainError.md) + +### Interfaces + +- [CustomError](interfaces/CustomError.md) +- [DuplicateEvaluation](interfaces/DuplicateEvaluation.md) +- [EASEvaluation](interfaces/EASEvaluation.md) +- [HypercertClaimdata](interfaces/HypercertClaimdata.md) +- [HypercertClientInterface](interfaces/HypercertClientInterface.md) +- [HypercertClientMethods](interfaces/HypercertClientMethods.md) +- [HypercertClientState](interfaces/HypercertClientState.md) +- [HypercertEvaluationSchema](interfaces/HypercertEvaluationSchema.md) +- [HypercertIndexerInterface](interfaces/HypercertIndexerInterface.md) +- [HypercertMetadata](interfaces/HypercertMetadata.md) +- [HypercertPointer](interfaces/HypercertPointer.md) +- [HypercertStorageInterface](interfaces/HypercertStorageInterface.md) +- [IPFSEvaluation](interfaces/IPFSEvaluation.md) +- [SimpleTextEvaluation](interfaces/SimpleTextEvaluation.md) + +### Type Aliases + +- [AllowlistEntry](modules.md#allowlistentry) +- [Deployment](modules.md#deployment) +- [EvaluationData](modules.md#evaluationdata) +- [EvaluationSource](modules.md#evaluationsource) +- [HypercertClientConfig](modules.md#hypercertclientconfig) +- [HypercertClientProps](modules.md#hypercertclientprops) +- [HypercertEvaluatorConfig](modules.md#hypercertevaluatorconfig) +- [HypercertStorageConfig](modules.md#hypercertstorageconfig) +- [HypercertsSdkError](modules.md#hypercertssdkerror) +- [QueryParams](modules.md#queryparams) +- [SupportedChainIds](modules.md#supportedchainids) +- [TransferRestrictions](modules.md#transferrestrictions) + +### Properties + +- [ClaimByIdQuery](modules.md#claimbyidquery) + +### Variables + +- [INDEFINITE_DATE_STRING](modules.md#indefinite_date_string) +- [TransferRestrictions](modules.md#transferrestrictions-1) + +### Functions + +- [execute](modules.md#execute) +- [formatDate](modules.md#formatdate) +- [formatHypercertData](modules.md#formathypercertdata) +- [formatUnixTime](modules.md#formatunixtime) +- [validateAllowlist](modules.md#validateallowlist) +- [validateClaimData](modules.md#validateclaimdata) +- [validateDuplicateEvaluationData](modules.md#validateduplicateevaluationdata) +- [validateMetaData](modules.md#validatemetadata) +- [validateSimpleTextEvaluationData](modules.md#validatesimpletextevaluationdata) +- [verifyMerkleProof](modules.md#verifymerkleproof) +- [verifyMerkleProofs](modules.md#verifymerkleproofs) + +## References + +### Claim + +Renames and re-exports [ClaimByIdQuery](modules.md#claimbyidquery) + +--- + +### ClaimToken + +Renames and re-exports [ClaimByIdQuery](modules.md#claimbyidquery) + +--- + +### ClaimTokensByClaimQuery + +Renames and re-exports [ClaimByIdQuery](modules.md#claimbyidquery) + +## Type Aliases + +### AllowlistEntry + +Ƭ **AllowlistEntry**: `Object` + +Allowlist entry for Hypercerts matching the definitions in the Hypercerts protocol + +**`Param`** + +Address of the recipient + +**`Param`** + +Number of units allocated to the recipient + +#### Type declaration + +| Name | Type | +| :-------- | :------------- | +| `address` | `string` | +| `units` | `BigNumberish` | + +#### Defined in + +[sdk/src/types/hypercerts.ts:22](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/hypercerts.ts#L22) + +--- + +### Deployment + +Ƭ **Deployment**: `Object` + +Represents a deployment of a contract on a specific network. + +#### Type declaration + +| Name | Type | Description | +| :---------------- | :------- | :--------------------------------------------------------------------------------------- | +| `chainId` | `number` | The ID of the network on which the contract is deployed. | +| `chainName` | `string` | The name of the network on which the contract is deployed. | +| `contractAddress` | `string` | The address of the deployed contract. | +| `graphUrl` | `string` | The url to the subgraph that indexes the contract events. Override for localized testing | + +#### Defined in + +[sdk/src/types/client.ts:21](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L21) + +--- + +### EvaluationData + +Ƭ **EvaluationData**: [`DuplicateEvaluation`](interfaces/DuplicateEvaluation.md) \| [`SimpleTextEvaluation`](interfaces/SimpleTextEvaluation.md) + +This file was automatically generated by json-schema-to-typescript. +DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +and run json-schema-to-typescript to regenerate this file. + +#### Defined in + +[sdk/src/types/evaluation.d.ts:8](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L8) + +--- + +### EvaluationSource + +Ƭ **EvaluationSource**: [`EASEvaluation`](interfaces/EASEvaluation.md) \| [`IPFSEvaluation`](interfaces/IPFSEvaluation.md) + +#### Defined in + +[sdk/src/types/evaluation.d.ts:9](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/evaluation.d.ts#L9) + +--- + +### HypercertClientConfig + +Ƭ **HypercertClientConfig**: [`Deployment`](modules.md#deployment) & [`HypercertStorageConfig`](modules.md#hypercertstorageconfig) & [`HypercertEvaluatorConfig`](modules.md#hypercertevaluatorconfig) & { `operator`: `ethers.providers.Provider` \| `ethers.Signer` ; `unsafeForceOverrideConfig?`: `boolean` } + +Configuration options for the Hypercert client. + +#### Defined in + +[sdk/src/types/client.ts:35](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L35) + +--- + +### HypercertClientProps + +Ƭ **HypercertClientProps**: `Object` + +The props for the Hypercert client. + +#### Type declaration + +| Name | Type | Description | +| :-------- | :---------------------------------------------------------------------- | :-------------------------------------------------- | +| `config?` | `Partial`<[`HypercertClientConfig`](modules.md#hypercertclientconfig)\> | The configuration options for the Hypercert client. | + +#### Defined in + +[sdk/src/types/client.ts:99](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L99) + +--- + +### HypercertEvaluatorConfig + +Ƭ **HypercertEvaluatorConfig**: `Omit`<`PartialTypedDataConfig`, `"address"`\> & { `easContractAddress`: `string` } + +Configuration options for the Hypercert evaluator. + +**`Note`** + +The signer is required for submitting evaluations. + +#### Defined in + +[sdk/src/types/client.ts:59](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L59) + +--- + +### HypercertStorageConfig + +Ƭ **HypercertStorageConfig**: `Object` + +Configuration options for the Hypercert storage layer. + +**`Note`** + +The API tokens are optional, but required for storing data on NFT.storage and Web3.storage. + +#### Type declaration + +| Name | Type | Description | +| :------------------ | :------- | :------------------------------ | +| `nftStorageToken?` | `string` | The API token for NFT.storage. | +| `web3StorageToken?` | `string` | The API token for Web3.storage. | + +#### Defined in + +[sdk/src/types/client.ts:48](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L48) + +--- + +### HypercertsSdkError + +Ƭ **HypercertsSdkError**: [`ConfigurationError`](classes/ConfigurationError.md) \| [`FetchError`](classes/FetchError.md) \| [`InvalidOrMissingError`](classes/InvalidOrMissingError.md) \| [`MalformedDataError`](classes/MalformedDataError.md) \| [`MintingError`](classes/MintingError.md) \| [`StorageError`](classes/StorageError.md) \| [`UnsupportedChainError`](classes/UnsupportedChainError.md) \| [`UnknownSchemaError`](classes/UnknownSchemaError.md) + +#### Defined in + +[sdk/src/types/errors.ts:173](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/errors.ts#L173) + +--- + +### QueryParams + +Ƭ **QueryParams**: `Object` + +#### Index signature + +▪ [key: `string`]: `any` + +#### Type declaration + +| Name | Type | +| :---------------- | :------------------ | +| `first` | `number` | +| `orderDirections` | `"asc"` \| `"desc"` | +| `skip` | `number` | + +#### Defined in + +[sdk/src/types/indexer.ts:10](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/indexer.ts#L10) + +--- + +### SupportedChainIds + +Ƭ **SupportedChainIds**: `5` \| `10` + +#### Defined in + +[sdk/src/types/client.ts:10](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/client.ts#L10) + +--- + +### TransferRestrictions + +Ƭ **TransferRestrictions**: typeof [`TransferRestrictions`](modules.md#transferrestrictions-1)[keyof typeof [`TransferRestrictions`](modules.md#transferrestrictions-1)] + +#### Defined in + +[sdk/src/types/hypercerts.ts:9](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/hypercerts.ts#L9) + +[sdk/src/types/hypercerts.ts:15](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/hypercerts.ts#L15) + +## Properties + +### ClaimByIdQuery + +• **ClaimByIdQuery**: `any` + +## Variables + +### INDEFINITE_DATE_STRING + +• `Const` **INDEFINITE_DATE_STRING**: `"indefinite"` + +#### Defined in + +[sdk/src/utils/formatter.ts:4](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/utils/formatter.ts#L4) + +--- + +### TransferRestrictions + +• `Const` **TransferRestrictions**: `Object` + +Transfer restrictions for Hypercerts matching the definitions in the Hypercerts protocol + +**`Dev`** + +AllowAll: All transfers are allowed + +**`Dev`** + +DisallowAll: All transfers are disallowed + +**`Dev`** + +FromCreatorOnly: Only the creator can transfer the Hypercert + +#### Type declaration + +| Name | Type | +| :---------------- | :--- | +| `AllowAll` | `0` | +| `DisallowAll` | `1` | +| `FromCreatorOnly` | `2` | + +#### Defined in + +[sdk/src/types/hypercerts.ts:9](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/hypercerts.ts#L9) + +[sdk/src/types/hypercerts.ts:15](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/types/hypercerts.ts#L15) + +## Functions + +### execute + +▸ **execute**(`document`, `variables`, `context?`, `rootValue?`, `operationName?`): `Promise`<`ExecutionResult`<`any`, `ObjMap`<`unknown`\>\>\> + +#### Parameters + +| Name | Type | +| :--------------- | :-------------------------------- | +| `document` | `GraphQLOperation`<`any`, `any`\> | +| `variables` | `any` | +| `context?` | `any` | +| `rootValue?` | `any` | +| `operationName?` | `string` | + +#### Returns + +`Promise`<`ExecutionResult`<`any`, `ObjMap`<`unknown`\>\>\> + +#### Defined in + +node_modules/@graphql-mesh/runtime/typings/types.d.ts:25 + +--- + +### formatDate + +▸ **formatDate**(`date`): `string` + +#### Parameters + +| Name | Type | +| :----- | :----- | +| `date` | `Date` | + +#### Returns + +`string` + +#### Defined in + +[sdk/src/utils/formatter.ts:13](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/utils/formatter.ts#L13) + +--- + +### formatHypercertData + +▸ **formatHypercertData**(`«destructured»`): [`FormatResult`](modules/internal.md#formatresult) + +Formats input data to an object containing HypercertMetadata including appropriate labels + +#### Parameters + +| Name | Type | +| :----------------------- | :----------------------------------------------- | +| `«destructured»` | `Object` | +| › `contributors` | `string`[] | +| › `description` | `string` | +| › `excludedImpactScope` | `string`[] | +| › `excludedRights` | `string`[] | +| › `excludedWorkScope` | `string`[] | +| › `external_url?` | `string` | +| › `image` | `string` | +| › `impactScope` | `string`[] | +| › `impactTimeframeEnd` | `number` | +| › `impactTimeframeStart` | `number` | +| › `name` | `string` | +| › `properties?` | { `trait_type`: `string` ; `value`: `string` }[] | +| › `rights` | `string`[] | +| › `version` | `string` | +| › `workScope` | `string`[] | +| › `workTimeframeEnd` | `number` | +| › `workTimeframeStart` | `number` | + +#### Returns + +[`FormatResult`](modules/internal.md#formatresult) + +#### Defined in + +[sdk/src/utils/formatter.ts:27](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/utils/formatter.ts#L27) + +--- + +### formatUnixTime + +▸ **formatUnixTime**(`seconds`): `string` + +#### Parameters + +| Name | Type | +| :-------- | :------- | +| `seconds` | `number` | + +#### Returns + +`string` + +#### Defined in + +[sdk/src/utils/formatter.ts:5](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/utils/formatter.ts#L5) + +--- + +### validateAllowlist + +▸ **validateAllowlist**(`data`, `units`): `Object` + +Validates the data for an allowlist. + +#### Parameters + +| Name | Type | Description | +| :------ | :---------------------------------------------- | :------------------------------------------ | +| `data` | [`AllowlistEntry`](modules.md#allowlistentry)[] | The data to validate. | +| `units` | `BigNumberish` | The total number of units in the allowlist. | + +#### Returns + +`Object` + +A `ValidationResult` object indicating whether the data is valid and any errors that were found. + +| Name | Type | +| :------- | :------------------------------------------ | +| `errors` | `Record`<`string`, `string` \| `string`[]\> | +| `valid` | `boolean` | + +#### Defined in + +[sdk/src/validator/index.ts:91](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L91) + +--- + +### validateClaimData + +▸ **validateClaimData**(`data`): [`ValidationResult`](modules/internal.md#validationresult) + +Validates the data for a simple text evaluation. + +#### Parameters + +| Name | Type | Description | +| :----- | :------------------------------------------------------- | :-------------------- | +| `data` | [`HypercertClaimdata`](interfaces/HypercertClaimdata.md) | The data to validate. | + +#### Returns + +[`ValidationResult`](modules/internal.md#validationresult) + +A `ValidationResult` object indicating whether the data is valid and any errors that were found. + +#### Defined in + +[sdk/src/validator/index.ts:64](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L64) + +--- + +### validateDuplicateEvaluationData + +▸ **validateDuplicateEvaluationData**(`data`): [`ValidationResult`](modules/internal.md#validationresult) + +Validates the data for a duplicate evaluation. + +#### Parameters + +| Name | Type | Description | +| :----- | :--------------------------------------------------------- | :-------------------- | +| `data` | [`DuplicateEvaluation`](interfaces/DuplicateEvaluation.md) | The data to validate. | + +#### Returns + +[`ValidationResult`](modules/internal.md#validationresult) + +A `ValidationResult` object indicating whether the data is valid and any errors that were found. + +#### Defined in + +[sdk/src/validator/index.ts:117](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L117) + +--- + +### validateMetaData + +▸ **validateMetaData**(`data`): [`ValidationResult`](modules/internal.md#validationresult) + +Validates the data for a simple text evaluation. + +#### Parameters + +| Name | Type | Description | +| :----- | :----------------------------------------------------- | :-------------------- | +| `data` | [`HypercertMetadata`](interfaces/HypercertMetadata.md) | The data to validate. | + +#### Returns + +[`ValidationResult`](modules/internal.md#validationresult) + +A `ValidationResult` object indicating whether the data is valid and any errors that were found. + +#### Defined in + +[sdk/src/validator/index.ts:38](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L38) + +--- + +### validateSimpleTextEvaluationData + +▸ **validateSimpleTextEvaluationData**(`data`): [`ValidationResult`](modules/internal.md#validationresult) + +Validates the data for a simple text evaluation. + +#### Parameters + +| Name | Type | Description | +| :----- | :----------------------------------------------------------- | :-------------------- | +| `data` | [`SimpleTextEvaluation`](interfaces/SimpleTextEvaluation.md) | The data to validate. | + +#### Returns + +[`ValidationResult`](modules/internal.md#validationresult) + +A `ValidationResult` object indicating whether the data is valid and any errors that were found. + +#### Defined in + +[sdk/src/validator/index.ts:142](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L142) + +--- + +### verifyMerkleProof + +▸ **verifyMerkleProof**(`root`, `signerAddress`, `units`, `proof`): `void` + +Verifies a Merkle proof for a given address and units. + +**`Throws`** + +If the Merkle proof verification fails. + +#### Parameters + +| Name | Type | Description | +| :-------------- | :------------- | :-------------------------------------- | +| `root` | `string` | The Merkle root hash to verify against. | +| `signerAddress` | `string` | The address to verify. | +| `units` | `BigNumberish` | The units to verify. | +| `proof` | `string`[] | The Merkle proof to verify. | + +#### Returns + +`void` + +#### Defined in + +[sdk/src/validator/index.ts:170](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L170) + +--- + +### verifyMerkleProofs + +▸ **verifyMerkleProofs**(`roots`, `signerAddress`, `units`, `proofs`): `void` + +Batch verifies Merkle proofs for multiple roots, units and proofs for a single address + +**`Throws`** + +If the Merkle proof verification fails. + +**`Notice`** + +Wrapper around `verifyMerkleProof` to batch verify multiple proofs + +#### Parameters + +| Name | Type | Description | +| :-------------- | :--------------- | :---------------------------------------- | +| `roots` | `string`[] | The Merkle root hashes to verify against. | +| `signerAddress` | `string` | The address to verify. | +| `units` | `BigNumberish`[] | The units to verify. | +| `proofs` | `string`[][] | The Merkle proofs to verify. | + +#### Returns + +`void` + +#### Defined in + +[sdk/src/validator/index.ts:190](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L190) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/modules/internal.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/modules/internal.md new file mode 100644 index 00000000..d20a3804 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/api/sdk/modules/internal.md @@ -0,0 +1,307 @@ +[Hypercerts SDK Documentation](../README.md) / [Exports](../modules.md) / internal + +# Module: internal + +## Table of contents + +### Classes + +- [default](../classes/internal.default.md) +- [default](../classes/internal.default-1.md) +- [default](../classes/internal.default-2.md) + +### Interfaces + +- [EvaluatorInterface](../interfaces/internal.EvaluatorInterface.md) +- [HypercertClaimdata](../interfaces/internal.HypercertClaimdata.md) +- [HypercertMinter](../interfaces/internal.HypercertMinter.md) + +### Type Aliases + +- [Claim](internal.md#claim) +- [ClaimByIdQuery](internal.md#claimbyidquery) +- [ClaimToken](internal.md#claimtoken) +- [ClaimTokenByIdQuery](internal.md#claimtokenbyidquery) +- [ClaimTokensByClaimQuery](internal.md#claimtokensbyclaimquery) +- [ClaimTokensByOwnerQuery](internal.md#claimtokensbyownerquery) +- [ClaimsByOwnerQuery](internal.md#claimsbyownerquery) +- [Exact](internal.md#exact) +- [FormatResult](internal.md#formatresult) +- [InputMaybe](internal.md#inputmaybe) +- [Maybe](internal.md#maybe) +- [OrderDirection](internal.md#orderdirection) +- [RecentClaimsQuery](internal.md#recentclaimsquery) +- [Scalars](internal.md#scalars) +- [ValidationResult](internal.md#validationresult) + +## Type Aliases + +### Claim + +Ƭ **Claim**: `Object` + +#### Type declaration + +| Name | Type | +| :------------ | :---------------------------------------------------------------------------- | +| `chainName` | [`Scalars`](internal.md#scalars)[``"String"``] | +| `contract` | [`Scalars`](internal.md#scalars)[``"String"``] | +| `creation` | [`Scalars`](internal.md#scalars)[``"BigInt"``] | +| `creator?` | [`Maybe`](internal.md#maybe)<[`Scalars`](internal.md#scalars)[``"Bytes"``]\> | +| `id` | [`Scalars`](internal.md#scalars)[``"String"``] | +| `owner?` | [`Maybe`](internal.md#maybe)<[`Scalars`](internal.md#scalars)[``"Bytes"``]\> | +| `tokenID` | [`Scalars`](internal.md#scalars)[``"BigInt"``] | +| `totalUnits?` | [`Maybe`](internal.md#maybe)<[`Scalars`](internal.md#scalars)[``"BigInt"``]\> | +| `uri?` | [`Maybe`](internal.md#maybe)<[`Scalars`](internal.md#scalars)[``"String"``]\> | + +#### Defined in + +[sdk/.graphclient/index.ts:275](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L275) + +--- + +### ClaimByIdQuery + +Ƭ **ClaimByIdQuery**: `Object` + +#### Type declaration + +| Name | Type | +| :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `claim?` | [`Maybe`](internal.md#maybe)<`Pick`<[`Claim`](internal.md#claim), `"chainName"` \| `"contract"` \| `"tokenID"` \| `"creator"` \| `"id"` \| `"owner"` \| `"totalUnits"` \| `"uri"`\>\> | + +#### Defined in + +[sdk/.graphclient/index.ts:985](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L985) + +--- + +### ClaimToken + +Ƭ **ClaimToken**: `Object` + +#### Type declaration + +| Name | Type | +| :---------- | :--------------------------------------------- | +| `chainName` | [`Scalars`](internal.md#scalars)[``"String"``] | +| `claim` | [`Claim`](internal.md#claim) | +| `id` | [`Scalars`](internal.md#scalars)[``"String"``] | +| `owner` | [`Scalars`](internal.md#scalars)[``"Bytes"``] | +| `tokenID` | [`Scalars`](internal.md#scalars)[``"BigInt"``] | +| `units` | [`Scalars`](internal.md#scalars)[``"BigInt"``] | + +#### Defined in + +[sdk/.graphclient/index.ts:287](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L287) + +--- + +### ClaimTokenByIdQuery + +Ƭ **ClaimTokenByIdQuery**: `Object` + +#### Type declaration + +| Name | Type | +| :------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `claimToken?` | [`Maybe`](internal.md#maybe)<`Pick`<[`ClaimToken`](internal.md#claimtoken), `"chainName"` \| `"id"` \| `"owner"` \| `"tokenID"` \| `"units"`\> & { `claim`: `Pick`<[`Claim`](internal.md#claim), `"id"` \| `"creation"` \| `"uri"` \| `"totalUnits"`\> }\> | + +#### Defined in + +[sdk/.graphclient/index.ts:1015](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L1015) + +--- + +### ClaimTokensByClaimQuery + +Ƭ **ClaimTokensByClaimQuery**: `Object` + +#### Type declaration + +| Name | Type | +| :------------ | :------------------------------------------------------------------------------------------------------------------ | +| `claimTokens` | `Pick`<[`ClaimToken`](internal.md#claimtoken), `"chainName"` \| `"id"` \| `"owner"` \| `"tokenID"` \| `"units"`\>[] | + +#### Defined in + +[sdk/.graphclient/index.ts:1008](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L1008) + +--- + +### ClaimTokensByOwnerQuery + +Ƭ **ClaimTokensByOwnerQuery**: `Object` + +#### Type declaration + +| Name | Type | +| :------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `claimTokens` | `Pick`<[`ClaimToken`](internal.md#claimtoken), `"chainName"` \| `"id"` \| `"owner"` \| `"tokenID"` \| `"units"`\> & { `claim`: `Pick`<[`Claim`](internal.md#claim), `"id"` \| `"creation"` \| `"uri"` \| `"totalUnits"`\> }[] | + +#### Defined in + +[sdk/.graphclient/index.ts:995](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L995) + +--- + +### ClaimsByOwnerQuery + +Ƭ **ClaimsByOwnerQuery**: `Object` + +#### Type declaration + +| Name | Type | +| :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `claims` | `Pick`<[`Claim`](internal.md#claim), `"chainName"` \| `"contract"` \| `"tokenID"` \| `"creator"` \| `"id"` \| `"owner"` \| `"totalUnits"` \| `"uri"`\>[] | + +#### Defined in + +[sdk/.graphclient/index.ts:969](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L969) + +--- + +### Exact + +Ƭ **Exact**<`T`\>: { [K in keyof T]: T[K] } + +#### Type parameters + +| Name | Type | +| :--- | :--------------- | +| `T` | extends `Object` | + +#### Defined in + +[sdk/.graphclient/index.ts:28](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L28) + +--- + +### FormatResult + +Ƭ **FormatResult**: `Object` + +#### Type declaration + +| Name | Type | +| :------- | :------------------------------------------------------------------ | +| `data` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) \| `null` | +| `errors` | `Record`<`string`, `string`\> \| `null` | +| `valid` | `boolean` | + +#### Defined in + +[sdk/src/utils/formatter.ts:20](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/utils/formatter.ts#L20) + +--- + +### InputMaybe + +Ƭ **InputMaybe**<`T`\>: [`Maybe`](internal.md#maybe)<`T`\> + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Defined in + +[sdk/.graphclient/index.ts:27](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L27) + +--- + +### Maybe + +Ƭ **Maybe**<`T`\>: `T` \| `null` + +#### Type parameters + +| Name | +| :--- | +| `T` | + +#### Defined in + +[sdk/.graphclient/index.ts:26](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L26) + +--- + +### OrderDirection + +Ƭ **OrderDirection**: `"asc"` \| `"desc"` + +Defines the order direction, either ascending or descending + +#### Defined in + +[sdk/.graphclient/index.ts:507](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L507) + +--- + +### RecentClaimsQuery + +Ƭ **RecentClaimsQuery**: `Object` + +#### Type declaration + +| Name | Type | +| :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `claims` | `Pick`<[`Claim`](internal.md#claim), `"chainName"` \| `"contract"` \| `"tokenID"` \| `"creator"` \| `"id"` \| `"owner"` \| `"totalUnits"` \| `"uri"`\>[] | + +#### Defined in + +[sdk/.graphclient/index.ts:978](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L978) + +--- + +### Scalars + +Ƭ **Scalars**: `Object` + +All built-in and custom scalars, mapped to their actual values + +#### Type declaration + +| Name | Type | +| :----------- | :-------- | +| `BigDecimal` | `any` | +| `BigInt` | `any` | +| `Boolean` | `boolean` | +| `Bytes` | `any` | +| `Float` | `number` | +| `ID` | `string` | +| `Int` | `number` | +| `Int8` | `any` | +| `String` | `string` | + +#### Defined in + +[sdk/.graphclient/index.ts:36](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/.graphclient/index.ts#L36) + +--- + +### ValidationResult + +Ƭ **ValidationResult**: `Object` + +The result of a validation. + +**`Property`** + +Whether the data is valid. + +**`Property`** + +A map of errors, where the key is the field that failed validation and the value is the error message. + +#### Type declaration + +| Name | Type | +| :------- | :---------------------------- | +| `errors` | `Record`<`string`, `string`\> | +| `valid` | `boolean` | + +#### Defined in + +[sdk/src/validator/index.ts:28](https://github.com/Network-Goods/hypercerts/blob/9677274/sdk/src/validator/index.ts#L28) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/burning.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/burning.md new file mode 100644 index 00000000..b591d11d --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/burning.md @@ -0,0 +1,12 @@ +# Burning + +> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. + +## Burning fraction tokens + +You can only burn fraction tokens that you own. Hypercert claims cannot be burned once minted. +You can get a list of all fraction tokens you own with [this query](./querying.md#claimtokensbyowner). + +```js +const txn = await hypercerts.burnFraction({ tokenId }); +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/config.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/config.md new file mode 100644 index 00000000..0be153cb --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/config.md @@ -0,0 +1,110 @@ +# Hypercert Client Configuration + +The client provides a high level interface that communicates with the Graph, IPFS and the evm. For easy setup we harmonised the configuration into a flow that allows for configuration with different levels of specificity. + +## Configuration + +### Setup + +The SDK allows for minimal configuration, explicit overrides and defining values in environment variables. We apply the following hierarchy: + +1. Overrides declared in `Partial` + +Based on the chainID (either 5 or 10) we load the default config for Goerli or Optimism. + +We then process the rest of the overrides and possible environment variables to customise the default configuration. + +To get started quickly you can either: + +- initialize a new client by calling `new HypercertClient({chain: {id: 5})` (or 10) + +Using either of the options above will launch the client in `read only` mode using the defaults in [constants.ts](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/constants.ts) + +### Read-only mode + +The SDK client will be in read-only mode if any of the following conditions are true: + +- The client was initialized without an operator. +- The client was initialized with an operator without signing abilities. +- The contract address is not set. +- The storage layer is in read-only mode. + +If any of these conditions are true, the read-only property of the `HypercertClient` instance will be set to true, and a warning message will be logged indicating that the client is in read-only mode. + +### Defaults + +The [constants.ts](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/constants.ts) file defines various defaults constants that are used throughout the Hypercert system. + +`DEFAULT_CHAIN_ID`: This constant defines the default chain ID to use if no chain ID is specified. In this case, the +default chain ID is set to 5, which corresponds to the Goerli testnet. + +Based on `DEFAULT_CHAIN_ID` the SDK will select a `DEPLOYMENT`. + +`DEPLOYMENTS`: This constant defines the deployments that are managed by the Hypercert system. Each Deployment object +contains information about a specific deployment, including the chain ID, chain name, contract address, and graph name. + +For example: + +```json +{ + "5": { + "chainId": 5, + "chainName": "goerli", + "contractAddress": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", + "graphUrl": "https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-testnet" + } +} +``` + +You can select which deployment to use by either passing in a `chainId` configuration parameter or setting the `DEFAULT_CHAIN_ID` environment variable. We also allow for `overrides` +when creating the SDK by passing configuration variables. Finally, when not defaults or overrides are found, we check the environment variables. + +### Client config properties + +| Property | Type | Description | +| ------------------ | -------------------------- | -------------------------------------- | ------------------------------ | +| `chainId` | `number` | The chain ID of the network to use. | +| `chainName` | `string` | The name of the network to use. | +| `contractAddress` | `string` | The address of the Hypercert contract. | +| `graphUrl` | `string` | The url of the subgraph to use. | +| `operator` | `ethers.providers.Provider | ethers.Signer` | The provider or signer to use. | +| `nftStorageToken` | `string` | Your NFT.storage API key. | +| `web3StorageToken` | `string` | Your web3.storage API key. | + +- [Get an NFT.Storage API token](https://nft.storage/docs/#get-an-api-token) +- [Get a web3.storage API token](https://web3.storage/docs/how-tos/generate-api-token/) + +### Environment variables + +You can also configure the SDK via environment variables. If you set both the config parameter and environment variable, the config parameter will take precedent. + +We provide a [template file](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/.env.template) in our monorepo. + +| Environment Variable | Description | +| -------------------------------- | --------------------------------------------------------------------------------------------------- | +| `DEFAULT_CHAIN_ID` | Specifies the default chain ID to use if no chain ID is specified. | +| `CONTRACT_ADDRESS` | Specifies the contract address to use for the Hypercert protocol. | +| `PRIVATE_KEY` | Specifies the private key to use for signing transactions. | +| `NFT_STORAGE_TOKEN` | Specifies the NFT.storage API token to use for storing Hypercert metadata. | +| `NEXT_PUBLIC_NFT_STORAGE_TOKEN` | Specifies the NFT.storage API token to use for storing Hypercert metadata in a Next.js application. | +| `WEB3_STORAGE_TOKEN` | Specifies the Web3.storage API token to use for storing Hypercert data. | +| `NEXT_PUBLIC_WEB3_STORAGE_TOKEN` | Specifies the Web3.storage API token to use for storing Hypercert data in a Next.js application. | + +### Logging + +The logger for the SDK uses the log level based on the value of the LOG_LEVEL environment variable. The log level +determines which log messages are printed to the console. By default, the logger is configured to log messages with a +level of info or higher to the console. + +In your `.env` file: + +```bash +LOG_LEVEL="info" +``` + +The SDK logger supports four log levels: `error`, `warn`, `info`, and `debug`. + +- The `error` log level is used to log errors that occur in the SDK. +- The `warn` log level is used to log warnings that do not necessarily indicate an error, but may be important to investigate. +- The `info` log level is used to log general information about the SDK's state or behavior. +- The `debug` log level is used to log detailed information that is useful for debugging purposes. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/errors.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/errors.md new file mode 100644 index 00000000..60f4e5e7 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/errors.md @@ -0,0 +1,18 @@ +# Errors in the SDK + +Generally, we follow the pattern of throwing on errors and letting those surface to the application. This allows for developers to handle any (un)expected errors in a manner they find suitable. + +### Handling Errors + +To support debugging we've implemented some custom errors. + +| Error | Reason | Payload | +| --------------------- | ------------------------------------------------- | ---------------------------- | --------- | +| ClientError | An error caused by the client | `{ [key: string]: unknown }` | +| FetchError | An error caused by a failed API call | `{ [key: string]: unknown }` | +| InvalidOrMissingError | An error caused by a missing environment variable | `{ keyName: string }` | +| MalformedDataError | An error caused by invalid or malformed data | `{ [key: string]: unknown }` | +| MintingError | An error caused by a failed EVM call to mint | `{ [key: string]: unknown }` | +| StorageError | An error caused by NFT-/Web3 Storage | `{ [key: string]: unknown }` | +| UnsupportedChainError | An error caused by an unsupported EVM chain ID | `{ chainID: string | number }` | +| UnknownSchemaError | An error caused by a missing validation schema | `{ schemaName: string }` | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/evaluations.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/evaluations.md new file mode 100644 index 00000000..c5399a4f --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/evaluations.md @@ -0,0 +1,13 @@ +# Evaluations + +> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. + +## Respond / or contest an evaluation + +To create an evaluation of a hypercert + +```js +TODO; +``` + +_Note: Under the hood, we leverage the [Ethereum Attestation Service](https://attest.sh/) for creating evaluations_ diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/minting.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/minting.md new file mode 100644 index 00000000..d5ff1226 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/minting.md @@ -0,0 +1,57 @@ +# Minting + +## Token design + +Hypercerts are semi-fungible tokens. +Thus, each hypercert is represented on-chain by a group of fraction tokens, +each representing a fraction of ownership over the hypercert. +If you want to split your fraction token, or merge multiple tokens into one, +check out the section on [splitting and merging](./split-merge.md). + +## Minting your first hypercert + +To mint a hypercert you need to provide the `metadata`, total amount of `units` and the preferred `TransferRestrictions`. +The resulting hypercert will be wholly owned by the creator. + +```js +import { TransferRestrictions, formatHypercertData } from "@hypercerts-org/sdk" + +const { metadata } = formatHypercertData(...); +const totalUnits = "10000"; + +const tx: Promise = await hypercerts.mintClaim({ + metadata, + totalUnits, + transferRestrictions: TransferRestrictions.FromCreatorOnly, +}); +``` + +> **Note** If you did not initialize your HypercertsClient with an `operator`, `nftStorageToken` and `web3StorageToken`, the client will run in [read-only mode](#read-only-mode) and this will fail. + +Let's see what happens under the hood: + +First, `mintClaim` checks that the client is not `read only` and that the operator is a `Signer`. If not, it throws an `InvalidOrMissingError`. + +Next, the function validates the provided metadata using the `validateMetaData` function. If the metadata is invalid, it throws a `MalformedDataError`. The function then stores the metadata on `IPFS` using the `storeMetadata` method and returns the `CID` for the metadata. + +Finally, we call the mintClaim function on the contract with the signer `address`, total `units`, `CID`, and `transfer restriction` as parameters. If `overrides` are provided, the function uses them to send the transaction. Otherwise, it sends the transaction without overrides. + +## Transfer restrictions + +When minting a Hypercert, you must pass in a `TransferRestriction` policy. For now there are only 3 implemented policies: + +```js +enum TransferRestrictions { + // Unrestricted + AllowAll, + // All transfers disabled after minting + DisallowAll, + // Only the original creator can transfer + FromCreatorOnly +} +``` + +## Reference + +See the [code](https://github.com/hypercerts-org/hypercerts/tree/main/sdk/src/client.ts) +for more details on how we implement minting. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/querying.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/querying.md new file mode 100644 index 00000000..98ebbb83 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/querying.md @@ -0,0 +1,306 @@ +# Querying + +## Overview + +The `HypercertClient` provides a high-level interface for interacting with the Hypercert ecosystem. The HypercertClient +has three getter methods: `storage`, `indexer`, and `contract`. These methods return instances of the HypercertsStorage, +HypercertIndexer, and HypercertMinter classes, respectively. + +```js +const { + client: { storage }, +} = new HypercertClient({}); +``` + +The `storage` is a utility class that provides methods for storing and retrieving Hypercert metadata off-chain on IPFS. It is used by the HypercertClient to store metadata when creating new Hypercerts. + +```js +const { + client: { indexer }, +} = new HypercertClient({}); +``` + +The `indexer` is a utility class that provides methods for indexing and searching Hypercerts based on various criteria. +It is used by the HypercertClient to retrieve event-based data via the subgraph. + +```js +const { + client: { contract }, +} = new HypercertClient({}); +``` + +Finally we have a `contract` that provides methods for interacting with the HypercertMinter smart contract. It is used +by the HypercertClient to create new Hypercerts and retrieve specific on-chain information. + +By providing instances of these classes through the `storage`, `indexer`, and `contract` getters, the HypercertClient allows developers to easily interact with the various components of the Hypercert system directly. +For example, a developer could use the storage instance to store metadata for a new Hypercert, the indexer instance to search for existing Hypercerts based on various criteria, and the contract instance to create new Hypercerts and retrieve existing Hypercerts from the contract. + +## Indexer + +For indexing purposes, we rely on the [Graph](https://thegraph.com/docs/en/) to index Hypercert events. To make the subgraph easily accessible with typed methods and object we wrap the [Graph Client](https://github.com/graphprotocol/graph-client) and its SDK. + +### Live graph playground + +To inspect the subgraph and explore queries, have a look at the Graph playground for Goerli testnet and Optimism mainnet: + +- [Goerli dashboard](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-testnet) +- [Optimism dashboard](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-optimism-mainnet) + +### Graph client + +Since the client is fully typed, it's easy to explore the functionalities using code completion in IDEs. + +Here's one example from our frontend where we let [react-query](https://www.npmjs.com/package/%2540tanstack/react-query) frequently update the call to the graph: + +```js +import { useHypercertClient } from "./hypercerts-client"; +import { useQuery } from "@tanstack/react-query"; + +export const useFractionsByOwner = (owner: string) => { + const { + client: { indexer }, + } = useHypercertClient(); + + return useQuery( + ["hypercerts", "fractions", "owner", owner], + () => indexer.fractionsByOwner(owner), + { enabled: !!owner, refetchInterval: 5000 }, + ); +}; +``` + +### Queries: Claims + +These tables show the input parameters and output fields for each of the GraphQL queries in [claims.graphql](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/indexer/queries/claims.graphql). +A claim represents 1 Hypercert and all of the common data across all claim/fraction tokens. + +#### `ClaimsByOwner` + +The `ClaimsByOwner` query retrieves an array of claims that belong to a specific owner. + +##### Input + +The query takes the following input parameters: + +| Parameter | Type | Description | Default Value | +| ---------------- | ---------------- | -------------------------------------------------- | ------------- | +| `owner` | `Bytes` | The address of the owner whose claims to retrieve. | "" | +| `orderDirection` | `OrderDirection` | The direction to order the claims. | `asc` | +| `first` | `Int` | The number of claims to retrieve. | `100` | +| `skip` | `Int` | The number of claims to skip. | `0` | + +##### Output + +The query returns an array of claim objects that match the input parameters. Each claim object has the following fields: + +| Field | Type | Description | +| ------------ | -------- | ---------------------------------------------- | +| `chainName` | `String` | The name of the chain the claim was minted on. | +| `contract` | `Bytes` | The address of the contract. | +| `tokenID` | `String` | The token ID. | +| `creator` | `Bytes` | The address of the creator. | +| `id` | `ID` | The ID of the claim. | +| `owner` | `Bytes` | The address of the owner. | +| `totalUnits` | `BigInt` | The total number of units. | +| `uri` | `String` | The URI of the claim metadata. | + +#### `RecentClaims` + +The RecentClaims query retrieves an array of the most recent claims on the Hypercert platform. + +##### Input + +The query takes the following input parameters: + +| Parameter | Type | Description | Default Value | +| ---------------- | ---------------- | ---------------------------------- | ------------- | +| `orderDirection` | `OrderDirection` | The direction to order the claims. | `asc` | +| `first` | `Int` | The number of claims to retrieve. | `100` | +| `skip` | `Int` | The number of claims to skip. | `0` | + +##### Output + +The query returns an array of claim objects that match the input parameters. Each claim object has the following fields: + +| Field | Type | Description | +| ------------ | -------- | ---------------------------------------------- | +| `chainName` | `String` | The name of the chain the claim was minted on. | +| `contract` | `Bytes` | The address of the contract. | +| `tokenID` | `String` | The token ID. | +| `creator` | `Bytes` | The address of the creator. | +| `id` | `ID` | The ID of the claim. | +| `owner` | `Bytes` | The address of the owner. | +| `totalUnits` | `BigInt` | The total number of units. | +| `uri` | `String` | The URI of the claim metadata. | + +#### `ClaimByID` + +The ClaimById query retrieves a single claim by its ID on the Hypercert platform. + +##### Input + +The query takes the following input parameters: + +| Parameter | Type | Description | +| --------- | ----- | -------------------------------- | +| `id` | `ID!` | The ID of the claim to retrieve. | + +##### Output + +The query returns a claim object that matches the input parameter. The claim object has the following fields: + +| Field | Type | Description | +| ------------ | -------- | ---------------------------------------------- | +| `chainName` | `String` | The name of the chain the claim was minted on. | +| `contract` | `Bytes` | The address of the contract. | +| `tokenID` | `String` | The token ID. | +| `creator` | `Bytes` | The address of the creator. | +| `id` | `ID` | The ID of the claim. | +| `owner` | `Bytes` | The address of the owner. | +| `totalUnits` | `BigInt` | The total number of units. | +| `uri` | `String` | The URI of the claim metadata. | + +### Queries: Fractions + +These tables show the input parameters and output fields for each of the GraphQL queries in [fractions.graphql](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/indexer/queries/fractions.graphql). +A claim token represents a fraction of ownership of a Hypercert. + +#### `ClaimTokensByOwner` + +The `ClaimTokensByOwner` query retrieves an array of claim tokens that belong to a specific owner on the Hypercert platform. + +##### Input + +The query takes the following input parameters: + +| Parameter | Type | Description | Default Value | +| ---------------- | ---------------- | -------------------------------------------------------------------- | ------------- | +| `owner` | `Bytes` | The address of the owner whose claim tokens to retrieve. | "" | +| `orderDirection` | `OrderDirection` | The direction to order the claim tokens. The default value is `asc`. | `asc` | +| `first` | `Int` | The number of claim tokens to retrieve. The default value is `100`. | `100` | +| `skip` | `Int` | The number of claim tokens to skip. The default value is `0`. | `0` | + +##### Output + +The query returns an array of claim token objects that match the input parameters. Each claim token object has the following fields: + +| Field | Type | Description | +| ----------- | -------- | ------------------------------------------ | +| `chainName` | `String` | The name of the chain. | +| `id` | `ID` | The ID of the claim token. | +| `owner` | `Bytes` | The address of the owner. | +| `tokenID` | `String` | The token ID. | +| `units` | `BigInt` | The number of units. | +| `claim` | `Claim` | The claim associated with the claim token. | + +The Claim object has the following fields: + +| Field | Type | Description | +| ------------ | -------- | ------------------------------------ | +| `id` | `ID` | The ID of the claim. | +| `creation` | `Int` | The timestamp of the claim creation. | +| `uri` | `String` | The URI of the claim metadata. | +| `totalUnits` | `BigInt` | The total number of units. | + +#### `ClaimTokensByClaim` + +The `ClaimTokensByClaim` query retrieves an array of claim tokens that belong to a specific claim on the Hypercert platform. + +##### Input + +The query takes the following input parameters: + +| Parameter | Type | Description | Default Value | +| ---------------- | ---------------- | -------------------------------------------------------------------- | ------------- | +| `claimId` | `String!` | The ID of the claim whose claim tokens to retrieve. | None | +| `orderDirection` | `OrderDirection` | The direction to order the claim tokens. The default value is `asc`. | `asc` | +| `first` | `Int` | The number of claim tokens to retrieve. The default value is `100`. | `100` | +| `skip` | `Int` | The number of claim tokens to skip. The default value is `0`. | `0` | + +##### Output + +The query returns an array of claim token objects that match the input parameters. Each claim token object has the following fields: + +| Field | Type | Description | +| ----------- | -------- | ---------------------------------------------- | +| `chainName` | `String` | The name of the chain the claim was minted on. | +| `id` | `ID` | The ID of the claim token. | +| `owner` | `Bytes` | The address of the owner. | +| `tokenID` | `String` | The token ID. | +| `units` | `BigInt` | The number of units. | + +#### `ClaimTokenById` Query + +The `ClaimTokenById` query retrieves a single claim token by its ID on the Hypercert platform. + +##### Input + +The query takes the following input parameters: + +| Parameter | Type | Description | +| --------- | ----- | -------------------------------------- | +| `id` | `ID!` | The ID of the claim token to retrieve. | + +##### Output + +The query returns a claim token object that matches the input parameter. The claim token object has the following fields: + +| Field | Type | Description | +| ----------- | -------- | ---------------------------------------------- | +| `chainName` | `String` | The name of the chain the claim was minted on. | +| `id` | `ID` | The ID of the claim token. | +| `owner` | `Bytes` | The address of the owner. | +| `tokenID` | `String` | The token ID. | +| `units` | `BigInt` | The number of units. | +| `claim` | `Claim` | The claim associated with the claim token. | + +The Claim object has the following fields: + +| Field | Type | Description | +| ------------ | -------- | ------------------------------------ | +| `id` | `ID` | The ID of the claim. | +| `creation` | `Int` | The timestamp of the claim creation. | +| `uri` | `String` | The URI of the claim metadata. | +| `totalUnits` | `BigInt` | The total number of units. | + +## Storage + +### Hypercert Metadata + +Currently, all metadata is stored off-chain in IPFS. Use the `storage` client to retrieve the metadata + +```js +const claimId = "0x822f17a9a5eecfd...85254363386255337"; +const { indexer, storage } = hypercertsClient; +// Get the on-chain claim +const claimById = await indexer.claimById(claimId); +// Get the off-chain metadata +const metadata = await storage.getMetadata(claimById.claim.uri); +``` + +## Contract + +### Typechain bindings + +We export the [typechain](https://github.com/dethcrypto/TypeChain) bindings, +which you can import and use from your TypeScript/JavaScript codebase. + +For example: + +```js +import { ethers } from "ethers"; +import { + HyperCertMinterFactory, + HypercertMinterABI, + IHypercertTokenABI, +} from "@hypercerts-org/sdk"; + +const provider = new ethers.getDefaultProvider(network); +const contractInterface = new ethers.utils.Interface(HypercertMinterABI); +const contract = new ethers.Contract( + contractAddress, + HypercertMinterABI, + provider, +); +const metadataUri = await contract.functions.uri(tokenId); +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/quickstart-javascript.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/quickstart-javascript.md new file mode 100644 index 00000000..936cc05b --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/quickstart-javascript.md @@ -0,0 +1,101 @@ +# Getting started with JavaScript + +The Hypercerts SDK makes it easy to integrate Hypercerts into your application or backend with JavaScript/TypeScript. + +## Installation + +Install the SDK using npm or yarn: + +```bash +npm install @hypercerts-org/sdk +# OR yarn add @hypercerts-org/sdk +``` + +## Get storage credentials (only required for minting) + +For now, we store all metadata (e.g. Hypercert claim data) on IPFS using [NFT.Storage](https://nft.storage/) and [web3.storage](https://web3.storage/). + +In order to mint a Hypercert, you will need to create API tokens for both services, which you can learn more about from their respective guides: + +- [Get an NFT.Storage API token](https://nft.storage/docs/#get-an-api-token) +- [Get a web3.storage API token](https://web3.storage/docs/how-tos/generate-api-token/) + +_Note: In the future, we want to also support other mechanisms for storing off-chain data._ + +## Initialize + +Import the SDK into your project and create a new instance of `HypercertClient` with your configuration options: + +```js +import { HypercertClient } from "@hypercerts-org/sdk"; +import { ethers } from "ethers"; + +// NOTE: you should replace this with your own JSON-RPC provider to the network +// This should have signing abilities and match the `chainId` passed into HypercertClient +const operator = ethers.providers.getDefaultProvider("goerli"); + +const client = new HypercertClient({ + chainId: 5, // goerli testnet + operator, + nftStorageToken, + web3StorageToken, +}); +``` + +Hypercerts is a multi-chain protocol. +See [here](./supported-networks.md) for a list of currently supported networks. + +> **Note** If there's no `operator`, `nftStorageToken` or `web3StorageToken` provided, the client will run in [read-only mode](#read-only-mode). + +## Make a Hypercert + +Use the client object to interact with the Hypercert network. For example, you can use the `client.mintClaim` method to create a new claim: + +```js +import { + formatHypercertData, + TransferRestrictions, +} from "@hypercerts-org/sdk"; + +// Validate and format your Hypercert metadata +const { data: metadata, valid, errors } = formatHypercertData({ + name, + ... +}) + +// Check on errors +if (!valid) { + return console.error(errors); +} + +// Set the total amount of units available +const totalUnits: BigNumberish = 10_000_000 + +// Define the transfer restriction +const transferRestrictions: TransferRestrictions = TransferRestrictions.FromCreatorOnly + +// Mint your Hypercert! +const tx = await client.mintClaim( + metadata, + totalUnits, + transferRestrictions, +); +``` + +For guidance on how to specify your metadata, see the [minting guide](../minting-guide/step-by-step.md). +This will validate the metadata, store claim metadata on IPFS, create a new hypercert on-chain, and return a transaction receipt. + +For more details, check out the [Minting Guide](./minting.md). + +## Query for Hypercerts + +You can also use the client to query the subgraph and retrieve which claims an address owns: + +```js +const claims = await client.indexer.fractionsByOwner(owner), +``` + +For more details, checkout the [Querying guide](./querying.md) +and our [Graph playground](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-optimism-mainnet). + +That's it! With these simple steps, you can start using the Hypercert SDK in your own projects. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/quickstart-solidity.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/quickstart-solidity.md new file mode 100644 index 00000000..409a1e9d --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/quickstart-solidity.md @@ -0,0 +1,41 @@ +# Getting started with Solidity + +> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. + +If you need the Solidity contracts or interfaces exported from the SDK, +please reach out by [filing an issue](https://github.com/hypercerts-org/hypercerts/issues). + +## Hypercerts deployments + +Hypercerts is a multi-chain protocol and we want to support any network that wants to make positive impact. +We plan to support at most 1 canonical contract deployment per network. +For a complete list of deployments and their contract addresses, see [Supported Networks](./supported-networks.md). + +## Installing the Hypercert contracts + +```bash +npm install @hypercerts-org/contracts +# or yarn add @hypercerts-org/contracts +``` + +## Using the Solidity interface + +If you want to call the Hypercerts contract on your network directly from Solidity, +we export the interface/ABI for you to use from your contract. + +```js +import { IHypercertToken } from "@hypercerts-org/contracts/IHypercertMinter.sol"; + +contract MyContract { + IHypercertToken hypercerts; + + function initialize(address _addr) public virtual initializer { + hypercerts = IHypercertToken(_addr); + } + + function uri(uint256 tokenID) public view returns (string memory _uri) { + _uri = hypercerts.uri(tokenID); + } +} + +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/split-merge.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/split-merge.md new file mode 100644 index 00000000..1ac5556e --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/split-merge.md @@ -0,0 +1,29 @@ +# Split and Merge + +> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. + +## By Token Value + +### Split / merge token values + +```js +const { tokenIds } = await hypercerts.splitFraction({ + tokenId, + units: [10, 12, 15], +}); +const { tokenId } = await hypercerts.mergeFractions({ tokenIds }); +``` + +## By Claim Data + +### Split / merge claim data + +```js +const { claimIds } = await hypercerts.splitClaim({ + claimId, + TODO: somehow specify hypercert subregions +}); +const { claimId} = await hypercerts.mergeClaims({ + claimIds, +}); +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/developer/supported-networks.md b/docs/versioned_docs/version-1.0.0-alpha.1/developer/supported-networks.md new file mode 100644 index 00000000..3bfd0f18 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/developer/supported-networks.md @@ -0,0 +1,13 @@ +# Supported networks + +Hypercerts is developed in public and released under [Apache license](https://github.com/hypercerts-org/hypercerts/blob/main/LICENSE). The Hypercert Foundation currently rolled out on two networks: Goerli for testing and Optimism as the production deployment. + +We want to support every network that wants to support positive impact! +If you want to see Hypercerts deployed on another network, please reach out by [filing an issue](https://github.com/hypercerts-org/hypercerts/issues). + +## Overview + +| Chainname | ChainID | Hypercerts Minter (UUPS Proxy) | Subgraph | Notes | +| --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ---------- | +| Goerli | 5 | [0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07](https://goerli.etherscan.io/address/0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07) | [Goerli Subgraph](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-testnet) | Testnet | +| Optimism | 10 | [0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07](https://optimistic.etherscan.io/address/0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07) | [Optimism Subgraph](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-optimism-mainnet) | Production | diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/devops/deploy-proxy.md b/docs/versioned_docs/version-1.0.0-alpha.1/devops/deploy-proxy.md new file mode 100644 index 00000000..72b3ee2d --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/devops/deploy-proxy.md @@ -0,0 +1,120 @@ +# Deploy a new proxy contract + +This should be done only on rare occasions. For example, when: + +- We want to deploy to a new network +- We have updated the contract in a way that is _NOT_ backwards-compatible. + - For most upgrades, please use UUPS [upgrades](./upgrade.md). + +## Smart Contracts + +### Setup the `contracts/` environment + +Navigate to `contracts/`. Configure your `.env` file by following the instructions in the +[README](https://github.com/hypercerts-org/hypercerts/tree/main/contracts#setup). + +### Build and deploy the smart contracts + +If you are deploying on a new network, configure `contracts/hardhat.config.ts` to support the new network under the `networks` key. + +```javascript + "optimism-goeri": getChainConfig("optimism-goerli"), +``` + +Build the contracts and deploy. Specify the network to match the key used in `hardhat.config.ts`. + +```sh +# Run in contracts/ +yarn build:hardhat +yarn hardhat deploy --network NETWORK +``` + +This will output the new proxy address. Update the root `README.md` with this new address. + +Now transfer ownership over the proxy contract to the multisig: + +```sh +yarn hardhat transfer-owner --network NETWORK --proxy PROXY_CONTRACT_ADDRESS --owner MULTISIG_ADDRESS +``` + +## Subgraph + +### Setup the `graph/` environment + +Navigate to `graph/`. Follow the instructions in the +[README](https://github.com/hypercerts-org/hypercerts/tree/main/graph#setup) +to get set up. + +### Deploy the subgraph + +Update `graph/networks.json` with the new proxy address. To speed up indexing, you set the `startBlock` to the block containing the contract creation. We can add multiple networks that are monitored by the same subgraph. For more details, see the [Graph documentation](https://thegraph.com/docs/en/deploying/deploying-a-subgraph-to-hosted/#deploying-the-subgraph-to-multiple-ethereum-networks). + +Now deploy the subgraph + +```sh +# Run in graph/ +yarn build +yarn deploy:hosted +``` + +## OpenZeppelin Defender + +### Create a new Supabase table + +Log into the [Supabase dashboard](https://app.supabase.com/). +We store all data in a single project, but use different tables for each network. +The table name should be suffixed by the network (e.g. `allowlistCache-goerli`). +If you are deploying to a new network, create a new table. You can copy the table schema and RLS policy from another pre-existing table. + +If you are deploying a new proxy contract to a network for which you already have another deployment, you'll have to make a judgement call as to whether you can reuse the existing table, whether you need to clear the existing table, or create another table. + +Note: We want to merge all the tables in this [issue](https://github.com/hypercerts-org/hypercerts/issues/477). + +### Update the OpenZeppelin Defender scripts + +Modify the Defender scripts to support the new network in `defender/src/networks.ts`. + +If the ABI of the contract has changed, make sure you also update `defender/src/HypercertMinterABI.ts`. + +Note: The entry point for deployment is in `defender/src/setup.ts`. + +### Setup the `defender/` environment + +Navigate to `defender/`. Follow the instructions in the +[README](https://github.com/hypercerts-org/hypercerts/tree/main/defender#setup) +to get set up. + +### Deploy defender scripts + +Deploy to OpenZeppelin Defender via + +```sh +# Run in defender/ +yarn deploy +``` + +## Hypercerts SDK + +TODO: Flesh this out + +Run the build in `contracts/`. + +(Soon to be deprecated) Publish `contracts/` to npm + +Configure the SDK to support the new network via the graphclient. + +Publish SDK to npm + +## Deploy the Dapp frontend + +Each frontend build is configured to run on a different network (e.g. `https://testnet.hypercerts.org`). You can use any CDN to serve the site (e.g. Netlify, Vercel, GitHub Pages, Cloudflare Pages, Fleek, Firebase Hosting). + +1. Configure your build environment with the environment variables specified in `frontend/.env.local.example`. + +2. Configure your builds to the following settings: + +- Build command: `yarn build:site` +- Build output directory: `/build` +- Root directory: `/` + +3. Configure the domain that you want for your build. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/devops/errors.md b/docs/versioned_docs/version-1.0.0-alpha.1/devops/errors.md new file mode 100644 index 00000000..05dc5b0c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/devops/errors.md @@ -0,0 +1,45 @@ +# Errors + +## Deploying + +### Artifact for contract "HypercertMinter" not found + +#### Error message + +`Error HH700: Artifact for contract "HypercertMinter" not found.` + +#### Cause + +Attempting to deploy a contract with `npx hardhat deploy` before the contract has been compiled by hardhat. Contracts compiled by forge are currently not visible to hardhat (this could be a configuration problem). + +### insufficient funds for intrinsic transaction cost + +#### Error message + +`Error: insufficient funds for intrinsic transaction cost` + +#### Cause + +The environment variable `MNEMONIC` is not configured correctly. + +Alternatively, the wallet may not have enough funds for the selected network + +Causing pause twice + +Error: cannot estimate gas; transaction may fail or may require manual gas limit + +reason: 'execution reverted: Pausable: paused', + +#### Etherscan API + +Note: It can take between 5-10 minutes before a newly created etherscan API key becomes valid for queries to goerli. + +When using an etherscan API key that was too recently created, hardhat tasks using etherscan to verify transactions will exit with an error message: + +`Etherscan returned with message: NOTOK, reason: Invalid API Key` + +Despite this error the transaction may have succeeded, the hardhat task just can't confirm it. + +It is unknown if this is a problem for queries to mainnet as well. + +Metamask makes it very difficult to have multiple wallets. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/devops/index.md b/docs/versioned_docs/version-1.0.0-alpha.1/devops/index.md new file mode 100644 index 00000000..9b208595 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/devops/index.md @@ -0,0 +1,18 @@ +# DevOps + +We use this playbook to encapsulate our practices and current setup. + +## Setup dev environment + +- [Setup guide](./setup.md) +- [Plasmic setup](./plasmic.md) + +## Tasks + +- [Deploy new proxy contract](./deploy-proxy.md) +- [Upgrade contract](./upgrade.md) +- [Pause contract](./pause.md) + +## FAQ + +- [Common errors](./errors.md) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/devops/pause.md b/docs/versioned_docs/version-1.0.0-alpha.1/devops/pause.md new file mode 100644 index 00000000..2668f51e --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/devops/pause.md @@ -0,0 +1,29 @@ +# Pause / Unpause + +## Pause + +### Contract owned by an address + +Make sure you have set up your wallets and config from the [setup guide](./setup.md). + +To pause the contract, run the following, where `CONTRACT_ADDRESS` is the proxy address of the HypercertMinter, and `NETWORK` is one of the networks from `hardhat.config.ts`: + +```sh +yarn hardhat pause --network NETWORK --address CONTRACT_ADDRESS +``` + +### Contract owned by a multi-sig + +If we transferred ownership to a multisig, we can use +[OpenZeppelin Defender Admin](https://defender.openzeppelin.com/#/admin) +to propose a pause to be approved by the multisig. + +## Unpause + +Make sure you have set up your wallets and config from the [setup guide](./setup.md). + +To pause the contract, run the following, where `CONTRACT_ADDRESS` is the proxy address of the HypercertMinter, and `NETWORK` is one of the networks from `hardhat.config.ts`: + +```sh +yarn hardhat unpause --network NETWORK --address CONTRACT_ADDRESS +``` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/devops/plasmic.md b/docs/versioned_docs/version-1.0.0-alpha.1/devops/plasmic.md new file mode 100644 index 00000000..10e52f5b --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/devops/plasmic.md @@ -0,0 +1,76 @@ +# Plasmic setup + +## HypercertImage + +### Props + +hideImpact + +``` +$ctx.currentForm.impactTimeEnd === "indefinite" && ($ctx.currentForm.impactScopes.length === 0 || ($ctx.currentForm.impactScopes.length === 1 && $ctx.currentForm.impactScopes[0] === "all")) +``` + +color + +``` +$ctx.currentForm.backgroundColor +``` + +vectorart + +``` +$ctx.currentForm.backgroundVectorArt +``` + +### Slots + +logoImage Image URL + +``` +$ctx.currentForm.logoUrl +``` + +title Content + +``` +$ctx.currentForm.name +``` + +workPeriod Content + +``` +`${$ctx.currentForm.workTimeStart.format ? $ctx.currentForm.workTimeStart.format("YYYY-MM-DD") : $ctx.currentForm.workTimeStart} → ${$ctx.currentForm.workTimeEnd.format ? $ctx.currentForm.workTimeEnd.format("YYYY-MM-DD") : $ctx.currentForm.workTimeEnd}` +``` + +bannerImage Image URL + +``` +$ctx.currentForm.bannerUrl +``` + +impactPeriod Content + +``` +`${$ctx.currentForm.workTimeStart.format ? $ctx.currentForm.workTimeStart.format("YYYY-MM-DD") : $ctx.currentForm.workTimeStart} → ${$ctx.currentForm.impactTimeEnd.format ? $ctx.currentForm.impactTimeEnd.format("YYYY-MM-DD") : $ctx.currentForm.impactTimeEnd}` +``` + +#### workScopes: repeated ScopeChip + +Collection + +``` +$ctx.currentForm.workScopes.split(/[,\n]/).map(i => i.trim()).filter(i => !!i) +``` + +Element name: `currentWorkScope` +Index name: `currentIndex` +Color variant: `$ctx.currentForm.backgroundColor` +Content: `currentWorkScope` + +#### impactScopes: repeated ScopeChip + +Collection: `$ctx.currentForm.impactScopes` +Element name: `currentImpactScope` +Index name: `currentIndex` +Color variant: `$ctx.currentForm.backgroundColor` +Content: `currentImpactScope` diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/devops/setup.md b/docs/versioned_docs/version-1.0.0-alpha.1/devops/setup.md new file mode 100644 index 00000000..afb95296 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/devops/setup.md @@ -0,0 +1,41 @@ +# Setup + +## Pre-requisites + +1. Install [NodeJS](https://nodejs.org/en/) and [git](https://git-scm.com/) +2. Install [yarn](https://classic.yarnpkg.com/) + +```sh +npm install --global yarn +``` + +3. Clone the repository: + +``` +git clone git@github.com:hypercerts-org/hypercerts.git +cd hypercerts +``` + +4. Install dependancies: + +To install dependencies across all projects in the monorepo workspace: + +```sh +yarn install +``` + +## Setup your wallets + +We need 2 wallets: a multi-sig for administering the contracts, and a hot wallet for setting everything up. + +1. We use a [Gnosis Safe](https://app.safe.global/) multisig for managing and administering the contracts. Set one up with your desired confirmation threshold (e.g. 2 of 3). This wallet will not require any balance. +2. Separately, set up a wallet that we'll use in our developer scripts. + +- If you don't have one, you can goto `contracts/` and run `yarn hardhat generate-address`. +- Make sure there is enough balance in this account to deploy the contract and transfer ownership to the multisig + - [Goerli Faucet](https://goerlifaucet.com/) + - [Optimism Bridge](https://app.optimism.io/bridge/deposit) + +## Next Steps + +Depending on what you want to do (e.g. in `./sdk/` or `./frontend/`), there will be further setup instructions in the respective `README.md` file. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/devops/upgrade.md b/docs/versioned_docs/version-1.0.0-alpha.1/devops/upgrade.md new file mode 100644 index 00000000..820255e7 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/devops/upgrade.md @@ -0,0 +1,35 @@ +# Upgrading the contract + +## Validate upgrade + +Validate contract upgradeability against deployment. + +For example, for the `goerli` deployment: + +```sh +yarn hardhat validate-upgrade --network goerli --proxy PROXY_CONTRACT_ADDRESS +``` + +## Propose Upgrade + +Propose an upgrade via OpenZeppelin Defender. For more information, see this +[guide](https://docs.openzeppelin.com/defender/guide-upgrades) + +For example, for the `goerli` deployment: + +```sh +yarn build:hardhat +yarn hardhat propose-upgrade --network goerli --proxy PROXY_CONTRACT_ADDRESS --multisig OWNER_MULTISIG_ADDRESS +``` + +This will output an OpenZeppelin URL that multi-sig members can use to approve/reject the upgrade. + +## Publish to npm + +After you update the contracts, deploy the `contracts/` package to npm. + +TODO + +Update the dependencies in `frontend/package.json` and `sdk/package.json`. + +If the ABI of the contract has changed, make sure you also update `defender/src/HypercertMinterABI.ts`. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/faq.md b/docs/versioned_docs/version-1.0.0-alpha.1/faq.md new file mode 100644 index 00000000..b9659b5a --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/faq.md @@ -0,0 +1,139 @@ +--- +title: Frequently Asked Questions +id: faq +--- + +# FAQs + +### How do I create a hypercert? + +We've created a step-by-step guide in the documents, which you can find [here](minting-guide/minting-guide-start). + +### Who gets to claim my hypercert? + +There are currently two types of users who are eligible to claim your hypercert. + +1. You as the creator of the hypercert are eligible to claim your hypercert. For projects with an allow list, you are eligible to claim 50% of the total tokens. For projects with no allow list, you will receive 100% of the tokens automatically and can do whatever you like with them. + +2. Anyone on the hypercert's allow list will be eligible to claim your hypercert. The allow list is stored and the time of minting and allocates fractions of the hypercert to specific wallet addresses. These wallet addresses are then allowed to claim these fractions through a separate contract interaction. Creators often use allow lists be used to allocate fractions to previous funders and contributors. + +### How do I claim a hypercert? Can I claim all of the ones I’m eligible for at once? + +After you connect your wallet, you will see a dashboard of hypercerts that you can claim. You can either claim them individually or in a batch transaction. Note that if you perform the batch transaction you will automatically claim _all_ hypercerts you are allow-listed for. (You still pay a gas fee for each claim, however.) If you don't want to claim _all_ at once, then you should claim them one-by-one. + +### What token standard do hypercerts utilize? + +The interface supports both ERC-1155s and 721s. Our current implementation makes use of [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155) (a semi-fungible token). + +### What are the required fields to generate a hypercert? + +There are six required fields: + +1. Set of contributors: An ordered list of all contributors, who claim to do or have done the work described by this hypercert. +2. Scope of work: A conjunction of potentially-negated work scope tags, where an empty string means “all”. +3. Time of work: A date range, from the start to the end of the work being claimed by this hypercert. +4. Scope of impact: A conjunction of potentially-negated impact scope tags, where an empty string means “all”. +5. Time of impact: Date ranges from the start to the end of the impact. +6. Rights of the owners: An unordered list of usage rights tags, which define the rights of the owners of this hypercert over the work being claimed by this hypercert. + +Hypercerts also need a name and description. + +### What should I put for my hypercert's work scope? + +For most projects, it's probably best just to use a single tag that is a short form of your project's name. Given that your project may create numerous hypercerts over time, having a work scope that represents the name of your project will make your claims in the "impact hyperspace" more continuous. + +If you choose to use more than one tag, remember that tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. + +### Are hypercerts the same as impact evaluations? + +No. A hypercert is a claim over a discrete piece of work and the impact that may result from that work. It has no opinion about the legitimacy or quality of the claim. + +An impact evaluation is an opinionated assessment about the legitimacy or quality of a claim. + +For example, a hypercert might represent "Planting trees in the Amazon in 2022". An impact evaluation might point to that hypercert and assert the percent of trees that survived, the amount of CO2 removed by the trees, or the income change among people living around the project. + +Over time, the expectation is that hypercerts that attract multiple, high quality, credibly neutral impact evaluations will be more relevant than ones that do not. + +### What can I do with my hypercert? + +The `rights` dimension specific what an owner can do with their hypercert. Currently, the only `right` that owners have is "Public Display". Over time, we hope the protocol can support various `rights` including transfers, intellectual property, tax-deductibility, carbon offsets, ESG reporting, and more. + +### How is a hypercert different than a POAP or Impact NFT? + +Hypercerts have some things in common with certain POAPs or Impact NFTs, but also a number of crucial differences. + +First, all POAPs and most Impact NFTs are implemented as non-fungible tokens (ERC-721s). Hypercerts are currently being implemented as semi-fungible tokens (ERC-1155s), meaning it is possible to own more than one unit or fraction of a given hypercert. This makes it easy and intuitive to display the share of hypercerts that a given owner has. + +Second, hypercerts have specific metadata requirements and interpretation logic. These include a standard schema for how the six required hypercert dimensions are defined and captured (i.e., work scopes, impact scopes, timeframes, contributors, etc) as well as logic for how to interpret different inputs (e.g., how to include or exclude certain work scopes, create an indefinite time period, etc). POAPs have a completely different schema. Although there is no standard schema for Impact NFTs, an Impact NFT project could choose to adopt the hypercert standard and token interface and thereby achieve compatibility. + +Third, the hypercerts token interface is intended to support several functions that are not possible out of the box with other token standards, chiefly, atomic split and merge capabilities. We also expect other protocols to work with hypercerts for the purposes of prospective and retrospective funding, contributor verification, and impact evaluation. + +For certain use cases, POAPs may be better suited for projects as hypercerts are focused on the funding aspect of impactful work. + +### Where can I purchase a hypercert? + +Currently, it is only possible to purchase a hypercert from a creator or project. This can be facilitated directly by the project or via a third-party marketplace like OpenSea. Currently, hypercerts cannot be resold on secondary markets. + +### What chain(s) is hypercerts running on? + +The hypercerts smart contracts have been deployed on Optimism and Goerli Testnet. We plan to support various EVM chains in the near future. + +### How do I bridge to Optimism? + +There are various bridging services including the official [Optimism Bridge](https://app.optimism.io/bridge/deposit). Note that bridging assets from Ethereum to Optimism will incur a gas fee. + +### How much gas will it cost to create or claim a hypercert? + +In our simulations, the gas fee for minting a hypercert on Ethereum Mainnet ranged from 2,707,282 to 7,515,075 gwei (0.0027 to 0.0075 ETH). Minting costs are significantly cheaper on Optimism (i.e., below 0.0005 ETH or less than $1). Claiming a hypercert should be below 0.0001 ETH or less than $0.10 on Optimism. + +### How do I create a hypercert from a multisig? + +If you are creating a hypercert on Optimism, then you will need an Optimism-based multisig. (Unfortunately, Safe wallets created on Ethereum won't work on Optimism.) + +### Have the smart contracts been audited? + +Yes. The auditor's security report is available [here](https://github.com/pashov/audits/blob/master/solo/Hypercerts-security-review.md). + +### How is the allow list generated? + +For Gitcoin projects, an allow list is generated from a snapshot of all of the on-chain funding received by the project. + +The queries used to generate the allow lists can be viewed here: + +- ETH Infra: https://dune.com/queries/1934656 +- Climate: https://dune.com/queries/1934689 +- OSS: https://dune.com/queries/1934969 + +Once the snapshot is taken, the formula assigns one fraction (rounded down) for every $1 (using the exchange rate at the time of the transaction) that a donor contributed to the project. It also provides a small buffer (of 5%) so that a transaction worth $0.999 or $0.951 remains eligible for one fraction. + +For example: + +- $5.60 donated --> 5 fractions +- $5.20 donated --> 5 fractions +- $0.96 donated --> 1 fraction +- $0.52 donated --> 0 fractions + +### Why am I not on the allow list even though I contributed to the project? + +If you contributed less than $1 DAI to a project, then you will not be eligible to claim a hypercert fraction. + +### I supported a project. Why I don't I see the hypercert in my dashboard? + +In order to your hypercert to appear as "claimable", the project needs to mint the hypercert first. If the project has not minted its hypercert yet, then you will not be able to claim it. We suggest you check back in a few days to see if the project has created the hypercert and is now claimable. + +If the project has created its hypercert, then please try the following solutions: + +1. Confirm the wallet address is correct (some users have multiple wallet addresses and forget which one they donated with) +2. Check that your wallet is included in the Dune Dashboards for each Gitcoin Round + +- ETH Infra: https://dune.com/queries/1934656 +- Climate: https://dune.com/queries/1934689 +- OSS: https://dune.com/queries/1934969 + +3. Confirm you donated more than $1 DAI to the project. + +If the project has created its hypercert, and you have confirmed items 1-3, then please send us a DM over Twitter or Telegram with your wallet address and we will get back to you promptly. + +### How do I retire a hypercert? + +We don't yet have a frontend for retiring hypercerts but you can do this by interacting directly with the smart contract on Etherscan. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/further-resources.md b/docs/versioned_docs/version-1.0.0-alpha.1/further-resources.md new file mode 100644 index 00000000..86c25331 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/further-resources.md @@ -0,0 +1,37 @@ +--- +title: Further Resources +id: further-resources +--- + +# Papers, Articles, Presentations + +## Writings + +- Feb 14, 2023, Whitepaper draft by [@hypercerts](http://twitter.com/hypercerts): [Hypercerts: A new primitive for impact funding systems (draft v0)](../static/pdf/hypercerts_whitepaper_v0.pdf) +- Aug 24, 2022, Blogpost by [@holkeb](https://twitter.com/holkeb): [Hypercerts: A new primitive for public goods funding](https://protocol.ai/blog/hypercert-new-primitive/) +- Jun 2022, Tech report (draft) by [@davidad](https://twitter.com/davidad): [Hypercerts; an Interoperable Datalayer for Impact-Funding Mechanisms](../static/pdf/hypercerts_Tech_Report_draft.pdf) + +## Talks + +#### Jun 24, 2022, Talk at [Funding the Commons](https://fundingthecommons.io/) by [@davidad](https://twitter.com/davidad): [Hypercerts: on-chain primitives for impact markets](https://youtu.be/2hOhOdCbBlU) + + + +#### Jun 23, 2022, Conversation between [@emiyazono](http://twitter.com/emiyazono) and [@owocki](http://twitter.com/owocki) at GreenPill Podcast: [Impact Certificates | Evan Miyazono, Head of Research at Protocol Labs | Green Pill #21](https://youtu.be/kyo5SxtSJ9U) + + + +#### Mar 4, 2022, Talk at [Funding the Commons](https://fundingthecommons.io/) by [@davidad](https://twitter.com/davidad): [Interoperable mechanisms for non-rival goods (Hypercerts)](https://youtu.be/acbBeGcevok) + + + +## Other resources + +Overview of some previous writings on impact certificates, retrospective funding and impact markets: + +- Christiano, Paul (2014) Certificates of impact, Rational Altruist, [https://rationalaltruist.com/2014/11/15/certificates-of-impact/](https://rationalaltruist.com/2014/11/15/certificates-of-impact/) +- Christiano, Paul & Katja Grace (2015) The Impact Purchase, [https://impactpurchase.org/why-certificates/](https://impactpurchase.org/why-certificates/) +- Optimism & Buterin, Vitalik (2021) Retroactive Public Goods Funding, [https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c](https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c) +- Cotton-Barratt, Owen (2021), Impact Certificates and Impact Markets, Funding the Commons November 2021, [https://youtu.be/ZiDV56o5M7Q](https://youtu.be/ZiDV56o5M7Q) +- Drescher, Denis (2022) Towards Impact Markets, [https://forum.effectivealtruism.org/posts/7kqL4G5badqjskYQs/toward-impact-markets-1](https://forum.effectivealtruism.org/posts/7kqL4G5badqjskYQs/toward-impact-markets-1) +- Ofer & Cotton-Barratt, Owen (2022) Impact markets may incentivize predictably net-negative projects, [https://forum.effectivealtruism.org/posts/74rz7b8fztCsKotL6](https://forum.effectivealtruism.org/posts/74rz7b8fztCsKotL6) diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/implementation/glossary.md b/docs/versioned_docs/version-1.0.0-alpha.1/implementation/glossary.md new file mode 100644 index 00000000..b2451310 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/implementation/glossary.md @@ -0,0 +1,139 @@ +--- +title: Glossary +id: glossary +sidebar_position: 3 +--- + +# Glossary of Hypercerts Terms + +## Main Terms + +### Allowlist + +A list that determines how fractions of hypercerts will be allocated to new owners. The current implementation requires a project to specify an allowlist at the time of minting its hypercert. Based on allowlists, designated new owners are able to claim their fractions. + +### Claiming a fraction + +Transferring the ownership of a fraction of a hypercert to a (new) owner. Generally 'claiming' implies minting a new token that represents said fraction by the new owner. + +### Contributor + +An individual or organization that performs some or all of the work described in a hypercert. + +### Creating a hypercert + +Synonymous to minting a hypercert. + +### Fraction + +A token that represents a quantified proportion of a hypercert denominated in units. + +### Funder + +Individual, organization, or algorithm that funds work. There are generally two types: (1) **prospective** funders, who fund work _before_ it is done, and (2) **retrospective** funders, who fund work _after_ it is done. + +### Hypercert + +A token that (1) accounts for work by specified contributors that is supposed to be impactful, (2) represents the – potentially explicitly specified – impact of this work, and (3) assigns right over this work to its owners. If a hypercert is split into multiple fractions, the hypercert refers to the sum of all of its fractions. The term `hypercert` may also refer to an implementation of the hypercert interface and standard. + +### Hypercerts interface + +The hypercerts [contract interface](https://github.com/hypercerts-org/hypercerts/blob/main/contracts/src/interfaces/IHypercertToken.sol), which declares the required functionality for a hypercert token. The current interface includes functions for minting, burning, splitting, and merging of hypercert tokens. + +### Hypercerts implementation + +An implementation that builds on top of the hypercerts interface and conforms to the hypercerts standard. For instance, our initial implementation uses an [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155) token. The first 128 bits of the 256-bit token ID identifies the hypercert, the latter 128 bits identifies the specific fraction. Other implementations are possible (e.g., based on ERC-721) as long as they also conform to the data standard and use the hypercerts interface to support capabilities like splitting and merging of values. + +### Hypercerts standard + +A data standard for hypercerts. It requires the following fields to be defined in the metadata of the token: (1) set of contributors, (2) scope of work, (3) time of work, (4) scope of impact, (5) time of impact, (6) rights. + +### Impact + +Value that is created or destroyed by work. It mostly refers to positive impact, i.e., value that is created. If work destroys value, it is referred to as negative impact. + +### Impact evaluation + +A claim that a specified impact has or will occur – potentially claiming which work was responsible for the impact. + +### Impact Funding System (IFS) + +A system of actors (contributors, evaluators, funders) that interact according to a set of rules (funding mechanisms, coordination mechanisms) to maximize the domain-specific impact. + +### Impact space + +A geometrical space representing all possible work with its associated impact and rights. The space is spanned by the six fields specified in the hypercerts data standard: (1) set of contributors, (2) scope of work, (3) time of work, (4) scope of impact, (5) time of impact, (6) rights. + +### Merging hypercerts + +An operation to combine two or more hypercerts, such that the resulting, merged hypercert covers the exact same region in the impact space that the individual hypercerts covered. + +### Minting a hypercert + +Creating a new record for a hypercert on a blockchain. The properties of the hypercert (e.g., its timeframe and scope of work) are retrievable via this record. + +### Project + +Work by one or more contributors to achieve a goal. A project does not always need to be represented by one hypercert; it can be represented by multiple hypercerts (e.g., one hypercert per phase or milestone of a project). A hypercert can also represent multiple projects or even parts of multiple projects. + +### Prospective funder + +Individual, organization, or algorithm that fund work before it is done. + +### Retrospective funder + +Individual, organization, or algorithm that fund work after it is done. + +### Rights + +An unordered list of usage rights tags, which define the rights of the owners of a hypercert over the work being claimed by a hypercert. One of the axis of the impact space and part of the required fields in the hypercerts data standard. + +### Set of contributors + +An ordered list of all contributors, who claim to do or have done the work described by a hypercert. One axis of the impact space and part of the required fields in the hypercerts data standard. + +### Scope of impact + +A conjunction of potentially-negated impact scope tags, where an empty string means “all”. One axis of the impact space and part of the required fields in the hypercerts data standard. + +### Scope of work + +A conjunction of potentially-negated work scope tags, where an empty string means “all”. One axis of the impact space and part of the required fields in the hypercerts data standard. + +### Splitting hypercerts + +An operation to split one hypercert into two or more separate hypercerts, such that the resulting, separated hypercerts cover the exact same region in the impact space that the previous hypercert covered. + +### Time of impact + +Date ranges from the start to the end of the impact being claimed by a hypercert. One axis of the impact space and part of the required fields in the hypercerts data standard. + +### Time of work + +A date range, from the start to the end of the work being claimed by a hypercert. One axis of the impact space and part of the required fields in the hypercerts data standard. + +### Unit + +The smallest possible fraction of a claim. Generally units are grouped in fractions. + +### Work + +Activities that produce impact. + +## Additional Impact Evaluation Terms + +### Auditor + +Individual, organization, or algorithm that evaluates the impact of work after it is done. + +### Beneficiaries + +People or objects that are impacted by work. + +### Evaluator + +Individual, organization, or algorithm that evaluates the impact of work. There are two types: Scouts evaluate the potential impact before it is done, auditors evaluate the impact after it is done. + +### Scout + +Individual, organization, or algorithm that evaluates the potential impact of work before it is done. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/implementation/metadata.md b/docs/versioned_docs/version-1.0.0-alpha.1/implementation/metadata.md new file mode 100644 index 00000000..08eb9fcb --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/implementation/metadata.md @@ -0,0 +1,188 @@ +--- +title: Metadata Standard +id: metadata +sidebar_position: 2 +--- + +# Hypercert Metadata Structure + +Hypercerts are represented as [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155) tokens. All token instances of a hypercert must share the same ERC-1155 metadata. For sites like OpenSea to pull in off-chain metadata for ERC-1155 assets, your hypercert contract will need to return an IPFS URI that contains all necessary hypercert metadata. + +The hypercert metadata schema follows the [Enjin recommendation](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md#erc-1155-metadata-uri-json-schema) for ERC-1155 metadata. It also includes **six required dimensions** that are necessary to clearly and unambiguously identify the hypercert's impact claim. + +The following are standard ERC-1155 metadata fields. + +## ERC-1155 fields + +| Property | Description | +| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | Name or title of the hypercert. Given that a project may create numerous hypercerts over time, consider giving the hypercert a name that represents a discrete phase or output. | +| `description` | A human readable description of the hypercert. Markdown is supported. Additional external URLs can be added. | +| `image` | A URI pointing to a resource with mime type image/\* that represents the hypercert's artwork, i.e., `ipfs://`. We recommend images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive. | +| `external_url` | [optional] A URL that can be displayed next to the hypercert on webpages like OpenSea and links users to a page that has more information about the project or impact claim. | +| `properties` | [optional] Additional properties (aka attributes) that may be helpful for discovery and curation of hypercerts. Marketplaces like OpenSea will display these properties in the same way as they display rarity traits of NFTs. | + +In order to perform hypercert-specific operations, including split and merge functions, and for your hypercert to robustly claim a set of coordinates in the impact space, there are six additional dimensions that must be included in your metadata. + +## Required Hypercert dimensions + +| Property | Description | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `work_scope` | An _ordered list_ of work scope tags. Work scopes may also be excluded from the claim. The `¬` prefix will be displayed next to any work scope that is explicitly excluded from the claim. | +| `work_timeframe` | Date range from the start to the end of the work in the form of a [UTC timestamp](https://www.utctime.net/utc-timestamp). | +| `impact_scope` | An _ordered list_ of impact scope tags. Impact scopes may also be excluded from the claim. The `¬` prefix will be displayed next to any impact scope that is explicitly excluded from the claim. The default claim is to "all" impact, giving the owner rights to claim all potential impact created by the work that is represented by the hypercert. | +| `impact_timeframe` | Date range from the start to the end of the impact in the form of a [UTC timestamp](https://www.utctime.net/utc-timestamp). The default claim is from the start date of work until `indefinite` (i.e., the impact may occur at any point in time in the future). | +| `contributors` | An _ordered list_ of all contributors. Contributors should be itemized as wallet addresses or ENS names, but may be names / pseudonyms. The default claim is to the wallet address that created the hypercert contract. A multisig wallet can be used to represent a group of contributors. | +| `rights` | An _unordered list_ of usage rights tags. The default claim is solely to "public display" of the hypercert, i.e., all other rights remain with the contributors. | + +## Examples + +### Example 1: hypercert with minimal bounds + +Here is an example of hypercert dimensions for work on IPFS with minimal bounds: + +``` +"hypercert": { + "work_scope": { + "name": "Work Scope", + "value": ["IPFS"], + "excludes": [], + "display_value": "IPFS" + }, + "impact_scope": { + "name": "Impact Scope", + "value": ["All"], + "excludes": [], + "display_value": "All" + }, + "work_timeframe": { + "name": "Work Timeframe", + "value": [1380585600, 1388534399], + "display_value": "2013-10-01 -> 2013-12-31" + }, + "impact_timeframe": { + "name": "Impact Timeframe", + "value": [1380585600, 0], + "display_value": "2013-10-01 -> Indefinite" + }, + "contributors": { + "name": "Contributors", + "value": ["Protocol Labs"], + "display_value": "Protocol Labs" + }, + "rights": { + "name": "Rights", + "value": ["Public Display"], + "display_value": "Public Display" + } +} +``` + +### Example 2: hypercert with bounded impact claims + +This hypercert is for a carbon removal project that provides a bounded impact scope. + +``` +"hypercert": { + "work_scope": { + "name": "Work Scope", + "value": ["Protecting Trees in Amazon"], + "excludes": [], + "display_value": "Protecting Trees in Amazon" + }, + "impact_scope": { + "name": "Impact Scope", + "value": ["CO2 in Atmosphere"], + "excludes": [], + "display_value": "CO2 in Atmosphere" + }, + "work_timeframe": { + "name": "Work Timeframe", + "value": [1356998400, 1388534399], + "display_value": "2013-01-01 -> 2013-12-31" + }, + "impact_timeframe": { + "name": "Impact Timeframe", + "value": [1356998400, 0], + "display_value": "2013-01-01 -> Indefinite" + }, + "contributors": { + "name": "Contributors", + "value": ["0xa1fa1fa000000000000000000000000000000000", "Project Forest Conservation"], + "display_value": "0xa1f...000, Project Forest Conservation" + }, + "rights": { + "name": "Rights", + "value": ["Public Display"], + "display_value": "Public Display" + } +} +``` + +### Example 3: hypercert with excluded impact claims + +Here is an example that explicitly excludes an impact scope to generate a more fine-grained claim. + +``` +"hypercert": { + "work_scope": { + "name": "Work Scope", + "value": ["Protecting Trees in Amazon"], + "excludes": [], + "display_value": "Protecting Trees in Amazon" + }, + "impact_scope": { + "name": "Impact Scope", + "value": ["All"], + "excludes": ["CO2 in Atmosphere"], + "display_value": "All ∧ ¬CO2 in Atmosphere" + }, + "work_timeframe": { + "name": "Work Timeframe", + "value": [1356998400, 1388534399], + "display_value": "2013-01-01 -> 2013-12-31" + }, + "impact_timeframe": { + "name": "Impact Timeframe", + "value": [1356998400, 0], + "display_value": "2013-01-01 -> Indefinite" + }, + "contributors": { + "name": "Contributors", + "value": ["0xa1fa1fa000000000000000000000000000000000", "Project Forest Conservation"], + "display_value": "0xa1f...000, Project Forest Conservation" + }, + "rights": { + "name": "Rights", + "value": ["Public Display"], + "display_value": "Public Display" + } +} +``` + +### Additional guidelines + +Here are some additional guidelines for defining hypercert dimensions. + +- For most hypercerts, the `work_scope` is best represented as the name of the project or activity. Other information contained in the hypercert, namely, the `contributors` and the `work_timeframe` should provide sufficient context to disambiguate multiple claims from the same project. +- Similarly, for most hypercerts, the `impact_scope` will be most clearly represented as "all" (with an indefinite upper bound on the `impact_timeframe` dimensions). This gives the hypercert creator and its owners the flexibility to make claims about impact that may not have been observable or well-understood when the hypercert was created. + +- It is recommended to browse the `impact_scope` and `work_scope` tags that have already been created and are in use by your or other projects. (We are building a catalog to be available at [hypercerts.org](https://hypercerts.org).) Picking established tags can make it easier for users to discover, curate, and interact with your hypercert. In the long-run, we expect different ontologies to emerge in domains like climate solutions, open source software, etc, and picking more established tags will help prevent overlapping or duplicate claims. +- Tags for work scopes and impact scopes are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. +- Scopes that are explicitly excluded from the hypercert claim are enumerated separately and displayed with the `¬` prefix in the tag. Excluded scopes are not currently displayed on hypercert artwork. +- The order of tags matters only for display purposes. The hypercert artwork will only display a limited number of tags in the `impact_scope` and `work_scope` arrays due to image size and stylistic constraints. +- A `contributor` can be identified using any human-readable string. The base case is to set the `contributors` to the wallet address used to create the hypercert. A multisig wallet can be used to represent a group of contributors. + +### Assigning `rights` + +In version 1.0 of the protocol, only one `rights` tag will be enabled: + +> **Public Display**: owners of the hypercert have the right to publicly display and receive social utility from their hypercert. + +This means that any other rights regarding the work described by the hypercert either remain with the original contributors or are governed by other agreements. + +Additional `rights` including the potential for certain types of transfers to be explicitly enabled will be released in subsequent versions. + +## Optional hidden properties + +Creators may wish to add other fields in their metadata that are not a part of the hypercert claim and are not for display on third-party marketplaces like OpenSea. These can be added by creating a `hidden_properties` field in the metadata. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/implementation/token-standard.md b/docs/versioned_docs/version-1.0.0-alpha.1/implementation/token-standard.md new file mode 100644 index 00000000..a767c670 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/implementation/token-standard.md @@ -0,0 +1,29 @@ +--- +title: Token Standard +id: token-standard +sidebar_position: 1 +--- + +### Hypercerts as a semi-fungible token + +In order to make the token identifiable, traceable, and transferable, hypercerts are represented as [ERC-1155 tokens](https://eips.ethereum.org/EIPS/eip-1155). The ERC-1155 standard enables a single deployed contract to store many hypercerts, facilitating simpler creation, transfers, as well as splitting and merging of hypercerts within a single namespace. As a semi-fungible token, each unique token represents a fraction of ownership of a hypercert. Hypercerts are then represented as a group of tokens, where the total ownership sums to 100%. In order to easily identify which hypercert a token belongs to, we utilize the upper 128 bits of a 256-bit token ID to identify the hypercert. All tokens within the same hypercert group should share the same [ERC-1155 Metadata](https://eips.ethereum.org/EIPS/eip-1155#metadata). + +![hypercert id](../../static/img/hypercert_id.png) + +For illustrative purposes, let us assume that token IDs are just 2 bytes long, where the first byte represents the hypercert ID and the last byte represents which fraction of ownership. Alice could create a new hypercert token 0x2301, representing 100% of hypercert 0x23. If Alice wanted to transfer 20% to Bob, Alice could perform a split operation by minting token 0x2302 and transferring 20% of value to it, such that tokens 0x2301 and 0x2302 represent 80% and 20% ownership respectively of hypercert 0x23. Then Alice transfers token 0x2302 to Bob. Similarly, they could merge these 2 tokens together, back to form a token that represented 100% ownership. In this case, the value of 0x2301 would be transferred to 0x2302, and then 0x2301 is subsequently burned. + +Alice can also choose to split or merge hypercerts along some dimension of the impact space. For example, Alice may split hypercert 0x23 into two new hypercerts — 0x24 representing work done before the year 2000, and 0x25 representing work done after 2000. The original hypercert 0x23 is burned and the two new hypercerts store a reference to the previous hypercert. When the history of splits and merges are indexed, we can easily trace through the provenance of any individual hypercert. + +### Claim Data + +Hypercert claim data, such as scope of work and the contributor list, is encoded in JSON format into the [ERC-1155 Metadata](https://eips.ethereum.org/EIPS/eip-1155#metadata). Claim data can be stored on-chain alongside the token, or in off-chain storage such as IPFS. For details on the JSON schema and how off-chain storage can be utilized, see the [hypercerts-sdk repository](https://github.com/hypercerts-org/hypercerts/tree/main/sdk). + +When considering whether to store hypercert metadata on-chain or off-chain, we can consider the different trade-offs to the user experience and cost, which may differ depending on which blockchain is being used. Storing data off-chain saves on costs, but could lead to on-chain claims without the metadata. Storing data on-chain adds additional security that the claims will not be forgotten but can lead to higher gas fees. + +Beyond the standard fields of hypercerts that locate the hypercert in the impact space, additional fields can be added. This allows for different templates in different impact areas, such as AI safety or biodiversity, as different additional information will be useful. Importantly, however, all hypercerts will be located in a single impact space – the additional fields do not change that. + +### Multi-chain support + +We expect hypercerts to exist in a multi-chain ecosystem, where the local deployment can be used to support the unique funding systems of that community. In order to visualize a single global impact space, we index the different contract deployments across chains and surface any potential hypercert claim conflicts. Because different blockchains support different subsets of programming languages, we do expect different implementations of the hypercert protocol to exist. However, they must adhere to the same hypercert data model to be indexed into the impact space. + +In order to decide which deployments to index into the hypercerts impact space, decentralized governance institutions will be used to govern the list of contract addresses used across all blockchains. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/intro.md b/docs/versioned_docs/version-1.0.0-alpha.1/intro.md new file mode 100644 index 00000000..0c4d7ca3 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/intro.md @@ -0,0 +1,58 @@ +--- +title: What Are Hypercerts? +id: intro +--- + +# What are hypercerts? + +### Hypercerts are a new token standard for tracking and rewarding positive impact. + +Each hypercert represents a unique impact claim capturing the following information: + +- a scope of work and its corresponding scope of impact +- a set of time frames for both the work and its impact +- a set of contributors – the organization or people behind the work +- a set of rights you get by owning a hypercert + +The hypercert itself is an ERC-1155 semi-fungible token with the information above stored as metadata on IPFS. Here’s an example. + +### Hypercert example + +#### Graphic representation + +![hypercert design example](../static/img/hypercert_example.png) + +#### Supplementary information (metadata) + +- **Title of hypercert:** Invention of the InterPlanetary Filesystem (IPFS) +- **Description:** The InterPlanetary File System (IPFS) is a set of composable, peer-to-peer protocols for addressing, routing, and transferring content-addressed data in a decentralized file system. +- **Link:** ipns://ipfs.tech/ + +#### Hypercert dimensions (metadata) + +- **Set of contributors:** 0xb794f5ea0ba39494ce839613fffba74279579268 _(example Ethereum address)_ +- **Scope of work:** IPFS ∧ ¬ go-ipfs +- **Time of work:** 2013-01-01 --> 2013-12-31 +- **Scope of impact:** All +- **Time of impact:** 2013-01-01 --> indefinite +- **Rights:** Public display + +### Why should you care? + +We spend trillions of dollars every year on public goods via governmental agencies, foundations, private donations and corporate spendings; however, we don’t effectively track this work – leaving us in the dark, hoping that it actually has the intended positive impact. + +We believe we can do better: + +- We should start by tracking this work consistently – this is what hypercerts are for. +- We should evaluate how impactful that work was – this is what the open evaluation system of hypercerts supports. +- We should reward the work that was exceptionally impactful – this is what the public display of hypercerts and retrospective funding is for. + +Doing this would unfold powerful incentives. Retrospective funding 1) provides incentives for creators to take on public goods projects with a potentially high, but uncertain, impact, 2) enables feedback loops to learn from successes and failures, and 3) attracts more talent to the public goods sector by improving performance-based compensation. + +While we are excited about the prospects of retrospective funding, hypercerts do not impose any specific funding mechanisms, but start with tracking the work that is supposed to be impactful. As a database for many funding mechanisms this facilitates experimentation and interoperability between funding mechanisms. + +### Next + +Curious and want to learn more? Head over to the [whitepaper](whitepaper/whitepaper-intro.md) to dive deeper into the world of hypercerts. + +Or do you want to get started right away? Head to the [minting guide](minting-guide/minting-guide-start.md). diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/minting-guide/gitcoin-round.md b/docs/versioned_docs/version-1.0.0-alpha.1/minting-guide/gitcoin-round.md new file mode 100644 index 00000000..1ad2310a --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/minting-guide/gitcoin-round.md @@ -0,0 +1,166 @@ +--- +title: Gitcoin Alpha Round Instructions +id: gitcoin-round +sidebar_position: 3 +--- + +# Gitcoin Alpha Round Instructions + +## Overview + +- all projects in the Gitcoin Alpha Round are invited to mint a hypercert for their work +- anyone who gave over $1 to a project is automatically allowlisted for that project’s hypercert +- 50% of each hypercert is distributed to the funders, 50% is kept by the project and can be transferred later +- each project has a custom URL to make minting super easy (the link is sent directly to each project) +- everything runs on Optimism (users only need to pay L2 gas costs) + +:::info +If your project participated in the Gitcoin Alpha Round, but you didn't get a message with a custom URL, please reach out to team[at]hypercert.org. +::: + +## Hypercerts x Gitcoin Alpha Round + +Now that Gitcoin’s Alpha Round has officially closed and the funding distribution is finalized, we are inviting all eligible projects that participated to mint a hypercert for their past work and to allocate fractions of their hypercert to a list of supporters. + +We’ve created a dApp that pulls all of the data required to mint your hypercert directly from Gitcoin’s Grant Protocol. You can fine-tune the properties, tweak your artwork, and review the distribution mechanism. Once you’re ready, hit the create button and your hypercert will be released into the ethers! + +Once your hypercert has been minted, the people who supported your project with a contribution of at least $1 DAI on Gitcoin’s Alpha Round will be able to connect and claim their fractions. + +A few important notes about the Alpha Round: + +- The total units of a hypercert is based on the total donations; each funder get awarded units proportional to their donations. +- Transfers will be restricted to one transfer from the project to the supporters. +- There will be no additional rights awarded to the funders except the right to "public display" their support for the project. + +## Instructions + +The following guidance is only for projects that receive a custom URL that pre-populates the hypercerts form based on their Gitcoin Grants' data. + +It explains the default settings in the form and recommends fields that the creator may choose to update or edit. + +:::note +Gitcoin Grant hypercerts are for retrospective work, i.e., they are intended to capture work that happened between Gitcoin Grants Round 15 (September 2022) and the Alpha Round (January 2023). Therefore, the work time period is always set to past dates. (You might need to adjust the name and description to also refer to past work only.) We are focusing solely on retrospective hypercerts for this round as part of broader efforts to promote retrospective funding; you can read more about it [in the whitepaper](whitepaper/retrospective-funding.md). +::: + +### General Fields + +#### Name of Hypercert + +This field is set by default to the name of your project on Gitcoin Grants. You can edit this to be more specific. Given that your project may create numerous hypercerts over time, consider giving each hypercert a name that represents a more discrete phase or output. + +#### Logo + +This field is set to the icon artwork provided for your project on Gitcoin Grants. If there was an error accessing your icon, you will see a generic icon. + +You can update this by providing a new URL and the hypercert artwork should update automatically. + +Logo images look best with an aspect ratio of 1.0 (square-shaped). + +#### Background Banner Image + +This field is set to the banner artwork provided for your project on Gitcoin Grants. If there was an error accessing your banner, you will see a generic Gitcoin banner. + +You can update this by providing a new URL and the hypercert artwork should update automatically. + +Banner images look best with an aspect ratio of 1.5 (e.g., 600 x 400 pixels). The dimensions should be at least 320 pixels wide and 214 pixels high to avoid stretching. + +#### Project Description + +This field is set by default to the description of your project on Gitcoin Grants. Review closely -- a long project description in your Gitcoin Grant description will be truncated. + +You may edit this to provide more details about your work and to remove information that is targeted solely at Gitcoin Grants users. This is also a good place to provide other links, such as Github repos or social media accounts, where the general public can learn more about the work. Please aim for a project description that is less than 500 characters. + +:::note +The project description should refer to **past work**, not future work that you would like to do with additional funding. +::: + +#### Link + +This field is set to the first external URL provided for your project on Gitcoin Grants. You can update this. + +### Hypercert Fields + +#### Work Scope + +This field is set by default to a **shortened version** of the name of your project on Gitcoin Grants. You may edit or add additional work scope tags. + +For most projects, it's probably best just to use a single tag that is a short form of your project's name. Given that your project may create numerous hypercerts over time, having a work scope that represents the name of your project will make your claims in the "impact hyperspace" more continuous. + +If you choose to use more than one tag, remember that tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. + +#### Work Start/End Dates + +The start date has been set by default to the `2022-09-22` for all projects on Gitcoin Grants. This date coincides with the end of Gitcoin Grants Round 15. + +The end date references the last update to your grant page on Gitcoin Grants. + +You may edit or update these fields, however, the end date may not extend beyond `2023-01-31` (the close of the funding round) as all hypercerts will be retrospective in this round. + +#### Set of Contributors + +This field is set by default to the wallet address that is set as the recipient address for receiving Gitcoin Grants funding. + +:::note +You should review this field closely and – if applicable – provide the addresses of additional contributors. +::: + +### Advanced Fields + +#### Impact Scope + +This field is set by default to `all`. + +Updates are currently disabled on the frontend because funding decisions on Gitcoin Grants were not specific to an impact scope or impact time period. + +#### Impact Start/End Dates + +This field is set by default to the work start date of `2022-09-22` (see above) and a work end date of `indefinite`. Updates are currently disabled on the frontend. + +#### Rights + +This field is set by default to `Public Display`, i.e., the owners are allowed to publicly display the hypercert and show their support of the work. + +Updates are currently disabled on the frontend. + +### Distribution + +#### Allowlist + +This field is set by default to a custom allowlist generated for each project based on the funding it received on the Gitcoin Grants Alpha Round. You should not need to update this field. If there is a problem with your allowlist, please contact us. + +50% of the hypercert will be allocated according to this allowlist. The other 50% will be kept by the project, i.e. it is allocated to the address that mints the hypercert. You will be able to transfer or sell these fractions later as long as they are owned by the minter. This means that they can only be transferred or sold once. + +The formula assigns one fraction (rounded down) for every $1 (using the exchange rate at the time of the transaction) that a donor contributed to the project. It also provides a small buffer (of 5%) so that a transaction worth $0.999 or $0.951 remains eligible for one fraction. + +For example: + +- $5.60 donated --> 5 fractions +- $5.20 donated --> 5 fractions +- $0.96 donated --> 1 fraction +- $0.52 donated --> 0 fractions + +The queries used to generate the allowlists can be viewed here: + +- ETH Infra: https://dune.com/queries/1934656 +- Climate: https://dune.com/queries/1934689 +- OSS: https://dune.com/queries/1934969 + +Donors who contributed to the matching pool for each round are also eligible to claim hypercerts. + +:::note +You are free to edit your allowlist. You can do this by following the step-by-step instructions [here](minting-guide/step-by-step.md). Just remember that you will need to upload the new allowlist in a CSV format to a storage site like [web3.storage](https://web3.storage) and then update the link in the allowlist field. Contact team[at]hypercerts.org if you need help. +::: + +### Confirmations + +#### Contributors' permission + +Every contributor needs to agree to have their contribution be represented by a hypercert. This is why the person minting the hypercert has to confirm to have the permission of all listed contributors. + +#### Terms & Conditions + +The terms & Conditions can be found [here](https://hypercerts.org/terms). + +### Final step: Click "Create" + +Make sure your Optimism wallet or multi-sig is connected. Click on "create" and wait for your hypercert to be created. Congratulations! diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/minting-guide/minting-guide-start.md b/docs/versioned_docs/version-1.0.0-alpha.1/minting-guide/minting-guide-start.md new file mode 100644 index 00000000..47e8ad7c --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/minting-guide/minting-guide-start.md @@ -0,0 +1,44 @@ +--- +title: Getting Started +id: minting-guide-start +sidebar_position: 1 +--- + +# Getting started + +### How to create a hypercert + +Creating a hypercert is similar to creating an NFT on sites like OpenSea or Zora. + +In this article, we’ll walk through the steps one by one and explain exactly what you need to do to create your first hypercert. + +There are typically two ways of creating a hypercert: + +1. As a project affiliated with a specific funding network (e.g., Gitcoin Grants): In this case, you should receive a custom URL from the funding network that pre-populates most of your hypercert fields. You will still be able to change most of these, so you should review and adjust them as needed to better describe your hypercert. Guidance on how to do so (for Gitcoin Grants projects) is provided at the end of this doc. +2. As a project not affiliated with a specific funding network: In this case, you will be creating a hypercert from scratch and filling in each field on your own. Read on below. + +### Who can create a hypercert? + +Anyone doing work that is intended to have a positive impact can create a hypercert. Your hypercert can be as simple as "I did X on this date and want to claim all future impact from it". + +It can also represent something more, such as a phase in an ongoing team project, an invention or discovery, a research publication, or an important software release. + +Critically, if the work was done by more than one person, then each person should be listed as a contributor to the hypercert and approve the creation of the hypercert. + +_Note: In the future, the approval of each contributor will be verified on-chain._ + +### What do I need to create a hypercert? + +You will need to prepare all of the information required in the form builder (see **Step-by-step instructions for creating a hypercert** below). This includes important metadata, such as a description of the project and the dimensions of your impact claim, as well as a project artwork. You may also want to include an allowlist of wallets that are approved to claim one or more fractions of the hypercert. + +In addition to the information regarding the hypercert itself, you’ll need a crypto wallet to mint your hypercert. “Minting” a hypercert is the process of writing an impact claim to the blockchain. This establishes its immutable record of authenticity and ownership. + +Next, choose a blockchain on which to mint your hypercert. The hypercerts protocol is available on Ethereum, Goerli (testnet), and Optimism. Each of these blockchains has different gas fees associated with transactions on their networks. To reduce gas fees we recommend Optimism for most projects. + +Finally, go ahead and create your hypercert. + +### How much does it cost to create a hypercert? + +You will need enough Ethereum in your wallet to cover gas fees. In our simulations, the gas fee for minting a hypercert on Ethereum Mainnet ranged from 2,707,282 to 7,515,075 gwei (0.0027 to 0.0075 ETH). Minting costs are significantly cheaper on Optimism (i.e., below 0.0005 ETH or less than $1). + +The protocol currently does not offer gas-free or "lazy" minting. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/minting-guide/step-by-step.md b/docs/versioned_docs/version-1.0.0-alpha.1/minting-guide/step-by-step.md new file mode 100644 index 00000000..9f3b6303 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/minting-guide/step-by-step.md @@ -0,0 +1,130 @@ +--- +title: Step-by-step Instructions +id: step-by-step +sidebar_position: 2 +--- + +# Step-by-step instructions + +First, go to the [Create Hypercert](https://hypercerts.org/app/create) site with a wallet-enabled browser or follow the custom URL you received to access a prepopulated form. + +Although the site works on mobile, it is easier to use on desktop because the browser will display a dynamic preview of the hypercert while you fill out the Create form. + +Next, connect your wallet. You will be prompted to switch to the Ethereum or Optimism network. + +Once you've connected, you will see an empty form for creating a hypercert. + +### General fields + +#### Name of Hypercert + +Enter the name or title of the hypercert. This is the place to be verbose and specific about what the project is doing. You'll see on the preview when your title becomes too long. + +Given that a project may create numerous hypercerts over time, consider giving the hypercert a name that represents a discrete phase or output. + +Names are restricted to 100 characters but may include emojis (:smile:), accents (é), non-Latin scripts (表情), and other Unicode characters. + +#### Project Description + +Enter a human readable description of the hypercert. This is the place to share more details about the work and the team or individual behind the work. + +The description field supports [Markdown syntax](https://www.markdownguide.org/cheat-sheet/) and has a limit of 10,000 characters. + +In addition to the main link (see next field) you can add further links in the markdown to help others to understand the work of the project. + +#### Link + +A valid URL for the project, beginning with https:// + +This will be displayed next to the hypercert on webpages like OpenSea and should link users to a page that has more information about the project or impact claim. + +#### Logo + +An icon for the top left part of the card. This could be your project logo. It will be automatically masked to the shape of a circle. + +Logo images look best with an aspect ratio of 1.0 (square-shaped). + +The easiest way is to find an image you like in your web browser, right click "Copy Image Address", and paste it in the field. Images stored on IPFS should be referenced through a hosted URL service, e.g., `https://cloudflare-ipfs.com/ipfs/`. + +#### Background Banner Image + +A background image that will extend across the upper half of the artwork. This could be your project masthead or a unique piece of art. + +Banner images look best with an aspect ratio of 1.5 (e.g., 600 x 400 pixels). The dimensions should be at least 320 pixels wide and 214 pixels high to avoid stretching. + +Currently we don't support zoom / cropping, so you will need to test the look and feel on your own. + +The easiest way is to find an image you like in your web browser, right click "Copy Image Address", and paste it in the field. Images stored on IPFS should be referenced through a hosted URL service, e.g., `https://cloudflare-ipfs.com/ipfs/`. + +### Work Scope fields + +#### Work Scope + +One or multiple tags describe the work that the hypercert represents. This work scope will be used to identify the work that is included in the hypercerts and the work that is not included. + +Multiple tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. + +For most projects, it's probably best just to use a single tag that is a short form of your project's name. Given that your project may create numerous hypercerts over time, having a work scope that represents the name of your project will make your claims in the "impact hyperspace" more continuous. + +_Note: In the future, you will be able to specifically exclude work from the hypercert._ + +#### Start and End Date of Work + +The work time period defines when the work was done that the hypercert represents, i.e., only the work in this time period is included in the hypercert. + +The time period of work doesn't need to be the start and end date of a project, but it can be. One project can be split up into multiple hypercerts, e.g. all hypercerts can have the same `work scope`, but different time periods of work. Of course, the time periods are not allowed to overlap. + +### Impact scope fields + +#### Impact Scope + +The impact scope can be used to limit the impact that a hypercert represents, e.g. for the work scope `Planting trees` a hypercert can represent _only_ the impact on biodiversity by including the impact scope tag `Biodiversity`. This would exclude all other impacts, including the impact on CO2 in the atmosphere, which can be useful if that impact is already captured by a carbon credit. + +By default this is set to "`all`" and we strongly recommend keeping it that way. + +Just like the work scope, multiple impact scope tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction). + +#### Start and End Date of Impact + +The impact time period is another way to limit the impact that a hypercert represents, e.g. inventing a new medical treatment has a positive impact over many years, but we might want to capture the positive impact separately for each year. + +By default the `impact start date` is the same as the `work start date` and the `impact end date` is "`indefinite`", i.e., the impact is not restricted time-wise. We strongly recommend keeping it that way. + +### Set of Contributors + +Provide a list of contributors, one per line, or comma-separated. + +The list should include _all_ contributors that performed the described work. + +Contributors are generally itemized as wallet addresses or ENS names, but can also be names / pseudonyms. Groups of contributors can be represented by a multisig or name of an organization. + +### Owners + +#### Allowlist + +The allowlist allocates fractions of the hypercert to specific wallet addresses. These wallet addresses are then allowed to claim these fractions afterwards. For example, it can be used to allocate fractions to previous funders and contributors. + +The allowlist is implemented as a CSV file specifying `index,address,price,fractions` headers. + +| index | address | price | fractions | +| ----- | ------------------------------------------ | ----- | --------- | +| 0 | 0x5dee7b340764c49a827c60d2b8729e49405fbefc | 0.0 | 100 | +| 1 | 0x1e2dbb9ca3f6d48e085384a821b7259abfdc7d65 | 0.0 | 50 | +| ... | ... | ... | ... | +| 999 | 0x436bad18642f45d3fa5fcaad0a2d81764a9cba85 | 0.0 | 1 | + +The `price` field is denominated in ETH. This should remain at 0.0 for all hypercerts, as primary sales are not currently supported through the app and the secondary sale/transfer of hypercerts is currently not allowed. + +You can store your allowlists on IPFS using [web3.storage](https://web3.storage/). + +:::note +If your allowlist is not properly formatted, you will be unable to mint your hypercert. If you do not include an allowlist, then the creator of the hypercert will receive 100% of the hypercert (set to a default of 10,000 units), which you can then sell or transfer to another wallet a maximum of one time. +::: + +#### Rights + +This field defines the rights that owners of the hypercert have over the work being claimed by this hypercert. + +By default this is set to `Public Display`, i.e., the owners are allowed to publicly display the hypercert and show their support of the work. + +_Note: In the future, additional rights can be included for different hypercerts._ diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/evaluation.md b/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/evaluation.md new file mode 100644 index 00000000..87fb9194 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/evaluation.md @@ -0,0 +1,23 @@ +--- +title: Open Impact Evaluations +id: evaluation +sidebar_position: 5 +--- + +A key design element is that hypercerts themselves do not make a claim about the size of the impact, but only account for the work that is supposed to be impactful. The figure below shows this contrast in a simplified illustration of the example that we introduced above. The open evaluation system allows multiple evaluations to point at the same area of the impact space that a hypercert claims. The evaluations can include self-evaluation from the contributors themselves. Funders observe these and make their funding decisions based on this richer set of information. + +![hypercert evaluations](../../static/img/hypercert_evaluations.png) + +The open evaluation system is also used to provide additional information, e.g. an evaluator or the project itself provides information about the health of the trees. This information can then be used transparently by other evaluators to evaluate the impact on CO2 in the atmosphere. + +An important feature is that the evaluations do not directly point at a hypercert, but rather at an area in the impact space. In practice this area will mostly be the exact same area that a hypercert claims, such that it can be considered an evaluation of the hypercert, but it does not have to. This feature ensures that, if hypercerts are merged or split, previous evaluations will continue to be linked appropriately. + +The form of evaluations can be standardized to simplify handling and comparing multiple evaluations from multiple evaluators. The open evaluation system allows for templates to be created and used by any evaluators. Similar to the emerging ontologies, these are not enforced centrally, but should emerge as useful standards – potentially steered by decentralized governance institutions. + +Important characteristics of the open evaluation system are: + +- Evaluators can submit multiple evaluations of the same area in the impact space as more information becomes available +- Evaluations can challenge other evaluations +- Evaluation methodologies can evolve over time + +These features allow the whole evaluation system to be dynamically improved by each actor. The relevant incentives for this improvement will stem from the funders who will value the signals from some evaluators more than others and evaluators are able to build up reputation. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/hypercerts-intro.md b/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/hypercerts-intro.md new file mode 100644 index 00000000..8acc11d1 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/hypercerts-intro.md @@ -0,0 +1,104 @@ +--- +title: "Hypercerts: a New Primitive for Impact Funding Systems" +id: hypercerts-intro +sidebar_position: 3 +--- + +### Defining hypercerts + +A hypercert is a semi-fungible token that accounts for work that is supposed to be impactful and represents all or parts of that impact. A hypercert has the following fields (one for each dimension): + +1. **Set of contributors:** An ordered list of all contributors, who claim to do or have done the work described by this hypercert. +2. **Scope of work:** A conjunction of potentially-negated work scope tags, where an empty string means “all”: + +``` + ::= AND | " " + ::= | NOT +``` + +3. **Time of work:** A date range, from the start to the end of the work being claimed by this hypercert. +4. **Scope of impact:** A conjunction of potentially-negated impact scope tags, where an empty string means “all”: + +``` + ::= AND | " " + ::= | NOT +``` + +5. **Time of impact:** Date ranges from the start to the end of the impact. +6. **Rights of the owners:** An unordered list of usage rights tags, which define the rights of the owners of this hypercert over the work being claimed by this hypercert. + +Implementing hypercerts as a semi-fungible token allows multiple contributors and funders to own parts of hypercerts. For instance the original contributors can award 10% of a hypercert to a funder, while keeping 90%, which they can award to other funders later. This is why hypercerts are fractionalizable. + +### Examples + +In the simplest cases of hypercerts, the scope of work and impact as well as the time of impact are not restricted and no rights are transferred to owners of the hypercerts, i.e. the hypercerts just define the who (set of contributors) and when (time of work) of the claimed work. Scope of work and impact would be set to all, time of impact to “indefinite” and the rights to only “public display of support”. The latter is always included as the hypercert is a public record, such that owners will always automatically display their support of the work. + +Take for example hypercert 1 below: It represents all work that contributor 1 has performed in 2013 with all the impact that the work had from the beginning of the work; the hypercert doesn’t give any additional rights to the owners of the hypercert. + +The other fields – except the rights field – can be used to limit the work or impact that is represented by the hypercert. Hypercert 2 limits this to the work on IPFS in 2013, i.e. any other work besides IPFS that contributor 1 performed is not included. Hypercert 3 limits it even further as it excludes a specific aspect of IPFS, the go-ipfs implementation. + +| | **Hypercert 1** | **Hypercert 2** | **Hypercert 3** | +| ----------------------- | ------------------------- | ------------------------- | ------------------------- | +| **Set of contributors** | Contributor 1 | Contributor 1 | Contributor 1 | +| **Scope of work** | all | IPFS | IPFS ∧ ¬ go-ipfs | +| **Time of work** | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | +| **Scope of impact** | all | all | all | +| **Time of impact** | 2013-01-01 → indefinite | 2013-01-01 → indefinite | 2013-01-01 → 2013-12-31 | +| **Rights** | Public display of support | Public display of support | Public display of support | + +In the table below we illustrate a use case for limiting the scope of impact. Suppose contributor 1 protects trees in a certain area. This work has positive effects on the CO2 in the atmosphere and could turn into carbon credits; however, the trees have additional positive impacts, such as protecting biodiversity. Instead of including all positive impacts in one hypercert (hypercert 4), the impact can be split between the impact on CO2 in the atmosphere (hypercert 5) and all other positive impacts (hypercert 6). If funders are willing to pay for biodiversity, this would be a new income opportunity. And it would account for the additional positive impact that other methods of reducing CO2 might not have, like industrial carbon capture. Importantly, negative impacts can not be excluded from a hypercert. + +| | **Hypercert 4** | **Hypercert 5** | **Hypercert 6** | +| ----------------------- | -------------------------- | -------------------------- | -------------------------- | +| **Set of contributors** | Contributor 1 | Contributor 1 | Contributor 1 | +| **Scope of work** | Protecting trees in area X | Protecting trees in area X | Protecting trees in area X | +| **Time of work** | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | +| **Scope of impact** | all | CO2 in atmosphere | all ∧ ¬ CO2 in atmosphere | +| **Time of impact** | 2013-01-01 → indefinite | 2013-01-01 → indefinite | 2013-01-01 → indefinite | +| **Rights** | Public display of support | Public display of support | Public display of support | + +Importantly a hypercert does not specify the “size” of the impact, e.g. a hypercert does not state “5 tons of CO2 removed from the atmosphere.” Instead the hypercert only defines the work, e.g. “200 trees protected” (scope of work) in 2022 (time of work). The size of the impact is then left to the evaluations of the “CO2 in the atmosphere” (scope of impact) in 2022 (time of impact) that point towards the covered region of the hypercert. For instance: This allows a self evaluation to claim that 5 tons of CO2 were removed in a given year as well as one or multiple evaluations from independent auditors to confirm or challenge how much CO2 has been removed. An evaluator could detect that some of the trees were not healthy and hence only 4 tons of CO2 were removed. Allowing for multiple evaluation is a defining characteristic of the open evaluation system. + +### Functions of hypercerts + +#### 1. Identifiability + +Hypercerts clearly define the work that is supposed to be impactful by creating a record of who (set of contributors) claims to do or have done what (scope of work) in what time period (time of work). They also allow the creation of multiple records of the same work to identify separate impacts that this work had or will have (scope of impact) over specified time periods (time of impact). + +#### 2. Traceability + +As these records are public and logically monotonic (immutable, except to split or merge hypercerts), records are durable and permanent. + +#### 3. Transferability + +The records are a digital object that can be owned and ownership can be transferred (under specific conditions). As hypercerts can be created as fractionalizable, it is also possible to transfer only a specified fraction of the hypercert. Each hypercert defines the rights over the defined work that owners have, such as rights to retrospective rewards, rights to public display of the support (“bragging rights”) or rights to passive income from intellectual property. + +:::note Transferability restrictions + +Hypercerts are generally transferable. However, there are use cases, in which minters of hypercerts want to restrict how their hypercerts can be transferred. The protocol allows the minter to restrict who can transfer the hypercert and/or to whom the hypercert can be transferred. For instance, by specifying that only the original owner can transfer the hypercert, any future owner is prohibited from selling it, i.e. a secondary market would not exist for this hypercert. + +::: + +### Merging hypercerts + +Besides the fungible dimension, hypercerts can be merged and split on any of the six dimensions as shown in box 1. Let us take the hypercert 1 from the section "Hypercerts definition" and focus only on two of the dimensions, scope of work and time of work. These two dimensions create a simplified impact space. The figure below shows how work on IPFS (InterPlanetary File System) could have been minted over time in separate hypercerts, one for each quarter of work. + +![minting hypercerts example](../../static/img/creating.png) + +We created five hypercerts, one for each quarter of work. As the resulting work of all of these together is IPFS 0.1, the merged hypercert in total is more meaningful and more valuable than just the five individual hypercerts. In this case the proverb is true, the whole is greater than the sum of its parts. Hence, we want to merge them as shown in the next figure. + +![merging hypercerts example](../../static/img/merging.png) + +### Splitting hypercerts + +Conversely, splitting can increase the meaningfulness and value of hypercerts as well. We can split the work on IPFS 0.1 into the conceptual work “invention of IPFS” and the implementation via “go-ipfs 0.1” as shown in the next figure. + +![splitting hypercerts examples](../../static/img/splitting.png) + +Other use cases are where multiple contributors want to combine their work on the same scope of work (merging) or disentangle their work (splitting). Ultimately, splitting and merging allows users to repackage the digital representation of their work and impact. + +Importantly, splitting and merging are the only operations that are permitted to change hypercerts. Once an area in the impact space is claimed, it can not be unclaimed. This ensures that claims are never forgotten. + +### Retiring hypercerts + +While a claim in the impact space can not be unclaimed, it can be retired. Retiring a hypercert means that owners can not transfer and sell it anymore. This way owners prove that they are the final buyers of the impact. Technically retiring hypercerts means that they are sent to a specific null address, which ensures that the retired hypercerts are recorded and traceable. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/ifs.md b/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/ifs.md new file mode 100644 index 00000000..6f71ac50 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/ifs.md @@ -0,0 +1,103 @@ +--- +title: The Need for Interoperable Impact Funding Systems (IFSs) +id: ifs +--- + +# The Need for Interoperable Impact Funding Systems (IFSs) + +### An IFS consists of + +- **Actors:** Contributors, funders, evaluators, and beneficiaries +- **Funding mechanisms:** Grants, bounties, retrospective funding, etc. +- **Coordination mechanisms:** Roadmapping, communication forums, etc. +- **A goal:** Maximize the domain-specific positive value created (impact) + +The goal will be specific to the impact area, e.g. prevent existential risks from artificial intelligence (AI) would be the goal for the impact area “AI safety.” To achieve these goals, skilled contributors must work with high effort on promising projects. Additionally, for those projects that create impact continuously, sufficient income streams are necessary to cover both their ongoing operating expenses and contributors’ upside incentives. + +#### Actors in IFSs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeSubtypeDescription
ContributorsPeople or organizations who do the work
FundersProspective fundersPeople or organizations who fund work before it is done
Retrospective fundersPeople or organizations who fund work after it is done
EvaluatorsScoutsPeople or organizations who evaluate the potential impact of work before it is done
AuditorsPeople or organizations who evaluate the impact of work after it is done
BeneficiariesPeople or objects that are impacted by the work
+ +### Guiding questions for designing IFSs + +1. **Projects:** How can we improve the chances that the most promising projects are worked on? +2. **Talent & resources:** How can we attract top talent to contribute to the most promising projects and provide them with the necessary resources? +3. **Effort:** How can we reward contributors for their impact on outcomes? +4. **Sustainable income:** How can we create recurring income streams and financial sustainability for impactful projects? + +Markets have been proven very powerful in answering these questions if they are directed towards maximizing profits. As we are directing systems towards maximizing impact, these answers become more challenging. In particular, in an IFS we are facing coordination and incentive problems in funding impact, such as the free-rider problem. + +### Example dynamics between actors in an IFS + +In order for impact funding systems to be most effective, they should be interoperable regarding (1) funding mechanisms, (2) funding sources and (3) evaluations. In the diagram below you see a potential dynamic between the actors of an IFS. In that scenario hypercerts can account for the prospective funding (steps 2-3) as well as for the retrospective funding (steps 8-9) from different funders. Evaluations are made public and can be discovered through the hypercerts for all funders (steps 5-7). Retrospective funders can reward not only the contributors but also the prospective funders (steps 10-11). + +```mermaid +sequenceDiagram + autonumber + participant Beneficiaries + participant Contributors + participant Prospective funders + participant Retrospective funders + participant Evaluators + Contributors ->> Contributors: Mint hypercerts + Prospective funders ->> Contributors: Award funding + Contributors ->> Prospective funders: Award fractions of
the hypercert + Contributors ->> Beneficiaries: Create impact + Retrospective funders ->> Evaluators: Fund evaluation + Evaluators ->> Beneficiaries: Evaluate impact on beneficiaries + Evaluators ->> Retrospective funders: Make evaluations public,
esp. for retrospective
funders + Retrospective funders ->> Contributors: Award funding + Contributors ->> Retrospective funders: Award fractions of hypercerts + opt + Retrospective funders ->> Prospective funders: Award funding + Prospective funders ->> Retrospective funders: Transfer fractions
of hypercert + end +``` + +### Hypercerts as a data layer for IFSs + +By serving as a single, open, shared, decentralized database hypercerts lower the transaction costs to coordinate and fund impactful work together. This is important because the optimal funding decisions of a single funder depends on the funding decision of all other funders. For instance, some work is only impactful if a minimum funding is provided: The impact is non-linear in the funding amount, e.g. half a bridge is not half as impactful as a full bridge. Other work might be over-funded, i.e. the impact of an additional dollar is basically zero. Ultimately, funders want to find the highest impact for each additional dollar spend (cf. S-process as in Critch, 2021). Today multi-funder coordination on impact funding is prohibitively expensive, leading to suboptimal efficiency in impact capital allocation. Through hypercerts the funding becomes more transparent and the credits for funding impactful work can be easily shared. Coordinating funding becomes easier. + +Hypercerts don’t solve this coordination problem by themselves, but build the basis for different decision and funding mechanisms as shown below. Quadratic voting, bargaining solutions, DAO-style votes, milestone bounties, and simple unconditional grants all have their strengths, among others. Hypercerts do not lock in any particular decision-making scheme for funders. + +![Hypercerts as a data layer for an IFS](../../static/img/hypercert_data_layer.png) + +Looking farther into the future: If a large majority of funding across an entire IFS ends up flowing through hypercerts, funders have created the transparency that enables each of them to make the best decisions given the funding decision of everyone else. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/impact-space.md b/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/impact-space.md new file mode 100644 index 00000000..f8fed762 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/impact-space.md @@ -0,0 +1,35 @@ +--- +title: A Consistent Impact Space +id: impact-space +sidebar_position: 4 +--- + +Every hypercert represents a claim in the impact space, which itself represents all possible claims. Above we illustrated the impact space with two dimensions, scope and time of work. The complete impact space is spanned by the six dimensions introduced in the definition of hypercerts. + +### Consistency of the impact space + +Every point in the impact space should either be claimed or not be claimed. No point must be claimed twice, or equivalently: + +- If the impact of some work is represented in one hypercert, it must not be part of any other hypercert. +- Hypercerts must not overlap with each other. + +The table below shows two hypercerts that were illustrated in the section on "Hypercerts operations", but now with all six fields. The two hypercerts can represent the exact same work by the same contributor, but they do not overlap because of the difference in the time of work. + +| | **Hypercert 7** | **Hypercert 8** | +| ----------------------- | ------------------------ | ------------------------ | +| **Set of contributors** | Contributor 1 | Contributor 1 | +| **Scope of work** | IPFS | IPFS | +| **Time of work** | 2013-10-01 to 2013-12-31 | 2014-01-01 to 2014-03-31 | +| **Scope of impact** | all | all | +| **Time of impact** | 2013-10-01 → indefinite | 2014-01-01 → indefinite | +| **Rights** | None | None | + +The consistency of the impact space is crucial as it ensures that no rights to an impact claim are sold twice. If for example someone owns the right to retrospective rewards for the impact of some work, the owners must be identifiable unambiguously. + +Because users can create hypercerts with arbitrary data on any chain, on which a hypercert contract is deployed, we provide ways to help users detect collisions in the impact space. For example, if one hypercert on Ethereum points to the work on “IPFS”, and another hypercert on Filecoin points to the work on “https://github.com/ipfs/go-ipfs” both with the same contributor and time of work, which of these overlapping hypercerts is the correct one to support? To surface such overlapping hypercerts, the hypercerts protocol and SDK will support mechanisms to index, search, and visualize neighbors in the impact space. With these tools evaluators can quickly detect potential conflicts and submit the results as evaluations to help disambiguate proper credit and attribution. + +### Emerging ontologies + +Common ontologies for the scope of work and scope of impact are useful to create transparency and improve discoverability. Such ontologies need to be created from the practices and should be adapted over time. They are like emerging norms, instead of fixed rules. However, some larger players or a group of smaller players could enforce certain ontologies, e.g. if multiple funders agree that they only fund projects that follow a specified ontology. + +As some ontologies might be more useful than others, we would ideally see a consensus emerge between participants and experts in each impact area. Decentralized governance institutions can help facilitate this; however, further details on the design are out of the scope of this paper and are left for future work. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/retrospective-funding.md b/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/retrospective-funding.md new file mode 100644 index 00000000..57444581 --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/retrospective-funding.md @@ -0,0 +1,42 @@ +--- +title: Retrospective Impact Funding +id: retrospective-funding +sidebar_position: 6 +--- + +### Introducing retrospective funding + +While hypercerts do not impose any specific funding mechanisms, they are especially useful for retrospective funding. The core idea, from the perspective of contributors building impactful goods, is this: if you can reasonably expect to get funded retrospectively for your work once you produce a positive impact, then you can work now, in expectation of a probabilistic future cash flow. In another conception, you are effectively “borrowing” money from this anticipated future cash flow to fund the work in the first place; the expectation of future funding “retro-causes” the impactful work. Retrospective funding may be able to 1) provide incentives for contributors to take on impactful goods projects with a potentially high, but uncertain, impact and 2) create a more efficient IFS by back-propagating signals on what outcomes were impactful post-hoc. + +In addition, contributors are able to receive fair compensation by providing outsized impact that will be highly valued. It incentivizes you to create a positive impact, beyond your intrinsic motivation. This does not mean that the most successful contributors to impactful goods automatically have potential upside comparable to some for-profit startup founders (or that they should), just that their potential upside does depend on how much funders later value their past work. This will attract more talent to the impact sector by improving performance-based compensation. + +The crucial aspect for this to work: funders need to retrospectively fund impact, and send credible signals that they will do so in the future. Based on these signals contributors form expectations about future retrospective rewards and can start working today to receive them in the future. + +Hypercerts facilitate retrospective funding as the impact claims are identifiable, traceable and transferable. Contributors can sell parts of their hypercerts to prospective funders to receive the necessary funding for their project (“activity” in the figure below). The project delivers impact to a larger group (“beneficiaries”), which retrospectively buys the hypercerts from the prospective funder, and from the contributors if they retained some fraction of their hypercerts (the latter is not represented in the figure). + +![Retrospective funding with hypercerts](../../static/img/retrospective_funding.png) + +### Increasing rewards + +Retrospective funding allows us to increase rewards as more impact is created because impact is easier to observe, measure and prove retrospectively. Increasing rewards – as shown in the next figure – incentivizes contributors to put in their highest effort to produce impact and enables contributors to be rewarded for their talent. Moreover, prospective funders are incentivized to select, fund and support the projects with the highest expected impact, if they also receive retrospective rewards. + +![Increasing rewards](../../static/img/increasing_rewards.png) + +Note that retrospective funding should not be used in cases where a significant negative impact is possible since a nongovernmental, permissionless framework can not impose retrospective penalties for negative externalities. See Ofer & Cotton-Barratt (2022) for a discussion of this limitation of retrospective funding. + +In some cases we do not expect the retrospective evaluation to be any different than the prospective evaluation, i.e. there is no uncertainty resolved over time as the impact of an activity is already “known” prospectively. In these cases retrospective funding would only complicate the funding mechanism and funding via grants or milestone bounties would be preferable. Retrospective funding is preferable only if uncertainty is resolved over time. + +### Impact evaluations + +The relevance of impact evaluations will depend on how much their signals influence the funding decisions of retrospective funders (see the potential dynamics in the section on "IFSs"). This is a critical difference to many impact reports today: If a project was funded by a grant, the funders as well as the project want to receive a positive evaluation. If, however, the funding decisions of the retrospective funders are outstanding, they are interested in truthful signals about the impact. Hence, funders value improvements in evaluation methodologies and can fund independent evaluators. Evaluators in turn would build up a reputation for their evaluation methodologies and improve the strength of their signals to retrospective funders. + +Impact evaluators can take on a range of forms ranging forms, such as + +- Voting by relevant communities or beneficiaries +- Expert panels +- Professional evaluators similar to financial rating agencies +- Automatic monitoring and data collection by sensors and oracles + +The most useful form or combinations thereof will depend on the specific requirements of the impact area. For a generalized framework on impact evaluators see Protocol Labs (2023). + +While retrospective funding makes impact evaluations financially relevant for funders and contributors, hypercerts enable to pre-commit funding for those evaluations: As impact claims are never forgotten, any actor can at any time commit funding to a future evaluation of these claims. diff --git a/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/whitepaper-intro.md b/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/whitepaper-intro.md new file mode 100644 index 00000000..4d4648ba --- /dev/null +++ b/docs/versioned_docs/version-1.0.0-alpha.1/whitepaper/whitepaper-intro.md @@ -0,0 +1,24 @@ +--- +title: Introduction +id: whitepaper-intro +--- + +# Vision & Whitepaper + +:::note + +If you prefer to read the draft whitepaper (v0) as a pdf, you can find it [here](../../static/pdf/hypercerts_whitepaper_v0.pdf). The content is mostly identical to the following pages. + +::: + +#### The world faces unprecedented challenges, from climate change to safe artificial intelligence, that require billions to trillions of dollars of public goods funding. + +High-upside/high-uncertainty endeavors are often overlooked due to the absence of strong incentives to pursue them in the dominant public goods funding framework of at-cost grants or even a milestone-bounty framework (which directly exposes small contributors to aversive risk levels). Yet these should be pursued when the expected positive value is very high, as it often is. New impact funding mechanisms can address this. One such mechanism is retrospective funding, which rewards projects based on the impact they create after the impact is observable. If projects can reasonably expect such retrospective rewards, they are incentivized to maximize their impact and – together with prospective funders – take risky bets when the expected positive value is high. + +#### In order for Impact Funding Systems (IFSs) to be most effective, they should be interoperable regarding (1) funding mechanisms, (2) funding sources, and (3) evaluations. + +Quadratic voting, bargaining solutions, DAO-style votes, milestone bounties, and simple unconditional grants all have their strengths, among others. We do not wish to lock in any particular decision-making scheme for funders. Without mechanisms like these, multi-funder coordination on impact funding is prohibitively expensive, leading to suboptimal efficiency in impact capital allocation. Funders should be able to easily collaborate with other funders or to intentionally fund different projects to diversify the funded approaches. Evaluators should be able to evaluate the same impact with different methodologies – potentially with conflicting results, to foster rigor and progress of evaluation methodologies. + +#### Hypercerts create this interoperability by serving as a single, open, shared, decentralized database for impact funding mechanisms. + +A single hypercert is a semi-fungible token that accounts for work that is supposed to be impactful and whose ownership is fractionizable and transferable (under specific conditions). Hypercerts do not impose any specific funding mechanisms but provide baseline invariant guarantees such that claims will not be forgotten as different mechanisms come into and out of fashion. This is also why hypercerts are especially useful for any retrospective funding mechanisms – funding can be applied to claims of the past. diff --git a/docs/versioned_sidebars/version-1.0.0-alpha.0-sidebars.json b/docs/versioned_sidebars/version-1.0.0-alpha.0-sidebars.json new file mode 100644 index 00000000..33a5ba79 --- /dev/null +++ b/docs/versioned_sidebars/version-1.0.0-alpha.0-sidebars.json @@ -0,0 +1,162 @@ +{ + "mySidebar": [ + { + "type": "doc", + "id": "intro" + }, + { + "type": "category", + "label": "Vision & Whitepaper", + "collapsed": true, + "items": [ + { + "type": "doc", + "id": "whitepaper/whitepaper-intro" + }, + { + "type": "doc", + "id": "whitepaper/ifs" + }, + { + "type": "doc", + "id": "whitepaper/hypercerts-intro" + }, + { + "type": "doc", + "id": "whitepaper/impact-space" + }, + { + "type": "doc", + "id": "whitepaper/evaluation" + }, + { + "type": "doc", + "id": "whitepaper/retrospective-funding" + } + ] + }, + { + "type": "category", + "label": "Developer Guide", + "collapsed": true, + "items": [ + { + "type": "doc", + "id": "developer/quickstart-javascript" + }, + { + "type": "doc", + "id": "developer/quickstart-solidity" + }, + { + "type": "doc", + "id": "developer/minting" + }, + { + "type": "doc", + "id": "developer/allowlists" + }, + { + "type": "doc", + "id": "developer/querying" + }, + { + "type": "doc", + "id": "developer/split-merge" + }, + { + "type": "doc", + "id": "developer/evaluations" + }, + { + "type": "doc", + "id": "developer/burning" + }, + { + "type": "doc", + "id": "developer/supported-networks" + }, + { + "type": "doc", + "id": "devops/index" + }, + { + "type": "category", + "label": "API Reference", + "collapsed": true, + "items": [ + { + "type": "category", + "label": "Contracts", + "collapsed": true, + "items": [ + { + "type": "doc", + "id": "developer/api/contracts/HypercertMinter" + }, + { + "type": "doc", + "id": "developer/api/contracts/SemiFungible1155" + }, + { + "type": "doc", + "id": "developer/api/contracts/AllowlistMinter" + } + ] + }, + { + "type": "doc", + "id": "developer/api/sdk/modules" + } + ] + } + ] + }, + { + "type": "category", + "label": "Minting Guide", + "collapsed": true, + "items": [ + { + "type": "doc", + "id": "minting-guide/minting-guide-start" + }, + { + "type": "doc", + "id": "minting-guide/step-by-step" + }, + { + "type": "doc", + "id": "minting-guide/gitcoin-round" + } + ] + }, + { + "type": "category", + "label": "Implementation", + "collapsed": true, + "items": [ + { + "type": "doc", + "id": "implementation/token-standard" + }, + { + "type": "doc", + "id": "implementation/metadata" + }, + { + "type": "doc", + "id": "implementation/glossary" + } + ] + }, + { + "type": "doc", + "id": "faq" + }, + { + "type": "doc", + "id": "further-resources" + } + ] +} diff --git a/docs/versioned_sidebars/version-1.0.0-alpha.1-sidebars.json b/docs/versioned_sidebars/version-1.0.0-alpha.1-sidebars.json new file mode 100644 index 00000000..91fbd94e --- /dev/null +++ b/docs/versioned_sidebars/version-1.0.0-alpha.1-sidebars.json @@ -0,0 +1,165 @@ +{ + "mySidebar": [ + { + "type": "doc", + "id": "intro" + }, + { + "type": "category", + "label": "Vision & Whitepaper", + "collapsed": true, + "items": [ + { + "type": "doc", + "id": "whitepaper/whitepaper-intro" + }, + { + "type": "doc", + "id": "whitepaper/ifs" + }, + { + "type": "doc", + "id": "whitepaper/hypercerts-intro" + }, + { + "type": "doc", + "id": "whitepaper/impact-space" + }, + { + "type": "doc", + "id": "whitepaper/evaluation" + }, + { + "type": "doc", + "id": "whitepaper/retrospective-funding" + } + ] + }, + { + "type": "category", + "label": "Developer Guide", + "collapsed": true, + "items": [ + { + "type": "doc", + "id": "developer/quickstart-javascript" + }, + { + "type": "doc", + "id": "developer/quickstart-solidity" + }, + { + "type": "doc", + "id": "developer/minting" + }, + { + "type": "doc", + "id": "developer/allowlists" + }, + { + "type": "doc", + "id": "developer/querying" + }, + { + "type": "doc", + "id": "developer/split-merge" + }, + { + "type": "doc", + "id": "developer/evaluations" + }, + { + "type": "doc", + "id": "developer/burning" + }, + { + "type": "doc", + "id": "developer/supported-networks" + }, + { + "type": "doc", + "id": "devops/index" + }, + { + "type": "category", + "label": "API Reference", + "collapsed": true, + "items": [ + { + "type": "category", + "label": "Protocol", + "collapsed": true, + "items": [ + { + "type": "autogenerated", + "dirName": "developer/api/contracts/protocol" + } + ] + }, + { + "type": "category", + "label": "Exchange", + "collapsed": true, + "items": [ + { + "type": "autogenerated", + "dirName": "developer/api/contracts/marketplace" + } + ] + }, + { + "type": "doc", + "id": "developer/api/sdk/modules" + } + ] + } + ] + }, + { + "type": "category", + "label": "Minting Guide", + "collapsed": true, + "items": [ + { + "type": "doc", + "id": "minting-guide/minting-guide-start" + }, + { + "type": "doc", + "id": "minting-guide/step-by-step" + }, + { + "type": "doc", + "id": "minting-guide/gitcoin-round" + } + ] + }, + { + "type": "category", + "label": "Implementation", + "collapsed": true, + "items": [ + { + "type": "doc", + "id": "implementation/token-standard" + }, + { + "type": "doc", + "id": "implementation/metadata" + }, + { + "type": "doc", + "id": "implementation/glossary" + } + ] + }, + { + "type": "doc", + "id": "faq" + }, + { + "type": "doc", + "id": "further-resources" + } + ] +} diff --git a/docs/versions.json b/docs/versions.json index 1e3a80c1..df2daf73 100644 --- a/docs/versions.json +++ b/docs/versions.json @@ -1 +1,2 @@ -["0.3.0", "0.0.1"] +["1.0.0-alpha.1", "0.3.0", "0.0.1"] + diff --git a/frontend/.env.local.example b/frontend/.env.local.example index 5156ec11..d6275350 100644 --- a/frontend/.env.local.example +++ b/frontend/.env.local.example @@ -7,8 +7,6 @@ NEXT_PUBLIC_DOMAIN=testnet.hypercerts.org ####### ## Web3 ####### -### 5=Goerli, 10=Optimism -NEXT_PUBLIC_DEFAULT_CHAIN_ID=5 ### UUPS proxy contract address NEXT_PUBLIC_CONTRACT_ADDRESS=0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07 ### Subgraph URL - currently using hosted service diff --git a/frontend/.eslintrc.json b/frontend/.eslintrc.json index d99797cb..fdcf77c2 100644 --- a/frontend/.eslintrc.json +++ b/frontend/.eslintrc.json @@ -16,11 +16,6 @@ "prettier", "next" ], - "ignorePatterns": [ - "**/graph/generated/*", - "**/vendor/*.js", - "vendor/**/*.js" - ], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaFeatures": { diff --git a/frontend/components/blueprint-create.tsx b/frontend/components/blueprint-create.tsx deleted file mode 100644 index 876b6a6c..00000000 --- a/frontend/components/blueprint-create.tsx +++ /dev/null @@ -1,487 +0,0 @@ -import { useAccountLowerCase } from "../hooks/account"; -import { useMintBlueprintToRegistry } from "../hooks/createBlueprintInRegistry"; -import { useListRegistries } from "../hooks/list-registries"; -import { parseListFromString } from "../lib/parsing"; -import { useConfetti } from "./confetti"; -import { useContractModal } from "./contract-interaction-dialog-context"; -import { DATE_INDEFINITE, DateIndefinite, FormContext } from "./forms"; -import { formatHypercertData } from "@hypercerts-org/sdk"; -import { DataProvider } from "@plasmicapp/loader-nextjs"; -import dayjs from "dayjs"; -import { Formik, FormikProps } from "formik"; -import html2canvas from "html2canvas"; -import _ from "lodash"; -import { useRouter } from "next/router"; -import qs from "qs"; -import React, { ReactNode } from "react"; -import { toast } from "react-toastify"; -import * as Yup from "yup"; - -/** - * Constants - */ -const FORM_SELECTOR = "currentForm"; -const IMAGE_SELECTOR = "hypercertimage"; -export const NAME_MIN_LENGTH = 2; -export const NAME_MAX_LENGTH = 50; - -export const DESCRIPTION_MIN_LENGTH = 20; -export const DESCRIPTION_MAX_LENGTH = 1500; - -export const DEFAULT_NUM_FRACTIONS = 10000; -export const DEFAULT_HYPERCERT_VERSION = "0.0.1"; - -//const DEFAULT_TIME = dayjs().format("YYYY-MM-DD"); -const DEFAULT_TIME = dayjs(); -const DEFAULT_FORM_DATA: BlueprintCreateFormData = { - registryId: "", - minterAddress: "", - name: "", - description: "", - externalLink: "", - logoUrl: "", - //logoImage: null, - bannerUrl: "", - //bannerImage: null, - impactScopes: ["all"] as string[], - //impactTimeStart: DEFAULT_TIME.format("YYYY-MM-DD"), - impactTimeEnd: DEFAULT_TIME.format("YYYY-MM-DD"), - workScopes: "", - workTimeStart: DEFAULT_TIME.format("YYYY-MM-DD"), - workTimeEnd: DEFAULT_TIME.format("YYYY-MM-DD"), - rights: ["Public Display"] as string[], - contributors: "", - agreeContributorsConsent: false, - agreeTermsConditions: false, - // Hidden - backgroundColor: "", - backgroundVectorArt: "", - metadataProperties: "", -}; - -interface BlueprintCreateFormData { - registryId: string; - minterAddress: string; - name: string; - description: string; - externalLink: string; - logoUrl: string; - //logoImage: File | null; - bannerUrl: string; - //bannerImage: File | null; - impactScopes: string[]; - //impactTimeStart?: string; - impactTimeEnd?: string | DateIndefinite; - workScopes: string; - workTimeStart?: string; - workTimeEnd?: string; - rights: string[]; - contributors: string; - agreeContributorsConsent: boolean; - agreeTermsConditions: boolean; - // Hidden - backgroundColor: string; - backgroundVectorArt: string; - metadataProperties: string; -} - -/** - * Generic utility function to check for valid URLs - * - We should probably move this to common.ts or util.ts - * @param value - * @param opts - * @returns - */ -const isValidUrl = ( - value: any, - opts: { - emptyAllowed?: boolean; - ipfsAllowed?: boolean; - }, -) => { - // Check empty, null, or undefined - if (opts.emptyAllowed && !value) { - return true; - } else if (!value) { - return false; - } - - // Check IPFS - const isIpfsUrl = value.match(/^(ipfs):\/\//); - if (opts.ipfsAllowed && isIpfsUrl) { - return true; - } - - try { - const urlSchema = Yup.string().url(); - urlSchema.validateSync(value); - return true; - } catch (e) { - return false; - } -}; - -/** - * Converts raw form data to a query string - * @param values - * @returns - */ -const formDataToQueryString = (values: Record) => { - // We will serialize our Dayjs objects - const formatDate = (key: string) => { - if (values[key] === DATE_INDEFINITE) { - values[key] = DATE_INDEFINITE; - } else if (values[key] && values[key].format) { - values[key] = values[key].format("YYYY-MM-DD"); - } - }; - ["impactTimeStart", "impactTimeEnd", "workTimeStart", "workTimeEnd"].forEach( - formatDate, - ); - const filteredValues = _.chain(values).pickBy().value(); - return qs.stringify(filteredValues); -}; - -/** - * Converts a query string into raw form data - * @param query - * @returns - */ -const queryStringToFormData = (query?: string) => { - const rawValues = qs.parse(query ?? ""); - const parseValue = (v: any) => { - return v === DATE_INDEFINITE ? DATE_INDEFINITE : dayjs(v as string); - }; - const values = { - ...rawValues, - // we need to parse dates to match the expected types - //impactTimeStart: parseValue(rawValues["impactTimeStart"]), - impactTimeEnd: parseValue(rawValues["impactTimeEnd"]), - workTimeStart: parseValue(rawValues["workTimeStart"]), - workTimeEnd: parseValue(rawValues["workTimeEnd"]), - }; - return values as any; -}; - -/** - * Form validation rules - */ -const ValidationSchema = Yup.object().shape({ - registryId: Yup.string().required("Required"), - minterAddress: Yup.string().required("Required"), - name: Yup.string() - .min(NAME_MIN_LENGTH, `Name must be at least ${NAME_MIN_LENGTH} characters`) - .max(NAME_MAX_LENGTH, `Name must be at most ${NAME_MAX_LENGTH} characters`) - .required("Required"), - description: Yup.string() - .min( - DESCRIPTION_MIN_LENGTH, - `Description must be at least ${DESCRIPTION_MIN_LENGTH} characters`, - ) - .max( - DESCRIPTION_MAX_LENGTH, - `Description must be at most ${DESCRIPTION_MAX_LENGTH} characters`, - ) - .required("Required"), - externalLink: Yup.string().test( - "valid uri", - "Please enter a valid URL", - (value) => - isValidUrl(value, { - emptyAllowed: true, - ipfsAllowed: true, - }), - ), - logoUrl: Yup.string().test("valid uri", "Please enter a valid URL", (value) => - isValidUrl(value, { - emptyAllowed: true, - ipfsAllowed: false, - }), - ), - bannerUrl: Yup.string().test( - "valid uri", - "Please enter a valid URL", - (value) => - isValidUrl(value, { - emptyAllowed: true, - ipfsAllowed: false, - }), - ), - impactScopes: Yup.array().min(1, "Please choose at least 1 item"), - impactTimeEnd: Yup.lazy((val: any) => { - switch (typeof val) { - case "string": - return Yup.string(); - default: - return Yup.date().when("workTimeStart", (workTimeStart) => { - return Yup.date().min( - workTimeStart, - "End date must be after start date", - ); - }); - } - }), - workScopes: Yup.string() - .required("Required") - .min( - NAME_MIN_LENGTH, - `Work scopes must be at least ${NAME_MIN_LENGTH} characters`, - ) - .test("no duplicates", "Please remove duplicate items", (value) => { - if (!value) { - return true; - } - const items = parseListFromString(value, { lowercase: "all" }); - const dedup = parseListFromString(value, { - lowercase: "all", - deduplicate: true, - }); - return _.isEqual(items, dedup); - }), - workTimeEnd: Yup.date().when("workTimeStart", (workTimeStart) => { - return Yup.date().min(workTimeStart, "End date must be after start date"); - }), - rights: Yup.array().min(1), - contributors: Yup.string() - .required("Required") - .test("no duplicates", "Please remove duplicate items", (value) => { - if (!value) { - return true; - } - const items = parseListFromString(value, { lowercase: "all" }); - const dedup = parseListFromString(value, { - lowercase: "all", - deduplicate: true, - }); - return _.isEqual(items, dedup); - }), - agreeContributorsConsent: Yup.boolean().oneOf( - [true], - "You must get the consent of contributors before creating", - ), - agreeTermsConditions: Yup.boolean().oneOf( - [true], - "You must agree to the terms and conditions", - ), -}); - -/** - * Hypercert creation form logic using Formik - * - For the actual layout of form elements, - * we assume it's passed in via the `children` prop. - * - Use the form elements defined in `./forms.tsx` - * - Make sure that there is a form element with a `fieldName` - * for each field in HypercertCreateFormData - */ -export interface HypercertCreateFormProps { - className?: string; // Plasmic CSS class - children?: ReactNode; // Form elements -} - -export function BlueprintCreateForm(props: HypercertCreateFormProps) { - const { data: registries = [] } = useListRegistries(); - const registryOptions = registries.map((r: any) => `${r.name} - ${r.id}`); - const { className, children } = props; - const { address } = useAccountLowerCase(); - const { push } = useRouter(); - const { hideModal } = useContractModal(); - const confetti = useConfetti(); - - // Query string - const [initialQuery, setInitialQuery] = React.useState( - undefined, - ); - // Load the querystring into React state only once on initial page load - React.useEffect(() => { - if (!initialQuery) { - window.location.hash.startsWith("#") - ? setInitialQuery(window.location.hash.slice(1)) - : setInitialQuery(window.location.hash); - } - }, [initialQuery]); - - const onComplete = async () => { - hideModal(); - confetti && - (await confetti.addConfetti({ - emojis: ["🌈", "⚡️", "💥", "✨", "💫", "🌸"], - })); - push("/app/dashboard"); - }; - - const { mutate: createBlueprint, isLoading: createBlueprintPending } = - useMintBlueprintToRegistry({ - onComplete, - }); - - return ( -
- { - // console.log(values); - if (typeof initialQuery !== "undefined") { - // The useEffect has run already, so it's safe to just update the query string directly - //const querystring = formDataToQueryString(values); - //const path = `${window.location.pathname}#${querystring}`; - //window.history.pushState(null, "", path); - } - }} - initialValues={{ - ...DEFAULT_FORM_DATA, - ...queryStringToFormData(initialQuery), - }} - enableReinitialize - onSubmit={async (values, { setSubmitting }) => { - const image = await exportAsImage(IMAGE_SELECTOR); - const metaData = formatValuesToMetaData( - values, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - address!, - image, - ); - console.log(`Metadata(valid=${metaData.valid}): `, metaData.data); - if (metaData.data) { - const registryId = values.registryId.split(" - ")[1]; - //return; // Used for testing - - if (!registryId) { - toast("Error creating blueprint. Please contact the team.", { - type: "error", - }); - console.error("Registry ID not found"); - return; - } - createBlueprint({ - registryId, - value: formDataToQueryString(values), - minterAddress: values.minterAddress, - }); - } else { - toast("Error creating hypercert. Please contact the team.", { - type: "error", - }); - console.error("SDK formatting errors: ", metaData.errors); - } - - if (!createBlueprintPending) { - setSubmitting(false); - } - }} - > - {(formikProps: FormikProps) => ( - - -
{ - e.preventDefault(); - console.log("Submitting form..."); - console.log("Form values: ", formikProps.values); - console.log("Form errors: ", formikProps.errors); - formikProps.handleSubmit(); - }} - > - {children} -
-
-
- )} -
-
- ); -} - -const formatValuesToMetaData = ( - val: BlueprintCreateFormData, - address: string, - image?: string, -) => { - // Split contributor names and addresses. - // - make sure addresses are always lower case - const contributorNamesAndAddresses = parseListFromString(val.contributors, { - lowercase: "addresses", - }); - // Split the work scopes - const workScopes = parseListFromString(val.workScopes); - - // Mint certificate using contract - // NOTE: we set the times to be UNIX time (seconds since the epoch) - // but Date.getTime() returns milliseconds since the epoch - // NOTE: we are fixing the impactTimeStart to be the same as workTimeStart - const impactTimeframeStart = val.workTimeStart - ? new Date(val.workTimeStart).getTime() / 1000 - : 0; - /** - const impactTimeframeStart = val.impactTimeStart - ? new Date(val.impactTimeStart).getTime() / 1000 - : 0; - */ - const impactTimeframeEnd = - val.impactTimeEnd !== "indefinite" && val.impactTimeEnd !== undefined - ? new Date(val.impactTimeEnd).getTime() / 1000 - : 0; - const workTimeframeStart = val.workTimeStart - ? new Date(val.workTimeStart).getTime() / 1000 - : 0; - const workTimeframeEnd = val.workTimeEnd - ? new Date(val.workTimeEnd).getTime() / 1000 - : 0; - - let properties = []; - if (val.metadataProperties) { - try { - properties = JSON.parse(val.metadataProperties); - } catch (e) { - console.warn( - `Unable to parse metadataProperties: ${val.metadataProperties}`, - ); - } - } - - return formatHypercertData({ - name: val.name, - description: val.description, - external_url: val.externalLink, - image: image ?? "", - contributors: contributorNamesAndAddresses, - workTimeframeStart, - workTimeframeEnd, - impactTimeframeStart, - impactTimeframeEnd, - workScope: workScopes, - impactScope: val.impactScopes, - rights: val.rights, - version: DEFAULT_HYPERCERT_VERSION, - properties: properties, - excludedImpactScope: [], - excludedRights: [], - excludedWorkScope: [], - }); -}; - -const exportAsImage = async (id: string) => { - const el = document.getElementById(id); - if (!el) { - return; - } - const canvas = await html2canvas(el, { - logging: true, - backgroundColor: null, - //useCORS: true, - proxy: "https://cors-proxy.hypercerts.workers.dev/", - imageTimeout: 0, - }); - const image = canvas.toDataURL("image/png", 1.0); - return image; -}; diff --git a/frontend/components/config.tsx b/frontend/components/config.tsx index 5cad0317..d2cdf24b 100644 --- a/frontend/components/config.tsx +++ b/frontend/components/config.tsx @@ -7,8 +7,8 @@ const PLASMIC_DATA_KEY = "Config"; interface ConfigData { domain: string; - chainId: number; - graphUrl: string; + chainId?: number; + graphUrl?: string; supabaseTable: string; } @@ -20,10 +20,14 @@ export interface ConfigProps { export function Config(props: ConfigProps) { const { className, children } = props; const { client: hypercertClient } = useHypercertClient(); + const chainId = hypercertClient?.config.chain?.id + ? Number(hypercertClient.config.chain.id) + : undefined; + const data: ConfigData = { domain: DOMAIN, - chainId: hypercertClient._config.chainId, - graphUrl: hypercertClient._config.graphUrl, + chainId: chainId, + graphUrl: hypercertClient?.config.graphUrl, supabaseTable: SUPABASE_TABLE, }; return ( diff --git a/frontend/components/contribution-blueprint-create.tsx b/frontend/components/contribution-blueprint-create.tsx deleted file mode 100644 index 8ca28c1a..00000000 --- a/frontend/components/contribution-blueprint-create.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { useListRegistries } from "../hooks/list-registries"; -import { Button, Divider } from "@mui/material"; -import { useState } from "react"; -import { AddRegistryDialog } from "./add-registry-dialog"; - -export const ContributionBlueprintCreate = () => { - const { data } = useListRegistries(); - const [showAddRegistryDialog, setShowAddRegistryDialog] = useState(false); - return ( -
- - {data?.map((registry: any) => ( -
-

{registry.name}

-

{registry.description}

-

{registry.owner_address}

- -
- ))} - setShowAddRegistryDialog(false)} - /> -
- ); -}; diff --git a/frontend/components/dapp-state.tsx b/frontend/components/dapp-state.tsx index 56e1947e..6b4e661a 100644 --- a/frontend/components/dapp-state.tsx +++ b/frontend/components/dapp-state.tsx @@ -1,6 +1,5 @@ import { useAccountLowerCase } from "../hooks/account"; import useCheckWriteable from "../hooks/checkWriteable"; -import { DEFAULT_CHAIN_ID } from "../lib/config"; import { claimedRecently } from "./claim-all-fractions-button"; import { PlasmicCanvasContext } from "@plasmicapp/loader-nextjs"; import { DataProvider } from "@plasmicapp/loader-nextjs"; @@ -15,7 +14,6 @@ const ALL_CHAINS = [optimism, goerli, hardhat, sepolia]; export interface DappStateData { myAddress?: string; - defaultChainId?: number; chain?: Chain; chains?: Chain[]; waitToClaim?: boolean; @@ -25,7 +23,6 @@ export interface DappStateData { //TODO revert to testnet data. Needed to override for local dev of WC-wagmi-safe integration export const DEFAULT_TEST_DATA: DappStateData = { myAddress: "0x22E4b9b003Cc7B7149CF2135dfCe2BaddC7a534f".toLowerCase(), - defaultChainId: 10, chain: optimism, chains: ALL_CHAINS, waitToClaim: false, @@ -63,7 +60,6 @@ export function DappState(props: DappStateProps) { myAddress: address, chain, chains, - defaultChainId: DEFAULT_CHAIN_ID, waitToClaim, writeable, }; diff --git a/frontend/components/hypercert-create.tsx b/frontend/components/hypercert-create.tsx index 99600560..98b37b6a 100644 --- a/frontend/components/hypercert-create.tsx +++ b/frontend/components/hypercert-create.tsx @@ -3,7 +3,7 @@ import { parseListFromString } from "../lib/parsing"; import { useConfetti } from "./confetti"; import { useContractModal } from "./contract-interaction-dialog-context"; import { DATE_INDEFINITE, DateIndefinite, FormContext } from "./forms"; -import { formatHypercertData } from "@hypercerts-org/sdk"; +import { TransferRestrictions, formatHypercertData } from "@hypercerts-org/sdk"; import { DataProvider } from "@plasmicapp/loader-nextjs"; import dayjs from "dayjs"; import { Formik, FormikProps } from "formik"; @@ -290,10 +290,12 @@ const ValidationSchema = Yup.object().shape({ export interface HypercertCreateFormProps { className?: string; // Plasmic CSS class children?: ReactNode; // Form elements + transferRestrictions: TransferRestrictions; + applicationName: string; } export function HypercertCreateForm(props: HypercertCreateFormProps) { - const { className, children } = props; + const { className, children, transferRestrictions, applicationName } = props; const { address } = useAccountLowerCase(); const { push } = useRouter(); const { hideModal } = useContractModal(); @@ -374,6 +376,7 @@ export function HypercertCreateForm(props: HypercertCreateFormProps) { values, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion address!, + applicationName, image, ); console.log(`Metadata(valid=${metaData.valid}): `, metaData.data); @@ -385,9 +388,14 @@ export function HypercertCreateForm(props: HypercertCreateFormProps) { allowlistUrl: values.allowlistUrl, allowlistPercentage: values.allowlistPercentage, deduplicate: values.deduplicateAllowlist, + transferRestrictions, }); } else { - await mintClaim(metaData.data, DEFAULT_NUM_FRACTIONS); + await mintClaim( + metaData.data, + DEFAULT_NUM_FRACTIONS, + transferRestrictions, + ); } } else { toast("Error creating hypercert. Please contact the team.", { @@ -435,6 +443,7 @@ export function HypercertCreateForm(props: HypercertCreateFormProps) { const formatValuesToMetaData = ( val: HypercertCreateFormData, address: string, + applicationName: string, image?: string, ) => { // Split contributor names and addresses. @@ -468,10 +477,16 @@ const formatValuesToMetaData = ( ? new Date(val.workTimeEnd).getTime() / 1000 : 0; - let properties = []; + let properties = [ + { + trait_type: "Minted by", + value: "true", + application: applicationName, + }, + ]; if (val.metadataProperties) { try { - properties = JSON.parse(val.metadataProperties); + properties = [...properties, ...JSON.parse(val.metadataProperties)]; } catch (e) { console.warn( `Unable to parse metadataProperties: ${val.metadataProperties}`, diff --git a/frontend/components/hypercert-fetcher.tsx b/frontend/components/hypercert-fetcher.tsx index fd3076b5..78f0da03 100644 --- a/frontend/components/hypercert-fetcher.tsx +++ b/frontend/components/hypercert-fetcher.tsx @@ -28,6 +28,7 @@ export interface HypercertFetcherProps { useQueryString?: boolean; // Forces us to try the query string first byClaimId?: string; // Fetch by claimId byMetadataUri?: string; // Fetch by metadataUri; If both are specified, byMetadataUri will override the URI in the claim + overrideChainId?: number; // Override the chainId } export function HypercertFetcher(props: HypercertFetcherProps) { @@ -40,11 +41,17 @@ export function HypercertFetcher(props: HypercertFetcherProps) { useQueryString, byClaimId, byMetadataUri, + overrideChainId, } = props; const [data, setData] = React.useState(); - const { client } = useHypercertClient(); + const { client } = useHypercertClient({ + overrideChainId, + }); React.useEffect(() => { + if (!client) { + return; + } spawn( (async () => { const hashQueryString = window.location.hash.slice( @@ -70,16 +77,16 @@ export function HypercertFetcher(props: HypercertFetcherProps) { overrideMetadataUri: useQueryString && byMetadataUri !== undefined, }); console.log( - `Hypercert name='${hypercert.name}' claimId=${claimId}, metadataUri=${hypercert.metadataUri}: `, + `Hypercert name='${hypercert.name}' claimId=${claimId}, qClaimId=${qClaimId} byClaimId=${byClaimId} metadataUri=${hypercert.metadataUri}: `, hypercert, ); setData(hypercert); })(), ); - }, [useQueryString, byClaimId, byMetadataUri]); + }, [useQueryString, byClaimId, byMetadataUri, client]); // Show when loading - if (!ignoreLoading && !!loading && !data) { + if (!client && !ignoreLoading && !!loading && !data) { return
{loading}
; } diff --git a/frontend/components/merge-all-claim-fractions-button.tsx b/frontend/components/merge-all-claim-fractions-button.tsx index f0c5d1b3..55dd5a12 100644 --- a/frontend/components/merge-all-claim-fractions-button.tsx +++ b/frontend/components/merge-all-claim-fractions-button.tsx @@ -1,5 +1,16 @@ import React from "react"; -import { Button } from "@mui/material"; +import { + Button, + Dialog, + DialogActions, + DialogContent, + DialogContentText, + DialogTitle, +} from "@mui/material"; +import { useMergeFractionUnits } from "../hooks/mergeFractionUnits"; +import { toast } from "react-toastify"; +import { useHypercertClient } from "../hooks/hypercerts-client"; +import { useAccountLowerCase } from "../hooks/account"; interface Props { claimId: string; @@ -14,13 +25,84 @@ export function MergeAllClaimFractionsButton({ className, disabled, }: Props) { + const [open, setOpen] = React.useState(false); + const { write, readOnly, txPending } = useMergeFractionUnits({}); + const { client, isLoading } = useHypercertClient(); + const { address } = useAccountLowerCase(); + const onClick = async () => { console.log("Merging all claim fractions", claimId); + setOpen(false); + if (readOnly) { + toast("Please connect your wallet to merge all claim fractions"); + return; + } + + if (isLoading) { + toast("Please wait for the client to be ready"); + return; + } + + if (!client) { + toast("Please connect your wallet to merge all claim fractions"); + return; + } + + if (!address) { + toast("Please connect your wallet to merge all claim fractions"); + return; + } + + const fractionUnits = await client.indexer.fractionsByClaim(claimId); + console.log("Fraction units", fractionUnits); + + const myFractions = fractionUnits.claimTokens.filter( + (fraction) => fraction.owner === address, + ); + + console.log("address", address); + console.log("My fractions", myFractions); + + if (!myFractions.length) { + toast("No fractions to merge"); + return; + } + + await write(myFractions.map((fraction) => fraction.tokenID)); }; + const isDisabled = disabled || txPending || readOnly || isLoading; + return ( - + <> + + setOpen(false)} + aria-labelledby="alert-dialog-title" + aria-describedby="alert-dialog-description" + > + + {"Merge all your fractions for this hypercert?"} + + + + This action cannot be reversed + + + + + + + + ); } diff --git a/frontend/components/split-fraction-button.tsx b/frontend/components/split-fraction-button.tsx index 09202758..c6321870 100644 --- a/frontend/components/split-fraction-button.tsx +++ b/frontend/components/split-fraction-button.tsx @@ -1,4 +1,24 @@ -import { Button } from "@mui/material"; +import { Box, Button, Input, Modal, Typography } from "@mui/material"; +import React, { useState } from "react"; +import { FieldArray, Form, Formik } from "formik"; +import { useFractionById } from "../hooks/fractions"; +import { PlusIcon } from "primereact/icons/plus"; +import { Delete } from "@mui/icons-material"; +import { useSplitFractionUnits } from "../hooks/splitClaimUnits"; +import { toast } from "react-toastify"; + +const style = { + position: "absolute", + top: "50%", + left: "50%", + transform: "translate(-50%, -50%)", + width: 400, + bgcolor: "background.paper", + boxShadow: 24, + pt: 2, + px: 4, + pb: 3, +}; interface Props { fractionId: string; @@ -12,13 +32,157 @@ export function SplitFractionButton({ className, disabled, }: Props) { - const onClick = async () => { - console.log("Splitting fraction", fractionId); - }; + const [open, setOpen] = useState(false); + const handleOpen = () => setOpen(true); + const handleClose = () => setOpen(false); + + const { write, readOnly, txPending } = useSplitFractionUnits({ + onComplete: () => { + toast("Splitting fraction completed"); + handleClose(); + }, + }); + + const { data, isLoading } = useFractionById(fractionId); + + console.log(data, isLoading); + + if (isLoading || !data?.claimToken) { + return null; + } + + const totalValue = parseInt(data.claimToken.units, 10); + + const _disabled = txPending || readOnly || isLoading || disabled; return ( - + <> + + + + + Split up your fraction + + + Make sure the total value of the fractions is equal to the original + + { + if (!values.units.length) { + return { units: "Required" }; + } + const totalValueInForm = values.units.reduce( + (sum, value) => sum + value, + 0, + ); + + if (totalValueInForm !== totalValue) { + return { + units: "Total value must be equal to the original value", + }; + } + }} + onSubmit={async (values) => { + const tokenId = data.claimToken?.tokenID; + if (!tokenId) { + return; + } + await write( + BigInt(tokenId), + values.units.map((x) => BigInt(x)), + ); + }} + > + {({ values, errors, setFieldValue, isValid, isSubmitting }) => { + const isDisabled = _disabled || isSubmitting; + return ( +
+ ( +
+ {values.units && values.units.length > 0 ? ( + values.units.map((unit, index) => ( +
+ {/**/} + + setFieldValue( + `units.${index}`, + isNaN(parseInt(e.target.value)) + ? 0 + : parseInt(e.target.value), + ) + } + /> + + + + +
+ )) + ) : ( + + )} + {errors.units && ( +
{errors.units as string}
+ )} + +
+ +
+
+ )} + /> + + ); + }} +
+
+
+ ); } diff --git a/frontend/components/transfer-fraction-button.tsx b/frontend/components/transfer-fraction-button.tsx new file mode 100644 index 00000000..12d0dfdf --- /dev/null +++ b/frontend/components/transfer-fraction-button.tsx @@ -0,0 +1,249 @@ +import { + Box, + Button, + Dialog, + DialogActions, + DialogContent, + DialogContentText, + DialogTitle, + IconButton, + Modal, + TextField, + Typography, +} from "@mui/material"; +import { Send } from "@mui/icons-material"; +import React, { useState } from "react"; +import { useTransferFraction } from "../hooks/transferFraction"; +import { Form, Formik } from "formik"; +import { isAddress } from "viem"; +import { useClaimById, useFractionById } from "../hooks/fractions"; +import { useAccountLowerCase } from "../hooks/account"; +import { formatAddress } from "../lib/formatting"; +import { TransferRestrictions } from "@hypercerts-org/sdk"; +import { useReadTransferRestrictions } from "../hooks/readTransferRestriction"; + +const style = { + position: "absolute", + top: "50%", + left: "50%", + transform: "translate(-50%, -50%)", + width: 400, + bgcolor: "background.paper", + boxShadow: 24, + pt: 2, + px: 4, + pb: 3, +}; + +interface Props { + fractionId: string; + text?: string; + disabled?: boolean; + className?: string; +} +export function TransferFractionButton({ + fractionId, + text, + className, + disabled, +}: Props) { + const [open, setOpen] = useState(false); + const handleOpen = () => setOpen(true); + const handleClose = () => setOpen(false); + const { address } = useAccountLowerCase(); + + const { write, readOnly, txPending } = useTransferFraction({ + onComplete: () => { + handleClose(); + }, + }); + + const [dialogOpen, setDialogOpen] = React.useState(false); + + const handleDialogOpen = () => { + setDialogOpen(true); + }; + + const handleDialogClose = () => { + setDialogOpen(false); + }; + + const { data: fractionData, isLoading: isLoadingFraction } = + useFractionById(fractionId); + + const { data: claim, isLoading: isLoadingClaim } = useClaimById( + fractionData?.claimToken?.claim.id, + ); + + const { + data: transferRestrictions, + isLoading: isLoadingTransferRestrictions, + } = useReadTransferRestrictions(claim?.claim?.tokenID); + + const determineCanTransfer = () => { + if (!address) { + return false; + } + + if (!transferRestrictions) { + return false; + } + + if (!(fractionData?.claimToken?.owner === address)) { + return false; + } + + if (!(transferRestrictions in TransferRestrictions)) { + return false; + } + + const transferRestrictionValue = + TransferRestrictions[ + transferRestrictions as keyof typeof TransferRestrictions + ]; + + if (transferRestrictionValue === TransferRestrictions.DisallowAll) { + return false; + } + + if (transferRestrictionValue === TransferRestrictions.AllowAll) { + return true; + } + + if (transferRestrictionValue === TransferRestrictions.FromCreatorOnly) { + return claim?.claim?.creator === address; + } + + return false; + }; + + const canTransfer = determineCanTransfer(); + + const tokenId = fractionId.split("-")[1]; + const _disabled = + txPending || + readOnly || + disabled || + isLoadingFraction || + isLoadingClaim || + isLoadingTransferRestrictions; + + if (!canTransfer) { + return null; + } + + return ( + <> + { + console.log({ + fractionId, + text, + className, + disabled, + }); + handleOpen(); + }} + > + + + + + { + if (!values.to || values.to === "") { + return { to: "Required" }; + } + + if (!isAddress(values.to)) { + return { to: "Invalid address" }; + } + }} + onSubmit={() => { + handleDialogOpen(); + }} + > + {({ isSubmitting, isValid, setFieldValue, errors, values }) => { + const isDisabled = _disabled || isSubmitting; + return ( + <> +
+ + Transfer this fraction + + { + setFieldValue("to", e.target.value); + }} + /> + + {" "} + + + Are you sure you want to transfer? + + + + Transferring to {formatAddress(values.to)}. This action + cannot be reversed. + + + + + + + + + ); + }} +
+
+
+ + ); +} diff --git a/frontend/hooks/burnFraction.ts b/frontend/hooks/burnFraction.ts index 2c28bf11..277d0632 100644 --- a/frontend/hooks/burnFraction.ts +++ b/frontend/hooks/burnFraction.ts @@ -31,19 +31,30 @@ export const useBurnFraction = ({ setStep("burning"); - const tx = await client.burnClaimFraction(claimId); + if (!client) { + toast("No client found", { + type: "error", + }); + return; + } - setStep("waiting"); + const hash = await client.burnClaimFraction(claimId); - const receipt = await tx.wait(5); + const publicClient = client.config.publicClient; + const receipt = await publicClient?.waitForTransactionReceipt({ + confirmations: 3, + hash: hash, + }); + + setStep("waiting"); - if (receipt.status === 0) { + if (receipt?.status === "reverted") { toast("Burning failed", { type: "error", }); console.error(receipt); } - if (receipt.status === 1) { + if (receipt?.status === "success") { toast(burnInteractionLabels.toastSuccess(receipt.transactionHash), { type: "success", }); diff --git a/frontend/hooks/claims.ts b/frontend/hooks/claims.ts deleted file mode 100644 index fd57ad34..00000000 --- a/frontend/hooks/claims.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { QueryParams } from "@hypercerts-org/sdk"; -import { useQuery } from "@tanstack/react-query"; -import { useHypercertClient } from "./hypercerts-client"; - -export const useClaimMetadata = (cid?: string | null) => { - const { - client: { storage }, - } = useHypercertClient(); - return useQuery( - ["ipfs", "claim", "metadata", cid], - () => (cid ? storage.getMetadata(cid) : null), - { enabled: !!cid, refetchInterval: 10000 }, - ); -}; - -export const useListFirstClaims = (params?: QueryParams) => { - const { - client: { indexer }, - } = useHypercertClient(); - return useQuery(["firstClaims"], () => indexer.firstClaims(params), { - refetchInterval: 10000, - }); -}; diff --git a/frontend/hooks/fractions.ts b/frontend/hooks/fractions.ts index b7482831..5103e39b 100644 --- a/frontend/hooks/fractions.ts +++ b/frontend/hooks/fractions.ts @@ -2,38 +2,68 @@ import { useHypercertClient } from "./hypercerts-client"; import { useQuery } from "@tanstack/react-query"; export const useFractionsByOwner = (owner: string) => { - const { - client: { indexer }, - } = useHypercertClient(); + const { client } = useHypercertClient(); return useQuery( ["graph", "fractions", "owner", owner], - () => indexer.fractionsByOwner(owner), + () => { + if (!client) return null; + return client.indexer.fractionsByOwner(owner); + }, { enabled: !!owner, refetchInterval: 5000 }, ); }; export const useFractionsByClaim = (claimId: string) => { - const { - client: { indexer }, - } = useHypercertClient(); - - return ( - useQuery(["graph", "fractions", "claim", claimId], () => - indexer.fractionsByClaim(claimId), - ), - { enabled: !!claimId, refetchInterval: 5000 } + const { client } = useHypercertClient(); + + return useQuery( + ["graph", "fractions", "claim", claimId], + () => { + if (!client) return null; + return client.indexer.fractionsByClaim(claimId); + }, + { enabled: !!claimId, refetchInterval: 5000 }, ); }; export const useFractionById = (fractionId: string) => { - const { - client: { indexer }, - } = useHypercertClient(); + const { client } = useHypercertClient(); return useQuery( ["graph", "fractions", fractionId], - () => indexer.fractionById(fractionId), - { enabled: !!fractionId, refetchInterval: 5000 }, + () => { + if (!client) return null; + return client.indexer.fractionById(fractionId); + }, + { enabled: !!fractionId }, + ); +}; + +export const useClaimById = (claimId?: string | null) => { + const { client } = useHypercertClient(); + + return useQuery( + ["graph", "claims", claimId], + () => { + if (!client) return null; + if (!claimId) return null; + return client.indexer.claimById(claimId); + }, + { enabled: !!claimId && !!client }, + ); +}; + +export const useClaimMetadataByUri = (uri?: string | null) => { + const { client } = useHypercertClient(); + + return useQuery( + ["graph", "claim-metadata", uri], + () => { + if (!client) return null; + if (!uri) return null; + return client.storage.getMetadata(uri); + }, + { enabled: !!uri && !!client }, ); }; diff --git a/frontend/hooks/hypercerts-client.ts b/frontend/hooks/hypercerts-client.ts index f616ab5c..4ca52dda 100644 --- a/frontend/hooks/hypercerts-client.ts +++ b/frontend/hooks/hypercerts-client.ts @@ -1,82 +1,46 @@ -import React, { useEffect, useMemo } from "react"; +import React, { useEffect } from "react"; -import { - DEFAULT_CHAIN_ID, - NFT_STORAGE_TOKEN, - WEB3_STORAGE_TOKEN, - OVERRIDE_CHAIN_NAME, - OVERRIDE_GRAPH_URL, - CONTRACT_ADDRESS, - UNSAFE_FORCE_OVERRIDE_CONFIG, -} from "../lib/config"; +import { NFT_STORAGE_TOKEN, WEB3_STORAGE_TOKEN } from "../lib/config"; import { HypercertClient, HypercertClientConfig } from "@hypercerts-org/sdk"; -import { providers } from "ethers"; -import { type WalletClient, useWalletClient, useNetwork } from "wagmi"; +import { useWalletClient, useNetwork } from "wagmi"; -const clientConfig: Partial = { - chainId: DEFAULT_CHAIN_ID, - nftStorageToken: NFT_STORAGE_TOKEN, - web3StorageToken: WEB3_STORAGE_TOKEN, -}; - -function loadOverridingConfig(clientConfig: Partial) { - if (OVERRIDE_CHAIN_NAME) { - clientConfig.chainName = OVERRIDE_CHAIN_NAME; - } - - if (OVERRIDE_GRAPH_URL) { - clientConfig.graphUrl = OVERRIDE_GRAPH_URL; - } - - if (CONTRACT_ADDRESS) { - clientConfig.contractAddress = CONTRACT_ADDRESS; - } - - if (UNSAFE_FORCE_OVERRIDE_CONFIG) { - clientConfig.unsafeForceOverrideConfig = UNSAFE_FORCE_OVERRIDE_CONFIG; - } -} -loadOverridingConfig(clientConfig); - -const defaultClient = new HypercertClient(clientConfig); - -const walletClientToSigner = (walletClient: WalletClient) => { - const { account, chain, transport } = walletClient; - const network = { - chainId: chain.id, - name: chain.name, - ensAddress: chain.contracts?.ensRegistry?.address, - }; - const provider = new providers.Web3Provider(transport, network); - const signer = provider.getSigner(account.address); - return signer; -}; - -const useEthersSigner = ({ chainId }: { chainId?: number } = {}) => { - const { data: walletClient } = useWalletClient({ chainId }); - return useMemo( - () => (walletClient ? walletClientToSigner(walletClient) : undefined), - [walletClient], - ); -}; - -export const useHypercertClient = () => { +export const useHypercertClient = ({ + overrideChainId, +}: { + overrideChainId?: number; +} = {}) => { const { chain } = useNetwork(); - const signer = useEthersSigner({ chainId: chain?.id }); - - const [client, setClient] = React.useState(defaultClient); + const clientConfig = { + chain: overrideChainId ? { id: overrideChainId } : chain, + nftStorageToken: NFT_STORAGE_TOKEN, + web3StorageToken: WEB3_STORAGE_TOKEN, + }; + const [client, setClient] = React.useState(() => { + if (clientConfig.chain?.id) { + return new HypercertClient(clientConfig); + } + return null; + }); const [isLoading, setIsLoading] = React.useState(false); + const { + data: walletClient, + isError, + isLoading: walletClientLoading, + } = useWalletClient(); + useEffect(() => { - if (chain?.id && signer) { + const chainId = overrideChainId || chain?.id; + if (chainId && !walletClientLoading && !isError && walletClient) { setIsLoading(true); - const config = { - chainId: chain.id, - operator: signer, - }; - loadOverridingConfig(config); try { + const config: Partial = { + ...clientConfig, + chain: { id: chainId }, + walletClient, + }; + const client = new HypercertClient(config); setClient(client); } catch (e) { @@ -85,7 +49,7 @@ export const useHypercertClient = () => { } setIsLoading(false); - }, [chain?.id, signer]); + }, [chain?.id, overrideChainId, walletClient, walletClientLoading]); return { client, isLoading }; }; diff --git a/frontend/hooks/mergeFractionUnits.ts b/frontend/hooks/mergeFractionUnits.ts index 2ebf4b8a..2a1e131b 100644 --- a/frontend/hooks/mergeFractionUnits.ts +++ b/frontend/hooks/mergeFractionUnits.ts @@ -29,18 +29,30 @@ export const useMergeFractionUnits = ({ try { setTxPending(true); - const tx = await client.mergeClaimUnits(ids); + if (!client) { + toast("No client found", { + type: "error", + }); + return; + } + + const hash = await client.mergeFractionUnits(ids); + + const publicClient = client.config.publicClient; + const receipt = await publicClient?.waitForTransactionReceipt({ + confirmations: 3, + hash: hash, + }); setStep("waiting"); - const receipt = await tx.wait(5); - if (receipt.status === 0) { + if (receipt?.status === "reverted") { toast("Merging failed", { type: "error", }); console.error(receipt); } - if (receipt.status === 1) { - toast(mintInteractionLabels.toastSuccess, { type: "success" }); + if (receipt?.status === "success") { + toast("Fractions successfully merged", { type: "success" }); setStep("complete"); onComplete?.(); @@ -61,6 +73,7 @@ export const useMergeFractionUnits = ({ showModal({ stepDescriptions }); setStep("preparing"); await initializeWrite(ids); + window.location.reload(); }, txPending, readOnly: isLoading || !client || client.readonly, diff --git a/frontend/hooks/mintClaim.ts b/frontend/hooks/mintClaim.ts index 4b152f5d..75cbbf8c 100644 --- a/frontend/hooks/mintClaim.ts +++ b/frontend/hooks/mintClaim.ts @@ -24,26 +24,40 @@ export const useMintClaim = ({ onComplete }: { onComplete?: () => void }) => { const initializeWrite = async ( metaData: HypercertMetadata, units: number, + transferRestrictions: TransferRestrictions, ) => { setStep("minting"); try { setTxPending(true); - const tx = await client.mintClaim( + if (!client) { + toast("No client found", { + type: "error", + }); + return; + } + + const hash = await client.mintClaim( metaData, - units, - TransferRestrictions.FromCreatorOnly, + BigInt(units), + transferRestrictions, ); + + const receipt = + await client.config.publicClient?.waitForTransactionReceipt({ + confirmations: 3, + hash: hash, + }); + setStep("waiting"); - const receipt = await tx.wait(5); - if (receipt.status === 0) { + if (receipt?.status === "reverted") { toast("Minting failed", { type: "error", }); console.error(receipt); } - if (receipt.status === 1) { + if (receipt?.status === "success") { toast(mintInteractionLabels.toastSuccess, { type: "success" }); setStep("complete"); @@ -61,10 +75,14 @@ export const useMintClaim = ({ onComplete }: { onComplete?: () => void }) => { }; return { - write: async (metaData: HypercertMetadata, units: number) => { + write: async ( + metaData: HypercertMetadata, + units: number, + transferRestrictions: TransferRestrictions = TransferRestrictions.FromCreatorOnly, + ) => { showModal({ stepDescriptions }); setStep("preparing"); - await initializeWrite(metaData, units); + await initializeWrite(metaData, units, transferRestrictions); }, txPending, readOnly: isLoading || !client || client.readonly, diff --git a/frontend/hooks/mintClaimAllowlist.ts b/frontend/hooks/mintClaimAllowlist.ts index 45debc0b..6d8343e7 100644 --- a/frontend/hooks/mintClaimAllowlist.ts +++ b/frontend/hooks/mintClaimAllowlist.ts @@ -84,9 +84,17 @@ export const useMintClaimAllowlist = ({ allowlistUrl: string, allowlistPercentage: number, deduplicate: boolean, + transferRestrictions: TransferRestrictions, ) => { setStep("validateAllowlist"); + if (!client) { + toast("No client found", { + type: "error", + }); + return; + } + let _totalSupply; let _allowlist: AllowlistEntry[]; @@ -121,22 +129,28 @@ export const useMintClaimAllowlist = ({ setStep("preparing"); setTxPending(true); - const tx = await client.createAllowlist( + const hash = await client.createAllowlist( _allowlist, metaData, _totalSupply, - TransferRestrictions.FromCreatorOnly, + transferRestrictions, ); + + const publicClient = client.config.publicClient; + const receipt = await publicClient?.waitForTransactionReceipt({ + confirmations: 3, + hash: hash, + }); + setStep("writing"); - const receipt = await tx.wait(5); - if (receipt.status === 0) { + if (receipt?.status === "reverted") { toast("Minting failed", { type: "error", }); console.error(receipt); } - if (receipt.status === 1) { + if (receipt?.status === "success") { toast(mintInteractionLabels.toastSuccess, { type: "success" }); setStep("complete"); @@ -159,11 +173,13 @@ export const useMintClaimAllowlist = ({ allowlistUrl, allowlistPercentage, deduplicate, + transferRestrictions = TransferRestrictions.FromCreatorOnly, }: { metaData: HypercertMetadata; allowlistUrl: string; allowlistPercentage: number; deduplicate: boolean; + transferRestrictions?: TransferRestrictions; }) => { showModal({ stepDescriptions }); await initializeWrite( @@ -171,6 +187,7 @@ export const useMintClaimAllowlist = ({ allowlistUrl, allowlistPercentage, deduplicate, + transferRestrictions, ); }, txPending, diff --git a/frontend/hooks/mintFractionAllowlist.ts b/frontend/hooks/mintFractionAllowlist.ts index 09cd0ff5..f02a6980 100644 --- a/frontend/hooks/mintFractionAllowlist.ts +++ b/frontend/hooks/mintFractionAllowlist.ts @@ -15,6 +15,7 @@ export const useMintFractionAllowlist = ({ const [txPending, setTxPending] = useState(false); const { client, isLoading } = useHypercertClient(); + const { setStep, showModal, hideModal } = useContractModal(); const stepDescriptions = { @@ -29,27 +30,40 @@ export const useMintFractionAllowlist = ({ const initializeWrite = async ( claimID: bigint, units: bigint, - proof: string[], + proof: `0x${string}`[], ) => { setStep("minting"); try { setTxPending(true); - const tx = await client.mintClaimFractionFromAllowlist( + if (!client) { + toast("No client found", { + type: "error", + }); + return; + } + + const hash = await client.mintClaimFractionFromAllowlist( claimID, units, proof, ); + + const publicClient = client.config.publicClient; + const receipt = await publicClient?.waitForTransactionReceipt({ + confirmations: 3, + hash: hash, + }); + setStep("waiting"); - const receipt = await tx.wait(5); - if (receipt.status === 0) { + if (receipt?.status === "reverted") { toast("Minting failed", { type: "error", }); console.error(receipt); } - if (receipt.status === 1) { + if (receipt?.status === "success") { toast(mintInteractionLabels.toastSuccess, { type: "success" }); setStep("complete"); @@ -67,7 +81,7 @@ export const useMintFractionAllowlist = ({ }; return { - write: async (proof: string[], claimId: bigint, units: bigint) => { + write: async (proof: `0x${string}`[], claimId: bigint, units: bigint) => { showModal({ stepDescriptions }); setStep("initial"); await initializeWrite(claimId, units, proof); diff --git a/frontend/hooks/mintFractionAllowlistBatch.ts b/frontend/hooks/mintFractionAllowlistBatch.ts index e1c65c71..0b31564b 100644 --- a/frontend/hooks/mintFractionAllowlistBatch.ts +++ b/frontend/hooks/mintFractionAllowlistBatch.ts @@ -36,6 +36,9 @@ export const useMintFractionAllowlistBatch = ({ }; const initializeWrite = async () => { + if (!client) { + throw new Error("No client found"); + } if (!address) { throw new Error("No address found for current user"); } @@ -56,7 +59,9 @@ export const useMintFractionAllowlistBatch = ({ const verified: ClaimProof[] = results.flat().filter((x) => x); const unique = _.uniqWith(verified, _.isEqual); - const claimIDs = unique.map((claimProof) => claimProof.claimIDContract); + const claimIDs = unique.map((claimProof) => + BigInt(claimProof.claimIDContract), + ); const units = unique.map((claimProof) => BigInt(claimProof.units)); const proofs = unique.map((claimProof) => claimProof.proof as HexString[]); @@ -69,21 +74,26 @@ export const useMintFractionAllowlistBatch = ({ try { setTxPending(true); - const tx = await client.batchMintClaimFractionsFromAllowlists( + const hash = await client.batchMintClaimFractionsFromAllowlists( claimIDs, units, proofs, ); + + const publicClient = client.config.publicClient; + const receipt = await publicClient?.waitForTransactionReceipt({ + confirmations: 3, + hash: hash, + }); setStep("waiting"); - const receipt = await tx.wait(5); - if (receipt.status === 0) { + if (receipt?.status === "reverted") { toast("Minting failed", { type: "error", }); console.error(receipt); } - if (receipt.status === 1) { + if (receipt?.status === "success") { toast(mintInteractionLabels.toastSuccess, { type: "success" }); setStep("complete"); diff --git a/frontend/hooks/readTransferRestriction.ts b/frontend/hooks/readTransferRestriction.ts new file mode 100644 index 00000000..8133140c --- /dev/null +++ b/frontend/hooks/readTransferRestriction.ts @@ -0,0 +1,28 @@ +import { useHypercertClient } from "./hypercerts-client"; +import { useWalletClient } from "wagmi"; +import { useQuery } from "@tanstack/react-query"; +import { readContract } from "viem/actions"; + +export const useReadTransferRestrictions = (tokenId?: bigint) => { + const { client } = useHypercertClient(); + const { data: walletClient } = useWalletClient(); + + return useQuery( + ["read-transfer-restrictions", tokenId], + async () => { + if (!client) return null; + if (!tokenId) return null; + if (!walletClient) return null; + const contract = client.contract; + + if (!contract) return null; + + return (await readContract(walletClient, { + ...contract, + functionName: "readTransferRestriction", + args: [tokenId], + })) as string; + }, + { enabled: !!tokenId && !!client }, + ); +}; diff --git a/frontend/hooks/splitClaimUnits.ts b/frontend/hooks/splitClaimUnits.ts index 47cd4859..e1688969 100644 --- a/frontend/hooks/splitClaimUnits.ts +++ b/frontend/hooks/splitClaimUnits.ts @@ -15,8 +15,7 @@ export const useSplitFractionUnits = ({ const { client, isLoading } = useHypercertClient(); const stepDescriptions = { - preparing: "Preparing to merge fraction values", - merging: "Splitting fraction units on-chain", + splitting: "Splitting fraction units on-chain", waiting: "Awaiting confirmation", complete: "Done splitting", }; @@ -24,22 +23,34 @@ export const useSplitFractionUnits = ({ const { setStep, showModal, hideModal } = useContractModal(); const parseError = useParseBlockchainError(); - const initializeWrite = async (id: bigint, fractions: bigint[]) => { + const initializeWrite = async (fractionId: bigint, fractions: bigint[]) => { + if (!client) { + toast("No client found", { + type: "error", + }); + return; + } + showModal({ stepDescriptions }); setStep("splitting"); try { setTxPending(true); - const tx = await client.splitClaimUnits(id, fractions); + const hash = await client.splitFractionUnits(fractionId, fractions); + setStep("waiting"); + const publicClient = client.config.publicClient; + const receipt = await publicClient?.waitForTransactionReceipt({ + confirmations: 3, + hash: hash, + }); - const receipt = await tx.wait(5); - if (receipt.status === 0) { + if (receipt?.status === "reverted") { toast("Splitting failed", { type: "error", }); console.error(receipt); } - if (receipt.status === 1) { + if (receipt?.status === "success") { toast(mintInteractionLabels.toastSuccess, { type: "success" }); setStep("complete"); @@ -58,9 +69,8 @@ export const useSplitFractionUnits = ({ return { write: async (id: bigint, fractions: bigint[]) => { - showModal({ stepDescriptions }); - setStep("preparing"); await initializeWrite(id, fractions); + window.location.reload(); }, txPending, readOnly: isLoading || !client || client.readonly, diff --git a/frontend/hooks/transferFraction.ts b/frontend/hooks/transferFraction.ts new file mode 100644 index 00000000..e8d1509a --- /dev/null +++ b/frontend/hooks/transferFraction.ts @@ -0,0 +1,102 @@ +import { useContractModal } from "../components/contract-interaction-dialog-context"; +import { useParseBlockchainError } from "../lib/parse-blockchain-error"; +import { toast } from "react-toastify"; +import { useHypercertClient } from "./hypercerts-client"; +import { useState } from "react"; +import { waitForTransactionReceipt, writeContract } from "viem/actions"; +import { useAccount, useWalletClient } from "wagmi"; + +export const useTransferFraction = ({ + onComplete, +}: { + onComplete?: () => void; +}) => { + const [txPending, setTxPending] = useState(false); + + const { client, isLoading } = useHypercertClient(); + const { data: walletClient } = useWalletClient(); + const { address } = useAccount(); + + const stepDescriptions = { + transferring: "Transferring", + waiting: "Awaiting confirmation", + complete: "Done splitting", + }; + + const { setStep, showModal, hideModal } = useContractModal(); + const parseError = useParseBlockchainError(); + + const initializeWrite = async (fractionId: bigint, to: string) => { + if (!client) { + toast("No client found", { + type: "error", + }); + return; + } + + if (!walletClient) { + toast("No wallet client found", { + type: "error", + }); + return; + } + + if (!address) { + toast("No address found", { + type: "error", + }); + return; + } + + const hypercertMinterContract = client.contract; + + showModal({ stepDescriptions }); + setStep("transferring"); + try { + setTxPending(true); + const tx = await writeContract(walletClient, { + ...hypercertMinterContract, + functionName: "safeTransferFrom", + args: [address, to, fractionId, 1, ""], + }); + setStep("waiting"); + const receipt = await waitForTransactionReceipt(walletClient, { + hash: tx, + }); + + if (receipt?.status === "reverted") { + toast("Splitting failed", { + type: "error", + }); + console.error(receipt); + } + if (receipt?.status === "success") { + toast("Fraction successfully sent", { type: "success" }); + + setStep("complete"); + onComplete?.(); + } + } catch (error) { + toast(parseError(error, "Fraction could not be sent"), { + type: "error", + }); + console.error(error); + } finally { + hideModal(); + setTxPending(false); + } + }; + + return { + write: async (id: bigint, to: string) => { + try { + await initializeWrite(id, to); + window.location.reload(); + } catch (e) { + console.error(e); + } + }, + txPending, + readOnly: isLoading || !client || client.readonly, + }; +}; diff --git a/frontend/hooks/verifyFractionClaim.ts b/frontend/hooks/verifyFractionClaim.ts index 14fbb5c1..bf366e9f 100644 --- a/frontend/hooks/verifyFractionClaim.ts +++ b/frontend/hooks/verifyFractionClaim.ts @@ -8,18 +8,19 @@ export type ClaimProof = { }; export const useVerifyFractionClaim = () => { - const { - client: { indexer, storage }, - } = useHypercertClient(); + const { client } = useHypercertClient(); const verifyFractionClaim = async (claimId: string, address: string) => { - const claimByIdRes = await indexer.claimById(claimId); + if (!client) { + throw new Error("No client found"); + } + const claimByIdRes = await client.indexer.claimById(claimId); if (!claimByIdRes?.claim) { throw new Error("No claim found for ${claimID}"); } const { uri, tokenID: _id } = claimByIdRes.claim; - const metadata = await storage.getMetadata(uri || ""); + const metadata = await client.storage.getMetadata(uri || ""); if (!metadata?.allowList) { throw new Error(`No allowlist found for ${claimId}`); @@ -27,7 +28,7 @@ export const useVerifyFractionClaim = () => { // TODO: this should be retrieved with `getData`, but it fails on res.files() // Need to investigate further - const treeResponse = await storage.getData(metadata.allowList); + const treeResponse = await client.storage.getData(metadata.allowList); if (!treeResponse) { throw new Error("Could not fetch json tree dump for allowlist"); diff --git a/frontend/lib/config.ts b/frontend/lib/config.ts index a30134c6..f412dd0f 100644 --- a/frontend/lib/config.ts +++ b/frontend/lib/config.ts @@ -12,15 +12,6 @@ export const DOMAIN = requireEnv( export const isProduction = DOMAIN === "hypercerts.org"; -export const DEFAULT_CHAIN_ID = parseInt( - requireEnv( - process.env.NEXT_PUBLIC_DEFAULT_CHAIN_ID, - "NEXT_PUBLIC_DEFAULT_CHAIN_ID", - ), -); - -export const CONTRACT_ADDRESS = process.env.NEXT_PUBLIC_CONTRACT_ADDRESS; - export const NFT_STORAGE_TOKEN = requireEnv( process.env.NEXT_PUBLIC_NFT_STORAGE_TOKEN, "NEXT_PUBLIC_NFT_STORAGE_TOKEN", @@ -53,7 +44,3 @@ export const SUPABASE_TABLE = requireEnv( export const UNSAFE_FORCE_OVERRIDE_CONFIG = process.env.NEXT_PUBLIC_UNSAFE_FORCE_OVERRIDE_CONFIG == "1"; - -export const OVERRIDE_CHAIN_NAME = process.env.NEXT_PUBLIC_CHAIN_NAME; - -export const OVERRIDE_GRAPH_URL = process.env.NEXT_PUBLIC_GRAPH_URL; diff --git a/frontend/lib/formatting.ts b/frontend/lib/formatting.ts index ddf4215d..260f7c39 100644 --- a/frontend/lib/formatting.ts +++ b/frontend/lib/formatting.ts @@ -1,5 +1,4 @@ import _ from "lodash"; -import { HypercertClient } from "@hypercerts-org/sdk"; export const formatScope = (scopeLabel: string) => scopeLabel.toLowerCase().replaceAll(/\s+/g, "-").trim(); @@ -74,10 +73,13 @@ export const formatAddress = (address: string) => export const cidToIpfsUri = (cid: string) => cid.startsWith("ipfs://") ? cid : `ipfs://${cid}`; -export const formatExternalUrl = ( - client: HypercertClient, - externalUrl?: string, -) => { +const getIpfsGatewayUri = (cidOrIpfsUri: string) => { + const NFT_STORAGE_IPFS_GATEWAY = "https://nftstorage.link/ipfs/{cid}"; + const cid = cidOrIpfsUri.replace("ipfs://", ""); + return NFT_STORAGE_IPFS_GATEWAY.replace("{cid}", cid); +}; + +export const formatExternalUrl = (externalUrl?: string) => { if (!externalUrl) { return ""; } @@ -85,7 +87,5 @@ export const formatExternalUrl = ( return externalUrl; } - return client.storage.getNftStorageGatewayUri( - externalUrl.replace("ipfs://", ""), - ); + return getIpfsGatewayUri(externalUrl); }; diff --git a/frontend/lib/hypercert.test.ts b/frontend/lib/hypercert.test.ts index 7920637b..a2d4c549 100644 --- a/frontend/lib/hypercert.test.ts +++ b/frontend/lib/hypercert.test.ts @@ -23,7 +23,7 @@ function genClaimTokens( id: id, tokenID: tokenID, owner: owner, - chainName: options?.chainName ?? "test", + graphName: options?.chainName ?? "test", units: options?.units ?? "100", }); } @@ -37,7 +37,7 @@ function genClaim(totalUnits: string): Claim { contract: randomAddress(), tokenID: randomTokenID(), totalUnits: totalUnits, - chainName: "test", + graphName: "test", }; } diff --git a/frontend/lib/hypercert.ts b/frontend/lib/hypercert.ts index fd4eb87e..379d7837 100644 --- a/frontend/lib/hypercert.ts +++ b/frontend/lib/hypercert.ts @@ -27,6 +27,7 @@ export async function loadHypercert( client: HypercertClient, options: LoadOptions, ): Promise { + console.log("Options: ", options); if (options.claimId) { const claimQueryResp = await client.indexer.claimById(options.claimId); const claimTokensQueryResp = await client.indexer.fractionsByClaim( @@ -42,10 +43,7 @@ export async function loadHypercert( const metadata = await client.storage.getMetadata(metadataUri); hypercert.metadata = { ...metadata, - external_url_formatted: formatExternalUrl( - client, - metadata.external_url, - ), + external_url_formatted: formatExternalUrl(metadata.external_url), }; } return hypercert; @@ -54,10 +52,7 @@ export async function loadHypercert( const metadata = await client.storage.getMetadata(options.metadataUri); return new MetadataOnlyHypercert(options.metadataUri, { ...metadata, - external_url_formatted: formatExternalUrl( - client, - metadata.external_url, - ), + external_url_formatted: formatExternalUrl(metadata.external_url), }); } throw new Error( diff --git a/frontend/lib/parse-blockchain-error.ts b/frontend/lib/parse-blockchain-error.ts index 1f28a411..8c169066 100644 --- a/frontend/lib/parse-blockchain-error.ts +++ b/frontend/lib/parse-blockchain-error.ts @@ -1,19 +1,20 @@ import { errorMessages } from "../content/readable-errors"; -import { useHypercertClient } from "../hooks/hypercerts-client"; +import { decodeErrorResult } from "viem"; +import { HypercertMinterAbi } from "@hypercerts-org/contracts"; export const useParseBlockchainError = () => { - const { - client: { contract }, - } = useHypercertClient(); return (e: any, fallbackMessage: string) => { const unparsedErrorData = e?.error?.data?.originalError?.data; if (unparsedErrorData) { - const errorData = contract?.interface?.parseError(unparsedErrorData); + const errorData = decodeErrorResult({ + abi: HypercertMinterAbi, + data: unparsedErrorData, + }); if (errorData) { console.log("Blockchain error", errorData); - const errorName = errorData.errorFragment.name; + const errorName = errorData.errorName; return errorMessages[errorName] || errorName; } } diff --git a/frontend/lib/parsing.test.ts b/frontend/lib/parsing.test.ts index 2b14fe6f..f98ec4d1 100644 --- a/frontend/lib/parsing.test.ts +++ b/frontend/lib/parsing.test.ts @@ -11,9 +11,9 @@ describe("allowlist", () => { true, ); expect(resultDeduped).toEqual([ - { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 100 }, - { address: "0x15c7281842a45465b4cbb8f89111d99e36e5bab8", units: 50 }, - { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 40 }, + { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 100n }, + { address: "0x15c7281842a45465b4cbb8f89111d99e36e5bab8", units: 50n }, + { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 40n }, ]); const resultNotDeduped = parseAllowlistCsv( @@ -25,9 +25,9 @@ describe("allowlist", () => { false, ); expect(resultNotDeduped).toEqual([ - { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 100 }, - { address: "0x15c7281842a45465b4cbb8f89111d99e36e5bab8", units: 50 }, - { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 40 }, + { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 100n }, + { address: "0x15c7281842a45465b4cbb8f89111d99e36e5bab8", units: 50n }, + { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 40n }, ]); }); @@ -43,9 +43,9 @@ describe("allowlist", () => { true, ); expect(result).toEqual([ - { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 200 }, - { address: "0x15c7281842a45465b4cbb8f89111d99e36e5bab8", units: 50 }, - { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 80 }, + { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 200n }, + { address: "0x15c7281842a45465b4cbb8f89111d99e36e5bab8", units: 50n }, + { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 80n }, ]); }); @@ -61,11 +61,11 @@ describe("allowlist", () => { false, ); expect(result).toEqual([ - { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 100 }, - { address: "0x15c7281842a45465b4cbb8f89111d99e36e5bab8", units: 50 }, - { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 40 }, - { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 100 }, - { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 40 }, + { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 100n }, + { address: "0x15c7281842a45465b4cbb8f89111d99e36e5bab8", units: 50n }, + { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 40n }, + { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 100n }, + { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 40n }, ]); }); @@ -85,10 +85,10 @@ describe("allowlist", () => { ], ); expect(result).toEqual([ - { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 100 }, - { address: "0x15c7281842a45465b4cbb8f89111d99e36e5bab8", units: 50 }, - { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 40 }, - { address: "0x22e4b9b003cc7b7149cf2135dfce2baddc7a534f", units: 570 }, + { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 100n }, + { address: "0x15c7281842a45465b4cbb8f89111d99e36e5bab8", units: 50n }, + { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 40n }, + { address: "0x22e4b9b003cc7b7149cf2135dfce2baddc7a534f", units: 570n }, ]); }); @@ -112,10 +112,10 @@ describe("allowlist", () => { ], ); expect(result).toEqual([ - { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 290 }, - { address: "0x15c7281842a45465b4cbb8f89111d99e36e5bab8", units: 50 }, - { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 40 }, - { address: "0x22e4b9b003cc7b7149cf2135dfce2baddc7a534f", units: 380 }, + { address: "0x20326e144532f17f76aca759e61e19af20a58ef3", units: 290n }, + { address: "0x15c7281842a45465b4cbb8f89111d99e36e5bab8", units: 50n }, + { address: "0x1cca19b823afa773b09708d94d2ee6ff96c60057", units: 40n }, + { address: "0x22e4b9b003cc7b7149cf2135dfce2baddc7a534f", units: 380n }, ]); }); diff --git a/frontend/lib/parsing.ts b/frontend/lib/parsing.ts index e7444a9c..8315f860 100644 --- a/frontend/lib/parsing.ts +++ b/frontend/lib/parsing.ts @@ -27,12 +27,17 @@ export function parseAllowlistCsv( console.error("Errors parsing allowlist:", errors); throw new InvalidDataError("Errors parsing allowlist"); } + + console.log(rawData); // Get the addresses and units from the CSV const csvData = rawData.map((row: any) => ({ address: row["address"].trim().toLowerCase(), - units: parseInt(row["fractions"].trim(), 10), + units: BigInt(row["fractions"].trim()), })); - const csvTotalSupply = csvData.reduce((accum, curr) => accum + curr.units, 0); + const csvTotalSupply = csvData.reduce( + (accum, curr) => accum + curr.units, + 0n, + ); if (csvTotalSupply <= 0) { throw new InvalidDataError("Did not find any valid rows"); } @@ -52,12 +57,23 @@ export function parseAllowlistCsv( } } // Combine CSV data with manually added addresses + // 0.75 const csvTotalPercentage = 1.0 - addTotalPercentage; - const totalSupply = csvTotalSupply / csvTotalPercentage; + + // 75 + const csvTotalPercentageBigInt = BigInt(Math.floor(csvTotalPercentage * 100)); // convert percentage to BigInt + const addTotalPercentageBigInt = BigInt(Math.floor(addTotalPercentage * 100)); // convert percentage to BigInt + const creatorSupply = + (((csvTotalSupply * 100n) / csvTotalPercentageBigInt) * + addTotalPercentageBigInt) / + 100n; + const totalSupply = csvTotalSupply + creatorSupply; // calculate total supply + + // TODO risk over overflow on units - casting bigint to number const data = csvData.concat( add.map((x) => ({ address: x.address.trim().toLowerCase(), - units: Math.floor(totalSupply * x.percentage), + units: (totalSupply * BigInt(Math.floor(x.percentage * 100))) / 100n, })), ); @@ -69,7 +85,7 @@ export function parseAllowlistCsv( // Deduplicate const groups = _.groupBy(data, (x) => x.address); const addressToUnits = _.mapValues(groups, (x) => - x.reduce((accum, curr) => accum + curr.units, 0), + x.reduce((accum, curr) => accum + curr.units, 0n), ); const result = _.toPairs(addressToUnits).map(([address, units]) => ({ diff --git a/frontend/next.config.mjs b/frontend/next.config.mjs index beb093bd..c8d52715 100644 --- a/frontend/next.config.mjs +++ b/frontend/next.config.mjs @@ -15,6 +15,7 @@ const nextConfig = { config.resolve.fallback = { fs: false, net: false, tls: false }; return config; }, + transpilePackages: ["@hypercerts-org/sdk"], }; export default withSentryConfig( diff --git a/frontend/package.json b/frontend/package.json index c9d96480..1d944407 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -23,9 +23,9 @@ "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", "@graphprotocol/client-cli": "^2.2.16", - "@hypercerts-org/contracts": "0.8.11", + "@hypercerts-org/contracts": "1.0.0-alpha.2", "@hypercerts-org/observabletreemap": "workspace: *", - "@hypercerts-org/sdk": "0.8.16", + "@hypercerts-org/sdk": "1.0.0-alpha.10", "@mui/icons-material": "^5.11.9", "@mui/material": "^5.11.2", "@mui/x-date-pickers": "^5.0.12", @@ -33,8 +33,8 @@ "@observablehq/runtime": "5", "@openzeppelin/merkle-tree": "^1.0.2", "@plasmicapp/host": "^1.0.171", - "@plasmicapp/loader-nextjs": "^1.0.284", - "@rainbow-me/rainbowkit": "1.0.8", + "@plasmicapp/loader-nextjs": "^1.0.345", + "@rainbow-me/rainbowkit": "1.2.0", "@sentry/nextjs": "^7.73.0", "@sentry/utils": "^7.73.0", "@supabase/supabase-js": "^2.1.2", @@ -54,7 +54,7 @@ "html2canvas": "^1.4.1", "js-confetti": "^0.11.0", "lodash": "^4.17.21", - "next": "latest", + "next": "^13.5.6", "papaparse": "^5.4.1", "primereact": "^9.6.0", "qs": "^6.11.0", @@ -66,8 +66,8 @@ "react-toastify": "^9.1.1", "react-use": "^17.4.0", "serve": "^14.0.1", - "viem": "1.5.3", - "wagmi": "1.3.9", + "viem": "1.19.9", + "wagmi": "1.4.5", "yup": "^0.32.11" }, "devDependencies": { diff --git a/frontend/plasmic-init.ts b/frontend/plasmic-init.ts index c722eca3..4e22ee73 100644 --- a/frontend/plasmic-init.ts +++ b/frontend/plasmic-init.ts @@ -1,9 +1,7 @@ -import { BlueprintCreateForm } from "./components/blueprint-create"; import { BurnFractionButton } from "./components/burn-fraction-button"; import ClaimAllFractionsButton from "./components/claim-all-fractions-button"; import { ClientGrid } from "./components/client-grid"; import { Config } from "./components/config"; -import { ContributionBlueprintCreate } from "./components/contribution-blueprint-create"; import { DEFAULT_TEST_DATA } from "./components/dapp-state"; import { FormField, @@ -34,6 +32,7 @@ import "primereact/resources/primereact.min.css"; import "primereact/resources/themes/tailwind-light/theme.css"; import { MergeAllClaimFractionsButton } from "./components/merge-all-claim-fractions-button"; import { SplitFractionButton } from "./components/split-fraction-button"; +import { TransferFractionButton } from "./components/transfer-fraction-button"; export const PLASMIC = initPlasmicLoader({ projects: [ @@ -184,6 +183,12 @@ PLASMIC.registerComponent(HypercertFetcher, { name: "HypercertFetcher", description: "Client-side fetch metadata from IPFS", props: { + overrideChainId: { + type: "number", + helpText: "Override chainId", + editOnly: true, + defaultValue: 5, + }, variableName: { type: "string", helpText: "Name to use in Plasmic data picker", @@ -224,6 +229,11 @@ PLASMIC.registerComponent(HypercertFetcher, { importPath: "./components/hypercert-metadata-fetcher", }); +/** + * AllowAll: 0, + * DisallowAll: 1, + * FromCreatorOnly: 2, + */ PLASMIC.registerComponent(HypercertCreateForm, { name: "HypercertCreateForm", description: "Create a hypercert", @@ -235,32 +245,17 @@ PLASMIC.registerComponent(HypercertCreateForm, { value: "Placeholder", }, }, - }, - providesData: true, - importPath: "./components/hypercert-create", -}); - -PLASMIC.registerComponent(BlueprintCreateForm, { - name: "BlueprintCreateForm", - description: "Create a blueprint", - props: { - children: { - type: "slot", - defaultValue: { - type: "text", - value: "Placeholder", - }, + transferRestrictions: { + type: "number", + description: "0: AllowAll, 1: DisallowAll, 2: FromCreatorOnly", + }, + applicationName: { + type: "string", + defaultValueHint: "hypercerts.org/create", }, }, providesData: true, - importPath: "./components/blueprint-create", -}); - -PLASMIC.registerComponent(ContributionBlueprintCreate, { - name: "ContributionBlueprintCreate", - description: "Create a contribution blueprint", - importPath: "./components/contribution-blueprint-create", - props: {}, + importPath: "./components/hypercert-create", }); PLASMIC.registerComponent(FormError, { @@ -685,6 +680,22 @@ PLASMIC.registerComponent(ProjectsClientProvider, { }, }); +PLASMIC.registerComponent(TransferFractionButton, { + name: "TransferFractionButton", + description: "Button that will transfer the fraction currently selected", + props: { + text: { + type: "string", + defaultValue: "Transfer", + helpText: "Text to display on button", + }, + fractionId: "string", + disabled: "boolean", + className: "string", + }, + importPath: "./components/transfer-fraction-button", +}); + PLASMIC.registerComponent(MergeAllClaimFractionsButton, { name: "MergeAllClaimFractionsButton", description: @@ -695,7 +706,7 @@ PLASMIC.registerComponent(MergeAllClaimFractionsButton, { disabled: "boolean", text: { type: "string", - defaultValue: "Split", + defaultValue: "Merge", helpText: "Text to display on button", }, }, diff --git a/graph/.eslintrc.yml b/graph/.eslintrc.yml new file mode 100644 index 00000000..2c49e547 --- /dev/null +++ b/graph/.eslintrc.yml @@ -0,0 +1,11 @@ +root: false +ignorePatterns: ["tests/", "generated/"] +parser: "@typescript-eslint/parser" +plugins: + - "@typescript-eslint" +extends: + - "eslint:recommended" + - "plugin:@typescript-eslint/recommended" +rules: + "@typescript-eslint/ban-types": + - "warn" diff --git a/graph/abis/HypercertMinter.json b/graph/abis/HypercertMinter.json index a0bb3aee..feb7ccb2 100644 --- a/graph/abis/HypercertMinter.json +++ b/graph/abis/HypercertMinter.json @@ -1,1065 +1,1130 @@ [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "ArraySize", - "type": "error" - }, - { - "inputs": [], - "name": "DoesNotExist", - "type": "error" - }, - { - "inputs": [], - "name": "DuplicateEntry", - "type": "error" - }, - { - "inputs": [], - "name": "FractionalBurn", - "type": "error" - }, - { - "inputs": [], - "name": "Invalid", - "type": "error" - }, - { - "inputs": [], - "name": "NotAllowed", - "type": "error" - }, - { - "inputs": [], - "name": "TransfersNotAllowed", - "type": "error" - }, - { - "inputs": [], - "name": "TypeMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "tokenID", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "root", - "type": "bytes32" - } - ], - "name": "AllowlistCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256[]", - "name": "claimIDs", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "fromTokenIDs", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "toTokenIDs", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "BatchValueTransfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "claimID", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "totalUnits", - "type": "uint256" - } - ], - "name": "ClaimStored", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "tokenID", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "leaf", - "type": "bytes32" - } - ], - "name": "LeafClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "TransferBatch", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "TransferSingle", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "value", - "type": "string" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "URI", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Unpaused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "claimID", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fromTokenID", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "toTokenID", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "ValueTransfer", - "type": "event" - }, - { - "inputs": [], - "name": "__SemiFungible1155_init", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "__Upgradeable1155_init", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "accounts", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - } - ], - "name": "balanceOfBatch", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32[][]", - "name": "proofs", - "type": "bytes32[][]" - }, - { - "internalType": "uint256[]", - "name": "claimIDs", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "units", - "type": "uint256[]" - } - ], - "name": "batchMintClaimsFromAllowlists", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "burnBatch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenID", - "type": "uint256" - } - ], - "name": "burnValue", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "units", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "merkleRoot", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "_uri", - "type": "string" - }, - { - "internalType": "enum IHypercertToken.TransferRestrictions", - "name": "restrictions", - "type": "uint8" - } - ], - "name": "createAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "hasBeenClaimed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32[]", - "name": "proof", - "type": "bytes32[]" - }, - { - "internalType": "uint256", - "name": "claimID", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "leaf", - "type": "bytes32" - } - ], - "name": "isAllowedToClaim", - "outputs": [ - { - "internalType": "bool", - "name": "isAllowed", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "_fractionIDs", - "type": "uint256[]" - } - ], - "name": "mergeValue", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "units", - "type": "uint256" - }, - { - "internalType": "string", - "name": "_uri", - "type": "string" - }, - { - "internalType": "enum IHypercertToken.TransferRestrictions", - "name": "restrictions", - "type": "uint8" - } - ], - "name": "mintClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32[]", - "name": "proof", - "type": "bytes32[]" - }, - { - "internalType": "uint256", - "name": "claimID", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "units", - "type": "uint256" - } - ], - "name": "mintClaimFromAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "units", - "type": "uint256" - }, - { - "internalType": "uint256[]", - "name": "fractions", - "type": "uint256[]" - }, - { - "internalType": "string", - "name": "_uri", - "type": "string" - }, - { - "internalType": "enum IHypercertToken.TransferRestrictions", - "name": "restrictions", - "type": "uint8" - } - ], - "name": "mintClaimWithFractions", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenID", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeBatchTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenID", - "type": "uint256" - }, - { - "internalType": "uint256[]", - "name": "_values", - "type": "uint256[]" - } - ], - "name": "splitValue", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenID", - "type": "uint256" - } - ], - "name": "unitsOf", - "outputs": [ - { - "internalType": "uint256", - "name": "units", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenID", - "type": "uint256" - } - ], - "name": "unitsOf", - "outputs": [ - { - "internalType": "uint256", - "name": "units", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "unpause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenID", - "type": "uint256" - } - ], + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyClaimed", + "type": "error" + }, + { + "inputs": [], + "name": "ArraySize", + "type": "error" + }, + { + "inputs": [], + "name": "DoesNotExist", + "type": "error" + }, + { + "inputs": [], + "name": "DuplicateEntry", + "type": "error" + }, + { + "inputs": [], + "name": "Invalid", + "type": "error" + }, + { + "inputs": [], + "name": "NotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "NotApprovedOrOwner", + "type": "error" + }, + { + "inputs": [], + "name": "TransfersNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "TypeMismatch", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "root", + "type": "bytes32" + } + ], + "name": "AllowlistCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256[]", + "name": "claimIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "fromTokenIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "toTokenIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + } + ], + "name": "BatchValueTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "claimID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", "name": "uri", - "outputs": [ - { - "internalType": "string", - "name": "_uri", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalUnits", + "type": "uint256" + } + ], + "name": "ClaimStored", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "leaf", + "type": "bytes32" + } + ], + "name": "LeafClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + } + ], + "name": "TransferBatch", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "TransferSingle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "value", + "type": "string" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "URI", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "claimID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fromTokenID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "toTokenID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "ValueTransfer", + "type": "event" + }, + { + "inputs": [], + "name": "__SemiFungible1155_init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "accounts", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + } + ], + "name": "balanceOfBatch", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "_tokenIDs", + "type": "uint256[]" + } + ], + "name": "batchBurnFraction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32[][]", + "name": "proofs", + "type": "bytes32[][]" + }, + { + "internalType": "uint256[]", + "name": "claimIDs", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "units", + "type": "uint256[]" + } + ], + "name": "batchMintClaimsFromAllowlists", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + } + ], + "name": "burnBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenID", + "type": "uint256" + } + ], + "name": "burnFraction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "units", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "merkleRoot", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "_uri", + "type": "string" + }, + { + "internalType": "enum IHypercertToken.TransferRestrictions", + "name": "restrictions", + "type": "uint8" + } + ], + "name": "createAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "hasBeenClaimed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + }, + { + "internalType": "uint256", + "name": "claimID", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "leaf", + "type": "bytes32" + } + ], + "name": "isAllowedToClaim", + "outputs": [ + { + "internalType": "bool", + "name": "isAllowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "_fractionIDs", + "type": "uint256[]" + } + ], + "name": "mergeFractions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "units", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_uri", + "type": "string" + }, + { + "internalType": "enum IHypercertToken.TransferRestrictions", + "name": "restrictions", + "type": "uint8" + } + ], + "name": "mintClaim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + }, + { + "internalType": "uint256", + "name": "claimID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "units", + "type": "uint256" + } + ], + "name": "mintClaimFromAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "units", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "fractions", + "type": "uint256[]" + }, + { + "internalType": "string", + "name": "_uri", + "type": "string" + }, + { + "internalType": "enum IHypercertToken.TransferRestrictions", + "name": "restrictions", + "type": "uint8" + } + ], + "name": "mintClaimWithFractions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + } + ], + "name": "readTransferRestriction", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeBatchTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_newFractions", + "type": "uint256[]" + } + ], + "name": "splitFraction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + } + ], + "name": "unitsOf", + "outputs": [ + { + "internalType": "uint256", + "name": "units", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + } + ], + "name": "unitsOf", + "outputs": [ + { + "internalType": "uint256", + "name": "units", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + } + ], + "name": "uri", + "outputs": [ + { + "internalType": "string", + "name": "_uri", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } ] diff --git a/graph/generated/HypercertMinter/HypercertMinter.ts b/graph/generated/HypercertMinter/HypercertMinter.ts index 41fdeb8c..988629ae 100644 --- a/graph/generated/HypercertMinter/HypercertMinter.ts +++ b/graph/generated/HypercertMinter/HypercertMinter.ts @@ -7,7 +7,7 @@ import { Entity, Bytes, Address, - BigInt + BigInt, } from "@graphprotocol/graph-ts"; export class AdminChanged extends ethereum.Event { @@ -401,8 +401,8 @@ export class HypercertMinter extends ethereum.SmartContract { "balanceOf(address,uint256):(uint256)", [ ethereum.Value.fromAddress(account), - ethereum.Value.fromUnsignedBigInt(id) - ] + ethereum.Value.fromUnsignedBigInt(id), + ], ); return result[0].toBigInt(); @@ -414,8 +414,8 @@ export class HypercertMinter extends ethereum.SmartContract { "balanceOf(address,uint256):(uint256)", [ ethereum.Value.fromAddress(account), - ethereum.Value.fromUnsignedBigInt(id) - ] + ethereum.Value.fromUnsignedBigInt(id), + ], ); if (result.reverted) { return new ethereum.CallResult(); @@ -430,8 +430,8 @@ export class HypercertMinter extends ethereum.SmartContract { "balanceOfBatch(address[],uint256[]):(uint256[])", [ ethereum.Value.fromAddressArray(accounts), - ethereum.Value.fromUnsignedBigIntArray(ids) - ] + ethereum.Value.fromUnsignedBigIntArray(ids), + ], ); return result[0].toBigIntArray(); @@ -439,15 +439,15 @@ export class HypercertMinter extends ethereum.SmartContract { try_balanceOfBatch( accounts: Array
, - ids: Array + ids: Array, ): ethereum.CallResult> { let result = super.tryCall( "balanceOfBatch", "balanceOfBatch(address[],uint256[]):(uint256[])", [ ethereum.Value.fromAddressArray(accounts), - ethereum.Value.fromUnsignedBigIntArray(ids) - ] + ethereum.Value.fromUnsignedBigIntArray(ids), + ], ); if (result.reverted) { return new ethereum.CallResult(); @@ -462,8 +462,8 @@ export class HypercertMinter extends ethereum.SmartContract { "hasBeenClaimed(uint256,bytes32):(bool)", [ ethereum.Value.fromUnsignedBigInt(param0), - ethereum.Value.fromFixedBytes(param1) - ] + ethereum.Value.fromFixedBytes(param1), + ], ); return result[0].toBoolean(); @@ -471,15 +471,15 @@ export class HypercertMinter extends ethereum.SmartContract { try_hasBeenClaimed( param0: BigInt, - param1: Bytes + param1: Bytes, ): ethereum.CallResult { let result = super.tryCall( "hasBeenClaimed", "hasBeenClaimed(uint256,bytes32):(bool)", [ ethereum.Value.fromUnsignedBigInt(param0), - ethereum.Value.fromFixedBytes(param1) - ] + ethereum.Value.fromFixedBytes(param1), + ], ); if (result.reverted) { return new ethereum.CallResult(); @@ -495,8 +495,8 @@ export class HypercertMinter extends ethereum.SmartContract { [ ethereum.Value.fromFixedBytesArray(proof), ethereum.Value.fromUnsignedBigInt(claimID), - ethereum.Value.fromFixedBytes(leaf) - ] + ethereum.Value.fromFixedBytes(leaf), + ], ); return result[0].toBoolean(); @@ -505,7 +505,7 @@ export class HypercertMinter extends ethereum.SmartContract { try_isAllowedToClaim( proof: Array, claimID: BigInt, - leaf: Bytes + leaf: Bytes, ): ethereum.CallResult { let result = super.tryCall( "isAllowedToClaim", @@ -513,8 +513,8 @@ export class HypercertMinter extends ethereum.SmartContract { [ ethereum.Value.fromFixedBytesArray(proof), ethereum.Value.fromUnsignedBigInt(claimID), - ethereum.Value.fromFixedBytes(leaf) - ] + ethereum.Value.fromFixedBytes(leaf), + ], ); if (result.reverted) { return new ethereum.CallResult(); @@ -529,8 +529,8 @@ export class HypercertMinter extends ethereum.SmartContract { "isApprovedForAll(address,address):(bool)", [ ethereum.Value.fromAddress(account), - ethereum.Value.fromAddress(operator) - ] + ethereum.Value.fromAddress(operator), + ], ); return result[0].toBoolean(); @@ -538,15 +538,15 @@ export class HypercertMinter extends ethereum.SmartContract { try_isApprovedForAll( account: Address, - operator: Address + operator: Address, ): ethereum.CallResult { let result = super.tryCall( "isApprovedForAll", "isApprovedForAll(address,address):(bool)", [ ethereum.Value.fromAddress(account), - ethereum.Value.fromAddress(operator) - ] + ethereum.Value.fromAddress(operator), + ], ); if (result.reverted) { return new ethereum.CallResult(); @@ -587,7 +587,7 @@ export class HypercertMinter extends ethereum.SmartContract { ownerOf(tokenID: BigInt): Address { let result = super.call("ownerOf", "ownerOf(uint256):(address)", [ - ethereum.Value.fromUnsignedBigInt(tokenID) + ethereum.Value.fromUnsignedBigInt(tokenID), ]); return result[0].toAddress(); @@ -595,7 +595,7 @@ export class HypercertMinter extends ethereum.SmartContract { try_ownerOf(tokenID: BigInt): ethereum.CallResult
{ let result = super.tryCall("ownerOf", "ownerOf(uint256):(address)", [ - ethereum.Value.fromUnsignedBigInt(tokenID) + ethereum.Value.fromUnsignedBigInt(tokenID), ]); if (result.reverted) { return new ethereum.CallResult(); @@ -629,7 +629,7 @@ export class HypercertMinter extends ethereum.SmartContract { let result = super.tryCall( "proxiableUUID", "proxiableUUID():(bytes32)", - [] + [], ); if (result.reverted) { return new ethereum.CallResult(); @@ -638,11 +638,34 @@ export class HypercertMinter extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toBytes()); } + readTransferRestriction(tokenID: BigInt): string { + let result = super.call( + "readTransferRestriction", + "readTransferRestriction(uint256):(string)", + [ethereum.Value.fromUnsignedBigInt(tokenID)], + ); + + return result[0].toString(); + } + + try_readTransferRestriction(tokenID: BigInt): ethereum.CallResult { + let result = super.tryCall( + "readTransferRestriction", + "readTransferRestriction(uint256):(string)", + [ethereum.Value.fromUnsignedBigInt(tokenID)], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + supportsInterface(interfaceId: Bytes): boolean { let result = super.call( "supportsInterface", "supportsInterface(bytes4):(bool)", - [ethereum.Value.fromFixedBytes(interfaceId)] + [ethereum.Value.fromFixedBytes(interfaceId)], ); return result[0].toBoolean(); @@ -652,7 +675,7 @@ export class HypercertMinter extends ethereum.SmartContract { let result = super.tryCall( "supportsInterface", "supportsInterface(bytes4):(bool)", - [ethereum.Value.fromFixedBytes(interfaceId)] + [ethereum.Value.fromFixedBytes(interfaceId)], ); if (result.reverted) { return new ethereum.CallResult(); @@ -664,7 +687,7 @@ export class HypercertMinter extends ethereum.SmartContract { unitsOf(account: Address, tokenID: BigInt): BigInt { let result = super.call("unitsOf", "unitsOf(address,uint256):(uint256)", [ ethereum.Value.fromAddress(account), - ethereum.Value.fromUnsignedBigInt(tokenID) + ethereum.Value.fromUnsignedBigInt(tokenID), ]); return result[0].toBigInt(); @@ -676,8 +699,8 @@ export class HypercertMinter extends ethereum.SmartContract { "unitsOf(address,uint256):(uint256)", [ ethereum.Value.fromAddress(account), - ethereum.Value.fromUnsignedBigInt(tokenID) - ] + ethereum.Value.fromUnsignedBigInt(tokenID), + ], ); if (result.reverted) { return new ethereum.CallResult(); @@ -688,7 +711,7 @@ export class HypercertMinter extends ethereum.SmartContract { unitsOf1(tokenID: BigInt): BigInt { let result = super.call("unitsOf", "unitsOf(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(tokenID) + ethereum.Value.fromUnsignedBigInt(tokenID), ]); return result[0].toBigInt(); @@ -696,7 +719,7 @@ export class HypercertMinter extends ethereum.SmartContract { try_unitsOf1(tokenID: BigInt): ethereum.CallResult { let result = super.tryCall("unitsOf", "unitsOf(uint256):(uint256)", [ - ethereum.Value.fromUnsignedBigInt(tokenID) + ethereum.Value.fromUnsignedBigInt(tokenID), ]); if (result.reverted) { return new ethereum.CallResult(); @@ -707,7 +730,7 @@ export class HypercertMinter extends ethereum.SmartContract { uri(tokenID: BigInt): string { let result = super.call("uri", "uri(uint256):(string)", [ - ethereum.Value.fromUnsignedBigInt(tokenID) + ethereum.Value.fromUnsignedBigInt(tokenID), ]); return result[0].toString(); @@ -715,7 +738,7 @@ export class HypercertMinter extends ethereum.SmartContract { try_uri(tokenID: BigInt): ethereum.CallResult { let result = super.tryCall("uri", "uri(uint256):(string)", [ - ethereum.Value.fromUnsignedBigInt(tokenID) + ethereum.Value.fromUnsignedBigInt(tokenID), ]); if (result.reverted) { return new ethereum.CallResult(); @@ -777,28 +800,36 @@ export class __SemiFungible1155_initCall__Outputs { } } -export class __Upgradeable1155_initCall extends ethereum.Call { - get inputs(): __Upgradeable1155_initCall__Inputs { - return new __Upgradeable1155_initCall__Inputs(this); +export class BatchBurnFractionCall extends ethereum.Call { + get inputs(): BatchBurnFractionCall__Inputs { + return new BatchBurnFractionCall__Inputs(this); } - get outputs(): __Upgradeable1155_initCall__Outputs { - return new __Upgradeable1155_initCall__Outputs(this); + get outputs(): BatchBurnFractionCall__Outputs { + return new BatchBurnFractionCall__Outputs(this); } } -export class __Upgradeable1155_initCall__Inputs { - _call: __Upgradeable1155_initCall; +export class BatchBurnFractionCall__Inputs { + _call: BatchBurnFractionCall; - constructor(call: __Upgradeable1155_initCall) { + constructor(call: BatchBurnFractionCall) { this._call = call; } + + get _account(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get _tokenIDs(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } } -export class __Upgradeable1155_initCall__Outputs { - _call: __Upgradeable1155_initCall; +export class BatchBurnFractionCall__Outputs { + _call: BatchBurnFractionCall; - constructor(call: __Upgradeable1155_initCall) { + constructor(call: BatchBurnFractionCall) { this._call = call; } } @@ -820,16 +851,20 @@ export class BatchMintClaimsFromAllowlistsCall__Inputs { this._call = call; } + get account(): Address { + return this._call.inputValues[0].value.toAddress(); + } + get proofs(): Array> { - return this._call.inputValues[0].value.toBytesMatrix(); + return this._call.inputValues[1].value.toBytesMatrix(); } get claimIDs(): Array { - return this._call.inputValues[1].value.toBigIntArray(); + return this._call.inputValues[2].value.toBigIntArray(); } get units(): Array { - return this._call.inputValues[2].value.toBigIntArray(); + return this._call.inputValues[3].value.toBigIntArray(); } } @@ -917,20 +952,20 @@ export class BurnBatchCall__Outputs { } } -export class BurnValueCall extends ethereum.Call { - get inputs(): BurnValueCall__Inputs { - return new BurnValueCall__Inputs(this); +export class BurnFractionCall extends ethereum.Call { + get inputs(): BurnFractionCall__Inputs { + return new BurnFractionCall__Inputs(this); } - get outputs(): BurnValueCall__Outputs { - return new BurnValueCall__Outputs(this); + get outputs(): BurnFractionCall__Outputs { + return new BurnFractionCall__Outputs(this); } } -export class BurnValueCall__Inputs { - _call: BurnValueCall; +export class BurnFractionCall__Inputs { + _call: BurnFractionCall; - constructor(call: BurnValueCall) { + constructor(call: BurnFractionCall) { this._call = call; } @@ -943,10 +978,10 @@ export class BurnValueCall__Inputs { } } -export class BurnValueCall__Outputs { - _call: BurnValueCall; +export class BurnFractionCall__Outputs { + _call: BurnFractionCall; - constructor(call: BurnValueCall) { + constructor(call: BurnFractionCall) { this._call = call; } } @@ -968,20 +1003,24 @@ export class CreateAllowlistCall__Inputs { this._call = call; } + get account(): Address { + return this._call.inputValues[0].value.toAddress(); + } + get units(): BigInt { - return this._call.inputValues[0].value.toBigInt(); + return this._call.inputValues[1].value.toBigInt(); } get merkleRoot(): Bytes { - return this._call.inputValues[1].value.toBytes(); + return this._call.inputValues[2].value.toBytes(); } get _uri(): string { - return this._call.inputValues[2].value.toString(); + return this._call.inputValues[3].value.toString(); } get restrictions(): i32 { - return this._call.inputValues[3].value.toI32(); + return this._call.inputValues[4].value.toI32(); } } @@ -1019,32 +1058,36 @@ export class InitializeCall__Outputs { } } -export class MergeValueCall extends ethereum.Call { - get inputs(): MergeValueCall__Inputs { - return new MergeValueCall__Inputs(this); +export class MergeFractionsCall extends ethereum.Call { + get inputs(): MergeFractionsCall__Inputs { + return new MergeFractionsCall__Inputs(this); } - get outputs(): MergeValueCall__Outputs { - return new MergeValueCall__Outputs(this); + get outputs(): MergeFractionsCall__Outputs { + return new MergeFractionsCall__Outputs(this); } } -export class MergeValueCall__Inputs { - _call: MergeValueCall; +export class MergeFractionsCall__Inputs { + _call: MergeFractionsCall; - constructor(call: MergeValueCall) { + constructor(call: MergeFractionsCall) { this._call = call; } + get _account(): Address { + return this._call.inputValues[0].value.toAddress(); + } + get _fractionIDs(): Array { - return this._call.inputValues[0].value.toBigIntArray(); + return this._call.inputValues[1].value.toBigIntArray(); } } -export class MergeValueCall__Outputs { - _call: MergeValueCall; +export class MergeFractionsCall__Outputs { + _call: MergeFractionsCall; - constructor(call: MergeValueCall) { + constructor(call: MergeFractionsCall) { this._call = call; } } @@ -1066,16 +1109,20 @@ export class MintClaimCall__Inputs { this._call = call; } + get account(): Address { + return this._call.inputValues[0].value.toAddress(); + } + get units(): BigInt { - return this._call.inputValues[0].value.toBigInt(); + return this._call.inputValues[1].value.toBigInt(); } get _uri(): string { - return this._call.inputValues[1].value.toString(); + return this._call.inputValues[2].value.toString(); } get restrictions(): i32 { - return this._call.inputValues[2].value.toI32(); + return this._call.inputValues[3].value.toI32(); } } @@ -1104,16 +1151,20 @@ export class MintClaimFromAllowlistCall__Inputs { this._call = call; } + get account(): Address { + return this._call.inputValues[0].value.toAddress(); + } + get proof(): Array { - return this._call.inputValues[0].value.toBytesArray(); + return this._call.inputValues[1].value.toBytesArray(); } get claimID(): BigInt { - return this._call.inputValues[1].value.toBigInt(); + return this._call.inputValues[2].value.toBigInt(); } get units(): BigInt { - return this._call.inputValues[2].value.toBigInt(); + return this._call.inputValues[3].value.toBigInt(); } } @@ -1142,20 +1193,24 @@ export class MintClaimWithFractionsCall__Inputs { this._call = call; } + get account(): Address { + return this._call.inputValues[0].value.toAddress(); + } + get units(): BigInt { - return this._call.inputValues[0].value.toBigInt(); + return this._call.inputValues[1].value.toBigInt(); } get fractions(): Array { - return this._call.inputValues[1].value.toBigIntArray(); + return this._call.inputValues[2].value.toBigIntArray(); } get _uri(): string { - return this._call.inputValues[2].value.toString(); + return this._call.inputValues[3].value.toString(); } get restrictions(): i32 { - return this._call.inputValues[3].value.toI32(); + return this._call.inputValues[4].value.toI32(); } } @@ -1345,20 +1400,20 @@ export class SetApprovalForAllCall__Outputs { } } -export class SplitValueCall extends ethereum.Call { - get inputs(): SplitValueCall__Inputs { - return new SplitValueCall__Inputs(this); +export class SplitFractionCall extends ethereum.Call { + get inputs(): SplitFractionCall__Inputs { + return new SplitFractionCall__Inputs(this); } - get outputs(): SplitValueCall__Outputs { - return new SplitValueCall__Outputs(this); + get outputs(): SplitFractionCall__Outputs { + return new SplitFractionCall__Outputs(this); } } -export class SplitValueCall__Inputs { - _call: SplitValueCall; +export class SplitFractionCall__Inputs { + _call: SplitFractionCall; - constructor(call: SplitValueCall) { + constructor(call: SplitFractionCall) { this._call = call; } @@ -1370,15 +1425,15 @@ export class SplitValueCall__Inputs { return this._call.inputValues[1].value.toBigInt(); } - get _values(): Array { + get _newFractions(): Array { return this._call.inputValues[2].value.toBigIntArray(); } } -export class SplitValueCall__Outputs { - _call: SplitValueCall; +export class SplitFractionCall__Outputs { + _call: SplitFractionCall; - constructor(call: SplitValueCall) { + constructor(call: SplitFractionCall) { this._call = call; } } diff --git a/graph/generated/schema.ts b/graph/generated/schema.ts index 7834b274..cf492abf 100644 --- a/graph/generated/schema.ts +++ b/graph/generated/schema.ts @@ -222,6 +222,23 @@ export class Claim extends Entity { this.set("totalUnits", Value.fromBigInt(value)); } } + + get allowlist(): string | null { + let value = this.get("allowlist"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set allowlist(value: string | null) { + if (!value) { + this.unset("allowlist"); + } else { + this.set("allowlist", Value.fromString(value)); + } + } } export class ClaimToken extends Entity { @@ -314,4 +331,417 @@ export class ClaimToken extends Entity { set units(value: BigInt) { this.set("units", Value.fromBigInt(value)); } + + get offers(): OfferLoader { + return new OfferLoader("ClaimToken", this.get("id")!.toString(), "offers"); + } +} + +export class Token extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Token entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + `Entities of type Token must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("Token", id.toString(), this); + } + } + + static loadInBlock(id: string): Token | null { + return changetype(store.get_in_block("Token", id)); + } + + static load(id: string): Token | null { + return changetype(store.get("Token", id)); + } + + get id(): string { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get name(): string { + let value = this.get("name"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set name(value: string) { + this.set("name", Value.fromString(value)); + } + + get symbol(): string | null { + let value = this.get("symbol"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set symbol(value: string | null) { + if (!value) { + this.unset("symbol"); + } else { + this.set("symbol", Value.fromString(value)); + } + } + + get decimals(): BigInt | null { + let value = this.get("decimals"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set decimals(value: BigInt | null) { + if (!value) { + this.unset("decimals"); + } else { + this.set("decimals", Value.fromBigInt(value)); + } + } +} + +export class AcceptedToken extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save AcceptedToken entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + `Entities of type AcceptedToken must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("AcceptedToken", id.toString(), this); + } + } + + static loadInBlock(id: string): AcceptedToken | null { + return changetype( + store.get_in_block("AcceptedToken", id), + ); + } + + static load(id: string): AcceptedToken | null { + return changetype(store.get("AcceptedToken", id)); + } + + get id(): string { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get token(): string { + let value = this.get("token"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set token(value: string) { + this.set("token", Value.fromString(value)); + } + + get minimumAmountPerUnit(): BigInt { + let value = this.get("minimumAmountPerUnit"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set minimumAmountPerUnit(value: BigInt) { + this.set("minimumAmountPerUnit", Value.fromBigInt(value)); + } + + get accepted(): boolean { + let value = this.get("accepted"); + if (!value || value.kind == ValueKind.NULL) { + return false; + } else { + return value.toBoolean(); + } + } + + set accepted(value: boolean) { + this.set("accepted", Value.fromBoolean(value)); + } +} + +export class Offer extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Offer entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + `Entities of type Offer must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("Offer", id.toString(), this); + } + } + + static loadInBlock(id: string): Offer | null { + return changetype(store.get_in_block("Offer", id)); + } + + static load(id: string): Offer | null { + return changetype(store.get("Offer", id)); + } + + get id(): string { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get fractionID(): string { + let value = this.get("fractionID"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set fractionID(value: string) { + this.set("fractionID", Value.fromString(value)); + } + + get unitsAvailable(): BigInt { + let value = this.get("unitsAvailable"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set unitsAvailable(value: BigInt) { + this.set("unitsAvailable", Value.fromBigInt(value)); + } + + get minUnitsPerTrade(): BigInt { + let value = this.get("minUnitsPerTrade"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set minUnitsPerTrade(value: BigInt) { + this.set("minUnitsPerTrade", Value.fromBigInt(value)); + } + + get maxUnitsPerTrade(): BigInt { + let value = this.get("maxUnitsPerTrade"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set maxUnitsPerTrade(value: BigInt) { + this.set("maxUnitsPerTrade", Value.fromBigInt(value)); + } + + get status(): string { + let value = this.get("status"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set status(value: string) { + this.set("status", Value.fromString(value)); + } + + get acceptedTokens(): Array { + let value = this.get("acceptedTokens"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toStringArray(); + } + } + + set acceptedTokens(value: Array) { + this.set("acceptedTokens", Value.fromStringArray(value)); + } +} + +export class Trade extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Trade entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + `Entities of type Trade must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("Trade", id.toString(), this); + } + } + + static loadInBlock(id: string): Trade | null { + return changetype(store.get_in_block("Trade", id)); + } + + static load(id: string): Trade | null { + return changetype(store.get("Trade", id)); + } + + get id(): string { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get buyer(): Bytes { + let value = this.get("buyer"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set buyer(value: Bytes) { + this.set("buyer", Value.fromBytes(value)); + } + + get offerID(): string { + let value = this.get("offerID"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set offerID(value: string) { + this.set("offerID", Value.fromString(value)); + } + + get unitsSold(): BigInt { + let value = this.get("unitsSold"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set unitsSold(value: BigInt) { + this.set("unitsSold", Value.fromBigInt(value)); + } + + get token(): string { + let value = this.get("token"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set token(value: string) { + this.set("token", Value.fromString(value)); + } + + get amountPerUnit(): BigInt { + let value = this.get("amountPerUnit"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set amountPerUnit(value: BigInt) { + this.set("amountPerUnit", Value.fromBigInt(value)); + } +} + +export class OfferLoader extends Entity { + _entity: string; + _field: string; + _id: string; + + constructor(entity: string, id: string, field: string) { + super(); + this._entity = entity; + this._id = id; + this._field = field; + } + + load(): Offer[] { + let value = store.loadRelated(this._entity, this._id, this._field); + return changetype(value); + } } diff --git a/graph/schema.graphql b/graph/schema.graphql index 85e54ed2..d6ec32ef 100644 --- a/graph/schema.graphql +++ b/graph/schema.graphql @@ -13,6 +13,7 @@ type Claim @entity { creator: Bytes owner: Bytes totalUnits: BigInt + allowlist: Allowlist } type ClaimToken @entity { @@ -21,4 +22,44 @@ type ClaimToken @entity { claim: Claim! owner: Bytes! units: BigInt! + offers: [Offer!] @derivedFrom(field: "fractionID") +} + +type Token @entity { + id: String! + name: String! + symbol: String + decimals: BigInt +} + +type AcceptedToken @entity { + id: String! + token: Token! + minimumAmountPerUnit: BigInt! + accepted: Boolean! +} + +enum OfferStatus { + Open + Fulfilled + Cancelled +} + +type Offer @entity { + id: String! + fractionID: ClaimToken! + unitsAvailable: BigInt! + minUnitsPerTrade: BigInt! + maxUnitsPerTrade: BigInt! + status: OfferStatus! + acceptedTokens: [AcceptedToken!]! +} + +type Trade @entity { + id: String! + buyer: Bytes! + offerID: Offer! + unitsSold: BigInt! + token: Token! + amountPerUnit: BigInt! } diff --git a/graph/src/hypercert-minter.ts b/graph/src/hypercert-minter.ts index a9f65e3a..3116aa01 100644 --- a/graph/src/hypercert-minter.ts +++ b/graph/src/hypercert-minter.ts @@ -11,37 +11,34 @@ import { URI as URIEvent, ValueTransfer as ValueTransferEvent, } from "../generated/HypercertMinter/HypercertMinter"; +import { ClaimToken } from "../generated/schema"; import { + ZERO_ADDRESS, getID, getOrCreateAllowlist, getOrCreateClaim, getOrCreateClaimToken, } from "./utils"; -import { Address, BigInt, log } from "@graphprotocol/graph-ts"; -import { ClaimToken } from "../generated/schema"; - -const ZERO_ADDRESS = Address.fromString( - "0x0000000000000000000000000000000000000000" -); -const ZERO_TOKEN = BigInt.fromI32(0); +import { log } from "@graphprotocol/graph-ts"; export function handleAllowlistCreated(event: AllowlistCreatedEvent): void { - let allowlist = getOrCreateAllowlist( + const allowlist = getOrCreateAllowlist( event.params.tokenID, event.params.root, - event.address + event.address, ); allowlist.save(); } -export function handleApprovalForAll(event: ApprovalForAllEvent): void {} +// eslint-disable-next-line @typescript-eslint/no-empty-function +export function handleApprovalForAll(_event: ApprovalForAllEvent): void {} export function handleClaimStored(event: ClaimStoredEvent): void { - let claim = getOrCreateClaim( + const claim = getOrCreateClaim( event.params.claimID, event.address, - event.block.timestamp + event.block.timestamp, ); claim.uri = event.params.uri; @@ -52,19 +49,38 @@ export function handleClaimStored(event: ClaimStoredEvent): void { claim.save(); } -export function handleInitialized(event: InitializedEvent): void {} +// eslint-disable-next-line @typescript-eslint/no-empty-function +export function handleInitialized(_: InitializedEvent): void {} -export function handleLeafClaimed(event: LeafClaimedEvent): void {} +// eslint-disable-next-line @typescript-eslint/no-empty-function +export function handleLeafClaimed(_: LeafClaimedEvent): void {} export function handleOwnershipTransferred( - event: OwnershipTransferredEvent + _event: OwnershipTransferredEvent, + // eslint-disable-next-line @typescript-eslint/no-empty-function, ): void {} -export function handleTransferBatch(event: TransferBatchEvent): void {} +export function handleTransferBatch(event: TransferBatchEvent): void { + const ids = event.params.ids; + const size = ids.length; + + for (let i = 0; i < size; i++) { + const id = getID(ids[i], event.address); + const token = ClaimToken.load(id); + + if (!token) { + log.debug("Transfered ClaimToken does not exist: {}", [id]); + return; + } + + token.owner = event.params.to; + token.save(); + } +} export function handleTransferSingle(event: TransferSingleEvent): void { - let id = getID(event.params.id, event.address); - let token = ClaimToken.load(id); + const id = getID(event.params.id, event.address); + const token = ClaimToken.load(id); if (!token) { log.debug("Transfered ClaimToken does not exist: {}", [id]); @@ -75,7 +91,8 @@ export function handleTransferSingle(event: TransferSingleEvent): void { token.save(); } -export function handleURI(event: URIEvent): void {} +// eslint-disable-next-line @typescript-eslint/no-empty-function +export function handleURI(_event: URIEvent): void {} export function handleValueTransfer(event: ValueTransferEvent): void { log.debug("Received ValueTransferEvent claimID: {}", [ @@ -92,18 +109,18 @@ export function handleValueTransfer(event: ValueTransferEvent): void { event.params.value.toString(), ]); - let from = getOrCreateClaimToken( + const from = getOrCreateClaimToken( event.params.claimID, event.params.fromTokenID, - event.address + event.address, ); - let to = getOrCreateClaimToken( + const to = getOrCreateClaimToken( event.params.claimID, event.params.toTokenID, - event.address + event.address, ); - let value = event.params.value; + const value = event.params.value; log.debug("Got from: {}", [from.id]); log.debug("Got to: {}", [to.id]); @@ -123,6 +140,7 @@ export function handleValueTransfer(event: ValueTransferEvent): void { // Burn value if (!from.tokenID.isZero() && to.tokenID.isZero()) { from.units = from.units.minus(value); + from.owner = ZERO_ADDRESS; } log.debug("Saving from: {}", [from.id]); @@ -134,18 +152,23 @@ export function handleValueTransfer(event: ValueTransferEvent): void { //TODO cleanup to nicer state handling export function handleBatchValueTransfer(event: BatchValueTransfer): void { - let claimIDs = event.params.claimIDs; - let fromIDs = event.params.fromTokenIDs; - let toIDs = event.params.toTokenIDs; - let values = event.params.values; + const claimIDs = event.params.claimIDs; + const fromIDs = event.params.fromTokenIDs; + const toIDs = event.params.toTokenIDs; + const values = event.params.values; + const contractAddress = event.address; - let size = claimIDs.length; + const size = claimIDs.length; for (let i = 0; i < size; i++) { - let from = getOrCreateClaimToken(claimIDs[i], fromIDs[i], event.address); - let to = getOrCreateClaimToken(claimIDs[i], toIDs[i], event.address); + const from = getOrCreateClaimToken( + claimIDs[i], + fromIDs[i], + contractAddress, + ); + const to = getOrCreateClaimToken(claimIDs[i], toIDs[i], contractAddress); - let value = values[i]; + const value = values[i]; log.debug("Got from: {}", [from.id]); log.debug("Got to: {}", [to.id]); @@ -164,6 +187,7 @@ export function handleBatchValueTransfer(event: BatchValueTransfer): void { // Burn value if (!from.tokenID.isZero() && to.tokenID.isZero()) { from.units = from.units.minus(value); + from.owner = ZERO_ADDRESS; } log.debug("Saving from: {}", [from.id]); diff --git a/graph/src/utils.ts b/graph/src/utils.ts index a401c245..2828cc15 100644 --- a/graph/src/utils.ts +++ b/graph/src/utils.ts @@ -1,6 +1,17 @@ -import { Address, BigInt, Bytes, log } from "@graphprotocol/graph-ts"; -import { Allowlist, Claim, ClaimToken } from "../generated/schema"; import { HypercertMinter } from "../generated/HypercertMinter/HypercertMinter"; +import { + AcceptedToken, + Allowlist, + Claim, + ClaimToken, + Offer, + Token, +} from "../generated/schema"; +import { Address, BigInt, Bytes, log } from "@graphprotocol/graph-ts"; + +export const ZERO_ADDRESS = Address.fromString( + "0x0000000000000000000000000000000000000000", +); export function getID(tokenID: BigInt, contract: Address): string { return contract.toHexString().concat("-".concat(tokenID.toString())); @@ -9,9 +20,9 @@ export function getID(tokenID: BigInt, contract: Address): string { export function getOrCreateAllowlist( claimID: BigInt, root: Bytes, - contract: Address + contract: Address, ): Allowlist { - let id = getID(claimID, contract); + const id = getID(claimID, contract); let list = Allowlist.load(id); log.debug("Created allowlistID: {}", [id]); @@ -29,18 +40,24 @@ export function getOrCreateAllowlist( export function getOrCreateClaim( claimID: BigInt, contract: Address, - timestamp: BigInt + timestamp: BigInt, ): Claim { - let id = getID(claimID, contract); + const id = getID(claimID, contract); let claim = Claim.load(id); log.debug("Created claimID: {}", [id]); if (claim == null) { claim = new Claim(id); + const list = Allowlist.load(id); + if (timestamp) { claim.creation = timestamp; } + + if (list) { + claim.allowlist = list.id; + } claim.tokenID = claimID; claim.contract = contract.toHexString(); claim.save(); @@ -52,17 +69,17 @@ export function getOrCreateClaim( export function getOrCreateClaimToken( claimID: BigInt, tokenID: BigInt, - contract: Address + contract: Address, ): ClaimToken { - let minterContract = HypercertMinter.bind(contract); + const minterContract = HypercertMinter.bind(contract); - let id = getID(tokenID, contract); + const id = getID(tokenID, contract); let fraction = ClaimToken.load(id); if (fraction == null) { log.debug("Creating claimToken: {}", [id]); - let owner = minterContract.ownerOf(tokenID); + const owner = minterContract.ownerOf(tokenID); fraction = new ClaimToken(id); fraction.owner = owner; @@ -74,3 +91,108 @@ export function getOrCreateClaimToken( return fraction; } + +export function getOrCreateToken(token: Address): Token { + const _tokenID = token.toHexString(); + let _token = Token.load(_tokenID); + + if (_token == null) { + _token = new Token(_tokenID); + log.debug("Created Token: {}", [_tokenID]); + _token.name = "Native"; + _token.save(); + } + + log.debug("Returning Token: {}", [_tokenID]); + + return _token; +} + +export function getOrCreateAcceptedToken( + offerID: BigInt, + token: Address, + minimumAmountPerUnit: BigInt, +): AcceptedToken { + const _acceptedTokenID = offerID + .toHexString() + .concat("-".concat(token.toHexString())); + let acceptedToken = AcceptedToken.load(_acceptedTokenID); + + if (acceptedToken == null) { + acceptedToken = new AcceptedToken(_acceptedTokenID); + log.debug("Created acceptedToken: {}", [_acceptedTokenID]); + + acceptedToken.token = getOrCreateToken(token).id; + acceptedToken.minimumAmountPerUnit = minimumAmountPerUnit; + acceptedToken.accepted = true; + acceptedToken.save(); + } + + log.debug("Returning acceptedToken: {}", [_acceptedTokenID]); + return acceptedToken; +} + +export function getOrCreateOffer( + hypercertContract: Address, + traderContract: Address, + fractionID: BigInt, + offerID: BigInt, +): Offer { + const _traderContract = HypercertTrader.bind(traderContract); + + const _fractionID = getID(fractionID, hypercertContract); + const _offerID = fractionID + .toHexString() + .concat("-".concat(offerID.toString())); + let offer = Offer.load(_offerID); + + if (offer == null) { + const offerOnChain = _traderContract.getOffer(offerID); + offer = new Offer(_offerID); + log.debug("Created offer: {}", [_offerID]); + + offer.fractionID = _fractionID; + offer.unitsAvailable = offerOnChain.unitsAvailable; + offer.minUnitsPerTrade = offerOnChain.minUnitsPerTrade; + offer.maxUnitsPerTrade = offerOnChain.maxUnitsPerTrade; + offer.acceptedTokens = []; + offer.status = "Open"; + + for (let i = 0; i < offerOnChain.acceptedTokens.length; i++) { + const _acceptedToken = offerOnChain.acceptedTokens[i]; + const parsedToken = getOrCreateAcceptedToken( + offerID, + _acceptedToken.token, + _acceptedToken.minimumAmountPerUnit, + ); + offer.acceptedTokens.push(parsedToken.id.toString()); + log.debug("Added accepted token to offer {} at place {}", [ + _offerID, + _acceptedToken.length.toString(), + ]); + } + + log.debug("Created offerID: {}", [_offerID]); + offer.save(); + } + + log.debug("Returning offer: {}", [_offerID]); + + return offer; +} + +export function getOrCreateOfferByID( + hypercertContract: Address, + fractionID: BigInt, + offerID: BigInt, +): Offer | null { + const _fractionID = getID(fractionID, hypercertContract); + const _offerID = _fractionID.concat("-".concat(offerID.toString())); + const offer = Offer.load(_offerID); + + if (offer == null) { + log.error("Offer with ID {} does not exist", [_offerID]); + } + + return offer; +} diff --git a/graph/subgraph.yaml b/graph/subgraph.yaml index ada9aab5..6b664dde 100644 --- a/graph/subgraph.yaml +++ b/graph/subgraph.yaml @@ -33,11 +33,9 @@ dataSources: handler: handleLeafClaimed - event: OwnershipTransferred(indexed address,indexed address) handler: handleOwnershipTransferred - - event: TransferBatch(indexed address,indexed address,indexed - address,uint256[],uint256[]) + - event: TransferBatch(indexed address,indexed address,indexed address,uint256[],uint256[]) handler: handleTransferBatch - - event: TransferSingle(indexed address,indexed address,indexed - address,uint256,uint256) + - event: TransferSingle(indexed address,indexed address,indexed address,uint256,uint256) handler: handleTransferSingle - event: URI(string,indexed uint256) handler: handleURI diff --git a/graph/tests/.latest.json b/graph/tests/.latest.json index 4651dd06..5afb1807 100644 --- a/graph/tests/.latest.json +++ b/graph/tests/.latest.json @@ -1,4 +1,4 @@ { "version": "0.6.0", - "timestamp": 1698094053842 + "timestamp": 1701971111457 } diff --git a/graph/tests/hypercert-minter-burn.test.ts b/graph/tests/hypercert-minter-burn.test.ts new file mode 100644 index 00000000..09d35de4 --- /dev/null +++ b/graph/tests/hypercert-minter-burn.test.ts @@ -0,0 +1,189 @@ +import { + handleTransferSingle, + handleValueTransfer, + handleBatchValueTransfer, + handleTransferBatch, +} from "../src/hypercert-minter"; +import { + createBatchValueTransferEvent, + createTransferBatchEvent, + createTransferSingleEvent, + createValueTransferEvent, + getDefaultContractAddress, + ZERO_ADDRESS, + ZERO_TOKEN, +} from "./hypercert-minter-utils"; +import { Address, BigInt, ethereum } from "@graphprotocol/graph-ts"; +import { + assert, + describe, + test, + clearStore, + beforeAll, + createMockedFunction, + afterEach, +} from "matchstick-as/assembly/index"; + +export { handleTransferSingle, handleValueTransfer, handleBatchValueTransfer }; + +describe("Describe entity assertions", () => { + beforeAll(() => {}); + + afterEach(() => { + clearStore(); + }); + + test("TransferSingle and TransferValue for an existing token to zero address burns the fraction", () => { + let from = Address.fromString("0x0000000000000000000000000000000000000001"); + + let claimID = BigInt.fromI64(1); + let fromID = BigInt.fromI64(0); + let toID = BigInt.fromI64(1); + let units = BigInt.fromI64(10000); + + // Create fraction token + let valueTransferEvent = createValueTransferEvent( + claimID, + fromID, + toID, + units, + ); + + createMockedFunction( + getDefaultContractAddress(), + "ownerOf", + "ownerOf(uint256):(address)", + ) + .withArgs([ethereum.Value.fromUnsignedBigInt(toID)]) + .returns([ethereum.Value.fromAddress(from)]); + + createMockedFunction( + getDefaultContractAddress(), + "ownerOf", + "ownerOf(uint256):(address)", + ) + .withArgs([ethereum.Value.fromUnsignedBigInt(fromID)]) + .returns([ethereum.Value.fromAddress(from)]); + + handleValueTransfer(valueTransferEvent); + + let fractionId = getDefaultContractAddress().toHexString().concat("-1"); + + assert.fieldEquals("ClaimToken", fractionId, "owner", from.toHexString()); + assert.fieldEquals("ClaimToken", fractionId, "units", "10000"); + + // Handle 1155 transfer to zero address + let transferSingleEvent = createTransferSingleEvent( + from, + from, + ZERO_ADDRESS, + BigInt.fromI64(1), + BigInt.fromI64(1), + ); + + handleTransferSingle(transferSingleEvent); + + assert.fieldEquals( + "ClaimToken", + fractionId, + "owner", + ZERO_ADDRESS.toHexString(), + ); + assert.fieldEquals("ClaimToken", fractionId, "units", "10000"); + + // Handle hypercert units transfer + let valueTransferEvent2 = createValueTransferEvent( + claimID, + toID, + ZERO_TOKEN, + units, + ); + + handleValueTransfer(valueTransferEvent2); + + assert.fieldEquals( + "ClaimToken", + fractionId, + "owner", + ZERO_ADDRESS.toHexString(), + ); + assert.fieldEquals("ClaimToken", fractionId, "units", "0"); + }); + + test("TransferBatch and BatchTransferValue for an existing token to zero address burns the fraction", () => { + let from = Address.fromString("0x0000000000000000000000000000000000000001"); + + let claimID = BigInt.fromI64(1); + let fromID = BigInt.fromI64(0); + let toID = BigInt.fromI64(1); + let units = BigInt.fromI64(10000); + + // Create fraction token + let valueTransferEvent = createBatchValueTransferEvent( + [claimID], + [fromID], + [toID], + [units], + ); + + createMockedFunction( + getDefaultContractAddress(), + "ownerOf", + "ownerOf(uint256):(address)", + ) + .withArgs([ethereum.Value.fromUnsignedBigInt(toID)]) + .returns([ethereum.Value.fromAddress(from)]); + + createMockedFunction( + getDefaultContractAddress(), + "ownerOf", + "ownerOf(uint256):(address)", + ) + .withArgs([ethereum.Value.fromUnsignedBigInt(fromID)]) + .returns([ethereum.Value.fromAddress(from)]); + + handleBatchValueTransfer(valueTransferEvent); + + let fractionId = getDefaultContractAddress().toHexString().concat("-1"); + + assert.fieldEquals("ClaimToken", fractionId, "owner", from.toHexString()); + assert.fieldEquals("ClaimToken", fractionId, "units", "10000"); + + // Handle 1155 transfer to zero address + let transferBatchEvent = createTransferBatchEvent( + from, + from, + ZERO_ADDRESS, + [BigInt.fromI64(1)], + [BigInt.fromI64(1)], + ); + + handleTransferBatch(transferBatchEvent); + + assert.fieldEquals( + "ClaimToken", + fractionId, + "owner", + ZERO_ADDRESS.toHexString(), + ); + assert.fieldEquals("ClaimToken", fractionId, "units", "10000"); + + // Handle hypercert units transfer + let valueTransferEvent2 = createBatchValueTransferEvent( + [claimID], + [toID], + [ZERO_TOKEN], + [units], + ); + + handleBatchValueTransfer(valueTransferEvent2); + + assert.fieldEquals( + "ClaimToken", + fractionId, + "owner", + ZERO_ADDRESS.toHexString(), + ); + assert.fieldEquals("ClaimToken", fractionId, "units", "0"); + }); +}); diff --git a/graph/tests/hypercert-minter-claim.test.ts b/graph/tests/hypercert-minter-claim.test.ts index 38c403c0..b7a6e45a 100644 --- a/graph/tests/hypercert-minter-claim.test.ts +++ b/graph/tests/hypercert-minter-claim.test.ts @@ -20,7 +20,7 @@ describe("Describe entity assertions", () => { let claimStoredEvent = createClaimStoredEvent( BigInt.fromI64(1), "ipfs://exampleshash", - BigInt.fromI64(10000) + BigInt.fromI64(10000), ); handleClaimStored(claimStoredEvent); }); @@ -43,13 +43,13 @@ describe("Describe entity assertions", () => { "Claim", claimId, "creator", - "0xa16081f360e3847006db660bae1c6d1b2e17ec2a" + "0xa16081f360e3847006db660bae1c6d1b2e17ec2a", ); assert.fieldEquals( "Claim", claimId, "owner", - "0xa16081f360e3847006db660bae1c6d1b2e17ec2a" + "0xa16081f360e3847006db660bae1c6d1b2e17ec2a", ); assert.fieldEquals("Claim", claimId, "totalUnits", "10000"); }); diff --git a/graph/tests/hypercert-minter-utils.ts b/graph/tests/hypercert-minter-utils.ts index 53a64853..e1694735 100644 --- a/graph/tests/hypercert-minter-utils.ts +++ b/graph/tests/hypercert-minter-utils.ts @@ -1,5 +1,3 @@ -import { newMockEvent } from "matchstick-as"; -import { ethereum, Address, BigInt, Bytes } from "@graphprotocol/graph-ts"; import { AllowlistCreated, BatchValueTransfer, @@ -10,6 +8,13 @@ import { URI, ValueTransfer, } from "../generated/HypercertMinter/HypercertMinter"; +import { ethereum, Address, BigInt, Bytes } from "@graphprotocol/graph-ts"; +import { newMockEvent } from "matchstick-as"; + +export const ZERO_ADDRESS = Address.fromString( + "0x0000000000000000000000000000000000000000", +); +export const ZERO_TOKEN = BigInt.fromI32(0); export function getDefaultContractAddress(): Address { return Address.fromString("0x89205A3A3b2A69De6Dbf7f01ED13B2108B2c43e7"); @@ -28,7 +33,7 @@ export function buildZeroes(size: BigInt): BigInt[] { export function buildIDs( size: BigInt, - start: BigInt = BigInt.zero() + start: BigInt = BigInt.zero(), ): BigInt[] { let array: BigInt[] = []; for (let i = 0; i < size.toI32(); i++) { @@ -54,7 +59,7 @@ export function buildValues(size: BigInt): BigInt[] { export function createAllowlistCreatedEvent( tokenID: BigInt, - root: Bytes + root: Bytes, ): AllowlistCreated { let mockEvent = newMockEvent(); let parameters: ethereum.EventParam[] = new Array(); @@ -64,11 +69,11 @@ export function createAllowlistCreatedEvent( parameters.push( new ethereum.EventParam( "tokenID", - ethereum.Value.fromUnsignedBigInt(tokenID) - ) + ethereum.Value.fromUnsignedBigInt(tokenID), + ), ); parameters.push( - new ethereum.EventParam("root", ethereum.Value.fromFixedBytes(root)) + new ethereum.EventParam("root", ethereum.Value.fromFixedBytes(root)), ); let allowlistCreatedEvent = new AllowlistCreated( @@ -79,7 +84,7 @@ export function createAllowlistCreatedEvent( mockEvent.block, mockEvent.transaction, parameters, - mockEvent.receipt + mockEvent.receipt, ); return allowlistCreatedEvent; @@ -88,7 +93,7 @@ export function createAllowlistCreatedEvent( export function createClaimStoredEvent( claimID: BigInt, uri: string, - totalUnits: BigInt + totalUnits: BigInt, ): ClaimStored { let mockEvent = newMockEvent(); let parameters: ethereum.EventParam[] = new Array(); @@ -96,18 +101,18 @@ export function createClaimStoredEvent( parameters.push( new ethereum.EventParam( "claimID", - ethereum.Value.fromUnsignedBigInt(claimID) - ) + ethereum.Value.fromUnsignedBigInt(claimID), + ), ); parameters.push( - new ethereum.EventParam("uri", ethereum.Value.fromString(uri)) + new ethereum.EventParam("uri", ethereum.Value.fromString(uri)), ); parameters.push( new ethereum.EventParam( "totalUnits", - ethereum.Value.fromUnsignedBigInt(totalUnits) - ) + ethereum.Value.fromUnsignedBigInt(totalUnits), + ), ); let claimStoredEvent = new ClaimStored( @@ -118,7 +123,7 @@ export function createClaimStoredEvent( mockEvent.block, mockEvent.transaction, parameters, - mockEvent.receipt + mockEvent.receipt, ); return claimStoredEvent; @@ -126,7 +131,7 @@ export function createClaimStoredEvent( export function createLeafClaimedEvent( tokenID: BigInt, - leaf: Bytes + leaf: Bytes, ): LeafClaimed { let leafClaimedEvent = changetype(newMockEvent()); @@ -135,11 +140,11 @@ export function createLeafClaimedEvent( leafClaimedEvent.parameters.push( new ethereum.EventParam( "tokenID", - ethereum.Value.fromUnsignedBigInt(tokenID) - ) + ethereum.Value.fromUnsignedBigInt(tokenID), + ), ); leafClaimedEvent.parameters.push( - new ethereum.EventParam("leaf", ethereum.Value.fromFixedBytes(leaf)) + new ethereum.EventParam("leaf", ethereum.Value.fromFixedBytes(leaf)), ); return leafClaimedEvent; @@ -150,29 +155,39 @@ export function createTransferBatchEvent( from: Address, to: Address, ids: Array, - values: Array + values: Array, ): TransferBatch { - let transferBatchEvent = changetype(newMockEvent()); - - transferBatchEvent.parameters = new Array(); + let mockEvent = newMockEvent(); + let parameters: ethereum.EventParam[] = new Array(); - transferBatchEvent.parameters.push( - new ethereum.EventParam("operator", ethereum.Value.fromAddress(operator)) + parameters.push( + new ethereum.EventParam("operator", ethereum.Value.fromAddress(operator)), ); - transferBatchEvent.parameters.push( - new ethereum.EventParam("from", ethereum.Value.fromAddress(from)) + parameters.push( + new ethereum.EventParam("from", ethereum.Value.fromAddress(from)), ); - transferBatchEvent.parameters.push( - new ethereum.EventParam("to", ethereum.Value.fromAddress(to)) + parameters.push( + new ethereum.EventParam("to", ethereum.Value.fromAddress(to)), ); - transferBatchEvent.parameters.push( - new ethereum.EventParam("ids", ethereum.Value.fromUnsignedBigIntArray(ids)) + parameters.push( + new ethereum.EventParam("ids", ethereum.Value.fromUnsignedBigIntArray(ids)), ); - transferBatchEvent.parameters.push( + parameters.push( new ethereum.EventParam( "values", - ethereum.Value.fromUnsignedBigIntArray(values) - ) + ethereum.Value.fromUnsignedBigIntArray(values), + ), + ); + + let transferBatchEvent = new TransferBatch( + getDefaultContractAddress(), + mockEvent.logIndex, + mockEvent.transactionLogIndex, + mockEvent.logType, + mockEvent.block, + mockEvent.transaction, + parameters, + mockEvent.receipt, ); return transferBatchEvent; @@ -183,25 +198,25 @@ export function createTransferSingleEvent( from: Address, to: Address, id: BigInt, - value: BigInt + value: BigInt, ): TransferSingle { let mockEvent = newMockEvent(); let parameters: ethereum.EventParam[] = new Array(); parameters.push( - new ethereum.EventParam("operator", ethereum.Value.fromAddress(operator)) + new ethereum.EventParam("operator", ethereum.Value.fromAddress(operator)), ); parameters.push( - new ethereum.EventParam("from", ethereum.Value.fromAddress(from)) + new ethereum.EventParam("from", ethereum.Value.fromAddress(from)), ); parameters.push( - new ethereum.EventParam("to", ethereum.Value.fromAddress(to)) + new ethereum.EventParam("to", ethereum.Value.fromAddress(to)), ); parameters.push( - new ethereum.EventParam("id", ethereum.Value.fromUnsignedBigInt(id)) + new ethereum.EventParam("id", ethereum.Value.fromUnsignedBigInt(id)), ); parameters.push( - new ethereum.EventParam("value", ethereum.Value.fromUnsignedBigInt(value)) + new ethereum.EventParam("value", ethereum.Value.fromUnsignedBigInt(value)), ); let transferSingleEvent = new TransferSingle( @@ -212,7 +227,7 @@ export function createTransferSingleEvent( mockEvent.block, mockEvent.transaction, parameters, - mockEvent.receipt + mockEvent.receipt, ); return transferSingleEvent; @@ -224,20 +239,20 @@ export function createURIEvent(value: string, id: BigInt): URI { uriEvent.parameters = new Array(); uriEvent.parameters.push( - new ethereum.EventParam("value", ethereum.Value.fromString(value)) + new ethereum.EventParam("value", ethereum.Value.fromString(value)), ); uriEvent.parameters.push( - new ethereum.EventParam("id", ethereum.Value.fromUnsignedBigInt(id)) + new ethereum.EventParam("id", ethereum.Value.fromUnsignedBigInt(id)), ); return uriEvent; } export function createHypercertMinterUpgradedEvent( - implementation: Address + implementation: Address, ): HypercertMinterUpgraded { let hypercertMinterUpgradedEvent = changetype( - newMockEvent() + newMockEvent(), ); hypercertMinterUpgradedEvent.parameters = new Array(); @@ -245,8 +260,8 @@ export function createHypercertMinterUpgradedEvent( hypercertMinterUpgradedEvent.parameters.push( new ethereum.EventParam( "implementation", - ethereum.Value.fromAddress(implementation) - ) + ethereum.Value.fromAddress(implementation), + ), ); return hypercertMinterUpgradedEvent; @@ -256,7 +271,7 @@ export function createValueTransferEvent( claimID: BigInt, fromTokenID: BigInt, toTokenID: BigInt, - value: BigInt + value: BigInt, ): ValueTransfer { let mockEvent = newMockEvent(); let parameters: ethereum.EventParam[] = new Array(); @@ -264,24 +279,24 @@ export function createValueTransferEvent( parameters.push( new ethereum.EventParam( "claimID", - ethereum.Value.fromUnsignedBigInt(claimID) - ) + ethereum.Value.fromUnsignedBigInt(claimID), + ), ); parameters.push( new ethereum.EventParam( "fromTokenID", - ethereum.Value.fromUnsignedBigInt(fromTokenID) - ) + ethereum.Value.fromUnsignedBigInt(fromTokenID), + ), ); parameters.push( new ethereum.EventParam( "toTokenID", - ethereum.Value.fromUnsignedBigInt(toTokenID) - ) + ethereum.Value.fromUnsignedBigInt(toTokenID), + ), ); parameters.push( - new ethereum.EventParam("value", ethereum.Value.fromUnsignedBigInt(value)) + new ethereum.EventParam("value", ethereum.Value.fromUnsignedBigInt(value)), ); let valueTransferEvent = new ValueTransfer( @@ -292,7 +307,7 @@ export function createValueTransferEvent( mockEvent.block, mockEvent.transaction, parameters, - mockEvent.receipt + mockEvent.receipt, ); return valueTransferEvent; @@ -302,7 +317,7 @@ export function createBatchValueTransferEvent( claimIDs: BigInt[], fromTokenIDs: BigInt[], toTokenIDs: BigInt[], - values: BigInt[] + values: BigInt[], ): BatchValueTransfer { let mockEvent = newMockEvent(); let parameters: ethereum.EventParam[] = new Array(); @@ -310,26 +325,26 @@ export function createBatchValueTransferEvent( parameters.push( new ethereum.EventParam( "claimIDs", - ethereum.Value.fromUnsignedBigIntArray(claimIDs) - ) + ethereum.Value.fromUnsignedBigIntArray(claimIDs), + ), ); parameters.push( new ethereum.EventParam( "fromTokenIDs", - ethereum.Value.fromUnsignedBigIntArray(fromTokenIDs) - ) + ethereum.Value.fromUnsignedBigIntArray(fromTokenIDs), + ), ); parameters.push( new ethereum.EventParam( "toTokenIDs", - ethereum.Value.fromUnsignedBigIntArray(toTokenIDs) - ) + ethereum.Value.fromUnsignedBigIntArray(toTokenIDs), + ), ); parameters.push( new ethereum.EventParam( "values", - ethereum.Value.fromUnsignedBigIntArray(values) - ) + ethereum.Value.fromUnsignedBigIntArray(values), + ), ); let batchValueTransferEvent = new BatchValueTransfer( @@ -340,7 +355,7 @@ export function createBatchValueTransferEvent( mockEvent.block, mockEvent.transaction, parameters, - mockEvent.receipt + mockEvent.receipt, ); return batchValueTransferEvent; diff --git a/package.json b/package.json index 38706568..90eb0ffd 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,13 @@ { "name": "hypercerts", "description": "Scalable retrospective reward systems for impact", - "version": "0.0.0", + "version": "1.0.0-alpha.0", "author": "Hypercerts Foundation", "license": "Apache-2.0", "private": true, "scripts": { "build": "turbo run build --concurrency=100%", + "build:graph": "turbo run build --filter=@hypercerts-org/graph --", "copy": "pnpm copy:frontend && pnpm copy:docs && pnpm copy:html", "copy:docs": "mkdir -p ./build/docs/ && cp -r ./docs/build/* ./build/docs/", "copy:frontend": "mkdir -p ./build/ && cp -r ./frontend/out/* ./build/ && cp ./frontend/_redirects ./build/", @@ -46,8 +47,13 @@ "type": "git", "url": "git+https://github.com/hypercerts-org/hypercerts.git" }, - "resolutions": { - "graphql": "^16.6.0", - "ethers": "^5.7.2" + "overrides": { + "graphql": "^16.8.1", + "@hypercerts/contracts": { + "ethers": "6.8.0" + }, + "@hypercerts/frontend": { + "ethers": "5.7.2" + } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 531025b1..c75202e8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,10 +4,6 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false -overrides: - graphql: ^16.6.0 - ethers: ^5.7.2 - importers: .: @@ -17,7 +13,7 @@ importers: version: 1.39.0 '@synthetixio/synpress': specifier: ^3.7.1 - version: 3.7.1(@babel/core@7.23.2)(@babel/preset-env@7.23.2)(babel-loader@9.1.3)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(webpack@5.89.0) + version: 3.7.1(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(babel-loader@9.1.3)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.2)(webpack@5.89.0) husky: specifier: ^8.0.3 version: 8.0.3 @@ -32,7 +28,14 @@ importers: version: 1.10.16 contracts: + dependencies: + hardhat: + specifier: ^2.18.3 + version: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) devDependencies: + '@chainlink/contracts': + specifier: ^0.8.0 + version: 0.8.0(ethers@6.8.0) '@commitlint/cli': specifier: ^17.1.2 version: 17.8.1 @@ -41,40 +44,34 @@ importers: version: 17.8.1 '@dlsl/hardhat-markup': specifier: ^1.0.0-rc.7 - version: 1.0.0-rc.14(hardhat@2.13.1)(prettier@2.8.8) - '@ethersproject/abi': - specifier: ^5.7.0 - version: 5.7.0 - '@ethersproject/bytes': - specifier: ^5.7.0 - version: 5.7.0 - '@ethersproject/providers': - specifier: ^5.7.2 - version: 5.7.2 + version: 1.0.0-rc.14(hardhat@2.18.3)(prettier@2.8.8) + '@looksrare/contracts-libs': + specifier: ^3.4.0 + version: 3.4.0 '@nomicfoundation/hardhat-chai-matchers': - specifier: ^1.0.5 - version: 1.0.6(@nomiclabs/hardhat-ethers@2.2.3)(chai@4.3.10)(ethers@5.7.2)(hardhat@2.13.1) - '@nomicfoundation/hardhat-network-helpers': - specifier: ^1.0.7 - version: 1.0.9(hardhat@2.13.1) + specifier: ^2.0.2 + version: 2.0.2(@nomicfoundation/hardhat-ethers@3.0.4)(chai@4.3.10)(ethers@6.8.0)(hardhat@2.18.3) + '@nomicfoundation/hardhat-ethers': + specifier: ^3.0.4 + version: 3.0.4(ethers@6.8.0)(hardhat@2.18.3) '@nomicfoundation/hardhat-toolbox': - specifier: ^2.0.0 - version: 2.0.2(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(@nomicfoundation/hardhat-chai-matchers@1.0.6)(@nomicfoundation/hardhat-network-helpers@1.0.9)(@nomiclabs/hardhat-ethers@2.2.3)(@nomiclabs/hardhat-etherscan@3.1.7)(@typechain/ethers-v5@11.1.2)(@typechain/hardhat@9.1.0)(@types/chai@4.3.9)(@types/mocha@9.1.0)(@types/node@18.18.6)(chai@4.3.10)(ethers@5.7.2)(hardhat-gas-reporter@1.0.9)(hardhat@2.13.1)(solidity-coverage@0.8.5)(ts-node@10.9.1)(typechain@8.3.2)(typescript@4.9.5) - '@nomiclabs/hardhat-ethers': - specifier: ^2.2.1 - version: 2.2.3(ethers@5.7.2)(hardhat@2.13.1) - '@nomiclabs/hardhat-etherscan': - specifier: ^3.1.3 - version: 3.1.7(hardhat@2.13.1) - '@openzeppelin/hardhat-defender': - specifier: ^1.8.2 - version: 1.9.0(@nomiclabs/hardhat-ethers@2.2.3)(@nomiclabs/hardhat-etherscan@3.1.7)(ethers@5.7.2)(hardhat@2.13.1) + specifier: ^3.0.0 + version: 3.0.0(@nomicfoundation/hardhat-chai-matchers@2.0.2)(@nomicfoundation/hardhat-ethers@3.0.4)(@nomicfoundation/hardhat-network-helpers@1.0.9)(@nomicfoundation/hardhat-verify@1.1.1)(@typechain/ethers-v6@0.4.3)(@typechain/hardhat@8.0.3)(@types/chai@4.3.11)(@types/mocha@9.1.0)(@types/node@18.18.7)(chai@4.3.10)(ethers@6.8.0)(hardhat-gas-reporter@1.0.9)(hardhat@2.18.3)(solidity-coverage@0.8.5)(ts-node@10.9.1)(typechain@8.3.2)(typescript@4.9.5) + '@nomicfoundation/hardhat-viem': + specifier: ^1.0.0 + version: 1.0.0(hardhat@2.18.3)(typescript@4.9.5)(viem@1.18.9) + '@openzeppelin/contracts': + specifier: ^4.9.3 + version: 4.9.3 + '@openzeppelin/defender-sdk': + specifier: ^1.4.0 + version: 1.4.0(@ethersproject/abstract-provider@5.7.0)(@ethersproject/abstract-signer@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2)(@ethersproject/transactions@5.7.0)(web3-core-helpers@1.10.3)(web3-core@1.10.3)(web3-utils@1.10.3)(web3@1.10.3) '@openzeppelin/hardhat-upgrades': - specifier: ^1.28 - version: 1.28.0(@nomiclabs/hardhat-ethers@2.2.3)(@nomiclabs/hardhat-etherscan@3.1.7)(ethers@5.7.2)(hardhat@2.13.1) + specifier: 2.3.3 + version: 2.3.3(@nomicfoundation/hardhat-ethers@3.0.4)(@nomicfoundation/hardhat-verify@1.1.1)(ethers@6.8.0)(hardhat@2.18.3) '@primitivefi/hardhat-dodoc': specifier: ^0.2.3 - version: 0.2.3(hardhat@2.13.1)(squirrelly@8.0.8) + version: 0.2.3(hardhat@2.18.3)(squirrelly@8.0.8) '@rollup/plugin-commonjs': specifier: ^24.0.1 version: 24.1.0(rollup@4.1.4) @@ -87,42 +84,24 @@ importers: '@trivago/prettier-plugin-sort-imports': specifier: ^3.3.0 version: 3.4.0(prettier@2.8.8) - '@typechain/ethers-v5': - specifier: ^11.1.1 - version: 11.1.2(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2)(typescript@4.9.5) - '@typechain/hardhat': - specifier: ^9.0.0 - version: 9.1.0(@typechain/ethers-v6@0.5.1)(ethers@5.7.2)(hardhat@2.13.1)(typechain@8.3.2) - '@types/chai': - specifier: ^4.3.4 - version: 4.3.9 - '@types/mocha': - specifier: 9.1.0 - version: 9.1.0 '@types/node': specifier: ^18.11.11 - version: 18.18.6 + version: 18.18.7 '@typescript-eslint/eslint-plugin': specifier: ^5.38.0 version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.52.0)(typescript@4.9.5) '@typescript-eslint/parser': specifier: ^5.38.0 version: 5.62.0(eslint@8.52.0)(typescript@4.9.5) - chai: - specifier: ^4.3.7 - version: 4.3.10 commitizen: specifier: ^4.2.5 - version: 4.3.0 - copyfiles: - specifier: ^2.4.1 - version: 2.4.1 + version: 4.3.0(typescript@4.9.5) cross-env: specifier: ^7.0.3 version: 7.0.3 cz-conventional-changelog: specifier: ^3.3.0 - version: 3.3.0 + version: 3.3.0(typescript@4.9.5) dotenv: specifier: ^16.0.2 version: 16.3.1 @@ -133,20 +112,14 @@ importers: specifier: ^8.5.0 version: 8.10.0(eslint@8.52.0) ethers: - specifier: ^5.7.2 - version: 5.7.2 - hardhat: - specifier: 2.13.1 - version: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) + specifier: ^6.8.0 + version: 6.8.0 hardhat-abi-exporter: specifier: ^2.10.1 - version: 2.10.1(hardhat@2.13.1) - hardhat-gas-reporter: - specifier: ^1.0.9 - version: 1.0.9(hardhat@2.13.1) + version: 2.10.1(hardhat@2.18.3) hardhat-preprocessor: specifier: ^0.1.5 - version: 0.1.5(hardhat@2.13.1) + version: 0.1.5(hardhat@2.18.3) husky: specifier: ^8.0.1 version: 8.0.3 @@ -168,12 +141,15 @@ importers: rollup-plugin-auto-external: specifier: ^2.0.0 version: 2.0.0(rollup@4.1.4) + rollup-plugin-copy: + specifier: ^3.5.0 + version: 3.5.0 rollup-plugin-dts: specifier: ^6.1.0 version: 6.1.0(rollup@4.1.4)(typescript@4.9.5) rollup-plugin-esbuild: specifier: ^6.1.0 - version: 6.1.0(esbuild@0.19.5)(rollup@4.1.4) + version: 6.1.0(esbuild@0.19.8)(rollup@4.1.4) rollup-plugin-node-polyfills: specifier: ^0.2.1 version: 0.2.1 @@ -186,24 +162,30 @@ importers: solhint-plugin-prettier: specifier: ^0.0.5 version: 0.0.5(prettier-plugin-solidity@1.1.3)(prettier@2.8.8) - solidity-coverage: - specifier: ^0.8.2 - version: 0.8.5(hardhat@2.13.1) + solmate: + specifier: ^6.2.0 + version: 6.2.0 ts-node: specifier: ^10.9.1 - version: 10.9.1(@types/node@18.18.6)(typescript@4.9.5) + version: 10.9.1(@types/node@18.18.7)(typescript@4.9.5) typechain: specifier: ^8.3.1 version: 8.3.2(typescript@4.9.5) typescript: specifier: ^4.9.4 version: 4.9.5 + viem: + specifier: ^1.18.9 + version: 1.18.9(typescript@4.9.5) + xdeployer: + specifier: ^2.1.13 + version: 2.1.13(@nomicfoundation/hardhat-ethers@3.0.4)(ethers@6.8.0)(hardhat@2.18.3) cors-proxy: devDependencies: '@cloudflare/workers-types': specifier: ^4.20230115.0 - version: 4.20231016.0 + version: 4.20231025.0 typescript: specifier: ^4.9.5 version: 4.9.5 @@ -220,23 +202,23 @@ importers: specifier: 0.8.11 version: 0.8.11 '@openzeppelin/defender-autotask-client': - specifier: ^1.48.0 - version: 1.49.0 + specifier: 1.50.0 + version: 1.50.0 '@openzeppelin/defender-autotask-utils': - specifier: ^1.48.0 - version: 1.49.0 + specifier: 1.50.0 + version: 1.50.0 '@openzeppelin/defender-base-client': - specifier: ^1.48.0 + specifier: 1.49.0 version: 1.49.0(debug@4.3.4) '@openzeppelin/defender-sentinel-client': - specifier: ^1.48.0 + specifier: 1.49.0 version: 1.49.0 '@openzeppelin/merkle-tree': specifier: ^1.0.2 version: 1.0.5 '@supabase/supabase-js': specifier: ^2.4.1 - version: 2.38.2 + version: 2.38.3 axios: specifier: ^1.2.6 version: 1.5.1(debug@4.3.4) @@ -244,7 +226,7 @@ importers: specifier: ^16.0.3 version: 16.3.1 ethers: - specifier: ^5.7.2 + specifier: 5.7.2 version: 5.7.2 node-fetch: specifier: ^3.3.0 @@ -252,7 +234,7 @@ importers: devDependencies: '@types/node': specifier: ^18.11.18 - version: 18.18.6 + version: 18.18.7 rimraf: specifier: ^5.0.5 version: 5.0.5 @@ -264,7 +246,7 @@ importers: version: 9.5.0(typescript@4.9.5)(webpack@5.89.0) ts-node: specifier: ^10.9.1 - version: 10.9.1(@types/node@18.18.6)(typescript@4.9.5) + version: 10.9.1(@types/node@18.18.7)(typescript@4.9.5) tsx: specifier: ^3.14.0 version: 3.14.0 @@ -282,13 +264,13 @@ importers: dependencies: '@docusaurus/core': specifier: ^2.4.1 - version: 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + version: 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/preset-classic': specifier: ^2.4.1 - version: 2.4.3(@algolia/client-search@4.20.0)(react-dom@18.2.0)(react@18.2.0)(search-insights@2.9.0)(typescript@4.9.5) + version: 2.4.3(@algolia/client-search@4.20.0)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(search-insights@2.9.0)(typescript@4.9.5) '@docusaurus/theme-mermaid': specifier: ^2.4.1 - version: 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + version: 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@mdx-js/react': specifier: ^1.6.22 version: 1.6.22(react@18.2.0) @@ -314,6 +296,9 @@ importers: specifier: ^18.2.0 version: 18.2.0(react@18.2.0) devDependencies: + '@docusaurus/eslint-plugin': + specifier: ^2.4.1 + version: 2.4.3(eslint@8.52.0)(typescript@4.9.5) '@docusaurus/module-type-aliases': specifier: ^2.4.1 version: 2.4.3(react-dom@18.2.0)(react@18.2.0) @@ -331,34 +316,34 @@ importers: version: 3.8.6(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0) '@celo/rainbowkit-celo': specifier: ^1.1.0 - version: 1.1.0(@rainbow-me/rainbowkit@1.0.8)(react@18.2.0)(typescript@5.1.6)(viem@1.5.3)(wagmi@1.3.9)(zod@3.22.4) + version: 1.1.0(@rainbow-me/rainbowkit@1.2.0)(react@18.2.0)(typescript@5.1.6)(viem@1.19.9)(wagmi@1.4.5)(zod@3.22.4) '@emotion/react': specifier: ^11.10.5 - version: 11.11.1(@types/react@18.2.31)(react@18.2.0) + version: 11.11.1(@types/react@18.2.33)(react@18.2.0) '@emotion/styled': specifier: ^11.10.5 - version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.31)(react@18.2.0) + version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) '@graphprotocol/client-cli': specifier: ^2.2.16 - version: 2.2.22(@babel/core@7.23.2)(@envelop/core@3.0.6)(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/delegate@9.0.35)(@graphql-tools/merge@8.4.2)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(@types/node@18.18.6)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6) + version: 2.2.22(@babel/core@7.23.5)(@envelop/core@3.0.6)(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/delegate@9.0.35)(@graphql-tools/merge@8.4.2)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(@types/node@18.18.7)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6) '@hypercerts-org/contracts': - specifier: 0.8.11 - version: 0.8.11 + specifier: 1.0.0-alpha.2 + version: 1.0.0-alpha.2(typescript@5.1.6) '@hypercerts-org/observabletreemap': specifier: 'workspace: *' version: link:../vendor/observabletreemap '@hypercerts-org/sdk': - specifier: 0.8.16 - version: 0.8.16(@envelop/core@3.0.6)(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(@graphql-tools/delegate@9.0.35)(@graphql-tools/merge@8.4.2)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(@types/node@18.18.6)(node-fetch@3.3.2)(react-dom@18.2.0)(react@18.2.0)(tslib@2.6.2)(typescript@5.1.6)(uint8arraylist@2.4.3) + specifier: 1.0.0-alpha.10 + version: 1.0.0-alpha.10(@envelop/core@3.0.6)(@graphql-tools/delegate@9.0.35)(@graphql-tools/merge@8.4.2)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(@types/node@18.18.7)(node-fetch@3.3.2)(react-dom@18.2.0)(react@18.2.0)(tslib@2.6.2)(typescript@5.1.6)(uint8arraylist@2.4.3)(zod@3.22.4) '@mui/icons-material': specifier: ^5.11.9 - version: 5.14.14(@mui/material@5.14.14)(@types/react@18.2.31)(react@18.2.0) + version: 5.14.15(@mui/material@5.14.15)(@types/react@18.2.33)(react@18.2.0) '@mui/material': specifier: ^5.11.2 - version: 5.14.14(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.31)(react-dom@18.2.0)(react@18.2.0) + version: 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) '@mui/x-date-pickers': specifier: ^5.0.12 - version: 5.0.20(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.14)(@mui/system@5.14.14)(@types/react@18.2.31)(dayjs@1.11.10)(react-dom@18.2.0)(react@18.2.0) + version: 5.0.20(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.15)(@mui/system@5.14.15)(@types/react@18.2.33)(dayjs@1.11.10)(react-dom@18.2.0)(react@18.2.0) '@next/eslint-plugin-next': specifier: ^13.4.12 version: 13.5.6 @@ -372,20 +357,20 @@ importers: specifier: ^1.0.171 version: 1.0.177(react-dom@18.2.0)(react@18.2.0) '@plasmicapp/loader-nextjs': - specifier: ^1.0.284 - version: 1.0.333(next@13.5.6)(react-dom@18.2.0)(react@18.2.0) + specifier: ^1.0.345 + version: 1.0.345(next@13.5.6)(react-dom@18.2.0)(react@18.2.0) '@rainbow-me/rainbowkit': - specifier: 1.0.8 - version: 1.0.8(@types/react@18.2.31)(react-dom@18.2.0)(react@18.2.0)(viem@1.5.3)(wagmi@1.3.9) + specifier: 1.2.0 + version: 1.2.0(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(viem@1.19.9)(wagmi@1.4.5) '@sentry/nextjs': specifier: ^7.73.0 - version: 7.74.1(next@13.5.6)(react@18.2.0)(webpack@5.89.0) + version: 7.75.1(next@13.5.6)(react@18.2.0)(webpack@5.89.0) '@sentry/utils': specifier: ^7.73.0 - version: 7.74.1 + version: 7.75.1 '@supabase/supabase-js': specifier: ^2.1.2 - version: 2.38.2 + version: 2.38.3 '@tanstack/react-query': specifier: ^4.36.1 version: 4.36.1(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0) @@ -411,17 +396,17 @@ importers: specifier: ^16.0.3 version: 16.3.1 ethers: - specifier: ^5.7.2 + specifier: 5.7.2 version: 5.7.2 formik: specifier: ^2.2.9 version: 2.4.5(react@18.2.0) formik-mui: specifier: ^5.0.0-alpha.0 - version: 5.0.0-alpha.0(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.14)(formik@2.4.5)(react@18.2.0)(tiny-warning@1.0.3) + version: 5.0.0-alpha.0(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.15)(formik@2.4.5)(react@18.2.0)(tiny-warning@1.0.3) formik-mui-x-date-pickers: specifier: ^0.0.1 - version: 0.0.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.14)(@mui/system@5.14.14)(@mui/x-date-pickers@5.0.20)(formik@2.4.5)(react@18.2.0)(tiny-warning@1.0.3) + version: 0.0.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.15)(@mui/system@5.14.15)(@mui/x-date-pickers@5.0.20)(formik@2.4.5)(react@18.2.0)(tiny-warning@1.0.3) graphql: specifier: ^16.6.0 version: 16.8.1 @@ -435,14 +420,14 @@ importers: specifier: ^4.17.21 version: 4.17.21 next: - specifier: latest - version: 13.5.6(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) + specifier: ^13.5.6 + version: 13.5.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0) papaparse: specifier: ^5.4.1 version: 5.4.1 primereact: specifier: ^9.6.0 - version: 9.6.3(@types/react@18.2.31)(react-dom@18.2.0)(react@18.2.0) + version: 9.6.3(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) qs: specifier: ^6.11.0 version: 6.11.2 @@ -460,7 +445,7 @@ importers: version: 14.2.3(react@18.2.0) react-markdown: specifier: ^8.0.7 - version: 8.0.7(@types/react@18.2.31)(react@18.2.0) + version: 8.0.7(@types/react@18.2.33)(react@18.2.0) react-toastify: specifier: ^9.1.1 version: 9.1.3(react-dom@18.2.0)(react@18.2.0) @@ -471,11 +456,11 @@ importers: specifier: ^14.0.1 version: 14.2.1 viem: - specifier: 1.5.3 - version: 1.5.3(typescript@5.1.6)(zod@3.22.4) + specifier: 1.19.9 + version: 1.19.9(typescript@5.1.6)(zod@3.22.4) wagmi: - specifier: 1.3.9 - version: 1.3.9(@types/react@18.2.31)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@1.5.3)(zod@3.22.4) + specifier: 1.4.5 + version: 1.4.5(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@1.19.9)(zod@3.22.4) yup: specifier: ^0.32.11 version: 0.32.11 @@ -494,7 +479,7 @@ importers: version: 14.5.1(@testing-library/dom@9.3.3) '@types/node': specifier: ^18.0.0 - version: 18.18.6 + version: 18.18.7 '@types/papaparse': specifier: ^5.3.7 version: 5.3.10 @@ -503,7 +488,7 @@ importers: version: 6.9.9 '@types/react': specifier: ^18.0.14 - version: 18.2.31 + version: 18.2.33 '@types/react-dom': specifier: ^18.0.5 version: 18.2.14 @@ -530,7 +515,7 @@ importers: version: 1.1.7 jest: specifier: ^29.5.0 - version: 29.7.0(@types/node@18.18.6)(ts-node@10.9.1) + version: 29.7.0(@types/node@18.18.7) jest-environment-jsdom: specifier: ^29.5.0 version: 29.7.0 @@ -542,7 +527,7 @@ importers: devDependencies: '@graphprotocol/graph-cli': specifier: 0.60.0 - version: 0.60.0(@types/node@18.18.6)(node-fetch@3.3.2)(typescript@4.9.5) + version: 0.60.0(@types/node@18.18.7)(node-fetch@3.3.2)(typescript@4.9.5) '@graphprotocol/graph-ts': specifier: 0.31.0 version: 0.31.0 @@ -556,108 +541,96 @@ importers: sdk: dependencies: '@ethereum-attestation-service/eas-sdk': - specifier: ^0.28.3 - version: 0.28.3(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ts-node@10.9.1)(typescript@4.9.5) + specifier: 1.3.7 + version: 1.3.7(ts-node@10.9.1)(typescript@5.3.2) '@ethersproject/abstract-signer': specifier: ^5.7.0 version: 5.7.0 '@graphprotocol/client-add-source-name': - specifier: ^1.0.16 - version: 1.0.20(@graphql-mesh/types@0.95.7)(@graphql-tools/delegate@9.0.35)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(graphql@16.8.1) + specifier: ^2.0.0 + version: 2.0.0(@graphql-mesh/types@0.93.2)(@graphql-tools/delegate@10.0.3)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@10.0.1)(graphql@16.8.1) + '@graphprotocol/client-cli': + specifier: ^3.0.0 + version: 3.0.0(@babel/core@7.23.5)(@envelop/core@3.0.6)(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.96.2)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/delegate@10.0.3)(@graphql-tools/merge@9.0.1)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@10.0.1)(@types/node@18.18.7)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6) '@graphprotocol/client-polling-live': specifier: ^2.0.0 - version: 2.0.0(@envelop/core@3.0.6)(@graphql-tools/merge@9.0.0)(graphql@16.8.1) + version: 2.0.0(@envelop/core@3.0.6)(@graphql-tools/merge@9.0.1)(graphql@16.8.1) '@graphql-mesh/cache-localforage': - specifier: ^0.95.7 - version: 0.95.7(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(graphql@16.8.1)(tslib@2.6.2) + specifier: ^0.96.1 + version: 0.96.2(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/cross-helpers': specifier: ^0.4.1 version: 0.4.1(@graphql-tools/utils@9.2.1)(graphql@16.8.1) '@graphql-mesh/graphql': - specifier: ^0.95.7 - version: 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.95.7)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(@types/node@18.18.6)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0)(tslib@2.6.2) + specifier: ^0.96.1 + version: 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.96.2)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(@types/node@18.18.7)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0)(tslib@2.6.2) '@graphql-mesh/http': - specifier: ^0.96.13 - version: 0.96.13(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/runtime@0.96.12)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(graphql@16.8.1)(tslib@2.6.2) + specifier: ^0.97.2 + version: 0.97.3(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/runtime@0.97.3)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/merger-bare': - specifier: ^0.95.7 - version: 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + specifier: ^0.96.1 + version: 0.96.2(@graphql-mesh/store@0.96.2)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/runtime': - specifier: ^0.96.12 - version: 0.96.12(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + specifier: ^0.97.2 + version: 0.97.3(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/store': - specifier: ^0.95.7 - version: 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/types': - specifier: ^0.95.7 - version: 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + specifier: ^0.96.1 + version: 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/utils': - specifier: ^0.95.7 - version: 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + specifier: ^0.96.1 + version: 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-typed-document-node/core': specifier: ^3.2.0 version: 3.2.0(graphql@16.8.1) '@hypercerts-org/contracts': - specifier: 0.8.11 - version: 0.8.11 + specifier: 1.0.0-alpha.6 + version: 1.0.0-alpha.6(ts-node@10.9.1)(typescript@5.3.2) '@openzeppelin/merkle-tree': - specifier: ^1.0.4 + specifier: ^1.0.5 version: 1.0.5 '@whatwg-node/fetch': specifier: ^0.9.13 - version: 0.9.13 + version: 0.9.14 ajv: specifier: ^8.11.2 version: 8.12.0 axios: - specifier: ^1.2.2 - version: 1.5.1(debug@4.3.4) + specifier: ^1.6.2 + version: 1.6.2(debug@4.3.4) dotenv: specifier: ^16.0.3 version: 16.3.1 ethers: - specifier: ^5.7.2 + specifier: 5.7.2 version: 5.7.2 graphql: specifier: ^16.6.0 version: 16.8.1 - ipfs-core: - specifier: ^0.17.0 - version: 0.17.0(uint8arraylist@2.4.3) - jest: - specifier: ^29.3.1 - version: 29.7.0(@types/node@18.18.6)(ts-node@10.9.1) loglevel: specifier: ^1.8.1 version: 1.8.1 - mime: - specifier: ^3.0.0 - version: 3.0.0 nft.storage: specifier: ^7.1.1 version: 7.1.1(node-fetch@3.3.2) + viem: + specifier: ^1.19.9 + version: 1.19.9(typescript@5.3.2)(zod@3.22.4) web3.storage: specifier: ^4.5.5 version: 4.5.5(node-fetch@3.3.2) devDependencies: '@babel/core': - specifier: ^7.23.2 - version: 7.23.2 + specifier: ^7.23.5 + version: 7.23.5 '@babel/preset-env': - specifier: ^7.23.2 - version: 7.23.2(@babel/core@7.23.2) + specifier: ^7.23.5 + version: 7.23.5(@babel/core@7.23.5) '@babel/preset-typescript': - specifier: ^7.23.2 - version: 7.23.2(@babel/core@7.23.2) + specifier: ^7.23.3 + version: 7.23.3(@babel/core@7.23.5) '@faker-js/faker': - specifier: ^8.0.2 - version: 8.2.0 - '@graphprotocol/client-cli': - specifier: ^3.0.0 - version: 3.0.0(@babel/core@7.23.2)(@envelop/core@3.0.6)(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.95.7)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/delegate@9.0.35)(@graphql-tools/merge@9.0.0)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(@types/node@18.18.6)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6) - '@jest/globals': - specifier: ^29.7.0 - version: 29.7.0 + specifier: ^8.3.1 + version: 8.3.1 '@rollup/plugin-commonjs': specifier: ^24.0.1 version: 24.1.0(rollup@3.29.4) @@ -668,23 +641,23 @@ importers: specifier: ^15.0.1 version: 15.2.3(rollup@3.29.4) '@types/chai': - specifier: ^4.3.4 - version: 4.3.9 + specifier: ^4.3.11 + version: 4.3.11 '@types/chai-subset': - specifier: ^1.3.3 - version: 1.3.4 - '@types/jest': - specifier: ^29.2.5 - version: 29.5.6 + specifier: ^1.3.5 + version: 1.3.5 '@types/node': specifier: ^18.11.17 - version: 18.18.6 + version: 18.18.7 '@types/sinon': - specifier: ^10.0.15 - version: 10.0.20 - babel-jest: - specifier: ^29.7.0 - version: 29.7.0(@babel/core@7.23.2) + specifier: ^17.0.2 + version: 17.0.2 + '@viem/anvil': + specifier: ^0.0.6 + version: 0.0.6 + abitype: + specifier: ^0.10.3 + version: 0.10.3(typescript@5.3.2)(zod@3.22.4) chai: specifier: ^4.3.7 version: 4.3.10 @@ -695,23 +668,14 @@ importers: specifier: ^1.6.0 version: 1.6.0 esbuild: - specifier: ^0.17.10 - version: 0.17.19 - ethereum-waffle: - specifier: ^4.0.10 - version: 4.0.10(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typescript@4.9.5) + specifier: ^0.19.8 + version: 0.19.8 it-all: - specifier: ^2.0.0 - version: 2.0.1 - jest-extended: - specifier: ^4.0.0 - version: 4.0.2(jest@29.7.0) + specifier: ^3.0.4 + version: 3.0.4 json-schema-to-typescript: - specifier: ^12.0.0 - version: 12.0.0 - msw: - specifier: ^1.2.1 - version: 1.3.2(typescript@4.9.5) + specifier: ^13.1.1 + version: 13.1.1 nyc: specifier: ^15.1.0 version: 15.1.0 @@ -722,50 +686,38 @@ importers: specifier: ^2.0.0 version: 2.0.0(rollup@3.29.4) rollup-plugin-dts: - specifier: ^5.2.0 - version: 5.3.1(rollup@3.29.4)(typescript@4.9.5) + specifier: ^6.1.0 + version: 6.1.0(rollup@3.29.4)(typescript@5.3.2) rollup-plugin-esbuild: - specifier: ^5.0.0 - version: 5.0.0(esbuild@0.17.19)(rollup@3.29.4) + specifier: ^6.1.0 + version: 6.1.0(esbuild@0.19.8)(rollup@3.29.4) rollup-plugin-node-polyfills: specifier: ^0.2.1 version: 0.2.1 - shx: - specifier: ^0.3.4 - version: 0.3.4 sinon: - specifier: ^15.2.0 - version: 15.2.0 - ts-jest: - specifier: ^29.0.3 - version: 29.1.1(@babel/core@7.23.2)(babel-jest@29.7.0)(esbuild@0.17.19)(jest@29.7.0)(typescript@4.9.5) - ts-jest-resolver: - specifier: ^2.0.0 - version: 2.0.1 - ts-mocha: - specifier: ^10.0.0 - version: 10.0.0(mocha@10.2.0) + specifier: ^17.0.1 + version: 17.0.1 + sinon-chai: + specifier: ^3.7.0 + version: 3.7.0(chai@4.3.10)(sinon@17.0.1) ts-node: specifier: ^10.9.1 - version: 10.9.1(@types/node@18.18.6)(typescript@4.9.5) - tslib: - specifier: ^2.5.0 - version: 2.6.2 - tsx: - specifier: ^3.14.0 - version: 3.14.0 + version: 10.9.1(@types/node@18.18.7)(typescript@5.3.2) typedoc: - specifier: ^0.23.25 - version: 0.23.28(typescript@4.9.5) + specifier: ^0.25.4 + version: 0.25.4(typescript@5.3.2) typedoc-plugin-markdown: - specifier: ^3.14.0 - version: 3.16.0(typedoc@0.23.28) + specifier: ^3.17.1 + version: 3.17.1(typedoc@0.25.4) typedoc-plugin-missing-exports: specifier: ^2.0.0 - version: 2.1.0(typedoc@0.23.28) + version: 2.1.0(typedoc@0.25.4) typescript: - specifier: ^4.9.0 - version: 4.9.5 + specifier: 5.3.2 + version: 5.3.2 + vitest: + specifier: ^1.0.1 + version: 1.0.2(@types/node@18.18.7) vendor/observabletreemap: dependencies: @@ -778,7 +730,6 @@ packages: /@aashutoshrathi/word-wrap@1.2.6: resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} engines: {node: '>=0.10.0'} - dev: true /@achingbrain/ip-address@8.1.0: resolution: {integrity: sha512-Zus4vMKVRDm+R1o0QJNhD0PD/8qRGO3Zx8YPsFG5lANt5utVtGg3iHVGBSAF80TfQmhi8rP+Kg/OigdxY0BXHw==} @@ -792,7 +743,7 @@ packages: resolution: {integrity: sha512-rU4G75TEOTIPlkeDnPEVwx/VmMMFta42kY2SMmVobRkrtNLnxtU08Yhriu6tSBc9oO0wXdfNNeuLnNnEnL7w/A==} dependencies: '@achingbrain/ssdp': 4.0.6 - '@libp2p/logger': 3.0.3 + '@libp2p/logger': 3.0.4 default-gateway: 7.2.2 err-code: 3.0.1 it-first: 3.0.3 @@ -816,8 +767,16 @@ packages: resolution: {integrity: sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==} dev: true + /@adraffy/ens-normalize@1.10.0: + resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} + /@adraffy/ens-normalize@1.9.0: resolution: {integrity: sha512-iowxq3U30sghZotgl4s/oJRci6WPBfNO5YYgk2cIOMCHr3LeGPcsZjCEr+33Q4N+oV3OABDAtA+pyvWjbvBifQ==} + dev: true + + /@adraffy/ens-normalize@1.9.4: + resolution: {integrity: sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw==} + dev: true /@algolia/autocomplete-core@1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0)(search-insights@2.9.0): resolution: {integrity: sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==} @@ -967,7 +926,7 @@ packages: /@apollo/client@3.8.6(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-FnHg3vhQP8tQzgBs6oTJCFFIbovelDGYujj6MK7CJneiHf62TJstCIO0Ot4A1h7XrgFEtgl8a/OgajQWqrTuYw==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 graphql-ws: ^5.5.5 react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -983,8 +942,8 @@ packages: optional: true dependencies: '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) - '@wry/context': 0.7.3 - '@wry/equality': 0.5.6 + '@wry/context': 0.7.4 + '@wry/equality': 0.5.7 '@wry/trie': 0.4.3 graphql: 16.8.1 graphql-tag: 2.12.6(graphql@16.8.1) @@ -1011,20 +970,21 @@ packages: ajv-formats: 2.1.1(ajv@8.12.0) fast-deep-equal: 3.1.3 rfdc: 1.3.0 + dev: false /@ardatan/relay-compiler@12.0.0(graphql@16.8.1): resolution: {integrity: sha512-9anThAaj1dQr6IGmzBMcfzOQKTa5artjuPmw8NYK/fiGEMjADbSguBY2FMDykt+QhilR3wc9VA/3yVju7JHg7Q==} hasBin: true peerDependencies: - graphql: ^16.6.0 + graphql: '*' dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/generator': 7.23.0 '@babel/parser': 7.23.0 '@babel/runtime': 7.23.2 '@babel/traverse': 7.23.2 '@babel/types': 7.23.0 - babel-preset-fbjs: 3.4.0(@babel/core@7.23.2) + babel-preset-fbjs: 3.4.0(@babel/core@7.23.5) chalk: 4.1.2 fb-watchman: 2.0.2 fbjs: 3.0.5 @@ -1039,6 +999,7 @@ packages: transitivePeerDependencies: - encoding - supports-color + dev: false /@ardatan/sync-fetch@0.0.1: resolution: {integrity: sha512-xhlTqH0m31mnsG0tIP4ETgfSB6gXDaYYsUWTrlUV93fFQPI9dd8hE0Ot6MHLCtqgB32hwJAC3YZMWlXZw7AleA==} @@ -1047,6 +1008,7 @@ packages: node-fetch: 2.7.0 transitivePeerDependencies: - encoding + dev: false /@assemblyscript/loader@0.9.4: resolution: {integrity: sha512-HazVq9zwTVwGmqdwYzu7WyQ6FQVZ7SwET0KKQuKm55jD0IfUpZgN0OPIiZG3zV1iSrVYcN0bdwLRXI/VNCYsUA==} @@ -1082,18 +1044,30 @@ packages: resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.22.20 + '@babel/highlight': 7.23.4 + chalk: 2.4.2 + dev: true + + /@babel/code-frame@7.23.5: + resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.23.4 chalk: 2.4.2 /@babel/compat-data@7.23.2: resolution: {integrity: sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==} engines: {node: '>=6.9.0'} + /@babel/compat-data@7.23.5: + resolution: {integrity: sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==} + engines: {node: '>=6.9.0'} + /@babel/core@7.12.9: resolution: {integrity: sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 '@babel/generator': 7.23.0 '@babel/helper-module-transforms': 7.23.0(@babel/core@7.12.9) '@babel/helpers': 7.23.2 @@ -1119,14 +1093,14 @@ packages: dependencies: '@ampproject/remapping': 2.2.1 '@babel/code-frame': 7.22.13 - '@babel/generator': 7.17.7 + '@babel/generator': 7.23.0 '@babel/helper-compilation-targets': 7.22.15 '@babel/helper-module-transforms': 7.23.0(@babel/core@7.17.8) '@babel/helpers': 7.23.2 - '@babel/parser': 7.18.9 + '@babel/parser': 7.23.0 '@babel/template': 7.22.15 - '@babel/traverse': 7.17.3 - '@babel/types': 7.17.0 + '@babel/traverse': 7.23.2 + '@babel/types': 7.23.0 convert-source-map: 1.9.0 debug: 4.3.4(supports-color@8.1.1) gensync: 1.0.0-beta.2 @@ -1141,7 +1115,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 '@babel/generator': 7.23.0 '@babel/helper-compilation-targets': 7.22.15 '@babel/helper-module-transforms': 7.23.0(@babel/core@7.23.2) @@ -1157,12 +1131,35 @@ packages: semver: 6.3.1 transitivePeerDependencies: - supports-color + dev: false + + /@babel/core@7.23.5: + resolution: {integrity: sha512-Cwc2XjUrG4ilcfOw4wBAK+enbdgwAcAJCfGUItPBKR7Mjw4aEfAFYrLxeRp4jWgtNIKn3n2AlBOfwwafl+42/g==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.2.1 + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) + '@babel/helpers': 7.23.5 + '@babel/parser': 7.23.5 + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.5 + '@babel/types': 7.23.5 + convert-source-map: 2.0.0 + debug: 4.3.4(supports-color@8.1.1) + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color /@babel/generator@7.17.7: resolution: {integrity: sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.17.0 + '@babel/types': 7.23.0 jsesc: 2.5.2 source-map: 0.5.7 dev: true @@ -1176,6 +1173,15 @@ packages: '@jridgewell/trace-mapping': 0.3.20 jsesc: 2.5.2 + /@babel/generator@7.23.5: + resolution: {integrity: sha512-BPssCHrBD+0YrxviOa3QzpqwhNIXKEtOa2jQrm4FlmkC2apYgRnQcmPWiGZDlGxiNtltnUFolMe8497Esry+jA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.23.5 + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.20 + jsesc: 2.5.2 + /@babel/helper-annotate-as-pure@7.22.5: resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} engines: {node: '>=6.9.0'} @@ -1214,6 +1220,41 @@ packages: '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 semver: 6.3.1 + dev: false + + /@babel/helper-create-class-features-plugin@7.22.15(@babel/core@7.23.5): + resolution: {integrity: sha512-jKkwA59IXcvSaiK2UN45kKwSC9o+KuoXsBDvHvU/7BecYIp8GQ2UwrVvFgJASUT+hBnwJx6MhvMCuMzwZZ7jlg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-member-expression-to-functions': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.5) + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + semver: 6.3.1 + + /@babel/helper-create-class-features-plugin@7.23.5(@babel/core@7.23.5): + resolution: {integrity: sha512-QELlRWxSpgdwdJzSJn4WAhKC+hvw/AtHbbrIoncKHkhKKR/luAlKkgBDcri1EzWAo8f8VvYVryEHN4tax/V67A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-member-expression-to-functions': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.5) + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + semver: 6.3.1 /@babel/helper-create-regexp-features-plugin@7.22.15(@babel/core@7.23.2): resolution: {integrity: sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w==} @@ -1225,6 +1266,18 @@ packages: '@babel/helper-annotate-as-pure': 7.22.5 regexpu-core: 5.3.2 semver: 6.3.1 + dev: false + + /@babel/helper-create-regexp-features-plugin@7.22.15(@babel/core@7.23.5): + resolution: {integrity: sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + regexpu-core: 5.3.2 + semver: 6.3.1 /@babel/helper-define-polyfill-provider@0.4.3(@babel/core@7.23.2): resolution: {integrity: sha512-WBrLmuPP47n7PNwsZ57pqam6G/RGo1vw/87b0Blc53tZNGZ4x7YvZ6HgQe2vo1W/FR20OgjeZuGXzudPiXHFug==} @@ -1239,6 +1292,21 @@ packages: resolve: 1.22.8 transitivePeerDependencies: - supports-color + dev: false + + /@babel/helper-define-polyfill-provider@0.4.3(@babel/core@7.23.5): + resolution: {integrity: sha512-WBrLmuPP47n7PNwsZ57pqam6G/RGo1vw/87b0Blc53tZNGZ4x7YvZ6HgQe2vo1W/FR20OgjeZuGXzudPiXHFug==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + debug: 4.3.4(supports-color@8.1.1) + lodash.debounce: 4.0.8 + resolve: 1.22.8 + transitivePeerDependencies: + - supports-color /@babel/helper-environment-visitor@7.22.20: resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} @@ -1309,6 +1377,34 @@ packages: '@babel/helper-simple-access': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 '@babel/helper-validator-identifier': 7.22.20 + dev: false + + /@babel/helper-module-transforms@7.23.0(@babel/core@7.23.5): + resolution: {integrity: sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-validator-identifier': 7.22.20 + dev: false + + /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-validator-identifier': 7.22.20 /@babel/helper-optimise-call-expression@7.22.5: resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} @@ -1334,6 +1430,18 @@ packages: '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-wrap-function': 7.22.20 + dev: false + + /@babel/helper-remap-async-to-generator@7.22.20(@babel/core@7.23.5): + resolution: {integrity: sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-wrap-function': 7.22.20 /@babel/helper-replace-supers@7.22.20(@babel/core@7.23.2): resolution: {integrity: sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw==} @@ -1345,6 +1453,18 @@ packages: '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-member-expression-to-functions': 7.23.0 '@babel/helper-optimise-call-expression': 7.22.5 + dev: false + + /@babel/helper-replace-supers@7.22.20(@babel/core@7.23.5): + resolution: {integrity: sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-member-expression-to-functions': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 /@babel/helper-simple-access@7.22.5: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} @@ -1368,6 +1488,10 @@ packages: resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} engines: {node: '>=6.9.0'} + /@babel/helper-string-parser@7.23.4: + resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} + engines: {node: '>=6.9.0'} + /@babel/helper-validator-identifier@7.22.20: resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} @@ -1376,6 +1500,10 @@ packages: resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} engines: {node: '>=6.9.0'} + /@babel/helper-validator-option@7.23.5: + resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} + engines: {node: '>=6.9.0'} + /@babel/helper-wrap-function@7.22.20: resolution: {integrity: sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw==} engines: {node: '>=6.9.0'} @@ -1394,8 +1522,18 @@ packages: transitivePeerDependencies: - supports-color - /@babel/highlight@7.22.20: - resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==} + /@babel/helpers@7.23.5: + resolution: {integrity: sha512-oO7us8FzTEsG3U6ag9MfdF1iA/7Z6dz+MtFhifZk8C8o453rGJFFWUP1t+ULM9TUIAzC9uxXEiXjOiVMyd7QPg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.5 + '@babel/types': 7.23.5 + transitivePeerDependencies: + - supports-color + + /@babel/highlight@7.23.4: + resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-validator-identifier': 7.22.20 @@ -1407,7 +1545,7 @@ packages: engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.17.0 + '@babel/types': 7.23.0 dev: true /@babel/parser@7.23.0: @@ -1417,6 +1555,13 @@ packages: dependencies: '@babel/types': 7.23.0 + /@babel/parser@7.23.5: + resolution: {integrity: sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.23.5 + /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.22.15(@babel/core@7.23.2): resolution: {integrity: sha512-FB9iYlz7rURmRJyXRKEnalYPPdn87H5no108cyuQQyMwlpJ2SJtpIUBI27kdTin956pz+LPypkPVPUTlxOmrsg==} engines: {node: '>=6.9.0'} @@ -1425,6 +1570,16 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-iRkKcCqb7iGnq9+3G6rZ+Ciz5VywC4XNRHe57lKM+jOeYAoR0lVqdeeDRfh0tQcTfw/+vBhHn926FmQhLtlFLQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.22.15(@babel/core@7.23.2): resolution: {integrity: sha512-Hyph9LseGvAeeXzikV88bczhsrLrIZqDPxO+sSmAunMPaGrBGhfMWzCPYTtiW9t+HzSE2wtV8e5cc5P6r1xMDQ==} @@ -1436,62 +1591,89 @@ packages: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/plugin-transform-optional-chaining': 7.23.0(@babel/core@7.23.2) + dev: false - /@babel/plugin-proposal-async-generator-functions@7.20.7(@babel/core@7.23.2): + /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-WwlxbfMNdVEpQjZmK5mhm7oSwD3dS6eU+Iwsi4Knl9wAletWem7kaRsGOG+8UEbRyqxY4SS5zvtfXwX+jMxUwQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.13.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/plugin-transform-optional-chaining': 7.23.4(@babel/core@7.23.5) + + /@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-XaJak1qcityzrX0/IU5nKHb34VaibwP3saKqG6a/tppelgllOH13LUann4ZCIBcVOeE6H18K4Vx9QKkVww3z/w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + + /@babel/plugin-proposal-async-generator-functions@7.20.7(@babel/core@7.23.5): resolution: {integrity: sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==} engines: {node: '>=6.9.0'} deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead. peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.2) - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.2) + '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.5) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.5) + dev: false - /@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.23.2): + /@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.23.5): resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} engines: {node: '>=6.9.0'} deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 - '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.2) + '@babel/core': 7.23.5 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.5) '@babel/helper-plugin-utils': 7.22.5 + dev: false - /@babel/plugin-proposal-export-default-from@7.22.17(@babel/core@7.23.2): + /@babel/plugin-proposal-export-default-from@7.22.17(@babel/core@7.23.5): resolution: {integrity: sha512-cop/3quQBVvdz6X5SJC6AhUv3C9DrVTM06LUEXimEdWAhCSyOJIr9NiZDU9leHZ0/aiG0Sh7Zmvaku5TWYNgbA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-export-default-from': 7.22.5(@babel/core@7.23.2) + '@babel/plugin-syntax-export-default-from': 7.22.5(@babel/core@7.23.5) + dev: false - /@babel/plugin-proposal-nullish-coalescing-operator@7.18.6(@babel/core@7.23.2): + /@babel/plugin-proposal-nullish-coalescing-operator@7.18.6(@babel/core@7.23.5): resolution: {integrity: sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==} engines: {node: '>=6.9.0'} deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead. peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.2) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.5) + dev: false - /@babel/plugin-proposal-numeric-separator@7.18.6(@babel/core@7.23.2): + /@babel/plugin-proposal-numeric-separator@7.18.6(@babel/core@7.23.5): resolution: {integrity: sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==} engines: {node: '>=6.9.0'} deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead. peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.2) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.5) + dev: false /@babel/plugin-proposal-object-rest-spread@7.12.1(@babel/core@7.12.9): resolution: {integrity: sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA==} @@ -1500,12 +1682,12 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-plugin-utils': 7.10.4 + '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.12.9) '@babel/plugin-transform-parameters': 7.22.15(@babel/core@7.12.9) dev: false - /@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.23.2): + /@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.23.5): resolution: {integrity: sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==} engines: {node: '>=6.9.0'} deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead. @@ -1513,34 +1695,37 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/compat-data': 7.23.2 - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-compilation-targets': 7.22.15 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.2) - '@babel/plugin-transform-parameters': 7.22.15(@babel/core@7.23.2) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-transform-parameters': 7.22.15(@babel/core@7.23.5) + dev: false - /@babel/plugin-proposal-optional-catch-binding@7.18.6(@babel/core@7.23.2): + /@babel/plugin-proposal-optional-catch-binding@7.18.6(@babel/core@7.23.5): resolution: {integrity: sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==} engines: {node: '>=6.9.0'} deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead. peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.2) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.5) + dev: false - /@babel/plugin-proposal-optional-chaining@7.21.0(@babel/core@7.23.2): + /@babel/plugin-proposal-optional-chaining@7.21.0(@babel/core@7.23.5): resolution: {integrity: sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==} engines: {node: '>=6.9.0'} deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead. peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.2) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.5) + dev: false /@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.23.2): resolution: {integrity: sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==} @@ -1549,6 +1734,15 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.2 + dev: false + + /@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.23.5): + resolution: {integrity: sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.23.2): resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} @@ -1557,14 +1751,24 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.23.5): + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 - /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.23.2): + /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.23.5): resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 + dev: true /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.23.2): resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} @@ -1573,6 +1777,15 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.23.5): + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.23.2): resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} @@ -1582,6 +1795,16 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.23.5): + resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.23.2): resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==} @@ -1590,15 +1813,25 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.23.5): + resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 - /@babel/plugin-syntax-export-default-from@7.22.5(@babel/core@7.23.2): + /@babel/plugin-syntax-export-default-from@7.22.5(@babel/core@7.23.5): resolution: {integrity: sha512-ODAqWWXB/yReh/jVQDag/3/tl6lgBueQkk/TcfW/59Oykm4c8a55XloX0CTk2k2VJiFWMgHby9xNX29IbCv9dQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 + dev: false /@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.23.2): resolution: {integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==} @@ -1607,15 +1840,25 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.23.5): + resolution: {integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 - /@babel/plugin-syntax-flow@7.22.5(@babel/core@7.23.2): + /@babel/plugin-syntax-flow@7.22.5(@babel/core@7.23.5): resolution: {integrity: sha512-9RdCl0i+q0QExayk2nOS7853w08yLucnnPML6EN9S8fgMPVtdLDCdx/cOQ/i44Lb9UeQX9A35yaqBBOMMZxPxQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 + dev: false /@babel/plugin-syntax-import-assertions@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==} @@ -1625,6 +1868,26 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-import-assertions@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-import-assertions@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-import-attributes@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg==} @@ -1634,6 +1897,16 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-import-attributes@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-pawnE0P9g10xgoP7yKr6CK63K2FMsTE+FZidZO/1PwRdzmAPVs+HS1mAURUsgaoxammTJvULUdIkEK0gOcU2tA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.23.2): resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} @@ -1642,6 +1915,15 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.23.5): + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.23.2): resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} @@ -1650,6 +1932,15 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.23.5): + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-jsx@7.12.1(@babel/core@7.12.9): resolution: {integrity: sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg==} @@ -1668,6 +1959,25 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + + /@babel/plugin-syntax-jsx@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.23.2): resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} @@ -1676,6 +1986,15 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.23.5): + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.23.2): resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} @@ -1684,6 +2003,15 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.23.5): + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.23.2): resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} @@ -1692,6 +2020,15 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.23.5): + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.12.9): resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} @@ -1709,6 +2046,15 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.23.5): + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.23.2): resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} @@ -1717,6 +2063,15 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.23.5): + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.23.2): resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} @@ -1725,6 +2080,15 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.23.5): + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.23.2): resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} @@ -1734,6 +2098,16 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.23.5): + resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.23.2): resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} @@ -1743,6 +2117,16 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.23.5): + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==} @@ -1752,6 +2136,26 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + + /@babel/plugin-syntax-typescript@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.23.2): resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==} @@ -1762,6 +2166,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.23.5): + resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-arrow-functions@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==} @@ -1771,6 +2186,26 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-arrow-functions@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-arrow-functions@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-NzQcQrzaQPkaEwoTm4Mhyl8jI1huEL/WWIEvudjTCMJ9aBZNpsJbMASx7EQECtQQPS/DcnFpo0FIh3LvEO9cxQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-async-generator-functions@7.23.2(@babel/core@7.23.2): resolution: {integrity: sha512-BBYVGxbDVHfoeXbOwcagAkOQAm9NxoTdMGfTqghu1GrvadSaw6iW3Je6IcL5PNOw8VwjxqBECXy50/iCQSY/lQ==} @@ -1783,6 +2218,19 @@ packages: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.2) '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-async-generator-functions@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-efdkfPhHYTtn0G6n2ddrESE91fgXxjlqLsnUtPWnJs4a4mZIbUaK7ffqKIIUKXSHwcDvaCVX6GXkaJJFqtX7jw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.5) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.5) /@babel/plugin-transform-async-to-generator@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ==} @@ -1794,6 +2242,18 @@ packages: '@babel/helper-module-imports': 7.22.15 '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-async-to-generator@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-A7LFsKi4U4fomjqXJlZg/u0ft/n8/7n7lpffUP/ZULx/DtV9SGlNKZolHH6PE8Xl1ngCc0M11OaeZptXVkfKSw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.5) /@babel/plugin-transform-block-scoped-functions@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA==} @@ -1803,6 +2263,26 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-block-scoped-functions@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-block-scoped-functions@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-vI+0sIaPIO6CNuM9Kk5VmXcMVRiOpDh7w2zZt9GXzmE/9KD70CUEVhvPR/etAeNK/FAEkhxQtXOzVF3EuRL41A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-block-scoping@7.23.0(@babel/core@7.23.2): resolution: {integrity: sha512-cOsrbmIOXmf+5YbL99/S49Y3j46k/T16b9ml8bm9lP6N9US5iQ2yBK7gpui1pg0V/WMcXdkfKbTb7HXq9u+v4g==} @@ -1812,6 +2292,26 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-block-scoping@7.23.0(@babel/core@7.23.5): + resolution: {integrity: sha512-cOsrbmIOXmf+5YbL99/S49Y3j46k/T16b9ml8bm9lP6N9US5iQ2yBK7gpui1pg0V/WMcXdkfKbTb7HXq9u+v4g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-block-scoping@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-0QqbP6B6HOh7/8iNR4CQU2Th/bbRtBp4KS9vcaZd1fZ0wSh5Fyssg0UCIHwxh+ka+pNDREbVLQnHCMHKZfPwfw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-class-properties@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ==} @@ -1822,6 +2322,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-class-properties@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-uM+AN8yCIjDPccsKGlw271xjJtGii+xQIF/uMPS8H15L12jZTsLfF4o5vNO7d/oUguOyfdikHGc/yi9ge4SGIg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-class-static-block@7.22.11(@babel/core@7.23.2): resolution: {integrity: sha512-GMM8gGmqI7guS/llMFk1bJDkKfn3v3C4KHK9Yg1ey5qcHcOlKb0QvcMrgzvxo+T03/4szNh5lghY+fEC98Kq9g==} @@ -1833,6 +2344,18 @@ packages: '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-class-static-block@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-nsWu/1M+ggti1SOALj3hfx5FXzAY06fwPJsUZD4/A5e1bWi46VUIWtD+kOX6/IdhXGsXBWllLFDSnqSCdUNydQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.12.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.23.5) /@babel/plugin-transform-classes@7.22.15(@babel/core@7.23.2): resolution: {integrity: sha512-VbbC3PGjBdE0wAWDdHM9G8Gm977pnYI0XpqMd6LrKISj8/DJXEsWqgRuTYaNE9Bv0JGhTZUzHDlMk18IpOuoqw==} @@ -1850,6 +2373,42 @@ packages: '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.2) '@babel/helper-split-export-declaration': 7.22.6 globals: 11.12.0 + dev: false + + /@babel/plugin-transform-classes@7.22.15(@babel/core@7.23.5): + resolution: {integrity: sha512-VbbC3PGjBdE0wAWDdHM9G8Gm977pnYI0XpqMd6LrKISj8/DJXEsWqgRuTYaNE9Bv0JGhTZUzHDlMk18IpOuoqw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.5) + '@babel/helper-split-export-declaration': 7.22.6 + globals: 11.12.0 + dev: false + + /@babel/plugin-transform-classes@7.23.5(@babel/core@7.23.5): + resolution: {integrity: sha512-jvOTR4nicqYC9yzOHIhXG5emiFEOpappSJAl73SDSEDcybD+Puuze8Tnpb9p9qEyYup24tq891gkaygIFvWDqg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.5) + '@babel/helper-split-export-declaration': 7.22.6 + globals: 11.12.0 /@babel/plugin-transform-computed-properties@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==} @@ -1860,6 +2419,28 @@ packages: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 '@babel/template': 7.22.15 + dev: false + + /@babel/plugin-transform-computed-properties@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/template': 7.22.15 + dev: false + + /@babel/plugin-transform-computed-properties@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-dTj83UVTLw/+nbiHqQSFdwO9CbTtwq1DsDqm3CUEtDrZNET5rT5E6bIdTlOftDTDLMYxvxHNEYO4B9SLl8SLZw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/template': 7.22.15 /@babel/plugin-transform-destructuring@7.23.0(@babel/core@7.23.2): resolution: {integrity: sha512-vaMdgNXFkYrB+8lbgniSYWHsgqK5gjaMNcc84bMIOMRLH0L9AqYq3hwMdvnyqj1OPqea8UtjPEuS/DCenah1wg==} @@ -1869,6 +2450,26 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-destructuring@7.23.0(@babel/core@7.23.5): + resolution: {integrity: sha512-vaMdgNXFkYrB+8lbgniSYWHsgqK5gjaMNcc84bMIOMRLH0L9AqYq3hwMdvnyqj1OPqea8UtjPEuS/DCenah1wg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-destructuring@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-n225npDqjDIr967cMScVKHXJs7rout1q+tt50inyBCPkyZ8KxeI6d+GIbSBTT/w/9WdlWDOej3V9HE5Lgk57gw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-dotall-regex@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw==} @@ -1879,6 +2480,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-dotall-regex@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-vgnFYDHAKzFaTVp+mneDsIEbnJ2Np/9ng9iviHw3P/KVcgONxpNULEW/51Z/BaFojG2GI2GwwXck5uV1+1NOYQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-duplicate-keys@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw==} @@ -1888,6 +2500,16 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-duplicate-keys@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-RrqQ+BQmU3Oyav3J+7/myfvRCq7Tbz+kKLLshUmMwNlDHExbGL7ARhajvoBJEvc+fCguPPu887N+3RRXBVKZUA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-dynamic-import@7.22.11(@babel/core@7.23.2): resolution: {integrity: sha512-g/21plo58sfteWjaO0ZNVb+uEOkJNjAaHhbejrnBmu011l/eNDScmkbjCC3l4FKb10ViaGU4aOkFznSu2zRHgA==} @@ -1898,6 +2520,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-dynamic-import@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-V6jIbLhdJK86MaLh4Jpghi8ho5fGzt3imHOBu/x0jlBaPYqDoWz4RDXjmMOfnh+JWNaQleEAByZLV0QzBT4YQQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.5) /@babel/plugin-transform-exponentiation-operator@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g==} @@ -1908,6 +2541,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-builder-binary-assignment-operator-visitor': 7.22.15 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-exponentiation-operator@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-5fhCsl1odX96u7ILKHBj4/Y8vipoqwsJMh4csSA8qFfxrZDEA4Ssku2DyNvMJSmZNOEBT750LfFPbtrnTP90BQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-builder-binary-assignment-operator-visitor': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-export-namespace-from@7.22.11(@babel/core@7.23.2): resolution: {integrity: sha512-xa7aad7q7OiT8oNZ1mU7NrISjlSkVdMbNxn9IuLZyL9AJEhs1Apba3I+u5riX1dIkdptP5EKDG5XDPByWxtehw==} @@ -1918,93 +2562,246 @@ packages: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-export-namespace-from@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-GzuSBcKkx62dGzZI1WVgTWvkkz84FZO5TC5T8dl/Tht/rAla6Dg/Mz9Yhypg+ezVACf/rgDuQt3kbWEv7LdUDQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.5) + + /@babel/plugin-transform-flow-strip-types@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-tujNbZdxdG0/54g/oua8ISToaXTFBf8EnSb5PgQSciIXWOWKX3S4+JR7ZE9ol8FZwf9kxitzkGQ+QWeov/mCiA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-flow': 7.22.5(@babel/core@7.23.5) + dev: false + + /@babel/plugin-transform-for-of@7.22.15(@babel/core@7.23.2): + resolution: {integrity: sha512-me6VGeHsx30+xh9fbDLLPi0J1HzmeIIyenoOQHuw2D4m2SAU3NrspX5XxJLBpqn5yrLzrlw2Iy3RA//Bx27iOA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.2 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-for-of@7.22.15(@babel/core@7.23.5): + resolution: {integrity: sha512-me6VGeHsx30+xh9fbDLLPi0J1HzmeIIyenoOQHuw2D4m2SAU3NrspX5XxJLBpqn5yrLzrlw2Iy3RA//Bx27iOA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-for-of@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-X8jSm8X1CMwxmK878qsUGJRmbysKNbdpTv/O1/v0LuY/ZkZrng5WYiekYSdg9m09OTmDDUWeEDsTE+17WYbAZw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + + /@babel/plugin-transform-function-name@7.22.5(@babel/core@7.23.2): + resolution: {integrity: sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.2 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-function-name@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-function-name@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-I1QXp1LxIvt8yLaib49dRW5Okt7Q4oaxao6tFVKS/anCdEOMtYwWVKoiOA1p34GOWIZjUK0E+zCp7+l1pfQyiw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-plugin-utils': 7.22.5 + + /@babel/plugin-transform-json-strings@7.22.11(@babel/core@7.23.2): + resolution: {integrity: sha512-CxT5tCqpA9/jXFlme9xIBCc5RPtdDq3JpkkhgHQqtDdiTnTI0jtZ0QzXhr5DILeYifDPp2wvY2ad+7+hLMW5Pw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.2 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-json-strings@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-81nTOqM1dMwZ/aRXQ59zVubN9wHGqk6UtqRK+/q+ciXmRy8fSolhGVvG09HHRGo4l6fr/c4ZhXUQH0uFW7PZbg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.5) + + /@babel/plugin-transform-literals@7.22.5(@babel/core@7.23.2): + resolution: {integrity: sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.2 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-literals@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-literals@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-wZ0PIXRxnwZvl9AYpqNUxpZ5BiTGrYt7kueGQ+N5FiQ7RCOD4cm8iShd6S6ggfVIWaJf2EMk8eRzAh52RfP4rQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + + /@babel/plugin-transform-logical-assignment-operators@7.22.11(@babel/core@7.23.2): + resolution: {integrity: sha512-qQwRTP4+6xFCDV5k7gZBF3C31K34ut0tbEcTKxlX/0KXxm9GLcO14p570aWxFvVzx6QAfPgq7gaeIHXJC8LswQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.2 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.2) + dev: false - /@babel/plugin-transform-flow-strip-types@7.22.5(@babel/core@7.23.2): - resolution: {integrity: sha512-tujNbZdxdG0/54g/oua8ISToaXTFBf8EnSb5PgQSciIXWOWKX3S4+JR7ZE9ol8FZwf9kxitzkGQ+QWeov/mCiA==} + /@babel/plugin-transform-logical-assignment-operators@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-Mc/ALf1rmZTP4JKKEhUwiORU+vcfarFVLfcFiolKUo6sewoxSEgl36ak5t+4WamRsNr6nzjZXQjM35WsU+9vbg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-flow': 7.22.5(@babel/core@7.23.2) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.5) - /@babel/plugin-transform-for-of@7.22.15(@babel/core@7.23.2): - resolution: {integrity: sha512-me6VGeHsx30+xh9fbDLLPi0J1HzmeIIyenoOQHuw2D4m2SAU3NrspX5XxJLBpqn5yrLzrlw2Iy3RA//Bx27iOA==} + /@babel/plugin-transform-member-expression-literals@7.22.5(@babel/core@7.23.2): + resolution: {integrity: sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false - /@babel/plugin-transform-function-name@7.22.5(@babel/core@7.23.2): - resolution: {integrity: sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg==} + /@babel/plugin-transform-member-expression-literals@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 - '@babel/helper-compilation-targets': 7.22.15 - '@babel/helper-function-name': 7.23.0 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 + dev: false - /@babel/plugin-transform-json-strings@7.22.11(@babel/core@7.23.2): - resolution: {integrity: sha512-CxT5tCqpA9/jXFlme9xIBCc5RPtdDq3JpkkhgHQqtDdiTnTI0jtZ0QzXhr5DILeYifDPp2wvY2ad+7+hLMW5Pw==} + /@babel/plugin-transform-member-expression-literals@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-sC3LdDBDi5x96LA+Ytekz2ZPk8i/Ck+DEuDbRAll5rknJ5XRTSaPKEYwomLcs1AA8wg9b3KjIQRsnApj+q51Ag==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.2) - /@babel/plugin-transform-literals@7.22.5(@babel/core@7.23.2): - resolution: {integrity: sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g==} + /@babel/plugin-transform-modules-amd@7.23.0(@babel/core@7.23.2): + resolution: {integrity: sha512-xWT5gefv2HGSm4QHtgc1sYPbseOyf+FFDo2JbpE25GWl5BqTGO9IMwTYJRoIdjsF85GE+VegHxSCUt5EvoYTAw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.2 + '@babel/helper-module-transforms': 7.23.0(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 + dev: false - /@babel/plugin-transform-logical-assignment-operators@7.22.11(@babel/core@7.23.2): - resolution: {integrity: sha512-qQwRTP4+6xFCDV5k7gZBF3C31K34ut0tbEcTKxlX/0KXxm9GLcO14p570aWxFvVzx6QAfPgq7gaeIHXJC8LswQ==} + /@babel/plugin-transform-modules-amd@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-vJYQGxeKM4t8hYCKVBlZX/gtIY2I7mRGFNcm85sgXGMTBcoV3QdVtdpbcWEbzbfUIUZKwvgFT82mRvaQIebZzw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.2) - /@babel/plugin-transform-member-expression-literals@7.22.5(@babel/core@7.23.2): - resolution: {integrity: sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew==} + /@babel/plugin-transform-modules-commonjs@7.23.0(@babel/core@7.23.2): + resolution: {integrity: sha512-32Xzss14/UVc7k9g775yMIvkVK8xwKE0DPdP5JTapr3+Z9w4tzeOuLNY6BXDQR6BdnzIlXnCGAzsk/ICHBLVWQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.23.2 + '@babel/helper-module-transforms': 7.23.0(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-simple-access': 7.22.5 + dev: false - /@babel/plugin-transform-modules-amd@7.23.0(@babel/core@7.23.2): - resolution: {integrity: sha512-xWT5gefv2HGSm4QHtgc1sYPbseOyf+FFDo2JbpE25GWl5BqTGO9IMwTYJRoIdjsF85GE+VegHxSCUt5EvoYTAw==} + /@babel/plugin-transform-modules-commonjs@7.23.0(@babel/core@7.23.5): + resolution: {integrity: sha512-32Xzss14/UVc7k9g775yMIvkVK8xwKE0DPdP5JTapr3+Z9w4tzeOuLNY6BXDQR6BdnzIlXnCGAzsk/ICHBLVWQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 - '@babel/helper-module-transforms': 7.23.0(@babel/core@7.23.2) + '@babel/core': 7.23.5 + '@babel/helper-module-transforms': 7.23.0(@babel/core@7.23.5) '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-simple-access': 7.22.5 + dev: false - /@babel/plugin-transform-modules-commonjs@7.23.0(@babel/core@7.23.2): - resolution: {integrity: sha512-32Xzss14/UVc7k9g775yMIvkVK8xwKE0DPdP5JTapr3+Z9w4tzeOuLNY6BXDQR6BdnzIlXnCGAzsk/ICHBLVWQ==} + /@babel/plugin-transform-modules-commonjs@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 - '@babel/helper-module-transforms': 7.23.0(@babel/core@7.23.2) + '@babel/core': 7.23.5 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-simple-access': 7.22.5 @@ -2019,6 +2816,19 @@ packages: '@babel/helper-module-transforms': 7.23.0(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-validator-identifier': 7.22.20 + dev: false + + /@babel/plugin-transform-modules-systemjs@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-ZxyKGTkF9xT9YJuKQRo19ewf3pXpopuYQd8cDXqNzc3mUNbOME0RKMoZxviQk74hwzfQsEe66dE92MaZbdHKNQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-identifier': 7.22.20 /@babel/plugin-transform-modules-umd@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ==} @@ -2029,6 +2839,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-module-transforms': 7.23.0(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-modules-umd@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-zHsy9iXX2nIsCBFPud3jKn1IRPWg3Ing1qOZgeKV39m1ZgIdpJqvlWVeiHBZC6ITRG0MfskhYe9cLgntfSFPIg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-named-capturing-groups-regex@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==} @@ -2039,6 +2860,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-named-capturing-groups-regex@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-new-target@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw==} @@ -2048,6 +2880,16 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-new-target@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-YJ3xKqtJMAT5/TIZnpAR3I+K+WaDowYbN3xyxI8zxx/Gsypwf9B9h0VB+1Nh6ACAAPRS5NSRje0uVv5i79HYGQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-nullish-coalescing-operator@7.22.11(@babel/core@7.23.2): resolution: {integrity: sha512-YZWOw4HxXrotb5xsjMJUDlLgcDXSfO9eCmdl1bgW4+/lAGdkjaEvOnQ4p5WKKdUgSzO39dgPl0pTnfxm0OAXcg==} @@ -2058,6 +2900,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-nullish-coalescing-operator@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.5) /@babel/plugin-transform-numeric-separator@7.22.11(@babel/core@7.23.2): resolution: {integrity: sha512-3dzU4QGPsILdJbASKhF/V2TVP+gJya1PsueQCxIPCEcerqF21oEcrob4mzjsp2Py/1nLfF5m+xYNMDpmA8vffg==} @@ -2068,6 +2921,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-numeric-separator@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-mps6auzgwjRrwKEZA05cOwuDc9FAzoyFS4ZsG/8F43bTLf/TgkJg7QXOrPO1JO599iA3qgK9MXdMGOEC8O1h6Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.5) /@babel/plugin-transform-object-rest-spread@7.22.15(@babel/core@7.23.2): resolution: {integrity: sha512-fEB+I1+gAmfAyxZcX1+ZUwLeAuuf8VIg67CTznZE0MqVFumWkh8xWtn58I4dxdVf080wn7gzWoF8vndOViJe9Q==} @@ -2081,6 +2945,20 @@ packages: '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.2) '@babel/plugin-transform-parameters': 7.22.15(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-object-rest-spread@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-9x9K1YyeQVw0iOXJlIzwm8ltobIIv7j2iLyP2jIhEbqPRQ7ScNgwQufU2I0Gq11VjyG4gI4yMXt2VFags+1N3g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.23.5 + '@babel/core': 7.23.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.23.5) /@babel/plugin-transform-object-super@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw==} @@ -2091,6 +2969,28 @@ packages: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-object-super@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.5) + dev: false + + /@babel/plugin-transform-object-super@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-BwQ8q0x2JG+3lxCVFohg+KbQM7plfpBwThdW9A6TMtWwLsbDA01Ek2Zb/AgDN39BiZsExm4qrXxjk+P1/fzGrA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.5) /@babel/plugin-transform-optional-catch-binding@7.22.11(@babel/core@7.23.2): resolution: {integrity: sha512-rli0WxesXUeCJnMYhzAglEjLWVDF6ahb45HuprcmQuLidBJFWjNnOzssk2kuc6e33FlLaiZhG/kUIzUMWdBKaQ==} @@ -2101,6 +3001,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-optional-catch-binding@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-XIq8t0rJPHf6Wvmbn9nFxU6ao4c7WhghTR5WyV8SrJfUFzyxhCm4nhC+iAp3HFhbAKLfYpgzhJ6t4XCtVwqO5A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.5) /@babel/plugin-transform-optional-chaining@7.23.0(@babel/core@7.23.2): resolution: {integrity: sha512-sBBGXbLJjxTzLBF5rFWaikMnOGOk/BmK6vVByIdEggZ7Vn6CvWXZyRkkLFK6WE0IF8jSliyOkUN6SScFgzCM0g==} @@ -2112,6 +3023,18 @@ packages: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-optional-chaining@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.5) /@babel/plugin-transform-parameters@7.22.15(@babel/core@7.12.9): resolution: {integrity: sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ==} @@ -2131,6 +3054,26 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-parameters@7.22.15(@babel/core@7.23.5): + resolution: {integrity: sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-parameters@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-09lMt6UsUb3/34BbECKVbVwrT9bO6lILWln237z7sLaWnMsTi7Yc9fhX5DLpkJzAGfaReXI22wP41SZmnAA3Vw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-private-methods@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA==} @@ -2141,6 +3084,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-private-methods@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-UzqRcRtWsDMTLrRWFvUBDwmw06tCQH9Rl1uAjfh6ijMSmGYQ+fpdB+cnqRC8EMh5tuuxSv0/TejGL+7vyj+50g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-private-property-in-object@7.22.11(@babel/core@7.23.2): resolution: {integrity: sha512-sSCbqZDBKHetvjSwpyWzhuHkmW5RummxJBVbYLkGkaiTOWGxml7SXt0iWa03bzxFIx7wOj3g/ILRd0RcJKBeSQ==} @@ -2153,6 +3107,19 @@ packages: '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-private-property-in-object@7.23.4(@babel/core@7.23.5): + resolution: {integrity: sha512-9G3K1YqTq3F4Vt88Djx1UZ79PDyj+yKRnUy7cZGSMe+a7jkwD259uKKuUzQlPkGam7R+8RJwh5z4xO27fA1o2A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.23.5) /@babel/plugin-transform-property-literals@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ==} @@ -2162,14 +3129,34 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-property-literals@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-property-literals@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-jR3Jn3y7cZp4oEWPFAlRsSWjxKe4PZILGBSd4nis1TsC5qeSpb+nrtihJuDhNI7QHiVbUaiXa0X2RZY3/TI6Nw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 - /@babel/plugin-transform-react-constant-elements@7.22.5(@babel/core@7.23.2): + /@babel/plugin-transform-react-constant-elements@7.22.5(@babel/core@7.23.5): resolution: {integrity: sha512-BF5SXoO+nX3h5OhlN78XbbDrBOffv+AxPP2ENaJOVqjWCgBDeOY3WcaUcddutGSfoap+5NEQ/q/4I3WZIvgkXA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 dev: false @@ -2181,6 +3168,17 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-react-display-name@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-PVk3WPYudRF5z4GKMEYUrLjPl38fJSKNaEOkFuoprioowGuWN6w2RKznuFNSlJx7pzzXXStPUnNSOEO0jL5EVw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false /@babel/plugin-transform-react-jsx-development@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-bDhuzwWMuInwCYeDeMzyi7TaBgRQei6DqxhbyniL7/VG4RSS7HtSL2QbY4eESy1KJqlWt8g3xeEBGPuo+XqC8A==} @@ -2192,23 +3190,35 @@ packages: '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.23.2) dev: false - /@babel/plugin-transform-react-jsx-self@7.22.5(@babel/core@7.23.2): + /@babel/plugin-transform-react-jsx-development@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-bDhuzwWMuInwCYeDeMzyi7TaBgRQei6DqxhbyniL7/VG4RSS7HtSL2QbY4eESy1KJqlWt8g3xeEBGPuo+XqC8A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.23.5) + dev: false + + /@babel/plugin-transform-react-jsx-self@7.22.5(@babel/core@7.23.5): resolution: {integrity: sha512-nTh2ogNUtxbiSbxaT4Ds6aXnXEipHweN9YRgOX/oNXdf0cCrGn/+2LozFa3lnPV5D90MkjhgckCPBrsoSc1a7g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 + dev: false - /@babel/plugin-transform-react-jsx-source@7.22.5(@babel/core@7.23.2): + /@babel/plugin-transform-react-jsx-source@7.22.5(@babel/core@7.23.5): resolution: {integrity: sha512-yIiRO6yobeEIaI0RTbIr8iAK9FcBHLtZq0S89ZPjDLQXBA4xvghaKqI0etp/tF3htTM0sazJKKLz9oEiGRtu7w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 + dev: false /@babel/plugin-transform-react-jsx@7.22.15(@babel/core@7.23.2): resolution: {integrity: sha512-oKckg2eZFa8771O/5vi7XeTvmM6+O9cxZu+kanTU7tD4sin5nO/G8jGJhq8Hvt2Z0kUoEDRayuZLaUlYl8QuGA==} @@ -2222,6 +3232,21 @@ packages: '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.23.2) '@babel/types': 7.23.0 + dev: false + + /@babel/plugin-transform-react-jsx@7.22.15(@babel/core@7.23.5): + resolution: {integrity: sha512-oKckg2eZFa8771O/5vi7XeTvmM6+O9cxZu+kanTU7tD4sin5nO/G8jGJhq8Hvt2Z0kUoEDRayuZLaUlYl8QuGA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.23.5) + '@babel/types': 7.23.0 + dev: false /@babel/plugin-transform-react-pure-annotations@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-gP4k85wx09q+brArVinTXhWiyzLl9UpmGva0+mWyKxk6JZequ05x3eUcIUE+FyttPKJFRRVtAvQaJ6YF9h1ZpA==} @@ -2234,6 +3259,17 @@ packages: '@babel/helper-plugin-utils': 7.22.5 dev: false + /@babel/plugin-transform-react-pure-annotations@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-gP4k85wx09q+brArVinTXhWiyzLl9UpmGva0+mWyKxk6JZequ05x3eUcIUE+FyttPKJFRRVtAvQaJ6YF9h1ZpA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + /@babel/plugin-transform-regenerator@7.22.10(@babel/core@7.23.2): resolution: {integrity: sha512-F28b1mDt8KcT5bUyJc/U9nwzw6cV+UmTeRlXYIl2TNqMMJif0Jeey9/RQ3C4NOd2zp0/TRsDns9ttj2L523rsw==} engines: {node: '>=6.9.0'} @@ -2243,6 +3279,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 regenerator-transform: 0.15.2 + dev: false + + /@babel/plugin-transform-regenerator@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-KP+75h0KghBMcVpuKisx3XTu9Ncut8Q8TuvGO4IhY+9D5DFEckQefOuIsB/gQ2tG71lCke4NMrtIPS8pOj18BQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + regenerator-transform: 0.15.2 /@babel/plugin-transform-reserved-words@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA==} @@ -2252,6 +3299,16 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-reserved-words@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-QnNTazY54YqgGxwIexMZva9gqbPa15t/x9VS+0fsEFWplwVpXYZivtgl43Z1vMpc1bdPP2PP8siFeVcnFvA3Cg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-runtime@7.23.2(@babel/core@7.23.2): resolution: {integrity: sha512-XOntj6icgzMS58jPVtQpiuF6ZFWxQiJavISGx5KGjRj+3gqZr8+N6Kx+N9BApWzgS+DOjIZfXXj0ZesenOWDyA==} @@ -2268,6 +3325,24 @@ packages: semver: 6.3.1 transitivePeerDependencies: - supports-color + dev: false + + /@babel/plugin-transform-runtime@7.23.2(@babel/core@7.23.5): + resolution: {integrity: sha512-XOntj6icgzMS58jPVtQpiuF6ZFWxQiJavISGx5KGjRj+3gqZr8+N6Kx+N9BApWzgS+DOjIZfXXj0ZesenOWDyA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + babel-plugin-polyfill-corejs2: 0.4.6(@babel/core@7.23.5) + babel-plugin-polyfill-corejs3: 0.8.6(@babel/core@7.23.5) + babel-plugin-polyfill-regenerator: 0.5.3(@babel/core@7.23.5) + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + dev: false /@babel/plugin-transform-shorthand-properties@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA==} @@ -2277,6 +3352,26 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-shorthand-properties@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-shorthand-properties@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-ED2fgqZLmexWiN+YNFX26fx4gh5qHDhn1O2gvEhreLW2iI63Sqm4llRLCXALKrCnbN4Jy0VcMQZl/SAzqug/jg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-spread@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg==} @@ -2287,6 +3382,28 @@ packages: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + dev: false + + /@babel/plugin-transform-spread@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + dev: false + + /@babel/plugin-transform-spread@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-VvfVYlrlBVu+77xVTOAoxQ6mZbnIq5FM0aGBSFEcIh03qHf+zNqA4DC/3XMUozTg7bZV3e3mZQ0i13VB6v5yUg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 /@babel/plugin-transform-sticky-regex@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw==} @@ -2296,6 +3413,16 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-sticky-regex@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-HZOyN9g+rtvnOU3Yh7kSxXrKbzgrm5X4GncPY1QOquu7epga5MxKHVpYu2hvQnry/H+JjckSYRb93iNfsioAGg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-template-literals@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA==} @@ -2305,6 +3432,26 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-template-literals@7.22.5(@babel/core@7.23.5): + resolution: {integrity: sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-template-literals@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-Flok06AYNp7GV2oJPZZcP9vZdszev6vPBkHLwxwSpaIqx75wn6mUd3UFWsSsA0l8nXAKkyCmL/sR02m8RYGeHg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-typeof-symbol@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA==} @@ -2314,6 +3461,16 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-typeof-symbol@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-4t15ViVnaFdrPC74be1gXBSMzXk3B4Us9lP7uLRQHTFpV5Dvt33pn+2MyyNxmN3VTTm3oTrZVMUmuw3oBnQ2oQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-typescript@7.22.15(@babel/core@7.23.2): resolution: {integrity: sha512-1uirS0TnijxvQLnlv5wQBwOX3E1wCFX7ITv+9pBV2wKEk4K+M5tqDaoNXnTH8tjEIYHLO98MwiTWO04Ggz4XuA==} @@ -2326,6 +3483,19 @@ packages: '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.23.2) + dev: false + + /@babel/plugin-transform-typescript@7.23.5(@babel/core@7.23.5): + resolution: {integrity: sha512-2fMkXEJkrmwgu2Bsv1Saxgj30IXZdJ+84lQcKKI7sm719oXs0BBw2ZENKdJdR1PjWndgLCEBNXJOri0fk7RYQA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.23.5(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-typescript': 7.23.3(@babel/core@7.23.5) /@babel/plugin-transform-unicode-escapes@7.22.10(@babel/core@7.23.2): resolution: {integrity: sha512-lRfaRKGZCBqDlRU3UIFovdp9c9mEvlylmpod0/OatICsSfuQ9YFthRo1tpTkGsklEefZdqlEFdY4A2dwTb6ohg==} @@ -2335,6 +3505,16 @@ packages: dependencies: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-unicode-escapes@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-OMCUx/bU6ChE3r4+ZdylEqAjaQgHAgipgW8nsCfu5pGqDcFytVd91AwRvUJSBZDz0exPGgnjoqhgRYLRjFZc9Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-unicode-property-regex@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A==} @@ -2345,6 +3525,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-unicode-property-regex@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-KcLIm+pDZkWZQAFJ9pdfmh89EwVfmNovFBcXko8szpBeF8z68kWIPeKlmSOkT9BXJxs2C0uk+5LxoxIv62MROA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-unicode-regex@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg==} @@ -2355,6 +3546,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-unicode-regex@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-wMHpNA4x2cIA32b/ci3AfwNgheiva2W0WUKWTK7vBHBhDKfPsc5cFGNWm69WBqpwd86u1qwZ9PWevKqm1A3yAw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-unicode-sets-regex@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg==} @@ -2365,6 +3567,17 @@ packages: '@babel/core': 7.23.2 '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.2) '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-unicode-sets-regex@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-W7lliA/v9bNR83Qc3q1ip9CQMZ09CcHDbHfbLRDNuAhn1Mvkr1ZNF7hPmztMQvtTGVLJ9m8IZqWsTkXOml8dbw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.5) + '@babel/helper-plugin-utils': 7.22.5 /@babel/preset-env@7.23.2(@babel/core@7.23.2): resolution: {integrity: sha512-BW3gsuDD+rvHL2VO2SjAUNTBe5YrjsTiDyqamPDWY723na3/yPQ65X5oQkFVJZ0o50/2d+svm1rkPoJeR1KxVQ==} @@ -2455,17 +3668,109 @@ packages: semver: 6.3.1 transitivePeerDependencies: - supports-color + dev: false + + /@babel/preset-env@7.23.5(@babel/core@7.23.5): + resolution: {integrity: sha512-0d/uxVD6tFGWXGDSfyMD1p2otoaKmu6+GD+NfAx0tMaH+dxORnp7T9TaVQ6mKyya7iBtCIVxHjWT7MuzzM9z+A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.23.5 + '@babel/core': 7.23.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.23.5 + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.23.5) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.5) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.23.5) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.23.5) + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-import-assertions': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-syntax-import-attributes': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.23.5) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.5) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.5) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.23.5) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.23.5) + '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.23.5) + '@babel/plugin-transform-arrow-functions': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-async-generator-functions': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-async-to-generator': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-block-scoped-functions': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-block-scoping': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-class-properties': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-class-static-block': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-classes': 7.23.5(@babel/core@7.23.5) + '@babel/plugin-transform-computed-properties': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-destructuring': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-dotall-regex': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-duplicate-keys': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-dynamic-import': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-exponentiation-operator': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-export-namespace-from': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-for-of': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-function-name': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-json-strings': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-literals': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-logical-assignment-operators': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-member-expression-literals': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-modules-amd': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-modules-systemjs': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-modules-umd': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-named-capturing-groups-regex': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-new-target': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-nullish-coalescing-operator': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-numeric-separator': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-object-rest-spread': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-object-super': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-optional-catch-binding': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-optional-chaining': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-private-methods': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-private-property-in-object': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-property-literals': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-regenerator': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-reserved-words': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-shorthand-properties': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-spread': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-sticky-regex': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-template-literals': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-typeof-symbol': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-unicode-escapes': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-unicode-property-regex': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-unicode-regex': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-unicode-sets-regex': 7.23.3(@babel/core@7.23.5) + '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.23.5) + babel-plugin-polyfill-corejs2: 0.4.6(@babel/core@7.23.5) + babel-plugin-polyfill-corejs3: 0.8.6(@babel/core@7.23.5) + babel-plugin-polyfill-regenerator: 0.5.3(@babel/core@7.23.5) + core-js-compat: 3.33.1 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color - /@babel/preset-flow@7.22.15(@babel/core@7.23.2): + /@babel/preset-flow@7.22.15(@babel/core@7.23.5): resolution: {integrity: sha512-dB5aIMqpkgbTfN5vDdTRPzjqtWiZcRESNR88QYnoPR+bmdYoluOzMX9tQerTv0XzSgZYctPfO1oc0N5zdog1ew==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-validator-option': 7.22.15 - '@babel/plugin-transform-flow-strip-types': 7.22.5(@babel/core@7.23.2) + '@babel/helper-validator-option': 7.23.5 + '@babel/plugin-transform-flow-strip-types': 7.22.5(@babel/core@7.23.5) + dev: false /@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.23.2): resolution: {integrity: sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==} @@ -2476,6 +3781,17 @@ packages: '@babel/helper-plugin-utils': 7.22.5 '@babel/types': 7.23.0 esutils: 2.0.3 + dev: false + + /@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.23.5): + resolution: {integrity: sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==} + peerDependencies: + '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/types': 7.23.0 + esutils: 2.0.3 /@babel/preset-react@7.22.15(@babel/core@7.23.2): resolution: {integrity: sha512-Csy1IJ2uEh/PecCBXXoZGAZBeCATTuePzCSB7dLYWS0vOEj6CNpjxIhW4duWwZodBNueH7QO14WbGn8YyeuN9w==} @@ -2492,6 +3808,21 @@ packages: '@babel/plugin-transform-react-pure-annotations': 7.22.5(@babel/core@7.23.2) dev: false + /@babel/preset-react@7.22.15(@babel/core@7.23.5): + resolution: {integrity: sha512-Csy1IJ2uEh/PecCBXXoZGAZBeCATTuePzCSB7dLYWS0vOEj6CNpjxIhW4duWwZodBNueH7QO14WbGn8YyeuN9w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.22.15 + '@babel/plugin-transform-react-display-name': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.23.5) + '@babel/plugin-transform-react-jsx-development': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-react-pure-annotations': 7.22.5(@babel/core@7.23.5) + dev: false + /@babel/preset-typescript@7.23.2(@babel/core@7.23.2): resolution: {integrity: sha512-u4UJc1XsS1GhIGteM8rnGiIvf9rJpiVgMEeCnwlLA7WJPC+jcXWJAGxYmeqs5hOZD8BbAfnV5ezBOxQbb4OUxA==} engines: {node: '>=6.9.0'} @@ -2504,19 +3835,34 @@ packages: '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.23.2) '@babel/plugin-transform-modules-commonjs': 7.23.0(@babel/core@7.23.2) '@babel/plugin-transform-typescript': 7.22.15(@babel/core@7.23.2) + dev: false + + /@babel/preset-typescript@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-17oIGVlqz6CchO9RFYn5U6ZpWRZIngayYCtrPRSgANSwC2V1Jb+iP74nVxzzXJte8b8BYxrL1yY96xfhTBrNNQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.22.15 + '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-typescript': 7.23.5(@babel/core@7.23.5) - /@babel/register@7.22.15(@babel/core@7.23.2): + /@babel/register@7.22.15(@babel/core@7.23.5): resolution: {integrity: sha512-V3Q3EqoQdn65RCgTLwauZaTfd1ShhwPmbBv+1dkZV/HpCGMKVyn6oFcRlI7RaKqiDQjX2Qd3AuoEguBgdjIKlg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 clone-deep: 4.0.1 find-cache-dir: 2.1.0 make-dir: 2.1.0 pirates: 4.0.6 source-map-support: 0.5.21 + dev: false /@babel/regjsgen@0.8.0: resolution: {integrity: sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==} @@ -2538,22 +3884,22 @@ packages: resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.13 - '@babel/parser': 7.23.0 - '@babel/types': 7.23.0 + '@babel/code-frame': 7.23.5 + '@babel/parser': 7.23.5 + '@babel/types': 7.23.5 /@babel/traverse@7.17.3: resolution: {integrity: sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.22.13 - '@babel/generator': 7.17.7 + '@babel/generator': 7.23.0 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-function-name': 7.23.0 '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.18.9 - '@babel/types': 7.17.0 + '@babel/parser': 7.23.0 + '@babel/types': 7.23.0 debug: 4.3.4(supports-color@8.1.1) globals: 11.12.0 transitivePeerDependencies: @@ -2564,7 +3910,7 @@ packages: resolution: {integrity: sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 '@babel/generator': 7.23.0 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-function-name': 7.23.0 @@ -2577,6 +3923,23 @@ packages: transitivePeerDependencies: - supports-color + /@babel/traverse@7.23.5: + resolution: {integrity: sha512-czx7Xy5a6sapWWRx61m1Ke1Ra4vczu1mCTtJam5zRTBOonfdJ+S/B6HYmGYu3fJtr8GGET3si6IhgWVBhJ/m8w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.23.5 + '@babel/types': 7.23.5 + debug: 4.3.4(supports-color@8.1.1) + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + /@babel/types@7.17.0: resolution: {integrity: sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==} engines: {node: '>=6.9.0'} @@ -2593,6 +3956,14 @@ packages: '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 + /@babel/types@7.23.5: + resolution: {integrity: sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + /@bcherny/json-schema-ref-parser@10.0.5-fork: resolution: {integrity: sha512-E/jKbPoca1tfUPj3iSbitDZTGnq6FUFjkH6L8U2oDwSuwK1WhnnVtCG7oFOTg/DDnyoXbQYUiUiGOibHqaGVnw==} engines: {node: '>= 16'} @@ -2605,12 +3976,13 @@ packages: /@bcoe/v8-coverage@0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + dev: true /@braintree/sanitize-url@6.0.4: resolution: {integrity: sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==} dev: false - /@celo/rainbowkit-celo@1.1.0(@rainbow-me/rainbowkit@1.0.8)(react@18.2.0)(typescript@5.1.6)(viem@1.5.3)(wagmi@1.3.9)(zod@3.22.4): + /@celo/rainbowkit-celo@1.1.0(@rainbow-me/rainbowkit@1.2.0)(react@18.2.0)(typescript@5.1.6)(viem@1.19.9)(wagmi@1.4.5)(zod@3.22.4): resolution: {integrity: sha512-/G4HFhJNwUk6uU1yqGfQ/LIoNg9UAA4BUcEvFdd0M3DImnKlhodNLUdCmzqv96sjc/I7tMJqBeTnmbhwXdlsjQ==} peerDependencies: '@rainbow-me/rainbowkit': '>=1.0.2 && <=2.0.0' @@ -2618,10 +3990,10 @@ packages: wagmi: '>=1.0.0 && <=2.0.0' dependencies: '@metamask/providers': 11.1.2 - '@rainbow-me/rainbowkit': 1.0.8(@types/react@18.2.31)(react-dom@18.2.0)(react@18.2.0)(viem@1.5.3)(wagmi@1.3.9) - '@wagmi/connectors': 2.6.6(@wagmi/chains@1.6.0)(react@18.2.0)(typescript@5.1.6)(viem@1.5.3)(zod@3.22.4) - viem: 1.5.3(typescript@5.1.6)(zod@3.22.4) - wagmi: 1.3.9(@types/react@18.2.31)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@1.5.3)(zod@3.22.4) + '@rainbow-me/rainbowkit': 1.2.0(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(viem@1.19.9)(wagmi@1.4.5) + '@wagmi/connectors': 2.7.0(react@18.2.0)(typescript@5.1.6)(viem@1.19.9)(zod@3.22.4) + viem: 1.19.9(typescript@5.1.6)(zod@3.22.4) + wagmi: 1.4.5(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@1.19.9)(zod@3.22.4) transitivePeerDependencies: - '@react-native-async-storage/async-storage' - '@wagmi/chains' @@ -2635,6 +4007,19 @@ packages: - zod dev: false + /@chainlink/contracts@0.8.0(ethers@6.8.0): + resolution: {integrity: sha512-nUv1Uxw5Mn92wgLs2bgPYmo8hpdQ3s9jB/lcbdU0LmNOVu0hbfmouVnqwRLa28Ll50q6GczUA+eO0ikNIKLZsA==} + dependencies: + '@eth-optimism/contracts': 0.5.40(ethers@6.8.0) + '@openzeppelin/contracts': 4.3.3 + '@openzeppelin/contracts-upgradeable-4.7.3': /@openzeppelin/contracts-upgradeable@4.7.3 + '@openzeppelin/contracts-v0.7': /@openzeppelin/contracts@3.4.2 + transitivePeerDependencies: + - bufferutil + - ethers + - utf-8-validate + dev: true + /@chainsafe/as-sha256@0.3.1: resolution: {integrity: sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==} @@ -2735,8 +4120,8 @@ packages: mime: 3.0.0 dev: true - /@cloudflare/workers-types@4.20231016.0: - resolution: {integrity: sha512-eGB0cRVyoJpeyGJx2re5sbd9R316a61sY73xwnqm4cwGpb+OxCK2gc651RxGiN7H4w6LY1RpysUgeGLmj5B3+g==} + /@cloudflare/workers-types@4.20231025.0: + resolution: {integrity: sha512-TkcZkntUTOcvJ4vgmwpNfLTclpMbmbClZCe62B25/VTukmyv91joRa4eKzSjzCZUXTbFHNmVdOpmGaaJU2U3+A==} dev: true /@coinbase/wallet-sdk@3.7.2: @@ -2808,12 +4193,12 @@ packages: ajv: 8.12.0 dev: true - /@commitlint/config-validator@18.0.0: - resolution: {integrity: sha512-PlXy5QZzQeMgQM7jb0odIhxsI6GWcbGgfy+Hkz5ap31KES/oJgtEvgD8pjg0Z9Ri296bT6zK3ts6brS0MAcMgg==} + /@commitlint/config-validator@18.1.0: + resolution: {integrity: sha512-kbHkIuItXn93o2NmTdwi5Mk1ujyuSIysRE/XHtrcps/27GuUKEIqBJp6TdJ4Sq+ze59RlzYSHMKuDKZbfg9+uQ==} engines: {node: '>=v18'} requiresBuild: true dependencies: - '@commitlint/types': 18.0.0 + '@commitlint/types': 18.1.0 ajv: 8.12.0 dev: true optional: true @@ -2835,8 +4220,8 @@ packages: engines: {node: '>=v14'} dev: true - /@commitlint/execute-rule@18.0.0: - resolution: {integrity: sha512-eNUSaHajb+g3sgZeIrfc6cXNnKIkYN2SXtDVXuiE+hOa055T0bLdZK29gSd945JCztxPVwdOkPLDeLg3NfDubg==} + /@commitlint/execute-rule@18.1.0: + resolution: {integrity: sha512-w3Vt4K+O7+nSr9/gFSEfZ1exKUOPSlJaRpnk7Y+XowEhvwT7AIk1HNANH+gETf0zGZ020+hfiMW/Ome+SNCUsg==} engines: {node: '>=v18'} requiresBuild: true dev: true @@ -2891,28 +4276,25 @@ packages: - '@swc/wasm' dev: true - /@commitlint/load@18.0.0: - resolution: {integrity: sha512-ocvMSkzNZCJ4yV673xjd4Y7sFVG/mg7S6yvL5ioM0OIG2XTbcCdzpmq+BeJcIwsRYU9g/b688yh7RDzGlbai6w==} + /@commitlint/load@18.2.0(typescript@4.9.5): + resolution: {integrity: sha512-xjX3d3CRlOALwImhOsmLYZh14/+gW/KxsY7+bPKrzmGuFailf9K7ckhB071oYZVJdACnpY4hDYiosFyOC+MpAA==} engines: {node: '>=v18'} requiresBuild: true dependencies: - '@commitlint/config-validator': 18.0.0 - '@commitlint/execute-rule': 18.0.0 - '@commitlint/resolve-extends': 18.0.0 - '@commitlint/types': 18.0.0 - '@types/node': 18.18.6 + '@commitlint/config-validator': 18.1.0 + '@commitlint/execute-rule': 18.1.0 + '@commitlint/resolve-extends': 18.1.0 + '@commitlint/types': 18.1.0 + '@types/node': 18.18.7 chalk: 4.1.2 - cosmiconfig: 8.3.6(typescript@5.2.2) - cosmiconfig-typescript-loader: 4.4.0(@types/node@18.18.6)(cosmiconfig@8.3.6)(ts-node@10.9.1)(typescript@5.2.2) + cosmiconfig: 8.3.6(typescript@4.9.5) + cosmiconfig-typescript-loader: 5.0.0(@types/node@18.18.7)(cosmiconfig@8.3.6)(typescript@4.9.5) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 resolve-from: 5.0.0 - ts-node: 10.9.1(@types/node@18.18.6)(typescript@5.2.2) - typescript: 5.2.2 transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' + - typescript dev: true optional: true @@ -2953,13 +4335,13 @@ packages: resolve-global: 1.0.0 dev: true - /@commitlint/resolve-extends@18.0.0: - resolution: {integrity: sha512-MD9+6GSiWvqgdJtfos+1gqz+zmy2vV7TbUVz2ETZzpfECgmUZSZSYzyivivBAQK6feS71KxmMLL8+YFF9+FFRQ==} + /@commitlint/resolve-extends@18.1.0: + resolution: {integrity: sha512-3mZpzOEJkELt7BbaZp6+bofJyxViyObebagFn0A7IHaLARhPkWTivXdjvZHS12nAORftv88Yhbh8eCPKfSvB7g==} engines: {node: '>=v18'} requiresBuild: true dependencies: - '@commitlint/config-validator': 18.0.0 - '@commitlint/types': 18.0.0 + '@commitlint/config-validator': 18.1.0 + '@commitlint/types': 18.1.0 import-fresh: 3.3.0 lodash.mergewith: 4.6.2 resolve-from: 5.0.0 @@ -2997,8 +4379,8 @@ packages: chalk: 4.1.2 dev: true - /@commitlint/types@18.0.0: - resolution: {integrity: sha512-FDzAdSm7kIir0NW0bZLENdrEgf/9Ihs1AAqE9DK9R+dRFby4ookkxPMaz7elZmG+e5rBl7hGrWJzJINqG9cDDg==} + /@commitlint/types@18.1.0: + resolution: {integrity: sha512-65vGxZmbs+2OVwEItxhp3Ul7X2m2LyLfifYI/NdPwRqblmuES2w2aIRhIjb7cwUIBHHSTT8WXj4ixVHQibmvLQ==} engines: {node: '>=v18'} requiresBuild: true dependencies: @@ -3012,8 +4394,8 @@ packages: dependencies: '@jridgewell/trace-mapping': 0.3.9 - /@cypress/code-coverage@3.12.5(@babel/core@7.23.2)(@babel/preset-env@7.23.2)(babel-loader@9.1.3)(cypress@12.17.4)(webpack@5.89.0): - resolution: {integrity: sha512-0hczq2kgzkh/fBLm74rHcDRX//W3bhJJw/aPWu57/pPaRp5c+LcatWuv8ZtIWNXit2kBClueOrVj0I20Arh80A==} + /@cypress/code-coverage@3.12.6(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(babel-loader@9.1.3)(cypress@12.17.4)(webpack@5.89.0): + resolution: {integrity: sha512-QeOB54dkxee8LKdbK9NqMinlMtzy60K2DexSvx4XZdrU52gut9Ukc7sUvRe44gK1yJFYno977Kx9miNIeYWVtA==} peerDependencies: '@babel/core': ^7.0.1 '@babel/preset-env': ^7.0.0 @@ -3021,10 +4403,10 @@ packages: cypress: '*' webpack: ^4 || ^5 dependencies: - '@babel/core': 7.23.2 - '@babel/preset-env': 7.23.2(@babel/core@7.23.2) - '@cypress/webpack-preprocessor': 6.0.0(@babel/core@7.23.2)(@babel/preset-env@7.23.2)(babel-loader@9.1.3)(webpack@5.89.0) - babel-loader: 9.1.3(@babel/core@7.23.2)(webpack@5.89.0) + '@babel/core': 7.23.5 + '@babel/preset-env': 7.23.5(@babel/core@7.23.5) + '@cypress/webpack-preprocessor': 6.0.0(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(babel-loader@9.1.3)(webpack@5.89.0) + babel-loader: 9.1.3(@babel/core@7.23.5)(webpack@5.89.0) chalk: 4.1.2 cypress: 12.17.4 dayjs: 1.11.10 @@ -3085,7 +4467,7 @@ packages: - webpack-cli dev: true - /@cypress/webpack-preprocessor@6.0.0(@babel/core@7.23.2)(@babel/preset-env@7.23.2)(babel-loader@9.1.3)(webpack@5.89.0): + /@cypress/webpack-preprocessor@6.0.0(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(babel-loader@9.1.3)(webpack@5.89.0): resolution: {integrity: sha512-1AS1Et5CNPJii0+DdBZBS8e0hlM2BkBNmYRdZO4/16A3KS3em1sjPZtFw7jJF00m6DYAdB9iy6QW/lLZ2bN0gg==} peerDependencies: '@babel/core': ^7.0.1 @@ -3093,9 +4475,9 @@ packages: babel-loader: ^8.3 || ^9 webpack: ^4 || ^5 dependencies: - '@babel/core': 7.23.2 - '@babel/preset-env': 7.23.2(@babel/core@7.23.2) - babel-loader: 9.1.3(@babel/core@7.23.2)(webpack@5.89.0) + '@babel/core': 7.23.5 + '@babel/preset-env': 7.23.5(@babel/core@7.23.5) + babel-loader: 9.1.3(@babel/core@7.23.5)(webpack@5.89.0) bluebird: 3.7.1 debug: 4.3.4(supports-color@8.1.1) lodash: 4.17.21 @@ -3166,13 +4548,13 @@ packages: resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==} engines: {node: '>=10.0.0'} - /@dlsl/hardhat-markup@1.0.0-rc.14(hardhat@2.13.1)(prettier@2.8.8): + /@dlsl/hardhat-markup@1.0.0-rc.14(hardhat@2.18.3)(prettier@2.8.8): resolution: {integrity: sha512-fhkjuHjM6sDzjY6xiNHiENTdNRQGDEZ8RTkFnmvGVSYP2G7VKjVvay0ZWxILIXb+WvK+JdkcVtpvR00eo8wuWg==} deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. peerDependencies: hardhat: ^2.10.0 dependencies: - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) json2md: 2.0.0 prettier-plugin-solidity: 1.1.3(prettier@2.8.8) solidity-ast: 0.4.52 @@ -3212,7 +4594,7 @@ packages: - '@algolia/client-search' dev: false - /@docusaurus/core@2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): + /@docusaurus/core@2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-dWH5P7cgeNSIg9ufReX6gaCl/TmrGKD38Orbwuz05WPhAQtFXHd5B8Qym1TiXfvUNvwoYKkAJOJuGe8ou0Z7PA==} engines: {node: '>=16.14'} hasBin: true @@ -3271,7 +4653,7 @@ packages: postcss-loader: 7.3.3(postcss@8.4.31)(typescript@4.9.5)(webpack@5.89.0) prompts: 2.4.2 react: 18.2.0 - react-dev-utils: 12.0.1(typescript@4.9.5)(webpack@5.89.0) + react-dev-utils: 12.0.1(eslint@8.52.0)(typescript@4.9.5)(webpack@5.89.0) react-dom: 18.2.0(react@18.2.0) react-helmet-async: 1.3.0(react-dom@18.2.0)(react@18.2.0) react-loadable: /@docusaurus/react-loadable@5.5.2(react@18.2.0) @@ -3279,7 +4661,7 @@ packages: react-router: 5.3.4(react@18.2.0) react-router-config: 5.1.1(react-router@5.3.4)(react@18.2.0) react-router-dom: 5.3.4(react@18.2.0) - rtl-detect: 1.0.4 + rtl-detect: 1.1.2 semver: 7.5.4 serve-handler: 6.1.5 shelljs: 0.8.5 @@ -3322,6 +4704,20 @@ packages: tslib: 2.6.2 dev: false + /@docusaurus/eslint-plugin@2.4.3(eslint@8.52.0)(typescript@4.9.5): + resolution: {integrity: sha512-CckN1JCU7biEP4JMDCNGJf6VcmaCqqIruYrvSU91pKYrFuYi0gblfkljagkHc9+mw1ZX2jtoTm4XfoZ/Q9WDCA==} + engines: {node: '>=16.14'} + peerDependencies: + eslint: '>=6' + dependencies: + '@typescript-eslint/utils': 5.62.0(eslint@8.52.0)(typescript@4.9.5) + eslint: 8.52.0 + tslib: 2.6.2 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /@docusaurus/logger@2.4.3: resolution: {integrity: sha512-Zxws7r3yLufk9xM1zq9ged0YHs65mlRmtsobnFkdZTxWXdTYlWWLWdKyNKAsVC+D7zg+pv2fGbyabdOnyZOM3w==} engines: {node: '>=16.14'} @@ -3374,7 +4770,7 @@ packages: '@docusaurus/react-loadable': 5.5.2(react@18.2.0) '@docusaurus/types': 2.4.3(react-dom@18.2.0)(react@18.2.0) '@types/history': 4.7.11 - '@types/react': 18.2.31 + '@types/react': 18.2.33 '@types/react-router-config': 5.0.9 '@types/react-router-dom': 5.3.3 react: 18.2.0 @@ -3387,14 +4783,14 @@ packages: - uglify-js - webpack-cli - /@docusaurus/plugin-content-blog@2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): + /@docusaurus/plugin-content-blog@2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-PVhypqaA0t98zVDpOeTqWUTvRqCEjJubtfFUQ7zJNYdbYTbS/E/ytq6zbLVsN/dImvemtO/5JQgjLxsh8XLo8Q==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/logger': 2.4.3 '@docusaurus/mdx-loader': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0) '@docusaurus/types': 2.4.3(react-dom@18.2.0)(react@18.2.0) @@ -3430,14 +4826,14 @@ packages: - webpack-cli dev: false - /@docusaurus/plugin-content-docs@2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): + /@docusaurus/plugin-content-docs@2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-N7Po2LSH6UejQhzTCsvuX5NOzlC+HiXOVvofnEPj0WhMu1etpLEXE6a4aTxrtg95lQ5kf0xUIdjX9sh3d3G76A==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/logger': 2.4.3 '@docusaurus/mdx-loader': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0) '@docusaurus/module-type-aliases': 2.4.3(react-dom@18.2.0)(react@18.2.0) @@ -3473,14 +4869,14 @@ packages: - webpack-cli dev: false - /@docusaurus/plugin-content-pages@2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): + /@docusaurus/plugin-content-pages@2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-txtDVz7y3zGk67q0HjG0gRttVPodkHqE0bpJ+7dOaTH40CQFLSh7+aBeGnPOTl+oCPG+hxkim4SndqPqXjQ8Bg==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/mdx-loader': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0) '@docusaurus/types': 2.4.3(react-dom@18.2.0)(react@18.2.0) '@docusaurus/utils': 2.4.3(@docusaurus/types@2.4.3) @@ -3508,14 +4904,14 @@ packages: - webpack-cli dev: false - /@docusaurus/plugin-debug@2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): + /@docusaurus/plugin-debug@2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-LkUbuq3zCmINlFb+gAd4ZvYr+bPAzMC0hwND4F7V9bZ852dCX8YoWyovVUBKq4er1XsOwSQaHmNGtObtn8Av8Q==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/types': 2.4.3(react-dom@18.2.0)(react@18.2.0) '@docusaurus/utils': 2.4.3(@docusaurus/types@2.4.3) fs-extra: 10.1.0 @@ -3543,14 +4939,14 @@ packages: - webpack-cli dev: false - /@docusaurus/plugin-google-analytics@2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): + /@docusaurus/plugin-google-analytics@2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-KzBV3k8lDkWOhg/oYGxlK5o9bOwX7KpPc/FTWoB+SfKhlHfhq7qcQdMi1elAaVEIop8tgK6gD1E58Q+XC6otSQ==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/types': 2.4.3(react-dom@18.2.0)(react@18.2.0) '@docusaurus/utils-validation': 2.4.3(@docusaurus/types@2.4.3) react: 18.2.0 @@ -3574,14 +4970,14 @@ packages: - webpack-cli dev: false - /@docusaurus/plugin-google-gtag@2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): + /@docusaurus/plugin-google-gtag@2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-5FMg0rT7sDy4i9AGsvJC71MQrqQZwgLNdDetLEGDHLfSHLvJhQbTCUGbGXknUgWXQJckcV/AILYeJy+HhxeIFA==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/types': 2.4.3(react-dom@18.2.0)(react@18.2.0) '@docusaurus/utils-validation': 2.4.3(@docusaurus/types@2.4.3) react: 18.2.0 @@ -3605,14 +5001,14 @@ packages: - webpack-cli dev: false - /@docusaurus/plugin-google-tag-manager@2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): + /@docusaurus/plugin-google-tag-manager@2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-1jTzp71yDGuQiX9Bi0pVp3alArV0LSnHXempvQTxwCGAEzUWWaBg4d8pocAlTpbP9aULQQqhgzrs8hgTRPOM0A==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/types': 2.4.3(react-dom@18.2.0)(react@18.2.0) '@docusaurus/utils-validation': 2.4.3(@docusaurus/types@2.4.3) react: 18.2.0 @@ -3636,14 +5032,14 @@ packages: - webpack-cli dev: false - /@docusaurus/plugin-sitemap@2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): + /@docusaurus/plugin-sitemap@2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-LRQYrK1oH1rNfr4YvWBmRzTL0LN9UAPxBbghgeFRBm5yloF6P+zv1tm2pe2hQTX/QP5bSKdnajCvfnScgKXMZQ==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/logger': 2.4.3 '@docusaurus/types': 2.4.3(react-dom@18.2.0)(react@18.2.0) '@docusaurus/utils': 2.4.3(@docusaurus/types@2.4.3) @@ -3672,25 +5068,25 @@ packages: - webpack-cli dev: false - /@docusaurus/preset-classic@2.4.3(@algolia/client-search@4.20.0)(react-dom@18.2.0)(react@18.2.0)(search-insights@2.9.0)(typescript@4.9.5): + /@docusaurus/preset-classic@2.4.3(@algolia/client-search@4.20.0)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(search-insights@2.9.0)(typescript@4.9.5): resolution: {integrity: sha512-tRyMliepY11Ym6hB1rAFSNGwQDpmszvWYJvlK1E+md4SW8i6ylNHtpZjaYFff9Mdk3i/Pg8ItQq9P0daOJAvQw==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/plugin-content-blog': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/plugin-content-docs': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/plugin-content-pages': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/plugin-debug': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/plugin-google-analytics': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/plugin-google-gtag': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/plugin-google-tag-manager': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/plugin-sitemap': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/theme-classic': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/theme-common': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/theme-search-algolia': 2.4.3(@algolia/client-search@4.20.0)(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(search-insights@2.9.0)(typescript@4.9.5) + '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-content-blog': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-content-docs': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-content-pages': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-debug': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-google-analytics': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-google-gtag': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-google-tag-manager': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-sitemap': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/theme-classic': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/theme-common': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/theme-search-algolia': 2.4.3(@algolia/client-search@4.20.0)(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(search-insights@2.9.0)(typescript@4.9.5) '@docusaurus/types': 2.4.3(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -3721,24 +5117,24 @@ packages: peerDependencies: react: '*' dependencies: - '@types/react': 18.2.31 + '@types/react': 18.2.33 prop-types: 15.8.1 react: 18.2.0 - /@docusaurus/theme-classic@2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): + /@docusaurus/theme-classic@2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-QKRAJPSGPfDY2yCiPMIVyr+MqwZCIV2lxNzqbyUW0YkrlmdzzP3WuQJPMGLCjWgQp/5c9kpWMvMxjhpZx1R32Q==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/mdx-loader': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0) '@docusaurus/module-type-aliases': 2.4.3(react-dom@18.2.0)(react@18.2.0) - '@docusaurus/plugin-content-blog': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/plugin-content-docs': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/plugin-content-pages': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/theme-common': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-content-blog': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-content-docs': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-content-pages': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/theme-common': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/theme-translations': 2.4.3 '@docusaurus/types': 2.4.3(react-dom@18.2.0)(react@18.2.0) '@docusaurus/utils': 2.4.3(@docusaurus/types@2.4.3) @@ -3777,7 +5173,7 @@ packages: - webpack-cli dev: false - /@docusaurus/theme-common@2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): + /@docusaurus/theme-common@2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-7KaDJBXKBVGXw5WOVt84FtN8czGWhM0lbyWEZXGp8AFfL6sZQfRTluFp4QriR97qwzSyOfQb+nzcDZZU4tezUw==} engines: {node: '>=16.14'} peerDependencies: @@ -3786,13 +5182,13 @@ packages: dependencies: '@docusaurus/mdx-loader': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0) '@docusaurus/module-type-aliases': 2.4.3(react-dom@18.2.0)(react@18.2.0) - '@docusaurus/plugin-content-blog': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/plugin-content-docs': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/plugin-content-pages': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-content-blog': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-content-docs': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-content-pages': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/utils': 2.4.3(@docusaurus/types@2.4.3) '@docusaurus/utils-common': 2.4.3(@docusaurus/types@2.4.3) '@types/history': 4.7.11 - '@types/react': 18.2.31 + '@types/react': 18.2.33 '@types/react-router-config': 5.0.9 clsx: 1.2.1 parse-numeric-range: 1.3.0 @@ -3821,16 +5217,16 @@ packages: - webpack-cli dev: false - /@docusaurus/theme-mermaid@2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): + /@docusaurus/theme-mermaid@2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-S1tZ3xpowtFiTrpTKmvVbRHUYGOlEG5CnPzWlO4huJT1sAwLR+pD6f9DYUlPv2+9NezF3EfUrUyW9xLH0UP58w==} engines: {node: '>=16.14'} peerDependencies: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/module-type-aliases': 2.4.3(react-dom@18.2.0)(react@18.2.0) - '@docusaurus/theme-common': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/theme-common': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/types': 2.4.3(react-dom@18.2.0)(react@18.2.0) '@docusaurus/utils-validation': 2.4.3(@docusaurus/types@2.4.3) '@mdx-js/react': 1.6.22(react@18.2.0) @@ -3856,7 +5252,7 @@ packages: - webpack-cli dev: false - /@docusaurus/theme-search-algolia@2.4.3(@algolia/client-search@4.20.0)(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(search-insights@2.9.0)(typescript@4.9.5): + /@docusaurus/theme-search-algolia@2.4.3(@algolia/client-search@4.20.0)(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(search-insights@2.9.0)(typescript@4.9.5): resolution: {integrity: sha512-jziq4f6YVUB5hZOB85ELATwnxBz/RmSLD3ksGQOLDPKVzat4pmI8tddNWtriPpxR04BNT+ZfpPUMFkNFetSW1Q==} engines: {node: '>=16.14'} peerDependencies: @@ -3864,15 +5260,15 @@ packages: react-dom: ^16.8.4 || ^17.0.0 dependencies: '@docsearch/react': 3.5.2(@algolia/client-search@4.20.0)(react-dom@18.2.0)(react@18.2.0)(search-insights@2.9.0) - '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/logger': 2.4.3 - '@docusaurus/plugin-content-docs': 2.4.3(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) - '@docusaurus/theme-common': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/plugin-content-docs': 2.4.3(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/theme-common': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) '@docusaurus/theme-translations': 2.4.3 '@docusaurus/utils': 2.4.3(@docusaurus/types@2.4.3) '@docusaurus/utils-validation': 2.4.3(@docusaurus/types@2.4.3) algoliasearch: 4.20.0 - algoliasearch-helper: 3.14.2(algoliasearch@4.20.0) + algoliasearch-helper: 3.15.0(algoliasearch@4.20.0) clsx: 1.2.1 eta: 2.2.0 fs-extra: 10.1.0 @@ -3918,7 +5314,7 @@ packages: react-dom: ^16.8.4 || ^17.0.0 dependencies: '@types/history': 4.7.11 - '@types/react': 18.2.31 + '@types/react': 18.2.33 commander: 5.1.0 joi: 17.11.0 react: 18.2.0 @@ -4049,7 +5445,7 @@ packages: resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} dev: false - /@emotion/react@11.11.1(@types/react@18.2.31)(react@18.2.0): + /@emotion/react@11.11.1(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} peerDependencies: '@types/react': '*' @@ -4065,7 +5461,7 @@ packages: '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 - '@types/react': 18.2.31 + '@types/react': 18.2.33 hoist-non-react-statics: 3.3.2 react: 18.2.0 dev: false @@ -4084,7 +5480,7 @@ packages: resolution: {integrity: sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==} dev: false - /@emotion/styled@11.11.0(@emotion/react@11.11.1)(@types/react@18.2.31)(react@18.2.0): + /@emotion/styled@11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng==} peerDependencies: '@emotion/react': ^11.0.0-rc.0 @@ -4097,11 +5493,11 @@ packages: '@babel/runtime': 7.23.2 '@emotion/babel-plugin': 11.11.0 '@emotion/is-prop-valid': 1.2.1 - '@emotion/react': 11.11.1(@types/react@18.2.31)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) '@emotion/serialize': 1.1.2 '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) '@emotion/utils': 1.2.1 - '@types/react': 18.2.31 + '@types/react': 18.2.33 react: 18.2.0 dev: false @@ -4125,27 +5521,12 @@ packages: resolution: {integrity: sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==} dev: false - /@ensdomains/ens@0.4.5: - resolution: {integrity: sha512-JSvpj1iNMFjK6K+uVl4unqMoa9rf5jopb8cya5UGBWz23Nw8hSNT7efgUx4BTlAPAgpNlEioUfeTyQ6J9ZvTVw==} - deprecated: Please use @ensdomains/ens-contracts - dependencies: - bluebird: 3.7.2 - eth-ens-namehash: 2.0.8 - solc: 0.4.26 - testrpc: 0.0.1 - web3-utils: 1.10.3 - dev: true - - /@ensdomains/resolver@0.2.4: - resolution: {integrity: sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA==} - deprecated: Please use @ensdomains/ens-contracts - dev: true - /@envelop/core@3.0.6: resolution: {integrity: sha512-06t1xCPXq6QFN7W1JUEf68aCwYN0OUDNAIoJe7bAqhaoa2vn7NCcuX1VHkJ/OWpmElUgCsRO6RiBbIru1in0Ig==} dependencies: '@envelop/types': 3.0.2 tslib: 2.6.2 + dev: false /@envelop/core@5.0.0: resolution: {integrity: sha512-aJdnH/ptv+cvwfvciCBe7TSvccBwo9g0S5f6u35TBVzRVqIGkK03lFlIL+x1cnfZgN9EfR2b1PH2galrT1CdCQ==} @@ -4159,19 +5540,20 @@ packages: resolution: {integrity: sha512-aXAf1bg5Z71YfEKLCZ8OMUZAOYPGHV/a+7avd5TIMFNDxl5wJTmIonep3T+kdMpwRInDphfNPGFD0GcGdGxpHg==} peerDependencies: '@envelop/core': ^3.0.6 - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@envelop/core': 3.0.6 '@graphql-tools/utils': 8.13.1(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 + dev: false /@envelop/extended-validation@4.0.0(@envelop/core@5.0.0)(graphql@16.8.1): resolution: {integrity: sha512-pvJ/OL+C+lpNiiCXezHT+vP3PTq37MQicoOB1l5MdgOOZZWRAp0NDOgvEKcXUY7AWNpvNHgSE0QFSRfGwsfwFQ==} engines: {node: '>=18.0.0'} peerDependencies: '@envelop/core': ^5.0.0 - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@envelop/core': 5.0.0 '@graphql-tools/utils': 10.0.7(graphql@16.8.1) @@ -4184,7 +5566,7 @@ packages: engines: {node: '>=18.0.0'} peerDependencies: '@envelop/core': ^5.0.0 - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@envelop/core': 5.0.0 graphql: 16.8.1 @@ -4197,6 +5579,7 @@ packages: resolution: {integrity: sha512-pOFea9ha0EkURWxJ/35axoH9fDGP5S2cUu/5Mmo9pb8zUf+TaEot8vB670XXihFEn/92759BMjLJNWBKmNhyng==} dependencies: tslib: 2.6.2 + dev: false /@envelop/types@5.0.0: resolution: {integrity: sha512-IPjmgSc4KpQRlO4qbEDnBEixvtb06WDmjKfi/7fkZaryh5HuOmTtixe1EupQI5XfXO8joc3d27uUZ0QdC++euA==} @@ -4209,13 +5592,14 @@ packages: resolution: {integrity: sha512-MkzcScQHJJQ/9YCAPdWShEi3xZv4F4neTs+NszzSrZOdlU8z/THuRt7gZ0sO0y2be+sx+SKjHQP8Gq3VXXcTTg==} peerDependencies: '@envelop/core': ^3.0.6 - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@envelop/core': 3.0.6 graphql: 16.8.1 hash-it: 6.0.0 lru-cache: 6.0.0 tslib: 2.6.2 + dev: false /@esbuild-plugins/node-globals-polyfill@0.1.1(esbuild@0.16.3): resolution: {integrity: sha512-MR0oAA+mlnJWrt1RQVQ+4VYuRJW/P2YmRTv1AsplObyvuBMnPHiizUF95HHYiSsMGLhyGtWufaq2XQg6+iurBg==} @@ -4244,15 +5628,6 @@ packages: dev: true optional: true - /@esbuild/android-arm64@0.17.19: - resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-arm64@0.18.20: resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} @@ -4262,8 +5637,8 @@ packages: dev: true optional: true - /@esbuild/android-arm64@0.19.5: - resolution: {integrity: sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==} + /@esbuild/android-arm64@0.19.8: + resolution: {integrity: sha512-B8JbS61bEunhfx8kasogFENgQfr/dIp+ggYXwTqdbMAgGDhRa3AaPpQMuQU0rNxDLECj6FhDzk1cF9WHMVwrtA==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -4280,15 +5655,6 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.17.19: - resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-arm@0.18.20: resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} @@ -4298,8 +5664,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.19.5: - resolution: {integrity: sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==} + /@esbuild/android-arm@0.19.8: + resolution: {integrity: sha512-31E2lxlGM1KEfivQl8Yf5aYU/mflz9g06H6S15ITUFQueMFtFjESRMoDSkvMo8thYvLBax+VKTPlpnx+sPicOA==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -4316,15 +5682,6 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.17.19: - resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-x64@0.18.20: resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} @@ -4334,8 +5691,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.19.5: - resolution: {integrity: sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==} + /@esbuild/android-x64@0.19.8: + resolution: {integrity: sha512-rdqqYfRIn4jWOp+lzQttYMa2Xar3OK9Yt2fhOhzFXqg0rVWEfSclJvZq5fZslnz6ypHvVf3CT7qyf0A5pM682A==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -4352,15 +5709,6 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.17.19: - resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-arm64@0.18.20: resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} @@ -4370,8 +5718,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.19.5: - resolution: {integrity: sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==} + /@esbuild/darwin-arm64@0.19.8: + resolution: {integrity: sha512-RQw9DemMbIq35Bprbboyf8SmOr4UXsRVxJ97LgB55VKKeJOOdvsIPy0nFyF2l8U+h4PtBx/1kRf0BelOYCiQcw==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -4388,15 +5736,6 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.17.19: - resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-x64@0.18.20: resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} @@ -4406,8 +5745,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.19.5: - resolution: {integrity: sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==} + /@esbuild/darwin-x64@0.19.8: + resolution: {integrity: sha512-3sur80OT9YdeZwIVgERAysAbwncom7b4bCI2XKLjMfPymTud7e/oY4y+ci1XVp5TfQp/bppn7xLw1n/oSQY3/Q==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -4424,15 +5763,6 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.17.19: - resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-arm64@0.18.20: resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} @@ -4442,8 +5772,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.19.5: - resolution: {integrity: sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==} + /@esbuild/freebsd-arm64@0.19.8: + resolution: {integrity: sha512-WAnPJSDattvS/XtPCTj1tPoTxERjcTpH6HsMr6ujTT+X6rylVe8ggxk8pVxzf5U1wh5sPODpawNicF5ta/9Tmw==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -4460,15 +5790,6 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.17.19: - resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-x64@0.18.20: resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} @@ -4478,8 +5799,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.19.5: - resolution: {integrity: sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==} + /@esbuild/freebsd-x64@0.19.8: + resolution: {integrity: sha512-ICvZyOplIjmmhjd6mxi+zxSdpPTKFfyPPQMQTK/w+8eNK6WV01AjIztJALDtwNNfFhfZLux0tZLC+U9nSyA5Zg==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -4496,15 +5817,6 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.17.19: - resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm64@0.18.20: resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} @@ -4514,8 +5826,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.19.5: - resolution: {integrity: sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==} + /@esbuild/linux-arm64@0.19.8: + resolution: {integrity: sha512-z1zMZivxDLHWnyGOctT9JP70h0beY54xDDDJt4VpTX+iwA77IFsE1vCXWmprajJGa+ZYSqkSbRQ4eyLCpCmiCQ==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -4532,15 +5844,6 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.17.19: - resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm@0.18.20: resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} @@ -4550,8 +5853,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.19.5: - resolution: {integrity: sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==} + /@esbuild/linux-arm@0.19.8: + resolution: {integrity: sha512-H4vmI5PYqSvosPaTJuEppU9oz1dq2A7Mr2vyg5TF9Ga+3+MGgBdGzcyBP7qK9MrwFQZlvNyJrvz6GuCaj3OukQ==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -4568,15 +5871,6 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.17.19: - resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ia32@0.18.20: resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} @@ -4586,8 +5880,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.19.5: - resolution: {integrity: sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==} + /@esbuild/linux-ia32@0.19.8: + resolution: {integrity: sha512-1a8suQiFJmZz1khm/rDglOc8lavtzEMRo0v6WhPgxkrjcU0LkHj+TwBrALwoz/OtMExvsqbbMI0ChyelKabSvQ==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -4604,15 +5898,6 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.17.19: - resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-loong64@0.18.20: resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} @@ -4622,8 +5907,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.19.5: - resolution: {integrity: sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==} + /@esbuild/linux-loong64@0.19.8: + resolution: {integrity: sha512-fHZWS2JJxnXt1uYJsDv9+b60WCc2RlvVAy1F76qOLtXRO+H4mjt3Tr6MJ5l7Q78X8KgCFudnTuiQRBhULUyBKQ==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -4640,15 +5925,6 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.17.19: - resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-mips64el@0.18.20: resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} @@ -4658,8 +5934,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.19.5: - resolution: {integrity: sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==} + /@esbuild/linux-mips64el@0.19.8: + resolution: {integrity: sha512-Wy/z0EL5qZYLX66dVnEg9riiwls5IYnziwuju2oUiuxVc+/edvqXa04qNtbrs0Ukatg5HEzqT94Zs7J207dN5Q==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -4676,15 +5952,6 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.17.19: - resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ppc64@0.18.20: resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} @@ -4694,8 +5961,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.19.5: - resolution: {integrity: sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==} + /@esbuild/linux-ppc64@0.19.8: + resolution: {integrity: sha512-ETaW6245wK23YIEufhMQ3HSeHO7NgsLx8gygBVldRHKhOlD1oNeNy/P67mIh1zPn2Hr2HLieQrt6tWrVwuqrxg==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -4712,15 +5979,6 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.17.19: - resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-riscv64@0.18.20: resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} @@ -4730,8 +5988,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.19.5: - resolution: {integrity: sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==} + /@esbuild/linux-riscv64@0.19.8: + resolution: {integrity: sha512-T2DRQk55SgoleTP+DtPlMrxi/5r9AeFgkhkZ/B0ap99zmxtxdOixOMI570VjdRCs9pE4Wdkz7JYrsPvsl7eESg==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -4748,15 +6006,6 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.17.19: - resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-s390x@0.18.20: resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} @@ -4766,8 +6015,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.19.5: - resolution: {integrity: sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==} + /@esbuild/linux-s390x@0.19.8: + resolution: {integrity: sha512-NPxbdmmo3Bk7mbNeHmcCd7R7fptJaczPYBaELk6NcXxy7HLNyWwCyDJ/Xx+/YcNH7Im5dHdx9gZ5xIwyliQCbg==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -4784,15 +6033,6 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.17.19: - resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-x64@0.18.20: resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} @@ -4802,8 +6042,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.19.5: - resolution: {integrity: sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==} + /@esbuild/linux-x64@0.19.8: + resolution: {integrity: sha512-lytMAVOM3b1gPypL2TRmZ5rnXl7+6IIk8uB3eLsV1JwcizuolblXRrc5ShPrO9ls/b+RTp+E6gbsuLWHWi2zGg==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -4820,15 +6060,6 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.17.19: - resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/netbsd-x64@0.18.20: resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} @@ -4838,8 +6069,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.19.5: - resolution: {integrity: sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==} + /@esbuild/netbsd-x64@0.19.8: + resolution: {integrity: sha512-hvWVo2VsXz/8NVt1UhLzxwAfo5sioj92uo0bCfLibB0xlOmimU/DeAEsQILlBQvkhrGjamP0/el5HU76HAitGw==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -4856,15 +6087,6 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.17.19: - resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/openbsd-x64@0.18.20: resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} @@ -4874,8 +6096,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.19.5: - resolution: {integrity: sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==} + /@esbuild/openbsd-x64@0.19.8: + resolution: {integrity: sha512-/7Y7u77rdvmGTxR83PgaSvSBJCC2L3Kb1M/+dmSIvRvQPXXCuC97QAwMugBNG0yGcbEGfFBH7ojPzAOxfGNkwQ==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -4892,15 +6114,6 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.17.19: - resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - /@esbuild/sunos-x64@0.18.20: resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} @@ -4910,8 +6123,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.19.5: - resolution: {integrity: sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==} + /@esbuild/sunos-x64@0.19.8: + resolution: {integrity: sha512-9Lc4s7Oi98GqFA4HzA/W2JHIYfnXbUYgekUP/Sm4BG9sfLjyv6GKKHKKVs83SMicBF2JwAX6A1PuOLMqpD001w==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -4928,15 +6141,6 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.17.19: - resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-arm64@0.18.20: resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} @@ -4946,8 +6150,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.19.5: - resolution: {integrity: sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==} + /@esbuild/win32-arm64@0.19.8: + resolution: {integrity: sha512-rq6WzBGjSzihI9deW3fC2Gqiak68+b7qo5/3kmB6Gvbh/NYPA0sJhrnp7wgV4bNwjqM+R2AApXGxMO7ZoGhIJg==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -4964,15 +6168,6 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.17.19: - resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-ia32@0.18.20: resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} @@ -4982,8 +6177,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.19.5: - resolution: {integrity: sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==} + /@esbuild/win32-ia32@0.19.8: + resolution: {integrity: sha512-AIAbverbg5jMvJznYiGhrd3sumfwWs8572mIJL5NQjJa06P8KfCPWZQ0NwZbPQnbQi9OWSZhFVSUWjjIrn4hSw==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -5000,15 +6195,6 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.17.19: - resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-x64@0.18.20: resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} @@ -5018,8 +6204,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.19.5: - resolution: {integrity: sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==} + /@esbuild/win32-x64@0.19.8: + resolution: {integrity: sha512-bfZ0cQ1uZs2PqpulNL5j/3w+GDhP36k1K5c38QdQg+Swy51jFZWWeIkteNsufkQxp986wnqRRsb/bHbY1WQ7TA==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -5045,12 +6231,10 @@ packages: dependencies: eslint: 8.52.0 eslint-visitor-keys: 3.4.3 - dev: true - /@eslint-community/regexpp@4.9.1: - resolution: {integrity: sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==} + /@eslint-community/regexpp@4.10.0: + resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - dev: true /@eslint/eslintrc@1.4.1: resolution: {integrity: sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==} @@ -5084,58 +6268,66 @@ packages: strip-json-comments: 3.1.1 transitivePeerDependencies: - supports-color - dev: true /@eslint/js@8.52.0: resolution: {integrity: sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + /@eth-optimism/contracts@0.5.40(ethers@6.8.0): + resolution: {integrity: sha512-MrzV0nvsymfO/fursTB7m/KunkPsCndltVgfdHaT1Aj5Vi6R/doKIGGkOofHX+8B6VMZpuZosKCMQ5lQuqjt8w==} + peerDependencies: + ethers: ^5 + dependencies: + '@eth-optimism/core-utils': 0.12.0 + '@ethersproject/abstract-provider': 5.7.0 + '@ethersproject/abstract-signer': 5.7.0 + ethers: 6.8.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate dev: true - /@ethereum-attestation-service/eas-contracts@0.27.1(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(ts-node@10.9.1)(typescript@4.9.5): - resolution: {integrity: sha512-ly1N/jLbXJjACDL7dnMSkzViBxxuVc+aMZ3EB1kpFxeMWrXkb7nN6w9gxGTH+m3gJztaKvyMsyr/13pA0OYq6Q==} + /@eth-optimism/core-utils@0.12.0: + resolution: {integrity: sha512-qW+7LZYCz7i8dRa7SRlUKIo1VBU8lvN0HeXCxJR+z+xtMzMQpPds20XJNCMclszxYQHkXY00fOT6GvFw9ZL6nw==} dependencies: - '@typechain/ethers-v5': 10.2.1(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2)(typescript@4.9.5) - '@typechain/hardhat': 6.1.6(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(@typechain/ethers-v5@10.2.1)(ethers@5.7.2)(hardhat@2.13.1)(typechain@8.3.2) - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) - typechain: 8.3.2(typescript@4.9.5) + '@ethersproject/abi': 5.7.0 + '@ethersproject/abstract-provider': 5.7.0 + '@ethersproject/address': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/constants': 5.7.0 + '@ethersproject/contracts': 5.7.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/keccak256': 5.7.0 + '@ethersproject/properties': 5.7.0 + '@ethersproject/providers': 5.7.2 + '@ethersproject/rlp': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@ethersproject/web': 5.7.1 + bufio: 1.2.1 + chai: 4.3.10 transitivePeerDependencies: - - '@ethersproject/abi' - - '@ethersproject/providers' - bufferutil - - ethers - - supports-color - - ts-node - - typescript - utf-8-validate - dev: false + dev: true - /@ethereum-attestation-service/eas-contracts@0.27.1(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typescript@5.1.6): - resolution: {integrity: sha512-ly1N/jLbXJjACDL7dnMSkzViBxxuVc+aMZ3EB1kpFxeMWrXkb7nN6w9gxGTH+m3gJztaKvyMsyr/13pA0OYq6Q==} + /@ethereum-attestation-service/eas-contracts@1.2.0-beta.1(typescript@5.1.6): + resolution: {integrity: sha512-NOicVFjm3UOY6HHmMPIpFTZJ7ieuETl7GRJyceW/CPPXxMMBBu9tf9eDVbVrDn6D7fYX3NMDIR39RoK5BhpWYA==} dependencies: - '@typechain/ethers-v5': 10.2.1(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2)(typescript@5.1.6) - '@typechain/hardhat': 6.1.6(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(@typechain/ethers-v5@10.2.1)(ethers@5.7.2)(hardhat@2.13.1)(typechain@8.3.2) - hardhat: 2.13.1(typescript@5.1.6) - typechain: 8.3.2(typescript@5.1.6) + hardhat: 2.18.2(typescript@5.1.6) transitivePeerDependencies: - - '@ethersproject/abi' - - '@ethersproject/providers' - bufferutil - - ethers - supports-color - ts-node - typescript - utf-8-validate dev: false - /@ethereum-attestation-service/eas-sdk@0.28.3(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ts-node@10.9.1)(typescript@4.9.5): - resolution: {integrity: sha512-Z197jE5oi8Eh9SmjldTnkPKKhOId2NA9OyEFvbXDMafoHtfC6V117r0GHj9IlsOGtaK8Y0fiZYX1EKMKcJb6UQ==} + /@ethereum-attestation-service/eas-contracts@1.3.7(ts-node@10.9.1)(typescript@5.3.2): + resolution: {integrity: sha512-msCKGDhqSjfkx0lbs0PPkf/Z6bWxaYT9ze/uLoRh1tM7W8N27mobX4g6AsjATqGC+eWHRfliK9eCwJQj7TU8WA==} dependencies: - '@ethereum-attestation-service/eas-contracts': 0.27.1(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(ts-node@10.9.1)(typescript@4.9.5) - ethers: 5.7.2 - multiformats: 9.9.0 + hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) transitivePeerDependencies: - - '@ethersproject/abi' - - '@ethersproject/providers' - bufferutil - supports-color - ts-node @@ -5143,15 +6335,17 @@ packages: - utf-8-validate dev: false - /@ethereum-attestation-service/eas-sdk@0.28.3(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(typescript@5.1.6): - resolution: {integrity: sha512-Z197jE5oi8Eh9SmjldTnkPKKhOId2NA9OyEFvbXDMafoHtfC6V117r0GHj9IlsOGtaK8Y0fiZYX1EKMKcJb6UQ==} + /@ethereum-attestation-service/eas-sdk@1.2.2-beta.0(typescript@5.1.6): + resolution: {integrity: sha512-penkXiCKvHY8jN9UVV3B9IX001YnwWCNjbrBNE5e8Wy1rAzcPv7tqTBuvqXzjqmHfcASv7UFOIbfPEc5hd9mpA==} dependencies: - '@ethereum-attestation-service/eas-contracts': 0.27.1(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typescript@5.1.6) - ethers: 5.7.2 + '@ethereum-attestation-service/eas-contracts': 1.2.0-beta.1(typescript@5.1.6) + ethers: 6.8.0 + js-base64: 3.7.5 + lodash: 4.17.21 multiformats: 9.9.0 + pako: 2.1.0 + semver: 7.5.4 transitivePeerDependencies: - - '@ethersproject/abi' - - '@ethersproject/providers' - bufferutil - supports-color - ts-node @@ -5159,117 +6353,23 @@ packages: - utf-8-validate dev: false - /@ethereum-waffle/chai@4.0.10(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(ethers@5.7.2): - resolution: {integrity: sha512-X5RepE7Dn8KQLFO7HHAAe+KeGaX/by14hn90wePGBhzL54tq4Y8JscZFu+/LCwCl6TnkAAy5ebiMoqJ37sFtWw==} - engines: {node: '>=10.0'} - peerDependencies: - ethers: ^5.7.2 + /@ethereum-attestation-service/eas-sdk@1.3.7(ts-node@10.9.1)(typescript@5.3.2): + resolution: {integrity: sha512-7dmy3w/hIeUYGTvkoFIo/JSviiTK8qhjr0BKf7qK+xSPYt9rW9Qksw1njqC5G3OXyp5teaXCH05v75NOASYoSQ==} dependencies: - '@ethereum-waffle/provider': 4.0.5(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(ethers@5.7.2) - debug: 4.3.4(supports-color@8.1.1) - ethers: 5.7.2 - json-bigint: 1.0.0 - transitivePeerDependencies: - - '@ensdomains/ens' - - '@ensdomains/resolver' - - supports-color - dev: true - - /@ethereum-waffle/compiler@4.0.3(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(solc@0.8.15)(typechain@8.3.2)(typescript@4.9.5): - resolution: {integrity: sha512-5x5U52tSvEVJS6dpCeXXKvRKyf8GICDwiTwUvGD3/WD+DpvgvaoHOL82XqpTSUHgV3bBq6ma5/8gKUJUIAnJCw==} - engines: {node: '>=10.0'} - peerDependencies: - ethers: ^5.7.2 - solc: '*' - typechain: ^8.0.0 - dependencies: - '@resolver-engine/imports': 0.3.3 - '@resolver-engine/imports-fs': 0.3.3 - '@typechain/ethers-v5': 10.2.1(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2)(typescript@4.9.5) - '@types/mkdirp': 0.5.2 - '@types/node-fetch': 2.6.7 - ethers: 5.7.2 - mkdirp: 0.5.6 - node-fetch: 2.7.0 - solc: 0.8.15 - typechain: 8.3.2(typescript@4.9.5) + '@ethereum-attestation-service/eas-contracts': 1.3.7(ts-node@10.9.1)(typescript@5.3.2) + ethers: 6.9.0 + js-base64: 3.7.5 + lodash: 4.17.21 + multiformats: 9.9.0 + pako: 2.1.0 + semver: 7.5.4 transitivePeerDependencies: - - '@ethersproject/abi' - - '@ethersproject/providers' - - encoding + - bufferutil - supports-color + - ts-node - typescript - dev: true - - /@ethereum-waffle/ens@4.0.3(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(ethers@5.7.2): - resolution: {integrity: sha512-PVLcdnTbaTfCrfSOrvtlA9Fih73EeDvFS28JQnT5M5P4JMplqmchhcZB1yg/fCtx4cvgHlZXa0+rOCAk2Jk0Jw==} - engines: {node: '>=10.0'} - peerDependencies: - '@ensdomains/ens': ^0.4.4 - '@ensdomains/resolver': ^0.2.4 - ethers: ^5.7.2 - dependencies: - '@ensdomains/ens': 0.4.5 - '@ensdomains/resolver': 0.2.4 - ethers: 5.7.2 - dev: true - - /@ethereum-waffle/mock-contract@4.0.4(ethers@5.7.2): - resolution: {integrity: sha512-LwEj5SIuEe9/gnrXgtqIkWbk2g15imM/qcJcxpLyAkOj981tQxXmtV4XmQMZsdedEsZ/D/rbUAOtZbgwqgUwQA==} - engines: {node: '>=10.0'} - peerDependencies: - ethers: ^5.7.2 - dependencies: - ethers: 5.7.2 - dev: true - - /@ethereum-waffle/provider@4.0.5(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(ethers@5.7.2): - resolution: {integrity: sha512-40uzfyzcrPh+Gbdzv89JJTMBlZwzya1YLDyim8mVbEqYLP5VRYWoGp0JMyaizgV3hMoUFRqJKVmIUw4v7r3hYw==} - engines: {node: '>=10.0'} - peerDependencies: - ethers: ^5.7.2 - dependencies: - '@ethereum-waffle/ens': 4.0.3(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(ethers@5.7.2) - '@ganache/ethereum-options': 0.1.4 - debug: 4.3.4(supports-color@8.1.1) - ethers: 5.7.2 - ganache: 7.4.3 - transitivePeerDependencies: - - '@ensdomains/ens' - - '@ensdomains/resolver' - - supports-color - dev: true - - /@ethereumjs/block@3.6.3: - resolution: {integrity: sha512-CegDeryc2DVKnDkg5COQrE0bJfw/p0v3GBk2W5/Dj5dOVfEmb50Ux0GLnSPypooLnfqjwFaorGuT9FokWB3GRg==} - dependencies: - '@ethereumjs/common': 2.6.5 - '@ethereumjs/tx': 3.5.2 - ethereumjs-util: 7.1.5 - merkle-patricia-tree: 4.2.4 - dev: true - - /@ethereumjs/blockchain@5.5.3: - resolution: {integrity: sha512-bi0wuNJ1gw4ByNCV56H0Z4Q7D+SxUbwyG12Wxzbvqc89PXLRNR20LBcSUZRKpN0+YCPo6m0XZL/JLio3B52LTw==} - dependencies: - '@ethereumjs/block': 3.6.3 - '@ethereumjs/common': 2.6.5 - '@ethereumjs/ethash': 1.1.0 - debug: 4.3.4(supports-color@8.1.1) - ethereumjs-util: 7.1.5 - level-mem: 5.0.1 - lru-cache: 5.1.1 - semaphore-async-await: 1.5.1 - transitivePeerDependencies: - - supports-color - dev: true - - /@ethereumjs/common@2.6.0: - resolution: {integrity: sha512-Cq2qS0FTu6O2VU1sgg+WyU9Ps0M6j/BEMHN+hRaECXCV/r0aI78u4N6p52QW/BDVhwWZpCdrvG8X7NJdzlpNUA==} - dependencies: - crc-32: 1.2.2 - ethereumjs-util: 7.1.3 - dev: true + - utf-8-validate + dev: false /@ethereumjs/common@2.6.5: resolution: {integrity: sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==} @@ -5278,29 +6378,12 @@ packages: ethereumjs-util: 7.1.5 dev: true - /@ethereumjs/ethash@1.1.0: - resolution: {integrity: sha512-/U7UOKW6BzpA+Vt+kISAoeDie1vAvY4Zy2KF5JJb+So7+1yKmJeJEHOGSnQIj330e9Zyl3L5Nae6VZyh2TJnAA==} - dependencies: - '@ethereumjs/block': 3.6.3 - '@types/levelup': 4.3.3 - buffer-xor: 2.0.2 - ethereumjs-util: 7.1.5 - miller-rabin: 4.0.1 - dev: true - /@ethereumjs/rlp@4.0.1: resolution: {integrity: sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==} engines: {node: '>=14'} hasBin: true dev: true - /@ethereumjs/tx@3.4.0: - resolution: {integrity: sha512-WWUwg1PdjHKZZxPPo274ZuPsJCWV3SqATrEKQP1n2DrVYVP1aZIYpo/mFaA0BDoE0tIQmBeimRCEA0Lgil+yYw==} - dependencies: - '@ethereumjs/common': 2.6.0 - ethereumjs-util: 7.1.3 - dev: true - /@ethereumjs/tx@3.5.2: resolution: {integrity: sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==} dependencies: @@ -5317,25 +6400,6 @@ packages: micro-ftch: 0.3.1 dev: true - /@ethereumjs/vm@5.6.0: - resolution: {integrity: sha512-J2m/OgjjiGdWF2P9bj/4LnZQ1zRoZhY8mRNVw/N3tXliGI8ai1sI1mlDPkLpeUUM4vq54gH6n0ZlSpz8U/qlYQ==} - dependencies: - '@ethereumjs/block': 3.6.3 - '@ethereumjs/blockchain': 5.5.3 - '@ethereumjs/common': 2.6.0 - '@ethereumjs/tx': 3.4.0 - async-eventemitter: 0.2.4 - core-js-pure: 3.33.1 - debug: 2.6.9 - ethereumjs-util: 7.1.3 - functional-red-black-tree: 1.0.1 - mcl-wasm: 0.7.9 - merkle-patricia-tree: 4.2.4 - rustbn.js: 0.2.0 - transitivePeerDependencies: - - supports-color - dev: true - /@ethersproject/abi@5.0.7: resolution: {integrity: sha512-Cqktk+hSIckwP/W8O47Eef60VwmoSC/L3lY0+dIBhQPCNn9E4V7rwmm2aFrNRRDJfFlGuZ1khkQUOc3oBX+niw==} dependencies: @@ -5635,8 +6699,8 @@ packages: '@ethersproject/properties': 5.7.0 '@ethersproject/strings': 5.7.0 - /@faker-js/faker@8.2.0: - resolution: {integrity: sha512-VacmzZqVxdWdf9y64lDOMZNDMM/FQdtM9IsaOPKOm2suYwEatb8VkdHqOzXcDnZbk7YDE2BmsJmy/2Hmkn563g==} + /@faker-js/faker@8.3.1: + resolution: {integrity: sha512-FdgpFxY6V6rLZE9mmIBb9hM0xpfvQOSNOLnzolzKwsE1DH+gC7lEKV1p1IbR0lAYyvYd5a4u3qWJzowUkw1bIw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0, npm: '>=6.14.13'} dev: true @@ -5646,6 +6710,7 @@ packages: /@fastify/deepmerge@1.3.0: resolution: {integrity: sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==} + dev: false /@float-capital/float-subgraph-uncrashable@0.0.0-internal-testing.5: resolution: {integrity: sha512-yZ0H5e3EpAYKokX/AbtplzlvSxEJY7ZfpvQyDzyODkks0hakAAlDG6fQu1SlDJMWorY7bbq1j7fCiFeTWci6TA==} @@ -5692,66 +6757,6 @@ packages: ts-interface-checker: 0.1.13 dev: true - /@ganache/ethereum-address@0.1.4: - resolution: {integrity: sha512-sTkU0M9z2nZUzDeHRzzGlW724xhMLXo2LeX1hixbnjHWY1Zg1hkqORywVfl+g5uOO8ht8T0v+34IxNxAhmWlbw==} - dependencies: - '@ganache/utils': 0.1.4 - dev: true - - /@ganache/ethereum-options@0.1.4: - resolution: {integrity: sha512-i4l46taoK2yC41FPkcoDlEVoqHS52wcbHPqJtYETRWqpOaoj9hAg/EJIHLb1t6Nhva2CdTO84bG+qlzlTxjAHw==} - dependencies: - '@ganache/ethereum-address': 0.1.4 - '@ganache/ethereum-utils': 0.1.4 - '@ganache/options': 0.1.4 - '@ganache/utils': 0.1.4 - bip39: 3.0.4 - seedrandom: 3.0.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@ganache/ethereum-utils@0.1.4: - resolution: {integrity: sha512-FKXF3zcdDrIoCqovJmHLKZLrJ43234Em2sde/3urUT/10gSgnwlpFmrv2LUMAmSbX3lgZhW/aSs8krGhDevDAg==} - dependencies: - '@ethereumjs/common': 2.6.0 - '@ethereumjs/tx': 3.4.0 - '@ethereumjs/vm': 5.6.0 - '@ganache/ethereum-address': 0.1.4 - '@ganache/rlp': 0.1.4 - '@ganache/utils': 0.1.4 - emittery: 0.10.0 - ethereumjs-abi: 0.6.8 - ethereumjs-util: 7.1.3 - transitivePeerDependencies: - - supports-color - dev: true - - /@ganache/options@0.1.4: - resolution: {integrity: sha512-zAe/craqNuPz512XQY33MOAG6Si1Xp0hCvfzkBfj2qkuPcbJCq6W/eQ5MB6SbXHrICsHrZOaelyqjuhSEmjXRw==} - dependencies: - '@ganache/utils': 0.1.4 - bip39: 3.0.4 - seedrandom: 3.0.5 - dev: true - - /@ganache/rlp@0.1.4: - resolution: {integrity: sha512-Do3D1H6JmhikB+6rHviGqkrNywou/liVeFiKIpOBLynIpvZhRCgn3SEDxyy/JovcaozTo/BynHumfs5R085MFQ==} - dependencies: - '@ganache/utils': 0.1.4 - rlp: 2.2.6 - dev: true - - /@ganache/utils@0.1.4: - resolution: {integrity: sha512-oatUueU3XuXbUbUlkyxeLLH3LzFZ4y5aSkNbx6tjSIhVTPeh+AuBKYt4eQ73FFcTB3nj/gZoslgAh5CN7O369w==} - dependencies: - emittery: 0.10.0 - keccak: 3.0.1 - seedrandom: 3.0.5 - optionalDependencies: - '@trufflesuite/bigint-buffer': 1.1.9 - dev: true - /@graphprotocol/client-add-source-name@1.0.20(@graphql-mesh/types@0.93.2)(@graphql-tools/delegate@9.0.35)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(graphql@16.8.1): resolution: {integrity: sha512-JJ++BVg4fhNCbLej105uHpabZesLsCSo9p43ZKSTT1VUdbuZtarzyIHC3uUmbvCfWQMVTCJEBZGx4l41oooOiw==} peerDependencies: @@ -5759,7 +6764,7 @@ packages: '@graphql-tools/delegate': ^9.0.32 '@graphql-tools/utils': ^9.2.1 '@graphql-tools/wrap': ^9.4.2 - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) @@ -5770,16 +6775,16 @@ packages: tslib: 2.6.2 dev: false - /@graphprotocol/client-add-source-name@1.0.20(@graphql-mesh/types@0.95.7)(@graphql-tools/delegate@9.0.35)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(graphql@16.8.1): + /@graphprotocol/client-add-source-name@1.0.20(@graphql-mesh/types@0.95.8)(@graphql-tools/delegate@9.0.35)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(graphql@16.8.1): resolution: {integrity: sha512-JJ++BVg4fhNCbLej105uHpabZesLsCSo9p43ZKSTT1VUdbuZtarzyIHC3uUmbvCfWQMVTCJEBZGx4l41oooOiw==} peerDependencies: '@graphql-mesh/types': ^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0 '@graphql-tools/delegate': ^9.0.32 '@graphql-tools/utils': ^9.2.1 '@graphql-tools/wrap': ^9.4.2 - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.95.8(@graphql-mesh/store@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) '@graphql-tools/wrap': 9.4.2(graphql@16.8.1) @@ -5788,7 +6793,7 @@ packages: tslib: 2.6.2 dev: false - /@graphprotocol/client-add-source-name@2.0.0(@graphql-mesh/types@0.95.7)(@graphql-tools/delegate@9.0.35)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(graphql@16.8.1): + /@graphprotocol/client-add-source-name@2.0.0(@graphql-mesh/types@0.93.2)(@graphql-tools/delegate@10.0.3)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@10.0.1)(graphql@16.8.1): resolution: {integrity: sha512-3vX8mVPIEJFwAoRhjTPd9IjQrBuE+Gv+JB7IEf8/9222qiU9EzHVFUekKxVtcxQXD40CfageS41CxOreWQ1enA==} engines: {node: '>=16.0.0'} peerDependencies: @@ -5796,16 +6801,16 @@ packages: '@graphql-tools/delegate': ^9.0.32 || ^10.0.0 '@graphql-tools/utils': ^9.2.1 || ^10.0.0 '@graphql-tools/wrap': ^9.4.2 || ^10.0.0 - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) - '@graphql-tools/wrap': 9.4.2(graphql@16.8.1) + '@graphql-tools/wrap': 10.0.1(graphql@16.8.1) graphql: 16.8.1 lodash: 4.17.21 tslib: 2.6.2 - dev: true + dev: false /@graphprotocol/client-auto-pagination@1.1.18(@graphql-mesh/types@0.93.2)(@graphql-tools/delegate@9.0.35)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(graphql@16.8.1): resolution: {integrity: sha512-p8eEyeBcqxCXLxC7CNgIhLSCd7bjiKToKnrwYPShVb26gIG2JdAmD3/mpjuR+QaMA4chN/EO5t+TGvq6KnFx9g==} @@ -5814,7 +6819,7 @@ packages: '@graphql-tools/delegate': ^9.0.32 '@graphql-tools/utils': ^9.2.1 '@graphql-tools/wrap': ^9.4.2 - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) @@ -5825,7 +6830,7 @@ packages: tslib: 2.6.2 dev: false - /@graphprotocol/client-auto-pagination@2.0.0(@graphql-mesh/types@0.95.7)(@graphql-tools/delegate@9.0.35)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(graphql@16.8.1): + /@graphprotocol/client-auto-pagination@2.0.0(@graphql-mesh/types@0.93.2)(@graphql-tools/delegate@10.0.3)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@10.0.1)(graphql@16.8.1): resolution: {integrity: sha512-TouHgs6rQLpZSgnMoPdes8/ZTtMMEoxWeUUCkfho/xfSi49prb5DcsI83pykln0OEAUnNPnaX0MhP+xA5LtFSg==} engines: {node: '>=16.0.0'} peerDependencies: @@ -5833,23 +6838,23 @@ packages: '@graphql-tools/delegate': ^9.0.32 || ^10.0.0 '@graphql-tools/utils': ^9.2.1 || ^10.0.0 '@graphql-tools/wrap': ^9.4.2 || ^10.0.0 - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) - '@graphql-tools/wrap': 9.4.2(graphql@16.8.1) + '@graphql-tools/wrap': 10.0.1(graphql@16.8.1) graphql: 16.8.1 lodash: 4.17.21 tslib: 2.6.2 - dev: true + dev: false /@graphprotocol/client-auto-type-merging@1.0.25(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/delegate@9.0.35)(graphql@16.8.1): resolution: {integrity: sha512-kpiX2s804mpP3EVL0EdJfxeHWBTdg6SglIyEvSZ5T1OWyGDeMhr19D+gVIAlo22/PiBUkBDd0JfqppLsliPZ1A==} peerDependencies: '@graphql-mesh/types': ^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0 '@graphql-tools/delegate': ^9.0.32 - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: '@graphql-mesh/transform-type-merging': 0.93.1(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) @@ -5860,28 +6865,28 @@ packages: - '@graphql-mesh/utils' dev: false - /@graphprotocol/client-auto-type-merging@2.0.0(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/delegate@9.0.35)(graphql@16.8.1): + /@graphprotocol/client-auto-type-merging@2.0.0(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/delegate@10.0.3)(graphql@16.8.1): resolution: {integrity: sha512-mxqXKHK2lO+k4r02Q44n3qhd5dufo+SSDduD8zGUDBsYcRQAtQD9PwmXRHyUoB9nw4A+NC+CtVh+76fueXCG1w==} engines: {node: '>=16.0.0'} peerDependencies: '@graphql-mesh/types': ^0.78.0 || ^0.79.0 || ^0.80.0 || ^0.81.0 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.89.0 || ^0.90.0 || ^0.91.0 || ^0.93.0 '@graphql-tools/delegate': ^9.0.32 || ^10.0.0 - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: - '@graphql-mesh/transform-type-merging': 0.93.1(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) + '@graphql-mesh/transform-type-merging': 0.93.1(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 transitivePeerDependencies: - '@graphql-mesh/utils' - dev: true + dev: false /@graphprotocol/client-block-tracking@1.0.14(@graphql-tools/delegate@9.0.35)(graphql@16.8.1): resolution: {integrity: sha512-Eim0fZ0AgukHt5770j/UYDxfrqJroOhDe8FfNKKN7mDVRoMBoCsNknH47i03fh4A/kE8R+J6Job/zEJZPTtKnQ==} peerDependencies: '@graphql-tools/delegate': ^9.0.32 - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) @@ -5889,32 +6894,32 @@ packages: tslib: 2.6.2 dev: false - /@graphprotocol/client-block-tracking@2.0.0(@graphql-tools/delegate@9.0.35)(graphql@16.8.1): + /@graphprotocol/client-block-tracking@2.0.0(@graphql-tools/delegate@10.0.3)(graphql@16.8.1): resolution: {integrity: sha512-mpr0JAlefFGhxeb25ndeRKZ+t9cDHcUKGfRKIsoDzCclUEh5tBVTiQCDVGt6Eu+pxnrHPF2v/NQWktaB3+6twQ==} engines: {node: '>=16.0.0'} peerDependencies: '@graphql-tools/delegate': ^9.0.32 || ^10.0.0 - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: - '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) + '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) '@graphql-tools/utils': 10.0.7(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 - dev: true + dev: false - /@graphprotocol/client-cli@2.2.22(@babel/core@7.23.2)(@envelop/core@3.0.6)(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/delegate@9.0.35)(@graphql-tools/merge@8.4.2)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(@types/node@18.18.6)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6): + /@graphprotocol/client-cli@2.2.22(@babel/core@7.23.5)(@envelop/core@3.0.6)(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/delegate@9.0.35)(@graphql-tools/merge@8.4.2)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(@types/node@18.18.7)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6): resolution: {integrity: sha512-PIi8rFibYZVup+0jb08399RmbGF1ZrqUe6RXzLtKZBT57OWIMWwsFvdJyUAdr8Y8f0rrMn6A+Oy4nP1lf3hc1g==} hasBin: true peerDependencies: - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: '@graphprotocol/client-add-source-name': 1.0.20(@graphql-mesh/types@0.93.2)(@graphql-tools/delegate@9.0.35)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(graphql@16.8.1) '@graphprotocol/client-auto-pagination': 1.1.18(@graphql-mesh/types@0.93.2)(@graphql-tools/delegate@9.0.35)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(graphql@16.8.1) '@graphprotocol/client-auto-type-merging': 1.0.25(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/delegate@9.0.35)(graphql@16.8.1) '@graphprotocol/client-block-tracking': 1.0.14(@graphql-tools/delegate@9.0.35)(graphql@16.8.1) '@graphprotocol/client-polling-live': 1.1.1(@envelop/core@3.0.6)(@graphql-tools/merge@8.4.2)(graphql@16.8.1) - '@graphql-mesh/cli': 0.82.35(@babel/core@7.23.2)(@types/node@18.18.6)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6) - '@graphql-mesh/graphql': 0.93.1(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(@types/node@18.18.6)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/cli': 0.82.35(@babel/core@7.23.5)(@types/node@18.18.7)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6) + '@graphql-mesh/graphql': 0.93.1(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(@types/node@18.18.7)(graphql@16.8.1)(tslib@2.6.2) graphql: 16.8.1 tslib: 2.6.2 transitivePeerDependencies: @@ -5940,20 +6945,20 @@ packages: - utf-8-validate dev: false - /@graphprotocol/client-cli@3.0.0(@babel/core@7.23.2)(@envelop/core@3.0.6)(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.95.7)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/delegate@9.0.35)(@graphql-tools/merge@9.0.0)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(@types/node@18.18.6)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6): + /@graphprotocol/client-cli@3.0.0(@babel/core@7.23.5)(@envelop/core@3.0.6)(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.96.2)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/delegate@10.0.3)(@graphql-tools/merge@9.0.1)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@10.0.1)(@types/node@18.18.7)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6): resolution: {integrity: sha512-hTISbOzKavlDifBNsR6JqQMfdYwY7++hflPy+c3WHRrZ4OMoxFmW7ZuvaP6LvgKdJV77O8w9dnT/uxeHs6a90g==} engines: {node: '>=16.0.0'} hasBin: true peerDependencies: - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: - '@graphprotocol/client-add-source-name': 2.0.0(@graphql-mesh/types@0.95.7)(@graphql-tools/delegate@9.0.35)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(graphql@16.8.1) - '@graphprotocol/client-auto-pagination': 2.0.0(@graphql-mesh/types@0.95.7)(@graphql-tools/delegate@9.0.35)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(graphql@16.8.1) - '@graphprotocol/client-auto-type-merging': 2.0.0(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/delegate@9.0.35)(graphql@16.8.1) - '@graphprotocol/client-block-tracking': 2.0.0(@graphql-tools/delegate@9.0.35)(graphql@16.8.1) - '@graphprotocol/client-polling-live': 2.0.0(@envelop/core@3.0.6)(@graphql-tools/merge@9.0.0)(graphql@16.8.1) - '@graphql-mesh/cli': 0.82.35(@babel/core@7.23.2)(@types/node@18.18.6)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6) - '@graphql-mesh/graphql': 0.93.1(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.95.7)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(@types/node@18.18.6)(graphql@16.8.1)(tslib@2.6.2) + '@graphprotocol/client-add-source-name': 2.0.0(@graphql-mesh/types@0.93.2)(@graphql-tools/delegate@10.0.3)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@10.0.1)(graphql@16.8.1) + '@graphprotocol/client-auto-pagination': 2.0.0(@graphql-mesh/types@0.93.2)(@graphql-tools/delegate@10.0.3)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@10.0.1)(graphql@16.8.1) + '@graphprotocol/client-auto-type-merging': 2.0.0(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/delegate@10.0.3)(graphql@16.8.1) + '@graphprotocol/client-block-tracking': 2.0.0(@graphql-tools/delegate@10.0.3)(graphql@16.8.1) + '@graphprotocol/client-polling-live': 2.0.0(@envelop/core@3.0.6)(@graphql-tools/merge@9.0.1)(graphql@16.8.1) + '@graphql-mesh/cli': 0.82.35(@babel/core@7.23.5)(@types/node@18.18.7)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6) + '@graphql-mesh/graphql': 0.93.1(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.96.2)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(@types/node@18.18.7)(graphql@16.8.1)(tslib@2.6.2) graphql: 16.8.1 tslib: 2.6.2 transitivePeerDependencies: @@ -5977,14 +6982,14 @@ packages: - react-native-windows - supports-color - utf-8-validate - dev: true + dev: false /@graphprotocol/client-polling-live@1.1.1(@envelop/core@3.0.6)(@graphql-tools/merge@8.4.2)(graphql@16.8.1): resolution: {integrity: sha512-/XKnXNTts1VCUqwN2TCuPzQBfMGusL8vtamACKUeX65WxVy/H/Wjpcxq+w/XbyqNsQdG5QOoxY+AS/vKMhUcDQ==} peerDependencies: '@envelop/core': ^2.4.2 || ^3.0.0 '@graphql-tools/merge': ^8.3.14 - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: '@envelop/core': 3.0.6 '@graphql-tools/merge': 8.4.2(graphql@16.8.1) @@ -5999,7 +7004,7 @@ packages: peerDependencies: '@envelop/core': ^2.4.2 || ^3.0.0 || ^4.0.0 '@graphql-tools/merge': ^8.3.14 || ^9.0.0 - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: '@envelop/core': 3.0.6 '@graphql-tools/merge': 8.4.2(graphql@16.8.1) @@ -6008,29 +7013,30 @@ packages: tslib: 2.6.2 dev: false - /@graphprotocol/client-polling-live@2.0.0(@envelop/core@3.0.6)(@graphql-tools/merge@9.0.0)(graphql@16.8.1): + /@graphprotocol/client-polling-live@2.0.0(@envelop/core@3.0.6)(@graphql-tools/merge@9.0.1)(graphql@16.8.1): resolution: {integrity: sha512-JQ0sKiFCX+ErR0fynBNUg/WDiVaaEndlS12fkgrFZrQA2vVpSyow9pW0nKMGVZJa4cN+VDskgwqK5BWXMvdeRA==} engines: {node: '>=16.0.0'} peerDependencies: '@envelop/core': ^2.4.2 || ^3.0.0 || ^4.0.0 '@graphql-tools/merge': ^8.3.14 || ^9.0.0 - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: '@envelop/core': 3.0.6 - '@graphql-tools/merge': 9.0.0(graphql@16.8.1) + '@graphql-tools/merge': 9.0.1(graphql@16.8.1) '@repeaterjs/repeater': 3.0.4 graphql: 16.8.1 tslib: 2.6.2 + dev: false - /@graphprotocol/graph-cli@0.60.0(@types/node@18.18.6)(node-fetch@3.3.2)(typescript@4.9.5): + /@graphprotocol/graph-cli@0.60.0(@types/node@18.18.7)(node-fetch@3.3.2)(typescript@4.9.5): resolution: {integrity: sha512-8tGaQJ0EzAPtkDXCAijFGoVdJXM+pKFlGxjiU31TdG5bS4cIUoSB6yWojVsFFod0yETAwf+giel/0/8sudYsDw==} engines: {node: '>=14'} hasBin: true dependencies: '@float-capital/float-subgraph-uncrashable': 0.0.0-internal-testing.5 - '@oclif/core': 2.8.6(@types/node@18.18.6)(typescript@4.9.5) - '@oclif/plugin-autocomplete': 2.3.10(@types/node@18.18.6)(typescript@4.9.5) - '@oclif/plugin-not-found': 2.4.3(@types/node@18.18.6)(typescript@4.9.5) + '@oclif/core': 2.8.6(@types/node@18.18.7)(typescript@4.9.5) + '@oclif/plugin-autocomplete': 2.3.10(@types/node@18.18.7)(typescript@4.9.5) + '@oclif/plugin-not-found': 2.4.3(@types/node@18.18.7)(typescript@4.9.5) '@whatwg-node/fetch': 0.8.8 assemblyscript: 0.19.23 binary-install-raw: 0.0.13(debug@4.3.4) @@ -6042,7 +7048,7 @@ packages: fs-extra: 9.1.0 glob: 9.3.5 gluegun: 5.1.2(debug@4.3.4) - graphql: 16.8.1 + graphql: 15.5.0 immutable: 4.2.1 ipfs-http-client: 55.0.0(node-fetch@3.3.2) jayson: 4.0.0 @@ -6076,18 +7082,19 @@ packages: /@graphql-codegen/core@3.1.0(graphql@16.8.1): resolution: {integrity: sha512-DH1/yaR7oJE6/B+c6ZF2Tbdh7LixF1K8L+8BoSubjNyQ8pNwR4a70mvc1sv6H7qgp6y1bPQ9tKE+aazRRshysw==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.8.1) '@graphql-tools/schema': 9.0.19(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 tslib: 2.5.3 + dev: false /@graphql-codegen/plugin-helpers@2.7.2(graphql@16.8.1): resolution: {integrity: sha512-kln2AZ12uii6U59OQXdjLk5nOlh1pHis1R98cDZGFnfaiAbX9V3fxcZ1MMJkB7qFUymTALzyjZoXXdyVmPMfRg==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@graphql-tools/utils': 8.13.1(graphql@16.8.1) change-case-all: 1.0.14 @@ -6096,11 +7103,12 @@ packages: import-from: 4.0.0 lodash: 4.17.21 tslib: 2.4.1 + dev: false /@graphql-codegen/plugin-helpers@3.1.2(graphql@16.8.1): resolution: {integrity: sha512-emOQiHyIliVOIjKVKdsI5MXj312zmRDwmHpyUTZMjfpvxq/UVAHUJIVdVf+lnjjrI+LXBTgMlTWTgHQfmICxjg==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) change-case-all: 1.0.15 @@ -6109,11 +7117,12 @@ packages: import-from: 4.0.0 lodash: 4.17.21 tslib: 2.4.1 + dev: false /@graphql-codegen/plugin-helpers@4.2.0(graphql@16.8.1): resolution: {integrity: sha512-THFTCfg+46PXlXobYJ/OoCX6pzjI+9woQqCjdyKtgoI0tn3Xq2HUUCiidndxUpEYVrXb5pRiRXb7b/ZbMQqD0A==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) change-case-all: 1.0.15 @@ -6122,21 +7131,23 @@ packages: import-from: 4.0.0 lodash: 4.17.21 tslib: 2.5.3 + dev: false /@graphql-codegen/schema-ast@3.0.1(graphql@16.8.1): resolution: {integrity: sha512-rTKTi4XiW4QFZnrEqetpiYEWVsOFNoiR/v3rY9mFSttXFbIwNXPme32EspTiGWmEEdHY8UuTDtZN3vEcs/31zw==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 tslib: 2.5.3 + dev: false /@graphql-codegen/typed-document-node@4.0.1(graphql@16.8.1): resolution: {integrity: sha512-mQNYCd12JsFSaK6xLry4olY9TdYG7GxQPexU6qU4Om++eKhseGwk2eGmQDRG4Qp8jEDFLMXuHMVUKqMQ1M+F/A==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.8.1) '@graphql-codegen/visitor-plugin-common': 3.1.1(graphql@16.8.1) @@ -6147,11 +7158,12 @@ packages: transitivePeerDependencies: - encoding - supports-color + dev: false /@graphql-codegen/typescript-generic-sdk@3.1.0(graphql-tag@2.12.6)(graphql@16.8.1): resolution: {integrity: sha512-nQZi/YGRI1+qCZZsh0V5nz6+hCHSN4OU9tKyOTDsEPyDFnGEukDuRdCH2IZasGn22a3Iu5TUDkgp5w9wEQwGmg==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 graphql-tag: ^2.0.0 dependencies: '@graphql-codegen/plugin-helpers': 3.1.2(graphql@16.8.1) @@ -6163,11 +7175,12 @@ packages: transitivePeerDependencies: - encoding - supports-color + dev: false /@graphql-codegen/typescript-operations@3.0.4(graphql@16.8.1): resolution: {integrity: sha512-6yE2OL2+WJ1vd5MwFEGXpaxsFGzjAGUytPVHDML3Bi3TwP1F3lnQlIko4untwvHW0JhZEGQ7Ck30H9HjcxpdKA==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.8.1) '@graphql-codegen/typescript': 3.0.4(graphql@16.8.1) @@ -6178,11 +7191,12 @@ packages: transitivePeerDependencies: - encoding - supports-color + dev: false /@graphql-codegen/typescript-resolvers@3.2.1(graphql@16.8.1): resolution: {integrity: sha512-2ZIHk5J6HTuylse5ZIxw+aega54prHxvj7vM8hiKJ6vejZ94kvVPAq4aWmSFOkZ5lqU3YnM/ZyWfnhT5CUDj1g==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.8.1) '@graphql-codegen/typescript': 3.0.4(graphql@16.8.1) @@ -6194,11 +7208,12 @@ packages: transitivePeerDependencies: - encoding - supports-color + dev: false /@graphql-codegen/typescript@3.0.4(graphql@16.8.1): resolution: {integrity: sha512-x4O47447DZrWNtE/l5CU9QzzW4m1RbmCEdijlA3s2flG/y1Ckqdemob4CWfilSm5/tZ3w1junVDY616RDTSvZw==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.8.1) '@graphql-codegen/schema-ast': 3.0.1(graphql@16.8.1) @@ -6209,11 +7224,12 @@ packages: transitivePeerDependencies: - encoding - supports-color + dev: false /@graphql-codegen/visitor-plugin-common@2.13.1(graphql@16.8.1): resolution: {integrity: sha512-mD9ufZhDGhyrSaWQGrU1Q1c5f01TeWtSWy/cDwXYjJcHIj1Y/DG2x0tOflEfCvh5WcnmHNIw4lzDsg1W7iFJEg==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@graphql-codegen/plugin-helpers': 2.7.2(graphql@16.8.1) '@graphql-tools/optimize': 1.4.0(graphql@16.8.1) @@ -6229,11 +7245,12 @@ packages: transitivePeerDependencies: - encoding - supports-color + dev: false /@graphql-codegen/visitor-plugin-common@3.1.1(graphql@16.8.1): resolution: {integrity: sha512-uAfp+zu/009R3HUAuTK2AamR1bxIltM6rrYYI6EXSmkM3rFtFsLTuJhjUDj98HcUCszJZrADppz8KKLGRUVlNg==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: '@graphql-codegen/plugin-helpers': 4.2.0(graphql@16.8.1) '@graphql-tools/optimize': 1.4.0(graphql@16.8.1) @@ -6249,34 +7266,49 @@ packages: transitivePeerDependencies: - encoding - supports-color + dev: false /@graphql-inspector/core@3.3.0(graphql@16.8.1): resolution: {integrity: sha512-LRtk9sHgj9qqVPIkkThAVq3iZ7QxgHCx6elEwd0eesZBCmaIYQxD/BFu+VT8jr10YfOURBZuAnVdyGu64vYpBg==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: dependency-graph: 0.11.0 graphql: 16.8.1 object-inspect: 1.10.3 tslib: 2.6.2 + dev: false /@graphql-inspector/core@5.0.1(graphql@16.8.1): resolution: {integrity: sha512-1CWfFYucnRdULGiN1NDSinlNlpucBT+0x4i4AIthKe5n5jD9RIVyJtkA8zBbujUFrP++YE3l+TQifwbN1yTQsw==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: dependency-graph: 0.11.0 graphql: 16.8.1 object-inspect: 1.12.3 tslib: 2.6.0 + dev: false + + /@graphql-inspector/core@5.0.2(graphql@16.8.1): + resolution: {integrity: sha512-pXHPCggwLmgi5NACPPV4qyf2xW/sQONnu6ZqCAid3k/S2APmVYN4Z3OvxvLA12NFhzby5Sz5K4fRsId43cK8ww==} + engines: {node: '>=16.0.0'} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 + dependencies: + dependency-graph: 0.11.0 + graphql: 16.8.1 + object-inspect: 1.12.3 + tslib: 2.6.2 + dev: false /@graphql-mesh/cache-localforage@0.93.1(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(graphql@16.8.1)(tslib@2.6.2): resolution: {integrity: sha512-cY/LJ+XC8kiyPoLxqPAMlOAvaeB81CZafdadLNyNDFuu66qDiZqWTYPw/lnhp2nyeukC8o/P69oP7d2OqVaCZA==} peerDependencies: '@graphql-mesh/types': ^0.93.1 '@graphql-mesh/utils': ^0.93.1 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) @@ -6284,28 +7316,45 @@ packages: graphql: 16.8.1 localforage: 1.10.0 tslib: 2.6.2 + dev: false - /@graphql-mesh/cache-localforage@0.95.7(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(graphql@16.8.1)(tslib@2.6.2): - resolution: {integrity: sha512-/e9sFn0kgSxGE6O/GWfdGnFMOIfk1Y+IZwRqPIofHmIPdyC5cZ/gnkN6oRQv7nnx+c9hzQQ5OnxiOGdOKwb1cg==} + /@graphql-mesh/cache-localforage@0.95.8(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-PgCTHh1dLwjmusWEWAMQkglL7gR8VyyT9pzTcYBVFhGYNXysepCrl85QtaqtEMnR/YijgpCWaKGIYK+bosQZsg==} engines: {node: '>=16.0.0'} peerDependencies: - '@graphql-mesh/types': ^0.95.7 - '@graphql-mesh/utils': ^0.95.7 - graphql: ^16.6.0 + '@graphql-mesh/types': ^0.95.8 + '@graphql-mesh/utils': ^0.95.8 + graphql: '*' tslib: ^2.4.0 dependencies: - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/utils': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.95.8(@graphql-mesh/store@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) graphql: 16.8.1 localforage: 1.10.0 tslib: 2.6.2 dev: false - /@graphql-mesh/cli@0.82.35(@babel/core@7.23.2)(@types/node@18.18.6)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6): + /@graphql-mesh/cache-localforage@0.96.2(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-1l8KJzYF/hYQszoOQ4R6E05nz6TkcNnW7Wu99kseCE/4rA/z0HuYtdpG/mxBvEXSbodOZ6Ly5hWlq3fdx2a3eA==} + engines: {node: '>=16.0.0'} + peerDependencies: + '@graphql-mesh/types': ^0.96.2 + '@graphql-mesh/utils': ^0.96.2 + graphql: '*' + tslib: ^2.4.0 + dependencies: + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + graphql: 16.8.1 + localforage: 1.10.0 + tslib: 2.6.2 + dev: false + + /@graphql-mesh/cli@0.82.35(@babel/core@7.23.5)(@types/node@18.18.7)(graphql-tag@2.12.6)(graphql@16.8.1)(react-native@0.72.6): resolution: {integrity: sha512-5IuXpk+Zpg05u6qNPX19VzC5/HCiLdDRF6EPZ3ze57FIRgGA3YsB1CUGga6Ky3inalURYwx0kWqmdjbdKZYx1w==} hasBin: true peerDependencies: - graphql: ^16.6.0 + graphql: '*' dependencies: '@graphql-codegen/core': 3.1.0(graphql@16.8.1) '@graphql-codegen/typed-document-node': 4.0.1(graphql@16.8.1) @@ -6313,7 +7362,7 @@ packages: '@graphql-codegen/typescript-generic-sdk': 3.1.0(graphql-tag@2.12.6)(graphql@16.8.1) '@graphql-codegen/typescript-operations': 3.0.4(graphql@16.8.1) '@graphql-codegen/typescript-resolvers': 3.2.1(graphql@16.8.1) - '@graphql-mesh/config': 0.93.1(@babel/core@7.23.2)(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/runtime@0.93.2)(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/config': 0.93.1(@babel/core@7.23.5)(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/runtime@0.93.2)(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/cross-helpers': 0.3.4(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(react-native@0.72.6) '@graphql-mesh/http': 0.93.2(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/runtime@0.93.2)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/runtime': 0.93.2(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) @@ -6323,7 +7372,7 @@ packages: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) ajv: 8.12.0 change-case: 4.1.2 - cosmiconfig: 8.3.6(typescript@5.1.6) + cosmiconfig: 8.3.6(typescript@5.3.2) dnscache: 1.0.2 dotenv: 16.3.1 graphql: 16.8.1 @@ -6335,10 +7384,10 @@ packages: open: 7.4.2 pascal-case: 3.1.2 rimraf: 5.0.5 - ts-node: 10.9.1(@types/node@18.18.6)(typescript@5.1.6) + ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.3.2) tsconfig-paths: 4.2.0 tslib: 2.6.2 - typescript: 5.1.6 + typescript: 5.3.2 ws: 8.14.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) yargs: 17.7.2 transitivePeerDependencies: @@ -6353,8 +7402,9 @@ packages: - react-native-windows - supports-color - utf-8-validate + dev: false - /@graphql-mesh/config@0.93.1(@babel/core@7.23.2)(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/runtime@0.93.2)(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): + /@graphql-mesh/config@0.93.1(@babel/core@7.23.5)(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/runtime@0.93.2)(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): resolution: {integrity: sha512-g4omjuBBVPtyhEDeEa6uwfSSvUehV3zcwZVNbk+UJuFJEYPO4yBLsxfEZBpoeO6EriiPX2WnQyn5kiHbC3YTRA==} peerDependencies: '@graphql-mesh/cross-helpers': ^0.3.4 @@ -6363,7 +7413,7 @@ packages: '@graphql-mesh/types': ^0.93.1 '@graphql-mesh/utils': ^0.93.1 '@graphql-tools/utils': ^9.2.1 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@envelop/core': 3.0.6 @@ -6375,7 +7425,7 @@ packages: '@graphql-mesh/store': 0.93.1(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/utils': 0.93.2(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-tools/code-file-loader': 7.3.23(@babel/core@7.23.2)(graphql@16.8.1) + '@graphql-tools/code-file-loader': 7.3.23(@babel/core@7.23.5)(graphql@16.8.1) '@graphql-tools/graphql-file-loader': 7.5.17(graphql@16.8.1) '@graphql-tools/load': 7.8.14(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) @@ -6388,12 +7438,13 @@ packages: transitivePeerDependencies: - '@babel/core' - supports-color + dev: false /@graphql-mesh/cross-helpers@0.3.4(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(react-native@0.72.6): resolution: {integrity: sha512-jseNppSNEwNWjcjDDwsxmRBK+ub8tz2qc/ca2ZfCTebuCk/+D3dI3LJ95ceNFOIhInK0g2HVq8BO8lMMX1pQtg==} peerDependencies: '@graphql-tools/utils': ^9.2.1 - graphql: ^16.6.0 + graphql: '*' dependencies: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 @@ -6403,19 +7454,21 @@ packages: transitivePeerDependencies: - react-native - react-native-windows + dev: false /@graphql-mesh/cross-helpers@0.4.1(@graphql-tools/utils@9.2.1)(graphql@16.8.1): resolution: {integrity: sha512-NkLzFuY72tmmKO7gKWoDzoYcRVf3lLoCdlw30fSNKFKEWDAV3Tyh4v0fPvU3SEmoTJio7v0TIYZqtVt3dBBDFw==} engines: {node: '>=16.0.0'} peerDependencies: '@graphql-tools/utils': ^9.2.1 || ^10.0.0 - graphql: ^16.6.0 + graphql: '*' dependencies: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 path-browserify: 1.0.1 + dev: false - /@graphql-mesh/graphql@0.93.1(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(@types/node@18.18.6)(graphql@16.8.1)(tslib@2.6.2): + /@graphql-mesh/graphql@0.93.1(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(@types/node@18.18.7)(graphql@16.8.1)(tslib@2.6.2): resolution: {integrity: sha512-1G2/1jkl1VPWhsZsUBwFQI5d9OxxEc+CMxy5ef0qI2WEXqIocOxMhEY53cc+tCSbuXR99rxos+KD/8Z6ZasaOQ==} peerDependencies: '@graphql-mesh/cross-helpers': ^0.3.4 @@ -6423,7 +7476,7 @@ packages: '@graphql-mesh/types': ^0.93.1 '@graphql-mesh/utils': ^0.93.1 '@graphql-tools/utils': ^9.2.1 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-mesh/cross-helpers': 0.3.4(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(react-native@0.72.6) @@ -6432,7 +7485,7 @@ packages: '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/utils': 0.93.2(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) - '@graphql-tools/url-loader': 7.17.18(@types/node@18.18.6)(graphql@16.8.1) + '@graphql-tools/url-loader': 7.17.18(@types/node@18.18.7)(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) '@graphql-tools/wrap': 9.4.2(graphql@16.8.1) graphql: 16.8.1 @@ -6445,7 +7498,7 @@ packages: - utf-8-validate dev: false - /@graphql-mesh/graphql@0.93.1(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.95.7)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(@types/node@18.18.6)(graphql@16.8.1)(tslib@2.6.2): + /@graphql-mesh/graphql@0.93.1(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.96.2)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(@types/node@18.18.7)(graphql@16.8.1)(tslib@2.6.2): resolution: {integrity: sha512-1G2/1jkl1VPWhsZsUBwFQI5d9OxxEc+CMxy5ef0qI2WEXqIocOxMhEY53cc+tCSbuXR99rxos+KD/8Z6ZasaOQ==} peerDependencies: '@graphql-mesh/cross-helpers': ^0.3.4 @@ -6453,16 +7506,16 @@ packages: '@graphql-mesh/types': ^0.93.1 '@graphql-mesh/utils': ^0.93.1 '@graphql-tools/utils': ^9.2.1 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-mesh/cross-helpers': 0.4.1(@graphql-tools/utils@9.2.1)(graphql@16.8.1) - '@graphql-mesh/store': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/store': 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/string-interpolation': 0.4.4(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/utils': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) - '@graphql-tools/url-loader': 7.17.18(@types/node@18.18.6)(graphql@16.8.1) + '@graphql-tools/url-loader': 7.17.18(@types/node@18.18.7)(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) '@graphql-tools/wrap': 9.4.2(graphql@16.8.1) graphql: 16.8.1 @@ -6473,28 +7526,63 @@ packages: - bufferutil - encoding - utf-8-validate - dev: true + dev: false + + /@graphql-mesh/graphql@0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.95.8)(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(@graphql-tools/utils@9.2.1)(@types/node@18.18.7)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0)(tslib@2.6.2): + resolution: {integrity: sha512-mEbz2XYSgRTdNidUBWB7FT3QzLliJwxJIoqipSbZNputJqSbUZZ6QD/oI1IrdPXqVl/ELE2CuLiogkOSO24C1Q==} + engines: {node: '>=16.0.0'} + peerDependencies: + '@graphql-mesh/cross-helpers': ^0.4.1 + '@graphql-mesh/store': ^0.95.8 + '@graphql-mesh/types': ^0.95.8 + '@graphql-mesh/utils': ^0.95.8 + '@graphql-tools/utils': ^9.2.1 || ^10.0.0 + graphql: '*' + tslib: ^2.4.0 + dependencies: + '@graphql-mesh/cross-helpers': 0.4.1(@graphql-tools/utils@9.2.1)(graphql@16.8.1) + '@graphql-mesh/store': 0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/string-interpolation': 0.5.3(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.95.8(@graphql-mesh/store@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) + '@graphql-tools/federation': 1.1.10(@types/node@18.18.7)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0) + '@graphql-tools/url-loader': 8.0.0(@types/node@18.18.7)(graphql@16.8.1) + '@graphql-tools/utils': 9.2.1(graphql@16.8.1) + graphql: 16.8.1 + lodash.get: 4.4.2 + tslib: 2.6.2 + transitivePeerDependencies: + - '@types/node' + - bufferutil + - encoding + - graphql-ws + - react + - react-dom + - subscriptions-transport-ws + - utf-8-validate + dev: false - /@graphql-mesh/graphql@0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.95.7)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(@types/node@18.18.6)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0)(tslib@2.6.2): - resolution: {integrity: sha512-Fjf1Ti2HYOEP+dFLVnVxafD/Z4Ev+sR6BUbx3E7Mw8r/XGY28KmCA/QftBOB6BRNKMLe5w7RsgjCrO+Qp0klNg==} + /@graphql-mesh/graphql@0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.96.2)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(@types/node@18.18.7)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0)(tslib@2.6.2): + resolution: {integrity: sha512-lXNRJV+AVh/8l9PMOnYPTV5mEEebR5W8uHMC7NMToJoGylXemT/8E6AAglzszUt/fv7Wlbzpwi4g7dXToX25mg==} engines: {node: '>=16.0.0'} peerDependencies: '@graphql-mesh/cross-helpers': ^0.4.1 - '@graphql-mesh/store': ^0.95.7 - '@graphql-mesh/types': ^0.95.7 - '@graphql-mesh/utils': ^0.95.7 + '@graphql-mesh/store': ^0.96.2 + '@graphql-mesh/types': ^0.96.2 + '@graphql-mesh/utils': ^0.96.2 '@graphql-tools/utils': ^9.2.1 || ^10.0.0 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-mesh/cross-helpers': 0.4.1(@graphql-tools/utils@9.2.1)(graphql@16.8.1) - '@graphql-mesh/store': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/string-interpolation': 0.5.2(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/utils': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/store': 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/string-interpolation': 0.5.3(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) - '@graphql-tools/federation': 1.1.10(@types/node@18.18.6)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0) - '@graphql-tools/url-loader': 8.0.0(@types/node@18.18.6)(graphql@16.8.1) + '@graphql-tools/federation': 1.1.10(@types/node@18.18.7)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0) + '@graphql-tools/url-loader': 8.0.0(@types/node@18.18.7)(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 lodash.get: 4.4.2 @@ -6517,7 +7605,7 @@ packages: '@graphql-mesh/runtime': ^0.93.2 '@graphql-mesh/types': ^0.93.1 '@graphql-mesh/utils': ^0.93.1 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-mesh/cross-helpers': 0.3.4(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(react-native@0.72.6) @@ -6528,23 +7616,45 @@ packages: graphql: 16.8.1 graphql-yoga: 3.9.1(graphql@16.8.1) tslib: 2.6.2 + dev: false - /@graphql-mesh/http@0.96.13(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/runtime@0.96.12)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(graphql@16.8.1)(tslib@2.6.2): - resolution: {integrity: sha512-WNiOJkwuRKoVCv/+9bp8/PFdclyTN0COIwSXjzIf36QICPtUXhokPLkXKhR7Xdtk175aIIpUHYRRwlgQw3BC1w==} + /@graphql-mesh/http@0.96.14(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/runtime@0.96.13)(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-38Mxw2K2RABBBO0IiXKZDu2o+jlM4vcUSEg+9h2Dz67oOJZHpKeId6z1PFb7uYMzAs29yoMcqXIEnews+HVhrQ==} engines: {node: '>=16.0.0'} peerDependencies: '@graphql-mesh/cross-helpers': ^0.4.1 - '@graphql-mesh/runtime': ^0.96.12 - '@graphql-mesh/types': ^0.95.7 - '@graphql-mesh/utils': ^0.95.7 - graphql: ^16.6.0 + '@graphql-mesh/runtime': ^0.96.13 + '@graphql-mesh/types': ^0.95.8 + '@graphql-mesh/utils': ^0.95.8 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-mesh/cross-helpers': 0.4.1(@graphql-tools/utils@9.2.1)(graphql@16.8.1) - '@graphql-mesh/runtime': 0.96.12(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/utils': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@whatwg-node/server': 0.9.15 + '@graphql-mesh/runtime': 0.96.13(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.95.8(@graphql-mesh/store@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@whatwg-node/server': 0.9.16 + graphql: 16.8.1 + graphql-yoga: 5.0.0(graphql@16.8.1) + tslib: 2.6.2 + dev: false + + /@graphql-mesh/http@0.97.3(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/runtime@0.97.3)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-J/8ipMTRh+Fi4+zqz9+gymr/tZaR2N4//hoVOdNHCvpxe1L2pBmO1dwSBDCbbKH52MVtB8EY4poOwAMPmDGyiQ==} + engines: {node: '>=16.0.0'} + peerDependencies: + '@graphql-mesh/cross-helpers': ^0.4.1 + '@graphql-mesh/runtime': ^0.97.3 + '@graphql-mesh/types': ^0.96.2 + '@graphql-mesh/utils': ^0.96.2 + graphql: '*' + tslib: ^2.4.0 + dependencies: + '@graphql-mesh/cross-helpers': 0.4.1(@graphql-tools/utils@9.2.1)(graphql@16.8.1) + '@graphql-mesh/runtime': 0.97.3(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@whatwg-node/server': 0.9.16 graphql: 16.8.1 graphql-yoga: 5.0.0(graphql@16.8.1) tslib: 2.6.2 @@ -6556,7 +7666,7 @@ packages: '@graphql-mesh/types': ^0.93.1 '@graphql-mesh/utils': ^0.93.1 '@graphql-tools/utils': ^9.2.1 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-mesh/merger-stitching': 0.93.1(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) @@ -6568,20 +7678,21 @@ packages: tslib: 2.6.2 transitivePeerDependencies: - '@graphql-mesh/store' + dev: false - /@graphql-mesh/merger-bare@0.95.7(@graphql-mesh/store@0.95.7)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): - resolution: {integrity: sha512-QNLm5otrzcpClR8Puks4Md7Mh6AON+EWK+l3NBKvEkiOINFcnDRFv4FrSEXSfrAv/vHrSBbxAEXGUWHjjbQ8Kw==} + /@graphql-mesh/merger-bare@0.95.8(@graphql-mesh/store@0.95.8)(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-E5R8Sv5Dkp+eswYKEDHgu8puwSeolPX1j9IHwBVe1npRRCXc3CjMsQJ9+kcTln453vbSBcM1a3fQspIaKA1Tcg==} engines: {node: '>=16.0.0'} peerDependencies: - '@graphql-mesh/types': ^0.95.7 - '@graphql-mesh/utils': ^0.95.7 + '@graphql-mesh/types': ^0.95.8 + '@graphql-mesh/utils': ^0.95.8 '@graphql-tools/utils': ^9.2.1 || ^10.0.0 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: - '@graphql-mesh/merger-stitching': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/utils': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/merger-stitching': 0.95.8(@graphql-mesh/store@0.95.8)(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.95.8(@graphql-mesh/store@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/schema': 10.0.0(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 @@ -6590,6 +7701,27 @@ packages: - '@graphql-mesh/store' dev: false + /@graphql-mesh/merger-bare@0.96.2(@graphql-mesh/store@0.96.2)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-2sOt1dyNPUrJoXD203n5gBSGXR+9plj0Ybgjv1VjXbZKVRL0Bao6COqf+ZYS2e3FJgI/9CUR85tGhoGyEc4EGA==} + engines: {node: '>=16.0.0'} + peerDependencies: + '@graphql-mesh/types': ^0.96.2 + '@graphql-mesh/utils': ^0.96.2 + '@graphql-tools/utils': ^9.2.1 || ^10.0.0 + graphql: '*' + tslib: ^2.4.0 + dependencies: + '@graphql-mesh/merger-stitching': 0.96.2(@graphql-mesh/store@0.96.2)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-tools/schema': 10.0.2(graphql@16.8.1) + '@graphql-tools/utils': 9.2.1(graphql@16.8.1) + graphql: 16.8.1 + tslib: 2.6.2 + transitivePeerDependencies: + - '@graphql-mesh/store' + dev: false + /@graphql-mesh/merger-stitching@0.93.1(@graphql-mesh/store@0.93.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): resolution: {integrity: sha512-8km5UFhKQGd0XY8bTBpHoBhVx/7qCkflPHLoTAguIWN8nJrcXJoqPamodci/U+2hudLAtRqhWosHu/8z7ctZpg==} peerDependencies: @@ -6597,7 +7729,7 @@ packages: '@graphql-mesh/types': ^0.93.1 '@graphql-mesh/utils': ^0.93.1 '@graphql-tools/utils': ^9.2.1 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-mesh/store': 0.93.1(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) @@ -6610,21 +7742,22 @@ packages: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 + dev: false - /@graphql-mesh/merger-stitching@0.95.7(@graphql-mesh/store@0.95.7)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): - resolution: {integrity: sha512-0fooZHNseNrrVIm+OPfy7NdN1f/Cq6yhpW7d9lXjB8kPWjRGaX6gBUxpfCsRqSrfBDP1VwusZ6Z9EmW+84AtCQ==} + /@graphql-mesh/merger-stitching@0.95.8(@graphql-mesh/store@0.95.8)(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-eAukU8AsjK8jIT3vFhalGoERh98xZgzKkTCQL7w2wPpFXveSDMn+9fVvCJ1EBKTsLa7SkNXqzAFkfYp21hW0ng==} engines: {node: '>=16.0.0'} peerDependencies: - '@graphql-mesh/store': ^0.95.7 - '@graphql-mesh/types': ^0.95.7 - '@graphql-mesh/utils': ^0.95.7 + '@graphql-mesh/store': ^0.95.8 + '@graphql-mesh/types': ^0.95.8 + '@graphql-mesh/utils': ^0.95.8 '@graphql-tools/utils': ^9.2.1 || ^10.0.0 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: - '@graphql-mesh/store': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/utils': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/store': 0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.95.8(@graphql-mesh/store@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) '@graphql-tools/schema': 10.0.0(graphql@16.8.1) '@graphql-tools/stitch': 9.0.3(graphql@16.8.1) @@ -6633,6 +7766,28 @@ packages: tslib: 2.6.2 dev: false + /@graphql-mesh/merger-stitching@0.96.2(@graphql-mesh/store@0.96.2)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-pljjW7+wx/t5N4f3NRgk7+FPt3KCsR+Hhuquigwefn9y9vLn4k7LI03lzhD0ZVZNSrNk0bymw34uzU2jR/vV5w==} + engines: {node: '>=16.0.0'} + peerDependencies: + '@graphql-mesh/store': ^0.96.2 + '@graphql-mesh/types': ^0.96.2 + '@graphql-mesh/utils': ^0.96.2 + '@graphql-tools/utils': ^9.2.1 || ^10.0.0 + graphql: '*' + tslib: ^2.4.0 + dependencies: + '@graphql-mesh/store': 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) + '@graphql-tools/schema': 10.0.2(graphql@16.8.1) + '@graphql-tools/stitch': 9.0.3(graphql@16.8.1) + '@graphql-tools/utils': 9.2.1(graphql@16.8.1) + graphql: 16.8.1 + tslib: 2.6.2 + dev: false + /@graphql-mesh/runtime@0.93.2(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): resolution: {integrity: sha512-8z9ag3jZLmkzawMzF6+i/+P1nQai+HmSZzNeJJen6fRkwprSM1Z7B4lfYBYhdiCbK11HHubDfw4LYwRuBcISMQ==} peerDependencies: @@ -6640,7 +7795,7 @@ packages: '@graphql-mesh/types': ^0.93.1 '@graphql-mesh/utils': ^0.93.1 '@graphql-tools/utils': ^9.2.1 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@envelop/core': 3.0.6 @@ -6657,23 +7812,24 @@ packages: '@whatwg-node/fetch': 0.8.8 graphql: 16.8.1 tslib: 2.6.2 + dev: false - /@graphql-mesh/runtime@0.96.12(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): - resolution: {integrity: sha512-b3a/XjbTtS8gF30wu35M4pA2KyUYkYcWlnYNGXWOObtdEtEXjj+GkX//yO2XzTGI/sGWKElAAKIv4asPsye4jA==} + /@graphql-mesh/runtime@0.96.13(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-eZIW/gdEVLvCLEEae8e3lny7d89CFfDyu0Z0xu4yVEdYeVpG9Ki2mDYFHztusIIkZikecvdsoM9MZX6LYcPOkg==} engines: {node: '>=16.0.0'} peerDependencies: '@graphql-mesh/cross-helpers': ^0.4.1 - '@graphql-mesh/types': ^0.95.7 - '@graphql-mesh/utils': ^0.95.7 + '@graphql-mesh/types': ^0.95.8 + '@graphql-mesh/utils': ^0.95.8 '@graphql-tools/utils': ^9.2.1 || ^10.0.0 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@envelop/core': 5.0.0 '@envelop/extended-validation': 4.0.0(@envelop/core@5.0.0)(graphql@16.8.1) '@envelop/graphql-jit': 8.0.1(@envelop/core@5.0.0)(graphql@16.8.1) '@graphql-mesh/cross-helpers': 0.3.4(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(react-native@0.72.6) - '@graphql-mesh/string-interpolation': 0.5.2(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/string-interpolation': 0.5.3(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/utils': 0.93.2(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/batch-delegate': 9.0.0(graphql@16.8.1) @@ -6681,36 +7837,36 @@ packages: '@graphql-tools/executor': 1.2.0(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) '@graphql-tools/wrap': 10.0.1(graphql@16.8.1) - '@whatwg-node/fetch': 0.9.13 + '@whatwg-node/fetch': 0.9.14 graphql: 16.8.1 graphql-jit: 0.8.2(graphql@16.8.1) tslib: 2.6.2 dev: false - /@graphql-mesh/runtime@0.96.12(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): - resolution: {integrity: sha512-b3a/XjbTtS8gF30wu35M4pA2KyUYkYcWlnYNGXWOObtdEtEXjj+GkX//yO2XzTGI/sGWKElAAKIv4asPsye4jA==} + /@graphql-mesh/runtime@0.97.3(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-XvheLgxrjCE86G9vxJCRSw7pZZM7wC3F9iTwBfaG5ynfjO3paO53Q03kEZ1n+KLdZE0RVZltGMDi6Xx9rTdPmA==} engines: {node: '>=16.0.0'} peerDependencies: '@graphql-mesh/cross-helpers': ^0.4.1 - '@graphql-mesh/types': ^0.95.7 - '@graphql-mesh/utils': ^0.95.7 + '@graphql-mesh/types': ^0.96.2 + '@graphql-mesh/utils': ^0.96.2 '@graphql-tools/utils': ^9.2.1 || ^10.0.0 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@envelop/core': 5.0.0 '@envelop/extended-validation': 4.0.0(@envelop/core@5.0.0)(graphql@16.8.1) '@envelop/graphql-jit': 8.0.1(@envelop/core@5.0.0)(graphql@16.8.1) '@graphql-mesh/cross-helpers': 0.4.1(@graphql-tools/utils@9.2.1)(graphql@16.8.1) - '@graphql-mesh/string-interpolation': 0.5.2(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/utils': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/string-interpolation': 0.5.3(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/batch-delegate': 9.0.0(graphql@16.8.1) '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) '@graphql-tools/executor': 1.2.0(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) '@graphql-tools/wrap': 10.0.1(graphql@16.8.1) - '@whatwg-node/fetch': 0.9.13 + '@whatwg-node/fetch': 0.9.14 graphql: 16.8.1 graphql-jit: 0.8.2(graphql@16.8.1) tslib: 2.6.2 @@ -6723,7 +7879,7 @@ packages: '@graphql-mesh/types': ^0.93.1 '@graphql-mesh/utils': ^0.93.1 '@graphql-tools/utils': ^9.2.1 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-inspector/core': 3.3.0(graphql@16.8.1) @@ -6733,30 +7889,52 @@ packages: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 + dev: false - /@graphql-mesh/store@0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): - resolution: {integrity: sha512-4T5MnkdV70gPzM3Hj+Er2Qg4FTzePzbzGdHdWRSbW++4K+05Hbe1gKPix2f3s3BGkAO4Et5XkkdILL5QynhQFw==} + /@graphql-mesh/store@0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-29lpMcvqS1DM9alUOCyj6he2V7ZzG/DZxkerRefT8Mo5FexwJZI3LeI0YHNSY9Cq0x8KzRoH1TWcTTN/1PDRRw==} engines: {node: '>=16.0.0'} peerDependencies: '@graphql-mesh/cross-helpers': ^0.4.1 - '@graphql-mesh/types': ^0.95.7 - '@graphql-mesh/utils': ^0.95.7 + '@graphql-mesh/types': ^0.95.8 + '@graphql-mesh/utils': ^0.95.8 '@graphql-tools/utils': ^9.2.1 || ^10.0.0 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-inspector/core': 5.0.1(graphql@16.8.1) '@graphql-mesh/cross-helpers': 0.4.1(@graphql-tools/utils@9.2.1)(graphql@16.8.1) - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/utils': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.95.8(@graphql-mesh/store@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-tools/utils': 9.2.1(graphql@16.8.1) + graphql: 16.8.1 + tslib: 2.6.2 + dev: false + + /@graphql-mesh/store@0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-nryLBuR5pVs2axi3Lw7ZvAp/9KBirCHTKFO7aygf+C1hqh8xq8AOyc88ButFFk7YHlfkrAJ+RF850tHBPq/0nA==} + engines: {node: '>=16.0.0'} + peerDependencies: + '@graphql-mesh/cross-helpers': ^0.4.1 + '@graphql-mesh/types': ^0.96.2 + '@graphql-mesh/utils': ^0.96.2 + '@graphql-tools/utils': ^9.2.1 || ^10.0.0 + graphql: '*' + tslib: ^2.4.0 + dependencies: + '@graphql-inspector/core': 5.0.2(graphql@16.8.1) + '@graphql-mesh/cross-helpers': 0.4.1(@graphql-tools/utils@9.2.1)(graphql@16.8.1) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 + dev: false /@graphql-mesh/string-interpolation@0.4.4(graphql@16.8.1)(tslib@2.6.2): resolution: {integrity: sha512-IotswBYZRaPswOebcr2wuOFuzD3dHIJxVEkPiiQubqjUIR8HhQI22XHJv0WNiQZ65z8NR9+GYWwEDIc2JRCNfQ==} peerDependencies: - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: dayjs: 1.11.7 @@ -6764,12 +7942,13 @@ packages: json-pointer: 0.6.2 lodash.get: 4.4.2 tslib: 2.6.2 + dev: false - /@graphql-mesh/string-interpolation@0.5.2(graphql@16.8.1)(tslib@2.6.2): - resolution: {integrity: sha512-TkSAJ9pj1zesQyDlHrEUevVGOc1s/z9IQC0AONcpMHAunb8uYGO4Yryl8JIRIvDl5DlexHt3z8kLDNCInRGWNQ==} + /@graphql-mesh/string-interpolation@0.5.3(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-/R4kj3M1uqUie/7RZ58zgRrT8RBrDsCCR6ii00s62DbLsl+jZYOZFyTqHGsFbP7L7aHnl0fo1dwhEJIs+rjCLg==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: dayjs: 1.11.10 @@ -6777,13 +7956,14 @@ packages: json-pointer: 0.6.2 lodash.get: 4.4.2 tslib: 2.6.2 + dev: false /@graphql-mesh/transform-type-merging@0.93.1(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(graphql@16.8.1)(tslib@2.6.2): resolution: {integrity: sha512-CUrqCMaEqO1LDusv59UPqmQju3f+LpEGxFu7CydMiIvbfKDDDrf8+dF3OVU7d/ZOMRxB6hR80JsQF0SVeXPCOQ==} peerDependencies: '@graphql-mesh/types': ^0.93.1 '@graphql-mesh/utils': ^0.93.1 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) @@ -6794,28 +7974,28 @@ packages: tslib: 2.6.2 dev: false - /@graphql-mesh/transform-type-merging@0.93.1(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(graphql@16.8.1)(tslib@2.6.2): + /@graphql-mesh/transform-type-merging@0.93.1(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(graphql@16.8.1)(tslib@2.6.2): resolution: {integrity: sha512-CUrqCMaEqO1LDusv59UPqmQju3f+LpEGxFu7CydMiIvbfKDDDrf8+dF3OVU7d/ZOMRxB6hR80JsQF0SVeXPCOQ==} peerDependencies: '@graphql-mesh/types': ^0.93.1 '@graphql-mesh/utils': ^0.93.1 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/utils': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) '@graphql-tools/stitching-directives': 2.3.34(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 - dev: true + dev: false /@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): resolution: {integrity: sha512-113DuJzmR7aj2EMnLPu33ktCe5k7+Mk0BxFfmQViUH+mkr6i4JMsWvPKs9dTODSYuSuwvAZ90Vw2l3QyMrbFVA==} peerDependencies: '@graphql-mesh/store': ^0.93.1 '@graphql-tools/utils': ^9.2.1 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-mesh/store': 0.93.1(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) @@ -6825,23 +8005,42 @@ packages: '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 + dev: false - /@graphql-mesh/types@0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): - resolution: {integrity: sha512-afM2uuGR//lBoDrQvyfDmCcPwObpouRauahKVrXGyxkWe9LuIBG+scBZcynSbKotO1SgFcbJtToafMAIk5CefQ==} + /@graphql-mesh/types@0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-113DuJzmR7aj2EMnLPu33ktCe5k7+Mk0BxFfmQViUH+mkr6i4JMsWvPKs9dTODSYuSuwvAZ90Vw2l3QyMrbFVA==} + peerDependencies: + '@graphql-mesh/store': ^0.93.1 + '@graphql-tools/utils': ^9.2.1 + graphql: '*' + tslib: ^2.4.0 + dependencies: + '@graphql-mesh/store': 0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-tools/batch-delegate': 8.4.27(graphql@16.8.1) + '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) + '@graphql-tools/utils': 9.2.1(graphql@16.8.1) + '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) + graphql: 16.8.1 + tslib: 2.6.2 + dev: false + + /@graphql-mesh/types@0.95.8(@graphql-mesh/store@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-H2xh5KGc3+Ly3VdAPnRdKTibZpW9zEFgUzsozL9MQhCs6WLX+/kOADb0uIDqYFKX5c/2axmcy87BFNOausXYig==} engines: {node: '>=16.0.0'} peerDependencies: - '@graphql-mesh/store': ^0.95.7 + '@graphql-mesh/store': ^0.95.8 '@graphql-tools/utils': ^9.2.1 || ^10.0.0 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: - '@graphql-mesh/store': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/store': 0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/batch-delegate': 9.0.0(graphql@16.8.1) '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 + dev: false /@graphql-mesh/utils@0.93.2(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): resolution: {integrity: sha512-U+VytfSoqPofH/pmYZHFY10SkIFtHKrvE7Isxv1d0DiweVjdH3Qtojw13DWFpu/EKtgJY5bqoVnlcsZJYlKQoA==} @@ -6849,7 +8048,7 @@ packages: '@graphql-mesh/cross-helpers': ^0.3.4 '@graphql-mesh/types': ^0.93.2 '@graphql-tools/utils': ^9.2.1 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-mesh/cross-helpers': 0.3.4(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(react-native@0.72.6) @@ -6857,42 +8056,69 @@ packages: '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.93.1)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) - dset: 3.1.2 + dset: 3.1.3 graphql: 16.8.1 js-yaml: 4.1.0 lodash.get: 4.4.2 lodash.topath: 4.5.2 tiny-lru: 8.0.2 tslib: 2.6.2 + dev: false - /@graphql-mesh/utils@0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): - resolution: {integrity: sha512-6YQTMTrLt6m/cAdesrBgbGVSrLd+68xTo1dRIhxUFHSgucSAqA47Q8E71Lc9cLHh80HQT+/pauKHHG40csy1Ng==} + /@graphql-mesh/utils@0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-gH2/kXvxMHVWMX8DppIIZpFfSUaoKDJ6eQHFoAAsdabGE+vLtVk0OEYqMGVGtD/8ZDFa/P6CmwXc6hBzoLY6Kg==} engines: {node: '>=16.0.0'} peerDependencies: '@graphql-mesh/cross-helpers': ^0.4.1 - '@graphql-mesh/types': ^0.95.7 + '@graphql-mesh/types': ^0.95.8 '@graphql-tools/utils': ^9.2.1 || ^10.0.0 - graphql: ^16.6.0 + graphql: '*' tslib: ^2.4.0 dependencies: '@graphql-mesh/cross-helpers': 0.4.1(@graphql-tools/utils@9.2.1)(graphql@16.8.1) - '@graphql-mesh/string-interpolation': 0.5.2(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/string-interpolation': 0.5.3(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.95.8(@graphql-mesh/store@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) - '@whatwg-node/fetch': 0.9.13 - dset: 3.1.2 + '@whatwg-node/fetch': 0.9.14 + dset: 3.1.3 graphql: 16.8.1 js-yaml: 4.1.0 lodash.get: 4.4.2 lodash.topath: 4.5.2 tiny-lru: 11.2.3 tslib: 2.6.2 + dev: false + + /@graphql-mesh/utils@0.96.2(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2): + resolution: {integrity: sha512-ZlICYDHKnurIK27xtGT0gg4p/P2V8IonzEjLbRhlcEnbnC1cnqmZkqWCQqAJm4jh3q6qJwIa3CNgabNrn6k+fw==} + engines: {node: '>=16.0.0'} + peerDependencies: + '@graphql-mesh/cross-helpers': ^0.4.1 + '@graphql-mesh/types': ^0.96.2 + '@graphql-tools/utils': ^9.2.1 || ^10.0.0 + graphql: '*' + tslib: ^2.4.0 + dependencies: + '@graphql-mesh/cross-helpers': 0.4.1(@graphql-tools/utils@9.2.1)(graphql@16.8.1) + '@graphql-mesh/string-interpolation': 0.5.3(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.93.2(@graphql-mesh/store@0.96.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) + '@graphql-tools/utils': 9.2.1(graphql@16.8.1) + '@whatwg-node/fetch': 0.9.14 + dset: 3.1.3 + graphql: 16.8.1 + js-yaml: 4.1.0 + lodash.get: 4.4.2 + lodash.topath: 4.5.2 + tiny-lru: 11.2.3 + tslib: 2.6.2 + dev: false /@graphql-tools/batch-delegate@8.4.27(graphql@16.8.1): resolution: {integrity: sha512-efgDDJhljma9d3Ky/LswIu1xm/if2oS27XA1sOcxcShW+Ze+Qxi0hZZ6iyI4eQxVDX5Lyy/n+NvQEZAK1riqnQ==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) @@ -6900,12 +8126,13 @@ packages: graphql: 16.8.1 tslib: 2.6.2 value-or-promise: 1.0.12 + dev: false /@graphql-tools/batch-delegate@9.0.0(graphql@16.8.1): resolution: {integrity: sha512-23NmxcHQeKcfhMQyrRPTZfW4/+bSpAyR/qAhRjx+/hikDIa1Uv2XVgV9jIitSgM0OEk/KGPB4VQv+LCOWvAYiw==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) '@graphql-tools/utils': 10.0.7(graphql@16.8.1) @@ -6913,36 +8140,39 @@ packages: graphql: 16.8.1 tslib: 2.6.2 value-or-promise: 1.0.12 + dev: false /@graphql-tools/batch-execute@8.5.22(graphql@16.8.1): resolution: {integrity: sha512-hcV1JaY6NJQFQEwCKrYhpfLK8frSXDbtNMoTur98u10Cmecy1zrqNKSqhEyGetpgHxaJRqszGzKeI3RuroDN6A==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) dataloader: 2.2.2 graphql: 16.8.1 tslib: 2.6.2 value-or-promise: 1.0.12 + dev: false /@graphql-tools/batch-execute@9.0.2(graphql@16.8.1): resolution: {integrity: sha512-Y2uwdZI6ZnatopD/SYfZ1eGuQFI7OU2KGZ2/B/7G9ISmgMl5K+ZZWz/PfIEXeiHirIDhyk54s4uka5rj2xwKqQ==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 10.0.7(graphql@16.8.1) dataloader: 2.2.2 graphql: 16.8.1 tslib: 2.6.2 value-or-promise: 1.0.12 + dev: false - /@graphql-tools/code-file-loader@7.3.23(@babel/core@7.23.2)(graphql@16.8.1): + /@graphql-tools/code-file-loader@7.3.23(@babel/core@7.23.5)(graphql@16.8.1): resolution: {integrity: sha512-8Wt1rTtyTEs0p47uzsPJ1vAtfAx0jmxPifiNdmo9EOCuUPyQGEbMaik/YkqZ7QUFIEYEQu+Vgfo8tElwOPtx5Q==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: - '@graphql-tools/graphql-tag-pluck': 7.5.2(@babel/core@7.23.2)(graphql@16.8.1) + '@graphql-tools/graphql-tag-pluck': 7.5.2(@babel/core@7.23.5)(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) globby: 11.1.0 graphql: 16.8.1 @@ -6951,12 +8181,13 @@ packages: transitivePeerDependencies: - '@babel/core' - supports-color + dev: false /@graphql-tools/delegate@10.0.3(graphql@16.8.1): resolution: {integrity: sha512-Jor9oazZ07zuWkykD3OOhT/2XD74Zm6Ar0ENZMk75MDD51wB2UWUIMljtHxbJhV5A6UBC2v8x6iY0xdCGiIlyw==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/batch-execute': 9.0.2(graphql@16.8.1) '@graphql-tools/executor': 1.2.0(graphql@16.8.1) @@ -6965,11 +8196,12 @@ packages: dataloader: 2.2.2 graphql: 16.8.1 tslib: 2.6.2 + dev: false /@graphql-tools/delegate@9.0.35(graphql@16.8.1): resolution: {integrity: sha512-jwPu8NJbzRRMqi4Vp/5QX1vIUeUPpWmlQpOkXQD2r1X45YsVceyUUBnktCrlJlDB4jPRVy7JQGwmYo3KFiOBMA==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/batch-execute': 8.5.22(graphql@16.8.1) '@graphql-tools/executor': 0.0.20(graphql@16.8.1) @@ -6979,11 +8211,12 @@ packages: graphql: 16.8.1 tslib: 2.6.2 value-or-promise: 1.0.12 + dev: false /@graphql-tools/executor-graphql-ws@0.0.14(graphql@16.8.1): resolution: {integrity: sha512-P2nlkAsPZKLIXImFhj0YTtny5NQVGSsKnhi7PzXiaHSXc6KkzqbWZHKvikD4PObanqg+7IO58rKFpGXP7eeO+w==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) '@repeaterjs/repeater': 3.0.4 @@ -6996,12 +8229,13 @@ packages: transitivePeerDependencies: - bufferutil - utf-8-validate + dev: false /@graphql-tools/executor-graphql-ws@1.1.0(graphql@16.8.1): resolution: {integrity: sha512-yM67SzwE8rYRpm4z4AuGtABlOp9mXXVy6sxXnTJRoYIdZrmDbKVfIY+CpZUJCqS0FX3xf2+GoHlsj7Qswaxgcg==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 10.0.7(graphql@16.8.1) '@types/ws': 8.5.8 @@ -7015,35 +8249,36 @@ packages: - utf-8-validate dev: false - /@graphql-tools/executor-http@0.1.10(@types/node@18.18.6)(graphql@16.8.1): + /@graphql-tools/executor-http@0.1.10(@types/node@18.18.7)(graphql@16.8.1): resolution: {integrity: sha512-hnAfbKv0/lb9s31LhWzawQ5hghBfHS+gYWtqxME6Rl0Aufq9GltiiLBcl7OVVOnkLF0KhwgbYP1mB5VKmgTGpg==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) '@repeaterjs/repeater': 3.0.4 '@whatwg-node/fetch': 0.8.8 - dset: 3.1.2 + dset: 3.1.3 extract-files: 11.0.0 graphql: 16.8.1 - meros: 1.3.0(@types/node@18.18.6) + meros: 1.3.0(@types/node@18.18.7) tslib: 2.6.2 value-or-promise: 1.0.12 transitivePeerDependencies: - '@types/node' + dev: false - /@graphql-tools/executor-http@1.0.3(@types/node@18.18.6)(graphql@16.8.1): + /@graphql-tools/executor-http@1.0.3(@types/node@18.18.7)(graphql@16.8.1): resolution: {integrity: sha512-5WZIMBevRaxMabZ8U2Ty0dTUPy/PpeYSlMNEmC/YJjKKykgSfc/AwSejx2sE4FFKZ0I2kxRKRenyoWMHRAV49Q==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 10.0.7(graphql@16.8.1) '@repeaterjs/repeater': 3.0.4 - '@whatwg-node/fetch': 0.9.13 + '@whatwg-node/fetch': 0.9.14 extract-files: 11.0.0 graphql: 16.8.1 - meros: 1.3.0(@types/node@18.18.6) + meros: 1.3.0(@types/node@18.18.7) tslib: 2.6.2 value-or-promise: 1.0.12 transitivePeerDependencies: @@ -7053,7 +8288,7 @@ packages: /@graphql-tools/executor-legacy-ws@0.0.11(graphql@16.8.1): resolution: {integrity: sha512-4ai+NnxlNfvIQ4c70hWFvOZlSUN8lt7yc+ZsrwtNFbFPH/EroIzFMapAxM9zwyv9bH38AdO3TQxZ5zNxgBdvUw==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) '@types/ws': 8.5.8 @@ -7064,12 +8299,13 @@ packages: transitivePeerDependencies: - bufferutil - utf-8-validate + dev: false /@graphql-tools/executor-legacy-ws@1.0.4(graphql@16.8.1): resolution: {integrity: sha512-b7aGuRekZDS+m3af3BIvMKxu15bmVPMt5eGQVuP2v5pxmbaPTh+iv5mx9b3Plt32z5Ke5tycBnNm5urSFtW8ng==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 10.0.7(graphql@16.8.1) '@types/ws': 8.5.8 @@ -7085,7 +8321,7 @@ packages: /@graphql-tools/executor@0.0.18(graphql@16.8.1): resolution: {integrity: sha512-xZC0C+/npXoSHBB5bsJdwxDLgtl1Gu4fL9J2TPQmXoZC3L2N506KJoppf9LgWdHU/xK04luJrhP6WjhfkIN0pQ==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) @@ -7093,11 +8329,12 @@ packages: graphql: 16.8.1 tslib: 2.6.2 value-or-promise: 1.0.12 + dev: false /@graphql-tools/executor@0.0.20(graphql@16.8.1): resolution: {integrity: sha512-GdvNc4vszmfeGvUqlcaH1FjBoguvMYzxAfT6tDd4/LgwymepHhinqLNA5otqwVLW+JETcDaK7xGENzFomuE6TA==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) @@ -7105,12 +8342,13 @@ packages: graphql: 16.8.1 tslib: 2.6.2 value-or-promise: 1.0.12 + dev: false /@graphql-tools/executor@1.2.0(graphql@16.8.1): resolution: {integrity: sha512-SKlIcMA71Dha5JnEWlw4XxcaJ+YupuXg0QCZgl2TOLFz4SkGCwU/geAsJvUJFwK2RbVLpQv/UMq67lOaBuwDtg==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 10.0.7(graphql@16.8.1) '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) @@ -7118,15 +8356,16 @@ packages: graphql: 16.8.1 tslib: 2.6.2 value-or-promise: 1.0.12 + dev: false - /@graphql-tools/federation@1.1.10(@types/node@18.18.6)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0): + /@graphql-tools/federation@1.1.10(@types/node@18.18.7)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-H51qTYwbtfIYBO1uHXlImRWzo9tknSoIGBgJckDh+hdxJx43sZaMjJiLHc2DjRc/A8d2Bf0bi0HbH++HqOos/w==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) - '@graphql-tools/executor-http': 1.0.3(@types/node@18.18.6)(graphql@16.8.1) + '@graphql-tools/executor-http': 1.0.3(@types/node@18.18.7)(graphql@16.8.1) '@graphql-tools/merge': 9.0.0(graphql@16.8.1) '@graphql-tools/schema': 10.0.0(graphql@16.8.1) '@graphql-tools/stitch': 9.0.3(graphql@16.8.1) @@ -7148,7 +8387,7 @@ packages: /@graphql-tools/graphql-file-loader@7.5.17(graphql@16.8.1): resolution: {integrity: sha512-hVwwxPf41zOYgm4gdaZILCYnKB9Zap7Ys9OhY1hbwuAuC4MMNY9GpUjoTU3CQc3zUiPoYStyRtUGkHSJZ3HxBw==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/import': 6.7.18(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) @@ -7156,14 +8395,15 @@ packages: graphql: 16.8.1 tslib: 2.6.2 unixify: 1.0.0 + dev: false - /@graphql-tools/graphql-tag-pluck@7.5.2(@babel/core@7.23.2)(graphql@16.8.1): + /@graphql-tools/graphql-tag-pluck@7.5.2(@babel/core@7.23.5)(graphql@16.8.1): resolution: {integrity: sha512-RW+H8FqOOLQw0BPXaahYepVSRjuOHw+7IL8Opaa5G5uYGOBxoXR7DceyQ7BcpMgktAOOmpDNQ2WtcboChOJSRA==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@babel/parser': 7.23.0 - '@babel/plugin-syntax-import-assertions': 7.22.5(@babel/core@7.23.2) + '@babel/plugin-syntax-import-assertions': 7.22.5(@babel/core@7.23.5) '@babel/traverse': 7.23.2 '@babel/types': 7.23.0 '@graphql-tools/utils': 9.2.1(graphql@16.8.1) @@ -7172,59 +8412,76 @@ packages: transitivePeerDependencies: - '@babel/core' - supports-color + dev: false /@graphql-tools/import@6.7.18(graphql@16.8.1): resolution: {integrity: sha512-XQDdyZTp+FYmT7as3xRWH/x8dx0QZA2WZqfMF5EWb36a0PiH7WwlRQYIdyYXj8YCLpiWkeBXgBRHmMnwEYR8iQ==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 resolve-from: 5.0.0 tslib: 2.6.2 + dev: false /@graphql-tools/load@7.8.14(graphql@16.8.1): resolution: {integrity: sha512-ASQvP+snHMYm+FhIaLxxFgVdRaM0vrN9wW2BKInQpktwWTXVyk+yP5nQUCEGmn0RTdlPKrffBaigxepkEAJPrg==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/schema': 9.0.19(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 p-limit: 3.1.0 tslib: 2.6.2 + dev: false /@graphql-tools/merge@8.4.2(graphql@16.8.1): resolution: {integrity: sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 + dev: false /@graphql-tools/merge@9.0.0(graphql@16.8.1): resolution: {integrity: sha512-J7/xqjkGTTwOJmaJQJ2C+VDBDOWJL3lKrHJN4yMaRLAJH3PosB7GiPRaSDZdErs0+F77sH2MKs2haMMkywzx7Q==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/utils': 10.0.7(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 + dev: false + + /@graphql-tools/merge@9.0.1(graphql@16.8.1): + resolution: {integrity: sha512-hIEExWO9fjA6vzsVjJ3s0cCQ+Q/BEeMVJZtMXd7nbaVefVy0YDyYlEkeoYYNV3NVVvu1G9lr6DM1Qd0DGo9Caw==} + engines: {node: '>=16.0.0'} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/utils': 10.0.11(graphql@16.8.1) + graphql: 16.8.1 + tslib: 2.6.2 + dev: false /@graphql-tools/optimize@1.4.0(graphql@16.8.1): resolution: {integrity: sha512-dJs/2XvZp+wgHH8T5J2TqptT9/6uVzIYvA6uFACha+ufvdMBedkfR4b4GbT8jAKLRARiqRTxy3dctnwkTM2tdw==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: graphql: 16.8.1 tslib: 2.6.2 + dev: false /@graphql-tools/relay-operation-optimizer@6.5.18(graphql@16.8.1): resolution: {integrity: sha512-mc5VPyTeV+LwiM+DNvoDQfPqwQYhPV/cl5jOBjTgSniyaq8/86aODfMkrE2OduhQ5E00hqrkuL2Fdrgk0w1QJg==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@ardatan/relay-compiler': 12.0.0(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) @@ -7233,34 +8490,50 @@ packages: transitivePeerDependencies: - encoding - supports-color + dev: false /@graphql-tools/schema@10.0.0(graphql@16.8.1): resolution: {integrity: sha512-kf3qOXMFcMs2f/S8Y3A8fm/2w+GaHAkfr3Gnhh2LOug/JgpY/ywgFVxO3jOeSpSEdoYcDKLcXVjMigNbY4AdQg==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/merge': 9.0.0(graphql@16.8.1) '@graphql-tools/utils': 10.0.7(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 value-or-promise: 1.0.12 + dev: false + + /@graphql-tools/schema@10.0.2(graphql@16.8.1): + resolution: {integrity: sha512-TbPsIZnWyDCLhgPGnDjt4hosiNU2mF/rNtSk5BVaXWnZqvKJ6gzJV4fcHcvhRIwtscDMW2/YTnK6dLVnk8pc4w==} + engines: {node: '>=16.0.0'} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/merge': 9.0.1(graphql@16.8.1) + '@graphql-tools/utils': 10.0.11(graphql@16.8.1) + graphql: 16.8.1 + tslib: 2.6.2 + value-or-promise: 1.0.12 + dev: false /@graphql-tools/schema@9.0.19(graphql@16.8.1): resolution: {integrity: sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/merge': 8.4.2(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 value-or-promise: 1.0.12 + dev: false /@graphql-tools/stitch@8.7.50(graphql@16.8.1): resolution: {integrity: sha512-VB1/uZyXjj1P5Wj0c4EKX3q8Q1Maj4dy6uNwodEPaO3EHMpaJU/DqyN0Bvnhxu0ol7RzdY3kgsvsdUjU2QMImw==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/batch-delegate': 8.4.27(graphql@16.8.1) '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) @@ -7272,12 +8545,13 @@ packages: graphql: 16.8.1 tslib: 2.6.2 value-or-promise: 1.0.12 + dev: false /@graphql-tools/stitch@9.0.3(graphql@16.8.1): resolution: {integrity: sha512-G03XahiHDu1pnaS8z2GNfsV/5BribMEUATT5dCHBAqj13Te5y1amZNQePrmw8DLtbf5qDbU6CO7kGHPxv0XO9A==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/batch-delegate': 9.0.0(graphql@16.8.1) '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) @@ -7294,22 +8568,23 @@ packages: /@graphql-tools/stitching-directives@2.3.34(graphql@16.8.1): resolution: {integrity: sha512-DVlo1/SW9jN6jN1IL279c7voEJiEHsLbYRD7tYsAW472zrHqn0rpB6jRzZDzLOlCpm7JRWPsegXVlkqf0qvqFQ==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 + dev: false - /@graphql-tools/url-loader@7.17.18(@types/node@18.18.6)(graphql@16.8.1): + /@graphql-tools/url-loader@7.17.18(@types/node@18.18.7)(graphql@16.8.1): resolution: {integrity: sha512-ear0CiyTj04jCVAxi7TvgbnGDIN2HgqzXzwsfcqiVg9cvjT40NcMlZ2P1lZDgqMkZ9oyLTV8Bw6j+SyG6A+xPw==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@ardatan/sync-fetch': 0.0.1 '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) '@graphql-tools/executor-graphql-ws': 0.0.14(graphql@16.8.1) - '@graphql-tools/executor-http': 0.1.10(@types/node@18.18.6)(graphql@16.8.1) + '@graphql-tools/executor-http': 0.1.10(@types/node@18.18.7)(graphql@16.8.1) '@graphql-tools/executor-legacy-ws': 0.0.11(graphql@16.8.1) '@graphql-tools/utils': 9.2.1(graphql@16.8.1) '@graphql-tools/wrap': 9.4.2(graphql@16.8.1) @@ -7325,22 +8600,23 @@ packages: - bufferutil - encoding - utf-8-validate + dev: false - /@graphql-tools/url-loader@8.0.0(@types/node@18.18.6)(graphql@16.8.1): + /@graphql-tools/url-loader@8.0.0(@types/node@18.18.7)(graphql@16.8.1): resolution: {integrity: sha512-rPc9oDzMnycvz+X+wrN3PLrhMBQkG4+sd8EzaFN6dypcssiefgWKToXtRKI8HHK68n2xEq1PyrOpkjHFJB+GwA==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@ardatan/sync-fetch': 0.0.1 '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) '@graphql-tools/executor-graphql-ws': 1.1.0(graphql@16.8.1) - '@graphql-tools/executor-http': 1.0.3(@types/node@18.18.6)(graphql@16.8.1) + '@graphql-tools/executor-http': 1.0.3(@types/node@18.18.7)(graphql@16.8.1) '@graphql-tools/executor-legacy-ws': 1.0.4(graphql@16.8.1) '@graphql-tools/utils': 10.0.7(graphql@16.8.1) '@graphql-tools/wrap': 10.0.1(graphql@16.8.1) '@types/ws': 8.5.8 - '@whatwg-node/fetch': 0.9.13 + '@whatwg-node/fetch': 0.9.14 graphql: 16.8.1 isomorphic-ws: 5.0.0(ws@8.14.2) tslib: 2.6.2 @@ -7353,39 +8629,55 @@ packages: - utf-8-validate dev: false + /@graphql-tools/utils@10.0.11(graphql@16.8.1): + resolution: {integrity: sha512-vVjXgKn6zjXIlYBd7yJxCVMYGb5j18gE3hx3Qw3mNsSEsYQXbJbPdlwb7Fc9FogsJei5AaqiQerqH4kAosp1nQ==} + engines: {node: '>=16.0.0'} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) + cross-inspect: 1.0.0 + dset: 3.1.3 + graphql: 16.8.1 + tslib: 2.6.2 + dev: false + /@graphql-tools/utils@10.0.7(graphql@16.8.1): resolution: {integrity: sha512-KOdeMj6Hd/MENDaqPbws3YJl3wVy0DeYnL7PyUms5Skyf7uzI9INynDwPMhLXfSb0/ph6BXTwMd5zBtWbF8tBQ==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) - dset: 3.1.2 + dset: 3.1.3 graphql: 16.8.1 tslib: 2.6.2 + dev: false /@graphql-tools/utils@8.13.1(graphql@16.8.1): resolution: {integrity: sha512-qIh9yYpdUFmctVqovwMdheVNJqFh+DQNWIhX87FJStfXYnmweBUDATok9fWPleKeFwxnW8IapKmY8m8toJEkAw==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: graphql: 16.8.1 tslib: 2.6.2 + dev: false /@graphql-tools/utils@9.2.1(graphql@16.8.1): resolution: {integrity: sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) graphql: 16.8.1 tslib: 2.6.2 + dev: false /@graphql-tools/wrap@10.0.1(graphql@16.8.1): resolution: {integrity: sha512-Cw6hVrKGM2OKBXeuAGltgy4tzuqQE0Nt7t/uAqnuokSXZhMHXJUb124Bnvxc2gPZn5chfJSDafDe4Cp8ZAVJgg==} engines: {node: '>=16.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/delegate': 10.0.3(graphql@16.8.1) '@graphql-tools/schema': 10.0.0(graphql@16.8.1) @@ -7398,7 +8690,7 @@ packages: /@graphql-tools/wrap@9.4.2(graphql@16.8.1): resolution: {integrity: sha512-DFcd9r51lmcEKn0JW43CWkkI2D6T9XI1juW/Yo86i04v43O9w2/k4/nx2XTJv4Yv+iXwUw7Ok81PGltwGJSDSA==} peerDependencies: - graphql: ^16.6.0 + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@graphql-tools/delegate': 9.0.35(graphql@16.8.1) '@graphql-tools/schema': 9.0.19(graphql@16.8.1) @@ -7406,18 +8698,21 @@ packages: graphql: 16.8.1 tslib: 2.6.2 value-or-promise: 1.0.12 + dev: false /@graphql-typed-document-node/core@3.2.0(graphql@16.8.1): resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: graphql: 16.8.1 + dev: false /@graphql-yoga/logger@0.0.1: resolution: {integrity: sha512-6npFz7eZz33mXgSm1waBLMjUNG0D5hTc/p5Hcs1mojkT3KsLpCOFokzTEKboNsBhKevYcaVa/xeA7WBj4UYMLg==} dependencies: tslib: 2.6.2 + dev: false /@graphql-yoga/logger@2.0.0: resolution: {integrity: sha512-Mg8psdkAp+YTG1OGmvU+xa6xpsAmSir0hhr3yFYPyLNwzUj95DdIwsMpKadDj9xDpYgJcH3Hp/4JMal9DhQimA==} @@ -7433,6 +8728,7 @@ packages: '@repeaterjs/repeater': 3.0.4 '@whatwg-node/events': 0.0.2 tslib: 2.6.2 + dev: false /@graphql-yoga/subscription@5.0.0: resolution: {integrity: sha512-Ri7sK8hmxd/kwaEa0YT8uqQUb2wOLsmBMxI90QDyf96lzOMJRgBuNYoEkU1pSgsgmW2glceZ96sRYfaXqwVxUw==} @@ -7449,6 +8745,7 @@ packages: dependencies: '@repeaterjs/repeater': 3.0.4 tslib: 2.6.2 + dev: false /@graphql-yoga/typed-event-target@3.0.0: resolution: {integrity: sha512-w+liuBySifrstuHbFrHoHAEyVnDFVib+073q8AeAJ/qqJfvFvAwUPLLtNohR/WDVRgSasfXtl3dcNuVJWN+rjg==} @@ -7475,7 +8772,6 @@ packages: minimatch: 3.1.2 transitivePeerDependencies: - supports-color - dev: true /@humanwhocodes/config-array@0.9.5: resolution: {integrity: sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==} @@ -7491,7 +8787,6 @@ packages: /@humanwhocodes/module-importer@1.0.1: resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - dev: true /@humanwhocodes/object-schema@1.2.1: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} @@ -7499,59 +8794,78 @@ packages: /@humanwhocodes/object-schema@2.0.1: resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} - dev: true /@hypercerts-org/contracts@0.8.11: resolution: {integrity: sha512-n6fwMsaoR50VITM2upR4OOi4EZJmZvU6vvXrHWCSakP9e1OeDuAOk+kHiK+egqDRYj6uKtg9VTUFKZBYvu3jRg==} dev: false - /@hypercerts-org/sdk@0.8.16(@envelop/core@3.0.6)(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(@graphql-tools/delegate@9.0.35)(@graphql-tools/merge@8.4.2)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(@types/node@18.18.6)(node-fetch@3.3.2)(react-dom@18.2.0)(react@18.2.0)(tslib@2.6.2)(typescript@5.1.6)(uint8arraylist@2.4.3): - resolution: {integrity: sha512-WkxYb5RYhv3QI7+N5y4xg5IL4azLqCq4ia1/bgFB55vWJLjnmoMj3VYbiybMxyfgnPfh5O8n2DU86u8ClLgyhg==} + /@hypercerts-org/contracts@1.0.0-alpha.2(typescript@5.1.6): + resolution: {integrity: sha512-I9TMEyN4cKW3Gfv3Wysk9xoZzwpUjI+dgCECJVjBlInRiCxnaUdahBSqhVvKg1gViWaPMDvDGe5v9jVknZIN/A==} + dependencies: + hardhat: 2.18.3(typescript@5.1.6) + transitivePeerDependencies: + - bufferutil + - supports-color + - ts-node + - typescript + - utf-8-validate + dev: false + + /@hypercerts-org/contracts@1.0.0-alpha.6(ts-node@10.9.1)(typescript@5.3.2): + resolution: {integrity: sha512-8XV9jlj5P+WL+hFX56OP+cYpLDwicZoGteN3ZAPHc1Y07fy7I2tpx1/MU7Sg2GX2nVO46Xix1MblQxVzx0Xy8Q==} + dependencies: + hardhat: 2.18.3(ts-node@10.9.1)(typescript@5.3.2) + transitivePeerDependencies: + - bufferutil + - supports-color + - ts-node + - typescript + - utf-8-validate + dev: false + + /@hypercerts-org/sdk@1.0.0-alpha.10(@envelop/core@3.0.6)(@graphql-tools/delegate@9.0.35)(@graphql-tools/merge@8.4.2)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(@types/node@18.18.7)(node-fetch@3.3.2)(react-dom@18.2.0)(react@18.2.0)(tslib@2.6.2)(typescript@5.1.6)(uint8arraylist@2.4.3)(zod@3.22.4): + resolution: {integrity: sha512-PEGKxzxhGZuz0cjYCCj90+bBmbfU4n1mP+q911Kx6jZ0g5sQyj+m685x0cq8OIL4JnYNPShZ2OWDjcX93KzbBA==} dependencies: - '@ethereum-attestation-service/eas-sdk': 0.28.3(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(typescript@5.1.6) + '@ethereum-attestation-service/eas-sdk': 1.2.2-beta.0(typescript@5.1.6) '@ethersproject/abstract-signer': 5.7.0 - '@graphprotocol/client-add-source-name': 1.0.20(@graphql-mesh/types@0.95.7)(@graphql-tools/delegate@9.0.35)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(graphql@16.8.1) + '@graphprotocol/client-add-source-name': 1.0.20(@graphql-mesh/types@0.95.8)(@graphql-tools/delegate@9.0.35)(@graphql-tools/utils@9.2.1)(@graphql-tools/wrap@9.4.2)(graphql@16.8.1) '@graphprotocol/client-polling-live': 2.0.0(@envelop/core@3.0.6)(@graphql-tools/merge@8.4.2)(graphql@16.8.1) - '@graphql-mesh/cache-localforage': 0.95.7(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/cache-localforage': 0.95.8(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(graphql@16.8.1)(tslib@2.6.2) '@graphql-mesh/cross-helpers': 0.4.1(@graphql-tools/utils@9.2.1)(graphql@16.8.1) - '@graphql-mesh/graphql': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.95.7)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(@types/node@18.18.6)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0)(tslib@2.6.2) - '@graphql-mesh/http': 0.96.13(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/runtime@0.96.12)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/merger-bare': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/runtime': 0.96.12(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/store': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-mesh/utils@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/types': 0.95.7(@graphql-mesh/store@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) - '@graphql-mesh/utils': 0.95.7(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.7)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/graphql': 0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/store@0.95.8)(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(@graphql-tools/utils@9.2.1)(@types/node@18.18.7)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0)(tslib@2.6.2) + '@graphql-mesh/http': 0.96.14(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/runtime@0.96.13)(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/merger-bare': 0.95.8(@graphql-mesh/store@0.95.8)(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/runtime': 0.96.13(@graphql-mesh/cross-helpers@0.3.4)(@graphql-mesh/types@0.93.2)(@graphql-mesh/utils@0.93.2)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/store': 0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/types': 0.95.8(@graphql-mesh/store@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) + '@graphql-mesh/utils': 0.95.8(@graphql-mesh/cross-helpers@0.4.1)(@graphql-mesh/types@0.95.8)(@graphql-tools/utils@9.2.1)(graphql@16.8.1)(tslib@2.6.2) '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) - '@hypercerts-org/contracts': 0.8.11 + '@hypercerts-org/contracts': 1.0.0-alpha.2(typescript@5.1.6) '@openzeppelin/merkle-tree': 1.0.5 - '@whatwg-node/fetch': 0.9.13 + '@whatwg-node/fetch': 0.9.14 ajv: 8.12.0 axios: 1.5.1(debug@4.3.4) dotenv: 16.3.1 ethers: 5.7.2 graphql: 16.8.1 ipfs-core: 0.17.0(uint8arraylist@2.4.3) - jest: 29.7.0(@types/node@18.18.6)(ts-node@10.9.1) loglevel: 1.8.1 mime: 3.0.0 nft.storage: 7.1.1(node-fetch@3.3.2) + viem: 1.19.9(typescript@5.1.6)(zod@3.22.4) web3.storage: 4.5.5(node-fetch@3.3.2) transitivePeerDependencies: - '@envelop/core' - - '@ethersproject/abi' - - '@ethersproject/providers' - '@graphql-tools/delegate' - '@graphql-tools/merge' - '@graphql-tools/utils' - '@graphql-tools/wrap' - '@types/node' - - babel-plugin-macros - bufferutil - debug - encoding - graphql-ws - node-fetch - - node-notifier - react - react-dom - subscriptions-transport-ws @@ -7561,6 +8875,7 @@ packages: - typescript - uint8arraylist - utf-8-validate + - zod dev: false /@iarna/toml@2.2.5: @@ -7580,8 +8895,8 @@ packages: engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: '@ipld/dag-cbor': 9.0.6 - cborg: 4.0.4 - multiformats: 12.1.2 + cborg: 4.0.5 + multiformats: 12.1.3 varint: 6.0.0 dev: false @@ -7610,8 +8925,8 @@ packages: resolution: {integrity: sha512-3kNab5xMppgWw6DVYx2BzmFq8t7I56AGWfp5kaU1fIPkwHVpBRglJJTYsGtbVluCi/s/q97HZM3bC+aDW4sxbQ==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: - cborg: 4.0.4 - multiformats: 12.1.2 + cborg: 4.0.5 + multiformats: 12.1.3 dev: false /@ipld/dag-json@8.0.11: @@ -7661,23 +8976,26 @@ packages: get-package-type: 0.1.0 js-yaml: 3.14.1 resolve-from: 5.0.0 + dev: true /@istanbuljs/schema@0.1.3: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} + dev: true /@jest/console@29.7.0: resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 chalk: 4.1.2 jest-message-util: 29.7.0 jest-util: 29.7.0 slash: 3.0.0 + dev: true - /@jest/core@29.7.0(ts-node@10.9.1): + /@jest/core@29.7.0: resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -7691,14 +9009,14 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@18.18.6)(ts-node@10.9.1) + jest-config: 29.7.0(@types/node@18.18.7) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -7718,12 +9036,14 @@ packages: - babel-plugin-macros - supports-color - ts-node + dev: true /@jest/create-cache-key-function@29.7.0: resolution: {integrity: sha512-4QqS3LY5PBmTRHj9sAg1HLoPzqAI0uOX6wI/TRqHIcOxlFidy6YEmCQJk6FSZjNLGCeubDMfmkWL+qaLKhSGQA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 + dev: false /@jest/environment@29.7.0: resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} @@ -7731,7 +9051,7 @@ packages: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 jest-mock: 29.7.0 /@jest/expect-utils@29.7.0: @@ -7739,6 +9059,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: jest-get-type: 29.6.3 + dev: true /@jest/expect@29.7.0: resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} @@ -7748,6 +9069,7 @@ packages: jest-snapshot: 29.7.0 transitivePeerDependencies: - supports-color + dev: true /@jest/fake-timers@29.7.0: resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} @@ -7755,7 +9077,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 18.18.6 + '@types/node': 18.18.7 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -7770,6 +9092,7 @@ packages: jest-mock: 29.7.0 transitivePeerDependencies: - supports-color + dev: true /@jest/reporters@29.7.0: resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==} @@ -7786,7 +9109,7 @@ packages: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.20 - '@types/node': 18.18.6 + '@types/node': 18.18.7 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -7806,6 +9129,7 @@ packages: v8-to-istanbul: 9.1.3 transitivePeerDependencies: - supports-color + dev: true /@jest/schemas@29.6.3: resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} @@ -7820,6 +9144,7 @@ packages: '@jridgewell/trace-mapping': 0.3.20 callsites: 3.1.0 graceful-fs: 4.2.11 + dev: true /@jest/test-result@29.7.0: resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==} @@ -7829,6 +9154,7 @@ packages: '@jest/types': 29.6.3 '@types/istanbul-lib-coverage': 2.0.5 collect-v8-coverage: 1.0.2 + dev: true /@jest/test-sequencer@29.7.0: resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==} @@ -7838,12 +9164,13 @@ packages: graceful-fs: 4.2.11 jest-haste-map: 29.7.0 slash: 3.0.0 + dev: true /@jest/transform@29.7.0: resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.20 babel-plugin-istanbul: 6.1.1 @@ -7860,6 +9187,7 @@ packages: write-file-atomic: 4.0.2 transitivePeerDependencies: - supports-color + dev: true /@jest/types@26.6.2: resolution: {integrity: sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==} @@ -7867,7 +9195,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.5 '@types/istanbul-reports': 3.0.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 '@types/yargs': 15.0.17 chalk: 4.1.2 @@ -7877,9 +9205,10 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.5 '@types/istanbul-reports': 3.0.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 '@types/yargs': 16.0.7 chalk: 4.1.2 + dev: false /@jest/types@29.6.3: resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} @@ -7888,7 +9217,7 @@ packages: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.5 '@types/istanbul-reports': 3.0.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 '@types/yargs': 17.0.29 chalk: 4.1.2 @@ -8342,14 +9671,14 @@ packages: - supports-color dev: false - /@libp2p/interface@0.1.3: - resolution: {integrity: sha512-C1O7Xqd2TGVWrIOEDx6kGJSk4YOysWGmYG5Oh3chnsCY0wjUSsLDpl9+wKrdiM/lJbAlHlV65ZOvSkIQ9cWPBQ==} + /@libp2p/interface@0.1.4: + resolution: {integrity: sha512-Pk8mzit/w7PbTh28n77RDLTU1CQBBzLygiNC07MvcEjaIwqXdNPN3Vuzr/5qiF6aDsbM9fA1W5dWoCif9xBdxg==} dependencies: '@multiformats/multiaddr': 12.1.7 abortable-iterator: 5.0.1 it-pushable: 3.2.1 it-stream-types: 2.0.1 - multiformats: 12.1.2 + multiformats: 12.1.3 p-defer: 4.0.0 race-signal: 1.0.1 uint8arraylist: 2.4.3 @@ -8428,14 +9757,14 @@ packages: - supports-color dev: false - /@libp2p/logger@3.0.3: - resolution: {integrity: sha512-85ioPX10QN4ZOZeurAZe5sQeRUCkIBT2DikKRbE/AIWKauIKHvvIrN4CSdCdzLw29XNA+xxNO2FVkf51HGgCeQ==} + /@libp2p/logger@3.0.4: + resolution: {integrity: sha512-MF42c7SOJIx5YmHhIsFaSYfaC266YYmMbAJHjjH8Zl5unFsqW82M+Xr7sGVj9/WXrWAd37ts8xJaQrkIXc3OZQ==} dependencies: - '@libp2p/interface': 0.1.3 + '@libp2p/interface': 0.1.4 '@multiformats/multiaddr': 12.1.7 debug: 4.3.4(supports-color@8.1.1) interface-datastore: 8.2.5 - multiformats: 12.1.2 + multiformats: 12.1.3 transitivePeerDependencies: - supports-color dev: false @@ -8812,6 +10141,11 @@ packages: '@lit-labs/ssr-dom-shim': 1.1.2 dev: false + /@looksrare/contracts-libs@3.4.0: + resolution: {integrity: sha512-tRFHcz9D4J0PLQg4ETWlvlRqrHpEoZhKsCTbyqATDXmekXvxbgk8+sRtaZK9Zo4gHpt6x+TcOgdUdARCg2elWg==} + engines: {node: '>=8.3.0'} + dev: true + /@mdx-js/mdx@1.6.22: resolution: {integrity: sha512-AMxuLxPz2j5/6TpF/XSdKpQP1NlG0z11dFOlq+2IP/lSgl11GY8ji6S/rgsViN/L0BDvHvUMruRb7ub+24LUYA==} dependencies: @@ -8860,8 +10194,8 @@ packages: tweetnacl: 1.0.3 tweetnacl-util: 0.15.1 - /@metamask/object-multiplex@1.2.0: - resolution: {integrity: sha512-hksV602d3NWE2Q30Mf2Np1WfVKaGqfJRy9vpHAmelbaD0OkDt06/0KQkRR6UVYdMbTbkuEu8xN5JDUU80inGwQ==} + /@metamask/object-multiplex@1.3.0: + resolution: {integrity: sha512-czcQeVYdSNtabd+NcYQnrM69MciiJyd1qvKH8WM2Id3C0ZiUUX5Xa/MK+/VUk633DBhVOwdNzAKIQ33lGyA+eQ==} engines: {node: '>=12.0.0'} dependencies: end-of-stream: 1.4.4 @@ -8873,10 +10207,10 @@ packages: resolution: {integrity: sha512-xjE4cKrGpKZjripkMKMStc0H4LXrWJPijfbaj1kKeDLVhRH2Yu3ZecV3iIhf1EIJePeA+Kx6Pcm7d0IVJ+ea7g==} engines: {node: '>=16.0.0'} dependencies: - '@metamask/object-multiplex': 1.2.0 + '@metamask/object-multiplex': 1.3.0 '@metamask/safe-event-emitter': 3.0.0 detect-browser: 5.3.0 - eth-rpc-errors: 4.0.2 + eth-rpc-errors: 4.0.3 extension-port-stream: 2.1.1 fast-deep-equal: 3.1.3 is-stream: 2.0.1 @@ -9139,32 +10473,8 @@ packages: tslib: 2.6.2 dev: false - /@mswjs/cookies@0.2.2: - resolution: {integrity: sha512-mlN83YSrcFgk7Dm1Mys40DLssI1KdJji2CMKN8eOlBqsTADYzj2+jWzsANsUTFbxDMWPD5e9bfA1RGqBpS3O1g==} - engines: {node: '>=14'} - dependencies: - '@types/set-cookie-parser': 2.4.5 - set-cookie-parser: 2.6.0 - dev: true - - /@mswjs/interceptors@0.17.10: - resolution: {integrity: sha512-N8x7eSLGcmUFNWZRxT1vsHvypzIRgQYdG0rJey/rZCy6zT/30qDt8Joj7FxzGNLSwXbeZqJOMqDurp7ra4hgbw==} - engines: {node: '>=14'} - dependencies: - '@open-draft/until': 1.0.3 - '@types/debug': 4.1.10 - '@xmldom/xmldom': 0.8.10 - debug: 4.3.4(supports-color@8.1.1) - headers-polyfill: 3.2.5 - outvariant: 1.4.0 - strict-event-emitter: 0.2.8 - web-encoding: 1.1.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@mui/base@5.0.0-beta.20(@types/react@18.2.31)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-CS2pUuqxST7ch9VNDCklRYDbJ3rru20Tx7na92QvVVKfu3RL4z/QLuVIc8jYGsdCnauMaeUSlFNLAJNb0yXe6w==} + /@mui/base@5.0.0-beta.21(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-eTKWx3WV/nwmRUK4z4K1MzlMyWCsi3WJ3RtV4DiXZeRh4qd4JCyp1Zzzi8Wv9xM4dEBmqQntFoei716PzwmFfA==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -9176,22 +10486,22 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@floating-ui/react-dom': 2.0.2(react-dom@18.2.0)(react@18.2.0) - '@mui/types': 7.2.6(@types/react@18.2.31) - '@mui/utils': 5.14.14(@types/react@18.2.31)(react@18.2.0) + '@mui/types': 7.2.7(@types/react@18.2.33) + '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) '@popperjs/core': 2.11.8 - '@types/react': 18.2.31 + '@types/react': 18.2.33 clsx: 2.0.0 prop-types: 15.8.1 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@mui/core-downloads-tracker@5.14.14: - resolution: {integrity: sha512-Rw/xKiTOUgXD8hdKqj60aC6QcGprMipG7ne2giK6Mz7b4PlhL/xog9xLeclY3BxsRLkZQ05egFnIEY1CSibTbw==} + /@mui/core-downloads-tracker@5.14.15: + resolution: {integrity: sha512-ZCDzBWtCKjAYAlKKM3PA/jG/3uVIDT9ZitOtVixIVmTCQyc5jSV1qhJX8+qIGz4RQZ9KLzPWO2tXd0O5hvzouQ==} dev: false - /@mui/icons-material@5.14.14(@mui/material@5.14.14)(@types/react@18.2.31)(react@18.2.0): - resolution: {integrity: sha512-vwuaMsKvI7AWTeYqR8wYbpXijuU8PzMAJWRAq2DDIuOZPxjKyHlr8WQ25+azZYkIXtJ7AqnVb1ZmHdEyB4/kug==} + /@mui/icons-material@5.14.15(@mui/material@5.14.15)(@types/react@18.2.33)(react@18.2.0): + resolution: {integrity: sha512-Dqu21vN/mVNzebJ+ofnKG+CeJYIhHuDs5+0fMEpdpzRt6UojelzdrEkNv+XkO0e1JMclzeXIRx404FirK/CFRw==} engines: {node: '>=12.0.0'} peerDependencies: '@mui/material': ^5.0.0 @@ -9202,13 +10512,13 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@mui/material': 5.14.14(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.31)(react-dom@18.2.0)(react@18.2.0) - '@types/react': 18.2.31 + '@mui/material': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@types/react': 18.2.33 react: 18.2.0 dev: false - /@mui/material@5.14.14(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.31)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cAmCwAHFQXxb44kWbVFkhKATN8tACgMsFwrXo8ro6WzYW73U/qsR5AcCiJIhCyYYg+gcftfkmNcpRaV3JjhHCg==} + /@mui/material@5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-Gq65rHjvLzkxmhG8bvag851Oqsmru7qkUb/cCI2xu7dQzmY345f9xJRJi72sRGjhaqHXWeRKw/yIwp/7oQoeXg==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 @@ -9225,14 +10535,14 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@emotion/react': 11.11.1(@types/react@18.2.31)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.31)(react@18.2.0) - '@mui/base': 5.0.0-beta.20(@types/react@18.2.31)(react-dom@18.2.0)(react@18.2.0) - '@mui/core-downloads-tracker': 5.14.14 - '@mui/system': 5.14.14(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.31)(react@18.2.0) - '@mui/types': 7.2.6(@types/react@18.2.31) - '@mui/utils': 5.14.14(@types/react@18.2.31)(react@18.2.0) - '@types/react': 18.2.31 + '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) + '@mui/base': 5.0.0-beta.21(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@mui/core-downloads-tracker': 5.14.15 + '@mui/system': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react@18.2.0) + '@mui/types': 7.2.7(@types/react@18.2.33) + '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 '@types/react-transition-group': 4.4.8 clsx: 2.0.0 csstype: 3.1.2 @@ -9243,8 +10553,8 @@ packages: react-transition-group: 4.4.5(react-dom@18.2.0)(react@18.2.0) dev: false - /@mui/private-theming@5.14.14(@types/react@18.2.31)(react@18.2.0): - resolution: {integrity: sha512-n77au3CQj9uu16hak2Y+rvbGSBaJKxziG/gEbOLVGrAuqZ+ycVSkorCfN6Y/4XgYOpG/xvmuiY3JwhAEOzY3iA==} + /@mui/private-theming@5.14.15(@types/react@18.2.33)(react@18.2.0): + resolution: {integrity: sha512-V2Xh+Tu6A07NoSpup0P9m29GwvNMYl5DegsGWqlOTJyAV7cuuVjmVPqxgvL8xBng4R85xqIQJRMjtYYktoPNuQ==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -9254,14 +10564,14 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@mui/utils': 5.14.14(@types/react@18.2.31)(react@18.2.0) - '@types/react': 18.2.31 + '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/styled-engine@5.14.14(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0): - resolution: {integrity: sha512-sF3DS2PVG+cFWvkVHQQaGFpL1h6gSwOW3L91pdxPLQDHDZ5mZ/X0SlXU5XA+WjypoysG4urdAQC7CH/BRvUiqg==} + /@mui/styled-engine@5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0): + resolution: {integrity: sha512-mbOjRf867BysNpexe5Z/P8s3bWzDPNowmKhi7gtNDP/LPEeqAfiDSuC4WPTXmtvse1dCl30Nl755OLUYuoi7Mw==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.4.1 @@ -9275,15 +10585,15 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@emotion/cache': 11.11.0 - '@emotion/react': 11.11.1(@types/react@18.2.31)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.31)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) csstype: 3.1.2 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/system@5.14.14(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.31)(react@18.2.0): - resolution: {integrity: sha512-y4InFmCgGGWXnz+iK4jRTWVikY0HgYnABjz4wgiUgEa2W1H8M4ow+27BegExUWPkj4TWthQ2qG9FOGSMtI+PKA==} + /@mui/system@5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react@18.2.0): + resolution: {integrity: sha512-zr0Gdk1RgKiEk+tCMB900LaOpEC8NaGvxtkmMdL/CXgkqQZSVZOt2PQsxJWaw7kE4YVkIe4VukFVc43qcq9u3w==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 @@ -9299,32 +10609,32 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@emotion/react': 11.11.1(@types/react@18.2.31)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.31)(react@18.2.0) - '@mui/private-theming': 5.14.14(@types/react@18.2.31)(react@18.2.0) - '@mui/styled-engine': 5.14.14(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@mui/types': 7.2.6(@types/react@18.2.31) - '@mui/utils': 5.14.14(@types/react@18.2.31)(react@18.2.0) - '@types/react': 18.2.31 + '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) + '@mui/private-theming': 5.14.15(@types/react@18.2.33)(react@18.2.0) + '@mui/styled-engine': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) + '@mui/types': 7.2.7(@types/react@18.2.33) + '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 clsx: 2.0.0 csstype: 3.1.2 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/types@7.2.6(@types/react@18.2.31): - resolution: {integrity: sha512-7sjLQrUmBwufm/M7jw/quNiPK/oor2+pGUQP2CULRcFCArYTq78oJ3D5esTaL0UMkXKJvDqXn6Ike69yAOBQng==} + /@mui/types@7.2.7(@types/react@18.2.33): + resolution: {integrity: sha512-sofpWmcBqOlTzRbr1cLQuUDKaUYVZTw8ENQrtL39TECRNENEzwgnNPh6WMfqMZlMvf1Aj9DLg74XPjnLr0izUQ==} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 peerDependenciesMeta: '@types/react': optional: true dependencies: - '@types/react': 18.2.31 + '@types/react': 18.2.33 dev: false - /@mui/utils@5.14.14(@types/react@18.2.31)(react@18.2.0): - resolution: {integrity: sha512-3AKp8uksje5sRfVrtgG9Q/2TBsHWVBUtA0NaXliZqGcXo8J+A+Agp0qUW2rJ+ivgPWTCCubz9FZVT2IQZ3bGsw==} + /@mui/utils@5.14.15(@types/react@18.2.33)(react@18.2.0): + resolution: {integrity: sha512-QBfHovAvTa0J1jXuYDaXGk+Yyp7+Fm8GSqx6nK2JbezGqzCFfirNdop/+bL9Flh/OQ/64PeXcW4HGDdOge+n3A==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -9335,13 +10645,13 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@types/prop-types': 15.7.9 - '@types/react': 18.2.31 + '@types/react': 18.2.33 prop-types: 15.8.1 react: 18.2.0 react-is: 18.2.0 dev: false - /@mui/x-date-pickers@5.0.20(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.14)(@mui/system@5.14.14)(@types/react@18.2.31)(dayjs@1.11.10)(react-dom@18.2.0)(react@18.2.0): + /@mui/x-date-pickers@5.0.20(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.15)(@mui/system@5.14.15)(@types/react@18.2.33)(dayjs@1.11.10)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-ERukSeHIoNLbI1C2XRhF9wRhqfsr+Q4B1SAw2ZlU7CWgcG8UBOxgqRKDEOVAIoSWL+DWT6GRuQjOKvj6UXZceA==} engines: {node: '>=12.0.0'} peerDependencies: @@ -9375,11 +10685,11 @@ packages: '@date-io/dayjs': 2.17.0(dayjs@1.11.10) '@date-io/luxon': 2.17.0 '@date-io/moment': 2.17.0 - '@emotion/react': 11.11.1(@types/react@18.2.31)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.31)(react@18.2.0) - '@mui/material': 5.14.14(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.31)(react-dom@18.2.0)(react@18.2.0) - '@mui/system': 5.14.14(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.31)(react@18.2.0) - '@mui/utils': 5.14.14(@types/react@18.2.31)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) + '@mui/material': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@mui/system': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react@18.2.0) + '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) '@types/react-transition-group': 4.4.8 clsx: 1.2.1 dayjs: 1.11.10 @@ -9438,9 +10748,9 @@ packages: dependencies: '@chainsafe/is-ip': 2.0.2 '@chainsafe/netmask': 2.0.0 - '@libp2p/interface': 0.1.3 + '@libp2p/interface': 0.1.4 dns-over-http-resolver: 2.1.2 - multiformats: 12.1.2 + multiformats: 12.1.3 uint8-varint: 2.0.1 uint8arrays: 4.0.6 transitivePeerDependencies: @@ -9458,7 +10768,7 @@ packages: resolution: {integrity: sha512-Yf0UpAaONjed+8PTt5NM/GG4Z4Ai4m1qfT7bqevjnkwRQ12K+0jxtRomirz+VJx4PokpA2St1ZSD1iMkZTqPRQ==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: - multiformats: 12.1.2 + multiformats: 12.1.3 murmurhash3js-revisited: 3.0.0 dev: false @@ -9563,6 +10873,7 @@ packages: resolution: {integrity: sha512-2upgEu0iLiDVDZkNLeFV2+ht0BAVgQnEmCk6JsOch9Rp8xfkMCbvbAZlA2pBHQc73dbl+vFOXfqkf4uemdn0bw==} dependencies: '@noble/hashes': 1.3.0 + dev: true /@noble/curves@1.1.0: resolution: {integrity: sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==} @@ -9574,7 +10885,6 @@ packages: resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} dependencies: '@noble/hashes': 1.3.2 - dev: false /@noble/ed25519@1.7.3: resolution: {integrity: sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ==} @@ -9585,6 +10895,7 @@ packages: /@noble/hashes@1.3.0: resolution: {integrity: sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==} + dev: true /@noble/hashes@1.3.1: resolution: {integrity: sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==} @@ -9594,7 +10905,6 @@ packages: /@noble/hashes@1.3.2: resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} engines: {node: '>= 16'} - dev: false /@noble/secp256k1@1.7.1: resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==} @@ -9617,32 +10927,32 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - /@nomicfoundation/ethereumjs-block@5.0.0: - resolution: {integrity: sha512-DfhVbqM5DjriguuSv6r3TgOpyXC76oX8D/VEODsSwJQ1bZGqu4xLLfYPPTacpCAYOnewzJsZli+Ao9TBTAo2uw==} + /@nomicfoundation/ethereumjs-block@5.0.2: + resolution: {integrity: sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q==} engines: {node: '>=14'} dependencies: - '@nomicfoundation/ethereumjs-common': 4.0.0 - '@nomicfoundation/ethereumjs-rlp': 5.0.0 - '@nomicfoundation/ethereumjs-trie': 6.0.0 - '@nomicfoundation/ethereumjs-tx': 5.0.0 - '@nomicfoundation/ethereumjs-util': 9.0.0 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-trie': 6.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 ethereum-cryptography: 0.1.3 ethers: 5.7.2 transitivePeerDependencies: - bufferutil - utf-8-validate - /@nomicfoundation/ethereumjs-blockchain@7.0.0: - resolution: {integrity: sha512-cVRCrXZminZr0Mbx2hm0/109GZLn1v5bf0/k+SIbGn50yZm6YCdQt9CgGT0Gk56N2vy8NhXD4apo167m4LWk6Q==} + /@nomicfoundation/ethereumjs-blockchain@7.0.2: + resolution: {integrity: sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w==} engines: {node: '>=14'} dependencies: - '@nomicfoundation/ethereumjs-block': 5.0.0 - '@nomicfoundation/ethereumjs-common': 4.0.0 - '@nomicfoundation/ethereumjs-ethash': 3.0.0 - '@nomicfoundation/ethereumjs-rlp': 5.0.0 - '@nomicfoundation/ethereumjs-trie': 6.0.0 - '@nomicfoundation/ethereumjs-tx': 5.0.0 - '@nomicfoundation/ethereumjs-util': 9.0.0 + '@nomicfoundation/ethereumjs-block': 5.0.2 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-ethash': 3.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-trie': 6.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 abstract-level: 1.0.3 debug: 4.3.4(supports-color@8.1.1) ethereum-cryptography: 0.1.3 @@ -9654,19 +10964,19 @@ packages: - supports-color - utf-8-validate - /@nomicfoundation/ethereumjs-common@4.0.0: - resolution: {integrity: sha512-UPpm5FAGAf2B6hQ8aVgO44Rdo0k73oMMCViqNJcKMlk1s9l3rxwuPTp1l20NiGvNO2Pzqk3chFL+BzmLL2g4wQ==} + /@nomicfoundation/ethereumjs-common@4.0.2: + resolution: {integrity: sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg==} dependencies: - '@nomicfoundation/ethereumjs-util': 9.0.0 + '@nomicfoundation/ethereumjs-util': 9.0.2 crc-32: 1.2.2 - /@nomicfoundation/ethereumjs-ethash@3.0.0: - resolution: {integrity: sha512-6zNv5Y3vNIsxjrsbKjMInVpo8cmR0c7yjZbBpy7NYuIMtm0JKhQoXsiFN56t/1sfn9V3v0wgrkAixo5v6bahpA==} + /@nomicfoundation/ethereumjs-ethash@3.0.2: + resolution: {integrity: sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg==} engines: {node: '>=14'} dependencies: - '@nomicfoundation/ethereumjs-block': 5.0.0 - '@nomicfoundation/ethereumjs-rlp': 5.0.0 - '@nomicfoundation/ethereumjs-util': 9.0.0 + '@nomicfoundation/ethereumjs-block': 5.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 abstract-level: 1.0.3 bigint-crypto-utils: 3.3.0 ethereum-cryptography: 0.1.3 @@ -9674,14 +10984,14 @@ packages: - bufferutil - utf-8-validate - /@nomicfoundation/ethereumjs-evm@2.0.0: - resolution: {integrity: sha512-D+tr3M9sictopr3E20OVgme7YF/d0fU566WKh+ofXwmxapz/Dd8RSLSaVeKgfCI2BkzVA+XqXY08NNCV8w8fWA==} + /@nomicfoundation/ethereumjs-evm@2.0.2: + resolution: {integrity: sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ==} engines: {node: '>=14'} dependencies: '@ethersproject/providers': 5.7.2 - '@nomicfoundation/ethereumjs-common': 4.0.0 - '@nomicfoundation/ethereumjs-tx': 5.0.0 - '@nomicfoundation/ethereumjs-util': 9.0.0 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 debug: 4.3.4(supports-color@8.1.1) ethereum-cryptography: 0.1.3 mcl-wasm: 0.7.9 @@ -9691,16 +11001,16 @@ packages: - supports-color - utf-8-validate - /@nomicfoundation/ethereumjs-rlp@5.0.0: - resolution: {integrity: sha512-U1A0y330PtGb8Wft4yPVv0myWYJTesi89ItGoB0ICdqz7793KmUhpfQb2vJUXBi98wSdnxkIABO/GmsQvGKVDw==} + /@nomicfoundation/ethereumjs-rlp@5.0.2: + resolution: {integrity: sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA==} engines: {node: '>=14'} hasBin: true - /@nomicfoundation/ethereumjs-statemanager@2.0.0: - resolution: {integrity: sha512-tgXtsx8yIDlxWMN+ThqPtGK0ITAuITrDy+GYIgGrnT6ZtelvXWM7SUYR0Mcv578lmGCoIwyHFtSBqOkOBYHLjw==} + /@nomicfoundation/ethereumjs-statemanager@2.0.2: + resolution: {integrity: sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA==} dependencies: - '@nomicfoundation/ethereumjs-common': 4.0.0 - '@nomicfoundation/ethereumjs-rlp': 5.0.0 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 debug: 4.3.4(supports-color@8.1.1) ethereum-cryptography: 0.1.3 ethers: 5.7.2 @@ -9710,51 +11020,51 @@ packages: - supports-color - utf-8-validate - /@nomicfoundation/ethereumjs-trie@6.0.0: - resolution: {integrity: sha512-YqPWiNxrZvL+Ef7KHqgru1IlaIGXhu78wd2fxNFOvi/NAQBF845dVfTKKXs1L9x0QBRRQRephgxHCKMuISGppw==} + /@nomicfoundation/ethereumjs-trie@6.0.2: + resolution: {integrity: sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ==} engines: {node: '>=14'} dependencies: - '@nomicfoundation/ethereumjs-rlp': 5.0.0 - '@nomicfoundation/ethereumjs-util': 9.0.0 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 '@types/readable-stream': 2.3.15 ethereum-cryptography: 0.1.3 readable-stream: 3.6.2 - /@nomicfoundation/ethereumjs-tx@5.0.0: - resolution: {integrity: sha512-LTyxI+zBJ+HuEBblUGbxvfKl1hg1uJlz2XhnszNagiBWQSgLb1vQCa1QaXV5Q8cUDYkr/Xe4NXWiUGEvH4e6lA==} + /@nomicfoundation/ethereumjs-tx@5.0.2: + resolution: {integrity: sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g==} engines: {node: '>=14'} dependencies: '@chainsafe/ssz': 0.9.4 '@ethersproject/providers': 5.7.2 - '@nomicfoundation/ethereumjs-common': 4.0.0 - '@nomicfoundation/ethereumjs-rlp': 5.0.0 - '@nomicfoundation/ethereumjs-util': 9.0.0 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 ethereum-cryptography: 0.1.3 transitivePeerDependencies: - bufferutil - utf-8-validate - /@nomicfoundation/ethereumjs-util@9.0.0: - resolution: {integrity: sha512-9EG98CsEC9BnI7AY27F4QXZ8Vf0re8R9XoxQ0//KWF+B7quu6GQvgTq1RlNUjGh/XNCCJNf8E3LOY9ULR85wFQ==} + /@nomicfoundation/ethereumjs-util@9.0.2: + resolution: {integrity: sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ==} engines: {node: '>=14'} dependencies: '@chainsafe/ssz': 0.10.2 - '@nomicfoundation/ethereumjs-rlp': 5.0.0 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 ethereum-cryptography: 0.1.3 - /@nomicfoundation/ethereumjs-vm@7.0.0: - resolution: {integrity: sha512-eHkEoe/4r4+g+fZyIIlQjBHEjCPFs8CHiIEEMvMfvFrV4hyHnuTg4LH7l92ok7TGZqpWxgMG2JOEUFkNsXrKuQ==} + /@nomicfoundation/ethereumjs-vm@7.0.2: + resolution: {integrity: sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA==} engines: {node: '>=14'} dependencies: - '@nomicfoundation/ethereumjs-block': 5.0.0 - '@nomicfoundation/ethereumjs-blockchain': 7.0.0 - '@nomicfoundation/ethereumjs-common': 4.0.0 - '@nomicfoundation/ethereumjs-evm': 2.0.0 - '@nomicfoundation/ethereumjs-rlp': 5.0.0 - '@nomicfoundation/ethereumjs-statemanager': 2.0.0 - '@nomicfoundation/ethereumjs-trie': 6.0.0 - '@nomicfoundation/ethereumjs-tx': 5.0.0 - '@nomicfoundation/ethereumjs-util': 9.0.0 + '@nomicfoundation/ethereumjs-block': 5.0.2 + '@nomicfoundation/ethereumjs-blockchain': 7.0.2 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-evm': 2.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-statemanager': 2.0.2 + '@nomicfoundation/ethereumjs-trie': 6.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 debug: 4.3.4(supports-color@8.1.1) ethereum-cryptography: 0.1.3 mcl-wasm: 0.7.9 @@ -9764,78 +11074,122 @@ packages: - supports-color - utf-8-validate - /@nomicfoundation/hardhat-chai-matchers@1.0.6(@nomiclabs/hardhat-ethers@2.2.3)(chai@4.3.10)(ethers@5.7.2)(hardhat@2.13.1): - resolution: {integrity: sha512-f5ZMNmabZeZegEfuxn/0kW+mm7+yV7VNDxLpMOMGXWFJ2l/Ct3QShujzDRF9cOkK9Ui/hbDeOWGZqyQALDXVCQ==} + /@nomicfoundation/hardhat-chai-matchers@2.0.2(@nomicfoundation/hardhat-ethers@3.0.4)(chai@4.3.10)(ethers@6.8.0)(hardhat@2.18.3): + resolution: {integrity: sha512-9Wu9mRtkj0U9ohgXYFbB/RQDa+PcEdyBm2suyEtsJf3PqzZEEjLUZgWnMjlFhATMk/fp3BjmnYVPrwl+gr8oEw==} peerDependencies: - '@nomiclabs/hardhat-ethers': ^2.0.0 + '@nomicfoundation/hardhat-ethers': ^3.0.0 chai: ^4.2.0 - ethers: ^5.7.2 + ethers: ^6.1.0 hardhat: ^2.9.4 dependencies: - '@ethersproject/abi': 5.7.0 - '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.7.2)(hardhat@2.13.1) + '@nomicfoundation/hardhat-ethers': 3.0.4(ethers@6.8.0)(hardhat@2.18.3) '@types/chai-as-promised': 7.1.7 chai: 4.3.10 chai-as-promised: 7.1.1(chai@4.3.10) deep-eql: 4.1.3 - ethers: 5.7.2 - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) + ethers: 6.8.0 + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) ordinal: 1.0.3 dev: true - /@nomicfoundation/hardhat-network-helpers@1.0.9(hardhat@2.13.1): + /@nomicfoundation/hardhat-ethers@3.0.4(ethers@6.8.0)(hardhat@2.18.3): + resolution: {integrity: sha512-k9qbLoY7qn6C6Y1LI0gk2kyHXil2Tauj4kGzQ8pgxYXIGw8lWn8tuuL72E11CrlKaXRUvOgF0EXrv/msPI2SbA==} + peerDependencies: + ethers: ^6.1.0 + hardhat: ^2.0.0 + dependencies: + debug: 4.3.4(supports-color@8.1.1) + ethers: 6.8.0 + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) + lodash.isequal: 4.5.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@nomicfoundation/hardhat-network-helpers@1.0.9(hardhat@2.18.3): resolution: {integrity: sha512-OXWCv0cHpwLUO2u7bFxBna6dQtCC2Gg/aN/KtJLO7gmuuA28vgmVKYFRCDUqrbjujzgfwQ2aKyZ9Y3vSmDqS7Q==} peerDependencies: hardhat: ^2.9.5 dependencies: ethereumjs-util: 7.1.5 - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) dev: true - /@nomicfoundation/hardhat-toolbox@2.0.2(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(@nomicfoundation/hardhat-chai-matchers@1.0.6)(@nomicfoundation/hardhat-network-helpers@1.0.9)(@nomiclabs/hardhat-ethers@2.2.3)(@nomiclabs/hardhat-etherscan@3.1.7)(@typechain/ethers-v5@11.1.2)(@typechain/hardhat@9.1.0)(@types/chai@4.3.9)(@types/mocha@9.1.0)(@types/node@18.18.6)(chai@4.3.10)(ethers@5.7.2)(hardhat-gas-reporter@1.0.9)(hardhat@2.13.1)(solidity-coverage@0.8.5)(ts-node@10.9.1)(typechain@8.3.2)(typescript@4.9.5): - resolution: {integrity: sha512-vnN1AzxbvpSx9pfdRHbUzTRIXpMLPXnUlkW855VaDk6N1pwRaQ2gNzEmFAABk4lWf11E00PKwFd/q27HuwYrYg==} + /@nomicfoundation/hardhat-toolbox@3.0.0(@nomicfoundation/hardhat-chai-matchers@2.0.2)(@nomicfoundation/hardhat-ethers@3.0.4)(@nomicfoundation/hardhat-network-helpers@1.0.9)(@nomicfoundation/hardhat-verify@1.1.1)(@typechain/ethers-v6@0.4.3)(@typechain/hardhat@8.0.3)(@types/chai@4.3.11)(@types/mocha@9.1.0)(@types/node@18.18.7)(chai@4.3.10)(ethers@6.8.0)(hardhat-gas-reporter@1.0.9)(hardhat@2.18.3)(solidity-coverage@0.8.5)(ts-node@10.9.1)(typechain@8.3.2)(typescript@4.9.5): + resolution: {integrity: sha512-MsteDXd0UagMksqm9KvcFG6gNKYNa3GGNCy73iQ6bEasEgg2v8Qjl6XA5hjs8o5UD5A3153B6W2BIVJ8SxYUtA==} peerDependencies: - '@ethersproject/abi': ^5.4.7 - '@ethersproject/providers': ^5.4.7 - '@nomicfoundation/hardhat-chai-matchers': ^1.0.0 + '@nomicfoundation/hardhat-chai-matchers': ^2.0.0 + '@nomicfoundation/hardhat-ethers': ^3.0.0 '@nomicfoundation/hardhat-network-helpers': ^1.0.0 - '@nomiclabs/hardhat-ethers': ^2.0.0 - '@nomiclabs/hardhat-etherscan': ^3.0.0 - '@typechain/ethers-v5': ^10.1.0 - '@typechain/hardhat': ^6.1.2 + '@nomicfoundation/hardhat-verify': ^1.0.0 + '@typechain/ethers-v6': ^0.4.0 + '@typechain/hardhat': ^8.0.0 '@types/chai': ^4.2.0 '@types/mocha': '>=9.1.0' '@types/node': '>=12.0.0' chai: ^4.2.0 - ethers: ^5.7.2 + ethers: ^6.4.0 hardhat: ^2.11.0 hardhat-gas-reporter: ^1.0.8 solidity-coverage: ^0.8.1 ts-node: '>=8.0.0' - typechain: ^8.1.0 + typechain: ^8.2.0 typescript: '>=4.5.0' dependencies: - '@ethersproject/abi': 5.7.0 - '@ethersproject/providers': 5.7.2 - '@nomicfoundation/hardhat-chai-matchers': 1.0.6(@nomiclabs/hardhat-ethers@2.2.3)(chai@4.3.10)(ethers@5.7.2)(hardhat@2.13.1) - '@nomicfoundation/hardhat-network-helpers': 1.0.9(hardhat@2.13.1) - '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.7.2)(hardhat@2.13.1) - '@nomiclabs/hardhat-etherscan': 3.1.7(hardhat@2.13.1) - '@typechain/ethers-v5': 11.1.2(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2)(typescript@4.9.5) - '@typechain/hardhat': 9.1.0(@typechain/ethers-v6@0.5.1)(ethers@5.7.2)(hardhat@2.13.1)(typechain@8.3.2) - '@types/chai': 4.3.9 + '@nomicfoundation/hardhat-chai-matchers': 2.0.2(@nomicfoundation/hardhat-ethers@3.0.4)(chai@4.3.10)(ethers@6.8.0)(hardhat@2.18.3) + '@nomicfoundation/hardhat-ethers': 3.0.4(ethers@6.8.0)(hardhat@2.18.3) + '@nomicfoundation/hardhat-network-helpers': 1.0.9(hardhat@2.18.3) + '@nomicfoundation/hardhat-verify': 1.1.1(hardhat@2.18.3) + '@typechain/ethers-v6': 0.4.3(ethers@6.8.0)(typechain@8.3.2)(typescript@4.9.5) + '@typechain/hardhat': 8.0.3(@typechain/ethers-v6@0.4.3)(ethers@6.8.0)(hardhat@2.18.3)(typechain@8.3.2) + '@types/chai': 4.3.11 '@types/mocha': 9.1.0 - '@types/node': 18.18.6 + '@types/node': 18.18.7 chai: 4.3.10 - ethers: 5.7.2 - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) - hardhat-gas-reporter: 1.0.9(hardhat@2.13.1) - solidity-coverage: 0.8.5(hardhat@2.13.1) - ts-node: 10.9.1(@types/node@18.18.6)(typescript@4.9.5) + ethers: 6.8.0 + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) + hardhat-gas-reporter: 1.0.9(hardhat@2.18.3) + solidity-coverage: 0.8.5(hardhat@2.18.3) + ts-node: 10.9.1(@types/node@18.18.7)(typescript@4.9.5) typechain: 8.3.2(typescript@4.9.5) typescript: 4.9.5 dev: true + /@nomicfoundation/hardhat-verify@1.1.1(hardhat@2.18.3): + resolution: {integrity: sha512-9QsTYD7pcZaQFEA3tBb/D/oCStYDiEVDN7Dxeo/4SCyHRSm86APypxxdOMEPlGmXsAvd+p1j/dTODcpxb8aztA==} + peerDependencies: + hardhat: ^2.0.4 + dependencies: + '@ethersproject/abi': 5.7.0 + '@ethersproject/address': 5.7.0 + cbor: 8.1.0 + chalk: 2.4.2 + debug: 4.3.4(supports-color@8.1.1) + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) + lodash.clonedeep: 4.5.0 + semver: 6.3.1 + table: 6.8.1 + undici: 5.26.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@nomicfoundation/hardhat-viem@1.0.0(hardhat@2.18.3)(typescript@4.9.5)(viem@1.18.9): + resolution: {integrity: sha512-BWIrjlw3AOGVOPLZ/aGcAYC4EiFUF2QVrFV5StVtMUhQ9Wl6rlUCW98vNd1n0DFW1dPw93NYrMy5w0pEJPyKeg==} + peerDependencies: + hardhat: ^2.17.0 + typescript: ~5.0.0 + viem: ^1.15.1 + dependencies: + abitype: 0.9.8(typescript@4.9.5) + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) + lodash.memoize: 4.1.2 + typescript: 4.9.5 + viem: 1.18.9(typescript@4.9.5) + transitivePeerDependencies: + - zod + dev: true + /@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1: resolution: {integrity: sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w==} engines: {node: '>= 10'} @@ -9931,36 +11285,6 @@ packages: '@nomicfoundation/solidity-analyzer-win32-ia32-msvc': 0.1.1 '@nomicfoundation/solidity-analyzer-win32-x64-msvc': 0.1.1 - /@nomiclabs/hardhat-ethers@2.2.3(ethers@5.7.2)(hardhat@2.13.1): - resolution: {integrity: sha512-YhzPdzb612X591FOe68q+qXVXGG2ANZRvDo0RRUtimev85rCrAlv/TLMEZw5c+kq9AbzocLTVX/h2jVIFPL9Xg==} - peerDependencies: - ethers: ^5.7.2 - hardhat: ^2.0.0 - dependencies: - ethers: 5.7.2 - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) - dev: true - - /@nomiclabs/hardhat-etherscan@3.1.7(hardhat@2.13.1): - resolution: {integrity: sha512-tZ3TvSgpvsQ6B6OGmo1/Au6u8BrAkvs1mIC/eURA3xgIfznUZBhmpne8hv7BXUzw9xNL3fXdpOYgOQlVMTcoHQ==} - peerDependencies: - hardhat: ^2.0.4 - dependencies: - '@ethersproject/abi': 5.7.0 - '@ethersproject/address': 5.7.0 - cbor: 8.1.0 - chalk: 2.4.2 - debug: 4.3.4(supports-color@8.1.1) - fs-extra: 7.0.1 - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) - lodash: 4.17.21 - semver: 6.3.1 - table: 6.8.1 - undici: 5.26.5 - transitivePeerDependencies: - - supports-color - dev: true - /@observablehq/inspector@5.0.0: resolution: {integrity: sha512-Vvg/TQdsZTUaeYbH0IKxYEz37FbRO6kdowoz2PrHLQif54NC1CjEihEjg+ZMSBn587GQxTFABu0CGkFZgtR1UQ==} dependencies: @@ -9983,7 +11307,7 @@ packages: d3-require: 1.3.0 dev: false - /@oclif/core@2.15.0(@types/node@18.18.6)(typescript@4.9.5): + /@oclif/core@2.15.0(@types/node@18.18.7)(typescript@4.9.5): resolution: {integrity: sha512-fNEMG5DzJHhYmI3MgpByTvltBOMyFcnRIUMxbiz2ai8rhaYgaTHMG3Q38HcosfIvtw9nCjxpcQtC8MN8QtVCcA==} engines: {node: '>=14.0.0'} dependencies: @@ -10010,7 +11334,7 @@ packages: strip-ansi: 6.0.1 supports-color: 8.1.1 supports-hyperlinks: 2.3.0 - ts-node: 10.9.1(@types/node@18.18.6)(typescript@4.9.5) + ts-node: 10.9.1(@types/node@18.18.7)(typescript@4.9.5) tslib: 2.6.2 widest-line: 3.1.0 wordwrap: 1.0.0 @@ -10022,7 +11346,7 @@ packages: - typescript dev: true - /@oclif/core@2.8.6(@types/node@18.18.6)(typescript@4.9.5): + /@oclif/core@2.8.6(@types/node@18.18.7)(typescript@4.9.5): resolution: {integrity: sha512-1QlPaHMhOORySCXkQyzjsIsy2GYTilOw3LkjeHkCgsPJQjAT4IclVytJusWktPbYNys9O+O4V23J44yomQvnBQ==} engines: {node: '>=14.0.0'} dependencies: @@ -10050,7 +11374,7 @@ packages: strip-ansi: 6.0.1 supports-color: 8.1.1 supports-hyperlinks: 2.3.0 - ts-node: 10.9.1(@types/node@18.18.6)(typescript@4.9.5) + ts-node: 10.9.1(@types/node@18.18.7)(typescript@4.9.5) tslib: 2.6.2 widest-line: 3.1.0 wordwrap: 1.0.0 @@ -10062,11 +11386,11 @@ packages: - typescript dev: true - /@oclif/plugin-autocomplete@2.3.10(@types/node@18.18.6)(typescript@4.9.5): + /@oclif/plugin-autocomplete@2.3.10(@types/node@18.18.7)(typescript@4.9.5): resolution: {integrity: sha512-Ow1AR8WtjzlyCtiWWPgzMyT8SbcDJFr47009riLioHa+MHX2BCDtVn2DVnN/E6b9JlPV5ptQpjefoRSNWBesmg==} engines: {node: '>=12.0.0'} dependencies: - '@oclif/core': 2.15.0(@types/node@18.18.6)(typescript@4.9.5) + '@oclif/core': 2.15.0(@types/node@18.18.7)(typescript@4.9.5) chalk: 4.1.2 debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: @@ -10077,11 +11401,11 @@ packages: - typescript dev: true - /@oclif/plugin-not-found@2.4.3(@types/node@18.18.6)(typescript@4.9.5): + /@oclif/plugin-not-found@2.4.3(@types/node@18.18.7)(typescript@4.9.5): resolution: {integrity: sha512-nIyaR4y692frwh7wIHZ3fb+2L6XEecQwRDIb4zbEam0TvaVmBQWZoColQyWA84ljFBPZ8XWiQyTz+ixSwdRkqg==} engines: {node: '>=12.0.0'} dependencies: - '@oclif/core': 2.15.0(@types/node@18.18.6)(typescript@4.9.5) + '@oclif/core': 2.15.0(@types/node@18.18.7)(typescript@4.9.5) chalk: 4.1.2 fast-levenshtein: 3.0.0 transitivePeerDependencies: @@ -10091,15 +11415,27 @@ packages: - typescript dev: true - /@open-draft/until@1.0.3: - resolution: {integrity: sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q==} + /@openzeppelin/contracts-upgradeable@4.7.3: + resolution: {integrity: sha512-+wuegAMaLcZnLCJIvrVUDzA9z/Wp93f0Dla/4jJvIhijRrPabjQbZe6fWiECLaJyfn5ci9fqf9vTw3xpQOad2A==} + dev: true + + /@openzeppelin/contracts@3.4.2: + resolution: {integrity: sha512-z0zMCjyhhp4y7XKAcDAi3Vgms4T2PstwBdahiO0+9NaGICQKjynK3wduSRplTgk4LXmoO1yfDGO5RbjKYxtuxA==} dev: true - /@openzeppelin/defender-admin-client@1.49.0: - resolution: {integrity: sha512-ka+GTbsnGO6j1R2AGj027uu29es/EBVs3VjJStb+7u/1lNhx1xSRS11JBD0a0GNhrwqsKU4czIemlIKMlUzhhQ==} + /@openzeppelin/contracts@4.3.3: + resolution: {integrity: sha512-tDBopO1c98Yk7Cv/PZlHqrvtVjlgK5R4J6jxLwoO7qxK4xqOiZG+zSkIvGFpPZ0ikc3QOED3plgdqjgNTnBc7g==} + dev: true + + /@openzeppelin/contracts@4.9.3: + resolution: {integrity: sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==} + dev: true + + /@openzeppelin/defender-admin-client@1.50.0(debug@4.3.4): + resolution: {integrity: sha512-JxeA111ifCIzXho2gFymhepufB0ElI1UMvFIMEfJLvRL7g7V69wSiN8v+OqZyqZTahiY32Rb+TwdhVjKF5Zu+A==} dependencies: - '@openzeppelin/defender-base-client': 1.49.0(debug@4.3.4) - axios: 1.5.1(debug@4.3.4) + '@openzeppelin/defender-base-client': 1.50.0(debug@4.3.4) + axios: 1.6.2(debug@4.3.4) ethers: 5.7.2 lodash: 4.17.21 node-fetch: 2.7.0 @@ -10110,11 +11446,11 @@ packages: - utf-8-validate dev: true - /@openzeppelin/defender-autotask-client@1.49.0: - resolution: {integrity: sha512-FhqFB/E0jaDNEgx0WklodpRS2RPfE181+kwtGL23a8uzGiyQRs7+Ia/a8ARGaLEqD9gWwAte6ODiqZAaim7/jg==} + /@openzeppelin/defender-autotask-client@1.50.0: + resolution: {integrity: sha512-QWob3F6xuOu8r8oPy0Y2XLfAL1PTuKE2F4nC4wGeu3JJT8/pJz3xnHX5DgUYwiGIMqnkitUNUoBcmi4CPI31yw==} hasBin: true dependencies: - '@openzeppelin/defender-base-client': 1.49.0(debug@4.3.4) + '@openzeppelin/defender-base-client': 1.50.0(debug@4.3.4) axios: 1.5.1(debug@4.3.4) dotenv: 10.0.0 glob: 7.2.3 @@ -10126,8 +11462,8 @@ packages: - encoding dev: false - /@openzeppelin/defender-autotask-utils@1.49.0: - resolution: {integrity: sha512-rJls6HOuddBsPJwbSmIN/nugdIsgdrwzgpVJC/hxv+amu0HsSkrH26LbcoDig7Eb2dp68Avtmo0EOyAUP1bNGA==} + /@openzeppelin/defender-autotask-utils@1.50.0: + resolution: {integrity: sha512-wuhm5idjsIiC7hdLj+z5ewDmyKx5q0tRXKHp05K9X8uo1CyLdHV2kKZjBrWzGE9qxVhJ79f9PzHZrLcyPHNDOg==} dev: false /@openzeppelin/defender-base-client@1.49.0(debug@4.3.4): @@ -10142,66 +11478,236 @@ packages: - debug - encoding - /@openzeppelin/defender-sentinel-client@1.49.0: - resolution: {integrity: sha512-fr39U1GRWvJP1fWgwqjTYCz7uhfVfXJReWcivwxMeaoyMl+jYFxj8NkMhqkkbmI6O4TUyNMsmAQ34qFf0IS0/A==} + /@openzeppelin/defender-base-client@1.50.0(debug@4.3.4): + resolution: {integrity: sha512-V5uJ4t3kr9ex1RrqGH2DwsHuyW7/hl3VK0sSkq3VVbAewtcsW3cdg/UkXd5ITu6mtz76RoYkvUBHtkYUm0nb+w==} dependencies: - '@ethersproject/abi': 5.7.0 - '@openzeppelin/defender-base-client': 1.49.0(debug@4.3.4) - axios: 1.5.1(debug@4.3.4) + amazon-cognito-identity-js: 6.3.6 + async-retry: 1.3.3 + axios: 1.6.2(debug@4.3.4) lodash: 4.17.21 node-fetch: 2.7.0 transitivePeerDependencies: - debug - encoding - dev: false - /@openzeppelin/hardhat-defender@1.9.0(@nomiclabs/hardhat-ethers@2.2.3)(@nomiclabs/hardhat-etherscan@3.1.7)(ethers@5.7.2)(hardhat@2.13.1): - resolution: {integrity: sha512-dl2pQyBvwEZVq1sgw/i+mLQiu4ZD7iKn2/ghD9RbAGHIM8hZQ4ou8cXl1S6wCA92prpeO1rPGQ+NcJajbY4MCw==} - deprecated: '@openzeppelin/hardhat-defender is deprecated. This functionality is now included as part of @openzeppelin/hardhat-upgrades' + /@openzeppelin/defender-sdk-account-client@1.4.0: + resolution: {integrity: sha512-R3jJOh/Wirp+UtD/YYHzC1LYqdXsIPl77z7ZlJLdQDdWHZbIHpHCUlTrj1zZ/0+XovJ23ItiZqivnkVLqV62LQ==} dependencies: - '@openzeppelin/defender-admin-client': 1.49.0 - '@openzeppelin/defender-base-client': 1.49.0(debug@4.3.4) - '@openzeppelin/hardhat-upgrades': 1.28.0(@nomiclabs/hardhat-ethers@2.2.3)(@nomiclabs/hardhat-etherscan@3.1.7)(ethers@5.7.2)(hardhat@2.13.1) - ethereumjs-util: 7.1.5 + '@openzeppelin/defender-sdk-base-client': 1.4.0 + axios: 1.6.2(debug@4.3.4) + lodash: 4.17.21 + transitivePeerDependencies: + - debug + - encoding + dev: true + + /@openzeppelin/defender-sdk-action-client@1.4.0: + resolution: {integrity: sha512-kLwO5sVC2KUt+jyHe5GZr7+BEeKgkX4ZcZCqyg+ykRtqVjQOmufwjdVRpwaqKsetEJdqobwmDu0D5gZnjC9ZwQ==} + dependencies: + '@openzeppelin/defender-sdk-base-client': 1.4.0 + axios: 1.6.2(debug@4.3.4) + glob: 7.2.3 + jszip: 3.10.1 + lodash: 4.17.21 + transitivePeerDependencies: + - debug + - encoding + dev: true + + /@openzeppelin/defender-sdk-base-client@1.4.0: + resolution: {integrity: sha512-aBDQpA4+ayFyx/2hQFRrBJqo6pKcF3eVbztjq49cHdg+cAQgM56Dy333Bp2z4bHzx1IbzmYcvhlhBH2LBnsdzg==} + dependencies: + amazon-cognito-identity-js: 6.3.6 + async-retry: 1.3.3 + transitivePeerDependencies: + - encoding + dev: true + + /@openzeppelin/defender-sdk-deploy-client@1.4.0(debug@4.3.4): + resolution: {integrity: sha512-uXsGKXhH0P4xRBD0WvR8eo830sFd2jbES2Uf7nQnd8jGK5wxUgCLGgfrRXFznEzAbXA3xs+a5IGcmHwbL9MxyQ==} + dependencies: + '@ethersproject/abi': 5.7.0 + '@openzeppelin/defender-sdk-base-client': 1.4.0 + axios: 1.6.2(debug@4.3.4) + lodash: 4.17.21 + transitivePeerDependencies: + - debug + - encoding + dev: true + + /@openzeppelin/defender-sdk-monitor-client@1.4.0: + resolution: {integrity: sha512-I3LHhp4/BQjcCwhCfmzfrPNnnyRuMoJM0AtJYsyG7PTgfZe9UXnta5z4mJNJyBGBvOpg8v6Rt5k30uHDXReHhQ==} + dependencies: + '@ethersproject/abi': 5.7.0 + '@openzeppelin/defender-sdk-base-client': 1.4.0 + axios: 1.6.2(debug@4.3.4) + lodash: 4.17.21 + transitivePeerDependencies: + - debug + - encoding + dev: true + + /@openzeppelin/defender-sdk-network-client@1.4.0: + resolution: {integrity: sha512-jbclbqBjyBUNi/5C84EXaXOLTcLF83gMIk9Vx2uTPrb7GvfkmEG1ZWO0btBq312cmXgtUmCRj1QTyWxTArBT4g==} + dependencies: + '@ethersproject/abi': 5.7.0 + '@openzeppelin/defender-sdk-base-client': 1.4.0 + axios: 1.6.2(debug@4.3.4) + lodash: 4.17.21 + transitivePeerDependencies: + - debug + - encoding + dev: true + + /@openzeppelin/defender-sdk-notification-channel-client@1.4.0: + resolution: {integrity: sha512-cXsatNPUodwfwUAJJ/0P0PEtx2RhPbAa/W4x/pmBltmIB1YDjmbxqtjzWmxn7yZMcu4XcdxDIBH8GXINsWtexw==} + dependencies: + '@ethersproject/abi': 5.7.0 + '@openzeppelin/defender-sdk-base-client': 1.4.0 + axios: 1.6.2(debug@4.3.4) + lodash: 4.17.21 + transitivePeerDependencies: + - debug + - encoding + dev: true + + /@openzeppelin/defender-sdk-proposal-client@1.4.0: + resolution: {integrity: sha512-jhvVZOt9AlvsOzJZiU0nO61ew+AT25d6kVPMT3GeyoFo8v3P62U19w3RtTrozxvxppMadUsIm53mu8Y4JWL/Zg==} + dependencies: + '@openzeppelin/defender-sdk-base-client': 1.4.0 + axios: 1.6.2(debug@4.3.4) + ethers: 5.7.2 + lodash: 4.17.21 transitivePeerDependencies: - - '@nomiclabs/hardhat-ethers' - - '@nomiclabs/hardhat-etherscan' - - '@nomiclabs/harhdat-etherscan' - bufferutil - debug - encoding - - ethers - - hardhat - - supports-color - utf-8-validate dev: true - /@openzeppelin/hardhat-upgrades@1.28.0(@nomiclabs/hardhat-ethers@2.2.3)(@nomiclabs/hardhat-etherscan@3.1.7)(ethers@5.7.2)(hardhat@2.13.1): - resolution: {integrity: sha512-7sb/Jf+X+uIufOBnmHR0FJVWuxEs2lpxjJnLNN6eCJCP8nD0v+Ot5lTOW2Qb/GFnh+fLvJtEkhkowz4ZQ57+zQ==} + /@openzeppelin/defender-sdk-relay-client@1.4.0: + resolution: {integrity: sha512-j6XmTTkfShN2VbR82aw/NiSD8ee6vMEmQDFtnNG3NIsl/FYygpIksGVef3gFsYPBCspQPQ0SdeKlwM0pU/+Sag==} + dependencies: + '@openzeppelin/defender-sdk-base-client': 1.4.0 + axios: 1.6.2(debug@4.3.4) + lodash: 4.17.21 + transitivePeerDependencies: + - debug + - encoding + dev: true + + /@openzeppelin/defender-sdk-relay-signer-client@1.4.0(@ethersproject/abstract-provider@5.7.0)(@ethersproject/abstract-signer@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2)(@ethersproject/transactions@5.7.0)(web3-core-helpers@1.10.3)(web3-core@1.10.3)(web3-utils@1.10.3)(web3@1.10.3): + resolution: {integrity: sha512-BP2c3uEHTCxwdbSA7uhbeSpiBW7ti839bIJbojdd29HsEYNxX3Ng913QZtnn/MpfXVV8xKmnoTlplurozwEHTg==} + peerDependencies: + '@ethersproject/abstract-provider': ^5.6.1 + '@ethersproject/abstract-signer': ^5.6.2 + '@ethersproject/hash': ^5.6.1 + '@ethersproject/providers': ^5.6.8 + '@ethersproject/transactions': ^5.6.2 + web3: ^1.8.2 + web3-core: ^1.10.3 + web3-core-helpers: ^1.8.2 + web3-utils: ^1.8.2 + dependencies: + '@ethersproject/abstract-provider': 5.7.0 + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/bytes': 5.7.0 + '@ethersproject/contracts': 5.7.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/logger': 5.7.0 + '@ethersproject/networks': 5.7.1 + '@ethersproject/properties': 5.7.0 + '@ethersproject/providers': 5.7.2 + '@ethersproject/random': 5.7.0 + '@ethersproject/strings': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@openzeppelin/defender-sdk-base-client': 1.4.0 + amazon-cognito-identity-js: 6.3.6 + axios: 1.6.2(debug@4.3.4) + lodash: 4.17.21 + web3: 1.10.3 + web3-core: 1.10.3 + web3-core-helpers: 1.10.3 + web3-utils: 1.10.3 + transitivePeerDependencies: + - debug + - encoding + dev: true + + /@openzeppelin/defender-sdk@1.4.0(@ethersproject/abstract-provider@5.7.0)(@ethersproject/abstract-signer@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2)(@ethersproject/transactions@5.7.0)(web3-core-helpers@1.10.3)(web3-core@1.10.3)(web3-utils@1.10.3)(web3@1.10.3): + resolution: {integrity: sha512-1WCECykTXE8UzMuRTLx0rSDWAQAyCWZ0cNxMeDxghhNwDGdClv3AJzi7Ns/GulaB/x2ubpbqh+fXUIEPq5JAdA==} + dependencies: + '@openzeppelin/defender-sdk-account-client': 1.4.0 + '@openzeppelin/defender-sdk-action-client': 1.4.0 + '@openzeppelin/defender-sdk-base-client': 1.4.0 + '@openzeppelin/defender-sdk-deploy-client': 1.4.0(debug@4.3.4) + '@openzeppelin/defender-sdk-monitor-client': 1.4.0 + '@openzeppelin/defender-sdk-network-client': 1.4.0 + '@openzeppelin/defender-sdk-notification-channel-client': 1.4.0 + '@openzeppelin/defender-sdk-proposal-client': 1.4.0 + '@openzeppelin/defender-sdk-relay-client': 1.4.0 + '@openzeppelin/defender-sdk-relay-signer-client': 1.4.0(@ethersproject/abstract-provider@5.7.0)(@ethersproject/abstract-signer@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2)(@ethersproject/transactions@5.7.0)(web3-core-helpers@1.10.3)(web3-core@1.10.3)(web3-utils@1.10.3)(web3@1.10.3) + transitivePeerDependencies: + - '@ethersproject/abstract-provider' + - '@ethersproject/abstract-signer' + - '@ethersproject/hash' + - '@ethersproject/providers' + - '@ethersproject/transactions' + - bufferutil + - debug + - encoding + - utf-8-validate + - web3 + - web3-core + - web3-core-helpers + - web3-utils + dev: true + + /@openzeppelin/defender-sentinel-client@1.49.0: + resolution: {integrity: sha512-fr39U1GRWvJP1fWgwqjTYCz7uhfVfXJReWcivwxMeaoyMl+jYFxj8NkMhqkkbmI6O4TUyNMsmAQ34qFf0IS0/A==} + dependencies: + '@ethersproject/abi': 5.7.0 + '@openzeppelin/defender-base-client': 1.49.0(debug@4.3.4) + axios: 1.5.1(debug@4.3.4) + lodash: 4.17.21 + node-fetch: 2.7.0 + transitivePeerDependencies: + - debug + - encoding + dev: false + + /@openzeppelin/hardhat-upgrades@2.3.3(@nomicfoundation/hardhat-ethers@3.0.4)(@nomicfoundation/hardhat-verify@1.1.1)(ethers@6.8.0)(hardhat@2.18.3): + resolution: {integrity: sha512-rF87xYSz6Q2WFq5zcUF1T1tx3Kiq83hmke0xOBn5Qgrl++osseiDwS5oXfDK3NSWvj06oYGLERRGHcXnpQ31FQ==} hasBin: true peerDependencies: - '@nomiclabs/hardhat-ethers': ^2.0.0 - '@nomiclabs/hardhat-etherscan': ^3.1.0 - '@nomiclabs/harhdat-etherscan': '*' - ethers: ^5.7.2 + '@nomicfoundation/hardhat-ethers': ^3.0.0 + '@nomicfoundation/hardhat-verify': ^1.1.0 + ethers: ^6.6.0 hardhat: ^2.0.2 peerDependenciesMeta: - '@nomiclabs/harhdat-etherscan': + '@nomicfoundation/hardhat-verify': optional: true dependencies: - '@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.7.2)(hardhat@2.13.1) - '@nomiclabs/hardhat-etherscan': 3.1.7(hardhat@2.13.1) + '@nomicfoundation/hardhat-ethers': 3.0.4(ethers@6.8.0)(hardhat@2.18.3) + '@nomicfoundation/hardhat-verify': 1.1.1(hardhat@2.18.3) + '@openzeppelin/defender-admin-client': 1.50.0(debug@4.3.4) '@openzeppelin/defender-base-client': 1.49.0(debug@4.3.4) - '@openzeppelin/platform-deploy-client': 0.8.0(debug@4.3.4) + '@openzeppelin/defender-sdk-base-client': 1.4.0 + '@openzeppelin/defender-sdk-deploy-client': 1.4.0(debug@4.3.4) '@openzeppelin/upgrades-core': 1.31.0 chalk: 4.1.2 debug: 4.3.4(supports-color@8.1.1) - ethers: 5.7.2 - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) + ethereumjs-util: 7.1.5 + ethers: 6.8.0 + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) proper-lockfile: 4.1.2 + undici: 5.26.5 transitivePeerDependencies: + - bufferutil - encoding - supports-color + - utf-8-validate dev: true /@openzeppelin/merkle-tree@1.0.5: @@ -10211,20 +11717,6 @@ packages: ethereum-cryptography: 1.2.0 dev: false - /@openzeppelin/platform-deploy-client@0.8.0(debug@4.3.4): - resolution: {integrity: sha512-POx3AsnKwKSV/ZLOU/gheksj0Lq7Is1q2F3pKmcFjGZiibf+4kjGxr4eSMrT+2qgKYZQH1ZLQZ+SkbguD8fTvA==} - deprecated: '@openzeppelin/platform-deploy-client is deprecated. Please use @openzeppelin/defender-sdk-deploy-client' - dependencies: - '@ethersproject/abi': 5.7.0 - '@openzeppelin/defender-base-client': 1.49.0(debug@4.3.4) - axios: 0.21.4(debug@4.3.4) - lodash: 4.17.21 - node-fetch: 2.7.0 - transitivePeerDependencies: - - debug - - encoding - dev: true - /@openzeppelin/upgrades-core@1.31.0: resolution: {integrity: sha512-E1Cz8lVpo2mnBeFWxiGDLWtuTYMFNTEWwbnhle4dZ+5UHX6xTRO+Q/CaWBHm33HHhuuiUbRwgGNnAR9zOu+fyQ==} hasBin: true @@ -10270,8 +11762,8 @@ packages: requiresBuild: true optional: true - /@plasmicapp/data-sources-context@0.1.17(react@18.2.0): - resolution: {integrity: sha512-vCAcgcxT6+MOn+rGlVszGDHPqBTGszzNZ4FuwXkX5RjN4W7VG8Vep6qpZC2KUZI0KpjGmGq3uLkeK4BcvciRzA==} + /@plasmicapp/data-sources-context@0.1.20(react@18.2.0): + resolution: {integrity: sha512-r+156StkG37WSXTGQSoihYjGLyKu1re+/ziD7GcPpP0VIHXtiUYC4XBINQa9jVer4hYZ54GItOdvUAZsxgCP/g==} engines: {node: '>=10'} peerDependencies: react: '>=16.8.0' @@ -10292,47 +11784,60 @@ packages: window-or-global: 1.0.1 dev: false + /@plasmicapp/host@1.0.185(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-Eka3J1gFID3d2E818asFp3PUizG3JQyaFc1y53BmhM0r+OGdlJUvKAof2zPXf6sDHdYJV77OhdBtbgE8ebBMqA==} + peerDependencies: + react: '>=16.8.0' + react-dom: '>=16.8.0' + dependencies: + '@plasmicapp/query': 0.1.77(react@18.2.0) + csstype: 3.1.2 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + window-or-global: 1.0.1 + dev: false + /@plasmicapp/isomorphic-unfetch@1.0.3: resolution: {integrity: sha512-cJtPOCf2/FWlFB42Q/n0MK/C47NSZr+YQJbCvQwvyjOrOgOQ4gJ/+gkr4avpMa7UPMa8qLovDAuaR+5k+hMlZQ==} dependencies: unfetch: 4.2.0 dev: false - /@plasmicapp/loader-core@1.0.115: - resolution: {integrity: sha512-Ip/I4kuBFnsOB7DrCTrkhOCfSCGYknDTH83qiWpbQdYwCxWCHUsCtY3P3j9K8U4NYjFgy3OL4d0EkAtOvoBCTw==} + /@plasmicapp/loader-core@1.0.121: + resolution: {integrity: sha512-BOJkCGYNQ8aKXSdHA7+SKTq0BfsIjdB86Xwi9ugEqwh/9PFGXdadlM758Pwo62FL2h4kkelkUqPBsOnYJvgBTA==} engines: {node: '>=10'} dependencies: '@plasmicapp/isomorphic-unfetch': 1.0.3 - '@plasmicapp/loader-fetcher': 1.0.37 + '@plasmicapp/loader-fetcher': 1.0.43 dev: false - /@plasmicapp/loader-edge@1.0.46: - resolution: {integrity: sha512-r3PA6ARF3EDWma5kwHOgPu/meed7hkKnkDp2aUWiHQKe7X0eRDWXpId/+2uYVzh8p1sjIxiINK6P9Bv1jVuXrQ==} + /@plasmicapp/loader-edge@1.0.52: + resolution: {integrity: sha512-YqC6zNIcgScNOE+cDrhR+9gPsUtEsgNVwnIMw+Z5Xmj8TeHQDIQOEKwOX8dzlXgrb6ahycqwdk4vkbww1j56nA==} engines: {node: '>=10'} dependencies: - '@plasmicapp/loader-splits': 1.0.43 + '@plasmicapp/loader-splits': 1.0.49 dev: false - /@plasmicapp/loader-fetcher@1.0.37: - resolution: {integrity: sha512-yLrOGklV8FNeyNteumzuE99zvPVGvNTT7TuLQISMvCkisY+pg4NY6gDxSUvDut65waBH0ie/ZdG6jUtkqb0kBg==} + /@plasmicapp/loader-fetcher@1.0.43: + resolution: {integrity: sha512-WKirusqEdRcCBwqdDaAYtfpQ3Qy6wnf/T5jyr5N0mmiTXTmTLSkTMjq/zCyAiOr+u2bWauHRF3GUs2H9Bd/6nw==} engines: {node: '>=10'} dependencies: '@plasmicapp/isomorphic-unfetch': 1.0.3 dev: false - /@plasmicapp/loader-nextjs@1.0.333(next@13.5.6)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-Uhkeeig9UhZQqLgH5QPuV3bd1jE4Z5ZsJgvoxmsL96XrGEuxEO2wUPLq02HQ+EgJtXuNTgbb5bSPZsVCJ/nCKQ==} + /@plasmicapp/loader-nextjs@1.0.345(next@13.5.6)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-50CGunxpvkApK4o805EOKZbN0YLasHybH0hzkDtyQ9AcDi0MuhzSpZQ0MM4zSX4vVo+6uBJ/YfcTQ4Kriw25yQ==} engines: {node: '>=10'} peerDependencies: next: '>=10.1.0' react: '>=16.8.0' react-dom: '>=16.8.0' dependencies: - '@plasmicapp/loader-core': 1.0.115 - '@plasmicapp/loader-edge': 1.0.46 - '@plasmicapp/loader-react': 1.0.312(react-dom@18.2.0)(react@18.2.0) - '@plasmicapp/watcher': 1.0.78 - next: 13.5.6(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) + '@plasmicapp/loader-core': 1.0.121 + '@plasmicapp/loader-edge': 1.0.52 + '@plasmicapp/loader-react': 1.0.324(react-dom@18.2.0)(react@18.2.0) + '@plasmicapp/watcher': 1.0.81 + next: 13.5.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) server-only: 0.0.1 @@ -10342,40 +11847,41 @@ packages: - utf-8-validate dev: false - /@plasmicapp/loader-react@1.0.312(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-nUu9TJrlu5/innWFTz1rvJx4NQgm/yLNZwK27cbLufQCYzec4FBdGEr4Ywr7IMHb4OHTzJOJG3ZsEDmFjTeJ3Q==} + /@plasmicapp/loader-react@1.0.324(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-wikljq+9lTdKnRw53FRyc0Qj/sJCOZl+wBQvcGFisOWYqEYsIQVPYzBKKy6bcr+ZpTbUHlVQzkG4K3zErquzBg==} engines: {node: '>=12'} peerDependencies: react: '>=16.8.0' react-dom: '>=16.8.0' dependencies: - '@plasmicapp/data-sources-context': 0.1.17(react@18.2.0) - '@plasmicapp/host': 1.0.177(react-dom@18.2.0)(react@18.2.0) - '@plasmicapp/loader-core': 1.0.115 - '@plasmicapp/loader-splits': 1.0.43 - '@plasmicapp/prepass': 1.0.9(react-dom@18.2.0)(react@18.2.0) - '@plasmicapp/query': 0.1.74(react@18.2.0) + '@plasmicapp/data-sources-context': 0.1.20(react@18.2.0) + '@plasmicapp/host': 1.0.185(react-dom@18.2.0)(react@18.2.0) + '@plasmicapp/loader-core': 1.0.121 + '@plasmicapp/loader-fetcher': 1.0.43 + '@plasmicapp/loader-splits': 1.0.49 + '@plasmicapp/prepass': 1.0.13(react-dom@18.2.0)(react@18.2.0) + '@plasmicapp/query': 0.1.77(react@18.2.0) pascalcase: 1.0.0 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) server-only: 0.0.1 dev: false - /@plasmicapp/loader-splits@1.0.43: - resolution: {integrity: sha512-XdSiD/N9ddD/HTjsk6EUhU0SSLFzQl0G4vlapdcHIBI9vBZRLAJQLGPIS98OJJnEK3DsE7j4kMYzKevoE/bycQ==} + /@plasmicapp/loader-splits@1.0.49: + resolution: {integrity: sha512-1L+1esk/hHBEOJo5d18aPUZwoYZEO+X6z/hx9s5I1/MdKeTXj60k++fhVr6D7j6tToofaMDO30oWyXSy9HvYRQ==} engines: {node: '>=10'} dependencies: json-logic-js: 2.0.2 dev: false - /@plasmicapp/prepass@1.0.9(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-0iG7iCD/Kf0I1Qaxw/steVPm3p2ciBPeA8Xa4i/E34gEat5qRsGl6cMi4V2EaPLWOF4cL6B+PEdtHCmZBscOGw==} + /@plasmicapp/prepass@1.0.13(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-Kh9lwlzQnOzKtHnDtzeSiupDvEYU9T6kq+XOQZ0+OR+r+IT60T1CMmFFWQP8ae/Z+m66U6ttonQrlw4vSP0rgw==} engines: {node: '>=12'} peerDependencies: react: '>=16.8.0' react-dom: '>=16.8.0' dependencies: - '@plasmicapp/query': 0.1.74(react@18.2.0) + '@plasmicapp/query': 0.1.77(react@18.2.0) '@plasmicapp/react-ssr-prepass': 2.0.3(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -10391,6 +11897,16 @@ packages: swr: 1.3.0(react@18.2.0) dev: false + /@plasmicapp/query@0.1.77(react@18.2.0): + resolution: {integrity: sha512-46yTL/y1ys9erE5yDKAX7x/VSq16gNYxpAGm1HF+h0TrFoWyctvFEFsZdAGkrcqPgrp5AYHW71khYkMD1ES/5A==} + engines: {node: '>=10'} + peerDependencies: + react: '>=16.8.0' + dependencies: + react: 18.2.0 + swr: 1.3.0(react@18.2.0) + dev: false + /@plasmicapp/react-ssr-prepass@2.0.3(react@18.2.0): resolution: {integrity: sha512-jFde/wfL8NlJEr76Mshyju/3GvJD5Z9YijCG1/8DR+KOEv7m5uRvORjxtEEw2GKDXRp2GqpQqj97iWGLFUsOzA==} peerDependencies: @@ -10399,8 +11915,8 @@ packages: react: 18.2.0 dev: false - /@plasmicapp/watcher@1.0.78: - resolution: {integrity: sha512-YvBtGMkI6pvqgagwP72Rr5btZ3iJsIOyInH7XsT3vDopWaQfrEm2oB4sVwxUxnsxnUZPniH/LHCwn4QJsPmdfQ==} + /@plasmicapp/watcher@1.0.81: + resolution: {integrity: sha512-rkPHPFyafxoFZm/klub2mCo0pRIIjr24shuO6/LTjPwncz3w5XxrJ4Rv/H9F+paV0+wjo43t0tBYmUmu82yRjg==} engines: {node: '>=10'} dependencies: socket.io-client: 4.7.2 @@ -10426,13 +11942,13 @@ packages: resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} dev: false - /@primitivefi/hardhat-dodoc@0.2.3(hardhat@2.13.1)(squirrelly@8.0.8): + /@primitivefi/hardhat-dodoc@0.2.3(hardhat@2.18.3)(squirrelly@8.0.8): resolution: {integrity: sha512-ver9uHa79LTDTeebOKZ/eOVRL/FP1k0s0x/5Bo/8ZaDdLWFVClKqZyZYVjjW4CJqTPCt8uU9b9p71P2vzH4O9A==} peerDependencies: hardhat: ^2.6.4 squirrelly: ^8.0.8 dependencies: - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) squirrelly: 8.0.8 dev: true @@ -10469,25 +11985,27 @@ packages: /@protobufjs/utf8@1.1.0: resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} - /@rainbow-me/rainbowkit@1.0.8(@types/react@18.2.31)(react-dom@18.2.0)(react@18.2.0)(viem@1.5.3)(wagmi@1.3.9): - resolution: {integrity: sha512-m1B9/X3p8MLmj4fDfs2NpJlFRmKz7vOR0jmcdBw2SMFzXqP1FQFQc4pjvtLEeyfEUGSNNceGrecFZRVS0Qk//A==} + /@rainbow-me/rainbowkit@1.2.0(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(viem@1.19.9)(wagmi@1.4.5): + resolution: {integrity: sha512-XjdeX31GwFdRR/1rCRqPXiO94nbq2qOlnaox5P4K/KMRIUwyelKzak27uWw8Krmor/Hcrd5FisfepGDS0tUfEA==} engines: {node: '>=12.4'} peerDependencies: react: '>=17' react-dom: '>=17' viem: ~0.3.19 || ^1.0.0 - wagmi: ~1.0.1 || ~1.1.0 || ~1.2.0 || ~1.3.0 + wagmi: ~1.0.1 || ~1.1.0 || ~1.2.0 || ~1.3.0 || ~1.4.0 dependencies: '@vanilla-extract/css': 1.9.1 '@vanilla-extract/dynamic': 2.0.2 '@vanilla-extract/sprinkles': 1.5.0(@vanilla-extract/css@1.9.1) clsx: 1.1.1 + i18n-js: 4.3.2 qrcode: 1.5.0 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-remove-scroll: 2.5.4(@types/react@18.2.31)(react@18.2.0) - viem: 1.5.3(typescript@5.1.6)(zod@3.22.4) - wagmi: 1.3.9(@types/react@18.2.31)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@1.5.3)(zod@3.22.4) + react-remove-scroll: 2.5.4(@types/react@18.2.33)(react@18.2.0) + ua-parser-js: 1.0.36 + viem: 1.19.9(typescript@5.1.6)(zod@3.22.4) + wagmi: 1.4.5(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@1.19.9)(zod@3.22.4) transitivePeerDependencies: - '@types/react' dev: false @@ -10501,6 +12019,7 @@ packages: prompts: 2.4.2 transitivePeerDependencies: - encoding + dev: false /@react-native-community/cli-config@11.3.7: resolution: {integrity: sha512-FDBLku9xskS+bx0YFJFLCmUJhEZ4/MMSC9qPYOGBollWYdgE7k/TWI0IeYFmMALAnbCdKQAYP5N29N55Tad8lg==} @@ -10513,6 +12032,7 @@ packages: joi: 17.11.0 transitivePeerDependencies: - encoding + dev: false /@react-native-community/cli-debugger-ui@11.3.7: resolution: {integrity: sha512-aVmKuPKHZENR8SrflkMurZqeyLwbKieHdOvaZCh1Nn/0UC5CxWcyST2DB2XQboZwsvr3/WXKJkSUO+SZ1J9qTQ==} @@ -10520,6 +12040,7 @@ packages: serve-static: 1.15.0 transitivePeerDependencies: - supports-color + dev: false /@react-native-community/cli-doctor@11.3.7: resolution: {integrity: sha512-YEHUqWISOHnsl5+NM14KHelKh68Sr5/HeEZvvNdIcvcKtZic3FU7Xd1WcbNdo3gCq5JvzGFfufx02Tabh5zmrg==} @@ -10544,6 +12065,7 @@ packages: yaml: 2.3.3 transitivePeerDependencies: - encoding + dev: false /@react-native-community/cli-hermes@11.3.7: resolution: {integrity: sha512-chkKd8n/xeZkinRvtH6QcYA8rjNOKU3S3Lw/3Psxgx+hAYV0Gyk95qJHTalx7iu+PwjOOqqvCkJo5jCkYLkoqw==} @@ -10555,6 +12077,7 @@ packages: ip: 1.1.8 transitivePeerDependencies: - encoding + dev: false /@react-native-community/cli-platform-android@11.3.7: resolution: {integrity: sha512-WGtXI/Rm178UQb8bu1TAeFC/RJvYGnbHpULXvE20GkmeJ1HIrMjkagyk6kkY3Ej25JAP2R878gv+TJ/XiRhaEg==} @@ -10566,6 +12089,7 @@ packages: logkitty: 0.7.1 transitivePeerDependencies: - encoding + dev: false /@react-native-community/cli-platform-ios@11.3.7: resolution: {integrity: sha512-Z/8rseBput49EldX7MogvN6zJlWzZ/4M97s2P+zjS09ZoBU7I0eOKLi0N9wx+95FNBvGQQ/0P62bB9UaFQH2jw==} @@ -10578,8 +12102,9 @@ packages: ora: 5.4.1 transitivePeerDependencies: - encoding + dev: false - /@react-native-community/cli-plugin-metro@11.3.7(@babel/core@7.23.2): + /@react-native-community/cli-plugin-metro@11.3.7(@babel/core@7.23.5): resolution: {integrity: sha512-0WhgoBVGF1f9jXcuagQmtxpwpfP+2LbLZH4qMyo6OtYLWLG13n2uRep+8tdGzfNzl1bIuUTeE9yZSAdnf9LfYQ==} dependencies: '@react-native-community/cli-server-api': 11.3.7 @@ -10589,7 +12114,7 @@ packages: metro: 0.76.8 metro-config: 0.76.8 metro-core: 0.76.8 - metro-react-native-babel-transformer: 0.76.8(@babel/core@7.23.2) + metro-react-native-babel-transformer: 0.76.8(@babel/core@7.23.5) metro-resolver: 0.76.8 metro-runtime: 0.76.8 readline: 1.3.0 @@ -10599,6 +12124,7 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /@react-native-community/cli-server-api@11.3.7: resolution: {integrity: sha512-yoFyGdvR3HxCnU6i9vFqKmmSqFzCbnFSnJ29a+5dppgPRetN+d//O8ard/YHqHzToFnXutAFf2neONn23qcJAg==} @@ -10617,6 +12143,7 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /@react-native-community/cli-tools@11.3.7: resolution: {integrity: sha512-peyhP4TV6Ps1hk+MBHTFaIR1eI3u+OfGBvr5r0wPwo3FAJvldRinMgcB/TcCcOBXVORu7ba1XYjkubPeYcqAyA==} @@ -10632,13 +12159,15 @@ packages: shell-quote: 1.8.1 transitivePeerDependencies: - encoding + dev: false /@react-native-community/cli-types@11.3.7: resolution: {integrity: sha512-OhSr/TiDQkXjL5YOs8+hvGSB+HltLn5ZI0+A3DCiMsjUgTTsYh+Z63OtyMpNjrdCEFcg0MpfdU2uxstCS6Dc5g==} dependencies: joi: 17.11.0 + dev: false - /@react-native-community/cli@11.3.7(@babel/core@7.23.2): + /@react-native-community/cli@11.3.7(@babel/core@7.23.5): resolution: {integrity: sha512-Ou8eDlF+yh2rzXeCTpMPYJ2fuqsusNOhmpYPYNQJQ2h6PvaF30kPomflgRILems+EBBuggRtcT+I+1YH4o/q6w==} engines: {node: '>=16'} hasBin: true @@ -10648,7 +12177,7 @@ packages: '@react-native-community/cli-debugger-ui': 11.3.7 '@react-native-community/cli-doctor': 11.3.7 '@react-native-community/cli-hermes': 11.3.7 - '@react-native-community/cli-plugin-metro': 11.3.7(@babel/core@7.23.2) + '@react-native-community/cli-plugin-metro': 11.3.7(@babel/core@7.23.5) '@react-native-community/cli-server-api': 11.3.7 '@react-native-community/cli-tools': 11.3.7 '@react-native-community/cli-types': 11.3.7 @@ -10666,31 +12195,37 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /@react-native/assets-registry@0.72.0: resolution: {integrity: sha512-Im93xRJuHHxb1wniGhBMsxLwcfzdYreSZVQGDoMJgkd6+Iky61LInGEHnQCTN0fKNYF1Dvcofb4uMmE1RQHXHQ==} + dev: false - /@react-native/codegen@0.72.7(@babel/preset-env@7.23.2): + /@react-native/codegen@0.72.7(@babel/preset-env@7.23.5): resolution: {integrity: sha512-O7xNcGeXGbY+VoqBGNlZ3O05gxfATlwE1Q1qQf5E38dK+tXn5BY4u0jaQ9DPjfE8pBba8g/BYI1N44lynidMtg==} peerDependencies: '@babel/preset-env': ^7.1.6 dependencies: - '@babel/parser': 7.23.0 - '@babel/preset-env': 7.23.2(@babel/core@7.23.2) + '@babel/parser': 7.23.5 + '@babel/preset-env': 7.23.5(@babel/core@7.23.5) flow-parser: 0.206.0 - jscodeshift: 0.14.0(@babel/preset-env@7.23.2) + jscodeshift: 0.14.0(@babel/preset-env@7.23.5) nullthrows: 1.1.1 transitivePeerDependencies: - supports-color + dev: false /@react-native/gradle-plugin@0.72.11: resolution: {integrity: sha512-P9iRnxiR2w7EHcZ0mJ+fmbPzMby77ZzV6y9sJI3lVLJzF7TLSdbwcQyD3lwMsiL+q5lKUHoZJS4sYmih+P2HXw==} + dev: false /@react-native/js-polyfills@0.72.1: resolution: {integrity: sha512-cRPZh2rBswFnGt5X5EUEPs0r+pAsXxYsifv/fgy9ZLQokuT52bPH+9xjDR+7TafRua5CttGW83wP4TntRcWNDA==} + dev: false /@react-native/normalize-colors@0.72.0: resolution: {integrity: sha512-285lfdqSXaqKuBbbtP9qL2tDrfxdOFtIMvkKadtleRQkdOxx+uzGvFr82KHmc/sSiMtfXGp7JnFYWVh4sFl7Yw==} + dev: false /@react-native/virtualized-lists@0.72.8(react-native@0.72.6): resolution: {integrity: sha512-J3Q4Bkuo99k7mu+jPS9gSUSgq+lLRSI/+ahXNwV92XgJ/8UgOTxu2LPwhJnBk/sQKxq7E8WkZBnBiozukQMqrw==} @@ -10699,56 +12234,17 @@ packages: dependencies: invariant: 2.2.4 nullthrows: 1.1.1 - react-native: 0.72.6(@babel/core@7.23.2)(@babel/preset-env@7.23.2)(react@18.2.0) + react-native: 0.72.6(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(react@18.2.0) + dev: false /@repeaterjs/repeater@3.0.4: resolution: {integrity: sha512-AW8PKd6iX3vAZ0vA43nOUOnbq/X5ihgU+mSXXqunMkeQADGiqw/PY0JNeYtD5sr0PAy51YPgAPbDoeapv9r8WA==} + dev: false /@rescript/std@9.0.0: resolution: {integrity: sha512-zGzFsgtZ44mgL4Xef2gOy1hrRVdrs9mcxCOOKZrIPsmbZW14yTkaF591GXxpQvjXiHtgZ/iA9qLyWH6oSReIxQ==} dev: true - /@resolver-engine/core@0.3.3: - resolution: {integrity: sha512-eB8nEbKDJJBi5p5SrvrvILn4a0h42bKtbCTri3ZxCGt6UvoQyp7HnGOfki944bUjBSHKK3RvgfViHn+kqdXtnQ==} - dependencies: - debug: 3.2.7(supports-color@8.1.1) - is-url: 1.2.4 - request: 2.88.2 - transitivePeerDependencies: - - supports-color - dev: true - - /@resolver-engine/fs@0.3.3: - resolution: {integrity: sha512-wQ9RhPUcny02Wm0IuJwYMyAG8fXVeKdmhm8xizNByD4ryZlx6PP6kRen+t/haF43cMfmaV7T3Cx6ChOdHEhFUQ==} - dependencies: - '@resolver-engine/core': 0.3.3 - debug: 3.2.7(supports-color@8.1.1) - transitivePeerDependencies: - - supports-color - dev: true - - /@resolver-engine/imports-fs@0.3.3: - resolution: {integrity: sha512-7Pjg/ZAZtxpeyCFlZR5zqYkz+Wdo84ugB5LApwriT8XFeQoLwGUj4tZFFvvCuxaNCcqZzCYbonJgmGObYBzyCA==} - dependencies: - '@resolver-engine/fs': 0.3.3 - '@resolver-engine/imports': 0.3.3 - debug: 3.2.7(supports-color@8.1.1) - transitivePeerDependencies: - - supports-color - dev: true - - /@resolver-engine/imports@0.3.3: - resolution: {integrity: sha512-anHpS4wN4sRMwsAbMXhMfOD/y4a4Oo0Cw/5+rue7hSwGWsDOQaAU1ClK1OxjUC35/peazxEl8JaSRRS+Xb8t3Q==} - dependencies: - '@resolver-engine/core': 0.3.3 - debug: 3.2.7(supports-color@8.1.1) - hosted-git-info: 2.8.9 - path-browserify: 1.0.1 - url: 0.11.3 - transitivePeerDependencies: - - supports-color - dev: true - /@rollup/plugin-commonjs@24.0.0(rollup@2.78.0): resolution: {integrity: sha512-0w0wyykzdyRRPHOb0cQt14mIBLujfAv6GgP6g8nvg/iBxEm112t3YPPq+Buqe2+imvElTka+bjNlJ/gB56TD8g==} engines: {node: '>=14.0.0'} @@ -10918,6 +12414,14 @@ packages: dev: true optional: true + /@rollup/rollup-android-arm-eabi@4.6.1: + resolution: {integrity: sha512-0WQ0ouLejaUCRsL93GD4uft3rOmB8qoQMU05Kb8CmMtMBe7XUDLAltxVZI1q6byNqEtU7N1ZX1Vw5lIpgulLQA==} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-android-arm64@4.1.4: resolution: {integrity: sha512-D1e+ABe56T9Pq2fD+R3ybe1ylCDzu3tY4Qm2Mj24R9wXNCq35+JbFbOpc2yrroO2/tGhTobmEl2Bm5xfE/n8RA==} cpu: [arm64] @@ -10926,6 +12430,14 @@ packages: dev: true optional: true + /@rollup/rollup-android-arm64@4.6.1: + resolution: {integrity: sha512-1TKm25Rn20vr5aTGGZqo6E4mzPicCUD79k17EgTLAsXc1zysyi4xXKACfUbwyANEPAEIxkzwue6JZ+stYzWUTA==} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-darwin-arm64@4.1.4: resolution: {integrity: sha512-7vTYrgEiOrjxnjsgdPB+4i7EMxbVp7XXtS+50GJYj695xYTTEMn3HZVEvgtwjOUkAP/Q4HDejm4fIAjLeAfhtg==} cpu: [arm64] @@ -10934,6 +12446,14 @@ packages: dev: true optional: true + /@rollup/rollup-darwin-arm64@4.6.1: + resolution: {integrity: sha512-cEXJQY/ZqMACb+nxzDeX9IPLAg7S94xouJJCNVE5BJM8JUEP4HeTF+ti3cmxWeSJo+5D+o8Tc0UAWUkfENdeyw==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-darwin-x64@4.1.4: resolution: {integrity: sha512-eGJVZScKSLZkYjhTAESCtbyTBq9SXeW9+TX36ki5gVhDqJtnQ5k0f9F44jNK5RhAMgIj0Ht9+n6HAgH0gUUyWQ==} cpu: [x64] @@ -10942,6 +12462,14 @@ packages: dev: true optional: true + /@rollup/rollup-darwin-x64@4.6.1: + resolution: {integrity: sha512-LoSU9Xu56isrkV2jLldcKspJ7sSXmZWkAxg7sW/RfF7GS4F5/v4EiqKSMCFbZtDu2Nc1gxxFdQdKwkKS4rwxNg==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-linux-arm-gnueabihf@4.1.4: resolution: {integrity: sha512-HnigYSEg2hOdX1meROecbk++z1nVJDpEofw9V2oWKqOWzTJlJf1UXVbDE6Hg30CapJxZu5ga4fdAQc/gODDkKg==} cpu: [arm] @@ -10950,6 +12478,14 @@ packages: dev: true optional: true + /@rollup/rollup-linux-arm-gnueabihf@4.6.1: + resolution: {integrity: sha512-EfI3hzYAy5vFNDqpXsNxXcgRDcFHUWSx5nnRSCKwXuQlI5J9dD84g2Usw81n3FLBNsGCegKGwwTVsSKK9cooSQ==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-linux-arm64-gnu@4.1.4: resolution: {integrity: sha512-TzJ+N2EoTLWkaClV2CUhBlj6ljXofaYzF/R9HXqQ3JCMnCHQZmQnbnZllw7yTDp0OG5whP4gIPozR4QiX+00MQ==} cpu: [arm64] @@ -10958,6 +12494,14 @@ packages: dev: true optional: true + /@rollup/rollup-linux-arm64-gnu@4.6.1: + resolution: {integrity: sha512-9lhc4UZstsegbNLhH0Zu6TqvDfmhGzuCWtcTFXY10VjLLUe4Mr0Ye2L3rrtHaDd/J5+tFMEuo5LTCSCMXWfUKw==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-linux-arm64-musl@4.1.4: resolution: {integrity: sha512-aVPmNMdp6Dlo2tWkAduAD/5TL/NT5uor290YvjvFvCv0Q3L7tVdlD8MOGDL+oRSw5XKXKAsDzHhUOPUNPRHVTQ==} cpu: [arm64] @@ -10966,6 +12510,14 @@ packages: dev: true optional: true + /@rollup/rollup-linux-arm64-musl@4.6.1: + resolution: {integrity: sha512-FfoOK1yP5ksX3wwZ4Zk1NgyGHZyuRhf99j64I5oEmirV8EFT7+OhUZEnP+x17lcP/QHJNWGsoJwrz4PJ9fBEXw==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-linux-x64-gnu@4.1.4: resolution: {integrity: sha512-77Fb79ayiDad0grvVsz4/OB55wJRyw9Ao+GdOBA9XywtHpuq5iRbVyHToGxWquYWlEf6WHFQQnFEttsAzboyKg==} cpu: [x64] @@ -10974,6 +12526,14 @@ packages: dev: true optional: true + /@rollup/rollup-linux-x64-gnu@4.6.1: + resolution: {integrity: sha512-DNGZvZDO5YF7jN5fX8ZqmGLjZEXIJRdJEdTFMhiyXqyXubBa0WVLDWSNlQ5JR2PNgDbEV1VQowhVRUh+74D+RA==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-linux-x64-musl@4.1.4: resolution: {integrity: sha512-/t6C6niEQTqmQTVTD9TDwUzxG91Mlk69/v0qodIPUnjjB3wR4UA3klg+orR2SU3Ux2Cgf2pWPL9utK80/1ek8g==} cpu: [x64] @@ -10982,6 +12542,14 @@ packages: dev: true optional: true + /@rollup/rollup-linux-x64-musl@4.6.1: + resolution: {integrity: sha512-RkJVNVRM+piYy87HrKmhbexCHg3A6Z6MU0W9GHnJwBQNBeyhCJG9KDce4SAMdicQnpURggSvtbGo9xAWOfSvIQ==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-win32-arm64-msvc@4.1.4: resolution: {integrity: sha512-ZY5BHHrOPkMbCuGWFNpJH0t18D2LU6GMYKGaqaWTQ3CQOL57Fem4zE941/Ek5pIsVt70HyDXssVEFQXlITI5Gg==} cpu: [arm64] @@ -10990,6 +12558,14 @@ packages: dev: true optional: true + /@rollup/rollup-win32-arm64-msvc@4.6.1: + resolution: {integrity: sha512-v2FVT6xfnnmTe3W9bJXl6r5KwJglMK/iRlkKiIFfO6ysKs0rDgz7Cwwf3tjldxQUrHL9INT/1r4VA0n9L/F1vQ==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-win32-ia32-msvc@4.1.4: resolution: {integrity: sha512-XG2mcRfFrJvYyYaQmvCIvgfkaGinfXrpkBuIbJrTl9SaIQ8HumheWTIwkNz2mktCKwZfXHQNpO7RgXLIGQ7HXA==} cpu: [ia32] @@ -10998,6 +12574,14 @@ packages: dev: true optional: true + /@rollup/rollup-win32-ia32-msvc@4.6.1: + resolution: {integrity: sha512-YEeOjxRyEjqcWphH9dyLbzgkF8wZSKAKUkldRY6dgNR5oKs2LZazqGB41cWJ4Iqqcy9/zqYgmzBkRoVz3Q9MLw==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-win32-x64-msvc@4.1.4: resolution: {integrity: sha512-ANFqWYPwkhIqPmXw8vm0GpBEHiPpqcm99jiiAp71DbCSqLDhrtr019C5vhD0Bw4My+LmMvciZq6IsWHqQpl2ZQ==} cpu: [x64] @@ -11006,6 +12590,14 @@ packages: dev: true optional: true + /@rollup/rollup-win32-x64-msvc@4.6.1: + resolution: {integrity: sha512-0zfTlFAIhgz8V2G8STq8toAjsYYA6eci1hnXuyOTUFnymrtJwnS6uGKiv3v5UrPZkBlamLvrLV2iiaeqCKzb0A==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@rushstack/eslint-patch@1.5.1: resolution: {integrity: sha512-6i/8UoL0P5y4leBIGzvkZdS85RDMG9y1ihZzmTZQ5LdHUYmZ7pKFoj8X0236s3lusPs1Fa5HTQUpwI+UfTcmeA==} dev: true @@ -11026,7 +12618,7 @@ packages: resolution: {integrity: sha512-gYw0ki/EAuV1oSyMxpqandHjnthZjYYy+YWpTAzf8BqfXM3ItcZLpjxfg+3+mXW8HIO+3jw6T9iiqEXsqHaMMw==} dependencies: '@safe-global/safe-gateway-typescript-sdk': 3.12.0 - viem: 1.5.3(typescript@5.1.6)(zod@3.22.4) + viem: 1.19.9(typescript@5.1.6)(zod@3.22.4) transitivePeerDependencies: - bufferutil - typescript @@ -11038,7 +12630,7 @@ packages: resolution: {integrity: sha512-XJbEPuaVc7b9n23MqlF6c+ToYIS3f7P2Sel8f3cSBQ9WORE4xrSuvhMpK9fDSFqJ7by/brc+rmJR/5HViRr0/w==} dependencies: '@safe-global/safe-gateway-typescript-sdk': 3.12.0 - viem: 1.5.3(typescript@5.1.6)(zod@3.22.4) + viem: 1.19.9(typescript@5.1.6)(zod@3.22.4) transitivePeerDependencies: - bufferutil - typescript @@ -11065,17 +12657,25 @@ packages: resolution: {integrity: sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q==} dependencies: '@noble/curves': 1.0.0 - '@noble/hashes': 1.3.0 + '@noble/hashes': 1.3.2 '@scure/base': 1.1.3 + dev: true /@scure/bip32@1.3.1: resolution: {integrity: sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==} dependencies: '@noble/curves': 1.1.0 - '@noble/hashes': 1.3.1 + '@noble/hashes': 1.3.2 '@scure/base': 1.1.3 dev: true + /@scure/bip32@1.3.2: + resolution: {integrity: sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==} + dependencies: + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@scure/base': 1.1.3 + /@scure/bip39@1.1.1: resolution: {integrity: sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==} dependencies: @@ -11085,36 +12685,34 @@ packages: /@scure/bip39@1.2.0: resolution: {integrity: sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg==} dependencies: - '@noble/hashes': 1.3.0 + '@noble/hashes': 1.3.2 '@scure/base': 1.1.3 + dev: true /@scure/bip39@1.2.1: resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} dependencies: - '@noble/hashes': 1.3.1 + '@noble/hashes': 1.3.2 '@scure/base': 1.1.3 - dev: true - /@sentry-internal/tracing@7.74.1: - resolution: {integrity: sha512-nNaiZreQxCitG2PzYPaC7XtyA9OMsETGYMKAtiK4p62/uTmeYbsBva9BoNx1XeiHRwbrVQYRMKQ9nV5e2jS4/A==} + /@sentry-internal/tracing@7.75.1: + resolution: {integrity: sha512-nynV+7iVcF8k3CqhvI2K7iA8h4ovJhgYHKnXR8RDDevQOqNG2AEX9+hjCj9fZM4MhKHYFqf1od2oO9lTr38kwg==} engines: {node: '>=8'} dependencies: - '@sentry/core': 7.74.1 - '@sentry/types': 7.74.1 - '@sentry/utils': 7.74.1 - tslib: 2.6.2 + '@sentry/core': 7.75.1 + '@sentry/types': 7.75.1 + '@sentry/utils': 7.75.1 dev: false - /@sentry/browser@7.74.1: - resolution: {integrity: sha512-OYWNne/KO60lOvkIpIlJUyiJt/9j8DGI57thSDFEYSmmbNqMitczUTBOaEStouvHKyfchqLZm1CZfWKt+z0VOA==} + /@sentry/browser@7.75.1: + resolution: {integrity: sha512-0+jPfPA5P9HVYYRQraDokGCY2NiMknSfz11dggClK4VmjvG+hOXiEyf73SFVwLFnv/hwrkWySjoIrVCX65xXQA==} engines: {node: '>=8'} dependencies: - '@sentry-internal/tracing': 7.74.1 - '@sentry/core': 7.74.1 - '@sentry/replay': 7.74.1 - '@sentry/types': 7.74.1 - '@sentry/utils': 7.74.1 - tslib: 2.6.2 + '@sentry-internal/tracing': 7.75.1 + '@sentry/core': 7.75.1 + '@sentry/replay': 7.75.1 + '@sentry/types': 7.75.1 + '@sentry/utils': 7.75.1 dev: false /@sentry/cli@1.75.2: @@ -11160,13 +12758,12 @@ packages: '@sentry/utils': 5.30.0 tslib: 1.14.1 - /@sentry/core@7.74.1: - resolution: {integrity: sha512-LvEhOSfdIvwkr+PdlrT/aA/iOLhkXrSkvjqAQyogE4ddCWeYfS0NoirxNt1EaxMBAWKhYZRqzkA7WA4LDLbzlA==} + /@sentry/core@7.75.1: + resolution: {integrity: sha512-Kw4KyKBxbxbh8OKO0S11Tm0gWP+6AaXXYrsq3hp8H338l/wOmIzyckmCbUrc/XJeoRqaFLJbdcCrcUEDZUvsVQ==} engines: {node: '>=8'} dependencies: - '@sentry/types': 7.74.1 - '@sentry/utils': 7.74.1 - tslib: 2.6.2 + '@sentry/types': 7.75.1 + '@sentry/utils': 7.75.1 dev: false /@sentry/hub@5.30.0: @@ -11177,15 +12774,14 @@ packages: '@sentry/utils': 5.30.0 tslib: 1.14.1 - /@sentry/integrations@7.74.1: - resolution: {integrity: sha512-Q7chPehHpHB4WOQ1J/X6NiN2ptiqJMmxtL+6wHumzIAyrjup3c9XekR83qEs8zpqYJAlb/4MUlwd9fPbkhGXnQ==} + /@sentry/integrations@7.75.1: + resolution: {integrity: sha512-qSCyTNX3DiL1aYRmdq10LRhPLfh1KJYKhbmGszC1PII4mt9FbLVmC8fSXiDbhgiuSUKKrDE+J2lC//w688lvHw==} engines: {node: '>=8'} dependencies: - '@sentry/core': 7.74.1 - '@sentry/types': 7.74.1 - '@sentry/utils': 7.74.1 + '@sentry/core': 7.75.1 + '@sentry/types': 7.75.1 + '@sentry/utils': 7.75.1 localforage: 1.10.0 - tslib: 2.6.2 dev: false /@sentry/minimal@5.30.0: @@ -11196,8 +12792,8 @@ packages: '@sentry/types': 5.30.0 tslib: 1.14.1 - /@sentry/nextjs@7.74.1(next@13.5.6)(react@18.2.0)(webpack@5.89.0): - resolution: {integrity: sha512-1RySEs3WBEqlpQCAFQ/XwV+oW4wEAtpYglvAyDBwPen/s6KnkkZ0za0l3Ug0O6S9HvMiNll1rPhvnkH5nM37Tg==} + /@sentry/nextjs@7.75.1(next@13.5.6)(react@18.2.0)(webpack@5.89.0): + resolution: {integrity: sha512-5DEW6Ksjuox8idf3O0NclF/rHSS0Z1VCIoFHW6d28FHFKU+/RkFwJTB13KfpQMBj1fiA9qSNJdy/2QlGUWVRmA==} engines: {node: '>=8'} peerDependencies: next: ^10.0.8 || ^11.0 || ^12.0 || ^13.0 @@ -11208,21 +12804,20 @@ packages: optional: true dependencies: '@rollup/plugin-commonjs': 24.0.0(rollup@2.78.0) - '@sentry/core': 7.74.1 - '@sentry/integrations': 7.74.1 - '@sentry/node': 7.74.1 - '@sentry/react': 7.74.1(react@18.2.0) - '@sentry/types': 7.74.1 - '@sentry/utils': 7.74.1 - '@sentry/vercel-edge': 7.74.1 + '@sentry/core': 7.75.1 + '@sentry/integrations': 7.75.1 + '@sentry/node': 7.75.1 + '@sentry/react': 7.75.1(react@18.2.0) + '@sentry/types': 7.75.1 + '@sentry/utils': 7.75.1 + '@sentry/vercel-edge': 7.75.1 '@sentry/webpack-plugin': 1.20.0 chalk: 3.0.0 - next: 13.5.6(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) + next: 13.5.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 resolve: 1.22.8 rollup: 2.78.0 stacktrace-parser: 0.1.10 - tslib: 2.6.2 webpack: 5.89.0(webpack-cli@5.1.4) transitivePeerDependencies: - encoding @@ -11245,43 +12840,40 @@ packages: transitivePeerDependencies: - supports-color - /@sentry/node@7.74.1: - resolution: {integrity: sha512-aMUQ2LFZF64FBr+cgjAqjT4OkpYBIC9lyWI8QqjEHqNho5+LGu18/iVrJPD4fgs4UhGdCuAiQjpC36MbmnIDZA==} + /@sentry/node@7.75.1: + resolution: {integrity: sha512-E174NbP3j7OIqQQYPtpMGz1FfL/KE5PeGnhoACyMIk0D5MGB7Ia7Y9+nYfHB7+EOJPV2Ob6BYlhemX/MxPrYWg==} engines: {node: '>=8'} dependencies: - '@sentry-internal/tracing': 7.74.1 - '@sentry/core': 7.74.1 - '@sentry/types': 7.74.1 - '@sentry/utils': 7.74.1 - cookie: 0.5.0 + '@sentry-internal/tracing': 7.75.1 + '@sentry/core': 7.75.1 + '@sentry/types': 7.75.1 + '@sentry/utils': 7.75.1 https-proxy-agent: 5.0.1 - lru_map: 0.3.3 - tslib: 2.6.2 transitivePeerDependencies: - supports-color dev: false - /@sentry/react@7.74.1(react@18.2.0): - resolution: {integrity: sha512-16oTsNi2hl/S5AL/e5bo9DQZDwXPkX0nC8ajrpU0z2pH4cwjQZUZt/9Xq1+MKqDIEZkqDcMwpTmBptOvy1Pvkw==} + /@sentry/react@7.75.1(react@18.2.0): + resolution: {integrity: sha512-5zFcIor8vwQa13VRwk7yDE8U7uspj0eKpsjOcYcfSvDkiL7LW0sA6rXxvO3jwd1AKaB3EAfr1F4oIdEz8aRIkA==} engines: {node: '>=8'} peerDependencies: react: 15.x || 16.x || 17.x || 18.x dependencies: - '@sentry/browser': 7.74.1 - '@sentry/types': 7.74.1 - '@sentry/utils': 7.74.1 + '@sentry/browser': 7.75.1 + '@sentry/types': 7.75.1 + '@sentry/utils': 7.75.1 hoist-non-react-statics: 3.3.2 react: 18.2.0 - tslib: 2.6.2 dev: false - /@sentry/replay@7.74.1: - resolution: {integrity: sha512-qmbOl+jYdyhoHFbPp9WemKx8UojID5hVmuVLxNIP0ANqAwmE9OQEK9YFg2cf7L/TpKb1tqz0qLgi5MYIdcdpgQ==} + /@sentry/replay@7.75.1: + resolution: {integrity: sha512-MKQTDWNYs9QXCJ+irGX5gu8Kxdk/Ds5puhILy8+DnCoXgXuPFRMGob1Sxt8qXmbQmcGeogsx221MNTselsRS6g==} engines: {node: '>=12'} dependencies: - '@sentry/core': 7.74.1 - '@sentry/types': 7.74.1 - '@sentry/utils': 7.74.1 + '@sentry-internal/tracing': 7.75.1 + '@sentry/core': 7.75.1 + '@sentry/types': 7.75.1 + '@sentry/utils': 7.75.1 dev: false /@sentry/tracing@5.30.0: @@ -11298,8 +12890,8 @@ packages: resolution: {integrity: sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==} engines: {node: '>=6'} - /@sentry/types@7.74.1: - resolution: {integrity: sha512-2jIuPc+YKvXqZETwr2E8VYnsH1zsSUR/wkIvg1uTVeVNyoowJv+YsOtCdeGyL2AwiotUBSPKu7O1Lz0kq5rMOQ==} + /@sentry/types@7.75.1: + resolution: {integrity: sha512-km+ygqgMDaFfTrbQwdhrptFqx0Oq15jZABqIoIpbaOCkCAMm+tyCqrFS8dTfaq5wpCktqWOy2qU/DOpppO99Cg==} engines: {node: '>=8'} dev: false @@ -11310,22 +12902,20 @@ packages: '@sentry/types': 5.30.0 tslib: 1.14.1 - /@sentry/utils@7.74.1: - resolution: {integrity: sha512-qUsqufuHYcy5gFhLZslLxA5kcEOkkODITXW3c7D+x+8iP/AJqa8v8CeUCVNS7RetHCuIeWAbbTClC4c411EwQg==} + /@sentry/utils@7.75.1: + resolution: {integrity: sha512-QzW2eRjY20epD//9/tQ0FTNwdAL6XZi+LyJNUQIeK3NMnc5NgHrgpxId87gmFq8cNx47utH1Blub8RuMbKqiwQ==} engines: {node: '>=8'} dependencies: - '@sentry/types': 7.74.1 - tslib: 2.6.2 + '@sentry/types': 7.75.1 dev: false - /@sentry/vercel-edge@7.74.1: - resolution: {integrity: sha512-E2lTfEtDFSh57EkjVe4EcgcdjOM8UvfZVsmANBqG4bnwRKrNX9GouClzKU2Ckd5vQnOiCH9r8x2aJ/dTqyBswQ==} + /@sentry/vercel-edge@7.75.1: + resolution: {integrity: sha512-TCiObqegXdWkObf0YUDTvAPgGS5rOpRtZKQmjJ03ZahwrSMZTWESvlKo1V/5JhgfZSRWJTvDnJAtomteopT5/A==} engines: {node: '>=8'} dependencies: - '@sentry/core': 7.74.1 - '@sentry/types': 7.74.1 - '@sentry/utils': 7.74.1 - tslib: 2.6.2 + '@sentry/core': 7.75.1 + '@sentry/types': 7.75.1 + '@sentry/utils': 7.75.1 dev: false /@sentry/webpack-plugin@1.20.0: @@ -11363,6 +12953,11 @@ packages: engines: {node: '>=4'} dev: true + /@sindresorhus/is@4.6.0: + resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} + engines: {node: '>=10'} + dev: true + /@sinonjs/commons@2.0.0: resolution: {integrity: sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==} dependencies: @@ -11379,6 +12974,12 @@ packages: dependencies: '@sinonjs/commons': 3.0.0 + /@sinonjs/fake-timers@11.2.2: + resolution: {integrity: sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==} + dependencies: + '@sinonjs/commons': 3.0.0 + dev: true + /@sinonjs/samsam@8.0.0: resolution: {integrity: sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew==} dependencies: @@ -11594,8 +13195,8 @@ packages: '@supabase/node-fetch': 2.6.14 dev: false - /@supabase/realtime-js@2.8.1: - resolution: {integrity: sha512-bka5U4OeoKMdorGMPjdF30cl8n8nbhn+I9H4iySKzbN45W6AGxi7xoODnxdq/QwaDGtVyTMVbU+GVWre0QCdtw==} + /@supabase/realtime-js@2.8.4: + resolution: {integrity: sha512-5C9slLTGikHnYmAnIBOaPogAgbcNY68vnIyE6GpqIKjHElVb6LIi4clwNcjHSj4z6szuvvzj8T/+ePEgGEGekw==} dependencies: '@supabase/node-fetch': 2.6.14 '@types/phoenix': 1.6.3 @@ -11611,114 +13212,114 @@ packages: '@supabase/node-fetch': 2.6.14 dev: false - /@supabase/supabase-js@2.38.2: - resolution: {integrity: sha512-yOCi94oO5WVUBhQ890BvtT7J3p8spP47PMhn22YldIcDLEQWE6N6X2JzfWCLHktXw+oCYUJfQBuqYhyLHAKb0w==} + /@supabase/supabase-js@2.38.3: + resolution: {integrity: sha512-qIQxXZJN42iM41VChBo3kmGNyRhM0LOk27fkTX8A4tHnWxt0zmxMGFKVCX7Qnrz8zttiJkcym/BZreM/F9k0FQ==} dependencies: '@supabase/functions-js': 2.1.5 '@supabase/gotrue-js': 2.57.0 '@supabase/node-fetch': 2.6.14 '@supabase/postgrest-js': 1.8.5 - '@supabase/realtime-js': 2.8.1 + '@supabase/realtime-js': 2.8.4 '@supabase/storage-js': 2.5.4 transitivePeerDependencies: - supports-color dev: false - /@svgr/babel-plugin-add-jsx-attribute@6.5.1(@babel/core@7.23.2): + /@svgr/babel-plugin-add-jsx-attribute@6.5.1(@babel/core@7.23.5): resolution: {integrity: sha512-9PYGcXrAxitycIjRmZB+Q0JaN07GZIWaTBIGQzfaZv+qr1n8X1XUEJ5rZ/vx6OVD9RRYlrNnXWExQXcmZeD/BQ==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 dev: false - /@svgr/babel-plugin-remove-jsx-attribute@8.0.0(@babel/core@7.23.2): + /@svgr/babel-plugin-remove-jsx-attribute@8.0.0(@babel/core@7.23.5): resolution: {integrity: sha512-BcCkm/STipKvbCl6b7QFrMh/vx00vIP63k2eM66MfHJzPr6O2U0jYEViXkHJWqXqQYjdeA9cuCl5KWmlwjDvbA==} engines: {node: '>=14'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 dev: false - /@svgr/babel-plugin-remove-jsx-empty-expression@8.0.0(@babel/core@7.23.2): + /@svgr/babel-plugin-remove-jsx-empty-expression@8.0.0(@babel/core@7.23.5): resolution: {integrity: sha512-5BcGCBfBxB5+XSDSWnhTThfI9jcO5f0Ai2V24gZpG+wXF14BzwxxdDb4g6trdOux0rhibGs385BeFMSmxtS3uA==} engines: {node: '>=14'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 dev: false - /@svgr/babel-plugin-replace-jsx-attribute-value@6.5.1(@babel/core@7.23.2): + /@svgr/babel-plugin-replace-jsx-attribute-value@6.5.1(@babel/core@7.23.5): resolution: {integrity: sha512-8DPaVVE3fd5JKuIC29dqyMB54sA6mfgki2H2+swh+zNJoynC8pMPzOkidqHOSc6Wj032fhl8Z0TVn1GiPpAiJg==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 dev: false - /@svgr/babel-plugin-svg-dynamic-title@6.5.1(@babel/core@7.23.2): + /@svgr/babel-plugin-svg-dynamic-title@6.5.1(@babel/core@7.23.5): resolution: {integrity: sha512-FwOEi0Il72iAzlkaHrlemVurgSQRDFbk0OC8dSvD5fSBPHltNh7JtLsxmZUhjYBZo2PpcU/RJvvi6Q0l7O7ogw==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 dev: false - /@svgr/babel-plugin-svg-em-dimensions@6.5.1(@babel/core@7.23.2): + /@svgr/babel-plugin-svg-em-dimensions@6.5.1(@babel/core@7.23.5): resolution: {integrity: sha512-gWGsiwjb4tw+ITOJ86ndY/DZZ6cuXMNE/SjcDRg+HLuCmwpcjOktwRF9WgAiycTqJD/QXqL2f8IzE2Rzh7aVXA==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 dev: false - /@svgr/babel-plugin-transform-react-native-svg@6.5.1(@babel/core@7.23.2): + /@svgr/babel-plugin-transform-react-native-svg@6.5.1(@babel/core@7.23.5): resolution: {integrity: sha512-2jT3nTayyYP7kI6aGutkyfJ7UMGtuguD72OjeGLwVNyfPRBD8zQthlvL+fAbAKk5n9ZNcvFkp/b1lZ7VsYqVJg==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 dev: false - /@svgr/babel-plugin-transform-svg-component@6.5.1(@babel/core@7.23.2): + /@svgr/babel-plugin-transform-svg-component@6.5.1(@babel/core@7.23.5): resolution: {integrity: sha512-a1p6LF5Jt33O3rZoVRBqdxL350oge54iZWHNI6LJB5tQ7EelvD/Mb1mfBiZNAan0dt4i3VArkFRjA4iObuNykQ==} engines: {node: '>=12'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 dev: false - /@svgr/babel-preset@6.5.1(@babel/core@7.23.2): + /@svgr/babel-preset@6.5.1(@babel/core@7.23.5): resolution: {integrity: sha512-6127fvO/FF2oi5EzSQOAjo1LE3OtNVh11R+/8FXa+mHx1ptAaS4cknIjnUA7e6j6fwGGJ17NzaTJFUwOV2zwCw==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 - '@svgr/babel-plugin-add-jsx-attribute': 6.5.1(@babel/core@7.23.2) - '@svgr/babel-plugin-remove-jsx-attribute': 8.0.0(@babel/core@7.23.2) - '@svgr/babel-plugin-remove-jsx-empty-expression': 8.0.0(@babel/core@7.23.2) - '@svgr/babel-plugin-replace-jsx-attribute-value': 6.5.1(@babel/core@7.23.2) - '@svgr/babel-plugin-svg-dynamic-title': 6.5.1(@babel/core@7.23.2) - '@svgr/babel-plugin-svg-em-dimensions': 6.5.1(@babel/core@7.23.2) - '@svgr/babel-plugin-transform-react-native-svg': 6.5.1(@babel/core@7.23.2) - '@svgr/babel-plugin-transform-svg-component': 6.5.1(@babel/core@7.23.2) + '@babel/core': 7.23.5 + '@svgr/babel-plugin-add-jsx-attribute': 6.5.1(@babel/core@7.23.5) + '@svgr/babel-plugin-remove-jsx-attribute': 8.0.0(@babel/core@7.23.5) + '@svgr/babel-plugin-remove-jsx-empty-expression': 8.0.0(@babel/core@7.23.5) + '@svgr/babel-plugin-replace-jsx-attribute-value': 6.5.1(@babel/core@7.23.5) + '@svgr/babel-plugin-svg-dynamic-title': 6.5.1(@babel/core@7.23.5) + '@svgr/babel-plugin-svg-em-dimensions': 6.5.1(@babel/core@7.23.5) + '@svgr/babel-plugin-transform-react-native-svg': 6.5.1(@babel/core@7.23.5) + '@svgr/babel-plugin-transform-svg-component': 6.5.1(@babel/core@7.23.5) dev: false /@svgr/core@6.5.1: resolution: {integrity: sha512-/xdLSWxK5QkqG524ONSjvg3V/FkNyCv538OIBdQqPNaAta3AsXj/Bd2FbvR87yMbXO2hFSWiAe/Q6IkVPDw+mw==} engines: {node: '>=10'} dependencies: - '@babel/core': 7.23.2 - '@svgr/babel-preset': 6.5.1(@babel/core@7.23.2) + '@babel/core': 7.23.5 + '@svgr/babel-preset': 6.5.1(@babel/core@7.23.5) '@svgr/plugin-jsx': 6.5.1(@svgr/core@6.5.1) camelcase: 6.3.0 cosmiconfig: 7.1.0 @@ -11740,8 +13341,8 @@ packages: peerDependencies: '@svgr/core': ^6.0.0 dependencies: - '@babel/core': 7.23.2 - '@svgr/babel-preset': 6.5.1(@babel/core@7.23.2) + '@babel/core': 7.23.5 + '@svgr/babel-preset': 6.5.1(@babel/core@7.23.5) '@svgr/core': 6.5.1 '@svgr/hast-util-to-babel-ast': 6.5.1 svg-parser: 2.0.4 @@ -11765,11 +13366,11 @@ packages: resolution: {integrity: sha512-cQ/AsnBkXPkEK8cLbv4Dm7JGXq2XrumKnL1dRpJD9rIO2fTIlJI9a1uCciYG1F2aUsox/hJQyNGbt3soDxSRkA==} engines: {node: '>=10'} dependencies: - '@babel/core': 7.23.2 - '@babel/plugin-transform-react-constant-elements': 7.22.5(@babel/core@7.23.2) - '@babel/preset-env': 7.23.2(@babel/core@7.23.2) - '@babel/preset-react': 7.22.15(@babel/core@7.23.2) - '@babel/preset-typescript': 7.23.2(@babel/core@7.23.2) + '@babel/core': 7.23.5 + '@babel/plugin-transform-react-constant-elements': 7.22.5(@babel/core@7.23.5) + '@babel/preset-env': 7.23.5(@babel/core@7.23.5) + '@babel/preset-react': 7.22.15(@babel/core@7.23.5) + '@babel/preset-typescript': 7.23.3(@babel/core@7.23.5) '@svgr/core': 6.5.1 '@svgr/plugin-jsx': 6.5.1(@svgr/core@6.5.1) '@svgr/plugin-svgo': 6.5.1(@svgr/core@6.5.1) @@ -11783,12 +13384,12 @@ packages: tslib: 2.6.2 dev: false - /@synthetixio/synpress@3.7.1(@babel/core@7.23.2)(@babel/preset-env@7.23.2)(babel-loader@9.1.3)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(webpack@5.89.0): + /@synthetixio/synpress@3.7.1(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(babel-loader@9.1.3)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.2)(webpack@5.89.0): resolution: {integrity: sha512-fU2+niaDgDvR/7NJwTvMA5WPbAt4fu8c4EMhQH1Lgk8OKSmaovL9xXgOscd90KZyHu6FbW8DNnocJKyiZmELEA==} engines: {node: '>=14'} hasBin: true dependencies: - '@cypress/code-coverage': 3.12.5(@babel/core@7.23.2)(@babel/preset-env@7.23.2)(babel-loader@9.1.3)(cypress@12.17.4)(webpack@5.89.0) + '@cypress/code-coverage': 3.12.6(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(babel-loader@9.1.3)(cypress@12.17.4)(webpack@5.89.0) '@cypress/webpack-dev-server': 3.6.1(debug@4.3.4)(webpack@5.89.0) '@drptbl/gremlins.js': 2.2.1 '@foundry-rs/easy-foundryup': 0.1.3 @@ -11798,7 +13399,7 @@ packages: '@types/testing-library__cypress': 5.0.12 '@viem/anvil': 0.0.5(debug@4.3.4) app-root-path: 3.1.0 - axios: 1.5.1(debug@4.3.4) + axios: 1.6.2(debug@4.3.4) babel-plugin-istanbul: 6.1.1 babel-plugin-react-generate-property: 1.1.2 babel-plugin-react-remove-properties: 0.3.0 @@ -11812,13 +13413,13 @@ packages: dotenv: 16.3.1 dotenv-parse-variables: 2.0.0 download: 8.0.0 - ethers: 5.7.2 + ethers: 6.8.0 etherscan-api: 10.3.0(debug@4.3.4) find-config: 1.0.0 get-port: 6.1.2 node-fetch: 2.7.0 underscore: 1.13.6 - viem: 0.3.50(typescript@5.1.6) + viem: 0.3.50(typescript@5.3.2) wait-on: 7.0.1(debug@4.3.4) transitivePeerDependencies: - '@babel/core' @@ -11843,6 +13444,20 @@ packages: defer-to-connect: 1.1.3 dev: false + /@szmarczak/http-timer@4.0.6: + resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} + engines: {node: '>=10'} + dependencies: + defer-to-connect: 2.0.1 + dev: true + + /@szmarczak/http-timer@5.0.1: + resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} + engines: {node: '>=14.16'} + dependencies: + defer-to-connect: 2.0.1 + dev: true + /@tanstack/match-sorter-utils@8.8.4: resolution: {integrity: sha512-rKH8LjZiszWEvmi01NR72QWZ8m4xmXre0OOwlRGnjU01Eqz/QnN+cqpty2PJ0efHblq09+KilvyR7lsbzmXVEw==} engines: {node: '>=12'} @@ -11905,7 +13520,7 @@ packages: '@tanstack/query-core': 4.36.1 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-native: 0.72.6(@babel/core@7.23.2)(@babel/preset-env@7.23.2)(react@18.2.0) + react-native: 0.72.6(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(react@18.2.0) use-sync-external-store: 1.2.0(react@18.2.0) dev: false @@ -11924,7 +13539,7 @@ packages: resolution: {integrity: sha512-3UqjCpey6HiTZT92vODYLPxTBWlM8ZOOjr3LX5F37/VRipW2M1kX6I/Cm4VXzteZqfGfagg8yXywpcOgQBlNsQ==} engines: {node: '>=10'} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 '@babel/runtime': 7.23.2 '@types/aria-query': 4.2.2 aria-query: 4.2.2 @@ -11938,7 +13553,7 @@ packages: resolution: {integrity: sha512-/DiOQ5xBxgdYRC8LNk7U+RWat0S3qRLeIw3ZIkMQ9kkVlRmwD/Eg8k8CqIpD6GW7u20JIUOfMKbxtiLutpjQ4g==} engines: {node: '>=12'} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 '@babel/runtime': 7.23.2 '@types/aria-query': 5.0.3 aria-query: 5.1.3 @@ -11952,7 +13567,7 @@ packages: resolution: {integrity: sha512-fB0R+fa3AUqbLHWyxXa2kGVtf1Fe1ZZFr0Zp6AIbIAzXb2mKbEXl+PCQNUOaq5lbTab5tfctfXRNsWXxa2f7Aw==} engines: {node: '>=14'} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 '@babel/runtime': 7.23.2 '@types/aria-query': 5.0.3 aria-query: 5.1.3 @@ -12015,7 +13630,7 @@ packages: '@babel/parser': 7.18.9 '@babel/traverse': 7.17.3 '@babel/types': 7.17.0 - '@vue/compiler-sfc': 3.3.6 + '@vue/compiler-sfc': 3.3.7 javascript-natural-sort: 0.7.1 lodash: 4.17.21 prettier: 2.8.8 @@ -12023,23 +13638,6 @@ packages: - supports-color dev: true - /@trufflesuite/bigint-buffer@1.1.10: - resolution: {integrity: sha512-pYIQC5EcMmID74t26GCC67946mgTJFiLXOT/BYozgrd4UEY2JHEGLhWi9cMiQCt5BSqFEvKkCHNnoj82SRjiEw==} - engines: {node: '>= 14.0.0'} - requiresBuild: true - dependencies: - node-gyp-build: 4.4.0 - dev: true - - /@trufflesuite/bigint-buffer@1.1.9: - resolution: {integrity: sha512-bdM5cEGCOhDSwminryHJbRmXc1x7dPKg6Pqns3qyTwFlxsqUgxE29lsERS3PlIW1HTjoIGMUqsk1zQQwST1Yxw==} - engines: {node: '>= 10.0.0'} - requiresBuild: true - dependencies: - node-gyp-build: 4.3.0 - dev: true - optional: true - /@trysound/sax@0.2.0: resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} engines: {node: '>=10.13.0'} @@ -12061,111 +13659,35 @@ packages: /@tsconfig/node16@1.0.4: resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} - /@typechain/ethers-v5@10.2.1(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2)(typescript@4.9.5): - resolution: {integrity: sha512-n3tQmCZjRE6IU4h6lqUGiQ1j866n5MTCBJreNEHHVWXa2u9GJTaeYyU1/k+1qLutkyw+sS6VAN+AbeiTqsxd/A==} - peerDependencies: - '@ethersproject/abi': ^5.0.0 - '@ethersproject/providers': ^5.0.0 - ethers: ^5.7.2 - typechain: ^8.1.1 - typescript: '>=4.3.0' - dependencies: - '@ethersproject/abi': 5.7.0 - '@ethersproject/providers': 5.7.2 - ethers: 5.7.2 - lodash: 4.17.21 - ts-essentials: 7.0.3(typescript@4.9.5) - typechain: 8.3.2(typescript@4.9.5) - typescript: 4.9.5 - - /@typechain/ethers-v5@10.2.1(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2)(typescript@5.1.6): - resolution: {integrity: sha512-n3tQmCZjRE6IU4h6lqUGiQ1j866n5MTCBJreNEHHVWXa2u9GJTaeYyU1/k+1qLutkyw+sS6VAN+AbeiTqsxd/A==} - peerDependencies: - '@ethersproject/abi': ^5.0.0 - '@ethersproject/providers': ^5.0.0 - ethers: ^5.7.2 - typechain: ^8.1.1 - typescript: '>=4.3.0' - dependencies: - '@ethersproject/abi': 5.7.0 - '@ethersproject/providers': 5.7.2 - ethers: 5.7.2 - lodash: 4.17.21 - ts-essentials: 7.0.3(typescript@5.1.6) - typechain: 8.3.2(typescript@5.1.6) - typescript: 5.1.6 - dev: false - - /@typechain/ethers-v5@11.1.2(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2)(typescript@4.9.5): - resolution: {integrity: sha512-ID6pqWkao54EuUQa0P5RgjvfA3MYqxUQKpbGKERbsjBW5Ra7EIXvbMlPp2pcP5IAdUkyMCFYsP2SN5q7mPdLDQ==} + /@typechain/ethers-v6@0.4.3(ethers@6.8.0)(typechain@8.3.2)(typescript@4.9.5): + resolution: {integrity: sha512-TrxBsyb4ryhaY9keP6RzhFCviWYApcLCIRMPyWaKp2cZZrfaM3QBoxXTnw/eO4+DAY3l+8O0brNW0WgeQeOiDA==} peerDependencies: - '@ethersproject/abi': ^5.0.0 - '@ethersproject/providers': ^5.0.0 - ethers: ^5.7.2 - typechain: ^8.3.2 - typescript: '>=4.3.0' - dependencies: - '@ethersproject/abi': 5.7.0 - '@ethersproject/providers': 5.7.2 - ethers: 5.7.2 - lodash: 4.17.21 - ts-essentials: 7.0.3(typescript@4.9.5) - typechain: 8.3.2(typescript@4.9.5) - typescript: 4.9.5 - dev: true - - /@typechain/ethers-v6@0.5.1(ethers@5.7.2)(typechain@8.3.2)(typescript@4.9.5): - resolution: {integrity: sha512-F+GklO8jBWlsaVV+9oHaPh5NJdd6rAKN4tklGfInX1Q7h0xPgVLP39Jl3eCulPB5qexI71ZFHwbljx4ZXNfouA==} - peerDependencies: - ethers: ^5.7.2 - typechain: ^8.3.2 + ethers: 6.x + typechain: ^8.3.1 typescript: '>=4.7.0' dependencies: - ethers: 5.7.2 + ethers: 6.8.0 lodash: 4.17.21 ts-essentials: 7.0.3(typescript@4.9.5) typechain: 8.3.2(typescript@4.9.5) typescript: 4.9.5 dev: true - /@typechain/hardhat@6.1.6(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(@typechain/ethers-v5@10.2.1)(ethers@5.7.2)(hardhat@2.13.1)(typechain@8.3.2): - resolution: {integrity: sha512-BiVnegSs+ZHVymyidtK472syodx1sXYlYJJixZfRstHVGYTi8V1O7QG4nsjyb0PC/LORcq7sfBUcHto1y6UgJA==} - peerDependencies: - '@ethersproject/abi': ^5.4.7 - '@ethersproject/providers': ^5.4.7 - '@typechain/ethers-v5': ^10.2.1 - ethers: ^5.7.2 - hardhat: ^2.9.9 - typechain: ^8.1.1 - dependencies: - '@ethersproject/abi': 5.7.0 - '@ethersproject/providers': 5.7.2 - '@typechain/ethers-v5': 10.2.1(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.2)(typescript@4.9.5) - ethers: 5.7.2 - fs-extra: 9.1.0 - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) - typechain: 8.3.2(typescript@4.9.5) - dev: false - - /@typechain/hardhat@9.1.0(@typechain/ethers-v6@0.5.1)(ethers@5.7.2)(hardhat@2.13.1)(typechain@8.3.2): - resolution: {integrity: sha512-mtaUlzLlkqTlfPwB3FORdejqBskSnh+Jl8AIJGjXNAQfRQ4ofHADPl1+oU7Z3pAJzmZbUXII8MhOLQltcHgKnA==} + /@typechain/hardhat@8.0.3(@typechain/ethers-v6@0.4.3)(ethers@6.8.0)(hardhat@2.18.3)(typechain@8.3.2): + resolution: {integrity: sha512-MytSmJJn+gs7Mqrpt/gWkTCOpOQ6ZDfRrRT2gtZL0rfGe4QrU4x9ZdW15fFbVM/XTa+5EsKiOMYXhRABibNeng==} peerDependencies: - '@typechain/ethers-v6': ^0.5.1 - ethers: ^5.7.2 + '@typechain/ethers-v6': ^0.4.3 + ethers: ^6.1.0 hardhat: ^2.9.9 - typechain: ^8.3.2 + typechain: ^8.3.1 dependencies: - '@typechain/ethers-v6': 0.5.1(ethers@5.7.2)(typechain@8.3.2)(typescript@4.9.5) - ethers: 5.7.2 + '@typechain/ethers-v6': 0.4.3(ethers@6.8.0)(typechain@8.3.2)(typescript@4.9.5) + ethers: 6.8.0 fs-extra: 9.1.0 - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) typechain: 8.3.2(typescript@4.9.5) dev: true - /@types/abstract-leveldown@7.2.4: - resolution: {integrity: sha512-ygy0hYyHdKnAtvCGUFEFvr3YV7Y6Q4akyRkZpM3RSUMYGSr35ZGRCT9Div+la4DpRUiwYUhJ6l75JBz6EORmpg==} - dev: true - /@types/aria-query@4.2.2: resolution: {integrity: sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig==} dev: true @@ -12182,60 +13704,83 @@ packages: '@types/babel__generator': 7.6.6 '@types/babel__template': 7.4.3 '@types/babel__traverse': 7.20.3 + dev: true /@types/babel__generator@7.6.6: resolution: {integrity: sha512-66BXMKb/sUWbMdBNdMvajU7i/44RkrA3z/Yt1c7R5xejt8qh84iU54yUWCtm0QwGJlDcf/gg4zd/x4mpLAlb/w==} dependencies: '@babel/types': 7.23.0 + dev: true /@types/babel__template@7.4.3: resolution: {integrity: sha512-ciwyCLeuRfxboZ4isgdNZi/tkt06m8Tw6uGbBSBgWrnnZGNXiEyM27xc/PjXGQLqlZ6ylbgHMnm7ccF9tCkOeQ==} dependencies: '@babel/parser': 7.23.0 '@babel/types': 7.23.0 + dev: true /@types/babel__traverse@7.20.3: resolution: {integrity: sha512-Lsh766rGEFbaxMIDH7Qa+Yha8cMVI3qAK6CHt3OR0YfxOIn5Z54iHiyDRycHrBqeIiqGa20Kpsv1cavfBKkRSw==} dependencies: '@babel/types': 7.23.0 + dev: true /@types/better-sqlite3@7.6.6: resolution: {integrity: sha512-nuFAptzt0hZYBvyLzKQCbuCCK+RN9PHH4ezar5EJLIg2qpVhwQ/uLvLO/K8A9O7N8DafawgFupiyXQSs0U48Ng==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 dev: true /@types/bn.js@4.11.6: resolution: {integrity: sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 /@types/bn.js@5.1.3: resolution: {integrity: sha512-wT1B4iIO82ecXkdN6waCK8Ou7E71WU+mP1osDA5Q8c6Ur+ozU2vIKUIhSpUr6uE5L2YHocKS1Z2jG2fBC1YVeg==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 /@types/body-parser@1.19.4: resolution: {integrity: sha512-N7UDG0/xiPQa2D/XrVJXjkWbpqHCd2sBaB32ggRF2l83RhPfamgKGF8gwwqyksS95qUS5ZYF9aF+lLPRlwI2UA==} dependencies: '@types/connect': 3.4.37 - '@types/node': 18.18.6 + '@types/node': 18.18.7 /@types/bonjour@3.5.12: resolution: {integrity: sha512-ky0kWSqXVxSqgqJvPIkgFkcn4C8MnRog308Ou8xBBIVo39OmUFy+jqNe0nPwLCDFxUpmT9EvT91YzOJgkDRcFg==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 + + /@types/cacheable-request@6.0.3: + resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==} + dependencies: + '@types/http-cache-semantics': 4.0.4 + '@types/keyv': 3.1.4 + '@types/node': 18.18.7 + '@types/responselike': 1.0.2 + dev: true /@types/chai-as-promised@7.1.7: resolution: {integrity: sha512-APucaP5rlmTRYKtRA6FE5QPP87x76ejw5t5guRJ4y5OgMnwtsvigw7HHhKZlx2MGXLeZd6R/GNZR/IqDHcbtQw==} dependencies: - '@types/chai': 4.3.9 + '@types/chai': 4.3.11 dev: true /@types/chai-subset@1.3.4: resolution: {integrity: sha512-CCWNXrJYSUIojZ1149ksLl3AN9cmZ5djf+yUoVVV+NuYrtydItQVlL2ZDqyC6M6O9LWRnVf8yYDxbXHO2TfQZg==} dependencies: - '@types/chai': 4.3.9 + '@types/chai': 4.3.11 + dev: true + + /@types/chai-subset@1.3.5: + resolution: {integrity: sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A==} + dependencies: + '@types/chai': 4.3.11 + dev: true + + /@types/chai@4.3.11: + resolution: {integrity: sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ==} dev: true /@types/chai@4.3.9: @@ -12245,39 +13790,36 @@ packages: /@types/cli-progress@3.11.4: resolution: {integrity: sha512-yufTxeeNCZuEIxx2uebK8lpSAsJM4lvzakm/VxzYhDtqhXCzwH9jpn7nPCxzrROuEbLATqhFq4MIPoG0tlrsvw==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 dev: true /@types/concat-stream@1.6.1: resolution: {integrity: sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 dev: true /@types/connect-history-api-fallback@1.5.2: resolution: {integrity: sha512-gX2j9x+NzSh4zOhnRPSdPPmTepS4DfxES0AvIFv3jGv5QyeAJf6u6dY5/BAoAJU9Qq1uTvwOku8SSC2GnCRl6Q==} dependencies: '@types/express-serve-static-core': 4.17.39 - '@types/node': 18.18.6 + '@types/node': 18.18.7 /@types/connect@3.4.37: resolution: {integrity: sha512-zBUSRqkfZ59OcwXon4HVxhx5oWCJmc0OtBTK05M+p0dYjgN6iTwIL2T/WbsQZrEsdnwaF9cWQ+azOnpPvIqY3Q==} dependencies: - '@types/node': 18.18.6 - - /@types/cookie@0.4.1: - resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} - dev: true + '@types/node': 18.18.7 /@types/debug@4.1.10: resolution: {integrity: sha512-tOSCru6s732pofZ+sMv9o4o3Zc+Sa8l3bxd/tweTQudFn06vAzb13ZX46Zi6m6EJ+RUbRTHvgQJ1gBtSgkaUYA==} dependencies: '@types/ms': 0.7.33 + dev: false /@types/dns-packet@5.6.2: resolution: {integrity: sha512-vgUZ0ilYvpnTDx7tBmmAUn1HsyzK3huAtulHaDbBBCW5UdaDrEei5XJjWHnD4s8r9/MSL1hJ8s+nvJdcvNKgMA==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 dev: false /@types/eslint-scope@3.7.6: @@ -12298,7 +13840,7 @@ packages: /@types/express-serve-static-core@4.17.39: resolution: {integrity: sha512-BiEUfAiGCOllomsRAZOiMFP7LAnrifHpt56pc4Z7l9K6ACyN06Ns1JLMBxwkfLOjJRlSf06NwWsT7yzfpaVpyQ==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 '@types/qs': 6.9.9 '@types/range-parser': 1.2.6 '@types/send': 0.17.3 @@ -12314,20 +13856,27 @@ packages: /@types/form-data@0.0.33: resolution: {integrity: sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 + dev: true + + /@types/fs-extra@8.1.5: + resolution: {integrity: sha512-0dzKcwO+S8s2kuF5Z9oUWatQJj5Uq/iqphEtE3GQJVRRYm/tD1LglU2UnXi2A8jLq5umkGouOXOR9y0n613ZwQ==} + dependencies: + '@types/node': 18.18.7 dev: true /@types/glob@7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 18.18.6 + '@types/node': 18.18.7 dev: true /@types/graceful-fs@4.1.8: resolution: {integrity: sha512-NhRH7YzWq8WiNKVavKPBmtLYZHxNY19Hh+az28O/phfp68CF45pMFud+ZzJ8ewnxnC5smIdF3dqFeiSUQ5I+pw==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 + dev: true /@types/hast@2.3.7: resolution: {integrity: sha512-EVLigw5zInURhzfXUM65eixfadfsHKomGKUakToXo84t8gGIJuTcD2xooM2See7GyQ7DRtYjhCHnSUQez8JaLw==} @@ -12341,7 +13890,7 @@ packages: /@types/hoist-non-react-statics@3.3.4: resolution: {integrity: sha512-ZchYkbieA+7tnxwX/SCBySx9WwvWR8TaP5tb2jRAzwvLb/rWchGw3v0w3pqUbUvj0GCwW2Xz/AVPSk6kUGctXQ==} dependencies: - '@types/react': 18.2.31 + '@types/react': 18.2.33 hoist-non-react-statics: 3.3.2 dev: false @@ -12352,13 +13901,17 @@ packages: /@types/html-minifier-terser@6.1.0: resolution: {integrity: sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg==} + /@types/http-cache-semantics@4.0.4: + resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==} + dev: true + /@types/http-errors@2.0.3: resolution: {integrity: sha512-pP0P/9BnCj1OVvQR2lF41EkDG/lWWnDyA203b/4Fmi2eTyORnBtcDoKDwjWQthELrBvWkMOrvSOnZ8OVlW6tXA==} /@types/http-proxy@1.17.13: resolution: {integrity: sha512-GkhdWcMNiR5QSQRYnJ+/oXzu0+7JJEPC8vkWXK351BkhjraZF+1W13CUYARUvX9+NqIU2n6YHA4iwywsc/M6Sw==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 /@types/istanbul-lib-coverage@2.0.5: resolution: {integrity: sha512-zONci81DZYCZjiLe0r6equvZut0b+dBRPBN5kBDjsONnutYNtJMoWQ9uR2RkL1gLG9NMTzvf+29e5RFfPbeKhQ==} @@ -12384,14 +13937,10 @@ packages: resolution: {integrity: sha512-aLkWa0C0vO5b4Sr798E26QgOkss68Un0bLjs7u9qxzPT5CG+8DuNTffWES58YzJs3hrVAOs1wonycqEBqNJubA==} dev: false - /@types/js-levenshtein@1.1.2: - resolution: {integrity: sha512-/NCbMABw2uacuyE16Iwka1EzREDD50/W2ggRBad0y1WHBvAkvR9OEINxModVY7D428gXBe0igeVX7bUc9GaslQ==} - dev: true - /@types/jsdom@20.0.1: resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 '@types/tough-cookie': 4.0.4 parse5: 7.1.2 dev: true @@ -12407,19 +13956,7 @@ packages: /@types/keyv@3.1.4: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: - '@types/node': 18.18.6 - - /@types/level-errors@3.0.1: - resolution: {integrity: sha512-eFJZWaOUhgjSqgEsPKJZrqXS9aEDUQh/5F9saFhhkR5uEVKlYb4GSG8XyoVC7APklcQKPGDVenTointTZBGIQg==} - dev: true - - /@types/levelup@4.3.3: - resolution: {integrity: sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA==} - dependencies: - '@types/abstract-leveldown': 7.2.4 - '@types/level-errors': 3.0.1 - '@types/node': 18.18.6 - dev: true + '@types/node': 18.18.7 /@types/lodash@4.14.200: resolution: {integrity: sha512-YI/M/4HRImtNf3pJgbF+W6FrXovqj+T+/HpENLTooK9PnkacBsDpeP3IpHab40CClUfhNmdM2WTNP2sa2dni5Q==} @@ -12452,41 +13989,25 @@ packages: /@types/minimist@1.2.4: resolution: {integrity: sha512-Kfe/D3hxHTusnPNRbycJE1N77WHDsdS4AjUYIzlDzhDrS47NrwuL3YW4VITxwR7KCVpzwgy4Rbj829KSSQmwXQ==} - /@types/mkdirp@0.5.2: - resolution: {integrity: sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg==} - dependencies: - '@types/node': 18.18.6 - dev: true - /@types/mocha@9.1.0: resolution: {integrity: sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==} dev: true /@types/ms@0.7.33: resolution: {integrity: sha512-AuHIyzR5Hea7ij0P9q7vx7xu4z0C28ucwjAZC0ja7JhINyCnOw8/DnvAPQQ9TfOlCtZAmCERKQX9+o1mgQhuOQ==} + dev: false /@types/multicast-dns@7.2.3: resolution: {integrity: sha512-2SZ079yRhuhDn5BssqkQGp07vErjm3PD8S/JAlduWXacZ8SVHF0q6R2m0PwjjgTDU1vE3kibNPlmnr1iKbP/Sw==} dependencies: '@types/dns-packet': 5.6.2 - '@types/node': 18.18.6 + '@types/node': 18.18.7 dev: false - /@types/node-fetch@2.6.7: - resolution: {integrity: sha512-lX17GZVpJ/fuCjguZ5b3TjEbSENxmEk1B2z02yoXSK9WMEWRivhdSY73wWMn6bpcCDAOh6qAdktpKHIlkDk2lg==} - dependencies: - '@types/node': 18.18.6 - form-data: 4.0.0 - dev: true - /@types/node@10.17.60: resolution: {integrity: sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==} dev: true - /@types/node@11.11.6: - resolution: {integrity: sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==} - dev: true - /@types/node@12.20.55: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} @@ -12498,8 +14019,13 @@ packages: resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} dev: false - /@types/node@18.18.6: - resolution: {integrity: sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==} + /@types/node@18.15.13: + resolution: {integrity: sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==} + + /@types/node@18.18.7: + resolution: {integrity: sha512-bw+lEsxis6eqJYW8Ql6+yTqkE6RuFtsQPSe5JxXbqYRFQEER5aJA9a5UH9igqDWm3X4iLHIKOHlnAXLM4mi7uQ==} + dependencies: + undici-types: 5.26.5 /@types/node@20.5.1: resolution: {integrity: sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==} @@ -12515,7 +14041,7 @@ packages: /@types/papaparse@5.3.10: resolution: {integrity: sha512-mS1Fta/xJ9EDYmAvpeWzcV9Gr0cOl1ClpW7di9+wSUNDIDO55tBtyXg97O7K+Syrd9rDEmuejM2iqmJIJ1SO5g==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 dev: true /@types/parse-json@4.0.1: @@ -12528,7 +14054,7 @@ packages: /@types/pbkdf2@3.1.1: resolution: {integrity: sha512-4HCoGwR3221nOc7G0Z/6KgTNGgaaFGkbGrtUJsB+zlKX2LBVjFHHIUkieMBgHHXgBH5Gq6dZHJKdBYdtlhBQvw==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 /@types/phoenix@1.6.3: resolution: {integrity: sha512-D8TtchWVnU2ZdPVDY6tBJuz8MUDmCNVduilZTrf0Gn/u5I/uZEXOsaL4Gs4F0j43cysHsU/4h7eqAKc+SF2boQ==} @@ -12536,6 +14062,7 @@ packages: /@types/prettier@2.7.3: resolution: {integrity: sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==} + dev: true /@types/prop-types@15.7.9: resolution: {integrity: sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g==} @@ -12549,37 +14076,37 @@ packages: /@types/react-dom@18.2.14: resolution: {integrity: sha512-V835xgdSVmyQmI1KLV2BEIUgqEuinxp9O4G6g3FqO/SqLac049E53aysv0oEFD2kHfejeKU+ZqL2bcFWj9gLAQ==} dependencies: - '@types/react': 18.2.31 + '@types/react': 18.2.33 dev: true /@types/react-router-config@5.0.9: resolution: {integrity: sha512-a7zOj9yVUtM3Ns5stoseQAAsmppNxZpXDv6tZiFV5qlRmV4W96u53on1vApBX1eRSc8mrFOiB54Hc0Pk1J8GFg==} dependencies: '@types/history': 4.7.11 - '@types/react': 18.2.31 + '@types/react': 18.2.33 '@types/react-router': 5.1.20 /@types/react-router-dom@5.3.3: resolution: {integrity: sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==} dependencies: '@types/history': 4.7.11 - '@types/react': 18.2.31 + '@types/react': 18.2.33 '@types/react-router': 5.1.20 /@types/react-router@5.1.20: resolution: {integrity: sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==} dependencies: '@types/history': 4.7.11 - '@types/react': 18.2.31 + '@types/react': 18.2.33 /@types/react-transition-group@4.4.8: resolution: {integrity: sha512-QmQ22q+Pb+HQSn04NL3HtrqHwYMf4h3QKArOy5F8U5nEVMaihBs3SR10WiOM1iwPz5jIo8x/u11al+iEGZZrvg==} dependencies: - '@types/react': 18.2.31 + '@types/react': 18.2.33 dev: false - /@types/react@18.2.31: - resolution: {integrity: sha512-c2UnPv548q+5DFh03y8lEDeMfDwBn9G3dRwfkrxQMo/dOtRHUUO57k6pHvBIfH/VF4Nh+98mZ5aaSe+2echD5g==} + /@types/react@18.2.33: + resolution: {integrity: sha512-v+I7S+hu3PIBoVkKGpSYYpiBT1ijqEzWpzQD62/jm4K74hPpSP7FF9BnKG6+fg2+62weJYkkBWDJlZt5JO/9hg==} dependencies: '@types/prop-types': 15.7.9 '@types/scheduler': 0.16.5 @@ -12588,7 +14115,7 @@ packages: /@types/readable-stream@2.3.15: resolution: {integrity: sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 safe-buffer: 5.1.2 /@types/resolve@1.20.2: @@ -12598,7 +14125,7 @@ packages: /@types/responselike@1.0.2: resolution: {integrity: sha512-/4YQT5Kp6HxUDb4yhRkm0bJ7TbjvTddqX7PZ5hz6qV3pxSo72f/6YPRo+Mu2DU307tm9IioO69l7uAwn5XNcFA==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 /@types/retry@0.12.0: resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} @@ -12610,7 +14137,7 @@ packages: /@types/sax@1.2.6: resolution: {integrity: sha512-A1mpYCYu1aHFayy8XKN57ebXeAbh9oQIZ1wXcno6b1ESUAfMBDMx7mf/QGlYwcMRaFryh9YBuH03i/3FlPGDkQ==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 dev: false /@types/scheduler@0.16.5: @@ -12619,11 +14146,7 @@ packages: /@types/secp256k1@4.0.5: resolution: {integrity: sha512-aIonTBMErtE3T9MxDvTZRzcrT/mCqpEZBw3CCY/i+oG9n57N/+7obBkhFgavUAIrX21bU0LHg1XRgtaLdelBhA==} dependencies: - '@types/node': 18.18.6 - - /@types/seedrandom@3.0.1: - resolution: {integrity: sha512-giB9gzDeiCeloIXDgzFBCgjj1k4WxcDrZtGl6h1IqmUPlxF+Nx8Ve+96QCyDZ/HseB/uvDsKbpib9hU5cU53pw==} - dev: true + '@types/node': 18.18.7 /@types/semver@7.5.4: resolution: {integrity: sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==} @@ -12633,7 +14156,7 @@ packages: resolution: {integrity: sha512-/7fKxvKUoETxjFUsuFlPB9YndePpxxRAOfGC/yJdc9kTjTeP5kRCTzfnE8kPUKCeyiyIZu0YQ76s50hCedI1ug==} dependencies: '@types/mime': 1.3.4 - '@types/node': 18.18.6 + '@types/node': 18.18.7 /@types/serve-index@1.9.3: resolution: {integrity: sha512-4KG+yMEuvDPRrYq5fyVm/I2uqAJSAwZK9VSa+Zf+zUq9/oxSSvy3kkIqyL+jjStv6UCVi8/Aho0NHtB1Fwosrg==} @@ -12645,28 +14168,18 @@ packages: dependencies: '@types/http-errors': 2.0.3 '@types/mime': 3.0.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 - /@types/set-cookie-parser@2.4.5: - resolution: {integrity: sha512-ZPmztaAQ4rbnW/WTUnT1dwSENQo4bjGqxCSeyK+gZxmd+zJl/QAeF6dpEXcS5UEJX22HwiggFSaY8nE1nRmkbg==} + /@types/sinon@17.0.2: + resolution: {integrity: sha512-Zt6heIGsdqERkxctIpvN5Pv3edgBrhoeb3yHyxffd4InN0AX2SVNKSrhdDZKGQICVOxWP/q4DyhpfPNMSrpIiA==} dependencies: - '@types/node': 18.18.6 - dev: true - - /@types/sinon@10.0.20: - resolution: {integrity: sha512-2APKKruFNCAZgx3daAyACGzWuJ028VVCUDk6o2rw/Z4PXT0ogwdV4KUegW0MwVs0Zu59auPXbbuBJHF12Sx1Eg==} - dependencies: - '@types/sinonjs__fake-timers': 8.1.4 + '@types/sinonjs__fake-timers': 8.1.1 dev: true /@types/sinonjs__fake-timers@8.1.1: resolution: {integrity: sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==} dev: true - /@types/sinonjs__fake-timers@8.1.4: - resolution: {integrity: sha512-GDV68H0mBSN449sa5HEj51E0wfpVQb8xNSMzxf/PrypMFcLTMwJMOM/cgXiv71Mq5drkOQmUGvL1okOZcu6RrQ==} - dev: true - /@types/sizzle@2.3.5: resolution: {integrity: sha512-tAe4Q+OLFOA/AMD+0lq8ovp8t3ysxAOeaScnfNdZpUxaGl51ZMDEITxkvFl1STudQ58mz6gzVGl9VhMKhwRnZQ==} dev: true @@ -12674,7 +14187,7 @@ packages: /@types/sockjs@0.3.35: resolution: {integrity: sha512-tIF57KB+ZvOBpAQwSaACfEu7htponHXaFzP7RfKYgsOS0NoYnn+9+jzp7bbq4fWerizI3dTB4NfAZoyeQKWJLw==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 /@types/source-list-map@0.1.4: resolution: {integrity: sha512-Kdfm7Sk5VX8dFW7Vbp18+fmAatBewzBILa1raHYxrGEFXT0jNl9x3LWfuW7bTbjEKFNey9Dfkj/UzT6z/NvRlg==} @@ -12725,7 +14238,7 @@ packages: /@types/webpack-sources@3.2.2: resolution: {integrity: sha512-acCzhuVe+UJy8abiSFQWXELhhNMZjQjQKpLNEi1pKGgKXZj0ul614ATcx4kkhunPost6Xw+aCq8y8cn1/WwAiA==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 '@types/source-list-map': 0.1.4 source-map: 0.7.4 dev: true @@ -12733,7 +14246,7 @@ packages: /@types/webpack@4.41.35: resolution: {integrity: sha512-XRC6HLGHtNfN8/xWeu1YUQV1GSE+28q8lSqvcJ+0xt/zW9Wmn4j9pCSvaXPyRlCKrl5OuqECQNEJUy2vo8oWqg==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 '@types/tapable': 1.0.10 '@types/uglify-js': 3.17.3 '@types/webpack-sources': 3.2.2 @@ -12744,18 +14257,18 @@ packages: /@types/websocket@1.0.8: resolution: {integrity: sha512-wvkOpWApbuxVfHhSQ1XrjVN4363vsfLJwEo4AboIZk0g1vJA5nmLp8GXUHuIdf4/Fe7+/V0Efe2HvWiLqHtlqw==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 dev: false /@types/ws@7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 /@types/ws@8.5.8: resolution: {integrity: sha512-flUksGIQCnJd6sZ1l5dqCEG/ksaoAg/eUwiLAGTJQcfgvZJKF++Ta4bJA6A5aPSJmsr+xlseHn4KLgVlNnvPTg==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 /@types/yargs-parser@21.0.2: resolution: {integrity: sha512-5qcvofLPbfjmBfKaLfj/+f+Sbd6pN4zl7w7VSVI5uz7m9QZTuB2aZAa2uo1wHFBNN2x6g/SoTkXmd8mQnQF2Cw==} @@ -12769,6 +14282,7 @@ packages: resolution: {integrity: sha512-lQcYmxWuOfJq4IncK88/nwud9rwr1F04CFc5xzk0k4oKVyz/AI35TfsXmhjf6t8zp8mpCOi17BfvuNWx+zrYkg==} dependencies: '@types/yargs-parser': 21.0.2 + dev: false /@types/yargs@17.0.29: resolution: {integrity: sha512-nacjqA3ee9zRF/++a3FUY1suHTFKZeHba2n8WeDw9cCVdmzmHpIxyzOJBcpHvvEmS8E9KqWlSnWHUkOrkhWcvA==} @@ -12779,7 +14293,7 @@ packages: resolution: {integrity: sha512-Km7XAtUIduROw7QPgvcft0lIupeG8a8rdKL8RiSyKvlE7dYY31fEn41HVuQsRFDuROA8tA4K2UVL+WdfFmErBA==} requiresBuild: true dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 dev: true optional: true @@ -12794,7 +14308,7 @@ packages: typescript: optional: true dependencies: - '@eslint-community/regexpp': 4.9.1 + '@eslint-community/regexpp': 4.10.0 '@typescript-eslint/parser': 5.62.0(eslint@8.19.0)(typescript@5.1.6) '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/type-utils': 5.62.0(eslint@8.19.0)(typescript@5.1.6) @@ -12822,7 +14336,7 @@ packages: typescript: optional: true dependencies: - '@eslint-community/regexpp': 4.9.1 + '@eslint-community/regexpp': 4.10.0 '@typescript-eslint/parser': 5.62.0(eslint@8.52.0)(typescript@4.9.5) '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/type-utils': 5.62.0(eslint@8.52.0)(typescript@4.9.5) @@ -13024,7 +14538,6 @@ packages: /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - dev: true /@vanilla-extract/css@1.9.1: resolution: {integrity: sha512-pu2SFiff5jRhPwvGoj8cM5l/qIyLvigOmy22ss5DGjwV5pJYezRjDLxWumi2luIwioMWvh9EozCjyfH8nq+7fQ==} @@ -13077,6 +14590,19 @@ packages: - utf-8-validate dev: true + /@viem/anvil@0.0.6: + resolution: {integrity: sha512-OjKR/+FVwzuygXYFqP8MBal1SXG8bT2gbZwqqB0XuLw81LNBBvmE/Repm6+5kkBh4IUj0PhYdrqOsnayS14Gtg==} + dependencies: + execa: 7.2.0 + get-port: 6.1.2 + http-proxy: 1.18.1(debug@4.3.4) + ws: 8.14.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - debug + - utf-8-validate + dev: true + /@vitest/expect@0.28.5: resolution: {integrity: sha512-gqTZwoUTwepwGIatnw4UKpQfnoyV0Z9Czn9+Lo2/jLIt4/AXLTn+oVZxlQ7Ng8bzcNkR+3DqLJ08kNr8jRmdNQ==} dependencies: @@ -13085,6 +14611,14 @@ packages: chai: 4.3.10 dev: true + /@vitest/expect@1.0.2: + resolution: {integrity: sha512-mAIo/8uddSWkjQMLFcjqZP3WmkwvvN0OtlyZIu33jFnwme3vZds8m8EDMxtj+Uzni2DwtPfHNjJcTM8zTV1f4A==} + dependencies: + '@vitest/spy': 1.0.2 + '@vitest/utils': 1.0.2 + chai: 4.3.10 + dev: true + /@vitest/runner@0.28.5: resolution: {integrity: sha512-NKkHtLB+FGjpp5KmneQjTcPLWPTDfB7ie+MmF1PnUBf/tGe2OjGxWyB62ySYZ25EYp9krR5Bw0YPLS/VWh1QiA==} dependencies: @@ -13093,12 +14627,34 @@ packages: pathe: 1.1.1 dev: true + /@vitest/runner@1.0.2: + resolution: {integrity: sha512-ZcHJXPT2kg/9Hc4fNkCbItlsgZSs3m4vQbxB8LCSdzpbG85bExCmSvu6K9lWpMNdoKfAr1Jn0BwS9SWUcGnbTQ==} + dependencies: + '@vitest/utils': 1.0.2 + p-limit: 5.0.0 + pathe: 1.1.1 + dev: true + + /@vitest/snapshot@1.0.2: + resolution: {integrity: sha512-9ClDz2/aV5TfWA4reV7XR9p+hE0e7bifhwxlURugj3Fw0YXeTFzHmKCNEHd6wOIFMfthbGGwhlq7TOJ2jDO4/g==} + dependencies: + magic-string: 0.30.5 + pathe: 1.1.1 + pretty-format: 29.7.0 + dev: true + /@vitest/spy@0.28.5: resolution: {integrity: sha512-7if6rsHQr9zbmvxN7h+gGh2L9eIIErgf8nSKYDlg07HHimCxp4H6I/X/DPXktVPPLQfiZ1Cw2cbDIx9fSqDjGw==} dependencies: tinyspy: 1.1.1 dev: true + /@vitest/spy@1.0.2: + resolution: {integrity: sha512-YlnHmDntp+zNV3QoTVFI5EVHV0AXpiThd7+xnDEbWnD6fw0TH/J4/+3GFPClLimR39h6nA5m0W4Bjm5Edg4A/A==} + dependencies: + tinyspy: 2.2.0 + dev: true + /@vitest/utils@0.28.5: resolution: {integrity: sha512-UyZdYwdULlOa4LTUSwZ+Paz7nBHGTT72jKwdFSV4IjHF1xsokp+CabMdhjvVhYwkLfO88ylJT46YMilnkSARZA==} dependencies: @@ -13109,59 +14665,67 @@ packages: pretty-format: 27.5.1 dev: true - /@vue/compiler-core@3.3.6: - resolution: {integrity: sha512-2JNjemwaNwf+MkkatATVZi7oAH1Hx0B04DdPH3ZoZ8vKC1xZVP7nl4HIsk8XYd3r+/52sqqoz9TWzYc3yE9dqA==} + /@vitest/utils@1.0.2: + resolution: {integrity: sha512-GPQkGHAnFAP/+seSbB9pCsj339yRrMgILoI5H2sPevTLCYgBq0VRjF8QSllmnQyvf0EontF6KUIt2t5s2SmqoQ==} + dependencies: + diff-sequences: 29.6.3 + loupe: 2.3.7 + pretty-format: 29.7.0 + dev: true + + /@vue/compiler-core@3.3.7: + resolution: {integrity: sha512-pACdY6YnTNVLXsB86YD8OF9ihwpolzhhtdLVHhBL6do/ykr6kKXNYABRtNMGrsQXpEXXyAdwvWWkuTbs4MFtPQ==} dependencies: '@babel/parser': 7.23.0 - '@vue/shared': 3.3.6 + '@vue/shared': 3.3.7 estree-walker: 2.0.2 source-map-js: 1.0.2 dev: true - /@vue/compiler-dom@3.3.6: - resolution: {integrity: sha512-1MxXcJYMHiTPexjLAJUkNs/Tw2eDf2tY3a0rL+LfuWyiKN2s6jvSwywH3PWD8bKICjfebX3GWx2Os8jkRDq3Ng==} + /@vue/compiler-dom@3.3.7: + resolution: {integrity: sha512-0LwkyJjnUPssXv/d1vNJ0PKfBlDoQs7n81CbO6Q0zdL7H1EzqYRrTVXDqdBVqro0aJjo/FOa1qBAPVI4PGSHBw==} dependencies: - '@vue/compiler-core': 3.3.6 - '@vue/shared': 3.3.6 + '@vue/compiler-core': 3.3.7 + '@vue/shared': 3.3.7 dev: true - /@vue/compiler-sfc@3.3.6: - resolution: {integrity: sha512-/Kms6du2h1VrXFreuZmlvQej8B1zenBqIohP0690IUBkJjsFvJxY0crcvVRJ0UhMgSR9dewB+khdR1DfbpArJA==} + /@vue/compiler-sfc@3.3.7: + resolution: {integrity: sha512-7pfldWy/J75U/ZyYIXRVqvLRw3vmfxDo2YLMwVtWVNew8Sm8d6wodM+OYFq4ll/UxfqVr0XKiVwti32PCrruAw==} dependencies: '@babel/parser': 7.23.0 - '@vue/compiler-core': 3.3.6 - '@vue/compiler-dom': 3.3.6 - '@vue/compiler-ssr': 3.3.6 - '@vue/reactivity-transform': 3.3.6 - '@vue/shared': 3.3.6 + '@vue/compiler-core': 3.3.7 + '@vue/compiler-dom': 3.3.7 + '@vue/compiler-ssr': 3.3.7 + '@vue/reactivity-transform': 3.3.7 + '@vue/shared': 3.3.7 estree-walker: 2.0.2 magic-string: 0.30.5 postcss: 8.4.31 source-map-js: 1.0.2 dev: true - /@vue/compiler-ssr@3.3.6: - resolution: {integrity: sha512-QTIHAfDCHhjXlYGkUg5KH7YwYtdUM1vcFl/FxFDlD6d0nXAmnjizka3HITp8DGudzHndv2PjKVS44vqqy0vP4w==} + /@vue/compiler-ssr@3.3.7: + resolution: {integrity: sha512-TxOfNVVeH3zgBc82kcUv+emNHo+vKnlRrkv8YvQU5+Y5LJGJwSNzcmLUoxD/dNzv0bhQ/F0s+InlgV0NrApJZg==} dependencies: - '@vue/compiler-dom': 3.3.6 - '@vue/shared': 3.3.6 + '@vue/compiler-dom': 3.3.7 + '@vue/shared': 3.3.7 dev: true - /@vue/reactivity-transform@3.3.6: - resolution: {integrity: sha512-RlJl4dHfeO7EuzU1iJOsrlqWyJfHTkJbvYz/IOJWqu8dlCNWtxWX377WI0VsbAgBizjwD+3ZjdnvSyyFW1YVng==} + /@vue/reactivity-transform@3.3.7: + resolution: {integrity: sha512-APhRmLVbgE1VPGtoLQoWBJEaQk4V8JUsqrQihImVqKT+8U6Qi3t5ATcg4Y9wGAPb3kIhetpufyZ1RhwbZCIdDA==} dependencies: '@babel/parser': 7.23.0 - '@vue/compiler-core': 3.3.6 - '@vue/shared': 3.3.6 + '@vue/compiler-core': 3.3.7 + '@vue/shared': 3.3.7 estree-walker: 2.0.2 magic-string: 0.30.5 dev: true - /@vue/shared@3.3.6: - resolution: {integrity: sha512-Xno5pEqg8SVhomD0kTSmfh30ZEmV/+jZtyh39q6QflrjdJCXah5lrnOLi9KB6a5k5aAHXMXjoMnxlzUkCNfWLQ==} + /@vue/shared@3.3.7: + resolution: {integrity: sha512-N/tbkINRUDExgcPTBvxNkvHGu504k8lzlNQRITVnm6YjOjwa4r0nnbd4Jb01sNpur5hAllyRJzSK5PvB9PPwRg==} dev: true - /@wagmi/chains@1.0.0(typescript@5.1.6): + /@wagmi/chains@1.0.0(typescript@5.3.2): resolution: {integrity: sha512-eNbqRWyHbivcMNq5tbXJks4NaOzVLHnNQauHPeE/EDT9AlpqzcrMc+v2T1/2Iw8zN4zgqB86NCsxeJHJs7+xng==} peerDependencies: typescript: '>=5.0.4' @@ -13169,29 +14733,50 @@ packages: typescript: optional: true dependencies: - typescript: 5.1.6 + typescript: 5.3.2 dev: true - /@wagmi/chains@1.6.0(typescript@5.1.6): - resolution: {integrity: sha512-5FRlVxse5P4ZaHG3GTvxwVANSmYJas1eQrTBHhjxVtqXoorm0aLmCHbhmN8Xo1yu09PaWKlleEvfE98yH4AgIw==} + /@wagmi/connectors@2.7.0(react@18.2.0)(typescript@5.1.6)(viem@1.19.9)(zod@3.22.4): + resolution: {integrity: sha512-1KOL0HTJl5kzSC/YdKwFwiokr6poUQn1V/tcT0TpG3iH2x0lSM7FTkvCjVVY/6lKzTXrLlo9y2aE7AsOPnkvqg==} peerDependencies: + '@wagmi/chains': '>=1.7.0' typescript: '>=5.0.4' + viem: '>=0.3.35' peerDependenciesMeta: + '@wagmi/chains': + optional: true typescript: optional: true dependencies: + '@coinbase/wallet-sdk': 3.7.2 + '@ledgerhq/connect-kit-loader': 1.1.2 + '@safe-global/safe-apps-provider': 0.17.1(typescript@5.1.6)(zod@3.22.4) + '@safe-global/safe-apps-sdk': 8.1.0(typescript@5.1.6)(zod@3.22.4) + '@walletconnect/ethereum-provider': 2.9.2(@walletconnect/modal@2.6.1) + '@walletconnect/legacy-provider': 2.0.0 + '@walletconnect/modal': 2.6.1(react@18.2.0) + '@walletconnect/utils': 2.9.2 + abitype: 0.8.7(typescript@5.1.6)(zod@3.22.4) + eventemitter3: 4.0.7 typescript: 5.1.6 + viem: 1.19.9(typescript@5.1.6)(zod@3.22.4) + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + - bufferutil + - encoding + - lokijs + - react + - supports-color + - utf-8-validate + - zod dev: false - /@wagmi/connectors@2.6.6(@wagmi/chains@1.6.0)(react@18.2.0)(typescript@5.1.6)(viem@1.5.3)(zod@3.22.4): - resolution: {integrity: sha512-/o1c/TCivQs8DOAUOcQvY2UIt3p2mWOAHi39D0LC74+ncpXzLC5/gyaWU38qnTxPM8s/PmTmaWDgz+VhICXrag==} + /@wagmi/connectors@3.1.3(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@1.19.9)(zod@3.22.4): + resolution: {integrity: sha512-UgwsQKQDFObJVJMf9pDfFoXTv710o4zrTHyhIWKBTMMkLpCMsMxN5+ZaDhBYt/BgoRinfRYQo8uwuwLhxE6Log==} peerDependencies: - '@wagmi/chains': '>=1.3.0' typescript: '>=5.0.4' viem: '>=0.3.35' peerDependenciesMeta: - '@wagmi/chains': - optional: true typescript: optional: true dependencies: @@ -13199,17 +14784,17 @@ packages: '@ledgerhq/connect-kit-loader': 1.1.2 '@safe-global/safe-apps-provider': 0.17.1(typescript@5.1.6)(zod@3.22.4) '@safe-global/safe-apps-sdk': 8.1.0(typescript@5.1.6)(zod@3.22.4) - '@wagmi/chains': 1.6.0(typescript@5.1.6) - '@walletconnect/ethereum-provider': 2.9.0(@walletconnect/modal@2.5.9) + '@walletconnect/ethereum-provider': 2.10.2(@walletconnect/modal@2.6.2) '@walletconnect/legacy-provider': 2.0.0 - '@walletconnect/modal': 2.5.9(react@18.2.0) - '@walletconnect/utils': 2.9.0 + '@walletconnect/modal': 2.6.2(@types/react@18.2.33)(react@18.2.0) + '@walletconnect/utils': 2.10.2 abitype: 0.8.7(typescript@5.1.6)(zod@3.22.4) eventemitter3: 4.0.7 typescript: 5.1.6 - viem: 1.5.3(typescript@5.1.6)(zod@3.22.4) + viem: 1.19.9(typescript@5.1.6)(zod@3.22.4) transitivePeerDependencies: - '@react-native-async-storage/async-storage' + - '@types/react' - bufferutil - encoding - lokijs @@ -13219,8 +14804,8 @@ packages: - zod dev: false - /@wagmi/core@1.3.8(@types/react@18.2.31)(react@18.2.0)(typescript@5.1.6)(viem@1.5.3)(zod@3.22.4): - resolution: {integrity: sha512-OYSxikoMizqVnpSkFTwGE7PwFaz2k0PXteSiI0W2Mtk4j4sZzRFdP+9AWeDB6AYm0yU3WvgN1IATx0EEBKUe3w==} + /@wagmi/core@1.4.5(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@1.19.9)(zod@3.22.4): + resolution: {integrity: sha512-N9luRb1Uk4tBN9kaYcQSWKE9AsRt/rvZaFt5IZech4JPzNN2sQlfhKd9GEjOXYRDqEPHdDvos7qyBKiDNTz4GA==} peerDependencies: typescript: '>=5.0.4' viem: '>=0.3.35' @@ -13228,13 +14813,12 @@ packages: typescript: optional: true dependencies: - '@wagmi/chains': 1.6.0(typescript@5.1.6) - '@wagmi/connectors': 2.6.6(@wagmi/chains@1.6.0)(react@18.2.0)(typescript@5.1.6)(viem@1.5.3)(zod@3.22.4) + '@wagmi/connectors': 3.1.3(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@1.19.9)(zod@3.22.4) abitype: 0.8.7(typescript@5.1.6)(zod@3.22.4) eventemitter3: 4.0.7 typescript: 5.1.6 - viem: 1.5.3(typescript@5.1.6)(zod@3.22.4) - zustand: 4.4.4(@types/react@18.2.31)(react@18.2.0) + viem: 1.19.9(typescript@5.1.6)(zod@3.22.4) + zustand: 4.4.4(@types/react@18.2.33)(react@18.2.0) transitivePeerDependencies: - '@react-native-async-storage/async-storage' - '@types/react' @@ -13248,22 +14832,48 @@ packages: - zod dev: false - /@walletconnect/core@2.9.0: - resolution: {integrity: sha512-MZYJghS9YCvGe32UOgDj0mCasaOoGHQaYXWeQblXE/xb8HuaM6kAWhjIQN9P+MNp5QP134BHP5olQostcCotXQ==} + /@walletconnect/core@2.10.2: + resolution: {integrity: sha512-JQz/xp3SLEpTeRQctdck2ugSBVEpMxoSE+lFi2voJkZop1hv6P+uqr6E4PzjFluAjeAnKlT1xvra0aFWjPWVcw==} dependencies: '@walletconnect/heartbeat': 1.2.1 '@walletconnect/jsonrpc-provider': 1.0.13 '@walletconnect/jsonrpc-types': 1.0.3 '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/jsonrpc-ws-connection': 1.0.12 + '@walletconnect/jsonrpc-ws-connection': 1.0.13 '@walletconnect/keyvaluestorage': 1.0.2 '@walletconnect/logger': 2.0.1 '@walletconnect/relay-api': 1.0.9 '@walletconnect/relay-auth': 1.0.4 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.9.0 - '@walletconnect/utils': 2.9.0 + '@walletconnect/types': 2.10.2 + '@walletconnect/utils': 2.10.2 + events: 3.3.0 + lodash.isequal: 4.5.0 + uint8arrays: 3.1.1 + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + - bufferutil + - lokijs + - utf-8-validate + dev: false + + /@walletconnect/core@2.9.2: + resolution: {integrity: sha512-VARMPAx8sIgodeyngDHbealP3B621PQqjqKsByFUTOep8ZI1/R/20zU+cmq6j9RCrL+kLKZcrZqeVzs8Z7OlqQ==} + dependencies: + '@walletconnect/heartbeat': 1.2.1 + '@walletconnect/jsonrpc-provider': 1.0.13 + '@walletconnect/jsonrpc-types': 1.0.3 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/jsonrpc-ws-connection': 1.0.13 + '@walletconnect/keyvaluestorage': 1.0.2 + '@walletconnect/logger': 2.0.1 + '@walletconnect/relay-api': 1.0.9 + '@walletconnect/relay-auth': 1.0.4 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.9.2 + '@walletconnect/utils': 2.9.2 events: 3.3.0 lodash.isequal: 4.5.0 uint8arrays: 3.1.1 @@ -13299,8 +14909,34 @@ packages: tslib: 1.14.1 dev: false - /@walletconnect/ethereum-provider@2.9.0(@walletconnect/modal@2.5.9): - resolution: {integrity: sha512-rSXkC0SXMigJRdIi/M2RMuEuATY1AwtlTWQBnqyxoht7xbO2bQNPCXn0XL4s/GRNrSUtoKSY4aPMHXV4W4yLBA==} + /@walletconnect/ethereum-provider@2.10.2(@walletconnect/modal@2.6.2): + resolution: {integrity: sha512-QMYFZ6+rVq2CJLdIPdKK0j1Qm66UA27oQU5V2SrL8EVwl7wFfm0Bq7fnL+qAWeDpn612dNeNErpk/ROa1zWlWg==} + peerDependencies: + '@walletconnect/modal': '>=2' + peerDependenciesMeta: + '@walletconnect/modal': + optional: true + dependencies: + '@walletconnect/jsonrpc-http-connection': 1.0.7 + '@walletconnect/jsonrpc-provider': 1.0.13 + '@walletconnect/jsonrpc-types': 1.0.3 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/modal': 2.6.2(@types/react@18.2.33)(react@18.2.0) + '@walletconnect/sign-client': 2.10.2 + '@walletconnect/types': 2.10.2 + '@walletconnect/universal-provider': 2.10.2 + '@walletconnect/utils': 2.10.2 + events: 3.3.0 + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + - bufferutil + - encoding + - lokijs + - utf-8-validate + dev: false + + /@walletconnect/ethereum-provider@2.9.2(@walletconnect/modal@2.6.1): + resolution: {integrity: sha512-eO1dkhZffV1g7vpG19XUJTw09M/bwGUwwhy1mJ3AOPbOSbMPvwiCuRz2Kbtm1g9B0Jv15Dl+TvJ9vTgYF8zoZg==} peerDependencies: '@walletconnect/modal': '>=2' peerDependenciesMeta: @@ -13311,11 +14947,11 @@ packages: '@walletconnect/jsonrpc-provider': 1.0.13 '@walletconnect/jsonrpc-types': 1.0.3 '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/modal': 2.5.9(react@18.2.0) - '@walletconnect/sign-client': 2.9.0 - '@walletconnect/types': 2.9.0 - '@walletconnect/universal-provider': 2.9.0 - '@walletconnect/utils': 2.9.0 + '@walletconnect/modal': 2.6.1(react@18.2.0) + '@walletconnect/sign-client': 2.9.2 + '@walletconnect/types': 2.9.2 + '@walletconnect/universal-provider': 2.9.2 + '@walletconnect/utils': 2.9.2 events: 3.3.0 transitivePeerDependencies: - '@react-native-async-storage/async-storage' @@ -13374,8 +15010,8 @@ packages: tslib: 1.14.1 dev: false - /@walletconnect/jsonrpc-ws-connection@1.0.12: - resolution: {integrity: sha512-HAcadga3Qjt1Cqy+qXEW6zjaCs8uJGdGQrqltzl3OjiK4epGZRdvSzTe63P+t/3z+D2wG+ffEPn0GVcDozmN1w==} + /@walletconnect/jsonrpc-ws-connection@1.0.13: + resolution: {integrity: sha512-mfOM7uFH4lGtQxG+XklYuFBj6dwVvseTt5/ahOkkmpcAEgz2umuzu7fTR+h5EmjQBdrmYyEBOWADbeaFNxdySg==} dependencies: '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/safe-json': 1.0.2 @@ -13466,35 +15102,65 @@ packages: tslib: 1.14.1 dev: false - /@walletconnect/modal-core@2.5.9(react@18.2.0): - resolution: {integrity: sha512-isIebwF9hOknGouhS/Ob4YJ9Sa/tqNYG2v6Ua9EkCqIoLimepkG5eC53tslUWW29SLSfQ9qqBNG2+iE7yQXqgw==} + /@walletconnect/modal-core@2.6.1(react@18.2.0): + resolution: {integrity: sha512-f2hYlJ5pwzGvjyaZ6BoGR5uiMgXzWXt6w6ktt1N8lmY6PiYp8whZgqx2hTxVWwVlsGnaIfh6UHp1hGnANx0eTQ==} dependencies: - buffer: 6.0.3 - valtio: 1.10.6(react@18.2.0) + valtio: 1.11.0(react@18.2.0) + transitivePeerDependencies: + - react + dev: false + + /@walletconnect/modal-core@2.6.2(@types/react@18.2.33)(react@18.2.0): + resolution: {integrity: sha512-cv8ibvdOJQv2B+nyxP9IIFdxvQznMz8OOr/oR/AaUZym4hjXNL/l1a2UlSQBXrVjo3xxbouMxLb3kBsHoYP2CA==} + dependencies: + valtio: 1.11.2(@types/react@18.2.33)(react@18.2.0) + transitivePeerDependencies: + - '@types/react' + - react + dev: false + + /@walletconnect/modal-ui@2.6.1(react@18.2.0): + resolution: {integrity: sha512-RFUOwDAMijSK8B7W3+KoLKaa1l+KEUG0LCrtHqaB0H0cLnhEGdLR+kdTdygw+W8+yYZbkM5tXBm7MlFbcuyitA==} + dependencies: + '@walletconnect/modal-core': 2.6.1(react@18.2.0) + lit: 2.7.6 + motion: 10.16.2 + qrcode: 1.5.3 transitivePeerDependencies: - react dev: false - /@walletconnect/modal-ui@2.5.9(react@18.2.0): - resolution: {integrity: sha512-nfBaAT9Ls7RZTBBgAq+Nt/3AoUcinIJ9bcq5UHXTV3lOPu/qCKmUC/0HY3GvUK8ykabUAsjr0OAGmcqkB91qug==} + /@walletconnect/modal-ui@2.6.2(@types/react@18.2.33)(react@18.2.0): + resolution: {integrity: sha512-rbdstM1HPGvr7jprQkyPggX7rP4XiCG85ZA+zWBEX0dVQg8PpAgRUqpeub4xQKDgY7pY/xLRXSiCVdWGqvG2HA==} dependencies: - '@walletconnect/modal-core': 2.5.9(react@18.2.0) - lit: 2.7.5 + '@walletconnect/modal-core': 2.6.2(@types/react@18.2.33)(react@18.2.0) + lit: 2.8.0 motion: 10.16.2 qrcode: 1.5.3 transitivePeerDependencies: + - '@types/react' - react dev: false - /@walletconnect/modal@2.5.9(react@18.2.0): - resolution: {integrity: sha512-Zs2RvPwbBNRdBhb50FuJCxi3FJltt1KSpI7odjU/x9GTpTOcSOkmR66PBCy2JvNA0+ztnS1Xs0LVEr3lu7/Jzw==} + /@walletconnect/modal@2.6.1(react@18.2.0): + resolution: {integrity: sha512-G84tSzdPKAFk1zimgV7JzIUFT5olZUVtI3GcOk77OeLYjlMfnDT23RVRHm5EyCrjkptnvpD0wQScXePOFd2Xcw==} dependencies: - '@walletconnect/modal-core': 2.5.9(react@18.2.0) - '@walletconnect/modal-ui': 2.5.9(react@18.2.0) + '@walletconnect/modal-core': 2.6.1(react@18.2.0) + '@walletconnect/modal-ui': 2.6.1(react@18.2.0) transitivePeerDependencies: - react dev: false + /@walletconnect/modal@2.6.2(@types/react@18.2.33)(react@18.2.0): + resolution: {integrity: sha512-eFopgKi8AjKf/0U4SemvcYw9zlLpx9njVN8sf6DAkowC2Md0gPU/UNEbH1Wwj407pEKnEds98pKWib1NN1ACoA==} + dependencies: + '@walletconnect/modal-core': 2.6.2(@types/react@18.2.33)(react@18.2.0) + '@walletconnect/modal-ui': 2.6.2(@types/react@18.2.33)(react@18.2.0) + transitivePeerDependencies: + - '@types/react' + - react + dev: false + /@walletconnect/randombytes@1.0.3: resolution: {integrity: sha512-35lpzxcHFbTN3ABefC9W+uBpNZl1GC4Wpx0ed30gibfO/y9oLdy1NznbV96HARQKSBV9J9M/rrtIvf6a23jfYw==} dependencies: @@ -13528,17 +15194,36 @@ packages: tslib: 1.14.1 dev: false - /@walletconnect/sign-client@2.9.0: - resolution: {integrity: sha512-mEKc4LlLMebCe45qzqh+MX4ilQK4kOEBzLY6YJpG8EhyT45eX4JMNA7qQoYa9MRMaaVb/7USJcc4e3ZrjZvQmA==} + /@walletconnect/sign-client@2.10.2: + resolution: {integrity: sha512-vviSLV3f92I0bReX+OLr1HmbH0uIzYEQQFd1MzIfDk9PkfFT/LLAHhUnDaIAMkIdippqDcJia+5QEtT4JihL3Q==} dependencies: - '@walletconnect/core': 2.9.0 + '@walletconnect/core': 2.10.2 '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.1 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.0.1 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.9.0 - '@walletconnect/utils': 2.9.0 + '@walletconnect/types': 2.10.2 + '@walletconnect/utils': 2.10.2 + events: 3.3.0 + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + - bufferutil + - lokijs + - utf-8-validate + dev: false + + /@walletconnect/sign-client@2.9.2: + resolution: {integrity: sha512-anRwnXKlR08lYllFMEarS01hp1gr6Q9XUgvacr749hoaC/AwGVlxYFdM8+MyYr3ozlA+2i599kjbK/mAebqdXg==} + dependencies: + '@walletconnect/core': 2.9.2 + '@walletconnect/events': 1.0.1 + '@walletconnect/heartbeat': 1.2.1 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/logger': 2.0.1 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.9.2 + '@walletconnect/utils': 2.9.2 events: 3.3.0 transitivePeerDependencies: - '@react-native-async-storage/async-storage' @@ -13553,8 +15238,8 @@ packages: tslib: 1.14.1 dev: false - /@walletconnect/types@2.9.0: - resolution: {integrity: sha512-ORopsMfSRvUYqtjKKd6scfg8o4/aGebipLxx92AuuUgMTERSU6cGmIrK6rdLu7W6FBJkmngPLEGc9mRqAb9Lug==} + /@walletconnect/types@2.10.2: + resolution: {integrity: sha512-luNV+07Wdla4STi9AejseCQY31tzWKQ5a7C3zZZaRK/di+rFaAAb7YW04OP4klE7tw/mJRGPTlekZElmHxO8kQ==} dependencies: '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.1 @@ -13567,17 +15252,51 @@ packages: - lokijs dev: false - /@walletconnect/universal-provider@2.9.0: - resolution: {integrity: sha512-k3nkSBkF69sJJVoe17IVoPtnhp/sgaa2t+x7BvA/BKeMxE0DGdtRJdEXotTc8DBmI7o2tkq6l8+HyFBGjQ/CjQ==} + /@walletconnect/types@2.9.2: + resolution: {integrity: sha512-7Rdn30amnJEEal4hk83cdwHUuxI1SWQ+K7fFFHBMqkuHLGi3tpMY6kpyfDxnUScYEZXqgRps4Jo5qQgnRqVM7A==} + dependencies: + '@walletconnect/events': 1.0.1 + '@walletconnect/heartbeat': 1.2.1 + '@walletconnect/jsonrpc-types': 1.0.3 + '@walletconnect/keyvaluestorage': 1.0.2 + '@walletconnect/logger': 2.0.1 + events: 3.3.0 + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + - lokijs + dev: false + + /@walletconnect/universal-provider@2.10.2: + resolution: {integrity: sha512-wFgI0LbQ3D56sgaUMsgOHCM5m8WLxiC71BGuCKQfApgsbNMVKugYVy2zWHyUyi8sqTQHI+uSaVpDev4UHq9LEw==} + dependencies: + '@walletconnect/jsonrpc-http-connection': 1.0.7 + '@walletconnect/jsonrpc-provider': 1.0.13 + '@walletconnect/jsonrpc-types': 1.0.3 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/logger': 2.0.1 + '@walletconnect/sign-client': 2.10.2 + '@walletconnect/types': 2.10.2 + '@walletconnect/utils': 2.10.2 + events: 3.3.0 + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + - bufferutil + - encoding + - lokijs + - utf-8-validate + dev: false + + /@walletconnect/universal-provider@2.9.2: + resolution: {integrity: sha512-JmaolkO8D31UdRaQCHwlr8uIFUI5BYhBzqYFt54Mc6gbIa1tijGOmdyr6YhhFO70LPmS6gHIjljwOuEllmlrxw==} dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.7 '@walletconnect/jsonrpc-provider': 1.0.13 '@walletconnect/jsonrpc-types': 1.0.3 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.0.1 - '@walletconnect/sign-client': 2.9.0 - '@walletconnect/types': 2.9.0 - '@walletconnect/utils': 2.9.0 + '@walletconnect/sign-client': 2.9.2 + '@walletconnect/types': 2.9.2 + '@walletconnect/utils': 2.9.2 events: 3.3.0 transitivePeerDependencies: - '@react-native-async-storage/async-storage' @@ -13587,8 +15306,30 @@ packages: - utf-8-validate dev: false - /@walletconnect/utils@2.9.0: - resolution: {integrity: sha512-7Tu3m6dZL84KofrNBcblsgpSqU2vdo9ImLD7zWimLXERVGNQ8smXG+gmhQYblebIBhsPzjy9N38YMC3nPlfQNw==} + /@walletconnect/utils@2.10.2: + resolution: {integrity: sha512-syxXRpc2yhSknMu3IfiBGobxOY7fLfLTJuw+ppKaeO6WUdZpIit3wfuGOcc0Ms3ZPFCrGfyGOoZsCvgdXtptRg==} + dependencies: + '@stablelib/chacha20poly1305': 1.0.1 + '@stablelib/hkdf': 1.0.1 + '@stablelib/random': 1.0.2 + '@stablelib/sha256': 1.0.1 + '@stablelib/x25519': 1.0.3 + '@walletconnect/relay-api': 1.0.9 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.10.2 + '@walletconnect/window-getters': 1.0.1 + '@walletconnect/window-metadata': 1.0.1 + detect-browser: 5.3.0 + query-string: 7.1.3 + uint8arrays: 3.1.1 + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + - lokijs + dev: false + + /@walletconnect/utils@2.9.2: + resolution: {integrity: sha512-D44hwXET/8JhhIjqljY6qxSu7xXnlPrf63UN/Qfl98vDjWlYVcDl2+JIQRxD9GPastw0S8XZXdRq59XDXLuZBg==} dependencies: '@stablelib/chacha20poly1305': 1.0.1 '@stablelib/hkdf': 1.0.1 @@ -13598,7 +15339,7 @@ packages: '@walletconnect/relay-api': 1.0.9 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.9.0 + '@walletconnect/types': 2.9.2 '@walletconnect/window-getters': 1.0.1 '@walletconnect/window-metadata': 1.0.1 detect-browser: 5.3.0 @@ -13805,9 +15546,11 @@ packages: dependencies: '@whatwg-node/events': 0.0.3 tslib: 2.6.2 + dev: false /@whatwg-node/events@0.0.2: resolution: {integrity: sha512-WKj/lI4QjnLuPrim0cfO7i+HsDSXHxNv1y0CrJhdntuO3hxWZmnXCwNDnwOvry11OjRin6cgWNF+j/9Pn8TN4w==} + dev: false /@whatwg-node/events@0.0.3: resolution: {integrity: sha512-IqnKIDWfXBJkvy/k6tzskWTc2NK3LcqHlb+KHGCrjOCH4jfQckRX0NAiIcC/vIqQkzLYw2r2CTSwAxcrtcD6lA==} @@ -13815,6 +15558,7 @@ packages: /@whatwg-node/events@0.1.1: resolution: {integrity: sha512-AyQEn5hIPV7Ze+xFoXVU3QTHXVbWPrzaOkxtENMPMuNL6VVHrp4hHfDt9nrQpjO7BgvuM95dMtkycX5M/DZR3w==} engines: {node: '>=16.0.0'} + dev: false /@whatwg-node/fetch@0.8.8: resolution: {integrity: sha512-CdcjGC2vdKhc13KKxgsc6/616BQ7ooDIgPeTuAiE8qfCnS0mGzcfCOoZXypQSz73nxI+GWc7ZReIAVhxoE1KCg==} @@ -13825,12 +15569,13 @@ packages: urlpattern-polyfill: 8.0.2 web-streams-polyfill: 3.2.1 - /@whatwg-node/fetch@0.9.13: - resolution: {integrity: sha512-PPtMwhjtS96XROnSpowCQM85gCUG2m7AXZFw0PZlGbhzx2GK7f2iOXilfgIJ0uSlCuuGbOIzfouISkA7C4FJOw==} + /@whatwg-node/fetch@0.9.14: + resolution: {integrity: sha512-wurZC82zzZwXRDSW0OS9l141DynaJQh7Yt0FD1xZ8niX7/Et/7RoiLiltbVU1fSF1RR9z6ndEaTUQBAmddTm1w==} engines: {node: '>=16.0.0'} dependencies: - '@whatwg-node/node-fetch': 0.4.19 + '@whatwg-node/node-fetch': 0.5.0 urlpattern-polyfill: 9.0.0 + dev: false /@whatwg-node/node-fetch@0.3.6: resolution: {integrity: sha512-w9wKgDO4C95qnXZRwZTfCmLWqyRnooGjcIwG0wADWjw9/HN0p7dtvtgSvItZtUyNteEvgTrd8QojNEqV6DAGTA==} @@ -13841,8 +15586,8 @@ packages: fast-url-parser: 1.1.3 tslib: 2.6.2 - /@whatwg-node/node-fetch@0.4.19: - resolution: {integrity: sha512-AW7/m2AuweAoSXmESrYQr/KBafueScNbn2iNO0u6xFr2JZdPmYsSm5yvAXYk6yDLv+eDmSSKrf7JnFZ0CsJIdA==} + /@whatwg-node/node-fetch@0.5.0: + resolution: {integrity: sha512-q76lDAafvHNGWedNAVHrz/EyYTS8qwRLcwne8SJQdRN5P3HydxU6XROFvJfTML6KZXQX2FDdGY4/SnaNyd7M0Q==} engines: {node: '>=16.0.0'} dependencies: '@whatwg-node/events': 0.1.1 @@ -13850,31 +15595,35 @@ packages: fast-querystring: 1.1.2 fast-url-parser: 1.1.3 tslib: 2.6.2 + dev: false /@whatwg-node/server@0.7.7: resolution: {integrity: sha512-aHURgNDFm/48WVV3vhTMfnEKCYwYgdaRdRhZsQZx4UVFjGGkGay7Ys0+AYu9QT/jpoImv2oONkstoTMUprDofg==} dependencies: '@whatwg-node/fetch': 0.8.8 tslib: 2.6.2 + dev: false - /@whatwg-node/server@0.9.15: - resolution: {integrity: sha512-MDmw3HYfZt8hzP8Vac/LPwD8LyZFByVuO1vHPBDsOMYNf4XWv6eHbRCk4UFfLT8OMFgd+qMy/zNYc74o+3tXZg==} + /@whatwg-node/server@0.9.16: + resolution: {integrity: sha512-gktQkRyONEw2EGpx7UZaC6zNlUm21CGlqAHQXU3QC6W0zlLM5ZQNDCeD66q/nsPHDV08X2NTHlABsuAEk5rh/w==} engines: {node: '>=16.0.0'} dependencies: - '@whatwg-node/fetch': 0.9.13 + '@whatwg-node/fetch': 0.9.14 tslib: 2.6.2 dev: false - /@wry/context@0.7.3: - resolution: {integrity: sha512-Nl8WTesHp89RF803Se9X3IiHjdmLBrIvPMaJkl+rKVJAYyPsz1TEUbu89943HpvujtSJgDUx9W4vZw3K1Mr3sA==} + /@wry/context@0.7.4: + resolution: {integrity: sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ==} engines: {node: '>=8'} + requiresBuild: true dependencies: tslib: 2.6.2 dev: false - /@wry/equality@0.5.6: - resolution: {integrity: sha512-D46sfMTngaYlrH+OspKf8mIJETntFnf6Hsjb0V41jAXJ7Bx2kB8Rv8RCUujuVWYttFtHkUNp7g+FwxNQAr6mXA==} + /@wry/equality@0.5.7: + resolution: {integrity: sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw==} engines: {node: '>=8'} + requiresBuild: true dependencies: tslib: 2.6.2 dev: false @@ -13882,15 +15631,11 @@ packages: /@wry/trie@0.4.3: resolution: {integrity: sha512-I6bHwH0fSf6RqQcnnXLJKhkSXG45MFral3GxPaY4uAl0LYDZM+YDVDAiU9bYwjTuysy1S0IeecWtmq1SZA3M1w==} engines: {node: '>=8'} + requiresBuild: true dependencies: tslib: 2.6.2 dev: false - /@xmldom/xmldom@0.8.10: - resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==} - engines: {node: '>=10.0.0'} - dev: true - /@xobotyi/scrollbar-width@1.9.5: resolution: {integrity: sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ==} dev: false @@ -13908,6 +15653,7 @@ packages: /@zxing/text-encoding@0.9.0: resolution: {integrity: sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==} requiresBuild: true + dev: false optional: true /JSONStream@1.3.2: @@ -13933,6 +15679,21 @@ packages: resolution: {integrity: sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==} dev: true + /abitype@0.10.3(typescript@5.3.2)(zod@3.22.4): + resolution: {integrity: sha512-tRN+7XIa7J9xugdbRzFv/95ka5ivR/sRe01eiWvM0HWWjHuigSZEACgKa0sj4wGuekTDtghCx+5Izk/cOi78pQ==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.22.0 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + dependencies: + typescript: 5.3.2 + zod: 3.22.4 + dev: true + /abitype@0.8.7(typescript@5.1.6)(zod@3.22.4): resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} peerDependencies: @@ -13944,9 +15705,36 @@ packages: dependencies: typescript: 5.1.6 zod: 3.22.4 + dev: false - /abitype@0.9.3(typescript@5.1.6)(zod@3.22.4): - resolution: {integrity: sha512-dz4qCQLurx97FQhnb/EIYTk/ldQ+oafEDUqC0VVIeQS1Q48/YWt/9YNfMmp9SLFqN41ktxny3c8aYxHjmFIB/w==} + /abitype@0.8.7(typescript@5.3.2): + resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.19.1 + peerDependenciesMeta: + zod: + optional: true + dependencies: + typescript: 5.3.2 + dev: true + + /abitype@0.9.8(typescript@4.9.5): + resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.19.1 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + dependencies: + typescript: 4.9.5 + dev: true + + /abitype@0.9.8(typescript@5.1.6)(zod@3.22.4): + resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} peerDependencies: typescript: '>=5.0.4' zod: ^3 >=3.19.1 @@ -13960,6 +15748,21 @@ packages: zod: 3.22.4 dev: false + /abitype@0.9.8(typescript@5.3.2)(zod@3.22.4): + resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.19.1 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + dependencies: + typescript: 5.3.2 + zod: 3.22.4 + dev: false + /abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -13981,6 +15784,10 @@ packages: it-stream-types: 2.0.1 dev: false + /abortcontroller-polyfill@1.7.5: + resolution: {integrity: sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==} + dev: true + /abstract-level@1.0.3: resolution: {integrity: sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==} engines: {node: '>=12'} @@ -13993,40 +15800,6 @@ packages: module-error: 1.0.2 queue-microtask: 1.2.3 - /abstract-leveldown@6.2.3: - resolution: {integrity: sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==} - engines: {node: '>=6'} - dependencies: - buffer: 5.7.1 - immediate: 3.2.3 - level-concat-iterator: 2.0.1 - level-supports: 1.0.1 - xtend: 4.0.2 - dev: true - - /abstract-leveldown@6.3.0: - resolution: {integrity: sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==} - engines: {node: '>=6'} - dependencies: - buffer: 5.7.1 - immediate: 3.3.0 - level-concat-iterator: 2.0.1 - level-supports: 1.0.1 - xtend: 4.0.2 - dev: true - - /abstract-leveldown@7.2.0: - resolution: {integrity: sha512-DnhQwcFEaYsvYDnACLZhMmCWd3rkOeEvglpa4q5i/5Jlm3UIsWaxVzuXvDLFCSCWRO3yy2/+V/G7FusFgejnfQ==} - engines: {node: '>=10'} - dependencies: - buffer: 6.0.3 - catering: 2.1.1 - is-buffer: 2.0.5 - level-concat-iterator: 3.1.0 - level-supports: 2.1.0 - queue-microtask: 1.2.3 - dev: true - /accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} @@ -14054,12 +15827,16 @@ packages: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: acorn: 8.10.0 - dev: true /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} + /acorn-walk@8.3.1: + resolution: {integrity: sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==} + engines: {node: '>=0.4.0'} + dev: true + /acorn@8.10.0: resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} engines: {node: '>=0.4.0'} @@ -14080,6 +15857,9 @@ packages: resolution: {integrity: sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==} dev: false + /aes-js@4.0.0-beta.5: + resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} + /agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -14156,8 +15936,8 @@ packages: require-from-string: 2.0.2 uri-js: 4.4.1 - /algoliasearch-helper@3.14.2(algoliasearch@4.20.0): - resolution: {integrity: sha512-FjDSrjvQvJT/SKMW74nPgFpsoPUwZCzGbCqbp8HhBFfSk/OvNFxzCaCmuO0p7AWeLy1gD+muFwQEkBwcl5H4pg==} + /algoliasearch-helper@3.15.0(algoliasearch@4.20.0): + resolution: {integrity: sha512-DGUnK3TGtDQsaUE4ayF/LjSN0DGsuYThB8WBgnnDY0Wq04K6lNVruO3LfqJOgSfDiezp+Iyt8Tj4YKHi+/ivSA==} peerDependencies: algoliasearch: '>= 3.1 < 6' dependencies: @@ -14204,6 +15984,7 @@ packages: /anser@1.4.10: resolution: {integrity: sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww==} + dev: false /ansi-align@3.0.1: resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} @@ -14238,6 +16019,7 @@ packages: colorette: 1.4.0 slice-ansi: 2.1.0 strip-ansi: 5.2.0 + dev: false /ansi-html-community@0.0.8: resolution: {integrity: sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==} @@ -14347,6 +16129,7 @@ packages: /appdirsjs@1.2.7: resolution: {integrity: sha512-Quji6+8kLBC3NnBeo14nPDq0+2jUs5s3/xEye+udFHumHhRk4M7aAMXp/PBJqkKYGuuyR9M/6Dq7d2AViiGmhw==} + dev: false /append-transform@2.0.0: resolution: {integrity: sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==} @@ -14407,10 +16190,12 @@ packages: /array-back@3.1.0: resolution: {integrity: sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==} engines: {node: '>=6'} + dev: true /array-back@4.0.2: resolution: {integrity: sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==} engines: {node: '>=8'} + dev: true /array-buffer-byte-length@1.0.0: resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} @@ -14597,22 +16382,18 @@ packages: engines: {node: '>=4'} dependencies: tslib: 2.6.2 + dev: false /astral-regex@1.0.0: resolution: {integrity: sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==} engines: {node: '>=4'} + dev: false /astral-regex@2.0.0: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} dev: true - /async-eventemitter@0.2.4: - resolution: {integrity: sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==} - dependencies: - async: 2.6.4 - dev: true - /async-limiter@1.0.1: resolution: {integrity: sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==} @@ -14666,6 +16447,7 @@ packages: /auto-bind@4.0.0: resolution: {integrity: sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ==} engines: {node: '>=8'} + dev: false /autoprefixer@10.4.16(postcss@8.4.31): resolution: {integrity: sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==} @@ -14675,7 +16457,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.22.1 - caniuse-lite: 1.0.30001553 + caniuse-lite: 1.0.30001554 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -14752,35 +16534,46 @@ packages: transitivePeerDependencies: - debug + /axios@1.6.2(debug@4.3.4): + resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} + dependencies: + follow-redirects: 1.15.3(debug@4.3.4) + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + /axobject-query@3.2.1: resolution: {integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==} dependencies: dequal: 2.0.3 dev: true - /babel-core@7.0.0-bridge.0(@babel/core@7.23.2): + /babel-core@7.0.0-bridge.0(@babel/core@7.23.5): resolution: {integrity: sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 + dev: false - /babel-jest@29.7.0(@babel/core@7.23.2): + /babel-jest@29.7.0(@babel/core@7.23.5): resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@jest/transform': 29.7.0 '@types/babel__core': 7.20.3 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.6.3(@babel/core@7.23.2) + babel-preset-jest: 29.6.3(@babel/core@7.23.5) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 transitivePeerDependencies: - supports-color + dev: true /babel-loader@8.3.0(@babel/core@7.23.2)(webpack@5.89.0): resolution: {integrity: sha512-H8SvsMF+m9t15HNLMipppzkC+Y2Yq+v3SonZyU70RBL/h1gxPkH08Ot8pEE9Z4Kd+czyWJClmFS8qzIP9OZ04Q==} @@ -14797,14 +16590,14 @@ packages: webpack: 5.89.0(webpack-cli@5.1.4) dev: false - /babel-loader@9.1.3(@babel/core@7.23.2)(webpack@5.89.0): + /babel-loader@9.1.3(@babel/core@7.23.5)(webpack@5.89.0): resolution: {integrity: sha512-xG3ST4DglodGf8qSwv0MdeWLhrDsw/32QMdTO5T1ZIp9gQur0HkCyFs7Awskr10JKXFXwpAhiCuYX5oGXnRGbw==} engines: {node: '>= 14.15.0'} peerDependencies: '@babel/core': ^7.12.0 webpack: '>=5' dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 find-cache-dir: 4.0.0 schema-utils: 4.2.0 webpack: 5.89.0(webpack-cli@5.1.4) @@ -14843,6 +16636,7 @@ packages: test-exclude: 6.0.0 transitivePeerDependencies: - supports-color + dev: true /babel-plugin-jest-hoist@29.6.3: resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} @@ -14852,6 +16646,7 @@ packages: '@babel/types': 7.23.0 '@types/babel__core': 7.20.3 '@types/babel__traverse': 7.20.3 + dev: true /babel-plugin-macros@3.1.0: resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==} @@ -14873,6 +16668,19 @@ packages: semver: 6.3.1 transitivePeerDependencies: - supports-color + dev: false + + /babel-plugin-polyfill-corejs2@0.4.6(@babel/core@7.23.5): + resolution: {integrity: sha512-jhHiWVZIlnPbEUKSSNb9YoWcQGdlTLq7z1GHL4AjFxaoOUMuuEVJ+Y4pAaQUGOGk93YsVCKPbqbfw3m0SM6H8Q==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/compat-data': 7.23.2 + '@babel/core': 7.23.5 + '@babel/helper-define-polyfill-provider': 0.4.3(@babel/core@7.23.5) + semver: 6.3.1 + transitivePeerDependencies: + - supports-color /babel-plugin-polyfill-corejs3@0.8.6(@babel/core@7.23.2): resolution: {integrity: sha512-leDIc4l4tUgU7str5BWLS2h8q2N4Nf6lGZP6UrNDxdtfF2g69eJ5L0H7S8A5Ln/arfFAfHor5InAdZuIOwZdgQ==} @@ -14884,6 +16692,18 @@ packages: core-js-compat: 3.33.1 transitivePeerDependencies: - supports-color + dev: false + + /babel-plugin-polyfill-corejs3@0.8.6(@babel/core@7.23.5): + resolution: {integrity: sha512-leDIc4l4tUgU7str5BWLS2h8q2N4Nf6lGZP6UrNDxdtfF2g69eJ5L0H7S8A5Ln/arfFAfHor5InAdZuIOwZdgQ==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-define-polyfill-provider': 0.4.3(@babel/core@7.23.5) + core-js-compat: 3.33.1 + transitivePeerDependencies: + - supports-color /babel-plugin-polyfill-regenerator@0.5.3(@babel/core@7.23.2): resolution: {integrity: sha512-8sHeDOmXC8csczMrYEOf0UTNa4yE2SxV5JGeT/LP1n0OYVDUUFPxG9vdk2AlDlIit4t+Kf0xCtpgXPBwnn/9pw==} @@ -14894,6 +16714,17 @@ packages: '@babel/helper-define-polyfill-provider': 0.4.3(@babel/core@7.23.2) transitivePeerDependencies: - supports-color + dev: false + + /babel-plugin-polyfill-regenerator@0.5.3(@babel/core@7.23.5): + resolution: {integrity: sha512-8sHeDOmXC8csczMrYEOf0UTNa4yE2SxV5JGeT/LP1n0OYVDUUFPxG9vdk2AlDlIit4t+Kf0xCtpgXPBwnn/9pw==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-define-polyfill-provider': 0.4.3(@babel/core@7.23.5) + transitivePeerDependencies: + - supports-color /babel-plugin-react-generate-property@1.1.2: resolution: {integrity: sha512-Wm1OfCfv7juukTZEZHNSYIMxeQEcIhnQQeGlFbML1BesMGZValuCCnEaayg6KyAlT9Y07I5Tz6XmH9YirUfkFQ==} @@ -14905,13 +16736,15 @@ packages: /babel-plugin-syntax-trailing-function-commas@7.0.0-beta.0: resolution: {integrity: sha512-Xj9XuRuz3nTSbaTXWv3itLOcxyF4oPD8douBBmj7U9BBC6nEBYfyOJYQMf/8PJAFotC62UY5dFfIGEPr7WswzQ==} + dev: false - /babel-plugin-transform-flow-enums@0.0.2(@babel/core@7.23.2): + /babel-plugin-transform-flow-enums@0.0.2(@babel/core@7.23.5): resolution: {integrity: sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ==} dependencies: - '@babel/plugin-syntax-flow': 7.22.5(@babel/core@7.23.2) + '@babel/plugin-syntax-flow': 7.22.5(@babel/core@7.23.5) transitivePeerDependencies: - '@babel/core' + dev: false /babel-plugin-transform-react-qa-classes@1.6.0: resolution: {integrity: sha512-r7G9s+j6CiatnTMP+32fbPrfrSSPWJ3LBoESNlCdXWb8oAO2Ubcrgk0TSbpHVMoDpBiyn+zfm2rxdxwdTt3FpQ==} @@ -14934,68 +16767,71 @@ packages: lodash.upperfirst: 4.3.1 dev: true - /babel-preset-current-node-syntax@1.0.1(@babel/core@7.23.2): + /babel-preset-current-node-syntax@1.0.1(@babel/core@7.23.5): resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.2 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.2) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.23.2) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.23.2) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.23.2) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.2) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.2) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.2) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.2) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.2) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.2) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.2) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.23.2) - - /babel-preset-fbjs@3.4.0(@babel/core@7.23.2): + '@babel/core': 7.23.5 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.5) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.23.5) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.23.5) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.5) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.5) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.23.5) + dev: true + + /babel-preset-fbjs@3.4.0(@babel/core@7.23.5): resolution: {integrity: sha512-9ywCsCvo1ojrw0b+XYk7aFvTH6D9064t0RIL1rtMf3nsa02Xw41MS7sZw216Im35xj/UY0PDBQsa1brUDDF1Ow==} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.2 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.23.2) - '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.23.2) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.23.2) - '@babel/plugin-syntax-flow': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.2) - '@babel/plugin-transform-arrow-functions': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-block-scoped-functions': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-block-scoping': 7.23.0(@babel/core@7.23.2) - '@babel/plugin-transform-classes': 7.22.15(@babel/core@7.23.2) - '@babel/plugin-transform-computed-properties': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-destructuring': 7.23.0(@babel/core@7.23.2) - '@babel/plugin-transform-flow-strip-types': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-for-of': 7.22.15(@babel/core@7.23.2) - '@babel/plugin-transform-function-name': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-literals': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-member-expression-literals': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-modules-commonjs': 7.23.0(@babel/core@7.23.2) - '@babel/plugin-transform-object-super': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-parameters': 7.22.15(@babel/core@7.23.2) - '@babel/plugin-transform-property-literals': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-react-display-name': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.23.2) - '@babel/plugin-transform-shorthand-properties': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-spread': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-template-literals': 7.22.5(@babel/core@7.23.2) + '@babel/core': 7.23.5 + '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.23.5) + '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.23.5) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.23.5) + '@babel/plugin-syntax-flow': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-transform-arrow-functions': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-block-scoped-functions': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-block-scoping': 7.23.0(@babel/core@7.23.5) + '@babel/plugin-transform-classes': 7.22.15(@babel/core@7.23.5) + '@babel/plugin-transform-computed-properties': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-destructuring': 7.23.0(@babel/core@7.23.5) + '@babel/plugin-transform-flow-strip-types': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-for-of': 7.22.15(@babel/core@7.23.5) + '@babel/plugin-transform-function-name': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-literals': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-member-expression-literals': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-modules-commonjs': 7.23.0(@babel/core@7.23.5) + '@babel/plugin-transform-object-super': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-parameters': 7.22.15(@babel/core@7.23.5) + '@babel/plugin-transform-property-literals': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-react-display-name': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.23.5) + '@babel/plugin-transform-shorthand-properties': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-spread': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-template-literals': 7.22.5(@babel/core@7.23.5) babel-plugin-syntax-trailing-function-commas: 7.0.0-beta.0 + dev: false - /babel-preset-jest@29.6.3(@babel/core@7.23.2): + /babel-preset-jest@29.6.3(@babel/core@7.23.5): resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 babel-plugin-jest-hoist: 29.6.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.23.2) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.23.5) + dev: true /babel-runtime@6.26.0: resolution: {integrity: sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==} @@ -15026,6 +16862,7 @@ packages: /base-64@0.1.0: resolution: {integrity: sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==} + dev: false /base-x@3.0.9: resolution: {integrity: sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==} @@ -15080,7 +16917,6 @@ packages: /bignumber.js@9.1.2: resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} - dev: true /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} @@ -15117,15 +16953,6 @@ packages: file-uri-to-path: 1.0.0 dev: false - /bip39@3.0.4: - resolution: {integrity: sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw==} - dependencies: - '@types/node': 11.11.6 - create-hash: 1.2.0 - pbkdf2: 3.1.2 - randombytes: 2.1.0 - dev: true - /bl@1.2.3: resolution: {integrity: sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==} dependencies: @@ -15306,7 +17133,7 @@ packages: dependencies: ansi-align: 3.0.1 camelcase: 7.0.1 - chalk: 5.0.1 + chalk: 5.3.0 cli-boxes: 3.0.0 string-width: 5.1.2 type-fest: 2.19.0 @@ -15367,18 +17194,11 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001553 - electron-to-chromium: 1.4.564 + caniuse-lite: 1.0.30001554 + electron-to-chromium: 1.4.567 node-releases: 2.0.13 update-browserslist-db: 1.0.13(browserslist@4.22.1) - /bs-logger@0.2.6: - resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} - engines: {node: '>= 6'} - dependencies: - fast-json-stable-stringify: 2.1.0 - dev: true - /bs58@4.0.1: resolution: {integrity: sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==} dependencies: @@ -15418,15 +17238,13 @@ packages: /buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + /buffer-to-arraybuffer@0.0.5: + resolution: {integrity: sha512-3dthu5CYiVB1DEJp61FtApNnNndTckcqe4pFcLdvHtrpG+kcyekCJKg4MRiDcFW7A6AODnXB9U4dwQiCW5kzJQ==} + dev: true + /buffer-xor@1.0.3: resolution: {integrity: sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==} - /buffer-xor@2.0.2: - resolution: {integrity: sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==} - dependencies: - safe-buffer: 5.2.1 - dev: true - /buffer@4.9.2: resolution: {integrity: sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==} dependencies: @@ -15446,15 +17264,6 @@ packages: base64-js: 1.5.1 ieee754: 1.2.1 - /bufferutil@4.0.5: - resolution: {integrity: sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A==} - engines: {node: '>=6.14.2'} - requiresBuild: true - dependencies: - node-gyp-build: 4.6.1 - dev: true - optional: true - /bufferutil@4.0.8: resolution: {integrity: sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==} engines: {node: '>=6.14.2'} @@ -15462,6 +17271,11 @@ packages: dependencies: node-gyp-build: 4.6.1 + /bufio@1.2.1: + resolution: {integrity: sha512-9oR3zNdupcg/Ge2sSHQF3GX+kmvL/fTPvD0nd5AGLq8SjUYnTz+SlFjK/GXidndbZtIj+pVKXiWeR9w6e9wKCA==} + engines: {node: '>=14.0.0'} + dev: true + /builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} @@ -15510,6 +17324,16 @@ packages: engines: {node: '>=8'} dev: true + /cacheable-lookup@5.0.4: + resolution: {integrity: sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==} + engines: {node: '>=10.6.0'} + dev: true + + /cacheable-lookup@6.1.0: + resolution: {integrity: sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww==} + engines: {node: '>=10.6.0'} + dev: true + /cacheable-request@2.1.4: resolution: {integrity: sha512-vag0O2LKZ/najSoUwDbVlnlCFvhBE/7mGTY2B5FgCBDcRD+oVV1HYTOwM6JZfMg/hIcM6IwnTZ1uQQL5/X3xIQ==} dependencies: @@ -15535,6 +17359,19 @@ packages: responselike: 1.0.2 dev: false + /cacheable-request@7.0.4: + resolution: {integrity: sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==} + engines: {node: '>=8'} + dependencies: + clone-response: 1.0.3 + get-stream: 5.2.0 + http-cache-semantics: 4.1.1 + keyv: 4.5.4 + lowercase-keys: 2.0.0 + normalize-url: 6.1.0 + responselike: 2.0.1 + dev: true + /cachedir@2.3.0: resolution: {integrity: sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==} engines: {node: '>=6'} @@ -15571,16 +17408,19 @@ packages: engines: {node: '>=4'} dependencies: callsites: 2.0.0 + dev: false /caller-path@2.0.0: resolution: {integrity: sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A==} engines: {node: '>=4'} dependencies: caller-callsite: 2.0.0 + dev: false /callsites@2.0.0: resolution: {integrity: sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ==} engines: {node: '>=4'} + dev: false /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} @@ -15605,11 +17445,6 @@ packages: map-obj: 4.3.0 quick-lru: 4.0.1 - /camelcase@3.0.0: - resolution: {integrity: sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==} - engines: {node: '>=0.10.0'} - dev: true - /camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} @@ -15627,13 +17462,13 @@ packages: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} dependencies: browserslist: 4.22.1 - caniuse-lite: 1.0.30001553 + caniuse-lite: 1.0.30001554 lodash.memoize: 4.1.2 lodash.uniq: 4.5.0 dev: false - /caniuse-lite@1.0.30001553: - resolution: {integrity: sha512-N0ttd6TrFfuqKNi+pMgWJTb9qrdJu4JSpgPFLe/lrD19ugC6fZgF0pUewRowDwzdDnb9V41mFcdlYgl/PyKf4A==} + /caniuse-lite@1.0.30001554: + resolution: {integrity: sha512-A2E3U//MBwbJVzebddm1YfNp7Nud5Ip+IPn4BozBmn4KqVX7AvluoIDFWjsv5OkGnKUXQVmMSoMKLa3ScCblcQ==} /capital-case@1.0.4: resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} @@ -15641,6 +17476,7 @@ packages: no-case: 3.0.4 tslib: 2.6.2 upper-case-first: 2.0.2 + dev: false /carbites@1.0.6: resolution: {integrity: sha512-dS9IQvnrb5VIRvSTNz5Ff+mB9d2MFfi5mojtJi7Rlss79VeF190jr0sZdA7eW0CGHotvHkZaWuM6wgfD9PEFRg==} @@ -15689,8 +17525,8 @@ packages: resolution: {integrity: sha512-b3tFPA9pUr2zCUiCfRd2+wok2/LBSNUMKOuRRok+WlvvAgEt/PlbgPTsZUcwCOs53IJvLgTp0eotwtosE6njug==} hasBin: true - /cborg@4.0.4: - resolution: {integrity: sha512-nu+JXYskYqWN/tFWQVjL2ZYlUwK+dapqkTpruAtJkwmDv7XaTgg8PStUbO+sXfhqSWaeQ9LPSPCTrO2WZ2Bxfg==} + /cborg@4.0.5: + resolution: {integrity: sha512-q8TAjprr8pn9Fp53rOIGp/UFDdFY6os2Nq62YogPSIzczJD9M6g2b6igxMkpCiZZKJ0kn/KzDLDvG+EqBIEeCg==} hasBin: true dev: false @@ -15770,7 +17606,6 @@ packages: /chalk@5.3.0: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - dev: true /chance@1.1.11: resolution: {integrity: sha512-kqTg3WWywappJPqtgrdvbA380VoXO2eu9VCV895JgbyHsaErXdyHK9LOZ911OvAk6L0obK7kDk9CGs8+oBawVA==} @@ -15789,6 +17624,7 @@ packages: title-case: 3.0.3 upper-case: 2.0.2 upper-case-first: 2.0.2 + dev: false /change-case-all@1.0.15: resolution: {integrity: sha512-3+GIFhk3sNuvFAJKU46o26OdzudQlPNBCu1ZQi3cMeMHhty1bhDxu2WrEilVNYaGvqUtR1VSigFcJOiS13dRhQ==} @@ -15803,6 +17639,7 @@ packages: title-case: 3.0.3 upper-case: 2.0.2 upper-case-first: 2.0.2 + dev: false /change-case@4.1.2: resolution: {integrity: sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==} @@ -15819,10 +17656,12 @@ packages: sentence-case: 3.0.4 snake-case: 3.0.4 tslib: 2.6.2 + dev: false /char-regex@1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} + dev: true /character-entities-legacy@1.1.4: resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} @@ -15917,6 +17756,18 @@ packages: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} + /cids@0.7.5: + resolution: {integrity: sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==} + engines: {node: '>=4.0.0', npm: '>=3.0.0'} + deprecated: This module has been superseded by the multiformats module + dependencies: + buffer: 5.7.1 + class-is: 1.1.0 + multibase: 0.6.1 + multicodec: 1.0.4 + multihashes: 0.4.21 + dev: true + /cipher-base@1.0.4: resolution: {integrity: sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==} dependencies: @@ -15925,10 +17776,10 @@ packages: /cjs-module-lexer@1.2.3: resolution: {integrity: sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==} + dev: true /class-is@1.1.0: resolution: {integrity: sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==} - dev: false /classic-level@1.3.0: resolution: {integrity: sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==} @@ -16072,14 +17923,6 @@ packages: is-wsl: 2.2.0 dev: false - /cliui@3.2.0: - resolution: {integrity: sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==} - dependencies: - string-width: 1.0.2 - strip-ansi: 3.0.1 - wrap-ansi: 2.1.0 - dev: true - /cliui@6.0.0: resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} dependencies: @@ -16120,7 +17963,6 @@ packages: resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==} dependencies: mimic-response: 1.0.1 - dev: false /clone@1.0.4: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} @@ -16144,10 +17986,6 @@ packages: /co@4.6.0: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} - - /code-point-at@1.1.0: - resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==} - engines: {node: '>=0.10.0'} dev: true /collapse-white-space@1.0.6: @@ -16156,6 +17994,7 @@ packages: /collect-v8-coverage@1.0.2: resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} + dev: true /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} @@ -16219,6 +18058,7 @@ packages: find-replace: 3.0.0 lodash.camelcase: 4.3.0 typical: 4.0.0 + dev: true /command-line-usage@6.1.3: resolution: {integrity: sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==} @@ -16228,6 +18068,7 @@ packages: chalk: 2.4.2 table-layout: 1.0.2 typical: 5.2.0 + dev: true /commander@10.0.1: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} @@ -16240,6 +18081,7 @@ packages: /commander@2.13.0: resolution: {integrity: sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==} + dev: false /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -16273,14 +18115,15 @@ packages: /commander@9.5.0: resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} engines: {node: ^12.20.0 || >=14} + dev: false - /commitizen@4.3.0: + /commitizen@4.3.0(typescript@4.9.5): resolution: {integrity: sha512-H0iNtClNEhT0fotHvGV3E9tDejDeS04sN1veIebsKYGMuGscFaswRoYJKmT3eW85eIJAs0F28bG2+a/9wCOfPw==} engines: {node: '>= 12'} hasBin: true dependencies: cachedir: 2.3.0 - cz-conventional-changelog: 3.3.0 + cz-conventional-changelog: 3.3.0(typescript@4.9.5) dedent: 0.7.0 detect-indent: 6.1.0 find-node-modules: 2.1.3 @@ -16294,8 +18137,7 @@ packages: strip-bom: 4.0.0 strip-json-comments: 3.1.1 transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' + - typescript dev: true /common-path-prefix@3.0.0: @@ -16379,6 +18221,7 @@ packages: utils-merge: 1.0.1 transitivePeerDependencies: - supports-color + dev: false /consola@2.15.3: resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==} @@ -16390,6 +18233,7 @@ packages: no-case: 3.0.4 tslib: 2.6.2 upper-case: 2.0.2 + dev: false /content-disposition@0.5.2: resolution: {integrity: sha512-kRGRZw3bLlFISDBgwTSA1TMBFN6J6GWDeubmDE3AF+3+yXL8hTWv8r5rkLbqYXY4RjPk/EzHnClI3zQf1cFmHA==} @@ -16402,6 +18246,14 @@ packages: dependencies: safe-buffer: 5.2.1 + /content-hash@2.5.2: + resolution: {integrity: sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw==} + dependencies: + cids: 0.7.5 + multicodec: 0.5.7 + multihashes: 0.4.21 + dev: true + /content-type@1.0.5: resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} engines: {node: '>= 0.6'} @@ -16456,7 +18308,7 @@ packages: resolution: {integrity: sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==} engines: {node: '>=12.13'} dependencies: - is-what: 4.1.15 + is-what: 4.1.16 dev: false /copy-text-to-clipboard@3.2.0: @@ -16485,19 +18337,6 @@ packages: webpack: 5.89.0(webpack-cli@5.1.4) dev: false - /copyfiles@2.4.1: - resolution: {integrity: sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==} - hasBin: true - dependencies: - glob: 7.2.3 - minimatch: 3.1.2 - mkdirp: 1.0.4 - noms: 0.0.0 - through2: 2.0.5 - untildify: 4.0.0 - yargs: 16.2.0 - dev: true - /core-js-compat@3.33.1: resolution: {integrity: sha512-6pYKNOgD/j/bkC5xS5IIg6bncid3rfrI42oBH1SQJbsmYPKF7rhzcFzYCcxYMmNQQ0rCEB8WqpW7QHndOggaeQ==} dependencies: @@ -16524,6 +18363,14 @@ packages: /core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + /cors@2.8.5: + resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} + engines: {node: '>= 0.10'} + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + dev: true + /cose-base@1.0.3: resolution: {integrity: sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==} dependencies: @@ -16536,7 +18383,7 @@ packages: layout-base: 2.0.1 dev: false - /cosmiconfig-typescript-loader@4.4.0(@types/node@18.18.6)(cosmiconfig@8.3.6)(ts-node@10.9.1)(typescript@5.2.2): + /cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6)(ts-node@10.9.1)(typescript@4.9.5): resolution: {integrity: sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw==} engines: {node: '>=v14.21.3'} peerDependencies: @@ -16545,27 +18392,27 @@ packages: ts-node: '>=10' typescript: '>=4' dependencies: - '@types/node': 18.18.6 - cosmiconfig: 8.3.6(typescript@5.2.2) - ts-node: 10.9.1(@types/node@18.18.6)(typescript@5.2.2) - typescript: 5.2.2 + '@types/node': 20.5.1 + cosmiconfig: 8.3.6(typescript@4.9.5) + ts-node: 10.9.1(@types/node@20.5.1)(typescript@4.9.5) + typescript: 4.9.5 dev: true - optional: true - /cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6)(ts-node@10.9.1)(typescript@4.9.5): - resolution: {integrity: sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw==} - engines: {node: '>=v14.21.3'} + /cosmiconfig-typescript-loader@5.0.0(@types/node@18.18.7)(cosmiconfig@8.3.6)(typescript@4.9.5): + resolution: {integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==} + engines: {node: '>=v16'} + requiresBuild: true peerDependencies: '@types/node': '*' - cosmiconfig: '>=7' - ts-node: '>=10' + cosmiconfig: '>=8.2' typescript: '>=4' dependencies: - '@types/node': 20.5.1 + '@types/node': 18.18.7 cosmiconfig: 8.3.6(typescript@4.9.5) - ts-node: 10.9.1(@types/node@20.5.1)(typescript@4.9.5) + jiti: 1.20.0 typescript: 4.9.5 dev: true + optional: true /cosmiconfig@5.2.1: resolution: {integrity: sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==} @@ -16575,6 +18422,7 @@ packages: is-directory: 0.3.1 js-yaml: 3.14.1 parse-json: 4.0.0 + dev: false /cosmiconfig@6.0.0: resolution: {integrity: sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==} @@ -16624,22 +18472,7 @@ packages: path-type: 4.0.0 typescript: 4.9.5 - /cosmiconfig@8.3.6(typescript@5.1.6): - resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} - engines: {node: '>=14'} - peerDependencies: - typescript: '>=4.9.5' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - import-fresh: 3.3.0 - js-yaml: 4.1.0 - parse-json: 5.2.0 - path-type: 4.0.0 - typescript: 5.1.6 - - /cosmiconfig@8.3.6(typescript@5.2.2): + /cosmiconfig@8.3.6(typescript@5.3.2): resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} engines: {node: '>=14'} peerDependencies: @@ -16652,9 +18485,8 @@ packages: js-yaml: 4.1.0 parse-json: 5.2.0 path-type: 4.0.0 - typescript: 5.2.2 - dev: true - optional: true + typescript: 5.3.2 + dev: false /crc-32@1.2.2: resolution: {integrity: sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==} @@ -16680,7 +18512,7 @@ packages: safe-buffer: 5.2.1 sha.js: 2.4.11 - /create-jest@29.7.0(@types/node@18.18.6)(ts-node@10.9.1): + /create-jest@29.7.0(@types/node@18.18.7): resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -16689,7 +18521,7 @@ packages: chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@18.18.6)(ts-node@10.9.1) + jest-config: 29.7.0(@types/node@18.18.7) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -16697,6 +18529,7 @@ packages: - babel-plugin-macros - supports-color - ts-node + dev: true /create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} @@ -16719,6 +18552,22 @@ packages: node-fetch: 2.7.0 transitivePeerDependencies: - encoding + dev: false + + /cross-fetch@4.0.0: + resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==} + dependencies: + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + dev: true + + /cross-inspect@1.0.0: + resolution: {integrity: sha512-4PFfn4b5ZN6FMNGSZlyb7wUhuN8wvj8t/VQHZdM4JsDcruGJ8L2kf9zao98QIrBPFCpdk27qst/AGTl7pL3ypQ==} + engines: {node: '>=16.0.0'} + dependencies: + tslib: 2.6.2 + dev: false /cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} @@ -17036,21 +18885,20 @@ packages: lodash: 4.17.21 dev: false - /cz-conventional-changelog@3.3.0: + /cz-conventional-changelog@3.3.0(typescript@4.9.5): resolution: {integrity: sha512-U466fIzU5U22eES5lTNiNbZ+d8dfcHcssH4o7QsdWaCcRs/feIPCxKYSWkYBNs5mny7MvEfwpTLWjvbm94hecw==} engines: {node: '>= 10'} dependencies: chalk: 2.4.2 - commitizen: 4.3.0 + commitizen: 4.3.0(typescript@4.9.5) conventional-commit-types: 3.0.0 lodash.map: 4.6.0 longest: 2.0.1 word-wrap: 1.2.5 optionalDependencies: - '@commitlint/load': 18.0.0 + '@commitlint/load': 18.2.0(typescript@4.9.5) transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' + - typescript dev: true /d3-array@3.2.4: @@ -17361,6 +19209,7 @@ packages: /dataloader@2.2.2: resolution: {integrity: sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g==} + dev: false /datastore-core@8.0.4: resolution: {integrity: sha512-oBA6a024NFXJOTu+w9nLAimfy4wCYUhdE/5XQGtdKt1BmCVtPYW10GORvVT3pdZBcse6k/mVcBl+hjkXIlm65A==} @@ -17435,6 +19284,7 @@ packages: /dayjs@1.11.7: resolution: {integrity: sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==} + dev: false /death@1.1.0: resolution: {integrity: sha512-vsV6S4KVHvTGxbEcij7hkWRv0It+sGGWVOM67dQde/o5Xjnr+KmLjxWJii2uEObIrt1CcM9w0Yaovx+iOlIL+w==} @@ -17509,6 +19359,13 @@ packages: dependencies: mimic-response: 1.0.1 + /decompress-response@6.0.0: + resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} + engines: {node: '>=10'} + dependencies: + mimic-response: 3.1.0 + dev: true + /decompress-tar@4.1.1: resolution: {integrity: sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==} engines: {node: '>=4'} @@ -17573,6 +19430,7 @@ packages: peerDependenciesMeta: babel-plugin-macros: optional: true + dev: true /deep-eql@4.1.3: resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} @@ -17610,7 +19468,6 @@ packages: /deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - dev: true /deep-object-diff@1.1.9: resolution: {integrity: sha512-Rn+RuwkmkDwCi2/oXOFS9Gsr5lJZu/yTGpK7wAaAIE75CC+LCGEZHpY6VQJa/RoJcrmaA/docWJZvYohlNkWPA==} @@ -17654,12 +19511,9 @@ packages: resolution: {integrity: sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==} dev: false - /deferred-leveldown@5.3.0: - resolution: {integrity: sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==} - engines: {node: '>=6'} - dependencies: - abstract-leveldown: 6.2.3 - inherits: 2.0.4 + /defer-to-connect@2.0.1: + resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} + engines: {node: '>=10'} dev: true /define-data-property@1.1.1: @@ -17723,6 +19577,7 @@ packages: /denodeify@1.2.1: resolution: {integrity: sha512-KNTihKNmQENUZeKu5fzfpzRqR5S2VMp4gl9RFHiWzj9DfvYQPMJ6XHKNaQxaGCXwPk6y9yme3aUoaiAe+KX+vg==} + dev: false /denque@1.5.1: resolution: {integrity: sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==} @@ -17740,6 +19595,7 @@ packages: /dependency-graph@0.11.0: resolution: {integrity: sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg==} engines: {node: '>= 0.6.0'} + dev: false /deprecated-react-native-prop-types@4.1.0: resolution: {integrity: sha512-WfepZHmRbbdTvhcolb8aOKEvQdcmTMn5tKLbqbXmkBvjFjRVWAYqsXk/DBsV8TZxws8SdGHLuHaJrHSQUPRdfw==} @@ -17747,6 +19603,7 @@ packages: '@react-native/normalize-colors': 0.72.0 invariant: 2.2.4 prop-types: 15.8.1 + dev: false /dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} @@ -17779,6 +19636,7 @@ packages: /detect-newline@3.1.0: resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} engines: {node: '>=8'} + dev: true /detect-node-es@1.1.0: resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==} @@ -17810,10 +19668,6 @@ packages: /diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - /diff@3.5.0: - resolution: {integrity: sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==} - engines: {node: '>=0.3.1'} dev: true /diff@4.0.2: @@ -17884,6 +19738,7 @@ packages: dependencies: asap: 2.0.6 lodash.clone: 4.5.0 + dev: false /docker-compose@0.23.19: resolution: {integrity: sha512-v5vNLIdUqwj4my80wxFDkNH+4S85zsRuH29SO7dCWVWPCMt/ohZBsGN6g6KXWifT0pzQ7uOxqEKCYCDPJ8Vz4g==} @@ -17927,7 +19782,6 @@ packages: engines: {node: '>=6.0.0'} dependencies: esutils: 2.0.3 - dev: true /docusaurus-plugin-remote-content@3.1.0(@docusaurus/core@2.4.3): resolution: {integrity: sha512-859WYmC75l9hRYa1f/2FNF+FLcKbkHCM/0dehN1Wl1fIuoFzEPf3tcWs4jcEobRHYnoMjyupqAhmu0q5j3JoIg==} @@ -17935,7 +19789,7 @@ packages: peerDependencies: '@docusaurus/core': 2.x dependencies: - '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) + '@docusaurus/core': 2.4.3(@docusaurus/types@2.4.3)(eslint@8.52.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) axios: 0.26.1 picocolors: 1.0.0 pretty-ms: 7.0.1 @@ -17975,6 +19829,10 @@ packages: entities: 4.5.0 dev: false + /dom-walk@0.1.2: + resolution: {integrity: sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==} + dev: true + /domelementtype@2.3.0: resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} @@ -18064,9 +19922,10 @@ packages: pify: 4.0.1 dev: true - /dset@3.1.2: - resolution: {integrity: sha512-g/M9sqy3oHe477Ar4voQxWtaPIFw1jTdKZuomOjhCcBx9nHUNn0pu6NopuFFrTh/TRZIKEj+76vLWFu9BNKk+Q==} + /dset@3.1.3: + resolution: {integrity: sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ==} engines: {node: '>=4'} + dev: false /duplexer3@0.1.5: resolution: {integrity: sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==} @@ -18119,8 +19978,8 @@ packages: dependencies: encoding: 0.1.13 - /electron-to-chromium@1.4.564: - resolution: {integrity: sha512-bGAx9+teIzL5I4esQwCMtiXtb78Ysc8xOKTPOvmafbJZ4SQ40kDO1ym3yRcGSkfaBtV81fGgHOgPoe6DsmpmkA==} + /electron-to-chromium@1.4.567: + resolution: {integrity: sha512-8KR114CAYQ4/r5EIEsOmOMqQ9j0MRbJZR3aXD/KFA8RuKzyoUB4XrUCg+l8RUGqTVQgKNIgTpjaG8YHRPAbX2w==} /elkjs@0.8.2: resolution: {integrity: sha512-L6uRgvZTH+4OF5NE/MBbzQx/WYpru1xCBE9respNj6qznEewGUIfhzmm7horWWxbNO2M0WckQypGctR8lH79xQ==} @@ -18141,14 +20000,10 @@ packages: resolution: {integrity: sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==} dev: true - /emittery@0.10.0: - resolution: {integrity: sha512-AGvFfs+d0JKCJQ4o01ASQLGPmSCxgfU9RFXvzPvZdjKK8oscynksuJhWrSTSw7j7Ep/sZct5b5ZhYCi8S/t0HQ==} - engines: {node: '>=12'} - dev: true - /emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} + dev: true /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -18171,16 +20026,6 @@ packages: resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} engines: {node: '>= 0.8'} - /encoding-down@6.3.0: - resolution: {integrity: sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==} - engines: {node: '>=6'} - dependencies: - abstract-leveldown: 6.3.0 - inherits: 2.0.4 - level-codec: 9.0.2 - level-errors: 2.0.1 - dev: true - /encoding@0.1.13: resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} dependencies: @@ -18250,13 +20095,6 @@ packages: /err-code@3.0.1: resolution: {integrity: sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==} - /errno@0.1.8: - resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} - hasBin: true - dependencies: - prr: 1.0.1 - dev: true - /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: @@ -18266,6 +20104,7 @@ packages: resolution: {integrity: sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==} dependencies: stackframe: 1.3.4 + dev: false /errorhandler@1.5.1: resolution: {integrity: sha512-rcOwbfvP1WTViVoUjcfZicVzjhjTuhSMntHh6mW3IrEiyE6mJyXvsToJUJGlGlw/2xU9P5whlWNGlIDVeCiT4A==} @@ -18273,6 +20112,7 @@ packages: dependencies: accepts: 1.3.8 escape-html: 1.0.3 + dev: false /es-abstract@1.22.3: resolution: {integrity: sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==} @@ -18456,36 +20296,6 @@ packages: '@esbuild/win32-x64': 0.16.3 dev: true - /esbuild@0.17.19: - resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/android-arm': 0.17.19 - '@esbuild/android-arm64': 0.17.19 - '@esbuild/android-x64': 0.17.19 - '@esbuild/darwin-arm64': 0.17.19 - '@esbuild/darwin-x64': 0.17.19 - '@esbuild/freebsd-arm64': 0.17.19 - '@esbuild/freebsd-x64': 0.17.19 - '@esbuild/linux-arm': 0.17.19 - '@esbuild/linux-arm64': 0.17.19 - '@esbuild/linux-ia32': 0.17.19 - '@esbuild/linux-loong64': 0.17.19 - '@esbuild/linux-mips64el': 0.17.19 - '@esbuild/linux-ppc64': 0.17.19 - '@esbuild/linux-riscv64': 0.17.19 - '@esbuild/linux-s390x': 0.17.19 - '@esbuild/linux-x64': 0.17.19 - '@esbuild/netbsd-x64': 0.17.19 - '@esbuild/openbsd-x64': 0.17.19 - '@esbuild/sunos-x64': 0.17.19 - '@esbuild/win32-arm64': 0.17.19 - '@esbuild/win32-ia32': 0.17.19 - '@esbuild/win32-x64': 0.17.19 - dev: true - /esbuild@0.18.20: resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} engines: {node: '>=12'} @@ -18516,34 +20326,34 @@ packages: '@esbuild/win32-x64': 0.18.20 dev: true - /esbuild@0.19.5: - resolution: {integrity: sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==} + /esbuild@0.19.8: + resolution: {integrity: sha512-l7iffQpT2OrZfH2rXIp7/FkmaeZM0vxbxN9KfiCwGYuZqzMg/JdvX26R31Zxn/Pxvsrg3Y9N6XTcnknqDyyv4w==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.19.5 - '@esbuild/android-arm64': 0.19.5 - '@esbuild/android-x64': 0.19.5 - '@esbuild/darwin-arm64': 0.19.5 - '@esbuild/darwin-x64': 0.19.5 - '@esbuild/freebsd-arm64': 0.19.5 - '@esbuild/freebsd-x64': 0.19.5 - '@esbuild/linux-arm': 0.19.5 - '@esbuild/linux-arm64': 0.19.5 - '@esbuild/linux-ia32': 0.19.5 - '@esbuild/linux-loong64': 0.19.5 - '@esbuild/linux-mips64el': 0.19.5 - '@esbuild/linux-ppc64': 0.19.5 - '@esbuild/linux-riscv64': 0.19.5 - '@esbuild/linux-s390x': 0.19.5 - '@esbuild/linux-x64': 0.19.5 - '@esbuild/netbsd-x64': 0.19.5 - '@esbuild/openbsd-x64': 0.19.5 - '@esbuild/sunos-x64': 0.19.5 - '@esbuild/win32-arm64': 0.19.5 - '@esbuild/win32-ia32': 0.19.5 - '@esbuild/win32-x64': 0.19.5 + '@esbuild/android-arm': 0.19.8 + '@esbuild/android-arm64': 0.19.8 + '@esbuild/android-x64': 0.19.8 + '@esbuild/darwin-arm64': 0.19.8 + '@esbuild/darwin-x64': 0.19.8 + '@esbuild/freebsd-arm64': 0.19.8 + '@esbuild/freebsd-x64': 0.19.8 + '@esbuild/linux-arm': 0.19.8 + '@esbuild/linux-arm64': 0.19.8 + '@esbuild/linux-ia32': 0.19.8 + '@esbuild/linux-loong64': 0.19.8 + '@esbuild/linux-mips64el': 0.19.8 + '@esbuild/linux-ppc64': 0.19.8 + '@esbuild/linux-riscv64': 0.19.8 + '@esbuild/linux-s390x': 0.19.8 + '@esbuild/linux-x64': 0.19.8 + '@esbuild/netbsd-x64': 0.19.8 + '@esbuild/openbsd-x64': 0.19.8 + '@esbuild/sunos-x64': 0.19.8 + '@esbuild/win32-arm64': 0.19.8 + '@esbuild/win32-ia32': 0.19.8 + '@esbuild/win32-x64': 0.19.8 dev: true /escalade@3.1.1: @@ -18807,7 +20617,6 @@ packages: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 - dev: true /eslint-utils@3.0.0(eslint@8.19.0): resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} @@ -18827,7 +20636,6 @@ packages: /eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true /eslint@8.19.0: resolution: {integrity: sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw==} @@ -18879,7 +20687,7 @@ packages: hasBin: true dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) - '@eslint-community/regexpp': 4.9.1 + '@eslint-community/regexpp': 4.10.0 '@eslint/eslintrc': 2.1.2 '@eslint/js': 8.52.0 '@humanwhocodes/config-array': 0.11.13 @@ -18918,7 +20726,6 @@ packages: text-table: 0.2.0 transitivePeerDependencies: - supports-color - dev: true /espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} @@ -18927,7 +20734,6 @@ packages: acorn: 8.10.0 acorn-jsx: 5.3.2(acorn@8.10.0) eslint-visitor-keys: 3.4.3 - dev: true /esprima@2.7.3: resolution: {integrity: sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==} @@ -18945,7 +20751,6 @@ packages: engines: {node: '>=0.10'} dependencies: estraverse: 5.3.0 - dev: true /esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} @@ -19014,7 +20819,7 @@ packages: optional: true dependencies: '@solidity-parser/parser': 0.14.5 - axios: 1.5.1(debug@4.3.4) + axios: 1.6.2(debug@4.3.4) cli-table3: 0.5.1 colors: 1.4.0 ethereum-cryptography: 1.2.0 @@ -19043,6 +20848,29 @@ packages: pify: 5.0.0 dev: false + /eth-lib@0.1.29: + resolution: {integrity: sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ==} + dependencies: + bn.js: 4.12.0 + elliptic: 6.5.4 + nano-json-stream-parser: 0.1.2 + servify: 0.1.12 + ws: 3.3.3 + xhr-request-promise: 0.1.3 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /eth-lib@0.2.8: + resolution: {integrity: sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==} + dependencies: + bn.js: 4.12.0 + elliptic: 6.5.4 + xhr-request-promise: 0.1.3 + dev: true + /eth-query@2.1.2: resolution: {integrity: sha512-srES0ZcvwkR/wd5OQBRA1bIJMww1skfGS0s8wlwK3/oNP4+wnds60krvu5R1QbpRQjMmpG5OMIWro5s7gvDPsA==} dependencies: @@ -19056,6 +20884,12 @@ packages: fast-safe-stringify: 2.1.1 dev: false + /eth-rpc-errors@4.0.3: + resolution: {integrity: sha512-Z3ymjopaoft7JDoxZcEb3pwdGh7yiYMhOwm2doUt6ASXlMavpNlK6Cre0+IMl2VSGyEU9rkiperQhp5iRxn5Pg==} + dependencies: + fast-safe-stringify: 2.1.1 + dev: false + /ethereum-bloom-filters@1.0.10: resolution: {integrity: sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA==} dependencies: @@ -19098,31 +20932,6 @@ packages: '@scure/bip39': 1.2.1 dev: true - /ethereum-waffle@4.0.10(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typescript@4.9.5): - resolution: {integrity: sha512-iw9z1otq7qNkGDNcMoeNeLIATF9yKl1M8AIeu42ElfNBplq0e+5PeasQmm8ybY/elkZ1XyRO0JBQxQdVRb8bqQ==} - engines: {node: '>=10.0'} - hasBin: true - peerDependencies: - ethers: ^5.7.2 - dependencies: - '@ethereum-waffle/chai': 4.0.10(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(ethers@5.7.2) - '@ethereum-waffle/compiler': 4.0.3(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(solc@0.8.15)(typechain@8.3.2)(typescript@4.9.5) - '@ethereum-waffle/mock-contract': 4.0.4(ethers@5.7.2) - '@ethereum-waffle/provider': 4.0.5(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(ethers@5.7.2) - ethers: 5.7.2 - solc: 0.8.15 - typechain: 8.3.2(typescript@4.9.5) - transitivePeerDependencies: - - '@ensdomains/ens' - - '@ensdomains/resolver' - - '@ethersproject/abi' - - '@ethersproject/providers' - - debug - - encoding - - supports-color - - typescript - dev: true - /ethereumjs-abi@0.6.8: resolution: {integrity: sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==} dependencies: @@ -19140,17 +20949,6 @@ packages: ethjs-util: 0.1.6 rlp: 2.2.7 - /ethereumjs-util@7.1.3: - resolution: {integrity: sha512-y+82tEbyASO0K0X1/SRhbJJoAlfcvq8JbrG4a5cjrOks7HS/36efU/0j2flxCPOUM++HFahk33kr/ZxyC4vNuw==} - engines: {node: '>=10.0.0'} - dependencies: - '@types/bn.js': 5.1.3 - bn.js: 5.2.1 - create-hash: 1.2.0 - ethereum-cryptography: 0.1.3 - rlp: 2.2.7 - dev: true - /ethereumjs-util@7.1.5: resolution: {integrity: sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==} engines: {node: '>=10.0.0'} @@ -19199,6 +20997,37 @@ packages: - bufferutil - utf-8-validate + /ethers@6.8.0: + resolution: {integrity: sha512-zrFbmQRlraM+cU5mE4CZTLBurZTs2gdp2ld0nG/f3ecBK+x6lZ69KSxBqZ4NjclxwfTxl5LeNufcBbMsTdY53Q==} + engines: {node: '>=14.0.0'} + dependencies: + '@adraffy/ens-normalize': 1.10.0 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@types/node': 18.15.13 + aes-js: 4.0.0-beta.5 + tslib: 2.4.0 + ws: 8.5.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + /ethers@6.9.0: + resolution: {integrity: sha512-pmfNyQzc2mseLe91FnT2vmNaTt8dDzhxZ/xItAV7uGsF4dI4ek2ufMu3rAkgQETL/TIs0GS5A+U05g9QyWnv3Q==} + engines: {node: '>=14.0.0'} + dependencies: + '@adraffy/ens-normalize': 1.10.0 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@types/node': 18.15.13 + aes-js: 4.0.0-beta.5 + tslib: 2.4.0 + ws: 8.5.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false + /etherscan-api@10.3.0(debug@4.3.4): resolution: {integrity: sha512-XH+E7J2c6Wq750stvFuIIMdiLv5v65nTRftQojXuQXNfEsQaZOOgeY11WHdrGh6yh90ekDJQldgf033tIS1rCw==} dependencies: @@ -19228,7 +21057,7 @@ packages: resolution: {integrity: sha512-EzV94NYKoO09GLXGjXj9JIlXijVck4ONSr5wiCWDvhsvj5jxSrzTmRU/9C1DyB6uToszLs8aifA6NQ7lEQdvFw==} engines: {node: '>= 0.8'} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 require-like: 0.1.2 dev: false @@ -19251,6 +21080,10 @@ packages: resolution: {integrity: sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==} dev: true + /eventemitter3@4.0.4: + resolution: {integrity: sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==} + dev: true + /eventemitter3@4.0.7: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} @@ -19325,6 +21158,21 @@ packages: signal-exit: 3.0.7 strip-final-newline: 3.0.0 + /execa@8.0.1: + resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} + engines: {node: '>=16.17'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.1.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + dev: true + /executable@4.1.1: resolution: {integrity: sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==} engines: {node: '>=4'} @@ -19335,6 +21183,7 @@ packages: /exit@0.1.2: resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} engines: {node: '>= 0.8.0'} + dev: true /expand-tilde@2.0.2: resolution: {integrity: sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==} @@ -19352,6 +21201,7 @@ packages: jest-matcher-utils: 29.7.0 jest-message-util: 29.7.0 jest-util: 29.7.0 + dev: true /express@4.18.2: resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} @@ -19440,6 +21290,7 @@ packages: /extract-files@11.0.0: resolution: {integrity: sha512-FuoE1qtbJ4bBVvv94CC7s0oTnKUGvQs+Rjf1L2SJFfS+HTVVjhPFtehPdQ0JiGPqVNfSSZvL5yzHHQq2Z4WNhQ==} engines: {node: ^12.20 || >= 14.13} + dev: false /extract-zip@2.0.1(supports-color@8.1.1): resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==} @@ -19503,7 +21354,6 @@ packages: /fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - dev: true /fast-levenshtein@3.0.0: resolution: {integrity: sha512-hKKNajm46uNmTlhHSyZkmToAc56uZJwYq7yrciZjqOxnlfQwERDQJmHPUp7m1m9wx8vgOe8IaCKZ5Kv2k1DdCQ==} @@ -19551,6 +21401,7 @@ packages: hasBin: true dependencies: strnum: 1.0.5 + dev: false /fastest-levenshtein@1.0.16: resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} @@ -19586,6 +21437,7 @@ packages: /fbjs-css-vars@1.0.2: resolution: {integrity: sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==} + dev: false /fbjs@3.0.5: resolution: {integrity: sha512-ztsSx77JBtkuMrEypfhgc3cI0+0h+svqeie7xHbh1k/IKdcydnvadp/mUaGgjAOXQmQSxsqgaRhS3q9fy+1kxg==} @@ -19599,6 +21451,7 @@ packages: ua-parser-js: 1.0.36 transitivePeerDependencies: - encoding + dev: false /fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} @@ -19635,6 +21488,7 @@ packages: tslib: 2.6.2 zod: 3.22.4 zod-to-json-schema: 3.21.4(zod@3.22.4) + dev: false /figures@3.2.0: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} @@ -19648,7 +21502,6 @@ packages: engines: {node: ^10.12.0 || >=12.0.0} dependencies: flat-cache: 3.1.1 - dev: true /file-loader@6.2.0(webpack@5.89.0): resolution: {integrity: sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==} @@ -19764,6 +21617,7 @@ packages: unpipe: 1.0.0 transitivePeerDependencies: - supports-color + dev: false /finalhandler@1.2.0: resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} @@ -19786,6 +21640,7 @@ packages: commondir: 1.0.1 make-dir: 2.1.0 pkg-dir: 3.0.0 + dev: false /find-cache-dir@3.3.2: resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==} @@ -19822,18 +21677,11 @@ packages: engines: {node: '>=4.0.0'} dependencies: array-back: 3.1.0 + dev: true /find-root@1.1.0: resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} - /find-up@1.1.2: - resolution: {integrity: sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==} - engines: {node: '>=0.10.0'} - dependencies: - path-exists: 2.1.0 - pinkie-promise: 2.0.1 - dev: true - /find-up@2.1.0: resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==} engines: {node: '>=4'} @@ -19845,6 +21693,7 @@ packages: engines: {node: '>=6'} dependencies: locate-path: 3.0.0 + dev: false /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} @@ -19885,7 +21734,6 @@ packages: flatted: 3.2.9 keyv: 4.5.4 rimraf: 3.0.2 - dev: true /flat@5.0.2: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} @@ -19893,14 +21741,15 @@ packages: /flatted@3.2.9: resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} - dev: true /flow-enums-runtime@0.0.5: resolution: {integrity: sha512-PSZF9ZuaZD03sT9YaIs0FrGJ7lSUw7rHZIex+73UYVXg46eL/wxN5PaVcPJFudE2cJu5f0fezitV5aBkLHPUOQ==} + dev: false /flow-parser@0.206.0: resolution: {integrity: sha512-HVzoK3r6Vsg+lKvlIZzaWNBVai+FXTX1wdYhz/wVlH13tb/gOdLXmlTqy6odmTBhT5UoWUbq0k8263Qhr9d88w==} engines: {node: '>=0.4.0'} + dev: false /flux@4.0.4(react@18.2.0): resolution: {integrity: sha512-NCj3XlayA2UsapRpM7va6wU1+9rE5FIL7qoMcmxWHRzbp0yujihMBm9BBHZ1MDIk5h5o2Bl6eGiCe8rYELAmYw==} @@ -19942,6 +21791,7 @@ packages: /foreach@2.0.6: resolution: {integrity: sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==} + dev: false /foreground-child@2.0.0: resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==} @@ -19962,7 +21812,7 @@ packages: resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} dev: true - /fork-ts-checker-webpack-plugin@6.5.3(typescript@4.9.5)(webpack@5.89.0): + /fork-ts-checker-webpack-plugin@6.5.3(eslint@8.52.0)(typescript@4.9.5)(webpack@5.89.0): resolution: {integrity: sha512-SbH/l9ikmMWycd5puHJKTkZJKddF4iRLyW3DeZ08HTI7NGyLS38MXd/KGgeWumQO7YNQbW2u/NtPT2YowbPaGQ==} engines: {node: '>=10', yarn: '>=1.0.0'} peerDependencies: @@ -19976,12 +21826,13 @@ packages: vue-template-compiler: optional: true dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 '@types/json-schema': 7.0.14 chalk: 4.1.2 chokidar: 3.5.3 cosmiconfig: 6.0.0 deepmerge: 4.3.1 + eslint: 8.52.0 fs-extra: 9.1.0 glob: 7.2.3 memfs: 3.5.3 @@ -19993,6 +21844,10 @@ packages: webpack: 5.89.0(webpack-cli@5.1.4) dev: false + /form-data-encoder@1.7.1: + resolution: {integrity: sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg==} + dev: true + /form-data@2.3.3: resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==} engines: {node: '>= 0.12'} @@ -20025,7 +21880,7 @@ packages: dependencies: fetch-blob: 3.2.0 - /formik-mui-x-date-pickers@0.0.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.14)(@mui/system@5.14.14)(@mui/x-date-pickers@5.0.20)(formik@2.4.5)(react@18.2.0)(tiny-warning@1.0.3): + /formik-mui-x-date-pickers@0.0.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.15)(@mui/system@5.14.15)(@mui/x-date-pickers@5.0.20)(formik@2.4.5)(react@18.2.0)(tiny-warning@1.0.3): resolution: {integrity: sha512-IxZsY6er+g0eNsucIDHcNs6DLaPDdG14IYx/lS2HSuKnTgV4vGEWpXyGMpkY/vGyh+W3N5U4TrBVu+7eRb5rLA==} peerDependencies: '@emotion/react': '>=11.5.0' @@ -20037,17 +21892,17 @@ packages: react: '>=17.0.2' tiny-warning: '>=1.0.3' dependencies: - '@emotion/react': 11.11.1(@types/react@18.2.31)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.31)(react@18.2.0) - '@mui/material': 5.14.14(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.31)(react-dom@18.2.0)(react@18.2.0) - '@mui/system': 5.14.14(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.31)(react@18.2.0) - '@mui/x-date-pickers': 5.0.20(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.14)(@mui/system@5.14.14)(@types/react@18.2.31)(dayjs@1.11.10)(react-dom@18.2.0)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) + '@mui/material': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@mui/system': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react@18.2.0) + '@mui/x-date-pickers': 5.0.20(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.15)(@mui/system@5.14.15)(@types/react@18.2.33)(dayjs@1.11.10)(react-dom@18.2.0)(react@18.2.0) formik: 2.4.5(react@18.2.0) react: 18.2.0 tiny-warning: 1.0.3 dev: false - /formik-mui@5.0.0-alpha.0(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.14)(formik@2.4.5)(react@18.2.0)(tiny-warning@1.0.3): + /formik-mui@5.0.0-alpha.0(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/material@5.14.15)(formik@2.4.5)(react@18.2.0)(tiny-warning@1.0.3): resolution: {integrity: sha512-tcY8B4I3N2UK9ghgVpeBWsXGMDe1y4LVKwI8GiUbLKGB86fI/CN9UMr4FuNo6kzNXvO42LFNmCxdEVzovNCyYQ==} peerDependencies: '@emotion/react': '>=11.5.0' @@ -20057,9 +21912,9 @@ packages: react: '>=17.0.2' tiny-warning: '>=1.0.3' dependencies: - '@emotion/react': 11.11.1(@types/react@18.2.31)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.31)(react@18.2.0) - '@mui/material': 5.14.14(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.31)(react-dom@18.2.0)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) + '@mui/material': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) formik: 2.4.5(react@18.2.0) react: 18.2.0 tiny-warning: 1.0.3 @@ -20143,6 +21998,14 @@ packages: universalify: 2.0.0 dev: true + /fs-extra@4.0.3: + resolution: {integrity: sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: true + /fs-extra@7.0.1: resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} engines: {node: '>=6 <7 || >=8'} @@ -20175,6 +22038,12 @@ packages: rimraf: 2.7.1 dev: true + /fs-minipass@1.2.7: + resolution: {integrity: sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==} + dependencies: + minipass: 2.9.0 + dev: true + /fs-minipass@2.1.0: resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} engines: {node: '>= 8'} @@ -20227,32 +22096,6 @@ packages: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} dev: true - /ganache@7.4.3: - resolution: {integrity: sha512-RpEDUiCkqbouyE7+NMXG26ynZ+7sGiODU84Kz+FVoXUnQ4qQM4M8wif3Y4qUCt+D/eM1RVeGq0my62FPD6Y1KA==} - hasBin: true - dependencies: - '@trufflesuite/bigint-buffer': 1.1.10 - '@types/bn.js': 5.1.3 - '@types/lru-cache': 5.1.1 - '@types/seedrandom': 3.0.1 - emittery: 0.10.0 - keccak: 3.0.2 - leveldown: 6.1.0 - secp256k1: 4.0.3 - optionalDependencies: - bufferutil: 4.0.5 - utf-8-validate: 5.0.7 - dev: true - bundledDependencies: - - '@trufflesuite/bigint-buffer' - - emittery - - keccak - - leveldown - - secp256k1 - - '@types/bn.js' - - '@types/lru-cache' - - '@types/seedrandom' - /generate-function@2.3.1: resolution: {integrity: sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==} dependencies: @@ -20263,10 +22106,6 @@ packages: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} - /get-caller-file@1.0.3: - resolution: {integrity: sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==} - dev: true - /get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} @@ -20302,6 +22141,7 @@ packages: /get-package-type@0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} engines: {node: '>=8.0.0'} + dev: true /get-port@3.2.0: resolution: {integrity: sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==} @@ -20347,6 +22187,11 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + /get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} + dev: true + /get-symbol-description@1.0.0: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} engines: {node: '>= 0.4'} @@ -20554,6 +22399,13 @@ packages: kind-of: 6.0.3 which: 1.3.1 + /global@4.4.0: + resolution: {integrity: sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==} + dependencies: + min-document: 2.19.0 + process: 0.11.10 + dev: true + /globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -20563,7 +22415,6 @@ packages: engines: {node: '>=8'} dependencies: type-fest: 0.20.2 - dev: true /globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} @@ -20572,6 +22423,20 @@ packages: define-properties: 1.2.1 dev: true + /globby@10.0.1: + resolution: {integrity: sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==} + engines: {node: '>=8'} + dependencies: + '@types/glob': 7.2.0 + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.1 + glob: 7.2.3 + ignore: 5.2.4 + merge2: 1.4.1 + slash: 3.0.0 + dev: true + /globby@10.0.2: resolution: {integrity: sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==} engines: {node: '>=8'} @@ -20674,6 +22539,42 @@ packages: dependencies: get-intrinsic: 1.2.2 + /got@11.8.6: + resolution: {integrity: sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==} + engines: {node: '>=10.19.0'} + dependencies: + '@sindresorhus/is': 4.6.0 + '@szmarczak/http-timer': 4.0.6 + '@types/cacheable-request': 6.0.3 + '@types/responselike': 1.0.2 + cacheable-lookup: 5.0.4 + cacheable-request: 7.0.4 + decompress-response: 6.0.0 + http2-wrapper: 1.0.3 + lowercase-keys: 2.0.0 + p-cancelable: 2.1.1 + responselike: 2.0.1 + dev: true + + /got@12.1.0: + resolution: {integrity: sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig==} + engines: {node: '>=14.16'} + dependencies: + '@sindresorhus/is': 4.6.0 + '@szmarczak/http-timer': 5.0.1 + '@types/cacheable-request': 6.0.3 + '@types/responselike': 1.0.2 + cacheable-lookup: 6.1.0 + cacheable-request: 7.0.4 + decompress-response: 6.0.0 + form-data-encoder: 1.7.1 + get-stream: 6.0.1 + http2-wrapper: 2.2.0 + lowercase-keys: 3.0.0 + p-cancelable: 3.0.0 + responselike: 2.0.1 + dev: true + /got@8.3.2: resolution: {integrity: sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==} engines: {node: '>=4'} @@ -20723,19 +22624,18 @@ packages: /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - dev: true /graphql-import-node@0.0.5(graphql@16.8.1): resolution: {integrity: sha512-OXbou9fqh9/Lm7vwXT0XoRN9J5+WCYKnbiTalgFDvkQERITRmcfncZs6aVABedd5B85yQU5EULS4a5pnbpuI0Q==} peerDependencies: - graphql: ^16.6.0 + graphql: '*' dependencies: graphql: 16.8.1 /graphql-jit@0.8.2(graphql@16.8.1): resolution: {integrity: sha512-P9KtM/UY4JTtHVRqRlZzFXPmDEtps1Bd27Mvj/naQIa5d0j83zPxAx4jewq1wueF3UEZu1JFZwX1XVBBkoo1Mg==} peerDependencies: - graphql: ^16.6.0 + graphql: '>=15' dependencies: '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) fast-json-stringify: 1.21.0 @@ -20751,31 +22651,34 @@ packages: resolution: {integrity: sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==} engines: {node: '>=10'} peerDependencies: - graphql: ^16.6.0 + graphql: ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: graphql: 16.8.1 tslib: 2.6.2 + dev: false /graphql-ws@5.12.1(graphql@16.8.1): resolution: {integrity: sha512-umt4f5NnMK46ChM2coO36PTFhHouBrK9stWWBczERguwYrGnPNxJ9dimU6IyOBfOkC6Izhkg4H8+F51W/8CYDg==} engines: {node: '>=10'} peerDependencies: - graphql: ^16.6.0 + graphql: '>=0.11 <=16' dependencies: graphql: 16.8.1 + dev: false /graphql-ws@5.14.2(graphql@16.8.1): resolution: {integrity: sha512-LycmCwhZ+Op2GlHz4BZDsUYHKRiiUz+3r9wbhBATMETNlORQJAaFlAgTFoeRh6xQoQegwYwIylVD1Qns9/DA3w==} engines: {node: '>=10'} peerDependencies: - graphql: ^16.6.0 + graphql: '>=0.11 <=16' dependencies: graphql: 16.8.1 + dev: false /graphql-yoga@3.9.1(graphql@16.8.1): resolution: {integrity: sha512-BB6EkN64VBTXWmf9Kym2OsVZFzBC0mAsQNo9eNB5xIr3t+x7qepQ34xW5A353NWol3Js3xpzxwIKFVF6l9VsPg==} peerDependencies: - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: '@envelop/core': 3.0.6 '@envelop/validation-cache': 5.1.3(@envelop/core@3.0.6)(graphql@16.8.1) @@ -20786,16 +22689,17 @@ packages: '@graphql-yoga/subscription': 3.1.0 '@whatwg-node/fetch': 0.8.8 '@whatwg-node/server': 0.7.7 - dset: 3.1.2 + dset: 3.1.3 graphql: 16.8.1 lru-cache: 7.18.3 tslib: 2.6.2 + dev: false /graphql-yoga@5.0.0(graphql@16.8.1): resolution: {integrity: sha512-ZvZlO8MHMDWuLRoDhvJQnXg8SOJD0iDaCA+M/zWuD26AlhEugOEbpnhw/645oqXTYtvHsM91WyxtV7p5XJWYMg==} engines: {node: '>=18.0.0'} peerDependencies: - graphql: ^16.6.0 + graphql: ^15.2.0 || ^16.0.0 dependencies: '@envelop/core': 5.0.0 '@graphql-tools/executor': 1.2.0(graphql@16.8.1) @@ -20803,14 +22707,19 @@ packages: '@graphql-tools/utils': 10.0.7(graphql@16.8.1) '@graphql-yoga/logger': 2.0.0 '@graphql-yoga/subscription': 5.0.0 - '@whatwg-node/fetch': 0.9.13 - '@whatwg-node/server': 0.9.15 - dset: 3.1.2 + '@whatwg-node/fetch': 0.9.14 + '@whatwg-node/server': 0.9.16 + dset: 3.1.3 graphql: 16.8.1 lru-cache: 10.0.1 tslib: 2.6.2 dev: false + /graphql@15.5.0: + resolution: {integrity: sha512-OmaM7y0kaK31NKG31q4YbD2beNYa6jBBKtMFT6gLYJljHLJr42IqJ8KX08u3Li/0ifzTU5HjmoOOrwa5BRLeDA==} + engines: {node: '>= 10.x'} + dev: true + /graphql@16.8.1: resolution: {integrity: sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} @@ -20882,7 +22791,7 @@ packages: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} engines: {node: '>=6'} - /hardhat-abi-exporter@2.10.1(hardhat@2.13.1): + /hardhat-abi-exporter@2.10.1(hardhat@2.18.3): resolution: {integrity: sha512-X8GRxUTtebMAd2k4fcPyVnCdPa6dYK4lBsrwzKP5yiSq4i+WadWPIumaLfce53TUf/o2TnLpLOduyO1ylE2NHQ==} engines: {node: '>=14.14.0'} peerDependencies: @@ -20890,17 +22799,17 @@ packages: dependencies: '@ethersproject/abi': 5.7.0 delete-empty: 3.0.0 - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) dev: true - /hardhat-gas-reporter@1.0.9(hardhat@2.13.1): + /hardhat-gas-reporter@1.0.9(hardhat@2.18.3): resolution: {integrity: sha512-INN26G3EW43adGKBNzYWOlI3+rlLnasXTwW79YNnUhXPDa+yHESgt639dJEs37gCjhkbNKcRRJnomXEuMFBXJg==} peerDependencies: hardhat: ^2.0.2 dependencies: array-uniq: 1.0.3 eth-gas-reporter: 0.2.27 - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) sha1: 1.1.1 transitivePeerDependencies: - '@codechecks/client' @@ -20909,18 +22818,17 @@ packages: - utf-8-validate dev: true - /hardhat-preprocessor@0.1.5(hardhat@2.13.1): + /hardhat-preprocessor@0.1.5(hardhat@2.18.3): resolution: {integrity: sha512-j8m44mmPxpxAAd0G8fPHRHOas/INZdzptSur0TNJvMEGcFdLDhbHHxBcqZVQ/bmiW42q4gC60AP4CXn9EF018g==} peerDependencies: hardhat: ^2.0.5 dependencies: - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) murmur-128: 0.2.1 dev: true - /hardhat@2.13.1(ts-node@10.9.1)(typescript@4.9.5): - resolution: {integrity: sha512-ZZL7LQxHmbw4JQJsiEv2qE35nbR+isr2sIdtgZVPp0+zWqRkpr1OT7gmvhCNYfjpEPyfjZIxWriQWlphJhVPLQ==} - engines: {node: '>=14.0.0'} + /hardhat@2.18.2(typescript@5.1.6): + resolution: {integrity: sha512-lUVmJg7DsKcUCDpqv57CJl6vHqo/1PeHSfM3+WIa8UtRKmXyVTj1qQK01TDiuetkZBVg9Dn52qU+ZwaJQynaKA==} hasBin: true peerDependencies: ts-node: '*' @@ -20933,21 +22841,87 @@ packages: dependencies: '@ethersproject/abi': 5.7.0 '@metamask/eth-sig-util': 4.0.1 - '@nomicfoundation/ethereumjs-block': 5.0.0 - '@nomicfoundation/ethereumjs-blockchain': 7.0.0 - '@nomicfoundation/ethereumjs-common': 4.0.0 - '@nomicfoundation/ethereumjs-evm': 2.0.0 - '@nomicfoundation/ethereumjs-rlp': 5.0.0 - '@nomicfoundation/ethereumjs-statemanager': 2.0.0 - '@nomicfoundation/ethereumjs-trie': 6.0.0 - '@nomicfoundation/ethereumjs-tx': 5.0.0 - '@nomicfoundation/ethereumjs-util': 9.0.0 - '@nomicfoundation/ethereumjs-vm': 7.0.0 + '@nomicfoundation/ethereumjs-block': 5.0.2 + '@nomicfoundation/ethereumjs-blockchain': 7.0.2 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-evm': 2.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-statemanager': 2.0.2 + '@nomicfoundation/ethereumjs-trie': 6.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 + '@nomicfoundation/ethereumjs-vm': 7.0.2 + '@nomicfoundation/solidity-analyzer': 0.1.1 + '@sentry/node': 5.30.0 + '@types/bn.js': 5.1.3 + '@types/lru-cache': 5.1.1 + adm-zip: 0.4.16 + aggregate-error: 3.1.0 + ansi-escapes: 4.3.2 + chalk: 2.4.2 + chokidar: 3.5.3 + ci-info: 2.0.0 + debug: 4.3.4(supports-color@8.1.1) + enquirer: 2.4.1 + env-paths: 2.2.1 + ethereum-cryptography: 1.2.0 + ethereumjs-abi: 0.6.8 + find-up: 2.1.0 + fp-ts: 1.19.3 + fs-extra: 7.0.1 + glob: 7.2.0 + immutable: 4.3.4 + io-ts: 1.10.4 + keccak: 3.0.4 + lodash: 4.17.21 + mnemonist: 0.38.5 + mocha: 10.2.0 + p-map: 4.0.0 + raw-body: 2.5.2 + resolve: 1.17.0 + semver: 6.3.1 + solc: 0.7.3(debug@4.3.4) + source-map-support: 0.5.21 + stacktrace-parser: 0.1.10 + tsort: 0.0.1 + typescript: 5.1.6 + undici: 5.26.5 + uuid: 8.3.2 + ws: 7.5.9 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + + /hardhat@2.18.3(ts-node@10.9.1)(typescript@4.9.5): + resolution: {integrity: sha512-JuYaTG+4ZHVjEHCW5Hn6jCHH3LpO75dtgznZpM/dLv12RcSlw/xHbeQh3FAsGahQr1epKryZcZEMHvztVZHe0g==} + hasBin: true + peerDependencies: + ts-node: '*' + typescript: '*' + peerDependenciesMeta: + ts-node: + optional: true + typescript: + optional: true + dependencies: + '@ethersproject/abi': 5.7.0 + '@metamask/eth-sig-util': 4.0.1 + '@nomicfoundation/ethereumjs-block': 5.0.2 + '@nomicfoundation/ethereumjs-blockchain': 7.0.2 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-evm': 2.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-statemanager': 2.0.2 + '@nomicfoundation/ethereumjs-trie': 6.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 + '@nomicfoundation/ethereumjs-vm': 7.0.2 '@nomicfoundation/solidity-analyzer': 0.1.1 '@sentry/node': 5.30.0 '@types/bn.js': 5.1.3 '@types/lru-cache': 5.1.1 - abort-controller: 3.0.0 adm-zip: 0.4.16 aggregate-error: 3.1.0 ansi-escapes: 4.3.2 @@ -20970,14 +22944,13 @@ packages: mnemonist: 0.38.5 mocha: 10.2.0 p-map: 4.0.0 - qs: 6.11.2 raw-body: 2.5.2 resolve: 1.17.0 semver: 6.3.1 solc: 0.7.3(debug@4.3.4) source-map-support: 0.5.21 stacktrace-parser: 0.1.10 - ts-node: 10.9.1(@types/node@18.18.6)(typescript@4.9.5) + ts-node: 10.9.1(@types/node@18.18.7)(typescript@4.9.5) tsort: 0.0.1 typescript: 4.9.5 undici: 5.26.5 @@ -20988,9 +22961,8 @@ packages: - supports-color - utf-8-validate - /hardhat@2.13.1(typescript@5.1.6): - resolution: {integrity: sha512-ZZL7LQxHmbw4JQJsiEv2qE35nbR+isr2sIdtgZVPp0+zWqRkpr1OT7gmvhCNYfjpEPyfjZIxWriQWlphJhVPLQ==} - engines: {node: '>=14.0.0'} + /hardhat@2.18.3(ts-node@10.9.1)(typescript@5.3.2): + resolution: {integrity: sha512-JuYaTG+4ZHVjEHCW5Hn6jCHH3LpO75dtgznZpM/dLv12RcSlw/xHbeQh3FAsGahQr1epKryZcZEMHvztVZHe0g==} hasBin: true peerDependencies: ts-node: '*' @@ -21003,21 +22975,88 @@ packages: dependencies: '@ethersproject/abi': 5.7.0 '@metamask/eth-sig-util': 4.0.1 - '@nomicfoundation/ethereumjs-block': 5.0.0 - '@nomicfoundation/ethereumjs-blockchain': 7.0.0 - '@nomicfoundation/ethereumjs-common': 4.0.0 - '@nomicfoundation/ethereumjs-evm': 2.0.0 - '@nomicfoundation/ethereumjs-rlp': 5.0.0 - '@nomicfoundation/ethereumjs-statemanager': 2.0.0 - '@nomicfoundation/ethereumjs-trie': 6.0.0 - '@nomicfoundation/ethereumjs-tx': 5.0.0 - '@nomicfoundation/ethereumjs-util': 9.0.0 - '@nomicfoundation/ethereumjs-vm': 7.0.0 + '@nomicfoundation/ethereumjs-block': 5.0.2 + '@nomicfoundation/ethereumjs-blockchain': 7.0.2 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-evm': 2.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-statemanager': 2.0.2 + '@nomicfoundation/ethereumjs-trie': 6.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 + '@nomicfoundation/ethereumjs-vm': 7.0.2 + '@nomicfoundation/solidity-analyzer': 0.1.1 + '@sentry/node': 5.30.0 + '@types/bn.js': 5.1.3 + '@types/lru-cache': 5.1.1 + adm-zip: 0.4.16 + aggregate-error: 3.1.0 + ansi-escapes: 4.3.2 + chalk: 2.4.2 + chokidar: 3.5.3 + ci-info: 2.0.0 + debug: 4.3.4(supports-color@8.1.1) + enquirer: 2.4.1 + env-paths: 2.2.1 + ethereum-cryptography: 1.2.0 + ethereumjs-abi: 0.6.8 + find-up: 2.1.0 + fp-ts: 1.19.3 + fs-extra: 7.0.1 + glob: 7.2.0 + immutable: 4.3.4 + io-ts: 1.10.4 + keccak: 3.0.4 + lodash: 4.17.21 + mnemonist: 0.38.5 + mocha: 10.2.0 + p-map: 4.0.0 + raw-body: 2.5.2 + resolve: 1.17.0 + semver: 6.3.1 + solc: 0.7.3(debug@4.3.4) + source-map-support: 0.5.21 + stacktrace-parser: 0.1.10 + ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.3.2) + tsort: 0.0.1 + typescript: 5.3.2 + undici: 5.26.5 + uuid: 8.3.2 + ws: 7.5.9 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + + /hardhat@2.18.3(typescript@5.1.6): + resolution: {integrity: sha512-JuYaTG+4ZHVjEHCW5Hn6jCHH3LpO75dtgznZpM/dLv12RcSlw/xHbeQh3FAsGahQr1epKryZcZEMHvztVZHe0g==} + hasBin: true + peerDependencies: + ts-node: '*' + typescript: '*' + peerDependenciesMeta: + ts-node: + optional: true + typescript: + optional: true + dependencies: + '@ethersproject/abi': 5.7.0 + '@metamask/eth-sig-util': 4.0.1 + '@nomicfoundation/ethereumjs-block': 5.0.2 + '@nomicfoundation/ethereumjs-blockchain': 7.0.2 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-evm': 2.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-statemanager': 2.0.2 + '@nomicfoundation/ethereumjs-trie': 6.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 + '@nomicfoundation/ethereumjs-vm': 7.0.2 '@nomicfoundation/solidity-analyzer': 0.1.1 '@sentry/node': 5.30.0 '@types/bn.js': 5.1.3 '@types/lru-cache': 5.1.1 - abort-controller: 3.0.0 adm-zip: 0.4.16 aggregate-error: 3.1.0 ansi-escapes: 4.3.2 @@ -21040,7 +23079,6 @@ packages: mnemonist: 0.38.5 mocha: 10.2.0 p-map: 4.0.0 - qs: 6.11.2 raw-body: 2.5.2 resolve: 1.17.0 semver: 6.3.1 @@ -21058,6 +23096,74 @@ packages: - utf-8-validate dev: false + /hardhat@2.19.1(ts-node@10.9.1)(typescript@5.3.2): + resolution: {integrity: sha512-bsWa63g1GB78ZyMN08WLhFElLPA+J+pShuKD1BFO2+88g3l+BL3R07vj9deIi9dMbssxgE714Gof1dBEDGqnCw==} + hasBin: true + peerDependencies: + ts-node: '*' + typescript: '*' + peerDependenciesMeta: + ts-node: + optional: true + typescript: + optional: true + dependencies: + '@ethersproject/abi': 5.7.0 + '@metamask/eth-sig-util': 4.0.1 + '@nomicfoundation/ethereumjs-block': 5.0.2 + '@nomicfoundation/ethereumjs-blockchain': 7.0.2 + '@nomicfoundation/ethereumjs-common': 4.0.2 + '@nomicfoundation/ethereumjs-evm': 2.0.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.2 + '@nomicfoundation/ethereumjs-statemanager': 2.0.2 + '@nomicfoundation/ethereumjs-trie': 6.0.2 + '@nomicfoundation/ethereumjs-tx': 5.0.2 + '@nomicfoundation/ethereumjs-util': 9.0.2 + '@nomicfoundation/ethereumjs-vm': 7.0.2 + '@nomicfoundation/solidity-analyzer': 0.1.1 + '@sentry/node': 5.30.0 + '@types/bn.js': 5.1.3 + '@types/lru-cache': 5.1.1 + adm-zip: 0.4.16 + aggregate-error: 3.1.0 + ansi-escapes: 4.3.2 + chalk: 2.4.2 + chokidar: 3.5.3 + ci-info: 2.0.0 + debug: 4.3.4(supports-color@8.1.1) + enquirer: 2.4.1 + env-paths: 2.2.1 + ethereum-cryptography: 1.2.0 + ethereumjs-abi: 0.6.8 + find-up: 2.1.0 + fp-ts: 1.19.3 + fs-extra: 7.0.1 + glob: 7.2.0 + immutable: 4.3.4 + io-ts: 1.10.4 + keccak: 3.0.4 + lodash: 4.17.21 + mnemonist: 0.38.5 + mocha: 10.2.0 + p-map: 4.0.0 + raw-body: 2.5.2 + resolve: 1.17.0 + semver: 6.3.1 + solc: 0.7.3(debug@4.3.4) + source-map-support: 0.5.21 + stacktrace-parser: 0.1.10 + ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.3.2) + tsort: 0.0.1 + typescript: 5.3.2 + undici: 5.26.5 + uuid: 8.3.2 + ws: 7.5.9 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + /has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} dev: true @@ -21124,6 +23230,7 @@ packages: /hash-it@6.0.0: resolution: {integrity: sha512-KHzmSFx1KwyMPw0kXeeUD752q/Kfbzhy6dAZrjXV9kAIXGqzGvv8vhkUqj+2MGZldTo0IBpw6v7iWE7uxsvH0w==} + dev: false /hash.js@1.1.7: resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} @@ -21224,27 +23331,27 @@ packages: dependencies: capital-case: 1.0.4 tslib: 2.6.2 - - /headers-polyfill@3.2.5: - resolution: {integrity: sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==} - dev: true + dev: false /heap@0.2.7: resolution: {integrity: sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==} /hermes-estree@0.12.0: resolution: {integrity: sha512-+e8xR6SCen0wyAKrMT3UD0ZCCLymKhRgjEB5sS28rKiFir/fXgLoeRilRUssFCILmGHb+OvHDUlhxs0+IEyvQw==} + dev: false /hermes-parser@0.12.0: resolution: {integrity: sha512-d4PHnwq6SnDLhYl3LHNHvOg7nQ6rcI7QVil418REYksv0Mh3cEkHDcuhGxNQ3vgnLSLl4QSvDrFCwQNYdpWlzw==} dependencies: hermes-estree: 0.12.0 + dev: false /hermes-profile-transformer@0.0.6: resolution: {integrity: sha512-cnN7bQUm65UWOy6cbGcCcZ3rpwW8Q/j4OP5aWRhEry4Z2t2aR1cjrbp0BS+KiBN0smvP1caBgAuxutvyvJILzQ==} engines: {node: '>=8'} dependencies: source-map: 0.7.4 + dev: false /hey-listen@1.0.8: resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==} @@ -21270,6 +23377,7 @@ packages: /hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} + requiresBuild: true dependencies: react-is: 16.13.1 dev: false @@ -21292,6 +23400,7 @@ packages: /hotscript@1.0.13: resolution: {integrity: sha512-C++tTF1GqkGYecL+2S1wJTfoH6APGAsbb7PAWQ3iVIwgG/EFseAfEVOKFgAFq4yK3+6j1EjUD4UQ9dRJHX/sSQ==} + dev: false /hpack.js@2.1.6: resolution: {integrity: sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==} @@ -21313,6 +23422,7 @@ packages: /html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + dev: true /html-minifier-terser@5.1.1: resolution: {integrity: sha512-ZPr5MNObqnV/T9akshPKbVgyOqLmy+Bxo7juKCfTfnjNniTAMdy4hz21YQqoofMBJD2kdREaqPPdThoR78Tgxg==} @@ -21449,6 +23559,10 @@ packages: statuses: 2.0.1 toidentifier: 1.0.1 + /http-https@1.0.0: + resolution: {integrity: sha512-o0PWwVCSp3O0wS6FvNr6xfBCHgt0m1tvPLFOCc2iFDKTRAXhB7m8klDf7ErowFH8POa6dVdGatKU5I1YYwzUyg==} + dev: true + /http-parser-js@0.5.8: resolution: {integrity: sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==} @@ -21515,6 +23629,22 @@ packages: sshpk: 1.18.0 dev: true + /http2-wrapper@1.0.3: + resolution: {integrity: sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==} + engines: {node: '>=10.19.0'} + dependencies: + quick-lru: 5.1.1 + resolve-alpn: 1.2.1 + dev: true + + /http2-wrapper@2.2.0: + resolution: {integrity: sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==} + engines: {node: '>=10.19.0'} + dependencies: + quick-lru: 5.1.1 + resolve-alpn: 1.2.1 + dev: true + /https-proxy-agent@5.0.1: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} @@ -21542,6 +23672,11 @@ packages: resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} engines: {node: '>=14.18.0'} + /human-signals@5.0.0: + resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} + engines: {node: '>=16.17.0'} + dev: true + /humanize-ms@1.2.1: resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} dependencies: @@ -21563,6 +23698,14 @@ packages: resolution: {integrity: sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ==} dev: false + /i18n-js@4.3.2: + resolution: {integrity: sha512-n8gbEbQEueym2/q2yrZk5/xKWjFcKtg3/Escw4JHSVWa8qtKqP8j7se3UjkRbHlO/REqFA0V/MG1q8tEfyHeOA==} + dependencies: + bignumber.js: 9.1.2 + lodash: 4.17.21 + make-plural: 7.3.0 + dev: false + /iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -21608,18 +23751,11 @@ packages: hasBin: true dependencies: queue: 6.0.2 + dev: false /immediate@3.0.6: resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} - /immediate@3.2.3: - resolution: {integrity: sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg==} - dev: true - - /immediate@3.3.0: - resolution: {integrity: sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==} - dev: true - /immer@9.0.21: resolution: {integrity: sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==} dev: false @@ -21627,6 +23763,7 @@ packages: /immutable@3.7.6: resolution: {integrity: sha512-AizQPcaofEtO11RZhPPHBOJRdo/20MKQF9mBLnVkBoyHi1/zXK8fzVdnEpSV9gxqtnh6Qomfp3F0xT5qP/vThw==} engines: {node: '>=0.8.0'} + dev: false /immutable@4.2.1: resolution: {integrity: sha512-7WYV7Q5BTs0nlQm7tl92rDYYoyELLKHoDMBKhrxEoiV4mrfVdRz8hzPiYOzH7yWjzoVEamxRuAqhxL2PLRwZYQ==} @@ -21641,6 +23778,7 @@ packages: dependencies: caller-path: 2.0.0 resolve-from: 3.0.0 + dev: false /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} @@ -21652,6 +23790,7 @@ packages: /import-from@4.0.0: resolution: {integrity: sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==} engines: {node: '>=12.2'} + dev: false /import-lazy@2.1.0: resolution: {integrity: sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A==} @@ -21739,27 +23878,6 @@ packages: wrap-ansi: 7.0.0 dev: true - /inquirer@8.2.6: - resolution: {integrity: sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==} - engines: {node: '>=12.0.0'} - dependencies: - ansi-escapes: 4.3.2 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-width: 3.0.0 - external-editor: 3.1.0 - figures: 3.2.0 - lodash: 4.17.21 - mute-stream: 0.0.8 - ora: 5.4.1 - run-async: 2.4.1 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - through: 2.3.8 - wrap-ansi: 6.2.0 - dev: true - /interface-blockstore@2.0.3: resolution: {integrity: sha512-OwVUnlNcx7H5HloK0Myv6c/C1q9cNG11HX6afdeU6q6kbuNj8jKCwVnmJHhC94LZaJ+9hvVOk4IUstb3Esg81w==} dependencies: @@ -21846,11 +23964,6 @@ packages: dependencies: loose-envify: 1.4.0 - /invert-kv@1.0.0: - resolution: {integrity: sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==} - engines: {node: '>=0.10.0'} - dev: true - /io-ts@1.10.4: resolution: {integrity: sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==} dependencies: @@ -21867,6 +23980,7 @@ packages: /ip@1.1.8: resolution: {integrity: sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==} + dev: false /ipaddr.js@1.9.1: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} @@ -22013,7 +24127,7 @@ packages: '@libp2p/interface-peer-info': 1.0.10 '@libp2p/interface-pubsub': 3.0.7 '@multiformats/multiaddr': 11.6.1 - '@types/node': 18.18.6 + '@types/node': 18.18.7 interface-datastore: 7.0.4 ipfs-unixfs: 8.0.0 multiformats: 10.0.3 @@ -22503,6 +24617,7 @@ packages: dependencies: is-relative: 1.0.0 is-windows: 1.0.2 + dev: false /is-alphabetical@1.0.4: resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} @@ -22608,6 +24723,7 @@ packages: /is-directory@0.3.1: resolution: {integrity: sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw==} engines: {node: '>=0.10.0'} + dev: false /is-docker@2.2.1: resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} @@ -22636,13 +24752,6 @@ packages: call-bind: 1.0.5 dev: true - /is-fullwidth-code-point@1.0.0: - resolution: {integrity: sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==} - engines: {node: '>=0.10.0'} - dependencies: - number-is-nan: 1.0.1 - dev: true - /is-fullwidth-code-point@2.0.0: resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==} engines: {node: '>=4'} @@ -22656,9 +24765,14 @@ packages: engines: {node: '>=12'} dev: true + /is-function@1.0.2: + resolution: {integrity: sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==} + dev: true + /is-generator-fn@2.1.0: resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} engines: {node: '>=6'} + dev: true /is-generator-function@1.0.10: resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} @@ -22718,6 +24832,7 @@ packages: resolution: {integrity: sha512-bVcMJy4X5Og6VZfdOZstSexlEy20Sr0k/p/b2IlQJlfdKAQuMpiv5w2Ccxb8sKdRUNAG1PnHVHjFSdRDVS6NlQ==} dependencies: tslib: 2.6.2 + dev: false /is-map@2.0.2: resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} @@ -22736,10 +24851,6 @@ packages: engines: {node: '>= 0.4'} dev: true - /is-node-process@1.2.0: - resolution: {integrity: sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==} - dev: true - /is-npm@5.0.0: resolution: {integrity: sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==} engines: {node: '>=10'} @@ -22801,6 +24912,11 @@ packages: dependencies: isobject: 3.0.1 + /is-plain-object@3.0.1: + resolution: {integrity: sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==} + engines: {node: '>=0.10.0'} + dev: true + /is-plain-object@5.0.0: resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} engines: {node: '>=0.10.0'} @@ -22846,6 +24962,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: is-unc-path: 1.0.0 + dev: false /is-retry-allowed@1.2.0: resolution: {integrity: sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==} @@ -22926,6 +25043,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: unc-path-regex: 0.1.2 + dev: false /is-unicode-supported@0.1.0: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} @@ -22935,10 +25053,7 @@ packages: resolution: {integrity: sha512-44pxmxAvnnAOwBg4tHPnkfvgjPwbc5QIsSstNU+YcJ1ovxVzCWpSGosPJOZh/a1tdl81fbgnLc9LLv+x2ywbPQ==} dependencies: tslib: 2.6.2 - - /is-url@1.2.4: - resolution: {integrity: sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==} - dev: true + dev: false /is-utf8@0.2.1: resolution: {integrity: sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==} @@ -22961,8 +25076,8 @@ packages: get-intrinsic: 1.2.2 dev: true - /is-what@4.1.15: - resolution: {integrity: sha512-uKua1wfy3Yt+YqsD6mTUEa2zSi3G1oPlqTflgaPJ7z63vUGN5pxFpnQfeSLMFnJDEsdvOtkp1rUWkYjB4YfhgA==} + /is-what@4.1.16: + resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} engines: {node: '>=12.13'} dev: false @@ -22981,6 +25096,7 @@ packages: /is-wsl@1.1.0: resolution: {integrity: sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==} engines: {node: '>=4'} + dev: false /is-wsl@2.2.0: resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} @@ -23052,6 +25168,7 @@ packages: ws: '*' dependencies: ws: 8.12.0 + dev: true /isomorphic-ws@5.0.0(ws@8.13.0): resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} @@ -23059,6 +25176,7 @@ packages: ws: '*' dependencies: ws: 8.13.0 + dev: false /isomorphic-ws@5.0.0(ws@8.14.2): resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} @@ -23066,6 +25184,14 @@ packages: ws: '*' dependencies: ws: 8.14.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) + dev: false + + /isows@1.0.3(ws@8.13.0): + resolution: {integrity: sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==} + peerDependencies: + ws: '*' + dependencies: + ws: 8.13.0 /isstream@0.1.2: resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==} @@ -23079,6 +25205,7 @@ packages: /istanbul-lib-coverage@3.2.0: resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} engines: {node: '>=8'} + dev: true /istanbul-lib-hook@3.0.0: resolution: {integrity: sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==} @@ -23091,7 +25218,7 @@ packages: resolution: {integrity: sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==} engines: {node: '>=8'} dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 semver: 6.3.1 @@ -23103,25 +25230,27 @@ packages: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/parser': 7.23.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 semver: 6.3.1 transitivePeerDependencies: - supports-color + dev: true /istanbul-lib-instrument@6.0.1: resolution: {integrity: sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA==} engines: {node: '>=10'} dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/parser': 7.23.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 semver: 7.5.4 transitivePeerDependencies: - supports-color + dev: true /istanbul-lib-processinfo@2.0.3: resolution: {integrity: sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==} @@ -23142,6 +25271,7 @@ packages: istanbul-lib-coverage: 3.2.0 make-dir: 4.0.0 supports-color: 7.2.0 + dev: true /istanbul-lib-source-maps@4.0.1: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} @@ -23152,6 +25282,7 @@ packages: source-map: 0.6.1 transitivePeerDependencies: - supports-color + dev: true /istanbul-reports@3.1.6: resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} @@ -23159,6 +25290,7 @@ packages: dependencies: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 + dev: true /isurl@1.0.0: resolution: {integrity: sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==} @@ -23174,6 +25306,11 @@ packages: /it-all@2.0.1: resolution: {integrity: sha512-9UuJcCRZsboz+HBQTNOau80Dw+ryGaHYFP/cPYzFBJBFcfDathMYnhHk4t52en9+fcyDGPTdLB+lFc1wzQIroA==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} + dev: false + + /it-all@3.0.4: + resolution: {integrity: sha512-UMiy0i9DqCHBdWvMbzdYvVGa5/w4t1cc4nchpbnjdLhklglv8mQeEYnii0gvKESJuL1zV32Cqdb33R6/GPfxpQ==} + dev: true /it-batch@1.0.9: resolution: {integrity: sha512-7Q7HXewMhNFltTsAMdSz6luNhyhkhEtGGbYek/8Xb/GiqYMtwUmopE1ocPSiJKKp3rM4Dt045sNFoUu+KZGNyA==} @@ -23545,6 +25682,7 @@ packages: execa: 5.1.1 jest-util: 29.7.0 p-limit: 3.1.0 + dev: true /jest-circus@29.7.0: resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==} @@ -23554,7 +25692,7 @@ packages: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.1 @@ -23573,8 +25711,9 @@ packages: transitivePeerDependencies: - babel-plugin-macros - supports-color + dev: true - /jest-cli@29.7.0(@types/node@18.18.6)(ts-node@10.9.1): + /jest-cli@29.7.0(@types/node@18.18.7): resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -23584,14 +25723,14 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.7.0(ts-node@10.9.1) + '@jest/core': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@18.18.6)(ts-node@10.9.1) + create-jest: 29.7.0(@types/node@18.18.7) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@18.18.6)(ts-node@10.9.1) + jest-config: 29.7.0(@types/node@18.18.7) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -23600,8 +25739,9 @@ packages: - babel-plugin-macros - supports-color - ts-node + dev: true - /jest-config@29.7.0(@types/node@18.18.6)(ts-node@10.9.1): + /jest-config@29.7.0(@types/node@18.18.7): resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -23613,11 +25753,11 @@ packages: ts-node: optional: true dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.18.6 - babel-jest: 29.7.0(@babel/core@7.23.2) + '@types/node': 18.18.7 + babel-jest: 29.7.0(@babel/core@7.23.5) chalk: 4.1.2 ci-info: 3.9.0 deepmerge: 4.3.1 @@ -23636,10 +25776,10 @@ packages: pretty-format: 29.7.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1(@types/node@18.18.6)(typescript@4.9.5) transitivePeerDependencies: - babel-plugin-macros - supports-color + dev: true /jest-diff@29.7.0: resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} @@ -23649,12 +25789,14 @@ packages: diff-sequences: 29.6.3 jest-get-type: 29.6.3 pretty-format: 29.7.0 + dev: true /jest-docblock@29.7.0: resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: detect-newline: 3.1.0 + dev: true /jest-each@29.7.0: resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==} @@ -23665,6 +25807,7 @@ packages: jest-get-type: 29.6.3 jest-util: 29.7.0 pretty-format: 29.7.0 + dev: true /jest-environment-jsdom@29.7.0: resolution: {integrity: sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA==} @@ -23679,7 +25822,7 @@ packages: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 '@types/jsdom': 20.0.1 - '@types/node': 18.18.6 + '@types/node': 18.18.7 jest-mock: 29.7.0 jest-util: 29.7.0 jsdom: 20.0.3 @@ -23696,24 +25839,10 @@ packages: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 jest-mock: 29.7.0 jest-util: 29.7.0 - /jest-extended@4.0.2(jest@29.7.0): - resolution: {integrity: sha512-FH7aaPgtGYHc9mRjriS0ZEHYM5/W69tLrFTIdzm+yJgeoCmmrSB/luSfMSqWP9O29QWHPEmJ4qmU6EwsZideog==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - jest: '>=27.2.5' - peerDependenciesMeta: - jest: - optional: true - dependencies: - jest: 29.7.0(@types/node@18.18.6)(ts-node@10.9.1) - jest-diff: 29.7.0 - jest-get-type: 29.6.3 - dev: true - /jest-get-type@29.6.3: resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -23724,7 +25853,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.8 - '@types/node': 18.18.6 + '@types/node': 18.18.7 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -23735,6 +25864,7 @@ packages: walker: 1.0.8 optionalDependencies: fsevents: 2.3.3 + dev: true /jest-leak-detector@29.7.0: resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==} @@ -23742,6 +25872,7 @@ packages: dependencies: jest-get-type: 29.6.3 pretty-format: 29.7.0 + dev: true /jest-matcher-utils@29.7.0: resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} @@ -23751,12 +25882,13 @@ packages: jest-diff: 29.7.0 jest-get-type: 29.6.3 pretty-format: 29.7.0 + dev: true /jest-message-util@29.7.0: resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 '@jest/types': 29.6.3 '@types/stack-utils': 2.0.2 chalk: 4.1.2 @@ -23771,7 +25903,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 jest-util: 29.7.0 /jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): @@ -23784,14 +25916,17 @@ packages: optional: true dependencies: jest-resolve: 29.7.0 + dev: true /jest-regex-util@27.5.1: resolution: {integrity: sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + dev: false /jest-regex-util@29.6.3: resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true /jest-resolve-dependencies@29.7.0: resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==} @@ -23801,6 +25936,7 @@ packages: jest-snapshot: 29.7.0 transitivePeerDependencies: - supports-color + dev: true /jest-resolve@29.7.0: resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==} @@ -23815,6 +25951,7 @@ packages: resolve: 1.22.8 resolve.exports: 2.0.2 slash: 3.0.0 + dev: true /jest-runner@29.7.0: resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==} @@ -23825,7 +25962,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -23843,6 +25980,7 @@ packages: source-map-support: 0.5.13 transitivePeerDependencies: - supports-color + dev: true /jest-runtime@29.7.0: resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==} @@ -23855,7 +25993,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 chalk: 4.1.2 cjs-module-lexer: 1.2.3 collect-v8-coverage: 1.0.2 @@ -23872,20 +26010,21 @@ packages: strip-bom: 4.0.0 transitivePeerDependencies: - supports-color + dev: true /jest-snapshot@29.7.0: resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 '@babel/generator': 7.23.0 - '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.23.2) + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.23.5) '@babel/types': 7.23.0 '@jest/expect-utils': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.23.2) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.23.5) chalk: 4.1.2 expect: 29.7.0 graceful-fs: 4.2.11 @@ -23899,24 +26038,26 @@ packages: semver: 7.5.4 transitivePeerDependencies: - supports-color + dev: true /jest-util@27.5.1: resolution: {integrity: sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 18.18.6 + '@types/node': 18.18.7 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 picomatch: 2.3.1 + dev: false /jest-util@29.7.0: resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -23939,18 +26080,19 @@ packages: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 jest-util: 29.7.0 string-length: 4.0.2 + dev: true /jest-worker@27.5.1: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -23958,12 +26100,12 @@ packages: resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 - /jest@29.7.0(@types/node@18.18.6)(ts-node@10.9.1): + /jest@29.7.0(@types/node@18.18.7): resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -23973,20 +26115,20 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.7.0(ts-node@10.9.1) + '@jest/core': 29.7.0 '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@18.18.6)(ts-node@10.9.1) + jest-cli: 29.7.0(@types/node@18.18.7) transitivePeerDependencies: - '@types/node' - babel-plugin-macros - supports-color - ts-node + dev: true /jiti@1.20.0: resolution: {integrity: sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==} hasBin: true - dev: false /joi@17.11.0: resolution: {integrity: sha512-NgB+lZLNoqISVy1rZocE9PZI36bL/77ie924Ri43yEvi9GUUMPeyVIr8KdFTMUlby1p0PBYMk9spIxEUQYqrJQ==} @@ -23997,10 +26139,9 @@ packages: '@sideway/formula': 3.0.1 '@sideway/pinpoint': 2.0.0 - /joycon@3.1.1: - resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} - engines: {node: '>=10'} - dev: true + /js-base64@3.7.5: + resolution: {integrity: sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==} + dev: false /js-confetti@0.11.0: resolution: {integrity: sha512-Hc7I3VI4r4H0nq5q/oQK+JJwGoYRYVHK72fGk8E9Ay1dbh+aiZ9yl0yFp1K4oYeq7YFDQAndYChwqLPA3QWQuA==} @@ -24009,11 +26150,6 @@ packages: /js-cookie@2.2.1: resolution: {integrity: sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==} - /js-levenshtein@1.1.6: - resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==} - engines: {node: '>=0.10.0'} - dev: true - /js-sdsl@4.4.2: resolution: {integrity: sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w==} @@ -24050,27 +26186,29 @@ packages: /jsc-android@250231.0.0: resolution: {integrity: sha512-rS46PvsjYmdmuz1OAWXY/1kCYG7pnf1TBqeTiOJr1iDz7s5DLxxC9n/ZMknLDxzYzNVfI7R95MH10emSSG1Wuw==} + dev: false /jsc-safe-url@0.2.4: resolution: {integrity: sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q==} + dev: false - /jscodeshift@0.14.0(@babel/preset-env@7.23.2): + /jscodeshift@0.14.0(@babel/preset-env@7.23.5): resolution: {integrity: sha512-7eCC1knD7bLUPuSCwXsMZUH51O8jIcoVyKtI6P0XM0IVzlGjckPy3FIwQlorzbN0Sg79oK+RlohN32Mqf/lrYA==} hasBin: true peerDependencies: '@babel/preset-env': ^7.1.6 dependencies: - '@babel/core': 7.23.2 - '@babel/parser': 7.23.0 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.23.2) - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.23.2) - '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.23.2) - '@babel/plugin-transform-modules-commonjs': 7.23.0(@babel/core@7.23.2) - '@babel/preset-env': 7.23.2(@babel/core@7.23.2) - '@babel/preset-flow': 7.22.15(@babel/core@7.23.2) - '@babel/preset-typescript': 7.23.2(@babel/core@7.23.2) - '@babel/register': 7.22.15(@babel/core@7.23.2) - babel-core: 7.0.0-bridge.0(@babel/core@7.23.2) + '@babel/core': 7.23.5 + '@babel/parser': 7.23.5 + '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.23.5) + '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.23.5) + '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.23.5) + '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.23.5) + '@babel/preset-env': 7.23.5(@babel/core@7.23.5) + '@babel/preset-flow': 7.22.15(@babel/core@7.23.5) + '@babel/preset-typescript': 7.23.3(@babel/core@7.23.5) + '@babel/register': 7.22.15(@babel/core@7.23.5) + babel-core: 7.0.0-bridge.0(@babel/core@7.23.5) chalk: 4.1.2 flow-parser: 0.206.0 graceful-fs: 4.2.11 @@ -24082,6 +26220,7 @@ packages: write-file-atomic: 2.4.3 transitivePeerDependencies: - supports-color + dev: false /jsdom@20.0.3: resolution: {integrity: sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==} @@ -24135,19 +26274,13 @@ packages: /json-bigint-patch@0.0.8: resolution: {integrity: sha512-xa0LTQsyaq8awYyZyuUsporWisZFiyqzxGW8CKM3t7oouf0GFAKYJnqAm6e9NLNBQOCtOLvy614DEiRX/rPbnA==} - - /json-bigint@1.0.0: - resolution: {integrity: sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==} - dependencies: - bignumber.js: 9.1.2 - dev: true + dev: false /json-buffer@3.0.0: resolution: {integrity: sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==} /json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - dev: true /json-logic-js@2.0.2: resolution: {integrity: sha512-ZBtBdMJieqQcH7IX/LaBsr5pX+Y5JIW+EhejtM3Ffg2jdN9Iwf+Ht6TbHnvAZ/YtwyuhPaCBlnvzrwVeWdvGDQ==} @@ -24163,13 +26296,14 @@ packages: resolution: {integrity: sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw==} dependencies: foreach: 2.0.6 + dev: false /json-rpc-engine@6.1.0: resolution: {integrity: sha512-NEdLrtrq1jUZyfjkr9OCz9EzCNhnRyWtt1PAnvnhwy6e8XETS0Dtc+ZNCO2gvuAoKsIn2+vCSowXTYE4CkgnAQ==} engines: {node: '>=10.0.0'} dependencies: '@metamask/safe-event-emitter': 2.0.0 - eth-rpc-errors: 4.0.2 + eth-rpc-errors: 4.0.3 dev: false /json-rpc-middleware-stream@4.2.3: @@ -24192,9 +26326,10 @@ packages: '@babel/runtime': 7.23.2 '@types/json-schema': 7.0.14 ts-algebra: 1.2.2 + dev: false - /json-schema-to-typescript@12.0.0: - resolution: {integrity: sha512-Uk/BDIAo8vqepPBhM86UhNMHgCv7JulicNj/BgnQPHE1fGCoej0UTtcEYzXU/uk6lSvbZCf7pccW+dnNMrr5rg==} + /json-schema-to-typescript@13.1.1: + resolution: {integrity: sha512-F3CYhtA7F3yPbb8vF7sFchk/2dnr1/yTKf8RcvoNpjnh67ZS/ZMH1ElLt5KHAtf2/bymiejLQQszszPWEeTdSw==} engines: {node: '>=12.0.0'} hasBin: true dependencies: @@ -24225,7 +26360,6 @@ packages: /json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - dev: true /json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} @@ -24239,6 +26373,7 @@ packages: /json5@1.0.2: resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} hasBin: true + requiresBuild: true dependencies: minimist: 1.2.8 dev: true @@ -24314,7 +26449,6 @@ packages: pako: 1.0.11 readable-stream: 2.3.8 setimmediate: 1.0.5 - dev: false /just-debounce-it@3.2.0: resolution: {integrity: sha512-WXzwLL0745uNuedrCsCs3rpmfD6DBaf7uuVwaq98/8dafURfgQaBsSpjiPp5+CW6Vjltwy9cOGI6qE71b3T8iQ==} @@ -24338,25 +26472,6 @@ packages: randombytes: 2.1.0 dev: false - /keccak@3.0.1: - resolution: {integrity: sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==} - engines: {node: '>=10.0.0'} - requiresBuild: true - dependencies: - node-addon-api: 2.0.2 - node-gyp-build: 4.6.1 - dev: true - - /keccak@3.0.2: - resolution: {integrity: sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==} - engines: {node: '>=10.0.0'} - requiresBuild: true - dependencies: - node-addon-api: 2.0.2 - node-gyp-build: 4.6.1 - readable-stream: 3.6.2 - dev: true - /keccak@3.0.4: resolution: {integrity: sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==} engines: {node: '>=10.0.0'} @@ -24382,7 +26497,6 @@ packages: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} dependencies: json-buffer: 3.0.1 - dev: true /keyvaluestorage-interface@1.0.0: resolution: {integrity: sha512-8t6Q3TclQ4uZynJY9IGr2+SsIGwK9JHcO6ootkHCGA0CrQCRy+VkouYNO2xicET6b9al7QKzpebNow+gkpCL8g==} @@ -24445,76 +26559,6 @@ packages: engines: {node: '> 0.8'} dev: true - /lcid@1.0.0: - resolution: {integrity: sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==} - engines: {node: '>=0.10.0'} - dependencies: - invert-kv: 1.0.0 - dev: true - - /level-codec@9.0.2: - resolution: {integrity: sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==} - engines: {node: '>=6'} - dependencies: - buffer: 5.7.1 - dev: true - - /level-concat-iterator@2.0.1: - resolution: {integrity: sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==} - engines: {node: '>=6'} - dev: true - - /level-concat-iterator@3.1.0: - resolution: {integrity: sha512-BWRCMHBxbIqPxJ8vHOvKUsaO0v1sLYZtjN3K2iZJsRBYtp+ONsY6Jfi6hy9K3+zolgQRryhIn2NRZjZnWJ9NmQ==} - engines: {node: '>=10'} - dependencies: - catering: 2.1.1 - dev: true - - /level-errors@2.0.1: - resolution: {integrity: sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==} - engines: {node: '>=6'} - dependencies: - errno: 0.1.8 - dev: true - - /level-iterator-stream@4.0.2: - resolution: {integrity: sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==} - engines: {node: '>=6'} - dependencies: - inherits: 2.0.4 - readable-stream: 3.6.2 - xtend: 4.0.2 - dev: true - - /level-mem@5.0.1: - resolution: {integrity: sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg==} - engines: {node: '>=6'} - dependencies: - level-packager: 5.1.1 - memdown: 5.1.0 - dev: true - - /level-packager@5.1.1: - resolution: {integrity: sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==} - engines: {node: '>=6'} - dependencies: - encoding-down: 6.3.0 - levelup: 4.4.0 - dev: true - - /level-supports@1.0.1: - resolution: {integrity: sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==} - engines: {node: '>=6'} - dependencies: - xtend: 4.0.2 - dev: true - - /level-supports@2.1.0: - resolution: {integrity: sha512-E486g1NCjW5cF78KGPrMDRBYzPuueMZ6VBXHT6gC7A8UYWGiM14fGgp+s/L1oFfDWSPV/+SFkYCmZ0SiESkRKA==} - engines: {node: '>=10'} - dev: true - /level-supports@4.0.1: resolution: {integrity: sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==} engines: {node: '>=12'} @@ -24526,15 +26570,6 @@ packages: buffer: 6.0.3 module-error: 1.0.2 - /level-ws@2.0.0: - resolution: {integrity: sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA==} - engines: {node: '>=6'} - dependencies: - inherits: 2.0.4 - readable-stream: 3.6.2 - xtend: 4.0.2 - dev: true - /level@8.0.0: resolution: {integrity: sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ==} engines: {node: '>=12'} @@ -24542,27 +26577,6 @@ packages: browser-level: 1.0.1 classic-level: 1.3.0 - /leveldown@6.1.0: - resolution: {integrity: sha512-8C7oJDT44JXxh04aSSsfcMI8YiaGRhOFI9/pMEL7nWJLVsWajDPTRxsSHTM2WcTVY5nXM+SuRHzPPi0GbnDX+w==} - engines: {node: '>=10.12.0'} - requiresBuild: true - dependencies: - abstract-leveldown: 7.2.0 - napi-macros: 2.0.0 - node-gyp-build: 4.6.1 - dev: true - - /levelup@4.4.0: - resolution: {integrity: sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==} - engines: {node: '>=6'} - dependencies: - deferred-leveldown: 5.3.0 - level-errors: 2.0.1 - level-iterator-stream: 4.0.2 - level-supports: 1.0.1 - xtend: 4.0.2 - dev: true - /leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -24581,7 +26595,6 @@ packages: dependencies: prelude-ls: 1.2.1 type-check: 0.4.0 - dev: true /libp2p-crypto@0.21.2: resolution: {integrity: sha512-EXFrhSpiHtJ+/L8xXDvQNK5VjUMG51u878jzZcaT5XhuN/zFg6PWJFnl/qB2Y2j7eMWnvCRP7Kp+ua2H36cG4g==} @@ -24678,12 +26691,12 @@ packages: resolution: {integrity: sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==} dependencies: immediate: 3.0.6 + dev: false /lie@3.3.0: resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} dependencies: immediate: 3.0.6 - dev: false /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} @@ -24763,24 +26776,21 @@ packages: '@types/trusted-types': 2.0.5 dev: false - /lit@2.7.5: - resolution: {integrity: sha512-i/cH7Ye6nBDUASMnfwcictBnsTN91+aBjXoTHF2xARghXScKxpD4F4WYI+VLXg9lqbMinDfvoI7VnZXjyHgdfQ==} + /lit@2.7.6: + resolution: {integrity: sha512-1amFHA7t4VaaDe+vdQejSVBklwtH9svGoG6/dZi9JhxtJBBlqY5D1RV7iLUYY0trCqQc4NfhYYZilZiVHt7Hxg==} dependencies: '@lit/reactive-element': 1.6.3 lit-element: 3.3.3 lit-html: 2.8.0 dev: false - /load-json-file@1.1.0: - resolution: {integrity: sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==} - engines: {node: '>=0.10.0'} + /lit@2.8.0: + resolution: {integrity: sha512-4Sc3OFX9QHOJaHbmTMk28SYgVxLN3ePDjg7hofEft2zWlehFL3LiAuapWc4U/kYwMYJSh2hTCPZ6/LIC7ii0MA==} dependencies: - graceful-fs: 4.2.11 - parse-json: 2.2.0 - pify: 2.3.0 - pinkie-promise: 2.0.1 - strip-bom: 2.0.0 - dev: true + '@lit/reactive-element': 1.6.3 + lit-element: 3.3.3 + lit-html: 2.8.0 + dev: false /load-json-file@4.0.0: resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} @@ -24829,10 +26839,19 @@ packages: engines: {node: '>=14'} dev: true + /local-pkg@0.5.0: + resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} + engines: {node: '>=14'} + dependencies: + mlly: 1.4.2 + pkg-types: 1.0.3 + dev: true + /localforage@1.10.0: resolution: {integrity: sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==} dependencies: lie: 3.1.1 + dev: false /locate-path@2.0.0: resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==} @@ -24847,6 +26866,7 @@ packages: dependencies: p-locate: 3.0.0 path-exists: 3.0.0 + dev: false /locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} @@ -24871,15 +26891,17 @@ packages: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} dev: false - /lodash.assign@4.2.0: - resolution: {integrity: sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==} - dev: true - /lodash.camelcase@4.3.0: resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + dev: true /lodash.clone@4.5.0: resolution: {integrity: sha512-GhrVeweiTD6uTmmn5hV/lzgCQhccwReIVRLHp7LT4SopOjqEZ5BbX8b5WWEtAKasjmy8hR7ZPwsYlxRCku5odg==} + dev: false + + /lodash.clonedeep@4.5.0: + resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==} + dev: true /lodash.curry@4.1.1: resolution: {integrity: sha512-/u14pXGviLaweY5JI0IUzgzF2J6Ne8INyzAZjImcryjgkZ+ebruBxy2/JaOOkTqScddcYtakjhSaeemV8lR0tA==} @@ -24913,7 +26935,6 @@ packages: /lodash.isequal@4.5.0: resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} - dev: false /lodash.isfunction@3.0.9: resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} @@ -24986,9 +27007,11 @@ packages: /lodash.throttle@4.1.1: resolution: {integrity: sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==} + dev: false /lodash.topath@4.5.2: resolution: {integrity: sha512-1/W4dM+35DwvE/iEd1M9ekewOSTlpFekhw9mhAtrwjVqUr83/ilQiyAvmg4tVX7Unkcfl1KC+i9WdaT4B6aQcg==} + dev: false /lodash.trim@4.5.1: resolution: {integrity: sha512-nJAlRl/K+eiOehWKDzoBVrSMhK0K3A3YQsUNXHQa5yIrKBAhsZgSu3KoAFoFT+mEgiyBHddZ0pRk1ITpIp90Wg==} @@ -25066,6 +27089,7 @@ packages: ansi-fragments: 0.2.1 dayjs: 1.11.10 yargs: 15.4.1 + dev: false /loglevel@1.8.1: resolution: {integrity: sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg==} @@ -25107,6 +27131,7 @@ packages: resolution: {integrity: sha512-EVm/rR94FJTZi3zefZ82fLWab+GX14LJN4HrWBcuo6Evmsl9hEfnqxgcHCKb9q+mNf6EVdsjx/qucYFIIB84pg==} dependencies: tslib: 2.6.2 + dev: false /lower-case@2.0.2: resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} @@ -25125,7 +27150,11 @@ packages: /lowercase-keys@2.0.0: resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} engines: {node: '>=8'} - dev: false + + /lowercase-keys@3.0.0: + resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true /lru-cache@10.0.1: resolution: {integrity: sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==} @@ -25145,6 +27174,7 @@ packages: /lru-cache@7.18.3: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} + dev: false /lru-queue@0.1.0: resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==} @@ -25155,10 +27185,6 @@ packages: /lru_map@0.3.3: resolution: {integrity: sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==} - /ltgt@2.2.1: - resolution: {integrity: sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==} - dev: true - /lunr@2.3.9: resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} dev: true @@ -25212,10 +27238,15 @@ packages: engines: {node: '>=10'} dependencies: semver: 7.5.4 + dev: true /make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + /make-plural@7.3.0: + resolution: {integrity: sha512-/K3BC0KIsO+WK2i94LkMPv3wslMrazrQhfi5We9fMbLlLjzoOSJWr7TAdupLlDWaJcWxwoNosBkhFDejiu5VDw==} + dev: false + /makeerror@1.0.12: resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} dependencies: @@ -25224,6 +27255,7 @@ packages: /map-cache@0.2.2: resolution: {integrity: sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==} engines: {node: '>=0.10.0'} + dev: false /map-obj@1.0.1: resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} @@ -25369,18 +27401,6 @@ packages: resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} - /memdown@5.1.0: - resolution: {integrity: sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==} - engines: {node: '>=6'} - dependencies: - abstract-leveldown: 6.2.3 - functional-red-black-tree: 1.0.1 - immediate: 3.2.3 - inherits: 2.0.4 - ltgt: 2.2.1 - safe-buffer: 5.2.1 - dev: true - /memfs@3.5.3: resolution: {integrity: sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==} engines: {node: '>= 4.0.0'} @@ -25389,6 +27409,7 @@ packages: /memoize-one@5.2.1: resolution: {integrity: sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==} + dev: false /memoizee@0.4.15: resolution: {integrity: sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==} @@ -25470,17 +27491,6 @@ packages: resolution: {integrity: sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==} dev: true - /merkle-patricia-tree@4.2.4: - resolution: {integrity: sha512-eHbf/BG6eGNsqqfbLED9rIqbsF4+sykEaBn6OLNs71tjclbMcMOk1tEPmJKcNcNCLkvbpY/lwyOlizWsqPNo8w==} - dependencies: - '@types/levelup': 4.3.3 - ethereumjs-util: 7.1.5 - level-mem: 5.0.1 - level-ws: 2.0.0 - readable-stream: 3.6.2 - semaphore-async-await: 1.5.1 - dev: true - /mermaid@9.4.3: resolution: {integrity: sha512-TLkQEtqhRSuEHSE34lh5bCa94KATCyluAXmFnNI2PRZwOpXFeqiJWwZl+d2CcemE1RS6QbbueSSq9QIg8Uxcyw==} dependencies: @@ -25502,7 +27512,7 @@ packages: web-worker: 1.2.0 dev: false - /meros@1.3.0(@types/node@18.18.6): + /meros@1.3.0(@types/node@18.18.7): resolution: {integrity: sha512-2BNGOimxEz5hmjUG2FwoxCt5HN7BXdaWyFqEwxPTrJzVdABtrL4TiHTcsWSFAxPQ/tOnEaQEJh3qWq71QRMY+w==} engines: {node: '>=13'} peerDependencies: @@ -25511,7 +27521,8 @@ packages: '@types/node': optional: true dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 + dev: false /methods@1.1.2: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} @@ -25521,15 +27532,17 @@ packages: resolution: {integrity: sha512-Hh6PW34Ug/nShlBGxkwQJSgPGAzSJ9FwQXhUImkzdsDgVu6zj5bx258J8cJVSandjNoQ8nbaHK6CaHlnbZKbyA==} engines: {node: '>=16'} dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 hermes-parser: 0.12.0 nullthrows: 1.1.1 transitivePeerDependencies: - supports-color + dev: false /metro-cache-key@0.76.8: resolution: {integrity: sha512-buKQ5xentPig9G6T37Ww/R/bC+/V1MA5xU/D8zjnhlelsrPG6w6LtHUS61ID3zZcMZqYaELWk5UIadIdDsaaLw==} engines: {node: '>=16'} + dev: false /metro-cache@0.76.8: resolution: {integrity: sha512-QBJSJIVNH7Hc/Yo6br/U/qQDUpiUdRgZ2ZBJmvAbmAKp2XDzsapnMwK/3BGj8JNWJF7OLrqrYHsRsukSbUBpvQ==} @@ -25537,6 +27550,7 @@ packages: dependencies: metro-core: 0.76.8 rimraf: 3.0.2 + dev: false /metro-config@0.76.8: resolution: {integrity: sha512-SL1lfKB0qGHALcAk2zBqVgQZpazDYvYFGwCK1ikz0S6Y/CM2i2/HwuZN31kpX6z3mqjv/6KvlzaKoTb1otuSAA==} @@ -25554,6 +27568,7 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /metro-core@0.76.8: resolution: {integrity: sha512-sl2QLFI3d1b1XUUGxwzw/KbaXXU/bvFYrSKz6Sg19AdYGWFyzsgZ1VISRIDf+HWm4R/TJXluhWMEkEtZuqi3qA==} @@ -25561,6 +27576,7 @@ packages: dependencies: lodash.throttle: 4.1.1 metro-resolver: 0.76.8 + dev: false /metro-file-map@0.76.8: resolution: {integrity: sha512-A/xP1YNEVwO1SUV9/YYo6/Y1MmzhL4ZnVgcJC3VmHp/BYVOXVStzgVbWv2wILe56IIMkfXU+jpXrGKKYhFyHVw==} @@ -25582,6 +27598,7 @@ packages: fsevents: 2.3.3 transitivePeerDependencies: - supports-color + dev: false /metro-inspector-proxy@0.76.8: resolution: {integrity: sha512-Us5o5UEd4Smgn1+TfHX4LvVPoWVo9VsVMn4Ldbk0g5CQx3Gu0ygc/ei2AKPGTwsOZmKxJeACj7yMH2kgxQP/iw==} @@ -25598,84 +27615,90 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /metro-minify-terser@0.76.8: resolution: {integrity: sha512-Orbvg18qXHCrSj1KbaeSDVYRy/gkro2PC7Fy2tDSH1c9RB4aH8tuMOIXnKJE+1SXxBtjWmQ5Yirwkth2DyyEZA==} engines: {node: '>=16'} dependencies: terser: 5.22.0 + dev: false /metro-minify-uglify@0.76.8: resolution: {integrity: sha512-6l8/bEvtVaTSuhG1FqS0+Mc8lZ3Bl4RI8SeRIifVLC21eeSDp4CEBUWSGjpFyUDfi6R5dXzYaFnSgMNyfxADiQ==} engines: {node: '>=16'} dependencies: uglify-es: 3.3.9 + dev: false - /metro-react-native-babel-preset@0.76.8(@babel/core@7.23.2): + /metro-react-native-babel-preset@0.76.8(@babel/core@7.23.5): resolution: {integrity: sha512-Ptza08GgqzxEdK8apYsjTx2S8WDUlS2ilBlu9DR1CUcHmg4g3kOkFylZroogVAUKtpYQNYwAvdsjmrSdDNtiAg==} engines: {node: '>=16'} peerDependencies: '@babel/core': '*' dependencies: - '@babel/core': 7.23.2 - '@babel/plugin-proposal-async-generator-functions': 7.20.7(@babel/core@7.23.2) - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.23.2) - '@babel/plugin-proposal-export-default-from': 7.22.17(@babel/core@7.23.2) - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.23.2) - '@babel/plugin-proposal-numeric-separator': 7.18.6(@babel/core@7.23.2) - '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.23.2) - '@babel/plugin-proposal-optional-catch-binding': 7.18.6(@babel/core@7.23.2) - '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.23.2) - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.2) - '@babel/plugin-syntax-export-default-from': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-syntax-flow': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.2) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.2) - '@babel/plugin-transform-arrow-functions': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-async-to-generator': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-block-scoping': 7.23.0(@babel/core@7.23.2) - '@babel/plugin-transform-classes': 7.22.15(@babel/core@7.23.2) - '@babel/plugin-transform-computed-properties': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-destructuring': 7.23.0(@babel/core@7.23.2) - '@babel/plugin-transform-flow-strip-types': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-function-name': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-literals': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-modules-commonjs': 7.23.0(@babel/core@7.23.2) - '@babel/plugin-transform-named-capturing-groups-regex': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-parameters': 7.22.15(@babel/core@7.23.2) - '@babel/plugin-transform-react-display-name': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.23.2) - '@babel/plugin-transform-react-jsx-self': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-react-jsx-source': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-runtime': 7.23.2(@babel/core@7.23.2) - '@babel/plugin-transform-shorthand-properties': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-spread': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-sticky-regex': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-typescript': 7.22.15(@babel/core@7.23.2) - '@babel/plugin-transform-unicode-regex': 7.22.5(@babel/core@7.23.2) + '@babel/core': 7.23.5 + '@babel/plugin-proposal-async-generator-functions': 7.20.7(@babel/core@7.23.5) + '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.23.5) + '@babel/plugin-proposal-export-default-from': 7.22.17(@babel/core@7.23.5) + '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.23.5) + '@babel/plugin-proposal-numeric-separator': 7.18.6(@babel/core@7.23.5) + '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.23.5) + '@babel/plugin-proposal-optional-catch-binding': 7.18.6(@babel/core@7.23.5) + '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.23.5) + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-export-default-from': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-syntax-flow': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.5) + '@babel/plugin-transform-arrow-functions': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-async-to-generator': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-block-scoping': 7.23.4(@babel/core@7.23.5) + '@babel/plugin-transform-classes': 7.23.5(@babel/core@7.23.5) + '@babel/plugin-transform-computed-properties': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-destructuring': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-flow-strip-types': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-function-name': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-literals': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-named-capturing-groups-regex': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-react-display-name': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.23.5) + '@babel/plugin-transform-react-jsx-self': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-react-jsx-source': 7.22.5(@babel/core@7.23.5) + '@babel/plugin-transform-runtime': 7.23.2(@babel/core@7.23.5) + '@babel/plugin-transform-shorthand-properties': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-spread': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-sticky-regex': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-typescript': 7.23.5(@babel/core@7.23.5) + '@babel/plugin-transform-unicode-regex': 7.23.3(@babel/core@7.23.5) '@babel/template': 7.22.15 - babel-plugin-transform-flow-enums: 0.0.2(@babel/core@7.23.2) + babel-plugin-transform-flow-enums: 0.0.2(@babel/core@7.23.5) react-refresh: 0.4.3 transitivePeerDependencies: - supports-color + dev: false - /metro-react-native-babel-transformer@0.76.8(@babel/core@7.23.2): + /metro-react-native-babel-transformer@0.76.8(@babel/core@7.23.5): resolution: {integrity: sha512-3h+LfS1WG1PAzhq8QF0kfXjxuXetbY/lgz8vYMQhgrMMp17WM1DNJD0gjx8tOGYbpbBC1qesJ45KMS4o5TA73A==} engines: {node: '>=16'} peerDependencies: '@babel/core': '*' dependencies: - '@babel/core': 7.23.2 - babel-preset-fbjs: 3.4.0(@babel/core@7.23.2) + '@babel/core': 7.23.5 + babel-preset-fbjs: 3.4.0(@babel/core@7.23.5) hermes-parser: 0.12.0 - metro-react-native-babel-preset: 0.76.8(@babel/core@7.23.2) + metro-react-native-babel-preset: 0.76.8(@babel/core@7.23.5) nullthrows: 1.1.1 transitivePeerDependencies: - supports-color + dev: false /metro-resolver@0.76.8: resolution: {integrity: sha512-KccOqc10vrzS7ZhG2NSnL2dh3uVydarB7nOhjreQ7C4zyWuiW9XpLC4h47KtGQv3Rnv/NDLJYeDqaJ4/+140HQ==} engines: {node: '>=16'} + dev: false /metro-runtime@0.76.8: resolution: {integrity: sha512-XKahvB+iuYJSCr3QqCpROli4B4zASAYpkK+j3a0CJmokxCDNbgyI4Fp88uIL6rNaZfN0Mv35S0b99SdFXIfHjg==} @@ -25683,13 +27706,14 @@ packages: dependencies: '@babel/runtime': 7.23.2 react-refresh: 0.4.3 + dev: false /metro-source-map@0.76.8: resolution: {integrity: sha512-Hh0ncPsHPVf6wXQSqJqB3K9Zbudht4aUtNpNXYXSxH+pteWqGAXnjtPsRAnCsCWl38wL0jYF0rJDdMajUI3BDw==} engines: {node: '>=16'} dependencies: - '@babel/traverse': 7.23.2 - '@babel/types': 7.23.0 + '@babel/traverse': 7.23.5 + '@babel/types': 7.23.5 invariant: 2.2.4 metro-symbolicate: 0.76.8 nullthrows: 1.1.1 @@ -25698,6 +27722,7 @@ packages: vlq: 1.0.1 transitivePeerDependencies: - supports-color + dev: false /metro-symbolicate@0.76.8: resolution: {integrity: sha512-LrRL3uy2VkzrIXVlxoPtqb40J6Bf1mlPNmUQewipc3qfKKFgtPHBackqDy1YL0njDsWopCKcfGtFYLn0PTUn3w==} @@ -25712,28 +27737,30 @@ packages: vlq: 1.0.1 transitivePeerDependencies: - supports-color + dev: false /metro-transform-plugins@0.76.8: resolution: {integrity: sha512-PlkGTQNqS51Bx4vuufSQCdSn2R2rt7korzngo+b5GCkeX5pjinPjnO2kNhQ8l+5bO0iUD/WZ9nsM2PGGKIkWFA==} engines: {node: '>=16'} dependencies: - '@babel/core': 7.23.2 - '@babel/generator': 7.23.0 + '@babel/core': 7.23.5 + '@babel/generator': 7.23.5 '@babel/template': 7.22.15 - '@babel/traverse': 7.23.2 + '@babel/traverse': 7.23.5 nullthrows: 1.1.1 transitivePeerDependencies: - supports-color + dev: false /metro-transform-worker@0.76.8: resolution: {integrity: sha512-mE1fxVAnJKmwwJyDtThildxxos9+DGs9+vTrx2ktSFMEVTtXS/bIv2W6hux1pqivqAfyJpTeACXHk5u2DgGvIQ==} engines: {node: '>=16'} dependencies: - '@babel/core': 7.23.2 - '@babel/generator': 7.23.0 - '@babel/parser': 7.23.0 - '@babel/types': 7.23.0 - babel-preset-fbjs: 3.4.0(@babel/core@7.23.2) + '@babel/core': 7.23.5 + '@babel/generator': 7.23.5 + '@babel/parser': 7.23.5 + '@babel/types': 7.23.5 + babel-preset-fbjs: 3.4.0(@babel/core@7.23.5) metro: 0.76.8 metro-babel-transformer: 0.76.8 metro-cache: 0.76.8 @@ -25746,19 +27773,20 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /metro@0.76.8: resolution: {integrity: sha512-oQA3gLzrrYv3qKtuWArMgHPbHu8odZOD9AoavrqSFllkPgOtmkBvNNDLCELqv5SjBfqjISNffypg+5UGG3y0pg==} engines: {node: '>=16'} hasBin: true dependencies: - '@babel/code-frame': 7.22.13 - '@babel/core': 7.23.2 - '@babel/generator': 7.23.0 - '@babel/parser': 7.23.0 + '@babel/code-frame': 7.23.5 + '@babel/core': 7.23.5 + '@babel/generator': 7.23.5 + '@babel/parser': 7.23.5 '@babel/template': 7.22.15 - '@babel/traverse': 7.23.2 - '@babel/types': 7.23.0 + '@babel/traverse': 7.23.5 + '@babel/types': 7.23.5 accepts: 1.3.8 async: 3.2.4 chalk: 4.1.2 @@ -25783,7 +27811,7 @@ packages: metro-inspector-proxy: 0.76.8 metro-minify-terser: 0.76.8 metro-minify-uglify: 0.76.8 - metro-react-native-babel-preset: 0.76.8(@babel/core@7.23.2) + metro-react-native-babel-preset: 0.76.8(@babel/core@7.23.5) metro-resolver: 0.76.8 metro-runtime: 0.76.8 metro-source-map: 0.76.8 @@ -25805,6 +27833,7 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /micro-ftch@0.3.1: resolution: {integrity: sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==} @@ -25992,14 +28021,6 @@ packages: braces: 3.0.2 picomatch: 2.3.1 - /miller-rabin@4.0.1: - resolution: {integrity: sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==} - hasBin: true - dependencies: - bn.js: 4.12.0 - brorand: 1.1.0 - dev: true - /mime-db@1.33.0: resolution: {integrity: sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==} engines: {node: '>= 0.6'} @@ -26031,6 +28052,7 @@ packages: resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==} engines: {node: '>=4.0.0'} hasBin: true + dev: false /mime@3.0.0: resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==} @@ -26049,6 +28071,17 @@ packages: resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} engines: {node: '>=4'} + /mimic-response@3.1.0: + resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} + engines: {node: '>=10'} + dev: true + + /min-document@2.19.0: + resolution: {integrity: sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ==} + dependencies: + dom-walk: 0.1.2 + dev: true + /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -26128,13 +28161,6 @@ packages: dependencies: brace-expansion: 2.0.1 - /minimatch@7.4.6: - resolution: {integrity: sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==} - engines: {node: '>=10'} - dependencies: - brace-expansion: 2.0.1 - dev: true - /minimatch@8.0.4: resolution: {integrity: sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==} engines: {node: '>=16 || 14 >=14.17'} @@ -26163,6 +28189,13 @@ packages: /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + /minipass@2.9.0: + resolution: {integrity: sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==} + dependencies: + safe-buffer: 5.2.1 + yallist: 3.1.1 + dev: true + /minipass@3.3.6: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} engines: {node: '>=8'} @@ -26184,6 +28217,12 @@ packages: resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} engines: {node: '>=16 || 14 >=14.17'} + /minizlib@1.3.3: + resolution: {integrity: sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==} + dependencies: + minipass: 2.9.0 + dev: true + /minizlib@2.1.2: resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} engines: {node: '>= 8'} @@ -26192,6 +28231,14 @@ packages: yallist: 4.0.0 dev: true + /mkdirp-promise@5.0.1: + resolution: {integrity: sha512-Hepn5kb1lJPtVW84RFT40YG1OddBNTOVUZR2bzQUHc+Z03en8/3uX0+060JDhcEzyO08HmipsN9DcnFMxhIL9w==} + engines: {node: '>=4'} + deprecated: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that. + dependencies: + mkdirp: 3.0.1 + dev: true + /mkdirp@0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true @@ -26249,6 +28296,10 @@ packages: yargs-parser: 20.2.4 yargs-unparser: 2.0.0 + /mock-fs@4.14.0: + resolution: {integrity: sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==} + dev: true + /module-error@1.0.2: resolution: {integrity: sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==} engines: {node: '>=10'} @@ -26300,42 +28351,6 @@ packages: /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - /msw@1.3.2(typescript@4.9.5): - resolution: {integrity: sha512-wKLhFPR+NitYTkQl5047pia0reNGgf0P6a1eTnA5aNlripmiz0sabMvvHcicE8kQ3/gZcI0YiPFWmYfowfm3lA==} - engines: {node: '>=14'} - hasBin: true - requiresBuild: true - peerDependencies: - typescript: '>= 4.4.x <= 5.2.x' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@mswjs/cookies': 0.2.2 - '@mswjs/interceptors': 0.17.10 - '@open-draft/until': 1.0.3 - '@types/cookie': 0.4.1 - '@types/js-levenshtein': 1.1.2 - chalk: 4.1.2 - chokidar: 3.5.3 - cookie: 0.4.2 - graphql: 16.8.1 - headers-polyfill: 3.2.5 - inquirer: 8.2.6 - is-node-process: 1.2.0 - js-levenshtein: 1.1.6 - node-fetch: 2.7.0 - outvariant: 1.4.0 - path-to-regexp: 6.2.1 - strict-event-emitter: 0.4.6 - type-fest: 2.19.0 - typescript: 4.9.5 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - dev: true - /multiaddr-to-uri@8.0.0(node-fetch@3.3.2): resolution: {integrity: sha512-dq4p/vsOOUdVEd1J1gl+R2GFrXJQH8yjLtz4hodqdVbieg39LvBOdMQRdQnfbg5LSM/q1BYNVf5CBbwZFFqBgA==} deprecated: This module is deprecated, please upgrade to @multiformats/multiaddr-to-uri @@ -26359,6 +28374,22 @@ packages: - node-fetch - supports-color + /multibase@0.6.1: + resolution: {integrity: sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==} + deprecated: This module has been superseded by the multiformats module + dependencies: + base-x: 3.0.9 + buffer: 5.7.1 + dev: true + + /multibase@0.7.0: + resolution: {integrity: sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==} + deprecated: This module has been superseded by the multiformats module + dependencies: + base-x: 3.0.9 + buffer: 5.7.1 + dev: true + /multicast-dns@7.2.5: resolution: {integrity: sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==} hasBin: true @@ -26366,6 +28397,21 @@ packages: dns-packet: 5.6.1 thunky: 1.1.0 + /multicodec@0.5.7: + resolution: {integrity: sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA==} + deprecated: This module has been superseded by the multiformats module + dependencies: + varint: 5.0.2 + dev: true + + /multicodec@1.0.4: + resolution: {integrity: sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg==} + deprecated: This module has been superseded by the multiformats module + dependencies: + buffer: 5.7.1 + varint: 5.0.2 + dev: true + /multiformats@10.0.3: resolution: {integrity: sha512-K2yGSmstS/oEmYiEIieHb53jJCaqp4ERPDQAYrm5sV3UUrVDZeshJQCK6GHAKyIGufU1vAcbS0PdAAZmC7Tzcw==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} @@ -26376,14 +28422,22 @@ packages: engines: {node: '>=16.0.0', npm: '>=7.0.0'} dev: false - /multiformats@12.1.2: - resolution: {integrity: sha512-6mRIsrZXyw5xNPO31IGBMmxgDXBSgCGDsBAtazkZ02ip4hMwZNrQvfxXZtytRoBSWuzSq5f9VmMnXj76fIz5FQ==} + /multiformats@12.1.3: + resolution: {integrity: sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} dev: false /multiformats@9.9.0: resolution: {integrity: sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==} + /multihashes@0.4.21: + resolution: {integrity: sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw==} + dependencies: + buffer: 5.7.1 + multibase: 0.7.0 + varint: 5.0.2 + dev: true + /murmur-128@0.2.1: resolution: {integrity: sha512-WseEgiRkI6aMFBbj8Cg9yBj/y+OdipwVC7zUo3W2W1JAJITwouUOtpqsmGSg67EQmwwSyod7hsVsWY5LsrfQVg==} dependencies: @@ -26437,6 +28491,10 @@ packages: stylis: 4.3.0 dev: false + /nano-json-stream-parser@0.1.2: + resolution: {integrity: sha512-9MqxMH/BSJC7dnLsEMPyfN5Dvoo49IsPFYMcHw3Bcfc2kN0lpHRBSzlMSVx4HGyJ7s9B31CyBTVehWJoQ8Ctew==} + dev: true + /nanoclone@0.2.1: resolution: {integrity: sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA==} dev: false @@ -26451,16 +28509,18 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + /nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: true + /nanoid@4.0.2: resolution: {integrity: sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==} engines: {node: ^14 || ^16 || >=18} hasBin: true dev: false - /napi-macros@2.0.0: - resolution: {integrity: sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==} - dev: true - /napi-macros@2.2.2: resolution: {integrity: sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==} @@ -26519,7 +28579,7 @@ packages: /next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} - /next@13.5.6(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0): + /next@13.5.6(@babel/core@7.23.5)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-Y2wTcTbO4WwEsVb4A8VSnOsG1I9ok+h74q0ZdxkwM3EODqrs4pasq7O0iUxbcS9VtWMicG7f3+HAj0r1+NtKSw==} engines: {node: '>=16.14.0'} hasBin: true @@ -26537,11 +28597,11 @@ packages: '@next/env': 13.5.6 '@swc/helpers': 0.5.2 busboy: 1.6.0 - caniuse-lite: 1.0.30001553 + caniuse-lite: 1.0.30001554 postcss: 8.4.31 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - styled-jsx: 5.1.1(@babel/core@7.23.2)(react@18.2.0) + styled-jsx: 5.1.1(@babel/core@7.23.5)(react@18.2.0) watchpack: 2.4.0 optionalDependencies: '@next/swc-darwin-arm64': 13.5.6 @@ -26599,9 +28659,11 @@ packages: /nocache@3.0.4: resolution: {integrity: sha512-WDD0bdg9mbq6F4mRxEYcPWwfA1vxd0mrvKOyxI7Xj/atfRHVeutzuWByG//jfm4uPzp0y4Kj051EORCBSQMycw==} engines: {node: '>=12.0.0'} + dev: false /node-abort-controller@3.1.1: resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==} + dev: false /node-addon-api@2.0.2: resolution: {integrity: sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==} @@ -26611,6 +28673,7 @@ packages: engines: {node: '>= 0.10.5'} dependencies: minimatch: 3.1.2 + dev: false /node-domexception@1.0.0: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} @@ -26644,18 +28707,6 @@ packages: resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==} engines: {node: '>= 6.13.0'} - /node-gyp-build@4.3.0: - resolution: {integrity: sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==} - hasBin: true - requiresBuild: true - dev: true - optional: true - - /node-gyp-build@4.4.0: - resolution: {integrity: sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==} - hasBin: true - dev: true - /node-gyp-build@4.6.1: resolution: {integrity: sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==} hasBin: true @@ -26676,19 +28727,13 @@ packages: /node-stream-zip@1.15.0: resolution: {integrity: sha512-LN4fydt9TqhZhThkZIVQnF9cwjU3qmUH9h78Mx/K7d3VvfRqqwthLwJEUOEL0QPZ0XQmNN7be5Ggit5+4dq3Bw==} engines: {node: '>=0.12.0'} + dev: false /nofilter@3.1.0: resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} engines: {node: '>=12.19'} dev: true - /noms@0.0.0: - resolution: {integrity: sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==} - dependencies: - inherits: 2.0.4 - readable-stream: 1.0.34 - dev: true - /non-layered-tidy-tree-layout@2.0.2: resolution: {integrity: sha512-gkXMxRzUH+PB0ax9dUN0yYF0S25BqeAYqhgMaLUFmpXLEk7Fcu8f4emJuOAY0V8kjDICxROIKsTAKsV/v355xw==} dev: false @@ -26722,6 +28767,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: remove-trailing-separator: 1.1.0 + dev: false /normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} @@ -26749,7 +28795,6 @@ packages: /normalize-url@6.1.0: resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==} engines: {node: '>=10'} - dev: false /npm-run-path@4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} @@ -26783,11 +28828,7 @@ packages: /nullthrows@1.1.1: resolution: {integrity: sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==} - - /number-is-nan@1.0.1: - resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==} - engines: {node: '>=0.10.0'} - dev: true + dev: false /number-to-bn@1.7.0: resolution: {integrity: sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig==} @@ -26844,6 +28885,7 @@ packages: /ob1@0.76.8: resolution: {integrity: sha512-dlBkJJV5M/msj9KYA9upc+nUWVwuOFFTbu28X6kZeGwcuW+JxaHSBZ70SYQnk5M+j5JbNLR6yKHmgW4M5E7X5g==} engines: {node: '>=16'} + dev: false /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} @@ -26851,9 +28893,11 @@ packages: /object-inspect@1.10.3: resolution: {integrity: sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==} + dev: false /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} + dev: false /object-inspect@1.13.1: resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} @@ -26941,6 +28985,12 @@ packages: /obliterator@2.0.4: resolution: {integrity: sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==} + /oboe@2.1.5: + resolution: {integrity: sha512-zRFWiF+FoicxEs3jNI/WYUrVEgA7DeET/InK0XQuudGHRg8iIob3cNPrJTKaz4004uaA9Pbe+Dwa8iluhjLZWA==} + dependencies: + http-https: 1.0.0 + dev: true + /observable-webworkers@2.0.1: resolution: {integrity: sha512-JI1vB0u3pZjoQKOK1ROWzp0ygxSi7Yb0iR+7UNsw4/Zn4cQ0P3R7XL38zac/Dy2tEA7Lg88/wIJTjF8vYXZ0uw==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} @@ -26958,6 +29008,7 @@ packages: engines: {node: '>= 0.8'} dependencies: ee-first: 1.1.1 + dev: false /on-finished@2.4.1: resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} @@ -26991,6 +29042,7 @@ packages: engines: {node: '>=8'} dependencies: is-wsl: 1.1.0 + dev: false /open@7.4.2: resolution: {integrity: sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==} @@ -26998,6 +29050,7 @@ packages: dependencies: is-docker: 2.2.1 is-wsl: 2.2.0 + dev: false /open@8.4.2: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} @@ -27009,6 +29062,7 @@ packages: /openapi-types@12.1.3: resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==} + dev: false /opener@1.5.2: resolution: {integrity: sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==} @@ -27017,8 +29071,9 @@ packages: /optimism@0.17.5: resolution: {integrity: sha512-TEcp8ZwK1RczmvMnvktxHSF2tKgMWjJ71xEFGX5ApLh67VsMSTy1ZUlipJw8W+KaqgOmQ+4pqwkeivY89j+4Vw==} + requiresBuild: true dependencies: - '@wry/context': 0.7.3 + '@wry/context': 0.7.4 '@wry/trie': 0.4.3 tslib: 2.6.2 dev: false @@ -27045,7 +29100,6 @@ packages: levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 - dev: true /ora@4.0.2: resolution: {integrity: sha512-YUOZbamht5mfLxPmk4M35CD/5DuOkAacxlEUbStVXpBAt4fyhBf+vZHI/HRkI++QUp3sNoeA2Gw4C+hi4eGSig==} @@ -27083,13 +29137,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /os-locale@1.4.0: - resolution: {integrity: sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==} - engines: {node: '>=0.10.0'} - dependencies: - lcid: 1.0.0 - dev: true - /os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} @@ -27102,10 +29149,6 @@ packages: resolution: {integrity: sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A==} dev: false - /outvariant@1.4.0: - resolution: {integrity: sha512-AlWY719RF02ujitly7Kk/0QlV+pXGFDHrHf9O2OKqyqgBieaPOIeuSkL8sRK6j2WK+/ZAURq2kZsY0d8JapUiw==} - dev: true - /p-cancelable@0.4.1: resolution: {integrity: sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==} engines: {node: '>=4'} @@ -27116,6 +29159,16 @@ packages: engines: {node: '>=6'} dev: false + /p-cancelable@2.1.1: + resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} + engines: {node: '>=8'} + dev: true + + /p-cancelable@3.0.0: + resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} + engines: {node: '>=12.20'} + dev: true + /p-defer@3.0.0: resolution: {integrity: sha512-ugZxsxmtTln604yeYd29EGrNhazN2lywetzpKhfmQjW/VJmhpDmWbiX+h0zL8V91R0UXkhb3KtPmyq9PZw3aYw==} engines: {node: '>=8'} @@ -27179,6 +29232,13 @@ packages: dependencies: yocto-queue: 1.0.0 + /p-limit@5.0.0: + resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==} + engines: {node: '>=18'} + dependencies: + yocto-queue: 1.0.0 + dev: true + /p-locate@2.0.0: resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==} engines: {node: '>=4'} @@ -27190,6 +29250,7 @@ packages: engines: {node: '>=6'} dependencies: p-limit: 2.3.0 + dev: false /p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} @@ -27306,7 +29367,6 @@ packages: /pako@1.0.11: resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} - dev: false /pako@2.1.0: resolution: {integrity: sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==} @@ -27353,12 +29413,10 @@ packages: is-absolute: 1.0.0 map-cache: 0.2.2 path-root: 0.1.1 + dev: false - /parse-json@2.2.0: - resolution: {integrity: sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==} - engines: {node: '>=0.10.0'} - dependencies: - error-ex: 1.3.2 + /parse-headers@2.0.5: + resolution: {integrity: sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==} dev: true /parse-json@4.0.0: @@ -27372,7 +29430,7 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -27434,19 +29492,14 @@ packages: /path-browserify@1.0.1: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + dev: false /path-case@3.0.4: resolution: {integrity: sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==} dependencies: dot-case: 3.0.4 tslib: 2.6.2 - - /path-exists@2.1.0: - resolution: {integrity: sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==} - engines: {node: '>=0.10.0'} - dependencies: - pinkie-promise: 2.0.1 - dev: true + dev: false /path-exists@3.0.0: resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} @@ -27483,12 +29536,14 @@ packages: /path-root-regex@0.1.2: resolution: {integrity: sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==} engines: {node: '>=0.10.0'} + dev: false /path-root@0.1.1: resolution: {integrity: sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==} engines: {node: '>=0.10.0'} dependencies: path-root-regex: 0.1.2 + dev: false /path-scurry@1.10.1: resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} @@ -27518,15 +29573,6 @@ packages: resolution: {integrity: sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==} dev: true - /path-type@1.1.0: - resolution: {integrity: sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==} - engines: {node: '>=0.10.0'} - dependencies: - graceful-fs: 4.2.11 - pify: 2.3.0 - pinkie-promise: 2.0.1 - dev: true - /path-type@3.0.0: resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==} engines: {node: '>=4'} @@ -27655,6 +29701,7 @@ packages: engines: {node: '>=6'} dependencies: find-up: 3.0.0 + dev: false /pkg-dir@4.2.0: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} @@ -28123,6 +30170,15 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 + /postcss@8.4.32: + resolution: {integrity: sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: true + /preact@10.18.1: resolution: {integrity: sha512-mKUD7RRkQQM6s7Rkmi7IFkoEHjuFqRQUaXamO61E6Nn7vqF/bo7EZCmSyrUnp2UWHw0O7XjZ2eeXis+m7tf4lg==} dev: false @@ -28135,7 +30191,6 @@ packages: /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - dev: true /prepend-http@2.0.0: resolution: {integrity: sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==} @@ -28170,6 +30225,7 @@ packages: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} hasBin: true + dev: true /pretty-bytes@5.6.0: resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==} @@ -28227,7 +30283,7 @@ packages: engines: {node: '>=4'} dev: false - /primereact@9.6.3(@types/react@18.2.31)(react-dom@18.2.0)(react@18.2.0): + /primereact@9.6.3(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-E1Apj4zHeEqFuNR43PFmcpYO51V17PDaVuZmYggEUxZHUo7XWoqkOGg7896SRRMDMBQcO3+HXdJQXi6DOWRV1g==} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -28237,7 +30293,7 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.31 + '@types/react': 18.2.33 '@types/react-transition-group': 4.4.8 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -28302,6 +30358,7 @@ packages: resolution: {integrity: sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==} dependencies: asap: 2.0.6 + dev: false /promise@8.3.0: resolution: {integrity: sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==} @@ -28359,7 +30416,7 @@ packages: '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 '@types/long': 4.0.2 - '@types/node': 18.18.6 + '@types/node': 18.18.7 long: 4.0.0 /protobufjs@7.2.5: @@ -28377,7 +30434,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 18.18.6 + '@types/node': 18.18.7 long: 5.2.3 dev: false @@ -28416,10 +30473,6 @@ packages: /proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - /prr@1.0.1: - resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==} - dev: true - /psl@1.9.0: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} dev: true @@ -28462,6 +30515,7 @@ packages: /pure-rand@6.0.4: resolution: {integrity: sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==} + dev: true /pvtsutils@1.3.5: resolution: {integrity: sha512-ARvb14YB9Nm2Xi6nBq1ZX6dAM0FsJnuk+31aUp4TrcZEdKUlSqOqsxJHUPJDNE3qiIp+iUPEIeR6Je/tgV7zsA==} @@ -28564,6 +30618,7 @@ packages: resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} dependencies: inherits: 2.0.4 + dev: false /quick-format-unescaped@4.0.4: resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} @@ -28573,6 +30628,11 @@ packages: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} engines: {node: '>=8'} + /quick-lru@5.1.1: + resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} + engines: {node: '>=10'} + dev: true + /quick-lru@6.1.2: resolution: {integrity: sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==} engines: {node: '>=12'} @@ -28658,7 +30718,7 @@ packages: pure-color: 1.3.0 dev: false - /react-dev-utils@12.0.1(typescript@4.9.5)(webpack@5.89.0): + /react-dev-utils@12.0.1(eslint@8.52.0)(typescript@4.9.5)(webpack@5.89.0): resolution: {integrity: sha512-84Ivxmr17KjUupyqzFode6xKhjwuEJDROWKJy/BthkL7Wn6NJ8h4WE6k/exAv6ImS+0oZLRRW5j/aINMHyeGeQ==} engines: {node: '>=14'} peerDependencies: @@ -28668,7 +30728,7 @@ packages: typescript: optional: true dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 address: 1.2.2 browserslist: 4.22.1 chalk: 4.1.2 @@ -28677,7 +30737,7 @@ packages: escape-string-regexp: 4.0.0 filesize: 8.0.7 find-up: 5.0.0 - fork-ts-checker-webpack-plugin: 6.5.3(typescript@4.9.5)(webpack@5.89.0) + fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.52.0)(typescript@4.9.5)(webpack@5.89.0) global-modules: 2.0.0 globby: 11.1.0 gzip-size: 6.0.0 @@ -28700,14 +30760,15 @@ packages: - vue-template-compiler dev: false - /react-devtools-core@4.28.4: - resolution: {integrity: sha512-IUZKLv3CimeM07G3vX4H4loxVpByrzq3HvfTX7v9migalwvLs9ZY5D3S3pKR33U+GguYfBBdMMZyToFhsSE/iQ==} + /react-devtools-core@4.28.5: + resolution: {integrity: sha512-cq/o30z9W2Wb4rzBefjv5fBalHU0rJGZCHAkf/RHSBWSSYwh8PlQTqqOJmgIIbBtpj27T6FIPXeomIjZtCNVqA==} dependencies: shell-quote: 1.8.1 ws: 7.5.9 transitivePeerDependencies: - bufferutil - utf-8-validate + dev: false /react-dom@18.2.0(react@18.2.0): resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} @@ -28757,6 +30818,7 @@ packages: /react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} + requiresBuild: true /react-is@17.0.2: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} @@ -28797,7 +30859,7 @@ packages: webpack: 5.89.0(webpack-cli@5.1.4) dev: false - /react-markdown@8.0.7(@types/react@18.2.31)(react@18.2.0): + /react-markdown@8.0.7(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-bvWbzG4MtOU62XqBx3Xx+zB2raaFFsq4mYiAzfjXJMEz2sixgeAfraA3tvzULF02ZdOMUOKTBFFaZJDDrq+BJQ==} peerDependencies: '@types/react': '>=16' @@ -28805,7 +30867,7 @@ packages: dependencies: '@types/hast': 2.3.7 '@types/prop-types': 15.7.9 - '@types/react': 18.2.31 + '@types/react': 18.2.33 '@types/unist': 2.0.9 comma-separated-tokens: 2.0.3 hast-util-whitespace: 2.0.1 @@ -28839,13 +30901,15 @@ packages: optional: true dependencies: base-64: 0.1.0 - react-native: 0.72.6(@babel/core@7.23.2)(@babel/preset-env@7.23.2)(react@18.2.0) + react-native: 0.72.6(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(react@18.2.0) utf8: 3.0.0 + dev: false /react-native-path@0.0.5: resolution: {integrity: sha512-WJr256xBquk7X2O83QYWKqgLg43Zg3SrgjPc/kr0gCD2LoXA+2L72BW4cmstH12GbGeutqs/eXk3jgDQ2iCSvQ==} + dev: false - /react-native@0.72.6(@babel/core@7.23.2)(@babel/preset-env@7.23.2)(react@18.2.0): + /react-native@0.72.6(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(react@18.2.0): resolution: {integrity: sha512-RafPY2gM7mcrFySS8TL8x+TIO3q7oAlHpzEmC7Im6pmXni6n1AuufGaVh0Narbr1daxstw7yW7T9BKW5dpVc2A==} engines: {node: '>=16'} hasBin: true @@ -28853,11 +30917,11 @@ packages: react: 18.2.0 dependencies: '@jest/create-cache-key-function': 29.7.0 - '@react-native-community/cli': 11.3.7(@babel/core@7.23.2) + '@react-native-community/cli': 11.3.7(@babel/core@7.23.5) '@react-native-community/cli-platform-android': 11.3.7 '@react-native-community/cli-platform-ios': 11.3.7 '@react-native/assets-registry': 0.72.0 - '@react-native/codegen': 0.72.7(@babel/preset-env@7.23.2) + '@react-native/codegen': 0.72.7(@babel/preset-env@7.23.5) '@react-native/gradle-plugin': 0.72.11 '@react-native/js-polyfills': 0.72.1 '@react-native/normalize-colors': 0.72.0 @@ -28879,7 +30943,7 @@ packages: pretty-format: 26.6.2 promise: 8.3.0 react: 18.2.0 - react-devtools-core: 4.28.4 + react-devtools-core: 4.28.5 react-refresh: 0.4.3 react-shallow-renderer: 16.15.0(react@18.2.0) regenerator-runtime: 0.13.11 @@ -28896,12 +30960,14 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /react-refresh@0.4.3: resolution: {integrity: sha512-Hwln1VNuGl/6bVwnd0Xdn1e84gT/8T9aYNL+HAKDArLCS7LWjwr7StE30IEYbIkx0Vi3vs+coQxe+SQDbGbbpA==} engines: {node: '>=0.10.0'} + dev: false - /react-remove-scroll-bar@2.3.4(@types/react@18.2.31)(react@18.2.0): + /react-remove-scroll-bar@2.3.4(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==} engines: {node: '>=10'} peerDependencies: @@ -28911,13 +30977,13 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.31 + '@types/react': 18.2.33 react: 18.2.0 - react-style-singleton: 2.2.1(@types/react@18.2.31)(react@18.2.0) + react-style-singleton: 2.2.1(@types/react@18.2.33)(react@18.2.0) tslib: 2.6.2 dev: false - /react-remove-scroll@2.5.4(@types/react@18.2.31)(react@18.2.0): + /react-remove-scroll@2.5.4(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-xGVKJJr0SJGQVirVFAUZ2k1QLyO6m+2fy0l8Qawbp5Jgrv3DeLalrfMNBFSlmz5kriGGzsVBtGVnf4pTKIhhWA==} engines: {node: '>=10'} peerDependencies: @@ -28927,13 +30993,13 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.31 + '@types/react': 18.2.33 react: 18.2.0 - react-remove-scroll-bar: 2.3.4(@types/react@18.2.31)(react@18.2.0) - react-style-singleton: 2.2.1(@types/react@18.2.31)(react@18.2.0) + react-remove-scroll-bar: 2.3.4(@types/react@18.2.33)(react@18.2.0) + react-style-singleton: 2.2.1(@types/react@18.2.33)(react@18.2.0) tslib: 2.6.2 - use-callback-ref: 1.3.0(@types/react@18.2.31)(react@18.2.0) - use-sidecar: 1.1.2(@types/react@18.2.31)(react@18.2.0) + use-callback-ref: 1.3.0(@types/react@18.2.33)(react@18.2.0) + use-sidecar: 1.1.2(@types/react@18.2.33)(react@18.2.0) dev: false /react-router-config@5.1.1(react-router@5.3.4)(react@18.2.0): @@ -28987,8 +31053,9 @@ packages: object-assign: 4.1.1 react: 18.2.0 react-is: 18.2.0 + dev: false - /react-style-singleton@2.2.1(@types/react@18.2.31)(react@18.2.0): + /react-style-singleton@2.2.1(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} engines: {node: '>=10'} peerDependencies: @@ -28998,7 +31065,7 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.31 + '@types/react': 18.2.33 get-nonce: 1.0.1 invariant: 2.2.4 react: 18.2.0 @@ -29084,14 +31151,6 @@ packages: dependencies: loose-envify: 1.4.0 - /read-pkg-up@1.0.1: - resolution: {integrity: sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==} - engines: {node: '>=0.10.0'} - dependencies: - find-up: 1.1.2 - read-pkg: 1.1.0 - dev: true - /read-pkg-up@7.0.1: resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} engines: {node: '>=8'} @@ -29100,15 +31159,6 @@ packages: read-pkg: 5.2.0 type-fest: 0.8.1 - /read-pkg@1.1.0: - resolution: {integrity: sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==} - engines: {node: '>=0.10.0'} - dependencies: - load-json-file: 1.1.0 - normalize-package-data: 2.5.0 - path-type: 1.1.0 - dev: true - /read-pkg@3.0.0: resolution: {integrity: sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==} engines: {node: '>=4'} @@ -29178,6 +31228,7 @@ packages: /readline@1.3.0: resolution: {integrity: sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==} + dev: false /real-require@0.1.0: resolution: {integrity: sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==} @@ -29192,6 +31243,7 @@ packages: esprima: 4.0.1 source-map: 0.6.1 tslib: 2.6.2 + dev: false /receptacle@1.3.2: resolution: {integrity: sha512-HrsFvqZZheusncQRiEE7GatOAETrARKV/lnfYicIm8lbvp/JQOdADOfhjBd2DajvoszEyxSM6RlAAIZgEoeu/A==} @@ -29232,6 +31284,7 @@ packages: /reduce-flatten@2.0.0: resolution: {integrity: sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==} engines: {node: '>=6'} + dev: true /reflect.getprototypeof@1.0.4: resolution: {integrity: sha512-ECkTw8TmJwW60lOTR+ZkODISW6RQ8+2CL3COqtiJKLd6MmB45hN51HprHFziKLGkAuTGQhBb91V8cy+KHlaCjw==} @@ -29260,6 +31313,7 @@ packages: /regenerator-runtime@0.13.11: resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} + dev: false /regenerator-runtime@0.14.0: resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==} @@ -29340,6 +31394,7 @@ packages: invariant: 2.2.4 transitivePeerDependencies: - encoding + dev: false /release-zalgo@1.0.0: resolution: {integrity: sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==} @@ -29427,6 +31482,7 @@ packages: /remove-trailing-separator@1.1.0: resolution: {integrity: sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==} + dev: false /renderkid@2.0.7: resolution: {integrity: sha512-oCcFyxaMrKsKcTY59qnCAtmDVSLfPbrv6A3tVbPdFMMrv5jaK10V6m40cKsoPNhAqN6rmHW9sswW4o3ruSrwUQ==} @@ -29503,11 +31559,6 @@ packages: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} - /require-from-string@1.2.1: - resolution: {integrity: sha512-H7AkJWMobeskkttHyhTVtS0fxpFLjxhbfMa6Bk3wimP7sdPRGL3EyCg3sAQenFfAe+xQ+oAc85Nmtvq0ROM83Q==} - engines: {node: '>=0.10.0'} - dev: true - /require-from-string@2.0.2: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} @@ -29516,10 +31567,6 @@ packages: resolution: {integrity: sha512-oyrU88skkMtDdauHDuKVrgR+zuItqr6/c//FXzvmxRGMexSDc6hNvJInGW3LL46n+8b50RykrvwSUIIQH2LQ5A==} dev: false - /require-main-filename@1.0.1: - resolution: {integrity: sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==} - dev: true - /require-main-filename@2.0.0: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} @@ -29530,6 +31577,10 @@ packages: resolution: {integrity: sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==} dev: false + /resolve-alpn@1.2.1: + resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} + dev: true + /resolve-cwd@3.0.0: resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} engines: {node: '>=8'} @@ -29574,6 +31625,7 @@ packages: /resolve.exports@2.0.2: resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} engines: {node: '>=10'} + dev: true /resolve@1.1.7: resolution: {integrity: sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==} @@ -29604,6 +31656,7 @@ packages: /response-iterator@0.2.6: resolution: {integrity: sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw==} engines: {node: '>=0.8'} + requiresBuild: true dev: false /responselike@1.0.2: @@ -29611,6 +31664,12 @@ packages: dependencies: lowercase-keys: 1.0.1 + /responselike@2.0.1: + resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} + dependencies: + lowercase-keys: 2.0.0 + dev: true + /restore-cursor@3.1.0: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} engines: {node: '>=8'} @@ -29661,6 +31720,7 @@ packages: hasBin: true dependencies: glob: 7.2.3 + dev: false /rimraf@2.7.1: resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} @@ -29687,13 +31747,6 @@ packages: hash-base: 3.1.0 inherits: 2.0.4 - /rlp@2.2.6: - resolution: {integrity: sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==} - hasBin: true - dependencies: - bn.js: 4.12.0 - dev: true - /rlp@2.2.7: resolution: {integrity: sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==} hasBin: true @@ -29730,18 +31783,29 @@ packages: semver: 5.7.2 dev: true - /rollup-plugin-dts@5.3.1(rollup@3.29.4)(typescript@4.9.5): - resolution: {integrity: sha512-gusMi+Z4gY/JaEQeXnB0RUdU82h1kF0WYzCWgVmV4p3hWXqelaKuCvcJawfeg+EKn2T1Ie+YWF2OiN1/L8bTVg==} - engines: {node: '>=v14.21.3'} + /rollup-plugin-copy@3.5.0: + resolution: {integrity: sha512-wI8D5dvYovRMx/YYKtUNt3Yxaw4ORC9xo6Gt9t22kveWz1enG9QrhVlagzwrxSC455xD1dHMKhIJkbsQ7d48BA==} + engines: {node: '>=8.3'} + dependencies: + '@types/fs-extra': 8.1.5 + colorette: 1.4.0 + fs-extra: 8.1.0 + globby: 10.0.1 + is-plain-object: 3.0.1 + dev: true + + /rollup-plugin-dts@6.1.0(rollup@3.29.4)(typescript@5.3.2): + resolution: {integrity: sha512-ijSCPICkRMDKDLBK9torss07+8dl9UpY9z1N/zTeA1cIqdzMlpkV3MOOC7zukyvQfDyxa1s3Dl2+DeiP/G6DOw==} + engines: {node: '>=16'} peerDependencies: - rollup: ^3.0 - typescript: ^4.1 || ^5.0 + rollup: ^3.29.4 || ^4 + typescript: ^4.5 || ^5.0 dependencies: magic-string: 0.30.5 rollup: 3.29.4 - typescript: 4.9.5 + typescript: 5.3.2 optionalDependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 dev: true /rollup-plugin-dts@6.1.0(rollup@4.1.4)(typescript@4.9.5): @@ -29755,28 +31819,27 @@ packages: rollup: 4.1.4 typescript: 4.9.5 optionalDependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 dev: true - /rollup-plugin-esbuild@5.0.0(esbuild@0.17.19)(rollup@3.29.4): - resolution: {integrity: sha512-1cRIOHAPh8WQgdQQyyvFdeOdxuiyk+zB5zJ5+YOwrZP4cJ0MT3Fs48pQxrZeyZHcn+klFherytILVfE4aYrneg==} - engines: {node: '>=14.18.0', npm: '>=8.0.0'} + /rollup-plugin-esbuild@6.1.0(esbuild@0.19.8)(rollup@3.29.4): + resolution: {integrity: sha512-HPpXU65V8bSpW8eSYPahtUJaJHmbxJGybuf/M8B3bz/6i11YaYHlNNJIQ38gSEV0FyohQOgVxJ2YMEEZtEmwvA==} + engines: {node: '>=14.18.0'} peerDependencies: - esbuild: '>=0.10.1' - rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 + esbuild: '>=0.18.0' + rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 dependencies: '@rollup/pluginutils': 5.0.5(rollup@3.29.4) debug: 4.3.4(supports-color@8.1.1) es-module-lexer: 1.3.1 - esbuild: 0.17.19 - joycon: 3.1.1 - jsonc-parser: 3.2.0 + esbuild: 0.19.8 + get-tsconfig: 4.7.2 rollup: 3.29.4 transitivePeerDependencies: - supports-color dev: true - /rollup-plugin-esbuild@6.1.0(esbuild@0.19.5)(rollup@4.1.4): + /rollup-plugin-esbuild@6.1.0(esbuild@0.19.8)(rollup@4.1.4): resolution: {integrity: sha512-HPpXU65V8bSpW8eSYPahtUJaJHmbxJGybuf/M8B3bz/6i11YaYHlNNJIQ38gSEV0FyohQOgVxJ2YMEEZtEmwvA==} engines: {node: '>=14.18.0'} peerDependencies: @@ -29786,7 +31849,7 @@ packages: '@rollup/pluginutils': 5.0.5(rollup@4.1.4) debug: 4.3.4(supports-color@8.1.1) es-module-lexer: 1.3.1 - esbuild: 0.19.5 + esbuild: 0.19.8 get-tsconfig: 4.7.2 rollup: 4.1.4 transitivePeerDependencies: @@ -29850,6 +31913,26 @@ packages: fsevents: 2.3.3 dev: true + /rollup@4.6.1: + resolution: {integrity: sha512-jZHaZotEHQaHLgKr8JnQiDT1rmatjgKlMekyksz+yk9jt/8z9quNjnKNRoaM0wd9DC2QKXjmWWuDYtM3jfF8pQ==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.6.1 + '@rollup/rollup-android-arm64': 4.6.1 + '@rollup/rollup-darwin-arm64': 4.6.1 + '@rollup/rollup-darwin-x64': 4.6.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.6.1 + '@rollup/rollup-linux-arm64-gnu': 4.6.1 + '@rollup/rollup-linux-arm64-musl': 4.6.1 + '@rollup/rollup-linux-x64-gnu': 4.6.1 + '@rollup/rollup-linux-x64-musl': 4.6.1 + '@rollup/rollup-win32-arm64-msvc': 4.6.1 + '@rollup/rollup-win32-ia32-msvc': 4.6.1 + '@rollup/rollup-win32-x64-msvc': 4.6.1 + fsevents: 2.3.3 + dev: true + /rpc-websockets@7.6.1: resolution: {integrity: sha512-MmRGaJJvxTHSRxYPjJJqcj2zWnCetw7YbYbKlD0Yc7qVw6PsZhRJg1MI3mpWlpBs+4zO+urlNfLl9zLsdOD/gA==} dependencies: @@ -29868,8 +31951,8 @@ packages: '@babel/runtime': 7.23.2 dev: false - /rtl-detect@1.0.4: - resolution: {integrity: sha512-EBR4I2VDSSYr7PkBmFy04uhycIpDKp+21p/jARYXlCSjQksTBQcJ0HFUPOO79EPPH5JS6VAhiIQbycf0O3JAxQ==} + /rtl-detect@1.1.2: + resolution: {integrity: sha512-PGMBq03+TTG/p/cRB7HCLKJ1MgDIi07+QU1faSjiYRfmY5UsAttV9Hs08jDAHVwcOwmVLcSJkpwyfXszVjWfIQ==} dev: false /rtlcss@3.5.0: @@ -30009,6 +32092,7 @@ packages: resolution: {integrity: sha512-ABvovCDe/k9IluqSh4/ISoq8tIJnW8euVAWYt5j/bg6dRnqwQwiGO1F/V4AyK96NGF/FB04FhOUDuWj8IKfABA==} dependencies: loose-envify: 1.4.0 + dev: false /schema-utils@2.7.0: resolution: {integrity: sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==} @@ -30076,6 +32160,7 @@ packages: /seedrandom@3.0.5: resolution: {integrity: sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==} + dev: false /seek-bzip@1.0.6: resolution: {integrity: sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==} @@ -30093,11 +32178,6 @@ packages: dependencies: node-forge: 1.3.1 - /semaphore-async-await@1.5.1: - resolution: {integrity: sha512-b/ptP11hETwYWpeilHXXQiV5UJNJl7ZWWooKRE5eBIYWoom6dZ0SluCIdCtKycsMtZgKWE01/qAw6jblw1YVhg==} - engines: {node: '>=4.1'} - dev: true - /semiver@1.1.0: resolution: {integrity: sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg==} engines: {node: '>=6'} @@ -30167,10 +32247,12 @@ packages: no-case: 3.0.4 tslib: 2.6.2 upper-case-first: 2.0.2 + dev: false /serialize-error@2.1.0: resolution: {integrity: sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==} engines: {node: '>=0.10.0'} + dev: false /serialize-javascript@6.0.0: resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} @@ -30244,6 +32326,19 @@ packages: resolution: {integrity: sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==} dev: false + /servify@0.1.12: + resolution: {integrity: sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==} + engines: {node: '>=6'} + dependencies: + body-parser: 1.20.1 + cors: 2.8.5 + express: 4.18.2 + request: 2.88.2 + xhr: 2.6.0 + transitivePeerDependencies: + - supports-color + dev: true + /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} @@ -30370,13 +32465,35 @@ packages: /signedsource@1.0.0: resolution: {integrity: sha512-6+eerH9fEnNmi/hyM1DXcRK3pWdoMQtlkQ+ns0ntzunjKqp5i3sKCc80ym8Fib3iaYhdJUOPdhlJWj1tvge2Ww==} + dev: false + + /simple-concat@1.0.1: + resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} + dev: true + + /simple-get@2.8.2: + resolution: {integrity: sha512-Ijd/rV5o+mSBBs4F/x9oDPtTx9Zb6X9brmnXvMW4J7IR15ngi9q5xxqWBKU744jTZiaXtxaPL7uHG6vtN8kUkw==} + dependencies: + decompress-response: 3.3.0 + once: 1.4.0 + simple-concat: 1.0.1 + dev: true + + /sinon-chai@3.7.0(chai@4.3.10)(sinon@17.0.1): + resolution: {integrity: sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g==} + peerDependencies: + chai: ^4.0.0 + sinon: '>=4.0.0' + dependencies: + chai: 4.3.10 + sinon: 17.0.1 + dev: true - /sinon@15.2.0: - resolution: {integrity: sha512-nPS85arNqwBXaIsFCkolHjGIkFo+Oxu9vbgmBJizLAhqe6P2o3Qmj3KCUoRkfhHtvgDhZdWD3risLHAUJ8npjw==} - deprecated: 16.1.1 + /sinon@17.0.1: + resolution: {integrity: sha512-wmwE19Lie0MLT+ZYNpDymasPHUKTaZHUH/pKEubRXIzySv9Atnlw+BUMGCzWgV7b7wO+Hw6f1TEOr0IUnmU8/g==} dependencies: '@sinonjs/commons': 3.0.0 - '@sinonjs/fake-timers': 10.3.0 + '@sinonjs/fake-timers': 11.2.2 '@sinonjs/samsam': 8.0.0 diff: 5.1.0 nise: 5.1.5 @@ -30422,6 +32539,7 @@ packages: ansi-styles: 3.2.1 astral-regex: 1.0.0 is-fullwidth-code-point: 2.0.0 + dev: false /slice-ansi@3.0.0: resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==} @@ -30454,6 +32572,7 @@ packages: dependencies: dot-case: 3.0.4 tslib: 2.6.2 + dev: false /socket.io-client@4.7.2: resolution: {integrity: sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w==} @@ -30486,17 +32605,6 @@ packages: uuid: 8.3.2 websocket-driver: 0.7.4 - /solc@0.4.26: - resolution: {integrity: sha512-o+c6FpkiHd+HPjmjEVpQgH7fqZ14tJpXhho+/bQXlXbliLIS/xjXb42Vxh+qQY1WCSTMQ0+a5vR9vi0MfhU6mA==} - hasBin: true - dependencies: - fs-extra: 0.30.0 - memorystream: 0.3.1 - require-from-string: 1.2.1 - semver: 5.7.2 - yargs: 4.8.1 - dev: true - /solc@0.7.3(debug@4.3.4): resolution: {integrity: sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==} engines: {node: '>=8.0.0'} @@ -30514,22 +32622,6 @@ packages: transitivePeerDependencies: - debug - /solc@0.8.15: - resolution: {integrity: sha512-Riv0GNHNk/SddN/JyEuFKwbcWcEeho15iyupTSHw5Np6WuXA5D8kEHbyzDHi6sqmvLzu2l+8b1YmL8Ytple+8w==} - engines: {node: '>=10.0.0'} - hasBin: true - dependencies: - command-exists: 1.2.9 - commander: 8.3.0 - follow-redirects: 1.15.3(debug@4.3.4) - js-sha3: 0.8.0 - memorystream: 0.3.1 - semver: 5.7.2 - tmp: 0.0.33 - transitivePeerDependencies: - - debug - dev: true - /solhint-plugin-prettier@0.0.5(prettier-plugin-solidity@1.1.3)(prettier@2.8.8): resolution: {integrity: sha512-7jmWcnVshIrO2FFinIvDQmhQpfpS2rRRn3RejiYgnjIE68xO2bvrYvjqVNfrio4xH9ghOqn83tKuTzLjEbmGIA==} peerDependencies: @@ -30578,7 +32670,7 @@ packages: resolution: {integrity: sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw==} dev: true - /solidity-coverage@0.8.5(hardhat@2.13.1): + /solidity-coverage@0.8.5(hardhat@2.18.3): resolution: {integrity: sha512-6C6N6OV2O8FQA0FWA95FdzVH+L16HU94iFgg5wAFZ29UpLFkgNI/DRR2HotG1bC0F4gAc/OMs2BJI44Q/DYlKQ==} hasBin: true peerDependencies: @@ -30594,7 +32686,7 @@ packages: ghost-testrpc: 0.0.2 global-modules: 2.0.0 globby: 10.0.2 - hardhat: 2.13.1(ts-node@10.9.1)(typescript@4.9.5) + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) jsonschema: 1.4.1 lodash: 4.17.21 mocha: 10.2.0 @@ -30609,6 +32701,10 @@ packages: - supports-color dev: true + /solmate@6.2.0: + resolution: {integrity: sha512-AM38ioQ2P8zRsA42zenb9or6OybRjOLXIu3lhIT8rhddUuduCt76pUEuLxOIg9GByGojGz+EbpFdCB6B+QZVVA==} + dev: true + /sonic-boom@2.8.0: resolution: {integrity: sha512-kuonw1YOYYNOve5iHdSahXPOK49GqwA+LZhI6Wz/l0rP57iKyXXIHaRagOBHAPmGwJC6od2Z9zgvZ5loSgMlVg==} dependencies: @@ -30657,6 +32753,7 @@ packages: dependencies: buffer-from: 1.1.2 source-map: 0.6.1 + dev: true /source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} @@ -30794,6 +32891,7 @@ packages: resolution: {integrity: sha512-dblb9Et4DAtiZ5YSUZHLl4XhH4uK80GhAZrVXdN4O2P4gQ40Wa5UIOPUHlA/nFd2PLblBZWUioLMMAVrgpoYcA==} dependencies: tslib: 2.6.2 + dev: false /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} @@ -30850,6 +32948,7 @@ packages: /stackframe@1.3.4: resolution: {integrity: sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==} + dev: false /stacktrace-gps@3.1.2: resolution: {integrity: sha512-GcUgbO4Jsqqg6RxfyTHFiPxdPqF+3LFmQhm7MgCuYQOYuWyqxo5pwRPz5d/u6/WYJdEnWfK4r+jGbyD8TSggXQ==} @@ -30887,6 +32986,10 @@ packages: /std-env@3.4.3: resolution: {integrity: sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==} + /std-env@3.6.0: + resolution: {integrity: sha512-aFZ19IgVmhdB2uX599ve2kE6BIE3YMnQ6Gp6BURhW/oIzpXGKr878TQfAQZn1+i0Flcc/UKUy1gOlcfaUBCryg==} + dev: true + /stop-iteration-iterator@1.0.0: resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} engines: {node: '>= 0.4'} @@ -30919,16 +33022,6 @@ packages: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} - /strict-event-emitter@0.2.8: - resolution: {integrity: sha512-KDf/ujU8Zud3YaLtMCcTI4xkZlZVIYxTLr+XIULexP+77EEVWixeXroLUXQXiVtH4XH2W7jr/3PT1v3zBuvc3A==} - dependencies: - events: 3.3.0 - dev: true - - /strict-event-emitter@0.4.6: - resolution: {integrity: sha512-12KWeb+wixJohmnwNFerbyiBrAlq5qJLwIt38etRtKtmmHyDSoGlIqFE9wx+4IwG0aDjI7GV8tc8ZccjWZZtTg==} - dev: true - /strict-uri-encode@1.1.0: resolution: {integrity: sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==} engines: {node: '>=0.10.0'} @@ -30946,6 +33039,7 @@ packages: /string-format@2.0.0: resolution: {integrity: sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==} + dev: true /string-length@4.0.2: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} @@ -30953,21 +33047,13 @@ packages: dependencies: char-regex: 1.0.2 strip-ansi: 6.0.1 + dev: true /string-similarity@4.0.4: resolution: {integrity: sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ==} deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dev: false - /string-width@1.0.2: - resolution: {integrity: sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==} - engines: {node: '>=0.10.0'} - dependencies: - code-point-at: 1.1.0 - is-fullwidth-code-point: 1.0.0 - strip-ansi: 3.0.1 - dev: true - /string-width@2.1.1: resolution: {integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==} engines: {node: '>=4'} @@ -31091,13 +33177,6 @@ packages: engines: {node: '>=0.10.0'} dev: false - /strip-bom@2.0.0: - resolution: {integrity: sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==} - engines: {node: '>=0.10.0'} - dependencies: - is-utf8: 0.2.1 - dev: true - /strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} @@ -31105,6 +33184,7 @@ packages: /strip-bom@4.0.0: resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} engines: {node: '>=8'} + dev: true /strip-dirs@2.1.0: resolution: {integrity: sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==} @@ -31156,6 +33236,7 @@ packages: /strnum@1.0.5: resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} + dev: false /style-to-object@0.3.0: resolution: {integrity: sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==} @@ -31169,7 +33250,7 @@ packages: inline-style-parser: 0.1.1 dev: false - /styled-jsx@5.1.1(@babel/core@7.23.2)(react@18.2.0): + /styled-jsx@5.1.1(@babel/core@7.23.5)(react@18.2.0): resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} engines: {node: '>= 12.0.0'} peerDependencies: @@ -31182,7 +33263,7 @@ packages: babel-plugin-macros: optional: true dependencies: - '@babel/core': 7.23.2 + '@babel/core': 7.23.5 client-only: 0.0.1 react: 18.2.0 dev: false @@ -31208,6 +33289,7 @@ packages: /sudo-prompt@9.2.1: resolution: {integrity: sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw==} + dev: false /superjson@1.13.3: resolution: {integrity: sha512-mJiVjfd2vokfDxsQPOwJ/PtanO87LhpYY88ubI5dUB1Ab58Txbyje3+jpm+/83R/fevaq/107NNhtYBLuoTrFg==} @@ -31284,6 +33366,27 @@ packages: resolution: {integrity: sha512-kc6S2YS/2yXbtkSMunBtKdah4VFETZ8Oh6ONSmSd9bRxhqTrtARUCBUiWXH3xVPpvR7tz2CSnkuXVE42EcGnMw==} dependencies: tslib: 2.6.2 + dev: false + + /swarm-js@0.1.42: + resolution: {integrity: sha512-BV7c/dVlA3R6ya1lMlSSNPLYrntt0LUq4YMgy3iwpCIc6rZnS5W2wUoctarZ5pXlpKtxDDf9hNziEkcfrxdhqQ==} + dependencies: + bluebird: 3.7.2 + buffer: 5.7.1 + eth-lib: 0.1.29 + fs-extra: 4.0.3 + got: 11.8.6 + mime-types: 2.1.35 + mkdirp-promise: 5.0.1 + mock-fs: 4.14.0 + setimmediate: 1.0.5 + tar: 4.4.19 + xhr-request: 1.1.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true /swr@1.3.0(react@18.2.0): resolution: {integrity: sha512-dkghQrOl2ORX9HYrMDtPa7LTVHJjCTeZoB1dqTbnnEDlSvN8JEKpYIYurDfvbQFUUS8Cg8PceFVZNkW0KNNYPw==} @@ -31296,6 +33399,7 @@ packages: /symbol-observable@4.0.0: resolution: {integrity: sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==} engines: {node: '>=0.10'} + requiresBuild: true dev: false /symbol-tree@3.2.4: @@ -31325,6 +33429,7 @@ packages: deep-extend: 0.6.0 typical: 5.2.0 wordwrapjs: 4.0.1 + dev: true /table@6.8.1: resolution: {integrity: sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==} @@ -31367,6 +33472,19 @@ packages: xtend: 4.0.2 dev: true + /tar@4.4.19: + resolution: {integrity: sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==} + engines: {node: '>=4.5'} + dependencies: + chownr: 1.1.4 + fs-minipass: 1.2.7 + minipass: 2.9.0 + minizlib: 1.3.3 + mkdirp: 0.5.6 + safe-buffer: 5.2.1 + yallist: 3.1.1 + dev: true + /tar@6.2.0: resolution: {integrity: sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==} engines: {node: '>=10'} @@ -31384,6 +33502,7 @@ packages: engines: {node: '>=6.0.0'} dependencies: rimraf: 2.6.3 + dev: false /terser-webpack-plugin@5.3.9(webpack@5.89.0): resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} @@ -31436,10 +33555,6 @@ packages: '@istanbuljs/schema': 0.1.3 glob: 7.2.3 minimatch: 3.1.2 - - /testrpc@0.0.1: - resolution: {integrity: sha512-afH1hO+SQ/VPlmaLUFj2636QMeDvPCeQMc/9RBMW0IfjNe9gFD9Ra3ShqYkB7py0do1ZcCna/9acHyzTJ+GcNA==} - deprecated: testrpc has been renamed to ganache-cli, please use this package from now on. dev: true /text-encoding-utf-8@1.0.2: @@ -31498,6 +33613,7 @@ packages: /throat@5.0.0: resolution: {integrity: sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==} + dev: false /throttle-debounce@3.0.1: resolution: {integrity: sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg==} @@ -31517,6 +33633,7 @@ packages: dependencies: readable-stream: 2.3.8 xtend: 4.0.2 + dev: false /through2@4.0.2: resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==} @@ -31575,10 +33692,12 @@ packages: /tiny-lru@11.2.3: resolution: {integrity: sha512-mF9jPTrvN7UHk0bekOk3RlFdFwfyS4CJYVsGc7nInL3pVgUCYj5r9X6GpZBFQgLr0TKJo8Dp+F3oRvYzxU9xiA==} engines: {node: '>=12'} + dev: false /tiny-lru@8.0.2: resolution: {integrity: sha512-ApGvZ6vVvTNdsmt676grvCkUCGwzG9IqXma5Z07xJgiC5L7akUMof5U8G2JTI9Rz/ovtVhJBlY6mNhEvtjzOIg==} engines: {node: '>=6'} + dev: false /tiny-warning@1.0.3: resolution: {integrity: sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==} @@ -31593,15 +33712,26 @@ packages: engines: {node: '>=14.0.0'} dev: true + /tinypool@0.8.1: + resolution: {integrity: sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg==} + engines: {node: '>=14.0.0'} + dev: true + /tinyspy@1.1.1: resolution: {integrity: sha512-UVq5AXt/gQlti7oxoIg5oi/9r0WpF7DGEVwXgqWSMmyN16+e3tl5lIvTaOpJ3TAtu5xFzWccFRM4R5NaWHF+4g==} engines: {node: '>=14.0.0'} dev: true + /tinyspy@2.2.0: + resolution: {integrity: sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==} + engines: {node: '>=14.0.0'} + dev: true + /title-case@3.0.3: resolution: {integrity: sha512-e1zGYRvbffpcHIrnuqT0Dh+gEJtDaxDSoG4JAIpq4oDFyooziLBIiYQv0GBT4FUAnUop5uZ1hiIAj7oAF6sOCA==} dependencies: tslib: 2.6.2 + dev: false /tmp-promise@3.0.3: resolution: {integrity: sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==} @@ -31734,6 +33864,7 @@ packages: /ts-algebra@1.2.2: resolution: {integrity: sha512-kloPhf1hq3JbCPOTYoOWDKxebWjNb2o/LKnNfkWhxVVisFFmMJPPdJeGoGmM+iRLyoXAR61e08Pb+vUXINg8aA==} + dev: false /ts-command-line-args@2.5.1: resolution: {integrity: sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==} @@ -31743,6 +33874,7 @@ packages: command-line-args: 5.2.1 command-line-usage: 6.1.3 string-format: 2.0.0 + dev: true /ts-dedent@2.2.0: resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==} @@ -31759,14 +33891,7 @@ packages: typescript: '>=3.7.0' dependencies: typescript: 4.9.5 - - /ts-essentials@7.0.3(typescript@5.1.6): - resolution: {integrity: sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==} - peerDependencies: - typescript: '>=3.7.0' - dependencies: - typescript: 5.1.6 - dev: false + dev: true /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} @@ -31775,52 +33900,11 @@ packages: /ts-invariant@0.10.3: resolution: {integrity: sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==} engines: {node: '>=8'} + requiresBuild: true dependencies: tslib: 2.6.2 dev: false - /ts-jest-resolver@2.0.1: - resolution: {integrity: sha512-FolE73BqVZCs8/RbLKxC67iaAtKpBWx7PeLKFW2zJQlOf9j851I7JRxSDenri2NFvVH3QP7v3S8q1AmL24Zb9Q==} - dependencies: - jest-resolve: 29.7.0 - dev: true - - /ts-jest@29.1.1(@babel/core@7.23.2)(babel-jest@29.7.0)(esbuild@0.17.19)(jest@29.7.0)(typescript@4.9.5): - resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - '@babel/core': '>=7.0.0-beta.0 <8' - '@jest/types': ^29.0.0 - babel-jest: ^29.0.0 - esbuild: '*' - jest: ^29.0.0 - typescript: '>=4.3 <6' - peerDependenciesMeta: - '@babel/core': - optional: true - '@jest/types': - optional: true - babel-jest: - optional: true - esbuild: - optional: true - dependencies: - '@babel/core': 7.23.2 - babel-jest: 29.7.0(@babel/core@7.23.2) - bs-logger: 0.2.6 - esbuild: 0.17.19 - fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@18.18.6)(ts-node@10.9.1) - jest-util: 29.7.0 - json5: 2.2.3 - lodash.memoize: 4.1.2 - make-error: 1.3.6 - semver: 7.5.4 - typescript: 4.9.5 - yargs-parser: 21.1.1 - dev: true - /ts-loader@9.5.0(typescript@4.9.5)(webpack@5.89.0): resolution: {integrity: sha512-LLlB/pkB4q9mW2yLdFMnK3dEHbrBjeZTYguaaIfusyojBgAGf5kF+O6KcWqiGzWqHk0LBsoolrp4VftEURhybg==} engines: {node: '>=12.0.0'} @@ -31837,20 +33921,7 @@ packages: webpack: 5.89.0(webpack-cli@5.1.4) dev: true - /ts-mocha@10.0.0(mocha@10.2.0): - resolution: {integrity: sha512-VRfgDO+iiuJFlNB18tzOfypJ21xn2xbuZyDvJvqpTbWgkAgD17ONGr8t+Tl8rcBtOBdjXp5e/Rk+d39f7XBHRw==} - engines: {node: '>= 6.X.X'} - hasBin: true - peerDependencies: - mocha: ^3.X.X || ^4.X.X || ^5.X.X || ^6.X.X || ^7.X.X || ^8.X.X || ^9.X.X || ^10.X.X - dependencies: - mocha: 10.2.0 - ts-node: 7.0.1 - optionalDependencies: - tsconfig-paths: 3.14.2 - dev: true - - /ts-node@10.9.1(@types/node@18.18.6)(typescript@4.9.5): + /ts-node@10.9.1(@types/node@18.18.7)(typescript@4.9.5): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -31869,7 +33940,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 18.18.6 + '@types/node': 18.18.7 acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 @@ -31880,7 +33951,7 @@ packages: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 - /ts-node@10.9.1(@types/node@18.18.6)(typescript@5.1.6): + /ts-node@10.9.1(@types/node@18.18.7)(typescript@5.3.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -31899,49 +33970,17 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 18.18.6 + '@types/node': 18.18.7 acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.1.6 + typescript: 5.3.2 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 - /ts-node@10.9.1(@types/node@18.18.6)(typescript@5.2.2): - resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} - hasBin: true - peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' - peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': - optional: true - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.9 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 18.18.6 - acorn: 8.10.0 - acorn-walk: 8.2.0 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.2.2 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - dev: true - optional: true - /ts-node@10.9.1(@types/node@20.5.1)(typescript@4.9.5): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -31973,23 +34012,9 @@ packages: yn: 3.1.1 dev: true - /ts-node@7.0.1: - resolution: {integrity: sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==} - engines: {node: '>=4.2.0'} - hasBin: true - dependencies: - arrify: 1.0.1 - buffer-from: 1.1.2 - diff: 3.5.0 - make-error: 1.3.6 - minimist: 1.2.8 - mkdirp: 0.5.6 - source-map-support: 0.5.21 - yn: 2.0.0 - dev: true - /tsconfig-paths@3.14.2: resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==} + requiresBuild: true dependencies: '@types/json5': 0.0.29 json5: 1.0.2 @@ -32004,18 +34029,25 @@ packages: json5: 2.2.3 minimist: 1.2.8 strip-bom: 3.0.0 + dev: false /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + /tslib@2.4.0: + resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} + /tslib@2.4.1: resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} + dev: false /tslib@2.5.3: resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==} + dev: false /tslib@2.6.0: resolution: {integrity: sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==} + dev: false /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} @@ -32142,7 +34174,6 @@ packages: engines: {node: '>= 0.8.0'} dependencies: prelude-ls: 1.2.1 - dev: true /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} @@ -32180,6 +34211,7 @@ packages: /type-fest@2.19.0: resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} engines: {node: '>=12.20'} + dev: false /type-is@1.6.18: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} @@ -32213,27 +34245,7 @@ packages: typescript: 4.9.5 transitivePeerDependencies: - supports-color - - /typechain@8.3.2(typescript@5.1.6): - resolution: {integrity: sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==} - hasBin: true - peerDependencies: - typescript: '>=4.3.0' - dependencies: - '@types/prettier': 2.7.3 - debug: 4.3.4(supports-color@8.1.1) - fs-extra: 7.0.1 - glob: 7.1.7 - js-sha3: 0.8.0 - lodash: 4.17.21 - mkdirp: 1.0.4 - prettier: 2.8.8 - ts-command-line-args: 2.5.1 - ts-essentials: 7.0.3(typescript@5.1.6) - typescript: 5.1.6 - transitivePeerDependencies: - - supports-color - dev: false + dev: true /typed-array-buffer@1.0.0: resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} @@ -32282,35 +34294,35 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typedoc-plugin-markdown@3.16.0(typedoc@0.23.28): - resolution: {integrity: sha512-eeiC78fDNGFwemPIHiwRC+mEC7W5jwt3fceUev2gJ2nFnXpVHo8eRrpC9BLWZDee6ehnz/sPmNjizbXwpfaTBw==} + /typedoc-plugin-markdown@3.17.1(typedoc@0.25.4): + resolution: {integrity: sha512-QzdU3fj0Kzw2XSdoL15ExLASt2WPqD7FbLeaqwT70+XjKyTshBnUlQA5nNREO1C2P8Uen0CDjsBLMsCQ+zd0lw==} peerDependencies: typedoc: '>=0.24.0' dependencies: handlebars: 4.7.8 - typedoc: 0.23.28(typescript@4.9.5) + typedoc: 0.25.4(typescript@5.3.2) dev: true - /typedoc-plugin-missing-exports@2.1.0(typedoc@0.23.28): + /typedoc-plugin-missing-exports@2.1.0(typedoc@0.25.4): resolution: {integrity: sha512-+1DhqZCEu7Vu5APnrqpPwl31D+hXpt1fV0Le9ycCRL1eLVdatdl6KVt4SEVwPxnEpKwgOn2dNX6I9+0F1aO2aA==} peerDependencies: typedoc: 0.24.x || 0.25.x dependencies: - typedoc: 0.23.28(typescript@4.9.5) + typedoc: 0.25.4(typescript@5.3.2) dev: true - /typedoc@0.23.28(typescript@4.9.5): - resolution: {integrity: sha512-9x1+hZWTHEQcGoP7qFmlo4unUoVJLB0H/8vfO/7wqTnZxg4kPuji9y3uRzEu0ZKez63OJAUmiGhUrtukC6Uj3w==} - engines: {node: '>= 14.14'} + /typedoc@0.25.4(typescript@5.3.2): + resolution: {integrity: sha512-Du9ImmpBCw54bX275yJrxPVnjdIyJO/84co0/L9mwe0R3G4FSR6rQ09AlXVRvZEGMUg09+z/usc8mgygQ1aidA==} + engines: {node: '>= 16'} hasBin: true peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x dependencies: lunr: 2.3.9 marked: 4.3.0 - minimatch: 7.4.6 + minimatch: 9.0.3 shiki: 0.14.5 - typescript: 4.9.5 + typescript: 5.3.2 dev: true /typescript@4.9.5: @@ -32323,24 +34335,24 @@ packages: engines: {node: '>=14.17'} hasBin: true - /typescript@5.2.2: - resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} + /typescript@5.3.2: + resolution: {integrity: sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==} engines: {node: '>=14.17'} hasBin: true - requiresBuild: true - dev: true - optional: true /typical@4.0.0: resolution: {integrity: sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==} engines: {node: '>=8'} + dev: true /typical@5.2.0: resolution: {integrity: sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==} engines: {node: '>=8'} + dev: true /ua-parser-js@1.0.36: resolution: {integrity: sha512-znuyCIXzl8ciS3+y3fHJI/2OhQIXbXw9MWC/o3qwyR+RGppjZHrM27CGFSKCJXi2Kctiz537iOu2KnXs1lMQhw==} + dev: false /ufo@1.3.1: resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} @@ -32354,6 +34366,7 @@ packages: dependencies: commander: 2.13.0 source-map: 0.6.1 + dev: false /uglify-js@3.17.4: resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} @@ -32394,9 +34407,13 @@ packages: /uint8arrays@4.0.6: resolution: {integrity: sha512-4ZesjQhqOU2Ip6GPReIwN60wRxIupavL8T0Iy36BBHr2qyMrNxsPJvr7vpS4eFt8F8kSguWUPad6ZM9izs/vyw==} dependencies: - multiformats: 12.1.2 + multiformats: 12.1.3 dev: false + /ultron@1.1.1: + resolution: {integrity: sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==} + dev: true + /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: @@ -32416,11 +34433,15 @@ packages: /unc-path-regex@0.1.2: resolution: {integrity: sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==} engines: {node: '>=0.10.0'} + dev: false /underscore@1.13.6: resolution: {integrity: sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==} dev: true + /undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + /undici@5.26.5: resolution: {integrity: sha512-cSb4bPFd5qgR7qr2jYAi0hlX9n5YKK2ONKkLFkxl+v/9BvC0sOpZjBHDBSXc5lWAf5ty9oZdRXytBIHzgUcerw==} engines: {node: '>=14.0'} @@ -32608,6 +34629,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: normalize-path: 2.1.1 + dev: false /unpipe@1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} @@ -32659,11 +34681,13 @@ packages: resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==} dependencies: tslib: 2.6.2 + dev: false /upper-case@2.0.2: resolution: {integrity: sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==} dependencies: tslib: 2.6.2 + dev: false /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -32700,18 +34724,15 @@ packages: requires-port: 1.0.0 dev: true + /url-set-query@1.0.0: + resolution: {integrity: sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg==} + dev: true + /url-to-options@1.0.1: resolution: {integrity: sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A==} engines: {node: '>= 4'} dev: true - /url@0.11.3: - resolution: {integrity: sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==} - dependencies: - punycode: 1.4.1 - qs: 6.11.2 - dev: true - /urlpattern-polyfill@4.0.3: resolution: {integrity: sha512-DOE84vZT2fEcl9gqCUTcnAw5ZY5Id55ikUcziSUntuEFL3pRvavg5kwDmTEUJkeCHInTlV/HexFomgYnzO5kdQ==} dev: true @@ -32721,8 +34742,9 @@ packages: /urlpattern-polyfill@9.0.0: resolution: {integrity: sha512-WHN8KDQblxd32odxeIgo83rdVDE2bvdkb86it7bMhYZwWKJz0+O0RK/eZiHYnM+zgt/U7hAHOlCQGfjjvSkw2g==} + dev: false - /use-callback-ref@1.3.0(@types/react@18.2.31)(react@18.2.0): + /use-callback-ref@1.3.0(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w==} engines: {node: '>=10'} peerDependencies: @@ -32732,7 +34754,7 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.31 + '@types/react': 18.2.33 react: 18.2.0 tslib: 2.6.2 dev: false @@ -32770,7 +34792,7 @@ packages: use-isomorphic-layout-effect: 1.1.2(react@18.2.0) dev: false - /use-sidecar@1.1.2(@types/react@18.2.31)(react@18.2.0): + /use-sidecar@1.1.2(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==} engines: {node: '>=10'} peerDependencies: @@ -32780,7 +34802,7 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.31 + '@types/react': 18.2.33 detect-node-es: 1.1.0 react: 18.2.0 tslib: 2.6.2 @@ -32792,6 +34814,7 @@ packages: react: ^16.8.0 || ^17.0.0 || ^18.0.0 dependencies: react: 18.2.0 + dev: false /user-home@2.0.0: resolution: {integrity: sha512-KMWqdlOcjCYdtIJpicDSFBQ8nFwS2i9sslAd6f4+CBGcU4gist2REnr2fxj2YocvJFxSF3ZOHLYLVZnUxv4BZQ==} @@ -32807,15 +34830,6 @@ packages: dependencies: node-gyp-build: 4.6.1 - /utf-8-validate@5.0.7: - resolution: {integrity: sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q==} - engines: {node: '>=6.14.2'} - requiresBuild: true - dependencies: - node-gyp-build: 4.6.1 - dev: true - optional: true - /utf8-byte-length@1.0.4: resolution: {integrity: sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==} dev: false @@ -32872,7 +34886,6 @@ packages: /uuid@9.0.1: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true - dev: false /uvu@0.5.6: resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==} @@ -32899,6 +34912,7 @@ packages: '@jridgewell/trace-mapping': 0.3.20 '@types/istanbul-lib-coverage': 2.0.5 convert-source-map: 2.0.0 + dev: true /validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} @@ -32913,8 +34927,8 @@ packages: builtins: 5.0.1 dev: true - /valtio@1.10.6(react@18.2.0): - resolution: {integrity: sha512-SxN1bHUmdhW6V8qsQTpCgJEwp7uHbntuH0S9cdLQtiohuevwBksbpXjwj5uDMA7bLwg1WKyq9sEpZrx3TIMrkA==} + /valtio@1.11.0(react@18.2.0): + resolution: {integrity: sha512-65Yd0yU5qs86b5lN1eu/nzcTgQ9/6YnD6iO+DDaDbQLn1Zv2w12Gwk43WkPlUBxk5wL/6cD5YMFf7kj6HZ1Kpg==} engines: {node: '>=12.20.0'} peerDependencies: react: '>=16.8' @@ -32927,6 +34941,24 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false + /valtio@1.11.2(@types/react@18.2.33)(react@18.2.0): + resolution: {integrity: sha512-1XfIxnUXzyswPAPXo1P3Pdx2mq/pIqZICkWN60Hby0d9Iqb+MEIpqgYVlbflvHdrp2YR/q3jyKWRPJJ100yxaw==} + engines: {node: '>=12.20.0'} + peerDependencies: + '@types/react': '>=16.8' + react: '>=16.8' + peerDependenciesMeta: + '@types/react': + optional: true + react: + optional: true + dependencies: + '@types/react': 18.2.33 + proxy-compare: 2.5.1 + react: 18.2.0 + use-sync-external-store: 1.2.0(react@18.2.0) + dev: false + /value-equal@1.0.1: resolution: {integrity: sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==} dev: false @@ -32934,6 +34966,7 @@ packages: /value-or-promise@1.0.12: resolution: {integrity: sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==} engines: {node: '>=12'} + dev: false /varint-decoder@1.0.0: resolution: {integrity: sha512-JkOvdztASWGUAsXshCFHrB9f6AgR2Q8W08CEyJ+43b1qtFocmI8Sp1R/M0E/hDOY2FzVIqk63tOYLgDYWuJ7IQ==} @@ -32944,7 +34977,6 @@ packages: /varint@5.0.2: resolution: {integrity: sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==} - dev: false /varint@6.0.0: resolution: {integrity: sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==} @@ -32998,7 +35030,7 @@ packages: vfile-message: 3.1.4 dev: false - /viem@0.3.50(typescript@5.1.6): + /viem@0.3.50(typescript@5.3.2): resolution: {integrity: sha512-s+LxCYZTR9F/qPk1/n1YDVAX9vSeVz7GraqBZWGrDuenCJxo9ArCoIceJ6ksI0WwSeNzcZ0VVbD/kWRzTxkipw==} dependencies: '@adraffy/ens-normalize': 1.9.0 @@ -33006,8 +35038,8 @@ packages: '@noble/hashes': 1.3.0 '@scure/bip32': 1.3.0 '@scure/bip39': 1.2.0 - '@wagmi/chains': 1.0.0(typescript@5.1.6) - abitype: 0.8.7(typescript@5.1.6)(zod@3.22.4) + '@wagmi/chains': 1.0.0(typescript@5.3.2) + abitype: 0.8.7(typescript@5.3.2) isomorphic-ws: 5.0.0(ws@8.12.0) ws: 8.12.0 transitivePeerDependencies: @@ -33017,32 +35049,76 @@ packages: - zod dev: true - /viem@1.5.3(typescript@5.1.6)(zod@3.22.4): - resolution: {integrity: sha512-oImpSDDvm8Y72qxXV0pCAGAqQLYgo8YENdz9EKS8ExnnOJLascpex4LNazNyp9cksjm3ORpVpbqGMr9Cy1z2mg==} + /viem@1.18.9(typescript@4.9.5): + resolution: {integrity: sha512-eAXtoTwAFA3YEgjTYMb5ZTQrDC0UPx5qyZ4sv90TirVKepcM9mBPksTkC1SSWya0UdxhBmhEBL/CiYMjmGCTWg==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: typescript: optional: true dependencies: - '@adraffy/ens-normalize': 1.9.0 - '@noble/curves': 1.0.0 - '@noble/hashes': 1.3.0 - '@scure/bip32': 1.3.0 - '@scure/bip39': 1.2.0 - '@types/ws': 8.5.8 - '@wagmi/chains': 1.6.0(typescript@5.1.6) - abitype: 0.9.3(typescript@5.1.6)(zod@3.22.4) - isomorphic-ws: 5.0.0(ws@8.12.0) + '@adraffy/ens-normalize': 1.9.4 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@scure/bip32': 1.3.2 + '@scure/bip39': 1.2.1 + abitype: 0.9.8(typescript@4.9.5) + isows: 1.0.3(ws@8.13.0) + typescript: 4.9.5 + ws: 8.13.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + dev: true + + /viem@1.19.9(typescript@5.1.6)(zod@3.22.4): + resolution: {integrity: sha512-Sf9U2x4jU0S/FALqYypcspWOGene0NZyD470oUripNhE0Ta6uOE/OgE4toTDVfRxov8qw0JFinr/wPGxYE3+HQ==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@adraffy/ens-normalize': 1.10.0 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@scure/bip32': 1.3.2 + '@scure/bip39': 1.2.1 + abitype: 0.9.8(typescript@5.1.6)(zod@3.22.4) + isows: 1.0.3(ws@8.13.0) typescript: 5.1.6 - ws: 8.12.0 + ws: 8.13.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + dev: false + + /viem@1.19.9(typescript@5.3.2)(zod@3.22.4): + resolution: {integrity: sha512-Sf9U2x4jU0S/FALqYypcspWOGene0NZyD470oUripNhE0Ta6uOE/OgE4toTDVfRxov8qw0JFinr/wPGxYE3+HQ==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@adraffy/ens-normalize': 1.10.0 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@scure/bip32': 1.3.2 + '@scure/bip39': 1.2.1 + abitype: 0.9.8(typescript@5.3.2)(zod@3.22.4) + isows: 1.0.3(ws@8.13.0) + typescript: 5.3.2 + ws: 8.13.0 transitivePeerDependencies: - bufferutil - utf-8-validate - zod dev: false - /vite-node@0.28.5(@types/node@18.18.6): + /vite-node@0.28.5(@types/node@18.18.7): resolution: {integrity: sha512-LmXb9saMGlrMZbXTvOveJKwMTBTNUH66c8rJnQ0ZPNX+myPEol64+szRzXtV5ORb0Hb/91yq+/D3oERoyAt6LA==} engines: {node: '>=v14.16.0'} hasBin: true @@ -33054,7 +35130,28 @@ packages: picocolors: 1.0.0 source-map: 0.6.1 source-map-support: 0.5.21 - vite: 4.5.0(@types/node@18.18.6) + vite: 4.5.0(@types/node@18.18.7) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + + /vite-node@1.0.2(@types/node@18.18.7): + resolution: {integrity: sha512-h7BbMJf46fLvFW/9Ygo3snkIBEHFh6fHpB4lge98H5quYrDhPFeI3S0LREz328uqPWSnii2yeJXktQ+Pmqk5BQ==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + dependencies: + cac: 6.7.14 + debug: 4.3.4(supports-color@8.1.1) + pathe: 1.1.1 + picocolors: 1.0.0 + vite: 5.0.6(@types/node@18.18.7) transitivePeerDependencies: - '@types/node' - less @@ -33066,7 +35163,7 @@ packages: - terser dev: true - /vite@4.5.0(@types/node@18.18.6): + /vite@4.5.0(@types/node@18.18.7): resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -33094,7 +35191,7 @@ packages: terser: optional: true dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 esbuild: 0.18.20 postcss: 8.4.31 rollup: 3.29.4 @@ -33102,6 +35199,42 @@ packages: fsevents: 2.3.3 dev: true + /vite@5.0.6(@types/node@18.18.7): + resolution: {integrity: sha512-MD3joyAEBtV7QZPl2JVVUai6zHms3YOmLR+BpMzLlX2Yzjfcc4gTgNi09d/Rua3F4EtC8zdwPU8eQYyib4vVMQ==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 18.18.7 + esbuild: 0.19.8 + postcss: 8.4.32 + rollup: 4.6.1 + optionalDependencies: + fsevents: 2.3.3 + dev: true + /vitest@0.28.5: resolution: {integrity: sha512-pyCQ+wcAOX7mKMcBNkzDwEHRGqQvHUl0XnoHR+3Pb1hytAHISgSxv9h0gUiSiYtISXUU3rMrKiKzFYDrI6ZIHA==} engines: {node: '>=v14.16.0'} @@ -33126,7 +35259,7 @@ packages: dependencies: '@types/chai': 4.3.9 '@types/chai-subset': 1.3.4 - '@types/node': 18.18.6 + '@types/node': 18.18.7 '@vitest/expect': 0.28.5 '@vitest/runner': 0.28.5 '@vitest/spy': 0.28.5 @@ -33145,8 +35278,65 @@ packages: tinybench: 2.5.1 tinypool: 0.3.1 tinyspy: 1.1.1 - vite: 4.5.0(@types/node@18.18.6) - vite-node: 0.28.5(@types/node@18.18.6) + vite: 4.5.0(@types/node@18.18.7) + vite-node: 0.28.5(@types/node@18.18.7) + why-is-node-running: 2.2.2 + transitivePeerDependencies: + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + + /vitest@1.0.2(@types/node@18.18.7): + resolution: {integrity: sha512-F3NVwwpXfRSDnJmyv+ALPwSRVt0zDkRRE18pwUHSUPXAlWQ47rY1dc99ziMW5bBHyqwK2ERjMisLNoef64qk9w==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': ^1.0.0 + '@vitest/ui': ^1.0.0 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + dependencies: + '@types/node': 18.18.7 + '@vitest/expect': 1.0.2 + '@vitest/runner': 1.0.2 + '@vitest/snapshot': 1.0.2 + '@vitest/spy': 1.0.2 + '@vitest/utils': 1.0.2 + acorn-walk: 8.3.1 + cac: 6.7.14 + chai: 4.3.10 + debug: 4.3.4(supports-color@8.1.1) + execa: 8.0.1 + local-pkg: 0.5.0 + magic-string: 0.30.5 + pathe: 1.1.1 + picocolors: 1.0.0 + std-env: 3.6.0 + strip-literal: 1.3.0 + tinybench: 2.5.1 + tinypool: 0.8.1 + vite: 5.0.6(@types/node@18.18.7) + vite-node: 1.0.2(@types/node@18.18.7) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -33160,6 +35350,7 @@ packages: /vlq@1.0.1: resolution: {integrity: sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==} + dev: false /vscode-oniguruma@1.7.0: resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} @@ -33195,8 +35386,8 @@ packages: hasBin: true dev: true - /wagmi@1.3.9(@types/react@18.2.31)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@1.5.3)(zod@3.22.4): - resolution: {integrity: sha512-BQbl+vWLNpLraXd/MWsl1P3I41l7DHrujx6qshIa1HDV7Mdh0GNrDuluRYBtuK2bBx9WM/Fjw45Ef2aKADan9A==} + /wagmi@1.4.5(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@1.19.9)(zod@3.22.4): + resolution: {integrity: sha512-Ph62E6cO5n2Z8Z5LTyZrkaNprxTsbC4w0qZJT4OJdXrEELziI8z/b4FO6amVFXdu2rDp/wpvF56e4mhKC8/Kdw==} peerDependencies: react: '>=17.0.0' typescript: '>=5.0.4' @@ -33208,12 +35399,12 @@ packages: '@tanstack/query-sync-storage-persister': 4.36.1 '@tanstack/react-query': 4.36.1(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0) '@tanstack/react-query-persist-client': 4.36.1(@tanstack/react-query@4.36.1) - '@wagmi/core': 1.3.8(@types/react@18.2.31)(react@18.2.0)(typescript@5.1.6)(viem@1.5.3)(zod@3.22.4) + '@wagmi/core': 1.4.5(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@1.19.9)(zod@3.22.4) abitype: 0.8.7(typescript@5.1.6)(zod@3.22.4) react: 18.2.0 typescript: 5.1.6 use-sync-external-store: 1.2.0(react@18.2.0) - viem: 1.5.3(typescript@5.1.6)(zod@3.22.4) + viem: 1.19.9(typescript@5.1.6)(zod@3.22.4) transitivePeerDependencies: - '@react-native-async-storage/async-storage' - '@types/react' @@ -33284,6 +35475,7 @@ packages: util: 0.12.5 optionalDependencies: '@zxing/text-encoding': 0.9.0 + dev: false /web-namespaces@1.1.4: resolution: {integrity: sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==} @@ -33297,6 +35489,92 @@ packages: resolution: {integrity: sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA==} dev: false + /web3-bzz@1.10.3: + resolution: {integrity: sha512-XDIRsTwekdBXtFytMpHBuun4cK4x0ZMIDXSoo1UVYp+oMyZj07c7gf7tNQY5qZ/sN+CJIas4ilhN25VJcjSijQ==} + engines: {node: '>=8.0.0'} + requiresBuild: true + dependencies: + '@types/node': 12.20.55 + got: 12.1.0 + swarm-js: 0.1.42 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /web3-core-helpers@1.10.3: + resolution: {integrity: sha512-Yv7dQC3B9ipOc5sWm3VAz1ys70Izfzb8n9rSiQYIPjpqtJM+3V4EeK6ghzNR6CO2es0+Yu9CtCkw0h8gQhrTxA==} + engines: {node: '>=8.0.0'} + dependencies: + web3-eth-iban: 1.10.3 + web3-utils: 1.10.3 + dev: true + + /web3-core-method@1.10.3: + resolution: {integrity: sha512-VZ/Dmml4NBmb0ep5PTSg9oqKoBtG0/YoMPei/bq/tUdlhB2dMB79sbeJPwx592uaV0Vpk7VltrrrBv5hTM1y4Q==} + engines: {node: '>=8.0.0'} + dependencies: + '@ethersproject/transactions': 5.7.0 + web3-core-helpers: 1.10.3 + web3-core-promievent: 1.10.3 + web3-core-subscriptions: 1.10.3 + web3-utils: 1.10.3 + dev: true + + /web3-core-promievent@1.10.3: + resolution: {integrity: sha512-HgjY+TkuLm5uTwUtaAfkTgRx/NzMxvVradCi02gy17NxDVdg/p6svBHcp037vcNpkuGeFznFJgULP+s2hdVgUQ==} + engines: {node: '>=8.0.0'} + dependencies: + eventemitter3: 4.0.4 + dev: true + + /web3-core-requestmanager@1.10.3: + resolution: {integrity: sha512-VT9sKJfgM2yBOIxOXeXiDuFMP4pxzF6FT+y8KTLqhDFHkbG3XRe42Vm97mB/IvLQCJOmokEjl3ps8yP1kbggyw==} + engines: {node: '>=8.0.0'} + dependencies: + util: 0.12.5 + web3-core-helpers: 1.10.3 + web3-providers-http: 1.10.3 + web3-providers-ipc: 1.10.3 + web3-providers-ws: 1.10.3 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-core-subscriptions@1.10.3: + resolution: {integrity: sha512-KW0Mc8sgn70WadZu7RjQ4H5sNDJ5Lx8JMI3BWos+f2rW0foegOCyWhRu33W1s6ntXnqeBUw5rRCXZRlA3z+HNA==} + engines: {node: '>=8.0.0'} + dependencies: + eventemitter3: 4.0.4 + web3-core-helpers: 1.10.3 + dev: true + + /web3-core@1.10.3: + resolution: {integrity: sha512-Vbk0/vUNZxJlz3RFjAhNNt7qTpX8yE3dn3uFxfX5OHbuon5u65YEOd3civ/aQNW745N0vGUlHFNxxmn+sG9DIw==} + engines: {node: '>=8.0.0'} + dependencies: + '@types/bn.js': 5.1.3 + '@types/node': 12.20.55 + bignumber.js: 9.1.2 + web3-core-helpers: 1.10.3 + web3-core-method: 1.10.3 + web3-core-requestmanager: 1.10.3 + web3-utils: 1.10.3 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth-abi@1.10.3: + resolution: {integrity: sha512-O8EvV67uhq0OiCMekqYsDtb6FzfYzMXT7VMHowF8HV6qLZXCGTdB/NH4nJrEh2mFtEwVdS6AmLFJAQd2kVyoMQ==} + engines: {node: '>=8.0.0'} + dependencies: + '@ethersproject/abi': 5.7.0 + web3-utils: 1.10.3 + dev: true + /web3-eth-abi@1.7.0: resolution: {integrity: sha512-heqR0bWxgCJwjWIhq2sGyNj9bwun5+Xox/LdZKe+WMyTSy0cXDXEAgv3XKNkXC4JqdDt/ZlbTEx4TWak4TRMSg==} engines: {node: '>=8.0.0'} @@ -33305,6 +35583,160 @@ packages: web3-utils: 1.7.0 dev: true + /web3-eth-accounts@1.10.3: + resolution: {integrity: sha512-8MipGgwusDVgn7NwKOmpeo3gxzzd+SmwcWeBdpXknuyDiZSQy9tXe+E9LeFGrmys/8mLLYP79n3jSbiTyv+6pQ==} + engines: {node: '>=8.0.0'} + dependencies: + '@ethereumjs/common': 2.6.5 + '@ethereumjs/tx': 3.5.2 + '@ethereumjs/util': 8.1.0 + eth-lib: 0.2.8 + scrypt-js: 3.0.1 + uuid: 9.0.1 + web3-core: 1.10.3 + web3-core-helpers: 1.10.3 + web3-core-method: 1.10.3 + web3-utils: 1.10.3 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth-contract@1.10.3: + resolution: {integrity: sha512-Y2CW61dCCyY4IoUMD4JsEQWrILX4FJWDWC/Txx/pr3K/+fGsBGvS9kWQN5EsVXOp4g7HoFOfVh9Lf7BmVVSRmg==} + engines: {node: '>=8.0.0'} + dependencies: + '@types/bn.js': 5.1.3 + web3-core: 1.10.3 + web3-core-helpers: 1.10.3 + web3-core-method: 1.10.3 + web3-core-promievent: 1.10.3 + web3-core-subscriptions: 1.10.3 + web3-eth-abi: 1.10.3 + web3-utils: 1.10.3 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth-ens@1.10.3: + resolution: {integrity: sha512-hR+odRDXGqKemw1GFniKBEXpjYwLgttTES+bc7BfTeoUyUZXbyDHe5ifC+h+vpzxh4oS0TnfcIoarK0Z9tFSiQ==} + engines: {node: '>=8.0.0'} + dependencies: + content-hash: 2.5.2 + eth-ens-namehash: 2.0.8 + web3-core: 1.10.3 + web3-core-helpers: 1.10.3 + web3-core-promievent: 1.10.3 + web3-eth-abi: 1.10.3 + web3-eth-contract: 1.10.3 + web3-utils: 1.10.3 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth-iban@1.10.3: + resolution: {integrity: sha512-ZCfOjYKAjaX2TGI8uif5ah+J3BYFuo+47JOIV1RIz2l7kD9VfnxvRH5UiQDRyMALQC7KFd2hUqIEtHklapNyKA==} + engines: {node: '>=8.0.0'} + dependencies: + bn.js: 5.2.1 + web3-utils: 1.10.3 + dev: true + + /web3-eth-personal@1.10.3: + resolution: {integrity: sha512-avrQ6yWdADIvuNQcFZXmGLCEzulQa76hUOuVywN7O3cklB4nFc/Gp3yTvD3bOAaE7DhjLQfhUTCzXL7WMxVTsw==} + engines: {node: '>=8.0.0'} + dependencies: + '@types/node': 12.20.55 + web3-core: 1.10.3 + web3-core-helpers: 1.10.3 + web3-core-method: 1.10.3 + web3-net: 1.10.3 + web3-utils: 1.10.3 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-eth@1.10.3: + resolution: {integrity: sha512-Uk1U2qGiif2mIG8iKu23/EQJ2ksB1BQXy3wF3RvFuyxt8Ft9OEpmGlO7wOtAyJdoKzD5vcul19bJpPcWSAYZhA==} + engines: {node: '>=8.0.0'} + dependencies: + web3-core: 1.10.3 + web3-core-helpers: 1.10.3 + web3-core-method: 1.10.3 + web3-core-subscriptions: 1.10.3 + web3-eth-abi: 1.10.3 + web3-eth-accounts: 1.10.3 + web3-eth-contract: 1.10.3 + web3-eth-ens: 1.10.3 + web3-eth-iban: 1.10.3 + web3-eth-personal: 1.10.3 + web3-net: 1.10.3 + web3-utils: 1.10.3 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-net@1.10.3: + resolution: {integrity: sha512-IoSr33235qVoI1vtKssPUigJU9Fc/Ph0T9CgRi15sx+itysmvtlmXMNoyd6Xrgm9LuM4CIhxz7yDzH93B79IFg==} + engines: {node: '>=8.0.0'} + dependencies: + web3-core: 1.10.3 + web3-core-method: 1.10.3 + web3-utils: 1.10.3 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /web3-providers-http@1.10.3: + resolution: {integrity: sha512-6dAgsHR3MxJ0Qyu3QLFlQEelTapVfWNTu5F45FYh8t7Y03T1/o+YAkVxsbY5AdmD+y5bXG/XPJ4q8tjL6MgZHw==} + engines: {node: '>=8.0.0'} + dependencies: + abortcontroller-polyfill: 1.7.5 + cross-fetch: 4.0.0 + es6-promise: 4.2.8 + web3-core-helpers: 1.10.3 + transitivePeerDependencies: + - encoding + dev: true + + /web3-providers-ipc@1.10.3: + resolution: {integrity: sha512-vP5WIGT8FLnGRfswTxNs9rMfS1vCbMezj/zHbBe/zB9GauBRTYVrUo2H/hVrhLg8Ut7AbsKZ+tCJ4mAwpKi2hA==} + engines: {node: '>=8.0.0'} + dependencies: + oboe: 2.1.5 + web3-core-helpers: 1.10.3 + dev: true + + /web3-providers-ws@1.10.3: + resolution: {integrity: sha512-/filBXRl48INxsh6AuCcsy4v5ndnTZ/p6bl67kmO9aK1wffv7CT++DrtclDtVMeDGCgB3van+hEf9xTAVXur7Q==} + engines: {node: '>=8.0.0'} + dependencies: + eventemitter3: 4.0.4 + web3-core-helpers: 1.10.3 + websocket: 1.0.34 + transitivePeerDependencies: + - supports-color + dev: true + + /web3-shh@1.10.3: + resolution: {integrity: sha512-cAZ60CPvs9azdwMSQ/PSUdyV4PEtaW5edAZhu3rCXf6XxQRliBboic+AvwUvB6j3eswY50VGa5FygfVmJ1JVng==} + engines: {node: '>=8.0.0'} + requiresBuild: true + dependencies: + web3-core: 1.10.3 + web3-core-method: 1.10.3 + web3-core-subscriptions: 1.10.3 + web3-net: 1.10.3 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + /web3-utils@1.10.3: resolution: {integrity: sha512-OqcUrEE16fDBbGoQtZXWdavsPzbGIDc5v3VrRTZ0XrIpefC/viZ1ZU9bGEemazyS0catk/3rkOOxpzTfY+XsyQ==} engines: {node: '>=8.0.0'} @@ -33357,6 +35789,25 @@ packages: - supports-color dev: false + /web3@1.10.3: + resolution: {integrity: sha512-DgUdOOqC/gTqW+VQl1EdPxrVRPB66xVNtuZ5KD4adVBtko87hkgM8BTZ0lZ8IbUfnQk6DyjcDujMiH3oszllAw==} + engines: {node: '>=8.0.0'} + requiresBuild: true + dependencies: + web3-bzz: 1.10.3 + web3-core: 1.10.3 + web3-eth: 1.10.3 + web3-eth-personal: 1.10.3 + web3-net: 1.10.3 + web3-shh: 1.10.3 + web3-utils: 1.10.3 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + /webcrypto-core@1.7.7: resolution: {integrity: sha512-7FjigXNsBfopEj+5DV2nhNpfic2vumtjjgPmeDKk45z+MJwXKKfhPB7118Pfzrmh4jqOMST6Ch37iPAHoImg5g==} dependencies: @@ -33589,7 +36040,6 @@ packages: yaeti: 0.0.6 transitivePeerDependencies: - supports-color - dev: false /whatwg-encoding@2.0.0: resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==} @@ -33600,6 +36050,7 @@ packages: /whatwg-fetch@3.6.19: resolution: {integrity: sha512-d67JP4dHSbm2TrpFj8AbO8DnL1JXL5J9u0Kq2xW6d0TFDbCA3Muhdt8orXC22utleTVj7Prqt82baN6RBvnEgw==} + dev: false /whatwg-mimetype@3.0.0: resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} @@ -33664,10 +36115,6 @@ packages: is-weakset: 2.0.2 dev: true - /which-module@1.0.0: - resolution: {integrity: sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==} - dev: true - /which-module@2.0.1: resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} @@ -33723,12 +36170,6 @@ packages: resolution: {integrity: sha512-tE12J/NenOv4xdVobD+AD3fT06T4KNqnzRhkv5nBIu7K+pvOH2oLCEgYP+i+5mF2jtI6FEADheOdZkA8YWET9w==} dev: false - /window-size@0.2.0: - resolution: {integrity: sha512-UD7d8HFA2+PZsbKyaOCEy8gMh1oDtHgJh1LfgjQ4zVXmYjAT/kvz3PueITKuqDiIXQe7yzpPnxX3lNc+AhQMyw==} - engines: {node: '>= 0.10.0'} - hasBin: true - dev: true - /word-wrap@1.2.5: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} @@ -33744,6 +36185,7 @@ packages: dependencies: reduce-flatten: 2.0.0 typical: 5.2.0 + dev: true /workerpool@6.2.1: resolution: {integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==} @@ -33778,14 +36220,6 @@ packages: - utf-8-validate dev: true - /wrap-ansi@2.1.0: - resolution: {integrity: sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==} - engines: {node: '>=0.10.0'} - dependencies: - string-width: 1.0.2 - strip-ansi: 3.0.1 - dev: true - /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -33819,6 +36253,7 @@ packages: graceful-fs: 4.2.11 imurmurhash: 0.1.4 signal-exit: 3.0.7 + dev: false /write-file-atomic@3.0.3: resolution: {integrity: sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==} @@ -33834,6 +36269,23 @@ packages: dependencies: imurmurhash: 0.1.4 signal-exit: 3.0.7 + dev: true + + /ws@3.3.3: + resolution: {integrity: sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dependencies: + async-limiter: 1.0.1 + safe-buffer: 5.1.2 + ultron: 1.1.1 + dev: true /ws@6.2.2: resolution: {integrity: sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==} @@ -33847,6 +36299,7 @@ packages: optional: true dependencies: async-limiter: 1.0.1 + dev: false /ws@7.4.6: resolution: {integrity: sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==} @@ -33896,6 +36349,7 @@ packages: optional: true utf-8-validate: optional: true + dev: true /ws@8.13.0: resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} @@ -33924,11 +36378,63 @@ packages: bufferutil: 4.0.8 utf-8-validate: 5.0.10 + /ws@8.5.0: + resolution: {integrity: sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + /xdeployer@2.1.13(@nomicfoundation/hardhat-ethers@3.0.4)(ethers@6.8.0)(hardhat@2.18.3): + resolution: {integrity: sha512-QxVsQ+zz+cnhzCIs7/e5F06nKjOD2Lb47nW52Jw3IzFQVeYv6NfvokhZiez+y8jkzwvHDwVru+fCVlml0GQGkw==} + engines: {node: '>=14.0.0'} + peerDependencies: + '@nomicfoundation/hardhat-ethers': ^3.0.4 + ethers: ^6.8.1 + hardhat: ^2.19.0 + dependencies: + '@nomicfoundation/hardhat-ethers': 3.0.4(ethers@6.8.0)(hardhat@2.18.3) + ethers: 6.8.0 + hardhat: 2.18.3(ts-node@10.9.1)(typescript@4.9.5) + dev: true + /xdg-basedir@4.0.0: resolution: {integrity: sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==} engines: {node: '>=8'} dev: false + /xhr-request-promise@0.1.3: + resolution: {integrity: sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg==} + dependencies: + xhr-request: 1.1.0 + dev: true + + /xhr-request@1.1.0: + resolution: {integrity: sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==} + dependencies: + buffer-to-arraybuffer: 0.0.5 + object-assign: 4.1.1 + query-string: 5.1.1 + simple-get: 2.8.2 + timed-out: 4.0.1 + url-set-query: 1.0.0 + xhr: 2.6.0 + dev: true + + /xhr@2.6.0: + resolution: {integrity: sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==} + dependencies: + global: 4.4.0 + is-function: 1.0.2 + parse-headers: 2.0.5 + xtend: 4.0.2 + dev: true + /xml-js@1.6.11: resolution: {integrity: sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==} hasBin: true @@ -33975,10 +36481,6 @@ packages: resolution: {integrity: sha512-ibF0Or+FivM9lNrg+HGJfVX8WJqgo+kCLDc4vx6xMeTce7Aj+DLttKbxxRR/gNLSAelRc1omAPlJ77N/Jem07A==} dev: true - /y18n@3.2.2: - resolution: {integrity: sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==} - dev: true - /y18n@4.0.3: resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} @@ -33989,7 +36491,6 @@ packages: /yaeti@0.0.6: resolution: {integrity: sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==} engines: {node: '>=0.10.32'} - dev: false /yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} @@ -34009,6 +36510,7 @@ packages: /yaml@2.3.3: resolution: {integrity: sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==} engines: {node: '>= 14'} + dev: false /yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} @@ -34017,13 +36519,6 @@ packages: camelcase: 5.3.1 decamelize: 1.2.0 - /yargs-parser@2.4.1: - resolution: {integrity: sha512-9pIKIJhnI5tonzG6OnCFlz/yln8xHYcGl+pn3xR0Vzff0vzN1PbNRaelgfgRUwZ3s4i3jvxT9WhmUGL4whnasA==} - dependencies: - camelcase: 3.0.0 - lodash.assign: 4.2.0 - dev: true - /yargs-parser@20.2.4: resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} engines: {node: '>=10'} @@ -34085,25 +36580,6 @@ packages: y18n: 5.0.8 yargs-parser: 21.1.1 - /yargs@4.8.1: - resolution: {integrity: sha512-LqodLrnIDM3IFT+Hf/5sxBnEGECrfdC1uIbgZeJmESCSo4HoCAaKEus8MylXHAkdacGc0ye+Qa+dpkuom8uVYA==} - dependencies: - cliui: 3.2.0 - decamelize: 1.2.0 - get-caller-file: 1.0.3 - lodash.assign: 4.2.0 - os-locale: 1.4.0 - read-pkg-up: 1.0.1 - require-directory: 2.1.1 - require-main-filename: 1.0.1 - set-blocking: 2.0.0 - string-width: 1.0.2 - which-module: 1.0.0 - window-size: 0.2.0 - y18n: 3.2.2 - yargs-parser: 2.4.1 - dev: true - /yauzl@2.10.0: resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} dependencies: @@ -34111,11 +36587,6 @@ packages: fd-slicer: 1.1.0 dev: true - /yn@2.0.0: - resolution: {integrity: sha512-uTv8J/wiWTgUTg+9vLTi//leUl5vDQS6uii/emeTb2ssY7vl6QWf2fFbIIGjnhjvbdKlU0ed7QPgY1htTC86jQ==} - engines: {node: '>=4'} - dev: true - /yn@3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} engines: {node: '>=6'} @@ -34152,12 +36623,14 @@ packages: /zen-observable-ts@1.2.5: resolution: {integrity: sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==} + requiresBuild: true dependencies: zen-observable: 0.8.15 dev: false /zen-observable@0.8.15: resolution: {integrity: sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==} + requiresBuild: true dev: false /zod-to-json-schema@3.21.4(zod@3.22.4): @@ -34166,11 +36639,12 @@ packages: zod: ^3.21.4 dependencies: zod: 3.22.4 + dev: false /zod@3.22.4: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} - /zustand@4.4.4(@types/react@18.2.31)(react@18.2.0): + /zustand@4.4.4(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-5UTUIAiHMNf5+mFp7/AnzJXS7+XxktULFN0+D1sCiZWyX7ZG+AQpqs2qpYrynRij4QvoDdCD+U+bmg/cG3Ucxw==} engines: {node: '>=12.7.0'} peerDependencies: @@ -34185,7 +36659,7 @@ packages: react: optional: true dependencies: - '@types/react': 18.2.31 + '@types/react': 18.2.33 react: 18.2.0 use-sync-external-store: 1.2.0(react@18.2.0) dev: false diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index aaa9186b..fcd6e04d 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -4,6 +4,6 @@ packages: - "docs" - "frontend" - "graph" - - "vendor/observabletreemap" - "sdk" + - "vendor/observabletreemap" - "contracts" diff --git a/sdk/.eslintrc.yml b/sdk/.eslintrc.yml index d4bd79ab..da11d20d 100644 --- a/sdk/.eslintrc.yml +++ b/sdk/.eslintrc.yml @@ -9,7 +9,7 @@ parserOptions: plugins: - "@typescript-eslint" root: true -ignorePatterns: ["rollup.config.js", "jest.config.ts", "dist/"] +ignorePatterns: ["rollup.config.js", "vitest.config.ts", "dist/"] rules: "@typescript-eslint/semi": - warn diff --git a/sdk/.graphclient/index.ts b/sdk/.graphclient/index.ts index ee00cdac..9e48bf89 100644 --- a/sdk/.graphclient/index.ts +++ b/sdk/.graphclient/index.ts @@ -53,6 +53,14 @@ export type Query = { claims: Array; claimToken?: Maybe; claimTokens: Array; + token?: Maybe; + tokens: Array; + acceptedToken?: Maybe; + acceptedTokens: Array; + offer?: Maybe; + offers: Array; + trade?: Maybe; + trades: Array; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; }; @@ -112,6 +120,78 @@ export type QueryclaimTokensArgs = { }; +export type QuerytokenArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QuerytokensArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryacceptedTokenArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryacceptedTokensArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryofferArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryoffersArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QuerytradeArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QuerytradesArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + export type Query_metaArgs = { block?: InputMaybe; }; @@ -123,6 +203,14 @@ export type Subscription = { claims: Array; claimToken?: Maybe; claimTokens: Array; + token?: Maybe; + tokens: Array; + acceptedToken?: Maybe; + acceptedTokens: Array; + offer?: Maybe; + offers: Array; + trade?: Maybe; + trades: Array; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; }; @@ -182,10 +270,159 @@ export type SubscriptionclaimTokensArgs = { }; +export type SubscriptiontokenArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptiontokensArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionacceptedTokenArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionacceptedTokensArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionofferArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionoffersArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptiontradeArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptiontradesArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + export type Subscription_metaArgs = { block?: InputMaybe; }; +export type AcceptedToken = { + id: Scalars['String']; + token: Token; + minimumAmountPerUnit: Scalars['BigInt']; + accepted: Scalars['Boolean']; +}; + +export type AcceptedToken_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + token?: InputMaybe; + token_not?: InputMaybe; + token_gt?: InputMaybe; + token_lt?: InputMaybe; + token_gte?: InputMaybe; + token_lte?: InputMaybe; + token_in?: InputMaybe>; + token_not_in?: InputMaybe>; + token_contains?: InputMaybe; + token_contains_nocase?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_contains_nocase?: InputMaybe; + token_starts_with?: InputMaybe; + token_starts_with_nocase?: InputMaybe; + token_not_starts_with?: InputMaybe; + token_not_starts_with_nocase?: InputMaybe; + token_ends_with?: InputMaybe; + token_ends_with_nocase?: InputMaybe; + token_not_ends_with?: InputMaybe; + token_not_ends_with_nocase?: InputMaybe; + token_?: InputMaybe; + minimumAmountPerUnit?: InputMaybe; + minimumAmountPerUnit_not?: InputMaybe; + minimumAmountPerUnit_gt?: InputMaybe; + minimumAmountPerUnit_lt?: InputMaybe; + minimumAmountPerUnit_gte?: InputMaybe; + minimumAmountPerUnit_lte?: InputMaybe; + minimumAmountPerUnit_in?: InputMaybe>; + minimumAmountPerUnit_not_in?: InputMaybe>; + accepted?: InputMaybe; + accepted_not?: InputMaybe; + accepted_in?: InputMaybe>; + accepted_not_in?: InputMaybe>; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type AcceptedToken_orderBy = + | 'id' + | 'token' + | 'token__id' + | 'token__name' + | 'token__symbol' + | 'token__decimals' + | 'minimumAmountPerUnit' + | 'accepted'; + export type Allowlist = { id: Scalars['String']; root: Scalars['Bytes']; @@ -282,7 +519,8 @@ export type Claim = { creator?: Maybe; owner?: Maybe; totalUnits?: Maybe; - chainName: Scalars['String']; + allowlist?: Maybe; + graphName: Scalars['String']; }; export type ClaimToken = { @@ -291,7 +529,17 @@ export type ClaimToken = { claim: Claim; owner: Scalars['Bytes']; units: Scalars['BigInt']; - chainName: Scalars['String']; + offers?: Maybe>; + graphName: Scalars['String']; +}; + + +export type ClaimTokenoffersArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; }; export type ClaimToken_filter = { @@ -362,6 +610,7 @@ export type ClaimToken_filter = { units_lte?: InputMaybe; units_in?: InputMaybe>; units_not_in?: InputMaybe>; + offers_?: InputMaybe; /** Filter for the block changed event. */ _change_block?: InputMaybe; and?: InputMaybe>>; @@ -381,7 +630,8 @@ export type ClaimToken_orderBy = | 'claim__owner' | 'claim__totalUnits' | 'owner' - | 'units'; + | 'units' + | 'offers'; export type Claim_filter = { id?: InputMaybe; @@ -488,6 +738,27 @@ export type Claim_filter = { totalUnits_lte?: InputMaybe; totalUnits_in?: InputMaybe>; totalUnits_not_in?: InputMaybe>; + allowlist?: InputMaybe; + allowlist_not?: InputMaybe; + allowlist_gt?: InputMaybe; + allowlist_lt?: InputMaybe; + allowlist_gte?: InputMaybe; + allowlist_lte?: InputMaybe; + allowlist_in?: InputMaybe>; + allowlist_not_in?: InputMaybe>; + allowlist_contains?: InputMaybe; + allowlist_contains_nocase?: InputMaybe; + allowlist_not_contains?: InputMaybe; + allowlist_not_contains_nocase?: InputMaybe; + allowlist_starts_with?: InputMaybe; + allowlist_starts_with_nocase?: InputMaybe; + allowlist_not_starts_with?: InputMaybe; + allowlist_not_starts_with_nocase?: InputMaybe; + allowlist_ends_with?: InputMaybe; + allowlist_ends_with_nocase?: InputMaybe; + allowlist_not_ends_with?: InputMaybe; + allowlist_not_ends_with_nocase?: InputMaybe; + allowlist_?: InputMaybe; /** Filter for the block changed event. */ _change_block?: InputMaybe; and?: InputMaybe>>; @@ -502,13 +773,345 @@ export type Claim_orderBy = | 'uri' | 'creator' | 'owner' - | 'totalUnits'; + | 'totalUnits' + | 'allowlist' + | 'allowlist__id' + | 'allowlist__root'; + +export type Offer = { + id: Scalars['String']; + fractionID: ClaimToken; + unitsAvailable: Scalars['BigInt']; + minUnitsPerTrade: Scalars['BigInt']; + maxUnitsPerTrade: Scalars['BigInt']; + status: OfferStatus; + acceptedTokens: Array; +}; + + +export type OfferacceptedTokensArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; +}; + +export type OfferStatus = + | 'Open' + | 'Fulfilled' + | 'Cancelled'; + +export type Offer_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + fractionID?: InputMaybe; + fractionID_not?: InputMaybe; + fractionID_gt?: InputMaybe; + fractionID_lt?: InputMaybe; + fractionID_gte?: InputMaybe; + fractionID_lte?: InputMaybe; + fractionID_in?: InputMaybe>; + fractionID_not_in?: InputMaybe>; + fractionID_contains?: InputMaybe; + fractionID_contains_nocase?: InputMaybe; + fractionID_not_contains?: InputMaybe; + fractionID_not_contains_nocase?: InputMaybe; + fractionID_starts_with?: InputMaybe; + fractionID_starts_with_nocase?: InputMaybe; + fractionID_not_starts_with?: InputMaybe; + fractionID_not_starts_with_nocase?: InputMaybe; + fractionID_ends_with?: InputMaybe; + fractionID_ends_with_nocase?: InputMaybe; + fractionID_not_ends_with?: InputMaybe; + fractionID_not_ends_with_nocase?: InputMaybe; + fractionID_?: InputMaybe; + unitsAvailable?: InputMaybe; + unitsAvailable_not?: InputMaybe; + unitsAvailable_gt?: InputMaybe; + unitsAvailable_lt?: InputMaybe; + unitsAvailable_gte?: InputMaybe; + unitsAvailable_lte?: InputMaybe; + unitsAvailable_in?: InputMaybe>; + unitsAvailable_not_in?: InputMaybe>; + minUnitsPerTrade?: InputMaybe; + minUnitsPerTrade_not?: InputMaybe; + minUnitsPerTrade_gt?: InputMaybe; + minUnitsPerTrade_lt?: InputMaybe; + minUnitsPerTrade_gte?: InputMaybe; + minUnitsPerTrade_lte?: InputMaybe; + minUnitsPerTrade_in?: InputMaybe>; + minUnitsPerTrade_not_in?: InputMaybe>; + maxUnitsPerTrade?: InputMaybe; + maxUnitsPerTrade_not?: InputMaybe; + maxUnitsPerTrade_gt?: InputMaybe; + maxUnitsPerTrade_lt?: InputMaybe; + maxUnitsPerTrade_gte?: InputMaybe; + maxUnitsPerTrade_lte?: InputMaybe; + maxUnitsPerTrade_in?: InputMaybe>; + maxUnitsPerTrade_not_in?: InputMaybe>; + status?: InputMaybe; + status_not?: InputMaybe; + status_in?: InputMaybe>; + status_not_in?: InputMaybe>; + acceptedTokens?: InputMaybe>; + acceptedTokens_not?: InputMaybe>; + acceptedTokens_contains?: InputMaybe>; + acceptedTokens_contains_nocase?: InputMaybe>; + acceptedTokens_not_contains?: InputMaybe>; + acceptedTokens_not_contains_nocase?: InputMaybe>; + acceptedTokens_?: InputMaybe; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type Offer_orderBy = + | 'id' + | 'fractionID' + | 'fractionID__id' + | 'fractionID__tokenID' + | 'fractionID__owner' + | 'fractionID__units' + | 'unitsAvailable' + | 'minUnitsPerTrade' + | 'maxUnitsPerTrade' + | 'status' + | 'acceptedTokens'; /** Defines the order direction, either ascending or descending */ export type OrderDirection = | 'asc' | 'desc'; +export type Token = { + id: Scalars['String']; + name: Scalars['String']; + symbol?: Maybe; + decimals?: Maybe; +}; + +export type Token_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + name?: InputMaybe; + name_not?: InputMaybe; + name_gt?: InputMaybe; + name_lt?: InputMaybe; + name_gte?: InputMaybe; + name_lte?: InputMaybe; + name_in?: InputMaybe>; + name_not_in?: InputMaybe>; + name_contains?: InputMaybe; + name_contains_nocase?: InputMaybe; + name_not_contains?: InputMaybe; + name_not_contains_nocase?: InputMaybe; + name_starts_with?: InputMaybe; + name_starts_with_nocase?: InputMaybe; + name_not_starts_with?: InputMaybe; + name_not_starts_with_nocase?: InputMaybe; + name_ends_with?: InputMaybe; + name_ends_with_nocase?: InputMaybe; + name_not_ends_with?: InputMaybe; + name_not_ends_with_nocase?: InputMaybe; + symbol?: InputMaybe; + symbol_not?: InputMaybe; + symbol_gt?: InputMaybe; + symbol_lt?: InputMaybe; + symbol_gte?: InputMaybe; + symbol_lte?: InputMaybe; + symbol_in?: InputMaybe>; + symbol_not_in?: InputMaybe>; + symbol_contains?: InputMaybe; + symbol_contains_nocase?: InputMaybe; + symbol_not_contains?: InputMaybe; + symbol_not_contains_nocase?: InputMaybe; + symbol_starts_with?: InputMaybe; + symbol_starts_with_nocase?: InputMaybe; + symbol_not_starts_with?: InputMaybe; + symbol_not_starts_with_nocase?: InputMaybe; + symbol_ends_with?: InputMaybe; + symbol_ends_with_nocase?: InputMaybe; + symbol_not_ends_with?: InputMaybe; + symbol_not_ends_with_nocase?: InputMaybe; + decimals?: InputMaybe; + decimals_not?: InputMaybe; + decimals_gt?: InputMaybe; + decimals_lt?: InputMaybe; + decimals_gte?: InputMaybe; + decimals_lte?: InputMaybe; + decimals_in?: InputMaybe>; + decimals_not_in?: InputMaybe>; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type Token_orderBy = + | 'id' + | 'name' + | 'symbol' + | 'decimals'; + +export type Trade = { + id: Scalars['String']; + buyer: Scalars['Bytes']; + offerID: Offer; + unitsSold: Scalars['BigInt']; + token: Token; + amountPerUnit: Scalars['BigInt']; +}; + +export type Trade_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + buyer?: InputMaybe; + buyer_not?: InputMaybe; + buyer_gt?: InputMaybe; + buyer_lt?: InputMaybe; + buyer_gte?: InputMaybe; + buyer_lte?: InputMaybe; + buyer_in?: InputMaybe>; + buyer_not_in?: InputMaybe>; + buyer_contains?: InputMaybe; + buyer_not_contains?: InputMaybe; + offerID?: InputMaybe; + offerID_not?: InputMaybe; + offerID_gt?: InputMaybe; + offerID_lt?: InputMaybe; + offerID_gte?: InputMaybe; + offerID_lte?: InputMaybe; + offerID_in?: InputMaybe>; + offerID_not_in?: InputMaybe>; + offerID_contains?: InputMaybe; + offerID_contains_nocase?: InputMaybe; + offerID_not_contains?: InputMaybe; + offerID_not_contains_nocase?: InputMaybe; + offerID_starts_with?: InputMaybe; + offerID_starts_with_nocase?: InputMaybe; + offerID_not_starts_with?: InputMaybe; + offerID_not_starts_with_nocase?: InputMaybe; + offerID_ends_with?: InputMaybe; + offerID_ends_with_nocase?: InputMaybe; + offerID_not_ends_with?: InputMaybe; + offerID_not_ends_with_nocase?: InputMaybe; + offerID_?: InputMaybe; + unitsSold?: InputMaybe; + unitsSold_not?: InputMaybe; + unitsSold_gt?: InputMaybe; + unitsSold_lt?: InputMaybe; + unitsSold_gte?: InputMaybe; + unitsSold_lte?: InputMaybe; + unitsSold_in?: InputMaybe>; + unitsSold_not_in?: InputMaybe>; + token?: InputMaybe; + token_not?: InputMaybe; + token_gt?: InputMaybe; + token_lt?: InputMaybe; + token_gte?: InputMaybe; + token_lte?: InputMaybe; + token_in?: InputMaybe>; + token_not_in?: InputMaybe>; + token_contains?: InputMaybe; + token_contains_nocase?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_contains_nocase?: InputMaybe; + token_starts_with?: InputMaybe; + token_starts_with_nocase?: InputMaybe; + token_not_starts_with?: InputMaybe; + token_not_starts_with_nocase?: InputMaybe; + token_ends_with?: InputMaybe; + token_ends_with_nocase?: InputMaybe; + token_not_ends_with?: InputMaybe; + token_not_ends_with_nocase?: InputMaybe; + token_?: InputMaybe; + amountPerUnit?: InputMaybe; + amountPerUnit_not?: InputMaybe; + amountPerUnit_gt?: InputMaybe; + amountPerUnit_lt?: InputMaybe; + amountPerUnit_gte?: InputMaybe; + amountPerUnit_lte?: InputMaybe; + amountPerUnit_in?: InputMaybe>; + amountPerUnit_not_in?: InputMaybe>; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type Trade_orderBy = + | 'id' + | 'buyer' + | 'offerID' + | 'offerID__id' + | 'offerID__unitsAvailable' + | 'offerID__minUnitsPerTrade' + | 'offerID__maxUnitsPerTrade' + | 'offerID__status' + | 'unitsSold' + | 'token' + | 'token__id' + | 'token__name' + | 'token__symbol' + | 'token__decimals' + | 'amountPerUnit'; + export type _Block_ = { /** The hash of the block */ hash?: Maybe; @@ -628,6 +1231,9 @@ export type DirectiveResolverFn; Subscription: ResolverTypeWrapper<{}>; + AcceptedToken: ResolverTypeWrapper; + AcceptedToken_filter: AcceptedToken_filter; + AcceptedToken_orderBy: AcceptedToken_orderBy; Allowlist: ResolverTypeWrapper; Allowlist_filter: Allowlist_filter; Allowlist_orderBy: Allowlist_orderBy; @@ -647,8 +1253,18 @@ export type ResolversTypes = ResolversObject<{ ID: ResolverTypeWrapper; Int: ResolverTypeWrapper; Int8: ResolverTypeWrapper; + Offer: ResolverTypeWrapper; + OfferStatus: OfferStatus; + Offer_filter: Offer_filter; + Offer_orderBy: Offer_orderBy; OrderDirection: OrderDirection; String: ResolverTypeWrapper; + Token: ResolverTypeWrapper; + Token_filter: Token_filter; + Token_orderBy: Token_orderBy; + Trade: ResolverTypeWrapper; + Trade_filter: Trade_filter; + Trade_orderBy: Trade_orderBy; _Block_: ResolverTypeWrapper<_Block_>; _Meta_: ResolverTypeWrapper<_Meta_>; _SubgraphErrorPolicy_: _SubgraphErrorPolicy_; @@ -658,6 +1274,8 @@ export type ResolversTypes = ResolversObject<{ export type ResolversParentTypes = ResolversObject<{ Query: {}; Subscription: {}; + AcceptedToken: AcceptedToken; + AcceptedToken_filter: AcceptedToken_filter; Allowlist: Allowlist; Allowlist_filter: Allowlist_filter; BigDecimal: Scalars['BigDecimal']; @@ -674,48 +1292,78 @@ export type ResolversParentTypes = ResolversObject<{ ID: Scalars['ID']; Int: Scalars['Int']; Int8: Scalars['Int8']; + Offer: Offer; + Offer_filter: Offer_filter; String: Scalars['String']; + Token: Token; + Token_filter: Token_filter; + Trade: Trade; + Trade_filter: Trade_filter; _Block_: _Block_; _Meta_: _Meta_; }>; export type entityDirectiveArgs = { }; -export type entityDirectiveResolver = DirectiveResolverFn; +export type entityDirectiveResolver = DirectiveResolverFn; export type subgraphIdDirectiveArgs = { id: Scalars['String']; }; -export type subgraphIdDirectiveResolver = DirectiveResolverFn; +export type subgraphIdDirectiveResolver = DirectiveResolverFn; export type derivedFromDirectiveArgs = { field: Scalars['String']; }; -export type derivedFromDirectiveResolver = DirectiveResolverFn; +export type derivedFromDirectiveResolver = DirectiveResolverFn; -export type QueryResolvers = ResolversObject<{ +export type QueryResolvers = ResolversObject<{ allowlist?: Resolver, ParentType, ContextType, RequireFields>; allowlists?: Resolver, ParentType, ContextType, RequireFields>; claim?: Resolver, ParentType, ContextType, RequireFields>; claims?: Resolver, ParentType, ContextType, RequireFields>; claimToken?: Resolver, ParentType, ContextType, RequireFields>; claimTokens?: Resolver, ParentType, ContextType, RequireFields>; + token?: Resolver, ParentType, ContextType, RequireFields>; + tokens?: Resolver, ParentType, ContextType, RequireFields>; + acceptedToken?: Resolver, ParentType, ContextType, RequireFields>; + acceptedTokens?: Resolver, ParentType, ContextType, RequireFields>; + offer?: Resolver, ParentType, ContextType, RequireFields>; + offers?: Resolver, ParentType, ContextType, RequireFields>; + trade?: Resolver, ParentType, ContextType, RequireFields>; + trades?: Resolver, ParentType, ContextType, RequireFields>; _meta?: Resolver, ParentType, ContextType, Partial>; }>; -export type SubscriptionResolvers = ResolversObject<{ +export type SubscriptionResolvers = ResolversObject<{ allowlist?: SubscriptionResolver, "allowlist", ParentType, ContextType, RequireFields>; allowlists?: SubscriptionResolver, "allowlists", ParentType, ContextType, RequireFields>; claim?: SubscriptionResolver, "claim", ParentType, ContextType, RequireFields>; claims?: SubscriptionResolver, "claims", ParentType, ContextType, RequireFields>; claimToken?: SubscriptionResolver, "claimToken", ParentType, ContextType, RequireFields>; claimTokens?: SubscriptionResolver, "claimTokens", ParentType, ContextType, RequireFields>; + token?: SubscriptionResolver, "token", ParentType, ContextType, RequireFields>; + tokens?: SubscriptionResolver, "tokens", ParentType, ContextType, RequireFields>; + acceptedToken?: SubscriptionResolver, "acceptedToken", ParentType, ContextType, RequireFields>; + acceptedTokens?: SubscriptionResolver, "acceptedTokens", ParentType, ContextType, RequireFields>; + offer?: SubscriptionResolver, "offer", ParentType, ContextType, RequireFields>; + offers?: SubscriptionResolver, "offers", ParentType, ContextType, RequireFields>; + trade?: SubscriptionResolver, "trade", ParentType, ContextType, RequireFields>; + trades?: SubscriptionResolver, "trades", ParentType, ContextType, RequireFields>; _meta?: SubscriptionResolver, "_meta", ParentType, ContextType, Partial>; }>; -export type AllowlistResolvers = ResolversObject<{ +export type AcceptedTokenResolvers = ResolversObject<{ + id?: Resolver; + token?: Resolver; + minimumAmountPerUnit?: Resolver; + accepted?: Resolver; + __isTypeOf?: IsTypeOfResolverFn; +}>; + +export type AllowlistResolvers = ResolversObject<{ id?: Resolver; root?: Resolver; claim?: Resolver; @@ -734,7 +1382,7 @@ export interface BytesScalarConfig extends GraphQLScalarTypeConfig = ResolversObject<{ +export type ClaimResolvers = ResolversObject<{ id?: Resolver; creation?: Resolver; tokenID?: Resolver; @@ -743,17 +1391,19 @@ export type ClaimResolvers, ParentType, ContextType>; owner?: Resolver, ParentType, ContextType>; totalUnits?: Resolver, ParentType, ContextType>; - chainName?: Resolver; + allowlist?: Resolver, ParentType, ContextType>; + graphName?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }>; -export type ClaimTokenResolvers = ResolversObject<{ +export type ClaimTokenResolvers = ResolversObject<{ id?: Resolver; tokenID?: Resolver; claim?: Resolver; owner?: Resolver; units?: Resolver; - chainName?: Resolver; + offers?: Resolver>, ParentType, ContextType, RequireFields>; + graphName?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }>; @@ -761,23 +1411,53 @@ export interface Int8ScalarConfig extends GraphQLScalarTypeConfig = ResolversObject<{ +export type OfferResolvers = ResolversObject<{ + id?: Resolver; + fractionID?: Resolver; + unitsAvailable?: Resolver; + minUnitsPerTrade?: Resolver; + maxUnitsPerTrade?: Resolver; + status?: Resolver; + acceptedTokens?: Resolver, ParentType, ContextType, RequireFields>; + __isTypeOf?: IsTypeOfResolverFn; +}>; + +export type TokenResolvers = ResolversObject<{ + id?: Resolver; + name?: Resolver; + symbol?: Resolver, ParentType, ContextType>; + decimals?: Resolver, ParentType, ContextType>; + __isTypeOf?: IsTypeOfResolverFn; +}>; + +export type TradeResolvers = ResolversObject<{ + id?: Resolver; + buyer?: Resolver; + offerID?: Resolver; + unitsSold?: Resolver; + token?: Resolver; + amountPerUnit?: Resolver; + __isTypeOf?: IsTypeOfResolverFn; +}>; + +export type _Block_Resolvers = ResolversObject<{ hash?: Resolver, ParentType, ContextType>; number?: Resolver; timestamp?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }>; -export type _Meta_Resolvers = ResolversObject<{ +export type _Meta_Resolvers = ResolversObject<{ block?: Resolver; deployment?: Resolver; hasIndexingErrors?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }>; -export type Resolvers = ResolversObject<{ +export type Resolvers = ResolversObject<{ Query?: QueryResolvers; Subscription?: SubscriptionResolvers; + AcceptedToken?: AcceptedTokenResolvers; Allowlist?: AllowlistResolvers; BigDecimal?: GraphQLScalarType; BigInt?: GraphQLScalarType; @@ -785,11 +1465,14 @@ export type Resolvers; ClaimToken?: ClaimTokenResolvers; Int8?: GraphQLScalarType; + Offer?: OfferResolvers; + Token?: TokenResolvers; + Trade?: TradeResolvers; _Block_?: _Block_Resolvers; _Meta_?: _Meta_Resolvers; }>; -export type DirectiveResolvers = ResolversObject<{ +export type DirectiveResolvers = ResolversObject<{ entity?: entityDirectiveResolver; subgraphId?: subgraphIdDirectiveResolver; derivedFrom?: derivedFromDirectiveResolver; @@ -840,7 +1523,7 @@ const additionalEnvelopPlugins: MeshPlugin[] = []; const hypercertsTransforms = []; const hypercertsHandler = new GraphqlHandler({ name: "Hypercerts", - config: {"endpoint":"{context.graphUrl:https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-testnet}"}, + config: {"endpoint":"https://api.thegraph.com/subgraphs/name/hypercerts-admin/{context.graphName:hypercerts-testnet}"}, baseDir, cache, pubsub, @@ -853,7 +1536,7 @@ sources[0] = { handler: hypercertsHandler, transforms: hypercertsTransforms } -const additionalTypeDefs = [parse("extend type Claim {\n chainName: String!\n}\n\nextend type ClaimToken {\n chainName: String!\n}"),] as any[]; +const additionalTypeDefs = [parse("extend type Claim {\n graphName: String!\n}\n\nextend type ClaimToken {\n graphName: String!\n}"),] as any[]; additionalEnvelopPlugins[0] = await UsePollingLive({ ...({ "defaultInterval": 5000 @@ -969,7 +1652,7 @@ export type ClaimsByOwnerQueryVariables = Exact<{ }>; -export type ClaimsByOwnerQuery = { claims: Array> }; +export type ClaimsByOwnerQuery = { claims: Array> }; export type RecentClaimsQueryVariables = Exact<{ orderDirection?: InputMaybe; @@ -978,14 +1661,14 @@ export type RecentClaimsQueryVariables = Exact<{ }>; -export type RecentClaimsQuery = { claims: Array> }; +export type RecentClaimsQuery = { claims: Array> }; export type ClaimByIdQueryVariables = Exact<{ id: Scalars['ID']; }>; -export type ClaimByIdQuery = { claim?: Maybe> }; +export type ClaimByIdQuery = { claim?: Maybe> }; export type ClaimTokensByOwnerQueryVariables = Exact<{ owner?: InputMaybe; @@ -996,7 +1679,7 @@ export type ClaimTokensByOwnerQueryVariables = Exact<{ export type ClaimTokensByOwnerQuery = { claimTokens: Array<( - Pick + Pick & { claim: Pick } )> }; @@ -1008,7 +1691,7 @@ export type ClaimTokensByClaimQueryVariables = Exact<{ }>; -export type ClaimTokensByClaimQuery = { claimTokens: Array> }; +export type ClaimTokensByClaimQuery = { claimTokens: Array> }; export type ClaimTokenByIdQueryVariables = Exact<{ claimTokenId: Scalars['ID']; @@ -1016,7 +1699,7 @@ export type ClaimTokenByIdQueryVariables = Exact<{ export type ClaimTokenByIdQuery = { claimToken?: Maybe<( - Pick + Pick & { claim: Pick } )> }; @@ -1029,7 +1712,7 @@ export const ClaimsByOwnerDocument = gql` first: $first orderDirection: $orderDirection ) { - chainName + graphName contract tokenID creator @@ -1043,7 +1726,7 @@ export const ClaimsByOwnerDocument = gql` export const RecentClaimsDocument = gql` query RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) { claims(orderDirection: $orderDirection, orderBy: creation, first: $first) { - chainName + graphName contract tokenID creator @@ -1057,7 +1740,7 @@ export const RecentClaimsDocument = gql` export const ClaimByIdDocument = gql` query ClaimById($id: ID!) { claim(id: $id) { - chainName + graphName contract tokenID creator @@ -1076,7 +1759,7 @@ export const ClaimTokensByOwnerDocument = gql` first: $first orderDirection: $orderDirection ) { - chainName + graphName id owner tokenID @@ -1098,7 +1781,7 @@ export const ClaimTokensByClaimDocument = gql` first: $first orderDirection: $orderDirection ) { - chainName + graphName id owner tokenID @@ -1109,7 +1792,7 @@ export const ClaimTokensByClaimDocument = gql` export const ClaimTokenByIdDocument = gql` query ClaimTokenById($claimTokenId: ID!) { claimToken(id: $claimTokenId) { - chainName + graphName id owner tokenID diff --git a/sdk/.graphclient/schema.graphql b/sdk/.graphclient/schema.graphql index 8694426f..8eb86ef5 100644 --- a/sdk/.graphclient/schema.graphql +++ b/sdk/.graphclient/schema.graphql @@ -91,6 +91,110 @@ type Query { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [ClaimToken!]! + token( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Token + tokens( + skip: Int = 0 + first: Int = 100 + orderBy: Token_orderBy + orderDirection: OrderDirection + where: Token_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Token!]! + acceptedToken( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): AcceptedToken + acceptedTokens( + skip: Int = 0 + first: Int = 100 + orderBy: AcceptedToken_orderBy + orderDirection: OrderDirection + where: AcceptedToken_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [AcceptedToken!]! + offer( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Offer + offers( + skip: Int = 0 + first: Int = 100 + orderBy: Offer_orderBy + orderDirection: OrderDirection + where: Offer_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Offer!]! + trade( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Trade + trades( + skip: Int = 0 + first: Int = 100 + orderBy: Trade_orderBy + orderDirection: OrderDirection + where: Trade_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Trade!]! """Access to subgraph metadata""" _meta(block: Block_height): _Meta_ } @@ -174,10 +278,192 @@ type Subscription { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [ClaimToken!]! + token( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Token + tokens( + skip: Int = 0 + first: Int = 100 + orderBy: Token_orderBy + orderDirection: OrderDirection + where: Token_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Token!]! + acceptedToken( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): AcceptedToken + acceptedTokens( + skip: Int = 0 + first: Int = 100 + orderBy: AcceptedToken_orderBy + orderDirection: OrderDirection + where: AcceptedToken_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [AcceptedToken!]! + offer( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Offer + offers( + skip: Int = 0 + first: Int = 100 + orderBy: Offer_orderBy + orderDirection: OrderDirection + where: Offer_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Offer!]! + trade( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Trade + trades( + skip: Int = 0 + first: Int = 100 + orderBy: Trade_orderBy + orderDirection: OrderDirection + where: Trade_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Trade!]! """Access to subgraph metadata""" _meta(block: Block_height): _Meta_ } +type AcceptedToken { + id: String! + token: Token! + minimumAmountPerUnit: BigInt! + accepted: Boolean! +} + +input AcceptedToken_filter { + id: String + id_not: String + id_gt: String + id_lt: String + id_gte: String + id_lte: String + id_in: [String!] + id_not_in: [String!] + id_contains: String + id_contains_nocase: String + id_not_contains: String + id_not_contains_nocase: String + id_starts_with: String + id_starts_with_nocase: String + id_not_starts_with: String + id_not_starts_with_nocase: String + id_ends_with: String + id_ends_with_nocase: String + id_not_ends_with: String + id_not_ends_with_nocase: String + token: String + token_not: String + token_gt: String + token_lt: String + token_gte: String + token_lte: String + token_in: [String!] + token_not_in: [String!] + token_contains: String + token_contains_nocase: String + token_not_contains: String + token_not_contains_nocase: String + token_starts_with: String + token_starts_with_nocase: String + token_not_starts_with: String + token_not_starts_with_nocase: String + token_ends_with: String + token_ends_with_nocase: String + token_not_ends_with: String + token_not_ends_with_nocase: String + token_: Token_filter + minimumAmountPerUnit: BigInt + minimumAmountPerUnit_not: BigInt + minimumAmountPerUnit_gt: BigInt + minimumAmountPerUnit_lt: BigInt + minimumAmountPerUnit_gte: BigInt + minimumAmountPerUnit_lte: BigInt + minimumAmountPerUnit_in: [BigInt!] + minimumAmountPerUnit_not_in: [BigInt!] + accepted: Boolean + accepted_not: Boolean + accepted_in: [Boolean!] + accepted_not_in: [Boolean!] + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [AcceptedToken_filter] + or: [AcceptedToken_filter] +} + +enum AcceptedToken_orderBy { + id + token + token__id + token__name + token__symbol + token__decimals + minimumAmountPerUnit + accepted +} + type Allowlist { id: String! root: Bytes! @@ -281,7 +567,8 @@ type Claim { creator: Bytes owner: Bytes totalUnits: BigInt - chainName: String! + allowlist: Allowlist + graphName: String! } type ClaimToken { @@ -290,7 +577,8 @@ type ClaimToken { claim: Claim! owner: Bytes! units: BigInt! - chainName: String! + offers(skip: Int = 0, first: Int = 100, orderBy: Offer_orderBy, orderDirection: OrderDirection, where: Offer_filter): [Offer!] + graphName: String! } input ClaimToken_filter { @@ -361,6 +649,7 @@ input ClaimToken_filter { units_lte: BigInt units_in: [BigInt!] units_not_in: [BigInt!] + offers_: Offer_filter """Filter for the block changed event.""" _change_block: BlockChangedFilter and: [ClaimToken_filter] @@ -381,6 +670,7 @@ enum ClaimToken_orderBy { claim__totalUnits owner units + offers } input Claim_filter { @@ -488,6 +778,27 @@ input Claim_filter { totalUnits_lte: BigInt totalUnits_in: [BigInt!] totalUnits_not_in: [BigInt!] + allowlist: String + allowlist_not: String + allowlist_gt: String + allowlist_lt: String + allowlist_gte: String + allowlist_lte: String + allowlist_in: [String!] + allowlist_not_in: [String!] + allowlist_contains: String + allowlist_contains_nocase: String + allowlist_not_contains: String + allowlist_not_contains_nocase: String + allowlist_starts_with: String + allowlist_starts_with_nocase: String + allowlist_not_starts_with: String + allowlist_not_starts_with_nocase: String + allowlist_ends_with: String + allowlist_ends_with_nocase: String + allowlist_not_ends_with: String + allowlist_not_ends_with_nocase: String + allowlist_: Allowlist_filter """Filter for the block changed event.""" _change_block: BlockChangedFilter and: [Claim_filter] @@ -503,6 +814,9 @@ enum Claim_orderBy { creator owner totalUnits + allowlist + allowlist__id + allowlist__root } """ @@ -511,12 +825,336 @@ enum Claim_orderBy { """ scalar Int8 +type Offer { + id: String! + fractionID: ClaimToken! + unitsAvailable: BigInt! + minUnitsPerTrade: BigInt! + maxUnitsPerTrade: BigInt! + status: OfferStatus! + acceptedTokens(skip: Int = 0, first: Int = 100, orderBy: AcceptedToken_orderBy, orderDirection: OrderDirection, where: AcceptedToken_filter): [AcceptedToken!]! +} + +enum OfferStatus { + Open + Fulfilled + Cancelled +} + +input Offer_filter { + id: String + id_not: String + id_gt: String + id_lt: String + id_gte: String + id_lte: String + id_in: [String!] + id_not_in: [String!] + id_contains: String + id_contains_nocase: String + id_not_contains: String + id_not_contains_nocase: String + id_starts_with: String + id_starts_with_nocase: String + id_not_starts_with: String + id_not_starts_with_nocase: String + id_ends_with: String + id_ends_with_nocase: String + id_not_ends_with: String + id_not_ends_with_nocase: String + fractionID: String + fractionID_not: String + fractionID_gt: String + fractionID_lt: String + fractionID_gte: String + fractionID_lte: String + fractionID_in: [String!] + fractionID_not_in: [String!] + fractionID_contains: String + fractionID_contains_nocase: String + fractionID_not_contains: String + fractionID_not_contains_nocase: String + fractionID_starts_with: String + fractionID_starts_with_nocase: String + fractionID_not_starts_with: String + fractionID_not_starts_with_nocase: String + fractionID_ends_with: String + fractionID_ends_with_nocase: String + fractionID_not_ends_with: String + fractionID_not_ends_with_nocase: String + fractionID_: ClaimToken_filter + unitsAvailable: BigInt + unitsAvailable_not: BigInt + unitsAvailable_gt: BigInt + unitsAvailable_lt: BigInt + unitsAvailable_gte: BigInt + unitsAvailable_lte: BigInt + unitsAvailable_in: [BigInt!] + unitsAvailable_not_in: [BigInt!] + minUnitsPerTrade: BigInt + minUnitsPerTrade_not: BigInt + minUnitsPerTrade_gt: BigInt + minUnitsPerTrade_lt: BigInt + minUnitsPerTrade_gte: BigInt + minUnitsPerTrade_lte: BigInt + minUnitsPerTrade_in: [BigInt!] + minUnitsPerTrade_not_in: [BigInt!] + maxUnitsPerTrade: BigInt + maxUnitsPerTrade_not: BigInt + maxUnitsPerTrade_gt: BigInt + maxUnitsPerTrade_lt: BigInt + maxUnitsPerTrade_gte: BigInt + maxUnitsPerTrade_lte: BigInt + maxUnitsPerTrade_in: [BigInt!] + maxUnitsPerTrade_not_in: [BigInt!] + status: OfferStatus + status_not: OfferStatus + status_in: [OfferStatus!] + status_not_in: [OfferStatus!] + acceptedTokens: [String!] + acceptedTokens_not: [String!] + acceptedTokens_contains: [String!] + acceptedTokens_contains_nocase: [String!] + acceptedTokens_not_contains: [String!] + acceptedTokens_not_contains_nocase: [String!] + acceptedTokens_: AcceptedToken_filter + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Offer_filter] + or: [Offer_filter] +} + +enum Offer_orderBy { + id + fractionID + fractionID__id + fractionID__tokenID + fractionID__owner + fractionID__units + unitsAvailable + minUnitsPerTrade + maxUnitsPerTrade + status + acceptedTokens +} + """Defines the order direction, either ascending or descending""" enum OrderDirection { asc desc } +type Token { + id: String! + name: String! + symbol: String + decimals: BigInt +} + +input Token_filter { + id: String + id_not: String + id_gt: String + id_lt: String + id_gte: String + id_lte: String + id_in: [String!] + id_not_in: [String!] + id_contains: String + id_contains_nocase: String + id_not_contains: String + id_not_contains_nocase: String + id_starts_with: String + id_starts_with_nocase: String + id_not_starts_with: String + id_not_starts_with_nocase: String + id_ends_with: String + id_ends_with_nocase: String + id_not_ends_with: String + id_not_ends_with_nocase: String + name: String + name_not: String + name_gt: String + name_lt: String + name_gte: String + name_lte: String + name_in: [String!] + name_not_in: [String!] + name_contains: String + name_contains_nocase: String + name_not_contains: String + name_not_contains_nocase: String + name_starts_with: String + name_starts_with_nocase: String + name_not_starts_with: String + name_not_starts_with_nocase: String + name_ends_with: String + name_ends_with_nocase: String + name_not_ends_with: String + name_not_ends_with_nocase: String + symbol: String + symbol_not: String + symbol_gt: String + symbol_lt: String + symbol_gte: String + symbol_lte: String + symbol_in: [String!] + symbol_not_in: [String!] + symbol_contains: String + symbol_contains_nocase: String + symbol_not_contains: String + symbol_not_contains_nocase: String + symbol_starts_with: String + symbol_starts_with_nocase: String + symbol_not_starts_with: String + symbol_not_starts_with_nocase: String + symbol_ends_with: String + symbol_ends_with_nocase: String + symbol_not_ends_with: String + symbol_not_ends_with_nocase: String + decimals: BigInt + decimals_not: BigInt + decimals_gt: BigInt + decimals_lt: BigInt + decimals_gte: BigInt + decimals_lte: BigInt + decimals_in: [BigInt!] + decimals_not_in: [BigInt!] + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Token_filter] + or: [Token_filter] +} + +enum Token_orderBy { + id + name + symbol + decimals +} + +type Trade { + id: String! + buyer: Bytes! + offerID: Offer! + unitsSold: BigInt! + token: Token! + amountPerUnit: BigInt! +} + +input Trade_filter { + id: String + id_not: String + id_gt: String + id_lt: String + id_gte: String + id_lte: String + id_in: [String!] + id_not_in: [String!] + id_contains: String + id_contains_nocase: String + id_not_contains: String + id_not_contains_nocase: String + id_starts_with: String + id_starts_with_nocase: String + id_not_starts_with: String + id_not_starts_with_nocase: String + id_ends_with: String + id_ends_with_nocase: String + id_not_ends_with: String + id_not_ends_with_nocase: String + buyer: Bytes + buyer_not: Bytes + buyer_gt: Bytes + buyer_lt: Bytes + buyer_gte: Bytes + buyer_lte: Bytes + buyer_in: [Bytes!] + buyer_not_in: [Bytes!] + buyer_contains: Bytes + buyer_not_contains: Bytes + offerID: String + offerID_not: String + offerID_gt: String + offerID_lt: String + offerID_gte: String + offerID_lte: String + offerID_in: [String!] + offerID_not_in: [String!] + offerID_contains: String + offerID_contains_nocase: String + offerID_not_contains: String + offerID_not_contains_nocase: String + offerID_starts_with: String + offerID_starts_with_nocase: String + offerID_not_starts_with: String + offerID_not_starts_with_nocase: String + offerID_ends_with: String + offerID_ends_with_nocase: String + offerID_not_ends_with: String + offerID_not_ends_with_nocase: String + offerID_: Offer_filter + unitsSold: BigInt + unitsSold_not: BigInt + unitsSold_gt: BigInt + unitsSold_lt: BigInt + unitsSold_gte: BigInt + unitsSold_lte: BigInt + unitsSold_in: [BigInt!] + unitsSold_not_in: [BigInt!] + token: String + token_not: String + token_gt: String + token_lt: String + token_gte: String + token_lte: String + token_in: [String!] + token_not_in: [String!] + token_contains: String + token_contains_nocase: String + token_not_contains: String + token_not_contains_nocase: String + token_starts_with: String + token_starts_with_nocase: String + token_not_starts_with: String + token_not_starts_with_nocase: String + token_ends_with: String + token_ends_with_nocase: String + token_not_ends_with: String + token_not_ends_with_nocase: String + token_: Token_filter + amountPerUnit: BigInt + amountPerUnit_not: BigInt + amountPerUnit_gt: BigInt + amountPerUnit_lt: BigInt + amountPerUnit_gte: BigInt + amountPerUnit_lte: BigInt + amountPerUnit_in: [BigInt!] + amountPerUnit_not_in: [BigInt!] + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Trade_filter] + or: [Trade_filter] +} + +enum Trade_orderBy { + id + buyer + offerID + offerID__id + offerID__unitsAvailable + offerID__minUnitsPerTrade + offerID__maxUnitsPerTrade + offerID__status + unitsSold + token + token__id + token__name + token__symbol + token__decimals + amountPerUnit +} + type _Block_ { """The hash of the block""" hash: Bytes diff --git a/sdk/.graphclient/sources/Hypercerts/introspectionSchema.ts b/sdk/.graphclient/sources/Hypercerts/introspectionSchema.ts index 68838c80..0078e3f1 100644 --- a/sdk/.graphclient/sources/Hypercerts/introspectionSchema.ts +++ b/sdk/.graphclient/sources/Hypercerts/introspectionSchema.ts @@ -131,7 +131,7 @@ const schemaAST = { "kind": "ObjectTypeDefinition", "name": { "kind": "Name", - "value": "Allowlist" + "value": "AcceptedToken" }, "fields": [ { @@ -157,7 +157,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "root" + "value": "token" }, "arguments": [], "type": { @@ -166,7 +166,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "Token" } } }, @@ -176,7 +176,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "claim" + "value": "minimumAmountPerUnit" }, "arguments": [], "type": { @@ -185,7 +185,26 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Claim" + "value": "BigInt" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "accepted" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Boolean" } } }, @@ -199,7 +218,7 @@ const schemaAST = { "kind": "InputObjectTypeDefinition", "name": { "kind": "Name", - "value": "Allowlist_filter" + "value": "AcceptedToken_filter" }, "fields": [ { @@ -518,13 +537,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "root" + "value": "token" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -533,13 +552,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "root_not" + "value": "token_not" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -548,13 +567,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "root_gt" + "value": "token_gt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -563,13 +582,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "root_lt" + "value": "token_lt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -578,13 +597,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "root_gte" + "value": "token_gte" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -593,13 +612,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "root_lte" + "value": "token_lte" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -608,7 +627,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "root_in" + "value": "token_in" }, "type": { "kind": "ListType", @@ -618,7 +637,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } } } @@ -629,7 +648,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "root_not_in" + "value": "token_not_in" }, "type": { "kind": "ListType", @@ -639,7 +658,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } } } @@ -650,13 +669,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "root_contains" + "value": "token_contains" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -665,13 +684,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "root_not_contains" + "value": "token_contains_nocase" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -680,7 +699,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim" + "value": "token_not_contains" }, "type": { "kind": "NamedType", @@ -695,7 +714,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_not" + "value": "token_not_contains_nocase" }, "type": { "kind": "NamedType", @@ -710,7 +729,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_gt" + "value": "token_starts_with" }, "type": { "kind": "NamedType", @@ -725,7 +744,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_lt" + "value": "token_starts_with_nocase" }, "type": { "kind": "NamedType", @@ -740,7 +759,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_gte" + "value": "token_not_starts_with" }, "type": { "kind": "NamedType", @@ -755,7 +774,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_lte" + "value": "token_not_starts_with_nocase" }, "type": { "kind": "NamedType", @@ -770,19 +789,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_in" + "value": "token_ends_with" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] @@ -791,19 +804,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_not_in" + "value": "token_ends_with_nocase" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] @@ -812,7 +819,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_contains" + "value": "token_not_ends_with" }, "type": { "kind": "NamedType", @@ -827,7 +834,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_contains_nocase" + "value": "token_not_ends_with_nocase" }, "type": { "kind": "NamedType", @@ -842,13 +849,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_not_contains" + "value": "token_" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Token_filter" } }, "directives": [] @@ -857,13 +864,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_not_contains_nocase" + "value": "minimumAmountPerUnit" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BigInt" } }, "directives": [] @@ -872,13 +879,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_starts_with" + "value": "minimumAmountPerUnit_not" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BigInt" } }, "directives": [] @@ -887,13 +894,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_starts_with_nocase" + "value": "minimumAmountPerUnit_gt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BigInt" } }, "directives": [] @@ -902,13 +909,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_not_starts_with" + "value": "minimumAmountPerUnit_lt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BigInt" } }, "directives": [] @@ -917,13 +924,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_not_starts_with_nocase" + "value": "minimumAmountPerUnit_gte" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BigInt" } }, "directives": [] @@ -932,13 +939,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_ends_with" + "value": "minimumAmountPerUnit_lte" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BigInt" } }, "directives": [] @@ -947,13 +954,19 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_ends_with_nocase" + "value": "minimumAmountPerUnit_in" }, "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } } }, "directives": [] @@ -962,13 +975,19 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_not_ends_with" + "value": "minimumAmountPerUnit_not_in" }, "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } } }, "directives": [] @@ -977,13 +996,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_not_ends_with_nocase" + "value": "accepted" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Boolean" } }, "directives": [] @@ -992,13 +1011,55 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_" + "value": "accepted_not" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Claim_filter" + "value": "Boolean" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "accepted_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Boolean" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "accepted_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Boolean" + } + } } }, "directives": [] @@ -1035,7 +1096,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Allowlist_filter" + "value": "AcceptedToken_filter" } } }, @@ -1053,7 +1114,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Allowlist_filter" + "value": "AcceptedToken_filter" } } }, @@ -1066,7 +1127,7 @@ const schemaAST = { "kind": "EnumTypeDefinition", "name": { "kind": "Name", - "value": "Allowlist_orderBy" + "value": "AcceptedToken_orderBy" }, "values": [ { @@ -1081,7 +1142,7 @@ const schemaAST = { "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "root" + "value": "token" }, "directives": [] }, @@ -1089,7 +1150,7 @@ const schemaAST = { "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim" + "value": "token__id" }, "directives": [] }, @@ -1097,7 +1158,7 @@ const schemaAST = { "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim__id" + "value": "token__name" }, "directives": [] }, @@ -1105,7 +1166,7 @@ const schemaAST = { "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim__creation" + "value": "token__symbol" }, "directives": [] }, @@ -1113,7 +1174,7 @@ const schemaAST = { "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim__tokenID" + "value": "token__decimals" }, "directives": [] }, @@ -1121,7 +1182,7 @@ const schemaAST = { "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim__contract" + "value": "minimumAmountPerUnit" }, "directives": [] }, @@ -1129,99 +1190,114 @@ const schemaAST = { "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim__uri" + "value": "accepted" }, "directives": [] - }, + } + ], + "directives": [] + }, + { + "kind": "ObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Allowlist" + }, + "fields": [ { - "kind": "EnumValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "claim__creator" + "value": "id" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } }, "directives": [] }, { - "kind": "EnumValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "claim__owner" + "value": "root" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } }, "directives": [] }, { - "kind": "EnumValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "claim__totalUnits" + "value": "claim" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Claim" + } + } }, "directives": [] } ], + "interfaces": [], "directives": [] }, { - "kind": "ScalarTypeDefinition", + "kind": "InputObjectTypeDefinition", "name": { "kind": "Name", - "value": "BigDecimal" - }, - "directives": [] - }, - { - "kind": "ScalarTypeDefinition", - "name": { - "kind": "Name", - "value": "BigInt" - }, - "directives": [] - }, - { - "kind": "InputObjectTypeDefinition", - "name": { - "kind": "Name", - "value": "BlockChangedFilter" + "value": "Allowlist_filter" }, "fields": [ { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "number_gte" + "value": "id" }, "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Int" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] - } - ], - "directives": [] - }, - { - "kind": "InputObjectTypeDefinition", - "name": { - "kind": "Name", - "value": "Block_height" - }, - "fields": [ + }, { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "hash" + "value": "id_not" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -1230,13 +1306,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "number" + "value": "id_gt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "String" } }, "directives": [] @@ -1245,118 +1321,95 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "number_gte" + "value": "id_lt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "String" } }, "directives": [] - } - ], - "directives": [] - }, - { - "kind": "ScalarTypeDefinition", - "name": { - "kind": "Name", - "value": "Bytes" - }, - "directives": [] - }, - { - "kind": "ObjectTypeDefinition", - "name": { - "kind": "Name", - "value": "Claim" - }, - "fields": [ + }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id" + "value": "id_gte" }, - "arguments": [], "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creation" + "value": "id_lte" }, - "arguments": [], "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID" + "value": "id_in" }, - "arguments": [], "type": { - "kind": "NonNullType", + "kind": "ListType", "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } } } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract" + "value": "id_not_in" }, - "arguments": [], "type": { - "kind": "NonNullType", + "kind": "ListType", "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } } } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "uri" + "value": "id_contains" }, - "arguments": [], "type": { "kind": "NamedType", "name": { @@ -1367,175 +1420,130 @@ const schemaAST = { "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creator" + "value": "id_contains_nocase" }, - "arguments": [], "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner" + "value": "id_not_contains" }, - "arguments": [], "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "totalUnits" + "value": "id_not_contains_nocase" }, - "arguments": [], "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] - } - ], - "interfaces": [], - "directives": [] - }, - { - "kind": "ObjectTypeDefinition", - "name": { - "kind": "Name", - "value": "ClaimToken" - }, - "fields": [ + }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id" + "value": "id_starts_with" }, - "arguments": [], "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID" + "value": "id_starts_with_nocase" }, - "arguments": [], "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim" + "value": "id_not_starts_with" }, - "arguments": [], "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Claim" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner" + "value": "id_not_starts_with_nocase" }, - "arguments": [], "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "units" + "value": "id_ends_with" }, - "arguments": [], "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] - } - ], - "interfaces": [], - "directives": [] - }, - { - "kind": "InputObjectTypeDefinition", - "name": { - "kind": "Name", - "value": "ClaimToken_filter" - }, - "fields": [ + }, { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id" + "value": "id_ends_with_nocase" }, "type": { "kind": "NamedType", @@ -1550,7 +1558,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_not" + "value": "id_not_ends_with" }, "type": { "kind": "NamedType", @@ -1565,7 +1573,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_gt" + "value": "id_not_ends_with_nocase" }, "type": { "kind": "NamedType", @@ -1580,13 +1588,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_lt" + "value": "root" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -1595,13 +1603,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_gte" + "value": "root_not" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -1610,13 +1618,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_lte" + "value": "root_gt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -1625,19 +1633,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_in" + "value": "root_lt" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" } }, "directives": [] @@ -1646,19 +1648,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_not_in" + "value": "root_gte" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" } }, "directives": [] @@ -1667,13 +1663,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_contains" + "value": "root_lte" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -1682,13 +1678,19 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_contains_nocase" + "value": "root_in" }, "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } } }, "directives": [] @@ -1697,13 +1699,19 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_not_contains" + "value": "root_not_in" }, "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } } }, "directives": [] @@ -1712,13 +1720,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_not_contains_nocase" + "value": "root_contains" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -1727,13 +1735,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_starts_with" + "value": "root_not_contains" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -1742,7 +1750,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_starts_with_nocase" + "value": "claim" }, "type": { "kind": "NamedType", @@ -1757,7 +1765,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_not_starts_with" + "value": "claim_not" }, "type": { "kind": "NamedType", @@ -1772,7 +1780,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_not_starts_with_nocase" + "value": "claim_gt" }, "type": { "kind": "NamedType", @@ -1787,7 +1795,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_ends_with" + "value": "claim_lt" }, "type": { "kind": "NamedType", @@ -1802,7 +1810,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_ends_with_nocase" + "value": "claim_gte" }, "type": { "kind": "NamedType", @@ -1817,7 +1825,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_not_ends_with" + "value": "claim_lte" }, "type": { "kind": "NamedType", @@ -1832,13 +1840,19 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "id_not_ends_with_nocase" + "value": "claim_in" }, "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } } }, "directives": [] @@ -1847,13 +1861,19 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID" + "value": "claim_not_in" }, "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } } }, "directives": [] @@ -1862,13 +1882,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_not" + "value": "claim_contains" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -1877,13 +1897,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_gt" + "value": "claim_contains_nocase" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -1892,13 +1912,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_lt" + "value": "claim_not_contains" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -1907,13 +1927,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_gte" + "value": "claim_not_contains_nocase" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -1922,13 +1942,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_lte" + "value": "claim_starts_with" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -1937,19 +1957,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_in" + "value": "claim_starts_with_nocase" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] @@ -1958,19 +1972,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_not_in" + "value": "claim_not_starts_with" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] @@ -1979,7 +1987,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim" + "value": "claim_not_starts_with_nocase" }, "type": { "kind": "NamedType", @@ -1994,7 +2002,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_not" + "value": "claim_ends_with" }, "type": { "kind": "NamedType", @@ -2009,7 +2017,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_gt" + "value": "claim_ends_with_nocase" }, "type": { "kind": "NamedType", @@ -2024,7 +2032,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_lt" + "value": "claim_not_ends_with" }, "type": { "kind": "NamedType", @@ -2039,7 +2047,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_gte" + "value": "claim_not_ends_with_nocase" }, "type": { "kind": "NamedType", @@ -2054,34 +2062,33 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_lte" + "value": "claim_" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Claim_filter" } }, "directives": [] }, { "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Filter for the block changed event.", + "block": true + }, "name": { "kind": "Name", - "value": "claim_in" + "value": "_change_block" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BlockChangedFilter" } }, "directives": [] @@ -2090,18 +2097,15 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_not_in" + "value": "and" }, "type": { "kind": "ListType", "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Allowlist_filter" } } }, @@ -2111,202 +2115,177 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_contains" + "value": "or" }, "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Allowlist_filter" + } } }, "directives": [] - }, + } + ], + "directives": [] + }, + { + "kind": "EnumTypeDefinition", + "name": { + "kind": "Name", + "value": "Allowlist_orderBy" + }, + "values": [ { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim_contains_nocase" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "id" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim_not_contains" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "root" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim_not_contains_nocase" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "claim" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim_starts_with" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "claim__id" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim_starts_with_nocase" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "claim__creation" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim_not_starts_with" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "claim__tokenID" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim_not_starts_with_nocase" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "claim__contract" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim_ends_with" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "claim__uri" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim_ends_with_nocase" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "claim__creator" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim_not_ends_with" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "claim__owner" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "claim_not_ends_with_nocase" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "claim__totalUnits" }, "directives": [] - }, + } + ], + "directives": [] + }, + { + "kind": "ScalarTypeDefinition", + "name": { + "kind": "Name", + "value": "BigDecimal" + }, + "directives": [] + }, + { + "kind": "ScalarTypeDefinition", + "name": { + "kind": "Name", + "value": "BigInt" + }, + "directives": [] + }, + { + "kind": "InputObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "BlockChangedFilter" + }, + "fields": [ { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim_" + "value": "number_gte" }, "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Claim_filter" + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } } }, "directives": [] - }, + } + ], + "directives": [] + }, + { + "kind": "InputObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Block_height" + }, + "fields": [ { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner" + "value": "hash" }, "type": { "kind": "NamedType", @@ -2321,13 +2300,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner_not" + "value": "number" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "Int" } }, "directives": [] @@ -2336,125 +2315,134 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner_gt" + "value": "number_gte" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "Int" } }, "directives": [] - }, + } + ], + "directives": [] + }, + { + "kind": "ScalarTypeDefinition", + "name": { + "kind": "Name", + "value": "Bytes" + }, + "directives": [] + }, + { + "kind": "ObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Claim" + }, + "fields": [ { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "owner_lt" + "value": "id" }, + "arguments": [], "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } } }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "owner_gte" + "value": "creation" }, + "arguments": [], "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "owner_lte" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } } }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "owner_in" + "value": "tokenID" }, + "arguments": [], "type": { - "kind": "ListType", + "kind": "NonNullType", "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" } } }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "owner_not_in" + "value": "contract" }, + "arguments": [], "type": { - "kind": "ListType", + "kind": "NonNullType", "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } } }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "owner_contains" + "value": "uri" }, + "arguments": [], "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "owner_not_contains" + "value": "creator" }, + "arguments": [], "type": { "kind": "NamedType", "name": { @@ -2465,71 +2453,28 @@ const schemaAST = { "directives": [] }, { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "units" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "units_not" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "units_gt" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "units_lt" + "value": "owner" }, + "arguments": [], "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "Bytes" } }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "units_gte" + "value": "totalUnits" }, + "arguments": [], "type": { "kind": "NamedType", "name": { @@ -2540,240 +2485,242 @@ const schemaAST = { "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "units_lte" + "value": "allowlist" }, + "arguments": [], "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "Allowlist" } }, "directives": [] - }, + } + ], + "interfaces": [], + "directives": [] + }, + { + "kind": "ObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "ClaimToken" + }, + "fields": [ { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "units_in" + "value": "id" }, + "arguments": [], "type": { - "kind": "ListType", + "kind": "NonNullType", "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } } }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "units_not_in" + "value": "tokenID" }, + "arguments": [], "type": { - "kind": "ListType", + "kind": "NonNullType", "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" } } }, "directives": [] }, { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Filter for the block changed event.", - "block": true - }, + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "_change_block" + "value": "claim" }, + "arguments": [], "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BlockChangedFilter" + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Claim" + } } }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "and" + "value": "owner" }, + "arguments": [], "type": { - "kind": "ListType", + "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "ClaimToken_filter" + "value": "Bytes" } } }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "or" + "value": "units" }, + "arguments": [], "type": { - "kind": "ListType", + "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "ClaimToken_filter" + "value": "BigInt" } } }, "directives": [] - } - ], - "directives": [] - }, - { - "kind": "EnumTypeDefinition", - "name": { - "kind": "Name", - "value": "ClaimToken_orderBy" - }, - "values": [ - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "id" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "tokenID" - }, - "directives": [] }, { - "kind": "EnumValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "claim" + "value": "offers" }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "claim__id" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "claim__creation" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "claim__tokenID" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "claim__contract" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "claim__uri" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "claim__creator" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "claim__owner" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "claim__totalUnits" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "owner" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "units" + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer_filter" + } + }, + "directives": [] + } + ], + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer" + } + } + } }, "directives": [] } ], + "interfaces": [], "directives": [] }, { "kind": "InputObjectTypeDefinition", "name": { "kind": "Name", - "value": "Claim_filter" + "value": "ClaimToken_filter" }, "fields": [ { @@ -3092,7 +3039,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creation" + "value": "tokenID" }, "type": { "kind": "NamedType", @@ -3107,7 +3054,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creation_not" + "value": "tokenID_not" }, "type": { "kind": "NamedType", @@ -3122,7 +3069,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creation_gt" + "value": "tokenID_gt" }, "type": { "kind": "NamedType", @@ -3137,7 +3084,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creation_lt" + "value": "tokenID_lt" }, "type": { "kind": "NamedType", @@ -3152,7 +3099,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creation_gte" + "value": "tokenID_gte" }, "type": { "kind": "NamedType", @@ -3167,7 +3114,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creation_lte" + "value": "tokenID_lte" }, "type": { "kind": "NamedType", @@ -3182,7 +3129,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creation_in" + "value": "tokenID_in" }, "type": { "kind": "ListType", @@ -3203,7 +3150,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creation_not_in" + "value": "tokenID_not_in" }, "type": { "kind": "ListType", @@ -3224,13 +3171,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID" + "value": "claim" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -3239,13 +3186,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_not" + "value": "claim_not" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -3254,13 +3201,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_gt" + "value": "claim_gt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -3269,13 +3216,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_lt" + "value": "claim_lt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -3284,13 +3231,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_gte" + "value": "claim_gte" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -3299,13 +3246,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_lte" + "value": "claim_lte" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -3314,7 +3261,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_in" + "value": "claim_in" }, "type": { "kind": "ListType", @@ -3324,7 +3271,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } } } @@ -3335,7 +3282,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID_not_in" + "value": "claim_not_in" }, "type": { "kind": "ListType", @@ -3345,7 +3292,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } } } @@ -3356,7 +3303,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract" + "value": "claim_contains" }, "type": { "kind": "NamedType", @@ -3371,7 +3318,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_not" + "value": "claim_contains_nocase" }, "type": { "kind": "NamedType", @@ -3386,7 +3333,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_gt" + "value": "claim_not_contains" }, "type": { "kind": "NamedType", @@ -3401,7 +3348,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_lt" + "value": "claim_not_contains_nocase" }, "type": { "kind": "NamedType", @@ -3416,7 +3363,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_gte" + "value": "claim_starts_with" }, "type": { "kind": "NamedType", @@ -3431,7 +3378,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_lte" + "value": "claim_starts_with_nocase" }, "type": { "kind": "NamedType", @@ -3446,19 +3393,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_in" + "value": "claim_not_starts_with" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] @@ -3467,19 +3408,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_not_in" + "value": "claim_not_starts_with_nocase" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] @@ -3488,7 +3423,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_contains" + "value": "claim_ends_with" }, "type": { "kind": "NamedType", @@ -3503,7 +3438,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_contains_nocase" + "value": "claim_ends_with_nocase" }, "type": { "kind": "NamedType", @@ -3518,7 +3453,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_not_contains" + "value": "claim_not_ends_with" }, "type": { "kind": "NamedType", @@ -3533,7 +3468,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_not_contains_nocase" + "value": "claim_not_ends_with_nocase" }, "type": { "kind": "NamedType", @@ -3548,13 +3483,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_starts_with" + "value": "claim_" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Claim_filter" } }, "directives": [] @@ -3563,13 +3498,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_starts_with_nocase" + "value": "owner" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -3578,13 +3513,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_not_starts_with" + "value": "owner_not" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -3593,13 +3528,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_not_starts_with_nocase" + "value": "owner_gt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -3608,13 +3543,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_ends_with" + "value": "owner_lt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -3623,13 +3558,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_ends_with_nocase" + "value": "owner_gte" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -3638,13 +3573,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_not_ends_with" + "value": "owner_lte" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -3653,13 +3588,55 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract_not_ends_with_nocase" + "value": "owner_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "owner_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "owner_contains" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -3668,13 +3645,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "uri" + "value": "owner_not_contains" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Bytes" } }, "directives": [] @@ -3683,13 +3660,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "uri_not" + "value": "units" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BigInt" } }, "directives": [] @@ -3698,13 +3675,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "uri_gt" + "value": "units_not" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BigInt" } }, "directives": [] @@ -3713,13 +3690,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "uri_lt" + "value": "units_gt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BigInt" } }, "directives": [] @@ -3728,13 +3705,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "uri_gte" + "value": "units_lt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BigInt" } }, "directives": [] @@ -3743,13 +3720,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "uri_lte" + "value": "units_gte" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BigInt" } }, "directives": [] @@ -3758,7 +3735,22 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "uri_in" + "value": "units_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "units_in" }, "type": { "kind": "ListType", @@ -3768,7 +3760,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BigInt" } } } @@ -3779,7 +3771,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "uri_not_in" + "value": "units_not_in" }, "type": { "kind": "ListType", @@ -3789,7 +3781,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BigInt" } } } @@ -3800,28 +3792,33 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "uri_contains" + "value": "offers_" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "Offer_filter" } }, "directives": [] }, { "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Filter for the block changed event.", + "block": true + }, "name": { "kind": "Name", - "value": "uri_contains_nocase" + "value": "_change_block" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "String" + "value": "BlockChangedFilter" } }, "directives": [] @@ -3830,13 +3827,16 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "uri_not_contains" + "value": "and" }, "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ClaimToken_filter" + } } }, "directives": [] @@ -3845,148 +3845,163 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "uri_not_contains_nocase" + "value": "or" }, "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ClaimToken_filter" + } } }, "directives": [] - }, + } + ], + "directives": [] + }, + { + "kind": "EnumTypeDefinition", + "name": { + "kind": "Name", + "value": "ClaimToken_orderBy" + }, + "values": [ { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "uri_starts_with" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "id" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "uri_starts_with_nocase" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "tokenID" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "uri_not_starts_with" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "claim" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "uri_not_starts_with_nocase" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "claim__id" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "uri_ends_with" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "claim__creation" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "uri_ends_with_nocase" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "value": "claim__tokenID" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "uri_not_ends_with" + "value": "claim__contract" }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "claim__uri" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "uri_not_ends_with_nocase" + "value": "claim__creator" }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "claim__owner" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "claim__totalUnits" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "owner" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "units" }, "directives": [] }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "offers" + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "InputObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Claim_filter" + }, + "fields": [ { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creator" + "value": "id" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -3995,13 +4010,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creator_not" + "value": "id_not" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4010,13 +4025,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creator_gt" + "value": "id_gt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4025,13 +4040,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creator_lt" + "value": "id_lt" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4040,13 +4055,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creator_gte" + "value": "id_gte" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4055,13 +4070,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creator_lte" + "value": "id_lte" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4070,7 +4085,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creator_in" + "value": "id_in" }, "type": { "kind": "ListType", @@ -4080,7 +4095,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } } } @@ -4091,7 +4106,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creator_not_in" + "value": "id_not_in" }, "type": { "kind": "ListType", @@ -4101,7 +4116,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } } } @@ -4112,13 +4127,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creator_contains" + "value": "id_contains" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4127,13 +4142,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creator_not_contains" + "value": "id_contains_nocase" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4142,13 +4157,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner" + "value": "id_not_contains" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4157,13 +4172,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner_not" + "value": "id_not_contains_nocase" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4172,13 +4187,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner_gt" + "value": "id_starts_with" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4187,13 +4202,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner_lt" + "value": "id_starts_with_nocase" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4202,13 +4217,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner_gte" + "value": "id_not_starts_with" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4217,13 +4232,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner_lte" + "value": "id_not_starts_with_nocase" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4232,19 +4247,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner_in" + "value": "id_ends_with" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] @@ -4253,19 +4262,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner_not_in" + "value": "id_ends_with_nocase" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] @@ -4274,13 +4277,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner_contains" + "value": "id_not_ends_with" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4289,13 +4292,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner_not_contains" + "value": "id_not_ends_with_nocase" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "String" } }, "directives": [] @@ -4304,7 +4307,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "totalUnits" + "value": "creation" }, "type": { "kind": "NamedType", @@ -4319,7 +4322,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "totalUnits_not" + "value": "creation_not" }, "type": { "kind": "NamedType", @@ -4334,7 +4337,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "totalUnits_gt" + "value": "creation_gt" }, "type": { "kind": "NamedType", @@ -4349,7 +4352,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "totalUnits_lt" + "value": "creation_lt" }, "type": { "kind": "NamedType", @@ -4364,7 +4367,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "totalUnits_gte" + "value": "creation_gte" }, "type": { "kind": "NamedType", @@ -4379,7 +4382,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "totalUnits_lte" + "value": "creation_lte" }, "type": { "kind": "NamedType", @@ -4394,7 +4397,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "totalUnits_in" + "value": "creation_in" }, "type": { "kind": "ListType", @@ -4415,7 +4418,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "totalUnits_not_in" + "value": "creation_not_in" }, "type": { "kind": "ListType", @@ -4434,20 +4437,15 @@ const schemaAST = { }, { "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Filter for the block changed event.", - "block": true - }, "name": { "kind": "Name", - "value": "_change_block" + "value": "tokenID" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BlockChangedFilter" + "value": "BigInt" } }, "directives": [] @@ -4456,16 +4454,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "and" + "value": "tokenID_not" }, "type": { - "kind": "ListType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Claim_filter" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" } }, "directives": [] @@ -4474,618 +4469,9247 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "or" + "value": "tokenID_gt" }, "type": { - "kind": "ListType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Claim_filter" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" } }, "directives": [] - } - ], - "directives": [] - }, - { - "kind": "EnumTypeDefinition", - "name": { - "kind": "Name", - "value": "Claim_orderBy" - }, - "values": [ - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "id" - }, - "directives": [] }, { - "kind": "EnumValueDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creation" + "value": "tokenID_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } }, "directives": [] }, { - "kind": "EnumValueDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "tokenID" + "value": "tokenID_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } }, "directives": [] }, { - "kind": "EnumValueDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "contract" + "value": "tokenID_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } }, "directives": [] }, { - "kind": "EnumValueDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "uri" + "value": "tokenID_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } }, "directives": [] }, { - "kind": "EnumValueDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "creator" + "value": "tokenID_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } }, "directives": [] }, { - "kind": "EnumValueDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "owner" + "value": "contract" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } }, "directives": [] }, { - "kind": "EnumValueDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "totalUnits" + "value": "contract_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } }, "directives": [] - } - ], - "directives": [] - }, - { - "kind": "ScalarTypeDefinition", - "description": { - "kind": "StringValue", - "value": "8 bytes signed integer\n", - "block": true - }, - "name": { - "kind": "Name", - "value": "Int8" - }, - "directives": [] - }, - { - "kind": "EnumTypeDefinition", - "description": { - "kind": "StringValue", - "value": "Defines the order direction, either ascending or descending", - "block": true - }, - "name": { - "kind": "Name", - "value": "OrderDirection" - }, - "values": [ + }, { - "kind": "EnumValueDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "asc" + "value": "contract_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } }, "directives": [] }, { - "kind": "EnumValueDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "desc" + "value": "contract_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } }, "directives": [] - } - ], - "directives": [] - }, - { - "kind": "ObjectTypeDefinition", - "name": { - "kind": "Name", - "value": "Query" - }, - "fields": [ + }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "allowlist" + "value": "contract_gte" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "id" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "ID" - } - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", - "block": true - }, - "name": { - "kind": "Name", - "value": "block" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", - "block": true - }, - "name": { - "kind": "Name", - "value": "subgraphError" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "_SubgraphErrorPolicy_" - } - } - }, - "defaultValue": { - "kind": "EnumValue", - "value": "deny" - }, - "directives": [] + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } - ], + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "contract_lte" + }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Allowlist" + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "allowlists" + "value": "contract_in" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "skip" - }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "String" } - }, - "defaultValue": { - "kind": "IntValue", - "value": "0" - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "first" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Int" - } - }, - "defaultValue": { - "kind": "IntValue", - "value": "100" - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "orderBy" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Allowlist_orderBy" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "orderDirection" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "OrderDirection" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "where" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Allowlist_filter" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", - "block": true - }, - "name": { - "kind": "Name", - "value": "block" - }, + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "contract_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", - "block": true - }, - "name": { - "kind": "Name", - "value": "subgraphError" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "_SubgraphErrorPolicy_" - } + "value": "String" } - }, - "defaultValue": { - "kind": "EnumValue", - "value": "deny" - }, - "directives": [] + } } - ], + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "contract_contains" + }, "type": { - "kind": "NonNullType", - "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Allowlist" - } - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim" + "value": "contract_contains_nocase" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "id" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "ID" - } - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", - "block": true - }, - "name": { - "kind": "Name", - "value": "block" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", - "block": true - }, - "name": { - "kind": "Name", - "value": "subgraphError" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "_SubgraphErrorPolicy_" - } - } - }, - "defaultValue": { - "kind": "EnumValue", - "value": "deny" - }, - "directives": [] + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } - ], + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "contract_not_contains" + }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Claim" + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claims" + "value": "contract_not_contains_nocase" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "skip" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Int" - } - }, - "defaultValue": { - "kind": "IntValue", - "value": "0" - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "first" + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "contract_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "contract_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "contract_not_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "contract_not_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "contract_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "contract_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "contract_not_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "contract_not_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_not_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_not_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_not_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_not_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "uri_not_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "creator" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "creator_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "creator_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "creator_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "creator_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "creator_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "creator_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "creator_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "creator_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "creator_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "owner" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "owner_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "owner_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "owner_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "owner_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "owner_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "owner_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "owner_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "owner_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "owner_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "totalUnits" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "totalUnits_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "totalUnits_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "totalUnits_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "totalUnits_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "totalUnits_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "totalUnits_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "totalUnits_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_not_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_not_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_not_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_not_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_not_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist_" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Allowlist_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Filter for the block changed event.", + "block": true + }, + "name": { + "kind": "Name", + "value": "_change_block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BlockChangedFilter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "and" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Claim_filter" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "or" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Claim_filter" + } + } + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "EnumTypeDefinition", + "name": { + "kind": "Name", + "value": "Claim_orderBy" + }, + "values": [ + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "creation" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "tokenID" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "contract" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "uri" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "creator" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "owner" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "totalUnits" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist__id" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "allowlist__root" + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "ScalarTypeDefinition", + "description": { + "kind": "StringValue", + "value": "8 bytes signed integer\n", + "block": true + }, + "name": { + "kind": "Name", + "value": "Int8" + }, + "directives": [] + }, + { + "kind": "ObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Offer" + }, + "fields": [ + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "fractionID" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ClaimToken" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "unitsAvailable" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "minUnitsPerTrade" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "maxUnitsPerTrade" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "status" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OfferStatus" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "acceptedTokens" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "AcceptedToken_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "AcceptedToken_filter" + } + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "AcceptedToken" + } + } + } + } + }, + "directives": [] + } + ], + "interfaces": [], + "directives": [] + }, + { + "kind": "EnumTypeDefinition", + "name": { + "kind": "Name", + "value": "OfferStatus" + }, + "values": [ + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "Open" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "Fulfilled" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "Cancelled" + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "InputObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Offer_filter" + }, + "fields": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_not_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_not_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_not_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_not_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_not_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID_" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ClaimToken_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsAvailable" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsAvailable_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsAvailable_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsAvailable_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsAvailable_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsAvailable_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsAvailable_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsAvailable_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "minUnitsPerTrade" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "minUnitsPerTrade_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "minUnitsPerTrade_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "minUnitsPerTrade_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "minUnitsPerTrade_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "minUnitsPerTrade_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "minUnitsPerTrade_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "minUnitsPerTrade_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "maxUnitsPerTrade" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "maxUnitsPerTrade_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "maxUnitsPerTrade_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "maxUnitsPerTrade_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "maxUnitsPerTrade_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "maxUnitsPerTrade_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "maxUnitsPerTrade_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "maxUnitsPerTrade_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "status" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OfferStatus" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "status_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OfferStatus" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "status_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OfferStatus" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "status_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OfferStatus" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "acceptedTokens" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "acceptedTokens_not" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "acceptedTokens_contains" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "acceptedTokens_contains_nocase" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "acceptedTokens_not_contains" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "acceptedTokens_not_contains_nocase" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "acceptedTokens_" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "AcceptedToken_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Filter for the block changed event.", + "block": true + }, + "name": { + "kind": "Name", + "value": "_change_block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BlockChangedFilter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "and" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer_filter" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "or" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer_filter" + } + } + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "EnumTypeDefinition", + "name": { + "kind": "Name", + "value": "Offer_orderBy" + }, + "values": [ + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID__id" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID__tokenID" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID__owner" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "fractionID__units" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "unitsAvailable" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "minUnitsPerTrade" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "maxUnitsPerTrade" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "status" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "acceptedTokens" + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "EnumTypeDefinition", + "description": { + "kind": "StringValue", + "value": "Defines the order direction, either ascending or descending", + "block": true + }, + "name": { + "kind": "Name", + "value": "OrderDirection" + }, + "values": [ + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "asc" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "desc" + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "ObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Query" + }, + "fields": [ + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "allowlist" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Allowlist" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "allowlists" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Allowlist_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Allowlist_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Allowlist" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "claim" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Claim" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "claims" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Claim_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Claim_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Claim" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "claimToken" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ClaimToken" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "claimTokens" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ClaimToken_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ClaimToken_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ClaimToken" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "token" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Token" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "tokens" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Token_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Token_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Token" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "acceptedToken" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "AcceptedToken" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "acceptedTokens" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "AcceptedToken_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "AcceptedToken_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "AcceptedToken" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "offer" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "offers" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "trade" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Trade" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "trades" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Trade_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Trade_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Trade" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "description": { + "kind": "StringValue", + "value": "Access to subgraph metadata", + "block": true + }, + "name": { + "kind": "Name", + "value": "_meta" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_Meta_" + } + }, + "directives": [] + } + ], + "interfaces": [], + "directives": [] + }, + { + "kind": "ObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Subscription" + }, + "fields": [ + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "allowlist" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Allowlist" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "allowlists" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Allowlist_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Allowlist_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Allowlist" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "claim" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Claim" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "claims" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Claim_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Claim_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Claim" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "claimToken" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ClaimToken" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "claimTokens" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ClaimToken_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ClaimToken_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ClaimToken" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "token" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Token" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "tokens" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Token_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Token_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Token" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "acceptedToken" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "AcceptedToken" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "acceptedTokens" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "AcceptedToken_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "AcceptedToken_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "AcceptedToken" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "offer" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "offers" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "trade" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Trade" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "trades" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Trade_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Trade_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Trade" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "description": { + "kind": "StringValue", + "value": "Access to subgraph metadata", + "block": true + }, + "name": { + "kind": "Name", + "value": "_meta" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_Meta_" + } + }, + "directives": [] + } + ], + "interfaces": [], + "directives": [] + }, + { + "kind": "ObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Token" + }, + "fields": [ + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "name" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "symbol" + }, + "arguments": [], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "decimals" + }, + "arguments": [], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + } + ], + "interfaces": [], + "directives": [] + }, + { + "kind": "InputObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Token_filter" + }, + "fields": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_not_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_not_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_not_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_not_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "name_not_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_not_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_not_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_not_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_not_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "symbol_not_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "decimals" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "decimals_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "decimals_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "decimals_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "decimals_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "decimals_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "decimals_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "decimals_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Filter for the block changed event.", + "block": true + }, + "name": { + "kind": "Name", + "value": "_change_block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BlockChangedFilter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "and" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Token_filter" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "or" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Token_filter" + } + } + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "EnumTypeDefinition", + "name": { + "kind": "Name", + "value": "Token_orderBy" + }, + "values": [ + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "name" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "symbol" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "decimals" + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "ObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Trade" + }, + "fields": [ + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "buyer" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "offerID" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "unitsSold" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "token" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Token" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "amountPerUnit" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + }, + "directives": [] + } + ], + "interfaces": [], + "directives": [] + }, + { + "kind": "InputObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Trade_filter" + }, + "fields": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "buyer" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "buyer_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "buyer_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "buyer_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "buyer_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "buyer_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "buyer_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "Bytes" } - }, - "defaultValue": { - "kind": "IntValue", - "value": "100" - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "orderBy" - }, + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "buyer_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "buyer_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "buyer_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Claim_orderBy" + "value": "String" } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "orderDirection" - }, + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "OrderDirection" + "value": "String" } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "where" - }, + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_not_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_not_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_not_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_not_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_not_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "offerID_" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Offer_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsSold" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsSold_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsSold_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsSold_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsSold_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsSold_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsSold_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Claim_filter" + "value": "BigInt" } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", - "block": true - }, - "name": { - "kind": "Name", - "value": "block" - }, + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "unitsSold_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", - "block": true - }, - "name": { - "kind": "Name", - "value": "subgraphError" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "_SubgraphErrorPolicy_" - } + "value": "BigInt" } - }, - "defaultValue": { - "kind": "EnumValue", - "value": "deny" - }, - "directives": [] + } } - ], + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "token" + }, "type": { - "kind": "NonNullType", + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "token_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "token_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "token_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "token_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "token_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "token_in" + }, + "type": { + "kind": "ListType", "type": { - "kind": "ListType", + "kind": "NonNullType", "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Claim" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } } } @@ -5093,999 +13717,347 @@ const schemaAST = { "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claimToken" + "value": "token_not_in" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "id" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "ID" - } - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", - "block": true - }, - "name": { - "kind": "Name", - "value": "block" - }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", - "block": true - }, - "name": { - "kind": "Name", - "value": "subgraphError" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "_SubgraphErrorPolicy_" - } + "value": "String" } - }, - "defaultValue": { - "kind": "EnumValue", - "value": "deny" - }, - "directives": [] + } } - ], + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "token_contains" + }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "ClaimToken" + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claimTokens" + "value": "token_contains_nocase" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "skip" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Int" - } - }, - "defaultValue": { - "kind": "IntValue", - "value": "0" - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "first" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Int" - } - }, - "defaultValue": { - "kind": "IntValue", - "value": "100" - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "orderBy" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "ClaimToken_orderBy" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "orderDirection" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "OrderDirection" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "where" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "ClaimToken_filter" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", - "block": true - }, - "name": { - "kind": "Name", - "value": "block" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", - "block": true - }, - "name": { - "kind": "Name", - "value": "subgraphError" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "_SubgraphErrorPolicy_" - } - } - }, - "defaultValue": { - "kind": "EnumValue", - "value": "deny" - }, - "directives": [] + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } - ], + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "token_not_contains" + }, "type": { - "kind": "NonNullType", - "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "ClaimToken" - } - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", - "description": { - "kind": "StringValue", - "value": "Access to subgraph metadata", - "block": true - }, + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "_meta" + "value": "token_not_contains_nocase" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "block" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - } - ], "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "_Meta_" + "value": "String" } }, "directives": [] - } - ], - "interfaces": [], - "directives": [] - }, - { - "kind": "ObjectTypeDefinition", - "name": { - "kind": "Name", - "value": "Subscription" - }, - "fields": [ + }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "allowlist" + "value": "token_starts_with" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "id" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "ID" - } - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", - "block": true - }, - "name": { - "kind": "Name", - "value": "block" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", - "block": true - }, - "name": { - "kind": "Name", - "value": "subgraphError" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "_SubgraphErrorPolicy_" - } - } - }, - "defaultValue": { - "kind": "EnumValue", - "value": "deny" - }, - "directives": [] - } - ], "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Allowlist" + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "allowlists" + "value": "token_starts_with_nocase" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "skip" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Int" - } - }, - "defaultValue": { - "kind": "IntValue", - "value": "0" - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "first" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Int" - } - }, - "defaultValue": { - "kind": "IntValue", - "value": "100" - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "orderBy" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Allowlist_orderBy" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "orderDirection" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "OrderDirection" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "where" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Allowlist_filter" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", - "block": true - }, - "name": { - "kind": "Name", - "value": "block" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", - "block": true - }, - "name": { - "kind": "Name", - "value": "subgraphError" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "_SubgraphErrorPolicy_" - } - } - }, - "defaultValue": { - "kind": "EnumValue", - "value": "deny" - }, - "directives": [] + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "token_not_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } - ], + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "token_not_starts_with_nocase" + }, "type": { - "kind": "NonNullType", - "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Allowlist" - } - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claim" + "value": "token_ends_with" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "id" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "ID" - } - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", - "block": true - }, - "name": { - "kind": "Name", - "value": "block" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", - "block": true - }, - "name": { - "kind": "Name", - "value": "subgraphError" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "_SubgraphErrorPolicy_" - } - } - }, - "defaultValue": { - "kind": "EnumValue", - "value": "deny" - }, - "directives": [] + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } - ], + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "token_ends_with_nocase" + }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Claim" + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claims" + "value": "token_not_ends_with" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "skip" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Int" - } - }, - "defaultValue": { - "kind": "IntValue", - "value": "0" - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "first" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Int" - } - }, - "defaultValue": { - "kind": "IntValue", - "value": "100" - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "orderBy" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Claim_orderBy" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "orderDirection" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "OrderDirection" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "where" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Claim_filter" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", - "block": true - }, - "name": { - "kind": "Name", - "value": "block" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", - "block": true - }, - "name": { - "kind": "Name", - "value": "subgraphError" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "_SubgraphErrorPolicy_" - } - } - }, - "defaultValue": { - "kind": "EnumValue", - "value": "deny" - }, - "directives": [] + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } - ], + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "token_not_ends_with_nocase" + }, "type": { - "kind": "NonNullType", - "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Claim" - } - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claimToken" + "value": "token_" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "id" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "ID" - } - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", - "block": true - }, - "name": { - "kind": "Name", - "value": "block" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", - "block": true - }, - "name": { - "kind": "Name", - "value": "subgraphError" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "_SubgraphErrorPolicy_" - } - } - }, - "defaultValue": { - "kind": "EnumValue", - "value": "deny" - }, - "directives": [] + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Token_filter" } - ], + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amountPerUnit" + }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "ClaimToken" + "value": "BigInt" } }, "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "claimTokens" + "value": "amountPerUnit_not" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "skip" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Int" - } - }, - "defaultValue": { - "kind": "IntValue", - "value": "0" - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "first" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Int" - } - }, - "defaultValue": { - "kind": "IntValue", - "value": "100" - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "orderBy" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "ClaimToken_orderBy" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "orderDirection" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "OrderDirection" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "where" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "ClaimToken_filter" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", - "block": true - }, - "name": { - "kind": "Name", - "value": "block" - }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amountPerUnit_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amountPerUnit_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amountPerUnit_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amountPerUnit_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amountPerUnit_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", - "block": true - }, - "name": { - "kind": "Name", - "value": "subgraphError" - }, - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "_SubgraphErrorPolicy_" - } + "value": "BigInt" } - }, - "defaultValue": { - "kind": "EnumValue", - "value": "deny" - }, - "directives": [] + } } - ], + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amountPerUnit_not_in" + }, "type": { - "kind": "NonNullType", + "kind": "ListType", "type": { - "kind": "ListType", + "kind": "NonNullType", "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "ClaimToken" - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" } } } @@ -6093,44 +14065,192 @@ const schemaAST = { "directives": [] }, { - "kind": "FieldDefinition", + "kind": "InputValueDefinition", "description": { "kind": "StringValue", - "value": "Access to subgraph metadata", + "value": "Filter for the block changed event.", "block": true }, "name": { "kind": "Name", - "value": "_meta" + "value": "_change_block" }, - "arguments": [ - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "block" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Block_height" - } - }, - "directives": [] - } - ], "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "_Meta_" + "value": "BlockChangedFilter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "and" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Trade_filter" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "or" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Trade_filter" + } } }, "directives": [] } ], - "interfaces": [], + "directives": [] + }, + { + "kind": "EnumTypeDefinition", + "name": { + "kind": "Name", + "value": "Trade_orderBy" + }, + "values": [ + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "buyer" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "offerID" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "offerID__id" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "offerID__unitsAvailable" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "offerID__minUnitsPerTrade" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "offerID__maxUnitsPerTrade" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "offerID__status" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "unitsSold" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "token" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "token__id" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "token__name" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "token__symbol" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "token__decimals" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "amountPerUnit" + }, + "directives": [] + } + ], "directives": [] }, { diff --git a/sdk/.graphclient/sources/Hypercerts/schema.graphql b/sdk/.graphclient/sources/Hypercerts/schema.graphql index efc1bd8f..b44cef4d 100644 --- a/sdk/.graphclient/sources/Hypercerts/schema.graphql +++ b/sdk/.graphclient/sources/Hypercerts/schema.graphql @@ -12,6 +12,84 @@ directive @subgraphId(id: String!) on OBJECT "creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API." directive @derivedFrom(field: String!) on FIELD_DEFINITION +type AcceptedToken { + id: String! + token: Token! + minimumAmountPerUnit: BigInt! + accepted: Boolean! +} + +input AcceptedToken_filter { + id: String + id_not: String + id_gt: String + id_lt: String + id_gte: String + id_lte: String + id_in: [String!] + id_not_in: [String!] + id_contains: String + id_contains_nocase: String + id_not_contains: String + id_not_contains_nocase: String + id_starts_with: String + id_starts_with_nocase: String + id_not_starts_with: String + id_not_starts_with_nocase: String + id_ends_with: String + id_ends_with_nocase: String + id_not_ends_with: String + id_not_ends_with_nocase: String + token: String + token_not: String + token_gt: String + token_lt: String + token_gte: String + token_lte: String + token_in: [String!] + token_not_in: [String!] + token_contains: String + token_contains_nocase: String + token_not_contains: String + token_not_contains_nocase: String + token_starts_with: String + token_starts_with_nocase: String + token_not_starts_with: String + token_not_starts_with_nocase: String + token_ends_with: String + token_ends_with_nocase: String + token_not_ends_with: String + token_not_ends_with_nocase: String + token_: Token_filter + minimumAmountPerUnit: BigInt + minimumAmountPerUnit_not: BigInt + minimumAmountPerUnit_gt: BigInt + minimumAmountPerUnit_lt: BigInt + minimumAmountPerUnit_gte: BigInt + minimumAmountPerUnit_lte: BigInt + minimumAmountPerUnit_in: [BigInt!] + minimumAmountPerUnit_not_in: [BigInt!] + accepted: Boolean + accepted_not: Boolean + accepted_in: [Boolean!] + accepted_not_in: [Boolean!] + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [AcceptedToken_filter] + or: [AcceptedToken_filter] +} + +enum AcceptedToken_orderBy { + id + token + token__id + token__name + token__symbol + token__decimals + minimumAmountPerUnit + accepted +} + type Allowlist { id: String! root: Bytes! @@ -115,6 +193,7 @@ type Claim { creator: Bytes owner: Bytes totalUnits: BigInt + allowlist: Allowlist } type ClaimToken { @@ -123,6 +202,7 @@ type ClaimToken { claim: Claim! owner: Bytes! units: BigInt! + offers(skip: Int = 0, first: Int = 100, orderBy: Offer_orderBy, orderDirection: OrderDirection, where: Offer_filter): [Offer!] } input ClaimToken_filter { @@ -193,6 +273,7 @@ input ClaimToken_filter { units_lte: BigInt units_in: [BigInt!] units_not_in: [BigInt!] + offers_: Offer_filter """Filter for the block changed event.""" _change_block: BlockChangedFilter and: [ClaimToken_filter] @@ -213,6 +294,7 @@ enum ClaimToken_orderBy { claim__totalUnits owner units + offers } input Claim_filter { @@ -320,6 +402,27 @@ input Claim_filter { totalUnits_lte: BigInt totalUnits_in: [BigInt!] totalUnits_not_in: [BigInt!] + allowlist: String + allowlist_not: String + allowlist_gt: String + allowlist_lt: String + allowlist_gte: String + allowlist_lte: String + allowlist_in: [String!] + allowlist_not_in: [String!] + allowlist_contains: String + allowlist_contains_nocase: String + allowlist_not_contains: String + allowlist_not_contains_nocase: String + allowlist_starts_with: String + allowlist_starts_with_nocase: String + allowlist_not_starts_with: String + allowlist_not_starts_with_nocase: String + allowlist_ends_with: String + allowlist_ends_with_nocase: String + allowlist_not_ends_with: String + allowlist_not_ends_with_nocase: String + allowlist_: Allowlist_filter """Filter for the block changed event.""" _change_block: BlockChangedFilter and: [Claim_filter] @@ -335,6 +438,9 @@ enum Claim_orderBy { creator owner totalUnits + allowlist + allowlist__id + allowlist__root } """ @@ -343,6 +449,119 @@ enum Claim_orderBy { """ scalar Int8 +type Offer { + id: String! + fractionID: ClaimToken! + unitsAvailable: BigInt! + minUnitsPerTrade: BigInt! + maxUnitsPerTrade: BigInt! + status: OfferStatus! + acceptedTokens(skip: Int = 0, first: Int = 100, orderBy: AcceptedToken_orderBy, orderDirection: OrderDirection, where: AcceptedToken_filter): [AcceptedToken!]! +} + +enum OfferStatus { + Open + Fulfilled + Cancelled +} + +input Offer_filter { + id: String + id_not: String + id_gt: String + id_lt: String + id_gte: String + id_lte: String + id_in: [String!] + id_not_in: [String!] + id_contains: String + id_contains_nocase: String + id_not_contains: String + id_not_contains_nocase: String + id_starts_with: String + id_starts_with_nocase: String + id_not_starts_with: String + id_not_starts_with_nocase: String + id_ends_with: String + id_ends_with_nocase: String + id_not_ends_with: String + id_not_ends_with_nocase: String + fractionID: String + fractionID_not: String + fractionID_gt: String + fractionID_lt: String + fractionID_gte: String + fractionID_lte: String + fractionID_in: [String!] + fractionID_not_in: [String!] + fractionID_contains: String + fractionID_contains_nocase: String + fractionID_not_contains: String + fractionID_not_contains_nocase: String + fractionID_starts_with: String + fractionID_starts_with_nocase: String + fractionID_not_starts_with: String + fractionID_not_starts_with_nocase: String + fractionID_ends_with: String + fractionID_ends_with_nocase: String + fractionID_not_ends_with: String + fractionID_not_ends_with_nocase: String + fractionID_: ClaimToken_filter + unitsAvailable: BigInt + unitsAvailable_not: BigInt + unitsAvailable_gt: BigInt + unitsAvailable_lt: BigInt + unitsAvailable_gte: BigInt + unitsAvailable_lte: BigInt + unitsAvailable_in: [BigInt!] + unitsAvailable_not_in: [BigInt!] + minUnitsPerTrade: BigInt + minUnitsPerTrade_not: BigInt + minUnitsPerTrade_gt: BigInt + minUnitsPerTrade_lt: BigInt + minUnitsPerTrade_gte: BigInt + minUnitsPerTrade_lte: BigInt + minUnitsPerTrade_in: [BigInt!] + minUnitsPerTrade_not_in: [BigInt!] + maxUnitsPerTrade: BigInt + maxUnitsPerTrade_not: BigInt + maxUnitsPerTrade_gt: BigInt + maxUnitsPerTrade_lt: BigInt + maxUnitsPerTrade_gte: BigInt + maxUnitsPerTrade_lte: BigInt + maxUnitsPerTrade_in: [BigInt!] + maxUnitsPerTrade_not_in: [BigInt!] + status: OfferStatus + status_not: OfferStatus + status_in: [OfferStatus!] + status_not_in: [OfferStatus!] + acceptedTokens: [String!] + acceptedTokens_not: [String!] + acceptedTokens_contains: [String!] + acceptedTokens_contains_nocase: [String!] + acceptedTokens_not_contains: [String!] + acceptedTokens_not_contains_nocase: [String!] + acceptedTokens_: AcceptedToken_filter + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Offer_filter] + or: [Offer_filter] +} + +enum Offer_orderBy { + id + fractionID + fractionID__id + fractionID__tokenID + fractionID__owner + fractionID__units + unitsAvailable + minUnitsPerTrade + maxUnitsPerTrade + status + acceptedTokens +} + """Defines the order direction, either ascending or descending""" enum OrderDirection { asc @@ -428,6 +647,110 @@ type Query { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [ClaimToken!]! + token( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Token + tokens( + skip: Int = 0 + first: Int = 100 + orderBy: Token_orderBy + orderDirection: OrderDirection + where: Token_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Token!]! + acceptedToken( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): AcceptedToken + acceptedTokens( + skip: Int = 0 + first: Int = 100 + orderBy: AcceptedToken_orderBy + orderDirection: OrderDirection + where: AcceptedToken_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [AcceptedToken!]! + offer( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Offer + offers( + skip: Int = 0 + first: Int = 100 + orderBy: Offer_orderBy + orderDirection: OrderDirection + where: Offer_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Offer!]! + trade( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Trade + trades( + skip: Int = 0 + first: Int = 100 + orderBy: Trade_orderBy + orderDirection: OrderDirection + where: Trade_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Trade!]! """Access to subgraph metadata""" _meta(block: Block_height): _Meta_ } @@ -511,10 +834,325 @@ type Subscription { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [ClaimToken!]! + token( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Token + tokens( + skip: Int = 0 + first: Int = 100 + orderBy: Token_orderBy + orderDirection: OrderDirection + where: Token_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Token!]! + acceptedToken( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): AcceptedToken + acceptedTokens( + skip: Int = 0 + first: Int = 100 + orderBy: AcceptedToken_orderBy + orderDirection: OrderDirection + where: AcceptedToken_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [AcceptedToken!]! + offer( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Offer + offers( + skip: Int = 0 + first: Int = 100 + orderBy: Offer_orderBy + orderDirection: OrderDirection + where: Offer_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Offer!]! + trade( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Trade + trades( + skip: Int = 0 + first: Int = 100 + orderBy: Trade_orderBy + orderDirection: OrderDirection + where: Trade_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Trade!]! """Access to subgraph metadata""" _meta(block: Block_height): _Meta_ } +type Token { + id: String! + name: String! + symbol: String + decimals: BigInt +} + +input Token_filter { + id: String + id_not: String + id_gt: String + id_lt: String + id_gte: String + id_lte: String + id_in: [String!] + id_not_in: [String!] + id_contains: String + id_contains_nocase: String + id_not_contains: String + id_not_contains_nocase: String + id_starts_with: String + id_starts_with_nocase: String + id_not_starts_with: String + id_not_starts_with_nocase: String + id_ends_with: String + id_ends_with_nocase: String + id_not_ends_with: String + id_not_ends_with_nocase: String + name: String + name_not: String + name_gt: String + name_lt: String + name_gte: String + name_lte: String + name_in: [String!] + name_not_in: [String!] + name_contains: String + name_contains_nocase: String + name_not_contains: String + name_not_contains_nocase: String + name_starts_with: String + name_starts_with_nocase: String + name_not_starts_with: String + name_not_starts_with_nocase: String + name_ends_with: String + name_ends_with_nocase: String + name_not_ends_with: String + name_not_ends_with_nocase: String + symbol: String + symbol_not: String + symbol_gt: String + symbol_lt: String + symbol_gte: String + symbol_lte: String + symbol_in: [String!] + symbol_not_in: [String!] + symbol_contains: String + symbol_contains_nocase: String + symbol_not_contains: String + symbol_not_contains_nocase: String + symbol_starts_with: String + symbol_starts_with_nocase: String + symbol_not_starts_with: String + symbol_not_starts_with_nocase: String + symbol_ends_with: String + symbol_ends_with_nocase: String + symbol_not_ends_with: String + symbol_not_ends_with_nocase: String + decimals: BigInt + decimals_not: BigInt + decimals_gt: BigInt + decimals_lt: BigInt + decimals_gte: BigInt + decimals_lte: BigInt + decimals_in: [BigInt!] + decimals_not_in: [BigInt!] + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Token_filter] + or: [Token_filter] +} + +enum Token_orderBy { + id + name + symbol + decimals +} + +type Trade { + id: String! + buyer: Bytes! + offerID: Offer! + unitsSold: BigInt! + token: Token! + amountPerUnit: BigInt! +} + +input Trade_filter { + id: String + id_not: String + id_gt: String + id_lt: String + id_gte: String + id_lte: String + id_in: [String!] + id_not_in: [String!] + id_contains: String + id_contains_nocase: String + id_not_contains: String + id_not_contains_nocase: String + id_starts_with: String + id_starts_with_nocase: String + id_not_starts_with: String + id_not_starts_with_nocase: String + id_ends_with: String + id_ends_with_nocase: String + id_not_ends_with: String + id_not_ends_with_nocase: String + buyer: Bytes + buyer_not: Bytes + buyer_gt: Bytes + buyer_lt: Bytes + buyer_gte: Bytes + buyer_lte: Bytes + buyer_in: [Bytes!] + buyer_not_in: [Bytes!] + buyer_contains: Bytes + buyer_not_contains: Bytes + offerID: String + offerID_not: String + offerID_gt: String + offerID_lt: String + offerID_gte: String + offerID_lte: String + offerID_in: [String!] + offerID_not_in: [String!] + offerID_contains: String + offerID_contains_nocase: String + offerID_not_contains: String + offerID_not_contains_nocase: String + offerID_starts_with: String + offerID_starts_with_nocase: String + offerID_not_starts_with: String + offerID_not_starts_with_nocase: String + offerID_ends_with: String + offerID_ends_with_nocase: String + offerID_not_ends_with: String + offerID_not_ends_with_nocase: String + offerID_: Offer_filter + unitsSold: BigInt + unitsSold_not: BigInt + unitsSold_gt: BigInt + unitsSold_lt: BigInt + unitsSold_gte: BigInt + unitsSold_lte: BigInt + unitsSold_in: [BigInt!] + unitsSold_not_in: [BigInt!] + token: String + token_not: String + token_gt: String + token_lt: String + token_gte: String + token_lte: String + token_in: [String!] + token_not_in: [String!] + token_contains: String + token_contains_nocase: String + token_not_contains: String + token_not_contains_nocase: String + token_starts_with: String + token_starts_with_nocase: String + token_not_starts_with: String + token_not_starts_with_nocase: String + token_ends_with: String + token_ends_with_nocase: String + token_not_ends_with: String + token_not_ends_with_nocase: String + token_: Token_filter + amountPerUnit: BigInt + amountPerUnit_not: BigInt + amountPerUnit_gt: BigInt + amountPerUnit_lt: BigInt + amountPerUnit_gte: BigInt + amountPerUnit_lte: BigInt + amountPerUnit_in: [BigInt!] + amountPerUnit_not_in: [BigInt!] + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Trade_filter] + or: [Trade_filter] +} + +enum Trade_orderBy { + id + buyer + offerID + offerID__id + offerID__unitsAvailable + offerID__minUnitsPerTrade + offerID__maxUnitsPerTrade + offerID__status + unitsSold + token + token__id + token__name + token__symbol + token__decimals + amountPerUnit +} + type _Block_ { """The hash of the block""" hash: Bytes diff --git a/sdk/.graphclient/sources/Hypercerts/types.ts b/sdk/.graphclient/sources/Hypercerts/types.ts index 7481600c..70815082 100644 --- a/sdk/.graphclient/sources/Hypercerts/types.ts +++ b/sdk/.graphclient/sources/Hypercerts/types.ts @@ -22,6 +22,83 @@ export type Scalars = { Int8: any; }; +export type AcceptedToken = { + id: Scalars['String']; + token: Token; + minimumAmountPerUnit: Scalars['BigInt']; + accepted: Scalars['Boolean']; +}; + +export type AcceptedToken_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + token?: InputMaybe; + token_not?: InputMaybe; + token_gt?: InputMaybe; + token_lt?: InputMaybe; + token_gte?: InputMaybe; + token_lte?: InputMaybe; + token_in?: InputMaybe>; + token_not_in?: InputMaybe>; + token_contains?: InputMaybe; + token_contains_nocase?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_contains_nocase?: InputMaybe; + token_starts_with?: InputMaybe; + token_starts_with_nocase?: InputMaybe; + token_not_starts_with?: InputMaybe; + token_not_starts_with_nocase?: InputMaybe; + token_ends_with?: InputMaybe; + token_ends_with_nocase?: InputMaybe; + token_not_ends_with?: InputMaybe; + token_not_ends_with_nocase?: InputMaybe; + token_?: InputMaybe; + minimumAmountPerUnit?: InputMaybe; + minimumAmountPerUnit_not?: InputMaybe; + minimumAmountPerUnit_gt?: InputMaybe; + minimumAmountPerUnit_lt?: InputMaybe; + minimumAmountPerUnit_gte?: InputMaybe; + minimumAmountPerUnit_lte?: InputMaybe; + minimumAmountPerUnit_in?: InputMaybe>; + minimumAmountPerUnit_not_in?: InputMaybe>; + accepted?: InputMaybe; + accepted_not?: InputMaybe; + accepted_in?: InputMaybe>; + accepted_not_in?: InputMaybe>; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type AcceptedToken_orderBy = + | 'id' + | 'token' + | 'token__id' + | 'token__name' + | 'token__symbol' + | 'token__decimals' + | 'minimumAmountPerUnit' + | 'accepted'; + export type Allowlist = { id: Scalars['String']; root: Scalars['Bytes']; @@ -118,6 +195,7 @@ export type Claim = { creator?: Maybe; owner?: Maybe; totalUnits?: Maybe; + allowlist?: Maybe; }; export type ClaimToken = { @@ -126,6 +204,16 @@ export type ClaimToken = { claim: Claim; owner: Scalars['Bytes']; units: Scalars['BigInt']; + offers?: Maybe>; +}; + + +export type ClaimTokenoffersArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; }; export type ClaimToken_filter = { @@ -196,6 +284,7 @@ export type ClaimToken_filter = { units_lte?: InputMaybe; units_in?: InputMaybe>; units_not_in?: InputMaybe>; + offers_?: InputMaybe; /** Filter for the block changed event. */ _change_block?: InputMaybe; and?: InputMaybe>>; @@ -215,7 +304,8 @@ export type ClaimToken_orderBy = | 'claim__owner' | 'claim__totalUnits' | 'owner' - | 'units'; + | 'units' + | 'offers'; export type Claim_filter = { id?: InputMaybe; @@ -322,6 +412,27 @@ export type Claim_filter = { totalUnits_lte?: InputMaybe; totalUnits_in?: InputMaybe>; totalUnits_not_in?: InputMaybe>; + allowlist?: InputMaybe; + allowlist_not?: InputMaybe; + allowlist_gt?: InputMaybe; + allowlist_lt?: InputMaybe; + allowlist_gte?: InputMaybe; + allowlist_lte?: InputMaybe; + allowlist_in?: InputMaybe>; + allowlist_not_in?: InputMaybe>; + allowlist_contains?: InputMaybe; + allowlist_contains_nocase?: InputMaybe; + allowlist_not_contains?: InputMaybe; + allowlist_not_contains_nocase?: InputMaybe; + allowlist_starts_with?: InputMaybe; + allowlist_starts_with_nocase?: InputMaybe; + allowlist_not_starts_with?: InputMaybe; + allowlist_not_starts_with_nocase?: InputMaybe; + allowlist_ends_with?: InputMaybe; + allowlist_ends_with_nocase?: InputMaybe; + allowlist_not_ends_with?: InputMaybe; + allowlist_not_ends_with_nocase?: InputMaybe; + allowlist_?: InputMaybe; /** Filter for the block changed event. */ _change_block?: InputMaybe; and?: InputMaybe>>; @@ -336,7 +447,130 @@ export type Claim_orderBy = | 'uri' | 'creator' | 'owner' - | 'totalUnits'; + | 'totalUnits' + | 'allowlist' + | 'allowlist__id' + | 'allowlist__root'; + +export type Offer = { + id: Scalars['String']; + fractionID: ClaimToken; + unitsAvailable: Scalars['BigInt']; + minUnitsPerTrade: Scalars['BigInt']; + maxUnitsPerTrade: Scalars['BigInt']; + status: OfferStatus; + acceptedTokens: Array; +}; + + +export type OfferacceptedTokensArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; +}; + +export type OfferStatus = + | 'Open' + | 'Fulfilled' + | 'Cancelled'; + +export type Offer_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + fractionID?: InputMaybe; + fractionID_not?: InputMaybe; + fractionID_gt?: InputMaybe; + fractionID_lt?: InputMaybe; + fractionID_gte?: InputMaybe; + fractionID_lte?: InputMaybe; + fractionID_in?: InputMaybe>; + fractionID_not_in?: InputMaybe>; + fractionID_contains?: InputMaybe; + fractionID_contains_nocase?: InputMaybe; + fractionID_not_contains?: InputMaybe; + fractionID_not_contains_nocase?: InputMaybe; + fractionID_starts_with?: InputMaybe; + fractionID_starts_with_nocase?: InputMaybe; + fractionID_not_starts_with?: InputMaybe; + fractionID_not_starts_with_nocase?: InputMaybe; + fractionID_ends_with?: InputMaybe; + fractionID_ends_with_nocase?: InputMaybe; + fractionID_not_ends_with?: InputMaybe; + fractionID_not_ends_with_nocase?: InputMaybe; + fractionID_?: InputMaybe; + unitsAvailable?: InputMaybe; + unitsAvailable_not?: InputMaybe; + unitsAvailable_gt?: InputMaybe; + unitsAvailable_lt?: InputMaybe; + unitsAvailable_gte?: InputMaybe; + unitsAvailable_lte?: InputMaybe; + unitsAvailable_in?: InputMaybe>; + unitsAvailable_not_in?: InputMaybe>; + minUnitsPerTrade?: InputMaybe; + minUnitsPerTrade_not?: InputMaybe; + minUnitsPerTrade_gt?: InputMaybe; + minUnitsPerTrade_lt?: InputMaybe; + minUnitsPerTrade_gte?: InputMaybe; + minUnitsPerTrade_lte?: InputMaybe; + minUnitsPerTrade_in?: InputMaybe>; + minUnitsPerTrade_not_in?: InputMaybe>; + maxUnitsPerTrade?: InputMaybe; + maxUnitsPerTrade_not?: InputMaybe; + maxUnitsPerTrade_gt?: InputMaybe; + maxUnitsPerTrade_lt?: InputMaybe; + maxUnitsPerTrade_gte?: InputMaybe; + maxUnitsPerTrade_lte?: InputMaybe; + maxUnitsPerTrade_in?: InputMaybe>; + maxUnitsPerTrade_not_in?: InputMaybe>; + status?: InputMaybe; + status_not?: InputMaybe; + status_in?: InputMaybe>; + status_not_in?: InputMaybe>; + acceptedTokens?: InputMaybe>; + acceptedTokens_not?: InputMaybe>; + acceptedTokens_contains?: InputMaybe>; + acceptedTokens_contains_nocase?: InputMaybe>; + acceptedTokens_not_contains?: InputMaybe>; + acceptedTokens_not_contains_nocase?: InputMaybe>; + acceptedTokens_?: InputMaybe; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type Offer_orderBy = + | 'id' + | 'fractionID' + | 'fractionID__id' + | 'fractionID__tokenID' + | 'fractionID__owner' + | 'fractionID__units' + | 'unitsAvailable' + | 'minUnitsPerTrade' + | 'maxUnitsPerTrade' + | 'status' + | 'acceptedTokens'; /** Defines the order direction, either ascending or descending */ export type OrderDirection = @@ -350,6 +584,14 @@ export type Query = { claims: Array; claimToken?: Maybe; claimTokens: Array; + token?: Maybe; + tokens: Array; + acceptedToken?: Maybe; + acceptedTokens: Array; + offer?: Maybe; + offers: Array; + trade?: Maybe; + trades: Array; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; }; @@ -409,6 +651,78 @@ export type QueryclaimTokensArgs = { }; +export type QuerytokenArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QuerytokensArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryacceptedTokenArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryacceptedTokensArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryofferArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryoffersArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QuerytradeArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QuerytradesArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + export type Query_metaArgs = { block?: InputMaybe; }; @@ -420,6 +734,14 @@ export type Subscription = { claims: Array; claimToken?: Maybe; claimTokens: Array; + token?: Maybe; + tokens: Array; + acceptedToken?: Maybe; + acceptedTokens: Array; + offer?: Maybe; + offers: Array; + trade?: Maybe; + trades: Array; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; }; @@ -479,10 +801,291 @@ export type SubscriptionclaimTokensArgs = { }; +export type SubscriptiontokenArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptiontokensArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionacceptedTokenArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionacceptedTokensArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionofferArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionoffersArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptiontradeArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptiontradesArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + export type Subscription_metaArgs = { block?: InputMaybe; }; +export type Token = { + id: Scalars['String']; + name: Scalars['String']; + symbol?: Maybe; + decimals?: Maybe; +}; + +export type Token_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + name?: InputMaybe; + name_not?: InputMaybe; + name_gt?: InputMaybe; + name_lt?: InputMaybe; + name_gte?: InputMaybe; + name_lte?: InputMaybe; + name_in?: InputMaybe>; + name_not_in?: InputMaybe>; + name_contains?: InputMaybe; + name_contains_nocase?: InputMaybe; + name_not_contains?: InputMaybe; + name_not_contains_nocase?: InputMaybe; + name_starts_with?: InputMaybe; + name_starts_with_nocase?: InputMaybe; + name_not_starts_with?: InputMaybe; + name_not_starts_with_nocase?: InputMaybe; + name_ends_with?: InputMaybe; + name_ends_with_nocase?: InputMaybe; + name_not_ends_with?: InputMaybe; + name_not_ends_with_nocase?: InputMaybe; + symbol?: InputMaybe; + symbol_not?: InputMaybe; + symbol_gt?: InputMaybe; + symbol_lt?: InputMaybe; + symbol_gte?: InputMaybe; + symbol_lte?: InputMaybe; + symbol_in?: InputMaybe>; + symbol_not_in?: InputMaybe>; + symbol_contains?: InputMaybe; + symbol_contains_nocase?: InputMaybe; + symbol_not_contains?: InputMaybe; + symbol_not_contains_nocase?: InputMaybe; + symbol_starts_with?: InputMaybe; + symbol_starts_with_nocase?: InputMaybe; + symbol_not_starts_with?: InputMaybe; + symbol_not_starts_with_nocase?: InputMaybe; + symbol_ends_with?: InputMaybe; + symbol_ends_with_nocase?: InputMaybe; + symbol_not_ends_with?: InputMaybe; + symbol_not_ends_with_nocase?: InputMaybe; + decimals?: InputMaybe; + decimals_not?: InputMaybe; + decimals_gt?: InputMaybe; + decimals_lt?: InputMaybe; + decimals_gte?: InputMaybe; + decimals_lte?: InputMaybe; + decimals_in?: InputMaybe>; + decimals_not_in?: InputMaybe>; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type Token_orderBy = + | 'id' + | 'name' + | 'symbol' + | 'decimals'; + +export type Trade = { + id: Scalars['String']; + buyer: Scalars['Bytes']; + offerID: Offer; + unitsSold: Scalars['BigInt']; + token: Token; + amountPerUnit: Scalars['BigInt']; +}; + +export type Trade_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + buyer?: InputMaybe; + buyer_not?: InputMaybe; + buyer_gt?: InputMaybe; + buyer_lt?: InputMaybe; + buyer_gte?: InputMaybe; + buyer_lte?: InputMaybe; + buyer_in?: InputMaybe>; + buyer_not_in?: InputMaybe>; + buyer_contains?: InputMaybe; + buyer_not_contains?: InputMaybe; + offerID?: InputMaybe; + offerID_not?: InputMaybe; + offerID_gt?: InputMaybe; + offerID_lt?: InputMaybe; + offerID_gte?: InputMaybe; + offerID_lte?: InputMaybe; + offerID_in?: InputMaybe>; + offerID_not_in?: InputMaybe>; + offerID_contains?: InputMaybe; + offerID_contains_nocase?: InputMaybe; + offerID_not_contains?: InputMaybe; + offerID_not_contains_nocase?: InputMaybe; + offerID_starts_with?: InputMaybe; + offerID_starts_with_nocase?: InputMaybe; + offerID_not_starts_with?: InputMaybe; + offerID_not_starts_with_nocase?: InputMaybe; + offerID_ends_with?: InputMaybe; + offerID_ends_with_nocase?: InputMaybe; + offerID_not_ends_with?: InputMaybe; + offerID_not_ends_with_nocase?: InputMaybe; + offerID_?: InputMaybe; + unitsSold?: InputMaybe; + unitsSold_not?: InputMaybe; + unitsSold_gt?: InputMaybe; + unitsSold_lt?: InputMaybe; + unitsSold_gte?: InputMaybe; + unitsSold_lte?: InputMaybe; + unitsSold_in?: InputMaybe>; + unitsSold_not_in?: InputMaybe>; + token?: InputMaybe; + token_not?: InputMaybe; + token_gt?: InputMaybe; + token_lt?: InputMaybe; + token_gte?: InputMaybe; + token_lte?: InputMaybe; + token_in?: InputMaybe>; + token_not_in?: InputMaybe>; + token_contains?: InputMaybe; + token_contains_nocase?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_contains_nocase?: InputMaybe; + token_starts_with?: InputMaybe; + token_starts_with_nocase?: InputMaybe; + token_not_starts_with?: InputMaybe; + token_not_starts_with_nocase?: InputMaybe; + token_ends_with?: InputMaybe; + token_ends_with_nocase?: InputMaybe; + token_not_ends_with?: InputMaybe; + token_not_ends_with_nocase?: InputMaybe; + token_?: InputMaybe; + amountPerUnit?: InputMaybe; + amountPerUnit_not?: InputMaybe; + amountPerUnit_gt?: InputMaybe; + amountPerUnit_lt?: InputMaybe; + amountPerUnit_gte?: InputMaybe; + amountPerUnit_lte?: InputMaybe; + amountPerUnit_in?: InputMaybe>; + amountPerUnit_not_in?: InputMaybe>; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type Trade_orderBy = + | 'id' + | 'buyer' + | 'offerID' + | 'offerID__id' + | 'offerID__unitsAvailable' + | 'offerID__minUnitsPerTrade' + | 'offerID__maxUnitsPerTrade' + | 'offerID__status' + | 'unitsSold' + | 'token' + | 'token__id' + | 'token__name' + | 'token__symbol' + | 'token__decimals' + | 'amountPerUnit'; + export type _Block_ = { /** The hash of the block */ hash?: Maybe; @@ -527,6 +1130,22 @@ export type _SubgraphErrorPolicy_ = claimToken: InContextSdkMethod, /** null **/ claimTokens: InContextSdkMethod, + /** null **/ + token: InContextSdkMethod, + /** null **/ + tokens: InContextSdkMethod, + /** null **/ + acceptedToken: InContextSdkMethod, + /** null **/ + acceptedTokens: InContextSdkMethod, + /** null **/ + offer: InContextSdkMethod, + /** null **/ + offers: InContextSdkMethod, + /** null **/ + trade: InContextSdkMethod, + /** null **/ + trades: InContextSdkMethod, /** Access to subgraph metadata **/ _meta: InContextSdkMethod }; @@ -548,12 +1167,28 @@ export type _SubgraphErrorPolicy_ = claimToken: InContextSdkMethod, /** null **/ claimTokens: InContextSdkMethod, + /** null **/ + token: InContextSdkMethod, + /** null **/ + tokens: InContextSdkMethod, + /** null **/ + acceptedToken: InContextSdkMethod, + /** null **/ + acceptedTokens: InContextSdkMethod, + /** null **/ + offer: InContextSdkMethod, + /** null **/ + offers: InContextSdkMethod, + /** null **/ + trade: InContextSdkMethod, + /** null **/ + trades: InContextSdkMethod, /** Access to subgraph metadata **/ _meta: InContextSdkMethod }; export type Context = { ["Hypercerts"]: { Query: QuerySdk, Mutation: MutationSdk, Subscription: SubscriptionSdk }, - ["graphUrl"]: Scalars['ID'] + ["graphName"]: Scalars['ID'] }; } diff --git a/sdk/.graphclientrc.yml b/sdk/.graphclientrc.yml index bf07ad3d..79b1fc24 100644 --- a/sdk/.graphclientrc.yml +++ b/sdk/.graphclientrc.yml @@ -4,24 +4,24 @@ sources: graphql: # Default value is hypercerts-testnet # This is needed for the initial introspection on buildtime - endpoint: "{context.graphUrl:https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-testnet}" + endpoint: https://api.thegraph.com/subgraphs/name/hypercerts-admin/{context.graphName:hypercerts-testnet} additionalTypeDefs: | extend type Claim { - chainName: String! + graphName: String! } extend type ClaimToken { - chainName: String! + graphName: String! } additionalResolvers: - - ./src/utils/resolvers.ts + - src/utils/resolvers.ts documents: - - ./src/indexer/queries/*.graphql + - src/indexer/queries/*.graphql codegen: - contextType: "MeshContext & { graphUrl: string, chainName: string }" + contextType: "MeshContext & { graphName: string }" plugins: - pollingLive: diff --git a/sdk/README.md b/sdk/README.md index 55f4adb5..40bf074b 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -24,15 +24,13 @@ import { HypercertClient } from "@hypercerts-org/sdk"; ```js const client = new HypercertClient({ - chainId: 5, - provider, - signer, + chain: { id: 5 } // required nftStorageToken, web3StorageToken, }); ``` -> **Note** If there's no `signer`, `provider`, `nftStorageToken` or `web3StorageToken` provided, the client will run in +> **Note** If there's no `walletClient`, `nftStorageToken` or `web3StorageToken` provided, the client will run in > [read-only mode](#read-only-mode) 4. Use the client object to interact with the Hypercert network. @@ -60,78 +58,36 @@ environment variables for your NFT.storage and web3.storage API keys in your .en ## Config -The SDK will try to determine the `DEFAULT_CHAIN_ID` and use that to inform the configuration. We allow for `overrides` -when creating the SDK by passing configuration variables. Finally, when not defaults or overrides are found, we check -the environment variables. +HypercertClientConfig is a configuration object used when initializing a new instance of the HypercertClient. It allows +you to customize the client by setting your own providers or deployments. At it's simplest, you only need to provide +`chain.id` to initalize the client in `readonly` mode. + +| Field | Type | Description | +| --------------------------- | ------- | ---------------------------------------------------------------------------------------------- | +| `chain` | Object | Partial configuration for the blockchain network. | +| `contractAddress` | String | The address of the deployed contract. | +| `graphUrl` | String | The URL to the subgraph that indexes the contract events. Override for localized testing. | +| `graphName` | String | The name of the subgraph. | +| `nftStorageToken` | String | The API token for NFT.storage. | +| `web3StorageToken` | String | The API token for Web3.storage. | +| `easContractAddress` | String | The address of the EAS contract. | +| `publicClient` | Object | The PublicClient is inherently read-only and is used for reading data from the blockchain. | +| `walletClient` | Object | The WalletClient is used for signing and sending transactions. | +| `unsafeForceOverrideConfig` | Boolean | Boolean to force the use of overridden values. | +| `readOnly` | Boolean | Boolean to assert if the client is in read-only mode. | +| `readOnlyReason` | String | Reason for read-only mode. This is optional and can be used for logging or debugging purposes. | ### Read-only mode The SDK client will be in read-only mode if any of the following conditions are true: -- The client was initialized without a signer or provider. -- The client was initialized with a provider but not a signer. -- The client was initialized with a signer but not a provider. +- The client was initialized without a walletprovider. - The contract address is not set. - The storage layer is in read-only mode. If any of these conditions are true, the readonly property of the HypercertClient instance will be set to true, and a warning message will be logged indicating that the client is in read-only mode. -### Defaults - -The constants.ts file defines various constants that are used throughout the Hypercert system. Here's a brief -explanation of each constant: - -`DEFAULT_CHAIN_ID`: This constant defines the default chain ID to use if no chain ID is specified. In this case, the -default chain ID is set to 5, which corresponds to the Goerli testnet. - -Based on `DEFAULT_CHAIN_ID` the SDK will select a `DEPLOYMENT`. - -`DEPLOYMENTS`: This constant defines the deployments that are managed by the Hypercert system. Each Deployment object -contains information about a specific deployment, including the chain ID, chain name, contract address, and graph name. - -For example: - -```json -{ - "5": { - "chainId": 5, - "chainName": "goerli", - "contractAddress": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", - "graphName": "hypercerts-testnet" - } -} -``` - -### Client config properties - -| \| Property | Type | Description | -| ------------------ | -------------------- | -------------------------------------- | -| `chainId` | `number` | The chain ID of the network to use. | -| `chainName` | `string` | The name of the network to use. | -| `contractAddress` | `string` | The address of the Hypercert contract. | -| `rpcUrl` | `string` | The URL of the RPC endpoint to use. | -| `graphName` | `string` | The name of the Gsubgraph to use. | -| `provider` | `providers.Provider` | A custom provider to use. | -| `signer` | `Signer` | A custom signer to use. | -| `nftStorageToken` | `string` | Your NFT.storage API key. | -| `web3StorageToken` | `string` | Your web3.storage API key. | - -### Environment variables - -To determine the missing configuration values the SDK defaults to the following environment variables: - -| Environment Variable | Description | -| -------------------------------- | --------------------------------------------------------------------------------------------------- | -| `DEFAULT_CHAIN_ID` | Specifies the default chain ID to use if no chain ID is specified. | -| `CONTRACT_ADDRESS` | Specifies the contract address to use for the Hypercert protocol. | -| `RPC_URL` | Specifies the RPC URL to use for the evm-compatible network. | -| `PRIVATE_KEY` | Specifies the private key to use for signing transactions. | -| `NFT_STORAGE_TOKEN` | Specifies the NFT.storage API token to use for storing Hypercert metadata. | -| `NEXT_PUBLIC_NFT_STORAGE_TOKEN` | Specifies the NFT.storage API token to use for storing Hypercert metadata in a Next.js application. | -| `WEB3_STORAGE_TOKEN` | Specifies the Web3.storage API token to use for storing Hypercert data. | -| `NEXT_PUBLIC_WEB3_STORAGE_TOKEN` | Specifies the Web3.storage API token to use for storing Hypercert data in a Next.js application. | - ### Logging The logger for the SDK uses the log level based on the value of the LOG_LEVEL environment variable. The log level @@ -147,7 +103,7 @@ HypercertIndexer, and HypercertMinter classes, respectively. ```js const { client: { storage }, -} = new HypercertClient({}); +} = new HypercertClient({ chain: { id: 5 } }); ``` The `storage` is a utility class that provides methods for storing and retrieving Hypercert metadata on IPFS and @@ -156,7 +112,7 @@ NFT.storage. It is used by the HypercertClient to store metadata when creating n ```js const { client: { indexer }, -} = new HypercertClient({}); +} = new HypercertClient({ chain: { id: 5 } }); ``` The `indexer` is a utility class that provides methods for indexing and searching Hypercerts based on various criteria. @@ -165,7 +121,7 @@ It is used by the HypercertClient to retrieve event-based data via the subgraph ```js const { client: { contract }, -} = new HypercertClient({}); +} = new HypercertClient({ chain: { id: 5 } }); ``` Finally we have a `contract` that provides methods for interacting with the HypercertMinter smart contract. It is used diff --git a/sdk/global.d.ts b/sdk/global.d.ts deleted file mode 100644 index 3b47093f..00000000 --- a/sdk/global.d.ts +++ /dev/null @@ -1 +0,0 @@ -import "jest-extended"; diff --git a/sdk/jest.config.ts b/sdk/jest.config.ts deleted file mode 100644 index 263def76..00000000 --- a/sdk/jest.config.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Config } from "jest"; - -const config: Config = { - extensionsToTreatAsEsm: [".ts", ".tsx"], - preset: "ts-jest/presets/js-with-ts-esm", // or other ESM presets, - setupFiles: ["./test/setup-env.ts"], - setupFilesAfterEnv: ["jest-extended/all"], - rootDir: ".", - moduleDirectories: ["node_modules", "/src", ".graphclient"], - moduleNameMapper: { - "^(\\.{1,2}/.*)\\.js$": "$1", - "^@hypercerts-org/contracts$": require.resolve("@hypercerts-org/contracts"), // this is the trick! - }, - verbose: false, - resolver: "ts-jest-resolver", - moduleFileExtensions: ["js", "jsx", "json", "ts"], - transform: {}, -}; - -export default config; diff --git a/sdk/package.json b/sdk/package.json index 1227f74b..575dd9a4 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@hypercerts-org/sdk", - "version": "0.8.16", + "version": "1.0.0-alpha.15", "description": "SDK for hypercerts protocol", "repository": "git@github.com:hypercerts-org/hypercerts.git", "author": "Hypercerts team", @@ -11,11 +11,9 @@ "module": "./dist/esm/index.js", "types": "./dist/index.d.ts", "exports": { - ".": { - "require": "./dist/cjs/index.js", - "import": "./dist/esm/index.js", - "types": "./dist/index.d.ts" - } + "require": "./dist/cjs/index.js", + "import": "./dist/esm/index.js", + "types": "./dist/index.d.ts" }, "files": [ "dist", @@ -23,90 +21,79 @@ "package.json" ], "dependencies": { - "@ethereum-attestation-service/eas-sdk": "^0.28.3", + "@ethereum-attestation-service/eas-sdk": "1.3.7", "@ethersproject/abstract-signer": "^5.7.0", - "@graphprotocol/client-add-source-name": "^1.0.16", + "@graphprotocol/client-add-source-name": "^2.0.0", + "@graphprotocol/client-cli": "^3.0.0", "@graphprotocol/client-polling-live": "^2.0.0", - "@graphql-mesh/cache-localforage": "^0.95.7", + "@graphql-mesh/cache-localforage": "^0.96.1", "@graphql-mesh/cross-helpers": "^0.4.1", - "@graphql-mesh/graphql": "^0.95.7", - "@graphql-mesh/http": "^0.96.13", - "@graphql-mesh/merger-bare": "^0.95.7", - "@graphql-mesh/runtime": "^0.96.12", - "@graphql-mesh/store": "^0.95.7", - "@graphql-mesh/types": "^0.95.7", - "@graphql-mesh/utils": "^0.95.7", + "@graphql-mesh/graphql": "^0.96.1", + "@graphql-mesh/http": "^0.97.2", + "@graphql-mesh/merger-bare": "^0.96.1", + "@graphql-mesh/runtime": "^0.97.2", + "@graphql-mesh/store": "^0.96.1", + "@graphql-mesh/utils": "^0.96.1", "@graphql-typed-document-node/core": "^3.2.0", - "@hypercerts-org/contracts": "0.8.11", - "@openzeppelin/merkle-tree": "^1.0.4", + "@hypercerts-org/contracts": "1.0.0-alpha.6", + "@openzeppelin/merkle-tree": "^1.0.5", "@whatwg-node/fetch": "^0.9.13", "ajv": "^8.11.2", - "axios": "^1.2.2", + "axios": "^1.6.2", "dotenv": "^16.0.3", - "ethers": "^5.7.2", + "ethers": "5.7.2", "graphql": "^16.6.0", - "ipfs-core": "^0.17.0", - "jest": "^29.3.1", "loglevel": "^1.8.1", - "mime": "^3.0.0", "nft.storage": "^7.1.1", + "viem": "^1.19.9", "web3.storage": "^4.5.5" }, "devDependencies": { - "@babel/core": "^7.23.2", - "@babel/preset-env": "^7.23.2", - "@babel/preset-typescript": "^7.23.2", - "@faker-js/faker": "^8.0.2", - "@graphprotocol/client-cli": "^3.0.0", - "@jest/globals": "^29.7.0", + "@babel/core": "^7.23.5", + "@babel/preset-env": "^7.23.5", + "@babel/preset-typescript": "^7.23.3", + "@faker-js/faker": "^8.3.1", "@rollup/plugin-commonjs": "^24.0.1", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.0.1", - "@types/chai": "^4.3.4", - "@types/chai-subset": "^1.3.3", - "@types/jest": "^29.2.5", + "@types/chai": "^4.3.11", + "@types/chai-subset": "^1.3.5", "@types/node": "^18.11.17", - "@types/sinon": "^10.0.15", - "babel-jest": "^29.7.0", + "@types/sinon": "^17.0.2", + "@viem/anvil": "^0.0.6", + "abitype": "^0.10.3", "chai": "^4.3.7", "chai-assertions-count": "^1.0.2", "chai-subset": "^1.6.0", - "esbuild": "^0.17.10", - "ethereum-waffle": "^4.0.10", - "it-all": "^2.0.0", - "jest-extended": "^4.0.0", - "json-schema-to-typescript": "^12.0.0", - "msw": "^1.2.1", + "esbuild": "^0.19.8", + "it-all": "^3.0.4", + "json-schema-to-typescript": "^13.1.1", "nyc": "^15.1.0", "rollup": "^3.17.2", "rollup-plugin-auto-external": "^2.0.0", - "rollup-plugin-dts": "^5.2.0", - "rollup-plugin-esbuild": "^5.0.0", + "rollup-plugin-dts": "^6.1.0", + "rollup-plugin-esbuild": "^6.1.0", "rollup-plugin-node-polyfills": "^0.2.1", - "shx": "^0.3.4", - "sinon": "^15.2.0", - "ts-jest": "^29.0.3", - "ts-jest-resolver": "^2.0.0", - "ts-mocha": "^10.0.0", + "sinon": "^17.0.1", + "sinon-chai": "^3.7.0", "ts-node": "^10.9.1", - "tslib": "^2.5.0", - "tsx": "^3.14.0", - "typedoc": "^0.23.25", - "typedoc-plugin-markdown": "^3.14.0", + "typedoc": "^0.25.4", + "typedoc-plugin-markdown": "^3.17.1", "typedoc-plugin-missing-exports": "^2.0.0", - "typescript": "^4.9.0" + "typescript": "5.3.2", + "vitest": "^1.0.1" }, "scripts": { - "build": "pnpm types:json && pnpm graph:build:esm && rollup -c", + "build": "pnpm types:json && pnpm graph:build && rollup -c", "docs": "typedoc", "graph:compile": "graphql-codegen", "graph:serve": "graphclient serve-dev", "graph:watch": "graphql-codegen -w", - "graph:build:esm": "rm -rf ./src/.graphclient && NODE_OPTIONS='--loader ts-node/esm' graphclient build --throwOnInvalidConfig", + "graph:build": "rm -rf ./src/.graphclient && graphclient build --throwOnInvalidConfig", "clean": "rm -rf ./dist", "prebuild": "pnpm clean", "prepack": "pnpm build", - "test": "NODE_OPTIONS=\"--no-warnings --experimental-vm-modules\" jest", + "test": "vitest", "types:json": "pnpm json2ts -i './src/resources/schema/' -o 'src/types' --cwd './src/resources/schema'" } } diff --git a/sdk/src/client.ts b/sdk/src/client.ts index 6163bf03..6f8c14e9 100644 --- a/sdk/src/client.ts +++ b/sdk/src/client.ts @@ -1,11 +1,9 @@ -import { HypercertMinter, HypercertMinterAbi } from "@hypercerts-org/contracts"; +import { HypercertMinterAbi } from "@hypercerts-org/contracts"; import { StandardMerkleTree } from "@openzeppelin/merkle-tree"; -import { BigNumber, BigNumberish, BytesLike, ContractTransaction, ethers, providers } from "ethers"; - -import { DEFAULT_CHAIN_ID } from "./constants.js"; -import HypercertEvaluator from "./evaluations/index.js"; -import HypercertIndexer from "./indexer.js"; -import HypercertsStorage from "./storage.js"; +import { Account, ByteArray, GetContractReturnType, Hex, PublicClient, WalletClient, getContract } from "viem"; +import { HypercertEvaluator } from "./evaluations"; +import { HypercertIndexer } from "./indexer"; +import { HypercertsStorage } from "./storage"; import { AllowlistEntry, ClientError, @@ -14,52 +12,60 @@ import { HypercertMetadata, InvalidOrMissingError, MalformedDataError, + SupportedOverrides, TransferRestrictions, -} from "./types/index.js"; -import { getConfig } from "./utils/config.js"; -import logger from "./utils/logger.js"; -import { validateAllowlist, validateMetaData, verifyMerkleProof, verifyMerkleProofs } from "./validator/index.js"; +} from "./types"; +import { getConfig } from "./utils/config"; +import { validateAllowlist, validateMetaData, verifyMerkleProof, verifyMerkleProofs } from "./validator"; +import { handleSimulatedContractError } from "./utils/errors"; +import { logger } from "./utils"; /** - * Hypercerts client factory - * @dev Creates a Hypercerts client instance - * @notice The client is readonly if no signer is set or if the contract address is not set - * @param config - Hypercerts client configuration - * @param storage - Hypercerts storage object + * The `HypercertClient` is a core class in the hypercerts SDK, providing a high-level interface to interact with the hypercerts system. + * + * It encapsulates the logic for storage, evaluation, indexing, and wallet interactions, abstracting the complexity and providing a simple API for users. + * The client is read-only if the storage is read-only (no nft.storage/web3.storage keys) or if no walletClient was found. + * + * @example + * const config: Partial = { + * chain: {id: 5}, + * }; + * const client = new HypercertClient(config); + * + * @param {Partial} config - The configuration options for the client. */ -export default class HypercertClient implements HypercertClientInterface { - readonly _config: HypercertClientConfig; +export class HypercertClient implements HypercertClientInterface { + readonly _config; private _storage: HypercertsStorage; - private _evaluator: HypercertEvaluator; + // TODO better handling readonly. For now not needed since we don't use this class; + private _evaluator?: HypercertEvaluator; private _indexer: HypercertIndexer; - //TODO added the TypedDataSigner since that's needed for EAS signing. Will this work on front-end? - private _operator: ethers.providers.Provider | ethers.Signer; - private _contract: HypercertMinter; + private _publicClient: PublicClient; + private _walletClient?: WalletClient; readonly: boolean; /** * Creates a new instance of the `HypercertClient` class. - * @param config The configuration options for the client. + * + * This constructor takes a `config` parameter that is used to configure the client. The `config` parameter should be a `HypercertClientConfig` object. If the public client cannot be connected, it throws a `ClientError`. + * + * @param {Partial} config - The configuration options for the client. + * @throws {ClientError} Will throw a `ClientError` if the public client cannot be connected. */ - constructor(config = { chainId: DEFAULT_CHAIN_ID } as Partial) { + constructor(config: Partial) { this._config = getConfig(config); - this._operator = this._config.operator; + if (!this._config.publicClient) { + throw new ClientError("Could not connect to public client."); + } - this._contract = ( - new ethers.Contract(this._config.contractAddress, HypercertMinterAbi, this._operator) - ); + this._publicClient = this._config.publicClient; + this._walletClient = this._config?.walletClient; this._storage = new HypercertsStorage(this._config); this._indexer = new HypercertIndexer(this._config); - this._evaluator = new HypercertEvaluator(this._config); - - this.readonly = - providers.Provider.isProvider(this._operator) || - !ethers.Signer.isSigner(this._operator) || - !this._config.contractAddress || - this._storage.readonly; + this.readonly = this._config.readOnly || this._storage.readonly || !this._walletClient; if (this.readonly) { logger.warn("HypercertsClient is in readonly mode", "client"); @@ -70,7 +76,7 @@ export default class HypercertClient implements HypercertClientInterface { * Gets the config for the client. * @returns The client config. */ - get config(): HypercertClientConfig { + get config(): Partial { return this._config; } @@ -94,31 +100,37 @@ export default class HypercertClient implements HypercertClientInterface { * Gets the HypercertMinter contract used by the client. * @returns The contract. */ - get contract(): HypercertMinter { - return this._contract; + get contract(): GetContractReturnType { + return getContract({ + address: this._config.contractAddress as `0x${string}`, + abi: HypercertMinterAbi, + publicClient: this._publicClient, + walletClient: this._walletClient, + }); } /** - * Mint a Hypercert claim - * @dev Mints a Hypercert claim with the given metadata, total units and transfer restrictions - * @param metaData - Hypercert metadata - * @param totalUnits - Total number of units for the Hypercert - * @param transferRestriction - Transfer restrictions for the Hypercert - * @returns Contract transaction + * Mints a new claim. + * + * This method first validates the provided metadata using the `validateMetaData` function. If the metadata is invalid, it throws a `MalformedDataError`. + * It then stores the metadata on IPFS using the `storeMetadata` method of the storage client. + * After that, it simulates a contract call to the `mintClaim` function with the provided parameters and the stored metadata CID to validate the transaction. + * Finally, it submits the request using the `submitRequest` method. + * + * @param {HypercertMetadata} metaData - The metadata for the claim. + * @param {bigint} totalUnits - The total units for the claim. + * @param {TransferRestrictions} transferRestriction - The transfer restrictions for the claim. + * @param {SupportedOverrides} [overrides] - Optional overrides for the contract call. + * @returns {Promise<`0x${string}` | undefined>} A promise that resolves to the transaction hash. + * @throws {MalformedDataError} Will throw a `MalformedDataError` if the provided metadata is invalid. */ mintClaim = async ( metaData: HypercertMetadata, - totalUnits: BigNumberish, + totalUnits: bigint, transferRestriction: TransferRestrictions, - overrides?: ethers.Overrides, - ): Promise => { - this.checkWritable(); - - if (!ethers.Signer.isSigner(this._config.operator)) { - throw new InvalidOrMissingError("Invalid operator: not a signer", { operator: this._config.operator }); - } - - const signerAddress = await this._config.operator.getAddress(); + overrides?: SupportedOverrides, + ): Promise<`0x${string}` | undefined> => { + const { account } = this.getWallet(); // validate metadata const { valid, errors } = validateMetaData(metaData); @@ -129,35 +141,113 @@ export default class HypercertClient implements HypercertClientInterface { // store metadata on IPFS const cid = await this.storage.storeMetadata(metaData); - return overrides - ? this.contract.mintClaim(signerAddress, totalUnits, cid, transferRestriction, overrides) - : this.contract.mintClaim(signerAddress, totalUnits, cid, transferRestriction); + const request = await this.simulateRequest( + account, + "mintClaim", + [account?.address, totalUnits, cid, transferRestriction], + overrides, + ); + + return this.submitRequest(request); + }; + + /** + * Gets the TransferRestrictions for a claim. + * + * This method first retrieves the read contract using the `getContract` method. It then simulates a contract call to the `readTransferRestriction` function with the provided fraction ID. + * + * @param fractionId + * @returns a Promise that resolves to the applicable transfer restrictions. + */ + getTransferRestrictions = async (fractionId: bigint): Promise => { + const readContract = getContract({ + ...this.getContractConfig(), + publicClient: this._publicClient, + }); + + return readContract.read.readTransferRestriction([fractionId]) as Promise; + }; + + /** + * Transfers a claim fraction to a new owner. + * + * This method first retrieves the wallet client and account using the `getWallet` method. + * It then simulates a contract call to the `safeTransferFrom` function with the provided parameters and the account, and submits the request using the `submitRequest` method. + * + * @param fractionId + * @param to + * @param overrides + * @returns {Promise<`0x${string}` | undefined>} A promise that resolves to the transaction hash. + */ + transferFraction = async ( + fractionId: bigint, + to: string, + overrides?: SupportedOverrides | undefined, + ): Promise<`0x${string}` | undefined> => { + const { account } = this.getWallet(); + + const request = await this.simulateRequest( + account, + "safeTransferFrom", + [account?.address, to, fractionId, 1, "0x"], + overrides, + ); + + return this.submitRequest(request); }; /** - * Create a Hypercert claim with an allowlist - * @dev Mints a Hypercert claim with the given metadata, total units, transfer restrictions and allowlist - * @notice The total number of units in the allowlist must match the total number of units for the Hypercert - * @param allowList - Allowlist for the Hypercert - * @param metaData - Hypercert metadata - * @param totalUnits - Total number of units for the Hypercert - * @param transferRestriction - Transfer restrictions for the Hypercert - * @returns Contract transaction + * Transfers multiple claim fractions to a new owner. + * + * This method first retrieves the wallet client and account using the `getWallet` method. + * It then simulates a contract call to the `safeBatchTransferFrom` function with the provided parameters and the account, and submits the request using the `submitRequest` method. + * + * @param fractionIds + * @param to + * @param overrides + * @returns {Promise<`0x${string}` | undefined>} A promise that resolves to the transaction hash. + */ + batchTransferFractions = async ( + fractionIds: bigint[], + to: `0x${string}`, + overrides?: SupportedOverrides | undefined, + ): Promise<`0x${string}` | undefined> => { + const { account } = this.getWallet(); + + const request = await this.simulateRequest( + account, + "safeBatchTransferFrom", + [account?.address, to, fractionIds, fractionIds.map(() => 1n), "0x"], + overrides, + ); + + return this.submitRequest(request); + }; + + /** + * Creates an allowlist. + * + * This method first validates the provided allowlist and metadata using the `validateAllowlist` and `validateMetaData` functions respectively. If either is invalid, it throws a `MalformedDataError`. + * It then creates an allowlist from the provided entries and stores it on IPFS using the `storeData` method of the storage client. + * After that, it stores the metadata (including the CID of the allowlist) on IPFS using the `storeMetadata` method of the storage client. + * Finally, it simulates a contract call to the `createAllowlist` function with the provided parameters and the stored metadata CID, and submits the request using the `submitRequest` method. + * + * @param {AllowlistEntry[]} allowList - The entries for the allowlist. + * @param {HypercertMetadata} metaData - The metadata for the claim. + * @param {bigint} totalUnits - The total units for the claim. + * @param {TransferRestrictions} transferRestriction - The transfer restrictions for the claim. + * @param {SupportedOverrides} [overrides] - Optional overrides for the contract call. + * @returns {Promise<`0x${string}` | undefined>} A promise that resolves to the transaction hash. + * @throws {MalformedDataError} Will throw a `MalformedDataError` if the provided allowlist or metadata is invalid. */ createAllowlist = async ( allowList: AllowlistEntry[], metaData: HypercertMetadata, - totalUnits: BigNumberish, + totalUnits: bigint, transferRestriction: TransferRestrictions, - overrides?: ethers.Overrides, - ) => { - this.checkWritable(); - - if (!ethers.Signer.isSigner(this._config.operator)) { - throw new InvalidOrMissingError("Invalid operator: not a signer", { operator: this._config.operator }); - } - - const signerAddress = await this._config.operator.getAddress(); + overrides?: SupportedOverrides, + ): Promise<`0x${string}` | undefined> => { + const { account } = this.getWallet(); // validate allowlist const { valid: validAllowlist, errors: allowlistErrors } = validateAllowlist(allowList, totalUnits); @@ -172,189 +262,298 @@ export default class HypercertClient implements HypercertClientInterface { } // create allowlist - const tuples = allowList.map((p) => [p.address, p.units]); + const tuples = allowList.map((p) => [p.address, p.units.toString()]); const tree = StandardMerkleTree.of(tuples, ["address", "uint256"]); const cidMerkle = await this.storage.storeData(JSON.stringify(tree.dump())); - metaData.allowList = cidMerkle; - // store metadata on IPFS - const cid = await this.storage.storeMetadata(metaData); + const cid = await this.storage.storeMetadata({ ...metaData, allowList: cidMerkle }); - return overrides - ? this.contract.createAllowlist(signerAddress, totalUnits, tree.root, cid, transferRestriction, overrides) - : this.contract.createAllowlist(signerAddress, totalUnits, tree.root, cid, transferRestriction); + const request = await this.simulateRequest( + account, + "createAllowlist", + [account?.address, totalUnits, tree.root, cid, transferRestriction], + overrides, + ); + + return this.submitRequest(request); }; /** - * Split a Hypercert's unit into multiple claims with the given fractions - * @dev Submit the ID of the claim to split and new fraction values. - * @notice The sum of the fractions must be equal to the total units of the claim - * @param claimId - Hypercert claim id - * @param fractions - Fractions of the Hypercert claim to split - * @returns Contract transaction + * Splits a fraction into multiple fractions. + * + * This method first retrieves the wallet client and account using the `getWallet` method. It then retrieves the owner and total units of the fraction using the `ownerOf` and `unitsOf` methods of the read contract. + * If the fraction is not owned by the account, it throws a `ClientError`. + * It then checks if the sum of the provided fractions is equal to the total units of the fraction. If not, it throws a `ClientError`. + * Finally, it simulates a contract call to the `splitFraction` function with the provided parameters and the account, and submits the request using the `submitRequest` method. + * + * @param {bigint} fractionId - The ID of the fraction to split. + * @param {bigint[]} fractions - The fractions to split the fraction into. + * @param {SupportedOverrides} [overrides] - Optional overrides for the contract call. + * @returns {Promise<`0x${string}` | undefined>} A promise that resolves to the transaction hash. + * @throws {ClientError} Will throw a `ClientError` if the fraction is not owned by the account or if the sum of the fractions is not equal to the total units of the fraction. */ - splitClaimUnits = async (claimId: BigNumberish, fractions: BigNumberish[], overrides?: ethers.Overrides) => { - this.checkWritable(); + splitFractionUnits = async ( + fractionId: bigint, + fractions: bigint[], + overrides?: SupportedOverrides, + ): Promise<`0x${string}` | undefined> => { + const { account } = this.getWallet(); - // check if claim exists and is owned by the signer - if (!ethers.Signer.isSigner(this._config.operator)) { - throw new InvalidOrMissingError("Invalid operator: not a signer", { operator: this._config.operator }); - } + const readContract = getContract({ + ...this.getContractConfig(), + publicClient: this._publicClient, + }); - const signerAddress = await this._config.operator.getAddress(); + const fractionOwner = (await readContract.read.ownerOf([fractionId])) as `0x${string}`; + const totalUnits = (await readContract.read.unitsOf([fractionId])) as bigint; - const claimOwner = await this._contract.ownerOf(claimId); - if (claimOwner.toLowerCase() !== signerAddress.toLowerCase()) - throw new ClientError("Claim is not owned by the signer", { signer: signerAddress, claimOwner }); + if (fractionOwner.toLowerCase() !== account?.address.toLowerCase()) + throw new ClientError("Claim is not owned by the signer", { signer: account?.address, fractionOwner }); // check if the sum of the fractions is equal to the total units - const totalUnits = await this._contract["unitsOf(uint256)"](claimId); - const sumFractions = fractions.reduce((a, b) => BigNumber.from(a).add(b), BigNumber.from(0)); - if (!BigNumber.from(sumFractions).eq(totalUnits)) + const sumFractions = fractions.reduce((a, b) => a + b, 0n); + if (sumFractions != totalUnits) throw new ClientError("Sum of fractions is not equal to the total units", { totalUnits, sumFractions }); - return overrides - ? this.contract.splitFraction(signerAddress, claimId, fractions, overrides) - : this.contract.splitFraction(signerAddress, claimId, fractions); + const request = await this.simulateRequest( + account, + "splitFraction", + [account?.address, fractionId, fractions], + overrides, + ); + + return this.submitRequest(request); }; /** - * Merge multiple Hypercert claims fractions into one - * @dev Merges multiple Hypercert claims into one - * @param claimIds - Hypercert claim ids - * @returns Contract transaction + * Merges multiple fractions into a single fraction. + * + * This method first retrieves the wallet client and account using the `getWallet` method. It then retrieves the owner of each fraction using the `ownerOf` method of the read contract. + * If any of the fractions are not owned by the account, it throws a `ClientError`. + * It then simulates a contract call to the `mergeFractions` function with the provided parameters and the account, and submits the request using the `submitRequest` method. + * + * @param {bigint[]} fractionIds - The IDs of the fractions to merge. + * @param {SupportedOverrides} [overrides] - Optional overrides for the contract call. + * @returns {Promise<`0x${string}` | undefined>} A promise that resolves to the transaction hash. + * @throws {ClientError} Will throw a `ClientError` if any of the fractions are not owned by the account. */ - mergeClaimUnits = async (claimIds: BigNumberish[], overrides?: ethers.Overrides) => { - this.checkWritable(); - - // check if all claims exist and are owned by the signer - if (!ethers.Signer.isSigner(this._config.operator)) { - throw new InvalidOrMissingError("Invalid operator: not a signer", { operator: this._config.operator }); - } + mergeFractionUnits = async ( + fractionIds: bigint[], + overrides?: SupportedOverrides, + ): Promise<`0x${string}` | undefined> => { + const { account } = this.getWallet(); + + const readContract = getContract({ + ...this.getContractConfig(), + publicClient: this._publicClient, + }); + + const fractions = await Promise.all( + fractionIds.map(async (id) => ({ id, owner: (await readContract.read.ownerOf([id])) as `0x${string}` })), + ); - const signerAddress = await this._config.operator.getAddress(); + const notOwned = fractions.filter((fraction) => fraction.owner.toLowerCase() !== account?.address.toLowerCase()); - const claims = await Promise.all(claimIds.map(async (id) => ({ id, owner: await this._contract.ownerOf(id) }))); - if (claims.some((c) => c.owner.toLowerCase() !== signerAddress.toLowerCase())) { - const invalidClaimIDs = claims.filter((c) => c.owner !== signerAddress).map((c) => c.id); - throw new ClientError("One or more claims are not owned by the signer", { - signer: signerAddress, - claims: invalidClaimIDs, + if (notOwned.length > 0) { + throw new ClientError("One or more fractions are not owned by the signer", { + signer: account?.address, + notOwned, }); } - return overrides - ? this.contract.mergeFractions(signerAddress, claimIds, overrides) - : this.contract.mergeFractions(signerAddress, claimIds); + const request = await this.simulateRequest(account, "mergeFractions", [account?.address, fractionIds], overrides); + + return this.submitRequest(request); }; /** - * Burn a Hypercert claim by providing the claim id - * @dev Burns a Hypercert claim - * @param claimId - Hypercert claim id - * @returns Contract transaction + * Burns a claim fraction. + * + * This method first retrieves the wallet client and account using the `getWallet` method. It then retrieves the owner of the claim using the `ownerOf` method of the read contract. + * If the claim is not owned by the account, it throws a `ClientError`. + * It then simulates a contract call to the `burnFraction` function with the provided parameters and the account, and submits the request using the `submitRequest` method. + * + * @param {bigint} claimId - The ID of the claim to burn. + * @param {SupportedOverrides} [overrides] - Optional overrides for the contract call. + * @returns {Promise<`0x${string}` | undefined>} A promise that resolves to the transaction hash. + * @throws {ClientError} Will throw a `ClientError` if the claim is not owned by the account. */ - burnClaimFraction = async (claimId: BigNumberish, overrides?: ethers.Overrides) => { - this.checkWritable(); + burnClaimFraction = async (claimId: bigint, overrides?: SupportedOverrides): Promise<`0x${string}` | undefined> => { + const { account } = this.getWallet(); - // check if claim exists and is owned by the signer - if (!ethers.Signer.isSigner(this._config.operator)) { - throw new InvalidOrMissingError("Invalid operator: not a signer", { operator: this._config.operator }); + const readContract = getContract({ + ...this.getContractConfig(), + publicClient: this._publicClient, + }); + + const claimOwner = (await readContract.read.ownerOf([claimId])) as `0x${string}`; + + if (claimOwner.toLowerCase() !== account?.address.toLowerCase()) { + throw new ClientError("Claim is not owned by the signer", { signer: account?.address, claimOwner }); } - const signerAddress = await this._config.operator.getAddress(); - const claimOwner = await this._contract.ownerOf(claimId); - if (claimOwner.toLowerCase() !== signerAddress.toLowerCase()) - throw new ClientError("Claim is not owned by the signer", { signer: signerAddress, claimOwner }); + const request = await this.simulateRequest(account, "burnFraction", [account?.address, claimId], overrides); - return overrides - ? this.contract.burnFraction(signerAddress, claimId, overrides) - : this.contract.burnFraction(signerAddress, claimId); + return this.submitRequest(request); }; /** - * Mint a Hypercert claim fraction from an allowlist. - * @dev Verifies the claim proof and mints the claim fraction - * @notice If known, provide the root for client side verification - * @param claimId - Hypercert claim id - * @param units - Number of units to mint - * @param proof - Merkle proof for the claim - * @returns Contract transaction + * Mints a claim fraction from an allowlist. + * + * This method first retrieves the wallet client and account using the `getWallet` method. It then verifies the provided proof using the `verifyMerkleProof` function. If the proof is invalid, it throws an `InvalidOrMissingError`. + * It then simulates a contract call to the `mintClaimFromAllowlist` function with the provided parameters and the account, and submits the request using the `submitRequest` method. + * + * @param {bigint} claimId - The ID of the claim to mint. + * @param {bigint} units - The units of the claim to mint. + * @param {(Hex | ByteArray)[]} proof - The proof for the claim. + * @param {Hex | ByteArray} [root] - The root of the proof. If provided, it is used to verify the proof. + * @param {SupportedOverrides} [overrides] - Optional overrides for the contract call. + * @returns {Promise<`0x${string}` | undefined>} A promise that resolves to the transaction hash. + * @throws {InvalidOrMissingError} Will throw an `InvalidOrMissingError` if the proof is invalid. */ mintClaimFractionFromAllowlist = async ( - claimId: BigNumberish, - units: BigNumberish, - proof: BytesLike[], - root?: BytesLike, - overrides?: ethers.Overrides, - ): Promise => { - this.checkWritable(); - - if (!ethers.Signer.isSigner(this._config.operator)) { - throw new InvalidOrMissingError("Invalid operator: not a signer", { operator: this._config.operator }); - } + claimId: bigint, + units: bigint, + proof: (Hex | ByteArray)[], + root?: Hex | ByteArray, + overrides?: SupportedOverrides, + ): Promise<`0x${string}` | undefined> => { + const { account } = this.getWallet(); - const signerAddress = await this._config.operator.getAddress(); //verify the proof using the OZ merkle tree library if (root && root.length > 0) { + if (!account?.address) throw new InvalidOrMissingError("No wallet address found, are you connected?"); verifyMerkleProof( root.toString(), - signerAddress, + account?.address, units, proof.map((p) => p.toString()), ); } - return overrides - ? this.contract.mintClaimFromAllowlist(signerAddress, proof, claimId, units, overrides) - : this.contract.mintClaimFromAllowlist(signerAddress, proof, claimId, units); + const request = await this.simulateRequest( + account, + "mintClaimFromAllowlist", + [account?.address, proof, claimId, units], + overrides, + ); + + return this.submitRequest(request); }; /** - * Batch mints a claim fraction from an allowlist - * @param claimIds Array of the IDs of the claims to mint fractions for. - * @param units Array of the number of units for each fraction. - * @param proofs Array of Merkle proofs for the allowlists. - * @returns A Promise that resolves to the transaction receipt - * @note The length of the arrays must be equal. - * @note The order of the arrays must be equal. - * @returns A Promise that resolves to the transaction receipt + * Mints multiple claim fractions from allowlists in a batch. + * + * This method first retrieves the wallet client and account using the `getWallet` method. If the roots are provided, it verifies each proof using the `verifyMerkleProofs` function. If any of the proofs are invalid, it throws an `InvalidOrMissingError`. + * It then simulates a contract call to the `batchMintClaimsFromAllowlists` function with the provided parameters and the account, and submits the request using the `submitRequest` method. + * + * @param {bigint[]} claimIds - The IDs of the claims to mint. + * @param {bigint[]} units - The units of each claim to mint. + * @param {(Hex | ByteArray)[][]} proofs - The proofs for each claim. + * @param {(Hex | ByteArray)[]} [roots] - The roots of each proof. If provided, they are used to verify the proofs. + * @param {SupportedOverrides} [overrides] - Optional overrides for the contract call. + * @returns {Promise<`0x${string}` | undefined>} A promise that resolves to the transaction hash. + * @throws {InvalidOrMissingError} Will throw an `InvalidOrMissingError` if any of the proofs are invalid. */ batchMintClaimFractionsFromAllowlists = async ( - claimIds: BigNumberish[], - units: BigNumberish[], - proofs: BytesLike[][], - roots?: BytesLike[], - overrides?: ethers.Overrides, - ): Promise => { - this.checkWritable(); - - if (!ethers.Signer.isSigner(this._config.operator)) { - throw new InvalidOrMissingError("Invalid operator: not a signer", { operator: this._config.operator }); - } - - const signerAddress = await this._config.operator.getAddress(); + claimIds: bigint[], + units: bigint[], + proofs: (Hex | ByteArray)[][], + roots?: (Hex | ByteArray)[], + overrides?: SupportedOverrides, + ): Promise<`0x${string}` | undefined> => { + const { account } = this.getWallet(); //verify the proof using the OZ merkle tree library if (roots && roots.length > 0) { + if (!account?.address) throw new InvalidOrMissingError("No wallet address found, are you connected?"); + verifyMerkleProofs( roots.map((r) => r.toString()), - signerAddress, + account?.address, units, proofs.map((p) => p.map((p) => p.toString())), ); } - return overrides - ? this.contract.batchMintClaimsFromAllowlists(signerAddress, proofs, claimIds, units, overrides) - : this.contract.batchMintClaimsFromAllowlists(signerAddress, proofs, claimIds, units); + const request = await this.simulateRequest( + account, + "batchMintClaimsFromAllowlists", + [account?.address, proofs, claimIds, units], + overrides, + ); + + return this.submitRequest(request); + }; + + private getContractConfig = () => { + if (!this.config?.contractAddress) throw new ClientError("No contract address found", { config: this.config }); + + return getContract({ + address: this.config.contractAddress as `0x${string}`, + abi: HypercertMinterAbi, + }); }; - private checkWritable = () => { - //TODO add check on ContractRunner when migrating to ethers v6 + private getCleanedOverrides = (overrides?: SupportedOverrides) => { + const _overrides = { + value: overrides?.value, + gas: overrides?.gasLimit, + gasPrice: overrides?.gasPrice, + }; + + return Object.fromEntries(Object.entries(_overrides).filter(([_, value]) => value !== undefined)); + }; + + private getWallet = () => { + if (!this._walletClient) { + throw new ClientError("Could not connect to wallet; sending transactions not allowed.", { client: this }); + } if (this.readonly) throw new ClientError("Client is readonly", { client: this }); + if (!this._walletClient.account) throw new ClientError("No account found", { client: this }); + + return { walletClient: this._walletClient, account: this._walletClient.account }; + }; + + private simulateRequest = async ( + account: Account, + functionName: string, + args: unknown[], + overrides?: SupportedOverrides, + ) => { + try { + const { request } = await this._publicClient.simulateContract({ + functionName, + account, + args, + ...this.getContractConfig(), + ...this.getCleanedOverrides(overrides), + }); + + return request; + } catch (err) { + throw handleSimulatedContractError(err); + } + }; + + /** + * Submits a contract request. + * + * This method submits a contract request using the `writeContract` method of the wallet client. If the request fails, it throws a `ClientError`. + * + * @param {any} request - The contract request to submit. + * @returns {Promise<`0x${string}`>} A promise that resolves to the hash of the submitted request. + * @throws {ClientError} Will throw a `ClientError` if the request fails. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + private submitRequest = async (request: any) => { + const hash = await this._walletClient?.writeContract(request); + + if (!hash) { + throw new ClientError("Something went wrong when executing request", { request, hash }); + } - return true; + return hash; }; } diff --git a/sdk/src/constants.ts b/sdk/src/constants.ts index da4383b5..deebf21c 100644 --- a/sdk/src/constants.ts +++ b/sdk/src/constants.ts @@ -2,37 +2,30 @@ * Constants */ -import { Deployment, SupportedChainIds } from "./types/index.js"; - -// Goerli is default if nothing specified -const DEFAULT_CHAIN_ID = 5; +import { Deployment, SupportedChainIds } from "./types"; const DEFAULT_GRAPH_BASE_URL = "https://api.thegraph.com/subgraphs/name/hypercerts-admin"; // These are the deployments we manage -const DEPLOYMENTS: { [key in SupportedChainIds]: Deployment } = { +const DEPLOYMENTS: { [key in SupportedChainIds]: Partial } = { 5: { - chainId: 5, - chainName: "goerli", contractAddress: "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", + graphName: "hypercerts-testnet", graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-testnet`, } as const, 10: { - chainId: 10, - chainName: "optimism-mainnet", contractAddress: "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", + graphName: "hypercerts-optimism-mainnet", graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-optimism-mainnet`, } as const, 42220: { - chainId: 42220, - chainName: "celo-mainnet", contractAddress: "0x16ba53b74c234c870c61efc04cd418b8f2865959", + graphName: "hypercerts-celo", graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-celo`, }, 11155111: { - chainId: 11155111, - chainName: "sepolia", contractAddress: "0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941", + graphName: "hypercerts-sepolia", graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-sepolia`, } as const, }; @@ -52,4 +45,4 @@ const EAS_SCHEMAS = { }, } as const; -export { DEFAULT_CHAIN_ID, DEPLOYMENTS, EAS_SCHEMAS }; +export { DEPLOYMENTS, EAS_SCHEMAS }; diff --git a/sdk/src/evaluations/eas.ts b/sdk/src/evaluations/eas.ts deleted file mode 100644 index 3a7923b1..00000000 --- a/sdk/src/evaluations/eas.ts +++ /dev/null @@ -1,155 +0,0 @@ -import { Offchain, SchemaEncoder, SignedOffchainAttestation } from "@ethereum-attestation-service/eas-sdk"; -import { TypedDataSigner } from "@ethersproject/abstract-signer"; -import { ethers } from "ethers"; - -import { EAS_SCHEMAS } from "../constants.js"; -import { - DuplicateEvaluation, - EvaluationData, - HypercertClientConfig, - InvalidOrMissingError, - MalformedDataError, - SimpleTextEvaluation, -} from "../types/index.js"; -import { validateDuplicateEvaluationData, validateSimpleTextEvaluationData } from "../validator/index.js"; - -/** - * The EasEvaluator class provides methods for signing off-chain attestations of evaluations. - * Schemas are stored on-chain in the Ethereum Attestation Service (EAS) contract. - */ -export default class EasEvaluator { - /** - * The Offchain instance used for signing off-chain attestations. - */ - offChain: Offchain; - - /** - * The TypedDataSigner instance used for signing typed data. - */ - signer?: ethers.Signer & TypedDataSigner; - - readonly = true; - - /** - * Creates a new EasEvaluator instance. - * @param {EasEvaluatorConfig} config - The configuration options for the EasEvaluator instance. - */ - constructor(config: Partial) { - const { easContractAddress, chainId, operator } = config; - - if (!easContractAddress || !chainId || !operator) { - const missingValue = !easContractAddress ? "easContractAddress" : !chainId ? "chainId" : "operator"; - - throw new InvalidOrMissingError(`Invalid or missing config value: ${missingValue}`, { easConfig: config }); - } - - //TODO when expanding the Evaluator functionallity, we should review if readonly makes sense - if (ethers.Signer.isSigner(config.operator)) { - this.signer = config.operator as ethers.Signer & TypedDataSigner; - this.readonly = false; - } - - this.offChain = new Offchain({ address: easContractAddress, chainId: chainId, version: "0.26" }); - } - - /** - * Gets a signature for an off-chain attestation. - * @param {string} encodedData - The encoded data to sign. - * @param {string} recipient - The address of the recipient of the attestation. - * @param {string} schemaUid - The UID of the schema to use for the attestation. - * @returns {Promise} - The signature for the attestation. - */ - getSignature = async ( - encodedData: string, - recipient: string, - schemaUid: string, - ): Promise => { - if (!this.signer) { - throw new InvalidOrMissingError("No valid signer available.", { signer: this.signer }); - } - - return await this.offChain.signOffchainAttestation( - { - // TODO who will be the recipient? The contract it points to? The creator? - recipient, - // Unix timestamp of when attestation expires. (0 for no expiration) - expirationTime: 0, - // Unix timestamp of current time - time: Date.now(), - revocable: true, - nonce: 0, - schema: schemaUid, - refUID: "0x0000000000000000000000000000000000000000000000000000000000000000", - data: encodedData, - }, - this.signer, - ); - }; - - /** - * Signs an offline evaluation. - * @param {EvaluationData} evaluation - The evaluation data to sign. - * @returns {Promise} - The signature for the evaluation. - * @throws {MalformedDataError} - If the evaluation data is malformed. - */ - signOfflineEvaluation = async (evaluation: EvaluationData) => { - if (isDuplicateEvaluation(evaluation)) { - const validation = validateDuplicateEvaluationData(evaluation); - if (!validation.valid) { - throw new MalformedDataError("Invalid evaluation data", { errors: validation.errors }); - } - - const duplicateSchema = EAS_SCHEMAS["sepolia"].duplicate; - const schemaEncoder = new SchemaEncoder(duplicateSchema.schema); - const recipient = evaluation.realHypercert.contract; - - // Initialize SchemaEncoder with the schema string - // TODO validate schema values - const encodedData = schemaEncoder.encodeData([ - { name: "chainId", value: evaluation.realHypercert.chainId as string, type: "uint256" }, - { name: "contract", value: evaluation.realHypercert.contract as string, type: "address" }, - { name: "claimId", value: evaluation.realHypercert.claimId as string, type: "uint256" }, - ]); - - return this.getSignature(encodedData, recipient, duplicateSchema.uid); - } - - if (isSimpleTextEvaluation(evaluation)) { - const validation = validateSimpleTextEvaluationData(evaluation); - if (!validation.valid) { - throw new MalformedDataError("Invalid evaluation data", { errors: validation.errors }); - } - - const simpleTextSchema = EAS_SCHEMAS["sepolia"].contentHash; - const schemaEncoder = new SchemaEncoder(simpleTextSchema.schema); - const recipient = evaluation.hypercert.contract; - - const contentHash = ethers.utils.id(evaluation.text); - - // Initialize SchemaEncoder with the schema string - // TODO validate schema values - const encodedData = schemaEncoder.encodeData([{ name: "contentHash", value: contentHash, type: "bytes32" }]); - - return this.getSignature(encodedData, recipient, simpleTextSchema.uid); - } - - assertNever(evaluation); - }; -} - -const isDuplicateEvaluation = (evaluation: EvaluationData): evaluation is DuplicateEvaluation => { - return ( - evaluation.type === "duplicate" && - "realHypercert" in evaluation && - "duplicateHypercerts" in evaluation && - "explanation" in evaluation - ); -}; - -const isSimpleTextEvaluation = (evaluation: EvaluationData): evaluation is SimpleTextEvaluation => { - return evaluation.type === "simpleText" && "hypercert" in evaluation && "text" in evaluation; -}; - -const assertNever = (evaluation: never): never => { - throw new Error(`Unexpected evaluation type: ${evaluation}`); -}; diff --git a/sdk/src/evaluations/index.ts b/sdk/src/evaluations/index.ts index 9092b0b7..9d14b72a 100644 --- a/sdk/src/evaluations/index.ts +++ b/sdk/src/evaluations/index.ts @@ -1,20 +1,10 @@ -import type { TypedDataSigner } from "@ethersproject/abstract-signer"; -import { ethers } from "ethers"; -import { isAddress } from "ethers/lib/utils.js"; +import { isAddress } from "viem"; +//eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore import { CIDString } from "nft.storage"; -import { DEFAULT_CHAIN_ID } from "../constants.js"; -import HypercertsStorage from "../storage.js"; -import { - EASEvaluation, - EvaluationSource, - HypercertClientConfig, - HypercertEvaluationSchema, - MalformedDataError, -} from "../types/index.js"; -import EasEvaluator from "./eas.js"; - -const EASContractAddress = "0xC2679fBD37d54388Ce493F1DB75320D236e1815e"; // Sepolia v0.26 +import { HypercertsStorage } from "../storage"; +import { HypercertClientConfig, HypercertEvaluationSchema, MalformedDataError } from "../types"; export interface EvaluatorInterface { /** @@ -25,29 +15,18 @@ export interface EvaluatorInterface { submitEvaluation: (evaluation: HypercertEvaluationSchema) => Promise; } -export default class HypercertEvaluator implements EvaluatorInterface { - signer?: ethers.Signer & TypedDataSigner; - +export class HypercertEvaluator implements EvaluatorInterface { storage: HypercertsStorage; - eas: EasEvaluator; - readonly = true; - constructor( - config = { - chainId: DEFAULT_CHAIN_ID, - easContractAddress: EASContractAddress, - operator: new ethers.VoidSigner(""), - } as Partial, - ) { + constructor(config: Partial) { //TODO when expanding the Evaluator functionallity, we should review if readonly makes sense - if (ethers.Signer.isSigner(config.operator)) { - this.signer = config.operator as ethers.Signer & TypedDataSigner; + if (config?.walletClient?.account) { this.readonly = false; } + this.storage = new HypercertsStorage(config); - this.eas = new EasEvaluator(config); } submitEvaluation = async (evaluation: HypercertEvaluationSchema): Promise => { @@ -55,22 +34,6 @@ export default class HypercertEvaluator implements EvaluatorInterface { throw new MalformedDataError(`Invalid creator address: ${evaluation.creator}`); } - if (isEasEvaluation(evaluation.evaluationSource)) { - const signedData = await this.eas.signOfflineEvaluation(evaluation.evaluationData); - const evaluationData = { ...evaluation.evaluationData, signedData }; - - return this.storage.storeData({ ...evaluation, evaluationData }); - } - throw new Error(`Unexpected evaluation source: ${evaluation.evaluationSource.toString()}`); }; } - -const isEasEvaluation = (evaluationSource: EvaluationSource): evaluationSource is EASEvaluation => { - return ( - evaluationSource.type === "EAS" && - "chainId" in evaluationSource && - "contract" in evaluationSource && - "uid" in evaluationSource - ); -}; diff --git a/sdk/src/index.ts b/sdk/src/index.ts index 4bbdfcd6..58cc06ef 100644 --- a/sdk/src/index.ts +++ b/sdk/src/index.ts @@ -1,14 +1,14 @@ -import type { HypercertMinter, IHypercertToken } from "@hypercerts-org/contracts"; +import { HypercertMinterAbi, HypercertExchangeAbi } from "@hypercerts-org/contracts"; import { execute } from "../.graphclient"; -import HypercertClient from "./client.js"; -import HypercertsStorage from "./storage.js"; -import { DEPLOYMENTS } from "./constants.js"; +import { HypercertClient } from "./client"; +import { HypercertsStorage } from "./storage"; +import { DEPLOYMENTS } from "./constants"; /** * Protocol */ -export type { HypercertMinter, IHypercertToken }; +export { HypercertMinterAbi, HypercertExchangeAbi }; export { DEPLOYMENTS as deployments }; /** @@ -24,17 +24,17 @@ export { HypercertsStorage }; /** * Types */ -export * from "./types/index.js"; +export * from "./types"; /** * Validators */ -export * from "./validator/index.js"; +export * from "./validator"; /** - * Formatters + * Utils */ -export * from "./utils/formatter.js"; +export * from "./utils"; /** * Graph diff --git a/sdk/src/indexer.ts b/sdk/src/indexer.ts index 793e77ab..331beb93 100644 --- a/sdk/src/indexer.ts +++ b/sdk/src/indexer.ts @@ -1,23 +1,54 @@ -import { getBuiltGraphSDK, Sdk as GraphClient } from "../.graphclient"; -import { defaultQueryParams } from "./indexer/utils.js"; -import { HypercertIndexerInterface, QueryParams } from "./types/index.js"; +import { logger } from "./utils"; +import { + getBuiltGraphSDK, + Sdk as GraphClient, + execute, + ClaimsByOwnerDocument, + ClaimsByOwnerQuery, + ClaimByIdDocument, + ClaimByIdQuery, + RecentClaimsDocument, + RecentClaimsQuery, + ClaimsByOwnerQueryVariables, + ClaimByIdQueryVariables, + RecentClaimsQueryVariables, + ClaimTokensByOwnerDocument, + ClaimTokensByOwnerQuery, + ClaimTokensByOwnerQueryVariables, + ClaimTokensByClaimDocument, + ClaimTokensByClaimQueryVariables, + ClaimTokensByClaimQuery, + ClaimTokenByIdDocument, + ClaimTokenByIdQueryVariables, + ClaimTokenByIdQuery, +} from "../.graphclient"; +import { defaultQueryParams } from "./indexer/utils"; +import { HypercertClientConfig, HypercertIndexerInterface, QueryParams } from "./types"; /** * A class that provides indexing functionality for Hypercerts. - * @class HypercertIndexer + * + * This class implements the `HypercertIndexerInterface` and provides methods for retrieving claims by owner and by ID. It uses the Graph client for indexing. + * Because of the autogenerated Graph client packed with the SDK, this class is not recommended for custom Graph deployments. + * + * @property {GraphClient} _graphClient - The Graph client used by the indexer. + * + * @example + * const indexer = new HypercertIndexer({ graphUrl: 'your-graph-url', graphName: 'your-graph-name' }); + * const claims = await indexer.claimsByOwner('your-address'); */ -export default class HypercertIndexer implements HypercertIndexerInterface { +export class HypercertIndexer implements HypercertIndexerInterface { /** The Graph client used by the indexer. */ - private _graphClient: GraphClient; + private _graphName: string; /** * Creates a new instance of the `HypercertIndexer` class. * @param options The configuration options for the indexer. */ - constructor(options: { graphUrl?: string }) { - this._graphClient = getBuiltGraphSDK({ - graphUrl: options.graphUrl || "https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-testnet", - }); + constructor(options: Partial) { + logger.info("Creating HypercertIndexer", "constructor", { name: options.graphName, url: options.graphUrl }); + if (!options.graphName) throw new Error("Missing graphName"); + this._graphName = options.graphName; } /** @@ -25,7 +56,9 @@ export default class HypercertIndexer implements HypercertIndexerInterface { * @returns The Graph client. */ get graphClient(): GraphClient { - return this._graphClient; + return getBuiltGraphSDK({ + graphName: this._graphName, + }); } /** @@ -34,31 +67,39 @@ export default class HypercertIndexer implements HypercertIndexerInterface { * @param params The query parameters. * @returns A Promise that resolves to the claims. */ - claimsByOwner = async (owner: string, params: QueryParams = defaultQueryParams) => - this.graphClient.ClaimsByOwner({ + claimsByOwner = async (owner: string, params: QueryParams = defaultQueryParams) => { + const query = ClaimsByOwnerDocument; + const variables: ClaimsByOwnerQueryVariables = { owner, ...params, - }); + }; + return (await execute(query, variables, { graphName: this._graphName })) as ClaimsByOwnerQuery; + }; /** * Gets a claim by its ID. * @param id The ID of the claim. * @returns A Promise that resolves to the claim. */ - claimById = async (id: string) => - this.graphClient.ClaimById({ + claimById = async (id: string) => { + const query = ClaimByIdDocument; + const variables: ClaimByIdQueryVariables = { id, - }); - + }; + return (await execute(query, variables, { graphName: this._graphName })) as ClaimByIdQuery; + }; /** * Gets the most recent claims. * @param params The query parameters. * @returns A Promise that resolves to the claims. */ - firstClaims = async (params: QueryParams = defaultQueryParams) => - this.graphClient.RecentClaims({ + firstClaims = async (params: QueryParams = defaultQueryParams) => { + const query = RecentClaimsDocument; + const variables: RecentClaimsQueryVariables = { ...params, - }); + }; + return (await execute(query, variables, { graphName: this._graphName })) as RecentClaimsQuery; + }; /** * Gets the claim tokens owned by a given address. @@ -66,11 +107,14 @@ export default class HypercertIndexer implements HypercertIndexerInterface { * @param params The query parameters. * @returns A Promise that resolves to the claim tokens. */ - fractionsByOwner = async (owner: string, params: QueryParams = defaultQueryParams) => - this.graphClient.ClaimTokensByOwner({ + fractionsByOwner = async (owner: string, params: QueryParams = defaultQueryParams) => { + const query = ClaimTokensByOwnerDocument; + const variables: ClaimTokensByOwnerQueryVariables = { owner, ...params, - }); + }; + return (await execute(query, variables, { graphName: this._graphName })) as ClaimTokensByOwnerQuery; + }; /** * Gets the claim tokens for a given claim. @@ -78,19 +122,25 @@ export default class HypercertIndexer implements HypercertIndexerInterface { * @param params The query parameters. * @returns A Promise that resolves to the claim tokens. */ - fractionsByClaim = async (claimId: string, params: QueryParams = defaultQueryParams) => - this.graphClient.ClaimTokensByClaim({ + fractionsByClaim = async (claimId: string, params: QueryParams = defaultQueryParams) => { + const query = ClaimTokensByClaimDocument; + const variables: ClaimTokensByClaimQueryVariables = { claimId, ...params, - }); + }; + return (await execute(query, variables, { graphName: this._graphName })) as ClaimTokensByClaimQuery; + }; /** * Gets a claim token by its ID. * @param fractionId The ID of the claim token. * @returns A Promise that resolves to the claim token. */ - fractionById = async (fractionId: string) => - this.graphClient.ClaimTokenById({ + fractionById = async (fractionId: string) => { + const query = ClaimTokenByIdDocument; + const variables: ClaimTokenByIdQueryVariables = { claimTokenId: fractionId, - }); + }; + return (await execute(query, variables, { graphName: this._graphName })) as ClaimTokenByIdQuery; + }; } diff --git a/sdk/src/indexer/queries/claims.graphql b/sdk/src/indexer/queries/claims.graphql index 776ee260..9e143ae8 100644 --- a/sdk/src/indexer/queries/claims.graphql +++ b/sdk/src/indexer/queries/claims.graphql @@ -1,6 +1,6 @@ query ClaimsByOwner($owner: Bytes = "", $orderDirection: OrderDirection, $first: Int, $skip: Int) { claims(where: { owner: $owner }, skip: $skip, first: $first, orderDirection: $orderDirection) { - chainName + graphName contract tokenID creator @@ -13,7 +13,7 @@ query ClaimsByOwner($owner: Bytes = "", $orderDirection: OrderDirection, $first: query RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) { claims(orderDirection: $orderDirection, orderBy: creation, first: $first) { - chainName + graphName contract tokenID creator @@ -26,7 +26,7 @@ query RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) { query ClaimById($id: ID!) { claim(id: $id) { - chainName + graphName contract tokenID creator diff --git a/sdk/src/indexer/queries/fractions.graphql b/sdk/src/indexer/queries/fractions.graphql index 20eb8ad0..df07f421 100644 --- a/sdk/src/indexer/queries/fractions.graphql +++ b/sdk/src/indexer/queries/fractions.graphql @@ -1,6 +1,6 @@ query ClaimTokensByOwner($owner: Bytes = "", $orderDirection: OrderDirection, $first: Int, $skip: Int) { claimTokens(where: { owner: $owner }, skip: $skip, first: $first, orderDirection: $orderDirection) { - chainName + graphName id owner tokenID @@ -16,7 +16,7 @@ query ClaimTokensByOwner($owner: Bytes = "", $orderDirection: OrderDirection, $f query ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) { claimTokens(where: { claim: $claimId }, skip: $skip, first: $first, orderDirection: $orderDirection) { - chainName + graphName id owner tokenID @@ -26,7 +26,7 @@ query ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $fi query ClaimTokenById($claimTokenId: ID!) { claimToken(id: $claimTokenId) { - chainName + graphName id owner tokenID diff --git a/sdk/src/indexer/utils.ts b/sdk/src/indexer/utils.ts index d016677e..28329336 100644 --- a/sdk/src/indexer/utils.ts +++ b/sdk/src/indexer/utils.ts @@ -1,4 +1,4 @@ -import { QueryParams } from "../types/index.js"; +import { QueryParams } from "../types"; export const defaultQueryParams: QueryParams = { orderDirections: "desc", diff --git a/sdk/src/storage.ts b/sdk/src/storage.ts index 8dd23c2a..3bf2fdbe 100644 --- a/sdk/src/storage.ts +++ b/sdk/src/storage.ts @@ -1,24 +1,35 @@ -import axios from "axios"; +//eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore import { CIDString, NFTStorage } from "nft.storage"; +//eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore import { Blob, File, Web3Storage } from "web3.storage"; -import { validateMetaData } from "./validator/index.js"; +import { validateMetaData } from "./validator"; import { HypercertStorageConfig, HypercertStorageInterface, HypercertMetadata, MalformedDataError, StorageError, -} from "./types/index.js"; -import logger from "./utils/logger.js"; -import { getConfig } from "./utils/config.js"; - -const getCid = (cidOrIpfsUri: string) => cidOrIpfsUri.replace("ipfs://", ""); +} from "./types"; +import { logger, getFromIPFS } from "./utils"; +import { getNftStorageToken, getWeb3StorageToken } from "./utils/config"; /** * A class that provides storage functionality for Hypercerts. + * + * This class implements the `HypercertStorageInterface` and provides methods for storing and retrieving Hypercerts. It uses the NFT Storage and Web3 Storage APIs for storage, and can be configured to be read-only. + * + * @property {boolean} readonly - Whether the storage is read-only. If true, the storage methods will not perform any write operations. + * @property {NFTStorage} nftStorageClient - The NFT Storage client used for storing and retrieving Hypercerts. + * @property {Web3Storage} web3StorageClient - The Web3 Storage client used for storing and retrieving Hypercerts. + * + * @example + * const storage = new HypercertsStorage({ nftStorageToken: 'your-nft-storage-token', web3StorageToken: 'your-web3-storage-token' }); + * const metadata = await storage.getMetadata('your-hypercert-id'); */ -export default class HypercertsStorage implements HypercertStorageInterface { +export class HypercertsStorage implements HypercertStorageInterface { /** Whether the storage is read-only. */ readonly: boolean = true; /** The NFT storage client. */ @@ -28,37 +39,44 @@ export default class HypercertsStorage implements HypercertStorageInterface { /** * Creates a new instance of the `HypercertsStorage` class. - * @param overrides The configuration overrides for the storage. + * + * This constructor takes an optional `overrides` parameter that can be used to override the default configuration. If the NFT Storage or Web3 Storage API keys are missing or invalid, the storage will be read-only. + * + * @param {Partial} overrides - The configuration overrides for the storage. */ constructor(overrides: Partial) { - const { nftStorageToken, web3StorageToken } = getConfig(overrides); - - if (!nftStorageToken || nftStorageToken === "") { - logger.warn(`NFT Storage API key is missing or invalid: ${nftStorageToken}}`); - } - - if (!web3StorageToken || web3StorageToken === "") { - logger.warn(`Web3 Storage API key is missing or invalid: ${web3StorageToken}`); - } + const nftStorageToken = getNftStorageToken(overrides); + const web3StorageToken = getWeb3StorageToken(overrides); if (!nftStorageToken || !web3StorageToken) { logger.warn("HypercertsStorage is read only", "storage"); this.readonly = true; + + if (!nftStorageToken) { + logger.warn(`NFT Storage API key is missing or invalid: ${nftStorageToken}}`); + } + + if (!web3StorageToken) { + logger.warn(`Web3 Storage API key is missing or invalid: ${web3StorageToken}`); + } } else { - this.nftStorageClient = new NFTStorage({ token: nftStorageToken }); - this.web3StorageClient = new Web3Storage({ token: web3StorageToken }); + this.nftStorageClient = new NFTStorage({ token: nftStorageToken.nftStorageToken || "" }); + this.web3StorageClient = new Web3Storage({ token: web3StorageToken.web3StorageToken || "" }); this.readonly = false; } } /** - * Stores metadata for a Hypercert. - * @param data The metadata to store. - * @returns A Promise that resolves to the CID of the stored metadata. - * @throws A `StorageError` if the storage client is not configured. - * @throws A `MalformedDataError` if the metadata is invalid. - * @notice Because we pay for storage quotas, this data is stored best effort. - * If you are using our default keys, we may delete older data if we hit our storage quota. + * Stores Hypercert metadata using the NFT Storage client. + * + * This method first checks if the storage is read-only or if the NFT Storage client is not configured. If either of these conditions is true, it throws a `StorageError`. + * It then validates the provided metadata using the `validateMetaData` function. If the metadata is invalid, it throws a `MalformedDataError`. + * If the metadata is valid, it creates a new Blob from the metadata and stores it using the NFT Storage client. If the storage operation fails, it throws a `StorageError`. + * + * @param {HypercertMetadata} data - The Hypercert metadata to store. This should be an object that conforms to the HypercertMetadata type. + * @returns {Promise} A promise that resolves to the CID of the stored metadata. + * @throws {StorageError} Will throw a `StorageError` if the storage is read-only, if the NFT Storage client is not configured, or if the storage operation fails. + * @throws {MalformedDataError} Will throw a `MalformedDataError` if the provided metadata is invalid. */ public async storeMetadata(data: HypercertMetadata): Promise { if (this.readonly || !this.nftStorageClient) { @@ -84,37 +102,37 @@ export default class HypercertsStorage implements HypercertStorageInterface { } /** - * Gets metadata for a Hypercert. - * @param cidOrIpfsUri The CID or IPFS URI of the metadata to get. - * @returns A Promise that resolves to the metadata. - * @throws A `StorageError` if the storage client is not configured or the metadata cannot be retrieved. - * @throws A `MalformedDataError` if the metadata is invalid. E.g. unknown schema + * Retrieves Hypercert metadata from IPFS using the provided CID or IPFS URI. + * + * This method first retrieves the data from IPFS using the `getFromIPFS` function. It then validates the retrieved data using the `validateMetaData` function. If the data is invalid, it throws a `MalformedDataError`. + * If the data is valid, it returns the data as a `HypercertMetadata` object. + * + * @param {string} cidOrIpfsUri - The CID or IPFS URI of the metadata to retrieve. + * @returns {Promise} A promise that resolves to the retrieved metadata. + * @throws {MalformedDataError} Will throw a `MalformedDataError` if the retrieved data is invalid. */ public async getMetadata(cidOrIpfsUri: string): Promise { - const nftStorageGatewayLink = this.getNftStorageGatewayUri(cidOrIpfsUri); - logger.debug(`Getting metadata ${cidOrIpfsUri} at ${nftStorageGatewayLink}`); + const res = await getFromIPFS(cidOrIpfsUri); - const res = await axios.get(nftStorageGatewayLink); - - if (!res || !res.data) { - throw new StorageError(`Failed to get ${cidOrIpfsUri}`); - } - - const data = res.data; - const validation = validateMetaData(data); + const validation = validateMetaData(res); if (!validation.valid) { throw new MalformedDataError(`Invalid metadata at ${cidOrIpfsUri}`, { errors: validation.errors }); } - return data; + return validation.data as HypercertMetadata; } /** - * Stores arbitrary data in Web3 storage. - * @param data The data to store. - * @returns A Promise that resolves to the CID of the stored data. - * @throws A `StorageError` if the storage client is not configured. - * @notice Even though web3.storage takes a list of files, we'll assume we're only storing 1 JSON blob. + * Stores data using the Web3 Storage client. + * + * This method first checks if the storage is read-only or if the Web3 Storage client is not configured. If either of these conditions is true, it throws a `StorageError`. + * It then creates a new Blob from the provided data and stores it using the Web3 Storage client. If the storage operation fails, it throws a `StorageError`. + * + * @param {unknown} data - The data to store. This can be any type of data. + * @returns {Promise} A promise that resolves to the CID of the stored data. + * @throws {StorageError} Will throw a `StorageError` if the storage is read-only, if the Web3 Storage client is not configured, or if the storage operation fails. + * + * @remarks Even though web3.storage takes a list of files, we'll assume we're only storing 1 JSON blob. * Because we pay for storage quotas, this data is stored best effort. * If you are using our default keys, we may delete older data if we hit our storage quota. */ @@ -135,12 +153,18 @@ export default class HypercertsStorage implements HypercertStorageInterface { } /** - * Gets arbitrary data from Web3 storage. - * @param cidOrIpfsUri The CID or IPFS URI of the data to get. - * @returns A Promise that resolves to the data. - * @throws A `StorageError` if the storage client is not configured or the data cannot be retrieved. + * Retrieves data from IPFS using the provided CID or IPFS URI. + * + * This method first retrieves the data from IPFS using the `getFromIPFS` function. It then parses the retrieved data as JSON and returns it. + * + * @param {string} cidOrIpfsUri - The CID or IPFS URI of the data to retrieve. + * @returns {Promise} A promise that resolves to the retrieved data. + * @throws {FetchError} Will throw a `FetchError` if the retrieval operation fails. + * @throws {MalformedDataError} Will throw a `MalformedDataError` if the retrieved data is not a single file. + * + * @remarkts Note: The original implementation using the Web3 Storage client is currently commented out due to issues with upstream repos. This will be replaced once those issues are resolved. */ - public async getData(cidOrIpfsUri: string) { + public async getData(cidOrIpfsUri: string): Promise { /** // Using the default web3.storage client is not working in upstream repos. Needs further testing. const cid = getCid(cidOrIpfsUri); @@ -168,14 +192,6 @@ export default class HypercertsStorage implements HypercertStorageInterface { */ // TODO: replace current temporary fix of just using NFT.Storage IPFS gateway - const nftStorageGatewayLink = this.getNftStorageGatewayUri(cidOrIpfsUri); - logger.info(`Getting data ${cidOrIpfsUri} at ${nftStorageGatewayLink}`, "storage"); - - return axios.get(nftStorageGatewayLink).then((result) => result.data); + return await getFromIPFS(cidOrIpfsUri); } - - getNftStorageGatewayUri = (cidOrIpfsUri: string) => { - const NFT_STORAGE_IPFS_GATEWAY = "https://nftstorage.link/ipfs/{cid}"; - return NFT_STORAGE_IPFS_GATEWAY.replace("{cid}", getCid(cidOrIpfsUri)); - }; } diff --git a/sdk/src/types/client.ts b/sdk/src/types/client.ts index 7d803a0c..37d5100c 100644 --- a/sdk/src/types/client.ts +++ b/sdk/src/types/client.ts @@ -1,26 +1,32 @@ import { PartialTypedDataConfig } from "@ethereum-attestation-service/eas-sdk"; -import { HypercertMinter } from "@hypercerts-org/contracts"; -import { BigNumberish, BytesLike, ContractTransaction, ethers } from "ethers"; +//eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore import { CIDString } from "nft.storage"; -import HypercertIndexer from "../indexer.js"; -import { AllowlistEntry, TransferRestrictions } from "./hypercerts.js"; -import { HypercertMetadata } from "./metadata.js"; +import { HypercertIndexer } from "../indexer"; +import { AllowlistEntry, TransferRestrictions } from "./hypercerts"; +import { HypercertMetadata } from "./metadata"; + +import { ByteArray, Chain, Hex, PublicClient, WalletClient, GetContractReturnType } from "viem"; +import { HypercertMinterAbi } from "@hypercerts-org/contracts"; export type SupportedChainIds = 5 | 10 | 42220 | 11155111; +export type SupportedOverrides = { + value?: bigint; + gasPrice?: bigint; + gasLimit?: bigint; +}; /** * Represents a deployment of a contract on a specific network. */ export type Deployment = { - /** The ID of the network on which the contract is deployed. */ - chainId: number; - /** The name of the network on which the contract is deployed. */ - chainName: string; + chain: Partial; /** The address of the deployed contract. */ contractAddress: string; /** The url to the subgraph that indexes the contract events. Override for localized testing */ graphUrl: string; + graphName: string; }; /** @@ -29,10 +35,15 @@ export type Deployment = { export type HypercertClientConfig = Deployment & HypercertStorageConfig & HypercertEvaluatorConfig & { - /** The provider is inherently read-only */ - operator: ethers.providers.Provider | ethers.Signer; + /** The PublicClient is inherently read-only */ + publicClient: PublicClient; + walletClient: WalletClient; /** Force the use of overridden values */ unsafeForceOverrideConfig?: boolean; + /** Boolean to assert if the client is in readOnly mode */ + readOnly: boolean; + /** Reason for readOnly mode */ + readOnlyReason?: string; }; /** @@ -110,8 +121,7 @@ export interface HypercertClientState { storage: HypercertStorageInterface; /** The indexer used by the client. */ indexer: HypercertIndexer; - /** The contract used by the client. */ - contract: HypercertMinter; + contract: GetContractReturnType; } /** @@ -123,13 +133,46 @@ export interface HypercertClientMethods { * @param metaData The metadata for the claim. * @param totalUnits The total number of units for the claim. * @param transferRestriction The transfer restriction for the claim. - * @returns A Promise that resolves to the transaction receipt + * @returns A Promise that resolves to the transaction hash */ mintClaim: ( metaData: HypercertMetadata, - totalUnits: BigNumberish, + totalUnits: bigint, transferRestriction: TransferRestrictions, - ) => Promise; + ) => Promise<`0x${string}` | undefined>; + + /** + * Retrieves the TransferRestrictions for a claim. + * @param fractionId The ID of the claim to retrieve. + * @returns A Promise that resolves to the applicable transfer restrictions. + */ + getTransferRestrictions: (fractionId: bigint) => Promise; + + /** + * Transfers a claim fraction to a new owner. + * @param fractionId + * @param to + * @param overrides + * @returns A Promise that resolves to the transaction hash + */ + transferFraction: ( + fractionId: bigint, + to: `0x${string}`, + overrides?: SupportedOverrides, + ) => Promise<`0x${string}` | undefined>; + + /** + * Transfers multiple claim fractions to a new owner. + * @param fractionIds + * @param to + * @param overrides + * @returns A Promise that resolves to the transaction hash + */ + batchTransferFractions: ( + fractionIds: bigint[], + to: `0x${string}`, + overrides?: SupportedOverrides, + ) => Promise<`0x${string}` | undefined>; /** * Creates a new allowlist and mints a new claim with the allowlist. @@ -137,49 +180,49 @@ export interface HypercertClientMethods { * @param metaData The metadata for the claim. * @param totalUnits The total number of units for the claim. * @param transferRestriction The transfer restriction for the claim. - * @returns A Promise that resolves to the transaction receipt + * @returns A Promise that resolves to the transaction hash */ createAllowlist: ( allowList: AllowlistEntry[], metaData: HypercertMetadata, - totalUnits: BigNumberish, + totalUnits: bigint, transferRestriction: TransferRestrictions, - ) => Promise; + ) => Promise<`0x${string}` | undefined>; /** * Splits a claim into multiple fractions. - * @param claimId The ID of the claim to split. - * @param fractions The number of units for each fraction. - * @returns A Promise that resolves to the transaction receipt + * @param fractionId The ID of the claim to split. + * @param newFractions The number of units for each fraction. + * @returns A Promise that resolves to the transaction hash */ - splitClaimUnits: (claimId: BigNumberish, fractions: BigNumberish[]) => Promise; + splitFractionUnits: (fractionId: bigint, fractions: bigint[]) => Promise<`0x${string}` | undefined>; /** * Merges multiple claim fractions into a single claim. - * @param claimIds The IDs of the claim fractions to merge. - * @returns A Promise that resolves to the transaction receipt + * @param fractionIds The IDs of the claim fractions to merge. + * @returns A Promise that resolves to the transaction hash */ - mergeClaimUnits: (claimIds: BigNumberish[]) => Promise; + mergeFractionUnits: (fractionIds: bigint[]) => Promise<`0x${string}` | undefined>; /** * Burns a claim fraction. - * @param claimId The ID of the claim fraction to burn. - * @returns A Promise that resolves to the transaction receipt + * @param fractionId The ID of the claim fraction to burn. + * @returns A Promise that resolves to the transaction hash */ - burnClaimFraction: (claimId: BigNumberish) => Promise; + burnClaimFraction: (fractionId: bigint) => Promise<`0x${string}` | undefined>; /** * Mints a claim fraction from an allowlist. * @param claimId The ID of the claim to mint a fraction for. * @param units The number of units for the fraction. * @param proof The Merkle proof for the allowlist. - * @returns A Promise that resolves to the transaction receipt + * @returns A Promise that resolves to the transaction hash */ mintClaimFractionFromAllowlist: ( - claimId: BigNumberish, - units: BigNumberish, - proof: BytesLike[], - ) => Promise; + claimId: bigint, + units: bigint, + proof: (Hex | ByteArray)[], + ) => Promise<`0x${string}` | undefined>; /** * Batch mints a claim fraction from an allowlist @@ -189,11 +232,11 @@ export interface HypercertClientMethods { * @returns A Promise that resolves to the transaction receipt * @note The length of the arrays must be equal. * @note The order of the arrays must be equal. - * @returns A Promise that resolves to the transaction receipt + * @returns A Promise that resolves to the transaction hash */ batchMintClaimFractionsFromAllowlists: ( - claimIds: BigNumberish[], - units: BigNumberish[], - proofs: BytesLike[][], - ) => Promise; + claimIds: bigint[], + units: bigint[], + proofs: (Hex | ByteArray)[][], + ) => Promise<`0x${string}` | undefined>; } diff --git a/sdk/src/types/errors.ts b/sdk/src/types/errors.ts index 89640bf6..5da11836 100644 --- a/sdk/src/types/errors.ts +++ b/sdk/src/types/errors.ts @@ -1,3 +1,5 @@ +import { BaseError, Hex } from "viem"; + /** * An interface for errors that have a specific type. */ @@ -29,6 +31,26 @@ export class ClientError extends Error implements CustomError { } } +/** + * An error that is returned by the contract + */ +export class ContractError extends Error implements CustomError { + /** + * Additional error payload. + */ + payload?: { [key: string]: unknown }; + + constructor(errorName?: string, payload?: { data: BaseError | Hex; [key: string]: unknown }) { + const message = errorName + ? `Contract reverted: ${errorName}` + : "Contract returned unparsable error. Inspect payload for returned data."; + + super(message); + this.message = message; + this.payload = payload; + } +} + /** * Fails fetching a remote resource */ diff --git a/sdk/src/types/hypercerts.ts b/sdk/src/types/hypercerts.ts index 31df75cb..82f03c55 100644 --- a/sdk/src/types/hypercerts.ts +++ b/sdk/src/types/hypercerts.ts @@ -1,10 +1,10 @@ -import { BigNumberish } from "ethers"; - /** - * Transfer restrictions for Hypercerts matching the definitions in the Hypercerts protocol - * @dev AllowAll: All transfers are allowed - * @dev DisallowAll: All transfers are disallowed - * @dev FromCreatorOnly: Only the creator can transfer the Hypercert + * Represents the possible transfer restrictions of a claim matching the hypercerts protocol. + * + * @typedef {Object} TransferRestrictions + * @property {number} AllowAll - Represents no restrictions on the transfer of the claim. + * @property {number} DisallowAll - Represents complete restriction on the transfer of the claim. + * @property {number} FromCreatorOnly - Represents that the claim can only be transferred by its creator. */ export const TransferRestrictions = { AllowAll: 0, @@ -15,11 +15,13 @@ export const TransferRestrictions = { export type TransferRestrictions = (typeof TransferRestrictions)[keyof typeof TransferRestrictions]; /** - * Allowlist entry for Hypercerts matching the definitions in the Hypercerts protocol - * @param address - Address of the recipient - * @param units - Number of units allocated to the recipient + * Represents an entry in an allowlist. + * + * @typedef {Object} AllowlistEntry + * @property {string} address - The address of the entry. + * @property {bigint} units - The units associated with the entry. */ export type AllowlistEntry = { address: string; - units: BigNumberish; + units: bigint; }; diff --git a/sdk/src/types/index.ts b/sdk/src/types/index.ts index b3f7dfc7..39d19b46 100644 --- a/sdk/src/types/index.ts +++ b/sdk/src/types/index.ts @@ -1,8 +1,8 @@ -export type { HypercertClaimdata } from "./claimdata.js"; -export * from "./client.js"; -export * from "./errors.js"; -export * from "./hypercerts.js"; -export * from "./indexer.js"; +export type { HypercertClaimdata } from "./claimdata"; +export * from "./client"; +export * from "./errors"; +export * from "./hypercerts"; +export * from "./indexer"; export type { EvaluationData, EvaluationSource, @@ -12,6 +12,6 @@ export type { EASEvaluation, IPFSEvaluation, HypercertPointer, -} from "./evaluation.js"; -export type { ClaimByIdQuery, ClaimTokensByClaimQuery, Claim, ClaimToken } from "./global.js"; -export type { HypercertMetadata } from "./metadata.js"; +} from "./evaluation"; +export type { ClaimByIdQuery, ClaimTokensByClaimQuery, Claim, ClaimToken } from "./global"; +export type { HypercertMetadata } from "./metadata"; diff --git a/sdk/src/utils/adapters.ts b/sdk/src/utils/adapters.ts new file mode 100644 index 00000000..89f25fe3 --- /dev/null +++ b/sdk/src/utils/adapters.ts @@ -0,0 +1,66 @@ +import { providers } from "ethers"; +import { PublicClient, HttpTransport, WalletClient } from "viem"; +import { logger } from "./logger"; +import { Signer, TypedDataSigner } from "@ethersproject/abstract-signer"; + +/** + * This function converts a `PublicClient` instance to an ethers.js `Provider` to faciliate compatibility between ethers and viem. + * + * It extracts the chain and transport from the `PublicClient` and creates a network object. + * If no chain is found in the `PublicClient`, it logs a warning and stops the signature request. + * If the transport type is "fallback", it creates a `FallbackProvider` with multiple transports. + * Otherwise, it creates a `JsonRpcProvider` with a single transport. + * + * Ref: https://viem.sh/docs/ethers-migration.html + * + * @param publicClient - The `PublicClient` instance to convert. + * @returns An ethers.js `Provider` instance, or `undefined` if no chain is found in the `PublicClient`. + */ +export function publicClientToProvider(publicClient: PublicClient) { + const { chain, transport } = publicClient; + if (!chain) { + logger.warn("No chain found in public client, stopping signature request."); + return; + } + const network = { + chainId: chain.id, + name: chain.name, + ensAddress: chain.contracts?.ensRegistry?.address, + }; + if (transport.type === "fallback") + return new providers.FallbackProvider( + (transport.transports as ReturnType[]).map( + ({ value }) => new providers.JsonRpcProvider(value?.url, network), + ), + ); + return new providers.JsonRpcProvider(transport.url, network); +} + +/** + * This function converts a `WalletClient` instance to an ethers.js `Signer` to faciliate compatibility between ethers and viem. + * + * It extracts the account, chain, and transport from the `WalletClient` and creates a network object. + * If no chain is found in the `WalletClient`, it logs a warning and stops the signature request. + * It then creates a `Web3Provider` with the transport and network, and gets a `Signer` from the provider using the account's address. + * + * Ref: https://viem.sh/docs/ethers-migration.html + * + * @param walletClient - The `WalletClient` instance to convert. + * @returns An ethers.js `Signer` instance, or `undefined` if no chain is found in the `WalletClient`. + */ +export function walletClientToSigner(walletClient: WalletClient) { + const { account, chain, transport } = walletClient; + if (!chain) { + logger.warn("No chain found in public client, stopping signature request."); + return; + } + const network = { + chainId: chain.id, + name: chain.name, + ensAddress: chain.contracts?.ensRegistry?.address, + }; + const provider = new providers.Web3Provider(transport, network); + const signer = provider.getSigner(account?.address); + + return signer as Signer & TypedDataSigner; +} diff --git a/sdk/src/utils/allowlist.ts b/sdk/src/utils/allowlist.ts new file mode 100644 index 00000000..a0f840e2 --- /dev/null +++ b/sdk/src/utils/allowlist.ts @@ -0,0 +1,46 @@ +import { StandardMerkleTree } from "@openzeppelin/merkle-tree"; +import { getFromIPFS } from "./fetchers"; +import { logger } from "./logger"; + +const getMerkleTreeFromIPFS = async (cidOrIpfsUri: string) => { + const data = await getFromIPFS(cidOrIpfsUri); + const allowlist = typeof data === "string" ? data : undefined; + + if (!allowlist) { + throw new Error(`Invalid allowlist at ${cidOrIpfsUri}`); + } + + const tree = StandardMerkleTree.load(JSON.parse(allowlist)); + + if (!tree) { + throw new Error(`Invalid allowlist at ${cidOrIpfsUri}`); + } + + return tree; +}; + +/** + * This function retrieves proofs from an allowlist. + * + * It fetches a Merkle tree from IPFS using a given CID or IPFS URI, then iterates over the tree to find an account. + * When the account is found, it generates a proof for that account and logs the account, index, and proof as debug. + * It returns the proof and the root of the Merkle tree. + * + * @param cidOrIpfsUri - The CID or IPFS URI to fetch the Merkle tree from. + * @param account - The account to find in the Merkle tree. + * @returns An object containing the proof for the account and the root of the Merkle tree. + * @throws Will throw an error if the Merkle tree cannot be fetched. + * @async + */ +const getProofsFromAllowlist = async (cidOrIpfsUri: string, account: `0x${string}`) => { + const tree = await getMerkleTreeFromIPFS(cidOrIpfsUri); + for (const [i, v] of tree.entries()) { + if (v[0] === account) { + const proof = tree.getProof(i); + logger.debug(`Found ${account} at index ${i} with proof ${proof}`); + return { proof, root: tree.root }; + } + } +}; + +export { getProofsFromAllowlist }; diff --git a/sdk/src/utils/config.ts b/sdk/src/utils/config.ts index a9dfb228..5d873cc7 100644 --- a/sdk/src/utils/config.ts +++ b/sdk/src/utils/config.ts @@ -1,7 +1,6 @@ -import { ethers } from "ethers"; -import { isAddress } from "ethers/lib/utils.js"; +import { sepolia, goerli, optimism, celo, Chain } from "viem/chains"; -import { DEFAULT_CHAIN_ID, DEPLOYMENTS } from "../constants.js"; +import { DEPLOYMENTS } from "../constants"; import { ConfigurationError, Deployment, @@ -9,100 +8,120 @@ import { InvalidOrMissingError, SupportedChainIds, UnsupportedChainError, -} from "../types/index.js"; -import logger from "./logger.js"; +} from "../types"; +import { logger } from "./logger"; +import { createPublicClient, http, isAddress } from "viem"; +import { deployments } from "../../src"; /** - * Returns the configuration for the Hypercert client, based on the given overrides. - * @param overrides An object containing overrides for the default configuration. - * @returns The configuration for the Hypercert client. - * @throws An `UnsupportedChainError` if the chain ID is not 5 or 10, or if the chain ID is missing or not found. + * Returns a configuration object for the Hypercert client. + * + * This function first retrieves the chain configuration, then checks if there are any overrides provided. If the `unsafeForceOverrideConfig` flag is set, + * it validates the overrides and uses them to create the base deployment configuration. If the flag is not set, it retrieves the deployment configuration + * for the provided chain ID or the default chain ID. It then merges the base deployment configuration with the overrides and the values retrieved from + * environment variables to create the final configuration object. If any required properties are missing, it logs a warning. + * + * Current supported chain IDs are: + * - 5: Goerli + * - 10: Optimism + * - 42220: Celo + * - 11155111: Sepolia + * + * @param {Partial} overrides - An object containing any configuration values to override. This should be a partial HypercertClientConfig object. + * @returns {Partial} The final configuration object for the Hypercert client. + * @throws {InvalidOrMissingError} Will throw an `InvalidOrMissingError` if the `unsafeForceOverrideConfig` flag is set but the required overrides are not provided. + * @throws {UnsupportedChainError} Will throw an `UnsupportedChainError` if the default configuration for the provided chain ID is missing. */ -export const getConfig = (overrides: Partial) => { +export const getConfig = (overrides: Partial): Partial => { // Get the chainId, first from overrides, then environment variables, then the constant - const { chainId } = getChainConfig(overrides); + const chain = getChainConfig(overrides); + if (!chain) { + logger.warn("[getConfig]: No default config for chain found"); + } - let baseDeployment: Deployment & { unsafeForceOverrideConfig?: boolean }; + let baseDeployment: (Partial & { unsafeForceOverrideConfig?: boolean }) | undefined; if (overrides.unsafeForceOverrideConfig) { - if (!overrides.chainName || !overrides.contractAddress || !overrides.graphUrl) { - throw new UnsupportedChainError( - `attempted to override with chainId=${chainId}, but requires chainName, graphUrl, and contractAddress to be set`, - { chainID: chainId?.toString() || "undefined" }, + if (!overrides.chain?.id || !overrides.contractAddress || !overrides.graphUrl) { + throw new InvalidOrMissingError( + `attempted to override with chainId=${overrides.chain?.id}, but requires chainName, graphUrl, and contractAddress to be set`, + { + chainID: overrides.chain?.id?.toString(), + graphUrl: overrides.graphUrl, + contractAddress: overrides.contractAddress, + }, ); } baseDeployment = { - chainId: chainId, - chainName: overrides.chainName, + chain: { ...chain, id: overrides.chain?.id }, contractAddress: overrides.contractAddress, graphUrl: overrides.graphUrl, unsafeForceOverrideConfig: overrides.unsafeForceOverrideConfig, }; } else { - if (!chainId || [5, 10, 42220, 11155111].indexOf(chainId) === -1) { - throw new UnsupportedChainError(`chainId=${chainId} is not yet supported`, { - chainID: chainId?.toString() || "undefined", - }); - } - - baseDeployment = DEPLOYMENTS[chainId as SupportedChainIds]; + //TODO doo many casts + baseDeployment = overrides.chain?.id + ? (getDeployment(overrides.chain?.id as SupportedChainIds) as Partial & { + unsafeForceOverrideConfig?: boolean; + }) + : chain?.id + ? (getDeployment(chain.id as SupportedChainIds) as Partial & { unsafeForceOverrideConfig?: boolean }) + : undefined; if (!baseDeployment) { - throw new UnsupportedChainError(`Default config for chainId=${chainId} is missing in SDK`, { - chainID: chainId, + throw new UnsupportedChainError(`Default config for chainId=${overrides.chain?.id} is missing in SDK`, { + chainID: overrides.chain?.id, }); } + + baseDeployment = { ...baseDeployment, chain }; } - const config = { + const config: Partial = { // Start with the hardcoded values ...baseDeployment, // Let the user override from environment variables - ...getChainConfig(overrides), - ...getOperator(overrides), + ...getWalletClient(overrides), + ...getPublicClient(overrides), ...getContractAddress(overrides), ...getGraphUrl(overrides), ...getNftStorageToken(overrides), ...getWeb3StorageToken(overrides), ...getEasContractAddress(overrides), - } as HypercertClientConfig; + }; + + const missingKeys = []; for (const [key, value] of Object.entries(config)) { if (!value) { - logger.warn(`Cannot get chain config. ${key} is possibly undefined`); + missingKeys.push(key); } } + if (missingKeys.length > 0) logger.warn(`Missing properties in config: ${missingKeys.join(", ")}`); + return config; }; +const getDeployment = (chainId: SupportedChainIds) => { + return deployments[chainId]; +}; + const getChainConfig = (overrides: Partial) => { - const chainId = - overrides?.chainId ?? (process.env.DEFAULT_CHAIN_ID ? parseInt(process.env.DEFAULT_CHAIN_ID) : DEFAULT_CHAIN_ID); - let chainName: string; - - switch (chainId) { - case 5: - chainName = "goerli"; - break; - case 10: - chainName = "optimism-mainnet"; - break; - case 42220: - chainName = "celo"; - break; - case 11155111: - chainName = "sepolia"; - break; - default: - chainName = overrides?.chainName ?? ""; - if (!chainName) { - throw new UnsupportedChainError(`chainId=${chainId} is not yet supported`, { - chainID: chainId?.toString() || "undefined", - }); - } + const chainId = overrides?.chain?.id ? overrides.chain?.id : undefined; + + if (!chainId) { + throw new ConfigurationError("No chainId specified in config or environment variables"); + } + + const chain = getDefaultChain(chainId); + + if (!chain) { + throw new UnsupportedChainError(`No default config for chainId=${chainId} found in SDK`, { + chainID: chainId?.toString(), + }); } - return { chainId, chainName }; + return chain; }; const getContractAddress = (overrides: Partial) => { @@ -112,11 +131,6 @@ const getContractAddress = (overrides: Partial) => { } return { contractAddress: overrides.contractAddress }; } - const contractAddress = process.env.CONTRACT_ADDRESS; - if (contractAddress && !isAddress(contractAddress)) { - throw new InvalidOrMissingError("Invalid contract address.", { contractAddress }); - } - return contractAddress ? { contractAddress } : undefined; }; const getGraphUrl = (overrides: Partial) => { @@ -134,12 +148,12 @@ const getGraphUrl = (overrides: Partial) => { return { graphUrl }; } - const { chainId } = getChainConfig(overrides); + const chain = getChainConfig(overrides); - graphUrl = DEPLOYMENTS[chainId as keyof typeof DEPLOYMENTS].graphUrl ?? process.env.GRAPH_URL; + graphUrl = DEPLOYMENTS[chain?.id as keyof typeof DEPLOYMENTS].graphUrl ?? process.env.GRAPH_URL; if (!graphUrl) { - throw new UnsupportedChainError(`chainId=${chainId} is not yet supported`, { - chainID: chainId?.toString() || "undefined", + throw new UnsupportedChainError(`No Graph URL found in deployments or env vars`, { + chainID: chain?.toString(), }); } try { @@ -151,77 +165,56 @@ const getGraphUrl = (overrides: Partial) => { return { graphUrl }; }; -const getOperator = (overrides: Partial) => { - let operator: ethers.Signer | ethers.providers.Provider; +const getWalletClient = (overrides: Partial) => { + const walletClient = overrides.walletClient; - if ( - overrides.operator && - !ethers.providers.Provider.isProvider(overrides.operator) && - !ethers.Signer.isSigner(overrides.operator) - ) { - throw new InvalidOrMissingError("Invalid operator.", { operator: overrides.operator }); + if (!walletClient) { + logger.warn("No wallet client found", "getWalletClient", walletClient); } - if (ethers.Signer.isSigner(overrides.operator)) { - operator = overrides.operator; - } else if (ethers.providers.Provider.isProvider(overrides.operator)) { - operator = overrides.operator; - operator.on("network", (newNetwork, oldNetwork) => { - // When a Provider makes its initial connection, it emits a "network" - // event with a null oldNetwork along with the newNetwork. So, if the - // oldNetwork exists, it represents a changing network - - if (typeof window === "undefined") return; - if (oldNetwork && window.location) { - window.location.reload(); - } - }); - } else if (process.env.PRIVATE_KEY) { - const provider = ethers.getDefaultProvider(DEFAULT_CHAIN_ID); - operator = new ethers.Wallet(process.env.PRIVATE_KEY, provider); - } else { - operator = ethers.getDefaultProvider(DEFAULT_CHAIN_ID); + return { walletClient }; +}; + +const getPublicClient = (overrides: Partial) => { + const chain = getChainConfig(overrides); + let publicClient; + + publicClient = createPublicClient({ + chain: chain, + transport: http(), + }); + + if (overrides.publicClient) { + publicClient = overrides.publicClient; } - return { operator }; + return { publicClient }; }; -const getNftStorageToken = (overrides: Partial) => { +export const getNftStorageToken = (overrides: Partial) => { if (overrides.nftStorageToken) { return { nftStorageToken: overrides.nftStorageToken }; } - - if (process.env.NFT_STORAGE_TOKEN) { - return { nftStorageToken: process.env.NFT_STORAGE_TOKEN }; - } - - if (process.env.NEXT_PUBLIC_NFT_STORAGE_TOKEN) { - return { nftStorageToken: process.env.NEXT_PUBLIC_NFT_STORAGE_TOKEN }; - } - - return {}; }; -const getWeb3StorageToken = (overrides: Partial) => { +export const getWeb3StorageToken = (overrides: Partial) => { if (overrides.web3StorageToken) { return { web3StorageToken: overrides.web3StorageToken }; } - - if (process.env.WEB3_STORAGE_TOKEN) { - return { web3StorageToken: process.env.WEB3_STORAGE_TOKEN }; - } - - if (process.env.NEXT_PUBLIC_WEB3_STORAGE_TOKEN) { - return { web3StorageToken: process.env.NEXT_PUBLIC_WEB3_STORAGE_TOKEN }; - } - - return {}; }; const getEasContractAddress = (overrides: Partial) => { - if (overrides.easContractAddress) { - return { easContractAddress: overrides.easContractAddress }; - } + return { easContractAddress: overrides.easContractAddress }; +}; - return { easContractAddress: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e" }; +const getDefaultChain = (chainId: number) => { + const _chains = [sepolia, goerli, optimism, celo]; + + for (const chain of Object.values(_chains)) { + if ("id" in chain) { + if (chain.id === chainId) { + return chain as Chain; + } + } + } }; diff --git a/sdk/src/utils/errors.ts b/sdk/src/utils/errors.ts index 2b44580d..31df99da 100644 --- a/sdk/src/utils/errors.ts +++ b/sdk/src/utils/errors.ts @@ -1,5 +1,6 @@ import { ClientError, + ContractError, FetchError, HypercertsSdkError, InvalidOrMissingError, @@ -8,14 +9,17 @@ import { StorageError, UnknownSchemaError, UnsupportedChainError, -} from "../types/errors.js"; +} from "../types/errors"; + +import { BaseError, ContractFunctionRevertedError, Hex, decodeErrorResult } from "viem"; +import { HypercertMinterAbi } from "@hypercerts-org/contracts"; /** * * Method to catch errors and log them * @param err Error to handle defined in HypercertsSdkError */ -const handleError = (err: HypercertsSdkError) => { +const handleSdkError = (err: HypercertsSdkError) => { switch (err.constructor) { case ClientError: case FetchError: @@ -32,4 +36,41 @@ const handleError = (err: HypercertsSdkError) => { } }; -export { handleError }; +const handleContractError = (data: Hex) => { + try { + const value = decodeErrorResult({ + abi: HypercertMinterAbi, + data, + }); + + return new ContractError(value.errorName, { + data, + args: value.args, + }); + } catch (err) { + return new ContractError(undefined, { + data, + }); + } +}; + +const handleSimulatedContractError = (err: unknown) => { + if (err instanceof BaseError) { + const revertError = err.walk((err) => err instanceof ContractFunctionRevertedError); + if (revertError instanceof ContractFunctionRevertedError) { + const errorName = revertError.data?.errorName; + + return new ContractError(errorName, { + data: revertError.signature ?? err, + args: revertError.data?.args, + error: revertError, + }); + } else { + return new ContractError(undefined, { data: err }); + } + } + + return err; +}; + +export { handleSdkError, handleContractError, handleSimulatedContractError }; diff --git a/sdk/src/utils/fetchers.ts b/sdk/src/utils/fetchers.ts new file mode 100644 index 00000000..6b0144a6 --- /dev/null +++ b/sdk/src/utils/fetchers.ts @@ -0,0 +1,47 @@ +import { StorageError } from "../types/errors"; +import { logger } from "./logger"; +import axios from "axios"; + +/** + * Fetches data from IPFS using either the NFT Storage gateway or the Web3 Storage gateway. + * + * This function attempts to fetch data from the NFT Storage gateway first. If the request times out, it then tries to fetch the data from the Web3 Storage gateway. + * If the data cannot be fetched from either gateway, it throws a `StorageError`. + * + * @param {string} cidOrIpfsUri - The CID or IPFS URI of the data to fetch. + * @param {number} [timeout=10000] - The timeout for the fetch request in milliseconds. Defaults to 10000ms. + * @returns {Promise} The data fetched from IPFS. + * @throws {StorageError} Will throw a `StoragjeError` if the data cannot be fetched from either gateway. + * @async + */ +const getFromIPFS = async (cidOrIpfsUri: string, timeout: number = 10000): Promise => { + const nftStorageGatewayLink = getNftStorageGatewayUri(cidOrIpfsUri); + const web3StorageGatewayLink = getWeb3StorageGatewayUri(cidOrIpfsUri); + logger.debug(`Getting metadata ${cidOrIpfsUri} at ${nftStorageGatewayLink}`); + + const res = await axios.get(nftStorageGatewayLink, { timeout }).catch(() => { + logger.debug(`${nftStorageGatewayLink} timed out.`); + logger.debug(`Getting metadata ${cidOrIpfsUri} at ${web3StorageGatewayLink}`); + return axios.get(web3StorageGatewayLink, { timeout }); + }); + + if (!res || !res.data) { + throw new StorageError(`Failed to get ${cidOrIpfsUri}`); + } + + return res.data; +}; + +const getCid = (cidOrIpfsUri: string) => cidOrIpfsUri.replace("ipfs://", ""); + +const getNftStorageGatewayUri = (cidOrIpfsUri: string) => { + const NFT_STORAGE_IPFS_GATEWAY = "https://nftstorage.link/ipfs/{cid}"; + return NFT_STORAGE_IPFS_GATEWAY.replace("{cid}", getCid(cidOrIpfsUri)); +}; + +const getWeb3StorageGatewayUri = (cidOrIpfsUri: string) => { + const WEB3_STORAGE_IPFS_GATEWAY = "https://w3s.link/ipfs/{cid}"; + return WEB3_STORAGE_IPFS_GATEWAY.replace("{cid}", getCid(cidOrIpfsUri)); +}; + +export { getFromIPFS }; diff --git a/sdk/src/utils/formatter.ts b/sdk/src/utils/formatter.ts index d966b6b4..fa413cd9 100644 --- a/sdk/src/utils/formatter.ts +++ b/sdk/src/utils/formatter.ts @@ -1,5 +1,5 @@ -import { HypercertClaimdata, HypercertMetadata } from "../types/index.js"; -import { validateClaimData, validateMetaData } from "../validator/index.js"; +import { HypercertClaimdata, HypercertMetadata } from "../types"; +import { validateClaimData, validateMetaData } from "../validator"; export const INDEFINITE_DATE_STRING = "indefinite"; const formatUnixTime = (seconds: number) => { diff --git a/sdk/src/utils/index.ts b/sdk/src/utils/index.ts new file mode 100644 index 00000000..53113f75 --- /dev/null +++ b/sdk/src/utils/index.ts @@ -0,0 +1,18 @@ +import { walletClientToSigner, publicClientToProvider } from "./adapters"; + +import { getProofsFromAllowlist } from "./allowlist"; +import { getFromIPFS } from "./fetchers"; +import { formatHypercertData } from "./formatter"; +import { logger } from "./logger"; +import { handleSdkError, handleContractError } from "./errors"; + +export { + walletClientToSigner, + publicClientToProvider, + getProofsFromAllowlist, + logger, + getFromIPFS, + formatHypercertData, + handleSdkError, + handleContractError, +}; diff --git a/sdk/src/utils/logger.ts b/sdk/src/utils/logger.ts index e2615697..2e4680ff 100644 --- a/sdk/src/utils/logger.ts +++ b/sdk/src/utils/logger.ts @@ -49,4 +49,4 @@ const logger = { }, }; -export default logger; +export { logger }; diff --git a/sdk/src/utils/resolvers.ts b/sdk/src/utils/resolvers.ts index 566795d1..7e096e05 100644 --- a/sdk/src/utils/resolvers.ts +++ b/sdk/src/utils/resolvers.ts @@ -1,10 +1,12 @@ -import { Resolvers } from "../../.graphclient/index.js"; +import { Resolvers } from "../../.graphclient"; -export const resolvers: Resolvers = { +const resolvers: Resolvers = { Claim: { - chainName: (root, args, context) => context.chainName || "hypercerts-testnet", // The value we provide in the config + graphName: (root, args, context) => root.graphName || context.graphName || "hypercerts-testnet", // The value we provide in the config }, ClaimToken: { - chainName: (root, args, context) => context.chainName || "hypercerts-testnet", // The value we provide in the config + graphName: (root, args, context) => root.graphName || context.graphName || "hypercerts-testnet", // The value we provide in the config }, }; + +export { resolvers }; diff --git a/sdk/src/validator/index.ts b/sdk/src/validator/index.ts index b24244ce..dc592083 100644 --- a/sdk/src/validator/index.ts +++ b/sdk/src/validator/index.ts @@ -1,7 +1,5 @@ import { StandardMerkleTree } from "@openzeppelin/merkle-tree"; import Ajv from "ajv"; -import { BigNumber, BigNumberish } from "ethers"; -import { isAddress } from "ethers/lib/utils.js"; import claimDataSchema from "../resources/schema/claimdata.json"; import evaluationSchema from "../resources/schema/evaluation.json"; @@ -9,11 +7,13 @@ import metaDataSchema from "../resources/schema/metadata.json"; import { AllowlistEntry, DuplicateEvaluation, + EvaluationData, HypercertClaimdata, HypercertMetadata, MintingError, SimpleTextEvaluation, -} from "../types/index.js"; +} from "../types"; +import { isAddress } from "viem"; const ajv = new Ajv({ allErrors: true }); // options can be passed, e.g. {allErrors: true} ajv.addSchema(metaDataSchema, "metaData"); @@ -21,25 +21,33 @@ ajv.addSchema(claimDataSchema, "claimData"); ajv.addSchema(evaluationSchema, "evaluation.json"); /** - * The result of a validation. - * @property valid - Whether the data is valid. - * @property errors - A map of errors, where the key is the field that failed validation and the value is the error message. + * Represents the result of a validation operation. + * + * This type is used to return the result of validating data against a schema. It includes a `valid` flag that indicates + * whether the data is valid, and an `errors` object that contains any errors that occurred during validation. + * */ type ValidationResult = { + data: AllowlistEntry[] | EvaluationData | HypercertClaimdata | HypercertMetadata | unknown; valid: boolean; - errors: Record; + errors: Record; }; /** - * Validates the data for a simple text evaluation. - * @param data The data to validate. - * @returns A `ValidationResult` object indicating whether the data is valid and any errors that were found. + * Validates Hypercert metadata. + * + * This function uses the AJV library to validate the metadata. It first retrieves the schema for the metadata, + * then validates the data against the schema. If the schema is not found, it returns an error. If the data does not + * conform to the schema, it returns the validation errors. If the data is valid, it returns a success message. + * + * @param {unknown} data - The metadata to validate. This should be an object that conforms to the HypercertMetadata type. + * @returns {ValidationResult} An object that includes a validity flag and any errors that occurred during validation. */ -const validateMetaData = (data: HypercertMetadata): ValidationResult => { +const validateMetaData = (data: unknown): ValidationResult => { const schemaName = "metaData"; const validate = ajv.getSchema(schemaName); if (!validate) { - return { valid: false, errors: { schema: "Schema not found" } }; + return { data, valid: false, errors: { schema: "Schema not found" } }; } if (!validate(data)) { @@ -50,22 +58,27 @@ const validateMetaData = (data: HypercertMetadata): ValidationResult => { errors[key] = e.message; } } - return { valid: false, errors }; + return { data, valid: false, errors }; } - return { valid: true, errors: {} }; + return { data: data as HypercertMetadata, valid: true, errors: {} }; }; /** - * Validates the data for a simple text evaluation. - * @param data The data to validate. - * @returns A `ValidationResult` object indicating whether the data is valid and any errors that were found. + * Validates Hypercert claim data. + * + * This function uses the AJV library to validate the claim data. It first retrieves the schema for the claim data, + * then validates the data against the schema. If the schema is not found, it returns an error. If the data does not + * conform to the schema, it returns the validation errors. If the data is valid, it returns a success message. + * + * @param {unknown} data - The claim data to validate. This should be an object that conforms to the HypercertClaimdata type. + * @returns {ValidationResult} An object that includes a validity flag and any errors that occurred during validation. */ -const validateClaimData = (data: HypercertClaimdata): ValidationResult => { +const validateClaimData = (data: unknown): ValidationResult => { const schemaName = "claimData"; const validate = ajv.getSchema(schemaName); if (!validate) { - return { valid: false, errors: { schema: "Schema not found" } }; + return { data, valid: false, errors: { schema: "Schema not found" } }; } if (!validate(data)) { @@ -76,28 +89,32 @@ const validateClaimData = (data: HypercertClaimdata): ValidationResult => { errors[key] = e.message; } } - return { valid: false, errors }; + return { data, valid: false, errors }; } - return { valid: true, errors: {} }; + return { data: data as HypercertClaimdata, valid: true, errors: {} }; }; /** - * Validates the data for an allowlist. - * @param data The data to validate. - * @param units The total number of units in the allowlist. - * @returns A `ValidationResult` object indicating whether the data is valid and any errors that were found. + * Validates an array of allowlist entries. + * + * This function checks that the total units in the allowlist match the expected total units, that the total units are greater than 0, + * and that all addresses in the allowlist are valid Ethereum addresses. It returns an object that includes a validity flag and any errors that occurred during validation. + * + * @param {AllowlistEntry[]} data - The allowlist entries to validate. Each entry should be an object that includes an address and a number of units. + * @param {bigint} units - The expected total units in the allowlist. + * @returns {ValidationResult} An object that includes a validity flag and any errors that occurred during validation. The keys in the errors object are the names of the invalid properties, and the values are the error messages. */ -const validateAllowlist = (data: AllowlistEntry[], units: BigNumberish) => { +const validateAllowlist = (data: AllowlistEntry[], units: bigint): ValidationResult => { const errors: Record = {}; - const totalUnits = data.reduce((acc, curr) => acc.add(curr.units), BigNumber.from(0)); - if (!totalUnits.eq(units)) { + const totalUnits = data.reduce((acc, curr) => acc + BigInt(curr.units.toString()), 0n); + if (totalUnits != units) { errors[ "units" ] = `Total units in allowlist must match total units [expected: ${units}, got: ${totalUnits.toString()}]`; } - if (totalUnits.eq(0)) { + if (totalUnits == 0n) { errors["units"] = "Total units in allowlist must be greater than 0"; } @@ -106,18 +123,23 @@ const validateAllowlist = (data: AllowlistEntry[], units: BigNumberish) => { errors["address"] = filteredAddresses.map((entry) => entry.address); } - return { valid: Object.keys(errors).length === 0, errors }; + return { data, valid: Object.keys(errors).length === 0, errors }; }; /** - * Validates the data for a duplicate evaluation. - * @param data The data to validate. - * @returns A `ValidationResult` object indicating whether the data is valid and any errors that were found. + * Validates duplicate evaluation data. + * + * This function uses the AJV library to validate the duplicate evaluation data. It first retrieves the schema for the duplicate evaluation data, + * then validates the data against the schema. If the schema is not found, it returns an error. If the data does not + * conform to the schema, it returns the validation errors. If the data is valid, it returns a success message. + * + * @param {DuplicateEvaluation} data - The duplicate evaluation data to validate. This should be an object that conforms to the DuplicateEvaluation type. + * @returns {ValidationResult} An object that includes a validity flag and any errors that occurred during validation. */ const validateDuplicateEvaluationData = (data: DuplicateEvaluation): ValidationResult => { const validate = ajv.getSchema("evaluation.json#/definitions/DuplicateEvaluation"); if (!validate) { - return { valid: false, errors: { schema: "Schema not found" } }; + return { data, valid: false, errors: { schema: "Schema not found" } }; } if (!validate(data)) { @@ -128,21 +150,26 @@ const validateDuplicateEvaluationData = (data: DuplicateEvaluation): ValidationR errors[key] = e.message; } } - return { valid: false, errors }; + return { data, valid: false, errors }; } - return { valid: true, errors: {} }; + return { data, valid: true, errors: {} }; }; /** - * Validates the data for a simple text evaluation. - * @param data The data to validate. - * @returns A `ValidationResult` object indicating whether the data is valid and any errors that were found. + * Validates simple text evaluation data against a predefined schema. + * + * This function uses the AJV library to validate the simple text evaluation data. It first retrieves the schema for the simple text evaluation data, + * then validates the data against the schema. If the schema is not found, it returns an error. If the data does not + * conform to the schema, it returns the validation errors. If the data is valid, it returns a success message. + * + * @param {SimpleTextEvaluation} data - The simple text evaluation data to validate. This should be an object that conforms to the SimpleTextEvaluation type. + * @returns {ValidationResult} An object that includes a validity flag and any errors that occurred during validation. */ const validateSimpleTextEvaluationData = (data: SimpleTextEvaluation): ValidationResult => { const validate = ajv.getSchema("evaluation.json#/definitions/SimpleTextEvaluation"); if (!validate) { - return { valid: false, errors: { schema: "Schema not found" } }; + return { data, valid: false, errors: { schema: "Schema not found" } }; } if (!validate(data)) { @@ -153,21 +180,25 @@ const validateSimpleTextEvaluationData = (data: SimpleTextEvaluation): Validatio errors[key] = e.message; } } - return { valid: false, errors }; + return { data, valid: false, errors }; } - return { valid: true, errors: {} }; + return { data, valid: true, errors: {} }; }; /** - * Verifies a Merkle proof for a given address and units. - * @param root The Merkle root hash to verify against. - * @param signerAddress The address to verify. - * @param units The units to verify. - * @param proof The Merkle proof to verify. - * @throws {MintingError} If the Merkle proof verification fails. + * Verifies a Merkle proof for a given root, signer address, units, and proof. + * + * This function first checks if the signer address is a valid Ethereum address. If it's not, it throws a `MintingError`. + * It then verifies the Merkle proof using the `StandardMerkleTree.verify` method. If the verification fails, it throws a `MintingError`. + * + * @param {string} root - The root of the Merkle tree. + * @param {string} signerAddress - The signer's Ethereum address. + * @param {bigint} units - The number of units. + * @param {string[]} proof - The Merkle proof to verify. + * @throws {MintingError} Will throw a `MintingError` if the signer address is invalid or if the Merkle proof verification fails. */ -function verifyMerkleProof(root: string, signerAddress: string, units: BigNumberish, proof: string[]): void { +function verifyMerkleProof(root: string, signerAddress: string, units: bigint, proof: string[]): void { if (!isAddress(signerAddress)) { throw new MintingError("Invalid address", { signerAddress }); } @@ -179,15 +210,18 @@ function verifyMerkleProof(root: string, signerAddress: string, units: BigNumber } /** - * Batch verifies Merkle proofs for multiple roots, units and proofs for a single address - * @param roots The Merkle root hashes to verify against. - * @param signerAddress The address to verify. - * @param units The units to verify. - * @param proofs The Merkle proofs to verify. - * @throws {MintingError} If the Merkle proof verification fails. - * @notice Wrapper around `verifyMerkleProof` to batch verify multiple proofs + * Verifies multiple Merkle proofs for given roots, a signer address, units, and proofs. + * + * This function first checks if the lengths of the roots, units, and proofs arrays are equal. If they're not, it throws a `MintingError`. + * It then iterates over the arrays and verifies each Merkle proof using the `verifyMerkleProof` function. If any verification fails, it throws a `MintingError`. + * + * @param {string[]} roots - The roots of the Merkle trees. + * @param {string} signerAddress - The signer's Ethereum address. + * @param {bigint[]} units - The numbers of units. + * @param {string[][]} proofs - The Merkle proofs to verify. + * @throws {MintingError} Will throw a `MintingError` if the lengths of the input arrays are not equal or if any Merkle proof verification fails. */ -function verifyMerkleProofs(roots: string[], signerAddress: string, units: BigNumberish[], proofs: string[][]) { +function verifyMerkleProofs(roots: string[], signerAddress: string, units: bigint[], proofs: string[][]) { if (roots.length !== units.length || units.length !== proofs.length) { throw new MintingError("Invalid input", { roots, units, proofs }); } diff --git a/sdk/test/client.test.ts b/sdk/test/client.test.ts index 8540404b..260791f6 100644 --- a/sdk/test/client.test.ts +++ b/sdk/test/client.test.ts @@ -1,13 +1,11 @@ +import { describe, it, afterAll } from "vitest"; + import { expect } from "chai"; -import { MockProvider } from "ethereum-waffle"; -import { ethers } from "ethers"; import sinon from "sinon"; -import { HypercertClient, HypercertMetadata, TransferRestrictions } from "../src/index.js"; -import { AllowlistEntry, ClientError, UnsupportedChainError } from "../src/types/index.js"; - -const provider = new MockProvider(); -sinon.stub(provider, "on"); +import { HypercertClient, HypercertMetadata, TransferRestrictions } from "../src"; +import { AllowlistEntry, ClientError, UnsupportedChainError } from "../src/types"; +import { publicClient, walletClient } from "./helpers"; describe("HypercertClient setup tests", () => { afterAll(() => { @@ -15,51 +13,50 @@ describe("HypercertClient setup tests", () => { }); it("should be able to create a new read only instance when missing storage keys", () => { - sinon.stub(process, "env").value({ NFT_STORAGE_TOKEN: null }); - sinon.stub(process, "env").value({ WEB3_STORAGE_TOKEN: null }); - sinon.stub(process, "env").value({ NEXT_PUBLIC_NFT_STORAGE_TOKEN: null }); - sinon.stub(process, "env").value({ NEXT_PUBLIC_WEB3_STORAGE_TOKEN: null }); + const readOnlyClient = new HypercertClient({ + chain: { id: 5 }, + publicClient, + }); - const client = new HypercertClient({ operator: provider }); - - expect(client).to.be.an.instanceOf(HypercertClient); - expect(client.readonly).to.be.true; + expect(readOnlyClient).to.be.an.instanceOf(HypercertClient); + expect(readOnlyClient.readonly).to.be.true; }); it("should be able to create a new instance", () => { - const operator = ethers.Wallet.createRandom(); - - const config = { chainId: 5, operator, nftStorageToken: "test", web3StorageToken: "test" }; - const client = new HypercertClient(config); + const client = new HypercertClient({ + chain: { id: 5 }, + publicClient, + walletClient, + nftStorageToken: "test", + web3StorageToken: "test", + }); expect(client).to.be.an.instanceOf(HypercertClient); + + //TODO currently only publicClient added as a test, also add other flows expect(client.readonly).to.be.false; }); it("should throw an error when the chainId is not supported", () => { + const falseChainId = 1337; try { - new HypercertClient({ operator: provider, chainId: 1337 }); + new HypercertClient({ chain: { id: falseChainId } }); expect.fail("Should throw UnsupportedChainError"); } catch (e) { expect(e).to.be.instanceOf(UnsupportedChainError); const error = e as UnsupportedChainError; - expect(error.message).to.eq("chainId=1337 is not yet supported"); - expect(Number(error.payload?.chainID)).to.eq(1337); + expect(error.message).to.eq("No default config for chainId=1337 found in SDK"); + expect(Number(error.payload?.chainID)).to.eq(falseChainId); } }); it("should throw an error when executing write method in readonly mode", async () => { - sinon.stub(process, "env").value({ NFT_STORAGE_TOKEN: null }); - sinon.stub(process, "env").value({ WEB3_STORAGE_TOKEN: null }); - sinon.stub(process, "env").value({ NEXT_PUBLIC_NFT_STORAGE_TOKEN: null }); - sinon.stub(process, "env").value({ NEXT_PUBLIC_WEB3_STORAGE_TOKEN: null }); - - const client = new HypercertClient({ operator: provider }); + const client = new HypercertClient({ chain: { id: 5 } }); // mintClaim try { const metaData = { name: "test" } as HypercertMetadata; - const totalUnits = 1; + const totalUnits = 1n; const transferRestrictions = TransferRestrictions.AllowAll; await client.mintClaim(metaData, totalUnits, transferRestrictions); @@ -68,15 +65,15 @@ describe("HypercertClient setup tests", () => { expect(e).to.be.instanceOf(ClientError); const error = e as ClientError; - expect(error.message).to.eq("Client is readonly"); + expect(error.message).to.eq("Could not connect to wallet; sending transactions not allowed."); expect(error.payload?.client instanceof HypercertClient).to.be.true; } // createAllowlist try { - const allowlist: AllowlistEntry[] = [{ address: "0x0000000", units: 100 }]; + const allowlist: AllowlistEntry[] = [{ address: "0x0000000", units: 100n }]; const metaData = { name: "test" } as HypercertMetadata; - const totalUnits = 1; + const totalUnits = 1n; const transferRestrictions = TransferRestrictions.AllowAll; await client.createAllowlist(allowlist, metaData, totalUnits, transferRestrictions); @@ -85,42 +82,42 @@ describe("HypercertClient setup tests", () => { expect(e).to.be.instanceOf(ClientError); const error = e as ClientError; - expect(error.message).to.eq("Client is readonly"); + expect(error.message).to.eq("Could not connect to wallet; sending transactions not allowed."); expect(error.payload?.client).to.be.instanceOf(HypercertClient); } // splitClaimUnits try { - const claimId = 1; - const fractions = [100, 200]; + const claimId = 1n; + const fractions = [100n, 200n]; - await client.splitClaimUnits(claimId, fractions); + await client.splitFractionUnits(claimId, fractions); expect.fail("Should throw ClientError"); } catch (e) { expect(e).to.be.instanceOf(ClientError); const error = e as ClientError; - expect(error.message).to.eq("Client is readonly"); + expect(error.message).to.eq("Could not connect to wallet; sending transactions not allowed."); expect(error.payload?.client).to.be.instanceOf(HypercertClient); } // mergeClaimUnits try { - const claimIds = [1, 2]; + const claimIds = [1n, 2n]; - await client.mergeClaimUnits(claimIds); + await client.mergeFractionUnits(claimIds); expect.fail("Should throw ClientError"); } catch (e) { expect(e).to.be.instanceOf(ClientError); const error = e as ClientError; - expect(error.message).to.eq("Client is readonly"); + expect(error.message).to.eq("Could not connect to wallet; sending transactions not allowed."); expect(error.payload?.client).to.be.instanceOf(HypercertClient); } // burnClaimFraction try { - const claimId = 1; + const claimId = 1n; await client.burnClaimFraction(claimId); expect.fail("Should throw ClientError"); @@ -128,16 +125,16 @@ describe("HypercertClient setup tests", () => { expect(e).to.be.instanceOf(ClientError); const error = e as ClientError; - expect(error.message).to.eq("Client is readonly"); + expect(error.message).to.eq("Could not connect to wallet; sending transactions not allowed."); expect(error.payload?.client).to.be.instanceOf(HypercertClient); } // mintClaimFractionFromAllowlist try { - const claimId = 1; - const units = 100; - const proof = ["0x1", "0x2", "0x3"]; - const root = "0x4"; + const claimId = 1n; + const units = 100n; + const proof = ["0x1", "0x2", "0x3"] as `0x${string}`[]; + const root = "0x4" as `0x${string}`; await client.mintClaimFractionFromAllowlist(claimId, units, proof, root); expect.fail("Should throw ClientError"); @@ -145,19 +142,16 @@ describe("HypercertClient setup tests", () => { expect(e).to.be.instanceOf(ClientError); const error = e as ClientError; - expect(error.message).to.eq("Client is readonly"); + expect(error.message).to.eq("Could not connect to wallet; sending transactions not allowed."); expect(error.payload?.client).to.be.instanceOf(HypercertClient); } // batchMintClaimFractionsFromAllowlist try { - const claimIds = [1, 2]; - const units = [100, 200]; - const proofs = [ - ["0x1", "0x2", "0x3"], - ["0x4", "0x5", "0x6"], - ]; - const roots = ["0x7", "0x8"]; + const claimIds = [1n, 2n]; + const units = [100n, 200n]; + const proofs = [["0x1", "0x2", "0x3"] as `0x${string}`[], ["0x4", "0x5", "0x6"] as `0x${string}`[]]; + const roots = ["0x7", "0x8"] as `0x${string}`[]; await client.batchMintClaimFractionsFromAllowlists(claimIds, units, proofs, roots); expect.fail("Should throw ClientError"); @@ -165,7 +159,7 @@ describe("HypercertClient setup tests", () => { expect(e).to.be.instanceOf(ClientError); const error = e as ClientError; - expect(error.message).to.eq("Client is readonly"); + expect(error.message).to.eq("Could not connect to wallet; sending transactions not allowed."); expect(error.payload?.client).to.be.instanceOf(HypercertClient); } }); diff --git a/sdk/test/client/allowlist.minting.test.ts b/sdk/test/client/allowlist.minting.test.ts index b2b9eb3c..c9cbce48 100644 --- a/sdk/test/client/allowlist.minting.test.ts +++ b/sdk/test/client/allowlist.minting.test.ts @@ -1,59 +1,63 @@ -import { MockContract, MockProvider, deployMockContract } from "ethereum-waffle"; -import { BigNumber, ethers } from "ethers"; +import { describe, it, beforeEach, afterAll } from "vitest"; +import chai, { expect } from "chai"; +import assertionsCount from "chai-assertions-count"; + import sinon from "sinon"; -import { expect } from "@jest/globals"; -import { HypercertClient } from "../../src/index.js"; -import HypercertsStorage from "../../src/storage.js"; -import { MalformedDataError, MintingError, TransferRestrictions } from "../../src/types/index.js"; -import { getAllowlist, getFormattedMetadata } from "../helpers.js"; -import { HypercertMinter, HypercertMinterAbi } from "@hypercerts-org/contracts"; -const mockCorrectMetadataCid = "testCID1234fkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u"; +import { HypercertClient, HypercertsStorage } from "../../src"; +import { MalformedDataError, MintingError, TransferRestrictions } from "../../src/types"; +import { getAllowlist, getFormattedMetadata, publicClient, walletClient, mockDataSets } from "../helpers"; +import { HypercertMinterAbi } from "@hypercerts-org/contracts"; +import { encodeFunctionResult, isHex, stringToHex } from "viem"; + +chai.use(assertionsCount); describe("Allows for minting claims from an allowlist", () => { - const metaDataStub = sinon.stub(HypercertsStorage.prototype, "storeMetadata").resolves(mockCorrectMetadataCid); - const dataStub = sinon.stub(HypercertsStorage.prototype, "storeData").resolves(mockCorrectMetadataCid); + const { hypercertData, hypercertMetadata } = mockDataSets; + const metaDataStub = sinon.stub(HypercertsStorage.prototype, "storeMetadata").resolves(hypercertMetadata.cid); + const dataStub = sinon.stub(HypercertsStorage.prototype, "storeData").resolves(hypercertData.cid); + const wallet = walletClient; + const userAddress = wallet.account?.address; + const client = new HypercertClient({ + chain: { id: 5 }, + walletClient, + publicClient, + nftStorageToken: "test", + web3StorageToken: "test", + }); - const setUp = async () => { - const provider = new MockProvider(); - const [user, other, admin] = provider.getWallets(); - const stub = sinon.stub(provider, "on"); + const readSpy = sinon.stub(publicClient, "readContract"); + let writeSpy = sinon.stub(walletClient, "writeContract"); - const minter = await deployMockContract(user, HypercertMinterAbi); + const mintClaimFromAllowlistResult = encodeFunctionResult({ + abi: HypercertMinterAbi, + functionName: "mintClaimFromAllowlist", + result: [], + }); - const client = new HypercertClient({ - chainId: 5, - operator: user, - }); + const batchMintClaimFromAllowlistResult = encodeFunctionResult({ + abi: HypercertMinterAbi, + functionName: "batchMintClaimsFromAllowlists", + result: [], + }); - sinon.replaceGetter(client, "contract", () => minter as unknown as HypercertMinter); - - return { - client, - provider, - users: { user, other, admin }, - minter, - stub, - }; - }; - - let _client: HypercertClient; - let _provider: MockProvider; - let _users: { user: ethers.Wallet; other: ethers.Wallet; admin: ethers.Wallet }; - let _minter: MockContract; - let _stub: sinon.SinonStub; - - beforeAll(async () => { - const { client, provider, users, minter, stub } = await setUp(); - _client = client; - _provider = provider; - _users = users; - _minter = minter; - _stub = stub; + const mintClaimResult = encodeFunctionResult({ + abi: HypercertMinterAbi, + functionName: "createAllowlist", + result: [], }); - beforeEach(() => { - _provider.clearCallHistory(); + beforeEach(async () => { + chai.Assertion.resetAssertsCheck(); + + readSpy.resetBehavior(); + readSpy.resetHistory(); + + writeSpy.resetBehavior(); + writeSpy.resetHistory(); + + metaDataStub.resetHistory(); + dataStub.resetHistory(); }); afterAll(() => { @@ -65,120 +69,151 @@ describe("Allows for minting claims from an allowlist", () => { const { allowlist, totalUnits } = getAllowlist(); const metaData = getFormattedMetadata(); - await _minter.mock.createAllowlist.returns(); - const res = await _client.createAllowlist(allowlist, metaData, totalUnits, TransferRestrictions.FromCreatorOnly); + writeSpy = writeSpy.resolves(mintClaimResult); - sinon.assert.calledOnce(metaDataStub); - sinon.assert.calledOnce(dataStub); + const hash = await client.createAllowlist(allowlist, metaData, totalUnits, TransferRestrictions.FromCreatorOnly); - expect(res.chainId).toBe(1337); - expect(_provider.callHistory.length).toBe(2); + expect(isHex(hash)).to.be.true; + expect(metaDataStub.callCount).to.eq(1); + expect(dataStub.callCount).to.eq(1); + expect(readSpy.callCount).to.eq(0); + expect(writeSpy.callCount).to.eq(1); }); it("should not create an allowlist if the total units mismatch", async () => { + chai.Assertion.expectAssertions(8); const { allowlist, totalUnits } = getAllowlist(); const metaData = getFormattedMetadata(); + let hash; try { - await _client.createAllowlist(allowlist, metaData, totalUnits.add(1), TransferRestrictions.FromCreatorOnly); + hash = await client.createAllowlist(allowlist, metaData, totalUnits + 1n, TransferRestrictions.FromCreatorOnly); } catch (e) { - expect(e instanceof MalformedDataError).toBeTruthy(); + expect(e).to.be.instanceOf(MalformedDataError); const error = e as MalformedDataError; - expect(error.message).toBe("Allowlist validation failed"); - expect(error.payload).toEqual({ + expect(error.message).to.be.eq("Allowlist validation failed"); + expect(error.payload).to.deep.eq({ units: "Total units in allowlist must match total units [expected: 11, got: 10]", }); } - expect(_provider.callHistory.length).toBe(0); - expect.assertions(4); + expect(hash).to.be.undefined; + expect(metaDataStub.callCount).to.eq(0); + expect(dataStub.callCount).to.eq(0); + expect(readSpy.callCount).to.eq(0); + expect(writeSpy.callCount).to.eq(0); }); it("should not create an allowlist if the allowlist is empty", async () => { - const { allowlist, totalUnits } = getAllowlist({ size: 1 }); + chai.Assertion.expectAssertions(8); + const { allowlist, totalUnits } = getAllowlist(); const metaData = getFormattedMetadata(); - allowlist[0].units = BigNumber.from(0); + let hash; + + allowlist[0].units = 0n; try { - await _client.createAllowlist(allowlist, metaData, totalUnits, TransferRestrictions.FromCreatorOnly); + hash = await client.createAllowlist(allowlist, metaData, totalUnits, TransferRestrictions.FromCreatorOnly); } catch (e) { - expect(e instanceof MalformedDataError).toBeTruthy(); + expect(e).to.be.instanceOf(MalformedDataError); const error = e as MalformedDataError; - expect(error.message).toBe("Allowlist validation failed"); - expect(error.payload).toEqual({ units: "Total units in allowlist must be greater than 0" }); + expect(error.message).to.be.eq("Allowlist validation failed"); + expect(error.payload).to.deep.eq({ + units: "Total units in allowlist must match total units [expected: 10, got: 9]", + }); } - expect(_provider.callHistory.length).toBe(0); - expect.assertions(4); + expect(hash).to.be.undefined; + expect(metaDataStub.callCount).to.eq(0); + expect(dataStub.callCount).to.eq(0); + expect(readSpy.callCount).to.eq(0); + expect(writeSpy.callCount).to.eq(0); }); }); describe("Mint single fraction", () => { it("should allow to mint a claim from an allowlist without the root", async () => { + chai.Assertion.expectAssertions(5); const { allowlist, merkleTree } = getAllowlist({ size: 1 }); - await _minter.mock.mintClaimFromAllowlist.returns(); + writeSpy = writeSpy.resolves(mintClaimFromAllowlistResult); - await _client.mintClaimFractionFromAllowlist( - 1, + const hash = await client.mintClaimFractionFromAllowlist( + 1n, allowlist[0].units, - merkleTree.getProof([allowlist[0].address, allowlist[0].units.toString()]), + merkleTree.getProof([allowlist[0].address, allowlist[0].units.toString()]) as `0x${string}`[], ); - expect(_provider.callHistory.length).toBe(2); + expect(isHex(hash)).to.be.true; + expect(metaDataStub.callCount).to.eq(0); + expect(dataStub.callCount).to.eq(0); + expect(readSpy.callCount).to.eq(0); + expect(writeSpy.callCount).to.eq(1); }); it("should allow to mint a claim from an allowlist with a correct root", async () => { - const { allowlist, merkleTree } = getAllowlist({ size: 1, address: _users.user.address as `0x${string}` }); + chai.Assertion.expectAssertions(5); + const { allowlist, merkleTree } = getAllowlist({ size: 1, address: userAddress }); - await _minter.mock.mintClaimFromAllowlist.returns(); + writeSpy = writeSpy.resolves(mintClaimFromAllowlistResult); - await _client.mintClaimFractionFromAllowlist( - 1, + const hash = await client.mintClaimFractionFromAllowlist( + 1n, allowlist[0].units, - merkleTree.getProof([allowlist[0].address, allowlist[0].units.toString()]), - merkleTree.root, + merkleTree.getProof([allowlist[0].address, allowlist[0].units.toString()]) as `0x${string}`[], + merkleTree.root as `0x${string}`, ); - expect(_provider.callHistory.length).toBe(2); + expect(isHex(hash)).to.be.true; + expect(metaDataStub.callCount).to.eq(0); + expect(dataStub.callCount).to.eq(0); + expect(readSpy.callCount).to.eq(0); + expect(writeSpy.callCount).to.eq(1); }); it("should not allow to mint a claim from an allowlist with an incorrect root", async () => { - const { allowlist, merkleTree } = getAllowlist({ size: 1, address: _users.user.address as `0x${string}` }); + chai.Assertion.expectAssertions(8); + const { allowlist, merkleTree } = getAllowlist({ size: 1, address: userAddress }); + + const mockRoot = stringToHex("MOCK_ROOT", { size: 32 }); - const mockRoot = ethers.utils.formatBytes32String("MOCK_ROOT"); + let hash; try { - await _client.mintClaimFractionFromAllowlist( - 1, + hash = await client.mintClaimFractionFromAllowlist( + 1n, allowlist[0].units, - merkleTree.getProof([allowlist[0].address, allowlist[0].units.toString()]), + merkleTree.getProof([allowlist[0].address, allowlist[0].units.toString()]) as `0x${string}`[], mockRoot, ); } catch (e) { - expect(e instanceof MintingError).toBeTruthy(); + expect(e instanceof MintingError).to.be.true; const error = e as MintingError; - expect(error.message).toBe("Merkle proof verification failed"); - expect(error.payload).toEqual({ + expect(error.message).to.eq("Merkle proof verification failed"); + expect(error.payload).to.deep.eq({ root: mockRoot, proof: merkleTree.getProof([allowlist[0].address, allowlist[0].units.toString()]), }); } - expect(_provider.callHistory.length).toBe(0); - expect.assertions(4); + expect(hash).to.be.undefined; + expect(metaDataStub.callCount).to.eq(0); + expect(dataStub.callCount).to.eq(0); + expect(readSpy.callCount).to.eq(0); + expect(writeSpy.callCount).to.eq(0); }); }); describe("Batch mint fractions", () => { it("should allow to batch mint a claim from an allowlist without the root", async () => { + chai.Assertion.expectAssertions(5); const firstList = getAllowlist({ size: 1 }); - const secondList = getAllowlist({ size: 1, units: 42 }); + const secondList = getAllowlist({ size: 1, units: 42n }); - await _minter.mock.batchMintClaimsFromAllowlists.returns(); + writeSpy = writeSpy.resolves(batchMintClaimFromAllowlistResult); const firstProofs = firstList.merkleTree.getProof([ firstList.allowlist[0].address, @@ -188,20 +223,25 @@ describe("Allows for minting claims from an allowlist", () => { secondList.allowlist[0].address, secondList.allowlist[0].units.toString(), ]); - await _client.batchMintClaimFractionsFromAllowlists( - [1, 2], + const hash = await client.batchMintClaimFractionsFromAllowlists( + [1n, 2n], [firstList.allowlist[0].units, secondList.allowlist[0].units], - [firstProofs, secondProofs], + [firstProofs, secondProofs] as `0x${string}`[][], ); - expect(_provider.callHistory.length).toBe(2); + expect(isHex(hash)).to.be.true; + expect(metaDataStub.callCount).to.eq(0); + expect(dataStub.callCount).to.eq(0); + expect(readSpy.callCount).to.eq(0); + expect(writeSpy.callCount).to.eq(1); }); it("should allow to mint a claim from an allowlist with a correct root", async () => { - const firstList = getAllowlist({ size: 1, address: _users.user.address as `0x${string}` }); - const secondList = getAllowlist({ size: 1, units: 42, address: _users.user.address as `0x${string}` }); + chai.Assertion.expectAssertions(5); + const firstList = getAllowlist({ size: 1, address: userAddress }); + const secondList = getAllowlist({ size: 1, units: 42n, address: userAddress }); - await _minter.mock.batchMintClaimsFromAllowlists.returns(); + writeSpy = writeSpy.resolves(batchMintClaimFromAllowlistResult); const firstProofs = firstList.merkleTree.getProof([ firstList.allowlist[0].address, @@ -211,21 +251,26 @@ describe("Allows for minting claims from an allowlist", () => { secondList.allowlist[0].address, secondList.allowlist[0].units.toString(), ]); - await _client.batchMintClaimFractionsFromAllowlists( - [1, 2], + const hash = await client.batchMintClaimFractionsFromAllowlists( + [1n, 2n], [firstList.allowlist[0].units, secondList.allowlist[0].units], - [firstProofs, secondProofs], - [firstList.merkleTree.root, secondList.merkleTree.root], + [firstProofs, secondProofs] as `0x${string}`[][], + [firstList.merkleTree.root, secondList.merkleTree.root] as `0x${string}`[], ); - expect(_provider.callHistory.length).toBe(2); + expect(isHex(hash)).to.be.true; + expect(metaDataStub.callCount).to.eq(0); + expect(dataStub.callCount).to.eq(0); + expect(readSpy.callCount).to.eq(0); + expect(writeSpy.callCount).to.eq(1); }); it("should not allow to mint a claim from an allowlist with an incorrect root", async () => { - const firstList = getAllowlist({ size: 1, address: _users.user.address as `0x${string}` }); - const secondList = getAllowlist({ size: 1, units: 42, address: _users.user.address as `0x${string}` }); + chai.Assertion.expectAssertions(8); + const firstList = getAllowlist({ size: 1, address: userAddress }); + const secondList = getAllowlist({ size: 1, units: 42n, address: userAddress }); - await _minter.mock.batchMintClaimsFromAllowlists.returns(); + writeSpy = writeSpy.resolves(batchMintClaimFromAllowlistResult); const firstProofs = firstList.merkleTree.getProof([ firstList.allowlist[0].address, @@ -236,27 +281,31 @@ describe("Allows for minting claims from an allowlist", () => { secondList.allowlist[0].units.toString(), ]); - const mockRoot = ethers.utils.formatBytes32String("MOCK_ROOT"); + const mockRoot = stringToHex("MOCK_ROOT", { size: 32 }); + let hash; try { - await _client.batchMintClaimFractionsFromAllowlists( - [1, 2], + hash = await client.batchMintClaimFractionsFromAllowlists( + [1n, 2n], [firstList.allowlist[0].units, secondList.allowlist[0].units], - [firstProofs, secondProofs], - [firstList.merkleTree.root, mockRoot], + [firstProofs, secondProofs] as `0x${string}`[][], + [firstList.merkleTree.root as `0x${string}`, mockRoot], ); } catch (e) { - expect(e instanceof MintingError).toBeTruthy(); + expect(e instanceof MintingError).to.be.true; const error = e as MintingError; - expect(error.message).toBe("Merkle proof verification failed"); - expect(error.payload).toEqual({ + expect(error.message).to.eq("Merkle proof verification failed"); + expect(error.payload).to.deep.eq({ root: mockRoot, proof: secondProofs, }); } - // Signer getAddress - expect(_provider.callHistory.length).toBe(1); + expect(hash).to.be.undefined; + expect(metaDataStub.callCount).to.eq(0); + expect(dataStub.callCount).to.eq(0); + expect(readSpy.callCount).to.eq(0); + expect(writeSpy.callCount).to.eq(0); }); }); }); diff --git a/sdk/test/client/burn.test.ts b/sdk/test/client/burn.test.ts index c0d83887..9c097aa7 100644 --- a/sdk/test/client/burn.test.ts +++ b/sdk/test/client/burn.test.ts @@ -1,103 +1,107 @@ -import { MockProvider, deployMockContract } from "ethereum-waffle"; -import { BigNumber, Wallet } from "ethers"; +import { describe, it, beforeEach, afterAll } from "vitest"; +import chai, { expect } from "chai"; +import assertionsCount from "chai-assertions-count"; + +import { HypercertClient } from "../../src/client"; +import { walletClient, publicClient } from "../helpers"; +import { isHex, toHex } from "viem"; import sinon from "sinon"; +import { faker } from "@faker-js/faker"; +import { ClientError, ContractError } from "../../src"; + +chai.use(assertionsCount); -import HypercertClient from "../../src/client.js"; -import { ClientError } from "../../src/types/errors.js"; -import { HypercertMinterAbi } from "@hypercerts-org/contracts"; describe("burn fraction tokens in HypercertClient", () => { - let stub: sinon.SinonStub; - let provider: MockProvider; - let user: Wallet; - let other: Wallet; - const fractionId = BigNumber.from("9868188640707215440437863615521278132232"); + const wallet = walletClient; + const userAddress = wallet.account?.address; + const client = new HypercertClient({ + chain: { id: 5 }, + walletClient, + publicClient, + nftStorageToken: "test", + web3StorageToken: "test", + }); - beforeAll(() => { - provider = new MockProvider(); - [user, other] = provider.getWallets(); + const fractionId = 9868188640707215440437863615521278132232n; - stub = sinon.stub(provider, "on"); - }); - beforeEach(() => { - provider.clearCallHistory(); + let readSpy = sinon.stub(publicClient, "readContract"); + let writeSpy = sinon.stub(walletClient, "writeContract"); + + beforeEach(async () => { + chai.Assertion.resetAssertsCheck(); + + readSpy.resetBehavior(); + readSpy.resetHistory(); + + writeSpy.resetBehavior(); + writeSpy.resetHistory(); }); afterAll(() => { - stub.restore(); + sinon.restore(); }); it("allows for a hypercert fraction to be burned", async () => { - const userAddress = await user.getAddress(); - const mockMinter = await deployMockContract(user, HypercertMinterAbi); - await mockMinter.mock.ownerOf.withArgs(fractionId).returns(userAddress); - await mockMinter.mock["burnFraction(address,uint256)"].withArgs(userAddress, fractionId).returns(); + readSpy = readSpy.resolves(userAddress); - const client = new HypercertClient({ - chainId: 5, - operator: user, - contractAddress: mockMinter.address, - }); + writeSpy = writeSpy.resolves(toHex(420)); - expect(client.readonly).toBe(false); + expect(client.readonly).to.be.false; - await client.burnClaimFraction(fractionId); + const hash = await client.burnClaimFraction(fractionId); //TODO determine underlying calls and mock those out. Some are provider simulation calls - expect(provider.callHistory.length).toBe(5); + expect(isHex(hash)).to.be.true; + expect(readSpy.callCount).to.eq(1); + expect(writeSpy.callCount).to.eq(1); }); it("throws on burning fraction not owned by signer", async () => { - const otherUser = await other.getAddress(); - const mockMinter = await deployMockContract(user, HypercertMinterAbi); - await mockMinter.mock.ownerOf.withArgs(fractionId).returns(otherUser); - - const client = new HypercertClient({ - chainId: 5, - operator: user, - contractAddress: mockMinter.address, - }); + chai.Assertion.expectAssertions(6); + readSpy = readSpy.resolves(faker.finance.ethereumAddress()); - expect(client.readonly).toBe(false); + expect(client.readonly).to.be.false; + let hash; try { - await client.burnClaimFraction(fractionId); + hash = await client.burnClaimFraction(fractionId); } catch (e) { - console.log(e); - expect(e instanceof ClientError).toBeTruthy(); + expect(e).to.be.instanceOf(ClientError); const error = e as ClientError; - expect(error.message).toBe("Claim is not owned by the signer"); + expect(error.message).to.eq("Claim is not owned by the signer"); } //TODO determine underlying calls and mock those out. Some are provider simulation calls - // Owner - expect(provider.callHistory.length).toBe(3); - expect.assertions(4); + expect(hash).to.be.undefined; + expect(readSpy.callCount).to.eq(1); + expect(writeSpy.callCount).to.eq(0); }); it("allows for a hypercert fraction to be burned with override params", async () => { - const userAddress = await user.getAddress(); - const mockMinter = await deployMockContract(user, HypercertMinterAbi); - await mockMinter.mock.ownerOf.withArgs(fractionId).returns(userAddress); - await mockMinter.mock["burnFraction(address,uint256)"].withArgs(userAddress, fractionId).returns(); + chai.Assertion.expectAssertions(6); + readSpy = readSpy.resolves(userAddress); - const client = new HypercertClient({ - chainId: 5, - operator: user, - contractAddress: mockMinter.address, - }); + writeSpy = writeSpy.resolves(toHex(420)); - expect(client.readonly).toBe(false); + expect(client.readonly).to.be.false; + + let noHash; try { - await client.burnClaimFraction(fractionId, { gasLimit: "FALSE_VALUE" }); + noHash = await client.burnClaimFraction(fractionId, { gasLimit: "FALSE_VALUE" as unknown as bigint }); + expect.fail("should have thrown on incorrect gasLimit value"); } catch (e) { - expect((e as Error).message).toMatch(/invalid BigNumber string/); + console.log(e); + expect(e).to.be.instanceOf(ContractError); } - await client.burnClaimFraction(fractionId, { gasLimit: "12300000" }); + const hash = await client.burnClaimFraction(fractionId, { gasLimit: 12300000n }); //TODO determine underlying calls and mock those out. Some are provider simulation calls - expect(provider.callHistory.length).toBe(6); + expect(noHash).to.be.undefined; + expect(isHex(hash)).to.be.true; + expect(readSpy.callCount).to.eq(2); + expect(writeSpy.callCount).to.eq(1); }); }); diff --git a/sdk/test/client/minting.test.ts b/sdk/test/client/minting.test.ts index 2d657062..fa4e3f00 100644 --- a/sdk/test/client/minting.test.ts +++ b/sdk/test/client/minting.test.ts @@ -1,60 +1,55 @@ -import { expect } from "chai"; -import { MockContract, MockProvider, deployMockContract } from "ethereum-waffle"; -import { ethers } from "ethers"; +import { describe, it, beforeEach, afterAll, beforeAll } from "vitest"; +import chai, { expect } from "chai"; +import assertionsCount from "chai-assertions-count"; import sinon from "sinon"; -import { jest, test } from "@jest/globals"; +import { encodeFunctionResult, isHex, parseEther } from "viem"; -import HypercertClient from "../../src/client.js"; -import { HypercertMetadata, HypercertsStorage, formatHypercertData } from "../../src/index.js"; -import { MalformedDataError } from "../../src/types/errors.js"; -import { TransferRestrictions } from "../../src/types/hypercerts.js"; -import { getRawInputData } from "../helpers.js"; -import { HypercertMinter, HypercertMinterAbi } from "@hypercerts-org/contracts"; -const mockCorrectMetadataCid = "testCID1234fkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u"; +import { HypercertClient } from "../../src/client"; +import { HypercertMetadata, formatHypercertData } from "../../src"; +import { ContractError, MalformedDataError } from "../../src/types/errors"; +import { TransferRestrictions } from "../../src/types/hypercerts"; +import { getRawInputData, publicClient, walletClient, testClient } from "../helpers"; +import { HypercertMinterAbi } from "@hypercerts-org/contracts"; -describe("mintClaim in HypercertClient", () => { - const metaDataStub = sinon.stub(HypercertsStorage.prototype, "storeMetadata").resolves(mockCorrectMetadataCid); +//eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +import { CIDString, NFTStorage } from "nft.storage"; - const setUp = async () => { - const provider = new MockProvider(); - const [user, other, admin] = provider.getWallets(); - const stub = sinon.stub(provider, "on"); +chai.use(assertionsCount); - const minter = await deployMockContract(user, HypercertMinterAbi); +describe("mintClaim in HypercertClient", () => { + const mockCorrectMetadataCid = "testCID1234fkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u" as CIDString; - const client = new HypercertClient({ - chainId: 5, - operator: user, - }); + const storeBlobMock = sinon.stub(NFTStorage, "storeBlob").resolves(mockCorrectMetadataCid); - sinon.replaceGetter(client, "contract", () => minter as unknown as HypercertMinter); + const client = new HypercertClient({ + chain: { id: 5 }, + walletClient, + publicClient, + nftStorageToken: "test", + web3StorageToken: "test", + }); - return { - client, - provider, - users: { user, other, admin }, - minter, - stub, - }; - }; + const readSpy = sinon.stub(publicClient, "readContract"); + let writeSpy = sinon.stub(walletClient, "writeContract"); - let _client: HypercertClient; - let _provider: MockProvider; - let _users: { user: ethers.Wallet; other: ethers.Wallet; admin: ethers.Wallet }; - let _minter: MockContract; - let _stub: sinon.SinonStub; + const mintClaimResult = encodeFunctionResult({ + abi: HypercertMinterAbi, + functionName: "mintClaim", + result: [], + }); beforeAll(async () => { - const { client, provider, users, minter, stub } = await setUp(); - _client = client; - _provider = provider; - _users = users; - _minter = minter; - _stub = stub; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + await testClient.setBalance({ address: walletClient.account!.address, value: parseEther("1") }); }); - beforeEach(() => { - _provider.clearCallHistory(); + beforeEach(async () => { + chai.Assertion.resetAssertsCheck(); + writeSpy.resetBehavior(); + writeSpy.resetHistory(); + + storeBlobMock.resetHistory(); }); afterAll(() => { @@ -62,49 +57,61 @@ describe("mintClaim in HypercertClient", () => { }); it("mints a hypercerts", async () => { - expect(_client.readonly).to.be.false; + expect(client.readonly).to.be.false; const rawData = getRawInputData(); const { data: formattedData } = formatHypercertData(rawData); - await _minter.mock.mintClaim.returns(); + writeSpy = writeSpy.resolves(mintClaimResult); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - await _client.mintClaim(formattedData!, 1000, TransferRestrictions.AllowAll); + const hash = await client.mintClaim(formattedData!, 1000n, TransferRestrictions.AllowAll); - sinon.assert.calledOnce(metaDataStub); - expect(_provider.callHistory.length).to.equal(2); - }, 10000); + expect(isHex(hash)).to.be.true; + expect(readSpy.callCount).to.equal(0); + expect(writeSpy.callCount).to.equal(1); + expect(storeBlobMock.callCount).to.equal(1); + }); it("throws on malformed metadata", async () => { try { - await _client.mintClaim({} as HypercertMetadata, 1000, TransferRestrictions.AllowAll); + await client.mintClaim({} as HypercertMetadata, 1000n, TransferRestrictions.AllowAll); expect.fail("Should throw MalformedDataError"); } catch (e) { expect(e).to.be.instanceOf(MalformedDataError); const error = e as MalformedDataError; expect(error.message).to.equal("Metadata validation failed"); } - expect(_provider.callHistory.length).to.equal(0); + expect(writeSpy.callCount).to.equal(0); }); it("mints a hypercerts with override params", async () => { const rawData = getRawInputData(); - await _minter.mock.mintClaim.returns(); const { data: formattedData } = formatHypercertData(rawData); + writeSpy = writeSpy.resolves(mintClaimResult); + + let hash; + try { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - await _client.mintClaim(formattedData!, 1000, TransferRestrictions.AllowAll, { gasPrice: "FALSE_VALUE" }); + hash = await client.mintClaim(formattedData!, 1000n, TransferRestrictions.AllowAll, { + gasPrice: "FALSE_VALUE" as unknown as bigint, + }); expect.fail("Should throw Error"); } catch (e) { - expect((e as Error).message).to.match(/.*invalid BigNumber string.*/); + expect(e).to.be.instanceOf(ContractError); + const error = e as ContractError; + expect(error.message).to.equal("Contract returned unparsable error. Inspect payload for returned data."); } // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - await _client.mintClaim(formattedData!, 1000, TransferRestrictions.AllowAll, { gasPrice: "100" }); + hash = await client.mintClaim(formattedData!, 1000n, TransferRestrictions.AllowAll, { gasPrice: 100n }); - expect(_provider.callHistory.length).to.equal(2); - }, 10000); + expect(isHex(hash)).to.be.true; + expect(readSpy.callCount).to.equal(0); + expect(writeSpy.callCount).to.equal(1); + expect(storeBlobMock.callCount).to.equal(2); + }); }); diff --git a/sdk/test/client/split.merge.test.ts b/sdk/test/client/split.merge.test.ts index fec89bf8..bfd3cf54 100644 --- a/sdk/test/client/split.merge.test.ts +++ b/sdk/test/client/split.merge.test.ts @@ -1,252 +1,232 @@ -import { MockProvider, deployMockContract } from "ethereum-waffle"; -import { BigNumber, Wallet } from "ethers"; +import { describe, it, beforeEach, afterAll } from "vitest"; +import chai, { expect } from "chai"; +import assertionsCount from "chai-assertions-count"; + import sinon from "sinon"; -import HypercertClient from "../../src/client.js"; -import { ClientError } from "../../src/types/errors.js"; +import { HypercertClient } from "../../src/client"; -import { HypercertMinterAbi } from "@hypercerts-org/contracts"; +import { publicClient, walletClient } from "../helpers"; +import { isHex, toHex } from "viem"; +import { ClientError, ContractError } from "src"; +import { faker } from "@faker-js/faker"; -describe("splitClaimUnits in HypercertClient", () => { - let stub: sinon.SinonStub; - let provider: MockProvider; - let wallet: Wallet; - const fractionId = BigNumber.from("9868188640707215440437863615521278132232"); +chai.use(assertionsCount); - beforeAll(() => { - provider = new MockProvider(); - wallet = provider.getWallets()[0]; +describe("split and merge", () => { + const wallet = walletClient; + const userAddress = wallet.account?.address; - stub = sinon.stub(provider, "on"); - }); - beforeEach(() => { - provider.clearCallHistory(); + let readSpy = sinon.stub(publicClient, "readContract"); + let writeSpy = sinon.stub(walletClient, "writeContract"); + + const client = new HypercertClient({ + chain: { id: 5 }, + walletClient, + publicClient, + nftStorageToken: "test", + web3StorageToken: "test", }); + const fractionId = 9868188640707215440437863615521278132232n; + afterAll(() => { - stub.restore(); + sinon.restore(); }); - it("allows for a hypercert fractions to be splitted over value", async () => { - const userAddress = await wallet.getAddress(); - const mockMinter = await deployMockContract(wallet, HypercertMinterAbi); - await mockMinter.mock.ownerOf.withArgs(fractionId).returns(userAddress); - await mockMinter.mock["unitsOf(uint256)"].withArgs(fractionId).returns(300); - await mockMinter.mock["splitFraction(address,uint256,uint256[])"] - .withArgs(userAddress, fractionId, [100, 200]) - .returns(); - - const signer = wallet.connect(provider); - - const client = new HypercertClient({ - chainId: 5, - operator: signer, - contractAddress: mockMinter.address, - }); - - expect(client.readonly).toBe(false); + describe("splitFractionUnits in HypercertClient", () => { + beforeEach(async () => { + chai.Assertion.resetAssertsCheck(); + readSpy.resetBehavior(); + readSpy.resetHistory(); - await client.splitClaimUnits(fractionId, [100, 200]); + writeSpy.resetBehavior(); + writeSpy.resetHistory(); + }); - //TODO determine underlying calls and mock those out. Some are provider simulation calls - expect(provider.callHistory.length).toBe(7); - }, 10000); + it("allows for a hypercert fractions to be splitted over value", async () => { + chai.Assertion.expectExpects(4); + readSpy = readSpy.onFirstCall().resolves(userAddress).onSecondCall().resolves(300n); + writeSpy = writeSpy.resolves(toHex(420)); - it("allows for a hypercert fractions to be splitted over value with override params", async () => { - const userAddress = await wallet.getAddress(); - const mockMinter = await deployMockContract(wallet, HypercertMinterAbi); - await mockMinter.mock.ownerOf.withArgs(fractionId).returns(userAddress); - await mockMinter.mock["unitsOf(uint256)"].withArgs(fractionId).returns(300); - await mockMinter.mock["splitFraction(address,uint256,uint256[])"] - .withArgs(userAddress, fractionId, [100, 200]) - .returns(); + expect(client.readonly).to.be.false; - const signer = wallet.connect(provider); + const hash = await client.splitFractionUnits(fractionId, [100n, 200n]); - const client = new HypercertClient({ - chainId: 5, - operator: signer, - contractAddress: mockMinter.address, - }); - expect(client.readonly).toBe(false); - - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - try { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - await client.splitClaimUnits(fractionId, [100, 200], { gasLimit: "FALSE_VALUE" }); - } catch (e) { - expect((e as Error).message).toMatch(/invalid BigNumber string/); - } - - await client.splitClaimUnits(fractionId, [100, 200], { gasLimit: "12300000" }); - - //TODO determine underlying calls and mock those out. Some are provider simulation calls - expect(provider.callHistory.length).toBe(9); - }, 10000); - - it("throws on splitting with incorrect new total value", async () => { - const userAddress = await wallet.getAddress(); - const mockMinter = await deployMockContract(wallet, HypercertMinterAbi); - await mockMinter.mock.ownerOf.withArgs(fractionId).returns(userAddress); - await mockMinter.mock["unitsOf(uint256)"].withArgs(fractionId).returns(42); - - const signer = wallet.connect(provider); - - const client = new HypercertClient({ - chainId: 5, - operator: signer, - contractAddress: mockMinter.address, + //TODO determine underlying calls and mock those out. Some are provider simulation calls + expect(isHex(hash)).to.be.true; + expect(readSpy.callCount).to.eq(2); + expect(writeSpy.callCount).to.eq(1); }); - expect(client.readonly).toBe(false); - - try { - await client.splitClaimUnits(fractionId, [100, 200]); - } catch (e) { - expect(e instanceof ClientError).toBeTruthy(); - - const error = e as ClientError; - expect(error.message).toBe("Sum of fractions is not equal to the total units"); - } - - //TODO determine underlying calls and mock those out. Some are provider simulation calls - // Owner - // UnitsOf - expect(provider.callHistory.length).toBe(5); - expect.assertions(4); - }); - it("throws on splitting fractions not owned by signer", async () => { - const otherUser = await provider.getWallets()[1].getAddress(); - const mockMinter = await deployMockContract(wallet, HypercertMinterAbi); - await mockMinter.mock.ownerOf.withArgs(fractionId).returns(otherUser); - - const signer = wallet.connect(provider); + it("allows for a hypercert fractions to be splitted over value with override params", async () => { + chai.Assertion.expectExpects(5); + readSpy = readSpy + .onFirstCall() + .resolves(userAddress) + .onSecondCall() + .resolves(300n) + .onThirdCall() + .resolves(userAddress) + .onCall(3) + .resolves(300n); + + writeSpy = writeSpy.resolves(toHex(420)); + + expect(client.readonly).to.be.false; + + try { + await client.splitFractionUnits(fractionId, [100n, 200n], { gasLimit: "FALSE_VALUE" as unknown as bigint }); + } catch (e) { + expect(e instanceof ContractError).to.be.true; + } + + const hash = await client.splitFractionUnits(fractionId, [100n, 200n], { gasLimit: 12300000n }); + + //TODO determine underlying calls and mock those out. Some are provider simulation calls + expect(isHex(hash)).to.be.true; + expect(readSpy.callCount).to.eq(4); + expect(writeSpy.callCount).to.eq(1); + }); - const client = new HypercertClient({ - chainId: 5, - operator: signer, - contractAddress: mockMinter.address, + it("throws on splitting with incorrect new total value", async () => { + chai.Assertion.expectExpects(4); + readSpy = readSpy + .onFirstCall() + .resolves(userAddress) // ownerOf + .onSecondCall() + .resolves(300n) // unitsOf + .onThirdCall() + .resolves(userAddress) + .onCall(3) + .resolves(300n); + + expect(client.readonly).to.be.false; + + try { + await client.splitFractionUnits(fractionId, [100n, 777n]); + } catch (e) { + expect(e instanceof ClientError).to.be.true; + + const error = e as ClientError; + expect(error.message).to.be.eq("Sum of fractions is not equal to the total units"); + } + + //TODO determine underlying calls and mock those out. Some are provider simulation calls + // Owner + // UnitsOf + expect(readSpy.callCount).to.eq(2); + expect(writeSpy.callCount).to.eq(0); }); - expect(client.readonly).toBe(false); - try { - await client.splitClaimUnits(fractionId, [100, 200]); - } catch (e) { - expect(e instanceof ClientError).toBeTruthy(); + it("throws on splitting fractions not owned by signer", async () => { + chai.Assertion.expectExpects(4); + readSpy = readSpy.onFirstCall().resolves(faker.finance.ethereumAddress()).onSecondCall().resolves(300n); // unitsOf; // ownerOf - const error = e as ClientError; - expect(error.message).toBe("Claim is not owned by the signer"); - } + expect(client.readonly).to.be.false; - //TODO determine underlying calls and mock those out. Some are provider simulation calls - // Owner - expect(provider.callHistory.length).toBe(3); - expect.assertions(4); - }); -}); + try { + await client.splitFractionUnits(fractionId, [100n, 200n]); + } catch (e) { + expect(e instanceof ClientError).to.be.true; -describe("mergeClaimUnits in HypercertClient", () => { - let stub: sinon.SinonStub; - let provider: MockProvider; - let wallet: Wallet; - const fractionId = BigNumber.from("9868188640707215440437863615521278132232"); + const error = e as ClientError; + expect(error.message).to.be.eq("Claim is not owned by the signer"); + } - beforeAll(() => { - provider = new MockProvider(); - wallet = provider.getWallets()[0]; - stub = sinon.stub(provider, "on"); - }); - beforeEach(() => { - provider.clearCallHistory(); + //TODO determine underlying calls and mock those out. Some are provider simulation calls + // Owner + expect(readSpy.callCount).to.eq(2); + expect(writeSpy.callCount).to.eq(0); + }); }); - afterAll(() => { - stub.restore(); - }); + describe("mergeFractionUnits in HypercertClient", () => { + beforeEach(async () => { + chai.Assertion.resetAssertsCheck(); + readSpy.resetBehavior(); + readSpy.resetHistory(); - it("allows for hypercert fractions to merge value", async () => { - const userAddress = await wallet.getAddress(); - const mockMinter = await deployMockContract(wallet, HypercertMinterAbi); - await mockMinter.mock.ownerOf.withArgs(fractionId).returns(userAddress); - await mockMinter.mock.ownerOf.withArgs(fractionId.add(1)).returns(userAddress); - await mockMinter.mock["mergeFractions(address,uint256[])"] - .withArgs(userAddress, [fractionId, fractionId.add(1)]) - .returns(); - - const signer = wallet.connect(provider); - - const client = new HypercertClient({ - chainId: 5, - operator: signer, - contractAddress: mockMinter.address, + writeSpy.resetBehavior(); + writeSpy.resetHistory(); }); - expect(client.readonly).toBe(false); - await client.mergeClaimUnits([fractionId, fractionId.add(1)]); + it("allows for hypercert fractions to merge value", async () => { + chai.Assertion.expectExpects(3); + readSpy = readSpy + .onFirstCall() + .resolves(userAddress) // ownerOf + .onSecondCall() + .resolves(userAddress) // unitsOf + .onThirdCall() + .resolves(userAddress); - //TODO determine underlying calls and mock those out. Some are provider simulation calls - expect(provider.callHistory.length).toBe(7); - }, 10000); + writeSpy = writeSpy.resolves(toHex(420)); - it("allows for hypercert fractions to merge value with override params", async () => { - const userAddress = await wallet.getAddress(); - const mockMinter = await deployMockContract(wallet, HypercertMinterAbi); - await mockMinter.mock.ownerOf.withArgs(fractionId).returns(userAddress); - await mockMinter.mock.ownerOf.withArgs(fractionId.add(1)).returns(userAddress); - await mockMinter.mock["mergeFractions(address,uint256[])"] - .withArgs(userAddress, [fractionId, fractionId.add(1)]) - .returns(); + expect(client.readonly).to.be.false; - const signer = wallet.connect(provider); + const hash = await client.mergeFractionUnits([fractionId, fractionId + 1n]); - const client = new HypercertClient({ - chainId: 5, - operator: signer, - contractAddress: mockMinter.address, + //TODO determine underlying calls and mock those out. Some are provider simulation calls + expect(isHex(hash)).to.be.true; + expect(readSpy.callCount).to.eq(2); + expect(writeSpy.callCount).to.eq(1); }); - expect(client.readonly).toBe(false); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - try { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - await client.mergeClaimUnits([fractionId, fractionId.add(1)], { gasLimit: "FALSE_VALUE" }); - } catch (e) { - expect((e as Error).message).toMatch(/invalid BigNumber string/); - } + it("allows for hypercert fractions to merge value with override params", async () => { + chai.Assertion.expectExpects(7); + + readSpy = readSpy.resolves(userAddress); // ownerOf - await client.mergeClaimUnits([fractionId, fractionId.add(1)], { gasLimit: "12300000" }); + writeSpy = writeSpy.resolves(toHex(420)); - //TODO determine underlying calls and mock those out. Some are provider simulation calls - expect(provider.callHistory.length).toBe(9); - }, 10000); + expect(client.readonly).to.be.false; - it("throws on splitting fractions not owned by signer", async () => { - const userAddress = await wallet.getAddress(); - const otherUser = await provider.getWallets()[1].getAddress(); + let hash; - const mockMinter = await deployMockContract(wallet, HypercertMinterAbi); - await mockMinter.mock.ownerOf.withArgs(fractionId).returns(userAddress); - await mockMinter.mock.ownerOf.withArgs(fractionId.add(1)).returns(otherUser); + try { + hash = await client.mergeFractionUnits([fractionId, fractionId + 1n], { + gasLimit: "FALSE_VALUE" as unknown as bigint, + }); + } catch (e) { + console.log(e); + // https://github.com/wevm/viem/issues/1275 + expect(e instanceof Error).to.be.true; - const signer = wallet.connect(provider); + // const error = e as ClientError; + // expect(error.message).to.be.eq(/invalid BigNumber string/); + expect(isHex(hash)).to.be.false; + } - const client = new HypercertClient({ - chainId: 5, - operator: signer, - contractAddress: mockMinter.address, + hash = await client.mergeFractionUnits([fractionId, fractionId + 1n], { gasLimit: 12300000n }); + + //TODO determine underlying calls and mock those out. Some are provider simulation calls + + expect(isHex(hash)).to.be.true; + expect(readSpy.callCount).to.eq(4); + expect(writeSpy.callCount).to.eq(1); }); - expect(client.readonly).toBe(false); - try { - await client.mergeClaimUnits([fractionId, fractionId.add(1)]); - } catch (e) { - expect(e instanceof ClientError).toBeTruthy(); + it("throws on splitting fractions not owned by signer", async () => { + chai.Assertion.expectExpects(3); + readSpy = readSpy.onFirstCall().resolves(userAddress).onSecondCall().resolves(faker.finance.ethereumAddress()); // ownerOf + + expect(client.readonly).to.be.false; - const error = e as ClientError; - expect(error.message).toBe("One or more claims are not owned by the signer"); - } + let hash; + try { + hash = await client.mergeFractionUnits([fractionId, fractionId + 1n]); + } catch (e) { + expect(e instanceof ClientError).to.be.true; - //TODO determine underlying calls and mock those out. Some are provider simulation calls - expect(provider.callHistory.length).toBe(5); + const error = e as ClientError; + expect(error.message).to.be.eq("One or more fractions are not owned by the signer"); + } + + //TODO determine underlying calls and mock those out. Some are provider simulation calls + expect(isHex(hash)).to.be.false; + expect(readSpy.callCount).to.eq(2); + expect(writeSpy.callCount).to.eq(0); + }); }); }); diff --git a/sdk/test/evaluations/easEvaluator.test.ts b/sdk/test/evaluations/easEvaluator.test.ts deleted file mode 100644 index 048ec024..00000000 --- a/sdk/test/evaluations/easEvaluator.test.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { MockProvider } from "ethereum-waffle"; -import sinon from "sinon"; - -import { EAS_SCHEMAS } from "../../src/constants.js"; -import EasEvaluator from "../../src/evaluations/eas.js"; -import { HypercertClientConfig } from "../../src/index.js"; -import { DuplicateEvaluation, SimpleTextEvaluation } from "../../src/types/evaluation.js"; - -describe("EasEvaluator", () => { - let stub: sinon.SinonStub; - const provider = new MockProvider(); - - beforeAll(() => { - stub = sinon.stub(provider, "on"); - }); - const [wallet] = provider.getWallets(); - const signer = wallet.connect(provider); - - afterAll(() => { - stub.restore(); - }); - - const config = { - chainId: 5, - easContractAddress: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e", - operator: signer, - } as Partial; - const easEvaluator = new EasEvaluator(config); - - describe("getSignature", () => { - it("should return a signature", async () => { - const encodedData = "0x1234567890abcdef"; - const recipient = "0x0987654321098765432109876543210987654321"; - const schema = EAS_SCHEMAS["sepolia"].duplicate; - - const signature = await easEvaluator.getSignature(encodedData, recipient, schema.uid); - - expect(signature).toBeDefined(); - expect(signature.message.schema).toEqual(schema.uid); - expect(Object.keys(signature)).toEqual( - expect.arrayContaining(["domain", "message", "primaryType", "signature", "types", "uid"]), - ); - }); - }); - - describe("signOfflineEvaluation", () => { - it("should sign a duplicate evaluation", async () => { - const evaluation = { - type: "duplicate", - realHypercert: { - chainId: "0x1", - contract: "0x1234567890123456789012345678901234567890", - claimId: "1", - }, - duplicateHypercerts: [ - { - chainId: "0x1", - contract: "0x0987654321098765432109876543210987654321", - claimId: "2", - }, - ], - explanation: "explanation", - } as DuplicateEvaluation; - - const signature = await easEvaluator.signOfflineEvaluation(evaluation); - - expect(signature).toBeDefined(); - expect(signature?.message.schema).toEqual(EAS_SCHEMAS["sepolia"].duplicate.uid); - expect(signature).toContainKeys(["domain", "message", "primaryType", "signature", "types", "uid"]); - }); - - it("should sign a simple text evaluation", async () => { - const evaluation = { - type: "simpleText", - hypercert: { - chainId: "0x1", - contract: "0x0987654321098765432109876543210987654321", - claimId: "2", - }, - text: "text", - } as SimpleTextEvaluation; - - const signature = await easEvaluator.signOfflineEvaluation(evaluation); - - expect(signature).toBeDefined(); - expect(signature?.message.schema).toEqual(EAS_SCHEMAS["sepolia"].contentHash.uid); - expect(signature).toContainKeys(["domain", "message", "primaryType", "signature", "types", "uid"]); - }); - }); -}); diff --git a/sdk/test/evaluations/evaluator.test.ts b/sdk/test/evaluations/evaluator.test.ts index b3ca52c7..5e7c3864 100644 --- a/sdk/test/evaluations/evaluator.test.ts +++ b/sdk/test/evaluations/evaluator.test.ts @@ -1,30 +1,21 @@ -import { expect } from "@jest/globals"; -import { providers } from "ethers"; -import { Wallet, ethers } from "ethers"; -import { CIDString } from "nft.storage"; +import { describe, it, afterAll, beforeEach } from "vitest"; +import chai, { expect } from "chai"; +import assertionsCount from "chai-assertions-count"; import sinon from "sinon"; -import HypercertEvaluator from "../../src/evaluations/index.js"; -import { InvalidOrMissingError, MalformedDataError, StorageError } from "../../src/types/errors.js"; -import { HypercertEvaluationSchema } from "../../src/types/evaluation.js"; -import { getEvaluationData } from "../helpers.js"; +import { HypercertEvaluator } from "../../src/evaluations"; +import { MalformedDataError, StorageError } from "../../src/types/errors"; +import { HypercertEvaluationSchema } from "../../src/types/evaluation"; +import { getEvaluationData, publicClient, walletClient } from "../helpers"; + +chai.use(assertionsCount); describe("HypercertEvaluator", () => { - let stubSubscription: sinon.SinonStub; - let stubStorage: sinon.SinonStub; - let signer: Wallet; - let evaluator: HypercertEvaluator; - const mockCid = "bafybeibxm2nsadl3fnxv2sxcxmxaco2jl53wpeorjdzidjwf5aqdg7wa6u"; - - beforeAll(() => { - stubSubscription = sinon.stub(providers.JsonRpcProvider.prototype, "on"); - signer = ethers.Wallet.createRandom(); - evaluator = new HypercertEvaluator({ - chainId: 5, - easContractAddress: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e", - operator: signer, - }); - stubStorage = sinon.stub(evaluator.storage, "storeData").resolves(mockCid); + const signer = walletClient.account; + const evaluator = new HypercertEvaluator({ + chain: { id: 5 }, + easContractAddress: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e", + publicClient, }); beforeEach(() => { @@ -32,42 +23,15 @@ describe("HypercertEvaluator", () => { }); afterAll(() => { - // reloadEnv(); - - stubStorage.restore(); - stubSubscription.restore(); + sinon.restore(); }); describe("submitEvaluation", () => { - it("should submit an EAS evaluation", async () => { - const evaluation: HypercertEvaluationSchema = getEvaluationData({ creator: await signer.getAddress() }); - - const result: CIDString = await evaluator.submitEvaluation(evaluation); - - console.log(result); - - expect(result).toEqual("bafybeibxm2nsadl3fnxv2sxcxmxaco2jl53wpeorjdzidjwf5aqdg7wa6u"); - sinon.assert.calledOnce(stubStorage); - }); - - it("should throw an error for missing signer", async () => { - try { - new HypercertEvaluator({ - chainId: 5, - easContractAddress: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e", - }); - } catch (e) { - expect(e).toBeInstanceOf(InvalidOrMissingError); - const error = e as InvalidOrMissingError; - expect(error.message).toEqual("Invalid or missing config value: operator"); - } - - expect.assertions(2); - }); - it("should throw an error for unexpected evaluation source", async () => { + chai.Assertion.expectAssertions(2); + const evaluation = { - creator: await signer.getAddress(), + creator: signer?.address, evaluationSource: { type: "invalid", }, @@ -80,15 +44,15 @@ describe("HypercertEvaluator", () => { try { await evaluator.submitEvaluation(evaluation as HypercertEvaluationSchema); } catch (e) { - expect(e).toBeInstanceOf(Error); + expect(e).to.be.instanceOf(Error); const error = e as StorageError; - expect(error.message).toEqual(`Unexpected evaluation source: ${evaluation.evaluationSource.toString()}`); + expect(error.message).to.eq(`Unexpected evaluation source: ${evaluation.evaluationSource.toString()}`); } - - expect.assertions(2); }); it("should throw an error for invalid creator address", async () => { + chai.Assertion.expectAssertions(2); + const evaluation = { creator: "bob", }; @@ -96,37 +60,31 @@ describe("HypercertEvaluator", () => { try { await evaluator.submitEvaluation(evaluation as HypercertEvaluationSchema); } catch (e) { - expect(e).toBeInstanceOf(MalformedDataError); + expect(e).to.be.instanceOf(MalformedDataError); const error = e as MalformedDataError; - expect(error.message).toEqual(`Invalid creator address: ${evaluation.creator.toString()}`); + expect(error.message).to.be.eq(`Invalid creator address: ${evaluation.creator.toString()}`); } - - expect.assertions(2); }); it("should throw an error for readonly storage", async () => { - sinon.stub(process, "env").value({ NFT_STORAGE_TOKEN: null }); - sinon.stub(process, "env").value({ WEB3_STORAGE_TOKEN: null }); - sinon.stub(process, "env").value({ NEXT_PUBLIC_NFT_STORAGE_TOKEN: null }); - sinon.stub(process, "env").value({ NEXT_PUBLIC_WEB3_STORAGE_TOKEN: null }); + chai.Assertion.expectAssertions(2); - const evaluation: HypercertEvaluationSchema = getEvaluationData({ creator: await signer.getAddress() }); + const evaluation: HypercertEvaluationSchema = getEvaluationData({ creator: signer?.address }); const readonlyEvaluator = new HypercertEvaluator({ - chainId: 5, + chain: { id: 5 }, easContractAddress: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e", - operator: signer, + publicClient, }); try { await readonlyEvaluator.submitEvaluation(evaluation); } catch (e) { - expect(e).toBeInstanceOf(StorageError); - const error = e as StorageError; - expect(error.message).toEqual("Web3.storage client is not configured"); + const error = e as Error; + expect(error).to.be.instanceOf(Error); + expect(error.message).to.match(/Unexpected evaluation source/); } - expect.assertions(2); sinon.restore(); }); }); diff --git a/sdk/test/helpers.ts b/sdk/test/helpers.ts index ccc5b712..a35aedb1 100644 --- a/sdk/test/helpers.ts +++ b/sdk/test/helpers.ts @@ -1,15 +1,74 @@ import { faker } from "@faker-js/faker"; import { StandardMerkleTree } from "@openzeppelin/merkle-tree"; -import { BigNumber, BigNumberish, ContractReceipt, ContractTransaction } from "ethers"; -import { HypercertMetadata } from "../src/index.js"; -import { - AllowlistEntry, - DuplicateEvaluation, - HypercertEvaluationSchema, - SimpleTextEvaluation, -} from "../src/types/index.js"; -import { formatHypercertData } from "../src/utils/formatter.js"; +import { HypercertMetadata } from "../src"; +import { AllowlistEntry, DuplicateEvaluation, HypercertEvaluationSchema, SimpleTextEvaluation } from "../src/types"; +import { formatHypercertData } from "../src/utils/formatter"; +import { Chain, foundry } from "viem/chains"; +import { PublicClient, WalletClient, createPublicClient, createTestClient, createWalletClient, http } from "viem"; +import * as HypercertMinter from "./resources/HypercertMinter.json"; +import mockMetadata from "./res/mockMetadata"; +import mockData from "./res/mockData"; + +const mockCorrectMetadataCid = "testCIDMETAfkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u"; +const mockCorrectDataCid = "testCIDDATAfkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u"; +const mockSomeDataCid = "someCIDDATAfkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u"; + +export const mockDataSets = { + hypercertMetadata: { + cid: mockCorrectMetadataCid, + data: mockMetadata, + }, + hypercertData: { + cid: mockCorrectDataCid, + data: mockMetadata.hypercert, + }, + someData: { + cid: mockSomeDataCid, + data: mockData, + }, +}; + +export const pool = Number(process.env.VITEST_POOL_ID ?? 1); +export const anvil = { + ...foundry, // We are using a mainnet fork for testing. + id: foundry.id, + rpcUrls: { + // These rpc urls are automatically used in the transports. + default: { + // Note how we append the worker id to the local rpc urls. + http: [`http://127.0.0.1:8545/${pool}`], + webSocket: [`ws://127.0.0.1:8545/${pool}`], + }, + public: { + // Note how we append the worker id to the local rpc urls. + http: [`http://127.0.0.1:8545/${pool}`], + webSocket: [`ws://127.0.0.1:8545/${pool}`], + }, + }, +} as const satisfies Chain; + +export const testClient = createTestClient({ + chain: anvil, + mode: "anvil", + transport: http(), +}); + +export const publicClient: PublicClient = createPublicClient({ + chain: anvil, + batch: { + multicall: true, + }, + transport: http(), +}); + +export const walletClient: WalletClient = createWalletClient({ + chain: anvil, + transport: http(), + account: faker.finance.ethereumAddress() as `0x${string}`, +}); + +export const HypercertMinterByteCode = HypercertMinter.bytecode as `0x${string}`; export type TestDataType = Parameters[0]; @@ -19,12 +78,12 @@ export type TestDataType = Parameters[0]; */ const getAllowlist = ({ size = 10, - units = 1, + units = 1n, address, }: { size?: number; address?: `0x${string}`; - units?: BigNumberish; + units?: bigint; } = {}) => { //generate allowlist array based on possible overrides const allowlist: AllowlistEntry[] = []; @@ -43,7 +102,7 @@ const getAllowlist = ({ const merkleTree = StandardMerkleTree.of(mappedAllowlist, ["address", "uint256"]); - const totalUnits = allowlist.reduce((acc, entry) => acc.add(entry.units), BigNumber.from(0)); + const totalUnits = allowlist.reduce((acc, entry) => acc + BigInt(entry.units), 0n); return { allowlist, merkleTree, totalUnits }; }; @@ -78,42 +137,6 @@ const getFormattedMetadata = (overrides?: Partial): HypercertMetad return formattedData as HypercertMetadata; }; -const mockContractResponse = (): Promise => { - // mock transaction receipt - const receipt: ContractReceipt = { - to: "0x0", - from: "0x0", - contractAddress: "0x0", - transactionIndex: 0, - gasUsed: BigNumber.from(0), - logsBloom: "0x0", - blockHash: "0x0", - transactionHash: "0x0", - logs: [], - blockNumber: 0, - confirmations: 0, - cumulativeGasUsed: BigNumber.from(0), - effectiveGasPrice: BigNumber.from(0), - byzantium: true, - type: 0, - status: 1, - }; - - const transaction: ContractTransaction = { - gasLimit: BigNumber.from(0), - data: "0x0", - value: BigNumber.from(0), - chainId: 1337, - hash: "0x0", - confirmations: 1, - from: "0x0", - nonce: 0, - wait: () => Promise.resolve(receipt), - }; - - return Promise.resolve(transaction); -}; - const getEvaluationData = (overrides?: Partial): HypercertEvaluationSchema => { const mockData: HypercertEvaluationSchema = { creator: "0x17ec8597ff92C3F44523bDc65BF0f1bE632917ff", @@ -139,10 +162,8 @@ const getEvaluationData = (overrides?: Partial): Hype explanation: "These hypercerts are duplicates", }, evaluationSource: { - type: "EAS", - chainId: "0x1", - contract: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e", - uid: "0x1234567890abcdef", + type: "IPFS", + cid: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e", }, }; @@ -193,7 +214,6 @@ export { getAllowlist, getFormattedMetadata, getRawInputData, - mockContractResponse, getEvaluationData, getDuplicateEvaluationData, getSimpleTextEvaluationData, diff --git a/sdk/test/indexer.test.ts b/sdk/test/indexer.test.ts index fb80767a..1d6b3f24 100644 --- a/sdk/test/indexer.test.ts +++ b/sdk/test/indexer.test.ts @@ -1,17 +1,22 @@ +import { describe, it } from "vitest"; + import { expect } from "chai"; -import HypercertsIndexer from "../src/indexer.js"; +import { HypercertIndexer } from "../src/indexer"; describe("HypercertsIndexer", () => { it("should be able to create a new instance without valid graphName", () => { - const indexer = new HypercertsIndexer({}); + const indexer = new HypercertIndexer({ graphName: "hypercerts-testnet" }); - expect(indexer).to.be.an.instanceOf(HypercertsIndexer); + expect(indexer).to.be.an.instanceOf(HypercertIndexer); }); it("should be able to create a new instance with valid graphName", () => { - const indexer = new HypercertsIndexer({ graphUrl: "https://api.thegraph.com/subgraphs/name/hypercerts-testnet" }); + const indexer = new HypercertIndexer({ + graphName: "hypercerts-testnet", + graphUrl: "https://api.thegraph.com/subgraphs/name/hypercerts-testnet", + }); - expect(indexer).to.be.an.instanceOf(HypercertsIndexer); + expect(indexer).to.be.an.instanceOf(HypercertIndexer); }); }); diff --git a/sdk/test/indexer/queries.test.ts b/sdk/test/indexer/queries.test.ts index 01a9340b..27096d01 100644 --- a/sdk/test/indexer/queries.test.ts +++ b/sdk/test/indexer/queries.test.ts @@ -1,37 +1,32 @@ -import { jest } from "@jest/globals"; - -import { - ClaimByIdQuery, - ClaimTokenByIdQuery, - ClaimTokensByClaimQuery, - ClaimTokensByOwnerQuery, - ClaimsByOwnerQuery, - RecentClaimsQuery, -} from "../../.graphclient/index.js"; -import HypercertIndexer from "../../src/indexer.js"; -import { defaultQueryParams } from "../../src/indexer/utils.js"; +import { describe, it, beforeEach, afterEach, afterAll, vi, expect } from "vitest"; + +import { HypercertIndexer } from "../../src/indexer"; +import { defaultQueryParams } from "../../src/indexer/utils"; describe("HypercertIndexer", () => { let indexer: HypercertIndexer; beforeEach(() => { - indexer = new HypercertIndexer({ graphUrl: "https://api.thegraph.com/subgraphs/name/hypercerts-testnet" }); + indexer = new HypercertIndexer({ + graphName: "hypercerts-testnet", + graphUrl: "https://api.thegraph.com/subgraphs/name/hypercerts-testnet", + }); }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); afterAll(() => { - jest.resetAllMocks(); + vi.resetAllMocks(); }); it("should call graphClient.ClaimsByOwner with the correct parameters", async () => { const owner = "0x1234567890123456789012345678901234567890"; const params = defaultQueryParams; - const mockResponse: ClaimsByOwnerQuery = { claims: [] }; + const mockResponse = { claims: [] }; - const spy = jest.spyOn(indexer, "claimsByOwner").mockResolvedValue(mockResponse); + const spy = vi.spyOn(indexer, "claimsByOwner").mockResolvedValue(mockResponse); const result = await indexer.claimsByOwner(owner, params); @@ -42,9 +37,9 @@ describe("HypercertIndexer", () => { it("should call graphClient.ClaimById with the correct parameters", async () => { const id = "0x1234567890123456789012345678901234567890123456789012345678901234"; - const mockResponse: ClaimByIdQuery = { claim: null }; + const mockResponse = { claim: null }; - const spy = jest.spyOn(indexer, "claimById").mockResolvedValue(mockResponse); + const spy = vi.spyOn(indexer, "claimById").mockResolvedValue(mockResponse); const result = await indexer.claimById(id); @@ -55,9 +50,9 @@ describe("HypercertIndexer", () => { it("should call graphClient.RecentClaims with the correct parameters", async () => { const params = defaultQueryParams; - const mockResponse: RecentClaimsQuery = { claims: [] }; + const mockResponse = { claims: [] }; - const spy = jest.spyOn(indexer, "firstClaims").mockResolvedValue(mockResponse); + const spy = vi.spyOn(indexer, "firstClaims").mockResolvedValue(mockResponse); const result = await indexer.firstClaims(params); @@ -69,9 +64,9 @@ describe("HypercertIndexer", () => { it("should call graphClient.ClaimTokensByOwner with the correct parameters", async () => { const owner = "0x1234567890123456789012345678901234567890"; const params = defaultQueryParams; - const mockResponse: ClaimTokensByOwnerQuery = { claimTokens: [] }; + const mockResponse = { claimTokens: [] }; - const spy = jest.spyOn(indexer, "fractionsByOwner").mockResolvedValue(mockResponse); + const spy = vi.spyOn(indexer, "fractionsByOwner").mockResolvedValue(mockResponse); const result = await indexer.fractionsByOwner(owner, params); @@ -83,9 +78,9 @@ describe("HypercertIndexer", () => { it("should call graphClient.ClaimTokensByClaim with the correct parameters", async () => { const claimId = "0x1234567890123456789012345678901234567890123456789012345678901234"; const params = defaultQueryParams; - const mockResponse: ClaimTokensByClaimQuery = { claimTokens: [] }; + const mockResponse = { claimTokens: [] }; - const spy = jest.spyOn(indexer, "fractionsByClaim").mockResolvedValue(mockResponse); + const spy = vi.spyOn(indexer, "fractionsByClaim").mockResolvedValue(mockResponse); const result = await indexer.fractionsByClaim(claimId, params); @@ -96,9 +91,9 @@ describe("HypercertIndexer", () => { it("should call graphClient.ClaimTokenById with the correct parameters", async () => { const fractionId = "0x1234567890123456789012345678901234567890123456789012345678901234"; - const mockResponse: ClaimTokenByIdQuery = { claimToken: null }; + const mockResponse = { claimToken: null }; - const spy = jest.spyOn(indexer, "fractionById").mockResolvedValue(mockResponse); + const spy = vi.spyOn(indexer, "fractionById").mockResolvedValue(mockResponse); const result = await indexer.fractionById(fractionId); expect(spy).toHaveBeenCalledWith(fractionId); diff --git a/sdk/test/resources/HypercertMinter.json b/sdk/test/resources/HypercertMinter.json new file mode 100644 index 00000000..39fdd403 --- /dev/null +++ b/sdk/test/resources/HypercertMinter.json @@ -0,0 +1,1139 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "HypercertMinter", + "sourceName": "src/protocol/HypercertMinter.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyClaimed", + "type": "error" + }, + { + "inputs": [], + "name": "ArraySize", + "type": "error" + }, + { + "inputs": [], + "name": "DoesNotExist", + "type": "error" + }, + { + "inputs": [], + "name": "DuplicateEntry", + "type": "error" + }, + { + "inputs": [], + "name": "Invalid", + "type": "error" + }, + { + "inputs": [], + "name": "NotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "NotApprovedOrOwner", + "type": "error" + }, + { + "inputs": [], + "name": "TransfersNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "TypeMismatch", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "root", + "type": "bytes32" + } + ], + "name": "AllowlistCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256[]", + "name": "claimIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "fromTokenIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "toTokenIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + } + ], + "name": "BatchValueTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "claimID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "uri", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalUnits", + "type": "uint256" + } + ], + "name": "ClaimStored", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "leaf", + "type": "bytes32" + } + ], + "name": "LeafClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + } + ], + "name": "TransferBatch", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "TransferSingle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "value", + "type": "string" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "URI", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "claimID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fromTokenID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "toTokenID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "ValueTransfer", + "type": "event" + }, + { + "inputs": [], + "name": "__SemiFungible1155_init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "accounts", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + } + ], + "name": "balanceOfBatch", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "_tokenIDs", + "type": "uint256[]" + } + ], + "name": "batchBurnFraction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32[][]", + "name": "proofs", + "type": "bytes32[][]" + }, + { + "internalType": "uint256[]", + "name": "claimIDs", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "units", + "type": "uint256[]" + } + ], + "name": "batchMintClaimsFromAllowlists", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "name": "burnBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenID", + "type": "uint256" + } + ], + "name": "burnFraction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "units", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "merkleRoot", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "_uri", + "type": "string" + }, + { + "internalType": "enum IHypercertToken.TransferRestrictions", + "name": "restrictions", + "type": "uint8" + } + ], + "name": "createAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "hasBeenClaimed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + }, + { + "internalType": "uint256", + "name": "claimID", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "leaf", + "type": "bytes32" + } + ], + "name": "isAllowedToClaim", + "outputs": [ + { + "internalType": "bool", + "name": "isAllowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "_fractionIDs", + "type": "uint256[]" + } + ], + "name": "mergeFractions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "units", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_uri", + "type": "string" + }, + { + "internalType": "enum IHypercertToken.TransferRestrictions", + "name": "restrictions", + "type": "uint8" + } + ], + "name": "mintClaim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + }, + { + "internalType": "uint256", + "name": "claimID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "units", + "type": "uint256" + } + ], + "name": "mintClaimFromAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "units", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "fractions", + "type": "uint256[]" + }, + { + "internalType": "string", + "name": "_uri", + "type": "string" + }, + { + "internalType": "enum IHypercertToken.TransferRestrictions", + "name": "restrictions", + "type": "uint8" + } + ], + "name": "mintClaimWithFractions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + } + ], + "name": "readTransferRestriction", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeBatchTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_newFractions", + "type": "uint256[]" + } + ], + "name": "splitFraction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + } + ], + "name": "unitsOf", + "outputs": [ + { + "internalType": "uint256", + "name": "units", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + } + ], + "name": "unitsOf", + "outputs": [ + { + "internalType": "uint256", + "name": "units", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + } + ], + "name": "uri", + "outputs": [ + { + "internalType": "string", + "name": "_uri", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e7565b600054610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e5576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b608051615dcb6200011f60003960008181610b1601528181610bac01528181610f6701528181610ffd01526110f80152615dcb6000f3fe6080604052600436106102695760003560e01c8063715018a611610153578063b316962f116100cb578063f242432a1161007f578063f5298aca11610064578063f5298aca14610732578063f6b1229314610752578063fda4823c1461077257600080fd5b8063f242432a146106f2578063f2fde38b1461071257600080fd5b8063e985e9c5116100b0578063e985e9c514610669578063eb568a14146106b2578063f1169062146106d257600080fd5b8063b316962f14610629578063c7b26c541461064957600080fd5b80638fc202dd1161012257806399f771a71161010757806399f771a7146105ad578063a21ed980146105cd578063a22cb4651461060957600080fd5b80638fc202dd14610578578063993de1841461058d57600080fd5b8063715018a61461051b5780638129fc1c146105305780638456cb59146105455780638da5cb5b1461055a57600080fd5b80633f4ba83a116101e657806352d1902d116101b55780636352211e1161019a5780636352211e1461048c5780636b20c454146104db5780636ebd893f146104fb57600080fd5b806352d1902d1461045e5780635c975abb1461047357600080fd5b80633f4ba83a146103e95780633f71e944146103fe5780634e1273f41461041e5780634f1ef2861461044b57600080fd5b80631a2e98241161023d5780632eb2c2d6116102225780632eb2c2d6146103895780633659cfe6146103a95780633e11eefe146103c957600080fd5b80631a2e9824146103475780631e75a8b51461036757600080fd5b8062fdd58e1461026e57806301ffc9a7146102a157806306fdde03146102d15780630e89341c14610327575b600080fd5b34801561027a57600080fd5b5061028e610289366004614d0a565b610792565b6040519081526020015b60405180910390f35b3480156102ad57600080fd5b506102c16102bc366004614d62565b610840565b6040519015158152602001610298565b3480156102dd57600080fd5b5061031a6040518060400160405280600f81526020017f4879706572636572744d696e746572000000000000000000000000000000000081525081565b6040516102989190614dcf565b34801561033357600080fd5b5061031a610342366004614de2565b610923565b34801561035357600080fd5b5061028e610362366004614d0a565b61092e565b34801561037357600080fd5b50610387610382366004614f26565b610941565b005b34801561039557600080fd5b506103876103a436600461504e565b610a6a565b3480156103b557600080fd5b506103876103c43660046150f8565b610b0c565b3480156103d557600080fd5b506102c16103e4366004615113565b610ca9565b3480156103f557600080fd5b50610387610cd0565b34801561040a57600080fd5b5061031a610419366004614de2565b610ce2565b34801561042a57600080fd5b5061043e610439366004615164565b610e1f565b604051610298919061526a565b61038761045936600461527d565b610f5d565b34801561046a57600080fd5b5061028e6110eb565b34801561047f57600080fd5b506101cd5460ff166102c1565b34801561049857600080fd5b506104c36104a7366004614de2565b600090815261019260205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610298565b3480156104e757600080fd5b506103876104f63660046152c1565b6111b1565b34801561050757600080fd5b50610387610516366004615335565b6111c8565b34801561052757600080fd5b506103876111e2565b34801561053c57600080fd5b506103876111f4565b34801561055157600080fd5b50610387611355565b34801561056657600080fd5b5060fb546001600160a01b03166104c3565b34801561058457600080fd5b50610387611365565b34801561059957600080fd5b506103876105a836600461538f565b611408565b3480156105b957600080fd5b5061028e6105c8366004614de2565b61142f565b3480156105d957600080fd5b506102c16105e83660046153f4565b6101b060209081526000928352604080842090915290825290205460ff1681565b34801561061557600080fd5b50610387610624366004615416565b611444565b34801561063557600080fd5b50610387610644366004615452565b61144f565b34801561065557600080fd5b506103876106643660046154c4565b6114e4565b34801561067557600080fd5b506102c1610684366004615517565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b3480156106be57600080fd5b506103876106cd36600461554a565b611529565b3480156106de57600080fd5b506103876106ed36600461558e565b61153b565b3480156106fe57600080fd5b5061038761070d366004615639565b6115ce565b34801561071e57600080fd5b5061038761072d3660046150f8565b611669565b34801561073e57600080fd5b5061038761074d36600461569e565b6116f6565b34801561075e57600080fd5b5061038761076d366004614d0a565b611708565b34801561077e57600080fd5b5061038761078d3660046156d1565b61171a565b60006001600160a01b0383166108155760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e65720000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fd9b67a260000000000000000000000000000000000000000000000000000000014806108d357507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061083a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461083a565b606061083a826117cc565b600061093a83836117ea565b9392505050565b610949611822565b336001600160a01b0387161461097257604051631eb49d6d60e11b815260040160405180910390fd5b846109af85858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061187692505050565b146109e6576040517f6dac6a0900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006109f4878686866118f5565b60008181526101ff602052604090208054919250839160ff19166001836002811115610a2257610a22615739565b0217905550807f19789dde2d660b739733377add05f87576a360d2d4adea587c2592264f7f6d4e8488604051610a59929190615768565b60405180910390a250505050505050565b6001600160a01b038516331480610a865750610a868533610684565b610af85760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f766564000000000000000000000000000000000000606482015260840161080c565b610b05858585858561196f565b5050505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610baa5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c0000000000000000000000000000000000000000606482015260840161080c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c057f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614610c815760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f78790000000000000000000000000000000000000000606482015260840161080c565b610c8a81611c24565b60408051600080825260208201909252610ca691839190611c2c565b50565b60008281526101af6020526040812054610cc7908690869085611dcc565b95945050505050565b610cd8611de4565b610ce0611e3e565b565b6fffffffffffffffffffffffffffffffff19811660009081526101ff602052604081205460609160ff90911690816002811115610d2157610d21615739565b03610d6157505060408051808201909152600881527f416c6c6f77416c6c0000000000000000000000000000000000000000000000006020820152919050565b6001816002811115610d7557610d75615739565b03610db557505060408051808201909152600b81527f446973616c6c6f77416c6c0000000000000000000000000000000000000000006020820152919050565b6002816002811115610dc957610dc9615739565b03610e0957505060408051808201909152600f81527f46726f6d43726561746f724f6e6c7900000000000000000000000000000000006020820152919050565b5050604080516020810190915260008152919050565b60608151835114610e985760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d617463680000000000000000000000000000000000000000000000606482015260840161080c565b6000835167ffffffffffffffff811115610eb457610eb4614e47565b604051908082528060200260200182016040528015610edd578160200160208202803683370190505b50905060005b8451811015610f5557610f28858281518110610f0157610f0161578a565b6020026020010151858381518110610f1b57610f1b61578a565b6020026020010151610792565b828281518110610f3a57610f3a61578a565b6020908102919091010152610f4e816157e8565b9050610ee3565b509392505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610ffb5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c0000000000000000000000000000000000000000606482015260840161080c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166110567f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b0316146110d25760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f78790000000000000000000000000000000000000000606482015260840161080c565b6110db82611c24565b6110e782826001611c2c565b5050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461118b5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000606482015260840161080c565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b90565b6111b9611822565b6111c38383611e91565b505050565b6111d0611822565b6111dc8484848461211f565b50505050565b6111ea611de4565b610ce06000612667565b600054610100900460ff16158080156112145750600054600160ff909116105b8061122e5750303b15801561122e575060005460ff166001145b6112a05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161080c565b6000805460ff1916600117905580156112e057600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6112e8611365565b6112f06126d1565b8015610ca657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b61135d611de4565b610ce0612744565b600054610100900460ff166113d05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b6113e860405180602001604052806000815250612782565b6113f06127f6565b6113f8612861565b6114006128d4565b610ce06127f6565b611410611822565b61141c84848484612947565b611427858383612ad0565b505050505050565b6000818152610194602052604081205461083a565b6110e7338383612ba8565b611457611822565b6000611464868685612c9c565b9050611471818587612d6d565b60008181526101ff60205260409020805483919060ff1916600183600281111561149d5761149d615739565b0217905550807f19789dde2d660b739733377add05f87576a360d2d4adea587c2592264f7f6d4e84876040516114d4929190615768565b60405180910390a2505050505050565b6114ec611822565b6111c383838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612e5392505050565b611531611822565b6110e78282611e91565b611543611822565b8260005b818110156115b5576115ad8888838181106115645761156461578a565b90506020028101906115769190615802565b8888858181106115885761158861578a565b905060200201358787868181106115a1576115a161578a565b90506020020135612947565b600101611547565b506115c38886868686613167565b505050505050505050565b6001600160a01b0385163314806115ea57506115ea8533610684565b61165c5760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f766564000000000000000000000000000000000000606482015260840161080c565b610b0585858585856133a2565b611671611de4565b6001600160a01b0381166116ed5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161080c565b610ca681612667565b6116fe611822565b6111c3838361358d565b611710611822565b6110e7828261358d565b611722611822565b336001600160a01b0385161461174b57604051631eb49d6d60e11b815260040160405180910390fd5b600061175885858561365c565b60008181526101ff602052604090208054919250839160ff1916600183600281111561178657611786615739565b0217905550807f19789dde2d660b739733377add05f87576a360d2d4adea587c2592264f7f6d4e84866040516117bd929190615768565b60405180910390a25050505050565b606061083a6fffffffffffffffffffffffffffffffff198316613741565b600081815261019260205260408120546001600160a01b0384811691160361083a575060009081526101946020526040902054919050565b6101cd5460ff1615610ce05760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161080c565b8051600090815b818110156118ee578381815181106118975761189761578a565b60200260200101516000036118bf57604051631eb49d6d60e11b815260040160405180910390fd5b8381815181106118d1576118d161578a565b6020026020010151836118e4919061586a565b925060010161187d565b5050919050565b600061193d8561193786868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061187692505050565b8461365c565b60008181526101956020526040902054909150611967908690611960908461586a565b868661211f565b949350505050565b81518351146119e65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d61746368000000000000000000000000000000000000000000000000606482015260840161080c565b6001600160a01b038416611a625760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161080c565b33611a71818787878787613820565b60005b8451811015611bb0576000858281518110611a9157611a9161578a565b602002602001015190506000858381518110611aaf57611aaf61578a565b60209081029190910181015160008481526065835260408082206001600160a01b038e168352909352919091205490915081811015611b565760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161080c565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611b9590849061586a565b9250508190555050505080611ba9906157e8565b9050611a74565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611c0092919061587d565b60405180910390a4611c16818787878787613968565b6114278187878787876139d2565b610ca6611de4565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611c5f576111c383613bdf565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611cb9575060408051601f3d908101601f19168201909252611cb6918101906158a2565b60015b611d2b5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f742055555053000000000000000000000000000000000000606482015260840161080c565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114611dc05760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c65555549440000000000000000000000000000000000000000000000606482015260840161080c565b506111c3838383613cb5565b600082611dda868685613cda565b1495945050505050565b60fb546001600160a01b03163314610ce05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161080c565b611e46613d26565b6101cd805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382163314801590611eb15750611eaf8233610684565b155b15611ee8576040517fe433766c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805160008167ffffffffffffffff811115611f0557611f05614e47565b604051908082528060200260200182016040528015611f2e578160200160208202803683370190505b50905060008267ffffffffffffffff811115611f4c57611f4c614e47565b604051908082528060200260200182016040528015611f75578160200160208202803683370190505b50905060008367ffffffffffffffff811115611f9357611f93614e47565b604051908082528060200260200182016040528015611fbc578160200160208202803683370190505b50905060008467ffffffffffffffff811115611fda57611fda614e47565b604051908082528060200260200182016040528015612003578160200160208202803683370190505b50905060005b858110156120cd5760008782815181106120255761202561578a565b602090810291909101810151600081815261019490925260408220805492905591506fffffffffffffffffffffffffffffffff19821687848151811061206d5761206d61578a565b6020026020010181815250508085848151811061208c5761208c61578a565b60200260200101818152505060018484815181106120ac576120ac61578a565b602002602001018181525050505080806120c5906157e8565b915050612009565b506120d9878783613d79565b7f088515a3c7b4e71520602d818f4dec002fadefde30c55e13f390c8d96046990a8487858560405161210e94939291906158bb565b60405180910390a150505050505050565b60fd81118061212e5750600281105b15612165576040517f3ada02e500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6121a182828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061187692505050565b60008481526101946020526040902054146121cf57604051631eb49d6d60e11b815260040160405180910390fd5b600083815261019460205260408120546fffffffffffffffffffffffffffffffff198516916121ff600185615913565b905060008167ffffffffffffffff81111561221c5761221c614e47565b604051908082528060200260200182016040528015612245578160200160208202803683370190505b50905060008267ffffffffffffffff81111561226357612263614e47565b60405190808252806020026020018201604052801561228c578160200160208202803683370190505b50905060008367ffffffffffffffff8111156122aa576122aa614e47565b6040519080825280602002602001820160405280156122d3578160200160208202803683370190505b50905060008467ffffffffffffffff8111156122f1576122f1614e47565b60405190808252806020026020018201604052801561231a578160200160208202803683370190505b50905060008567ffffffffffffffff81111561233857612338614e47565b604051908082528060200260200182016040528015612361578160200160208202803683370190505b50905060008a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508451949550938593508b9250821090506123b1576123b161578a565b60200260200101519050816000815181106123ce576123ce61578a565b60200260200101518289815181106123e8576123e861578a565b60200260200101818152505080826000815181106124085761240861578a565b60200260200101818152505060005b888110156125235760008b8152610195602052604090205461243890614023565b8a88828151811061244b5761244b61578a565b6020026020010181815250508d87828151811061246a5761246a61578a565b60200260200101818152505061019560008c815260200190815260200160002060008154612497906157e8565b91829055506124a6908c61586a565b8682815181106124b8576124b861578a565b60200260200101818152505060018582815181106124d8576124d861578a565b6020026020010181815250508281815181106124f6576124f661578a565b60200260200101518482815181106125105761251061578a565b6020908102919091010152600101612417565b5050506125656125303390565b60008d8152610192602090815260408083205481519283019091529181526001600160a01b039091169087908790869061402d565b60005b868110156125ed578181815181106125825761258261578a565b6020026020010151886125959190615913565b97508181815181106125a9576125a961578a565b602002602001015161019460008684815181106125c8576125c861578a565b6020026020010151815260200190815260200160002081905550806001019050612568565b5060008b8152610194602090815260408083208a90558051918201905290815261261c908d908590859061415d565b7f088515a3c7b4e71520602d818f4dec002fadefde30c55e13f390c8d96046990a8585858460405161265194939291906158bb565b60405180910390a1505050505050505050505050565b60fb80546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661273c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b610ce0614373565b61274c611822565b6101cd805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611e743390565b600054610100900460ff166127ed5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b610ca6816143eb565b600054610100900460ff16610ce05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b600054610100900460ff166128cc5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b610ce061445f565b600054610100900460ff1661293f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b610ce06144e6565b60008281526101af60209081526040805133818401528082018590528151808203830181526060820183528051908401206080808301919091528251808303909101815260a090910182528051908301208584526101b083528184208185529092529091205460ff16156129e7576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526101af6020526040902054612a05908690869084611dcc565b1580612a36575060008381526101b160209081526040808320546101b290925290912054612a3490849061586a565b115b15612a6d576040517f6dac6a0900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526101b060209081526040808320848452825291829020805460ff1916600117905581518581529081018390527f51483c8cc684284e9ba3215822230838b766f1698bcc7e922a31e02c3c203bd7910160405180910390a15050505050565b6000612adb8361455a565b612af857604051631eb49d6d60e11b815260040160405180910390fd5b60008381526101956020526040902054612b1190614023565b5060008281526101956020908152604080832080546001808201909255860181018085526101948452828520869055825193840190925292825291612b599186918491614590565b6040805184815260006020820152908101829052606081018390527f5e65fcde72b913ac2870f9df6ea5b6bca757862f44636cb368ed5e339fc524fb9060800160405180910390a19392505050565b816001600160a01b0316836001600160a01b031603612c2f5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c660000000000000000000000000000000000000000000000606482015260840161080c565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000612caa610191546146d7565b608061019160008154612cbc906157e8565b9182905550901b60008181526101936020908152604080832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b038a1617905561019490915290208490559050612d1d81836146e5565b604080518281526000602082018190529182916001600160a01b038816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a49392505050565b811580612d78575080155b15612daf576040517f6dac6a0900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526101af602052604090205415612df6576040517f357d0cc400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526101af602090815260408083208590556101b182529182902083905581518581529081018490527f233c854c30aaaad173f2dd900c76d53c64e556d1d009d71466ec1afcb7b5844d91015b60405180910390a1505050565b60fd81511180612e64575060028151105b15612e9b576040517f3ada02e500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060018251612eab9190615913565b90506000828281518110612ec157612ec161578a565b602002602001015190506000808367ffffffffffffffff811115612ee757612ee7614e47565b604051908082528060200260200182016040528015612f10578160200160208202803683370190505b50905060008467ffffffffffffffff811115612f2e57612f2e614e47565b604051908082528060200260200182016040528015612f57578160200160208202803683370190505b50905060008567ffffffffffffffff811115612f7557612f75614e47565b604051908082528060200260200182016040528015612f9e578160200160208202803683370190505b50905060008667ffffffffffffffff811115612fbc57612fbc614e47565b604051908082528060200260200182016040528015612fe5578160200160208202803683370190505b50905060005b878110156130aa5760008982815181106130075761300761578a565b60200260200101519050808683815181106130245761302461578a565b602002602001018181525050878583815181106130435761304361578a565b60200260200101818152505060018383815181106130635761306361578a565b6020026020010181815250506101946000828152602001908152602001600020548483815181106130965761309661578a565b602090810291909101015250600101612feb565b506130c8338a8686866040518060200160405280600081525061402d565b60005b87811015613136578281815181106130e5576130e561578a565b6020026020010151866130f8919061586a565b955061019460008683815181106131115761311161578a565b60200260200101518152602001908152602001600020600090558060010190506130cb565b50600086815261019460205260408120805487929061315690849061586a565b909155506115c39050898583613d79565b6060838067ffffffffffffffff81111561318357613183614e47565b6040519080825280602002602001820160405280156131ac578160200160208202803683370190505b50915060008167ffffffffffffffff8111156131ca576131ca614e47565b6040519080825280602002602001820160405280156131f3578160200160208202803683370190505b50905060008267ffffffffffffffff81111561321157613211614e47565b60405190808252806020026020018201604052801561323a578160200160208202803683370190505b50905060005b8381101561333957600089898381811061325c5761325c61578a565b90506020020135905061326e8161455a565b61328b57604051631eb49d6d60e11b815260040160405180910390fd5b600081815261019560205260409020546132a490614023565b600081815261019560205260409020805460018082019092558201018888848181106132d2576132d261578a565b90506020020135610194600083815260200190815260200160002081905550808784815181106133045761330461578a565b60200260200101818152505060018584815181106133245761332461578a565b60209081029190910101525050600101613240565b506133558985846040518060200160405280600081525061415d565b7f088515a3c7b4e71520602d818f4dec002fadefde30c55e13f390c8d96046990a888883878a8a60405161338e96959493929190615971565b60405180910390a150505095945050505050565b6001600160a01b03841661341e5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161080c565b33600061342a85614742565b9050600061343785614742565b9050613447838989858589613820565b60008681526065602090815260408083206001600160a01b038c168452909152902054858110156134e05760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161080c565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061351f90849061586a565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461357f848a8a86868a613968565b6115c3848a8a8a8a8a61478d565b6001600160a01b03821633148015906135ad57506135ab8233610684565b155b156135e4576040517fe433766c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152610194602052604081208054919055613604838360016148e8565b7f5e65fcde72b913ac2870f9df6ea5b6bca757862f44636cb368ed5e339fc524fb6fffffffffffffffffffffffffffffffff198316604080519182526020820185905260009082015260608101839052608001612e46565b60008260000361367f57604051631eb49d6d60e11b815260040160405180910390fd5b61368a848484612c9c565b6000818152610195602052604081208054929350909182906136ab906157e8565b91829055506136ba908361586a565b9050836101946000838152602001908152602001600020819055506136f18582600160405180602001604052806000815250614590565b6040805183815260006020820152908101829052606081018590527f5e65fcde72b913ac2870f9df6ea5b6bca757862f44636cb368ed5e339fc524fb9060800160405180910390a1509392505050565b600081815260ca602052604081208054606092919061375f906159cd565b80601f016020809104026020016040519081016040528092919081815260200182805461378b906159cd565b80156137d85780601f106137ad576101008083540402835291602001916137d8565b820191906000526020600020905b8154815290600101906020018083116137bb57829003601f168201915b5050505050905060008151116137f6576137f183614ab9565b61093a565b60c98160405160200161380a929190615a20565b6040516020818303038152906040529392505050565b6001600160a01b03851615611427576001600160a01b0384161561142757825160005b8181101561395e5760006138808683815181106138625761386261578a565b60200260200101516fffffffffffffffffffffffffffffffff191690565b60008181526101ff602052604090205490915060ff1660018160028111156138aa576138aa615739565b036138e1576040517fab064ad300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028160028111156138f5576138f5615739565b14801561391d5750600082815261019360205260409020546001600160a01b038a8116911614155b15613954576040517fab064ad300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050600101613843565b5050505050505050565b825160005b8181101561395e5785610192600087848151811061398d5761398d61578a565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600101905061396d565b6001600160a01b0384163b15611427576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c8190613a2f9089908990889088908890600401615aa7565b6020604051808303816000875af1925050508015613a6a575060408051601f3d908101601f19168201909252613a6791810190615b05565b60015b613b1f57613a76615b22565b806308c379a003613aaf5750613a8a615b3d565b80613a955750613ab1565b8060405162461bcd60e51b815260040161080c9190614dcf565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e746572000000000000000000000000606482015260840161080c565b7fffffffff0000000000000000000000000000000000000000000000000000000081167fbc197c810000000000000000000000000000000000000000000000000000000014613bd65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e73000000000000000000000000000000000000000000000000606482015260840161080c565b50505050505050565b6001600160a01b0381163b613c5c5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161080c565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b613cbe83614b4d565b600082511180613ccb5750805b156111c3576111dc8383614b8d565b600081815b84811015613d1d57613d0982878784818110613cfd57613cfd61578a565b90506020020135614c8f565b915080613d15816157e8565b915050613cdf565b50949350505050565b6101cd5460ff16610ce05760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161080c565b6001600160a01b038316613df55760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161080c565b8051825114613e6c5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d61746368000000000000000000000000000000000000000000000000606482015260840161080c565b6000339050613e8f81856000868660405180602001604052806000815250613820565b60005b8351811015613fac576000848281518110613eaf57613eaf61578a565b602002602001015190506000848381518110613ecd57613ecd61578a565b60209081029190910181015160008481526065835260408082206001600160a01b038c168352909352919091205490915081811015613f735760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e636500000000000000000000000000000000000000000000000000000000606482015260840161080c565b60009283526065602090815260408085206001600160a01b038b1686529091529092209103905580613fa4816157e8565b915050613e92565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051613ffd92919061587d565b60405180910390a46111dc81856000868660405180602001604052806000815250613968565b806111c381615be5565b835160005b8181101561395e57600086828151811061404e5761404e61578a565b60200260200101519050600086838151811061406c5761406c61578a565b6020026020010151905061407f8261455a565b1561409d57604051631eb49d6d60e11b815260040160405180910390fd5b6fffffffffffffffffffffffffffffffff1981166fffffffffffffffffffffffffffffffff198316146140fc576040517fb4902a1300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038916331480159061411c575061411a8933610684565b155b15614153576040517fe433766c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050600101614032565b6001600160a01b0384166141d95760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161080c565b81518351146142505760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d61746368000000000000000000000000000000000000000000000000606482015260840161080c565b3361426081600087878787613820565b60005b84518110156142fc5783818151811061427e5761427e61578a565b60200260200101516065600087848151811061429c5761429c61578a565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546142e4919061586a565b909155508190506142f4816157e8565b915050614263565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161434d92919061587d565b60405180910390a461436481600087878787613968565b610b05816000878787876139d2565b600054610100900460ff166143de5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b6101cd805460ff19169055565b600054610100900460ff166144565760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b610ca681614cbe565b600054610100900460ff166144ca5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b60408051602081019091526000815260c990610ca69082615c5a565b600054610100900460ff166145515760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b610ce033612667565b60006fffffffffffffffffffffffffffffffff1982168214801561083a5750506fffffffffffffffffffffffffffffffff161590565b6001600160a01b03841661460c5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161080c565b33600061461885614742565b9050600061462585614742565b905061463683600089858589613820565b60008681526065602090815260408083206001600160a01b038b1684529091528120805487929061466890849061586a565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46146c883600089858589613968565b613bd68360008989898961478d565b608081901c6111c381615be5565b600082815260ca602052604090206146fd8282615c5a565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b61472984610923565b6040516147369190614dcf565b60405180910390a25050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061477c5761477c61578a565b602090810291909101015292915050565b6001600160a01b0384163b15611427576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906147ea9089908990889088908890600401615d1a565b6020604051808303816000875af1925050508015614825575060408051601f3d908101601f1916820190925261482291810190615b05565b60015b61483157613a76615b22565b7fffffffff0000000000000000000000000000000000000000000000000000000081167ff23a6e610000000000000000000000000000000000000000000000000000000014613bd65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e73000000000000000000000000000000000000000000000000606482015260840161080c565b6001600160a01b0383166149645760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161080c565b33600061497084614742565b9050600061497d84614742565b905061499d83876000858560405180602001604052806000815250613820565b60008581526065602090815260408083206001600160a01b038a16845290915290205484811015614a355760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e636500000000000000000000000000000000000000000000000000000000606482015260840161080c565b60008681526065602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4613bd684886000868660405180602001604052806000815250613968565b606060678054614ac8906159cd565b80601f0160208091040260200160405190810160405280929190818152602001828054614af4906159cd565b8015614b415780601f10614b1657610100808354040283529160200191614b41565b820191906000526020600020905b815481529060010190602001808311614b2457829003601f168201915b50505050509050919050565b614b5681613bdf565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b614c0c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161080c565b600080846001600160a01b031684604051614c279190615d52565b600060405180830381855af49150503d8060008114614c62576040519150601f19603f3d011682016040523d82523d6000602084013e614c67565b606091505b5091509150610cc78282604051806060016040528060278152602001615d6f60279139614cca565b6000818310614cab57600082815260208490526040902061093a565b600083815260208390526040902061093a565b60676110e78282615c5a565b60608315614cd957508161093a565b61093a8383815115613a955781518083602001fd5b80356001600160a01b0381168114614d0557600080fd5b919050565b60008060408385031215614d1d57600080fd5b614d2683614cee565b946020939093013593505050565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114610ca657600080fd5b600060208284031215614d7457600080fd5b813561093a81614d34565b60005b83811015614d9a578181015183820152602001614d82565b50506000910152565b60008151808452614dbb816020860160208601614d7f565b601f01601f19169290920160200192915050565b60208152600061093a6020830184614da3565b600060208284031215614df457600080fd5b5035919050565b60008083601f840112614e0d57600080fd5b50813567ffffffffffffffff811115614e2557600080fd5b6020830191508360208260051b8501011115614e4057600080fd5b9250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715614e9c57614e9c614e47565b6040525050565b600082601f830112614eb457600080fd5b813567ffffffffffffffff811115614ece57614ece614e47565b604051614ee56020601f19601f8501160182614e76565b818152846020838601011115614efa57600080fd5b816020850160208301376000918101602001919091529392505050565b803560038110614d0557600080fd5b60008060008060008060a08789031215614f3f57600080fd5b614f4887614cee565b955060208701359450604087013567ffffffffffffffff80821115614f6c57600080fd5b614f788a838b01614dfb565b90965094506060890135915080821115614f9157600080fd5b50614f9e89828a01614ea3565b925050614fad60808801614f17565b90509295509295509295565b600067ffffffffffffffff821115614fd357614fd3614e47565b5060051b60200190565b600082601f830112614fee57600080fd5b81356020614ffb82614fb9565b6040516150088282614e76565b83815260059390931b850182019282810191508684111561502857600080fd5b8286015b84811015615043578035835291830191830161502c565b509695505050505050565b600080600080600060a0868803121561506657600080fd5b61506f86614cee565b945061507d60208701614cee565b9350604086013567ffffffffffffffff8082111561509a57600080fd5b6150a689838a01614fdd565b945060608801359150808211156150bc57600080fd5b6150c889838a01614fdd565b935060808801359150808211156150de57600080fd5b506150eb88828901614ea3565b9150509295509295909350565b60006020828403121561510a57600080fd5b61093a82614cee565b6000806000806060858703121561512957600080fd5b843567ffffffffffffffff81111561514057600080fd5b61514c87828801614dfb565b90989097506020870135966040013595509350505050565b6000806040838503121561517757600080fd5b823567ffffffffffffffff8082111561518f57600080fd5b818501915085601f8301126151a357600080fd5b813560206151b082614fb9565b6040516151bd8282614e76565b83815260059390931b85018201928281019150898411156151dd57600080fd5b948201945b83861015615202576151f386614cee565b825294820194908201906151e2565b9650508601359250508082111561521857600080fd5b5061522585828601614fdd565b9150509250929050565b600081518084526020808501945080840160005b8381101561525f57815187529582019590820190600101615243565b509495945050505050565b60208152600061093a602083018461522f565b6000806040838503121561529057600080fd5b61529983614cee565b9150602083013567ffffffffffffffff8111156152b557600080fd5b61522585828601614ea3565b6000806000606084860312156152d657600080fd5b6152df84614cee565b9250602084013567ffffffffffffffff808211156152fc57600080fd5b61530887838801614fdd565b9350604086013591508082111561531e57600080fd5b5061532b86828701614fdd565b9150509250925092565b6000806000806060858703121561534b57600080fd5b61535485614cee565b935060208501359250604085013567ffffffffffffffff81111561537757600080fd5b61538387828801614dfb565b95989497509550505050565b6000806000806000608086880312156153a757600080fd5b6153b086614cee565b9450602086013567ffffffffffffffff8111156153cc57600080fd5b6153d888828901614dfb565b9699909850959660408101359660609091013595509350505050565b6000806040838503121561540757600080fd5b50508035926020909101359150565b6000806040838503121561542957600080fd5b61543283614cee565b91506020830135801515811461544757600080fd5b809150509250929050565b600080600080600060a0868803121561546a57600080fd5b61547386614cee565b94506020860135935060408601359250606086013567ffffffffffffffff81111561549d57600080fd5b6154a988828901614ea3565b9250506154b860808701614f17565b90509295509295909350565b6000806000604084860312156154d957600080fd5b6154e284614cee565b9250602084013567ffffffffffffffff8111156154fe57600080fd5b61550a86828701614dfb565b9497909650939450505050565b6000806040838503121561552a57600080fd5b61553383614cee565b915061554160208401614cee565b90509250929050565b6000806040838503121561555d57600080fd5b61556683614cee565b9150602083013567ffffffffffffffff81111561558257600080fd5b61522585828601614fdd565b60008060008060008060006080888a0312156155a957600080fd5b6155b288614cee565b9650602088013567ffffffffffffffff808211156155cf57600080fd5b6155db8b838c01614dfb565b909850965060408a01359150808211156155f457600080fd5b6156008b838c01614dfb565b909650945060608a013591508082111561561957600080fd5b506156268a828b01614dfb565b989b979a50959850939692959293505050565b600080600080600060a0868803121561565157600080fd5b61565a86614cee565b945061566860208701614cee565b93506040860135925060608601359150608086013567ffffffffffffffff81111561569257600080fd5b6150eb88828901614ea3565b6000806000606084860312156156b357600080fd5b6156bc84614cee565b95602085013595506040909401359392505050565b600080600080608085870312156156e757600080fd5b6156f085614cee565b935060208501359250604085013567ffffffffffffffff81111561571357600080fd5b61571f87828801614ea3565b92505061572e60608601614f17565b905092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60408152600061577b6040830185614da3565b90508260208301529392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600060001982036157fb576157fb6157b9565b5060010190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261583757600080fd5b83018035915067ffffffffffffffff82111561585257600080fd5b6020019150600581901b3603821315614e4057600080fd5b8082018082111561083a5761083a6157b9565b604081526000615890604083018561522f565b8281036020840152610cc7818561522f565b6000602082840312156158b457600080fd5b5051919050565b6080815260006158ce608083018761522f565b82810360208401526158e0818761522f565b905082810360408401526158f4818661522f565b90508281036060840152615908818561522f565b979650505050505050565b8181038181111561083a5761083a6157b9565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561595857600080fd5b8260051b80836020870137939093016020019392505050565b60808152600061598560808301888a615926565b8281036020840152615997818861522f565b905082810360408401526159ab818761522f565b905082810360608401526159c0818587615926565b9998505050505050505050565b600181811c908216806159e157607f821691505b602082108103615a1a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b6000808454615a2e816159cd565b60018281168015615a465760018114615a5b57615a8a565b60ff1984168752821515830287019450615a8a565b8860005260208060002060005b85811015615a815781548a820152908401908201615a68565b50505082870194505b505050508351615a9e818360208801614d7f565b01949350505050565b60006001600160a01b03808816835280871660208401525060a06040830152615ad360a083018661522f565b8281036060840152615ae5818661522f565b90508281036080840152615af98185614da3565b98975050505050505050565b600060208284031215615b1757600080fd5b815161093a81614d34565b600060033d11156111ae5760046000803e5060005160e01c90565b600060443d1015615b4b5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715615b9957505050505090565b8285019150815181811115615bb15750505050505090565b843d8701016020828501011115615bcb5750505050505090565b615bda60208286010187614e76565b509095945050505050565b60006fffffffffffffffffffffffffffffffff808316818103615c0a57615c0a6157b9565b6001019392505050565b601f8211156111c357600081815260208120601f850160051c81016020861015615c3b5750805b601f850160051c820191505b8181101561142757828155600101615c47565b815167ffffffffffffffff811115615c7457615c74614e47565b615c8881615c8284546159cd565b84615c14565b602080601f831160018114615cbd5760008415615ca55750858301515b600019600386901b1c1916600185901b178555611427565b600085815260208120601f198616915b82811015615cec57888601518255948401946001909101908401615ccd565b5085821015615d0a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261590860a0830184614da3565b60008251615d64818460208701614d7f565b919091019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204c37f0793ff8af27d30569e38fca163a67b4a79dd8f7dad4b36c16831acb84e764736f6c63430008110033", + "deployedBytecode": "0x6080604052600436106102695760003560e01c8063715018a611610153578063b316962f116100cb578063f242432a1161007f578063f5298aca11610064578063f5298aca14610732578063f6b1229314610752578063fda4823c1461077257600080fd5b8063f242432a146106f2578063f2fde38b1461071257600080fd5b8063e985e9c5116100b0578063e985e9c514610669578063eb568a14146106b2578063f1169062146106d257600080fd5b8063b316962f14610629578063c7b26c541461064957600080fd5b80638fc202dd1161012257806399f771a71161010757806399f771a7146105ad578063a21ed980146105cd578063a22cb4651461060957600080fd5b80638fc202dd14610578578063993de1841461058d57600080fd5b8063715018a61461051b5780638129fc1c146105305780638456cb59146105455780638da5cb5b1461055a57600080fd5b80633f4ba83a116101e657806352d1902d116101b55780636352211e1161019a5780636352211e1461048c5780636b20c454146104db5780636ebd893f146104fb57600080fd5b806352d1902d1461045e5780635c975abb1461047357600080fd5b80633f4ba83a146103e95780633f71e944146103fe5780634e1273f41461041e5780634f1ef2861461044b57600080fd5b80631a2e98241161023d5780632eb2c2d6116102225780632eb2c2d6146103895780633659cfe6146103a95780633e11eefe146103c957600080fd5b80631a2e9824146103475780631e75a8b51461036757600080fd5b8062fdd58e1461026e57806301ffc9a7146102a157806306fdde03146102d15780630e89341c14610327575b600080fd5b34801561027a57600080fd5b5061028e610289366004614d0a565b610792565b6040519081526020015b60405180910390f35b3480156102ad57600080fd5b506102c16102bc366004614d62565b610840565b6040519015158152602001610298565b3480156102dd57600080fd5b5061031a6040518060400160405280600f81526020017f4879706572636572744d696e746572000000000000000000000000000000000081525081565b6040516102989190614dcf565b34801561033357600080fd5b5061031a610342366004614de2565b610923565b34801561035357600080fd5b5061028e610362366004614d0a565b61092e565b34801561037357600080fd5b50610387610382366004614f26565b610941565b005b34801561039557600080fd5b506103876103a436600461504e565b610a6a565b3480156103b557600080fd5b506103876103c43660046150f8565b610b0c565b3480156103d557600080fd5b506102c16103e4366004615113565b610ca9565b3480156103f557600080fd5b50610387610cd0565b34801561040a57600080fd5b5061031a610419366004614de2565b610ce2565b34801561042a57600080fd5b5061043e610439366004615164565b610e1f565b604051610298919061526a565b61038761045936600461527d565b610f5d565b34801561046a57600080fd5b5061028e6110eb565b34801561047f57600080fd5b506101cd5460ff166102c1565b34801561049857600080fd5b506104c36104a7366004614de2565b600090815261019260205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610298565b3480156104e757600080fd5b506103876104f63660046152c1565b6111b1565b34801561050757600080fd5b50610387610516366004615335565b6111c8565b34801561052757600080fd5b506103876111e2565b34801561053c57600080fd5b506103876111f4565b34801561055157600080fd5b50610387611355565b34801561056657600080fd5b5060fb546001600160a01b03166104c3565b34801561058457600080fd5b50610387611365565b34801561059957600080fd5b506103876105a836600461538f565b611408565b3480156105b957600080fd5b5061028e6105c8366004614de2565b61142f565b3480156105d957600080fd5b506102c16105e83660046153f4565b6101b060209081526000928352604080842090915290825290205460ff1681565b34801561061557600080fd5b50610387610624366004615416565b611444565b34801561063557600080fd5b50610387610644366004615452565b61144f565b34801561065557600080fd5b506103876106643660046154c4565b6114e4565b34801561067557600080fd5b506102c1610684366004615517565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b3480156106be57600080fd5b506103876106cd36600461554a565b611529565b3480156106de57600080fd5b506103876106ed36600461558e565b61153b565b3480156106fe57600080fd5b5061038761070d366004615639565b6115ce565b34801561071e57600080fd5b5061038761072d3660046150f8565b611669565b34801561073e57600080fd5b5061038761074d36600461569e565b6116f6565b34801561075e57600080fd5b5061038761076d366004614d0a565b611708565b34801561077e57600080fd5b5061038761078d3660046156d1565b61171a565b60006001600160a01b0383166108155760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e65720000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fd9b67a260000000000000000000000000000000000000000000000000000000014806108d357507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061083a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461083a565b606061083a826117cc565b600061093a83836117ea565b9392505050565b610949611822565b336001600160a01b0387161461097257604051631eb49d6d60e11b815260040160405180910390fd5b846109af85858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061187692505050565b146109e6576040517f6dac6a0900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006109f4878686866118f5565b60008181526101ff602052604090208054919250839160ff19166001836002811115610a2257610a22615739565b0217905550807f19789dde2d660b739733377add05f87576a360d2d4adea587c2592264f7f6d4e8488604051610a59929190615768565b60405180910390a250505050505050565b6001600160a01b038516331480610a865750610a868533610684565b610af85760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f766564000000000000000000000000000000000000606482015260840161080c565b610b05858585858561196f565b5050505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610baa5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c0000000000000000000000000000000000000000606482015260840161080c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c057f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614610c815760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f78790000000000000000000000000000000000000000606482015260840161080c565b610c8a81611c24565b60408051600080825260208201909252610ca691839190611c2c565b50565b60008281526101af6020526040812054610cc7908690869085611dcc565b95945050505050565b610cd8611de4565b610ce0611e3e565b565b6fffffffffffffffffffffffffffffffff19811660009081526101ff602052604081205460609160ff90911690816002811115610d2157610d21615739565b03610d6157505060408051808201909152600881527f416c6c6f77416c6c0000000000000000000000000000000000000000000000006020820152919050565b6001816002811115610d7557610d75615739565b03610db557505060408051808201909152600b81527f446973616c6c6f77416c6c0000000000000000000000000000000000000000006020820152919050565b6002816002811115610dc957610dc9615739565b03610e0957505060408051808201909152600f81527f46726f6d43726561746f724f6e6c7900000000000000000000000000000000006020820152919050565b5050604080516020810190915260008152919050565b60608151835114610e985760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d617463680000000000000000000000000000000000000000000000606482015260840161080c565b6000835167ffffffffffffffff811115610eb457610eb4614e47565b604051908082528060200260200182016040528015610edd578160200160208202803683370190505b50905060005b8451811015610f5557610f28858281518110610f0157610f0161578a565b6020026020010151858381518110610f1b57610f1b61578a565b6020026020010151610792565b828281518110610f3a57610f3a61578a565b6020908102919091010152610f4e816157e8565b9050610ee3565b509392505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610ffb5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c0000000000000000000000000000000000000000606482015260840161080c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166110567f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b0316146110d25760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f78790000000000000000000000000000000000000000606482015260840161080c565b6110db82611c24565b6110e782826001611c2c565b5050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461118b5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000606482015260840161080c565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b90565b6111b9611822565b6111c38383611e91565b505050565b6111d0611822565b6111dc8484848461211f565b50505050565b6111ea611de4565b610ce06000612667565b600054610100900460ff16158080156112145750600054600160ff909116105b8061122e5750303b15801561122e575060005460ff166001145b6112a05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161080c565b6000805460ff1916600117905580156112e057600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6112e8611365565b6112f06126d1565b8015610ca657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b61135d611de4565b610ce0612744565b600054610100900460ff166113d05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b6113e860405180602001604052806000815250612782565b6113f06127f6565b6113f8612861565b6114006128d4565b610ce06127f6565b611410611822565b61141c84848484612947565b611427858383612ad0565b505050505050565b6000818152610194602052604081205461083a565b6110e7338383612ba8565b611457611822565b6000611464868685612c9c565b9050611471818587612d6d565b60008181526101ff60205260409020805483919060ff1916600183600281111561149d5761149d615739565b0217905550807f19789dde2d660b739733377add05f87576a360d2d4adea587c2592264f7f6d4e84876040516114d4929190615768565b60405180910390a2505050505050565b6114ec611822565b6111c383838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612e5392505050565b611531611822565b6110e78282611e91565b611543611822565b8260005b818110156115b5576115ad8888838181106115645761156461578a565b90506020028101906115769190615802565b8888858181106115885761158861578a565b905060200201358787868181106115a1576115a161578a565b90506020020135612947565b600101611547565b506115c38886868686613167565b505050505050505050565b6001600160a01b0385163314806115ea57506115ea8533610684565b61165c5760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f766564000000000000000000000000000000000000606482015260840161080c565b610b0585858585856133a2565b611671611de4565b6001600160a01b0381166116ed5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161080c565b610ca681612667565b6116fe611822565b6111c3838361358d565b611710611822565b6110e7828261358d565b611722611822565b336001600160a01b0385161461174b57604051631eb49d6d60e11b815260040160405180910390fd5b600061175885858561365c565b60008181526101ff602052604090208054919250839160ff1916600183600281111561178657611786615739565b0217905550807f19789dde2d660b739733377add05f87576a360d2d4adea587c2592264f7f6d4e84866040516117bd929190615768565b60405180910390a25050505050565b606061083a6fffffffffffffffffffffffffffffffff198316613741565b600081815261019260205260408120546001600160a01b0384811691160361083a575060009081526101946020526040902054919050565b6101cd5460ff1615610ce05760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161080c565b8051600090815b818110156118ee578381815181106118975761189761578a565b60200260200101516000036118bf57604051631eb49d6d60e11b815260040160405180910390fd5b8381815181106118d1576118d161578a565b6020026020010151836118e4919061586a565b925060010161187d565b5050919050565b600061193d8561193786868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061187692505050565b8461365c565b60008181526101956020526040902054909150611967908690611960908461586a565b868661211f565b949350505050565b81518351146119e65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d61746368000000000000000000000000000000000000000000000000606482015260840161080c565b6001600160a01b038416611a625760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161080c565b33611a71818787878787613820565b60005b8451811015611bb0576000858281518110611a9157611a9161578a565b602002602001015190506000858381518110611aaf57611aaf61578a565b60209081029190910181015160008481526065835260408082206001600160a01b038e168352909352919091205490915081811015611b565760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161080c565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611b9590849061586a565b9250508190555050505080611ba9906157e8565b9050611a74565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611c0092919061587d565b60405180910390a4611c16818787878787613968565b6114278187878787876139d2565b610ca6611de4565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611c5f576111c383613bdf565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611cb9575060408051601f3d908101601f19168201909252611cb6918101906158a2565b60015b611d2b5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f742055555053000000000000000000000000000000000000606482015260840161080c565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114611dc05760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c65555549440000000000000000000000000000000000000000000000606482015260840161080c565b506111c3838383613cb5565b600082611dda868685613cda565b1495945050505050565b60fb546001600160a01b03163314610ce05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161080c565b611e46613d26565b6101cd805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382163314801590611eb15750611eaf8233610684565b155b15611ee8576040517fe433766c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805160008167ffffffffffffffff811115611f0557611f05614e47565b604051908082528060200260200182016040528015611f2e578160200160208202803683370190505b50905060008267ffffffffffffffff811115611f4c57611f4c614e47565b604051908082528060200260200182016040528015611f75578160200160208202803683370190505b50905060008367ffffffffffffffff811115611f9357611f93614e47565b604051908082528060200260200182016040528015611fbc578160200160208202803683370190505b50905060008467ffffffffffffffff811115611fda57611fda614e47565b604051908082528060200260200182016040528015612003578160200160208202803683370190505b50905060005b858110156120cd5760008782815181106120255761202561578a565b602090810291909101810151600081815261019490925260408220805492905591506fffffffffffffffffffffffffffffffff19821687848151811061206d5761206d61578a565b6020026020010181815250508085848151811061208c5761208c61578a565b60200260200101818152505060018484815181106120ac576120ac61578a565b602002602001018181525050505080806120c5906157e8565b915050612009565b506120d9878783613d79565b7f088515a3c7b4e71520602d818f4dec002fadefde30c55e13f390c8d96046990a8487858560405161210e94939291906158bb565b60405180910390a150505050505050565b60fd81118061212e5750600281105b15612165576040517f3ada02e500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6121a182828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061187692505050565b60008481526101946020526040902054146121cf57604051631eb49d6d60e11b815260040160405180910390fd5b600083815261019460205260408120546fffffffffffffffffffffffffffffffff198516916121ff600185615913565b905060008167ffffffffffffffff81111561221c5761221c614e47565b604051908082528060200260200182016040528015612245578160200160208202803683370190505b50905060008267ffffffffffffffff81111561226357612263614e47565b60405190808252806020026020018201604052801561228c578160200160208202803683370190505b50905060008367ffffffffffffffff8111156122aa576122aa614e47565b6040519080825280602002602001820160405280156122d3578160200160208202803683370190505b50905060008467ffffffffffffffff8111156122f1576122f1614e47565b60405190808252806020026020018201604052801561231a578160200160208202803683370190505b50905060008567ffffffffffffffff81111561233857612338614e47565b604051908082528060200260200182016040528015612361578160200160208202803683370190505b50905060008a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508451949550938593508b9250821090506123b1576123b161578a565b60200260200101519050816000815181106123ce576123ce61578a565b60200260200101518289815181106123e8576123e861578a565b60200260200101818152505080826000815181106124085761240861578a565b60200260200101818152505060005b888110156125235760008b8152610195602052604090205461243890614023565b8a88828151811061244b5761244b61578a565b6020026020010181815250508d87828151811061246a5761246a61578a565b60200260200101818152505061019560008c815260200190815260200160002060008154612497906157e8565b91829055506124a6908c61586a565b8682815181106124b8576124b861578a565b60200260200101818152505060018582815181106124d8576124d861578a565b6020026020010181815250508281815181106124f6576124f661578a565b60200260200101518482815181106125105761251061578a565b6020908102919091010152600101612417565b5050506125656125303390565b60008d8152610192602090815260408083205481519283019091529181526001600160a01b039091169087908790869061402d565b60005b868110156125ed578181815181106125825761258261578a565b6020026020010151886125959190615913565b97508181815181106125a9576125a961578a565b602002602001015161019460008684815181106125c8576125c861578a565b6020026020010151815260200190815260200160002081905550806001019050612568565b5060008b8152610194602090815260408083208a90558051918201905290815261261c908d908590859061415d565b7f088515a3c7b4e71520602d818f4dec002fadefde30c55e13f390c8d96046990a8585858460405161265194939291906158bb565b60405180910390a1505050505050505050505050565b60fb80546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661273c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b610ce0614373565b61274c611822565b6101cd805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611e743390565b600054610100900460ff166127ed5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b610ca6816143eb565b600054610100900460ff16610ce05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b600054610100900460ff166128cc5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b610ce061445f565b600054610100900460ff1661293f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b610ce06144e6565b60008281526101af60209081526040805133818401528082018590528151808203830181526060820183528051908401206080808301919091528251808303909101815260a090910182528051908301208584526101b083528184208185529092529091205460ff16156129e7576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526101af6020526040902054612a05908690869084611dcc565b1580612a36575060008381526101b160209081526040808320546101b290925290912054612a3490849061586a565b115b15612a6d576040517f6dac6a0900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526101b060209081526040808320848452825291829020805460ff1916600117905581518581529081018390527f51483c8cc684284e9ba3215822230838b766f1698bcc7e922a31e02c3c203bd7910160405180910390a15050505050565b6000612adb8361455a565b612af857604051631eb49d6d60e11b815260040160405180910390fd5b60008381526101956020526040902054612b1190614023565b5060008281526101956020908152604080832080546001808201909255860181018085526101948452828520869055825193840190925292825291612b599186918491614590565b6040805184815260006020820152908101829052606081018390527f5e65fcde72b913ac2870f9df6ea5b6bca757862f44636cb368ed5e339fc524fb9060800160405180910390a19392505050565b816001600160a01b0316836001600160a01b031603612c2f5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c660000000000000000000000000000000000000000000000606482015260840161080c565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000612caa610191546146d7565b608061019160008154612cbc906157e8565b9182905550901b60008181526101936020908152604080832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b038a1617905561019490915290208490559050612d1d81836146e5565b604080518281526000602082018190529182916001600160a01b038816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a49392505050565b811580612d78575080155b15612daf576040517f6dac6a0900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526101af602052604090205415612df6576040517f357d0cc400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526101af602090815260408083208590556101b182529182902083905581518581529081018490527f233c854c30aaaad173f2dd900c76d53c64e556d1d009d71466ec1afcb7b5844d91015b60405180910390a1505050565b60fd81511180612e64575060028151105b15612e9b576040517f3ada02e500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060018251612eab9190615913565b90506000828281518110612ec157612ec161578a565b602002602001015190506000808367ffffffffffffffff811115612ee757612ee7614e47565b604051908082528060200260200182016040528015612f10578160200160208202803683370190505b50905060008467ffffffffffffffff811115612f2e57612f2e614e47565b604051908082528060200260200182016040528015612f57578160200160208202803683370190505b50905060008567ffffffffffffffff811115612f7557612f75614e47565b604051908082528060200260200182016040528015612f9e578160200160208202803683370190505b50905060008667ffffffffffffffff811115612fbc57612fbc614e47565b604051908082528060200260200182016040528015612fe5578160200160208202803683370190505b50905060005b878110156130aa5760008982815181106130075761300761578a565b60200260200101519050808683815181106130245761302461578a565b602002602001018181525050878583815181106130435761304361578a565b60200260200101818152505060018383815181106130635761306361578a565b6020026020010181815250506101946000828152602001908152602001600020548483815181106130965761309661578a565b602090810291909101015250600101612feb565b506130c8338a8686866040518060200160405280600081525061402d565b60005b87811015613136578281815181106130e5576130e561578a565b6020026020010151866130f8919061586a565b955061019460008683815181106131115761311161578a565b60200260200101518152602001908152602001600020600090558060010190506130cb565b50600086815261019460205260408120805487929061315690849061586a565b909155506115c39050898583613d79565b6060838067ffffffffffffffff81111561318357613183614e47565b6040519080825280602002602001820160405280156131ac578160200160208202803683370190505b50915060008167ffffffffffffffff8111156131ca576131ca614e47565b6040519080825280602002602001820160405280156131f3578160200160208202803683370190505b50905060008267ffffffffffffffff81111561321157613211614e47565b60405190808252806020026020018201604052801561323a578160200160208202803683370190505b50905060005b8381101561333957600089898381811061325c5761325c61578a565b90506020020135905061326e8161455a565b61328b57604051631eb49d6d60e11b815260040160405180910390fd5b600081815261019560205260409020546132a490614023565b600081815261019560205260409020805460018082019092558201018888848181106132d2576132d261578a565b90506020020135610194600083815260200190815260200160002081905550808784815181106133045761330461578a565b60200260200101818152505060018584815181106133245761332461578a565b60209081029190910101525050600101613240565b506133558985846040518060200160405280600081525061415d565b7f088515a3c7b4e71520602d818f4dec002fadefde30c55e13f390c8d96046990a888883878a8a60405161338e96959493929190615971565b60405180910390a150505095945050505050565b6001600160a01b03841661341e5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161080c565b33600061342a85614742565b9050600061343785614742565b9050613447838989858589613820565b60008681526065602090815260408083206001600160a01b038c168452909152902054858110156134e05760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161080c565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061351f90849061586a565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461357f848a8a86868a613968565b6115c3848a8a8a8a8a61478d565b6001600160a01b03821633148015906135ad57506135ab8233610684565b155b156135e4576040517fe433766c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152610194602052604081208054919055613604838360016148e8565b7f5e65fcde72b913ac2870f9df6ea5b6bca757862f44636cb368ed5e339fc524fb6fffffffffffffffffffffffffffffffff198316604080519182526020820185905260009082015260608101839052608001612e46565b60008260000361367f57604051631eb49d6d60e11b815260040160405180910390fd5b61368a848484612c9c565b6000818152610195602052604081208054929350909182906136ab906157e8565b91829055506136ba908361586a565b9050836101946000838152602001908152602001600020819055506136f18582600160405180602001604052806000815250614590565b6040805183815260006020820152908101829052606081018590527f5e65fcde72b913ac2870f9df6ea5b6bca757862f44636cb368ed5e339fc524fb9060800160405180910390a1509392505050565b600081815260ca602052604081208054606092919061375f906159cd565b80601f016020809104026020016040519081016040528092919081815260200182805461378b906159cd565b80156137d85780601f106137ad576101008083540402835291602001916137d8565b820191906000526020600020905b8154815290600101906020018083116137bb57829003601f168201915b5050505050905060008151116137f6576137f183614ab9565b61093a565b60c98160405160200161380a929190615a20565b6040516020818303038152906040529392505050565b6001600160a01b03851615611427576001600160a01b0384161561142757825160005b8181101561395e5760006138808683815181106138625761386261578a565b60200260200101516fffffffffffffffffffffffffffffffff191690565b60008181526101ff602052604090205490915060ff1660018160028111156138aa576138aa615739565b036138e1576040517fab064ad300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028160028111156138f5576138f5615739565b14801561391d5750600082815261019360205260409020546001600160a01b038a8116911614155b15613954576040517fab064ad300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050600101613843565b5050505050505050565b825160005b8181101561395e5785610192600087848151811061398d5761398d61578a565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600101905061396d565b6001600160a01b0384163b15611427576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c8190613a2f9089908990889088908890600401615aa7565b6020604051808303816000875af1925050508015613a6a575060408051601f3d908101601f19168201909252613a6791810190615b05565b60015b613b1f57613a76615b22565b806308c379a003613aaf5750613a8a615b3d565b80613a955750613ab1565b8060405162461bcd60e51b815260040161080c9190614dcf565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e746572000000000000000000000000606482015260840161080c565b7fffffffff0000000000000000000000000000000000000000000000000000000081167fbc197c810000000000000000000000000000000000000000000000000000000014613bd65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e73000000000000000000000000000000000000000000000000606482015260840161080c565b50505050505050565b6001600160a01b0381163b613c5c5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161080c565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b613cbe83614b4d565b600082511180613ccb5750805b156111c3576111dc8383614b8d565b600081815b84811015613d1d57613d0982878784818110613cfd57613cfd61578a565b90506020020135614c8f565b915080613d15816157e8565b915050613cdf565b50949350505050565b6101cd5460ff16610ce05760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161080c565b6001600160a01b038316613df55760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161080c565b8051825114613e6c5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d61746368000000000000000000000000000000000000000000000000606482015260840161080c565b6000339050613e8f81856000868660405180602001604052806000815250613820565b60005b8351811015613fac576000848281518110613eaf57613eaf61578a565b602002602001015190506000848381518110613ecd57613ecd61578a565b60209081029190910181015160008481526065835260408082206001600160a01b038c168352909352919091205490915081811015613f735760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e636500000000000000000000000000000000000000000000000000000000606482015260840161080c565b60009283526065602090815260408085206001600160a01b038b1686529091529092209103905580613fa4816157e8565b915050613e92565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051613ffd92919061587d565b60405180910390a46111dc81856000868660405180602001604052806000815250613968565b806111c381615be5565b835160005b8181101561395e57600086828151811061404e5761404e61578a565b60200260200101519050600086838151811061406c5761406c61578a565b6020026020010151905061407f8261455a565b1561409d57604051631eb49d6d60e11b815260040160405180910390fd5b6fffffffffffffffffffffffffffffffff1981166fffffffffffffffffffffffffffffffff198316146140fc576040517fb4902a1300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038916331480159061411c575061411a8933610684565b155b15614153576040517fe433766c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050600101614032565b6001600160a01b0384166141d95760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161080c565b81518351146142505760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d61746368000000000000000000000000000000000000000000000000606482015260840161080c565b3361426081600087878787613820565b60005b84518110156142fc5783818151811061427e5761427e61578a565b60200260200101516065600087848151811061429c5761429c61578a565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546142e4919061586a565b909155508190506142f4816157e8565b915050614263565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161434d92919061587d565b60405180910390a461436481600087878787613968565b610b05816000878787876139d2565b600054610100900460ff166143de5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b6101cd805460ff19169055565b600054610100900460ff166144565760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b610ca681614cbe565b600054610100900460ff166144ca5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b60408051602081019091526000815260c990610ca69082615c5a565b600054610100900460ff166145515760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161080c565b610ce033612667565b60006fffffffffffffffffffffffffffffffff1982168214801561083a5750506fffffffffffffffffffffffffffffffff161590565b6001600160a01b03841661460c5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161080c565b33600061461885614742565b9050600061462585614742565b905061463683600089858589613820565b60008681526065602090815260408083206001600160a01b038b1684529091528120805487929061466890849061586a565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46146c883600089858589613968565b613bd68360008989898961478d565b608081901c6111c381615be5565b600082815260ca602052604090206146fd8282615c5a565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b61472984610923565b6040516147369190614dcf565b60405180910390a25050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061477c5761477c61578a565b602090810291909101015292915050565b6001600160a01b0384163b15611427576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906147ea9089908990889088908890600401615d1a565b6020604051808303816000875af1925050508015614825575060408051601f3d908101601f1916820190925261482291810190615b05565b60015b61483157613a76615b22565b7fffffffff0000000000000000000000000000000000000000000000000000000081167ff23a6e610000000000000000000000000000000000000000000000000000000014613bd65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e73000000000000000000000000000000000000000000000000606482015260840161080c565b6001600160a01b0383166149645760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161080c565b33600061497084614742565b9050600061497d84614742565b905061499d83876000858560405180602001604052806000815250613820565b60008581526065602090815260408083206001600160a01b038a16845290915290205484811015614a355760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e636500000000000000000000000000000000000000000000000000000000606482015260840161080c565b60008681526065602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4613bd684886000868660405180602001604052806000815250613968565b606060678054614ac8906159cd565b80601f0160208091040260200160405190810160405280929190818152602001828054614af4906159cd565b8015614b415780601f10614b1657610100808354040283529160200191614b41565b820191906000526020600020905b815481529060010190602001808311614b2457829003601f168201915b50505050509050919050565b614b5681613bdf565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b614c0c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161080c565b600080846001600160a01b031684604051614c279190615d52565b600060405180830381855af49150503d8060008114614c62576040519150601f19603f3d011682016040523d82523d6000602084013e614c67565b606091505b5091509150610cc78282604051806060016040528060278152602001615d6f60279139614cca565b6000818310614cab57600082815260208490526040902061093a565b600083815260208390526040902061093a565b60676110e78282615c5a565b60608315614cd957508161093a565b61093a8383815115613a955781518083602001fd5b80356001600160a01b0381168114614d0557600080fd5b919050565b60008060408385031215614d1d57600080fd5b614d2683614cee565b946020939093013593505050565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114610ca657600080fd5b600060208284031215614d7457600080fd5b813561093a81614d34565b60005b83811015614d9a578181015183820152602001614d82565b50506000910152565b60008151808452614dbb816020860160208601614d7f565b601f01601f19169290920160200192915050565b60208152600061093a6020830184614da3565b600060208284031215614df457600080fd5b5035919050565b60008083601f840112614e0d57600080fd5b50813567ffffffffffffffff811115614e2557600080fd5b6020830191508360208260051b8501011115614e4057600080fd5b9250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715614e9c57614e9c614e47565b6040525050565b600082601f830112614eb457600080fd5b813567ffffffffffffffff811115614ece57614ece614e47565b604051614ee56020601f19601f8501160182614e76565b818152846020838601011115614efa57600080fd5b816020850160208301376000918101602001919091529392505050565b803560038110614d0557600080fd5b60008060008060008060a08789031215614f3f57600080fd5b614f4887614cee565b955060208701359450604087013567ffffffffffffffff80821115614f6c57600080fd5b614f788a838b01614dfb565b90965094506060890135915080821115614f9157600080fd5b50614f9e89828a01614ea3565b925050614fad60808801614f17565b90509295509295509295565b600067ffffffffffffffff821115614fd357614fd3614e47565b5060051b60200190565b600082601f830112614fee57600080fd5b81356020614ffb82614fb9565b6040516150088282614e76565b83815260059390931b850182019282810191508684111561502857600080fd5b8286015b84811015615043578035835291830191830161502c565b509695505050505050565b600080600080600060a0868803121561506657600080fd5b61506f86614cee565b945061507d60208701614cee565b9350604086013567ffffffffffffffff8082111561509a57600080fd5b6150a689838a01614fdd565b945060608801359150808211156150bc57600080fd5b6150c889838a01614fdd565b935060808801359150808211156150de57600080fd5b506150eb88828901614ea3565b9150509295509295909350565b60006020828403121561510a57600080fd5b61093a82614cee565b6000806000806060858703121561512957600080fd5b843567ffffffffffffffff81111561514057600080fd5b61514c87828801614dfb565b90989097506020870135966040013595509350505050565b6000806040838503121561517757600080fd5b823567ffffffffffffffff8082111561518f57600080fd5b818501915085601f8301126151a357600080fd5b813560206151b082614fb9565b6040516151bd8282614e76565b83815260059390931b85018201928281019150898411156151dd57600080fd5b948201945b83861015615202576151f386614cee565b825294820194908201906151e2565b9650508601359250508082111561521857600080fd5b5061522585828601614fdd565b9150509250929050565b600081518084526020808501945080840160005b8381101561525f57815187529582019590820190600101615243565b509495945050505050565b60208152600061093a602083018461522f565b6000806040838503121561529057600080fd5b61529983614cee565b9150602083013567ffffffffffffffff8111156152b557600080fd5b61522585828601614ea3565b6000806000606084860312156152d657600080fd5b6152df84614cee565b9250602084013567ffffffffffffffff808211156152fc57600080fd5b61530887838801614fdd565b9350604086013591508082111561531e57600080fd5b5061532b86828701614fdd565b9150509250925092565b6000806000806060858703121561534b57600080fd5b61535485614cee565b935060208501359250604085013567ffffffffffffffff81111561537757600080fd5b61538387828801614dfb565b95989497509550505050565b6000806000806000608086880312156153a757600080fd5b6153b086614cee565b9450602086013567ffffffffffffffff8111156153cc57600080fd5b6153d888828901614dfb565b9699909850959660408101359660609091013595509350505050565b6000806040838503121561540757600080fd5b50508035926020909101359150565b6000806040838503121561542957600080fd5b61543283614cee565b91506020830135801515811461544757600080fd5b809150509250929050565b600080600080600060a0868803121561546a57600080fd5b61547386614cee565b94506020860135935060408601359250606086013567ffffffffffffffff81111561549d57600080fd5b6154a988828901614ea3565b9250506154b860808701614f17565b90509295509295909350565b6000806000604084860312156154d957600080fd5b6154e284614cee565b9250602084013567ffffffffffffffff8111156154fe57600080fd5b61550a86828701614dfb565b9497909650939450505050565b6000806040838503121561552a57600080fd5b61553383614cee565b915061554160208401614cee565b90509250929050565b6000806040838503121561555d57600080fd5b61556683614cee565b9150602083013567ffffffffffffffff81111561558257600080fd5b61522585828601614fdd565b60008060008060008060006080888a0312156155a957600080fd5b6155b288614cee565b9650602088013567ffffffffffffffff808211156155cf57600080fd5b6155db8b838c01614dfb565b909850965060408a01359150808211156155f457600080fd5b6156008b838c01614dfb565b909650945060608a013591508082111561561957600080fd5b506156268a828b01614dfb565b989b979a50959850939692959293505050565b600080600080600060a0868803121561565157600080fd5b61565a86614cee565b945061566860208701614cee565b93506040860135925060608601359150608086013567ffffffffffffffff81111561569257600080fd5b6150eb88828901614ea3565b6000806000606084860312156156b357600080fd5b6156bc84614cee565b95602085013595506040909401359392505050565b600080600080608085870312156156e757600080fd5b6156f085614cee565b935060208501359250604085013567ffffffffffffffff81111561571357600080fd5b61571f87828801614ea3565b92505061572e60608601614f17565b905092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60408152600061577b6040830185614da3565b90508260208301529392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600060001982036157fb576157fb6157b9565b5060010190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261583757600080fd5b83018035915067ffffffffffffffff82111561585257600080fd5b6020019150600581901b3603821315614e4057600080fd5b8082018082111561083a5761083a6157b9565b604081526000615890604083018561522f565b8281036020840152610cc7818561522f565b6000602082840312156158b457600080fd5b5051919050565b6080815260006158ce608083018761522f565b82810360208401526158e0818761522f565b905082810360408401526158f4818661522f565b90508281036060840152615908818561522f565b979650505050505050565b8181038181111561083a5761083a6157b9565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561595857600080fd5b8260051b80836020870137939093016020019392505050565b60808152600061598560808301888a615926565b8281036020840152615997818861522f565b905082810360408401526159ab818761522f565b905082810360608401526159c0818587615926565b9998505050505050505050565b600181811c908216806159e157607f821691505b602082108103615a1a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b6000808454615a2e816159cd565b60018281168015615a465760018114615a5b57615a8a565b60ff1984168752821515830287019450615a8a565b8860005260208060002060005b85811015615a815781548a820152908401908201615a68565b50505082870194505b505050508351615a9e818360208801614d7f565b01949350505050565b60006001600160a01b03808816835280871660208401525060a06040830152615ad360a083018661522f565b8281036060840152615ae5818661522f565b90508281036080840152615af98185614da3565b98975050505050505050565b600060208284031215615b1757600080fd5b815161093a81614d34565b600060033d11156111ae5760046000803e5060005160e01c90565b600060443d1015615b4b5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715615b9957505050505090565b8285019150815181811115615bb15750505050505090565b843d8701016020828501011115615bcb5750505050505090565b615bda60208286010187614e76565b509095945050505050565b60006fffffffffffffffffffffffffffffffff808316818103615c0a57615c0a6157b9565b6001019392505050565b601f8211156111c357600081815260208120601f850160051c81016020861015615c3b5750805b601f850160051c820191505b8181101561142757828155600101615c47565b815167ffffffffffffffff811115615c7457615c74614e47565b615c8881615c8284546159cd565b84615c14565b602080601f831160018114615cbd5760008415615ca55750858301515b600019600386901b1c1916600185901b178555611427565b600085815260208120601f198616915b82811015615cec57888601518255948401946001909101908401615ccd565b5085821015615d0a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261590860a0830184614da3565b60008251615d64818460208701614d7f565b919091019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204c37f0793ff8af27d30569e38fca163a67b4a79dd8f7dad4b36c16831acb84e764736f6c63430008110033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/sdk/test/setup-env.ts b/sdk/test/setup-env.ts index 5b983c4f..aa5bf440 100644 --- a/sdk/test/setup-env.ts +++ b/sdk/test/setup-env.ts @@ -1,4 +1,8 @@ import dotenv from "dotenv"; +import { startProxy } from "@viem/anvil"; +// import fetchMock from "jest-fetch-mock"; + +// fetchMock.enableMocks(); dotenv.config({ path: "./.env" }); @@ -6,4 +10,11 @@ const reloadEnv = () => { dotenv.config({ path: "./.env" }); }; +export default async function () { + return await startProxy({ + port: 8545, // By default, the proxy will listen on port 8545. + host: "::", // By default, the proxy will listen on all interfaces. + }); +} + export { reloadEnv }; diff --git a/sdk/test/storage.test.ts b/sdk/test/storage.test.ts index 004815bc..f79d0f2c 100644 --- a/sdk/test/storage.test.ts +++ b/sdk/test/storage.test.ts @@ -1,25 +1,14 @@ +import { describe, it, afterAll } from "vitest"; + import { expect } from "chai"; -import { providers } from "ethers"; -import sinon from "sinon"; -import { HypercertMetadata } from "src/index.js"; +import { HypercertMetadata } from "../src"; -import HypercertsStorage from "../src/storage.js"; -import { StorageError } from "../src/types/errors.js"; -import { reloadEnv } from "./setup-env.js"; +import { HypercertsStorage } from "../src/storage"; +import { StorageError } from "../src/types/errors"; +import { reloadEnv } from "./setup-env"; describe("HypercertsStorage", () => { - let stub: sinon.SinonStub; - beforeAll(() => { - stub = sinon.stub(providers.BaseProvider.prototype, "on"); - - delete process.env.NFT_STORAGE_TOKEN; - delete process.env.WEB3_STORAGE_TOKEN; - delete process.env.NEXT_PUBLIC_NFT_STORAGE_TOKEN; - delete process.env.NEXT_PUBLIC_WEB3_STORAGE_TOKEN; - }); - afterAll(() => { - stub.restore(); reloadEnv(); }); @@ -47,11 +36,6 @@ describe("HypercertsStorage", () => { }); it("should throw an error when executing write method in readonly mode", async () => { - delete process.env.NFT_STORAGE_TOKEN; - delete process.env.WEB3_STORAGE_TOKEN; - delete process.env.NEXT_PUBLIC_NFT_STORAGE_TOKEN; - delete process.env.NEXT_PUBLIC_WEB3_STORAGE_TOKEN; - const client = new HypercertsStorage({}); // storeMetadata diff --git a/sdk/test/storage/nft.storage.test.ts b/sdk/test/storage/nft.storage.test.ts index 5ba4fc1a..60b9ec86 100644 --- a/sdk/test/storage/nft.storage.test.ts +++ b/sdk/test/storage/nft.storage.test.ts @@ -1,48 +1,39 @@ -import { jest } from "@jest/globals"; -import { rest } from "msw"; -import { setupServer } from "msw/node"; +import { describe, it, afterEach, afterAll, vi } from "vitest"; +import chai, { expect } from "chai"; +import assertionsCount from "chai-assertions-count"; + +//eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore import { NFTStorage } from "nft.storage"; -import HypercertsStorage from "../../src/storage.js"; -import { MalformedDataError } from "../../src/types/errors.js"; -import { HypercertMetadata } from "../../src/types/metadata.js"; -import logger from "../../src/utils/logger.js"; -import { getFormattedMetadata } from "../helpers.js"; -import mockData from "../res/mockData.js"; -import mockMetadata from "../res/mockMetadata.js"; +import { HypercertsStorage } from "../../src/storage"; +import { MalformedDataError } from "../../src/types/errors"; +import { HypercertMetadata } from "../../src/types/metadata"; +import { getFormattedMetadata, mockDataSets } from "../helpers"; +import sinon from "sinon"; +import axios from "axios"; + +chai.use(assertionsCount); describe("NFT.Storage Client", () => { - const mockCorrectMetadataCid = "testCID1234fkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u"; - const mockIncorrectMetadataCid = "errrCID1234fkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u"; + const { hypercertMetadata } = mockDataSets; - const storeBlobMock = jest.spyOn(NFTStorage.prototype, "storeBlob").mockImplementation((_: unknown, __?: unknown) => { - logger.debug("Hit mock storeBlob"); + const storeBlobMock = sinon.stub(NFTStorage.prototype, "storeBlob").resolves(hypercertMetadata.cid); - return Promise.resolve(mockCorrectMetadataCid); + const storage = new HypercertsStorage({ + nftStorageToken: process.env.NFT_STORAGE_TOKEN, + web3StorageToken: process.env.WEB3_STORAGE_TOKEN, }); - const server = setupServer( - rest.get(`https://nftstorage.link/ipfs/${mockCorrectMetadataCid}`, (_, res, ctx) => { - return res(ctx.status(200), ctx.json(mockMetadata)); - }), - rest.get(`https://nftstorage.link/ipfs/${mockIncorrectMetadataCid}`, (_, res, ctx) => { - return res(ctx.status(200), ctx.json(mockData)); - }), - ); - - const storage = new HypercertsStorage({}); - - beforeAll(() => server.listen()); - - afterEach(() => server.resetHandlers()); - afterEach(() => { - jest.clearAllMocks(); + chai.Assertion.resetAssertsCheck(); + vi.clearAllMocks(); + sinon.restore(); }); afterAll(() => { - server.close(); - jest.resetAllMocks(); + vi.resetAllMocks(); + sinon.resetBehavior(); }); /** @@ -50,40 +41,42 @@ describe("NFT.Storage Client", () => { */ it("Smoke test - add metadata", async () => { await storage.storeMetadata(getFormattedMetadata()); - expect(storeBlobMock).toHaveBeenCalledTimes(1); + expect(storeBlobMock.callCount).to.eq(1); }); it("Smoke test - get metadata", async () => { - const res = await storage.getMetadata(mockCorrectMetadataCid); + sinon.stub(axios, "get").resolves(Promise.resolve({ data: hypercertMetadata.data })); + const res = await storage.getMetadata(hypercertMetadata.cid); - expect(res).toMatchObject(mockMetadata); + expect(res).to.deep.eq(hypercertMetadata.data); }); it("Throws when trying to store incorrect metadata", async () => { + chai.Assertion.expectAssertions(2); // storeData try { - await storage.storeMetadata(mockData as HypercertMetadata); + await storage.storeMetadata({ data: "false" } as unknown as HypercertMetadata); } catch (e) { - expect(e instanceof MalformedDataError).toBeTruthy(); + expect(e).to.be.an.instanceOf(MalformedDataError); const error = e as MalformedDataError; - expect(error.message).toBe("Invalid metadata."); + expect(error.message).to.eq("Invalid metadata."); } - - expect.assertions(2); }); it("Throws when trying to fetch incorrect metadata", async () => { + chai.Assertion.expectAssertions(2); + const incorrectCID = "incorrect-cid"; + sinon.stub(axios, "get").resolves(Promise.resolve({ data: "false" })); + // storeData try { - await storage.getMetadata(mockIncorrectMetadataCid); + await storage.getMetadata(incorrectCID); } catch (e) { - expect(e instanceof MalformedDataError).toBeTruthy(); + expect(e).to.be.an.instanceOf(MalformedDataError); const error = e as MalformedDataError; - expect(error.message).toBe(`Invalid metadata at ${mockIncorrectMetadataCid}`); + expect(error.message).to.be.eq(`Invalid metadata at ${incorrectCID}`); } - - expect.assertions(2); }); }); diff --git a/sdk/test/storage/web3.storage.test.ts b/sdk/test/storage/web3.storage.test.ts index 8acf5020..4210cd5c 100644 --- a/sdk/test/storage/web3.storage.test.ts +++ b/sdk/test/storage/web3.storage.test.ts @@ -1,58 +1,44 @@ -import { jest } from "@jest/globals"; -import { rest } from "msw"; -import { setupServer } from "msw/node"; +import { describe, it, afterEach, afterAll } from "vitest"; +import { expect } from "chai"; //eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import { Web3Storage } from "web3.storage"; -import HypercertsStorage from "../../src/storage.js"; -import logger from "../../src/utils/logger.js"; -import mockData from "../res/mockData.js"; -import mockMetadata from "../res/mockMetadata.js"; +import { HypercertsStorage } from "../../src/storage"; +import { mockDataSets } from "../helpers"; +import axios from "axios"; +import sinon from "sinon"; describe("Web3.Storage Client", () => { - const mockCorrectMetadataCid = "testCID1234fkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u"; - const mockIncorrectMetadataCid = "errrCID1234fkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u"; + const { hypercertData, hypercertMetadata } = mockDataSets; - const storeBlobMock = jest.spyOn(Web3Storage.prototype, "put").mockImplementation((_: unknown, __?: unknown) => { - logger.debug("Hit mock storeBlob"); + const storeBlobMock = sinon.stub(Web3Storage.prototype, "put").resolves(hypercertMetadata.cid); - return Promise.resolve(mockCorrectMetadataCid); + const storage = new HypercertsStorage({ + nftStorageToken: process.env.NFT_STORAGE_TOKEN, + web3StorageToken: process.env.WEB3_STORAGE_TOKEN, }); - const server = setupServer( - rest.get(`https://nftstorage.link/ipfs/${mockCorrectMetadataCid}`, (_, res, ctx) => { - return res(ctx.status(200), ctx.json(mockMetadata)); - }), - rest.get(`https://nftstorage.link/ipfs/${mockIncorrectMetadataCid}`, (_, res, ctx) => { - return res(ctx.status(200), ctx.json(mockData)); - }), - ); - const storage = new HypercertsStorage({}); - - beforeAll(() => server.listen()); - afterEach(() => { - server.resetHandlers(); - jest.clearAllMocks(); + sinon.restore(); }); afterAll(() => { - server.close(); - jest.resetAllMocks(); + sinon.resetBehavior(); }); /** * Currently just testing against the production NFT.Storage service. */ it("Smoke test - add data", async () => { - await storage.storeData(mockData); - expect(storeBlobMock).toHaveBeenCalledTimes(1); + await storage.storeData(hypercertData.data); + expect(storeBlobMock.callCount).to.eq(1); }); it("Smoke test - get data", async () => { - const res = await storage.getData(mockCorrectMetadataCid); + sinon.stub(axios, "get").resolves(Promise.resolve({ data: hypercertData.data })); + const res = await storage.getData(hypercertData.cid); - expect(res).toMatchObject(mockMetadata); + expect(res).to.deep.eq(hypercertData.data); }); }); diff --git a/sdk/test/types/errors.test.ts b/sdk/test/types/errors.test.ts index 012a88eb..a5538bb2 100644 --- a/sdk/test/types/errors.test.ts +++ b/sdk/test/types/errors.test.ts @@ -1,3 +1,5 @@ +import { describe, it } from "vitest"; + import { expect } from "chai"; import { @@ -8,9 +10,9 @@ import { StorageError, UnknownSchemaError, UnsupportedChainError, -} from "../../src/types/errors.js"; +} from "../../src/types/errors"; -describe.only("Error types", () => { +describe("Error types", () => { it("has ClientError", () => { const error = new ClientError("Client error", { foo: "bar" }); error.message = "Client error"; diff --git a/sdk/test/utils/allowlist.test.ts b/sdk/test/utils/allowlist.test.ts new file mode 100644 index 00000000..444422e4 --- /dev/null +++ b/sdk/test/utils/allowlist.test.ts @@ -0,0 +1,52 @@ +import { describe, it, afterEach, afterAll } from "vitest"; + +import chai, { expect } from "chai"; +import chaiSubset from "chai-subset"; +import sinon from "sinon"; + +import { faker } from "@faker-js/faker"; +import { StandardMerkleTree } from "@openzeppelin/merkle-tree"; +import { getProofsFromAllowlist } from "../../src/utils"; +import axios from "axios"; + +chai.use(chaiSubset); + +const createAllowlist = async () => { + const allowlist = new Array(10).fill(0).map((_x) => ({ + address: faker.finance.ethereumAddress() as `0x${string}`, + units: 1n, + })); + + // create allowlist + const tuples = allowlist.map((p) => [p.address, p.units.toString()]); + const tree = StandardMerkleTree.of(tuples, ["address", "uint256"]); + + return { allowlist, tree }; +}; + +describe("Fetchers", () => { + afterEach(() => { + sinon.restore(); + }); + + afterAll(() => { + sinon.resetBehavior(); + }); + + it("Proof: should return valid proof and root", async () => { + const { allowlist, tree } = await createAllowlist(); + + const stub = sinon.stub(axios, "get").resolves(Promise.resolve({ data: JSON.stringify(tree.dump()) })); + + const res = await getProofsFromAllowlist("test", allowlist[0].address); + + expect(res).to.containSubset({ + proof: tree.getProof(0), + root: tree.root, + }); + + expect(res?.proof).to.deep.equal(tree.getProof(0)); + expect(res?.root).to.deep.equal(tree.root); + expect(stub.calledOnce).to.be.true; + }); +}); diff --git a/sdk/test/utils/config.test.ts b/sdk/test/utils/config.test.ts index 1290fa90..b3e7d32f 100644 --- a/sdk/test/utils/config.test.ts +++ b/sdk/test/utils/config.test.ts @@ -1,33 +1,16 @@ +import { describe, it, afterEach } from "vitest"; + import chai, { expect } from "chai"; import chaiSubset from "chai-subset"; -import { ethers } from "ethers"; import sinon from "sinon"; -import { DEFAULT_CHAIN_ID } from "../../src/constants.js"; -import { - ConfigurationError, - HypercertClientConfig, - InvalidOrMissingError, - UnsupportedChainError, -} from "../../src/types/index.js"; -import { getConfig } from "../../src/utils/config.js"; -import { reloadEnv } from "../../test/setup-env.js"; +import { ConfigurationError, HypercertClientConfig, InvalidOrMissingError } from "../../src/types"; +import { getConfig } from "../../src/utils/config"; +import { reloadEnv } from "../../test/setup-env"; +import { walletClient, publicClient } from "../helpers"; chai.use(chaiSubset); -describe("Config: chainId and chainName", () => { - it("should throw an error when the chainId is not supported", () => { - try { - getConfig({ chainId: 1337 }); - expect.fail("Should throw UnsupportedChainError"); - } catch (e) { - expect(e instanceof UnsupportedChainError).to.be.true; - const error = e as UnsupportedChainError; - expect(error.message).to.eq("chainId=1337 is not yet supported"); - } - }); -}); - describe("Config: contractAddress", () => { afterEach(() => { sinon.restore(); @@ -36,23 +19,23 @@ describe("Config: contractAddress", () => { }); it("should return the contract address specified by overrides", () => { - const overrides: Partial = { contractAddress: "0x1234567890123456789012345678901234567890" }; + const overrides: Partial = { + chain: { id: 5 }, + contractAddress: "0x1234567890123456789012345678901234567890", + }; const config = getConfig(overrides); expect(config.contractAddress).to.equal(overrides.contractAddress); }); - it("should return the contract address specified by the CONTRACT_ADDRESS environment variable", () => { - const CONTRACT_ADDRESS = "0x1234567890123456789012345678901234567890"; - sinon.stub(process, "env").value({ CONTRACT_ADDRESS }); - - const config = getConfig({}); - expect(config.contractAddress).to.equal(CONTRACT_ADDRESS); - delete process.env.CONTRACT_ADDRESS; - }); - it("should throw an error when the contract address specified by overrides is invalid", () => { - const overrides: Partial = { contractAddress: "invalid-address" }; - expect(() => getConfig(overrides)).to.throw(InvalidOrMissingError, "Invalid contract address"); + const overrides: Partial = { chain: { id: 5 }, contractAddress: "invalid-address" }; + try { + getConfig(overrides); + } catch (e) { + expect(e instanceof InvalidOrMissingError).to.be.true; + const error = e as InvalidOrMissingError; + expect(error.message).to.eq("Invalid contract address."); + } }); }); @@ -62,13 +45,13 @@ describe("Config: graphUrl", () => { }); it("should return the default graphUrl when no overrides are specified", () => { - const result = getConfig({}); + const result = getConfig({ chain: { id: 5 } }); expect(result.graphUrl).to.equal("https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-testnet"); }); it("should return the config specified by overrides", () => { const overrides: Partial = { - chainName: "testnet", + chain: { id: 5 }, graphUrl: "https://api.example.com", contractAddress: "0x1234567890123456789012345678901234567890", unsafeForceOverrideConfig: true, @@ -79,115 +62,105 @@ describe("Config: graphUrl", () => { it("should throw an error when the graph URL specified by overrides is invalid", () => { const overrides: Partial = { - chainName: "testnet", + chain: { id: 5 }, graphUrl: "incorrect-url", contractAddress: "0x1234567890123456789012345678901234567890", unsafeForceOverrideConfig: true, }; - expect(() => getConfig(overrides)).to.throw(ConfigurationError, "Invalid graph URL"); + try { + getConfig(overrides); + } catch (e) { + expect(e instanceof ConfigurationError).to.be.true; + const error = e as ConfigurationError; + expect(error.message).to.eq("Invalid graph URL"); + } }); it("should throw an error when the graph URL specified by overrides is missing", () => { const overrides: Partial = { - chainName: "testnet", + chain: { id: 5 }, contractAddress: "0x1234567890123456789012345678901234567890", unsafeForceOverrideConfig: true, }; - expect(() => getConfig(overrides)).to.throw( - UnsupportedChainError, - "attempted to override with chainId=5, but requires chainName, graphUrl, and contractAddress to be set", - ); + + try { + getConfig(overrides); + } catch (e) { + expect(e instanceof InvalidOrMissingError).to.be.true; + const error = e as InvalidOrMissingError; + expect(error.message).to.eq( + "attempted to override with chainId=5, but requires chainName, graphUrl, and contractAddress to be set", + ); + } }); }); -describe("Config: nftStorageToken", () => { +describe("Config: nftStorageToken & web3storageToken", () => { afterEach(() => { sinon.restore(); reloadEnv(); }); it("should return an empty object when no overrides or environment variables are specified", () => { - sinon.stub(process, "env").value({ NFT_STORAGE_TOKEN: "NFTSTOR" }); - - const result = getConfig({}); - expect(result).to.deep.include({ - nftStorageToken: "NFTSTOR", - }); + const result = getConfig({ chain: { id: 5 } }); + expect(result.nftStorageToken).to.be.undefined; }); it("should return the nftStorageToken specified by overrides", () => { const overrides: Partial = { + chain: { id: 5 }, nftStorageToken: "NFTSTOR", + web3StorageToken: "WEB3STOR", }; const result = getConfig(overrides); expect(result).to.deep.include({ nftStorageToken: overrides.nftStorageToken, + web3StorageToken: overrides.web3StorageToken, }); }); it("should return the nftStorageToken specified by the NFT_STORAGE_TOKEN environment variable", () => { - sinon.stub(process, "env").value({ NFT_STORAGE_TOKEN: "NFTSTOR" }); - const result = getConfig({}); - expect(result).to.deep.include({ - nftStorageToken: "NFTSTOR", - }); - }); - - it("should return the nftStorageToken specified by the NEXT_PUBLIC_NFT_STORAGE_TOKEN environment variable", () => { - sinon.stub(process, "env").value({ NEXT_PUBLIC_NFT_STORAGE_TOKEN: "NFTSTOR" }); - - const result = getConfig({}); - expect(result).to.deep.include({ - nftStorageToken: "NFTSTOR", - }); + const result = getConfig({ chain: { id: 5 }, nftStorageToken: "NFTSTOR" }); + expect(result.nftStorageToken).to.be.eq("NFTSTOR"); }); - it("should not throw an error when the nftStorageToken specified by overrides is invalid", () => { - sinon.stub(process, "env").value({ NFT_STORAGE_TOKEN: null }); - - const overrides: Partial = {}; + const overrides: Partial = { chain: { id: 5 }, nftStorageToken: undefined }; expect(() => getConfig(overrides)).to.not.throw(); }); }); -describe("Config: getOperator", () => { +describe("Config: getPublicClient", () => { afterEach(() => { sinon.restore(); reloadEnv(); }); - it("should return a default provider when no overrides or environment variables are specified", () => { - const result = getConfig({}); - //TODO: hacky solution to compare providers - expect(JSON.stringify(result.operator)).to.equal(JSON.stringify(ethers.getDefaultProvider(DEFAULT_CHAIN_ID))); - }); it("should return the operator specified by overrides", () => { - const provider = ethers.getDefaultProvider(DEFAULT_CHAIN_ID); - const wallet = new ethers.Wallet("0x0123456789012345678901234567890123456789012345678901234567890123", provider); const overrides: Partial = { - operator: wallet, + chain: { id: 5 }, + publicClient, }; const result = getConfig(overrides); - expect(result.operator).to.equal(overrides.operator); + expect(result.publicClient).to.equal(overrides.publicClient); }); +}); - it("should return the operator specified by the PRIVATE_KEY environment variable", () => { - const PRIVATE_KEY = "0x0123456789012345678901234567890123456789012345678901234567890123"; - sinon.stub(process, "env").value({ PRIVATE_KEY }); +describe("Config: getWalletClient", () => { + afterEach(() => { + sinon.restore(); - const result = getConfig({}); - const provider = ethers.getDefaultProvider(DEFAULT_CHAIN_ID); - const wallet = new ethers.Wallet(PRIVATE_KEY, provider); - expect(JSON.stringify(result.operator)).to.equal(JSON.stringify(wallet)); + reloadEnv(); }); - it("should throw an error when the operator specified by overrides is invalid", () => { + it("should return the operator specified by overrides", () => { const overrides: Partial = { - operator: "invalid" as unknown as ethers.Signer, + chain: { id: 5 }, + walletClient, }; - expect(() => getConfig(overrides)).to.throw(InvalidOrMissingError, "Invalid operator."); + const result = getConfig(overrides); + expect(result.walletClient).to.equal(overrides.walletClient); }); }); @@ -199,46 +172,24 @@ describe("Config: web3StorageToken", () => { }); it("should return an empty object when no overrides or environment variables are specified", () => { - const WEB3_STORAGE_TOKEN = "WEB3"; - sinon.stub(process, "env").value({ WEB3_STORAGE_TOKEN }); - const result = getConfig({}); - expect(result).to.deep.include({ - web3StorageToken: WEB3_STORAGE_TOKEN, - }); + const result = getConfig({ chain: { id: 5 } }); + expect(result.web3StorageToken).to.be.undefined; }); it("should return the web3StorageToken specified by overrides", () => { const overrides: Partial = { + chain: { id: 5 }, web3StorageToken: "WEB3STOR", }; + const result = getConfig(overrides); expect(result).to.deep.include({ web3StorageToken: overrides.web3StorageToken, }); }); - it("should return the web3StorageToken specified by the WEB3_STORAGE_TOKEN environment variable", () => { - const WEB3_STORAGE_TOKEN = "WEB3"; - sinon.stub(process, "env").value({ WEB3_STORAGE_TOKEN }); - const result = getConfig({}); - expect(result).to.deep.include({ - web3StorageToken: WEB3_STORAGE_TOKEN, - }); - }); - - it("should return the web3StorageToken specified by the NEXT_PUBLIC_WEB3_STORAGE_TOKEN environment variable", () => { - const NEXT_PUBLIC_WEB3_STORAGE_TOKEN = "WEB3"; - sinon.stub(process, "env").value({ NEXT_PUBLIC_WEB3_STORAGE_TOKEN }); - - const result = getConfig({}); - expect(result).to.deep.include({ - web3StorageToken: NEXT_PUBLIC_WEB3_STORAGE_TOKEN, - }); - }); - it("should not throw an error when the web3StorageToken specified by overrides is invalid", () => { - sinon.stub(process, "env").value({ WEB3_STORAGE_TOKEN: null }); - const overrides: Partial = {}; + const overrides: Partial = { chain: { id: 5 }, web3StorageToken: undefined }; expect(() => getConfig(overrides)).to.not.throw(); }); }); diff --git a/sdk/test/utils/errors.test.ts b/sdk/test/utils/errors.test.ts index affc4362..15ac9281 100644 --- a/sdk/test/utils/errors.test.ts +++ b/sdk/test/utils/errors.test.ts @@ -1,12 +1,88 @@ -import { expect } from "chai"; +import { describe, it, beforeEach, afterAll, beforeAll } from "vitest"; +import chai from "chai"; +import assertionsCount from "chai-assertions-count"; +import sinon from "sinon"; +import sinonChai from "sinon-chai"; -import { FetchError, MalformedDataError, UnsupportedChainError } from "../../src/types/errors.js"; -import { handleError } from "../../src/utils/errors.js"; +import { ContractError, FetchError, MalformedDataError, UnsupportedChainError } from "../../src/types/errors"; +import { handleSdkError } from "../../src/utils/errors"; -describe("Error handler test", () => { - it("checking error handler", () => { - expect(handleError(new FetchError("testing FetchError", { url: "http://badexample.com" }))).to.be.undefined; - expect(handleError(new MalformedDataError("testing MalformedDataError", { data: { foo: "bar" } }))).to.be.undefined; - expect(handleError(new UnsupportedChainError("testing UnsupportedChainError", { chainID: 1337 }))).to.be.undefined; +import { getRawInputData, publicClient, walletClient, testClient } from "../helpers"; + +//eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +import { CIDString, NFTStorage } from "nft.storage"; +import { HypercertClient, HypercertMinterAbi, TransferRestrictions, formatHypercertData } from "src"; +import { parseEther, encodeErrorResult } from "viem"; + +chai.use(assertionsCount); + +const expect = chai.expect; +chai.use(sinonChai); + +describe("SDK Error handler", () => { + it("handles SDK errors", () => { + expect(handleSdkError(new FetchError("testing FetchError", { url: "http://badexample.com" }))).to.be.undefined; + expect(handleSdkError(new MalformedDataError("testing MalformedDataError", { data: { foo: "bar" } }))).to.be + .undefined; + expect(handleSdkError(new UnsupportedChainError("testing UnsupportedChainError", { chainID: 1337 }))).to.be + .undefined; + }); +}); + +describe("Contract Error handler", () => { + const mockCorrectMetadataCid = "testCID1234fkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u" as CIDString; + + const storeBlobMock = sinon.stub(NFTStorage, "storeBlob").resolves(mockCorrectMetadataCid); + + const client = new HypercertClient({ + chain: { id: 5 }, + walletClient, + publicClient, + nftStorageToken: "test", + web3StorageToken: "test", + }); + + const readSpy = sinon.stub(publicClient, "readContract"); + const writeSpy = sinon.stub(walletClient, "writeContract"); + + beforeAll(async () => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + await testClient.setBalance({ address: walletClient.account!.address, value: parseEther("1") }); + }); + + beforeEach(async () => { + chai.Assertion.resetAssertsCheck(); + writeSpy.resetBehavior(); + writeSpy.resetHistory(); + + storeBlobMock.resetHistory(); + }); + + afterAll(() => { + sinon.restore(); + }); + + it("handles throw on mintClaim", async () => { + expect(client.readonly).to.be.false; + + const rawData = getRawInputData(); + const { data: formattedData } = formatHypercertData(rawData); + readSpy.resolves(walletClient.account!.address); + + const value = encodeErrorResult({ + abi: HypercertMinterAbi, + errorName: "NotAllowed", + }); + writeSpy.resolves(value); + + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + await client.mintClaim(formattedData!, 0n, TransferRestrictions.DisallowAll); + } catch (e) { + expect(e).to.be.instanceOf(ContractError); + const err = e as ContractError; + expect(err.message).to.equal("Contract returned NotAllowed"); + } }); }); diff --git a/sdk/test/utils/fetchers.test.ts b/sdk/test/utils/fetchers.test.ts new file mode 100644 index 00000000..a3586444 --- /dev/null +++ b/sdk/test/utils/fetchers.test.ts @@ -0,0 +1,39 @@ +import { describe, it, afterEach } from "vitest"; + +import chai, { expect } from "chai"; +import chaiSubset from "chai-subset"; +import sinon from "sinon"; + +import { getFromIPFS } from "../../src/utils/fetchers"; +import axios from "axios"; + +chai.use(chaiSubset); + +describe("Fetchers", () => { + afterEach(() => { + sinon.restore(); + }); + + it("IPFS: should return data from IPFS", async () => { + const validResponse = { data: "TEST_PASSED" }; + const axiosStub = sinon.stub(axios, "get").resolves(Promise.resolve(validResponse)); + + const res = await getFromIPFS("test"); + expect(res).to.equal(validResponse.data); + expect(axiosStub.calledOnce).to.be.true; + }); + + it("IPFS: should try another endpoint after the first fails", async () => { + const validResponse = { data: "TEST_PASSED" }; + const axiosStub = sinon + .stub(axios, "get") + .onFirstCall() + .rejects() + .onSecondCall() + .resolves(Promise.resolve(validResponse)); + + const res = await getFromIPFS("test"); + expect(res).to.equal(validResponse.data); + expect(axiosStub.calledTwice).to.be.true; + }); +}); diff --git a/sdk/test/utils/formatter.test.ts b/sdk/test/utils/formatter.test.ts index 0875cde2..f492d5cc 100644 --- a/sdk/test/utils/formatter.test.ts +++ b/sdk/test/utils/formatter.test.ts @@ -1,7 +1,8 @@ +import { describe, it } from "vitest"; import { expect } from "chai"; -import { formatHypercertData } from "../../src/index.js"; -import { INDEFINITE_DATE_STRING, formatDate, formatUnixTime } from "../../src/utils/formatter.js"; +import { formatHypercertData } from "../../src"; +import { INDEFINITE_DATE_STRING, formatDate, formatUnixTime } from "../../src/utils/formatter"; type TestDataType = Parameters[0]; const testData: Partial = { diff --git a/sdk/test/utils/logger.test.ts b/sdk/test/utils/logger.test.ts index 06fe768f..55a5caca 100644 --- a/sdk/test/utils/logger.test.ts +++ b/sdk/test/utils/logger.test.ts @@ -1,6 +1,7 @@ +import { describe, it, beforeEach, afterEach, beforeAll, afterAll } from "vitest"; import sinon from "sinon"; -import logger from "../../src/utils/logger.js"; +import { logger } from "../../src/utils"; describe("logger", () => { const stubError = sinon.stub(console, "error"); diff --git a/sdk/test/validator.test.ts b/sdk/test/validator.test.ts index 6036f72d..8ae0f44f 100644 --- a/sdk/test/validator.test.ts +++ b/sdk/test/validator.test.ts @@ -1,15 +1,18 @@ +import { describe, it } from "vitest"; + import { expect } from "chai"; -import { validateClaimData, validateMetaData } from "../src/index.js"; -import type { HypercertClaimdata, HypercertMetadata } from "../src/index.js"; -import testData from "./res/mockMetadata.js"; -import { validateDuplicateEvaluationData, validateSimpleTextEvaluationData } from "../src/validator/index.js"; -import { getDuplicateEvaluationData, getSimpleTextEvaluationData } from "./helpers.js"; -import { DuplicateEvaluation, SimpleTextEvaluation } from "../src/types/evaluation.js"; +import { validateClaimData, validateMetaData } from "../src"; +import type { HypercertClaimdata, HypercertMetadata } from "../src"; +import { validateDuplicateEvaluationData, validateSimpleTextEvaluationData } from "../src/validator"; +import { getDuplicateEvaluationData, getSimpleTextEvaluationData, mockDataSets } from "./helpers"; +import { DuplicateEvaluation, SimpleTextEvaluation } from "../src/types/evaluation"; describe("Validate claim test", () => { + const { hypercertData, hypercertMetadata } = mockDataSets; it("checking default metadata", () => { - expect(validateMetaData(testData).valid).to.be.true; + const result = validateMetaData(hypercertMetadata.data); + expect(result.valid).to.be.true; const invalidResult = validateMetaData({} as HypercertMetadata); @@ -18,7 +21,8 @@ describe("Validate claim test", () => { }); it("checking default claimdata", () => { - expect(validateClaimData(testData.hypercert).valid).to.be.true; + const result = validateClaimData(hypercertData.data); + expect(result.valid).to.be.true; const invalidResult = validateClaimData({} as HypercertClaimdata); diff --git a/sdk/tsconfig.json b/sdk/tsconfig.json index 368097f4..04d83b83 100644 --- a/sdk/tsconfig.json +++ b/sdk/tsconfig.json @@ -22,5 +22,5 @@ "skipLibCheck": true }, "exclude": ["node_modules"], - "include": ["./src/*.ts", "./src/**/*", "./test", "global.d.ts"] + "include": ["./src/*.ts", "./src/**/*", "./test/*.ts", "./test/**/*.ts"] } diff --git a/sdk/vitest.config.mts b/sdk/vitest.config.mts new file mode 100644 index 00000000..8e1d367d --- /dev/null +++ b/sdk/vitest.config.mts @@ -0,0 +1,7 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + globalSetup: "./test/setup-env.ts", + }, +});