|
2 | 2 |
|
3 | 3 | [](https://github.com/scroll-tech/canvas-contracts/actions/workflows/contracts.yml)
|
4 | 4 |
|
5 |
| - |
| 5 | +## Welcome to Scroll Canvas |
6 | 6 |
|
7 |
| -([Editable link](https://viewer.diagrams.net/?tags=%7B%7D&highlight=0000ff&edit=_blank&layers=1&nav=1&title=skelly-v4.drawio#R7VpLc6M4EP41rpo5xIWEMeYYx8nsIdma2Rx2clRABs0K5BVybO%2BvXwkknk7ijCEwNalUyqjVenV%2F%2FVDDxL6K91842kR3LMB0Aq1gP7FXEwgBsIH8UZRDTllY85wQchJoppJwT%2F7Dmmhp6pYEOK0xCsaoIJs60WdJgn1RoyHO2a7Otma0vuoGhbhFuPcRbVP%2FJoGI9Ckcq6T%2FgUkYmZWBpXtiZJg1IY1QwHYVkn09sa84YyJ%2FivdXmCrhGbnk426e6S02xnEiThkQf%2Ft2uwvggibu7Q9%2Fk1hfCbzQykjFwRwYB%2FL8usm4iFjIEkSvS%2BqSs20SYDWrJVslzy1jG0kEkvgDC3HQykRbwSQpEjHVvXLD%2FPBdj88aD6oxdUxzta92rg66lQrO%2FinUIAW4XBNKrxhlPNu7vV742PcLzkrP48KZOWqOttS0IFO25T5%2BQVQGfYiHWLzAZ%2Bd8So6VBbROvmAWY3kmycAxRYI81XGGNFzDgq%2FUqHzQSn2DgsEsn%2FgJ0a1eagLnVB5gGZCnmurn%2F24VFpd%2BLrZLtcfw8ZPjTaBc2yp%2FP2dylLaUiIs1igk95Nx3OKEsZ7qTgPD1s5wZxRIZSz3%2FlZQ0wVz2%2FIl3zc58SMwSlm6Q0kexUprBSa0DrM0%2B76AkwReRtr%2Bsy9Fd82K%2Beah%2BkRA4FZ8%2Bm8NLYWbnz3uPWsEtepTOrIZcREmYyGdfokeewF4%2BYS6I9BaXuiMmQZAbCZb7RY%2FZfAp3G0YSkSnXWU6clcKuPJQxNKsNy5fMVa2K95Mj%2Fk%2BvWHMxNdTpURfW1Fo4bj72UJvpZFzqyb%2Bqk5WzXHj1EWy9TqW9NHFcbOkMaLeQfX1539LkLiIC3%2BdYWu1kkGpoNN3kYWNN9sqn1dRyxMeCZzTwrKTthVWTsu3q9q4STjQpqkQSQ%2BvcI8CW2O79CMfIWMYjN1bxFw5JapY8R6Ytd7zM%2FrS0j9F7EDx0Bha8O2isLRqnxVq8J%2BJ7ySlbD5WecpBq1OPzm9T5atS1T4y6cFRR12uperCkqR5mOrXFzpQ3G5XyzNVjDNobNuU9VX%2FOqPRnHwlwnFG6RGp%2FR6JcyuiTykdHljk4zsgyh%2FZVoibYDsXXsaM6XeZuU%2BZwYJk77ybzLiDbFN9saPEB%2BJv48ld9NOjaRzeufxoB0G0gADRUmwcdPaqHS2Hb%2B3%2FUO37Zeocx304KHrAGTN06E%2B5FsmiqH4v6DD1WPxYfQFe%2F1pRnZQrMxwT202Ppm5Hs2I26Rn%2BVonbForfgCU8tSIBqOaIoTrxfQQLOhwq4512KwFEz6L36FFyql3CymbAE55QborauFYS4MBw%2BRWlKfEPWbKBnPfadEIFZw1y9hrnmQGolRFIq6FBh0z7mzevc%2FBy%2FfMh30GnQMkKvBK3LLFFRUaN5Mf%2FK2f782vMorpWwKeyha9HwI3vIMEbSdIuzu%2FSYsodXUuXOUom5Z00tS6JzMfechV2%2FuM1U38yZyX%2FHdW3YV2CyPpBYXtiWh7YfXGGKQxmCWDImjPYIS5DBEngAQMe1JDgXdec596ae58zmnu1CD3p9AXPgb2PKetJDte%2B59PiVTCtAaZTtC5yVNRk38Ktlv27LyUh7Q340Dst5EX%2Fn25M1BZb51uNns9n%2BCxoGWhUdyQxwTej4ytzNTwtm3sDpnH3sK68hndfkTZXxM%2FzRqa8oDbpedUhlvdC27XpKZGp9I7ah9usin2Mk2iY0Ij9nsNtFjRdA68zCrinkNt9b9Ki09iuLwvH19klW1y4RgndzibJZfjWdK6H89ty%2B%2Fh8%3D)) |
| 7 | +We are thrilled to have you join us in building unique discoveries with [Scroll Canvas](https://scroll.io/canvas), a new product designed for ecosystem projects to interact with users in a more tailored way. |
8 | 8 |
|
9 |
| -## ScrollBadge Schema and Resolver |
| 9 | +Try Canvas at [scroll.io/canvas](https://scroll.io/canvas) |
10 | 10 |
|
11 |
| -We define a *Scroll badge* [EAS schema](https://docs.attest.sh/docs/core--concepts/schemas): |
| 11 | +## Overview |
12 | 12 |
|
13 |
| -``` |
14 |
| -address badge |
15 |
| -bytes payload |
| 13 | +**Scroll Canvas** allows users to showcase on-chain credentials, status, and achievements called **Badges** issued and collected across the Scroll ecosystem. |
| 14 | +Users can mint a non-transferable and unique personal persona to collect and display their **Badges**. |
| 15 | + |
| 16 | +### Key Features |
| 17 | + |
| 18 | +- **Canvas**: Each Canvas is a smart contract minted through the `ProfileRegistry` contract by the user on Scroll’s website. |
| 19 | +- **Badges**: Attestations of achievements and traits verified through the [Ethereum Attestation Service](https://docs.attest.sh/docs/welcome) (EAS), issued by different projects and the Scroll Foundation. |
| 20 | + Badges are wallet-bound and non-transferable. |
| 21 | + |
| 22 | +Differences between attestations and NFTs: |
| 23 | + |
| 24 | +| Attestation | NFT | |
| 25 | +| --- | --- | |
| 26 | +| Witness Proofs | Tokenized Assets | |
| 27 | +| Non-transferable | Transferable | |
| 28 | +| Recorded on disk (blockchain history) | Recorded in memory (blockchain states) | |
| 29 | +| Prove ownership at a point in time | Exercise custodianship of an asset | |
| 30 | + |
| 31 | +## Developer Quickstart |
| 32 | + |
| 33 | +Visit the [Developer Documentation](./docs) in this repo to learn more about Canvas. |
| 34 | + |
| 35 | +See [Deployments](./docs/deployments.md) for the official Canvas contract addresses. |
| 36 | + |
| 37 | +See the [Integration Guide](https://scrollzkp.notion.site/Introducing-Scroll-Canvas-Badge-Integration-Guide-8656463ab63b42e8baf924763ed8c9d5) for more information. |
| 38 | + |
| 39 | +## Support |
| 40 | + |
| 41 | +For questions regarding Canvas and custom badge development, please join [Scroll dev support channel](https://discord.com/channels/853955156100907018/1028102371894624337) on Discord. |
| 42 | + |
| 43 | +## Running the Code |
| 44 | + |
| 45 | +### Node.js |
| 46 | + |
| 47 | +First install [`Node.js`](https://nodejs.org/en) and [`npm`](https://www.npmjs.com/). |
| 48 | +Run the following command to install [`yarn`](https://classic.yarnpkg.com/en/): |
| 49 | + |
| 50 | +```bash |
| 51 | +npm install --global yarn |
16 | 52 | ```
|
17 | 53 |
|
18 |
| -This schema is tied to `ScrollBadgeResolver`. |
19 |
| -Every time a Scroll badge attestation is created or revoked, `ScrollBadgeResolver` executes some checks. |
20 |
| -After that, it forwards the call to the actual badge implementation. |
| 54 | +### Foundry |
21 | 55 |
|
22 |
| -## Profiles |
| 56 | +Install `foundryup`, the Foundry toolchain installer: |
23 | 57 |
|
24 |
| -Each user can create a `Profile` contract, minted through the `ProfileRegistry` contract. |
25 |
| -Each wallet can mint only one profile. |
26 |
| -All profiles share the same implementation, upgradable by Scroll to enable new features. |
| 58 | +```bash |
| 59 | +curl -L https://foundry.paradigm.xyz | bash |
| 60 | +``` |
27 | 61 |
|
28 |
| -The main use of profiles is personalization. |
29 |
| -Users can configure a username and an avatar. |
30 |
| -Users can also decide which badges they atach to their profile, and in which order. |
| 62 | +If you do not want to use the redirect, feel free to manually download the `foundryup` installation script from [here](https://github.com/foundry-rs/foundry/master/foundryup/foundryup). Then, run `foundryup` in a new terminal session or after reloading `PATH`. |
31 | 63 |
|
32 |
| -## Badges |
| 64 | +Other ways to install Foundry can be found [here](https://github.com/foundry-rs/foundry#installation). |
33 | 65 |
|
34 |
| -Each badge is an EAS attestation that goes through the `ScrollBadgeResolver` contract and a badge contract. |
| 66 | +### Install Dependencies |
35 | 67 |
|
36 |
| -Each badge type is a standalone contract, inheriting from `ScrollBadge`. |
37 |
| -This badge contract can implement arbitrary logic attached to the attestation. |
38 |
| -Badges implement a `badgeTokenURI` interface, similar to `ERC721.tokenURI`. |
| 68 | +Run the following command to install all dependencies locally. |
39 | 69 |
|
40 |
| -Badges are minted to the user's wallet address. |
41 |
| -The user can express their personalization preferences (attach and order badges, choose a profile photo) through their `Profile`. |
| 70 | +``` |
| 71 | +yarn |
| 72 | +``` |
| 73 | + |
| 74 | +### Run Contract Tests |
| 75 | + |
| 76 | +Run the following command to run the contract tests. |
42 | 77 |
|
43 |
| -See [badges](./docs/badges.md) for details. |
| 78 | +``` |
| 79 | +yarn test |
| 80 | +``` |
44 | 81 |
|
45 |
| -### Extensions |
| 82 | +## Contributing |
46 | 83 |
|
47 |
| -This repo contains some useful [extensions](src/badge/extensions): |
48 |
| -- `ScrollBadgeAccessControl` restricts who can create and revoke this badge. |
49 |
| -- `ScrollBadgeCustomPayload` adds custom payload support to the badge. |
50 |
| -- `ScrollBadgeDefaultURI` sets a default badge token URI. |
51 |
| -- `ScrollBadgeEligibilityCheck` adds a standard on-chain eligibility check interface. |
52 |
| -- `ScrollBadgeNoExpiry` disables expiration for the badge. |
53 |
| -- `ScrollBadgeNonRevocable` disables revocation for the badge. |
54 |
| -- `ScrollBadgeSBT` attaches an SBT token to each badge attestation. |
55 |
| -- `ScrollBadgeSelfAttest` ensures that only the recipient of the badge can create the badge. |
56 |
| -- `ScrollBadgeSingleton` ensures that each user can only have at most one of the badge. |
| 84 | +We welcome community contributions to this repository. |
| 85 | +For larger changes, please [open an issue](https://github.com/scroll-tech/canvas-contracts/issues/new/choose) and discuss with the team before submitting code changes. |
57 | 86 |
|
58 |
| -### Examples |
| 87 | +## License |
59 | 88 |
|
60 |
| -This repo also contains some [examples](src/badge/examples): |
61 |
| -- `ScrollBadgeSimple` is a simple badge with fixed metadata. |
62 |
| -- `ScrollBadgePermissionless` is a permissionless badge that anyone can mint to themselves. |
63 |
| -- `ScrollBadgeLevels` is an SBT badge that stores a level in its payload and renders different images based on this level. |
64 |
| -- `ScrollBadgeTokenOwner` is a badge that is tied to the ownership of a Scroll Origins NFT. |
| 89 | +Scroll Monorepo is licensed under the [MIT](./LICENSE) license. |
0 commit comments