-
Notifications
You must be signed in to change notification settings - Fork 0
Initial Audit Fixes #2
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
13 commits
Select commit
Hold shift + click to select a range
5c21b6a
add mainnet sorella integration tests
imrtlfarm 97c76a2
add multi position liquidity management test
imrtlfarm 6b8034f
add basic deploy script, missing some prod features
imrtlfarm e8628d0
add checks for action mismatch
imrtlfarm 76c3f12
remove to parameter from actions and sig, only allow deposits to signers
imrtlfarm 1a4e7bc
fix Q-3 unused state vars
imrtlfarm a32b4af
Fix Q-2 redundant calculations
imrtlfarm 2994d48
fix L-2 ETH accounting and G-3 balance storage
imrtlfarm f7c0051
fix H-2 native handling, add token0IsNative immutable bool, publicize…
imrtlfarm 5426f94
fix M-2 fee claiming, fix L-1 uniswap uint sizing, fix swap direction…
imrtlfarm 0ccde8e
remove console import in manager
imrtlfarm f8844f4
forge fmt
imrtlfarm 663c01c
fix L-4 and Q-1, add Intent struct, fix TYPEHASH, fix tests
imrtlfarm 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
577 changes: 577 additions & 0 deletions
577
broadcast/DeploySorellaVaultSimple.s.sol/1/run-1750205587.json
Large diffs are not rendered by default.
Oops, something went wrong.
577 changes: 577 additions & 0 deletions
577
broadcast/DeploySorellaVaultSimple.s.sol/1/run-latest.json
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| // SPDX-License-Identifier: UNLICENSED | ||
| pragma solidity 0.8.24; | ||
|
|
||
| import {Auth, Authority} from "@solmate/src/auth/Auth.sol"; | ||
| import {Address} from "@openzeppelin/contracts/utils/Address.sol"; | ||
| import {UniswapV4FluxManager, FluxManager} from "src/managers/UniswapV4FluxManager.sol"; | ||
| import {IntentsTeller} from "src/tellers/IntentsTeller.sol"; | ||
| import {BoringVault} from "src/BoringVault.sol"; | ||
| import {ERC20} from "@solmate/src/tokens/ERC20.sol"; | ||
| import {RolesAuthority, Authority} from "@solmate/src/auth/authorities/RolesAuthority.sol"; | ||
| import {ChainlinkDatum} from "src/datums/ChainlinkDatum.sol"; | ||
| import {Script} from "@forge-std/Script.sol"; | ||
| import {PoolId, IPoolManager} from "lib/v4-core/src/libraries/StateLibrary.sol"; | ||
|
|
||
| contract DeploySorellaVaultSimple is Script { | ||
| RolesAuthority internal rolesAuthority; | ||
| BoringVault internal boringVault; | ||
| ChainlinkDatum internal datum; | ||
| UniswapV4FluxManager internal manager; | ||
| address internal positionManager = 0xbD216513d74C8cf14cf4747E6AaA6420FF64ee9e; | ||
| address internal universalRouter = 0x66a9893cC07D91D95644AEDD05D03f95e1dBA8Af; | ||
| ERC20 internal token0 = ERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); | ||
| ERC20 internal token1 = ERC20(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); | ||
| address internal nativeWrapper = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; | ||
| IPoolManager internal poolManager = IPoolManager(0x000000000004444c5dc75cB358380D2e3dE08A90); | ||
| PoolId internal eth_usdc_pool_id = PoolId.wrap(0xF4CEA555F4656F4561ECD2A74EC2673331779220CD60686514983EDB16D027F3); | ||
| address internal ETH_USD_ORACLE = 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419; | ||
| address internal hook = 0x0000000AA8c2Fb9b232F78D2B286dC2aE53BfAD4; // angstrom | ||
| bool internal baseIn0Or1 = false; | ||
|
|
||
| address internal scriptOwner; | ||
| address internal owner; | ||
| address internal payout; | ||
| address internal strategist; | ||
|
|
||
| uint24 internal poolFee = uint24(0x800000); | ||
| int24 internal tickSpacing = int24(10); | ||
|
|
||
| function run() public { | ||
| vm.startBroadcast(); | ||
| /// DEPLOY CONTRACTS | ||
|
|
||
| // ownership for test deployment set to scriptOwner | ||
| scriptOwner = msg.sender; | ||
|
|
||
| // deploy roles authority with scriptOwner as owner | ||
| rolesAuthority = new RolesAuthority(scriptOwner, Authority(address(0))); | ||
|
|
||
| // deploy boring vault with scriptOwner as owner | ||
| boringVault = new BoringVault(scriptOwner, "Test0", "T0", 18); | ||
|
|
||
| // deploy datum | ||
| datum = new ChainlinkDatum(ETH_USD_ORACLE, 1 days, true); | ||
|
|
||
| // deploy manager with scriptOwner as owner | ||
| manager = new UniswapV4FluxManager( | ||
| UniswapV4FluxManager.ConstructorArgs({ | ||
| owner: address(scriptOwner), | ||
| boringVault: address(boringVault), | ||
| token0: address(token0), | ||
| token1: address(token1), | ||
| baseIn0Or1: baseIn0Or1, | ||
| nativeWrapper: nativeWrapper, | ||
| datum: address(datum), | ||
| datumLowerBound: 0.995e4, | ||
| datumUpperBound: 1.005e4, | ||
| positionManager: positionManager, | ||
| universalRouter: universalRouter, | ||
| hook: hook, | ||
| poolFee: poolFee, | ||
| tickSpacing: tickSpacing | ||
| }) | ||
| ); | ||
|
|
||
| // set roles authority as authority for boring vault | ||
| boringVault.setAuthority(rolesAuthority); | ||
|
|
||
| // set roles authority as authority for manager | ||
| manager.setAuthority(rolesAuthority); | ||
|
|
||
| // create role capability for managing the vault | ||
| rolesAuthority.setRoleCapability( | ||
| 1, address(boringVault), bytes4(keccak256(abi.encodePacked("manage(address,bytes,uint256)"))), true | ||
| ); | ||
|
|
||
| // grant the manager the role to manage the vault | ||
| rolesAuthority.setUserRole(address(manager), 1, true); | ||
|
|
||
| // create a role for calling rebalance on the manager | ||
| rolesAuthority.setRoleCapability( | ||
| 7, address(manager), bytes4(keccak256(abi.encodePacked("rebalance(uint256,(uint8,bytes)[])"))), true | ||
| ); | ||
|
|
||
| // grant the strategist address the role to rebalance | ||
| rolesAuthority.setUserRole(strategist, 7, true); | ||
|
|
||
| // set payout address | ||
| manager.setPayout(strategist); | ||
|
|
||
| // set performance fee | ||
| manager.setPerformanceFee(0.2e4); | ||
|
|
||
| // TODO: deploy and grant roles to the teller, complete all other prod roles | ||
| // TODO: ownership xfer | ||
|
|
||
| vm.stopBroadcast(); | ||
| } | ||
| } | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: These state variables (owner, payout, strategist) are declared but never initialized, which will cause role assignment to fail on line 95