> ## Documentation Index
> Fetch the complete documentation index at: https://docs.redpotion.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployments

> Red Potion's canonical contracts are deployed and verified per network. Deployed addresses live in the deployments/ directory of the contracts repository, one JSON file per network

Red Potion's canonical contracts are deployed and verified per network. Deployed addresses live in the [`deployments/`](https://github.com/zentryHQ/red-potion-contract/tree/main/deployments) directory of the contracts repository, one JSON file per network.

## Networks

| Network                | Deployment file                                                                                                            |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| Ethereum mainnet       | [`deployments/mainnet.json`](https://github.com/zentryHQ/red-potion-contract/blob/main/deployments/mainnet.json)           |
| Base Sepolia (testnet) | [`deployments/base-sepolia.json`](https://github.com/zentryHQ/red-potion-contract/blob/main/deployments/base-sepolia.json) |

The **entrypoint** address in each file is `fundManagerDeployer` — the protocol root. The remaining entries are implementation addresses for each contract type; live proxies are created from these through the factories.

<Info>
  Addresses change as networks are added and implementations are upgraded. Always read the current value from the deployment JSON in the repository rather than hard-coding an address.
</Info>

## Toolchain

Red Potion is a [Foundry](https://book.getfoundry.sh/) project (Solidity `0.8.34`, OpenZeppelin v5 upgradeable). Common commands:

```bash theme={"dark"}
# Build
forge build

# Test
forge test

# Format
forge fmt

# Deploy infrastructure (writes deployments/$NETWORK.json)
NETWORK=base-sepolia forge script script/DeployInfra.s.sol \
  --rpc-url base-sepolia --broadcast

# Verify on Etherscan
./script/verify-base-sepolia.sh

# Upgrade implementations on a live network
./script/upgrade-impls.sh
```

RPC endpoints and Etherscan keys are configured via `MAINNET_RPC_URL`, `BASE_SEPOLIA_RPC_URL`, and `ETHER_SCAN_API_KEY` environment variables (see [`foundry.toml`](https://github.com/zentryHQ/red-potion-contract/blob/main/foundry.toml)).

## Repository layout

```
src/
├── *.sol                 # 13 deployed contracts
├── interfaces/           # One interface per contract + module interfaces
├── libraries/            # AssetSet (array union), TransferHelper (ERC20 + ETH)
└── modules/              # Composable behavior mixed into Fund / Strategy / spokes
script/
├── DeployInfra.s.sol     # Deploys implementations + FundManagerDeployer proxy
├── upgrade-impls.sh      # Redeploy impls & upgrade live proxies
├── verify-*.sh           # Etherscan verification per network
└── Log*.s.sol            # Introspection helpers
deployments/              # Per-network deployed addresses (JSON)
test/                     # Foundry tests
lib/                      # Dependencies (OpenZeppelin upgradeable, forge-std)
abi/                      # Exported ABIs
```

## Upgrading a live deployment

Changing an implementation on the [FundManagerDeployer](/developers/contract-reference/fund-manager-deployer) or a [Factory](/developers/contract-reference/factory) affects **future** deployments only. Existing proxies are upgraded individually through their own ProxyAdmins, owned by the `proxyAdmin` set at tenant/fund creation — see [Access Control & Roles](/developers/access-control-and-roles). The interactive `script/upgrade-impls.sh` helper handles redeploying implementations and upgrading live proxies.
