Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AEP scripts tutorial #1963

Merged
merged 15 commits into from
Jan 13, 2025
36 changes: 36 additions & 0 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 @@ -112,3 +112,39 @@ cp .env.example .env
```shell
yarn dev
```

## Triggering Movement of Funds
godzillaba marked this conversation as resolved.
Show resolved Hide resolved

Any `ChildToParentRouter` contracts deployed by an Orbit chain must be periodically called to move funds.
The following commands should be set up to execute at the same interval as the router's minimum distribution interval (`minDistributionIntervalSeconds`).
godzillaba marked this conversation as resolved.
Show resolved Hide resolved

The [router contracts repository](https://github.com/OffchainLabs/fund-distribution-contracts) contains scripts for calling the routers.

1. Periodically trigger withdrawals to the parent chain

::::info

If the `ChildToParentRouter` is routing its chain's native token, this step should be skipped.

::::

```shell
cast send <router_on_child_address> "routeToken()" --rpc-url <child_rpc_url> --private_key <private_key>
```

2. Periodically redeem withdrawals on the parent chain

```shell
git clone https://github.com/OffchainLabs/fund-distribution-contracts
cd fund-distribution-contracts && yarn

# set PARENT_CHAIN_PK in .env
cp .env.sample .env

# add --opStack if the router is on an OP stack chain
yarn redeem-child-to-parent \
--parentRPCUrl <parent_rpc_url> \
--childRPCUrl <child_rpc_url> \
--childToParentRewardRouterAddr <router_on_child_address> \
--oneOff
```
Loading