Dev - #141
Conversation
Bumps the development-dependencies group with 16 updates: | Package | From | To | | --- | --- | --- | | [@fhevm/hardhat-plugin](https://github.com/zama-ai/fhevm-mocks) | `0.1.0` | `0.4.0` | | [@fhevm/mock-utils](https://github.com/zama-ai/fhevm-mocks) | `0.1.0` | `0.4.0` | | [@nomicfoundation/hardhat-ethers](https://github.com/NomicFoundation/hardhat/tree/HEAD/v-next/ethers) | `3.1.3` | `4.0.4` | | [@nomicfoundation/hardhat-network-helpers](https://github.com/NomicFoundation/hardhat/tree/HEAD/v-next/hardhat-network-helpers) | `1.1.2` | `3.0.3` | | [@nomicfoundation/hardhat-verify](https://github.com/NomicFoundation/hardhat/tree/HEAD/v-next/hardhat-verify) | `2.1.3` | `3.0.8` | | [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) | `4.3.20` | `5.2.3` | | [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `25.0.6` | `25.2.0` | | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.52.0` | `8.54.0` | | [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `8.52.0` | `8.54.0` | | [@zama-fhe/relayer-sdk](https://github.com/zama-ai/relayer-sdk) | `0.2.0` | `0.4.0` | | [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) | `9.1.2` | `10.1.8` | | [hardhat](https://github.com/NomicFoundation/hardhat/tree/HEAD/v-next/hardhat) | `2.28.2` | `3.1.5` | | [hardhat-deploy](https://github.com/wighawag/hardhat-deploy) | `0.11.45` | `1.0.4` | | [prettier](https://github.com/prettier/prettier) | `3.7.4` | `3.8.1` | | [prettier-plugin-solidity](https://github.com/prettier-solidity/prettier-plugin-solidity) | `1.4.3` | `2.2.1` | | [solhint](https://github.com/protofire/solhint) | `6.0.2` | `6.0.3` | Updates `@fhevm/hardhat-plugin` from 0.1.0 to 0.4.0 - [Release notes](https://github.com/zama-ai/fhevm-mocks/releases) - [Commits](zama-ai/fhevm-mocks@v0.1.0...v0.4.0) Updates `@fhevm/mock-utils` from 0.1.0 to 0.4.0 - [Release notes](https://github.com/zama-ai/fhevm-mocks/releases) - [Commits](zama-ai/fhevm-mocks@v0.1.0...v0.4.0) Updates `@nomicfoundation/hardhat-ethers` from 3.1.3 to 4.0.4 - [Release notes](https://github.com/NomicFoundation/hardhat/releases) - [Commits](https://github.com/NomicFoundation/hardhat/commits/@nomicfoundation/hardhat-ethers@4.0.4/v-next/ethers) Updates `@nomicfoundation/hardhat-network-helpers` from 1.1.2 to 3.0.3 - [Release notes](https://github.com/NomicFoundation/hardhat/releases) - [Changelog](https://github.com/NomicFoundation/hardhat/blob/main/v-next/hardhat-network-helpers/CHANGELOG.md) - [Commits](https://github.com/NomicFoundation/hardhat/commits/@nomicfoundation/hardhat-network-helpers@3.0.3/v-next/hardhat-network-helpers) Updates `@nomicfoundation/hardhat-verify` from 2.1.3 to 3.0.8 - [Release notes](https://github.com/NomicFoundation/hardhat/releases) - [Changelog](https://github.com/NomicFoundation/hardhat/blob/main/v-next/hardhat-verify/CHANGELOG.md) - [Commits](https://github.com/NomicFoundation/hardhat/commits/@nomicfoundation/hardhat-verify@3.0.8/v-next/hardhat-verify) Updates `@types/chai` from 4.3.20 to 5.2.3 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai) Updates `@types/node` from 25.0.6 to 25.2.0 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Updates `@typescript-eslint/eslint-plugin` from 8.52.0 to 8.54.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.54.0/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 8.52.0 to 8.54.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.54.0/packages/parser) Updates `@zama-fhe/relayer-sdk` from 0.2.0 to 0.4.0 - [Release notes](https://github.com/zama-ai/relayer-sdk/releases) - [Commits](zama-ai/relayer-sdk@v0.2.0...v0.4.0) Updates `eslint-config-prettier` from 9.1.2 to 10.1.8 - [Release notes](https://github.com/prettier/eslint-config-prettier/releases) - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/eslint-config-prettier/commits/v10.1.8) Updates `hardhat` from 2.28.2 to 3.1.5 - [Release notes](https://github.com/NomicFoundation/hardhat/releases) - [Changelog](https://github.com/NomicFoundation/hardhat/blob/main/v-next/hardhat/CHANGELOG.md) - [Commits](https://github.com/NomicFoundation/hardhat/commits/hardhat@3.1.5/v-next/hardhat) Updates `hardhat-deploy` from 0.11.45 to 1.0.4 - [Changelog](https://github.com/wighawag/hardhat-deploy/blob/v1.0.4/CHANGELOG.md) - [Commits](wighawag/hardhat-deploy@v0.11.45...v1.0.4) Updates `prettier` from 3.7.4 to 3.8.1 - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](prettier/prettier@3.7.4...3.8.1) Updates `prettier-plugin-solidity` from 1.4.3 to 2.2.1 - [Release notes](https://github.com/prettier-solidity/prettier-plugin-solidity/releases) - [Commits](prettier-solidity/prettier-plugin-solidity@v1.4.3...v2.2.1) Updates `solhint` from 6.0.2 to 6.0.3 - [Release notes](https://github.com/protofire/solhint/releases) - [Changelog](https://github.com/protofire/solhint/blob/develop/CHANGELOG.md) - [Commits](protofire/solhint@v6.0.2...v6.0.3) --- updated-dependencies: - dependency-name: "@fhevm/hardhat-plugin" dependency-version: 0.4.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies - dependency-name: "@fhevm/mock-utils" dependency-version: 0.4.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies - dependency-name: "@nomicfoundation/hardhat-ethers" dependency-version: 4.0.4 dependency-type: direct:development update-type: version-update:semver-major dependency-group: development-dependencies - dependency-name: "@nomicfoundation/hardhat-network-helpers" dependency-version: 3.0.3 dependency-type: direct:development update-type: version-update:semver-major dependency-group: development-dependencies - dependency-name: "@nomicfoundation/hardhat-verify" dependency-version: 3.0.8 dependency-type: direct:development update-type: version-update:semver-major dependency-group: development-dependencies - dependency-name: "@types/chai" dependency-version: 5.2.3 dependency-type: direct:development update-type: version-update:semver-major dependency-group: development-dependencies - dependency-name: "@types/node" dependency-version: 25.2.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies - dependency-name: "@typescript-eslint/eslint-plugin" dependency-version: 8.54.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies - dependency-name: "@typescript-eslint/parser" dependency-version: 8.54.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies - dependency-name: "@zama-fhe/relayer-sdk" dependency-version: 0.4.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies - dependency-name: eslint-config-prettier dependency-version: 10.1.8 dependency-type: direct:development update-type: version-update:semver-major dependency-group: development-dependencies - dependency-name: hardhat dependency-version: 3.1.5 dependency-type: direct:development update-type: version-update:semver-major dependency-group: development-dependencies - dependency-name: hardhat-deploy dependency-version: 1.0.4 dependency-type: direct:development update-type: version-update:semver-major dependency-group: development-dependencies - dependency-name: prettier dependency-version: 3.8.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies - dependency-name: prettier-plugin-solidity dependency-version: 2.2.1 dependency-type: direct:development update-type: version-update:semver-major dependency-group: development-dependencies - dependency-name: solhint dependency-version: 6.0.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: development-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
…ev/development-dependencies-2f94ae4c13 chore(deps-dev): bump the development-dependencies group with 16 updates
Reviewer's GuideAdds comprehensive accounting, slippage, decommissioning, and access-control tests; introduces a mutable-decimals ERC4626 mock; tightens liquidity orchestration error handling and protocol events/interfaces; and standardizes terminology from "vault owner" to "manager" across tests and config APIs. Sequence diagram for updated liquidity orchestration sell/buy execution error handlingsequenceDiagram
actor Keeper
participant LiquidityOrchestrator
participant Token
Keeper->>LiquidityOrchestrator: performLiquidityUpkeep()
loop For_each_selling_token
LiquidityOrchestrator->>LiquidityOrchestrator: _executeSell(token, amount, estUnderlying)
alt _executeSell_success
LiquidityOrchestrator-->>LiquidityOrchestrator: continue to next token
else _executeSell_reverts
LiquidityOrchestrator->>LiquidityOrchestrator: currentPhase = StateCommitment
LiquidityOrchestrator->>LiquidityOrchestrator: _failedEpochTokens.push(token)
LiquidityOrchestrator-->>Keeper: return
end
end
loop For_each_buying_token
LiquidityOrchestrator->>LiquidityOrchestrator: _executeBuy(token, amount, estUnderlying)
alt _executeBuy_success
LiquidityOrchestrator-->>LiquidityOrchestrator: continue to next token
else _executeBuy_reverts
LiquidityOrchestrator->>LiquidityOrchestrator: currentPhase = StateCommitment
LiquidityOrchestrator->>LiquidityOrchestrator: _failedEpochTokens.push(token)
LiquidityOrchestrator-->>Keeper: return
end
end
Class diagram for updated verifier and vault interfaces and mock ERC4626classDiagram
class ISP1Verifier {
<<interface>>
+verifyProof(programVKey bytes32, publicValues bytes, proofBytes bytes) view
}
class ISP1VerifierWithHash {
<<interface>>
+VERIFIER_HASH() bytes32
}
ISP1VerifierWithHash --|> ISP1Verifier
class IERC4626 {
<<interface>>
+asset() address
+totalAssets() uint256
+convertToShares(assets uint256) uint256
+convertToAssets(shares uint256) uint256
+deposit(assets uint256, receiver address) uint256
+mint(shares uint256, receiver address) uint256
+withdraw(assets uint256, receiver address, owner address) uint256
+redeem(shares uint256, receiver address, owner address) uint256
}
class IOrionVault {
<<interface>>
+VaultFeesClaimed(manager address, feeAmount uint256) event
}
IOrionVault --|> IERC4626
class IOrionConfig {
<<interface>>
+isWhitelisted(asset address) bool view
+decommissioningAssets() address[] view
}
class ERC4626 {
+asset() address
+totalAssets() uint256
+convertToShares(assets uint256) uint256
+convertToAssets(shares uint256) uint256
+deposit(assets uint256, receiver address) uint256
+mint(shares uint256, receiver address) uint256
+withdraw(assets uint256, receiver address, owner address) uint256
+redeem(shares uint256, receiver address, owner address) uint256
}
class MockERC4626WithSettableDecimals {
+setDecimals(newDecimals uint8)
+decimals() uint8
}
MockERC4626WithSettableDecimals --|> ERC4626
Class diagram for updated protocol events in EventsLibclassDiagram
class EventsLib {
<<library>>
+WhitelistedAssetRemoved(asset address) event
+AssetDecommissioningInitiated(asset address) event
+LiquidityDeposited(depositor address, amount uint256) event
+LiquidityWithdrawn(withdrawer address, amount uint256) event
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
📝 WalkthroughWalkthroughChanges introduce event signature modifications (indexed parameters for fees and liquidity amounts), a new SP1 verifier interface with hash accessor, new test contract for decimal overriding, comprehensive accounting and adapter test suites, and terminology updates renaming "vault owner" to "manager" across multiple test files. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- In the new slippage tests for
sellandbuyyou describeSlippageExceededin theitstring but only assert.to.be.reverted; consider asserting the specific custom error (or updating the description) so the tests clearly validate the intended failure mode. - The new decommissioning-related tests in
Removal.test.tsre-implement the same vault-decommissioning setup multiple times; consider extracting a shared helper to prepare a decommissioned vault to reduce duplication and make the scenarios easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the new slippage tests for `sell` and `buy` you describe `SlippageExceeded` in the `it` string but only assert `.to.be.reverted`; consider asserting the specific custom error (or updating the description) so the tests clearly validate the intended failure mode.
- The new decommissioning-related tests in `Removal.test.ts` re-implement the same vault-decommissioning setup multiple times; consider extracting a shared helper to prepare a decommissioned vault to reduce duplication and make the scenarios easier to maintain.
## Individual Comments
### Comment 1
<location> `contracts/LiquidityOrchestrator.sol:694-696` </location>
<code_context>
if (token == address(underlyingAsset)) continue;
uint256 amount = sellLeg.sellingAmounts[i];
- try this._executeSell(token, amount, sellLeg.sellingEstimatedUnderlyingAmounts[i]) {} catch {
+ try this._executeSell(token, amount, sellLeg.sellingEstimatedUnderlyingAmounts[i]) {
+ // successful execution, continue.
+ } catch {
currentPhase = LiquidityUpkeepPhase.StateCommitment;
_failedEpochTokens.push(token);
</code_context>
<issue_to_address>
**suggestion:** The generic catch block swallows error details, which can hinder debugging of failed token operations.
Because the untyped `catch` hides why `_executeSell` / `_executeBuy` reverted, diagnosing issues with specific tokens becomes harder, especially given this code drives phase transitions and failed-token tracking. Consider using a typed catch (e.g., `catch Error(string memory reason)` or `catch (bytes memory lowLevelData)`) and emitting an event with the token and error details to retain observability without changing the control flow.
Suggested implementation:
```
address token = sellLeg.sellingTokens[i];
if (token == address(underlyingAsset)) continue;
uint256 amount = sellLeg.sellingAmounts[i];
try this._executeSell(token, amount, sellLeg.sellingEstimatedUnderlyingAmounts[i]) {
// successful execution, continue.
} catch (bytes memory lowLevelData) {
emit TokenOperationFailed(token, true, lowLevelData);
currentPhase = LiquidityUpkeepPhase.StateCommitment;
_failedEpochTokens.push(token);
return;
address token = buyLeg.buyingTokens[i];
if (token == address(underlyingAsset)) continue;
uint256 amount = buyLeg.buyingAmounts[i];
try this._executeBuy(token, amount, buyLeg.buyingEstimatedUnderlyingAmounts[i]) {
// successful execution, continue.
} catch (bytes memory lowLevelData) {
emit TokenOperationFailed(token, false, lowLevelData);
currentPhase = LiquidityUpkeepPhase.StateCommitment;
_failedEpochTokens.push(token);
```
1. Add an event declaration inside the `LiquidityOrchestrator` contract (near the top of the contract body is typical):
```solidity
event TokenOperationFailed(address indexed token, bool isSell, bytes lowLevelData);
```
- `isSell == true` will denote `_executeSell` failures; `false` will denote `_executeBuy` failures.
2. If your project uses an existing logging/telemetry pattern (e.g., a more specific event naming convention), adjust the event name and parameters accordingly and update the `emit` calls to match.
3. Ensure the control-flow braces around these snippets are correctly balanced; the provided context is partial, so you may need to re-run `solc` / your linter to fix any structural issues around the `return;` and closing braces.
</issue_to_address>
### Comment 2
<location> `test/Accounting.test.ts:133-137` </location>
<code_context>
+ await underlyingAsset.connect(user).approve(await vault.getAddress(), parseUnderlying("1000000"));
+ });
+
+ describe("convertToAssetsWithPITTotalAssets", function () {
+ it("returns assets using current totalSupply and point-in-time total assets (Floor)", async function () {
+ const depositAssets = parseUnderlying("100000");
</code_context>
<issue_to_address>
**suggestion (testing):** Consider adding edge-case tests for `convertToAssetsWithPITTotalAssets` with zero shares / zero PIT total assets.
Please also add tests for edge inputs:
- `shares = 0` and non-zero `pitTotalAssets` → expect 0 assets.
- Non-zero `shares` and `pitTotalAssets = 0` → verify behavior (likely 0 assets) and that it does not revert.
- Both `shares = 0` and `pitTotalAssets = 0`.
These will harden coverage around division/rounding corner cases and empty-position scenarios.
```suggestion
await underlyingAsset.mint(user.address, parseUnderlying("1000000"));
await underlyingAsset.connect(user).approve(await vault.getAddress(), parseUnderlying("1000000"));
});
describe("convertToAssetsWithPITTotalAssets edge cases", function () {
it("returns 0 assets when shares is 0 and pitTotalAssets is non-zero", async function () {
const depositAssets = parseUnderlying("100000");
await vault.connect(user).requestDeposit(depositAssets);
await setVaultStateWithFulfilledDeposit(vault, depositAssets, depositAssets);
const pitTotalAssets = depositAssets;
const zeroShares = 0n;
const assets = await vault.convertToAssetsWithPITTotalAssets(
zeroShares,
pitTotalAssets,
Rounding.Floor,
);
expect(assets).to.equal(0n);
});
it("returns 0 assets and does not revert when pitTotalAssets is 0 and shares are non-zero", async function () {
const depositAssets = parseUnderlying("100000");
await vault.connect(user).requestDeposit(depositAssets);
await setVaultStateWithFulfilledDeposit(vault, depositAssets, depositAssets);
const supply = await vault.totalSupply();
expect(supply).to.be.gt(0);
const nonZeroShares = 10n ** BigInt(SHARE_DECIMALS);
const pitTotalAssets = 0n;
const assets = await vault.convertToAssetsWithPITTotalAssets(
nonZeroShares,
pitTotalAssets,
Rounding.Floor,
);
expect(assets).to.equal(0n);
});
it("returns 0 assets when both shares and pitTotalAssets are 0", async function () {
const zeroShares = 0n;
const pitTotalAssets = 0n;
const assets = await vault.convertToAssetsWithPITTotalAssets(
zeroShares,
pitTotalAssets,
Rounding.Floor,
);
expect(assets).to.equal(0n);
});
});
describe("convertToAssetsWithPITTotalAssets", function () {
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| try this._executeSell(token, amount, sellLeg.sellingEstimatedUnderlyingAmounts[i]) { | ||
| // successful execution, continue. | ||
| } catch { |
There was a problem hiding this comment.
suggestion: The generic catch block swallows error details, which can hinder debugging of failed token operations.
Because the untyped catch hides why _executeSell / _executeBuy reverted, diagnosing issues with specific tokens becomes harder, especially given this code drives phase transitions and failed-token tracking. Consider using a typed catch (e.g., catch Error(string memory reason) or catch (bytes memory lowLevelData)) and emitting an event with the token and error details to retain observability without changing the control flow.
Suggested implementation:
address token = sellLeg.sellingTokens[i];
if (token == address(underlyingAsset)) continue;
uint256 amount = sellLeg.sellingAmounts[i];
try this._executeSell(token, amount, sellLeg.sellingEstimatedUnderlyingAmounts[i]) {
// successful execution, continue.
} catch (bytes memory lowLevelData) {
emit TokenOperationFailed(token, true, lowLevelData);
currentPhase = LiquidityUpkeepPhase.StateCommitment;
_failedEpochTokens.push(token);
return;
address token = buyLeg.buyingTokens[i];
if (token == address(underlyingAsset)) continue;
uint256 amount = buyLeg.buyingAmounts[i];
try this._executeBuy(token, amount, buyLeg.buyingEstimatedUnderlyingAmounts[i]) {
// successful execution, continue.
} catch (bytes memory lowLevelData) {
emit TokenOperationFailed(token, false, lowLevelData);
currentPhase = LiquidityUpkeepPhase.StateCommitment;
_failedEpochTokens.push(token);
- Add an event declaration inside the
LiquidityOrchestratorcontract (near the top of the contract body is typical):event TokenOperationFailed(address indexed token, bool isSell, bytes lowLevelData);
isSell == truewill denote_executeSellfailures;falsewill denote_executeBuyfailures.
- If your project uses an existing logging/telemetry pattern (e.g., a more specific event naming convention), adjust the event name and parameters accordingly and update the
emitcalls to match. - Ensure the control-flow braces around these snippets are correctly balanced; the provided context is partial, so you may need to re-run
solc/ your linter to fix any structural issues around thereturn;and closing braces.
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Fix all issues with AI agents
In `@contracts/libraries/EventsLib.sol`:
- Around line 21-23: The LiquidityDeposited and LiquidityWithdrawn event
definitions were changed to mark the amount parameter as indexed, which alters
the ABI/topic layout; revert the change by removing the indexed modifier from
the amount parameter in the LiquidityDeposited and LiquidityWithdrawn event
declarations so the event signature and topics match the previous ABI (leave any
legitimately indexed address parameters as-is) and run a quick compile to ensure
the original event signatures are restored for off-chain consumers.
In `@contracts/test/MockERC4626WithSettableDecimals.sol`:
- Around line 26-28: The setDecimals(uint8 d) function on
MockERC4626WithSettableDecimals currently allows anyone to change
_overrideDecimals; update the contract by adding a brief inline comment above
setDecimals stating this is intentionally unrestricted for testing convenience
(or, if you prefer stricter access, restrict it to onlyOwner by adding an access
check) so readers understand the choice; reference the function name setDecimals
and the variable _overrideDecimals when adding the explanatory note or when
applying the access modifier.
In `@test/Accounting.test.ts`:
- Around line 66-76: The test currently uses a non-null assertion on `log` and
then calls `transparentVaultFactory.interface.parseLog(log!)?.args`, which can
throw or produce unclear failures if the event isn't found; update the helper to
explicitly check whether `log` is null/undefined and throw a clear error (e.g.
"OrionVaultCreated event not found in receipt") before calling
`transparentVaultFactory.interface.parseLog`, and also validate that `args` and
`vaultAddress` are defined before calling
`ethers.getContractAt("OrionTransparentVault", vaultAddress)` (or throw another
descriptive error) so failures point to the missing event/arg rather than a
cryptic runtime exception.
In `@test/Adapters.test.ts`:
- Around line 457-461: The test currently uses a generic `.to.be.reverted` when
calling erc4626ExecutionAdapter.connect(loSigner).sell(...), which can mask
wrong failures; update the assertion to expect the specific custom error
`SlippageExceeded` using the Chai/Waffle custom error matcher (e.g.,
`.to.be.revertedWithCustomError(erc4626ExecutionAdapter, 'SlippageExceeded')`)
so the test asserts the adapter's `sell` call fails for the intended slippage
condition; locate the call to `erc4626ExecutionAdapter.connect(loSigner).sell`
and replace the generic revert assertion with the custom error assertion
referencing `erc4626ExecutionAdapter` and `SlippageExceeded`.
- Around line 490-494: Replace the generic `.to.be.reverted` assertion with a
custom-error assertion for SlippageExceeded: call the same promise (the result
of `erc4626ExecutionAdapter.connect(loSigner).buy(await
erc4626Vault.getAddress(), sharesAmount, estimatedUnderlying)`) but assert
`.to.be.revertedWithCustomError(erc4626ExecutionAdapter, 'SlippageExceeded')`
(or the appropriate contract instance exposing the error) so the test
specifically checks for the SlippageExceeded custom error.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary by Sourcery
Add comprehensive accounting, slippage, decommissioning, and manager lifecycle coverage through new tests and minor contract/interface adjustments.
New Features:
Bug Fixes:
Enhancements:
Tests:
Summary by CodeRabbit
New Features
Tests