Skip to content

Commit

Permalink
Merge branch 'master' into check-undocumented-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hkalodner authored Dec 17, 2024
2 parents e01df18 + 70c0b6a commit 55d8e68
Show file tree
Hide file tree
Showing 11 changed files with 372 additions and 616 deletions.
36 changes: 18 additions & 18 deletions arbitrum-docs/launch-orbit-chain/how-tos/set-up-aep-fee-router.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ content_type: how-to

## Quick start

- You can adopt the AEP Fee Router by using the [AEP Router deployment scripts](https://github.com/OffchainLabs/arbitrum-orbit-sdk/tree/main/examples/setup-aep-fee-router) provided in the [Orbit SDK](https://github.com/OffchainLabs/arbitrum-orbit-sdk/tree/main)
You can adopt the AEP Fee Router by using the [AEP Router deployment scripts](https://github.com/OffchainLabs/arbitrum-orbit-sdk/tree/main/examples/setup-aep-fee-router) provided in the [Orbit SDK](https://github.com/OffchainLabs/arbitrum-orbit-sdk/tree/main)

<!--
### Canonical contracts

| Network | Contract | Address | Configured for |
| ------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------- | --------------- |
| Ethereum | `Parent2ChildRouter` | [0x40Cd7D713D7ae463f95cE5d342Ea6E7F5cF7C999](https://etherscan.io/address/0x40Cd7D713D7ae463f95cE5d342Ea6E7F5cF7C999) | `ETH`, `ERC-20` |
| Arbitrum Nova | `Child2ParentRouter` | [0x36D0170D92F66e8949eB276C3AC4FEA64f83704d](https://nova.arbiscan.io/address/0x36D0170D92F66e8949eB276C3AC4FEA64f83704d) | `ETH` |
| Base | `Child2ParentRouter` | [0x1015c1ae166c4c39d18a1151b7029bac1530c9aa](https://basescan.org/address/0x1015c1ae166c4c39d18a1151b7029bac1530c9aa) | `ETH` |
| Network | Contract | Address | Configured for |
| ------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | --------------- |
| Ethereum | `Arbitrum Foundation's multisig wallet` | [0x1Afa41C006dA1605846271E7bdae942F2787f941](https://etherscan.io/address/0x1Afa41C006dA1605846271E7bdae942F2787f941) | `ETH`, `ERC-20` |
| Arbitrum Nova | `Child2ParentRouter` | [0x36D0170D92F66e8949eB276C3AC4FEA64f83704d](https://nova.arbiscan.io/address/0x36D0170D92F66e8949eB276C3AC4FEA64f83704d) | `ETH` |
| Base | `Child2ParentRouter` | [0x1015c1ae166c4c39d18a1151b7029bac1530c9aa](https://basescan.org/address/0x1015c1ae166c4c39d18a1151b7029bac1530c9aa) | `ETH` |
-->

## The AEP fee router contract system

Expand All @@ -28,32 +30,28 @@ This section describes the different fee distribution and router contracts that

The **AEP fee router** system relies on configuring an escrow contract as the intended reward address for protocol fee components. This intermediary contract is known as the `RewardDistributor.`

The `RewardDistributor` is configured to separate the AEP portion of the fees from fees intended for the chain owner. The `RewardDistributor` can be permissionlessly called to perform a withdrawal which simultaneously transfers 90% of accrued fees to the chain’s fee collector and 10% of accrued fees to a routing contract on the parent chain. From here, the chain owner has complete control over their earned fees, and the routing contracts can direct AEP fees to a collecting address for the Arbitrum DAO.
The `RewardDistributor` is configured to separate the AEP portion of the fees from fees intended for the chain owner. The `RewardDistributor` can be permissionlessly called to perform a withdrawal which simultaneously transfers 90% of accrued fees to the chain’s fee collector and 10% of accrued fees to a target address on the parent chain. From here, the chain owner has complete control over their earned fees, and the routing contracts can direct AEP fees to a collecting address for the Arbitrum DAO.

### ChildToParentRouter

AEP fees from the `RewardDistributor` must first be sent to Ethereum before they can be deposited to the DAO-controlled address on Arbitrum One. To facilitate this transfer to Ethereum, AEP fees are sent through a series of contracts known as `ChildToParentRouters.`

The `ChildToParentRouter` is configured to withdraw a single token (immutable and specified at deployment) from the child chain to a specific target address on the parent chain: either another `ChildToParentRouter` or the `ParentToChildRouter` on Ethereum.

### ParentToChildRouter

All AEP fees from the network of Orbit chains will arrive at the `ParentToChildRouter` on Ethereum. This contract can send ETH and arbitrary ERC-20 tokens to a DAO-controlled address on Arbitrum One.
The `ChildToParentRouter` is configured to withdraw a single token (immutable and specified at deployment) from the child chain to a specific target address on the parent chain: either another `ChildToParentRouter` or an address controlled by the Arbitrum Foundation on Ethereum.

## Deploying your AEP fee router contracts

An Orbit chain is responsible for deploying all `ChildToParentRouters` necessary for their AEP funds to arrive at the `ParentToChildRouter` on Ethereum.
An Orbit chain is responsible for deploying all `ChildToParentRouters` necessary for their AEP funds to arrive at the address controlled by the Arbitrum Foundation on Ethereum.

This includes:

- Deploying a `ChildToParentRouter` on their Orbit chain configured for their gas token and configured to send funds to either:
- The `ParentToChildRouter` on Ethereum (assuming the network is a Layer-2)
- An address controlled by the Arbitrum Foundation on Ethereum (assuming the network is a Layer-2)
- Another `ChildToParentRouter` configured to the same gas token and configured to send funds to a successive parent chain (this is the case for a Layer-3 network or higher)
- Deploying a `RewardDistributor` contract configured to forward 10% of fees to the `ChildToParentRouter` and 90% to the chain owner’s preferred reward-receiving address.

In the event that a `ChildToParentRouter` does not connect to the `ParentToChildRouter` on Ethereum, an Orbit chain must deploy successive `ChildToParentRouter` contracts until a connection to `ParentToChildRouter` is established.
In the event that a `ChildToParentRouter` does not connect to the address controlled by the Arbitrum Foundation on Ethereum, an Orbit chain must deploy successive `ChildToParentRouter` contracts until a connection to such address is established. <!-- Additional `ChildToParentRouter` contracts configured to route ETH have been deployed in certain networks and can be leveraged by chains created on top of these networks. You can see which networks have a router deployed [here](#canonical-contracts). -->

And optionally, an Orbit chain can decide to deduct assertion costs by following the instructions in the [Deducting Assertion Costs](/launch-orbit-chain/how-tos/calculate-aep-fees#assertion-costs) section:
Optionally, an Orbit chain can decide to deduct assertion costs by following the instructions in the [Deducting Assertion Costs](/launch-orbit-chain/how-tos/calculate-aep-fees#assertion-costs) section:

<aside>
🚨 Layer-3 chains with custom gas tokens with L2-based token contracts cannot send their custom gas tokens to Ethereum. A future version of the AEP Fee Router may allow Orbit chains with L2-based tokens to distribute fees using the routing system.
Expand All @@ -66,13 +64,15 @@ In the absence of these, please send `ETH` through the AEP Fee Router to fulfill

The Orbit SDK provides a [configurable script](https://github.com/OffchainLabs/arbitrum-orbit-sdk/tree/main/examples/setup-aep-fee-router) that allows a chain operator to deploy quickly and set up the AEP fee router contracts.

<!--
::::info Note for L3 chains with custom gas tokens

The standard script deploys and sets up the AEP fee router contracts to route funds to the parent chain.
L2 chains are expectd to route funds to the [ParentToChildRouter contract](#canonical-contracts) living on Ethereum.
L2 chains are expected to route funds to the [multisig wallet owned by the Arbitrum Foundation](#canonical-contracts) living on Ethereum.
L3 chains (or further layers) might need to specify a different target address on the parent chain depending on the gas token of the chain. If the chain uses ETH as the gas token, and a [ChildToParentRouter](#canonical-contracts) contract is deployed in the parent chain, they can route their funds to that contract. If the chain uses a different gas token, please contact the Arbitrum Foundation to confirm the target address to withdraw the AEP fees to.

::::
-->

The script performs the following operations:

Expand All @@ -95,7 +95,7 @@ To configure the script, you need to specify the following [environment variable
- `ORBIT_CHAIN_ID`: chain id of the Orbit chain
- `ORBIT_CHAIN_RPC`: RPC of the Orbit chain
- `PARENT_CHAIN_ID`: chain id of the parent chain, which shouldn't be an Arbitrum chain
- `PARENT_CHAIN_TARGET_ADDRESS`: address on the parent chain where 10% of the revenue will be sent to. You can find the potential target addresses in the [canonical contracts](#canonical-contracts) section of this document. If the parent chain is not on that list, or if your chain uses a gas token different than the one the router is configured for, contact the Arbitrum Foundation to obtain a specific target address for your chain.
- `PARENT_CHAIN_TARGET_ADDRESS`: address on the parent chain where 10% of the revenue will be sent to. Please, contact the Arbitrum Foundation to obtain the specific target address for your chain. <!-- You can find the potential target addresses in the [canonical contracts](#canonical-contracts) section of this document. If the parent chain is not on that list, or if your chain uses a gas token different than the one the router is configured for, contact the Arbitrum Foundation to obtain a specific target address for your chain. -->

Finally, follow these steps to execute the script (from the `examples/setup-aep-fee-router` folder):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Indexers provide a convenient way to retrieve historic or application-specific d
- [Goldsky](https://goldsky.com/)
- [Ormi](https://www.ormilabs.xyz/)
- [Traceye](https://traceye.io/)
- [Sequence](https://sequence.xyz/indexer)

## Oracles

Expand All @@ -91,6 +92,7 @@ RPC endpoints are the primary interface through which users and developers inter
- [Ankr](https://www.ankr.com/)
- [Chainstack](https://chainstack.com/)
- [QuickNode](https://www.quicknode.com?utm_source=arb-docs)
- [Sequence](https://sequence.xyz/node-gateway)

## Alternative Data availability

Expand Down
2 changes: 1 addition & 1 deletion arbitrum-docs/partials/_glossary-partial.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ The STF (State Transition Function) defines how new blocks are produced from inp

### Stylus {#stylus}
<p>
Upgrade to the <a href="/intro/glossary#arbitrum-nitro">Arbitrum Nitro</a> virtual machine that allows smart contract support for languages like Rust and C++ by taking advantage of Nitro's use of WASM. Currently on testnet (<a href="https://docs.arbitrum.io/stylus/gentle-introduction">read more</a>).
Upgrade to the <a href="/intro/glossary#arbitrum-nitro">Arbitrum Nitro</a> virtual machine that allows smart contract support for languages like Rust and C++ by taking advantage of Nitro's use of WASM. Currently on testnet (<a href="https://docs.arbitrum.io/stylus/stylus-gentle-introduction">read more</a>).
</p>

### Timeboost {#timeboost}
Expand Down
2 changes: 1 addition & 1 deletion arbitrum-docs/partials/_troubleshooting-stylus-partial.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ You deploy a Stylus contract the same way that Solidity contracts are deployed.
</p>

<p>
You can find instructions for deploying a Stylus contract in our <a href="https://docs.arbitrum.io/stylus/quickstart#checking-your-stylus-project-is-valid">Quickstart</a>.
You can find instructions for deploying a Stylus contract in our <a href="https://docs.arbitrum.io/stylus/stylus-quickstart#checking-your-stylus-project-is-valid">Quickstart</a>.
</p>


Expand Down
Loading

0 comments on commit 55d8e68

Please sign in to comment.