Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

Foundry consists of:

  • Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
  • Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
  • Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
  • Chisel: Fast, utilitarian, and verbose solidity REPL.

Documentation

https://book.getfoundry.sh/

Usage

Hedera Pool Address Format

Hedera pool IDs like /pool/0.0.3964804 must be converted to a 20-byte EVM address before using them in Solidity/Forge.

$ ./scripts/hedera_pool_to_evm.sh /pool/0.0.3964804
hedera_id=0.0.3964804
evm_address=0x00000000000000000000000000000000003c7f84

For live contract-to-contract flows on Hedera mainnet, use the contract's canonical evm_address from mirror-node:

$ curl -s "https://mainnet-public.mirrornode.hedera.com/api/v1/contracts/0.0.3964804" | jq -r '.evm_address'
0xc5b707348da504e9be1bd4e21525459830e7b11d

Hedera Fork Tests

Hedera tests are configured to fork from the hedera RPC alias in foundry.toml.

$ forge test --match-path 'test/Hedera*.t.sol' -vv

Hedera Deploy

Pass the converted EVM pool address into your deploy script:

$ forge script script/DeployHypervisor.s.sol:DeployHypervisor \
  --rpc-url https://mainnet.hashio.io/api \
  --private-key $MAINNET_PRIVATE_KEY \
  --broadcast \
  --sig "run(address,address,string,string)" \
  0xc5b707348da504e9be1bd4e21525459830e7b11d \
  <HYPE_REGISTRY_ADDRESS> \
  "USDC-WHBAR Hypervisor" \
  "ssUSDC-WHBAR"

Current Hedera Mainnet Infra (2026-03-03 Latest Redeploy)

  • Signer: 0xe911f518449ba0011D84b047B4cde50dAA081eC1
  • Owner target: 0xc3Fd6DD55db9fee2c09851b51C5018a61fc84EE3
  • ClearingV3: 0x71aD86ec15e31C535201B308b65213b70eF0bD76
  • UniProxyETH: 0x62B249AdD835b6f224c8bfE52cd00aD981974BfD
  • Admin: 0x86275d1c85ff342C36caf33A666c78A67e2b7991
  • HypeRegistry: 0xBA77963d31d6683d1e0acB0C3F2B3f8cF80B66E7
  • RebalanceProxy: 0xFe4Cd7f5A7E0DaBFCC04dc424C9C3e849F8DC0a5

Hedera Live End-to-End (Deploy + Deposit + Rebalance)

script/HederaLiveIntegration.s.sol executes:

  1. Deploy infra (ClearingV3, UniProxyETH, Admin, HypeRegistry, RebalanceProxy)
  2. Deploy Hypervisor against Hedera pool 0.0.3964804 (or env override)
  3. Verify token0 and token1
  4. Initial direct deposit + owner rebalance
  5. Proxy deposit via UniProxyETH
  6. Rebalance via RebalanceProxy -> Admin -> Hypervisor

Read-only pool verification:

$ forge script script/HederaLiveIntegration.s.sol:HederaLiveIntegration \
  --sig "runReadOnly()" \
  --rpc-url https://mainnet.hashio.io/api -vvv

Full live flow:

$ forge script script/HederaLiveIntegration.s.sol:HederaLiveIntegration \
  --rpc-url https://mainnet.hashio.io/api -vvv

Note: on Hedera, HTS token approve/transferFrom paths are often not fully emulated by local script simulation. If simulation reverts on token ops, use broadcast with simulation disabled:

Broadcast live transactions:

$ forge script script/HederaLiveIntegration.s.sol:HederaLiveIntegration \
  --rpc-url https://mainnet.hashio.io/api \
  --skip-simulation \
  --broadcast -vvv

Important env vars used by the script:

  • MAINNET_PRIVATE_KEY (required)
  • HEDERA_POOL_CONTRACT_ID (default 3964804)
  • HEDERA_INITIAL_DEPOSIT0 / HEDERA_INITIAL_DEPOSIT1
  • HEDERA_PROXY_DEPOSIT0 / HEDERA_PROXY_DEPOSIT1
  • HEDERA_MAX_SLIPPAGE_BPS (default 500)
  • HEDERA_LIMIT_WIDTH_MULTIPLIER (default 20)
  • HEDERA_MINT_FEE_FUND_MULTIPLIER (default 6)
  • HEDERA_STRICT_TOKEN_CHECK (default true)
  • HEDERA_HYPE_NAME / HEDERA_HYPE_SYMBOL

Build

$ forge build

Test

$ forge test

Format

$ forge fmt

Gas Snapshots

$ forge snapshot

Anvil

$ anvil

Deploy

$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>

Cast

$ cast <subcommand>

Help

$ forge --help
$ anvil --help
$ cast --help

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages