Skip to content

Commit

Permalink
GITBOOK-505: update getting started and tutorial with leo impersonation
Browse files Browse the repository at this point in the history
  • Loading branch information
yum0e authored and gitbook-bot committed Jul 19, 2023
1 parent b76215c commit adf94b5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion build-with-sismo-connect/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ To get rid of this issue, you will need to go to "Settings > Advanced > Clear ac

![MetaMask settings to clear activity tab data](<../.gitbook/assets/Capture d’écran 2023-05-12 à 01.18.14 (1).png>)

You can then stop your anvil local node and the frontend of your application before relaunching the anvil node with `yarn anvil` and then your frontend with `yarn dev`. If you are still stuck with this restart, come ask your questions in our [Discord](https://discord.gg/sismo) in the **#dev-support** channel or in our [Dev Telegram](https://t.me/+Z-SwcvXZFRVhZTQ0).
You can then stop your anvil local node and the frontend of your application before relaunching the anvil node with `yarn chain` and then your frontend with `yarn dev`. If you are still stuck with this restart, come ask your questions in our [Discord](https://discord.gg/sismo) in the **#dev-support** channel or in our [Dev Telegram](https://t.me/+Z-SwcvXZFRVhZTQ0).

</details>
16 changes: 8 additions & 8 deletions build-with-sismo-connect/getting-started-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ export default function Home() {
// Never use this in production
impersonate: [
// EVM
"dhadrien.sismo.eth",
"leo21.sismo.eth",
"0xa4c94a6091545e40fc9c3e0982aec8942e282f38",
// Github
"github:dhadrien",
"github:leo21",
// Twitter
"twitter:dhadrien_",
"twitter:leo21_eth",
// Telegram
"telegram:dhadrien",
"telegram:leo21",
],
},
// displayRawResponse: true,
Expand Down Expand Up @@ -302,14 +302,14 @@ const sismoConnect = SismoConnect({
// Never use this in production
impersonate: [
// EVM
"dhadrien.sismo.eth",
"leo21.sismo.eth",
"0xa4c94a6091545e40fc9c3e0982aec8942e282f38",
// Github
"github:dhadrien",
"github:leo21",
// Twitter
"twitter:dhadrien_",
"twitter:leo21_eth",
// Telegram
"telegram:dhadrien",
"telegram:leo21",
],
},
},
Expand Down
22 changes: 13 additions & 9 deletions build-with-sismo-connect/tutorials/tuto.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ foundryup
```bash
# in another terminal
# starts a local fork of Mumbai
yarn anvil
yarn chain
```

#### Launch the local application
Expand All @@ -67,7 +67,7 @@ You can now play with the local app that already integrates Sismo Connect. You s
### Important note

{% hint style="warning" %}
The interaction with the fork network can become quite unstable if you stop the `yarn anvil` command at some point or if you already used the sample app before.
The interaction with the fork network can become quite unstable if you stop the `yarn chain` command at some point or if you already used the sample app before.

You can end up with an infinitely pending transaction.

Expand Down Expand Up @@ -118,9 +118,9 @@ const sismoConnectConfig: SismoConnectConfig = {
vault: {
// We will impersonate those Data Sources, which will be useful later
impersonate: [
"dhadrien.sismo.eth",
"twitter:dhadrien_",
"github:dhadrien",
"leo21.sismo.eth",
"twitter:leo21_eth",
"github:leo21",
],
},
};
Expand Down Expand Up @@ -391,7 +391,7 @@ contract Airdrop is ERC20, SismoConnect {

These simple code additions now allow our smart contract to only airdrop some tokens to holders of a Gitcoin Passport. While this is exciting, how can we quickly test it in our local front end if we are not Gitcoin Passport holders?&#x20;

The simplest solution is to impersonate an account holding a Gitcoin Passport. Remember that we are already impersonating the dhadrien.sismo.eth Ethereum account that holds a Gitcoin Passport, making us eligible.
The simplest solution is to impersonate an account holding a Gitcoin Passport. Remember that we are already impersonating the leo21.sismo.eth Ethereum account that holds a Gitcoin Passport, making us eligible.

{% hint style="success" %}
Don't forget to remove the `vault object` in the config when deploying in production.
Expand All @@ -405,10 +405,12 @@ When all of this is done, you can try again to go on your local application on [

As you can see below, you are now asked to share your `userId` like before, and you also should prove that you own a Gitcoin Passport. You also keep signing the address on which you want to receive the airdrop.

<figure><img src="../../.gitbook/assets/Capture d’écran 2023-06-22 à 17.44.37.png" alt=""><figcaption><p>Sismo Vault UI when redirected</p></figcaption></figure>


<figure><img src="../../.gitbook/assets/Capture d’écran 2023-07-19 à 10.12.43.png" alt=""><figcaption><p>Sismo Vault UI when redirected</p></figcaption></figure>

{% hint style="warning" %}
The interaction with the fork network can become quite unstable if you stop the `yarn anvil` command at some point or if you already used the sample app before.
The interaction with the fork network can become quite unstable if you stop the `yarn chain` command at some point or if you already used the sample app before.

You can end up with an infinitely pending transaction.

Expand Down Expand Up @@ -567,7 +569,9 @@ function _getRewardAmount(

You can try again to claim the airdrop from your application. You will see the auth request with the four claim requests and the sign message. If you share all the information by default, you should end up with 400 tokens!

<figure><img src="../../.gitbook/assets/Capture d’écran 2023-06-22 à 17.26.51.png" alt=""><figcaption><p>Sismo Vault UI when redirected</p></figcaption></figure>


<figure><img src="../../.gitbook/assets/Capture d’écran 2023-07-19 à 10.15.44.png" alt=""><figcaption><p>Sismo Vault UI when redirected</p></figcaption></figure>

And it is our final congrats! 🎉

Expand Down

0 comments on commit adf94b5

Please sign in to comment.