Skip to content

feat: deploy liquity scripts#8

Merged
nvtaveras merged 32 commits into
mainfrom
feat/deploy-liquity-scripts
Feb 27, 2026
Merged

feat: deploy liquity scripts#8
nvtaveras merged 32 commits into
mainfrom
feat/deploy-liquity-scripts

Conversation

@philbow61
Copy link
Copy Markdown
Contributor

@philbow61 philbow61 commented Feb 21, 2026

This Pr adds the full deployment script for Liquity V2 CDP instances (DeployLiquity.s.sol) along with a Solidity-based config system.

I had to remove the price fetching in the initialize function in the FXPriceFeed.sol contract in the bold repo, so we can deploy a Liquity Instance and activate it by setting the rateFeedId later.
For testing this script, remove the line in the lib folder: https://github.com/mento-protocol/bold/blob/073a25f049f423b3336e3785d5f1e13235ced07b/contracts/src/PriceFeeds/FXPriceFeed.sol#L124

I also created a Pr for this: mento-protocol/bold#38

Concrete deployment configs implement ILiquityConfig directly and are imported by
LiquityConfigLib, so Foundry compiles its artifacts. The script deploys all Liquity V2 contracts (TroveManager, BorrowerOperations, StabilityPool, CollateralRegistry, etc.).

The three upgradeable proxy contracts (FXPriceFeed, StabilityPool, SystemParams) have their ProxyAdmin
Ownership transferred to the configured owner address after deployment.

The LiquityConfig_anvil_GBPm config provides a ready-to-use configuration for local Anvil fork testing of a GBPm/USDm instance. For testing run:
treb dev anvil start && treb run DeployLiquityDependenciesTest && LIQUITY_CONFIG_CONTRACT=LiquityConfig_anvil_GBPm treb run DeployLiquityV2

The optimizer_runs = 0 setting is added to foundry.toml
to keep TroveManager bytecode within the EIP-170 24576-byte limit.

@philbow61 philbow61 requested a review from bowd February 21, 2026 23:21
@nvtaveras nvtaveras changed the title Feat/deploy liquity scripts feat: deploy liquity scripts Feb 24, 2026
Base automatically changed from feat/deploy-v3-prestage to main February 25, 2026 16:37
Comment thread foundry.toml Outdated
Comment thread script/config/LiquityConfig_celo_GBPm.sol Outdated
oracleAdapterLabel: "OracleAdapter",
// ── Addresses ──────────────────────────────────────────
rateFeedID: 0xf590b62f9cfcc6409075b1ecAc8176fe25744B88, // GBP/USD
watchdog: 0x287810F677516f10993ff63a520aAD5509F35796, // TODO: change to FXPriceFeed Watchdog Celo
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we resolve this now? can I help?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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

Comment thread script/config/liquity/LiquityConfig_celo_GBPm.sol
Comment thread script/config/liquity/LiquityConfig_celo_GBPm.sol
Comment thread script/deploy/v3/LiquityV2/DeployLiquityDependenciesTest.s.sol Outdated
Comment thread script/config/LiquityConfig.sol Outdated
address(uint160(uint256(keccak256("hevm cheat code"))));
Vm private constant vm = Vm(VM_ADDRESS);

function get()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get("GBPm")

->

vm.deployCode(string.concat(..."LiquitiyConfig_{network}_{debtToken}.sol")).

Comment thread script/config/LiquityConfig.sol Outdated
Comment thread script/config/liquity/LiquityConfig_anvil_GBPm.sol
Comment thread yarn.lock Outdated
philbow61 and others added 4 commits February 26, 2026 15:37
LiquityConfigLib.get() now takes a token string param and resolves the
config contract as LiquityConfig_{network}_{token} using the NETWORK env
var. DeployLiquity declares the token param via @Custom:env natspec.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
solofberlin and others added 6 commits February 27, 2026 20:22
… preview SVG

- Replace instanceSalt with proxyLabel (for proxy names) and singletonLabel
  (for CREATE3 singleton deployments) across interface, configs, and deploy script
- Write decoded NFT preview SVG to out/nft-preview-{label}.svg during deployment
- Add out/ to fs_permissions for vm.writeFile support
- Add SVG token logo assets and remove old txt-based logos

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ity up

- Reset .treb files to main branch state
- Remove DeployLiquityDependenciesTest.s.sol
- Move DeployLiquity.s.sol from LiquityV2/ to v3/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nvtaveras nvtaveras merged commit e09a84e into main Feb 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants