Skip to content

Commit

Permalink
Merge pull request #646 from onflow/g-network-naming
Browse files Browse the repository at this point in the history
Update network naming
  • Loading branch information
Greg Santos authored Mar 8, 2024
2 parents 2f675c6 + bedf0a5 commit fbbfaf4
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 31 deletions.
2 changes: 1 addition & 1 deletion docs/build/basics/accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Accounts

:::info

Are you an EVM developer looking for information about Accounts on FlowEVM? If so, check out the EVM specific documentation [here](../../evm/build/accounts.md)
Are you an EVM developer looking for information about EVM Accounts on Flow? If so, check out the EVM specific documentation [here](../../evm/build/accounts.md)

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/build/basics/fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Fees

:::info

Are you an EVM developer looking for information about Accounts on FlowEVM? If so, check out the EVM specific documentation [here](../../evm/build/fees.md)
Are you an EVM developer looking for information about EVM Accounts on Flow? If so, check out the EVM specific documentation [here](../../evm/build/fees.md)

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/evm/advanced/vm-bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 1

# Cross-VM Bridge

Flow provides the cross-VM bridge which enables Cadence to interact with EVM on Flow in order to bridge tokens, fungible and non-fungible, from one VM environment to the other. Specifically, the cross-VM bridge is contract-based, trustless protocol enabling the automated bridging of tokens from Cadence into FlowEVM into the corresponding ERC-20 and ERC-721 token types. In the opposite direction, it supports bridging of arbitrary EVM ERC-20 and ERC-721 tokens into the corresponding Cadence FT or NFT token types. The cross-VM bridge internalizes the capabilities to deploy new token contracts in either VM state as needed and resolves access to, and maintains links between, contracts. It additionally automates account and contract calls to enforce source VM asset burn or lock, and target VM token mint or unlock.
Flow provides the cross-VM bridge which enables Cadence to interact with EVM on Flow in order to bridge tokens, fungible and non-fungible, from one VM environment to the other. Specifically, the cross-VM bridge is contract-based, trustless protocol enabling the automated bridging of tokens from Cadence into EVM into the corresponding ERC-20 and ERC-721 token types. In the opposite direction, it supports bridging of arbitrary EVM ERC-20 and ERC-721 tokens into the corresponding Cadence FT or NFT token types. The cross-VM bridge internalizes the capabilities to deploy new token contracts in either VM state as needed and resolves access to, and maintains links between, contracts. It additionally automates account and contract calls to enforce source VM asset burn or lock, and target VM token mint or unlock.

Developers wishing to use the cross-VM bridge will be required to use a Cadence transaction of contract. Cross-VM bridge functionality is currently not available natively in EVM.

Expand Down
4 changes: 2 additions & 2 deletions docs/evm/build/accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ Unlike EOAs, COAs do not have a key but are assigned a 20-byte EVM address upon

COAs exist in Cadence as a Resource type which is in turn owned by a Flow account on the Cadence VM. COAs facilitate the execution of EVM transactions using its `run` method. They also enable the deployment of Solidity contracts from Cadence, as well as other utility functions to interact with EVM.

For more information on Cadence Owned Accounts, see the [FlowEVM FLIP](https://github.com/onflow/flips/pull/225/files)
For more information on Cadence Owned Accounts, see the [Flow EVM Support FLIP](https://github.com/onflow/flips/pull/225/files)

![FlowEVM-Account-Model](flow-evm-account-model.png)
![Account-Model](flow-evm-account-model.png)
6 changes: 3 additions & 3 deletions docs/evm/build/guides/deploy-contract/using-hardhat.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Using Hardhat
description: "Using Hardhat to deploy a solidity contract to FlowEVM."
description: "Using Hardhat to deploy a Solidity contract to EVM on Flow."
sidebar_label: Using Hardhat
sidebar_position: 1
---
Expand Down Expand Up @@ -231,8 +231,8 @@ The greeting is: Howdy!
### Coming Soon

- **Comprehensive Guides:** Step-by-step tutorials on deploying various types of smart contracts, including NFTs (ERC-721), using Hardhat on the Flow network.
- **Requirements:** Detailed prerequisites for using Hardhat with FlowEVM, including Node.js setup, wallet preparation, and obtaining testnet FLOW for gas fees.
- **Verification and Interaction:** Steps to verify your smart contracts on FlowEVM and interact with them using tools like Flowdiver.
- **Requirements:** Detailed prerequisites for using Hardhat with EVM on Flow, including Node.js setup, wallet preparation, and obtaining testnet FLOW for gas fees.
- **Verification and Interaction:** Steps to verify deployment of your smart contracts and interact with them using tools like Flowdiver.

Stay tuned for updates and feel free to check back soon for the full guide.
:::
2 changes: 1 addition & 1 deletion docs/evm/build/guides/deploy-contract/using-remix.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Using Remix
description: "Using Remix to deploy a solidity contract to FlowEVM."
description: "Using Remix to deploy a solidity contract to EVM on Flow."
sidebar_label: Using Remix
sidebar_position: 1
---
Expand Down
4 changes: 2 additions & 2 deletions docs/evm/build/networks.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 1

# Networks

FlowEVM has the following public RPC nodes available:
EVM on Flow has the following public RPC nodes available:

# Previewnet

Expand All @@ -26,7 +26,7 @@ FlowEVM has the following public RPC nodes available:
| Network Name | Testnet |
| Description | The public RPC URL for Flow Testnet |
| RPC Endpoint | https://testnet.evm.nodes.onflow.org |
| Chain ID | 646 |
| Chain ID | 545 |
| Currency Symbol | FLOW |
| Block Explorer | https://testnet.flowdiver.io |

Expand Down
22 changes: 10 additions & 12 deletions docs/evm/build/wallets-and-configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ Integrating additional networks into MetaMask can pose challenges for users who

[EIP-3035](https://eips.ethereum.org/EIPS/eip-3085) is an Ethereum Improvement Proposal that defines an RPC method for adding Ethereum-compatible chains to wallet applications. Since March 2021 MetaMask has implemented that EIP as part of their MetaMask [Custom Networks API](https://consensys.io/blog/connect-users-to-layer-2-networks-with-the-metamask-custom-networks-api).

### Network configuration
### Flow Network configuration

To add the FlowEVM network to Metamask, we need to add the following network confgiuration:

#### Previewnet Network
To add the Flow Previewnet network to Metamask, add the following network confgiuration:

```js
export const FLOWEVM_PREVIEWNET_PARAMS = {
export const PREVIEWNET_PARAMS = {
chainId: '0x286',
chainName: 'Flow',
rpcUrls: ['https://previewnet.evm.nodes.onflow.org'],
Expand All @@ -36,17 +34,17 @@ export const FLOWEVM_PREVIEWNET_PARAMS = {
}
```

### Adding the Network
### Adding Flow Network

To add this configuration to MetaMask, we must call the `wallet_addEthereumChain` method which is exposed by the web3 provider.
To add this configuration to MetaMask, call the `wallet_addEthereumChain` method which is exposed by the web3 provider.

```js
function addFlowEvmNetwork() {
function addFlowPreviewnet() {
injected.getProvider().then((provider) => {
provider
.request({
method: "wallet_addEthereumChain",
params: [FLOWEVM_PREVIEWNET_PARAMS],
params: [PREVIEWNET_PARAMS],
})
.catch((error: any) => {
console.log(error)
Expand All @@ -61,10 +59,10 @@ The typical usage would be to expose this button if you get errors when attempti

### User Experience

Users who first come to your dApp's website will need to first approve a connection to Metamask. After doing this, if you don't detect a successful Web3 network connection, you may present a dialog asking them to add the FlowEVM network to their wallet.
Users of your app will need to first approve a connection to Metamask. After doing this, if you don't detect a successful Web3 network connection, you may present a dialog asking them to add the Flow network to their wallet.

![Metamask Network](./metamask-network.png)

After they approve, your app be connected to the FlowEVM network.
After they approve, your app will be connected to the Flow network.

By using this approach to add the FlowEVM network to Metamask, you can avoid manual user data entry and ensure that users are ready to interact with your dApp!
By using this approach to add the Flow network to Metamask, you can avoid manual user data entry and ensure that users are ready to interact with your dApp!
16 changes: 8 additions & 8 deletions src/components/addNetworkButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import {
export const AddNetworkButton = () => {
const hasEthereum = window?.ethereum !== undefined;

const addFlowPreviewnet = async () => {
const addFlowNetwork = async () => {
try {
// Define your network details here
await window?.ethereum?.request({
method: 'wallet_addEthereumChain',
params: [
{
chainId: '0x286',
chainName: 'Flow Previewnet',
chainName: 'Previewnet',
rpcUrls: ['https://previewnet.evm.nodes.onflow.org'],
iconUrls: [
'https://assets-global.website-files.com/5f734f4dbd95382f4fdfa0ea/65b016be9b9cf0a402a67a38_ico-flow-crescendo.png',
Expand All @@ -36,16 +36,16 @@ export const AddNetworkButton = () => {

// eslint-disable-next-line @typescript-eslint/no-misused-promises
return hasEthereum ? (
<Button className="my-5 " variant="secondary" onClick={addFlowPreviewnet}>
Add Flow Previewnet Network
<Button className='my-5 ' variant='secondary' onClick={addFlowNetwork}>
Add Flow Network
</Button>
) : (
<ButtonLink
className="my-5"
variant="primary"
href="https://metamask.io/download/"
className='my-5'
variant='primary'
href='https://metamask.io/download/'
>
Install MetaMask
</ButtonLink>
);
)
};

0 comments on commit fbbfaf4

Please sign in to comment.