-
Notifications
You must be signed in to change notification settings - Fork 0
feat: deploy liquity scripts #8
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
65969cf
feat: add dev multisig deployment
nvtaveras d38a847
feat: MGP14
nvtaveras a5ad7d4
chore: tentatively add oracle contracts
nvtaveras e4f987b
refactor: move mgp14 out of celo folder
nvtaveras ed3b8cc
fix: various fixes, more checks
nvtaveras 9be42b2
chore: fmt
nvtaveras 7cca9ba
chore: delete safe register output
nvtaveras a0a0f56
chore: update mgp md and title
nvtaveras 1988505
feat: add tx details to MGP14
nvtaveras f05bab2
chore: grammar
nvtaveras 8ccc1d2
fix: pr comments
nvtaveras a989205
chore: pr comments
nvtaveras 5936562
fix: md fixes
nvtaveras e3a83f0
chore: save current stage
philbow61 28176d6
Merge branch 'feat/deploy-Liquity' into feat/deploy-v3-prestage
philbow61 f4229d5
feat: add LiquityDeployment script
philbow61 a701d25
chore: point bold repo to main branch
philbow61 ec29be5
Merge branch 'feat/deploy-v3-prestage' into feat/deploy-liquity-scripts
nvtaveras 2f98638
feat: add NFT integration to the liquity deployment scripts
philbow61 60e09f3
feat: log NFT data
philbow61 788c070
Merge branch 'feat/deploy-v3-prestage' into feat/deploy-liquity-scripts
philbow61 a10a62a
feat: add AddressBook lookup and premature celo config
philbow61 661b68e
fix: address review comments
philbow61 e3a081d
remove: yarn.lock
philbow61 246e135
chore: update bold repo
solofberlin 87b4c50
feat: parameterize LiquityConfig resolution by token
solofberlin 62afa40
Merge branch 'main' into feat/deploy-liquity-scripts
solofberlin a8eb0e8
feat: split instanceSalt into proxyLabel/singletonLabel and write NFT…
solofberlin 58be8d6
chore: remove broadcast files and update treb registry
solofberlin fdf6498
Revert "chore: remove broadcast files and update treb registry"
solofberlin 4c03f5d
chore: update treb registry and remove duplicate config assets
solofberlin d289559
chore: reset .treb to main, remove dependencies test, move DeployLiqu…
solofberlin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,3 +17,4 @@ docs/ | |
| .claude/ | ||
| .treb/config.local.json | ||
| node_modules | ||
| .treb/priv/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| src/=src/ | ||
| lib/mento-core/lib/bold/:openzeppelin-contracts/=lib/mento-core/lib/bold/contracts/lib/openzeppelin-contracts/ | ||
| lib/bold/:openzeppelin-contracts/=lib/bold/contracts/lib/openzeppelin-contracts/ | ||
| openzeppelin-contracts/=lib/mento-core/lib/openzeppelin-contracts-next/ | ||
| safe-smart-account/=lib/treb-sol/lib/safe-utils/lib/safe-smart-account/contracts/ | ||
| mento-core/=lib/mento-core/contracts/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| interface ILiquityConfig { | ||
| struct LiquityInstanceConfig { | ||
| // ── Instance identity ──────────────────────────────────────────── | ||
| /// @dev Label used for proxy deployments, e.g. "GBPm" | ||
| string proxyLabel; | ||
| /// @dev Label used for singleton CREATE3 deployments, e.g. "v3.0.0-GBPm" | ||
| string singletonLabel; | ||
| // ── Registry lookup keys ───────────────────────────────────────── | ||
| string debtTokenLabel; // e.g. "StableTokenV3:GBPm" | ||
| string collateralTokenLabel; // e.g. "StableTokenV3:USDm" | ||
| string liquidityStrategyLabel; // e.g. "CDPLiquidityStrategy" | ||
| string gasTokenLabel; // e.g. "StableTokenV3:USDm" | ||
| string oracleAdapterLabel; // e.g. "OracleAdapter" | ||
| // ── Addresses ──────────────────────────────────────────────────── | ||
| address rateFeedID; | ||
| address watchdog; | ||
| address owner; | ||
| address yieldSplitAddress; | ||
| // ── FXPriceFeed ────────────────────────────────────────────────── | ||
| bool invertRateFeed; | ||
| uint256 l2SequencerGracePeriod; | ||
| // ── Collateral / TroveManager params ───────────────────────────── | ||
| uint256 CCR; | ||
| uint256 MCR; | ||
| uint256 BCR; | ||
| uint256 SCR; | ||
| uint256 liquidationPenaltySP; | ||
| uint256 liquidationPenaltyRedistribution; | ||
| // ── SystemParams: debt ─────────────────────────────────────────── | ||
| uint256 minDebt; | ||
| // ── SystemParams: gas compensation ─────────────────────────────── | ||
| uint256 collGasCompensationDivisor; | ||
| uint256 collGasCompensationCap; | ||
| uint256 ethGasCompensation; | ||
| // ── SystemParams: interest ─────────────────────────────────────── | ||
| uint256 minAnnualInterestRate; | ||
| // ── SystemParams: redemption ───────────────────────────────────── | ||
| uint256 redemptionFeeFloor; | ||
| uint256 initialBaseRate; | ||
| uint256 redemptionMinuteDecayFactor; | ||
| uint256 redemptionBeta; | ||
| // ── SystemParams: stability pool ───────────────────────────────── | ||
| uint256 spYieldSplit; | ||
| uint256 minBoldInSP; | ||
| uint256 minBoldAfterRebalance; | ||
| // ── NFT Metadata assets ───────────────────────────────────────── | ||
| /// @dev Base directory for asset files, relative to project root | ||
| /// e.g. "lib/bold/contracts/utils/assets/" | ||
| string metadataAssetsBasePath; | ||
| /// @dev Filename for the debt token logo (stored under "BOLD" key) | ||
| string debtTokenLogoFile; | ||
| /// @dev Filename for the collateral token logo | ||
| string collateralTokenLogoFile; | ||
| /// @dev Must match IERC20Metadata(collateralToken).symbol() | ||
| string collateralTokenSymbol; | ||
| /// @dev Filename for the font file (stored under "geist" key) | ||
| string fontFile; | ||
| } | ||
|
|
||
| function get() external view returns (LiquityInstanceConfig memory); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| import {Vm} from "forge-std/Vm.sol"; | ||
| import {ILiquityConfig} from "./ILiquityConfig.sol"; | ||
|
|
||
| // ── Concrete configs ───────────────────────────────────────────────────────── | ||
| // Imported here so Foundry compiles their artifacts, enabling vm.deployCode() | ||
| // to find them by contract name at script run time. | ||
| import "./liquity/LiquityConfig_celo_sepolia_GBPm.sol"; | ||
| import "./liquity/LiquityConfig_celo_GBPm.sol"; | ||
| import "./liquity/LiquityConfig_anvil_GBPm.sol"; | ||
|
|
||
| /** | ||
| * @notice Loader library used by deployment scripts. | ||
| * @dev Resolves the concrete config contract from the NETWORK env var and the | ||
| * token parameter, e.g. LiquityConfigLib.get("GBPm") on network "anvil" | ||
| * will deploy LiquityConfig_anvil_GBPm. | ||
| * vm.deployCode() instantiates the config locally in Foundry's simulation | ||
| * VM without broadcasting it as an on-chain transaction. | ||
| */ | ||
| library LiquityConfigLib { | ||
| address private constant VM_ADDRESS = | ||
| address(uint160(uint256(keccak256("hevm cheat code")))); | ||
| Vm private constant vm = Vm(VM_ADDRESS); | ||
|
|
||
| function get( | ||
| string memory token | ||
| ) internal returns (ILiquityConfig.LiquityInstanceConfig memory) { | ||
| string memory network = vm.envString("NETWORK"); | ||
| string memory name = string.concat( | ||
| "LiquityConfig_", | ||
| network, | ||
| "_", | ||
| token | ||
| ); | ||
| address config = vm.deployCode(name); | ||
| require( | ||
| config != address(0), | ||
| string.concat("LiquityConfig: failed to deploy ", name) | ||
| ); | ||
| return ILiquityConfig(config).get(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| import {ILiquityConfig} from "../ILiquityConfig.sol"; | ||
|
|
||
| /** | ||
| * @notice Liquity GBPm/USDm instance config for Anvil (local Monad mainnet fork). | ||
| * @dev gasTokenLabel == collateralTokenLabel: USDm serves as both collateral and gas token. | ||
| */ | ||
| contract LiquityConfig_anvil_GBPm is ILiquityConfig { | ||
| function get() | ||
| external | ||
| pure | ||
| override | ||
| returns (ILiquityConfig.LiquityInstanceConfig memory) | ||
| { | ||
| return | ||
| ILiquityConfig.LiquityInstanceConfig({ | ||
| proxyLabel: "GBPm", | ||
| singletonLabel: "v3.0.0-GBPm", | ||
| // ── Registry lookup keys ──────────────────────────────── | ||
| debtTokenLabel: "StableTokenV3:GBPm", | ||
| collateralTokenLabel: "StableTokenV3:USDm", | ||
| liquidityStrategyLabel: "CDPLiquidityStrategy", | ||
| gasTokenLabel: "StableTokenV3:USDm", | ||
| oracleAdapterLabel: "OracleAdapter", | ||
| // ── Addresses ────────────────────────────────────────── | ||
| rateFeedID: 0x00000000000000000000000000000000075BCd15, | ||
| watchdog: 0x00000000000000000000000000000002DfDC1c3E, | ||
| owner: 0x000000000000000000000000000000000001E240, | ||
| yieldSplitAddress: 0x000000000000000000000000000000000001e241, | ||
| // ── FXPriceFeed ──────────────────────────────────────── | ||
| invertRateFeed: false, | ||
| l2SequencerGracePeriod: 1200, | ||
| // ── Collateral params ────────────────────────────────── | ||
| CCR: 1500000000000000000, | ||
| MCR: 1100000000000000000, | ||
| BCR: 100000000000000000, | ||
| SCR: 1100000000000000000, | ||
| liquidationPenaltySP: 50000000000000000, | ||
| liquidationPenaltyRedistribution: 100000000000000000, | ||
| // ── SystemParams: debt ───────────────────────────────── | ||
| minDebt: 100000000000000000000, | ||
| // ── SystemParams: gas compensation ───────────────────── | ||
| collGasCompensationDivisor: 200, | ||
| collGasCompensationCap: 2000000000000000000, | ||
| ethGasCompensation: 37500000000000000, | ||
| // ── SystemParams: interest ───────────────────────────── | ||
| minAnnualInterestRate: 5000000000000000, | ||
| // ── SystemParams: redemption ─────────────────────────── | ||
| redemptionFeeFloor: 2500000000000000, | ||
| initialBaseRate: 1000000000000000000, | ||
| redemptionMinuteDecayFactor: 998076443575628800, | ||
| redemptionBeta: 1, | ||
| // ── SystemParams: stability pool ─────────────────────── | ||
| spYieldSplit: 750000000000000000, | ||
| minBoldInSP: 1000000000000000000, | ||
| minBoldAfterRebalance: 1000000000000000000000, | ||
| // ── NFT Metadata assets ─────────────────────────────── | ||
| metadataAssetsBasePath: "script/config/liquity/assets/", | ||
| debtTokenLogoFile: "GBPm.svg", | ||
| collateralTokenLogoFile: "USDm.svg", | ||
| collateralTokenSymbol: "USDm", | ||
| fontFile: "geist.txt" | ||
| }); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| import {ILiquityConfig} from "../ILiquityConfig.sol"; | ||
|
|
||
| /** | ||
| * @notice Liquity GBPm/USDm instance config for Celo. | ||
| */ | ||
| contract LiquityConfig_celo_GBPm is ILiquityConfig { | ||
| function get() | ||
| external | ||
| pure | ||
| override | ||
| returns (ILiquityConfig.LiquityInstanceConfig memory) | ||
| { | ||
| return | ||
| ILiquityConfig.LiquityInstanceConfig({ | ||
| proxyLabel: "GBPm", | ||
| singletonLabel: "v3.0.0-GBPm", | ||
| // ── Registry lookup keys ──────────────────────────────── | ||
| // TODO: change to labels used in prestage Celo script | ||
| debtTokenLabel: "StableTokenV3:GBPm", | ||
| collateralTokenLabel: "StableTokenV3:USDm", | ||
| liquidityStrategyLabel: "CDPLiquidityStrategy", | ||
| gasTokenLabel: "StableTokenV3:USDm", | ||
| oracleAdapterLabel: "OracleAdapter", | ||
| // ── Addresses ────────────────────────────────────────── | ||
| rateFeedID: 0xf590b62f9cfcc6409075b1ecAc8176fe25744B88, // GBP/USD | ||
| watchdog: 0x287810F677516f10993ff63a520aAD5509F35796, // TODO: change to FXPriceFeed Watchdog Celo | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we resolve this now? can I help?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah there are some addresses, and i wasn't sure which ones we will use on Celo |
||
| owner: 0x287810F677516f10993ff63a520aAD5509F35796, // TODO: change to Owner Celo | ||
|
philbow61 marked this conversation as resolved.
|
||
| yieldSplitAddress: 0x287810F677516f10993ff63a520aAD5509F35796, // TODO: change to Yield Split Address Celo | ||
|
philbow61 marked this conversation as resolved.
|
||
| // ── FXPriceFeed ──────────────────────────────────────── | ||
| invertRateFeed: true, // SortedOracles: GBP/USD is inverted as (USD/GBP) | ||
| l2SequencerGracePeriod: 1200, // 20 minutes | ||
| // ── Collateral params ────────────────────────────────── | ||
| CCR: 1e18 * 1.35, // 135% | ||
| MCR: 1e18 * 1.1, // 110% | ||
| BCR: 1e18 * 0.1, // 10% | ||
| SCR: 1e18 * 1.1, // 110% | ||
| liquidationPenaltySP: 1e18 * 0.05, // 5% | ||
| liquidationPenaltyRedistribution: 1e18 * 0.1, // 10% | ||
| // ── SystemParams: debt ───────────────────────────────── | ||
| minDebt: 1_000e18, // 1,000 GBPm | ||
| // ── SystemParams: gas compensation ───────────────────── | ||
| collGasCompensationDivisor: 200, | ||
| collGasCompensationCap: 10e18, // 10 USDm | ||
| ethGasCompensation: 1e18, // 1 CELO | ||
| // ── SystemParams: interest ───────────────────────────── | ||
| minAnnualInterestRate: 1e18 * 0.002, // 0.2% | ||
| // ── SystemParams: redemption ─────────────────────────── | ||
| redemptionFeeFloor: 1e18 * 0.005, // 0.5% | ||
| initialBaseRate: 1e18, // 100% | ||
| redemptionMinuteDecayFactor: 1e18 * 0.9885140204, // 60 minutes half-life time | ||
| redemptionBeta: 1, | ||
| // ── SystemParams: stability pool ─────────────────────── | ||
| spYieldSplit: 1e18 * 0.75, // 75% | ||
| minBoldInSP: 1e18, // 1 GBPm | ||
| minBoldAfterRebalance: 5_000e18, // 5_000 GBPm | ||
| // ── NFT Metadata assets ─────────────────────────────── | ||
| metadataAssetsBasePath: "script/config/liquity/assets/", | ||
| debtTokenLogoFile: "GBPm.svg", | ||
| collateralTokenLogoFile: "USDm.svg", | ||
| collateralTokenSymbol: "USDm", | ||
| fontFile: "geist.txt" | ||
| }); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| import {ILiquityConfig} from "../ILiquityConfig.sol"; | ||
|
|
||
| /** | ||
| * @notice Liquity GBPm/USDm instance config for Celo. | ||
| */ | ||
| contract LiquityConfig_celo_sepolia_GBPm is ILiquityConfig { | ||
| function get() | ||
| external | ||
| pure | ||
| override | ||
| returns (ILiquityConfig.LiquityInstanceConfig memory) | ||
| { | ||
| return | ||
| ILiquityConfig.LiquityInstanceConfig({ | ||
| proxyLabel: "GBPm", | ||
| singletonLabel: "v3.0.0-GBPm", | ||
| // ── Registry lookup keys ──────────────────────────────── | ||
| // TODO: change to labels used in prestage Celo script | ||
| debtTokenLabel: "cGBP", | ||
| collateralTokenLabel: "cUSD", | ||
| liquidityStrategyLabel: "CDPLiquidityStrategy", | ||
| gasTokenLabel: "cUSD", | ||
| oracleAdapterLabel: "OracleAdapter", | ||
| // ── Addresses ────────────────────────────────────────── | ||
| rateFeedID: 0xf590b62f9cfcc6409075b1ecAc8176fe25744B88, // GBP/USD | ||
| watchdog: 0x287810F677516f10993ff63a520aAD5509F35796, // TODO: change to FXPriceFeed Watchdog Celo | ||
| owner: 0x287810F677516f10993ff63a520aAD5509F35796, // TODO: change to Owner Celo | ||
| yieldSplitAddress: 0x287810F677516f10993ff63a520aAD5509F35796, // TODO: change to Yield Split Address Celo | ||
| // ── FXPriceFeed ──────────────────────────────────────── | ||
| invertRateFeed: true, // SortedOracles: GBP/USD is inverted as (USD/GBP) | ||
| l2SequencerGracePeriod: 1200, // 20 minutes | ||
| // ── Collateral params ────────────────────────────────── | ||
| CCR: 1e18 * 1.35, // 135% | ||
| MCR: 1e18 * 1.1, // 110% | ||
| BCR: 1e18 * 0.1, // 10% | ||
| SCR: 1e18 * 1.1, // 110% | ||
| liquidationPenaltySP: 1e18 * 0.05, // 5% | ||
| liquidationPenaltyRedistribution: 1e18 * 0.1, // 10% | ||
| // ── SystemParams: debt ───────────────────────────────── | ||
| minDebt: 1_000e18, // 1,000 GBPm | ||
| // ── SystemParams: gas compensation ───────────────────── | ||
| collGasCompensationDivisor: 200, | ||
| collGasCompensationCap: 10e18, // 10 USDm | ||
| ethGasCompensation: 1e18, // 1 CELO | ||
| // ── SystemParams: interest ───────────────────────────── | ||
| minAnnualInterestRate: 1e18 * 0.002, // 0.2% | ||
| // ── SystemParams: redemption ─────────────────────────── | ||
| redemptionFeeFloor: 1e18 * 0.005, // 0.5% | ||
| initialBaseRate: 1e18, // 100% | ||
| redemptionMinuteDecayFactor: 1e18 * 0.9885140204, // 60 minutes half-life time | ||
| redemptionBeta: 1, | ||
| // ── SystemParams: stability pool ─────────────────────── | ||
| spYieldSplit: 1e18 * 0.75, // 75% | ||
| minBoldInSP: 1e18, // 1 GBPm | ||
| minBoldAfterRebalance: 5_000e18, // 5_000 GBPm | ||
| // ── NFT Metadata assets ─────────────────────────────── | ||
| metadataAssetsBasePath: "script/config/liquity/assets/", | ||
| debtTokenLogoFile: "GBPm.svg", | ||
| collateralTokenLogoFile: "USDm.svg", | ||
| collateralTokenSymbol: "USDm", | ||
| fontFile: "geist.txt" | ||
| }); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.