Skip to content

Commit 4653932

Browse files
Merge pull request #1963 from OffchainLabs/henry-run-aep-scripts
AEP scripts tutorial
2 parents c9462d5 + 7047b66 commit 4653932

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

arbitrum-docs/launch-orbit-chain/how-tos/set-up-aep-fee-router.mdx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,39 @@ cp .env.example .env
112112
```shell
113113
yarn dev
114114
```
115+
116+
## Triggering movement of funds
117+
118+
Any `ChildToParentRouter` contract deployed by an Orbit chain must be periodically called to move funds.
119+
The following commands should be set up to execute at the same interval as the router's minimum distribution interval (`minDistributionIntervalSeconds`).
120+
121+
The [router contracts repository](https://github.com/OffchainLabs/fund-distribution-contracts) contains scripts for calling the routers.
122+
123+
1. Periodically trigger withdrawals to the parent chain
124+
125+
::::info
126+
127+
If the `ChildToParentRouter` is routing its chain's native token, this step should be skipped.
128+
129+
::::
130+
131+
```shell
132+
cast send <router_on_child_address> "routeToken()" --rpc-url <child_rpc_url> --private_key <private_key>
133+
```
134+
135+
2. Periodically redeem withdrawals on the parent chain
136+
137+
```shell
138+
git clone https://github.com/OffchainLabs/fund-distribution-contracts
139+
cd fund-distribution-contracts && yarn
140+
141+
# set PARENT_CHAIN_PK in .env
142+
cp .env.sample .env
143+
144+
# add --opStack if the router is on an OP stack chain
145+
yarn redeem-child-to-parent \
146+
--parentRPCUrl <parent_rpc_url> \
147+
--childRPCUrl <child_rpc_url> \
148+
--childToParentRewardRouterAddr <router_on_child_address> \
149+
--oneOff
150+
```

0 commit comments

Comments
 (0)