Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Rufusfavour authored Feb 1, 2025
2 parents 76899a3 + 6b85365 commit 44390ea
Show file tree
Hide file tree
Showing 45 changed files with 361 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
Jest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Run Tests
run: |
yarn install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Add a `public` function called `claim`. When called, so long as a number of toke

The `totalClaimed` should be incremented by the claim amount.

Once all tokens have been claimed, this function should revert with an error `AllTokensClaimed`. (We won't be able to test this, but you'll know if it's there!)
Once all tokens have been claimed, this function should revert with the error `AllTokensClaimed`. (We won't be able to test this, but you'll know if it's there!)

### Safe Transfer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You may wish to use another familiar contract to help with this challenge.

## AddressBook

Create an `Ownable` contract called `AddressBook`. In it include:
Create an `Ownable` contract called `AddressBook`. It includes:

- A `struct` called `Contact` with properties for:
- `id`
Expand All @@ -46,7 +46,7 @@ If the `_id` is not found, it should revert with an error called `ContactNotFoun

### Get Contact

The `getContact` function returns the contact information of the supplied `_id` number. It reverts with `ContactNotFound` if the contact isn't present.
The `getContact` function returns the contact information of the supplied `_id` number. It reverts to `ContactNotFound` if the contact isn't present.

:::tip Question

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A contract factory is a contract that creates other contracts. To start, let's c

### Adding the Template

Imagine you want to create a contract that can store its owner's name and compliment them upon request. You can create this contract fairly easily.
Imagine you want to create a contract that can store its owner's name and complement it upon request. You can create this contract fairly easily.

<details>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Luckily, you have options to control these calls a little better.

### Pausing On Blur

Once quick improvement is to simply stop watching the blockchain if the website doesn't have focus. To see this in action, add a state variable to count how many times the function has settled, and one for if the page is focused. You'll also need to set up event listeners to set the state of the latter when the page is focused or blurred.
One quick improvement is to simply stop watching the blockchain if the website doesn't have focus. To see this in action, add a state variable to count how many times the function has settled, and one for if the page is focused. You'll also need to set up event listeners to set the state of the latter when the page is focused or blurred.

```tsx
const [timesCalled, setTimesCalled] = useState(0);
Expand All @@ -106,7 +106,7 @@ Then, update the `watch` for `useBlockNumber` so that it only does so if `pageIs
const { data: blockNumber } = useBlockNumber({ watch: pageIsFocused });
```

Add a line to the `useEffect` for `blockNumber` increment your counter as well.
Add a line to the `useEffect` for `blockNumber` and increment your counter as well.

```tsx
useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Test it out by connecting and disconnecting with your wallet. You should see you

### Connection Status Conditional Rendering

It isn't very nice to display a value of `undefined` to the user, so let's use the connection status values for conditional rendering depending on if the user is disconnected, connected, or connecting.
It isn't very nice to display a value of `undefined` to the user, so let's use the connection status values for conditional rendering depending on whether the user is disconnected, connected, or connecting.

A common pattern is to use the conditional directly in the html return of a component or render function. For example, we could add a line to show that we're connecting as demonstrated:

Expand All @@ -128,7 +128,7 @@ A common pattern is to use the conditional directly in the html return of a comp

Connect and disconnect your wallet a few times. The `isConnecting` state is true while the _Connect to website_ wallet UI is open.

Autoconnect is enabled by default, so you'll need to clear the connection from your wallet settings to see this more than once. Otherwise, it will briefly flash as the autoconnect processes.
Autoconnect is enabled by default, so you'll need to clear the connection from your wallet settings to see this more than once. Otherwise, it will briefly flash as the auto-connect processes.

Use the `connected` property in the same way to only render the wallet address if there is a wallet connected. Similarly, use the `isDisconnected` property to show a message asking the user to connect.

Expand Down
4 changes: 4 additions & 0 deletions apps/base-docs/docs/building-with-base/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ Never share or commit your private key. Always keep it secure and handle with ca

Now that your environment is set up, let's deploy your contracts to Base Sepolia.

:::warning
Before proceeding with deployment, make sure you have enough test ETH in your wallet on Base Sepolia. You can get test ETH from the faucets mentioned earlier in this guide.
:::

1. Use the following command to compile and deploy your contract

```bash
Expand Down
2 changes: 1 addition & 1 deletion apps/base-docs/docs/contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ This page lists contract addresses for onchain apps that we have deployed.
| `v3Migrator` | [0xCbf8b7f80800bd4888Fbc7bf1713B80FE4E23E10](https://sepolia.basescan.org/address/0xCbf8b7f80800bd4888Fbc7bf1713B80FE4E23E10) |
| `v3Staker` | [0x62725F55f50bdE240aCa3e740D47298CAc8d57D5](https://sepolia.basescan.org/address/0x62725F55f50bdE240aCa3e740D47298CAc8d57D5) |
| `quoterV2` | [0xC5290058841028F1614F3A6F0F5816cAd0df5E27](https://sepolia.basescan.org/address/0xC5290058841028F1614F3A6F0F5816cAd0df5E27) |
| `swapRouter` | [0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4](https://sepolia.basescan.org/0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4) |
| `swapRouter` | [0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4](https://sepolia.basescan.org/address/0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4) | |

#### Testnet interfaces

Expand Down
112 changes: 89 additions & 23 deletions apps/base-docs/docs/tokens/wallet.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/base-docs/docs/tools/block-explorers.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ A testnet explorer for [Base Sepolia](https://sepolia.basescan.org/) is also ava

## Routescan

[Routescan](https://superscan.network/) superchain explorer allows you to search for transactions, addresses, tokens, prices and other activities taking place across all Superchain blockchains, including Base.
[Routescan](https://routescan.io) superchain explorer allows you to search for transactions, addresses, tokens, prices and other activities taking place across all Superchain blockchains, including Base.

---

Expand Down
2 changes: 1 addition & 1 deletion apps/base-docs/docs/tools/data-indexers.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ To get started, visit the [documentation](https://docs.envio.dev/docs/overview)

## GhostGraph

[GhostGraph](https://GhostGraph.xyz/) makes it easy to build blazingly fast indexers (subgraphs) for smart contracts.
[GhostGraph](https://ghostgraph.xyz/) makes it easy to build blazingly fast indexers (subgraphs) for smart contracts.

GhostGraph is the first indexing solution that lets you write your index transformations in **Solidity**. Base dApps can query data with GraphQL using our hosted endpoints.

Expand Down
4 changes: 2 additions & 2 deletions apps/base-docs/docs/tools/onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ hide_table_of_contents: true

## Openfort

[Openfort](https://openfort.xyz) is an infrastructure provider designed to simplify the development of games and gamified experiences across their suite of API endpoints. Authenticated users can instantly access the embedded, non-custodial [smart account](https://www.openfort.xyz/docs/guides/accounts/smart) natively in the game and sign blockchain transactions with one button. The Openfort platform is compatible with most EVM chains, including Base.
[Openfort](https://openfort.xyz) is an infrastructure provider designed to simplify the development of games and gamified experiences across their suite of API endpoints. Authenticated users can instantly access the embedded, non-custodial [smart account](https://www.openfort.xyz/docs/guides/javascript/smart-wallet/connected-wallets) natively in the game and sign blockchain transactions with one button. The Openfort platform is compatible with most EVM chains, including Base.

Use [Auth Guide](https://www.openfort.xyz/docs/guides/auth/overview) to allow several onboarding methods into your game regardless of the platform.
Use [Auth Guide](https://www.openfort.xyz/docs/guides/javascript/auth) to allow several onboarding methods into your game regardless of the platform.

---

Expand Down
2 changes: 1 addition & 1 deletion apps/base-docs/docs/using-base.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Using Base
sidebar_position: 1
sidebar_position: 2
slug: /using-base
description: 'How to integrate Base with popular wallets like Coinbase Wallet and MetaMask, covering both mainnet and testnet configurations.'
keywords:
Expand Down
104 changes: 104 additions & 0 deletions apps/base-docs/docs/why-base.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: Why Base
slug: /why-base
sidebar_position: 1
description:
Base provides robust developer tooling, extensive builder support, and a commitment to open access and innovation
for everyone.
keywords:
[
Base,
Ethereum L2,
Coinbase,
onchain economy,
builder grants,
cryptoeconomy,
EVM,
blockchain,
OP Stack,
Optimism,
decentralized apps,
AI,
onchain,
]
hide_table_of_contents: true
---

# Why Base?

## TL;DR

- **Cheap, fast, and open platform:** Base is a globally available platform that provides 1-second and <1-cent transactions to anyone in the world.
- **Access to high-quality tooling:** Builders have access to tools to build incredible onchain experiences for AI, social, media, and entertainment.
- **A place to earn:** Base has delivered over $26M in grants to more than 1,000 builders, with plans to continue supporting more.
- **Reach more users:** Base is committed to helping developers grow their user base by distributing their apps through official Base channels.

---

## A platform for building innovative apps

Base is a global onchain economy of people, builders, and businesses creating the next generation of the open internet. It enables builders to:

- Focus on solving real user problems
- Scale apps globally by default
- Onboard users with a click
- Accept payments from anyone, easily

It’s fast, cheap, and permissionless, meaning anyone can build and use applications on Base.

Base has become the hub for innovative use cases in media, entertainment, social, and even artificial intelligence. [Clanker], an autonomous AI agent on Base, generated more than $13 million in revenue within three months of its inception. As a cultivator of innovation, Base enables developers to focus on improving their products while retaining more of the upside they generate.

Traditional app distribution models often require developers to sacrifice 30% of their revenue to app marketplaces. These platforms may incentivize predatory practices—selling user data or requiring personal information—and can restrict or deny access at their discretion. For instance, someone in Nairobi might be unable to use many U.S.-based fintech services.

In contrast, decentralized finance (DeFi) apps—an onchain development sector—like [Moonwell] allow people anywhere in the world to access financial services directly from their phones. This means someone in Nairobi has the same level of access as someone in the U.S., opening opportunities that were previously inaccessible.

---

## Expansive developer tools

Developers choose Base for its:

- Always-on global payment rail operating at internet speed
- Low transaction costs (often less than a cent)
- Robust developer tooling

But there’s more: Base apps can be launched in hours, not days or weeks, thanks to an extensive suite of tools—many of which are open source. We’re reviving the spirit of innovation where two builders in a garage can create a massively successful business.

Some of the tooling that makes this possible:

- **Smart Wallets:** Onboard your users quickly and securely. Users never have to worry about seed phrases again.
- **Coinbase Developer Platform:** Access specialized developer services for onchain development, such as free node software, sponsored transactions, and other tools to help you fine-tune your application.
- **OnchainKit:** A React component library (TypeScript) to help you build apps faster.
- **Basenames:** More than just human-readable text to replace an address—Basenames are the front page to a builder’s onchain profile.
- **Verifications:** Enable unique experiences for users with verified credentials.

---

## Builder support

More apps mean more compelling reasons for everyone to get onchain. Base is committed to expanding its developer and user community by creating opportunities for apps to go viral. To support this, Base actively distributes apps through its official channels, including Wallet, X, and Warpcast.

Beyond growth, Base is also a place to earn. Since its launch, we have dedicated a portion of our revenue to the Optimism Collective, supporting initiatives like [Retroactive Public Goods Funding (RetroPGF)] and other ecosystem projects.

We have also distributed over $26M in builder grants to more than 1,000 builders. Here are a few ways you can earn on Base:

- **[Builder Grants]:** Small, retroactive grants up to 2 ETH
- **[/base-builds]:** Weekly grants by rounds to Warpcast builders
- **[Optimism RPGF]:** Projects built on Base are eligible for Optimism RPFG
- Other community-driven collaborations through based.management, [Bountycaster], and [Talent Protocol]

Base offers builders access to a high-growth, high-signal community across multiple social platforms, including a Discord server with over 400,000 members, X, and Warpcast. We actively amplify impactful projects on these platforms, helping the community discover new innovations. We believe the developers behind these applications are the key to unlocking an onchain future for everyone.

---

[Basenames]: https://www.base.org/names
[planned]: https://ethereum.org/en/roadmap/
[Solidity]: https://soliditylang.org/
[Bountycaster]: https://www.bountycaster.xyz/
[Builder Grants]: https://docs.google.com/forms/d/e/1FAIpQLSeiSAod4PAbXlvvDGtHWu-GqzGpvHYfaTQR2f77AawD7GYc4Q/viewform
[/base-builds]: https://warpcast.com/base/0xb3f1428b?utm_source=dotorg&urm_medium=builderkit
[Optimism RPGF]: https://round3.optimism.io/projects?after=undefined&display=grid&sort=mostAwarded&search=&seed=1738341430276&categories=
[Talent Protocol]: https://www.talentprotocol.com/
[Moonwell]: https://moonwell.fi/discover
[Clanker]: https://www.clanker.world/
[Retroactive Public Goods Funding (RetroPGF)]: https://round3.optimism.io/projects?after=undefined&display=grid&sort=mostAwarded&search=&seed=1738341430276&categories=
6 changes: 6 additions & 0 deletions apps/base-docs/sidebars.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
developers: [
['why-base'],
['overview'],
['using-base'],
{
Expand Down Expand Up @@ -93,6 +94,11 @@ module.exports = {
collapsed: false,
items: ['security/bounty', 'security/report', 'security/app-blocklist'],
},
{
type: 'link',
label: 'Metrics',
href: 'https://base.org/stats',
},
{
type: 'link',
label: 'Status',
Expand Down
2 changes: 1 addition & 1 deletion apps/base-docs/tutorials/docs/1_1_coinbase-smart-wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ In this tutorial, you've learned how to connect users to your onchain app with t
[Testnet Opensea]: https://testnets.opensea.io/
[deploy]: https://docs.base.org/tutorials?tag=smart%20contracts
[Sepolia Basescan]: https://sepolia.basescan.org/
[BOAT]: https://www.smartwallet.dev/guides/create-app/using-boat
[BOAT]: https://www.smartwallet.dev/guides/create-app/using-onchain-app-template
[wagmi template]: https://www.smartwallet.dev/guides/create-app/using-wagmi
[Coinbase Developer Platform (CDP)]: https://portal.cdp.coinbase.com/
[Base Gasless Campaign]: https://www.smartwallet.dev/base-gasless-campaign
Expand Down
6 changes: 3 additions & 3 deletions apps/base-docs/tutorials/docs/2_1_simple-onchain-nfts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1055,11 +1055,11 @@ contract RandomColorNFT is ERC721 {

---

[Base Camp]: https://base.org.camp
[ERC-721 Tokens]: https://docs.base.org/base-camp/docs/erc-721-token/erc-721-standard-video
[Base Camp]: https://docs.base.org/base-learn/docs/welcome/
[ERC-721 Tokens]: https://docs.base.org/base-learn/docs/erc-721-token/erc-721-standard-video/
[IPFS]: https://ipfs.tech/
[Base64]: https://en.wikipedia.org/wiki/Base64
[Hardhat and Hardhat Deploy]: https://docs.base.org/base-camp/docs/hardhat-deploy/hardhat-deploy-sbs
[Hardhat and Hardhat Deploy]: https://docs.base.org/base-learn/docs/hardhat-deploy/hardhat-deploy-sbs
[testnet version of Opensea]: https://testnets.opensea.io/
[sample project]: https://github.com/base-org/land-sea-and-sky
[Sample Art]: https://github.com/base-org/land-sea-and-sky/tree/master/Final_SVGs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -773,9 +773,8 @@ In this article, we've explored the transformative potential of Account Abstract
[Base Learn]: https://base.org/learn
[Next.js]: https://nextjs.org/
[Base Paymaster]: https://github.com/base-org/paymaster
[Privy]: https://www.privy.dev/
[Privy]: https://www.privy.io/
[Alchemy's Account Kit]: https://www.alchemy.com/account-kit
[Privy]: https://www.privy.dev/
[https://docs.privy.io/guide/frontend/embedded/overview]: https://docs.privy.io/guide/frontend/embedded/overview
[Alchemy's Account Kit]: https://www.alchemy.com/account-kit
[Privy's Quick Start]: https://docs.privy.io/guide/quickstart
Expand Down
4 changes: 2 additions & 2 deletions apps/base-docs/tutorials/docs/5_cross-chain-with-layerzero.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ abstract contract OApp is OAppSender, OAppReceiver {

:::info

You can view the source code for this contract on [GitHub](https://github.com/LayerZero-Labs/LayerZero-v2/blob/main/oapp/contracts/oapp/OApp.sol).
You can view the source code for this contract on [GitHub](https://github.com/LayerZero-Labs/LayerZero-v2/blob/main/packages/layerzero-v2/evm/oapp/contracts/oapp/OApp.sol).

:::

To get started using LayerZero, developers simply need to inherit from the [OApp](https://github.com/LayerZero-Labs/LayerZero-v2/blob/main/oapp/contracts/oapp/OApp.sol) contract, and implement the following two inherited functions:
To get started using LayerZero, developers simply need to inherit from the [OApp](https://github.com/LayerZero-Labs/LayerZero-v2/blob/main/packages/layerzero-v2/evm/oapp/contracts/oapp/OApp.sol) contract, and implement the following two inherited functions:

- `_lzSend`: A function used to send an omnichain message
- `_lzReceive`: A function used to receive an omnichain message
Expand Down
12 changes: 12 additions & 0 deletions apps/web/app/(base-org)/jobs/JobsScript.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use client';

import Script from 'next/script';

export default function JobsScript() {
return (
<Script
src="//jsv3.recruitics.com/0778138b-cc59-11ef-a514-fd1759833eec.js"
id="recruitics-jobs-script"
/>
)
}
2 changes: 2 additions & 0 deletions apps/web/app/(base-org)/jobs/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import JobsScript from 'apps/web/app/(base-org)/jobs/JobsScript';
import Container from 'apps/web/src/components/base-org/Container';
import Title from 'apps/web/src/components/base-org/typography/Title';
import { TitleLevel } from 'apps/web/src/components/base-org/typography/Title/types';
Expand Down Expand Up @@ -34,6 +35,7 @@ export default async function Jobs() {

return (
<main className="flex w-full grow flex-col items-center pt-20">
<JobsScript />
<Container>
<section className="mb-[140px] flex w-full flex-col pb-10 pt-20 ">
<Title level={TitleLevel.Display3}>Join our team</Title>
Expand Down
5 changes: 3 additions & 2 deletions apps/web/contexts/Analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import logEvent, {
ActionType,
AnalyticsEventImportance,
CCAEventData,
AnalyticsContext,
} from 'libs/base-ui/utils/logEvent';
import { ReactNode, createContext, useCallback, useContext, useMemo } from 'react';

Expand All @@ -29,7 +30,7 @@ export function useAnalytics() {

type AnalyticsProviderProps = {
children?: ReactNode;
context: string; // TODO: This could be an enum in CCAEventData
context: AnalyticsContext;
};

export default function AnalyticsProvider({ children, context }: AnalyticsProviderProps) {
Expand All @@ -41,7 +42,7 @@ export default function AnalyticsProvider({ children, context }: AnalyticsProvid
const sanitizedEventName = eventName.toLocaleLowerCase();
if (typeof window === 'undefined') return;
logEvent(
sanitizedEventName, // TODO: Do we want context here?
sanitizedEventName,
{
action: action,
context: fullContext,
Expand Down
Loading

0 comments on commit 44390ea

Please sign in to comment.