Build, fork and test
The Solidity project lives in protocol/ and uses Foundry with Aave V3 Origin 3.6.0. DeployBsc.s.sol deploys the BNB Chain listing, and you rehearse it on a local Anvil fork first.
Build locally
cd protocol
npm ci
forge install foundry-rs/forge-std@v1.9.7 --no-git
forge build
forge testTest tokens and test feeds live in test/utils/ and are never deployed. The fork suites are skipped unless you set BLUE_RUN_BNB_FORK_TESTS=true and point BSC_RPC_URL at a BNB mainnet RPC. They run in Foundry’s local fork and send nothing to BNB mainnet.
Test suites
| Suite | What it covers |
|---|---|
BluePoolTest | Offline scenarios with test bStocks, test feeds and test USDT, so halts, splits and price gaps can be scripted. |
BluePoolBnbForkTest | The same scenarios with real USDT in a local BNB mainnet fork. |
BscMainnetForkTest | The real listing: all five bStocks, their Atlas feeds and Chainlink USDT/USD. A TSLAB loan goes through supply, borrow, repay and withdraw. |
AproCrossCheckForkTest | The optional APRO module against live feeds, with checks for both allowlisted and unauthorized callers. |
Local fork deployment
DeployBsc.s.sol configures the pool with the BNB Chain assets and feeds. Start an Anvil fork, set BLUE_KEEPER, BLUE_GUARDIAN and BLUE_SIGNER, then dry-run the script against the local RPC. Use a guardian address different from the deployer.
anvil --fork-url "$BSC_RPC_URL" --chain-id 56
forge script script/DeployBsc.s.sol:DeployBsc --rpc-url http://127.0.0.1:8545 --account <local-keystore> --sender <local-deployer>To deploy on the local fork, repeat the forge script command with --broadcast against the same local RPC. Set BLUE_SEED_USDT in raw 18-decimal units to seed the reserve from a funded deployer account.
The script checks the chain ID and USDT code. A mainnet broadcast requires BLUE_ALLOW_MAINNET=true and explicit owner approval.
BNB Chain listing
BscMainnet.sol holds the token and feed addresses for TSLAB, NVDAB, QQQB, SPCXB, GOOGLB, USDT and the Chainlink USDT/USD feed, checked on-chain on November 27, 2026. The Atlas feed addresses are the instances Lista lists, and reads are open to any caller.