Deployment and utility scripts for interacting with the Blend Protocol and setting up mock environments.
- Clone the blend-contracts and build the contracts. This needs to be a sibling, ie:
parent-folder/
blend-utils/
blend-contracts/
- Install Node.JS dependencies:
npm i- Compile the scripts
npm run build- Create a
.envfile based on the.env.examplefile
The deployment script takes in a single "network" parameter that defines what is deployed.
If the network is mainnet, no mocked contracts will be deployed (like the mock_oracle). A network.contracts.json file will be created or replaced with the newly deployed contract addresses and WASM hashes used. All transactions will be sourced and payed for by the ADMIN key defined in the .env file.
To deploy the contracts on a "network_name" network, run:
node --es-module-specifier-resolution=node ./lib/scripts/setup.js network_nameTest environments optionally come with default data. The mock script does a few things to help make interacting with Blend in a test environment easier:
- Creates a handful of test tokens, including XLM's Stellar Asset Contract (SAC), USDC with a SAC, and some Soroban native tokens.
- Sets prices for the test tokens on the mock oracle.
- Creates two pools with a set of assets.
- Deposits into the backstop for the pools with
WHALEand adds the pools into the reward zone. - Starts the next emission cycle.
- Deposits and borrows assets from each pool from
WHALE.
To add mock data to the Blend protocol in a the "network_name" test network, run:
node --es-module-specifier-resolution=node ./lib/scripts/mock.js network_name