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

improve(tasks): Update deposit route script #581

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

pxrl
Copy link
Contributor

@pxrl pxrl commented Aug 13, 2024

This change updates the enable-l1-token-across-ecosystem task to do the following:

  • Auto-inherit the complete set of known chain IDs if not otherwise specified via the --chains option.
  • Display token symbols alongside token addresses.
  • Drop superfluous numbers from log messages (they were manually maintained and non-sequential).
  • Throw on default network (hardhat).
  • Sub in symbolic chainId names instead of hardcoded values.
  • Sort chain IDs numerically for cleaner display when iterating over chains.
  • Append setPoolRebalanceRoute calldata.

A few updates:
- Auto-inherit the complete set of known chain IDs if not otherwise
  specified via the --chains option.
- Display token symbols alongside token addresses.
- Drop superfluous numbers from log messages (they were manually
  maintained and non-sequential).
- Throw on default network (hardhat).
- Sub in symbolic chainId names instead of hardcoded values.

Signed-off-by: Paul <[email protected]>
@pxrl
Copy link
Contributor Author

pxrl commented Aug 13, 2024

Here's an example of the script output after this change:

yarn run v1.22.15
$ dev/across-protocol/contracts/node_modules/.bin/hardhat enable-l1-token-across-ecosystem --network mainnet --token USDC --depositroutechains 7777777

Only adding deposit routes involving chains on list 7777777

Have you setup the ConfigStore for this token? If not then this script will exit because a rate model must be set before the first deposit is sent otherwise the bots will error out (y/n) 
Running task to enable L1 token over entire Across ecosystem 🌉. L1 token: 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

Parsed 'chains' argument: [
        1,    10,    137,
      324,   690,   1135,
     8453, 34443,  42161,
    59144, 81457, 534352,
  7777777
]

Loading L2 companion token address for provided L1 token.
┌─────────┬─────────┬──────────┬──────────────────────────────────────────────┐
│ (index) │ chainId │  symbol  │                   address                    │
├─────────┼─────────┼──────────┼──────────────────────────────────────────────┤
│    0    │    1    │  'USDC'  │ '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' │
│    1    │   10    │  'USDC'  │ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85' │
│    2    │   137   │  'USDC'  │ '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359' │
│    3    │   324   │ 'USDC.e' │ '0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4' │
│    4    │   690   │  '----'  │ '------------------------------------------' │
│    5    │  1135   │  '----'  │ '------------------------------------------' │
│    6    │  8453   │  'USDC'  │ '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' │
│    7    │  34443  │ 'USDC.e' │ '0xd988097fb8612cc24eeC14542bC03424c656005f' │
│    8    │  42161  │  'USDC'  │ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' │
│    9    │  59144  │ 'USDC.e' │ '0x176211869cA2b568f2A7D4EE941E073a821EE1ff' │
│   10    │  81457  │  '----'  │ '------------------------------------------' │
│   11    │ 534352  │  'USDC'  │ '0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4' │
│   12    │ 7777777 │ 'USDzC'  │ '0xCccCCccc7021b32EBb4e8C08314bD62F7c653EC4' │
└─────────┴─────────┴──────────┴──────────────────────────────────────────────┘

Do these token addresses match your expectations? (y/n)
Constructing calldata to enable these tokens. Using HubPool at address: 0xc186fA914353c44b2E33eBE05f21846F1048bEda

Adding calldata to enable routes between all chains and tokens:
   1 Added route for 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 from       1 -> 7777777.
   2 Added route for 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85 from      10 -> 7777777.
   3 Added route for 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359 from     137 -> 7777777.
   4 Added route for 0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4 from     324 -> 7777777.
   5 Added route for 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 from    8453 -> 7777777.
   6 Added route for 0xd988097fb8612cc24eeC14542bC03424c656005f from   34443 -> 7777777.
   7 Added route for 0xaf88d065e77c8cC2239327C5EDb3A432268e5831 from   42161 -> 7777777.
   8 Added route for 0x176211869cA2b568f2A7D4EE941E073a821EE1ff from   59144 -> 7777777.
   9 Added route for 0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4 from  534352 -> 7777777.
  10 Added route for 0xCccCCccc7021b32EBb4e8C08314bD62F7c653EC4 from 7777777 ->       1.
  11 Added route for 0xCccCCccc7021b32EBb4e8C08314bD62F7c653EC4 from 7777777 ->      10.
  12 Added route for 0xCccCCccc7021b32EBb4e8C08314bD62F7c653EC4 from 7777777 ->     137.
  13 Added route for 0xCccCCccc7021b32EBb4e8C08314bD62F7c653EC4 from 7777777 ->     324.
  14 Added route for 0xCccCCccc7021b32EBb4e8C08314bD62F7c653EC4 from 7777777 ->     690.
  15 Added route for 0xCccCCccc7021b32EBb4e8C08314bD62F7c653EC4 from 7777777 ->    1135.
  16 Added route for 0xCccCCccc7021b32EBb4e8C08314bD62F7c653EC4 from 7777777 ->    8453.
  17 Added route for 0xCccCCccc7021b32EBb4e8C08314bD62F7c653EC4 from 7777777 ->   34443.
  18 Added route for 0xCccCCccc7021b32EBb4e8C08314bD62F7c653EC4 from 7777777 ->   42161.
  19 Added route for 0xCccCCccc7021b32EBb4e8C08314bD62F7c653EC4 from 7777777 ->   59144.
  20 Added route for 0xCccCCccc7021b32EBb4e8C08314bD62F7c653EC4 from 7777777 ->   81457.
  21 Added route for 0xCccCCccc7021b32EBb4e8C08314bD62F7c653EC4 from 7777777 ->  534352.

  Skipped route for 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on chains 1 -> 10, 137, 324, 690, 1135, 8453, 34443, 42161, 59144, 81457, 534352.
  Skipped route for 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85 on chains 10 -> 1, 137, 324, 690, 1135, 8453, 34443, 42161, 59144, 81457, 534352.
  Skipped route for 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359 on chains 137 -> 1, 10, 324, 690, 1135, 8453, 34443, 42161, 59144, 81457, 534352.
  Skipped route for 0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4 on chains 324 -> 1, 10, 137, 690, 1135, 8453, 34443, 42161, 59144, 81457, 534352.
  Skipped route for 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 on chains 8453 -> 1, 10, 137, 324, 690, 1135, 34443, 42161, 59144, 81457, 534352.
  Skipped route for 0xd988097fb8612cc24eeC14542bC03424c656005f on chains 34443 -> 1, 10, 137, 324, 690, 1135, 8453, 42161, 59144, 81457, 534352.
  Skipped route for 0xaf88d065e77c8cC2239327C5EDb3A432268e5831 on chains 42161 -> 1, 10, 137, 324, 690, 1135, 8453, 34443, 59144, 81457, 534352.
  Skipped route for 0x176211869cA2b568f2A7D4EE941E073a821EE1ff on chains 59144 -> 1, 10, 137, 324, 690, 1135, 8453, 34443, 42161, 81457, 534352.
  Skipped route for 0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4 on chains 534352 -> 1, 10, 137, 324, 690, 1135, 8453, 34443, 42161, 59144, 81457.

