Skip to content

Commit

Permalink
reorganize the builders and precompile sections
Browse files Browse the repository at this point in the history
  • Loading branch information
eshaben committed Jun 10, 2024
1 parent 53ac111 commit e8a28d9
Show file tree
Hide file tree
Showing 559 changed files with 1,849 additions and 853 deletions.
6 changes: 3 additions & 3 deletions .CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In the root directory and every subdirectory, in addition to the content directo

### Example `.pages` file

Below is an example of the [Canonical Contracts](https://docs.moonbeam.network/builders/build/canonical-contracts/) `.pages` file:
Below is an example of the [Canonical Contracts](https://docs.moonbeam.network/builders/ethereum/canonical-contracts/) `.pages` file:

```markdown
title: Canonical Contracts
Expand All @@ -37,13 +37,13 @@ Some important things to note:
- Files follow the convention of 'Display Name': 'file-name.md'
- Subdirectories are listed by their directory name in the source code

Both, **Canonical Contracts** and **Contract Addresses** are displayed in the left side navigation menu and on the landing page. The **Precompiled Contracts** title, comes from the `title` of the [`.pages` file for the `precompiles` subdirectory](https://github.com/moonbeam-foundation/moonbeam-docs/blob/master/builders/build/canonical-contracts/precompiles/.pages).
Both, **Canonical Contracts** and **Contract Addresses** are displayed in the left side navigation menu and on the landing page. The **Precompiled Contracts** title, comes from the `title` of the [`.pages` file for the `precompiles` subdirectory](https://github.com/moonbeam-foundation/moonbeam-docs/blob/master/builders/ethereum/canonical-contracts/precompiles/.pages).

![Display titles](/images/readme-contributing/contributing-1.webp)

### Example `index.md` file

Below is an example of the [Canonical Contracts](https://docs.moonbeam.network/builders/build/canonical-contracts/) `index.md` file:
Below is an example of the [Canonical Contracts](https://docs.moonbeam.network/builders/ethereum/canonical-contracts/) `index.md` file:

```markdown
---
Expand Down
Binary file added .snippets/code/.DS_Store
Binary file not shown.
Binary file added .snippets/code/builders/.DS_Store
Binary file not shown.
Binary file added .snippets/code/builders/substrate/.DS_Store
Binary file not shown.
40 changes: 0 additions & 40 deletions .snippets/text/builders/build/canonical-contracts/eth-mainnet.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
### Ethereum MainNet Precompiles {: #ethereum-mainnet-precompiles }

=== "Moonbeam"
| Contract | Address |
|:---------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------:|
| [ECRECOVER](/builders/ethereum/precompiles/utility/eth-mainnet/#verify-signatures-with-ecrecover){target=\_blank} | 0x0000000000000000000000000000000000000001 |
| [SHA256](/builders/ethereum/precompiles/utility/eth-mainnet/#hashing-with-sha256){target=\_blank} | 0x0000000000000000000000000000000000000002 |
| [RIPEMD160](/builders/ethereum/precompiles/utility/eth-mainnet/#hashing-with-ripemd-160){target=\_blank} | 0x0000000000000000000000000000000000000003 |
| [Identity](/builders/ethereum/precompiles/utility/eth-mainnet/#the-identity-function){target=\_blank} | 0x0000000000000000000000000000000000000004 |
| [Modular Exponentiation](/builders/ethereum/precompiles/utility/eth-mainnet/#modular-exponentiation){target=\_blank} | 0x0000000000000000000000000000000000000005 |
| [BN128Add](/builders/ethereum/precompiles/utility/eth-mainnet/#bn128add){target=\_blank} | 0x0000000000000000000000000000000000000006 |
| [BN128Mul](/builders/ethereum/precompiles/utility/eth-mainnet/#bn128mul){target=\_blank} | 0x0000000000000000000000000000000000000007 |
| [BN128Pairing](/builders/ethereum/precompiles/utility/eth-mainnet/#bn128pairing){target=\_blank} | 0x0000000000000000000000000000000000000008 |
| [Blake2](https://polkadot-evm.github.io/frontier/rustdocs/pallet_evm_precompile_blake2/struct.Blake2F.html){target=\_blank} | 0x0000000000000000000000000000000000000009 |

=== "Moonriver"
| Contract | Address |
|:---------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------:|
| [ECRECOVER](/builders/ethereum/precompiles/utility/eth-mainnet/#verify-signatures-with-ecrecover){target=\_blank} | 0x0000000000000000000000000000000000000001 |
| [SHA256](/builders/ethereum/precompiles/utility/eth-mainnet/#hashing-with-sha256){target=\_blank} | 0x0000000000000000000000000000000000000002 |
| [RIPEMD160](/builders/ethereum/precompiles/utility/eth-mainnet/#hashing-with-ripemd-160){target=\_blank} | 0x0000000000000000000000000000000000000003 |
| [Identity](/builders/ethereum/precompiles/utility/eth-mainnet/#the-identity-function){target=\_blank} | 0x0000000000000000000000000000000000000004 |
| [Modular Exponentiation](/builders/ethereum/precompiles/utility/eth-mainnet/#modular-exponentiation){target=\_blank} | 0x0000000000000000000000000000000000000005 |
| [BN128Add](/builders/ethereum/precompiles/utility/eth-mainnet/#bn128add){target=\_blank} | 0x0000000000000000000000000000000000000006 |
| [BN128Mul](/builders/ethereum/precompiles/utility/eth-mainnet/#bn128mul){target=\_blank} | 0x0000000000000000000000000000000000000007 |
| [BN128Pairing](/builders/ethereum/precompiles/utility/eth-mainnet/#bn128pairing){target=\_blank} | 0x0000000000000000000000000000000000000008 |
| [Blake2](https://polkadot-evm.github.io/frontier/rustdocs/pallet_evm_precompile_blake2/struct.Blake2F.html){target=\_blank} | 0x0000000000000000000000000000000000000009 |

=== "Moonbase Alpha"
| Contract | Address |
|:---------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------:|
| [ECRECOVER](/builders/ethereum/precompiles/utility/eth-mainnet/#verify-signatures-with-ecrecover){target=\_blank} | 0x0000000000000000000000000000000000000001 |
| [SHA256](/builders/ethereum/precompiles/utility/eth-mainnet/#hashing-with-sha256){target=\_blank} | 0x0000000000000000000000000000000000000002 |
| [RIPEMD160](/builders/ethereum/precompiles/utility/eth-mainnet/#hashing-with-ripemd-160){target=\_blank} | 0x0000000000000000000000000000000000000003 |
| [Identity](/builders/ethereum/precompiles/utility/eth-mainnet/#the-identity-function){target=\_blank} | 0x0000000000000000000000000000000000000004 |
| [Modular Exponentiation](/builders/ethereum/precompiles/utility/eth-mainnet/#modular-exponentiation){target=\_blank} | 0x0000000000000000000000000000000000000005 |
| [BN128Add](/builders/ethereum/precompiles/utility/eth-mainnet/#bn128add){target=\_blank} | 0x0000000000000000000000000000000000000006 |
| [BN128Mul](/builders/ethereum/precompiles/utility/eth-mainnet/#bn128mul){target=\_blank} | 0x0000000000000000000000000000000000000007 |
| [BN128Pairing](/builders/ethereum/precompiles/utility/eth-mainnet/#bn128pairing){target=\_blank} | 0x0000000000000000000000000000000000000008 |
| [Blake2](https://polkadot-evm.github.io/frontier/rustdocs/pallet_evm_precompile_blake2/struct.Blake2F.html){target=\_blank} | 0x0000000000000000000000000000000000000009 |
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
=== "Moonbeam"
| Contract | Address |
|:--------------------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------:|
| [SHA3FIPS256](/builders/pallets-precompiles/precompiles/eth-mainnet/#hashing-with-sha3fips256){target=\_blank} | 0x0000000000000000000000000000000000000400 |
| [SHA3FIPS256](/builders/ethereum/precompiles/utility/eth-mainnet/#hashing-with-sha3fips256){target=\_blank} | 0x0000000000000000000000000000000000000400 |
| [Dispatch](https://polkadot-evm.github.io/frontier/rustdocs/pallet_evm_precompile_dispatch/struct.Dispatch.html){target=\_blank} | 0x0000000000000000000000000000000000000401 |
| [ECRecoverPublicKey](https://polkadot-evm.github.io/frontier/rustdocs/pallet_evm_precompile_simple/struct.ECRecoverPublicKey.html){target=\_blank} | 0x0000000000000000000000000000000000000402 |

=== "Moonriver"
| Contract | Address |
|:--------------------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------:|
| [SHA3FIPS256](/builders/pallets-precompiles/precompiles/eth-mainnet/#hashing-with-sha3fips256){target=\_blank} | 0x0000000000000000000000000000000000000400 |
| [SHA3FIPS256](/builders/ethereum/precompiles/utility/eth-mainnet/#hashing-with-sha3fips256){target=\_blank} | 0x0000000000000000000000000000000000000400 |
| [Dispatch](https://polkadot-evm.github.io/frontier/rustdocs/pallet_evm_precompile_dispatch/struct.Dispatch.html){target=\_blank} | 0x0000000000000000000000000000000000000401 |
| [ECRecoverPublicKey](https://polkadot-evm.github.io/frontier/rustdocs/pallet_evm_precompile_simple/struct.ECRecoverPublicKey.html){target=\_blank} | 0x0000000000000000000000000000000000000402 |

=== "Moonbase Alpha"
| Contract | Address |
|:-------------------------------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------:|
| [SHA3FIPS256](/builders/pallets-precompiles/precompiles/eth-mainnet/#hashing-with-sha3fips256){target=\_blank} | 0x0000000000000000000000000000000000000400 |
| [SHA3FIPS256](/builders/ethereum/precompiles/utility/eth-mainnet/#hashing-with-sha3fips256){target=\_blank} | 0x0000000000000000000000000000000000000400 |
| [Dispatch](https://polkadot-evm.github.io/frontier/rustdocs/pallet_evm_precompile_dispatch/struct.Dispatch.html){target=\_blank} | 0x0000000000000000000000000000000000000401 |
| [ECRecoverPublicKey](https://polkadot-evm.github.io/frontier/rustdocs/pallet_evm_precompile_simple/struct.ECRecoverPublicKey.html){target=\_blank} | 0x0000000000000000000000000000000000000402 |
| [StorageCleaner](https://polkadot-evm.github.io/frontier/rustdocs/pallet_evm_precompile_storage_cleaner/struct.StorageCleanerPrecompile.html){target=\_blank} | 0x0000000000000000000000000000000000000403 |
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ touch Incrementer.sol
Next, you can add the Solidity code to the file:

```solidity
--8<-- 'code/builders/build/eth-api/libraries/web3-js/Incrementer.sol'
--8<-- 'code/builders/ethereum/libraries/web3-js/Incrementer.sol'
```

The `constructor` function, which runs when the contract is deployed, sets the initial value of the number variable stored on-chain (the default is `0`). The `increment` function adds the `_value` provided to the current number, but a transaction needs to be sent, which modifies the stored data. Lastly, the `reset` function resets the stored value to zero.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ If you're looking for your own endpoints suitable for production use, you can ch

## Quick Start {: #quick-start }

For the [Web3.js library](/builders/build/eth-api/libraries/web3js/){target=\_blank}, you can create a local Web3 instance and set the provider to connect to Moonbase Alpha (both HTTP and WS are supported):
For the [Web3.js library](/builders/ethereum/libraries/web3js/){target=\_blank}, you can create a local Web3 instance and set the provider to connect to Moonbase Alpha (both HTTP and WS are supported):

```js
const { Web3 } = require('web3'); // Load Web3 library
Expand All @@ -19,7 +19,7 @@ const { Web3 } = require('web3'); // Load Web3 library
const web3 = new Web3('https://rpc.api.moonbase.moonbeam.network');
```

For the [Ethers.js library](/builders/build/eth-api/libraries/ethersjs/){target=\_blank}, define the provider by using `ethers.JsonRpcProvider(providerURL, {object})` and setting the provider URL to Moonbase Alpha:
For the [Ethers.js library](/builders/ethereum/libraries/ethersjs/){target=\_blank}, define the provider by using `ethers.JsonRpcProvider(providerURL, {object})` and setting the provider URL to Moonbase Alpha:

```js
const ethers = require('ethers'); // Load Ethers library
Expand Down
Loading

0 comments on commit e8a28d9

Please sign in to comment.