Skip to content

Commit

Permalink
chore: add licenses, fix create session gas estimations, and optimize…
Browse files Browse the repository at this point in the history
… e2e tests (#174)

# Description

Following
https://www.notion.so/matterlabs/ZKsync-SSO-Repo-Checklist-13ea48363f23802da022d6c286a5f1bf?showMoveTo=true&saveParent=true

to add new files

Also, updated e2e tests as they were failing for this branch. This
should speed them up, stabilize them, and make them more like
Production/Staging.

## Additional context

I don't think we're doing the mirroring, but we are looking at a rename
which might impact this slightly

Co-authored-by: MexicanAce <[email protected]>
  • Loading branch information
cpb8010 and MexicanAce authored Nov 15, 2024
1 parent 46bf2a2 commit 3735ee0
Show file tree
Hide file tree
Showing 18 changed files with 725 additions and 51 deletions.
60 changes: 60 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Bug report
description: File a bug report to help us improve
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! Please fill out as much as you can, the more details the better we can help to resolve the issue.
- type: dropdown
id: project
attributes:
label: 🧰 Project
description: Which project is this bug related to?
options:
- Contracts
- Auth Server
- SDK
- Examples
default: 0
validations:
required: true
- type: textarea
id: description
attributes:
label: 📝 Description
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: steps
attributes:
label: 🔄 Reproduction steps
description: Steps to reproduce the behavior.
- type: textarea
id: expected
attributes:
label: 🤔 Expected behavior
description: What did you expect to happen.
- type: textarea
id: actual
attributes:
label: 😯 Actual behavior
description: What actually happened.
- type: textarea
id: environment
attributes:
label: 🖥 Environment
description: Please provide relevant details about the environment you experienced the bug in.
- type: textarea
id: additional
attributes:
label: 📋 Additional context
description: Add any other context about the problem here. If applicable, add screenshots to help explain.
- type: textarea
id: logs
attributes:
label: 📎 Logs
description: If applicable, add logs to help explain the problem.
render: shell
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Feature request
description: Suggest an idea for this project
title: "[Request]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request! Please fill out as much as you can, the more details the better we can help to implement the feature.
- type: textarea
id: description
attributes:
label: 📝 Description
description: A clear and concise description of what the feature is.
validations:
required: true
- type: textarea
id: rationale
attributes:
label: 🤔 Rationale
description: Why do you think this feature is important and how will it benefit the project?
- type: textarea
id: additional
attributes:
label: 📋 Additional context
description: Add any other context or information about the feature request here.
51 changes: 51 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Architecture

This project monorepo is the source for the ZKsync SSO SDK, Auth server, smart
contracts and examples.

## Project tools

This monorepo utilizes [pnpm](https://pnpm.io/) for handling dependencies and
managing package.json files. Pnpm is used to manage workspaces to handle working
with multiple projects in a single repository.

Additionally, the monorepo leverages [NX](https://nx.dev/) for managing and
building the various projects within the repository.

## Packages

### SDK

The ZKsync SSO SDK is a client-side library for integrating ZKsync SSO into a
web app. It is built using [`viem`](https://viem.sh/) and
[`@simplewebauthn`](https://simplewebauthn.dev/) for passkeys. The SDK provides
a Connector for use with ['wagmi'](https://wagmi.sh/).

### Smart contracts

The smart contracts for managing ZKsync SSO accounts. Implements
[ERC-7579](https://erc7579.com/) and
[Account abstraction](https://docs.zksync.io/build/developer-reference/account-abstraction)
for smart account features.

### Auth server

The Auth server is a static website that provides an interface for user
authentication. It is a [Nuxt](https://nuxt.com/) application using the
[Vue](https://vuejs.org/) framework.

---

## Examples

This repo provides examples demonstrating the use of ZKsync SSO in a variety of
applications.

### NFT Quest

A Nuxt app that demonstrates the use of sessions and paymasters.

### Bank demo

A Nuxt app that provides an example of how ZKsync SSO can be integrated into an
existing app and link a smart account with a traditional account.
94 changes: 94 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Code of Conduct

Version: 1.1

Apache 2.0 license, derived from the Apache Foundation Code of Conduct. Also, CC
BY-SA 3.0 derived from the Mozilla Community Participation Guidelines.

Our goal is to cultivate a safe, friendly, and inclusive space that benefits all
participants in the ZKsync ecosystem. This Code of Conduct outlines our shared
values and expectations to help ensure that the community remains a positive and
enriching environment for everyone.

## When and how to use this Code of Conduct

This is your guide for engaging as a participant in the ZKsync ecosystem. It
applies to all physical and digital spaces related to ZKsync.

## Expected behaviors

**Be ethical**: We endeavor to enrich the ZKsync ecosystem, while not infringing
on the rights and wellbeing of others. We also endeavor to enrich ourselves
without causing harm to the ZKsync community. We do not encourage tax evasion,
promoting information leaks, speculating on tokens or token prices, or otherwise
breaking the law.

**Be kind and respectful**: Treat everyone with kindness, empathy, and respect.
We all come from different backgrounds, perspectives and experiences, so let's
celebrate our differences and foster a culture of openness and understanding. We
may have strong feelings about other layer 1 and layer 2 blockchains, but that
is no reason to disparage, defame, or slander any competitor to ZKsync or what
other chains are doing. Feel free to compare metrics and features, but keep to
the facts and be respectful of all the builders in web3 trying to advance
freedom through blockchain technology!

**Share and learn**: Our community is a space for sharing knowledge,
experiences, and ideas. Positively contribute to discussions, offer helpful
feedback, be willing to educate others on your work and remain open to learning
from others.

**Give credit**: When sharing content or ideas that aren't your own, ensure you
give proper credit to the original creator. Plagiarism and intellectual property
infringement are strictly prohibited.

**Respect privacy**: Always seek consent before sharing personal information
about yourself or others. Respecting each other's privacy is vital to building
trust within our community.

**Be inquisitive and embrace continuous improvement**: We strive to improve from
each experience, and are open to constructive criticism. We encourage questions,
and redirect them to the appropriate channel if we do not have the answer.

**Mind your language**: Communication is key. Use clear and considerate language
in your interactions. We aim to create a welcoming environment for users of all
ages, so please avoid excessive profanity or explicit content. Remember that
ZKsync community members are a diverse bunch. English is our primary working
language, but to help others where English is not their first language, be
succinct and avoid acronyms where possible.

**Stay on topic**: While we encourage friendly conversations, please ensure your
discussions remain relevant to the community's purpose. To keep our space
focused and valuable, off-topic or irrelevant content may be redirected or
removed. Specific topics that are not appropriate include offering to buy or
sell any cryptocurrency or engage in price speculation.

**No hate speech or harassment**: Let's maintain a constructive and uplifting
atmosphere in all interactions. We have a zero-tolerance policy for any form of
hate speech, bullying, harassment, or discrimination. This includes, but is not
limited to:

- Violent threats or language directed against another person.
- Sexist, racist, or otherwise discriminatory jokes and language.
- Posting sexually explicit or violent material.
- Posting (or threatening to post) other people's personally identifying
information ("doxing").
- Sharing private content without explicit consent, such as messages sent
privately or non-publicly.
- Personal insults.
- Unwelcome sexual attention.
- Excessive or unnecessary profanity.
- Repeated harassment of others. In general, if someone asks you to stop, then
stop.
- Advocating for, or encouraging, any of the above behavior.

**Have fun and connect**: Finally, remember that ZK Squad and the ZKsync
community is a place to connect, learn, and enjoy. Participate in a manner that
encourages positive interactions and enhances the experiences of all.

## Managing violations

If you come across inappropriate content or behavior, please report it without
delay. By working together, we can maintain a positive and safe environment.

If you are the subject of, or witness to, any violations of this Code of
Conduct, please contact us at <[email protected]>.
78 changes: 78 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Contribution Guidelines

Hello! 👋 Thanks for your interest in joining the mission to accelerate the mass
adoption of crypto for personal sovereignty! We welcome contributions from
anyone on the internet, and are grateful for even the smallest of fixes!

## Ways to contribute

There are many ways to contribute to ZKsync SSO SDK:

1. **Open issues**: if you find a bug please open an issue.
2. **Add detail to existing issues**: provide screenshots, code snippets, etc
issues.
3. **Resolve issues**: either by showing an issue isn't a problem or by fixing
the problem and opening a PR.
4. **Report security issues**, see [our security policy](./github/SECURITY.md).
5. [**Join the team!**][join-the-team]

[join-the-team]:
https://matterlabs.notion.site/Shape-the-future-of-Ethereum-at-Matter-Labs-dfb3b5a037044bb3a8006af2eb0575e0

## Fixing issues

If you would like to fix an issue, please begin with commenting and getting
yourself assigned to the issue in Github. Your contributions should come from a
[fork of the project](https://github.com/matter-labs/zksync-account-sdk/fork).
Refer to the [Github guide][github-pr-fork] on how to work with PRs created from
a fork.

[github-pr-fork]:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork

### Commit conventions

This project uses
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
standards. For changes that are **code related**, use the `chore:`, `fix:`,
`feat:`, or `docs:` tags in your commits.

```sh
git commit -m "docs: fix typo in guide"
```

### Signed git commits

Your git commits need to be [signed with a verified
signature][github-verified-signature-commits].

1. Follow the instructions to [generate a signing
key][github-generate-signing-key].
1. [Add the key to your GitHub account][github-add-key].
1. [Tell git about your signing key][github-signing-key].

[github-verified-signature-commits]:
https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification
[github-generate-signing-key]:
https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key
[github-add-key]:
https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account
[github-signing-key]:
https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key

## Licenses

If you contribute to this project, your contributions will be made to the
project under both Apache 2.0 and the MIT license.

## Resources

We aim to make it as easy as possible to contribute to the mission.

1. [In-repo docs aimed at developers](docs)
2. [ZKsync docs](https://docs.zksync.io)
3. Company links can be found in the [repo's readme](README.md)

## Code of Conduct

Be polite and respectful. Read our [Code of conduct](./CODE_OF_CONDUCT.md).
Loading

0 comments on commit 3735ee0

Please sign in to comment.