Skip to content

Commit

Permalink
Merge pull request #176 from credbull/main
Browse files Browse the repository at this point in the history
* LiquidStone End-to-End Testing (#172)

* feat: Update Plume and Arbitrum config
* feat: Add LiquidStone test case for 90 day variation
---------
Co-authored-by: nawar-hisso <[email protected]>

* CBL TGE Staking campaign (#175)

CBL TGE Staking campaign
  • Loading branch information
lucasia authored Dec 4, 2024
2 parents 968c1f3 + 43e6e24 commit b27c533
Show file tree
Hide file tree
Showing 53 changed files with 34,105 additions and 5,429 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci-dev-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ jobs:
- name: Run Docker Compose with Background Services
run: docker compose --env-file packages/api/.env up --detach --build --wait

- name: Deploy Credbull Staking Vault
run: yarn deploy
working-directory: packages/contracts
env:
DEPLOY_SCRIPT: "script/DeployStakingVaults.s.sol:DeployStakingVaults"

- name: Deploy Credbull Contracts
run: yarn deploy
working-directory: packages/contracts
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"postinstall": "husky install"
},
"devDependencies": {
"@types/winston": "^2.4.4",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"turbo": "^2.0.6"
Expand Down
6 changes: 6 additions & 0 deletions packages/contracts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ deploy-plumeTestnet:
resume-plumeTestnet:
$(MAKE) deploy RPC_URL=plumeTestnet EXTRA_FLAGS="--verify --verifier blockscout --verifier-url https://test-explorer.plumenetwork.xyz/api\? --legacy --skip-simulation --slow --resume"

deploy-plume:
$(MAKE) deploy RPC_URL=plume EXTRA_FLAGS="--verify --verifier blockscout --verifier-url https://phoenix-explorer.plumenetwork.xyz/api\? --legacy --skip-simulation --slow"

resume-plume:
$(MAKE) deploy RPC_URL=plume EXTRA_FLAGS="--verify --verifier blockscout --verifier-url https://phoenix-explorer.plumenetwork.xyz/api\? --legacy --skip-simulation --slow --resume"

deploy-arbitrum:
$(MAKE) deploy RPC_URL=arbitrum EXTRA_FLAGS="--verify --slow"

Expand Down
2 changes: 2 additions & 0 deletions packages/contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ polygon = "https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}"
polygonMumbai = "https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_API_KEY}"
bitlayer = "https://rpc.bitlayer.org"
bitlayerTestnet = "https://testnet-rpc.bitlayer.org"
plume = "https://phoenix-rpc.plumenetwork.xyz/${PLUME_API_KEY}"
plumeDevnet = "https://devnet-rpc.plumenetwork.xyz"
plumeTestnet_old = "https://testnet-rpc.plumenetwork.xyz"
plumeTestnet= "https://test-rpc.plumenetwork.xyz"
Expand All @@ -35,6 +36,7 @@ arbitrum = { key = "${ARB_ETHERSCAN_API_KEY}", url = "https://api.arbiscan.io/ap
arbitrumSepolia = { key = "${ARB_SEPOLIA_ETHERSCAN_API_KEY}", url = "https://api-sepolia.arbiscan.io/api", chain=421614 }
bitlayer = { key = "bitlayer", url="https://rpc.bitlayer.org" }
bitlayerTestnet = { key = "bitlayerTestnet", url="https://testnet-scan.bitlayer.org" }
plume = { key = "plume", url = 'https://phoenix-explorer.plumenetwork.xyz/api\?', chain=98865 }
plumeDevnet = { key = "plumeDevnet", url = 'https://devnet-explorer.plumenetwork.xyz/api\?', chain=18230 }
plumeTestnet_old = { key = "plumeTestnet_old", url = 'https://testnet-explorer.plumenetwork.xyz/api\?', chain=161221135 }
plumeTestnet = { key = "plumeTestnet", url = 'https://test-explorer.plumenetwork.xyz/api\?', chain=98864 }
41 changes: 41 additions & 0 deletions packages/contracts/resource/plumeMainnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
##
# The Application Configuration for the Plume Mainnet Environment.
##

[evm]
# blockchain id, e.g. plumeMainnet=98865, plumeTestnet=98864, plumeTestnet_old=161221135, plumeDevnet=18230
chain_id = 98865
deploy_mocks = false


[evm.address]
# credbull.cb.id admin/owner (#1)
owner = "0x0fEcd2f7B3EC4BeE8001B4F73df32e7917d8fdE3"
# credbulloper.cb.id operator (#2)
operator = "0xf589233a140F037976f2786C8A4Fba4920EB687b"
# credbullupgrader.cb.id upgrader (#4)
upgrader = "0x3E449960Ba36cB00B728A370F991c658e7cca459"
# credbullassetmgr.cb.id asset manager (#7)
asset_manager = "0x97BE1b79AA9dB55e7235a9dd5E686cc4A26A7959"

# USDC.e token address (Fiat Proxy
usdc_token="0x0F3B6CC558A714ecf4Cc9ec8caFF0b57ECf65890"
# Liquid Continuous Multi Token Vault Proxy
liquid_vault_proxy="0xb89846b74f3B190F6e00fc35B3aFfCDF5d4BB9f9"
# Liquid Continuous Multi Token Vault Impl
liquid_vault_impl="0x8f87E1258d645d948F270221C34202Be0583F29b"


[evm.contracts.liquid_continuous_multi_token_vault]
# rate in basis points, e.g. 10% = 1000 bps
full_rate_bps = 10_00
# rate in basis points, e.g. 5.5% = 550 bps
reduced_rate_bps = 5_50
# January 1, 2025 2:00:00 PM UTC = 1735740000
vault_start_timestamp = 1735740000

[services.supabase]
url = ""

# Save the contract deployment details to the database.
update_contract_addresses = false
14 changes: 13 additions & 1 deletion packages/contracts/resource/plumeTestnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[evm]
# blockchain id, e.g. plumeTestnet=98864, plumeTestnet_old=161221135, plumeDevnet=18230
chain_id = 98864
deploy_mocks = true
deploy_mocks = false

[evm.address]
# credbull-devops wallets. wallet numbers are 1-based (as opposed to 0-based in anvil)
Expand All @@ -19,12 +19,24 @@ custodian = "0x8561845F6a9511cD8e2daCae77A961e718A77cF6"
upgrader = "0xaD3C004eE1f942BFDA2DA0D2DAaC94d6aC012F75"
# devops asset manager (wallet 7) - public address, okay to share
asset_manager = "0xd097E901FB9B75C2d2f97E142d73fA79C31FcAb3"
# CBL token address - Plume Testnet
cbl_token="0x931Cf9ab674bAbfa7De712EE635b75b5636b4D29"
# USDC.e token address - Plume Testnet
usdc_token="0x401eCb1D350407f13ba348573E5630B83638E30D"
# Liquid Continuous Multi Token Vault Proxy - Plume Testnet
liquid_vault_proxy="0x4B1fC984F324D2A0fDD5cD83925124b61175f5C6"
# Liquid Continuous Multi Token Vault Impl - Plume Testnet
liquid_vault_impl="0x9Db9df1D91c5cdE0c92cf02B9992d42f47028b4A"


[evm.contracts.liquid_continuous_multi_token_vault]
# rate in basis points, e.g. 10% = 1000 bps
full_rate_bps = 10_00
# rate in basis points, e.g. 5.5% = 550 bps
reduced_rate_bps = 5_50
# January 1, 2024 2:00:00 PM UTC = 1704117600
vault_start_timestamp = 1704117600


[evm.contracts.upside_vault]
# 2 decimal place percentage (meaining value divided by 100) as integer.
Expand Down
50 changes: 50 additions & 0 deletions packages/contracts/resource/testnetArbSepolia.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
##
# The Application Configuration for the TestNet Environment.
##

[evm]
# blockchain id, e.g. baseSepolia=84532, arbSepolia=421614
chain_id = 421614
deploy_mocks = false

[evm.address]
# credbull-devops wallets. wallet numbers are 1-based (as opposed to 0-based in anvil)
# devops admin/owner (wallet 1) - public address, okay to share
owner = "0xD79Be36f61fce3B8EF2FBF22b13B2b9a68eE15A2"
# devops operator (wallet 2) - public address, okay to share
operator = "0xaD3C004eE1f942BFDA2DA0D2DAaC94d6aC012F75"
# devops custodian (wallet 3) - public address, okay to share
custodian = "0x8561845F6a9511cD8e2daCae77A961e718A77cF6"
# devops upgrader (wallet 4) - public address, okay to share
upgrader = "0xaD3C004eE1f942BFDA2DA0D2DAaC94d6aC012F75"
# devops asset manager (wallet 7) - public address, okay to share
asset_manager = "0xd097E901FB9B75C2d2f97E142d73fA79C31FcAb3"
# CBL token address - Arbitrum Sepolia
cbl_token="0x3Dd53Ec7DFff8cf774391867C83583E634363345"
# USDC token address - Arbitrum Sepolia
usdc_token="0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"

[evm.contracts.liquid_continuous_multi_token_vault]
# rate in basis points, e.g. 10% = 1000 bps
full_rate_bps = 10_00
# rate in basis points, e.g. 5.5% = 550 bps
reduced_rate_bps = 5_50

[evm.contracts.upside_vault]
# 2 decimal place percentage (meaining value divided by 100) as integer.
collateral_percentage = 200

[evm.contracts.cbl]
# CBL token params
# devops admin/owner (wallet 1) - public address, okay to share
owner = "0xD79Be36f61fce3B8EF2FBF22b13B2b9a68eE15A2"
# devops operator (wallet 2) - public address, okay to share
minter = "0xaD3C004eE1f942BFDA2DA0D2DAaC94d6aC012F75"
# CBL token params
max_supply = 10_000_000 # 10 million in wei

[services.supabase]
url = ""

# Save the contract deployment details to the database.
update_contract_addresses = false
50 changes: 50 additions & 0 deletions packages/contracts/resource/testnetBaseSepolia.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
##
# The Application Configuration for the TestNet Environment.
##

[evm]
# blockchain id, e.g. baseSepolia=84532, arbSepolia=421614
chain_id = 84532
deploy_mocks = false

[evm.address]
# credbull-devops wallets. wallet numbers are 1-based (as opposed to 0-based in anvil)
# devops admin/owner (wallet 1) - public address, okay to share
owner = "0xD79Be36f61fce3B8EF2FBF22b13B2b9a68eE15A2"
# devops operator (wallet 2) - public address, okay to share
operator = "0xaD3C004eE1f942BFDA2DA0D2DAaC94d6aC012F75"
# devops custodian (wallet 3) - public address, okay to share
custodian = "0x8561845F6a9511cD8e2daCae77A961e718A77cF6"
# devops upgrader (wallet 4) - public address, okay to share
upgrader = "0xaD3C004eE1f942BFDA2DA0D2DAaC94d6aC012F75"
# devops asset manager (wallet 7) - public address, okay to share
asset_manager = "0xd097E901FB9B75C2d2f97E142d73fA79C31FcAb3"
# CBL token address - Base Sepolia
cbl_token="0x2064334877Fac12f353b8FB42440805709eC267A"
# USDC token address - Base Sepolia
usdc_token="0x036CbD53842c5426634e7929541eC2318f3dCF7e"

[evm.contracts.liquid_continuous_multi_token_vault]
# rate in basis points, e.g. 10% = 1000 bps
full_rate_bps = 10_00
# rate in basis points, e.g. 5.5% = 550 bps
reduced_rate_bps = 5_50

[evm.contracts.upside_vault]
# 2 decimal place percentage (meaining value divided by 100) as integer.
collateral_percentage = 200

[evm.contracts.cbl]
# CBL token params
# devops admin/owner (wallet 1) - public address, okay to share
owner = "0xD79Be36f61fce3B8EF2FBF22b13B2b9a68eE15A2"
# devops operator (wallet 2) - public address, okay to share
minter = "0xaD3C004eE1f942BFDA2DA0D2DAaC94d6aC012F75"
# CBL token params
max_supply = 10_000_000 # 10 million in wei

[services.supabase]
url = "https://kyvvhlnmoqibdihqrlmc.supabase.co"

# Save the contract deployment details to the database.
update_contract_addresses = true
7 changes: 4 additions & 3 deletions packages/contracts/script/DeployLiquidMultiTokenVault.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,13 @@ contract DeployLiquidMultiTokenVault is TomlConfig {
IERC20Metadata asset,
IYieldStrategy yieldStrategy,
IRedeemOptimizer redeemOptimizer
) public view returns (LiquidContinuousMultiTokenVault.VaultParams memory vaultParams_) {
) public view virtual returns (LiquidContinuousMultiTokenVault.VaultParams memory vaultParams_) {
uint256 fullRateBasisPoints = _tomlConfig.readUint(string.concat(CONTRACT_TOML_KEY, ".full_rate_bps"));
uint256 reducedRateBasisPoints = _tomlConfig.readUint(string.concat(CONTRACT_TOML_KEY, ".reduced_rate_bps"));
uint256 startTimestamp = _startTimestamp();

uint256 scale = 10 ** asset.decimals();
uint256 decimals = asset.decimals();
uint256 scale = 10 ** decimals;

TripleRateContext.ContextParams memory contextParams = TripleRateContext.ContextParams({
fullRateScaled: fullRateBasisPoints * scale / 100,
Expand All @@ -118,7 +119,7 @@ contract DeployLiquidMultiTokenVault is TomlConfig {
}),
frequency: 360,
tenor: 30,
decimals: asset.decimals()
decimals: decimals
});

LiquidContinuousMultiTokenVault.VaultParams memory vaultParams = LiquidContinuousMultiTokenVault.VaultParams({
Expand Down
6 changes: 3 additions & 3 deletions packages/contracts/script/DeployMocks.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ contract DeployMocks is Script {

if (isTestMode || deployChecker.isDeployRequired("SimpleToken")) {
testToken = new SimpleToken(owner, totalSupply);
console2.log("!!!!! Deploying SimpleToken !!!!!");
console2.log(string.concat("!!!!! Deploying SimpleToken [", vm.toString(address(testToken)), "] !!!!!"));
} else {
testToken = SimpleToken(deployChecker.getContractAddress("SimpleToken"));
}

if (isTestMode || deployChecker.isDeployRequired("SimpleUSDC")) {
testStablecoin = new SimpleUSDC(owner, totalSupply);
console2.log("!!!!! Deploying SimpleToken !!!!!");
console2.log(string.concat("!!!!! Deploying SimpleUSDC [", vm.toString(address(testStablecoin)), "] !!!!!"));
} else {
testStablecoin = SimpleUSDC(deployChecker.getContractAddress("SimpleUSDC"));
}
Expand All @@ -59,7 +59,7 @@ contract DeployMocks is Script {
custodian: custodian
});
testVault = new SimpleVault(params);
console2.log("!!!!! Deploying Simple Vault !!!!!");
console2.log(string.concat("!!!!! Deploying Simple Vault [", vm.toString(address(testVault)), "] !!!!!"));
}

vm.stopBroadcast();
Expand Down
Loading

0 comments on commit b27c533

Please sign in to comment.