Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ The first time you do this, your wallet will ask you to confirm that you want to
Once you are connected, you'll see the name of the network below the _Environment_ dropdown.

<Frame>
![Connected](/images/learn/deployment-to-testnet/remix-base-goerli-connected.png)
![Connected](/images/learn/deployment-to-testnet/remix-base-sepolia-connected.png)
</Frame>

For Base Sepolia, you should see `Custom (84532) network`. The old network, Goerli, was `84531`. If you don't see the correct network, change the active network in your wallet.
For Base Sepolia, you should see `Custom (84532) network`. If you don't see the correct network, change the active network in your wallet to Base sepolia.

### Deploy the Contract

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ Stay tuned for updates!
<Note>
#### Hey, where'd my NFT go!?

[Testnets](/learn/deployment-to-testnet/test-networks) are not permanent! Base Goerli [will soon be sunset](https://base.mirror.xyz/kkz1-KFdUwl0n23PdyBRtnFewvO48_m-fZNzPMJehM4), in favor of Base Sepolia.
[Testnets](/learn/deployment-to-testnet/test-networks) Base Sepolia (https://base.mirror.xyz/kkz1-KFdUwl0n23PdyBRtnFewvO48_m-fZNzPMJehM4), is now the active test network and replaces the older testnets.
Since these are separate networks with different data, your NFTs will not automatically transfer over.

As these are separate networks with separate data, your NFTs **will not** transfer over.
Don’t worry!
We’ve already collected the addresses of all NFT owners from the previous testnet.
When we release the mechanism to transfer these NFTs to mainnet later this year, all of those addresses will be included.

**Don't worry!** We've captured the addresses of all NFT owners on Base Goerli and will include them when we release the mechanism to transfer these NFTs to mainnet later this year! You can also redeploy on Sepolia and resubmit if you'd like!
</Note>
If you’d like, you can also redeploy your NFTs on Base Sepolia and resubmit them.
</Note>


{/* <CafeUnitTest nftNum={1}/> */}
Expand Down
6 changes: 3 additions & 3 deletions docs/learn/deployment-to-testnet/test-networks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This article provides a concise overview of Base test networks, highlighting the
By the end of this lesson you should be able to:

- Describe the uses and properties of the Base testnet
- Compare and contrast Ropsten, Rinkeby, Goerli, and Sepolia
- Compare and contrast Ropsten, Rinkeby, and Sepolia

---

Expand Down Expand Up @@ -73,9 +73,9 @@ Several well-known testnets have emerged over the years, each with its own set o

- **Rinkeby:** Rinkeby offered better security than Ropsten and used a proof-of-authority consensus mechanism. However, it lacked decentralization and client diversity, which ultimately led to its decline in popularity. After the Merge, Rinkeby is no longer a recommended test network.

- **Goerli:** Launched in early 2019, Goerli initially utilized a multi-client proof-of-authority consensus model to improve stability and security. Following the Merge, it transitioned to a proof-of-stake consensus mechanism, maintaining its cross-client compatibility and making it an ideal choice for developers. As of January 2024, Goerli is being sunset in favor of Sepolia.
- **Sepolia:** Sepolia was created in October 2021 by Ethereum core developers as a testnet, originally under a proof-of-authority consensus model.

- **Sepolia:** As one of the two original primary testnets alongside Goerli, Sepolia is designed for developers seeking a lighter weight chain for faster synchronization and interaction. As of January 2024, it is now the preferred testnet and developers should migrate to using it.
- **Sepolia:** As one of the two original primary testnets, Sepolia is designed for developers seeking a lighter weight chain for faster synchronization and interaction. As of January 2024, it is now the preferred testnet and developers should migrate to using it.

### L2 Testnets

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ This tutorial requires you to have a wallet. You can create a wallet by download

### Wallet funds

To complete this tutorial, you will need to fund a wallet with ETH on Base Goerli.
To complete this tutorial, you will need to fund a wallet with ETH on Base sepolia.

The ETH is required for covering gas fees associated with deploying smart contracts to the network.

- To fund your wallet with ETH on Base Goerli, visit a faucet listed on the [Base Faucets](https://docs.base.org/base-chain/tools/network-faucets) page.
- To fund your wallet with ETH on Base sepolia, visit a faucet listed on the [Base Faucets](https://docs.base.org/base-chain/tools/network-faucets) page.

## What is Biconomy?

Expand Down Expand Up @@ -151,20 +151,20 @@ cast wallet list
To deploy the smart contract, you can use the `forge create` command. The command requires you to specify the smart contract you want to deploy, an RPC URL of the network you want to deploy to, and the account you want to deploy with.

<Info>
Your wallet must be funded with ETH on the Base Goerli testnet to cover the gas fees associated with the smart contract deployment. Otherwise, the deployment will fail.
Your wallet must be funded with ETH on the Base sepolia testnet to cover the gas fees associated with the smart contract deployment. Otherwise, the deployment will fail.

To get testnet ETH, see the [prerequisites](#prerequisites).
</Info>

To deploy the smart contract to the Base Goerli testnet, run the following command:
To deploy the smart contract to the Base sepolia testnet, run the following command:

```bash
forge create ./src/Counter.sol:Counter --rpc-url https://goerli.base.org --account deployer
forge create ./src/Counter.sol:Counter --rpc-url https://sepolia.base.org --account deployer
```

When prompted, enter the password that you set earlier, when you imported your wallet's private key.

After running the command above, the contract will be deployed on the Base Goerli test network. You can view the deployment status and contract by using a [block explorer](/base-chain/tools/block-explorers).
After running the command above, the contract will be deployed on the Base sepolia test network. You can view the deployment status and contract by using a [block explorer](/base-chain/tools/block-explorers).

## Setting up the Paymaster and Bundler

Expand All @@ -177,7 +177,7 @@ Add and register a Paymaster by completing the following steps:
1. Visit the sign in to the [Biconomy Dashboard](https://dashboard.biconomy.io/)
1. From the dashboard, select the **Paymasters** tab and click **Add your first Paymaster**
1. Provide a **Name** for your paymaster
1. Select **Base Goerli** from the **Network** dropdown
1. Select **Base sepolia** from the **Network** dropdown
1. Click **Register**

You should now have a registered Biconomy paymaster.
Expand Down Expand Up @@ -217,7 +217,7 @@ Set up and fund the paymaster's gas tank by completing the following steps:
1. From the dashboard, select the **Bundlers** tab

<Info>
At the time of writing this tutorial, the Bundler service is still under development, however a **Bundler URL** is provided for testing out UserOperations on test networks. You can specify the chain ID **84531** to use the Bundler URL on **Base Goerli** testnet.
At the time of writing this tutorial, the Bundler service is still under development, however a **Bundler URL** is provided for testing out UserOperations on test networks. You can specify the chain ID **84531** to use the Bundler URL on **Base sepolia** testnet.
</Info>

## Setting up the frontend
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ This address is the [bundler], which is a special node that bundles user operati

#### EntryPoint

The EntryPoint contract for Base Goerli is located at `0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789`. Strangely, in your transaction receipt you'll see that the transaction includes a transfer of ETH **from** the EntryPoint **to** the bundler. This transaction is how the bundler gets compensated for performing the service of bundling user ops and turning them into transactions -- the EntryPoint calculates the gas used by user ops and multiplies that by the fee percentage and send it to the bundler.
The EntryPoint contract for Base sepolia is located at `0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789`. Strangely, in your transaction receipt you'll see that the transaction includes a transfer of ETH **from** the EntryPoint **to** the bundler. This transaction is how the bundler gets compensated for performing the service of bundling user ops and turning them into transactions -- the EntryPoint calculates the gas used by user ops and multiplies that by the fee percentage and send it to the bundler.

### Review the Example Code

Expand All @@ -425,7 +425,7 @@ Starting on line 63, the exported `SmartAccountProvider` does the following:

1. Fetch the user's wallets and find their Privy wallet. This wallet is provided, and if need be created, by the `PrivyProvider`
1. Set up state variables to manage and share connection status and the smart account itself
1. Initialize an RPC client for the [Base Paymaster] (on Goerli). The URL is hardcoded in `lib/constants.ts`
1. Initialize an RPC client for the [Base Paymaster] (on sepolia). The URL is hardcoded in `lib/constants.ts`
1. Initialize an ERC-4337 RPC client for Alchemy's network. This network is where the bundler address comes from
1. Create a smart wallet. In this case, the `signer` is your EOA embedded wallet created by Privy and fetched in the first step
1. The EOA address is displayed in the example app as `YOUR SIGNER ADDRESS`
Expand Down Expand Up @@ -456,13 +456,13 @@ When a user clicks, the app first creates a viem `RpcTransactionRequest` for the
}
```

The app then updates the toast component to update the users while it `await`s first the `userOpHash`, then the `transactionHash`, indicating that transaction has completed successfully. It then updates the link in the toast to send the user to that transaction on Goerli BaseScan.
The app then updates the toast component to update the users while it `await`s first the `userOpHash`, then the `transactionHash`, indicating that transaction has completed successfully. It then updates the link in the toast to send the user to that transaction on sepolia BaseScan.

### Implementing the Paymaster in your own App

Create a new project using Privy's [`create-next-app`] template, and complete the setup instructions in the readme.

Add an environment variable for `NEXT_PUBLIC_ALCHEMY_API_KEY` and paste in the an API key for a Base Goerli app. If you need a key, go to [add an app] and create a new one.
Add an environment variable for `NEXT_PUBLIC_ALCHEMY_API_KEY` and paste in the an API key for a Base sepolia app. If you need a key, go to [add an app] and create a new one.

#### Copying and Updating the Source Files

Expand Down Expand Up @@ -514,7 +514,7 @@ useEffect(() => {

#### Configuring the PrivyProvider and Adding SmartAccountProvider

By default, the `PrivyProvider` allows logging in with a wallet or email address. To limit it to only the wallet, update the config. You can also set the default chain here. You'll need to import `baseGoerli` to do so.
By default, the `PrivyProvider` allows logging in with a wallet or email address. To limit it to only the wallet, update the config. You can also set the default chain here. You'll need to import `basesepolia` to do so.

You also need to import and wrap the app with `SmartAccountProvider`, imported from `hooks/SmartAccountContext.tsx`.

Expand All @@ -534,7 +534,7 @@ Its instance type 'SmartAccountProvider<Transport>' is not a valid JSX element.
onSuccess={() => router.push('/dashboard')}
config={{
loginMethods: ['wallet'],
defaultChain: baseGoerli,
defaultChain: baseSepolia,
}}
>
<SmartAccountProvider>
Expand All @@ -553,7 +553,7 @@ Grab the snippet from the original demo that displays the user's addresses, and
</p>
<a
className="mt-2 text-sm text-zinc-500 hover:text-violet-600"
href={`${BASE_GOERLI_SCAN_URL}/address/${smartAccountAddress}#tokentxnsErc721`}
href={`${BASE_SEPOLIA_SCAN_URL}/address/${smartAccountAddress}#tokentxnsErc721`}
>
{smartAccountAddress}
</a>
Expand All @@ -562,15 +562,16 @@ Grab the snippet from the original demo that displays the user's addresses, and
</p>
<a
className="mt-2 text-sm text-zinc-500 hover:text-violet-600"
href={`${BASE_GOERLI_SCAN_URL}/address/${eoa?.address}`}
href={`${BASE_SEPOLIA
_SCAN_URL}/address/${eoa?.address}`}
>
{eoa?.address}
</a>
```

Paste it above the `<p>` for the `User Object` window.

You'll need to import `BASE_GOERLI_SCAN_URL` from `constants.ts`. The `useSmartAccount` hook returns `smartAccountProvider` and `eoa`. Import it and add it under the `usePrivy` hook. You don't need them just yet, but go ahead and decompose `smartAccountProvider` and `sendSponsoredUserOperation` as well:
You'll need to import `BASE_SEPOLIA_SCAN_URL` from `constants.ts`. The `useSmartAccount` hook returns `smartAccountProvider` and `eoa`. Import it and add it under the `usePrivy` hook. You don't need them just yet, but go ahead and decompose `smartAccountProvider` and `sendSponsoredUserOperation` as well:

```tsx
const router = useRouter();
Expand Down Expand Up @@ -604,7 +605,7 @@ The app sometimes gets confused with login state after you've made changes to `c

#### Calling a Smart Contract Function

You've adjusted the foundation of the app to allow you to use the Base Goerli Paymaster with your normal wallet as the signer. Now, it's time to call a smart contract function.
You've adjusted the foundation of the app to allow you to use the Base sepolia Paymaster with your normal wallet as the signer. Now, it's time to call a smart contract function.

Start by using the `mint` function in the original example. In the `DashboardPage` component, add a state variable holding an empty element:

Expand Down Expand Up @@ -639,7 +640,7 @@ const onMint = async () => {
const transactionHash = await smartAccountProvider.waitForUserOperationTransaction(userOpHash);

setTransactionLink(
<a href={`${BASE_GOERLI_SCAN_URL}/tx/${transactionHash}`}>
<a href={`${BASE_SEPOLIA_SCAN_URL}/tx/${transactionHash}`}>
Successfully minted! Click here to see your transaction.
</a>,
);
Expand Down Expand Up @@ -672,7 +673,7 @@ For simplicity, we've stripped out the code to disable the button while it is mi

#### Calling Another Function

The [Base Paymaster] on Goerli is very permissive. To call another function, all you need to do is to change the `RpcTransactionRequest` in `sendSponsoredUserOperation` to match the address, abi, function name, and arguments of your function on your smart contract.
The [Base Paymaster] on Sepolia is very permissive. To call another function, all you need to do is to change the `RpcTransactionRequest` in `sendSponsoredUserOperation` to match the address, abi, function name, and arguments of your function on your smart contract.

For example, to call the `claim` function in the Weighted Voting contract we've used in other tutorials, you'd simply need to import the Hardhat-style [artifact] for the contract and use it to call the function:

Expand Down Expand Up @@ -712,8 +713,8 @@ In this article, we've explored the transformative potential of Account Abstract
[securely stored]: https://docs.privy.io/guide/security#user-data-management
[paymaster example]: https://github.com/privy-io/base-paymaster-example/blob/main/README.md
[ERC-4337]: https://eips.ethereum.org/EIPS/eip-4337
[NFT Contract]: https://goerli.basescan.org/address/0x6527e5052de5521fe370ae5ec0afcc6cd5a221de
[view for the contract itself]: https://goerli.basescan.org/address/0x6527e5052de5521fe370ae5ec0afcc6cd5a221de
[NFT Contract]: https://sepolia.basescan.org/address/0x6527e5052de5521fe370ae5ec0afcc6cd5a221de
[view for the contract itself]: https://sepolia.basescan.org/address/0x6527e5052de5521fe370ae5ec0afcc6cd5a221de
[Base Paymaster]: https://github.com/base-org/paymaster
[EntryPoint]: https://github.com/eth-infinitism/account-abstraction/releases
[bundler]: https://www.alchemy.com/overviews/what-is-a-bundler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ This tutorial assumes you have:
Foundry is a development environment, testing framework, and smart contract toolkit for Ethereum. You’ll need it installed locally for generating key pairs and interacting with smart contracts.

> **Testnet vs. Mainnet**
> If you prefer not to spend real funds, you can switch to **Base Goerli** (testnet). The steps below are conceptually the same. Just select _Base Goerli_ in the Coinbase Developer Platform instead of _Base Mainnet_, and use a contract deployed on Base testnet for your allowlisted methods.

> If you prefer not to spend real funds, you can switch to Base Sepolia (testnet). The steps below are conceptually the same. Just select Base Sepolia in the Coinbase Developer Platform instead of Base Mainnet, and use a contract deployed on Base testnet for your allowlisted methods.
## Set Up a Base Paymaster & Bundler

In this section, you will configure a Paymaster to sponsor payments on behalf of a specific smart contract for a specified amount.
Expand All @@ -55,7 +54,7 @@ In this section, you will configure a Paymaster to sponsor payments on behalf of

### Allowlist a Sponsorable Contract

1. From the Configuration page, ensure **Base Mainnet** (or **Base Goerli** if you’re testing) is selected.
1. From the Configuration page, ensure **Base Mainnet** (or **Base Sepolia** if you’re testing) is selected.
2. Enable your paymaster by clicking the toggle button.
3. Click **Add** to add an allowlisted contract.
4. For this example, add [`0x83bd615eb93eE1336acA53e185b03B54fF4A17e8`][simple NFT contract], and add the function `mintTo(address)`.
Expand Down
Loading