diff --git a/README.md b/README.md index 5e5190e..f4d2181 100644 --- a/README.md +++ b/README.md @@ -2,63 +2,78 @@ [![test](https://github.com/scroll-tech/canvas-contracts/actions/workflows/contracts.yml/badge.svg)](https://github.com/scroll-tech/canvas-contracts/actions/workflows/contracts.yml) -![Components overview](images/overview.png "Overview") +## Welcome to Scroll Canvas -([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)) +We are thrilled to have you join us in building unique discoveries with Scroll Canvas, a new product designed for ecosystem projects to interact with users in a more tailored way. -## ScrollBadge Schema and Resolver +## Overview -We define a *Scroll badge* [EAS schema](https://docs.attest.sh/docs/core--concepts/schemas): +**Scroll Canvas** allows users to showcase on-chain credentials, status, and achievements called **Badges** issued and collected across the Scroll ecosystem. +Users can mint a non-transferable and unique personal persona to collect and display their **Badges**. +### Key Features + +- **Canvas**: Each Canvas is a smart contract minted through the `ProfileRegistry` contract by the user on Scroll’s website. +- **Badges**: Attestations of achievements and traits verified through the Ethereum Attestation Service ([EAS service](https://docs.attest.sh/docs/welcome)), issued by different projects and the Scroll Foundation. + Badges are wallet-bound and non-transferable. + +| Attestation | NFT | +| --- | --- | +| Witness Proofs | Tokenized Assets | +| Non-transferable | Transferable | +| Recorded on disk (blockchain history) | Recorded in memory (blockchain states) | +| Prove ownership at a point in time | Exercise custodianship of an asset | + +## Developer Quickstart + +Visit the [Developer Documentation](./docs) in this repo to learn more about Canvas. + +See [Deployments](./docs/deployments.md) for the official Canvas contract addresses. + +## Running the Code + +### Node.js + +First install [`Node.js`](https://nodejs.org/en) and [`npm`](https://www.npmjs.com/). +Run the following command to install [`yarn`](https://classic.yarnpkg.com/en/): + +```bash +npm install --global yarn ``` -address badge -bytes payload -``` -This schema is tied to `ScrollBadgeResolver`. -Every time a Scroll badge attestation is created or revoked, `ScrollBadgeResolver` executes some checks. -After that, it forwards the call to the actual badge implementation. +### Foundry + +Install `foundryup`, the Foundry toolchain installer: + +```bash +curl -L https://foundry.paradigm.xyz | bash +``` -## Profiles +If you do not want to use the redirect, feel free to manually download the `foundryup` installation script from [here](https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup). Then, run `foundryup` in a new terminal session or after reloading `PATH`. -Each user can create a `Profile` contract, minted through the `ProfileRegistry` contract. -Each wallet can mint only one profile. -All profiles share the same implementation, upgradable by Scroll to enable new features. +Other ways to install Foundry can be found [here](https://github.com/foundry-rs/foundry#installation). -The main use of profiles is personalization. -Users can configure a username and an avatar. -Users can also decide which badges they atach to their profile, and in which order. +### Install Dependencies -## Badges +Run the following command to install all dependencies locally. -Each badge is an EAS attestation that goes through the `ScrollBadgeResolver` contract and a badge contract. +``` +yarn +``` -Each badge type is a standalone contract, inheriting from `ScrollBadge`. -This badge contract can implement arbitrary logic attached to the attestation. -Badges implement a `badgeTokenURI` interface, similar to `ERC721.tokenURI`. +### Run Contract Tests -Badges are minted to the user's wallet address. -The user can express their personalization preferences (attach and order badges, choose a profile photo) through their `Profile`. +Run the following command to run the contract tests. -See [badges](./docs/badges.md) for details. +``` +yarn test +``` -### Extensions +## Contributing -This repo contains some useful [extensions](src/badge/extensions): -- `ScrollBadgeAccessControl` restricts who can create and revoke this badge. -- `ScrollBadgeCustomPayload` adds custom payload support to the badge. -- `ScrollBadgeDefaultURI` sets a default badge token URI. -- `ScrollBadgeEligibilityCheck` adds a standard on-chain eligibility check interface. -- `ScrollBadgeNoExpiry` disables expiration for the badge. -- `ScrollBadgeNonRevocable` disables revocation for the badge. -- `ScrollBadgeSBT` attaches an SBT token to each badge attestation. -- `ScrollBadgeSelfAttest` ensures that only the recipient of the badge can create the badge. -- `ScrollBadgeSingleton` ensures that each user can only have at most one of the badge. +We welcome community contributions to this repository. +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. -### Examples +## License -This repo also contains some [examples](src/badge/examples): -- `ScrollBadgeSimple` is a simple badge with fixed metadata. -- `ScrollBadgePermissionless` is a permissionless badge that anyone can mint to themselves. -- `ScrollBadgeLevels` is an SBT badge that stores a level in its payload and renders different images based on this level. -- `ScrollBadgeTokenOwner` is a badge that is tied to the ownership of a Scroll Origins NFT. +Scroll Monorepo is licensed under the [MIT](./LICENSE) license. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..8586f26 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,60 @@ +# Scroll Canvas Developer Documentation + +![Components overview](images/overview.png "Overview") + +([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)) + + +# Overview + +Scroll Canvas consists of the following components: +- [**ProfileRegistry**](../src/profile/ProfileRegistry.sol): A contract for users to mint and query their Canvases. +- [**Profile**](../src/profile/Profile.sol): Each Canvas is an instance of the profile smart contract. +- [**EAS**](https://docs.attest.org/docs/welcome): A technology for issuing on-chain attestations. +- [**ScrollBadgeResolver**](../src/resolver/ScrollBadgeResolver.sol): Each attestation passes through this resolver before the badge is minted. It enforces Canvas badge rules. +- [**ScrollBadge**](../src/badge/ScrollBadge.sol): Each badge is a contract the conforms to a certain [interface](../src/interfaces/IScrollBadge.sol). + + +## Profiles + +Each user can mint a [`Profile`](../src/profile/Profile.sol) instance through [`ProfileRegistry`](../src/profile/ProfileRegistry.sol). +This contract is the user's Canvas, and minting it is a prerequisite to collecting badges. +Each wallet can only mint one profile. +All profiles share the same implementation, upgradable by Scroll to enable new features. + +The main use of profiles is personalization. +Users can configure a username and an avatar. +Users can also decide which badges they attach to their profile, and in which order they want to display them. + +See the [Canvas Interaction Guide](./canvas-interaction-guide.md) section for more details. + + +## ScrollBadge Schema and Resolver + +We define a *Scroll badge* [EAS schema](https://docs.attest.org/docs/core--concepts/schemas): + +``` +address badge +bytes payload +``` + +This schema is tied to `ScrollBadgeResolver`. +Every time a Scroll badge attestation is created or revoked through EAS, `ScrollBadgeResolver` executes some checks and actions. +After this, it forwards the call to the actual badge implementation. + +You can find the schema UID in the [Deployments](./deployments.md) section. +Browse the Scroll mainnet badge attestations on the [EAS Explorer](https://scroll.easscan.org/schema/view/0xd57de4f41c3d3cc855eadef68f98c0d4edd22d57161d96b7c06d2f4336cc3b49). + + +## Badges + +Each badge is an [EAS attestation](https://docs.attest.org/docs/core--concepts/attestations) that goes through the [`ScrollBadgeResolver`](../src/resolver/ScrollBadgeResolver.sol) contract and a badge contract. + +Each badge type is a standalone contract that inherits from [`ScrollBadge`](../src/badge/ScrollBadge.sol). +This badge contract can implement arbitrary logic attached to the attestation. +Badges implement a `badgeTokenURI` interface, similar to `ERC721.tokenURI`. + +Badges are minted to the user's wallet address. +The user can express their personalization preferences (attach and reorder badges, choose a profile photo) through their Canvas [`Profile`](../src/profile/Profile.sol). + +See the [Badges](./badges.md) section for more details. diff --git a/docs/badges.md b/docs/badges.md index a735057..9d6ec21 100644 --- a/docs/badges.md +++ b/docs/badges.md @@ -1,19 +1,17 @@ -# Canvas Badge FAQ +# Badges ### What is a badge? Each Canvas badge is an [EAS attestation](https://docs.attest.sh/docs/core--concepts/attestations), with some additional logic attached to it. -The badge attestation uses the official Scroll Canvas schema (see `SCROLL_SEPOLIA_BADGE_SCHEMA` in [deployments.md](./deployments.md)). -This means that the badge data includes two fields: `address badge, bytes payload`, and badges will go through the official Canvas badge resolver contract. +The badge attestation uses the official Scroll Canvas schema (see `BADGE_SCHEMA` in [Deployments](./deployments.md)). +This means that the badge data contains two fields: `address badge, bytes payload`, and badges are issued through the official Canvas badge [resolver contract](../src/resolver/ScrollBadgeResolver.sol). ### How to implement a new badge? -As a badge developer, you need to deploy a badge contract that inherits from [`ScrollBadge`](../src/badge/ScrollBadge.sol). -Additionally, you can use one of more [extensions](../src/badge/extensions). - -The badge must implement 3 APIs (see [`IScrollBadge`](../src/interfaces/IScrollBadge.sol)): +Each badge must implement a certain interface to ensure it is compatible with Canvas. +In particular, each badge must implement 3 APIs (see [`IScrollBadge`](../src/interfaces/IScrollBadge.sol)): - `issueBadge`: Implement arbitrary logic that is triggered when a new badge is created. - `revokeBadge`: Implement arbitrary logic that is triggered when a badge is revoked. - `badgeTokenURI`: Return the badge token URI. @@ -21,39 +19,197 @@ The badge must implement 3 APIs (see [`IScrollBadge`](../src/interfaces/IScrollB In most cases, the badge contract would use a static image, shared by all instances of this badge. However, on-chain-generated SVG data URLs are also possible. +As a badge developer, it is strongly recommended that your contract inherits from [`ScrollBadge`](../src/badge/ScrollBadge.sol). +Additionally, you can use one or more [extensions](../src/badge/extensions). Refer to the examples in [examples](../src/badge/examples). -> While this is not compulsory, we recommend creating badges that do no expire, are non-revocable, and are singletons (at most 1 badge per user). +> While this is not mandatory, we recommend creating badges that do no expire, are non-revocable, and are singletons (at most 1 badge per user). -### How to mint a badge? +### Badge Types -Badges are created by attesting to the recipient using the `SCROLL_SEPOLIA_BADGE_SCHEMA`. +Badges are created by attesting to the recipient using the [`BADGE_SCHEMA`](./deployments.md). EAS provides multiple interfaces to attest: `attest`, `attestByDelegation`, `multiAttest`, `multiAttestByDelegation`. See [`IEAS.sol`](https://github.com/ethereum-attestation-service/eas-contracts/blob/master/contracts/IEAS.sol). -Another useful example is [`AttesterProxy.sol`](../src/AttesterProxy.sol), which allows creating unordered delegated attestations. -There are 3 main badge minting flows: -1. **Fully permissionless**. - The user attests to themselves using `EAS.attest`. - The badge contract ensures that the issuer is authorized. +There are three main badge types of badges: + +1. **Permissionless**. + Permissionless badges allow users to attest to themselves using `EAS.attest`. + The badge contract ensures that the user is authorized to mint. See [`ScrollBadgePermissionless.sol`](../src/badge/examples/ScrollBadgePermissionless.sol) and [`ScrollBadgeTokenOwner.sol`](../src/badge/examples/ScrollBadgeTokenOwner.sol). 2. **Backend-authorized**. - A centralized backend implements some off-chain eligibility check. + For backend-authorized badges, the issuer maintains a centralized backend service. + This backend implements some off-chain eligibility check and exposes an eligibility check and claim API. If the user is authorized to mint, the backend issues a signed permit. - The user then mints by calling `AttesterProxy.attestByDelegation`. - Note: In this case, the badge issuer will be the address of `AttesterProxy`. + The user then mints using this permit. + + For backend-authorized badges, you need to deploy two contracts: the badge contract, and an [`AttesterProxy`](../src/AttesterProxy.sol). + `AttesterProxy` allows executing delegated attestations in arbitrary order. + The user can mint the badge by calling `AttesterProxy.attestByDelegation` and providing the signed permit. + +3. **Gifted**. + Badges can also be issued with no user interaction. + To do this, the issuer uses `EAS.attest` or `EAS.multiAttest` to airdrop these badges to a list of users. + + +### Overview of Requirements + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescriptionBasic RequirementsAdditional RequirementsExamples
+ + `Permissionless` + + + + Badge checks eligibility based on smart contract. + + **Example: Badges attesting to completing an onchain transaction or holding an NFT are eligible to mint the badge.** + + +
    +
  • + + The badge is deployed on the **Scroll Mainnet** and verified on [ScrollScan](https://scrollscan.com). + +
  • +
  • + + The badge contract implements [defaultTokenURI](https://github.com/scroll-tech/canvas-contracts/blob/master/src/badge/extensions/ScrollBadgeDefaultURI.sol). + +
  • +
  • + + Your project is listed on [Scroll Ecosystem - Browse all protocols](https://scroll.io/ecosystem#protocols). + +
  • +
  • + + All URLs mentioned above are configured for cross-origin access on https://scroll.io. + +
  • +
+
+ N/A +
+ + `Backend-authorized` + + + + Badge checks eligibility based on the issuer’s API. + + **Example: Badges attesting to completing offchain actions or a certain allow list.** + + + +
    +
  • + + The **check API** and **claim API** have been deployed to **production**. + +
  • +
  • + + The attester proxy contract is deployed on the **Scroll Mainnet** and verified on [ScrollScan](https://scrollscan.com). + +
  • +
+
+ + `Gifted` + + + + Badge checks eligibility based on the issuer’s API and automatically sends to users' canvas. There is no minting required for users to display the badge. + + **Example: Badges attesting to ownership or paid membership on other platforms / chains.** + + + +
    +
  • + + The **check API** has been deployed to **production**. + +
  • +
+
+ + +### Extensions + +This repo contains some useful [extensions](src/badge/extensions): +- `ScrollBadgeAccessControl` restricts who can create and revoke this badge. +- `ScrollBadgeCustomPayload` adds custom payload support to the badge. +- `ScrollBadgeDefaultURI` sets a default badge token URI. +- `ScrollBadgeEligibilityCheck` adds a standard on-chain eligibility check interface. +- `ScrollBadgeNoExpiry` disables expiration for the badge. +- `ScrollBadgeNonRevocable` disables revocation for the badge. +- `ScrollBadgeSBT` attaches an SBT token to each badge attestation. +- `ScrollBadgeSelfAttest` ensures that only the recipient of the badge can create the badge. +- `ScrollBadgeSingleton` ensures that each user can only have at most one of the badge. + + +### Examples + +This repo also contains some [examples](src/badge/examples): +- `ScrollBadgeSimple` is a simple badge with fixed metadata. +- `ScrollBadgePermissionless` is a permissionless badge that anyone can mint to themselves. +- `ScrollBadgeLevels` is an SBT badge that stores a level in its payload and renders different images based on this level. +- `ScrollBadgeTokenOwner` is a badge that is tied to the ownership of a Scroll Origins NFT. + + +### Troubleshooting -3. **Airdropped**. - Badges can also be issues with no user interaction. - To do this, the issuer uses `EAS.attest` or `EAS.multiAttest`. +We recommend going through this checklist before your badge is published: +- [ ] The badge contract is deployed on Scroll mainnet and verified on Scrollscan. +- [ ] The badge contract configured the correct resolver address, see [Deployments](./deployments.md). -### How to ensure that the badge can be shown on scroll.io? +Backend-authorized badges: -Simply provide the deployed badge contract address to the Scroll team. +- [ ] The attester proxy contract is deployed on Scroll mainnet and verified on Scrollscan. +- [ ] The badge enabled the attester proxy: `badge.toggleAttester(attesterProxy, true)`. +- [ ] The attester proxy enabled your backend signer account: `attesterProxy.toggleAttester(signer, true)`. +If your badge minting transaction reverts, we recommend debugging using `cast`: -### How to ensure that the badge can be minted on scroll.io? +```sh +cast run --rpc-url https://rpc.scroll.io [txhash] +``` -TBA +This call will simulate the transaction in a local environment, and show you the call stack and revert reason. diff --git a/docs/integration-faq.md b/docs/canvas-interaction-guide.md similarity index 95% rename from docs/integration-faq.md rename to docs/canvas-interaction-guide.md index ef0f8ae..57d8720 100644 --- a/docs/integration-faq.md +++ b/docs/canvas-interaction-guide.md @@ -1,13 +1,11 @@ -# Canvas Integration FAQ +# Canvas Interaction Guide -In the examples on this page, we use the configurations from [deployments.md](./deployments.md), as well as the following values: +This document will show you the basic steps how one would interact with a Canvas profile. + +In the examples on this page, we use the configurations from [Deployments](./deployments.md), as well as the following values: ```bash # Canvas badges -- each badge type is a new contract, here we only have three simple test contracts -SCROLL_MAINNET_SIMPLE_BADGE_A_ADDRESS="0xB1Dbd079c62d181926E5A54932Bb1b15F760e8A0" -SCROLL_MAINNET_SIMPLE_BADGE_B_ADDRESS="0xe626E631BdDcd985D02D2eEe4fbdF901b52AE33C" -SCROLL_MAINNET_SIMPLE_BADGE_C_ADDRESS="0xe485f8fcBf3b678e83d208fa3f1933a315d58356" - SCROLL_SEPOLIA_SIMPLE_BADGE_A_ADDRESS="0x30C98067517f8ee38e748A3aF63429974103Ea6B" SCROLL_SEPOLIA_SIMPLE_BADGE_B_ADDRESS="0xeBFc9B95328B2Cdb3c4CA8913e329c101d2Abbc2" SCROLL_SEPOLIA_SIMPLE_BADGE_C_ADDRESS="0x64492EF5a60245fbaF65F69782FCf158F3a8e3Aa" @@ -59,7 +57,7 @@ To mint a profile with a referral, produce a signed referral, then submit it alo ### How to list all badges that a user has? -We can use the EAS GraphQL API to query a user's Canvas badges. +We can use the [EAS GraphQL API](https://docs.attest.org/docs/developer-tools/api) to query a user's Canvas badges. > Warning: Badges are minted to the user's wallet address, not to their profile address! diff --git a/docs/ethereum-year-badge.md b/docs/official-badges/ethereum-year-badge.md similarity index 100% rename from docs/ethereum-year-badge.md rename to docs/official-badges/ethereum-year-badge.md diff --git a/docs/scroll-origins-badge.md b/docs/official-badges/scroll-origins-badge.md similarity index 100% rename from docs/scroll-origins-badge.md rename to docs/official-badges/scroll-origins-badge.md