Skip to content

Commit

Permalink
Merge pull request #1963 from OffchainLabs/henry-run-aep-scripts
Browse files Browse the repository at this point in the history
AEP scripts tutorial
  • Loading branch information
pete-vielhaber authored Jan 13, 2025
2 parents c9462d5 + 7047b66 commit 4653932
Showing 1 changed file with 36 additions and 0 deletions.
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

Any `ChildToParentRouter` contract 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`).

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
```

0 comments on commit 4653932

Please sign in to comment.