Skip to content

Commit

Permalink
fix: resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
gabin54 committed Jul 24, 2023
2 parents 5da596a + b64e200 commit f4716cc
Show file tree
Hide file tree
Showing 219 changed files with 32,969 additions and 1,398 deletions.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ POSTGRES_DATABASE=""

# The URL of the Sismo API Hub
NEXT_PUBLIC_HUB_API_URL="https://hub.sismo.io"

# Defender ZK Badge relayer
SH_RELAY_DEFENDER_API_KEYS={"mumbai": { "key": "", "secret": ""}}

# Zk Badge contract addresses
NEXT_PUBLIC_ZK_BADGE_ADDRESSES={ "mumbai": "", "sepolia": ""}
54 changes: 54 additions & 0 deletions .github/workflows/create-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Create Sismo Connect App

on:
issue_comment:
types: [created]

jobs:
create-app:
runs-on: ubuntu-latest
if: contains(github.event.comment.body, '/create-app')
steps:
- name: Check if sismo-core organisation member
id: is_organization_member
uses: jamessingleton/[email protected]
with:
organization: "sismo-core"
username: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}

- if: steps.is_organization_member.outputs.result != 'true'
run: exit 1

- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{secrets.SISMOBOT_TOKEN}}

- name: Checkout Pull Request
run: hub pr checkout ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.SISMOBOT_TOKEN }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Create Sismo Connect App on the factory
run: yarn sync-all-apps-factory
env:
SISMO_FACTORY_URL: https://factory-api.sismo.io
SISMO_FACTORY_TOKEN: ${{ secrets.SISMO_FACTORY_TOKEN }}

- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SISMOBOT_SSH }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Commit and push filled appId
run: |
git config --global user.email "[email protected]"
git config --global user.name "sismobot"
git commit -a -m "feat: create Sismo Connect App and auto-fill appId" || exit 0
git push
86 changes: 86 additions & 0 deletions .github/workflows/upload-metdata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Upload zkDrop Metadata

on:
issue_comment:
types: [created]

jobs:
create-app:
runs-on: ubuntu-latest
if: contains(github.event.comment.body, '/upload-metadata')
steps:
- name: Check if sismo-core organisation member
id: is_organization_member
uses: jamessingleton/[email protected]
with:
organization: "sismo-core"
username: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}

- if: steps.is_organization_member.outputs.result != 'true'
run: exit 1

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch all branches and tags
token: ${{secrets.SISMOBOT_TOKEN}}

- name: Checkout Pull Request
run: hub pr checkout ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.SISMOBOT_TOKEN }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Get list of changed files from pull request
id: changed-files
env:
GITHUB_TOKEN: ${{ secrets.SISMOBOT_TOKEN }}
run: |
PR_NUMBER=${{ github.event.issue.number }}
# Make sure jq is installed
sudo apt-get install -y jq
# Fetch the list of files from the GitHub API
FILES=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/sismo-core/app-store/pulls/${PR_NUMBER}/files")
# Use jq to parse out the filenames and join them into one line
FILENAMES=$(echo "$FILES" | jq -r '.[].filename' | tr '\n' ' ')
# Set the output for subsequent steps
echo "::set-output name=files::$FILENAMES"
- name: Get modified spaces and apps
id: updated-spaces
run: |
echo 'Changed files:'
DEMO_UPDATED_SPACES=$(echo ${{steps.changed-files.outputs.files}} | awk 'BEGIN {OFS=FS=" "} {for(i=1; i<=NF; i++) {if ($i ~ /demo/){split($i,a,"/"); n=split(a[length(a)],b,"."); print b[1]}}}' | xargs)
echo "::set-output name=demo_updated_spaces::'$(echo "$DEMO_UPDATED_SPACES")'"
MAIN_UPDATED_SPACES=$(echo ${{steps.changed-files.outputs.files}} | awk 'BEGIN {OFS=FS=" "} {for(i=1; i<=NF; i++) {if ($i ~ /main/){split($i,a,"/"); n=split(a[length(a)],b,"."); print b[1]}}}' | xargs)
echo "::set-output name=main_updated_spaces::'$(echo "$MAIN_UPDATED_SPACES")'"
- name: Display changes
run: |
echo "[DEMO] Modified spaces and apps in commit:"
echo "${{ steps.updated-spaces.outputs.demo_updated_spaces }}"
echo "[MAIN] Modified spaces and apps in commit:"
echo "${{ steps.updated-spaces.outputs.main_updated_spaces }}"
- name: Run Upload metadata script [demo]
env:
NEXT_PUBLIC_NODE_ENV: demo
PINATA_JWT_TOKEN: ${{ secrets.PINATA_JWT_TOKEN }}
run: |
yarn upload-zk-drop-metadata ${{ steps.updated-spaces.outputs.demo_updated_spaces }}
- name: Run Upload metadata script [main]
env:
NEXT_PUBLIC_NODE_ENV: main
PINATA_JWT_TOKEN: ${{ secrets.PINATA_JWT_TOKEN }}
run: |
yarn upload-zk-drop-metadata ${{ steps.updated-spaces.outputs.main_updated_spaces }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ next-env.d.ts

.yarn
.yarn.lock

.space-configs/
.space-configs/*
14 changes: 12 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{
"tabWidth": 2,
"printWidth": 100
}
"printWidth": 100,

"overrides": [
{
"files": "*.sol",
"options": {
"tabWidth": 2,
"printWidth": 100
}
}
]
}
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,29 @@ You have two approaches to start building applications with Sismo Connect:
Available templates include:
- zkForm template: More than just a gated form.
- zkTelegramBot template: Facilitates privacy-preserving gated telegram group chats.
- zkDrop template: Simplifies privacy-preserving gated NFT airdrops creation.

2. Custom apps (soon): You will be able to build custom apps

### Configuration

All configurations for templates are located in the [space-config](./space-config/) folder.
All configurations for templates are located in the [space-configs](./space-configs/) folder.

For example, the [configuration](./space-config/aave-chan-initiative/demo.ts) for the [aave-chan-initiative](https://demo.apps.sismo.io/aave-chan-initiative/aci-swag) the configuration is setup in this files tree.
For example, the [configuration](./space-configs/demo/aave-chan-initiative.ts) for the [aave-chan-initiative](https://demo.apps.sismo.io/aave-chan-initiative/aci-swag) the configuration is setup in this files tree.
```bash
space-config/
├── aave-chan-initiative
│   ├── demo.ts
│   ├── main.ts
│   └── images
│      ├── aave_chan_initiative_apps_swag_1014x720.png
│      ├── ...
├── index.ts
space-configs/
├── main
│   ├── aave-chan-initiative.ts
│   ├── cow-swap.ts
│   ├── ...
├── demo
│   ├── aave-chan-initiative.ts
│   ├── cow-swap.ts
│   ├── ...
├── images
│   ├── aave_chan_initiative_apps_swag_1014x720.png
│   ├── aave_chan_initiative_apps_swag_400x400.png
│   └── ...
└── types.ts
```

Expand Down Expand Up @@ -74,3 +80,5 @@ Contact us in [Telegram](https://bit.ly/builders-telegram) or [Discord](https://

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.



13 changes: 13 additions & 0 deletions custom-apps/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
`use client`;

import SynapsProofOfLivenessCustomApp from "./synaps-proof-of-liveness";
import WorldcoinProofOfPersonhoodCustomApp from "./wordlcoin-proof-of-personhood";

export const customApps = {
worldcoin: {
"proof-of-personhood": <WorldcoinProofOfPersonhoodCustomApp />,
},
synaps: {
"proof-of-liveness": <SynapsProofOfLivenessCustomApp />,
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"use client";

import { CustomAppConfig } from "@/space-configs/types";
import Button3D from "@/src/ui/Button3D";
import { useRouter } from "next/navigation";
import React from "react";
import { styled } from "styled-components";

const Container = styled.div`
display: flex;
flex-direction: column;
align-items: center;
`;

const Title = styled.div`
font-family: ${(props) => props.theme.fonts.semibold};
color: ${(props) => props.theme.colors.neutral1};
font-size: 32px;
margin-top: 63px;
`;

const Subtitle = styled.div`
font-family: ${(props) => props.theme.fonts.regular};
color: ${(props) => props.theme.colors.neutral3};
font-size: 16px;
margin-bottom: 63px;
text-align: center;
`;

type Props = {
app: CustomAppConfig;
};

export default function Congratulations({ app }: Props): JSX.Element {
const router = useRouter();

return (
<Container>
<Title style={{ marginBottom: 16 }}>
{app?.templateConfig?.congratulationsMessage?.title}
</Title>
<Subtitle>{app?.templateConfig?.congratulationsMessage?.description}</Subtitle>
<Button3D onClick={() => router.push("/synaps")} secondary>
Back to the space
</Button3D>
</Container>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { styled } from "styled-components";
import HoverTooltip from "@/src/ui/HoverTooltip";
import { Info, LockSimpleOpen } from "phosphor-react";
import colors from "@/src/themes/colors";
import { CustomAppConfig } from "@/space-config/types";
import { CustomAppConfig } from "@/space-configs/types";

const Container = styled.div``;

Expand Down Expand Up @@ -54,13 +54,9 @@ type Props = {
onEligible: (response) => void;
};

export default function ProveEligibility({
app,
onEligible,
}: Props): JSX.Element {

export default function ProveEligibility({ app, onEligible }: Props): JSX.Element {
const config = {
appId: app.sismoConnectRequest.appId
appId: app.sismoConnectRequest.appId,
};

return (
Expand Down
Loading

0 comments on commit f4716cc

Please sign in to comment.