Intall foundry if haven't
Create a .env with PRIVATE_KEY =0x...
To run tests using Foundry, execute the following command:
forge test --fork-url sepolia -vvv
The forking ensures proper referencing of the Hats contract deployed on-chain.
- Update ownerTwo in
config.json
to not be your address - Adjust any other params in
config.json
and they will update globally across deployments and tests - If making a new test inherit the
DeploymentSetup.t.sol
to make it work form deployment
To deploy the contracts on the network, add the --broadcast
flag to the script command:
forge script -vvv ./scripts/DeployHamzaVault.s.sol:DeployHamzaVault \
--rpc-url sepolia \
--sender 0x000 \
--broadcast
You can run the deployment script without actually deploying the contract using the following command:
forge script -vvv ./scripts/DeployHamzaVault.s.sol:DeployHamzaVault \
--rpc-url sepolia \
--sender 0x...
-
Run the
DeployBaalSummoner.s.sol
script on the chain of your choice:forge script -vvv ./scripts/DeployBaalSummoner.s.sol:DeployCustomBaalSummoner \ --rpc-url <RPC-URL> \ --sender 0x... \ --broadcast
-
Add the deployed address from
DeployBaalSummoner
toDeploymentSetup.t.sol
by updating theBAAL_SUMMONER
variable.
The config.json
file contains key settings for deployment and testing. Below is an explanation of each parameter:
-
mode: Determines the deployment environment.
Test
: Used for testing.Deploy
: Used for live deployments with logging enabled.
-
owners:
ownerTwo
: The secondary owner address.
-
baal:
sharesName
: Name of the governance share tokens.sharesSymbol
: Symbol for the governance shares.pauseSharesOnInit
: Whether to pause share transfers at the beginning.pauseLootOnInit
: Whether to pause loot (non-voting) token transfers initially.safeSharesToMint
: Initial governance shares allocated to the safe.userLootAmount
: Number of loot tokens deploying user receives.vaultLootAmount
: Number of loot tokens allocated to the vault.votingPeriod
: Duration (in seconds) for voting on proposals.gracePeriod
: Time (in seconds) after voting ends before execution.proposalOffering
: Required ETH amount for non-members to submit proposals.sponsorThreshold
: Minimum number of shares required to sponsor a proposal.minRetentionPercent
: Minimum percentage of shares required to prevent mass exits before execution.quorumPercent
: Minimum percentage of total shares required to vote "yes" for a proposal to pass.
-
governanceToken:
name
: Name of the governance token.symbol
: Symbol for the governance token.
-
governanceVault:
vestingPeriod
: Time (in days) for governance token vesting.
-
governor:
timelockDelay
: Delay (in blocks or time) before execution of governance proposals.
-
systemSettings:
feeBPS
: Fee basis points (0 means no fee).
-
escrow:
autoRelease
: Whether the escrow automatically releases funds upon conditions being met.
The config.json
file is used to ensure consistent deployment settings across tests and live deployments. Adjust these parameters before running any scripts.