***DONE.***
Calldata to enable desired token has been constructed!
CallData contains 21 transactions, which can be sent in one multicall to hub pool @ 0xc186fA914353c44b2E33eBE05f21846F1048bEda🚀
[0x56864f380000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000076adf1000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000076adf10000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff850000000000000000000000000000000000000000000000000000000000000001,0x56864f380000000000000000000000000000000000000000000000000000000000000089000000000000000000000000000000000000000000000000000000000076adf10000000000000000000000003c499c542cef5e3811e1192ce70d8cc03d5c33590000000000000000000000000000000000000000000000000000000000000001,0x56864f380000000000000000000000000000000000000000000000000000000000000144000000000000000000000000000000000000000000000000000000000076adf10000000000000000000000003355df6d4c9c3035724fd0e3914de96a5a83aaf40000000000000000000000000000000000000000000000000000000000000001,0x56864f380000000000000000000000000000000000000000000000000000000000002105000000000000000000000000000000000000000000000000000000000076adf1000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000000868b000000000000000000000000000000000000000000000000000000000076adf1000000000000000000000000d988097fb8612cc24eec14542bc03424c656005f0000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000000a4b1000000000000000000000000000000000000000000000000000000000076adf1000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58310000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000000e708000000000000000000000000000000000000000000000000000000000076adf1000000000000000000000000176211869ca2b568f2a7d4ee941e073a821ee1ff0000000000000000000000000000000000000000000000000000000000000001,0x56864f380000000000000000000000000000000000000000000000000000000000082750000000000000000000000000000000000000000000000000000000000076adf100000000000000000000000006efdbff2a14a7c8e15944d1f4a48f9f95f663a40000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000076adf10000000000000000000000000000000000000000000000000000000000000001000000000000000000000000cccccccc7021b32ebb4e8c08314bd62f7c653ec40000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000076adf1000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000cccccccc7021b32ebb4e8c08314bd62f7c653ec40000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000076adf10000000000000000000000000000000000000000000000000000000000000089000000000000000000000000cccccccc7021b32ebb4e8c08314bd62f7c653ec40000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000076adf10000000000000000000000000000000000000000000000000000000000000144000000000000000000000000cccccccc7021b32ebb4e8c08314bd62f7c653ec40000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000076adf100000000000000000000000000000000000000000000000000000000000002b2000000000000000000000000cccccccc7021b32ebb4e8c08314bd62f7c653ec40000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000076adf1000000000000000000000000000000000000000000000000000000000000046f000000000000000000000000cccccccc7021b32ebb4e8c08314bd62f7c653ec40000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000076adf10000000000000000000000000000000000000000000000000000000000002105000000000000000000000000cccccccc7021b32ebb4e8c08314bd62f7c653ec40000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000076adf1000000000000000000000000000000000000000000000000000000000000868b000000000000000000000000cccccccc7021b32ebb4e8c08314bd62f7c653ec40000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000076adf1000000000000000000000000000000000000000000000000000000000000a4b1000000000000000000000000cccccccc7021b32ebb4e8c08314bd62f7c653ec40000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000076adf1000000000000000000000000000000000000000000000000000000000000e708000000000000000000000000cccccccc7021b32ebb4e8c08314bd62f7c653ec40000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000076adf10000000000000000000000000000000000000000000000000000000000013e31000000000000000000000000cccccccc7021b32ebb4e8c08314bd62f7c653ec40000000000000000000000000000000000000000000000000000000000000001,0x56864f38000000000000000000000000000000000000000000000000000000000076adf10000000000000000000000000000000000000000000000000000000000082750000000000000000000000000cccccccc7021b32ebb4e8c08314bd62f7c653ec40000000000000000000000000000000000000000000000000000000000000001]
Done in 18.74s.

depositroutes.txt

@pxrl
Copy link
Contributor Author

pxrl commented Aug 13, 2024

Pulling this back to draft to address a couple of tsc issues.

@pxrl pxrl marked this pull request as draft August 13, 2024 23:26
Signed-off-by: Paul <[email protected]>
Signed-off-by: Paul <[email protected]>
Signed-off-by: Paul <[email protected]>
@pxrl pxrl marked this pull request as ready for review August 14, 2024 12:29
Copy link
Contributor

@bmzig bmzig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants