Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middleware unit tests #2

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ docs/

# Dotenv file
.env
.env.local

.history/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "lib/core"]
path = lib/core
url = https://github.com/symbioticfi/core
[submodule "lib/foundry-devops"]
path = lib/foundry-devops
url = https://github.com/Cyfrin/foundry-devops
60 changes: 20 additions & 40 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,33 @@
.PHONY: all test clean deploy fund help install snapshot format anvil

DEFAULT_ANVIL_KEY := 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
DEFAULT_OWNER := 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
DEFAULT_VAULT_CONFIGURATOR := 0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f # This works since every run is seeded


all: clean remove install update build

# Clean the repo
clean :; forge clean

# Remove modules
remove :; rm -rf .gitmodules && rm -rf .git/modules/* && rm -rf lib && touch .gitmodules && git add . && git commit -m "modules"
remove :; rm -rf .gitmodules && rm -rf .git/modules/* && rm -rf lib && touch .gitmodules

install :; forge install foundry-rs/[email protected] --no-commit && forge install openzeppelin/[email protected] --no-commit && forge install openzeppelin/[email protected] --no-commit && forge install symbioticfi/core --no-commit
install :; forge install foundry-rs/[email protected] --no-commit && \
forge install openzeppelin/[email protected] --no-commit && \
forge install openzeppelin/[email protected] --no-commit && \
forge install symbioticfi/core --no-commit && \
forge install symbioticfi/rewards --no-commit && \
forge install Cyfrin/foundry-devops --no-commit

# Update Dependencies
update:; forge update

build:; forge build

test :; forge test
test :; forge test

testv :; forge test -vvvv

coverage :; forge coverage

snapshot :; forge snapshot

Expand All @@ -31,41 +39,13 @@ anvil :; anvil -m 'test test test test test test test test test test test junk'

NETWORK_ARGS := --rpc-url http://localhost:8545 --private-key $(DEFAULT_ANVIL_KEY) --broadcast

deploy-symbiotic:
deploy:
@echo "🚀 Deploying contracts..."

@echo "📡 Deploying Core..."
@forge script lib/core/script/deploy/Core.s.sol:CoreScript $(DEFAULT_OWNER) --sig "run(address)" $(NETWORK_ARGS)
@echo "✅ Core deployment completed"

@echo "📡 Deploying NetworkRegistry..."
@forge script lib/core/script/deploy/NetworkRegistry.s.sol:NetworkRegistryScript $(NETWORK_ARGS)
@echo "✅ NetworkRegistry deployment completed"

@echo "📡 Deploying MetadataService..."
@forge script lib/core/script/deploy/MetadataService.s.sol:MetadataServiceScript ${DEFAULT_OWNER} --sig "run(address)" $(NETWORK_ARGS)
@echo "✅ MetadataService deployment completed"

@echo "📡 Deploying NetworkMiddlewareService..."
@forge script lib/core/script/deploy/NetworkMiddlewareService.s.sol:NetworkMiddlewareServiceScript ${DEFAULT_OWNER} --sig "run(address)" $(NETWORK_ARGS)
@echo "✅ NetworkMiddlewareService deployment completed"

@echo "📡 Deploying OptInService..."
@forge script lib/core/script/deploy/OptInService.s.sol:OptInServiceScript ${DEFAULT_OWNER} ${DEFAULT_OWNER} "test" --sig "run(address,address,string)" $(NETWORK_ARGS)
@echo "✅ OptInService deployment completed"

@echo "📡 Deploying OperatorRegistry..."
@forge script lib/core/script/deploy/OperatorRegistry.s.sol:OperatorRegistryScript $(NETWORK_ARGS)
@echo "✅ OperatorRegistry deployment completed"

@echo "📡 Deploying VaultFactory..."
@forge script lib/core/script/deploy/VaultFactory.s.sol:VaultFactoryScript ${DEFAULT_OWNER} --sig "run(address)" ${NETWORK_ARGS}
@echo "✅ VaultFactory deployment completed"

@echo "📡 Deploying Vault..."
@forge script lib/core/script/deploy/Vault.s.sol:VaultScript -vvvv ${DEFAULT_VAULT_CONFIGURATOR} ${DEFAULT_OWNER} ${DEFAULT_VAULT_CONFIGURATOR} 1 false 0 0 false 0 0 --sig "run(address,address,address,uint48,bool,uint256,uint64,bool,uint64,uint48)" ${NETWORK_ARGS}
@echo "✅ Vault deployment completed"
@echo "📡 Deploying Collateral..."
@forge script script/DeployCollateral.s.sol:DeployCollateral ${NETWORK_ARGS}
@echo "✅ Collateral deployment completed"

@echo "📡 Deploying VaultTokenized..."
@forge script lib/core/script/deploy/VaultTokenized.s.sol:VaultTokenizedScript ${DEFAULT_VAULT_CONFIGURATOR} ${DEFAULT_OWNER} ${DEFAULT_VAULT_CONFIGURATOR} 1 false 0 Test TEST 0 false 0 0 --sig "run(address,address,address,uint48,bool,uint256,string,string,uint64,bool,uint64,uint48)" ${NETWORK_ARGS}
@echo "✅ VaultTokenized deployment completed"
@echo "📡 Deploying Symbiotic..."
@forge script script/DeploySymbiotic.s.sol ${NETWORK_ARGS}
@echo "✅ Symbiotic deployment completed"
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gas_reports = ["*"]

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options

remappings = ['@openzeppelin/contracts=lib/openzeppelin-contracts/contracts','@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/', '@symbiotic/=lib/core/src/']
remappings = ['@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/','@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/', '@symbiotic/=lib/core/src/', '@symbiotic-rewards=lib/rewards/src/']

[rpc_endpoints]
mainnet = "${ETH_RPC_URL}"
Expand Down
2 changes: 1 addition & 1 deletion lib/core
1 change: 1 addition & 0 deletions lib/foundry-devops
Submodule foundry-devops added at 47393d
32 changes: 0 additions & 32 deletions script/NetworkSetup.s.sol

This file was deleted.

38 changes: 0 additions & 38 deletions script/Setup.s.sol

This file was deleted.

Loading