@gearbox-protocol/permissionless-cli
v0.1.8
Published
Permissionsless scripts
Keywords
Readme
Gearbox Permissionless scripts
Environment Variables
Ensure the following environment variables are properly configured:
RPC_URL– RPC URLANVIL_URL– Testnet RPC URL for txs simulations and batchingADDRESS_PROVIDER– Address of the "Address Provider" contract- The address for the Mainnet Address Provider:
0xF7f0a609BfAb9a0A98786951ef10e5FE26cC1E38
- The address for the Mainnet Address Provider:
PRIVATE_KEY– Private keyPINATA_JWT– Pinata JWT token for IPFS uploadPINATA_GATEWAY– Pinata gateway URL
Scripts arguments
Ensure the following environment variables are properly configured:
-r,--rpc-urlMainnet RPC URL. If not provided, the script assumes you're using a testnet.
Env var:RPC_URL--anvil-url(mandatory)
RPC URL for testnet simulations and batching.
Env var:ANVIL_URL-p,--address-provider>
Address of the AddressProvider contract.
Env var:ADDRESS_PROVIDER-k,--private-key
Private key for mainnet transactions.
Env var:PRIVATE_KEY-a,--account
Testnet account address. Defaults to the InstanceManager owner if not provided.-o,--out-dir
Directory path to save output results.
Env var:OUTPUT_DIR--testnet
Flag to indicate usage of a testnet.--execute
Actually execute the prepared transactions.--force
Force transaction execution, ignoring safety checks.--timelock
Wrap transactions usingqueueTransaction(timelock logic).-s,--skip-batching
Skip batching transactions. Useful to debug Anvil issues.
Default:false-c,--config
Path to the configuration file.
Default:undefined-e,--eta(mandatory for --timelock)
ETA timestamp for queued transactions.
Default:undefined-m,--market-configurator(mandatory for --timelock)
Address of the MarketConfigurator contract.-u,--uploadUpload transactions to ipfs
Scripts Information
- Update price feeds
Update price feeds.pnpm start update-feeds
- Batch txs
Simaulte and convert RawTxs from json to Safe Bathces.pnpm start batch-txs -t "path/to/txs"
- Execute batches
Create execute txs for queued batchespnpm start execute-batches
Router Deployment and Setup
To deploy and configure the Router, follow these steps.
Configuration file: src/commands/configs/routerConfig.ts
Prerequisites
Configure router for your network Edit
src/commands/configs/routerConfig.tsand add/update the configuration for your chain ID with the required workers.Start Anvil fork
anvil --fork-url <YOUR_RPC_URL>Configure environment variables Ensure all variables from
.env.exampleare set:RPC_URL– RPC URLANVIL_URL– Testnet RPC URL for simulations (e.g.,http://127.0.0.1:8545)ADDRESS_PROVIDER– Address of the AddressProvider contractPRIVATE_KEY– Private key for transactionsPINATA_JWT– Pinata JWT token for IPFS uploadPINATA_GATEWAY– Pinata gateway URL
Deploy Router
pnpm start deploy-router --executeRestart Anvil
After deployment, restart the Anvil fork before running setup:
# Stop current Anvil instance (Ctrl+C) and start again
anvil --fork-url <YOUR_RPC_URL>Setup Router
pnpm start setup-router --testnet --execute --uploadWithdrawal Compressor Deployment and Setup
To deploy and configure the Withdrawal Compressor, follow these steps.
Configuration file: src/commands/configs/withdrawalCompressorConfig.ts
Prerequisites
Configure withdrawal compressor for your network Edit
src/commands/configs/withdrawalCompressorConfig.tsand add/update the configuration for your chain ID with the required subcompressors.Start Anvil fork
anvil --fork-url <YOUR_RPC_URL>Configure environment variables Ensure all variables from
.env.exampleare set:RPC_URL– RPC URLANVIL_URL– Testnet RPC URL for simulations (e.g.,http://127.0.0.1:8545)ADDRESS_PROVIDER– Address of the AddressProvider contractPRIVATE_KEY– Private key for transactionsPINATA_JWT– Pinata JWT token for IPFS uploadPINATA_GATEWAY– Pinata gateway URL
Deploy Withdrawal Compressor
pnpm start deploy-withdrawal-compressor --executeRestart Anvil
After deployment, restart the Anvil fork before running setup:
# Stop current Anvil instance (Ctrl+C) and start again
anvil --fork-url <YOUR_RPC_URL>Setup Withdrawal Compressor
pnpm start setup-withdrawal-compressor --testnet --execute --upload