Skip to content

Commit

Permalink
Merge branch 'dev' into ts-second-iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
pettinarip committed May 23, 2022
2 parents b91809d + 07eca93 commit 014d3b2
Show file tree
Hide file tree
Showing 24 changed files with 269 additions and 15 deletions.
72 changes: 72 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -7498,6 +7498,78 @@
"code",
"bug"
]
},
{
"login": "wolz-CODElife",
"name": "wolz-CODElife",
"avatar_url": "https://avatars.githubusercontent.com/u/55518764?v=4",
"profile": "http://wolzcodelife.web.app",
"contributions": [
"doc"
]
},
{
"login": "minaessam2015",
"name": "Mina Essam",
"avatar_url": "https://avatars.githubusercontent.com/u/13814552?v=4",
"profile": "https://github.com/minaessam2015",
"contributions": [
"ideas"
]
},
{
"login": "Choi-Jinhong",
"name": "GNONG",
"avatar_url": "https://avatars.githubusercontent.com/u/65050483?v=4",
"profile": "https://jinhongdev.tistory.com/",
"contributions": [
"doc"
]
},
{
"login": "spilehchiha",
"name": "Sina Pilehchiha",
"avatar_url": "https://avatars.githubusercontent.com/u/46059077?v=4",
"profile": "https://github.com/spilehchiha",
"contributions": [
"doc"
]
},
{
"login": "theexoticman",
"name": "thefrenchbrazilianguy",
"avatar_url": "https://avatars.githubusercontent.com/u/10594609?v=4",
"profile": "https://github.com/theexoticman",
"contributions": [
"doc"
]
},
{
"login": "nativeanish",
"name": "Anish Gupta",
"avatar_url": "https://avatars.githubusercontent.com/u/15274388?v=4",
"profile": "http://nativeanish.tech",
"contributions": [
"doc"
]
},
{
"login": "dev-matthew",
"name": "Matthew",
"avatar_url": "https://avatars.githubusercontent.com/u/80741503?v=4",
"profile": "https://github.com/dev-matthew",
"contributions": [
"doc"
]
},
{
"login": "JustynaBroniszewska",
"name": "Justyna Broniszewska",
"avatar_url": "https://avatars.githubusercontent.com/u/33961199?v=4",
"profile": "https://github.com/JustynaBroniszewska",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,18 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/JuliusDegesys"><img src="https://avatars.githubusercontent.com/u/3232103?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Julius Degesys</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=JuliusDegesys" title="Documentation">📖</a></td>
<td align="center"><a href="https://nicolasquiroz.com"><img src="https://avatars.githubusercontent.com/u/948922?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nicolás Quiroz</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=nhsz" title="Code">💻</a> <a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Anhsz" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="http://wolzcodelife.web.app"><img src="https://avatars.githubusercontent.com/u/55518764?v=4?s=100" width="100px;" alt=""/><br /><sub><b>wolz-CODElife</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=wolz-CODElife" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/minaessam2015"><img src="https://avatars.githubusercontent.com/u/13814552?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mina Essam</b></sub></a><br /><a href="#ideas-minaessam2015" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://jinhongdev.tistory.com/"><img src="https://avatars.githubusercontent.com/u/65050483?v=4?s=100" width="100px;" alt=""/><br /><sub><b>GNONG</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=Choi-Jinhong" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/spilehchiha"><img src="https://avatars.githubusercontent.com/u/46059077?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sina Pilehchiha</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=spilehchiha" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/theexoticman"><img src="https://avatars.githubusercontent.com/u/10594609?v=4?s=100" width="100px;" alt=""/><br /><sub><b>thefrenchbrazilianguy</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=theexoticman" title="Documentation">📖</a></td>
<td align="center"><a href="http://nativeanish.tech"><img src="https://avatars.githubusercontent.com/u/15274388?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Anish Gupta</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=nativeanish" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/dev-matthew"><img src="https://avatars.githubusercontent.com/u/80741503?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matthew</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=dev-matthew" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/JustynaBroniszewska"><img src="https://avatars.githubusercontent.com/u/33961199?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Justyna Broniszewska</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=JustynaBroniszewska" title="Documentation">📖</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
Expand Down
2 changes: 1 addition & 1 deletion src/content/bridges/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ If you have ETH on Ethereum Mainnet and you want to explore an alt L1 to try out

### Own native crypto assets {#own-native}

Let’s say you want to own native $LUNA, but you only have funds on Ethereum Mainnet. To gain exposure to $LUNA on Ethereum, you can buy Wrapped Luna (WLUNA). However, WLUNA is an ERC-20 token native to the Ethereum network, which means it’s an Ethereum version of LUNA and not the original asset in the Terra ecosystem. To own native $LUNA, you would have to bridge your assets from Ethereum to Terra using the [Terra Bridge](https://bridge.terra.money/). This will bridge your Wrapped LUNA and convert it into native LUNA.
Let’s say you want to own native Bitcoin (BTC), but you only have funds on Ethereum Mainnet. To gain exposure to BTC on Ethereum, you can buy Wrapped Bitcoin (WBTC). However, WBTC is an ERC-20 token native to the Ethereum network, which means it’s an Ethereum version of Bitcoin and not the original asset on the Bitcoin blockchain. To own native BTC, you would have to bridge your assets from Ethereum to Bitcoin using a bridge. This will bridge your WBTC and convert it into native BTC. Alternatively, you might own BTC and want to use it in Ethereum DeFi protocols. This would require bridging the other way, from BTC to WBTC which can then be used as an asset on Ethereum.

<InfoBanner shouldCenter emoji=":bulb:">
You can also do all of the above using a <a href="/get-eth/">centralized exchange</a>. However, unless your funds are already on an exchange, it would involve multiple steps, and you’d likely be better off using a bridge.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ A lot of the source content contains tags and variables, which are highlighted i

You may notice full links to pages on ethereum.org or other websites.

These should be identical to the source and not changed or translated. If you translate a link or change it in any way, even just removing a part of it, like a backslash (/), this will lead to broken and unusable links.
These should be identical to the source and not changed or translated. If you translate a link or change it in any way, even just removing a part of it, like a slash (/), this will lead to broken and unusable links.

The best way to handle links is to copy them directly from the source, either by clicking on them or using the ‘Copy Source’ button (Alt+C).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Finality is a property of certain blocks that means they cannot be reverted unle
1. Two-thirds of the total staked ether must have voted in favor of that block's inclusion in the canonical chain. This condition upgrades the block to "justified". Justified blocks are unlikely to be reverted, but they can be under certain conditions.
2. When another block is justified on top of a justified block, it is upgraded to "finalized". Finalizing a block is a commitment to include the block in the canonical chain. It cannot be reverted unless an attacker destroys millions of ether (billions of $USD).

These block upgrades do not happen in every slot. Instead, only epoch-boundary blocks can be justified and finalized. These blocks are known as "checkpoints". Upgrading considers pairs of checkpoints. A "supermajority link" must exist between two successive checkpoints (i.e. two-thirds of the total staked ether voting that checkpoint B is the correct descendant of checkpoint A to upgrade the less recent checkpoint to finalized and the more recent block to justified.
These block upgrades do not happen in every slot. Instead, only epoch-boundary blocks can be justified and finalized. These blocks are known as "checkpoints". Upgrading considers pairs of checkpoints. A "supermajority link" must exist between two successive checkpoints (i.e. two-thirds of the total staked ether voting that checkpoint B is the correct descendant of checkpoint A) to upgrade the less recent checkpoint to finalized and the more recent block to justified.

Because finality requires a two-thirds agreement that a block is canonical, an attacker cannot possibly create an alternative finalized chain without:

Expand Down
2 changes: 1 addition & 1 deletion src/content/developers/docs/networking-layer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Along with the hello messages, the wire protocol can also send a "disconnect" me

#### Wire protocol {#wire-protocol}

Once peers are connected and an RLPx session has been started, the wire protocol defines how peers communicate. There are three main tasks defined by the wire protocol: chain synchronization, block propagation and transaction exchange. Chain synchronization is the process of validating blocks near head of the chain, checking their proof-of-work data and re-executing their transactions to ensure their root hashes are correct, then cascading back in history via those blocks' parents, grandparents etc until the whole chain has been downloaed and validated. State sync is a faster alternative that only validates block headers. Block propagation is the process of sending and receiving newly mined blocks. Transaction exchnage refers to exchangign pending transactions between nodes so that miners can select some of them for inclusion in the next block. Detailed information about these tasks are available [here](https://github.com/ethereum/devp2p/blob/master/caps/eth.md). Clients that support these sub-protocols exose them via the [json-rpc](/developers/docs/apis/json-rpc).
Once peers are connected and an RLPx session has been started, the wire protocol defines how peers communicate. There are three main tasks defined by the wire protocol: chain synchronization, block propagation and transaction exchange. Chain synchronization is the process of validating blocks near the head of the chain, checking their proof-of-work data and re-executing their transactions to ensure their root hashes are correct, then cascading back in history via those blocks' parents, grandparents etc until the whole chain has been downloaded and validated. State sync is a faster alternative that only validates block headers. Block propagation is the process of sending and receiving newly mined blocks. Transaction exchange refers to exchanging pending transactions between nodes so that miners can select some of them for inclusion in the next block. Detailed information about these tasks is available [here](https://github.com/ethereum/devp2p/blob/master/caps/eth.md). Clients that support these sub-protocols expose them via the [JSON-RPC](/developers/docs/apis/json-rpc).

#### les (light ethereum subprotocol) {#les}

Expand Down
2 changes: 1 addition & 1 deletion src/content/developers/docs/networks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Arbitrum Rinkeby faucets:
- [Chainlink faucet](https://faucets.chain.link/)
- [Paradigm faucet](https://faucet.paradigm.xyz/)

#### Optimisic Kovan {#optimistic-kovan}
#### Optimistic Kovan {#optimistic-kovan}

A testnet for [Optimism](https://www.optimism.io/).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ If you don't already have an understanding of what nodes and clients are, check

Node service providers run distributed node clients behind the scenes for you, so you don't have to.

These services typically provide an API key that you can use to write to and read from the blockchain. They often include access to [Ethereum testnets](/developers/docs/networks/#testnets) in addition to Mainnet.
These services typically provide an API key that you can use to write to and read from the blockchain. They often include access to [Ethereum testnets](/developers/docs/networks/#ethereum-testnets) in addition to Mainnet.

Some services offer you your own dedicated node that they manage for you, while others use load balancers to distribute activity across nodes.

Expand Down Expand Up @@ -223,7 +223,7 @@ Here is a list of some of the most popular Ethereum node providers, feel free to
- Unlimited TX fee and infinite Gas for sending transactions
- Fastest getting of the new block and reading of the blockchain
- The best price per API call guarantee

## Further reading {#further-reading}

- [List of Ethereum node services](https://ethereumnodes.com/)
Expand Down
1 change: 1 addition & 0 deletions src/content/developers/docs/standards/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Certain EIPs relate to application-level standards (e.g. a standard smart-contra
- [ERC-721](/developers/docs/standards/tokens/erc-721/) - A standard interface for non-fungible tokens, like a deed for artwork or a song.
- [ERC-777](/developers/docs/standards/tokens/erc-777/) - A token standard improving over ERC-20.
- [ERC-1155](/developers/docs/standards/tokens/erc-1155/) - A token standard which can contain both fungible and non-fungible assets.
- [ERC-4626](/developers/docs/standards/tokens/erc-4626/) - A tokenized vault standard designed to optimize and unify the technical parameters of yield-bearing vaults.

Learn more about [token standards](/developers/docs/standards/tokens/).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ where the ERC-20 plays its role! This standard allows developers to build token
**What is ERC-20?**

The ERC-20 introduces a standard for Fungible Tokens, in other words, they have a property that makes each Token be exactly
the same (in type and value) of another Token. For example, an ERC-20 Token acts just like the ETH, meaning that 1 Token
the same (in type and value) as another Token. For example, an ERC-20 Token acts just like the ETH, meaning that 1 Token
is and will always be equal to all the other Tokens.

## Prerequisites {#prerequisites}
Expand Down
131 changes: 131 additions & 0 deletions src/content/developers/docs/standards/tokens/erc-4626/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
title: ERC-4626 Tokenized Vault Standard
description: A standard for yield bearing vaults.
lang: en
sidebar: true
---

## Introduction {#introduction}

ERC-4626 is a standard to optimize and unify the technical parameters of yield-bearing vaults. It provides a standard API for tokenized yield-bearing vaults that represent shares of a single underlying ERC-20 token. ERC-4626 also outlines an optional extension for tokenized vaults utilizing ERC-20, offering basic functionality for depositing, withdrawing tokens and reading balances.

**The role of ERC-4626 in yield-bearing vaults**

Lending markets, aggregators, and intrinsically interest-bearing tokens help users find the best yield on their crypto tokens by executing different strategies. These strategies are done with slight variation, which might be error-prone or waste development resources.

ERC-4626 in yield-bearing vaults will lower the integration effort and unlock access to yield in various applications with little specialized effort from developers by creating more consistent and robust implementation patterns.

The ERC-4626 token is described fully in [EIP-4626](https://eips.ethereum.org/EIPS/eip-4626).

## Prerequisites {#prerequisites}

To better understand this page, we recommend you first read about [token standards](/developers/docs/standards/tokens/) and [ERC-20](/developers/docs/standards/tokens/erc-20/).

## ERC-4626 Functions and Features: {#body}

### Methods {#methods}

#### deposit {#deposit}

```solidity
function deposit(address _to, uint256 _value) public returns (uint256 _shares)
```
This function deposits the `_value` tokens into the vault and grants ownership to `_to`.

#### withdraw {#withdraw}

```solidity
function withdraw(address _to, uint256 _value) public returns (uint256 _shares)
```
This function withdraws `_value` token from the vault and transfers them to `_to`.

#### totalHoldings {#totalholdings}

```solidity
function totalHoldings() public view returns (uint256)
```
This function returns the total amount of underlying tokens held by the vault.

#### balanceOfUnderlying {#balanceofunderlying}

```solidity
function balanceOfUnderlying(address _owner) public view returns (uint256)
```
This function returns the total amount of underlying tokens held in the vault for `_owner`.

#### underlying {#underlying}

```solidity
function underlying() public view returns (address)
```
Returns the address of the token the vault uses for accounting, depositing, and withdrawing.

#### totalSupply {#totalsupply}

```solidity
function totalSupply() public view returns (uint256)
```
Returns the total number of unredeemed vault shares in circulation.

#### balanceOf {#balanceof}

```solidity
function balanceOf(address _owner) public view returns (uint256)
```
Returns the total amount of vault shares the `_owner` currently has.

#### redeem {#redeem}

```solidity
function redeem(address _to, uint256 _shares) public returns (uint256 _value)
```
Redeems a specific number of `_shares` for underlying tokens and transfers them to `_to`.

#### exchangeRate {#exchangerate}

```solidity
function exchangeRate() public view returns (uint256)
```
The amount of underlying tokens one `baseUnit` of vault shares is redeemable for. For example:
```solidity
_shares * exchangeRate() / baseUnit() = _value.
```

```solidity
exchangeRate() * totalSupply() MUST equal totalHoldings().
```

#### baseUnit {#baseunit}

```solidity
function baseUnit() public view returns(uint256)
```
The decimal scalar for vault shares and operations involving `exchangeRate()`.



### Events {#events}

#### Deposit Event

**MUST** be emitted when tokens are deposited into the vault
```solidity
event Deposit(address indexed _from, addres indexed _to, uint256 _value)
```

Where `_from` is the user who triggered the deposit and approved `_value` underlying tokens to the vault, and `_to` is the user who can withdraw the deposited tokens.

#### Widthdraw Event

**MUST** be emitted when tokens are withdrawn from the vault by a depositor.
```solidity
event Withdraw(address indexed _owner, address indexed _to, uint256 _value)
```
Where `_from` is the user who triggered the withdrawal and held `_value` underlying tokens in the vault, and `_to` is the user who received the withdrawn tokens.

_Note_: All batch functions, including the hook, are also available in non-batch versions. This is done to save gas, as transferring just one asset will likely remain to be the most common method. For clarity in the explanations, we've left them out, including the safe transfer rules. Remove the 'Batch' and the names are identical.

## Further reading {#further-reading}

- [EIP-4626: Tokenized vault Standard](https://eips.ethereum.org/EIPS/eip-4626)
- [ERC-4626: Github Repo](https://github.com/Rari-Capital/solmate/blob/main/src/mixins/ERC4626.sol)
Loading

0 comments on commit 014d3b2

Please sign in to comment.