From 57487dcb5e29595fb6d5cc9c7c38ea203845cfe6 Mon Sep 17 00:00:00 2001 From: Nicholas Addison Date: Tue, 24 Feb 2026 16:29:21 +1100 Subject: [PATCH 1/5] Removed asset and oToken from StableSwapAMMStrategy constructor Added oToken to IVault which is used by StableSwapAMMStrategy constructor Removed calculateRedeemOutput and calculateRedeemOutputs from IVault --- contracts/contracts/interfaces/IVault.sol | 23 +++++++------ .../algebra/OETHSupernovaAMOStrategy.sol | 11 ++----- .../algebra/StableSwapAMMStrategy.sol | 30 ++++++++--------- .../sonic/SonicSwapXAMOStrategy.sol | 11 ++----- contracts/deploy/deployActions.js | 32 ++----------------- 5 files changed, 35 insertions(+), 72 deletions(-) diff --git a/contracts/contracts/interfaces/IVault.sol b/contracts/contracts/interfaces/IVault.sol index c517cf82b0..a201488fed 100644 --- a/contracts/contracts/interfaces/IVault.sol +++ b/contracts/contracts/interfaces/IVault.sol @@ -117,6 +117,8 @@ interface IVault { ) external; // VaultCore.sol + + /// @notice Deprecated: use `mint(uint256 _amount)` instead. function mint( address _asset, uint256 _amount, @@ -137,17 +139,6 @@ interface IVault { function checkBalance(address _asset) external view returns (uint256); - /// @notice Deprecated: use calculateRedeemOutput - function calculateRedeemOutputs(uint256 _amount) - external - view - returns (uint256[] memory); - - function calculateRedeemOutput(uint256 _amount) - external - view - returns (uint256); - function getAssetCount() external view returns (uint256); function getAllAssets() external view returns (address[] memory); @@ -156,13 +147,20 @@ interface IVault { function getAllStrategies() external view returns (address[] memory); - /// @notice Deprecated. + function strategies(address _addr) + external + view + returns (VaultStorage.Strategy memory); + + /// @notice Deprecated: use `asset()` instead. function isSupportedAsset(address _asset) external view returns (bool); function dripper() external view returns (address); function asset() external view returns (address); + function oToken() external view returns (address); + function initialize(address) external; function addWithdrawalQueueLiquidity() external; @@ -216,6 +214,7 @@ interface IVault { function previewYield() external view returns (uint256 yield); + /// @notice Deprecated: user `asset()` instead. function weth() external view returns (address); // slither-disable-end constable-states diff --git a/contracts/contracts/strategies/algebra/OETHSupernovaAMOStrategy.sol b/contracts/contracts/strategies/algebra/OETHSupernovaAMOStrategy.sol index 1717eb1f7e..a9d2de0b61 100644 --- a/contracts/contracts/strategies/algebra/OETHSupernovaAMOStrategy.sol +++ b/contracts/contracts/strategies/algebra/OETHSupernovaAMOStrategy.sol @@ -12,14 +12,9 @@ contract OETHSupernovaAMOStrategy is StableSwapAMMStrategy { /** * @param _baseConfig The `platformAddress` is the address of the Supernova OETH/WETH pool. * The `vaultAddress` is the address of the OETH Vault. - * @param _oeth Address of the OETH token. - * @param _weth Address of the WETH token. * @param _gauge Address of the Supernova gauge for the pool. */ - constructor( - BaseStrategyConfig memory _baseConfig, - address _oeth, - address _weth, - address _gauge - ) StableSwapAMMStrategy(_baseConfig, _oeth, _weth, _gauge) {} + constructor(BaseStrategyConfig memory _baseConfig, address _gauge) + StableSwapAMMStrategy(_baseConfig, _gauge) + {} } diff --git a/contracts/contracts/strategies/algebra/StableSwapAMMStrategy.sol b/contracts/contracts/strategies/algebra/StableSwapAMMStrategy.sol index 99e039b5e7..eb54d529c7 100644 --- a/contracts/contracts/strategies/algebra/StableSwapAMMStrategy.sol +++ b/contracts/contracts/strategies/algebra/StableSwapAMMStrategy.sol @@ -154,20 +154,19 @@ contract StableSwapAMMStrategy is InitializableAbstractStrategy { /** * @param _baseConfig The `platformAddress` is the address of the Algebra pool. * The `vaultAddress` is the address of the Origin Sonic Vault. - * @param _oToken Address of the OToken. - * @param _asset Address of the asset token. * @param _gauge Address of the Algebra gauge for the pool. */ - constructor( - BaseStrategyConfig memory _baseConfig, - address _oToken, - address _asset, - address _gauge - ) InitializableAbstractStrategy(_baseConfig) { + constructor(BaseStrategyConfig memory _baseConfig, address _gauge) + InitializableAbstractStrategy(_baseConfig) + { + // Read the oToken address from the Vault + address oTokenMem = IVault(_baseConfig.vaultAddress).oToken(); + address assetMem = IVault(_baseConfig.vaultAddress).asset(); + // Checked both tokens are to 18 decimals require( - IBasicToken(_asset).decimals() == 18 && - IBasicToken(_oToken).decimals() == 18, + IBasicToken(assetMem).decimals() == 18 && + IBasicToken(oTokenMem).decimals() == 18, "Incorrect token decimals" ); // Check the Algebra pool is a Stable AMM (sAMM) @@ -180,21 +179,22 @@ contract StableSwapAMMStrategy is InitializableAbstractStrategy { IGauge(_gauge).TOKEN() == _baseConfig.platformAddress, "Incorrect gauge" ); - oTokenPoolIndex = IPair(_baseConfig.platformAddress).token0() == _oToken + oTokenPoolIndex = IPair(_baseConfig.platformAddress).token0() == + oTokenMem ? 0 : 1; // Check the pool tokens are correct require( IPair(_baseConfig.platformAddress).token0() == - (oTokenPoolIndex == 0 ? _oToken : _asset) && + (oTokenPoolIndex == 0 ? oTokenMem : assetMem) && IPair(_baseConfig.platformAddress).token1() == - (oTokenPoolIndex == 0 ? _asset : _oToken), + (oTokenPoolIndex == 0 ? assetMem : oTokenMem), "Incorrect pool tokens" ); // Set the immutable variables - oToken = _oToken; - asset = _asset; + oToken = oTokenMem; + asset = assetMem; pool = _baseConfig.platformAddress; gauge = _gauge; diff --git a/contracts/contracts/strategies/sonic/SonicSwapXAMOStrategy.sol b/contracts/contracts/strategies/sonic/SonicSwapXAMOStrategy.sol index f786fa20a2..5fd18c8dfe 100644 --- a/contracts/contracts/strategies/sonic/SonicSwapXAMOStrategy.sol +++ b/contracts/contracts/strategies/sonic/SonicSwapXAMOStrategy.sol @@ -12,14 +12,9 @@ contract SonicSwapXAMOStrategy is StableSwapAMMStrategy { /** * @param _baseConfig The `platformAddress` is the address of the SwapX pool. * The `vaultAddress` is the address of the Origin Sonic Vault. - * @param _os Address of the OS token. - * @param _ws Address of the Wrapped S (wS) token. * @param _gauge Address of the SwapX gauge for the pool. */ - constructor( - BaseStrategyConfig memory _baseConfig, - address _os, - address _ws, - address _gauge - ) StableSwapAMMStrategy(_baseConfig, _os, _ws, _gauge) {} + constructor(BaseStrategyConfig memory _baseConfig, address _gauge) + StableSwapAMMStrategy(_baseConfig, _gauge) + {} } diff --git a/contracts/deploy/deployActions.js b/contracts/deploy/deployActions.js index 9f449833d9..f5c4265598 100644 --- a/contracts/deploy/deployActions.js +++ b/contracts/deploy/deployActions.js @@ -813,7 +813,6 @@ const getPlumeContracts = async () => { }; const deploySonicSwapXAMOStrategyImplementation = async () => { - const cOSonicProxy = await ethers.getContract("OSonicProxy"); const cOSonicVaultProxy = await ethers.getContract("OSonicVaultProxy"); // Deploy Sonic SwapX AMO Strategy implementation @@ -821,8 +820,6 @@ const deploySonicSwapXAMOStrategyImplementation = async () => { "SonicSwapXAMOStrategy", [ [addresses.sonic.SwapXWSOS.pool, cOSonicVaultProxy.address], - cOSonicProxy.address, - addresses.sonic.wS, addresses.sonic.SwapXWSOS.gauge, ] ); @@ -869,11 +866,7 @@ const deploySonicSwapXAMOStrategyImplementationAndInitialize = async () => { const deployOETHSupernovaAMOStrategyPoolAndGauge = async () => { // Account authorized to call createPair on the factory contract const pairBootstrapper = "0x7F8f2B6D0b0AaE8e95221Ce90B5C26B128C1Cb66"; - const topkenHandlerWhitelister = "0xD09A1388F0CcE25DA97E8bBAbf5D083E25a5Fbc6"; const sPairBootstrapper = await impersonateAndFund(pairBootstrapper); - const sTokenHandlerWhitelister = await impersonateAndFund( - topkenHandlerWhitelister - ); const oeth = await ethers.getContract("OETHProxy"); @@ -881,10 +874,6 @@ const deployOETHSupernovaAMOStrategyPoolAndGauge = async () => { "function createPair(address tokenA, address tokenB, bool stable) external returns (address pair)", "event PairCreated(address token0, address token1, bool stable, address pair, uint);", ]; - const tokenHandlerABI = [ - "function whitelistToken(address _token) external", - "function whitelistConnector(address _token) external", - ]; const pairCreatedTopic = "0xc4805696c66d7cf352fc1d6bb633ad5ee82f6cb577c453024b6e0eb8306c6fc9"; @@ -897,10 +886,6 @@ const deployOETHSupernovaAMOStrategyPoolAndGauge = async () => { gaugeManagerAbi, addresses.mainnet.supernovaGaugeManager ); - const tokenHandler = await ethers.getContractAt( - tokenHandlerABI, - await gaugeManager.tokenHandler() - ); const factory = await ethers.getContractAt( factoryABI, @@ -908,7 +893,7 @@ const deployOETHSupernovaAMOStrategyPoolAndGauge = async () => { ); let poolAddress; - log("Creating new OETH/WETH pair..."); + console.log("Creating new OETH/WETH pair..."); const tx = await factory .connect(sPairBootstrapper) .createPair(oeth.address, addresses.mainnet.WETH, true); @@ -923,14 +908,9 @@ const deployOETHSupernovaAMOStrategyPoolAndGauge = async () => { ); console.log("Pair address:", pairAddress); - console.log("Whitelisting OETH token"); - await tokenHandler - .connect(sTokenHandlerWhitelister) - .whitelistToken(oeth.address); - poolAddress = pairAddress; - log("Creating gauge for OETH/WETH..."); + console.log("Creating gauge for OETH/WETH..."); const gaugeCreatedTopic = ethers.utils.id( "GaugeCreated(address,address,address,address,address)" ); @@ -959,19 +939,13 @@ const deployOETHSupernovaAMOStrategyImplementation = async ( const cOETHSupernovaAMOStrategyProxy = await ethers.getContract( "OETHSupernovaAMOProxy" ); - const cOETHProxy = await ethers.getContract("OETHProxy"); const cOETHVaultProxy = await ethers.getContract("OETHVaultProxy"); // Deploy OETH Supernova AMO Strategy implementation that will serve // OETH Supernova AMO const dSupernovaAMOStrategy = await deployWithConfirmation( "OETHSupernovaAMOStrategy", - [ - [poolAddress, cOETHVaultProxy.address], - cOETHProxy.address, - addresses.mainnet.WETH, - gaugeAddress, - ] + [[poolAddress, cOETHVaultProxy.address], gaugeAddress] ); const cOETHSupernovaAMOStrategy = await ethers.getContractAt( From b601bcf9aa39c4f6ceb5767e99cf564b99832f65 Mon Sep 17 00:00:00 2001 From: Nicholas Addison Date: Tue, 24 Feb 2026 17:55:22 +1100 Subject: [PATCH 2/5] Added contract diagrams for OETHSupernovaAMOStrategy --- .../contracts/strategies/algebra/README.md | 19 ++ .../OETHSupernovaAMOStrategyHierarchy.svg | 75 +++++++ .../OETHSupernovaAMOStrategyInteractions.svg | 211 ++++++++++++++++++ .../docs/OETHSupernovaAMOStrategySquashed.svg | 124 ++++++++++ .../docs/OETHSupernovaAMOStrategyStorage.svg | 129 +++++++++++ contracts/docs/generate.sh | 6 + 6 files changed, 564 insertions(+) create mode 100644 contracts/contracts/strategies/algebra/README.md create mode 100644 contracts/docs/OETHSupernovaAMOStrategyHierarchy.svg create mode 100644 contracts/docs/OETHSupernovaAMOStrategyInteractions.svg create mode 100644 contracts/docs/OETHSupernovaAMOStrategySquashed.svg create mode 100644 contracts/docs/OETHSupernovaAMOStrategyStorage.svg diff --git a/contracts/contracts/strategies/algebra/README.md b/contracts/contracts/strategies/algebra/README.md new file mode 100644 index 0000000000..2d0dc5066c --- /dev/null +++ b/contracts/contracts/strategies/algebra/README.md @@ -0,0 +1,19 @@ +# Diagrams + +## OETH Supernova AMO Strategy + +### Hierarchy + +![OETH Supernova AMO Strategy Hierarchy](../../../docs/OETHSupernovaAMOStrategyHierarchy.svg) + +### Interactions + +![OETH Supernova AMO Strategy Interactions](../../../docs/OETHSupernovaAMOStrategyInteractions.svg) + +### Squashed + +![OETH Supernova AMO Strategy Squashed](../../../docs/OETHSupernovaAMOStrategySquashed.svg) + +### Storage + +![OETH Supernova AMO Strategy Storage](../../../docs/OETHSupernovaAMOStrategyStorage.svg) diff --git a/contracts/docs/OETHSupernovaAMOStrategyHierarchy.svg b/contracts/docs/OETHSupernovaAMOStrategyHierarchy.svg new file mode 100644 index 0000000000..6141e001eb --- /dev/null +++ b/contracts/docs/OETHSupernovaAMOStrategyHierarchy.svg @@ -0,0 +1,75 @@ + + + + + + +UmlClassDiagram + + + +40 + +<<Abstract>> +Governable +../contracts/governance/Governable.sol + + + +392 + +OETHSupernovaAMOStrategy +../contracts/strategies/algebra/OETHSupernovaAMOStrategy.sol + + + +393 + +StableSwapAMMStrategy +../contracts/strategies/algebra/StableSwapAMMStrategy.sol + + + +392->393 + + + + + +246 + +<<Abstract>> +InitializableAbstractStrategy +../contracts/utils/InitializableAbstractStrategy.sol + + + +393->246 + + + + + +245 + +<<Abstract>> +Initializable +../contracts/utils/Initializable.sol + + + +246->40 + + + + + +246->245 + + + + + diff --git a/contracts/docs/OETHSupernovaAMOStrategyInteractions.svg b/contracts/docs/OETHSupernovaAMOStrategyInteractions.svg new file mode 100644 index 0000000000..e52f46975c --- /dev/null +++ b/contracts/docs/OETHSupernovaAMOStrategyInteractions.svg @@ -0,0 +1,211 @@ + + + + + + +UmlClassDiagram + + + +54 + +<<Interface>> +IBasicToken + + + +88 + +<<Interface>> +IVault + + + +286 + +<<Interface>> +IGauge + + + +287 + +<<Interface>> +IPair + + + +392 + +OETHSupernovaAMOStrategy + + + +393 + +StableSwapAMMStrategy + + + +392->393 + + + + + +393->54 + + +decimals + + + +393->88 + + +asset +burnForStrategy +mint +mintForStrategy +oToken +strategistAddr +totalValue + + + +393->286 + + +TOKEN +balanceOf +deposit +emergency +emergencyWithdraw +getReward +totalSupply +withdraw + + + +393->287 + + +approve +balanceOf +burn +decimals +getAmountOut +getReserves +isStable +mint +skim +swap +token0 +token1 +totalSupply + + + +246 + +<<Abstract>> +InitializableAbstractStrategy + + + +393->246 + + + + + +250 + +<<Library>> +StableMath + + + +393->250 + + +divPrecisely + + + +1366 + +<<Interface>> +IERC20 + + + +393->1366 + + +approve +balanceOf +totalSupply + + + +1790 + +<<Library>> +SafeERC20 + + + +393->1790 + + +safeTransfer + + + +1391 + +<<Library>> +SafeCast + + + +393->1391 + + +toInt256 + + + +246->88 + + +strategistAddr + + + +246->1366 + + +balanceOf + + + +246->1790 + + +safeTransfer + + + +1790->1366 + + +allowance + + + diff --git a/contracts/docs/OETHSupernovaAMOStrategySquashed.svg b/contracts/docs/OETHSupernovaAMOStrategySquashed.svg new file mode 100644 index 0000000000..dbbfff8a29 --- /dev/null +++ b/contracts/docs/OETHSupernovaAMOStrategySquashed.svg @@ -0,0 +1,124 @@ + + + + + + +UmlClassDiagram + + + +392 + +OETHSupernovaAMOStrategy +../contracts/strategies/algebra/OETHSupernovaAMOStrategy.sol + +Private: +   initialized: bool <<Initializable>> +   initializing: bool <<Initializable>> +   ______gap: uint256[50] <<Initializable>> +   governorPosition: bytes32 <<Governable>> +   pendingGovernorPosition: bytes32 <<Governable>> +   reentryStatusPosition: bytes32 <<Governable>> +   _deprecated_platformAddress: address <<InitializableAbstractStrategy>> +   _deprecated_vaultAddress: address <<InitializableAbstractStrategy>> +   _deprecated_rewardTokenAddress: address <<InitializableAbstractStrategy>> +   _deprecated_rewardLiquidationThreshold: uint256 <<InitializableAbstractStrategy>> +   _reserved: int256[98] <<InitializableAbstractStrategy>> +Internal: +   assetsMapped: address[] <<InitializableAbstractStrategy>> +Public: +   _NOT_ENTERED: uint256 <<Governable>> +   _ENTERED: uint256 <<Governable>> +   platformAddress: address <<InitializableAbstractStrategy>> +   vaultAddress: address <<InitializableAbstractStrategy>> +   assetToPToken: mapping(address=>address) <<InitializableAbstractStrategy>> +   harvesterAddress: address <<InitializableAbstractStrategy>> +   rewardTokenAddresses: address[] <<InitializableAbstractStrategy>> +   SOLVENCY_THRESHOLD: uint256 <<StableSwapAMMStrategy>> +   PRECISION: uint256 <<StableSwapAMMStrategy>> +   asset: address <<StableSwapAMMStrategy>> +   oToken: address <<StableSwapAMMStrategy>> +   pool: address <<StableSwapAMMStrategy>> +   gauge: address <<StableSwapAMMStrategy>> +   oTokenPoolIndex: uint256 <<StableSwapAMMStrategy>> +   maxDepeg: uint256 <<StableSwapAMMStrategy>> + +Internal: +    _governor(): (governorOut: address) <<Governable>> +    _pendingGovernor(): (pendingGovernor: address) <<Governable>> +    _setGovernor(newGovernor: address) <<Governable>> +    _setPendingGovernor(newGovernor: address) <<Governable>> +    _changeGovernor(_newGovernor: address) <<Governable>> +    _initialize(_rewardTokenAddresses: address[], _assets: address[], _pTokens: address[]) <<InitializableAbstractStrategy>> +    _collectRewardTokens() <<InitializableAbstractStrategy>> +    _setPTokenAddress(_asset: address, _pToken: address) <<InitializableAbstractStrategy>> +    _abstractSetPToken(_asset: address, _pToken: address) <<StableSwapAMMStrategy>> +    _deposit(_assetAmount: uint256): (oTokenDepositAmount: uint256, lpTokens: uint256) <<StableSwapAMMStrategy>> +    _calcTokensToMint(_assetAmount: uint256): (oTokenAmount: uint256) <<StableSwapAMMStrategy>> +    _calcTokensToBurn(_assetAmount: uint256): (lpTokens: uint256) <<StableSwapAMMStrategy>> +    _depositToPoolAndGauge(_assetAmount: uint256, _oTokenAmount: uint256): (lpTokens: uint256) <<StableSwapAMMStrategy>> +    _withdrawFromGaugeAndPool(_lpTokens: uint256) <<StableSwapAMMStrategy>> +    _emergencyWithdrawFromGaugeAndPool() <<StableSwapAMMStrategy>> +    _swapExactTokensForTokens(_amountIn: uint256, _tokenIn: address, _tokenOut: address) <<StableSwapAMMStrategy>> +    _lpValue(_lpTokens: uint256): (value: uint256) <<StableSwapAMMStrategy>> +    _invariant(_x: uint256, _y: uint256): (k: uint256) <<StableSwapAMMStrategy>> +    _solvencyAssert() <<StableSwapAMMStrategy>> +    _getPoolReserves(): (assetReserves: uint256, oTokenReserves: uint256) <<StableSwapAMMStrategy>> +    _approveBase() <<StableSwapAMMStrategy>> +External: +    transferGovernance(_newGovernor: address) <<onlyGovernor>> <<Governable>> +    claimGovernance() <<Governable>> +    collectRewardTokens() <<onlyHarvester, nonReentrant>> <<StableSwapAMMStrategy>> +    setRewardTokenAddresses(_rewardTokenAddresses: address[]) <<onlyGovernor>> <<InitializableAbstractStrategy>> +    getRewardTokenAddresses(): address[] <<InitializableAbstractStrategy>> +    setPTokenAddress(_asset: address, _pToken: address) <<onlyGovernor>> <<InitializableAbstractStrategy>> +    removePToken(_assetIndex: uint256) <<onlyGovernor>> <<InitializableAbstractStrategy>> +    setHarvesterAddress(_harvesterAddress: address) <<onlyGovernor>> <<InitializableAbstractStrategy>> +    safeApproveAllTokens() <<onlyGovernor, nonReentrant>> <<StableSwapAMMStrategy>> +    deposit(_asset: address, _assetAmount: uint256) <<onlyVault, nonReentrant, skimPool, nearBalancedPool>> <<StableSwapAMMStrategy>> +    depositAll() <<onlyVault, nonReentrant, skimPool, nearBalancedPool>> <<StableSwapAMMStrategy>> +    withdraw(_recipient: address, _asset: address, _assetAmount: uint256) <<onlyVault, nonReentrant, skimPool>> <<StableSwapAMMStrategy>> +    withdrawAll() <<onlyVaultOrGovernor, nonReentrant, skimPool>> <<StableSwapAMMStrategy>> +    checkBalance(_asset: address): (balance: uint256) <<StableSwapAMMStrategy>> +    initialize(_rewardTokenAddresses: address[], _maxDepeg: uint256) <<onlyGovernor, initializer>> <<StableSwapAMMStrategy>> +    swapAssetsToPool(_assetAmount: uint256) <<onlyStrategist, nonReentrant, improvePoolBalance, skimPool>> <<StableSwapAMMStrategy>> +    swapOTokensToPool(_oTokenAmount: uint256) <<onlyStrategist, nonReentrant, improvePoolBalance, skimPool>> <<StableSwapAMMStrategy>> +    setMaxDepeg(_maxDepeg: uint256) <<onlyGovernor>> <<StableSwapAMMStrategy>> +Public: +    <<event>> PendingGovernorshipTransfer(previousGovernor: address, newGovernor: address) <<Governable>> +    <<event>> GovernorshipTransferred(previousGovernor: address, newGovernor: address) <<Governable>> +    <<event>> PTokenAdded(_asset: address, _pToken: address) <<InitializableAbstractStrategy>> +    <<event>> PTokenRemoved(_asset: address, _pToken: address) <<InitializableAbstractStrategy>> +    <<event>> Deposit(_asset: address, _pToken: address, _amount: uint256) <<InitializableAbstractStrategy>> +    <<event>> Withdrawal(_asset: address, _pToken: address, _amount: uint256) <<InitializableAbstractStrategy>> +    <<event>> RewardTokenCollected(recipient: address, rewardToken: address, amount: uint256) <<InitializableAbstractStrategy>> +    <<event>> RewardTokenAddressesUpdated(_oldAddresses: address[], _newAddresses: address[]) <<InitializableAbstractStrategy>> +    <<event>> HarvesterAddressesUpdated(_oldHarvesterAddress: address, _newHarvesterAddress: address) <<InitializableAbstractStrategy>> +    <<event>> SwapOTokensToPool(oTokenMinted: uint256, assetDepositAmount: uint256, oTokenDepositAmount: uint256, lpTokens: uint256) <<StableSwapAMMStrategy>> +    <<event>> SwapAssetsToPool(assetSwapped: uint256, lpTokens: uint256, oTokenBurnt: uint256) <<StableSwapAMMStrategy>> +    <<event>> MaxDepegUpdated(maxDepeg: uint256) <<StableSwapAMMStrategy>> +    <<modifier>> initializer() <<Initializable>> +    <<modifier>> onlyGovernor() <<Governable>> +    <<modifier>> nonReentrant() <<Governable>> +    <<modifier>> onlyGovernorOrStrategist() <<InitializableAbstractStrategy>> +    <<modifier>> onlyVault() <<InitializableAbstractStrategy>> +    <<modifier>> onlyHarvester() <<InitializableAbstractStrategy>> +    <<modifier>> onlyVaultOrGovernor() <<InitializableAbstractStrategy>> +    <<modifier>> onlyVaultOrGovernorOrStrategist() <<InitializableAbstractStrategy>> +    <<modifier>> onlyStrategist() <<StableSwapAMMStrategy>> +    <<modifier>> skimPool() <<StableSwapAMMStrategy>> +    <<modifier>> nearBalancedPool() <<StableSwapAMMStrategy>> +    <<modifier>> improvePoolBalance() <<StableSwapAMMStrategy>> +    governor(): address <<Governable>> +    isGovernor(): bool <<Governable>> +    constructor(_config: BaseStrategyConfig) <<InitializableAbstractStrategy>> +    transferToken(_asset: address, _amount: uint256) <<onlyGovernor>> <<InitializableAbstractStrategy>> +    supportsAsset(_asset: address): bool <<StableSwapAMMStrategy>> +    constructor(_baseConfig: BaseStrategyConfig, _gauge: address) <<OETHSupernovaAMOStrategy>> + + + diff --git a/contracts/docs/OETHSupernovaAMOStrategyStorage.svg b/contracts/docs/OETHSupernovaAMOStrategyStorage.svg new file mode 100644 index 0000000000..605400b729 --- /dev/null +++ b/contracts/docs/OETHSupernovaAMOStrategyStorage.svg @@ -0,0 +1,129 @@ + + + + + + +StorageDiagram + + + +3 + +OETHSupernovaAMOStrategy <<Contract>> + +slot + +0 + +1-50 + +51 + +52 + +53 + +54 + +55 + +56 + +57 + +58 + +59-156 + +157 + +type: <inherited contract>.variable (bytes) + +unallocated (30) + +bool: Initializable.initializing (1) + +bool: Initializable.initialized (1) + +uint256[50]: Initializable.______gap (1600) + +unallocated (12) + +address: InitializableAbstractStrategy._deprecated_platformAddress (20) + +unallocated (12) + +address: InitializableAbstractStrategy._deprecated_vaultAddress (20) + +mapping(address=>address): InitializableAbstractStrategy.assetToPToken (32) + +address[]: InitializableAbstractStrategy.assetsMapped (32) + +unallocated (12) + +address: InitializableAbstractStrategy._deprecated_rewardTokenAddress (20) + +uint256: InitializableAbstractStrategy._deprecated_rewardLiquidationThreshold (32) + +unallocated (12) + +address: InitializableAbstractStrategy.harvesterAddress (20) + +address[]: InitializableAbstractStrategy.rewardTokenAddresses (32) + +int256[98]: InitializableAbstractStrategy._reserved (3136) + +uint256: StableSwapAMMStrategy.maxDepeg (32) + + + +1 + +address[]: assetsMapped <<Array>> +0x4a11f94e20a93c79f6ec743a1954ec4fc2c08429ae2122118bf234b2185c81b8 + +offset + +0 + +type: variable (bytes) + +unallocated (12) + +address (20) + + + +3:8->1 + + + + + +2 + +address[]: rewardTokenAddresses <<Array>> +0xa2999d817b6757290b50e8ecf3fa939673403dd35c97de392fdb343b4015ce9e + +offset + +0 + +type: variable (bytes) + +unallocated (12) + +address (20) + + + +3:13->2 + + + + + diff --git a/contracts/docs/generate.sh b/contracts/docs/generate.sh index 924a67b2db..0aa95283f0 100644 --- a/contracts/docs/generate.sh +++ b/contracts/docs/generate.sh @@ -65,6 +65,12 @@ sol2uml .. -v -hv -hf -he -hs -hl -hi -i prettier-plugin-solidity -b BaseCurveAM sol2uml .. -s -d 0 -b BaseCurveAMOStrategy -i prettier-plugin-solidity -o BaseCurveAMOStrategySquashed.svg sol2uml storage .. -c BaseCurveAMOStrategy -i prettier-plugin-solidity -o BaseCurveAMOStrategyStorage.svg --hideExpand ______gap,_reserved,__gap +# contracts/strategies/algebra +sol2uml .. -v -hv -hf -he -hs -hl -hi -i prettier-plugin-solidity -b OETHSupernovaAMOStrategy -o OETHSupernovaAMOStrategyHierarchy.svg +sol2uml .. -v -hv -hf -he -hs -hn -d 2 -i prettier-plugin-solidity -b OETHSupernovaAMOStrategy -o OETHSupernovaAMOStrategyInteractions.svg +sol2uml .. -s -d 0 -b OETHSupernovaAMOStrategy -i prettier-plugin-solidity -o OETHSupernovaAMOStrategySquashed.svg +sol2uml storage .. -c OETHSupernovaAMOStrategy -i prettier-plugin-solidity -o OETHSupernovaAMOStrategyStorage.svg --hideExpand ______gap,_reserved + # contracts/strategies/sonic sol2uml .. -v -hv -hf -he -hs -hl -hi -b SonicStakingStrategy -o SonicStakingStrategyHierarchy.svg sol2uml .. -s -d 0 -b SonicStakingStrategy -o SonicStakingStrategySquashed.svg From c8aacf3acbde49e58eeae882af05aaa59f5e4168 Mon Sep 17 00:00:00 2001 From: Nicholas Addison Date: Tue, 24 Feb 2026 19:31:19 +1100 Subject: [PATCH 3/5] Fix SwapX AMO fork tests --- contracts/test/strategies/sonic/swapx-amo.sonic.fork-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/test/strategies/sonic/swapx-amo.sonic.fork-test.js b/contracts/test/strategies/sonic/swapx-amo.sonic.fork-test.js index 21f387cb94..a0a4d4e0c6 100644 --- a/contracts/test/strategies/sonic/swapx-amo.sonic.fork-test.js +++ b/contracts/test/strategies/sonic/swapx-amo.sonic.fork-test.js @@ -32,7 +32,7 @@ describe("Sonic Fork Test: SwapX AMO Strategy", function () { smallPoolShare: { bootstrapAssetSwapIn: "10000000", bigLiquidityAsset: "1000000", - oTokenBuffer: "2000000", + oTokenBuffer: "1800000", stressSwapOToken: "1005000", stressSwapAsset: "2000000", stressSwapAssetAlt: "1006000", From d4529763decd1896fd612424dd92a2894cdd977b Mon Sep 17 00:00:00 2001 From: Nicholas Addison Date: Tue, 24 Feb 2026 19:31:59 +1100 Subject: [PATCH 4/5] Fix SwapX AMO fork tests --- contracts/test/behaviour/algebraAmoStrategy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/test/behaviour/algebraAmoStrategy.js b/contracts/test/behaviour/algebraAmoStrategy.js index e36e0a7a78..2dfdb90f6c 100644 --- a/contracts/test/behaviour/algebraAmoStrategy.js +++ b/contracts/test/behaviour/algebraAmoStrategy.js @@ -1243,7 +1243,7 @@ const shouldBehaveLikeAlgebraAmoStrategy = (contextFunction) => { "Strategy's check balance" ).to.withinRange( dataBefore.stratBalance, - dataBefore.stratBalance.add(1) + dataBefore.stratBalance.add(2) ); }); From 03b22b05d7f08045c92ff91b66e0b6daa2239a6d Mon Sep 17 00:00:00 2001 From: Nicholas Addison Date: Tue, 24 Feb 2026 19:50:33 +1100 Subject: [PATCH 5/5] More rounding issues with Algebra fork tests --- contracts/test/behaviour/algebraAmoStrategy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/test/behaviour/algebraAmoStrategy.js b/contracts/test/behaviour/algebraAmoStrategy.js index 2dfdb90f6c..ab2198e519 100644 --- a/contracts/test/behaviour/algebraAmoStrategy.js +++ b/contracts/test/behaviour/algebraAmoStrategy.js @@ -1265,7 +1265,7 @@ const shouldBehaveLikeAlgebraAmoStrategy = (contextFunction) => { "Strategy's check balance" ).to.withinRange( dataBefore.stratBalance, - dataBefore.stratBalance.add(1) + dataBefore.stratBalance.add(2) ); // Swap OToken into the pool and asset token out. @@ -1283,7 +1283,7 @@ const shouldBehaveLikeAlgebraAmoStrategy = (contextFunction) => { "Strategy's check balance" ).to.withinRange( dataBefore.stratBalance, - dataBefore.stratBalance.add(1) + dataBefore.stratBalance.add(2) ); }); });