Skip to content

Commit

Permalink
Merge branch 'staging' into feature-326
Browse files Browse the repository at this point in the history
  • Loading branch information
nsjames authored Jul 31, 2023
2 parents ddf4c4d + 0646f92 commit ee54ad6
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 33 deletions.
8 changes: 6 additions & 2 deletions evm/10_quick-start/02_setup-metamask.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
title: Setup MetaMask
---

import ConnectMetaMask from '@site/src/components/ConnectMetaMask/ConnectMetaMask';

Click either of these buttons to instantly add EOS EVM to your MetaMask.

<!-- translation-ignore -->

import ConnectMetaMask from '@site/src/components/ConnectMetaMask/ConnectMetaMask';

<ConnectMetaMask />

<!-- end-translation-ignore -->


## Adding manually

Expand Down
10 changes: 7 additions & 3 deletions evm/10_quick-start/03_evm-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ exchanges only support the native version of those tokens, you must *bridge* you

## Testnet faucet

import FaucetTokens from '@site/src/components/FaucetTokens/FaucetTokens';

Want some EOS tokens to play with? Click the button below to get some from the testnet faucet.

<!-- translation-ignore -->

import FaucetTokens from '@site/src/components/FaucetTokens/FaucetTokens';

<FaucetTokens />

<!-- end-translation-ignore -->

## Bridge from EOS to EOS EVM

### Bridge tokens yourself
Expand All @@ -32,7 +36,7 @@ Open your wallet and send **EOS** tokens to `eosio.evm` with your EVM address as

To withdraw EOS tokens from a centralized exchange (CEX) to an EOS EVM address:

1. Visit the withdraw screen of the Exchange's app
1. Visit the withdrawal screen of the Exchange's app
2. Select EOS as Coin
3. Select EOS as Network
4. Enter `eosio.evm` as Wallet Address
Expand Down
16 changes: 12 additions & 4 deletions evm/20_smart-contracts/20_migrate-your-smart-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,30 @@ This guide will teach you to deploy a smart contract to the EOS EVM using hardha

## Set up your MetaMask

Click either of these buttons to instantly add EOS EVM to your MetaMask.

import ConnectMetaMask from '@site/src/components/ConnectMetaMask/ConnectMetaMask';
<!-- translation-ignore -->

Click either of these buttons to instantly add EOS EVM to your MetaMask.
import ConnectMetaMask from '@site/src/components/ConnectMetaMask/ConnectMetaMask';

<ConnectMetaMask />

<!-- end-translation-ignore -->

## Getting EOS tokens

import FaucetTokens from '@site/src/components/FaucetTokens/FaucetTokens';
## Getting EOS tokens

Want some EOS tokens to play with? Click the button below to get some from the testnet faucet.


<!-- translation-ignore -->

import FaucetTokens from '@site/src/components/FaucetTokens/FaucetTokens';

<FaucetTokens />

<!-- end-translation-ignore -->

If you're on the testnet, you can get some EOS tokens using the [**testnet faucet**](https://faucet.testnet.evm.eosnetwork.com/).

If you're on the EOS Mainnet, ]you can transfer your native EOS using a standard EOS transfer:
Expand Down
46 changes: 23 additions & 23 deletions native/06_guides/02_create-an-nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,25 @@ each action, expand the section below.
The `mint` action is used to create a new NFT.

It takes two parameters:
- **to** - The account that will own the NFT
- **token_id** - The ID of the NFT
- `to` - The account that will own the NFT
- `token_id` - The ID of the NFT

### Transfer

The `transfer` action is used to transfer an NFT from one account to another.

It takes four parameters:
- **from** - The account that currently owns the NFT
- **to** - The account that will own the NFT
- **token_id** - The ID of the NFT
- **memo** - A memo that will be included in the transaction
- `from` - The account that currently owns the NFT
- `to` - The account that will own the NFT
- `token_id` - The ID of the NFT
- `memo` - A memo that will be included in the transaction

### BalanceOf

The `balanceof` action is used to get the balance of an account.

It takes one parameter:
- **owner** - The account that you want to get the balance of
- `owner` - The account that you want to get the balance of

It returns a `uint64_t` which is the balance of the account.

Expand All @@ -160,7 +160,7 @@ It returns a `uint64_t` which is the balance of the account.
The `ownerof` action is used to get the owner of an NFT.

It takes one parameter:
- **token_id** - The ID of the NFT
- `token_id` - The ID of the NFT

It returns a `name` which is the account that owns the NFT.

Expand All @@ -169,24 +169,24 @@ It returns a `name` which is the account that owns the NFT.
The `approve` action is used to approve an account to transfer an NFT on your behalf.

It takes two parameters:
- **to** - The account that will be approved to transfer the NFT
- **token_id** - The ID of the NFT
- `to` - The account that will be approved to transfer the NFT
- `token_id` - The ID of the NFT

### ApproveAll

The `approveall` action is used to approve an account to transfer all of your NFTs on your behalf.

It takes three parameters:
- **from** - The account that currently owns the NFTs
- **to** - The account that will be approved to transfer the NFTs
- **approved** - A boolean that determines if the account is approved or not
- `from` - The account that currently owns the NFTs
- `to` - The account that will be approved to transfer the NFTs
- `approved` - A boolean that determines if the account is approved or not

### GetApproved

The `getapproved` action is used to get the account that is approved to transfer an NFT on your behalf.

It takes one parameter:
- **token_id** - The ID of the NFT
- `token_id` - The ID of the NFT

It returns a `name` which is the account that is approved to transfer the NFT.

Expand All @@ -195,8 +195,8 @@ It returns a `name` which is the account that is approved to transfer the NFT.
The `approved4all` action is used to get if an account is approved to transfer all of your NFTs on your behalf.

It takes two parameters:
- **owner** - The account that currently owns the NFTs
- **approved_account** - The account that you want to check if it is approved to transfer the NFTs
- `owner` - The account that currently owns the NFTs
- `approved_account` - The account that you want to check if it is approved to transfer the NFTs

It returns a `bool` which is `true` if the account is approved to transfer the NFTs, and `false` if it is not.

Expand All @@ -205,7 +205,7 @@ It returns a `bool` which is `true` if the account is approved to transfer the N
The `gettokenuri` action is used to get the URI of the NFT's metadata.

It takes one parameter:
- **token_id** - The ID of the NFT
- `token_id` - The ID of the NFT

It returns a `std::string` which is the URI of the NFT's metadata.

Expand All @@ -214,7 +214,7 @@ It returns a `std::string` which is the URI of the NFT's metadata.
The `setbaseuri` action is used to set the base URI of the NFT's metadata.

It takes one parameter:
- **base_uri** - The base URI of the NFT's metadata
- `base_uri` - The base URI of the NFT's metadata

</details>

Expand Down Expand Up @@ -244,11 +244,11 @@ Add the following code to your contract above the actions:
```

We've created singleton tables for the following:
- **_owners** - A mapping from token ID to the owner of the NFT
- **_balances** - A mapping from owner to the amount of NFTs they own
- **_approvals** - A mapping from token ID to an account approved to transfer that NFT
- **_approvealls** - A mapping from owner to an account approved to transfer all their NFTs
- **_base_uris** - A configuration table that stores the base URI of the NFT's metadata
- `_owners` - A mapping from token ID to the owner of the NFT
- `_balances` - A mapping from owner to the amount of NFTs they own
- `_approvals` - A mapping from token ID to an account approved to transfer that NFT
- `_approvealls` - A mapping from owner to an account approved to transfer all their NFTs
- `_base_uris` - A configuration table that stores the base URI of the NFT's metadata

> **Table Naming**
>
Expand Down
14 changes: 14 additions & 0 deletions native/60_advanced-topics/01_consensus-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,17 @@ Block finality is the final outcome of EOS consensus. It is achieved after a sup
#### 5.4.1. Goal of Finality

The main point of finality is to give users confidence that transactions that were applied prior and up to the LIB block cannot be modified, rolled back, or dropped. The LIB block can also be useful for active nodes to determine quickly and efficiently which branch to build off from, regardless of which is the longest one. This is because a given branch might be longer without containing the most recent LIB, in which case a shorter branch with the most recent LIB must be selected.

#### 5.4.2. EOS Finality

Currently, according to the above EOS consensus rules (see [3.1. Layer 1: Native Consensus (aBFT)](#31-layer-1-native-consensus-abft)), each proposed LIB block requires two schedule rounds of BP validations to become final. Since a supermajority of 2/3+1 BPs are required to reach consensus within the EOS mainnet (which accounts for 15 BPs from a total of 21 BPs), it follows that each proposed LIB block becomes final in at least `3` minutes (`180` seconds), according to the calculations below:

Variable | Value
-|-
**Tp**: Production time per producer | Tp = 0.5 (s/block) x 12 (blocks/producer) ⇒ Tp = 6 (s/producer) (**\***)
**SP**: Supermajority of producers | SP = int[ 2/3 * P (producers) ] + 1 ⇒ [P=21] SP = int[ 2/3 * 21 (producers) ] + 1 = 14 + 1 (producers) ⇒ SP = 15 (producers)
**CR**: Confirmation Rounds | CR = 2 (rounds) (**\*\***)
**FT**: Finality time | FT = SP x Tp (per round) x CR (rounds) ⇒ [SP=15, Tp=6, CR=2] FT = 15 (producers) x 6 (s/producer) (per round) x 2 (rounds) ⇒ **FT = 180 (s) = 3 (mins)**

(**\***): from section [4.2.2. Production Default Values](#422-production-default-values).
(**\*\***): number of schedule rounds required to validate a proposed LIB block.
2 changes: 1 addition & 1 deletion native/999_miscellaneous/20_audits.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Here you can find a list of the audits that have been completed on various EOS s

| Date | Audit | Auditor |
|------------|----------------------------------------------------------------------------|---------------------|
| 05-03-2023 | [EOS EVM Fuzzing Audit](./05_03_2023_eos_evm_fuzzing_audit_sentnl.pdf) | [sentnl.io](https://sentnl.io/) |
| 05-03-2023 | [EOS EVM Fuzzing Audit](https://docs.eosnetwork.com/docs/latest/miscellaneous/05_03_2023_eos_evm_fuzzing_audit_sentnl.pdf) | [sentnl.io](https://sentnl.io/) |

0 comments on commit ee54ad6

Please sign in to comment.