Skip to content

Commit

Permalink
GITBOOK-490: fix cheatsheet typos
Browse files Browse the repository at this point in the history
  • Loading branch information
yum0e authored and gitbook-bot committed Jul 13, 2023
1 parent eef1de1 commit 9a1488d
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 28 deletions.
4 changes: 2 additions & 2 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* [Data Groups & Creation](data-groups/data-groups-and-creation/README.md)
* [Factory Guide: Create a Data Group in 5 Minutes](data-groups/data-groups-and-creation/create-your-data-group.md)
* [Sismo Hub Guide: Create Data Groups Programmatically](data-groups/data-groups-and-creation/create-your-group-generator.md)
* [Sismo Hub Guide: Add a Data Provider to the Sismo Factory](data-groups/data-groups-and-creation/create-your-data-provider.md)
* [Sismo Hub Guide: Add a Data Provider to the Sismo Factory](data-groups/data-groups-and-how-to-create-them/create-your-data-provider.md)

## How Sismo Works

Expand All @@ -61,7 +61,7 @@
* [Get group snapshots](how-sismo-works/resources/sismo-api/group/get-group-snapshots.md)
* [Common Parameters](how-sismo-works/resources/sismo-api/common-parameters.md)
* [Advanced Filtering](how-sismo-works/resources/sismo-api/advanced-filtering.md)
* [Transaction](how-sismo-works/resources/sismo-api/transaction.md)
* [Transaction](how-sismo-works/resources/sismo-api/other-models/transaction.md)
* [Deployed Contract Addresses](how-sismo-works/resources/sismo-101.md)

