generated from PaulRBerg/foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented sismo connect button to verify
- Loading branch information
Showing
3 changed files
with
42 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,25 @@ | ||
// Next.js https://nextjs.org/docs/getting-started/installation | ||
// in src/page.tsx | ||
"use client"; | ||
|
||
import { | ||
SismoConnectButton, | ||
AuthType, | ||
SismoConnectResponse, | ||
ClaimType, | ||
} from "@sismo-core/sismo-connect-react"; | ||
|
||
export default function Home() { | ||
export default function SismoConnect({callback}: {callback: (response: string) => void}) { | ||
return ( | ||
<SismoConnectButton | ||
config={{ | ||
appId: "0xf4977993e52606cfd67b7a1cde717069", // replace with your appId | ||
vault: { | ||
// For development purposes insert the Data Sources that you want to impersonate here | ||
// Never use this in production | ||
impersonate: [ | ||
// EVM | ||
"leo21.sismo.eth", | ||
"0xA4C94A6091545e40fc9c3E0982AEc8942E282F38", | ||
"0x1b9424ed517f7700e7368e34a9743295a225d889", | ||
"0x82fbed074f62386ed43bb816f748e8817bf46ff7", | ||
"0xc281bd4db5bf94f02a8525dca954db3895685700", | ||
// Github | ||
"github:leo21", | ||
"twitter:leo21_eth", | ||
// Telegram | ||
"telegram:leo21", | ||
], | ||
}, | ||
// displayRawResponse: true, | ||
appId: "0x5dc7f3d6e3a6bd3ae49fcfc876ecf217", // replace with your appId | ||
}} | ||
// request proof of Data Sources ownership (e.g EVM, GitHub, twitter or telegram) | ||
auths={[{ authType: AuthType.GITHUB }]} | ||
// request zk proof that Data Source are part of a group | ||
// (e.g NFT ownership, Dao Participation, GitHub commits) | ||
claims={[ | ||
// ENS DAO Voters | ||
{ groupId: "0x85c7ee90829de70d0d51f52336ea4722" }, | ||
// Gitcoin passport with at least a score of 15 | ||
{ groupId: "0x1cde61966decb8600dfd0749bd371f12", value: 15, claimType: ClaimType.GTE } | ||
// Starred repo | ||
{ groupId: "0xfd931046287010533fccee33b62514a4" }, | ||
]} | ||
// request message signature from users. | ||
signature={{ message: "I vote Yes to Privacy" }} | ||
// retrieve the Sismo Connect Reponse from the user's Sismo data vault | ||
onResponse={async (response: SismoConnectResponse) => { | ||
const res = await fetch("/api/verify", { | ||
method: "POST", | ||
body: JSON.stringify(response), | ||
}); | ||
console.log(await res.json()); | ||
signature={{ message: "I starred the project repo" }} | ||
onResponseBytes={async (response: string) => { | ||
callback(response); | ||
}} | ||
// reponse in bytes to call a contract | ||
// onResponseBytes={async (response: string) => { | ||
// console.log(response); | ||
// }} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters