Skip to content

Commit

Permalink
Feat/sdk npm docs release 1 (#1231)
Browse files Browse the repository at this point in the history
* [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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
  • Loading branch information
bitbeckers and Jipperism authored Dec 8, 2023
1 parent f1de3d6 commit 210c167
Show file tree
Hide file tree
Showing 252 changed files with 36,488 additions and 17 deletions.
39 changes: 23 additions & 16 deletions docs/docs/developer/api/sdk/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ sdk/src/indexer/gql/graphql.ts:116

#### Defined in

sdk/src/indexer/gql/graphql.ts:580

sdk/src/indexer/gql/graphql.ts:587


---

Expand Down Expand Up @@ -135,7 +137,7 @@ sdk/src/indexer/gql/graphql.ts:129

#### Defined in

sdk/src/indexer/gql/graphql.ts:607
sdk/src/indexer/gql/graphql.ts:636

---

Expand All @@ -152,7 +154,7 @@ sdk/src/indexer/gql/graphql.ts:607

#### Defined in

sdk/src/indexer/gql/graphql.ts:600
sdk/src/indexer/gql/graphql.ts:627

---

Expand All @@ -169,7 +171,8 @@ sdk/src/indexer/gql/graphql.ts:600

#### Defined in

sdk/src/indexer/gql/graphql.ts:590
sdk/src/indexer/gql/graphql.ts:608


---

Expand All @@ -186,8 +189,7 @@ sdk/src/indexer/gql/graphql.ts:590

#### Defined in

sdk/src/indexer/gql/graphql.ts:564

sdk/src/indexer/gql/graphql.ts:549
---

### Deployment
Expand Down Expand Up @@ -223,7 +225,8 @@ sdk/src/types/client.ts:23

#### Defined in

sdk/src/indexer/gql/gql.ts:47
sdk/src/indexer/gql/gql.ts:53


---

Expand Down Expand Up @@ -263,7 +266,8 @@ sdk/src/types/evaluation.d.ts:9

#### Defined in

sdk/src/indexer/gql/fragment-masking.ts:6
sdk/src/indexer/gql/fragment-masking.ts:5


---

Expand Down Expand Up @@ -381,7 +385,7 @@ sdk/src/types/indexer.ts:10

#### Defined in

sdk/src/indexer/gql/graphql.ts:573
sdk/src/indexer/gql/graphql.ts:569

---

Expand Down Expand Up @@ -639,7 +643,7 @@ Please regenerate the types.

#### Defined in

sdk/src/indexer/gql/gql.ts:32
sdk/src/indexer/gql/gql.ts:34

**graphql**(`source`): typeof `documents`[``"query ClaimsByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}"``]

Expand All @@ -657,7 +661,7 @@ typeof `documents`[``"query ClaimsByOwner($owner: Bytes = \"\", $orderDirection:

#### Defined in

sdk/src/indexer/gql/gql.ts:37
sdk/src/indexer/gql/gql.ts:39

**graphql**(`source`): typeof `documents`[``"query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}"``]

Expand All @@ -675,7 +679,7 @@ typeof `documents`[``"query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirec

#### Defined in

sdk/src/indexer/gql/gql.ts:41
sdk/src/indexer/gql/gql.ts:45

---

Expand Down Expand Up @@ -891,7 +895,7 @@ sdk/src/utils/adapters.ts:19

#### Defined in

sdk/src/indexer/gql/fragment-masking.ts:18
sdk/src/indexer/gql/fragment-masking.ts:15

**useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `TType` \| `null` \| `undefined`

Expand All @@ -914,7 +918,8 @@ sdk/src/indexer/gql/fragment-masking.ts:18

#### Defined in

sdk/src/indexer/gql/fragment-masking.ts:23
sdk/src/indexer/gql/fragment-masking.ts:20


**useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `ReadonlyArray`<`TType`\>

Expand All @@ -937,7 +942,8 @@ sdk/src/indexer/gql/fragment-masking.ts:23

#### Defined in

sdk/src/indexer/gql/fragment-masking.ts:28
sdk/src/indexer/gql/fragment-masking.ts:25


**useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `ReadonlyArray`<`TType`\> \| `null` \| `undefined`

Expand All @@ -960,7 +966,8 @@ sdk/src/indexer/gql/fragment-masking.ts:28

#### Defined in

sdk/src/indexer/gql/fragment-masking.ts:33
sdk/src/indexer/gql/fragment-masking.ts:30


---

Expand Down
24 changes: 24 additions & 0 deletions docs/versioned_docs/version-1.0.0-alpha.0/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: The Hypercerts Foundation
id: about
---

# The Hypercerts Foundation

### Mission

The mission of the Hypercerts Foundation is to advance the development and adoption of open-source protocols for funding and rewarding positive impact.

### Organization

The Hypercerts Foundation is a fully independent organisation working closely with stakeholders in the open source, scientific research, and cryptography communities to develop and promote additional protocols that are decentralized, secure, and transparent. The Foundation will also provide support and resources to help drive the wider adoption of these protocols.

### History

Research on hypercerts was first presented to the public by David A. Dalrymple at the conference series Funding the Commons in March 2022. However, the concept of “impact certificates” has been a recurring theme at conferences and in online discussion forums since at least 2014. In late 2022, a small team of research scientists, developers, and practitioners began implementing hypercerts as a set of Ethereum-based smart contracts that could be used to assert and fund impact claims. The Hypercerts Foundation will now serve as the long-term home for this work.

The new foundation is supported in part by Protocol Labs and is part of the broader Protocol Labs Network of hundreds of companies and organizations. The Foundation will complement Protocol Labs Network’s mission of enabling a more secure, open, and accessible internet. The Hypercerts Foundation, however, is fully independent and will focus on protocol development and cultivating a community of developers and impact entrepreneurs well beyond the Protocol Labs Network.

### Further links

Read the full [announcement of the Hypercerts Foundation](https://hypercerts.notion.site/Introducing-the-Hypercerts-Foundation-d956203fe0fc4792980da138015e770a).
101 changes: 101 additions & 0 deletions docs/versioned_docs/version-1.0.0-alpha.0/developer/allowlists.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Allowlists

Allowlists are an efficient way to enable distribution of hypercert fractions amongst a group.
First, the creator will create the hypercert with the metadata and an immutable allowlist.
With the `claimId`, every account specified in the allowlist can later mint their fraction token from that allowlist.

## Create an allowlist

First specify an allowlist, mapping addresses to the number of units they should receive.

```js
import {
TransferRestrictions,
formatHypercertData,
Allowlist,
} from "@hypercerts-org/sdk";

const allowlist: Allowlist = [
{ address: "0x123", units: 100 },
{ address: "0xabc", units: 100 },
];
```

Then, call `createAllowlist` with the metadata and allowlist.

```js
const { metadata } = formatHypercertData(...);
const totalUnits = "10000";
const transferRestrictions = TransferRestrictions.FromCreatorOnly

const { claimId } = await hypercerts.createAllowlist({
allowList,
metaData,
totalUnits,
transferRestrictions: TransferRestrictions.FromCreatorOnly,
});
```

> **note** We store the allowlist and the Merkle tree in the metadata of the Hypercert. To understand the Merkle tree generation and data structures, check out the [OpenZeppelin merkle tree library](https://github.com/OpenZeppelin/merkle-tree)
It first checks if the client is writable and if the operator is a signer. If the operator is not a signer, it throws an `InvalidOrMissingError`.

Next, it validates the allowlist and metadata by calling the `validateAllowlist` and `validateMetaData` functions respectively. If either the allowlist or metadata is invalid, it throws a `MalformedDataError`.

Once the allowlist and metadata are validated, the method creates a Merkle tree from the allowlist and stores it on IPFS. It then stores the metadata on IPFS as well.

Finally, the method invokes the `createAllowlist` function on the contract with the signer's `address`, the total number of `units`, the Merkle tree `root`, the metadata `CID`, and the `transfer restrictions`. If the method is called with `overrides`, it passes them to the createAllowlist function.

## Claiming a fraction token

Users can claim their fraction tokens for many hypercerts at once using `mintClaimFractionFromAllowlist`. To determine the input the following information is required:

| Variable | Type | Source |
| -------- | ------------ | ------------ |
| claimId | BigNumberish | Hypercert ID |
| units | BigNumberish | Allowlist |
| proof | BytesLike[] | Merkle tree |

We store the allowlist and the Merkle tree in the metadata of the Hypercert. To understand the Merkle tree data structures, check out the [OpenZeppelin merkle tree library](https://github.com/OpenZeppelin/merkle-tree). You can get the `proof` and `units` by traversing the merkle tree.

Then, call `mintClaimFractionFromAllowlist` with the required data. The contracts will also verify the proofs. However, when providing the `root` in the function input, the proofs will be verified before a transaction is submitted.

```js
import { StandardMerkleTree } from "@openzeppelin/merkle-tree";

const claimId = "0x822f17a9a5eecfd...85254363386255337";
const address = "0xc0ffee254729296a45a3885639AC7E10F9d54979";

const { indexer, storage } = hypercertsClient;
const claimById = await indexer.claimById(claimId);
const { uri, tokenID: _id } = claimById.claim;
const metadata = await storage.getMetadata(uri || "");
const treeResponse = await storage.getData(metadata.allowList);
const tree = StandardMerkleTree.load(JSON.parse(treeResponse));

let args;
// Find the proof in the allowlist
for (const [leaf, value] of tree.entries()) {
if (value[0] === address) {
args = {
proofs: tree.getProof(leaf),
units: Number(value[1]),
claimId: _id,
};
break;
}
}

// Mint fraction token
const tx = await hypercerts.mintClaimFractionFromAllowlist({
...args,
});
```

Let's see what happens under the hood:

First, the method checks that the client is not `read only` and that the operator is a signer. If not, it throws an `InvalidOrMissingError`.

Next, the method verifies the Merkle `proof` using the OpenZeppelin Merkle tree library. If a `root` is provided, the method uses it to verify the proof. If the proof is invalid, it throws an error.

Finally, the method calls the `mintClaimFromAllowlist` function on the contract with the signer `address`, Merkle `proof`, `claim ID`, and number of `units` as parameters. If overrides are provided, the method uses them to send the transaction. Otherwise, it sends the transaction without overrides.
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# AllowlistMinter

_bitbeckers_

> Interface for hypercert token interactions
This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155)

## Methods

### hasBeenClaimed

```solidity
function hasBeenClaimed(uint256, bytes32) external view returns (bool)
```

#### Parameters

| Name | Type | Description |
| ---- | ------- | ----------- |
| \_0 | uint256 | undefined |
| \_1 | bytes32 | undefined |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0 | bool | undefined |

### isAllowedToClaim

```solidity
function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed)
```

#### Parameters

| Name | Type | Description |
| ------- | --------- | ----------- |
| proof | bytes32[] | undefined |
| claimID | uint256 | undefined |
| leaf | bytes32 | undefined |

#### Returns

| Name | Type | Description |
| --------- | ---- | ----------- |
| isAllowed | bool | undefined |

## Events

### AllowlistCreated

```solidity
event AllowlistCreated(uint256 tokenID, bytes32 root)
```

#### Parameters

| Name | Type | Description |
| ------- | ------- | ----------- |
| tokenID | uint256 | undefined |
| root | bytes32 | undefined |

### LeafClaimed

```solidity
event LeafClaimed(uint256 tokenID, bytes32 leaf)
```

#### Parameters

| Name | Type | Description |
| ------- | ------- | ----------- |
| tokenID | uint256 | undefined |
| leaf | bytes32 | undefined |

## Errors

### DoesNotExist

```solidity
error DoesNotExist()
```
Loading

0 comments on commit 210c167

Please sign in to comment.