More Vaults Core is a system for creating and managing vault contracts using the Diamond Pattern (EIP-2535). The project is built on Foundry and supports creating upgradeable vault contracts.
- Foundry
- Node.js (for dependencies)
# Clone the repository
git clone <repository-url>
cd More-Vaults
# Install Foundry dependencies
forge install
# Build the project
forge buildforge buildforge testforge snapshotanvilCreate a .env file in the project root with the following variables:
# Private key for signing transactions
PRIVATE_KEY=your_private_key_here
# Vault roles
OWNER=0x... # Vault owner address
CURATOR=0x... # Vault curator address
GUARDIAN=0x... # Vault guardian address
FEE_RECIPIENT=0x... # Fee recipient address
# Base asset for vault
UNDERLYING_ASSET=0x... # Token address to be used in vault
# Vault parameters
FEE=500 # Fee in basis points (500 = 5%)
DEPOSIT_CAPACITY=1000000000000000000000000 # Maximum deposit capacity (in wei with decimals of underlying asset)
TIME_LOCK_PERIOD=86400 # Time lock period in seconds (86400 = 1 day), for test purposes set it as 0
MAX_SLIPPAGE_PERCENT=1000 # Maximum slippage in basis points (1000 = 10%)
# Vault metadata
VAULT_NAME="My Vault" # Vault name
VAULT_SYMBOL="MV" # Vault symbol
# Deployment parameters
IS_HUB=true # true for hub vault, false for spoke vault
SALT=0x0000000000000000000000000000000000000000000000000000000000000001 # Salt for CREATE2
# Deployed core contract addresses, can be found in .env.deployments or in the docs
DIAMOND_LOUPE_FACET=0x...
ACCESS_CONTROL_FACET=0x...
CONFIGURATION_FACET=0x...
VAULT_FACET=0x...
MULTICALL_FACET=0x...
ERC4626_FACET=0x...
ERC7540_FACET=0x...
ORACLE_REGISTRY=0x...
VAULT_REGISTRY=0x...
VAULTS_FACTORY=0x...forge script scripts/CreateVault.s.sol:CreateVaultScript \
--chain-id 545 \
--rpc-url https://testnet.evm.nodes.onflow.org \
-vv \
--slow \
--broadcast \
--verify \
--verifier blockscout \
--verifier-url 'https://evm-testnet.flowscan.io/api/'forge script scripts/CreateVault.s.sol:CreateVaultScript \
--chain-id 747 \
--rpc-url https://mainnet.evm.nodes.onflow.org \
-vv \
--slow \
--broadcast \
--verify \
--verifier blockscout \
--verifier-url 'https://evm.flowscan.io/api/'forge script scripts/CreateVault.s.sol:CreateVaultScript \
--chain-id 11155111 \
--rpc-url YOUR_RPC_URL \
-vv \
--slow \
--broadcast \
--verify \
--verifier blockscout \
--verifier-url 'https://sepolia.etherscan.io/api/'After successful script execution:
- Vault will be deployed to an address that will be printed to console
- Vault address will be saved to
.env.deploymentsfile - Contract will be verified on the blockchain explorer
src/
├── facets/ # Diamond facets (functionality)
├── factory/ # Vault factory
├── registry/ # Vault registry
├── interfaces/ # Interfaces
└── MoreVaultsDiamond.sol # Main Diamond contract
scripts/
├── Deploy.s.sol # System deployment script
├── CreateVault.s.sol # Vault creation script
└── config/ # Deployment configuration
test/ # Tests
lib/ # Foundry dependencies
cast <subcommand>forge --help
anvil --help
cast --help