Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
zencephalon committed Sep 20, 2024
2 parents e119ca9 + 7d14488 commit e8770ac
Show file tree
Hide file tree
Showing 70 changed files with 3,371 additions and 117 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ The second item, at `0x20` has the error code of `32` hidden in it, which is for
It's sometimes better to just review the code first to see if the error is obvious.

```solidity
unction badGetLastValueFixed() public pure returns (uint) {
function badGetLastValueFixed() public pure returns (uint) {
uint[4] memory arr = [uint(1), 2, 3, 4];
return arr[arr.length-1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ By the end of this lesson, you should be able to:

- Verify a deployed smart contract on Etherscan
- Connect a wallet to a contract in Etherscan
- Use etherscan to interact with your own deployed contact
- Use etherscan to interact with your own deployed contract

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Exploring them separately will highlight the functionality provided by the prepa

:::caution

In this module, you'll'll extend the onchain app you build in the previous module, [Reading and Displaying Data].
In this module, you'll extend the onchain app you build in the previous module, [Reading and Displaying Data].

:::

Expand All @@ -54,7 +54,7 @@ You'll need to know how many tokens the user has to be able to make decisions on

You'll need the user's address to use in `args`, which you can conveniently get from the [`useAccount`] hook using the pattern below.

```tsx:
```tsx
const { data: balanceData, queryKey: balanceQueryKey } =
useReadContract({
address: contractData.address as `0x${string}`,
Expand Down Expand Up @@ -130,8 +130,8 @@ const handleClaimClick = () => {
return (
<div>
<p>{'Token Balance: ' + tokenBalance}</p>
<button disabled={claimIsLoading} onClick={handleClaimClick}>
{claimIsLoading ? 'Complete In Wallet' : 'Claim Tokens'}
<button disabled={claimIsPending} onClick={handleClaimClick}>
{claimIsPending ? 'Complete In Wallet' : 'Claim Tokens'}
</button>
</div>
);
Expand Down
10 changes: 10 additions & 0 deletions apps/base-docs/docs/tools/basenames-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,13 @@ Basenames are built using the Ethereum Name Service (ENS) protocol, leveraging i
### 17. Do Basenames work on different chains?

Yes, your Name will work on any chain as long as the app is ENSIP-10 compliant. Note that when sending money or interacting across different chains, you should ensure the receiving platform supports ENS.

### 18. How do I use frames with my basename?

You can pin frames as the ultimate way to make a profile yours. Want someone to mint? Frame it. Want someone to pay you? Frame it. Want to display your onchain identity your own way? Frame it.

Follow our step-by-step [guide] to get started. While Basenames supports all frames, we recommend using the Open Frames standard for the best experience.

---

[guide]: https://docs.base.org/tutorials/add-frames-to-basename
53 changes: 37 additions & 16 deletions apps/base-docs/tutorials/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@
"difficulty": "beginner",
"hide_table_of_contents": false,
"displayed_sidebar": null,
"last_updated": "Aug 14, 2024",
"last_updated": "Sep 12, 2024",
"duration": "21 min read",
"checksum": "c847674db9fb136fddfb6df8ebf5fe08ae30a4cbb35d03513c0b069d0acff0ee"
"checksum": "774c94bba584693d64a3db2ec4da3554ac5bc69b54956874d78d0abdd6701c62"
},
"0_run-a-base-node": {
"title": "Running a Base Node",
Expand All @@ -256,9 +256,9 @@
],
"difficulty": "beginner",
"displayed_sidebar": null,
"last_updated": "Aug 14, 2024",
"last_updated": "Sep 12, 2024",
"duration": "7 min read",
"checksum": "dd2f73c4b26b8126cca282e46fe39a1faba31cde44243fe9abaeace771841e0f"
"checksum": "1b62db4c90fac97453acd2f9bc09b3d23e75baa6ba765caa647721c5ce20d95a"
},
"1_10_farcaster-frames-hyperframes": {
"title": "Farcaster Frames: Building HyperFrames",
Expand Down Expand Up @@ -554,9 +554,9 @@
"tags": [
"smart contracts"
],
"last_updated": "Aug 20, 2024",
"last_updated": "Sep 12, 2024",
"duration": "12 min read",
"checksum": "c21972264ff57035c74bc01712adc187a6302b67482000a0a6f81681ff9fa9da"
"checksum": "c39c756f2f8f9940b0a041d5212d868f82aa0f949f11742d3fffedd37a5d2b35"
},
"2_1_simple-onchain-nfts": {
"title": "Simple Onchain NFTs",
Expand Down Expand Up @@ -696,9 +696,9 @@
"difficulty": "hard",
"hide_table_of_contents": false,
"displayed_sidebar": null,
"last_updated": "Aug 14, 2024",
"last_updated": "Sep 12, 2024",
"duration": "37 min read",
"checksum": "644148276a060da14958bd331948201e76c94390bfeffc80d81fb58621cf8592"
"checksum": "5a5ce14de1c4ea8416346409bec25aa6fb5d65e86f931771a58328d0280d1647"
},
"2_dynamic-nfts": {
"title": "Building dynamic NFTs",
Expand All @@ -724,9 +724,30 @@
"difficulty": "intermediate",
"hide_table_of_contents": false,
"displayed_sidebar": null,
"last_updated": "Jul 11, 2024",
"last_updated": "Sep 13, 2024",
"duration": "14 min read",
"checksum": "0b1498d415cda6e83031231cd05d42edacd2faa82d68471b2ed09670481a3259"
"checksum": "50ab75b2f4db041666bd7bf24bea0a3079389213810517bd8087807c3528fb0c"
},
"2_email-campaign-with-resend": {
"title": "Create Email Marketing Campaigns Onchain using Coinbase Smart Wallet + Resend",
"slug": "/onchain-email-campaigns-using-resend",
"description": "A tutorial that teaches how to create a mailing list and email customers using Resend",
"author": "hughescoin",
"keywords": [
"build on base",
"viem",
"wagmi",
"frontend",
"onchain app development"
],
"tags": [
"account abstraction"
],
"difficulty": "beginner",
"displayed_sidebar": null,
"last_updated": "Sep 12, 2024",
"duration": "21 min read",
"checksum": "e04c640da09b69b49d92c792d7cc6ddfddbcbee6facc44de85690c73da1f3aeb"
},
"2_event-gate-nouns": {
"title": "Gate IRL Events with Nouns",
Expand Down Expand Up @@ -856,9 +877,9 @@
"difficulty": "intermediate",
"hide_table_of_contents": false,
"displayed_sidebar": null,
"last_updated": "Aug 14, 2024",
"last_updated": "Sep 12, 2024",
"duration": "46 min read",
"checksum": "13ddb86a1b3e42ca0c3a8a4f1678f78d0f02d7b003133351081ecb252610789c"
"checksum": "aabfa2f90ea76b3e76b29d22f15262c84734e21d657e27ebc81b09f7f23b142d"
},
"4_hardhat-debugging": {
"title": "Hardhat: Debugging smart contracts",
Expand Down Expand Up @@ -1039,7 +1060,7 @@
"slug": "/cross-chain-with-layerzero",
"description": "A tutorial that teaches how to use LayerZero V2 to perform cross-chain messaging from Base Goerli testnet to Optimism Goerli testnet.",
"author": "taycaldwell",
"eywords": [
"keywords": [
"Cross-chain",
"Omni-chain",
"Crosschain",
Expand Down Expand Up @@ -1205,8 +1226,8 @@
"difficulty": "easy",
"hide_table_of_contents": false,
"displayed_sidebar": null,
"last_updated": "Jul 11, 2024",
"last_updated": "Sep 12, 2024",
"duration": "8 min read",
"checksum": "1d485f4ded5aa492578d9887e36fefefea452c262769f5f30f6e9750c24c2913"
"checksum": "59d04f2a46bc95b68a0f50c83f78a0b0d2f2549ecf0e8c7e592aaa4eae6bf6d1"
}
}
}
69 changes: 37 additions & 32 deletions apps/base-docs/tutorials/docs/2_dynamic-nfts.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ displayed_sidebar: null

# Build a Dynamic NFT on Base with Irys

In this tutorial, you will create a dynamic NFT using Irys' [mutable references].
In this tutorial, you will create a dynamic NFT using Irys's [mutability features].

![Overview](../../assets/images/dynamic-nfts/all-characters.png)

Expand All @@ -40,7 +40,7 @@ By the end of this tutorial, you should be able to:

- Permanently upload data onchain using Irys
- Create NFT metadata and use it to mint an NFT
- "Mutate" (change) the NFT metadata using Irys' mutable references
- "Mutate" (change) the NFT metadata using Irys's mutability features

## Prerequisites

Expand All @@ -50,7 +50,7 @@ By the end of this tutorial, you should be able to:

## About Irys

Irys is a provenance layer. Data uploaded to Irys is:
[Irys] is a datachain, a blockchain optimized for data storage. Data uploaded to Irys is:

- Permanent and immutable
- Onchain
Expand All @@ -64,20 +64,19 @@ When you store your NFT assets on Irys and mint them using a smart contract on B

Irys has a pay-once-store-forever model and accepts payment for storage using multiple tokens, including ETH on Base.

## Mutable references
## "Mutability"

Data on Irys is permanent and immutable, but you use Irys' [mutable references] to simulate mutability and create dynamic NFTs that evolve based on onchain or offchain actions.
Data on Irys is permanent and immutable, but you use Irys's [mutability features] to simulate mutability and create dynamic NFTs that evolve based on onchain or offchain actions.

![Overview](../../assets/images/dynamic-nfts/mutable-references.png)

With mutable references, you create a single, static URL that is linked to a series of transactions. You can add a new transaction to the series at any time, and the URL will always resolve to the most recent transaction.
Using Irys's mutability features, you create a single, static URL that is linked to a series of transactions. Then, you can add a new transaction to the series at any time, and the URL will always resolve to the most recent transaction.

You'll mint your NFT using a mutable reference URL, and then push updates to that URL. The URL won't change, but the metadata it resolves to will.
You'll mint your NFT using a mutable-style URL, and then push updates to that URL. The URL won't change, but the metadata it resolves to will.

## About

This tutorial focuses on creating a SuperMon NFT, similar to one used in a web3 game that would evolve during gameplay. The NFT starts with a basic appearance
and can be "upgraded" twice. You will use the Irys CLI to "mutate" the metadata, simulating the automatic changes that would occur through player interactions in an actual game.
This tutorial focuses on creating a SuperMon NFT, similar to one used in a web3 game that would evolve during gameplay. The NFT starts with a basic appearance and can be "upgraded" twice. You will use the Irys CLI to "mutate" the metadata, simulating the automatic changes that would occur through player interactions in an actual game.

## Smart contract

Expand Down Expand Up @@ -122,10 +121,14 @@ You'll use the [Irys CLI] to upload images and metadata.

Install the Irys CLI globally using the `-g` flag. Depending on your setup, you may need to use sudo.

```console
npm i -g @irys/sdk
# Or
sudo npm i -g @irys/sdk
```bash
npm i -g @irys/cli
```

Or:

```bash
sudo npm i -g @irys/cli
```

### Using private keys
Expand All @@ -142,7 +145,7 @@ irys -w <base-private-key> -t base-eth

[Download a zip containing PNGs] for each level, and save them on your local drive.

Next, fund the Irys Devnet node with 0.1 [Base Sepolia ETH] to pay for your uploads.
Next, fund Irys with 0.1 [Base Sepolia ETH] to pay for your uploads.

> In all of these CLI examples, make sure to replace the value of the `-w` parameter with your own private key.
Expand All @@ -151,14 +154,14 @@ irys fund 100000000000000000 \
-n devnet \
-t base-eth \
-w 6dd5e....54a120201cb6a \
--provider-url https://sepolia-explorer.base.org/
--provider-url https://sepolia.base.org
```

> The `fund` command accepts a value in atomic units, 0.1 ETH is equal to 100000000000000000 in atomic units.
Next, use the Irys CLI to upload each of the images to the Irys Devnet.

> Uploads to Irys' devnet are kept for ~60 days and are paid for using free tokens available from faucets [Base Sepolia]. Uploads to Irys' mainnet are permanent and can be paid for using ETH on Base.
> Uploads to Irys's devnet are kept for ~60 days and are paid for using free tokens available from [faucets].
```console
irys upload image-level-1.png \
Expand Down Expand Up @@ -188,7 +191,7 @@ Create three metadata files similar to the ones below. Make sure to change the v
{
"name": "SuperMon",
"symbol": "SMON",
"image": "https://gateway.irys.xyz/QH3rksVhbFg5L9vvjGzb4POUibCEG-TGPInmofp-O-o",
"image": "https://gateway.irys.xyz/3JE8cucmpLkXK1t84QwqDRv25FTB2EJWCUgpWdtvuJZd",
"description": "Super dooper, changing shapes, changing power",
"attributes": [
{
Expand All @@ -203,7 +206,7 @@ Create three metadata files similar to the ones below. Make sure to change the v
{
"name": "SuperMon",
"symbol": "SMON",
"image": "https://gateway.irys.xyz/QH3rksVhbFg5L9vvjGzb4POUibCEG-TGPInmofp-O-o",
"image": "https://gateway.irys.xyz/3JE8cucmpLkXK1t84QwqDRv25FTB2EJWCUgpWdtvuJZd",
"description": "Super dooper, changing shapes, changing power",
"attributes": [
{
Expand All @@ -219,7 +222,7 @@ Create three metadata files similar to the ones below. Make sure to change the v
{
"name": "SuperMon",
"symbol": "SMON",
"image": "https://gateway.irys.xyz/QH3rksVhbFg5L9vvjGzb4POUibCEG-TGPInmofp-O-o",
"image": "https://gateway.irys.xyz/3JE8cucmpLkXK1t84QwqDRv25FTB2EJWCUgpWdtvuJZd",
"description": "Super dooper, changing shapes, changing power",
"attributes": [
{
Expand All @@ -238,20 +241,20 @@ irys upload metadata-level-1.json \
-n devnet \
-t base-eth \
-w 6dd5e....54a120201cb6a \
--provider-url https://sepolia-explorer.base.org
--provider-url https://sepolia.base.org
```

The CLI will return a URL similar to `https://gateway.irys.xyz/NDtKvjlmZL2iXUPmX6P-BuvtnvAEFkUiQWG8ToyK5FM`. To convert that to a mutable references URL, interpolate it by adding `/mutable/` after the domain and before the transaction ID.
The CLI will return a URL similar to `https://gateway.irys.xyz/94TNg3UUKyZ96Dj8eSo9DVkBiivAz9jT39jjMFeTFvm3`. To convert that to a mutable-style URL, interpolate it by adding `/mutable/` after the domain and before the transaction ID.

Your final URL will be similar to `https://gateway.irys.xyz/mutable/NDtKvjlmZL2iXUPmX6P-BuvtnvAEFkUiQWG8ToyK5FM`.
Your final URL will be similar to `https://gateway.irys.xyz/mutable/94TNg3UUKyZ96Dj8eSo9DVkBiivAz9jT39jjMFeTFvm3`.

## Minting the NFT

To mint your NFT in Remix:

1. Return to Remix.
2. Under "Deployed Contracts", locate your contract and expand it to see its functions.
3. Under the `Mint` function, enter the wallet address you want to mint the NFT to and the metadata URL (e.g. `https://gateway.irys.xyz/mutable/NDtKvjlmZL2iXUPmX6P-BuvtnvAEFkUiQWG8ToyK5FM`) from the previous step.
3. Under the `Mint` function, enter the wallet address you want to mint the NFT to and the metadata URL (e.g. `https://gateway.irys.xyz/mutable/94TNg3UUKyZ96Dj8eSo9DVkBiivAz9jT39jjMFeTFvm3`) from the previous step.
4. Click Transact.

![Image Level 3](../../assets/images/dynamic-nfts/open-sea-mockup.jpg)
Expand All @@ -260,15 +263,15 @@ You can now view the NFT on the [Opensea Testnet].

## Mutating the metadata

To now "mutate" the NFT, upload a new version of the metadata tagging it as having a `Root-TX` equal to the transaction ID of your first transaction. In my example, I pass the value of `NDtKvjlmZL2iXUPmX6P-BuvtnvAEFkUiQWG8ToyK5FM`, however make sure to change this to match your unique transaction ID.
To now "mutate" the NFT, upload a new version of the metadata tagging it as having a `Root-TX` equal to the transaction ID of your first transaction. In my example, I pass the value of `94TNg3UUKyZ96Dj8eSo9DVkBiivAz9jT39jjMFeTFvm3`, however make sure to change this to match your unique transaction ID.

```console
irys upload metadata-level-2.json \
-n devnet \
-t base-eth \
-w 6dd5e....54a120201cb6a \
--tags Root-TX NDtKvjlmZL2iXUPmX6P-BuvtnvAEFkUiQWG8ToyK5FM \
--provider-url https://sepolia-explorer.base.org
--tags Root-TX 94TNg3UUKyZ96Dj8eSo9DVkBiivAz9jT39jjMFeTFvm3 \
--provider-url https://rpc.sepolia.org
```

Return to Opensea and request that it refresh your metadata.
Expand Down Expand Up @@ -302,13 +305,15 @@ Dynamic NFTs are commonly used with gaming projects, similar to the one we built

---

[Base Faucet]: https://docs.base.org/tools/network-faucet
[Base Sepolia ETH]: https://docs.base.org/tools/network-faucet
[browser]: https://docs.irys.xyz/developer-docs/irys-sdk/irys-in-the-browser
[Irys]: https://www.irys.xyz/
[Base Faucet]: https://docs.base.org/docs/tools/network-faucets/
[faucets]: https://docs.base.org/docs/tools/network-faucets/
[Base Sepolia]: https://docs.base.org/docs/tools/network-faucets/
[browser]: https://docs.irys.xyz/build/d/irys-in-the-browser
[Coinbase Wallet]: https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad?hl=e
[Download a zip containing PNGs]: https://gateway.irys.xyz/MoOvEzePMwFgc_v6Gw3U8ovV6ostgrkWb9tS4baAJhc
[Irys CLI]: https://docs.irys.xyz/developer-docs/cli
[mutable references]: https://docs.irys.xyz/developer-docs/mutable-references
[Irys CLI]: https://docs.irys.xyz/build/d/storage-cli/installation
[mutability features]: https://docs.irys.xyz/build/d/features/mutability
[Opensea Testnet]: https://testnets.opensea.io/accoun
[Remix]: https://docs.base.org/tutorials/deploy-with-remix
[server]: https://docs.irys.xyz/developer-docs/irys-sdk
[server]: https://docs.irys.xyz/build/d/quickstart
2 changes: 1 addition & 1 deletion apps/base-docs/tutorials/docs/4_intro-to-foundry-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ src = 'contracts'
In order to compile the project, simply run:

```bash
forge build:
forge build
```

## Setting up Foundry with Base
Expand Down
Loading

0 comments on commit e8770ac

Please sign in to comment.