Skip to content

Commit

Permalink
Merge branch 'base-org:master' into docs/update-particle-tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
soos3d authored Jan 17, 2025
2 parents a704c2f + d67d5c2 commit 128a677
Show file tree
Hide file tree
Showing 266 changed files with 6,011 additions and 3,605 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
// We utilize class properties
'react/state-in-constructor': 'off',

// Dont use prop types since were using TypeScript
// Dont use prop types since we are using TypeScript
'react/default-props-match-prop-types': 'off',
'react/forbid-foreign-prop-types': 'off',
'react/forbid-prop-types': 'off',
Expand Down Expand Up @@ -135,7 +135,7 @@ module.exports = {
'@typescript-eslint/prefer-string-starts-ends-with': 'error',

// Hard to migrate
// Errors for all try/catch blocks and any types from third-parties
// Errors for all try/catch blocks and any types from third parties
'@typescript-eslint/no-unsafe-member-access': 'off',
},
};
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/docs_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ body:
id: other
attributes:
label: Additional context
description: Add any other context or screenshots about the concern can be added here.
description: Add any additional context or screenshots about the concern here.
107 changes: 107 additions & 0 deletions .github/workflows/file-size-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: File Size Checker

# Add required permissions
permissions:
contents: read
pull-requests: write
statuses: write

on:
pull_request:
types: [opened, synchronize]

jobs:
check-file-sizes:
name: File Size Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check file sizes
id: check-sizes
run: |
# Initialize variables for tracking findings
large_files=""
huge_files=""
# Get all files in the PR
echo "Files changed in PR:"
git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
for file in $(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}); do
if [ -f "$file" ]; then
size=$(stat -c%s "$file")
size_mb=$(echo "scale=2; $size/1048576" | bc)
echo "Checking $file: ${size_mb}MB"
# Check for files over 40MB
if (( $(echo "$size_mb > 40" | bc -l) )); then
huge_files="${huge_files}* ${file} (${size_mb}MB)\n"
# Check for files over 10MB
elif (( $(echo "$size_mb > 10" | bc -l) )); then
large_files="${large_files}* ${file} (${size_mb}MB)\n"
fi
fi
done
# Print findings for debugging
echo "Large files found:"
echo -e "$large_files"
echo "Huge files found:"
echo -e "$huge_files"
# Set outputs for use in next steps
echo "large_files<<EOF" >> $GITHUB_OUTPUT
echo -e "$large_files" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "huge_files<<EOF" >> $GITHUB_OUTPUT
echo -e "$huge_files" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# Fail if huge files are found
if [ ! -z "$huge_files" ]; then
echo "❌ Files over 40MB found!"
exit 1
fi
- name: Update Status and Comment
if: always()
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const hugeFiles = `${{ steps.check-sizes.outputs.huge_files }}`;
const largeFiles = `${{ steps.check-sizes.outputs.large_files }}`;
try {
// Only comment if issues were found
if (hugeFiles || largeFiles) {
let comment = '## ⚠️ File Size Check Results\n\n';
if (hugeFiles) {
comment += '### 🚫 Files over 40MB (Not Allowed):\n' + hugeFiles + '\n';
comment += '**These files must be removed from git history before the PR can be merged.**\n\n';
}
if (largeFiles) {
comment += '### ⚠️ Large Files (Over 10MB):\n' + largeFiles + '\n';
comment += 'Consider reducing the size of these files if possible.\n';
}
await github.rest.issues.createComment({
issue_number: context.payload.pull_request.number,
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
body: comment
});
}
} catch (error) {
console.error('Error:', error);
core.setFailed(error.message);
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ out/
!.yarn/sdks
!.yarn/versions
.pnp.*
# prevent people from accidentally commiting a package-lock
# prevent people from accidentally committing a package-lock
package-lock.json

# Env files
Expand Down
13 changes: 10 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
// Prettier
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true, // use ⌘-K S to format without saving
"editor.formatOnSave": true, // use ⌘-K S (or Ctrl-K S) to format without saving

// Disable built-in formatters
"html.format.enable": false,
Expand All @@ -15,8 +15,15 @@
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},

// ESLint
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": ["source.fixAll.eslint"],
"eslint.packageManager": "yarn",
"eslint.useESLintClass": true,
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The following is a set of guidelines for contributing to Base Web. These are jus

## Code of Conduct

This project and everyone participating in it are governed by our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
This project and everyone participating in it is governed by our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.

## How Can I Contribute?

Expand Down
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Base is a secure, low-cost, developer-friendly Ethereum L2 built to bring the ne

## Setup

1. Ensure `nvm` is [installed](https://github.com/nvm-sh/nvm#install--update-script).
1. Ensure that `nvm` is [installed](https://github.com/nvm-sh/nvm#install--update-script).
2. Clone the repository.
3. If `nvm` doesn't auto-load the Node.js environment when changing to the repo directory, run `nvm use`.
4. Enable Yarn by running `corepack enable`.
Expand Down Expand Up @@ -71,7 +71,7 @@ yarn workspace @app/bridge dev

## Contributing

We welcome contributions to Base! To contribute, please see [CONTRIBUTING.md](CONTRIBUTING.md).
We welcome contributions to Base! For guidelines on how to contribute please refer to [CONTRIBUTING.md](CONTRIBUTING.md).

### Updating the Base Ecosystem Page

Expand All @@ -81,38 +81,47 @@ If you're a builder who wants to add or update your project on the [Base Ecosyst

2. Create a new branch for your changes.

3. Update the `web/apps/web/src/data/ecosystem.json` with your project information. All fields are required. Each entry should follow this format:
3. Update the `web/apps/web/src/data/ecosystem.json` with your project information. All fields are required. Each entry should follow the format below:

```json
{
"name": "Your Project Name",
"tags": ["category"],
"description": "A brief description of your project (less than 200 characters)",
"url": "https://your-project-url.com",
"imageUrl": "/images/partners/your-project-logo.png"
"imageUrl": "/images/partners/your-project-logo.png",
"category": "Your Project Category",
"subcategory": "Your Project Subcategory"
}
```

- name: Your project's name
- tags: An array with _one_ of the following categories: `bridge`, `dao`, `defi`, `gaming`, `infra`, `nft`, `onramp`, `social`, `wallet`, `security`
- description: A brief description of your project, must be less than 200 characters
- url: Your project's website URL
- imageUrl: Path to your project's logo image
- category: Your project's category, _one_ of: `consumer`, `defi`, `infra`, `onramp`, `wallet`
- subcategory: Your project's subcategory, with the following options associated with each category
- `consumer`: _One_ of `creator`, `crypto taxes`, `dao`, `gaming`, `messaging`, `music`, `nft`, `payments`, `real world`, `social`
- `defi`: _One_ of `dex`, `dex aggregator`, `insurance`, `lending/borrowing`, `liquidity management`, `portfolio`, `stablecoin`, `yield vault`
- `infra`: _One_ of `ai`, `bridge`, `data`, `depin`, `developer tool`, `identity`, `node provider`, `raas`, `security`
- `onramp`: _One_ of `centralized exchange`, `fiat on-ramp`
- `wallet`: _One_ of `account abstraction`, `multisig`, `self-custody`

4. When adding and/or updating a logo, place a 192x192 pixel PNG file in the `web/apps/web/public/images/partners/`. The file should be named appropriately (e.g., your-project-name.png). The logo should be an App Store or Play Store iconographic version, not a full wordmark.

5. Create a pull request with your changes.

By opening a PR to add your project, you authorize and license to Coinbase on a non-exclusive, worldwide, irrevocable, sublicensable, and royalty free basis to reproduce, distribute, transmit, make available, perform, display, or otherwise use the submitted Multimedia Assets for any purpose, including any marketing or promotional activities related to Base or Coinbase. Any goodwill associated with use of trademarks submitted in your Multimedia Assets will inure to your benefit. You further acknowledge and represent that you have all IP rights in the Multimedia Assets, that the Multimedia Assets do not infringe the rights of any third party, and that you have the right to grant this license to Coinbase.
By opening a PR to add your project, you authorize and license Coinbase on a non-exclusive, worldwide, irrevocable, sublicensable, and royalty-free basis to reproduce, distribute, transmit, make available, perform, display, or otherwise use the submitted Multimedia Assets for any purpose, including any marketing or promotional activities related to Base or Coinbase. Any goodwill associated with use of trademarks submitted in your Multimedia Assets will inure to your benefit. You further acknowledge and represent that you have all IP rights in the Multimedia Assets, that the Multimedia Assets do not infringe the rights of any third party, and that you have the right to grant this license to Coinbase.

**Note:** Submissions do not guarantee inclusion and all submissions are subject to review. Your project must be live on Base to potentially be included. Ensure all information is accurate and up-to-date.

#### Tips for a successful submission
#### Submission requirements

- App content adheres to the [Base Editorial Style Guide](https://github.com/base-org/brand-kit/blob/main/guides/editorial-style-guide.md)
- App has been live on Base for at least 30 days
- App has a Terms of Service and Privacy Policy
- App supports HTTPS and 301 redirects HTTP requests
- App is not a TGE, ICO, airdrop, claim, or similar
- App is not a TGE (Token Generation Event), ICO (Initial Coin Offering), airdrop, claim, or similar
- Landing page is a Base-specific page for users who will becoming from base.org
- Active development and community engagement can be observed without issue

---
Expand Down
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.
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 @@ -20,7 +20,7 @@ By the end of this lesson you should be able to:

By default, `public` functions can be called by **anyone**, without restriction. Often this is desirable. You want any user to be able to see what NFTs are for sale on your platform, sign up for a service, or read various items stored in state.

However, there will be many functions you **don't** want any user to be able to do, such as setting the fee for using the app, or withdrawing all of the funds in the contract! A common pattern to protect these functions is to use `modifier`s to make sure that only the owner can call these functions.
However, there will be many functions you **don't** want any user to be able to do, such as setting the fee for using the app, or withdrawing all funds in the contract! A common pattern to protect these functions is to use `modifier`s to make sure that only the owner can call these functions.

:::caution

Expand Down
2 changes: 1 addition & 1 deletion apps/base-docs/base-learn/docs/arrays/arrays-exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Write a function called `appendToNumbers` that takes a `uint[] calldata` array c

At the contract level, add an `address` array called `senders` and a `uint` array called `timestamps`.

Write a function called `saveTimestamp` that takes a `uint` called `_unixTimestamp` as an argument. When called, it should add the address of the caller to the end of `senders` and the `_unixTimeStamp` to `timestamps`.
Write a function called `saveTimestamp` that takes a `uint` called `_unixTimestamp` as an argument. When called, it should add the address of the caller to the end of `senders` and the `_unixTimestamp` to `timestamps`.

:::tip

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ contract StorageArray {

You cannot use a `storage` array as a function parameter, and you cannot write a function that `return`s a `storage` array.

Storage arrays are dynamic, unless they are declared with an explicit size. However, their functionality is limited compared to other languages. The `.push(value)` function works as expected. the `.pop()` function removes the last value of an array, but it **does not** return that value. You also **may not** use `.pop()` with an index to remove an element from the middle of an array, or to remove more than one element.
Storage arrays are dynamic, unless they are declared with an explicit size. However, their functionality is limited compared to other languages. The `.push(value)` function works as expected. The `.pop()` function removes the last value of an array, but it **does not** return that value. You also **may not** use `.pop()` with an index to remove an element from the middle of an array, or to remove more than one element.

You can use the `delete` keyword with an array. Doing so on an entire array will reset the array to zero length. Calling it on an element within the array will reset that value to its default. It **will not** resize the array!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The simple and obvious solution is to simply iterate through `numbers` and count
Go ahead and write it on your own. It needs to:

- Instantiate a `uint` to hold the results
- Iterate through all of the values in `numbers` and increment that number if the value is even
- Iterate through all values in `numbers` and increment that number if the value is even
- Return the result

You should end up with something like:
Expand Down Expand Up @@ -170,7 +170,7 @@ uint[] public numbers;
uint numEven;
```

Add a new function called `debugLoadArray` that takes a `uint` called `_number` as an argument, and fills the array by looping through `_numbers` times, pushing each number into the array. **For now, _don't_ update `numEven`**.
Add a new function called `debugLoadArray` that takes a `uint` called `_number` as an argument, and fills the array by looping through `_number` times, pushing each number into the array. **For now, _don't_ update `numEven`**.

<details>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ A function called `adder`. It must:

- Accept two `uint` arguments, called `_a` and `_b`
- Return a `uint` `sum` and a `bool` `error`
- If `_a` + `_b` do not overflow, it should return the `sum` and an `error` of `false`
- If `_a` + `_b` overflow, it should return `0` as the `sum`, and an `error` of `true`
- If `_a` + `_b` does not overflow, it should return the `sum` and an `error` of `false`
- If `_a` + `_b` overflows, it should return `0` as the `sum`, and an `error` of `true`

### Subtractor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Is `public` the most appropriate [visibility specifier]?

It would work, but you won't be calling this function from within the contract, so `external` is more appropriate.

You also need to specify a return type, and we've decided this function should return a string. You'll learn more about this later, but in Solidity, many of the more complex types require you to specify if they are `storage` or `memory`. You can then have your function return a string of `"Hello World!`.
You also need to specify a return type, and we've decided this function should return a string. You'll learn more about this later, but in Solidity, many of the more complex types require you to specify if they are `storage` or `memory`. You can then have your function return a string of `"Hello World!"`.

Don't forget your semicolon. They're mandatory in Solidity!

Expand Down Expand Up @@ -136,7 +136,7 @@ function Greeter(string memory _name) external pure returns (string memory) {

Unfortunately, this does not work in Solidity. The error message you receive is a little confusing:

> TypeError: Operator + not compatible with types literal_string "Hello " and string memory.
> TypeError: Operator + not compatible with types literal_string "Hello" and string memory.
You might think that there is some sort of type casting or conversion error that could be solved by explicitly casting the string literal to string memory, or vice versa. This is a great instinct. Solidity is a very explicit language.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Verify your contract and interact with it.
hide_table_of_contents: false
---

Once your contract is deployed, you can verify it using a number of popular services. Doing so will let you users have confidence that your contract does what you claim, and will allow you to interact with it using a similar interface to what you used in Remix.
Once your contract is deployed, you can verify it using a number of popular services. Doing so will let your users have confidence that your contract does what you claim, and will allow you to interact with it using a similar interface to what you used in Remix.

---

Expand Down Expand Up @@ -46,7 +46,7 @@ Click the linked address to your contract to return to the contract page. You'll

:::tip

If you have imports, you'll need to right click on the name of the file and choose `Flatten`. Submit the newly generated `filename_flattened.sol` for verification.
If you have imports, you'll need to right-click on the name of the file and choose `Flatten`. Submit the newly generated `filename_flattened.sol` for verification.

:::

Expand All @@ -69,7 +69,7 @@ With your contracts verified, you can interact with them using online tools and
[`sepolia.basescan.org`]: https://sepolia.basescan.org/
[coinbase]: https://www.coinbase.com/wallet
[faucet]: https://docs.base.org/tools/network-faucets
[set up]: https://www.youtube.com/watch?v=CZDgLG6jpgw
[set up]:
[coinbase settings]: https://docs.cloud.coinbase.com/wallet-sdk/docs/developer-settings
[BaseScan]: https://sepolia.basescan.org/
[faucets on the web]: https://coinbase.com/faucets
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ You now have the power to put smart contracts on the blockchain! You've only dep
[coinbase]: https://www.coinbase.com/wallet
[metamask]: https://metamask.io/
[faucet]: https://docs.base.org/tools/network-faucets
[set up]: https://www.youtube.com/watch?v=CZDgLG6jpgw
[set up]:
[coinbase settings]: https://docs.cloud.coinbase.com/wallet-sdk/docs/developer-settings
[Metamask Settings]: https://support.metamask.io/hc/en-us/articles/13946422437147-How-to-view-testnets-in-MetaMask
[BaseScan]: https://sepolia.basescan.org/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ The ERC-20 is a standard that allows for the development of fungible tokens and

By the end of this lesson you should be able to:

- Describe OpenZepplin
- Import the OpenZepplin ERC-20 implementation
- Describe OpenZeppelin
- Import the OpenZeppelin ERC-20 implementation
- Describe the difference between the ERC-20 standard and OpenZeppelin's ERC20.sol
- Build and deploy an ERC-20 compliant token

Expand Down
Loading

0 comments on commit 128a677

Please sign in to comment.