Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.
Merged
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
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.3.5

- name: Contract sizes
run: |
Expand All @@ -48,7 +48,7 @@ jobs:
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.3.5

- name: Format
run: |
Expand All @@ -69,7 +69,7 @@ jobs:
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.3.5

- name: Test
run: |
Expand All @@ -90,7 +90,7 @@ jobs:
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.3.5

- name: Fork Test
run: |
Expand All @@ -116,7 +116,7 @@ jobs:
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.3.5

- name: Run Slither
uses: crytic/slither-action@v0.4.0
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.3.5

- name: Install Crytic-compile
run: |
Expand Down Expand Up @@ -220,7 +220,7 @@ jobs:
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.3.5

- name: Install Halmos
run: |
Expand All @@ -245,7 +245,7 @@ jobs:
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.3.5

- name: Install dependencies
run: npm install
Expand Down Expand Up @@ -281,7 +281,7 @@ jobs:
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.3.5

- name: Install dependencies
run: npm install
Expand All @@ -308,7 +308,7 @@ jobs:
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.3.5

- name: Upload Selectors
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ Since Size v1.8, collections of markets, curators and rate providers are core en
- Curators can transfer ownership of their collections.
- Since users can subscribe to multiple collections, each with potentially many rate providers, the "borrow offer should be lower than loan offer" check now has O(C × R) complexity, where C is the number of collections and R is the number of rate providers. Users should avoid subscribing to too many collections or collections with excessive rate providers, as this may cause market orders to revert due to high gas usage.
- A rate provider in any market belonging to any collection can prevent all subscribed users from market orders if they set the borrow offer APR greater than or equal to the lend offer APR.
- After v1.8.1, users can configure a per-collection `CopyLimitOrderConfig`, which is applied as a fallback to per-market configs, and curator-defined configs are deprecated.

##### Breaking changes

- Copy trading behavior was updated: rate providers' limit orders no longer take precedence over a user's own yield curve.
- During reinitialization:
- All users who previously used the `copyLimitOrder` feature are now subscribed to a new collection that mirrors the rate provider they had copied.
- Their existing limit orders are cleared, since these may now be used by the taker side of a market order.
- By default, market orders now select the user-defined yield curve. Since migrated users will have no personal curve set, market orders will revert unless integrators pass an explicit collection parameter.
- To indicate "no copy," users should pass a `CopyLimitOrderConfig` with all fields set to null except `offsetAPR`. Passing zero min/max bounds will cause reverts—even if the curator has configured valid bounds.
- To indicate "no copy," users should pass a `CopyLimitOrderConfig` with all fields set to null except `offsetAPR`.
- For the sake of clarity, `getLoanOfferAPR` and `getBorrowOfferAPR` on the `SizeView` contract were renamed to `getUserDefinedLoanOfferAPR` and `getUserDefinedBorrowOfferAPR` to be explicit about whether the yield curve is from a rate provider or from the user themselves.
- Some infrequently utilized `SizeView` functions were removed to make room for the additional `WithCollection` functions and not break the max contract size limit.

Expand Down
182 changes: 182 additions & 0 deletions broadcast/ProposeSafeTxUpgradeToV1_8_1.s.sol/1/run-1761315146906.json

Large diffs are not rendered by default.

182 changes: 182 additions & 0 deletions broadcast/ProposeSafeTxUpgradeToV1_8_1.s.sol/1/run-latest.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

206 changes: 206 additions & 0 deletions broadcast/ProposeSafeTxUpgradeToV1_8_1.s.sol/8453/run-latest.json

Large diffs are not rendered by default.

187 changes: 0 additions & 187 deletions script/ProposeSafeTxUpgradeToV1_8.s.sol

This file was deleted.

66 changes: 66 additions & 0 deletions script/ProposeSafeTxUpgradeToV1_8_1.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;

import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {BaseScript} from "@script/BaseScript.sol";
import {CollectionsManager} from "@src/collections/CollectionsManager.sol";
import {ICollectionsManager} from "@src/collections/interfaces/ICollectionsManager.sol";
import {SizeFactory} from "@src/factory/SizeFactory.sol";

import {Contract, Networks} from "@script/Networks.sol";
import {console} from "forge-std/console.sol";

import {Safe} from "@safe-utils/Safe.sol";

contract ProposeSafeTxUpgradeToV1_8_1Script is BaseScript, Networks {
using Safe for *;

address signer;
string derivationPath;
SizeFactory private sizeFactory;
ICollectionsManager private collectionsManager;

modifier parseEnv() {
safe.initialize(vm.envAddress("OWNER"));
signer = vm.envAddress("SIGNER");
derivationPath = vm.envString("LEDGER_PATH");

_;
}

function run() public parseEnv broadcast {
console.log("ProposeSafeTxUpgradeToV1_8_1Script");

(address[] memory targets, bytes[] memory datas) = getUpgradeToV1_8_1Data();

safe.proposeTransactions(targets, datas, signer, derivationPath);

console.log("ProposeSafeTxUpgradeToV1_8_1Script: done");
}

function getUpgradeToV1_8_1Data() public returns (address[] memory targets, bytes[] memory datas) {
sizeFactory = SizeFactory(contracts[block.chainid][Contract.SIZE_FACTORY]);
collectionsManager = sizeFactory.collectionsManager();

CollectionsManager newCollectionsManagerImplementation = new CollectionsManager();
console.log(
"ProposeSafeTxUpgradeToV1_8_1Script: newCollectionsManagerImplementation",
address(newCollectionsManagerImplementation)
);
SizeFactory newSizeFactoryImplementation = new SizeFactory();
console.log(
"ProposeSafeTxUpgradeToV1_8_1Script: newSizeFactoryImplementation", address(newSizeFactoryImplementation)
);

targets = new address[](2);
datas = new bytes[](2);

// Upgrade SizeFactory
targets[0] = address(sizeFactory);
datas[0] = abi.encodeCall(UUPSUpgradeable.upgradeToAndCall, (address(newSizeFactoryImplementation), ""));

// Upgrade CollectionsManager
targets[1] = address(collectionsManager);
datas[1] = abi.encodeCall(UUPSUpgradeable.upgradeToAndCall, (address(newCollectionsManagerImplementation), ""));
}
}
Loading