From b76176e2c6794d072341597bc7b8396b47cb49c4 Mon Sep 17 00:00:00 2001 From: bitbeckers Date: Mon, 8 Jan 2024 18:05:57 +0100 Subject: [PATCH] Release to production (#1254) * 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(event): add event to merge * chore(deploy): deployed to goerli and sepolia * 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 * Chore/lets merge together (#1220) * [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: add wrapper components for split and merge functionality (#1148) * format external url in case it is a direct ipfs link (#1181) * merge fixes --------- Co-authored-by: bitbeckers * feat(urql): refactored to urql and own codegen (#1223) * feat(urql): refactored to urql and own codegen * chore(graph): cleanup schema * fix(build): graph build and test * Feat/docs updates docusaurs v3 search release (#1226) * chore(bump): docusaurs v3 * feat(docgen): docusaurus pulls SDK docs * feat(version): version 1.0.0 * fix(p.json): updated package-lock * fix(build): remove contract docs build from docs * Feat/sdk npm docs release 1 (#1228) * chore(bump): released contracts 1.0.0 * chore(bump): update graph testnet deploy * chore(bump): sdk version 1.0.0 * chore(bump): update deps in fe * chore(bump): sdk 1.0.3 in fe * fix(lint): test type lint * Feat/sdk npm docs release 1 (#1231) * [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: add wrapper components for split and merge functionality (#1148) * format external url in case it is a direct ipfs link (#1181) * 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 * chore(bump): released contracts 1.0.0 * chore(bump): update graph testnet deploy * chore(bump): sdk version 1.0.0 * chore(bump): update deps in fe * chore(bump): sdk 1.0.3 in fe * fix(lint): test type lint --------- Co-authored-by: Jip Stavenuiter * Faet/docs search function in documentation (#1236) * feat(docsearch): add config * feat(search): implement algolia search * (feat): add initial version of delete on order fulfilled script * chore(bump): web3 connectors fe * (feature): Delete order on execute taker bid autotask * (feat): fix setup and rollouts, update scripts * (feat): remove redundancy from create-sentinel.ts config * (chore): delete goerli from SDK * (chore): delete goerli from defender config * (chore): delete goerli from graph * (chore): delete goerli from frontend * (chore): update tests for goerli deprecation * feat(apis): refactor to use hypercerts APIs * fix(api): migrate to railway * fix(build): update viem and fe client config * chore(bump): sdk 1.1.0 release and bump fe * (chore): update changelog * fix(ci): linting * chore(bump): fe sdk dep --------- Co-authored-by: jipstavenuiter --- contracts/.openzeppelin/goerli.json | 1500 ----------------- contracts/hardhat.config.ts | 1 - contracts/package.json | 2 +- .../src/marketplace/LooksRareProtocol.sol | 1 - .../libraries/LowLevelHypercertCaller.sol | 1 - .../marketplace/libraries/OrderStructs.sol | 1 - .../foundry/marketplace/TransferManager.t.sol | 2 - .../HypercertFractionOffers.t.sol | 1 - .../marketplace/utils/MerkleWithPosition.sol | 1 - defender/package.json | 2 +- defender/src/auto-tasks/execute-taker-bid.ts | 168 ++ defender/src/create-sentinel.ts | 11 +- defender/src/networks.ts | 23 +- defender/src/rollout.ts | 65 +- defender/src/update.ts | 37 +- defender/webpack.config.cjs | 2 + .../version-1.0.0-alpha.0-sidebars.json | 20 +- frontend/.env.local.example | 4 +- frontend/README.md | 2 +- frontend/components/dapp-context.tsx | 4 +- frontend/components/dapp-state.tsx | 4 +- frontend/hooks/hypercerts-client.ts | 3 - frontend/lib/formatting.ts | 2 +- frontend/package.json | 2 +- graph/networks.json | 6 - graph/package.json | 3 +- graph/tests/.latest.json | 2 +- pnpm-lock.yaml | 709 ++------ sdk/.env.template | 4 - sdk/README.md | 10 +- sdk/RELEASE.md | 14 + sdk/package.json | 6 +- sdk/src/client.ts | 48 +- sdk/src/constants.ts | 14 +- sdk/src/index.ts | 3 +- sdk/src/indexer/gql/graphql.ts | 569 +++++++ sdk/src/storage.ts | 159 +- sdk/src/types/client.ts | 27 +- sdk/src/utils/allowlist.ts | 10 +- sdk/src/utils/apis.ts | 57 + sdk/src/utils/config.ts | 19 +- sdk/src/utils/fetchers.ts | 12 +- sdk/src/utils/index.ts | 6 +- sdk/src/validator/index.ts | 10 +- sdk/test/client.test.ts | 6 +- sdk/test/client/allowlist.minting.test.ts | 42 +- sdk/test/client/burn.test.ts | 2 +- sdk/test/client/minting.test.ts | 23 +- sdk/test/client/split.merge.test.ts | 2 +- sdk/test/evaluations/evaluator.test.ts | 4 +- sdk/test/storage.test.ts | 47 +- sdk/test/storage/nft.storage.test.ts | 82 - sdk/test/storage/storeAllowList.test.ts | 71 + sdk/test/storage/storeMetadata.test.ts | 60 + sdk/test/storage/web3.storage.test.ts | 44 - sdk/test/utils/config.test.ts | 84 +- sdk/test/utils/errors.test.ts | 16 +- 57 files changed, 1437 insertions(+), 2593 deletions(-) create mode 100644 defender/src/auto-tasks/execute-taker-bid.ts create mode 100644 sdk/src/utils/apis.ts delete mode 100644 sdk/test/storage/nft.storage.test.ts create mode 100644 sdk/test/storage/storeAllowList.test.ts create mode 100644 sdk/test/storage/storeMetadata.test.ts delete mode 100644 sdk/test/storage/web3.storage.test.ts diff --git a/contracts/.openzeppelin/goerli.json b/contracts/.openzeppelin/goerli.json index e63b6838..025a4ed0 100644 --- a/contracts/.openzeppelin/goerli.json +++ b/contracts/.openzeppelin/goerli.json @@ -4,11 +4,6 @@ { "address": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", "kind": "uups" - }, - { - "address": "0x689587461AA3103D3D7975c5e4B352Ab711C14C2", - "txHash": "0x236119a264468c853263e067fbde6781c2c4109a5a3027a9adcfdca56b9bdacb", - "kind": "uups" } ], "impls": { @@ -376,1501 +371,6 @@ }, "namespaces": {} } - }, - "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/hardhat.config.ts b/contracts/hardhat.config.ts index e4bb0221..c82c7039 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -59,7 +59,6 @@ const OPENZEPPELIN_SECRET_KEY = requireEnv(process.env.OPENZEPPELIN_SECRET_KEY, const chainIds = { hardhat: 31337, // Ethereum: https://docs.infura.io/infura/networks/ethereum/how-to/choose-a-network - goerli: 5, sepolia: 11155111, mainnet: 1, // Optimism: https://docs.infura.io/infura/networks/optimism/how-to/choose-a-network diff --git a/contracts/package.json b/contracts/package.json index a8fa9340..d12b0684 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -99,7 +99,7 @@ "deploy:marketplace:dryrun": "forge script scripts/deployment/Deployment.s.sol:Deployment --fork-url", "docs": "pnpm hardhat dodoc", "lint": "pnpm lint:sol && pnpm prettier:check", - "lint:sol": "forge fmt --check && solhint \"./{src,test/foundry/protocol,test/foundry/marketplace}/**/*.sol\"", + "lint:sol": "forge fmt && solhint \"./{src,test/foundry/protocol,test/foundry/marketplace}/**/*.sol\"", "prepublish": "pnpm build", "prettier": "prettier --config \"./.prettierrc.yml\" --write \"**/*.{json,md,ts,yml}\"", "prettier:check": "prettier --config \"./.prettierrc.yml\" --check \"**/*.{json,md,ts,yml}\"", diff --git a/contracts/src/marketplace/LooksRareProtocol.sol b/contracts/src/marketplace/LooksRareProtocol.sol index 9f3eb107..676df3b0 100644 --- a/contracts/src/marketplace/LooksRareProtocol.sol +++ b/contracts/src/marketplace/LooksRareProtocol.sol @@ -83,7 +83,6 @@ import {CollectionType} from "./enums/CollectionType.sol"; * ~~~~~~ * @author LooksRare protocol team (👀,💎); bitbeckers */ - contract LooksRareProtocol is ILooksRareProtocol, TransferSelectorNFT, diff --git a/contracts/src/marketplace/libraries/LowLevelHypercertCaller.sol b/contracts/src/marketplace/libraries/LowLevelHypercertCaller.sol index 5c330c38..38165f8e 100644 --- a/contracts/src/marketplace/libraries/LowLevelHypercertCaller.sol +++ b/contracts/src/marketplace/libraries/LowLevelHypercertCaller.sol @@ -20,7 +20,6 @@ contract LowLevelHypercertCaller { * @param tokenId tokenId to transfer * @param amounts split distribution */ - function _executeHypercertSplitFraction(address collection, address to, uint256 tokenId, uint256[] memory amounts) internal { diff --git a/contracts/src/marketplace/libraries/OrderStructs.sol b/contracts/src/marketplace/libraries/OrderStructs.sol index 38c632b2..9feafddb 100644 --- a/contracts/src/marketplace/libraries/OrderStructs.sol +++ b/contracts/src/marketplace/libraries/OrderStructs.sol @@ -69,7 +69,6 @@ library OrderStructs { /** * 3. Merkle tree struct */ - enum MerkleTreeNodePosition { Left, Right diff --git a/contracts/test/foundry/marketplace/TransferManager.t.sol b/contracts/test/foundry/marketplace/TransferManager.t.sol index e9e56855..7760a511 100644 --- a/contracts/test/foundry/marketplace/TransferManager.t.sol +++ b/contracts/test/foundry/marketplace/TransferManager.t.sol @@ -56,7 +56,6 @@ contract TransferManagerTest is ITransferManager, TestHelpers, TestParameters { /** * 0. Internal helper functions */ - function _grantApprovals(address user) private asPrankedUser(user) { mockERC721.setApprovalForAll(address(transferManager), true); mockERC1155.setApprovalForAll(address(transferManager), true); @@ -93,7 +92,6 @@ contract TransferManagerTest is ITransferManager, TestHelpers, TestParameters { /** * 1. Happy cases */ - function testTransferSingleItemERC721() public { _allowOperator(_transferrer); _grantApprovals(_sender); diff --git a/contracts/test/foundry/marketplace/executionStrategies/HypercertFractionOffers.t.sol b/contracts/test/foundry/marketplace/executionStrategies/HypercertFractionOffers.t.sol index c04a128a..d8ae2a99 100644 --- a/contracts/test/foundry/marketplace/executionStrategies/HypercertFractionOffers.t.sol +++ b/contracts/test/foundry/marketplace/executionStrategies/HypercertFractionOffers.t.sol @@ -174,7 +174,6 @@ contract HypercertFractionOffersTest is ProtocolBase { /** * A collection offer without merkle tree criteria */ - function testTakerBidHypercertFractionOrderPartialFill() public { _setUpUsers(); diff --git a/contracts/test/foundry/marketplace/utils/MerkleWithPosition.sol b/contracts/test/foundry/marketplace/utils/MerkleWithPosition.sol index 43857193..b28c68a6 100644 --- a/contracts/test/foundry/marketplace/utils/MerkleWithPosition.sol +++ b/contracts/test/foundry/marketplace/utils/MerkleWithPosition.sol @@ -13,7 +13,6 @@ 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) { diff --git a/defender/package.json b/defender/package.json index b682499d..5fbc4d36 100644 --- a/defender/package.json +++ b/defender/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@graphql-mesh/cache-localforage": "^0.95.7", - "@hypercerts-org/contracts": "0.8.11", + "@hypercerts-org/contracts": "1.0.0", "@openzeppelin/defender-autotask-client": "1.50.0", "@openzeppelin/defender-autotask-utils": "1.50.0", "@openzeppelin/defender-base-client": "1.49.0", diff --git a/defender/src/auto-tasks/execute-taker-bid.ts b/defender/src/auto-tasks/execute-taker-bid.ts new file mode 100644 index 00000000..ccc2c040 --- /dev/null +++ b/defender/src/auto-tasks/execute-taker-bid.ts @@ -0,0 +1,168 @@ +import { + AutotaskEvent, + BlockTriggerEvent, +} from "@openzeppelin/defender-autotask-utils"; +import { getNetworkConfigFromName } from "../networks"; +import { createClient } from "@supabase/supabase-js"; +import fetch from "node-fetch"; +import { BigNumber, ethers } from "ethers"; +import { MissingDataError, NotImplementedError } from "../errors"; +import { + HypercertExchangeAbi, + HypercertMinterAbi, +} from "@hypercerts-org/contracts"; + +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]; + + const client = createClient(SUPABASE_URL, SUPABASE_SECRET_API_KEY, { + global: { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + fetch: (...args) => fetch(...args), + }, + }); + + let provider; + + if (ALCHEMY_KEY) { + provider = new ethers.providers.AlchemyProvider( + network.networkKey, + ALCHEMY_KEY, + ); + } else if (network.rpc) { + provider = new ethers.providers.JsonRpcProvider(network.rpc); + } else { + throw new Error("No provider available"); + } + + // Check data availability + const body = event.request.body; + if (!("type" in body) || body.type !== "BLOCK") { + throw new NotImplementedError("Event body is not a BlockTriggerEvent"); + } + const blockTriggerEvent = body as BlockTriggerEvent; + const contractAddress = blockTriggerEvent.matchedAddresses[0]; + const fromAddress = blockTriggerEvent.transaction.from; + const txnLogs = blockTriggerEvent.transaction.logs; + const tx = await provider.getTransaction(blockTriggerEvent.hash); + + if (!contractAddress) { + throw new MissingDataError(`body.matchedAddresses is missing`); + } else if (!fromAddress) { + throw new MissingDataError(`body.transaction.from is missing`); + } else if (!txnLogs) { + throw new MissingDataError(`body.transaction.logs is missing`); + } else if (!tx) { + throw new MissingDataError(`tx is missing`); + } + + console.log("Contract address", contractAddress); + console.log("From address", fromAddress); + + // TODO: Update contracts so we can use ABI from the @hypercerts-org/contracts package + const hypercertsMinterContractInterface = new ethers.utils.Interface( + HypercertMinterAbi, + ); + + // Parse TransferSingle events + const parsedLogs = txnLogs.map((l) => { + //Ignore unknown events + try { + return hypercertsMinterContractInterface.parseLog(l); + } catch (e) { + console.log("Failed to parse log", l); + return null; + } + }); + console.log("Parsed logs: ", JSON.stringify(parsedLogs, null, 2)); + const transferSingleEvents = parsedLogs.filter( + (e) => e !== null && e.name === "TransferSingle", + ); + + console.log( + "TransferSingle Events: ", + JSON.stringify(transferSingleEvents, null, 2), + ); + + if (transferSingleEvents.length !== 1) { + throw new MissingDataError( + `Unexpected saw ${transferSingleEvents.length} TransferSingle events`, + ); + } + + // Get claimID + const signerAddress = transferSingleEvents[0].args["from"] as string; + const itemId = BigNumber.from(transferSingleEvents[0].args["id"]).toString(); + + const hypercertExchangeContractInterface = new ethers.utils.Interface( + HypercertExchangeAbi, + ); + // Parse TakerBid events + const takerBidEvents = txnLogs + .map((l) => { + //Ignore unknown events + try { + return hypercertExchangeContractInterface.parseLog(l); + } catch (e) { + console.log("Failed to parse log", l); + return null; + } + }) + .filter((e) => e !== null && e.name === "TakerBid"); + + console.log("TakerBid Events: ", JSON.stringify(takerBidEvents, null, 2)); + + if (takerBidEvents.length !== 1) { + throw new MissingDataError( + `Unexpected saw ${takerBidEvents.length} TakerBid events`, + ); + } + + // Get claimID + const orderNonce = BigNumber.from( + takerBidEvents[0].args["nonceInvalidationParameters"][1], + ).toString(); + console.log( + "Signer Address: ", + signerAddress, + "Order nonce: ", + orderNonce, + "Fraction ID: ", + itemId, + "Chain ID: ", + network.chainId, + ); + + // Remove from DB + if (await tx.wait(5).then((receipt) => receipt.status === 1)) { + const deleteResult = await client + .from("marketplace-orders") + .delete() + .eq("signer", signerAddress) + .eq("chainId", network.chainId) + .eq("orderNonce", orderNonce) + .containedBy("itemIds", [itemId]) + .select() + .throwOnError(); + console.log("Deleted", deleteResult); + + if (!deleteResult) { + throw new Error( + `Could not remove from database. Delete result: ${JSON.stringify( + deleteResult, + )}`, + ); + } + } +} diff --git a/defender/src/create-sentinel.ts b/defender/src/create-sentinel.ts index 58acfd90..55274f0d 100644 --- a/defender/src/create-sentinel.ts +++ b/defender/src/create-sentinel.ts @@ -1,4 +1,3 @@ -import { abi } from "./HypercertMinterABI.js"; import config from "./config.js"; import { NetworkConfig } from "./networks"; import { SentinelClient } from "@openzeppelin/defender-sentinel-client"; @@ -13,12 +12,16 @@ export const createSentinel = async ({ autotaskID, functionConditions = [], eventConditions = [], + contractAddress, + abi, }: { name: string; network: NetworkConfig; autotaskID: string; eventConditions?: EventCondition[]; functionConditions?: FunctionCondition[]; + contractAddress: string; + abi: any; }) => { const client = new SentinelClient(config.credentials); await client @@ -27,8 +30,8 @@ export const createSentinel = async ({ network: network.networkKey, confirmLevel: 1, // if not set, we pick the blockwatcher for the chosen network with the lowest offset name, - addresses: [network.contractAddress], - abi: abi, + addresses: [contractAddress], + abi, paused: false, eventConditions, functionConditions, @@ -41,7 +44,7 @@ export const createSentinel = async ({ `Created sentinel`, res.name, "- monitoring address", - network.contractAddress, + contractAddress, "- linked to autotask", autotaskID, ); diff --git a/defender/src/networks.ts b/defender/src/networks.ts index 80aa187b..ca8bfb1b 100644 --- a/defender/src/networks.ts +++ b/defender/src/networks.ts @@ -21,12 +21,6 @@ export interface SupportedNetworks { export const NETWORKS: SupportedNetworks = { TEST: [ - { - networkKey: "goerli", - contractAddress: "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", - alchemyKeyEnvName: "ALCHEMY_GOERLI_KEY", - chainId: 5, - }, { networkKey: "sepolia", contractAddress: "0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941", @@ -55,23 +49,28 @@ export const NETWORKS: SupportedNetworks = { * We'll then subsequently use `getNetworkConfigFromName` * to extract the network name from within the Autotask * @param network + * @param contract * @param name - name pre-encoding * @returns */ -export const encodeName = (network: NetworkConfig, name: string) => - `[${network.networkKey}] ${name}`; +export const encodeName = ( + network: NetworkConfig, + contract: "minter" | "exchange", + name: string, +) => `[${network.networkKey}][${contract}] ${name}`; export const decodeName = ( encodedName: string, -): { networkKey: string; name: string } => { - const regex = /^\[(.+)\]\s(.+)$/; +): { networkKey: string; contract: string; name: string } => { + const regex = /^\[(.+)\]\[(.+)\]\s(.+)$/; const match = encodedName.match(regex); if (!match) { throw new Error(`Invalid encoded name: ${encodedName}`); } const networkKey = match[1]; - const name = match[2]; - return { networkKey, name }; + const contract = match[2]; + const name = match[3]; + return { networkKey, contract, name }; }; /** diff --git a/defender/src/rollout.ts b/defender/src/rollout.ts index 3904cd36..3139fadd 100644 --- a/defender/src/rollout.ts +++ b/defender/src/rollout.ts @@ -2,26 +2,43 @@ import { createTask } from "./create-autotask"; import { createSentinel } from "./create-sentinel"; import { ApiError } from "./errors"; import { NetworkConfig, encodeName } from "./networks"; +import { + HypercertExchangeAbi, + deployments, + asDeployedChain, + HypercertMinterAbi, +} from "@hypercerts-org/contracts"; export const rollOut = async (networks: NetworkConfig[]) => { return await Promise.all( networks.map(async (network) => { + console.log( + "Contract address", + network.chainId.toString(), + asDeployedChain(network.chainId.toString()), + deployments[asDeployedChain(network.chainId.toString())], + deployments[asDeployedChain(network.chainId.toString())] + .HypercertExchange, + ); // On allowlist created const autoTaskOnAllowlistCreated = await createTask( - encodeName(network, "on-allowlist-created"), + encodeName(network, "minter", "on-allowlist-created"), "on-allowlist-created", ); if (!autoTaskOnAllowlistCreated) { throw new ApiError( encodeName( network, + "minter", "Could not create autoTask for on-allowlist-created", ), ); } await createSentinel({ - name: encodeName(network, "AllowlistCreated"), + name: encodeName(network, "minter", "AllowlistCreated"), network: network, + contractAddress: network.contractAddress, + abi: HypercertMinterAbi, eventConditions: [ { eventSignature: "AllowlistCreated(uint256,bytes32)" }, ], @@ -30,20 +47,23 @@ export const rollOut = async (networks: NetworkConfig[]) => { // On batch minted const autoTaskOnBatchMintClaimsFromAllowlists = await createTask( - encodeName(network, "batch-mint-claims-from-allowlists"), + encodeName(network, "minter", "batch-mint-claims-from-allowlists"), "batch-mint-claims-from-allowlists", ); if (!autoTaskOnBatchMintClaimsFromAllowlists) { throw new ApiError( encodeName( network, + "minter", "Could not create autoTask for batch-mint-claims-from-allowlists", ), ); } await createSentinel({ - name: encodeName(network, "batchMintClaimsFromAllowlists"), + name: encodeName(network, "minter", "batchMintClaimsFromAllowlists"), network: network, + contractAddress: network.contractAddress, + abi: HypercertMinterAbi, autotaskID: autoTaskOnBatchMintClaimsFromAllowlists.autotaskId, functionConditions: [ { @@ -55,20 +75,23 @@ export const rollOut = async (networks: NetworkConfig[]) => { // On single minted from allowlist const autoTaskOnMintClaimFromAllowlist = await createTask( - encodeName(network, "mint-claim-from-allowlist"), + encodeName(network, "minter", "mint-claim-from-allowlist"), "mint-claim-from-allowlist", ); if (!autoTaskOnMintClaimFromAllowlist) { throw new ApiError( encodeName( network, + "minter", "Could not create autoTask for mint-claim-from-allowlist", ), ); } await createSentinel({ - name: encodeName(network, "mintClaimFromAllowlist"), + name: encodeName(network, "minter", "mintClaimFromAllowlist"), network: network, + contractAddress: network.contractAddress, + abi: HypercertMinterAbi, autotaskID: autoTaskOnMintClaimFromAllowlist.autotaskId, functionConditions: [ { @@ -77,6 +100,36 @@ export const rollOut = async (networks: NetworkConfig[]) => { }, ], }); + + // On execute taker bid + const autoTaskExecuteTakerBid = await createTask( + encodeName(network, "exchange", "execute-taker-bid"), + "execute-taker-bid", + ); + if (!autoTaskExecuteTakerBid) { + throw new ApiError( + encodeName( + network, + "exchange", + "Could not create autoTask for execute-taker-bid", + ), + ); + } + await createSentinel({ + name: encodeName(network, "exchange", "executeTakerBid"), + network: network, + autotaskID: autoTaskExecuteTakerBid.autotaskId, + contractAddress: + deployments[asDeployedChain(network.chainId.toString())] + .HypercertExchange, + abi: HypercertExchangeAbi, + functionConditions: [ + { + functionSignature: + "executeTakerBid((address,bytes),(uint8,uint256,uint256,uint256,uint256,uint8,address,address,address,uint256,uint256,uint256,uint256[],uint256[],bytes),bytes,(bytes32,(bytes32,uint8)[]))", + }, + ], + }); }), ); }; diff --git a/defender/src/update.ts b/defender/src/update.ts index f7fbf463..dee78669 100644 --- a/defender/src/update.ts +++ b/defender/src/update.ts @@ -1,8 +1,13 @@ -import { abi } from "./HypercertMinterABI"; +import { abi as HypercertMinterAbi } from "./HypercertMinterABI"; import config from "./config"; import { NetworkConfig, decodeName } from "./networks"; import { AutotaskClient } from "@openzeppelin/defender-autotask-client"; import { SentinelClient } from "@openzeppelin/defender-sentinel-client"; +import { + asDeployedChain, + deployments, + HypercertExchangeAbi, +} from "@hypercerts-org/contracts"; export const updateAutotask = async (networks: NetworkConfig[]) => { const autotaskClient = new AutotaskClient(config.credentials); @@ -44,12 +49,17 @@ export const updateSentinel = async (networks: NetworkConfig[]) => { const targetNetworks = networks.map((network) => network.networkKey); const oldSentinels = await sentinelClient.list(); + return await Promise.all([ ...oldSentinels.items.map((sentinel) => { // Get name and network - const { name, networkKey } = decodeName(sentinel.name); + const { name, networkKey, contract } = decodeName(sentinel.name); // Validate if in target networks + + let address: string | undefined; + let abi: any; + if (!targetNetworks.includes(networkKey as NetworkConfig["networkKey"])) { return; } @@ -57,6 +67,27 @@ export const updateSentinel = async (networks: NetworkConfig[]) => { (network) => network.networkKey === networkKey, ); + if (contract === "minter") { + address = network?.contractAddress; + abi = HypercertMinterAbi; + } + + if (contract === "exchange") { + const deployment = + deployments[asDeployedChain(network.chainId.toString())]; + address = deployment.HypercertExchange; + abi = HypercertExchangeAbi; + } + + if (!address) { + console.error(`No address found for ${sentinel.subscriberId}`); + return; + } + if (!abi) { + console.error(`No abi found for ${sentinel.subscriberId}`); + return; + } + // Update sentinel console.log( `Updating ${sentinel.subscriberId} from ./build/relay/${name} on ${networkKey}`, @@ -65,7 +96,7 @@ export const updateSentinel = async (networks: NetworkConfig[]) => { sentinelClient .update(sentinel.subscriberId, { ...sentinel, - addresses: [network.contractAddress], + addresses: [address], abi, }) .then((res) => { diff --git a/defender/webpack.config.cjs b/defender/webpack.config.cjs index bf701568..749abaf2 100644 --- a/defender/webpack.config.cjs +++ b/defender/webpack.config.cjs @@ -9,6 +9,8 @@ module.exports = { "on-allowlist-created": "./src/auto-tasks/on-allowlist-created.ts", "mint-claim-from-allowlist": "./src/auto-tasks/mint-claim-from-allowlist.ts", + "execute-taker-bid": + "./src/auto-tasks/execute-taker-bid.ts", }, target: "node", mode: "development", 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 index a17aed17..91fbd94e 100644 --- a/docs/versioned_sidebars/version-1.0.0-alpha.0-sidebars.json +++ b/docs/versioned_sidebars/version-1.0.0-alpha.0-sidebars.json @@ -25,6 +25,10 @@ "type": "doc", "id": "whitepaper/impact-space" }, + { + "type": "doc", + "id": "whitepaper/evaluation" + }, { "type": "doc", "id": "whitepaper/retrospective-funding" @@ -60,6 +64,10 @@ "type": "doc", "id": "developer/split-merge" }, + { + "type": "doc", + "id": "developer/evaluations" + }, { "type": "doc", "id": "developer/burning" @@ -79,25 +87,29 @@ "items": [ { "type": "category", - "label": "Contracts", + "label": "Protocol", "collapsed": true, "items": [ { "type": "autogenerated", - "dirName": "developer/api/contracts" + "dirName": "developer/api/contracts/protocol" } ] }, { "type": "category", - "label": "SDK", + "label": "Exchange", "collapsed": true, "items": [ { "type": "autogenerated", - "dirName": "developer/api/sdk" + "dirName": "developer/api/contracts/marketplace" } ] + }, + { + "type": "doc", + "id": "developer/api/sdk/modules" } ] } diff --git a/frontend/.env.local.example b/frontend/.env.local.example index d6275350..6db8ed46 100644 --- a/frontend/.env.local.example +++ b/frontend/.env.local.example @@ -8,9 +8,9 @@ NEXT_PUBLIC_DOMAIN=testnet.hypercerts.org ## Web3 ####### ### UUPS proxy contract address -NEXT_PUBLIC_CONTRACT_ADDRESS=0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07 +NEXT_PUBLIC_CONTRACT_ADDRESS=0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941 ### Subgraph URL - currently using hosted service -NEXT_PUBLIC_GRAPH_URL=https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-testnet +NEXT_PUBLIC_GRAPH_URL=https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-sepolia ### Wallet connect ID NEXT_PUBLIC_WALLETCONNECT_ID=GET_FROM_https://cloud.walletconnect.com/app diff --git a/frontend/README.md b/frontend/README.md index 5f35cd8a..4c8bac0a 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -6,7 +6,7 @@ This frontend application is currently configured to use Next.js as a static sit All configurations are currently stored in environment variables. See `.env.local.example` to see which variables need to be set. -We have pre-populated the file with the current testnet deployment on Goerli. +We have pre-populated the file with the current testnet deployment on Sepolia. The easiest way to get started is to copy this into `.env.local` and modify the file directly, which `next` will automatically load when running the dev server below. diff --git a/frontend/components/dapp-context.tsx b/frontend/components/dapp-context.tsx index e0d4c179..bed7f318 100644 --- a/frontend/components/dapp-context.tsx +++ b/frontend/components/dapp-context.tsx @@ -31,7 +31,7 @@ import { import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; import React, { ReactNode, useEffect } from "react"; -import { celo, Chain, goerli, optimism, sepolia } from "viem/chains"; +import { celo, Chain, optimism, sepolia } from "viem/chains"; import { configureChains, WagmiConfig, createConfig } from "wagmi"; import { publicProvider } from "wagmi/providers/public"; @@ -44,7 +44,7 @@ import { const queryClient = new QueryClient(); -const TEST_CHAINS = [goerli, sepolia]; +const TEST_CHAINS = [sepolia]; const PROD_CHAINS = [optimism, celo]; export const CHAINS = (isProduction ? PROD_CHAINS : TEST_CHAINS) as Chain[]; diff --git a/frontend/components/dapp-state.tsx b/frontend/components/dapp-state.tsx index 6b4e661a..31e45512 100644 --- a/frontend/components/dapp-state.tsx +++ b/frontend/components/dapp-state.tsx @@ -5,12 +5,12 @@ import { PlasmicCanvasContext } from "@plasmicapp/loader-nextjs"; import { DataProvider } from "@plasmicapp/loader-nextjs"; import "@rainbow-me/rainbowkit/styles.css"; import React, { ReactNode } from "react"; -import { goerli, optimism, hardhat, Chain, sepolia } from "viem/chains"; +import { optimism, hardhat, Chain, sepolia } from "viem/chains"; import { useNetwork } from "wagmi"; const DAPP_STATE_NAME = "DappState"; -const ALL_CHAINS = [optimism, goerli, hardhat, sepolia]; +const ALL_CHAINS = [optimism, hardhat, sepolia]; export interface DappStateData { myAddress?: string; diff --git a/frontend/hooks/hypercerts-client.ts b/frontend/hooks/hypercerts-client.ts index ca7a63af..63143661 100644 --- a/frontend/hooks/hypercerts-client.ts +++ b/frontend/hooks/hypercerts-client.ts @@ -1,6 +1,5 @@ import React, { useEffect } from "react"; -import { NFT_STORAGE_TOKEN, WEB3_STORAGE_TOKEN } from "../lib/config"; import { HypercertClient, HypercertClientConfig } from "@hypercerts-org/sdk"; import { useWalletClient, useNetwork } from "wagmi"; @@ -17,8 +16,6 @@ export const useHypercertClient = ({ const { chain } = useNetwork(); const clientConfig = { chain: overrideChainId ? { id: overrideChainId } : chain, - nftStorageToken: NFT_STORAGE_TOKEN, - web3StorageToken: WEB3_STORAGE_TOKEN, }; const [client, setClient] = React.useState(() => { if (clientConfig.chain?.id && isSupportedChain(clientConfig.chain.id)) { diff --git a/frontend/lib/formatting.ts b/frontend/lib/formatting.ts index 260f7c39..6bfff01a 100644 --- a/frontend/lib/formatting.ts +++ b/frontend/lib/formatting.ts @@ -59,7 +59,7 @@ export const getOpenSeaFractionUrl = ( _tokenId = _tokenId.slice(0, -1); } - return `https://testnets.opensea.io/assets/goerli/${contractAddress}/${_tokenId}`; + return `https://testnets.opensea.io/assets/sepolia/${contractAddress}/${_tokenId}`; }; export const formatAddress = (address: string) => diff --git a/frontend/package.json b/frontend/package.json index 52b39cb1..7d3c08fb 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -25,7 +25,7 @@ "@graphprotocol/client-cli": "^2.2.16", "@hypercerts-org/contracts": "1.0.0", "@hypercerts-org/observabletreemap": "workspace: *", - "@hypercerts-org/sdk": "1.0.3", + "@hypercerts-org/sdk": "1.2.0", "@mui/icons-material": "^5.11.9", "@mui/material": "^5.11.2", "@mui/x-date-pickers": "^5.0.12", diff --git a/graph/networks.json b/graph/networks.json index 28925338..5babcf29 100644 --- a/graph/networks.json +++ b/graph/networks.json @@ -5,12 +5,6 @@ "startBlock": 22079542 } }, - "goerli": { - "HypercertMinter": { - "address": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", - "startBlock": 8537999 - } - }, "optimism": { "HypercertMinter": { "address": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", diff --git a/graph/package.json b/graph/package.json index c6ab7e5f..f983c57d 100644 --- a/graph/package.json +++ b/graph/package.json @@ -9,10 +9,9 @@ "build": "pnpm build:graph && pnpm build:codegen", "build:graph": "graph build", "build:codegen": "graph codegen", - "deploy:test": "pnpm auth && pnpm deploy:goerli && pnpm deploy:sepolia", + "deploy:test": "pnpm auth && pnpm deploy:sepolia", "deploy:prod": "pnpm auth && pnpm deploy:optimism && pnpm deploy:celo", "deploy:celo": "graph deploy --node https://api.thegraph.com/deploy/ --network celo hypercerts-admin/hypercerts-celo", - "deploy:goerli": "graph deploy --node https://api.thegraph.com/deploy/ --network goerli hypercerts-admin/hypercerts-testnet", "deploy:optimism": "graph deploy --node https://api.thegraph.com/deploy/ --network optimism hypercerts-admin/hypercerts-optimism-mainnet", "deploy:sepolia": "graph deploy --node https://api.thegraph.com/deploy/ --network sepolia hypercerts-admin/hypercerts-sepolia", "create-local": "graph create --node http://localhost:8020/ hypercerts-admin/hypercerts-testnet", diff --git a/graph/tests/.latest.json b/graph/tests/.latest.json index 4f9a5e79..59d5886d 100644 --- a/graph/tests/.latest.json +++ b/graph/tests/.latest.json @@ -1,4 +1,4 @@ { "version": "0.6.0", - "timestamp": 1702070097153 + "timestamp": 1703510468280 } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1439bc98..1934926e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -202,8 +202,8 @@ importers: specifier: ^0.95.7 version: 0.95.8(@graphql-mesh/types@0.95.8)(@graphql-mesh/utils@0.95.8)(graphql@16.8.1)(tslib@2.6.2) '@hypercerts-org/contracts': - specifier: 0.8.11 - version: 0.8.11 + specifier: 1.0.0 + version: 1.0.0(ts-node@10.9.1)(typescript@4.9.5) '@openzeppelin/defender-autotask-client': specifier: 1.50.0 version: 1.50.0 @@ -348,8 +348,8 @@ importers: specifier: 'workspace: *' version: link:../vendor/observabletreemap '@hypercerts-org/sdk': - specifier: 1.0.3 - version: 1.0.3(node-fetch@3.3.2)(react@18.2.0)(typescript@5.1.6)(zod@3.22.4) + specifier: 1.2.0 + version: 1.2.0(react@18.2.0)(typescript@5.1.6)(zod@3.22.4) '@mui/icons-material': specifier: ^5.11.9 version: 5.14.15(@mui/material@5.14.15)(@types/react@18.2.33)(react@18.2.0) @@ -594,18 +594,12 @@ importers: loglevel: specifier: ^1.8.1 version: 1.8.1 - nft.storage: - specifier: ^7.1.1 - version: 7.1.1(node-fetch@3.3.2) urql: specifier: ^4.0.6 version: 4.0.6(graphql@16.8.1)(react@18.2.0) viem: - specifier: ^1.19.9 - version: 1.19.9(typescript@5.3.2) - web3.storage: - specifier: ^4.5.5 - version: 4.5.5(node-fetch@3.3.2) + specifier: ^1.19.15 + version: 1.19.15(typescript@5.3.2) devDependencies: '@babel/core': specifier: ^7.23.5 @@ -972,10 +966,6 @@ packages: transitivePeerDependencies: - encoding - /@assemblyscript/loader@0.9.4: - resolution: {integrity: sha512-HazVq9zwTVwGmqdwYzu7WyQ6FQVZ7SwET0KKQuKm55jD0IfUpZgN0OPIiZG3zV1iSrVYcN0bdwLRXI/VNCYsUA==} - dev: false - /@aws-crypto/sha256-js@1.2.2: resolution: {integrity: sha512-Nr1QJIbW/afYYGzYvrF70LtaHrIRtd4TNAglX8BvlfxJLZ45SAmueIKYl5tWoNBPzp65ymXGFK0Bb1vZUpuc9g==} dependencies: @@ -7318,8 +7308,16 @@ packages: /@humanwhocodes/object-schema@2.0.1: resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} - /@hypercerts-org/contracts@0.8.11: - resolution: {integrity: sha512-n6fwMsaoR50VITM2upR4OOi4EZJmZvU6vvXrHWCSakP9e1OeDuAOk+kHiK+egqDRYj6uKtg9VTUFKZBYvu3jRg==} + /@hypercerts-org/contracts@1.0.0(ts-node@10.9.1)(typescript@4.9.5): + resolution: {integrity: sha512-pGdG3BGDz93IZXAAHcvwzRQOMgi9dOzy2ZLdRFKIdWMBoVz8uCQL03HCYutT5DOtVm2g+j2dcor+zSV5yUM5Dg==} + dependencies: + hardhat: 2.19.1(ts-node@10.9.1)(typescript@4.9.5) + transitivePeerDependencies: + - bufferutil + - supports-color + - ts-node + - typescript + - utf-8-validate dev: false /@hypercerts-org/contracts@1.0.0(ts-node@10.9.1)(typescript@5.3.2): @@ -7346,8 +7344,8 @@ packages: - utf-8-validate dev: false - /@hypercerts-org/sdk@1.0.3(node-fetch@3.3.2)(react@18.2.0)(typescript@5.1.6)(zod@3.22.4): - resolution: {integrity: sha512-drZy1kVFuSbelIBgM51ScJNOyahDKTrNIALO9ApIA7ZnoBC5hr3zsMwzpUCmq3AvPQTu6PssPoeJY28Hru40+A==} + /@hypercerts-org/sdk@1.2.0(react@18.2.0)(typescript@5.1.6)(zod@3.22.4): + resolution: {integrity: sha512-khaB4m8PYaZ/Kv69miu0t/WfQf56T/pJ8V7+U1VWs8rGdVExi62NntIxkWdJ0LQMsrmlN3kLSAEQAlIpYujHpg==} dependencies: '@ethereum-attestation-service/eas-sdk': 1.3.7(typescript@5.1.6) '@ethersproject/abstract-signer': 5.7.0 @@ -7362,15 +7360,11 @@ packages: ethers: 5.7.2 graphql: 16.8.1 loglevel: 1.8.1 - nft.storage: 7.1.1(node-fetch@3.3.2) urql: 4.0.6(graphql@16.8.1)(react@18.2.0) viem: 1.19.15(typescript@5.1.6)(zod@3.22.4) - web3.storage: 4.5.5(node-fetch@3.3.2) transitivePeerDependencies: - bufferutil - debug - - encoding - - node-fetch - react - supports-color - ts-node @@ -7387,26 +7381,12 @@ packages: resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} dev: false - /@ipld/car@3.2.4: - resolution: {integrity: sha512-rezKd+jk8AsTGOoJKqzfjLJ3WVft7NZNH95f0pfPbicROvzTyvHCNy567HzSUd6gRXZ9im29z5ZEv9Hw49jSYw==} - dependencies: - '@ipld/dag-cbor': 7.0.3 - multiformats: 9.9.0 - varint: 6.0.0 - dev: false - - /@ipld/dag-cbor@6.0.15: - resolution: {integrity: sha512-Vm3VTSTwlmGV92a3C5aeY+r2A18zbH2amehNhsX8PBa3muXICaWrN8Uri85A5hLH7D7ElhE8PdjxD6kNqUmTZA==} - dependencies: - cborg: 1.10.2 - multiformats: 9.9.0 - dev: false - /@ipld/dag-cbor@7.0.3: resolution: {integrity: sha512-1VVh2huHsuohdXC1bGJNE8WR72slZ9XE2T3wbBBq31dm7ZBatmKLLxrB+XAqafxfRFjv08RZmj/W/ZqaM13AuA==} dependencies: cborg: 1.10.2 multiformats: 9.9.0 + dev: true /@ipld/dag-json@8.0.11: resolution: {integrity: sha512-Pea7JXeYHTWXRTIhBqBlhw7G53PJ7yta3G/sizGEZyzdeEwhZRr0od5IQ0r2ZxOt1Do+2czddjeEPp+YTxDwCA==} @@ -7419,6 +7399,7 @@ packages: resolution: {integrity: sha512-ZBnf2fuX9y3KccADURG5vb9FaOeMjFkCrNysB0PtftME/4iCTjxfaLoNq/IAh5fTqUOMXvryN6Jyka4ZGuMLIg==} dependencies: multiformats: 9.9.0 + dev: true /@isaacs/cliui@8.0.2: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} @@ -8303,13 +8284,6 @@ packages: - '@types/react' dev: false - /@multiformats/murmur3@1.1.3: - resolution: {integrity: sha512-wAPLUErGR8g6Lt+bAZn6218k9YQPym+sjszsXL6o4zfxbA22P+gxWZuuD9wDbwL55xrKO5idpcuQUX7/E3oHcw==} - dependencies: - multiformats: 9.9.0 - murmurhash3js-revisited: 3.0.0 - dev: false - /@next/env@13.5.6: resolution: {integrity: sha512-Yac/bV5sBGkkEXmAX5FWPS9Mmo2rthrOPRQQNfycJPkjUAUclomCPH7QFVCDQ4Mp2k2K1SSM6m0zrxYrOwtFQw==} dev: false @@ -8424,10 +8398,6 @@ packages: dependencies: '@noble/hashes': 1.3.2 - /@noble/ed25519@1.7.3: - resolution: {integrity: sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ==} - dev: false - /@noble/hashes@1.2.0: resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==} @@ -9651,36 +9621,46 @@ packages: /@protobufjs/aspromise@1.1.2: resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} + dev: true /@protobufjs/base64@1.1.2: resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==} + dev: true /@protobufjs/codegen@2.0.4: resolution: {integrity: sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==} + dev: true /@protobufjs/eventemitter@1.1.0: resolution: {integrity: sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==} + dev: true /@protobufjs/fetch@1.1.0: resolution: {integrity: sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==} dependencies: '@protobufjs/aspromise': 1.1.2 '@protobufjs/inquire': 1.1.0 + dev: true /@protobufjs/float@1.0.2: resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==} + dev: true /@protobufjs/inquire@1.1.0: resolution: {integrity: sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==} + dev: true /@protobufjs/path@1.1.2: resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==} + dev: true /@protobufjs/pool@1.1.0: resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==} + dev: true /@protobufjs/utf8@1.1.0: resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} + dev: true /@rainbow-me/rainbowkit@1.3.1(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(viem@1.19.15)(wagmi@1.4.12): resolution: {integrity: sha512-4Upi+S12ZHosimzlUpCiOocg4dtfGU2wkzcpxeat/FYHrvhVIOgm0TuzbsIM96W1p7OXabosd7xuxPvwduUygQ==} @@ -11669,6 +11649,7 @@ packages: /@types/long@4.0.2: resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} + dev: true /@types/lru-cache@5.1.1: resolution: {integrity: sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==} @@ -11697,6 +11678,7 @@ packages: /@types/minimatch@3.0.5: resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==} + dev: true /@types/minimatch@5.1.2: resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} @@ -11704,6 +11686,7 @@ packages: /@types/minimist@1.2.4: resolution: {integrity: sha512-Kfe/D3hxHTusnPNRbycJE1N77WHDsdS4AjUYIzlDzhDrS47NrwuL3YW4VITxwR7KCVpzwgy4Rbj829KSSQmwXQ==} + dev: true /@types/mocha@9.1.0: resolution: {integrity: sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==} @@ -11746,6 +11729,7 @@ packages: /@types/normalize-package-data@2.4.3: resolution: {integrity: sha512-ehPtgRgaULsFG8x0NeYJvmyH1hmlfsNLujHe9dQEia/7MAJYdzMSi19JtchUHjmBA6XC/75dK55mzZH+RyieSg==} + dev: true /@types/papaparse@5.3.10: resolution: {integrity: sha512-mS1Fta/xJ9EDYmAvpeWzcV9Gr0cOl1ClpW7di9+wSUNDIDO55tBtyXg97O7K+Syrd9rDEmuejM2iqmJIJ1SO5g==} @@ -13072,59 +13056,6 @@ packages: tslib: 1.14.1 dev: false - /@web-std/blob@3.0.5: - resolution: {integrity: sha512-Lm03qr0eT3PoLBuhkvFBLf0EFkAsNz/G/AYCzpOdi483aFaVX86b4iQs0OHhzHJfN5C15q17UtDbyABjlzM96A==} - dependencies: - '@web-std/stream': 1.0.0 - web-encoding: 1.1.5 - dev: false - - /@web-std/fetch@4.2.1: - resolution: {integrity: sha512-M6sgHDgKegcjuVsq8J6jb/4XvhPGui8uwp3EIoADGXUnBl9vKzKLk9H9iFzrPJ6fSV6zZzFWXPyziBJp9hxzBA==} - engines: {node: ^10.17 || >=12.3} - dependencies: - '@web-std/blob': 3.0.5 - '@web-std/file': 3.0.3 - '@web-std/form-data': 3.1.0 - '@web-std/stream': 1.0.3 - '@web3-storage/multipart-parser': 1.0.0 - abort-controller: 3.0.0 - data-uri-to-buffer: 3.0.1 - mrmime: 1.0.1 - dev: false - - /@web-std/file@3.0.3: - resolution: {integrity: sha512-X7YYyvEERBbaDfJeC9lBKC5Q5lIEWYCP1SNftJNwNH/VbFhdHm+3neKOQP+kWEYJmosbDFq+NEUG7+XIvet/Jw==} - dependencies: - '@web-std/blob': 3.0.5 - dev: false - - /@web-std/form-data@3.1.0: - resolution: {integrity: sha512-WkOrB8rnc2hEK2iVhDl9TFiPMptmxJA1HaIzSdc2/qk3XS4Ny4cCt6/V36U3XmoYKz0Md2YyK2uOZecoZWPAcA==} - dependencies: - web-encoding: 1.1.5 - dev: false - - /@web-std/stream@1.0.0: - resolution: {integrity: sha512-jyIbdVl+0ZJyKGTV0Ohb9E6UnxP+t7ZzX4Do3AHjZKxUXKMs9EmqnBDQgHF7bEw0EzbQygOjtt/7gvtmi//iCQ==} - dependencies: - web-streams-polyfill: 3.2.1 - dev: false - - /@web-std/stream@1.0.3: - resolution: {integrity: sha512-5MIngxWyq4rQiGoDAC2WhjLuDraW8+ff2LD2et4NRY933K3gL8CHlUXrh8ZZ3dC9A9Xaub8c9sl5exOJE58D9Q==} - dependencies: - web-streams-polyfill: 3.2.1 - dev: false - - /@web3-storage/multipart-parser@1.0.0: - resolution: {integrity: sha512-BEO6al7BYqcnfX15W2cnGR+Q566ACXAT9UQykORCWW80lmkpWsnEob6zJS1ZVBKsSJC8+7vJkHwlp+lXG1UCdw==} - dev: false - - /@web3-storage/parse-link-header@3.1.0: - resolution: {integrity: sha512-K1undnK70vLLauqdE8bq/l98isTF2FDhcP0UPpXVSjkSWe3xhAn5eRXk5jfA1E5ycNm84Ws/rQFUD7ue11nciw==} - dev: false - /@webassemblyjs/ast@1.11.6: resolution: {integrity: sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==} dependencies: @@ -13345,12 +13276,6 @@ packages: resolution: {integrity: sha512-g5QiLIfbg3pLuYUJPlisNKY+epQJTcMDsOnVNkscrDP1oi7vmJnzOANYJI/1pZcVJ6umUkBv3aFtlg1UvUHGzA==} dev: false - /@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: resolution: {integrity: sha512-mn0KSip7N4e0UDPZHnqDsHECo5uGQrixQKnAskOM1BIB8hd7QKbd6il8IPRPudPHOeHiECoCFqhyMaRO9+nWyA==} dependencies: @@ -13776,9 +13701,11 @@ packages: dependencies: abort-controller: 3.0.0 native-abort-controller: 1.0.4(abort-controller@3.0.0) + dev: true /any-signal@3.0.1: resolution: {integrity: sha512-xgZgJtKEa9YmDqXodIgl7Fl1C8yNXr8w6gXjqK3LW4GcEiYT+6AQfJSE/8SPsEpLLmcvbv8YU+qet94UewHxqg==} + dev: true /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} @@ -13997,6 +13924,7 @@ packages: /arrify@1.0.1: resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} engines: {node: '>=0.10.0'} + dev: true /asap@2.0.6: resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} @@ -14546,14 +14474,6 @@ packages: inherits: 2.0.4 readable-stream: 3.6.2 - /bl@5.1.0: - resolution: {integrity: sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==} - dependencies: - buffer: 6.0.3 - inherits: 2.0.4 - readable-stream: 3.6.2 - dev: false - /blake3-wasm@2.1.5: resolution: {integrity: sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==} dev: true @@ -14565,24 +14485,12 @@ packages: resolution: {integrity: sha512-iCmk0W4NdbrWgRRuxOriU8aM5ijeVLI61Zulsmg/lUHNr7pYjoj+U77opLefNagevtrrbMt3JQ5Qip7ar178kA==} dependencies: browser-readablestream-to-it: 1.0.3 + dev: true /blob-util@2.0.2: resolution: {integrity: sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==} dev: true - /blockstore-core@1.0.5: - resolution: {integrity: sha512-i/9CUMMvBALVbtSqUIuiWB3tk//a4Q2I2CEWiBuYNnhJvk/DWplXjLt8Sqc5VGkRVXVPSsEuH8fUtqJt5UFYcA==} - dependencies: - err-code: 3.0.1 - interface-blockstore: 2.0.3 - interface-store: 2.0.2 - it-all: 1.0.6 - it-drain: 1.0.5 - it-filter: 1.0.3 - it-take: 1.0.2 - multiformats: 9.9.0 - dev: false - /bluebird@3.7.1: resolution: {integrity: sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg==} dev: true @@ -14703,6 +14611,7 @@ packages: /browser-readablestream-to-it@1.0.3: resolution: {integrity: sha512-+12sHB+Br8HIh6VAMVEG5r3UXCyESIgDW7kzk3BjIXa43DVqVwL7GC5TW3jeh+72dtcH99pPVpw0X8i0jt+/kw==} + dev: true /browser-stdout@1.3.1: resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} @@ -14942,6 +14851,7 @@ packages: camelcase: 5.3.1 map-obj: 4.3.0 quick-lru: 4.0.1 + dev: true /camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} @@ -14975,15 +14885,6 @@ packages: tslib: 2.6.2 upper-case-first: 2.0.2 - /carbites@1.0.6: - resolution: {integrity: sha512-dS9IQvnrb5VIRvSTNz5Ff+mB9d2MFfi5mojtJi7Rlss79VeF190jr0sZdA7eW0CGHotvHkZaWuM6wgfD9PEFRg==} - dependencies: - '@ipld/car': 3.2.4 - '@ipld/dag-cbor': 6.0.15 - '@ipld/dag-pb': 2.1.18 - multiformats: 9.9.0 - dev: false - /cardinal@2.1.1: resolution: {integrity: sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==} dependencies: @@ -15019,6 +14920,7 @@ packages: /cborg@1.10.2: resolution: {integrity: sha512-b3tFPA9pUr2zCUiCfRd2+wok2/LBSNUMKOuRRok+WlvvAgEt/PlbgPTsZUcwCOs53IJvLgTp0eotwtosE6njug==} + dev: true /ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -15275,6 +15177,7 @@ packages: /class-is@1.1.0: resolution: {integrity: sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==} + dev: true /classic-level@1.3.0: resolution: {integrity: sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==} @@ -16717,11 +16620,6 @@ packages: assert-plus: 1.0.0 dev: true - /data-uri-to-buffer@3.0.1: - resolution: {integrity: sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==} - engines: {node: '>= 6'} - dev: false - /data-uri-to-buffer@4.0.1: resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} engines: {node: '>= 12'} @@ -16793,6 +16691,7 @@ packages: dependencies: decamelize: 1.2.0 map-obj: 1.0.1 + dev: true /decamelize@1.2.0: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} @@ -17177,6 +17076,7 @@ packages: transitivePeerDependencies: - node-fetch - supports-color + dev: true /dns-packet@5.6.1: resolution: {integrity: sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==} @@ -17448,6 +17348,7 @@ packages: engines: {node: '>=6'} dependencies: encoding: 0.1.13 + dev: true /electron-to-chromium@1.4.567: resolution: {integrity: sha512-8KR114CAYQ4/r5EIEsOmOMqQ9j0MRbJZR3aXD/KFA8RuKzyoUB4XrUCg+l8RUGqTVQgKNIgTpjaG8YHRPAbX2w==} @@ -17505,6 +17406,7 @@ packages: resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} dependencies: iconv-lite: 0.6.3 + dev: true /end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} @@ -17568,6 +17470,7 @@ packages: /err-code@3.0.1: resolution: {integrity: sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==} + dev: true /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -18880,6 +18783,7 @@ packages: /fast-fifo@1.3.2: resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==} + dev: true /fast-glob@3.3.1: resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} @@ -19112,15 +19016,6 @@ packages: trim-repeated: 1.0.0 dev: true - /files-from-path@0.2.6: - resolution: {integrity: sha512-Mz4UNkv+WcRLxcCXAORbfpwYiXI60SN9C1ZfeyGFv0xQUmblgbOkSWwFwX+Ov/TaR3FEyzwDyPnCQjpPRGSxKA==} - dependencies: - err-code: 3.0.1 - graceful-fs: 4.2.11 - ipfs-unixfs: 6.0.9 - it-glob: 0.0.13 - dev: false - /filesize@8.0.7: resolution: {integrity: sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ==} engines: {node: '>= 0.4.0'} @@ -19621,6 +19516,7 @@ packages: /get-iterator@1.0.2: resolution: {integrity: sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg==} + dev: true /get-nonce@1.0.1: resolution: {integrity: sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==} @@ -20237,14 +20133,6 @@ packages: unenv: 1.8.0 dev: false - /hamt-sharding@2.0.1: - resolution: {integrity: sha512-vnjrmdXG9dDs1m/H4iJ6z0JFI2NtgsW5keRkTcM85NGak69Mkf5PHUqBz+Xs0T4sg0ppvj9O5EGAJo40FTxmmA==} - engines: {node: '>=10.0.0', npm: '>=6.0.0'} - dependencies: - sparse-array: 1.3.2 - uint8arrays: 3.1.1 - dev: false - /handle-thing@2.0.1: resolution: {integrity: sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==} @@ -20276,6 +20164,7 @@ packages: /hard-rejection@2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} engines: {node: '>=6'} + dev: true /hardhat-abi-exporter@2.10.1(hardhat@2.18.3): resolution: {integrity: sha512-X8GRxUTtebMAd2k4fcPyVnCdPa6dYK4lBsrwzKP5yiSq4i+WadWPIumaLfce53TUf/o2TnLpLOduyO1ylE2NHQ==} @@ -20380,6 +20269,74 @@ packages: - supports-color - utf-8-validate + /hardhat@2.19.1(ts-node@10.9.1)(typescript@4.9.5): + 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@4.9.5) + tsort: 0.0.1 + typescript: 4.9.5 + undici: 5.26.5 + uuid: 8.3.2 + ws: 7.5.9 + transitivePeerDependencies: + - bufferutil + - supports-color + - 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 @@ -20853,12 +20810,14 @@ packages: /hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + dev: true /hosted-git-info@4.1.0: resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} engines: {node: '>=10'} dependencies: lru-cache: 6.0.0 + dev: true /hotscript@1.0.13: resolution: {integrity: sha512-C++tTF1GqkGYecL+2S1wJTfoH6APGAsbb7PAWQ3iVIwgG/EFseAfEVOKFgAFq4yK3+6j1EjUD4UQ9dRJHX/sSQ==} @@ -21377,22 +21336,17 @@ packages: wrap-ansi: 7.0.0 dev: true - /interface-blockstore@2.0.3: - resolution: {integrity: sha512-OwVUnlNcx7H5HloK0Myv6c/C1q9cNG11HX6afdeU6q6kbuNj8jKCwVnmJHhC94LZaJ+9hvVOk4IUstb3Esg81w==} - dependencies: - interface-store: 2.0.2 - multiformats: 9.9.0 - dev: false - /interface-datastore@6.1.1: resolution: {integrity: sha512-AmCS+9CT34pp2u0QQVXjKztkuq3y5T+BIciuiHDDtDZucZD8VudosnSdUyXJV6IsRkN5jc4RFDhCk1O6Q3Gxjg==} dependencies: interface-store: 2.0.2 nanoid: 3.3.6 uint8arrays: 3.1.1 + dev: true /interface-store@2.0.2: resolution: {integrity: sha512-rScRlhDcz6k199EkHqT8NpM87ebN89ICOzILoBHgaG36/WX50N32BnU/kpZgCGPLhARRAWUUX5/cyaIjt7Kipg==} + dev: true /internal-slot@1.0.6: resolution: {integrity: sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==} @@ -21458,6 +21412,7 @@ packages: /ip-regex@4.3.0: resolution: {integrity: sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==} engines: {node: '>=8'} + dev: true /ip@1.1.8: resolution: {integrity: sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==} @@ -21471,77 +21426,6 @@ packages: resolution: {integrity: sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==} engines: {node: '>= 10'} - /ipfs-car@0.6.2(node-fetch@3.3.2): - resolution: {integrity: sha512-tliuakkKKtCa4TTnFT3zJKjq/aD8EGKX8Y0ybCyrAW0fo/n2koZpxiLjBvtTs47Rqyji6ggXo+atPbJJ60hJmg==} - dependencies: - '@ipld/car': 3.2.4 - '@web-std/blob': 3.0.5 - bl: 5.1.0 - blockstore-core: 1.0.5 - browser-readablestream-to-it: 1.0.3 - idb-keyval: 6.2.1 - interface-blockstore: 2.0.3 - ipfs-core-types: 0.8.4(node-fetch@3.3.2) - ipfs-core-utils: 0.12.2(node-fetch@3.3.2) - ipfs-unixfs-exporter: 7.0.11 - ipfs-unixfs-importer: 9.0.10 - ipfs-utils: 9.0.14 - it-all: 1.0.6 - it-last: 1.0.6 - it-pipe: 1.1.0 - meow: 9.0.0 - move-file: 2.1.0 - multiformats: 9.9.0 - stream-to-it: 0.2.4 - streaming-iterables: 6.2.0 - uint8arrays: 3.1.1 - transitivePeerDependencies: - - encoding - - node-fetch - - supports-color - dev: false - - /ipfs-car@0.7.0(node-fetch@3.3.2): - resolution: {integrity: sha512-9ser6WWZ1ZMTCGbcVkRXUzOrpQ4SIiLfzIEnk+3LQsXbV09yeZg3ijhRuEXozEIYE68Go9JmOFshamsK9iKlNQ==} - dependencies: - '@ipld/car': 3.2.4 - '@web-std/blob': 3.0.5 - bl: 5.1.0 - blockstore-core: 1.0.5 - browser-readablestream-to-it: 1.0.3 - idb-keyval: 6.2.1 - interface-blockstore: 2.0.3 - ipfs-core-types: 0.8.4(node-fetch@3.3.2) - ipfs-core-utils: 0.12.2(node-fetch@3.3.2) - ipfs-unixfs-exporter: 7.0.11 - ipfs-unixfs-importer: 9.0.10 - ipfs-utils: 9.0.14 - it-all: 1.0.6 - it-last: 1.0.6 - it-pipe: 1.1.0 - meow: 9.0.0 - move-file: 2.1.0 - multiformats: 9.9.0 - stream-to-it: 0.2.4 - streaming-iterables: 6.2.0 - uint8arrays: 3.1.1 - transitivePeerDependencies: - - encoding - - node-fetch - - supports-color - dev: false - - /ipfs-core-types@0.8.4(node-fetch@3.3.2): - resolution: {integrity: sha512-sbRZA1QX3xJ6ywTiVQZMOxhlhp4osAZX2SXx3azOLxAtxmGWDMkHYt722VV4nZ2GyJy8qyk5GHQIZ0uvQnpaTg==} - dependencies: - interface-datastore: 6.1.1 - multiaddr: 10.0.1(node-fetch@3.3.2) - multiformats: 9.9.0 - transitivePeerDependencies: - - node-fetch - - supports-color - dev: false - /ipfs-core-types@0.9.0(node-fetch@3.3.2): resolution: {integrity: sha512-VJ8vJSHvI1Zm7/SxsZo03T+zzpsg8pkgiIi5hfwSJlsrJ1E2v68QPlnLshGHUSYw89Oxq0IbETYl2pGTFHTWfg==} dependencies: @@ -21553,35 +21437,6 @@ packages: - supports-color dev: true - /ipfs-core-utils@0.12.2(node-fetch@3.3.2): - resolution: {integrity: sha512-RfxP3rPhXuqKIUmTAUhmee6fmaV3A7LMnjOUikRKpSyqESz/DR7aGK7tbttMxkZdkSEr0rFXlqbyb0vVwmn0wQ==} - dependencies: - any-signal: 2.1.2 - blob-to-it: 1.0.4 - browser-readablestream-to-it: 1.0.3 - debug: 4.3.4(supports-color@8.1.1) - err-code: 3.0.1 - ipfs-core-types: 0.8.4(node-fetch@3.3.2) - ipfs-unixfs: 6.0.9 - ipfs-utils: 9.0.14 - it-all: 1.0.6 - it-map: 1.0.6 - it-peekable: 1.0.3 - it-to-stream: 1.0.0 - merge-options: 3.0.4 - multiaddr: 10.0.1(node-fetch@3.3.2) - multiaddr-to-uri: 8.0.0(node-fetch@3.3.2) - multiformats: 9.9.0 - nanoid: 3.3.6 - parse-duration: 1.1.0 - timeout-abort-controller: 1.1.1 - uint8arrays: 3.1.1 - transitivePeerDependencies: - - encoding - - node-fetch - - supports-color - dev: false - /ipfs-core-utils@0.13.0(node-fetch@3.3.2): resolution: {integrity: sha512-HP5EafxU4/dLW3U13CFsgqVO5Ika8N4sRSIb/dTg16NjLOozMH31TXV0Grtu2ZWo1T10ahTzMvrfT5f4mhioXw==} dependencies: @@ -21640,52 +21495,13 @@ packages: - supports-color dev: true - /ipfs-unixfs-exporter@7.0.11: - resolution: {integrity: sha512-qTYa69J7HbI2EIYNUddKPg9Y3rHkYZV0bNdmzZKA5+ZbwRVoUEuBW/cguEqTp22zHygh3sMnzYZFm0naVIdMgQ==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@ipld/dag-cbor': 7.0.3 - '@ipld/dag-pb': 2.1.18 - '@multiformats/murmur3': 1.1.3 - err-code: 3.0.1 - hamt-sharding: 2.0.1 - interface-blockstore: 2.0.3 - ipfs-unixfs: 6.0.9 - it-last: 1.0.6 - multiformats: 9.9.0 - uint8arrays: 3.1.1 - dev: false - - /ipfs-unixfs-importer@9.0.10: - resolution: {integrity: sha512-W+tQTVcSmXtFh7FWYWwPBGXJ1xDgREbIyI1E5JzDcimZLIyT5gGMfxR3oKPxxWj+GKMpP5ilvMQrbsPzWcm3Fw==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@ipld/dag-pb': 2.1.18 - '@multiformats/murmur3': 1.1.3 - bl: 5.1.0 - err-code: 3.0.1 - hamt-sharding: 2.0.1 - interface-blockstore: 2.0.3 - ipfs-unixfs: 6.0.9 - it-all: 1.0.6 - it-batch: 1.0.9 - it-first: 1.0.7 - it-parallel-batch: 1.0.11 - merge-options: 3.0.4 - multiformats: 9.9.0 - rabin-wasm: 0.1.5 - uint8arrays: 3.1.1 - transitivePeerDependencies: - - encoding - - supports-color - dev: false - /ipfs-unixfs@6.0.9: resolution: {integrity: sha512-0DQ7p0/9dRB6XCb0mVCTli33GzIzSVx5udpJuVM47tGcD+W+Bl4LsnoLswd3ggNnNEakMv1FdoFITiEnchXDqQ==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: err-code: 3.0.1 protobufjs: 6.11.4 + dev: true /ipfs-utils@9.0.14: resolution: {integrity: sha512-zIaiEGX18QATxgaS0/EOQNoo33W0islREABAcxXE8n7y2MGAlB+hdsxXn4J0hGZge8IqVQhW8sWIb+oJz2yEvg==} @@ -21709,24 +21525,7 @@ packages: stream-to-it: 0.2.4 transitivePeerDependencies: - encoding - - /ipns@0.16.0: - resolution: {integrity: sha512-fBYkRjN3/fc6IQujUF4WBEyOXegK715w+wx9IErV6H2B5JXsMnHOBceUKn3L90dj+wJfHs6T+hM/OZiTT6mQCw==} - dependencies: - cborg: 1.10.2 - debug: 4.3.4(supports-color@8.1.1) - err-code: 3.0.1 - interface-datastore: 6.1.1 - libp2p-crypto: 0.21.2 - long: 4.0.0 - multiformats: 9.9.0 - peer-id: 0.16.0 - protobufjs: 6.11.4 - timestamp-nano: 1.0.1 - uint8arrays: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: false + dev: true /iron-webcrypto@1.0.0: resolution: {integrity: sha512-anOK1Mktt8U1Xi7fCM3RELTuYbnFikQY5VtrDj7kPgpejV7d43tWKhzgioO0zpkazLEL/j/iayRqnJhrGfqUsg==} @@ -21845,6 +21644,7 @@ packages: /is-electron@2.2.2: resolution: {integrity: sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==} + dev: true /is-extendable@0.1.1: resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} @@ -21920,6 +21720,7 @@ packages: engines: {node: '>=8'} dependencies: ip-regex: 4.3.0 + dev: true /is-lower-case@2.0.2: resolution: {integrity: sha512-bVcMJy4X5Og6VZfdOZstSexlEy20Sr0k/p/b2IlQJlfdKAQuMpiv5w2Ccxb8sKdRUNAG1PnHVHjFSdRDVS6NlQ==} @@ -21984,6 +21785,7 @@ packages: /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} + dev: true /is-plain-obj@2.1.0: resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} @@ -22206,17 +22008,10 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - /iso-random-stream@2.0.2: - resolution: {integrity: sha512-yJvs+Nnelic1L2vH2JzWvvPQFA4r7kSTnpST/+LkAQjSz0hos2oqLD+qIVi9Qk38Hoe7mNDt3j0S27R58MVjLQ==} - engines: {node: '>=10'} - dependencies: - events: 3.3.0 - readable-stream: 3.6.2 - dev: false - /iso-url@1.2.1: resolution: {integrity: sha512-9JPDgCN4B7QPkLtYAAOrEuAWvP9rWvR5offAr0/SeF046wIkglqH3VXgYYP6NcsKslH80UIVgmPqNe3j7tG2ng==} engines: {node: '>=12'} + dev: true /isobject@3.0.1: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} @@ -22380,61 +22175,34 @@ packages: /it-all@1.0.6: resolution: {integrity: sha512-3cmCc6Heqe3uWi3CVM/k51fa/XbMFpQVzFoDsV0IZNHSQDyAXl3c4MjHkFX5kF3922OGj7Myv1nSEUgRtcuM1A==} + dev: true /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==} - dev: false - - /it-drain@1.0.5: - resolution: {integrity: sha512-r/GjkiW1bZswC04TNmUnLxa6uovme7KKwPhc+cb1hHU65E3AByypHH6Pm91WHuvqfFsm+9ws0kPtDBV3/8vmIg==} - dev: false - - /it-filter@1.0.3: - resolution: {integrity: sha512-EI3HpzUrKjTH01miLHWmhNWy3Xpbx4OXMXltgrNprL5lDpF3giVpHIouFpr5l+evXw6aOfxhnt01BIB+4VQA+w==} - dev: false - /it-first@1.0.7: resolution: {integrity: sha512-nvJKZoBpZD/6Rtde6FXqwDqDZGF1sCADmr2Zoc0hZsIvnE449gRFnGctxDf09Bzc/FWnHXAdaHVIetY6lrE0/g==} - - /it-glob@0.0.13: - resolution: {integrity: sha512-0Hcd5BraJUPzL28NWiFbdNrcdyNxNTKKdU3sjdFiYynNTQpwlG2UKW31X7bp+XhJwux/oPzIquo5ioztVmc2RQ==} - dependencies: - '@types/minimatch': 3.0.5 - minimatch: 3.1.2 - dev: false + dev: true /it-glob@1.0.2: resolution: {integrity: sha512-Ch2Dzhw4URfB9L/0ZHyY+uqOnKvBNeS/SMcRiPmJfpHiM0TsUZn+GkpcZxAoF3dJVdPm/PuIk3A4wlV7SUo23Q==} dependencies: '@types/minimatch': 3.0.5 minimatch: 3.1.2 + dev: true /it-last@1.0.6: resolution: {integrity: sha512-aFGeibeiX/lM4bX3JY0OkVCFkAw8+n9lkukkLNivbJRvNz8lI3YXv5xcqhFUV2lDJiraEK3OXRDbGuevnnR67Q==} + dev: true /it-map@1.0.6: resolution: {integrity: sha512-XT4/RM6UHIFG9IobGlQPFQUrlEKkU4eBUFG3qhWhfAdh1JfF2x11ShCrKCdmZ0OiZppPfoLuzcfA4cey6q3UAQ==} - - /it-parallel-batch@1.0.11: - resolution: {integrity: sha512-UWsWHv/kqBpMRmyZJzlmZeoAMA0F3SZr08FBdbhtbe+MtoEBgr/ZUAKrnenhXCBrsopy76QjRH2K/V8kNdupbQ==} - dependencies: - it-batch: 1.0.9 - dev: false + dev: true /it-peekable@1.0.3: resolution: {integrity: sha512-5+8zemFS+wSfIkSZyf0Zh5kNN+iGyccN02914BY4w/Dj+uoFEoPSvj5vaWn8pNZJNSxzjW0zHRxC3LUb2KWJTQ==} - - /it-pipe@1.1.0: - resolution: {integrity: sha512-lF0/3qTVeth13TOnHVs0BTFaziwQF7m5Gg+E6JV0BXcLKutC92YjSi7bASgkPOXaLEb+YvNZrPorGMBIJvZfxg==} - dev: false - - /it-take@1.0.2: - resolution: {integrity: sha512-u7I6qhhxH7pSevcYNaMECtkvZW365ARqAIt9K+xjdK1B2WUDEjQSfETkOCT8bxFq/59LqrN3cMLUtTgmDBaygw==} - dev: false + dev: true /it-to-stream@1.0.0: resolution: {integrity: sha512-pLULMZMAB/+vbdvbZtebC0nWBTbG581lk6w8P7DfIIIKUfa8FbY7Oi0FxZcFPbxvISs7A9E+cMpLDBc1XhpAOA==} @@ -22445,6 +22213,7 @@ packages: p-defer: 3.0.0 p-fifo: 1.0.0 readable-stream: 3.6.2 + dev: true /iterator.prototype@1.1.2: resolution: {integrity: sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==} @@ -23432,20 +23201,6 @@ packages: prelude-ls: 1.2.1 type-check: 0.4.0 - /libp2p-crypto@0.21.2: - resolution: {integrity: sha512-EXFrhSpiHtJ+/L8xXDvQNK5VjUMG51u878jzZcaT5XhuN/zFg6PWJFnl/qB2Y2j7eMWnvCRP7Kp+ua2H36cG4g==} - engines: {node: '>=12.0.0'} - dependencies: - '@noble/ed25519': 1.7.3 - '@noble/secp256k1': 1.7.1 - err-code: 3.0.1 - iso-random-stream: 2.0.2 - multiformats: 9.9.0 - node-forge: 1.3.1 - protobufjs: 6.11.4 - uint8arrays: 3.1.1 - dev: false - /lie@3.1.1: resolution: {integrity: sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==} dependencies: @@ -23894,6 +23649,7 @@ packages: /long@4.0.0: resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} + dev: true /long@5.2.3: resolution: {integrity: sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==} @@ -24055,10 +23811,12 @@ packages: /map-obj@1.0.1: resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} engines: {node: '>=0.10.0'} + dev: true /map-obj@4.3.0: resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} engines: {node: '>=8'} + dev: true /markdown-extensions@2.0.0: resolution: {integrity: sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==} @@ -24543,24 +24301,6 @@ packages: yargs-parser: 20.2.9 dev: true - /meow@9.0.0: - resolution: {integrity: sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==} - engines: {node: '>=10'} - dependencies: - '@types/minimist': 1.2.4 - camelcase-keys: 6.2.2 - decamelize: 1.2.0 - decamelize-keys: 1.1.1 - hard-rejection: 2.1.0 - minimist-options: 4.1.0 - normalize-package-data: 3.0.3 - read-pkg-up: 7.0.1 - redent: 3.0.0 - trim-newlines: 3.0.1 - type-fest: 0.18.1 - yargs-parser: 20.2.9 - dev: false - /merge-descriptors@1.0.1: resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} @@ -24569,6 +24309,7 @@ packages: engines: {node: '>=10'} dependencies: is-plain-obj: 2.1.0 + dev: true /merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -25656,6 +25397,7 @@ packages: /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} + dev: true /mini-css-extract-plugin@2.7.6(webpack@5.89.0): resolution: {integrity: sha512-Qk7HcgaPkGG6eD77mLvZS1nmxlao3j+9PkrT9Uc7HAE1id3F41+DdBRYRYkbyfNRGzm8/YWtzhw7nVPmwhqTQw==} @@ -25759,6 +25501,7 @@ packages: arrify: 1.0.1 is-plain-obj: 1.1.0 kind-of: 6.0.3 + dev: true /minimist@1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} @@ -25896,13 +25639,6 @@ packages: '@motionone/vue': 10.16.4 dev: false - /move-file@2.1.0: - resolution: {integrity: sha512-i9qLW6gqboJ5Ht8bauZi7KlTnQ3QFpBCvMvFfEcHADKgHGeJ9BZMO7SFCTwHPV9Qa0du9DYY1Yx3oqlGt30nXA==} - engines: {node: '>=10.17'} - dependencies: - path-exists: 4.0.0 - dev: false - /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -25929,6 +25665,7 @@ packages: transitivePeerDependencies: - node-fetch - supports-color + dev: true /multiaddr@10.0.1(node-fetch@3.3.2): resolution: {integrity: sha512-G5upNcGzEGuTHkzxezPrrD6CaIHR9uo+7MwqhNVcXTs33IInon4y7nMiGxl2CY5hG7chvYQUQhz5V52/Qe3cbg==} @@ -25942,6 +25679,7 @@ packages: transitivePeerDependencies: - node-fetch - supports-color + dev: true /multibase@0.6.1: resolution: {integrity: sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==} @@ -25999,11 +25737,6 @@ packages: imul: 1.0.1 dev: true - /murmurhash3js-revisited@3.0.0: - resolution: {integrity: sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g==} - engines: {node: '>=8.0.0'} - dev: false - /mustache@4.2.0: resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} dev: true @@ -26072,6 +25805,7 @@ packages: abort-controller: '*' dependencies: abort-controller: 3.0.0 + dev: true /native-fetch@3.0.0(node-fetch@2.7.0): resolution: {integrity: sha512-G3Z7vx0IFb/FQ4JxvtqGABsOTIqRWvgQz6e+erkB+JJD6LrszQtMozEHI4EkmgZQvnGHrpLVzUWk7t4sJCIkVw==} @@ -26079,6 +25813,7 @@ packages: node-fetch: '*' dependencies: node-fetch: 2.7.0 + dev: true /native-fetch@3.0.0(node-fetch@3.3.2): resolution: {integrity: sha512-G3Z7vx0IFb/FQ4JxvtqGABsOTIqRWvgQz6e+erkB+JJD6LrszQtMozEHI4EkmgZQvnGHrpLVzUWk7t4sJCIkVw==} @@ -26086,6 +25821,7 @@ packages: node-fetch: '*' dependencies: node-fetch: 3.3.2 + dev: true /natural-compare-lite@1.4.0: resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} @@ -26147,28 +25883,6 @@ packages: - babel-plugin-macros dev: false - /nft.storage@7.1.1(node-fetch@3.3.2): - resolution: {integrity: sha512-OHFeRiWLcGCWHX8Kx3yvSt7qGbHwEROl0kcN2xaHWBaR0ApYH5DnjlqczXSwP9WwBDtjhyDk4IHReXSwuZkB7Q==} - dependencies: - '@ipld/car': 3.2.4 - '@ipld/dag-cbor': 6.0.15 - '@web-std/blob': 3.0.5 - '@web-std/fetch': 4.2.1 - '@web-std/file': 3.0.3 - '@web-std/form-data': 3.1.0 - carbites: 1.0.6 - ipfs-car: 0.6.2(node-fetch@3.3.2) - it-pipe: 1.1.0 - multiformats: 9.9.0 - p-retry: 4.6.2 - streaming-iterables: 6.2.0 - throttled-queue: 2.1.4 - transitivePeerDependencies: - - encoding - - node-fetch - - supports-color - dev: false - /nise@5.1.5: resolution: {integrity: sha512-VJuPIfUFaXNRzETTQEEItTOP8Y171ijr+JLq42wHes3DiryR8vT+1TXQW/Rx8JNUhyYYWyIvjXTU6dOhJcs9Nw==} dependencies: @@ -26313,6 +26027,7 @@ packages: resolve: 1.22.8 semver: 5.7.2 validate-npm-package-license: 3.0.4 + dev: true /normalize-package-data@3.0.3: resolution: {integrity: sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==} @@ -26322,6 +26037,7 @@ packages: is-core-module: 2.13.1 semver: 7.5.4 validate-npm-package-license: 3.0.4 + dev: true /normalize-path@2.1.1: resolution: {integrity: sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==} @@ -26722,6 +26438,7 @@ packages: /p-defer@3.0.0: resolution: {integrity: sha512-ugZxsxmtTln604yeYd29EGrNhazN2lywetzpKhfmQjW/VJmhpDmWbiX+h0zL8V91R0UXkhb3KtPmyq9PZw3aYw==} engines: {node: '>=8'} + dev: true /p-event@2.3.1: resolution: {integrity: sha512-NQCqOFhbpVTMX4qMe8PF8lbGtzZ+LCiN7pcNrb/413Na7+TRoe1xkKUzuWa/YEJdGQ0FvKtj35EEbDoVPO2kbA==} @@ -26735,6 +26452,7 @@ packages: dependencies: fast-fifo: 1.3.2 p-defer: 3.0.0 + dev: true /p-finally@1.0.0: resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} @@ -26892,6 +26610,7 @@ packages: /parse-duration@1.1.0: resolution: {integrity: sha512-z6t9dvSJYaPoQq7quMzdEagSFtpGu+utzHqqxmpVWNNZRIXnvqyCvn9XsTdh7c/w0Bqmdz3RB3YnRaKtpRtEXQ==} + dev: true /parse-entities@4.0.1: resolution: {integrity: sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==} @@ -27093,17 +26812,6 @@ packages: safe-buffer: 5.2.1 sha.js: 2.4.11 - /peer-id@0.16.0: - resolution: {integrity: sha512-EmL7FurFUduU9m1PS9cfJ5TAuCvxKQ7DKpfx3Yj6IKWyBRtosriFuOag/l3ni/dtPgPLwiA4R9IvpL7hsDLJuQ==} - engines: {node: '>=15.0.0'} - dependencies: - class-is: 1.1.0 - libp2p-crypto: 0.21.2 - multiformats: 9.9.0 - protobufjs: 6.11.4 - uint8arrays: 3.1.1 - dev: false - /pend@1.2.0: resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} @@ -27886,6 +27594,7 @@ packages: '@types/long': 4.0.2 '@types/node': 18.18.7 long: 4.0.0 + dev: true /proxy-addr@2.0.7: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} @@ -28095,25 +27804,12 @@ packages: /quick-lru@4.0.1: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} engines: {node: '>=8'} + dev: true /quick-lru@5.1.1: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} - /rabin-wasm@0.1.5: - resolution: {integrity: sha512-uWgQTo7pim1Rnj5TuWcCewRDTf0PEFTSlaUjWP4eY9EbLV9em08v89oCz/WO+wRxpYuO36XEHp4wgYQnAgOHzA==} - dependencies: - '@assemblyscript/loader': 0.9.4 - bl: 5.1.0 - debug: 4.3.4(supports-color@8.1.1) - minimist: 1.2.8 - node-fetch: 2.7.0 - readable-stream: 3.6.2 - transitivePeerDependencies: - - encoding - - supports-color - dev: false - /radix3@1.1.0: resolution: {integrity: sha512-pNsHDxbGORSvuSScqNJ+3Km6QAVqk8CfsCBIEoDgpqLrkD2f3QM4I7d1ozJJ172OmIcoUcerZaNWqtLkRXTV3A==} dev: false @@ -28324,6 +28020,7 @@ packages: resolution: {integrity: sha512-g2rtqPjdroaboDKTsJCTlcmtw54E25OjyaunUP0anOZn4Fuo2IKs8BVfe02zVggA/UysbmfSnRJIqtNkAgggNA==} dependencies: p-defer: 3.0.0 + dev: true /react-native-fs@2.20.0(react-native@0.72.6): resolution: {integrity: sha512-VkTBzs7fIDUiy/XajOSNk0XazFE9l+QlMAce7lGuebZcag5CnjszB+u4BdqzwaQOdcYb5wsJIsqq4kxInIRpJQ==} @@ -28578,6 +28275,7 @@ packages: find-up: 4.1.0 read-pkg: 5.2.0 type-fest: 0.8.1 + dev: true /read-pkg@3.0.0: resolution: {integrity: sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==} @@ -28596,6 +28294,7 @@ packages: normalize-package-data: 2.5.0 parse-json: 5.2.0 type-fest: 0.6.0 + dev: true /readable-stream@1.0.34: resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==} @@ -28658,6 +28357,7 @@ packages: resolution: {integrity: sha512-HrsFvqZZheusncQRiEE7GatOAETrARKV/lnfYicIm8lbvp/JQOdADOfhjBd2DajvoszEyxSM6RlAAIZgEoeu/A==} dependencies: ms: 2.1.3 + dev: true /rechoir@0.6.2: resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} @@ -28683,6 +28383,7 @@ packages: dependencies: indent-string: 4.0.0 strip-indent: 3.0.0 + dev: true /redeyed@2.1.1: resolution: {integrity: sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ==} @@ -29139,10 +28840,6 @@ packages: signal-exit: 3.0.7 dev: true - /retimer@2.0.0: - resolution: {integrity: sha512-KLXY85WkEq2V2bKex/LOO1ViXVn2KGYe4PYysAdYdjmraYIUsVkXu8O4am+8+5UbaaGl1qho4aqAAPHNQ4GSbg==} - dev: false - /retimer@3.0.0: resolution: {integrity: sha512-WKE0j11Pa0ZJI5YIk0nflGI7SQsfl2ljihVy7ogh7DeQSeYAUi0ubZ/yEueGtDfUPk6GH5LRw1hBdLq4IwUBWA==} dev: true @@ -30213,10 +29910,6 @@ packages: resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} dev: false - /sparse-array@1.3.2: - resolution: {integrity: sha512-ZT711fePGn3+kQyLuv1fpd3rNSkNF8vd5Kv2D+qnOANeyKs3fx6bUMGWRPvgTTcYV64QMqZKZwcuaQSP3AZ0tg==} - dev: false - /spawn-wrap@2.0.0: resolution: {integrity: sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==} engines: {node: '>=8'} @@ -30234,18 +29927,22 @@ packages: dependencies: spdx-expression-parse: 3.0.1 spdx-license-ids: 3.0.16 + dev: true /spdx-exceptions@2.3.0: resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} + dev: true /spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} dependencies: spdx-exceptions: 2.3.0 spdx-license-ids: 3.0.16 + dev: true /spdx-license-ids@3.0.16: resolution: {integrity: sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==} + dev: true /spdy-transport@3.0.0: resolution: {integrity: sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==} @@ -30424,11 +30121,7 @@ packages: resolution: {integrity: sha512-4vEbkSs83OahpmBybNJXlJd7d6/RxzkkSdT3I0mnGt79Xd2Kk+e1JqbvAvsQfCeKj3aKb0QIWkyK3/n0j506vQ==} dependencies: get-iterator: 1.0.2 - - /streaming-iterables@6.2.0: - resolution: {integrity: sha512-3AYC8oB60WyD1ic7uHmN/vm2oRGzRnQ3XFBl/bFMDi1q1+nc5/vjMmiE4vroIya3jG59t87VpyAj/iXYxyw9AA==} - engines: {node: '>=10'} - dev: false + dev: true /streamsearch@1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} @@ -30630,6 +30323,7 @@ packages: engines: {node: '>=8'} dependencies: min-indent: 1.0.1 + dev: true /strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} @@ -31059,10 +30753,6 @@ packages: engines: {node: '>=10'} dev: false - /throttled-queue@2.1.4: - resolution: {integrity: sha512-YGdk8sdmr4ge3g+doFj/7RLF5kLM+Mi7DEciu9PHxnMJZMeVuZeTj31g4VE7ekUffx/IdbvrtOCiz62afg0mkg==} - dev: false - /throttleit@1.0.0: resolution: {integrity: sha512-rkTVqu6IjfQ/6+uNuuc3sZek4CEYxTJom3IktzgdSxcZqdARuebbA/f4QmAxMQIxqq9ZLEUkSYqvuk1I6VKq4g==} dev: true @@ -31091,13 +30781,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /timeout-abort-controller@1.1.1: - resolution: {integrity: sha512-BsF9i3NAJag6T0ZEjki9j654zoafI2X6ayuNd6Tp8+Ul6Tr5s4jo973qFeiWrRSweqvskC+AHDKUmIW4b7pdhQ==} - dependencies: - abort-controller: 3.0.0 - retimer: 2.0.0 - dev: false - /timeout-abort-controller@2.0.0: resolution: {integrity: sha512-2FAPXfzTPYEgw27bQGTHc0SzrbmnU2eso4qo172zMLZzaGqeu09PFa5B2FCUHM1tflgRqPgn5KQgp6+Vex4uNA==} dependencies: @@ -31113,11 +30796,6 @@ packages: next-tick: 1.1.0 dev: true - /timestamp-nano@1.0.1: - resolution: {integrity: sha512-4oGOVZWTu5sl89PtCDnhQBSt7/vL1zVEwAfxH1p49JhTosxzVQWYBYFRFZ8nJmo0G6f824iyP/44BFAwIoKvIA==} - engines: {node: '>= 4.5.0'} - dev: false - /tiny-invariant@1.3.1: resolution: {integrity: sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==} dev: false @@ -31258,6 +30936,7 @@ packages: /trim-newlines@3.0.1: resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} engines: {node: '>=8'} + dev: true /trim-repeated@1.0.0: resolution: {integrity: sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==} @@ -31598,6 +31277,7 @@ packages: /type-fest@0.18.1: resolution: {integrity: sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==} engines: {node: '>=10'} + dev: true /type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} @@ -31610,6 +31290,7 @@ packages: /type-fest@0.6.0: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} + dev: true /type-fest@0.7.1: resolution: {integrity: sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==} @@ -31618,6 +31299,7 @@ packages: /type-fest@0.8.1: resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} engines: {node: '>=8'} + dev: true /type-fest@1.4.0: resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} @@ -32345,6 +32027,7 @@ packages: dependencies: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 + dev: true /validate-npm-package-name@4.0.0: resolution: {integrity: sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==} @@ -32385,6 +32068,7 @@ packages: /varint@6.0.0: resolution: {integrity: sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==} + dev: true /vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} @@ -32511,8 +32195,8 @@ packages: - zod dev: false - /viem@1.19.9(typescript@5.3.2): - resolution: {integrity: sha512-Sf9U2x4jU0S/FALqYypcspWOGene0NZyD470oUripNhE0Ta6uOE/OgE4toTDVfRxov8qw0JFinr/wPGxYE3+HQ==} + /viem@1.19.15(typescript@5.3.2): + resolution: {integrity: sha512-rc87AkyrUUsoOAgMNYP+X/wN4GYwbhP87DkmsqQCYKxxQyzTX0+yliKs6Bxljbjr8ybU72GOb12Oyus6393AjQ==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: @@ -32782,20 +32466,6 @@ packages: xml-name-validator: 4.0.0 dev: true - /w3name@1.0.8: - resolution: {integrity: sha512-MjCUGATeNm70YE1Zro4mykaoRI9dTTlr44AB83Qt6OaRlcLvH9g0gyLwAMd3gBm8oDVU/RrDAxsDGcO8r+RIuQ==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@web-std/fetch': 4.2.1 - cborg: 1.10.2 - ipns: 0.16.0 - libp2p-crypto: 0.21.2 - throttled-queue: 2.1.4 - uint8arrays: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: false - /wabt@1.0.24: resolution: {integrity: sha512-8l7sIOd3i5GWfTWciPL0+ff/FK/deVK2Q6FN+MPz4vfUcD78i2M/49XJTwF6aml91uIiuXJEsLKWMB2cw/mtKg==} dev: true @@ -32879,14 +32549,6 @@ packages: dependencies: defaults: 1.0.4 - /web-encoding@1.1.5: - resolution: {integrity: sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==} - dependencies: - util: 0.12.5 - optionalDependencies: - '@zxing/text-encoding': 0.9.0 - dev: false - /web-namespaces@2.0.1: resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==} dev: false @@ -33174,31 +32836,6 @@ packages: utf8: 3.0.0 dev: true - /web3.storage@4.5.5(node-fetch@3.3.2): - resolution: {integrity: sha512-ABW1Gk4gpkVkEIgeQTcoqZ1pI1YKQiBbZDploAcyldFWCXtdBpsijrRHg0S5Mwlvllw4E8OsRm/9HG2nVaGsCg==} - dependencies: - '@ipld/car': 3.2.4 - '@web-std/blob': 3.0.5 - '@web-std/fetch': 4.2.1 - '@web-std/file': 3.0.3 - '@web3-storage/parse-link-header': 3.1.0 - browser-readablestream-to-it: 1.0.3 - carbites: 1.0.6 - cborg: 1.10.2 - files-from-path: 0.2.6 - ipfs-car: 0.7.0(node-fetch@3.3.2) - libp2p-crypto: 0.21.2 - p-retry: 4.6.2 - streaming-iterables: 6.2.0 - throttled-queue: 2.1.4 - uint8arrays: 3.1.1 - w3name: 1.0.8 - transitivePeerDependencies: - - encoding - - node-fetch - - supports-color - dev: false - /web3@1.10.3: resolution: {integrity: sha512-DgUdOOqC/gTqW+VQl1EdPxrVRPB66xVNtuZ5KD4adVBtko87hkgM8BTZ0lZ8IbUfnQk6DyjcDujMiH3oszllAw==} engines: {node: '>=8.0.0'} diff --git a/sdk/.env.template b/sdk/.env.template index d864c413..b4b5a396 100644 --- a/sdk/.env.template +++ b/sdk/.env.template @@ -1,6 +1,3 @@ -# Specifies the default chain ID to use if no chain ID is specified. -DEFAULT_CHAIN_ID=5 - # Specifies the contract address to use for the Hypercert system. CONTRACT_ADDRESS=0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07 @@ -15,7 +12,6 @@ NFT_STORAGE_TOKEN=your-nft-storage-token # Specifies the NFT.storage API token to use for storing Hypercert metadata in a Next.js application. NEXT_PUBLIC_NFT_STORAGE_TOKEN=your-next-public-nft-storage-token - # Specifies the Web3.storage API token to use for storing Hypercert data. WEB3_STORAGE_TOKEN=your-web3-storage-token diff --git a/sdk/README.md b/sdk/README.md index 40bf074b..3a29041d 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -24,7 +24,7 @@ import { HypercertClient } from "@hypercerts-org/sdk"; ```js const client = new HypercertClient({ - chain: { id: 5 } // required + chain: { id: 11155111 }, // required nftStorageToken, web3StorageToken, }); @@ -46,7 +46,7 @@ This will validate the metadata, store it on IPFS, create a new hypercert on-cha 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), +const claims = await client.indexer.fractionsByOwner(owner); ``` For more information on how to use the SDK, check out the @@ -103,7 +103,7 @@ HypercertIndexer, and HypercertMinter classes, respectively. ```js const { client: { storage }, -} = new HypercertClient({ chain: { id: 5 } }); +} = new HypercertClient({ chain: { id: 11155111 } }); ``` The `storage` is a utility class that provides methods for storing and retrieving Hypercert metadata on IPFS and @@ -112,7 +112,7 @@ NFT.storage. It is used by the HypercertClient to store metadata when creating n ```js const { client: { indexer }, -} = new HypercertClient({ chain: { id: 5 } }); +} = new HypercertClient({ chain: { id: 11155111 } }); ``` The `indexer` is a utility class that provides methods for indexing and searching Hypercerts based on various criteria. @@ -121,7 +121,7 @@ It is used by the HypercertClient to retrieve event-based data via the subgraph ```js const { client: { contract }, -} = new HypercertClient({ chain: { id: 5 } }); +} = new HypercertClient({ chain: { id: 11155111 } }); ``` Finally we have a `contract` that provides methods for interacting with the HypercertMinter smart contract. It is used diff --git a/sdk/RELEASE.md b/sdk/RELEASE.md index 11f5fb65..ea8f7acb 100644 --- a/sdk/RELEASE.md +++ b/sdk/RELEASE.md @@ -1,5 +1,19 @@ # Release notes +## 1.1.1 + +- Deprecate goerli chain + +## 1.1.0 + +- Refactored `HypercertStorage` to use hypercert APIs instead if web3.storage and nft.storage for uploading metadata and + allowlist data +- Added `uploadMetaData` and `uploadAllowList` methods to `HypercertStorage` and as exports from the SDK. +- Removed `storeData` methods from `HypercertStorage` and as exports from the SDK. +- Added `apis` as export from the SDK. + +.... + ## 0.3.1 Update dependencies - Updated graph package dependencies diff --git a/sdk/package.json b/sdk/package.json index ba1f5749..87c3e49a 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@hypercerts-org/sdk", - "version": "1.0.3", + "version": "1.1.0", "description": "SDK for hypercerts protocol", "repository": "git@github.com:hypercerts-org/hypercerts.git", "author": "Hypercerts team", @@ -34,10 +34,8 @@ "ethers": "5.7.2", "graphql": "^16.8.1", "loglevel": "^1.8.1", - "nft.storage": "^7.1.1", "urql": "^4.0.6", - "viem": "^1.19.9", - "web3.storage": "^4.5.5" + "viem": "^1.19.15" }, "devDependencies": { "@babel/core": "^7.23.5", diff --git a/sdk/src/client.ts b/sdk/src/client.ts index 6f8c14e9..c5ac6dce 100644 --- a/sdk/src/client.ts +++ b/sdk/src/client.ts @@ -1,5 +1,4 @@ import { HypercertMinterAbi } from "@hypercerts-org/contracts"; -import { StandardMerkleTree } from "@openzeppelin/merkle-tree"; import { Account, ByteArray, GetContractReturnType, Hex, PublicClient, WalletClient, getContract } from "viem"; import { HypercertEvaluator } from "./evaluations"; import { HypercertIndexer } from "./indexer"; @@ -11,24 +10,24 @@ import { HypercertClientInterface, HypercertMetadata, InvalidOrMissingError, - MalformedDataError, SupportedOverrides, TransferRestrictions, } from "./types"; import { getConfig } from "./utils/config"; -import { validateAllowlist, validateMetaData, verifyMerkleProof, verifyMerkleProofs } from "./validator"; +import { verifyMerkleProof, verifyMerkleProofs } from "./validator"; import { handleSimulatedContractError } from "./utils/errors"; import { logger } from "./utils"; +import { parseAllowListEntriesToMerkleTree } from "./utils/allowlist"; /** * 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. + * The client is read-only if no walletClient was found. * * @example * const config: Partial = { - * chain: {id: 5}, + * chain: {id: 11155111 }, * }; * const client = new HypercertClient(config); * @@ -61,11 +60,11 @@ export class HypercertClient implements HypercertClientInterface { this._publicClient = this._config.publicClient; this._walletClient = this._config?.walletClient; - this._storage = new HypercertsStorage(this._config); + this._storage = new HypercertsStorage(); this._indexer = new HypercertIndexer(this._config); - this.readonly = this._config.readOnly || this._storage.readonly || !this._walletClient; + this.readonly = this._config.readOnly || !this._walletClient; if (this.readonly) { logger.warn("HypercertsClient is in readonly mode", "client"); @@ -132,19 +131,13 @@ export class HypercertClient implements HypercertClientInterface { ): Promise<`0x${string}` | undefined> => { const { account } = this.getWallet(); - // validate metadata - const { valid, errors } = validateMetaData(metaData); - if (!valid && Object.keys(errors).length > 0) { - throw new MalformedDataError("Metadata validation failed", errors); - } - - // store metadata on IPFS - const cid = await this.storage.storeMetadata(metaData); + // validate and store metadata + const metadataCID = await this.storage.storeMetadata(metaData); const request = await this.simulateRequest( account, "mintClaim", - [account?.address, totalUnits, cid, transferRestriction], + [account?.address, totalUnits, metadataCID, transferRestriction], overrides, ); @@ -249,30 +242,19 @@ export class HypercertClient implements HypercertClientInterface { ): Promise<`0x${string}` | undefined> => { const { account } = this.getWallet(); - // validate allowlist - const { valid: validAllowlist, errors: allowlistErrors } = validateAllowlist(allowList, totalUnits); - if (!validAllowlist && Object.keys(allowlistErrors).length > 0) { - throw new MalformedDataError("Allowlist validation failed", allowlistErrors); - } - - // validate metadata - const { valid: validMetaData, errors: metaDataErrors } = validateMetaData(metaData); - if (!validMetaData && Object.keys(metaDataErrors).length > 0) { - throw new MalformedDataError("Metadata validation failed", metaDataErrors); - } - // create allowlist - 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())); + const tree = parseAllowListEntriesToMerkleTree(allowList); + + // store allowlist on IPFS + const allowListCID = await this.storage.storeAllowList(allowList, totalUnits); // store metadata on IPFS - const cid = await this.storage.storeMetadata({ ...metaData, allowList: cidMerkle }); + const metadataCID = await this.storage.storeMetadata({ ...metaData, allowList: allowListCID }); const request = await this.simulateRequest( account, "createAllowlist", - [account?.address, totalUnits, tree.root, cid, transferRestriction], + [account?.address, totalUnits, tree.root, metadataCID, transferRestriction], overrides, ); diff --git a/sdk/src/constants.ts b/sdk/src/constants.ts index deebf21c..b87a672e 100644 --- a/sdk/src/constants.ts +++ b/sdk/src/constants.ts @@ -6,13 +6,15 @@ import { Deployment, SupportedChainIds } from "./types"; const DEFAULT_GRAPH_BASE_URL = "https://api.thegraph.com/subgraphs/name/hypercerts-admin"; +// The APIs we expose + +const APIS: { [key: string]: string } = { + metadata: "https://hypercerts-api.vercel.app/api/v1/web3up/metadata", + allowlist: "https://hypercerts-api.vercel.app/api/v1/web3up/allowlist", +}; + // These are the deployments we manage const DEPLOYMENTS: { [key in SupportedChainIds]: Partial } = { - 5: { - contractAddress: "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", - graphName: "hypercerts-testnet", - graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-testnet`, - } as const, 10: { contractAddress: "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", graphName: "hypercerts-optimism-mainnet", @@ -45,4 +47,4 @@ const EAS_SCHEMAS = { }, } as const; -export { DEPLOYMENTS, EAS_SCHEMAS }; +export { APIS, DEPLOYMENTS, EAS_SCHEMAS }; diff --git a/sdk/src/index.ts b/sdk/src/index.ts index 9e798de5..d8047a32 100644 --- a/sdk/src/index.ts +++ b/sdk/src/index.ts @@ -2,13 +2,14 @@ import { HypercertMinterAbi, HypercertExchangeAbi } from "@hypercerts-org/contra import { HypercertClient } from "./client"; import { HypercertsStorage } from "./storage"; -import { DEPLOYMENTS } from "./constants"; +import { APIS, DEPLOYMENTS } from "./constants"; /** * Protocol */ export { HypercertMinterAbi, HypercertExchangeAbi }; export { DEPLOYMENTS as deployments }; +export { APIS as apis }; /** * Client diff --git a/sdk/src/indexer/gql/graphql.ts b/sdk/src/indexer/gql/graphql.ts index eb7fef8c..26091837 100644 --- a/sdk/src/indexer/gql/graphql.ts +++ b/sdk/src/indexer/gql/graphql.ts @@ -24,6 +24,85 @@ export type Scalars = { Int8: { input: any; output: any }; }; +export type AcceptedToken = { + __typename?: "AcceptedToken"; + accepted: Scalars["Boolean"]["output"]; + id: Scalars["String"]["output"]; + minimumAmountPerUnit: Scalars["BigInt"]["output"]; + token: Token; +}; + +export type AcceptedToken_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + accepted?: InputMaybe; + accepted_in?: InputMaybe>; + accepted_not?: InputMaybe; + accepted_not_in?: InputMaybe>; + and?: InputMaybe>>; + id?: InputMaybe; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + minimumAmountPerUnit?: InputMaybe; + minimumAmountPerUnit_gt?: InputMaybe; + minimumAmountPerUnit_gte?: InputMaybe; + minimumAmountPerUnit_in?: InputMaybe>; + minimumAmountPerUnit_lt?: InputMaybe; + minimumAmountPerUnit_lte?: InputMaybe; + minimumAmountPerUnit_not?: InputMaybe; + minimumAmountPerUnit_not_in?: InputMaybe>; + or?: InputMaybe>>; + token?: InputMaybe; + token_?: InputMaybe; + token_contains?: InputMaybe; + token_contains_nocase?: InputMaybe; + token_ends_with?: InputMaybe; + token_ends_with_nocase?: InputMaybe; + token_gt?: InputMaybe; + token_gte?: InputMaybe; + token_in?: InputMaybe>; + token_lt?: InputMaybe; + token_lte?: InputMaybe; + token_not?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_contains_nocase?: InputMaybe; + token_not_ends_with?: InputMaybe; + token_not_ends_with_nocase?: InputMaybe; + token_not_in?: InputMaybe>; + token_not_starts_with?: InputMaybe; + token_not_starts_with_nocase?: InputMaybe; + token_starts_with?: InputMaybe; + token_starts_with_nocase?: InputMaybe; +}; + +export enum AcceptedToken_OrderBy { + Accepted = "accepted", + Id = "id", + MinimumAmountPerUnit = "minimumAmountPerUnit", + Token = "token", + TokenDecimals = "token__decimals", + TokenId = "token__id", + TokenName = "token__name", + TokenSymbol = "token__symbol", +} + export type Allowlist = { __typename?: "Allowlist"; claim: Claim; @@ -130,11 +209,20 @@ export type ClaimToken = { __typename?: "ClaimToken"; claim: Claim; id: Scalars["String"]["output"]; + offers?: Maybe>; owner: Scalars["Bytes"]["output"]; tokenID: Scalars["BigInt"]["output"]; units: Scalars["BigInt"]["output"]; }; +export type ClaimTokenOffersArgs = { + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + where?: InputMaybe; +}; + export type ClaimToken_Filter = { /** Filter for the block changed event. */ _change_block?: InputMaybe; @@ -180,6 +268,7 @@ export type ClaimToken_Filter = { id_not_starts_with_nocase?: InputMaybe; id_starts_with?: InputMaybe; id_starts_with_nocase?: InputMaybe; + offers_?: InputMaybe; or?: InputMaybe>>; owner?: InputMaybe; owner_contains?: InputMaybe; @@ -220,6 +309,7 @@ export enum ClaimToken_OrderBy { ClaimTotalUnits = "claim__totalUnits", ClaimUri = "claim__uri", Id = "id", + Offers = "offers", Owner = "owner", TokenId = "tokenID", Units = "units", @@ -371,6 +461,128 @@ export enum Claim_OrderBy { Uri = "uri", } +export type Offer = { + __typename?: "Offer"; + acceptedTokens: Array; + fractionID: ClaimToken; + id: Scalars["String"]["output"]; + maxUnitsPerTrade: Scalars["BigInt"]["output"]; + minUnitsPerTrade: Scalars["BigInt"]["output"]; + status: OfferStatus; + unitsAvailable: Scalars["BigInt"]["output"]; +}; + +export type OfferAcceptedTokensArgs = { + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + where?: InputMaybe; +}; + +export enum OfferStatus { + Cancelled = "Cancelled", + Fulfilled = "Fulfilled", + Open = "Open", +} + +export type Offer_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + acceptedTokens?: InputMaybe>; + acceptedTokens_?: InputMaybe; + acceptedTokens_contains?: InputMaybe>; + acceptedTokens_contains_nocase?: InputMaybe>; + acceptedTokens_not?: InputMaybe>; + acceptedTokens_not_contains?: InputMaybe>; + acceptedTokens_not_contains_nocase?: InputMaybe>; + and?: InputMaybe>>; + fractionID?: InputMaybe; + fractionID_?: InputMaybe; + fractionID_contains?: InputMaybe; + fractionID_contains_nocase?: InputMaybe; + fractionID_ends_with?: InputMaybe; + fractionID_ends_with_nocase?: InputMaybe; + fractionID_gt?: InputMaybe; + fractionID_gte?: InputMaybe; + fractionID_in?: InputMaybe>; + fractionID_lt?: InputMaybe; + fractionID_lte?: InputMaybe; + fractionID_not?: InputMaybe; + fractionID_not_contains?: InputMaybe; + fractionID_not_contains_nocase?: InputMaybe; + fractionID_not_ends_with?: InputMaybe; + fractionID_not_ends_with_nocase?: InputMaybe; + fractionID_not_in?: InputMaybe>; + fractionID_not_starts_with?: InputMaybe; + fractionID_not_starts_with_nocase?: InputMaybe; + fractionID_starts_with?: InputMaybe; + fractionID_starts_with_nocase?: InputMaybe; + id?: InputMaybe; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + maxUnitsPerTrade?: InputMaybe; + maxUnitsPerTrade_gt?: InputMaybe; + maxUnitsPerTrade_gte?: InputMaybe; + maxUnitsPerTrade_in?: InputMaybe>; + maxUnitsPerTrade_lt?: InputMaybe; + maxUnitsPerTrade_lte?: InputMaybe; + maxUnitsPerTrade_not?: InputMaybe; + maxUnitsPerTrade_not_in?: InputMaybe>; + minUnitsPerTrade?: InputMaybe; + minUnitsPerTrade_gt?: InputMaybe; + minUnitsPerTrade_gte?: InputMaybe; + minUnitsPerTrade_in?: InputMaybe>; + minUnitsPerTrade_lt?: InputMaybe; + minUnitsPerTrade_lte?: InputMaybe; + minUnitsPerTrade_not?: InputMaybe; + minUnitsPerTrade_not_in?: InputMaybe>; + or?: InputMaybe>>; + status?: InputMaybe; + status_in?: InputMaybe>; + status_not?: InputMaybe; + status_not_in?: InputMaybe>; + unitsAvailable?: InputMaybe; + unitsAvailable_gt?: InputMaybe; + unitsAvailable_gte?: InputMaybe; + unitsAvailable_in?: InputMaybe>; + unitsAvailable_lt?: InputMaybe; + unitsAvailable_lte?: InputMaybe; + unitsAvailable_not?: InputMaybe; + unitsAvailable_not_in?: InputMaybe>; +}; + +export enum Offer_OrderBy { + AcceptedTokens = "acceptedTokens", + FractionId = "fractionID", + FractionIdId = "fractionID__id", + FractionIdOwner = "fractionID__owner", + FractionIdTokenId = "fractionID__tokenID", + FractionIdUnits = "fractionID__units", + Id = "id", + MaxUnitsPerTrade = "maxUnitsPerTrade", + MinUnitsPerTrade = "minUnitsPerTrade", + Status = "status", + UnitsAvailable = "unitsAvailable", +} + /** Defines the order direction, either ascending or descending */ export enum OrderDirection { Asc = "asc", @@ -381,18 +593,42 @@ export type Query = { __typename?: "Query"; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; + acceptedToken?: Maybe; + acceptedTokens: Array; allowlist?: Maybe; allowlists: Array; claim?: Maybe; claimToken?: Maybe; claimTokens: Array; claims: Array; + offer?: Maybe; + offers: Array; + token?: Maybe; + tokens: Array; + trade?: Maybe; + trades: Array; }; export type Query_MetaArgs = { block?: InputMaybe; }; +export type QueryAcceptedTokenArgs = { + block?: InputMaybe; + id: Scalars["ID"]["input"]; + subgraphError?: _SubgraphErrorPolicy_; +}; + +export type QueryAcceptedTokensArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + export type QueryAllowlistArgs = { block?: InputMaybe; id: Scalars["ID"]["input"]; @@ -441,22 +677,94 @@ export type QueryClaimsArgs = { where?: InputMaybe; }; +export type QueryOfferArgs = { + block?: InputMaybe; + id: Scalars["ID"]["input"]; + subgraphError?: _SubgraphErrorPolicy_; +}; + +export type QueryOffersArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + +export type QueryTokenArgs = { + block?: InputMaybe; + id: Scalars["ID"]["input"]; + subgraphError?: _SubgraphErrorPolicy_; +}; + +export type QueryTokensArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + +export type QueryTradeArgs = { + block?: InputMaybe; + id: Scalars["ID"]["input"]; + subgraphError?: _SubgraphErrorPolicy_; +}; + +export type QueryTradesArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + export type Subscription = { __typename?: "Subscription"; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; + acceptedToken?: Maybe; + acceptedTokens: Array; allowlist?: Maybe; allowlists: Array; claim?: Maybe; claimToken?: Maybe; claimTokens: Array; claims: Array; + offer?: Maybe; + offers: Array; + token?: Maybe; + tokens: Array; + trade?: Maybe; + trades: Array; }; export type Subscription_MetaArgs = { block?: InputMaybe; }; +export type SubscriptionAcceptedTokenArgs = { + block?: InputMaybe; + id: Scalars["ID"]["input"]; + subgraphError?: _SubgraphErrorPolicy_; +}; + +export type SubscriptionAcceptedTokensArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + export type SubscriptionAllowlistArgs = { block?: InputMaybe; id: Scalars["ID"]["input"]; @@ -505,6 +813,267 @@ export type SubscriptionClaimsArgs = { where?: InputMaybe; }; +export type SubscriptionOfferArgs = { + block?: InputMaybe; + id: Scalars["ID"]["input"]; + subgraphError?: _SubgraphErrorPolicy_; +}; + +export type SubscriptionOffersArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + +export type SubscriptionTokenArgs = { + block?: InputMaybe; + id: Scalars["ID"]["input"]; + subgraphError?: _SubgraphErrorPolicy_; +}; + +export type SubscriptionTokensArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + +export type SubscriptionTradeArgs = { + block?: InputMaybe; + id: Scalars["ID"]["input"]; + subgraphError?: _SubgraphErrorPolicy_; +}; + +export type SubscriptionTradesArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + +export type Token = { + __typename?: "Token"; + decimals?: Maybe; + id: Scalars["String"]["output"]; + name: Scalars["String"]["output"]; + symbol?: Maybe; +}; + +export type Token_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + decimals?: InputMaybe; + decimals_gt?: InputMaybe; + decimals_gte?: InputMaybe; + decimals_in?: InputMaybe>; + decimals_lt?: InputMaybe; + decimals_lte?: InputMaybe; + decimals_not?: InputMaybe; + decimals_not_in?: InputMaybe>; + id?: InputMaybe; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + name?: InputMaybe; + name_contains?: InputMaybe; + name_contains_nocase?: InputMaybe; + name_ends_with?: InputMaybe; + name_ends_with_nocase?: InputMaybe; + name_gt?: InputMaybe; + name_gte?: InputMaybe; + name_in?: InputMaybe>; + name_lt?: InputMaybe; + name_lte?: InputMaybe; + name_not?: InputMaybe; + name_not_contains?: InputMaybe; + name_not_contains_nocase?: InputMaybe; + name_not_ends_with?: InputMaybe; + name_not_ends_with_nocase?: InputMaybe; + name_not_in?: InputMaybe>; + name_not_starts_with?: InputMaybe; + name_not_starts_with_nocase?: InputMaybe; + name_starts_with?: InputMaybe; + name_starts_with_nocase?: InputMaybe; + or?: InputMaybe>>; + symbol?: InputMaybe; + symbol_contains?: InputMaybe; + symbol_contains_nocase?: InputMaybe; + symbol_ends_with?: InputMaybe; + symbol_ends_with_nocase?: InputMaybe; + symbol_gt?: InputMaybe; + symbol_gte?: InputMaybe; + symbol_in?: InputMaybe>; + symbol_lt?: InputMaybe; + symbol_lte?: InputMaybe; + symbol_not?: InputMaybe; + symbol_not_contains?: InputMaybe; + symbol_not_contains_nocase?: InputMaybe; + symbol_not_ends_with?: InputMaybe; + symbol_not_ends_with_nocase?: InputMaybe; + symbol_not_in?: InputMaybe>; + symbol_not_starts_with?: InputMaybe; + symbol_not_starts_with_nocase?: InputMaybe; + symbol_starts_with?: InputMaybe; + symbol_starts_with_nocase?: InputMaybe; +}; + +export enum Token_OrderBy { + Decimals = "decimals", + Id = "id", + Name = "name", + Symbol = "symbol", +} + +export type Trade = { + __typename?: "Trade"; + amountPerUnit: Scalars["BigInt"]["output"]; + buyer: Scalars["Bytes"]["output"]; + id: Scalars["String"]["output"]; + offerID: Offer; + token: Token; + unitsSold: Scalars["BigInt"]["output"]; +}; + +export type Trade_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + amountPerUnit?: InputMaybe; + amountPerUnit_gt?: InputMaybe; + amountPerUnit_gte?: InputMaybe; + amountPerUnit_in?: InputMaybe>; + amountPerUnit_lt?: InputMaybe; + amountPerUnit_lte?: InputMaybe; + amountPerUnit_not?: InputMaybe; + amountPerUnit_not_in?: InputMaybe>; + and?: InputMaybe>>; + buyer?: InputMaybe; + buyer_contains?: InputMaybe; + buyer_gt?: InputMaybe; + buyer_gte?: InputMaybe; + buyer_in?: InputMaybe>; + buyer_lt?: InputMaybe; + buyer_lte?: InputMaybe; + buyer_not?: InputMaybe; + buyer_not_contains?: InputMaybe; + buyer_not_in?: InputMaybe>; + id?: InputMaybe; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + offerID?: InputMaybe; + offerID_?: InputMaybe; + offerID_contains?: InputMaybe; + offerID_contains_nocase?: InputMaybe; + offerID_ends_with?: InputMaybe; + offerID_ends_with_nocase?: InputMaybe; + offerID_gt?: InputMaybe; + offerID_gte?: InputMaybe; + offerID_in?: InputMaybe>; + offerID_lt?: InputMaybe; + offerID_lte?: InputMaybe; + offerID_not?: InputMaybe; + offerID_not_contains?: InputMaybe; + offerID_not_contains_nocase?: InputMaybe; + offerID_not_ends_with?: InputMaybe; + offerID_not_ends_with_nocase?: InputMaybe; + offerID_not_in?: InputMaybe>; + offerID_not_starts_with?: InputMaybe; + offerID_not_starts_with_nocase?: InputMaybe; + offerID_starts_with?: InputMaybe; + offerID_starts_with_nocase?: InputMaybe; + or?: InputMaybe>>; + token?: InputMaybe; + token_?: InputMaybe; + token_contains?: InputMaybe; + token_contains_nocase?: InputMaybe; + token_ends_with?: InputMaybe; + token_ends_with_nocase?: InputMaybe; + token_gt?: InputMaybe; + token_gte?: InputMaybe; + token_in?: InputMaybe>; + token_lt?: InputMaybe; + token_lte?: InputMaybe; + token_not?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_contains_nocase?: InputMaybe; + token_not_ends_with?: InputMaybe; + token_not_ends_with_nocase?: InputMaybe; + token_not_in?: InputMaybe>; + token_not_starts_with?: InputMaybe; + token_not_starts_with_nocase?: InputMaybe; + token_starts_with?: InputMaybe; + token_starts_with_nocase?: InputMaybe; + unitsSold?: InputMaybe; + unitsSold_gt?: InputMaybe; + unitsSold_gte?: InputMaybe; + unitsSold_in?: InputMaybe>; + unitsSold_lt?: InputMaybe; + unitsSold_lte?: InputMaybe; + unitsSold_not?: InputMaybe; + unitsSold_not_in?: InputMaybe>; +}; + +export enum Trade_OrderBy { + AmountPerUnit = "amountPerUnit", + Buyer = "buyer", + Id = "id", + OfferId = "offerID", + OfferIdId = "offerID__id", + OfferIdMaxUnitsPerTrade = "offerID__maxUnitsPerTrade", + OfferIdMinUnitsPerTrade = "offerID__minUnitsPerTrade", + OfferIdStatus = "offerID__status", + OfferIdUnitsAvailable = "offerID__unitsAvailable", + Token = "token", + TokenDecimals = "token__decimals", + TokenId = "token__id", + TokenName = "token__name", + TokenSymbol = "token__symbol", + UnitsSold = "unitsSold", +} + export type _Block_ = { __typename?: "_Block_"; /** The hash of the block */ diff --git a/sdk/src/storage.ts b/sdk/src/storage.ts index 3bf2fdbe..587268a8 100644 --- a/sdk/src/storage.ts +++ b/sdk/src/storage.ts @@ -1,69 +1,58 @@ -//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"; +import { validateAllowlist, validateMetaData } from "./validator"; import { - HypercertStorageConfig, HypercertStorageInterface, HypercertMetadata, MalformedDataError, StorageError, + AllowlistEntry, } from "./types"; -import { logger, getFromIPFS } from "./utils"; -import { getNftStorageToken, getWeb3StorageToken } from "./utils/config"; +import { logger, getFromIPFS, parseAllowListEntriesToMerkleTree } from "./utils"; +import { uploadAllowlist, uploadMetadata } from "./utils/apis"; /** * 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 storage = new HypercertsStorage(); * const metadata = await storage.getMetadata('your-hypercert-id'); */ export class HypercertsStorage implements HypercertStorageInterface { - /** Whether the storage is read-only. */ - readonly: boolean = true; - /** The NFT storage client. */ - nftStorageClient?: NFTStorage; - /** The Web3 storage client. */ - web3StorageClient?: Web3Storage; - /** - * Creates a new instance of the `HypercertsStorage` class. + * Stores hypercerts allowlist on IPFS. * - * 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. + * 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 {Partial} overrides - The configuration overrides for the storage. + * @param {AllowlistEntry[]} allowList - The allowList to store. + * @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. */ - constructor(overrides: Partial) { - 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.nftStorageToken || "" }); - this.web3StorageClient = new Web3Storage({ token: web3StorageToken.web3StorageToken || "" }); - this.readonly = false; + public async storeAllowList(allowList: AllowlistEntry[], totalUnits: bigint): Promise { + const { valid, data, errors: allowlistErrors } = validateAllowlist(allowList, totalUnits); + if (!valid) { + throw new MalformedDataError(`Invalid allowList.`, { errors: allowlistErrors }); } + + logger.debug("Storing allowlist: ", "storage", [data]); + + const tree = parseAllowListEntriesToMerkleTree(allowList); + + const { cid: allowlistCID, errors: uploadAllowlistErrors } = await uploadAllowlist({ + allowList: JSON.stringify(tree.dump()), + totalUnits: totalUnits.toString(), + }); + + if ((uploadAllowlistErrors && Object.keys(uploadAllowlistErrors).length > 0) || !allowlistCID) { + throw new StorageError(`Allowlist upload failed.`, { errors: uploadAllowlistErrors, allowlistCID }); + } + + logger.debug(`Stored metadata at ${allowlistCID}`); + + return allowlistCID; } /** @@ -74,26 +63,22 @@ export class HypercertsStorage implements HypercertStorageInterface { * 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. + * @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) { - throw new StorageError("NFT.storage client is not configured"); - } - - const validation = validateMetaData(data); - if (!validation.valid) { - throw new MalformedDataError(`Invalid metadata.`, { errors: validation.errors }); + public async storeMetadata(metadata: HypercertMetadata): Promise { + const { data, valid, errors: validationErrors } = validateMetaData(metadata); + if (!valid) { + throw new MalformedDataError(`Invalid metadata.`, { errors: validationErrors }); } logger.debug("Storing HypercertMetaData: ", "storage", [data]); - const blob = new Blob([JSON.stringify(data)], { type: "application/json" }); - const cid: CIDString = await this.nftStorageClient.storeBlob(blob); - if (!cid) { - throw new StorageError("Failed to store metadata"); + const { errors, cid } = await uploadMetadata(metadata); + + if (!cid || (errors && Object.keys(errors).length > 0)) { + throw new StorageError("Failed to store metadata", { errors, cid }); } logger.debug(`Stored metadata at ${cid}`); @@ -122,36 +107,6 @@ export class HypercertsStorage implements HypercertStorageInterface { return validation.data as HypercertMetadata; } - /** - * 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. - */ - public async storeData(data: unknown): Promise { - if (this.readonly || !this.web3StorageClient) { - throw new StorageError("Web3.storage client is not configured"); - } - const blob = new Blob([JSON.stringify(data)], { type: "application/json" }); - const files = [new File([blob], "data.json")]; - logger.debug("Storing blob of: ", "storage", [data]); - const cid: CIDString = await this.web3StorageClient.put(files, { wrapWithDirectory: false }); - - if (!cid) { - throw new StorageError("Failed to store data"); - } - - return cid; - } - /** * Retrieves data from IPFS using the provided CID or IPFS URI. * @@ -165,33 +120,7 @@ export class HypercertsStorage implements HypercertStorageInterface { * @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): Promise { - /** - // Using the default web3.storage client is not working in upstream repos. Needs further testing. - const cid = getCid(cidOrIpfsUri); - - // Get the data - const res = await this.web3StorageClient.get(cid); - if (!res || !res.ok) { - throw new FetchError(`Failed to get ${cidOrIpfsUri}`); - } - - // Assert there's only 1 file - // TODO: because we are storing with `wrapDirectory: false`, this call fails - // on upstream projects (e.g. frontend) - // which is confusing because there's no other way to retrieve the file - // doubly confusing because the unit tests work fine. - // Need further investigating, but using `getMetadata` works as a workaround atm - const files = await res.files(); - if (files.length !== 1) { - throw new MalformedDataError(`Expected 1 file but got ${files.length}`); - } - const dataStr = await files[0].text(); - const data = JSON.parse(dataStr); - console.log(`Getting data ${cidOrIpfsUri}: `, data); - return data; - */ - - // TODO: replace current temporary fix of just using NFT.Storage IPFS gateway + // TODO: replace current temporary fix or just using NFT.Storage IPFS gateway return await getFromIPFS(cidOrIpfsUri); } } diff --git a/sdk/src/types/client.ts b/sdk/src/types/client.ts index 37d5100c..0255e64f 100644 --- a/sdk/src/types/client.ts +++ b/sdk/src/types/client.ts @@ -1,7 +1,4 @@ import { PartialTypedDataConfig } from "@ethereum-attestation-service/eas-sdk"; -//eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore -import { CIDString } from "nft.storage"; import { HypercertIndexer } from "../indexer"; import { AllowlistEntry, TransferRestrictions } from "./hypercerts"; @@ -10,7 +7,7 @@ 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 SupportedChainIds = 10 | 42220 | 11155111; export type SupportedOverrides = { value?: bigint; gasPrice?: bigint; @@ -53,8 +50,6 @@ export type HypercertClientConfig = Deployment & export type HypercertStorageConfig = { /** The API token for NFT.storage. */ nftStorageToken?: string; - /** The API token for Web3.storage. */ - web3StorageToken?: string; }; /** @@ -70,26 +65,26 @@ export type HypercertEvaluatorConfig = Omit & */ export interface HypercertStorageInterface { /** - * Stores the metadata for a Hypercert evaluation. + * Stores the allowlost for a hypercert. + * @param allowList The metadata to store. + * @returns A Promise that resolves to the CID of the stored metadata. + */ + storeAllowList: (allowList: AllowlistEntry[], totalUnits: bigint) => Promise; + + /** + * Stores the metadata for a hypercert. * @param metadata The metadata to store. * @returns A Promise that resolves to the CID of the stored metadata. */ - storeMetadata: (metadata: HypercertMetadata) => Promise; + storeMetadata: (metadata: HypercertMetadata) => Promise; /** - * Retrieves the metadata for a Hypercert evaluation. + * Retrieves the metadata for a hypercerts. * @param cidOrIpfsUri The CID or IPFS URI of the metadata to retrieve. * @returns A Promise that resolves to the retrieved metadata. */ getMetadata: (cidOrIpfsUri: string) => Promise; - /** - * Stores arbitrary data on IPFS. - * @param data The data to store. - * @returns A Promise that resolves to the CID of the stored data. - */ - storeData: (data: unknown) => Promise; - /** * Retrieves arbitrary data from IPFS. * @param cidOrIpfsUri The CID or IPFS URI of the data to retrieve. diff --git a/sdk/src/utils/allowlist.ts b/sdk/src/utils/allowlist.ts index a0f840e2..58c26686 100644 --- a/sdk/src/utils/allowlist.ts +++ b/sdk/src/utils/allowlist.ts @@ -1,6 +1,14 @@ import { StandardMerkleTree } from "@openzeppelin/merkle-tree"; import { getFromIPFS } from "./fetchers"; import { logger } from "./logger"; +import { AllowlistEntry } from "src/types"; + +const parseAllowListEntriesToMerkleTree = (allowList: AllowlistEntry[]) => { + const tuples = allowList.map((p) => [p.address, p.units.toString()]); + const tree = StandardMerkleTree.of(tuples, ["address", "uint256"]); + + return tree; +}; const getMerkleTreeFromIPFS = async (cidOrIpfsUri: string) => { const data = await getFromIPFS(cidOrIpfsUri); @@ -43,4 +51,4 @@ const getProofsFromAllowlist = async (cidOrIpfsUri: string, account: `0x${string } }; -export { getProofsFromAllowlist }; +export { getProofsFromAllowlist, parseAllowListEntriesToMerkleTree }; diff --git a/sdk/src/utils/apis.ts b/sdk/src/utils/apis.ts new file mode 100644 index 00000000..a3a2e60d --- /dev/null +++ b/sdk/src/utils/apis.ts @@ -0,0 +1,57 @@ +import axios from "axios"; +import { HypercertMetadata } from "src/types"; + +/** + * Type for the request body when posting to the allowlist endpoint. + */ +type AllowListPostRequest = { + allowList: string; + totalUnits: string; +}; + +/** + * Type for the response data from the API. + */ +type ResponseData = { + message: string; + cid?: string; + errors?: Record; +}; + +/** + * Axios instance configured with the base URL for the hypercert API. + */ +const api = axios.create({ timeout: 10000, headers: { "Content-Type": "application/json" } }); + +/** + * Uploads metadata to the API. + * + * @param metadata - The metadata to upload. Should be an object that conforms to the HypercertMetadata type. + * @returns The response data from the API. + */ +const uploadMetadata = async (metadata: HypercertMetadata) => { + const response = await api.post( + "https://hypercerts-api-production.up.railway.app/api/v1/web3up/metadata", + metadata, + ); + + return response.data; +}; + +/** + * Uploads an allowlist to the API. + * + * @param req - The request body containing the allowlist and total units. The allowList should be a stringified Merkle tree dump. + * @returns The response data from the API. + * + */ +const uploadAllowlist = async (req: AllowListPostRequest) => { + const response = await api.post( + "https://hypercerts-api-production.up.railway.app/api/v1/web3up/allowlist", + req, + ); + + return response.data; +}; + +export { uploadMetadata, uploadAllowlist }; diff --git a/sdk/src/utils/config.ts b/sdk/src/utils/config.ts index 5d873cc7..a4afa1fd 100644 --- a/sdk/src/utils/config.ts +++ b/sdk/src/utils/config.ts @@ -1,4 +1,4 @@ -import { sepolia, goerli, optimism, celo, Chain } from "viem/chains"; +import { sepolia, optimism, celo, Chain } from "viem/chains"; import { DEPLOYMENTS } from "../constants"; import { @@ -22,7 +22,6 @@ import { deployments } from "../../src"; * 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 @@ -84,8 +83,6 @@ export const getConfig = (overrides: Partial): Partial) => { return { publicClient }; }; -export const getNftStorageToken = (overrides: Partial) => { - if (overrides.nftStorageToken) { - return { nftStorageToken: overrides.nftStorageToken }; - } -}; - -export const getWeb3StorageToken = (overrides: Partial) => { - if (overrides.web3StorageToken) { - return { web3StorageToken: overrides.web3StorageToken }; - } -}; - const getEasContractAddress = (overrides: Partial) => { return { easContractAddress: overrides.easContractAddress }; }; const getDefaultChain = (chainId: number) => { - const _chains = [sepolia, goerli, optimism, celo]; + const _chains = [sepolia, optimism, celo]; for (const chain of Object.values(_chains)) { if ("id" in chain) { diff --git a/sdk/src/utils/fetchers.ts b/sdk/src/utils/fetchers.ts index 6b0144a6..9c9111e1 100644 --- a/sdk/src/utils/fetchers.ts +++ b/sdk/src/utils/fetchers.ts @@ -3,9 +3,9 @@ import { logger } from "./logger"; import axios from "axios"; /** - * Fetches data from IPFS using either the NFT Storage gateway or the Web3 Storage gateway. + * Fetches data from IPFS using either the NFT Storage gateway or the Web3Up 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. + * 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 Web3Up 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. @@ -16,13 +16,13 @@ import axios from "axios"; */ const getFromIPFS = async (cidOrIpfsUri: string, timeout: number = 10000): Promise => { const nftStorageGatewayLink = getNftStorageGatewayUri(cidOrIpfsUri); - const web3StorageGatewayLink = getWeb3StorageGatewayUri(cidOrIpfsUri); + const web3upGatewayLink = getWeb3UpGatewayUri(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 }); + logger.debug(`Getting metadata ${cidOrIpfsUri} at ${web3upGatewayLink}`); + return axios.get(web3upGatewayLink, { timeout }); }); if (!res || !res.data) { @@ -39,7 +39,7 @@ const getNftStorageGatewayUri = (cidOrIpfsUri: string) => { return NFT_STORAGE_IPFS_GATEWAY.replace("{cid}", getCid(cidOrIpfsUri)); }; -const getWeb3StorageGatewayUri = (cidOrIpfsUri: string) => { +const getWeb3UpGatewayUri = (cidOrIpfsUri: string) => { const WEB3_STORAGE_IPFS_GATEWAY = "https://w3s.link/ipfs/{cid}"; return WEB3_STORAGE_IPFS_GATEWAY.replace("{cid}", getCid(cidOrIpfsUri)); }; diff --git a/sdk/src/utils/index.ts b/sdk/src/utils/index.ts index 53113f75..ccc4d04d 100644 --- a/sdk/src/utils/index.ts +++ b/sdk/src/utils/index.ts @@ -1,10 +1,11 @@ import { walletClientToSigner, publicClientToProvider } from "./adapters"; -import { getProofsFromAllowlist } from "./allowlist"; +import { getProofsFromAllowlist, parseAllowListEntriesToMerkleTree } from "./allowlist"; import { getFromIPFS } from "./fetchers"; import { formatHypercertData } from "./formatter"; import { logger } from "./logger"; import { handleSdkError, handleContractError } from "./errors"; +import { uploadMetadata, uploadAllowlist } from "./apis"; export { walletClientToSigner, @@ -15,4 +16,7 @@ export { formatHypercertData, handleSdkError, handleContractError, + uploadMetadata, + uploadAllowlist, + parseAllowListEntriesToMerkleTree, }; diff --git a/sdk/src/validator/index.ts b/sdk/src/validator/index.ts index dc592083..6a25b92d 100644 --- a/sdk/src/validator/index.ts +++ b/sdk/src/validator/index.ts @@ -58,7 +58,7 @@ const validateMetaData = (data: unknown): ValidationResult => { errors[key] = e.message; } } - return { data, valid: false, errors }; + return { data: data as unknown, valid: false, errors }; } return { data: data as HypercertMetadata, valid: true, errors: {} }; @@ -89,7 +89,7 @@ const validateClaimData = (data: unknown): ValidationResult => { errors[key] = e.message; } } - return { data, valid: false, errors }; + return { data: data as unknown, valid: false, errors }; } return { data: data as HypercertClaimdata, valid: true, errors: {} }; @@ -123,7 +123,11 @@ const validateAllowlist = (data: AllowlistEntry[], units: bigint): ValidationRes errors["address"] = filteredAddresses.map((entry) => entry.address); } - return { data, valid: Object.keys(errors).length === 0, errors }; + if (Object.keys(errors).length > 0) { + return { data: data as unknown, valid: Object.keys(errors).length === 0, errors }; + } + + return { data: data as AllowlistEntry[], valid: Object.keys(errors).length === 0, errors }; }; /** diff --git a/sdk/test/client.test.ts b/sdk/test/client.test.ts index 260791f6..01ceff58 100644 --- a/sdk/test/client.test.ts +++ b/sdk/test/client.test.ts @@ -14,7 +14,7 @@ describe("HypercertClient setup tests", () => { it("should be able to create a new read only instance when missing storage keys", () => { const readOnlyClient = new HypercertClient({ - chain: { id: 5 }, + chain: { id: 11155111 }, publicClient, }); @@ -24,7 +24,7 @@ describe("HypercertClient setup tests", () => { it("should be able to create a new instance", () => { const client = new HypercertClient({ - chain: { id: 5 }, + chain: { id: 11155111 }, publicClient, walletClient, nftStorageToken: "test", @@ -51,7 +51,7 @@ describe("HypercertClient setup tests", () => { }); it("should throw an error when executing write method in readonly mode", async () => { - const client = new HypercertClient({ chain: { id: 5 } }); + const client = new HypercertClient({ chain: { id: 11155111 } }); // mintClaim try { diff --git a/sdk/test/client/allowlist.minting.test.ts b/sdk/test/client/allowlist.minting.test.ts index c9cbce48..6322bb7f 100644 --- a/sdk/test/client/allowlist.minting.test.ts +++ b/sdk/test/client/allowlist.minting.test.ts @@ -13,17 +13,16 @@ import { encodeFunctionResult, isHex, stringToHex } from "viem"; chai.use(assertionsCount); describe("Allows for minting claims from an allowlist", () => { - 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 { someData } = mockDataSets; + const metaDataStub = sinon.stub(HypercertsStorage.prototype, "storeMetadata"); + const allowListStub = sinon.stub(HypercertsStorage.prototype, "storeAllowList"); const wallet = walletClient; const userAddress = wallet.account?.address; const client = new HypercertClient({ - chain: { id: 5 }, + chain: { id: 11155111 }, walletClient, publicClient, nftStorageToken: "test", - web3StorageToken: "test", }); const readSpy = sinon.stub(publicClient, "readContract"); @@ -57,7 +56,7 @@ describe("Allows for minting claims from an allowlist", () => { writeSpy.resetHistory(); metaDataStub.resetHistory(); - dataStub.resetHistory(); + allowListStub.resetHistory(); }); afterAll(() => { @@ -69,13 +68,14 @@ describe("Allows for minting claims from an allowlist", () => { const { allowlist, totalUnits } = getAllowlist(); const metaData = getFormattedMetadata(); + allowListStub.resolves(someData.cid); writeSpy = writeSpy.resolves(mintClaimResult); const hash = await client.createAllowlist(allowlist, metaData, totalUnits, TransferRestrictions.FromCreatorOnly); expect(isHex(hash)).to.be.true; expect(metaDataStub.callCount).to.eq(1); - expect(dataStub.callCount).to.eq(1); + expect(allowListStub.callCount).to.eq(1); expect(readSpy.callCount).to.eq(0); expect(writeSpy.callCount).to.eq(1); }); @@ -85,6 +85,12 @@ describe("Allows for minting claims from an allowlist", () => { const { allowlist, totalUnits } = getAllowlist(); const metaData = getFormattedMetadata(); + allowListStub.throws( + new MalformedDataError("Allowlist validation failed", { + units: "Total units in allowlist must match total units [expected: 11, got: 10]", + }), + ); + let hash; try { hash = await client.createAllowlist(allowlist, metaData, totalUnits + 1n, TransferRestrictions.FromCreatorOnly); @@ -100,7 +106,7 @@ describe("Allows for minting claims from an allowlist", () => { expect(hash).to.be.undefined; expect(metaDataStub.callCount).to.eq(0); - expect(dataStub.callCount).to.eq(0); + expect(allowListStub.callCount).to.eq(1); expect(readSpy.callCount).to.eq(0); expect(writeSpy.callCount).to.eq(0); }); @@ -114,6 +120,12 @@ describe("Allows for minting claims from an allowlist", () => { allowlist[0].units = 0n; + allowListStub.throws( + new MalformedDataError("Allowlist validation failed", { + units: "Total units in allowlist must match total units [expected: 10, got: 9]", + }), + ); + try { hash = await client.createAllowlist(allowlist, metaData, totalUnits, TransferRestrictions.FromCreatorOnly); } catch (e) { @@ -128,7 +140,7 @@ describe("Allows for minting claims from an allowlist", () => { expect(hash).to.be.undefined; expect(metaDataStub.callCount).to.eq(0); - expect(dataStub.callCount).to.eq(0); + expect(allowListStub.callCount).to.eq(1); expect(readSpy.callCount).to.eq(0); expect(writeSpy.callCount).to.eq(0); }); @@ -149,7 +161,7 @@ describe("Allows for minting claims from an allowlist", () => { expect(isHex(hash)).to.be.true; expect(metaDataStub.callCount).to.eq(0); - expect(dataStub.callCount).to.eq(0); + expect(allowListStub.callCount).to.eq(0); expect(readSpy.callCount).to.eq(0); expect(writeSpy.callCount).to.eq(1); }); @@ -169,7 +181,7 @@ describe("Allows for minting claims from an allowlist", () => { expect(isHex(hash)).to.be.true; expect(metaDataStub.callCount).to.eq(0); - expect(dataStub.callCount).to.eq(0); + expect(allowListStub.callCount).to.eq(0); expect(readSpy.callCount).to.eq(0); expect(writeSpy.callCount).to.eq(1); }); @@ -201,7 +213,7 @@ describe("Allows for minting claims from an allowlist", () => { expect(hash).to.be.undefined; expect(metaDataStub.callCount).to.eq(0); - expect(dataStub.callCount).to.eq(0); + expect(allowListStub.callCount).to.eq(0); expect(readSpy.callCount).to.eq(0); expect(writeSpy.callCount).to.eq(0); }); @@ -231,7 +243,7 @@ describe("Allows for minting claims from an allowlist", () => { expect(isHex(hash)).to.be.true; expect(metaDataStub.callCount).to.eq(0); - expect(dataStub.callCount).to.eq(0); + expect(allowListStub.callCount).to.eq(0); expect(readSpy.callCount).to.eq(0); expect(writeSpy.callCount).to.eq(1); }); @@ -260,7 +272,7 @@ describe("Allows for minting claims from an allowlist", () => { expect(isHex(hash)).to.be.true; expect(metaDataStub.callCount).to.eq(0); - expect(dataStub.callCount).to.eq(0); + expect(allowListStub.callCount).to.eq(0); expect(readSpy.callCount).to.eq(0); expect(writeSpy.callCount).to.eq(1); }); @@ -303,7 +315,7 @@ describe("Allows for minting claims from an allowlist", () => { expect(hash).to.be.undefined; expect(metaDataStub.callCount).to.eq(0); - expect(dataStub.callCount).to.eq(0); + expect(allowListStub.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 9c097aa7..fed00e1d 100644 --- a/sdk/test/client/burn.test.ts +++ b/sdk/test/client/burn.test.ts @@ -15,7 +15,7 @@ describe("burn fraction tokens in HypercertClient", () => { const wallet = walletClient; const userAddress = wallet.account?.address; const client = new HypercertClient({ - chain: { id: 5 }, + chain: { id: 11155111 }, walletClient, publicClient, nftStorageToken: "test", diff --git a/sdk/test/client/minting.test.ts b/sdk/test/client/minting.test.ts index fa4e3f00..c09ca1d8 100644 --- a/sdk/test/client/minting.test.ts +++ b/sdk/test/client/minting.test.ts @@ -5,7 +5,7 @@ import sinon from "sinon"; import { encodeFunctionResult, isHex, parseEther } from "viem"; import { HypercertClient } from "../../src/client"; -import { HypercertMetadata, formatHypercertData } from "../../src"; +import { HypercertMetadata, HypercertsStorage, formatHypercertData } from "../../src"; import { ContractError, MalformedDataError } from "../../src/types/errors"; import { TransferRestrictions } from "../../src/types/hypercerts"; import { getRawInputData, publicClient, walletClient, testClient } from "../helpers"; @@ -13,21 +13,20 @@ import { HypercertMinterAbi } from "@hypercerts-org/contracts"; //eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore -import { CIDString, NFTStorage } from "nft.storage"; +import { CIDString } from "nft.storage"; chai.use(assertionsCount); describe("mintClaim in HypercertClient", () => { const mockCorrectMetadataCid = "testCID1234fkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u" as CIDString; - const storeBlobMock = sinon.stub(NFTStorage, "storeBlob").resolves(mockCorrectMetadataCid); + const storeMetadataMock = sinon.stub(HypercertsStorage.prototype, "storeMetadata"); const client = new HypercertClient({ - chain: { id: 5 }, + chain: { id: 11155111 }, walletClient, publicClient, nftStorageToken: "test", - web3StorageToken: "test", }); const readSpy = sinon.stub(publicClient, "readContract"); @@ -49,7 +48,8 @@ describe("mintClaim in HypercertClient", () => { writeSpy.resetBehavior(); writeSpy.resetHistory(); - storeBlobMock.resetHistory(); + storeMetadataMock.resetBehavior(); + storeMetadataMock.resetHistory(); }); afterAll(() => { @@ -62,6 +62,7 @@ describe("mintClaim in HypercertClient", () => { const rawData = getRawInputData(); const { data: formattedData } = formatHypercertData(rawData); + storeMetadataMock.resolves(mockCorrectMetadataCid); writeSpy = writeSpy.resolves(mintClaimResult); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion @@ -70,19 +71,22 @@ describe("mintClaim in HypercertClient", () => { expect(isHex(hash)).to.be.true; expect(readSpy.callCount).to.equal(0); expect(writeSpy.callCount).to.equal(1); - expect(storeBlobMock.callCount).to.equal(1); + expect(storeMetadataMock.callCount).to.equal(1); }); it("throws on malformed metadata", async () => { + storeMetadataMock.callThrough(); try { await client.mintClaim({} as HypercertMetadata, 1000n, TransferRestrictions.AllowAll); expect.fail("Should throw MalformedDataError"); } catch (e) { + console.log(e); expect(e).to.be.instanceOf(MalformedDataError); const error = e as MalformedDataError; - expect(error.message).to.equal("Metadata validation failed"); + expect(error.message).to.equal("Invalid metadata."); } expect(writeSpy.callCount).to.equal(0); + expect(storeMetadataMock.callCount).to.equal(1); }); it("mints a hypercerts with override params", async () => { @@ -90,6 +94,7 @@ describe("mintClaim in HypercertClient", () => { const { data: formattedData } = formatHypercertData(rawData); + storeMetadataMock.resolves(mockCorrectMetadataCid); writeSpy = writeSpy.resolves(mintClaimResult); let hash; @@ -112,6 +117,6 @@ describe("mintClaim in HypercertClient", () => { expect(isHex(hash)).to.be.true; expect(readSpy.callCount).to.equal(0); expect(writeSpy.callCount).to.equal(1); - expect(storeBlobMock.callCount).to.equal(2); + expect(storeMetadataMock.callCount).to.equal(2); }); }); diff --git a/sdk/test/client/split.merge.test.ts b/sdk/test/client/split.merge.test.ts index bfd3cf54..1b13b2fa 100644 --- a/sdk/test/client/split.merge.test.ts +++ b/sdk/test/client/split.merge.test.ts @@ -21,7 +21,7 @@ describe("split and merge", () => { let writeSpy = sinon.stub(walletClient, "writeContract"); const client = new HypercertClient({ - chain: { id: 5 }, + chain: { id: 11155111 }, walletClient, publicClient, nftStorageToken: "test", diff --git a/sdk/test/evaluations/evaluator.test.ts b/sdk/test/evaluations/evaluator.test.ts index 5e7c3864..bd0c50ee 100644 --- a/sdk/test/evaluations/evaluator.test.ts +++ b/sdk/test/evaluations/evaluator.test.ts @@ -13,7 +13,7 @@ chai.use(assertionsCount); describe("HypercertEvaluator", () => { const signer = walletClient.account; const evaluator = new HypercertEvaluator({ - chain: { id: 5 }, + chain: { id: 11155111 }, easContractAddress: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e", publicClient, }); @@ -72,7 +72,7 @@ describe("HypercertEvaluator", () => { const evaluation: HypercertEvaluationSchema = getEvaluationData({ creator: signer?.address }); const readonlyEvaluator = new HypercertEvaluator({ - chain: { id: 5 }, + chain: { id: 11155111 }, easContractAddress: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e", publicClient, }); diff --git a/sdk/test/storage.test.ts b/sdk/test/storage.test.ts index f79d0f2c..9f761bfc 100644 --- a/sdk/test/storage.test.ts +++ b/sdk/test/storage.test.ts @@ -1,10 +1,8 @@ import { describe, it, afterAll } from "vitest"; import { expect } from "chai"; -import { HypercertMetadata } from "../src"; import { HypercertsStorage } from "../src/storage"; -import { StorageError } from "../src/types/errors"; import { reloadEnv } from "./setup-env"; describe("HypercertsStorage", () => { @@ -13,55 +11,14 @@ describe("HypercertsStorage", () => { }); it("should be able to create a new instance without valid storage keys", () => { - const storage = new HypercertsStorage({}); + const storage = new HypercertsStorage(); expect(storage).to.be.an.instanceOf(HypercertsStorage); - expect(storage.readonly).to.be.true; }); it("should be able to create a new instance with valid storage keys", () => { - const storage = new HypercertsStorage({ nftStorageToken: "test", web3StorageToken: "test" }); + const storage = new HypercertsStorage(); expect(storage).to.be.an.instanceOf(HypercertsStorage); - expect(storage.readonly).to.be.false; - }); - - it("should block calls to store data when in read only mode", async () => { - const storage = new HypercertsStorage({}); - - expect(async () => storage.storeData({}).should.throw(StorageError, "Web3.storage client is not configured")); - expect(async () => - storage.storeMetadata({} as HypercertMetadata).should.throw(StorageError, "NFT.storage client is not configured"), - ); - }); - - it("should throw an error when executing write method in readonly mode", async () => { - const client = new HypercertsStorage({}); - - // storeMetadata - try { - const metaData = { name: "test" } as HypercertMetadata; - - await client.storeMetadata(metaData); - expect.fail("Should throw StorageError"); - } catch (e) { - expect(e instanceof StorageError).to.be.true; - - const error = e as StorageError; - expect(error.message).to.eq("NFT.storage client is not configured"); - } - - // storeData - try { - const data = { name: "test" }; - - await client.storeData(data); - expect.fail("Should throw ClientError"); - } catch (e) { - expect(e instanceof StorageError).to.be.true; - - const error = e as StorageError; - expect(error.message).to.eq("Web3.storage client is not configured"); - } }); }); diff --git a/sdk/test/storage/nft.storage.test.ts b/sdk/test/storage/nft.storage.test.ts deleted file mode 100644 index 60b9ec86..00000000 --- a/sdk/test/storage/nft.storage.test.ts +++ /dev/null @@ -1,82 +0,0 @@ -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"; -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 { hypercertMetadata } = mockDataSets; - - const storeBlobMock = sinon.stub(NFTStorage.prototype, "storeBlob").resolves(hypercertMetadata.cid); - - const storage = new HypercertsStorage({ - nftStorageToken: process.env.NFT_STORAGE_TOKEN, - web3StorageToken: process.env.WEB3_STORAGE_TOKEN, - }); - - afterEach(() => { - chai.Assertion.resetAssertsCheck(); - vi.clearAllMocks(); - sinon.restore(); - }); - - afterAll(() => { - vi.resetAllMocks(); - sinon.resetBehavior(); - }); - - /** - * Currently just testing against the production NFT.Storage service. - */ - it("Smoke test - add metadata", async () => { - await storage.storeMetadata(getFormattedMetadata()); - expect(storeBlobMock.callCount).to.eq(1); - }); - - it("Smoke test - get metadata", async () => { - sinon.stub(axios, "get").resolves(Promise.resolve({ data: hypercertMetadata.data })); - const res = await storage.getMetadata(hypercertMetadata.cid); - - 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({ data: "false" } as unknown as HypercertMetadata); - } catch (e) { - expect(e).to.be.an.instanceOf(MalformedDataError); - - const error = e as MalformedDataError; - expect(error.message).to.eq("Invalid metadata."); - } - }); - - 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(incorrectCID); - } catch (e) { - expect(e).to.be.an.instanceOf(MalformedDataError); - - const error = e as MalformedDataError; - expect(error.message).to.be.eq(`Invalid metadata at ${incorrectCID}`); - } - }); -}); diff --git a/sdk/test/storage/storeAllowList.test.ts b/sdk/test/storage/storeAllowList.test.ts new file mode 100644 index 00000000..4c385293 --- /dev/null +++ b/sdk/test/storage/storeAllowList.test.ts @@ -0,0 +1,71 @@ +import { describe, it, afterEach, afterAll, vi, expect } from "vitest"; + +import { HypercertsStorage } from "../../src/storage"; +import { MalformedDataError } from "../../src/types/errors"; +import { mockDataSets } from "../helpers"; +import sinon from "sinon"; +import { faker } from "@faker-js/faker"; +import { AllowlistEntry } from "src"; + +const mocks = vi.hoisted(() => { + return { + uploadAllowlist: vi.fn(), + }; +}); + +vi.mock("../../src/utils/apis", () => { + return { + uploadAllowlist: mocks.uploadAllowlist, + }; +}); + +describe("Storage - store allowlist", () => { + const { someData } = mockDataSets; + + const storage = new HypercertsStorage(); + + afterEach(() => { + vi.clearAllMocks(); + sinon.restore(); + }); + + afterAll(() => { + vi.resetAllMocks(); + sinon.resetBehavior(); + }); + + it("Store allowlist", async () => { + const allowList = [ + { + address: faker.finance.ethereumAddress(), + units: BigInt(100), + }, + ]; + + mocks.uploadAllowlist.mockResolvedValue({ cid: someData.cid }); + const res = await storage.storeAllowList(allowList, 100n); + expect(res).to.eq(someData.cid); + expect(mocks.uploadAllowlist).toHaveBeenCalledTimes(1); + }); + + it("Throws when trying to store incorrect allowList", async () => { + const allowList = [ + { + address: faker.finance.ethereumAddress(), + units: 50n, + }, + ]; + + // storeData + try { + await storage.storeAllowList(allowList as unknown as AllowlistEntry[], 100n); + } catch (e) { + expect(e).to.be.an.instanceOf(MalformedDataError); + + const error = e as MalformedDataError; + expect(error.message).to.eq("Invalid allowList."); + } + + expect(mocks.uploadAllowlist).toHaveBeenCalledTimes(0); + }); +}); diff --git a/sdk/test/storage/storeMetadata.test.ts b/sdk/test/storage/storeMetadata.test.ts new file mode 100644 index 00000000..336e2072 --- /dev/null +++ b/sdk/test/storage/storeMetadata.test.ts @@ -0,0 +1,60 @@ +import { describe, it, afterEach, afterAll, vi, expect } from "vitest"; + +import { HypercertsStorage } from "../../src/storage"; +import { MalformedDataError } from "../../src/types/errors"; +import { mockDataSets } from "../helpers"; +import sinon from "sinon"; + +const mocks = vi.hoisted(() => { + return { + uploadMetadata: vi.fn(), + }; +}); + +vi.mock("../../src/utils/apis", () => { + return { + uploadMetadata: mocks.uploadMetadata, + }; +}); + +describe("Storage - store metadata", () => { + const { hypercertMetadata } = mockDataSets; + + const storage = new HypercertsStorage(); + + afterEach(() => { + vi.clearAllMocks(); + sinon.restore(); + }); + + afterAll(() => { + vi.resetAllMocks(); + sinon.resetBehavior(); + }); + + it("Store metadata", async () => { + mocks.uploadMetadata.mockResolvedValue({ cid: hypercertMetadata.cid }); + const res = await storage.storeMetadata(hypercertMetadata.data); + expect(res).to.eq(hypercertMetadata.cid); + expect(mocks.uploadMetadata).toHaveBeenCalledTimes(1); + }); + + it("Throws when trying to store incorrect metadata", async () => { + const _metadata = { + ...hypercertMetadata.data, + name: undefined, + }; + + // storeData + try { + await storage.storeMetadata(_metadata); + } catch (e) { + expect(e).to.be.an.instanceOf(MalformedDataError); + + const error = e as MalformedDataError; + expect(error.message).to.eq("Invalid metadata."); + } + + expect(mocks.uploadMetadata).toHaveBeenCalledTimes(0); + }); +}); diff --git a/sdk/test/storage/web3.storage.test.ts b/sdk/test/storage/web3.storage.test.ts deleted file mode 100644 index 4210cd5c..00000000 --- a/sdk/test/storage/web3.storage.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -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"; -import { mockDataSets } from "../helpers"; -import axios from "axios"; -import sinon from "sinon"; - -describe("Web3.Storage Client", () => { - const { hypercertData, hypercertMetadata } = mockDataSets; - - const storeBlobMock = sinon.stub(Web3Storage.prototype, "put").resolves(hypercertMetadata.cid); - - const storage = new HypercertsStorage({ - nftStorageToken: process.env.NFT_STORAGE_TOKEN, - web3StorageToken: process.env.WEB3_STORAGE_TOKEN, - }); - - afterEach(() => { - sinon.restore(); - }); - - afterAll(() => { - sinon.resetBehavior(); - }); - - /** - * Currently just testing against the production NFT.Storage service. - */ - it("Smoke test - add data", async () => { - await storage.storeData(hypercertData.data); - expect(storeBlobMock.callCount).to.eq(1); - }); - - it("Smoke test - get data", async () => { - sinon.stub(axios, "get").resolves(Promise.resolve({ data: hypercertData.data })); - const res = await storage.getData(hypercertData.cid); - - expect(res).to.deep.eq(hypercertData.data); - }); -}); diff --git a/sdk/test/utils/config.test.ts b/sdk/test/utils/config.test.ts index b3e7d32f..340f68b1 100644 --- a/sdk/test/utils/config.test.ts +++ b/sdk/test/utils/config.test.ts @@ -20,7 +20,7 @@ describe("Config: contractAddress", () => { it("should return the contract address specified by overrides", () => { const overrides: Partial = { - chain: { id: 5 }, + chain: { id: 11155111 }, contractAddress: "0x1234567890123456789012345678901234567890", }; const config = getConfig(overrides); @@ -28,7 +28,7 @@ describe("Config: contractAddress", () => { }); it("should throw an error when the contract address specified by overrides is invalid", () => { - const overrides: Partial = { chain: { id: 5 }, contractAddress: "invalid-address" }; + const overrides: Partial = { chain: { id: 11155111 }, contractAddress: "invalid-address" }; try { getConfig(overrides); } catch (e) { @@ -45,13 +45,13 @@ describe("Config: graphUrl", () => { }); it("should return the default graphUrl when no overrides are specified", () => { - const result = getConfig({ chain: { id: 5 } }); - expect(result.graphUrl).to.equal("https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-testnet"); + const result = getConfig({ chain: { id: 11155111 } }); + expect(result.graphUrl).to.equal("https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-sepolia"); }); it("should return the config specified by overrides", () => { const overrides: Partial = { - chain: { id: 5 }, + chain: { id: 11155111 }, graphUrl: "https://api.example.com", contractAddress: "0x1234567890123456789012345678901234567890", unsafeForceOverrideConfig: true, @@ -62,7 +62,7 @@ describe("Config: graphUrl", () => { it("should throw an error when the graph URL specified by overrides is invalid", () => { const overrides: Partial = { - chain: { id: 5 }, + chain: { id: 11155111 }, graphUrl: "incorrect-url", contractAddress: "0x1234567890123456789012345678901234567890", unsafeForceOverrideConfig: true, @@ -79,7 +79,7 @@ describe("Config: graphUrl", () => { it("should throw an error when the graph URL specified by overrides is missing", () => { const overrides: Partial = { - chain: { id: 5 }, + chain: { id: 11155111 }, contractAddress: "0x1234567890123456789012345678901234567890", unsafeForceOverrideConfig: true, }; @@ -90,46 +90,12 @@ describe("Config: graphUrl", () => { 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", + "attempted to override with chainId=11155111, but requires chainName, graphUrl, and contractAddress to be set", ); } }); }); -describe("Config: nftStorageToken & web3storageToken", () => { - afterEach(() => { - sinon.restore(); - - reloadEnv(); - }); - it("should return an empty object when no overrides or environment variables are specified", () => { - 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", () => { - 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", () => { - const overrides: Partial = { chain: { id: 5 }, nftStorageToken: undefined }; - expect(() => getConfig(overrides)).to.not.throw(); - }); -}); - describe("Config: getPublicClient", () => { afterEach(() => { sinon.restore(); @@ -139,7 +105,7 @@ describe("Config: getPublicClient", () => { it("should return the operator specified by overrides", () => { const overrides: Partial = { - chain: { id: 5 }, + chain: { id: 11155111 }, publicClient, }; const result = getConfig(overrides); @@ -156,40 +122,10 @@ describe("Config: getWalletClient", () => { it("should return the operator specified by overrides", () => { const overrides: Partial = { - chain: { id: 5 }, + chain: { id: 11155111 }, walletClient, }; const result = getConfig(overrides); expect(result.walletClient).to.equal(overrides.walletClient); }); }); - -describe("Config: web3StorageToken", () => { - afterEach(() => { - sinon.restore(); - - reloadEnv(); - }); - - it("should return an empty object when no overrides or environment variables are specified", () => { - 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 not throw an error when the web3StorageToken specified by overrides is invalid", () => { - 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 a69cc8e0..1f9a8955 100644 --- a/sdk/test/utils/errors.test.ts +++ b/sdk/test/utils/errors.test.ts @@ -8,10 +8,7 @@ import { handleSdkError } from "../../src/utils/errors"; 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 { HypercertClient, HypercertMinterAbi, HypercertsStorage, TransferRestrictions, formatHypercertData } from "src"; import { parseEther, encodeErrorResult } from "viem"; chai.use(assertionsCount); @@ -29,16 +26,15 @@ describe("SDK Error handler", () => { }); describe("Contract Error handler", () => { - const mockCorrectMetadataCid = "testCID1234fkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u" as CIDString; + const mockCorrectMetadataCid = "testCID1234fkreigdm2flneb4khd7eixodagst5nrndptgezrjux7gohxcngjn67x6u"; - const storeBlobMock = sinon.stub(NFTStorage, "storeBlob").resolves(mockCorrectMetadataCid); + const storeMetadataStub = sinon.stub(HypercertsStorage.prototype, "storeMetadata"); const client = new HypercertClient({ - chain: { id: 5 }, + chain: { id: 11155111 }, walletClient, publicClient, nftStorageToken: "test", - web3StorageToken: "test", }); const readSpy = sinon.stub(publicClient, "readContract"); @@ -54,7 +50,7 @@ describe("Contract Error handler", () => { writeSpy.resetBehavior(); writeSpy.resetHistory(); - storeBlobMock.resetHistory(); + storeMetadataStub.resetHistory(); }); afterAll(() => { @@ -74,6 +70,8 @@ describe("Contract Error handler", () => { }); writeSpy.resolves(value); + storeMetadataStub.resolves(mockCorrectMetadataCid); + try { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion await client.mintClaim(formattedData!, 0n, TransferRestrictions.DisallowAll);