## Links
Expand Down
37 changes: 19 additions & 18 deletions build-with-sismo-connect/sismo-connect-cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,15 @@ As an alternative to the React Button, you can use the [<mark style="color:blue;
import {
SismoConnectButton,
SismoConnectConfig,
ClaimRequest,
AuthRequest,
SignatureRequest,

AuthType,
ClaimType,
SismoConnectResponse
} from "@sismo-core/sismo-connect-react";

const config: SismoConnectConfig = {
appId: "0x32403ced4b65f2079eda77c84e7d2be6",
vault: {
// For development purposes, insert the Data Sources that you want to impersonate
// For development purposes insert the Data Sources that you want to impersonate
// Never use this in production
impersonate: [
// EVM Data Sources
Expand Down Expand Up @@ -100,9 +99,9 @@ return (
{ authType: AuthType.TELEGRAM, userId: "875608110", isOptional: true },
]}

// Claims = prove group membership of a Data Source in a specific Data Group.
// Claims = prove groump membership of a Data Source in a specific Data Group.
// Data Groups = [{[dataSource1]: value1}, {[dataSource1]: value1}, .. {[dataSource]: value}]
// When doing so, the Data Source is not shared with the app.
// When doing so Data Source is not shared to the app.
claims={[
{
// claim on Sismo Hub GitHub Contributors Data Group membership: https://factory.sismo.io/groups-explorer?search=0xda1c3726426d5639f4c6352c2c976b87
Expand All @@ -124,16 +123,16 @@ return (
// claim on Stand with Crypto NFT Minters Data Group membership: https://factory.sismo.io/groups-explorer?search=0xfae674b6cba3ff2f8ce2114defb200b1
// Data Group members = minters of the Stand with Crypto NFT
// value for each group member = number of NFT minted
// request the user to prove membership in the group with a value = 10
// request user to prove membership in the group with value = 10
groupId: "0xfae674b6cba3ff2f8ce2114defb200b1",
claimType: ClaimType.EQ,
value: 10, // dhadrien.sismo.eth minted exactly 10, eligible
value: 10, // dhadrin.sismo.eth minted exactly 10, eligible
},
{
// claim Gitcoin Passport Holders Data Group membership: https://factory.sismo.io/groups-explorer?search=0x1cde61966decb8600dfd0749bd371f12
// Data Group members = Gitcoin Passport Holders
// value for each group member = Gitcoin Passport Score
// request the user to prove membership in the group with a value > 15, the user can reveal more if they want
// request user to prove membership in the group with value > 15, user can reveal more if they want
groupId: "0x1cde61966decb8600dfd0749bd371f12",
claimType: ClaimType.GTE,
value: 15, // dhadrien.sismo.eth has a score of 46, eligible. Can reveal more.
Expand Down Expand Up @@ -161,7 +160,7 @@ return (
groupId: "0xda1c3726426d5639f4c6352c2c976b87",
claimType: ClaimType.GTE,
value: 1,
isSelectableByUser: true, // can selectively disclose more if the user wants
isSelectableByUser: true, // can selectively disclose more if user wants
isOptional: true, // can chose not to reveal
},
]}
Expand Down Expand Up @@ -448,18 +447,18 @@ import "sismo-connect-solidity/SismoLib.sol";
contract MyContract is SismoConnect {
// reference your appId
bytes16 public constant APP_ID = 0x32403ced4b65f2079eda77c84e7d2be6;
bytes16 private _appId = 0x32403ced4b65f2079eda77c84e7d2be6;
// allow impersonation
bool public constant IS_IMPERSONATION_MODE = true;
bool private _isImpersonationMode = true;
constructor()
// use buildConfig helper to easily build a Sismo Connect config in Solidity
SismoConnect(buildConfig({appId: APP_ID, isImpersonationMode: IS_IMPERSONATION_MODE}))
SismoConnect(buildConfig({appId: _appId, isImpersonationMode: _isImpersonationMode}))
{}
function verifySismoConnectResponse(bytes memory response) public {
// Recreate the request made in the front end to verify the proof
// We will verify the Sismo Connect Response containing the ZK proofs against it
// Recreate the request made in the fontend to verify the proof
// We will verify the Sismo Connect Response containing the ZK Proofs against it
AuthRequest[] memory auths = new AuthRequest[](6);
auths[0] = _authRequestBuilder.build({authType: AuthType.VAULT});
auths[1] = _authRequestBuilder.build({authType: AuthType.EVM_ACCOUNT});
Expand All @@ -481,7 +480,7 @@ contract MyContract is SismoConnect {
isSelectableByUser: false
});
ClaimRequest[] memory claims = new ClaimRequest[](6);
ClaimRequest[] memory claims = new ClaimRequest[](7);
claims[0] = _claimRequestBuilder.build({groupId: 0xda1c3726426d5639f4c6352c2c976b87});
claims[1] = _claimRequestBuilder.build({
groupId: 0x85c7ee90829de70d0d51f52336ea4722,
Expand All @@ -504,12 +503,14 @@ contract MyContract is SismoConnect {
groupId: 0xfae674b6cba3ff2f8ce2114defb200b1,
claimType: ClaimType.GTE,
value: 6,
isSelectableByUser: true,
isOptional: true
});
claims[5] = _claimRequestBuilder.build({
groupId: 0x1cde61966decb8600dfd0749bd371f12,
claimType: ClaimType.EQ,
value: 15,
isSelectableByUser: true,
isOptional: true
});
claims[6] = _claimRequestBuilder.build({
Expand All @@ -533,7 +534,7 @@ contract MyContract is SismoConnect {
uint256[] memory evmAccountIds = SismoConnectHelper.getUserIds(result, AuthType.EVM_ACCOUNT);
console.log("Vault ID: %s", vaultId);
console.log("GitHub ID: %s", githubId);
console.log("Github ID: %s", githubId);
console.log("Telegram ID: %s", telegramId);
console.log("First EVM Account ID: %s", evmAccountIds[0]);
console.log("Second EVM Account ID: %s", evmAccountIds[1]);
Expand Down
2 changes: 1 addition & 1 deletion data-groups/data-groups-and-creation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ Data Groups are sets of Data Sources in which each Data Source has an associated

<table><thead><tr><th width="254.33333333333331">Data Group Examples</th><th>Members (Data Sources)</th><th>Value for each Data Source</th></tr></thead><tbody><tr><td><a href="https://factory.sismo.io/groups-explorer?search=0xfae674b6cba3ff2f8ce2114defb200b1">"Stand With Crypto" NFT Minters</a></td><td>Wallets of minters </td><td>Number of NFT minted</td></tr><tr><td><a href="https://factory.sismo.io/groups-explorer?search=0x1cde61966decb8600dfd0749bd371f12">Gitcoin Passport Holders</a></td><td>Wallets of Gitcoin Passport holders</td><td>Sybil-resistant score</td></tr><tr><td><a href="https://factory.sismo.io/groups-explorer?search=0xda1c3726426d5639f4c6352c2c976b87">Sismo Hub Github Contributors </a></td><td>GitHub accounts of contributors to sismo-core/sismo-hub repo</td><td>Number of contributions</td></tr><tr><td><a href="https://factory.sismo.io/groups-explorer?search=0x85c7ee90829de70d0d51f52336ea4722">ENS DAO Voters</a></td><td>Wallets of voters in the ENS DAO</td><td>Number of votes</td></tr><tr><td><a href="https://factory.sismo.io/groups-explorer?search=0xd630aa769278cacde879c5c0fe5d203c">Sismo Community Members</a></td><td>Wallets, GitHub, Telegram and Twitter accounts of all people that helped Sismo</td><td>Level of their contributions (1, 2 or 3)</td></tr></tbody></table>

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><p>Factory Guide: </p><p>Create a Data Group in 5 Minutes</p></td><td></td><td></td><td><a href="create-your-data-group.md">create-your-data-group.md</a></td></tr><tr><td>Sismo Hub Guide: <br>Create Data Groups Programmatically</td><td></td><td></td><td><a href="create-your-group-generator.md">create-your-group-generator.md</a></td></tr><tr><td>Sismo Hub Guide: <br>Add a Data Provider to the Sismo Factory</td><td></td><td></td><td><a href="create-your-data-provider.md">create-your-data-provider.md</a></td></tr></tbody></table>
<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><p>Factory Guide: </p><p>Create a Data Group in 5 Minutes</p></td><td></td><td></td><td><a href="create-your-data-group.md">create-your-data-group.md</a></td></tr><tr><td>Sismo Hub Guide: <br>Create Data Groups Programmatically</td><td></td><td></td><td><a href="create-your-group-generator.md">create-your-group-generator.md</a></td></tr><tr><td>Sismo Hub Guide: <br>Add a Data Provider to the Sismo Factory</td><td></td><td></td><td><a href="../data-groups-and-how-to-create-them/create-your-data-provider.md">create-your-data-provider.md</a></td></tr></tbody></table>
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Next, by clicking on the <mark style="background-color:blue;">**Add**</mark> but
After this, you can click on the second <mark style="background-color:blue;">**Add**</mark> button (<mark style="color:red;">red box</mark>) in order to add these Lens accounts (sismo.lens followers) to the group.

{% hint style="info" %}
If you are a developer and want to build your own Data Provider, go check out this [tutorial](create-your-data-provider.md). It will explain all the steps of the creation process.
If you are a developer and want to build your own Data Provider, go check out this [tutorial](../data-groups-and-how-to-create-them/create-your-data-provider.md). It will explain all the steps of the creation process.
{% endhint %}

* **Get the holders of** [**Sismo - EthCC 2022 POAP**](https://poap.gallery/r/event/53325)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ To fetch all the accounts we want, you will use the 2 different [Data Providers]
* The [**Lens Data Provider**](https://github.com/sismo-core/sismo-hub/tree/main/group-generators/helpers/data-providers/lens): it will allow you to fetch all the collectors of the [first Sismo Lens Post](https://lenster.xyz/posts/0x26e5-0x02). (1.)

{% hint style="info" %}
If you want more info on how Data Provider works and how to create one, there is a tutorial for you [**here**](create-your-data-provider.md). This tutorial makes you create a Lens data provider and a function that fetch all Lens post collectors (It's a good time, isn't it 😉)
If you want more info on how Data Provider works and how to create one, there is a tutorial for you [**here**](../data-groups-and-how-to-create-them/create-your-data-provider.md). This tutorial makes you create a Lens data provider and a function that fetch all Lens post collectors (It's a good time, isn't it 😉)
{% endhint %}

* The[ **Snapshot Data Provider**](https://github.com/sismo-core/sismo-hub/tree/main/group-generators/helpers/data-providers/snapshot): it will allow you to fetch all the voters of one of the first [Sismo proposals](https://snapshot.org/#/sismo.eth/proposal/0xe280e236c5afa533fc28472dd0ce14e5c3514a843c0563552c962226cda05c52) on Snapshot. (2.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ When creating a group, you need to create a [Group Generator](../../how-sismo-wo
Moreover, Data Providers are useful because they enable automatic and frequent group updates, whereas if the group was made of a hardcoded list of accounts it wouldn't be automatic.

{% hint style="success" %}
If you want to create a [group](./) that contains all the voters of your last DAO proposal on Snapshot, simply use the `queryProposalVoters` function from the [Snapshot Data Provider](https://github.com/sismo-core/sismo-hub/tree/main/group-generators/helpers/data-providers/snapshot) in your [Group Generator](../../how-sismo-works/resources/sismo-hub/sismo-protocol-overview.md) by giving the Proposal Identifier as an argument.
If you want to create a [group](../data-groups-and-creation/) that contains all the voters of your last DAO proposal on Snapshot, simply use the `queryProposalVoters` function from the [Snapshot Data Provider](https://github.com/sismo-core/sismo-hub/tree/main/group-generators/helpers/data-providers/snapshot) in your [Group Generator](../../how-sismo-works/resources/sismo-hub/sismo-protocol-overview.md) by giving the Proposal Identifier as an argument.

For example:

Expand Down Expand Up @@ -364,7 +364,7 @@ Congrats 🎉 You've just created your first Data Provider!

But now that you have finished, you probably want to test it right?

To do this you will have to create a group (only for testing) and import your Data Provider into it, so you can try your request. If you don't know how to create a group, check out the group tutorial [**here**](create-your-group-generator.md).
To do this you will have to create a group (only for testing) and import your Data Provider into it, so you can try your request. If you don't know how to create a group, check out the group tutorial [**here**](../data-groups-and-creation/create-your-group-generator.md).

### Make your Data Provider usable by anyone on the Factory

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type Query {

### Query stats for a list of transactions

Use this query to get stats for a list of transactions. You can use [common parameters](common-parameters.md#parameters-when-querying-a-list) to filters them. The tab Schema below provides more details.
Use this query to get stats for a list of transactions. You can use [common parameters](../common-parameters.md#parameters-when-querying-a-list) to filters them. The tab Schema below provides more details.

{% tabs %}
{% tab title="Query" %}
Expand Down
4 changes: 2 additions & 2 deletions how-sismo-works/resources/sismo-hub/data-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ The above information displays how to use data from external sources. Below, you

**You can find here a complete tutorial describing all the Data Provider creation process steps:**

{% content-ref url="../../../data-groups/data-groups-and-creation/create-your-data-provider.md" %}
[create-your-data-provider.md](../../../data-groups/data-groups-and-creation/create-your-data-provider.md)
{% content-ref url="../../../data-groups/data-groups-and-how-to-create-them/create-your-data-provider.md" %}
[create-your-data-provider.md](../../../data-groups/data-groups-and-how-to-create-them/create-your-data-provider.md)
{% endcontent-ref %}

## Create a new Data Provider
Expand Down

0 comments on commit 9a1488d

Please sign in to comment.