From de0cf2311247d3beb87818a669c6e01c7cd7dc52 Mon Sep 17 00:00:00 2001 From: Nick Addison Date: Wed, 13 Nov 2024 09:59:03 +1100 Subject: [PATCH] Add third native staking strategy (#2304) * Deployed proxy for third native staking strategy * Added deploy script for third native staking strategy * Updated deploy file of NativeStakingSSVStrategy3Proxy * Added fork tests for 3rd Native Staking Strategy * Update comment on how to transfer proxy governance --- contracts/contracts/proxies/Proxies.sol | 18 ++ .../mainnet/109_3rd_native_ssv_staking.js | 218 +++++++++++++++ .../NativeStakingSSVStrategy3Proxy.json | 259 ++++++++++++++++++ .../nativeSsvStaking.mainnet.fork-test.js | 42 ++- contracts/utils/addresses.js | 2 + 5 files changed, 538 insertions(+), 1 deletion(-) create mode 100644 contracts/deploy/mainnet/109_3rd_native_ssv_staking.js create mode 100644 contracts/deployments/mainnet/NativeStakingSSVStrategy3Proxy.json diff --git a/contracts/contracts/proxies/Proxies.sol b/contracts/contracts/proxies/Proxies.sol index dcd28a7671..0f10d3ed44 100644 --- a/contracts/contracts/proxies/Proxies.sol +++ b/contracts/contracts/proxies/Proxies.sol @@ -246,6 +246,24 @@ contract NativeStakingFeeAccumulator2Proxy is } +/** + * @notice NativeStakingSSVStrategy3Proxy delegates calls to NativeStakingSSVStrategy implementation + */ +contract NativeStakingSSVStrategy3Proxy is + InitializeGovernedUpgradeabilityProxy +{ + +} + +/** + * @notice NativeStakingFeeAccumulator3Proxy delegates calls to FeeAccumulator implementation + */ +contract NativeStakingFeeAccumulator3Proxy is + InitializeGovernedUpgradeabilityProxy +{ + +} + /** * @notice LidoWithdrawalStrategyProxy delegates calls to a LidoWithdrawalStrategy implementation */ diff --git a/contracts/deploy/mainnet/109_3rd_native_ssv_staking.js b/contracts/deploy/mainnet/109_3rd_native_ssv_staking.js new file mode 100644 index 0000000000..bc7bc6f670 --- /dev/null +++ b/contracts/deploy/mainnet/109_3rd_native_ssv_staking.js @@ -0,0 +1,218 @@ +const { deploymentWithGovernanceProposal } = require("../../utils/deploy"); +const addresses = require("../../utils/addresses"); +const { isFork } = require("../../test/helpers.js"); +const { impersonateAccount } = require("../../utils/signers"); + +module.exports = deploymentWithGovernanceProposal( + { + deployName: "109_3rd_native_ssv_staking", + forceDeploy: false, + //forceSkip: true, + reduceQueueTime: true, + deployerIsProposer: false, + // proposalId: "", + }, + async ({ deployWithConfirmation, ethers, getTxOpts, withConfirmation }) => { + const { deployerAddr } = await getNamedAccounts(); + const sDeployer = await ethers.provider.getSigner(deployerAddr); + console.log(`Using deployer account: ${deployerAddr}`); + + // Current contracts + const cVaultProxy = await ethers.getContract("OETHVaultProxy"); + const cVaultAdmin = await ethers.getContractAt( + "OETHVaultAdmin", + cVaultProxy.address + ); + + const cHarvesterProxy = await ethers.getContract("OETHHarvesterProxy"); + const cHarvester = await ethers.getContractAt( + "OETHHarvester", + cHarvesterProxy.address + ); + + // Deployer Actions + // ---------------- + + // 1. Fetch the strategy proxy deployed by Defender Relayer + const cNativeStakingStrategyProxy = await ethers.getContract( + "NativeStakingSSVStrategy3Proxy" + ); + console.log( + `Native Staking Strategy 3 Proxy: ${cNativeStakingStrategyProxy.address}` + ); + + // 2. Deploy the new FeeAccumulator proxy + console.log(`About to deploy FeeAccumulator proxy`); + const dFeeAccumulatorProxy = await deployWithConfirmation( + "NativeStakingFeeAccumulator3Proxy" + ); + const cFeeAccumulatorProxy = await ethers.getContractAt( + "NativeStakingFeeAccumulator3Proxy", + dFeeAccumulatorProxy.address + ); + + // 3. Deploy the new FeeAccumulator implementation + console.log(`About to deploy FeeAccumulator implementation`); + const dFeeAccumulator = await deployWithConfirmation("FeeAccumulator", [ + cNativeStakingStrategyProxy.address, // _collector + ]); + const cFeeAccumulator = await ethers.getContractAt( + "FeeAccumulator", + dFeeAccumulator.address + ); + + // 4. Init the third FeeAccumulator proxy to point at the implementation, set the governor + console.log(`About to initialize FeeAccumulator`); + const proxyInitFunction = "initialize(address,address,bytes)"; + await withConfirmation( + cFeeAccumulatorProxy.connect(sDeployer)[proxyInitFunction]( + cFeeAccumulator.address, // implementation address + addresses.mainnet.Timelock, // governance + "0x", // do not call any initialize functions + await getTxOpts() + ) + ); + + // 5. Deploy the new Native Staking Strategy implementation + console.log(`About to deploy NativeStakingSSVStrategy implementation`); + const dNativeStakingStrategyImpl = await deployWithConfirmation( + "NativeStakingSSVStrategy", + [ + [addresses.zero, cVaultProxy.address], //_baseConfig + addresses.mainnet.WETH, // wethAddress + addresses.mainnet.SSV, // ssvToken + addresses.mainnet.SSVNetwork, // ssvNetwork + 500, // maxValidators + dFeeAccumulatorProxy.address, // feeAccumulator + addresses.mainnet.beaconChainDepositContract, // beacon chain deposit contract + ] + ); + const cNativeStakingStrategyImpl = await ethers.getContractAt( + "NativeStakingSSVStrategy", + dNativeStakingStrategyImpl.address + ); + + const cNativeStakingStrategy = await ethers.getContractAt( + "NativeStakingSSVStrategy", + cNativeStakingStrategyProxy.address + ); + + // 6. Initialize Native Staking Proxy with new implementation and strategy initialization + console.log(`About to initialize NativeStakingSSVStrategy`); + const initData = cNativeStakingStrategyImpl.interface.encodeFunctionData( + "initialize(address[],address[],address[])", + [ + [addresses.mainnet.WETH], // reward token addresses + /* no need to specify WETH as an asset, since we have that overriden in the "supportsAsset" + * function on the strategy + */ + [], // asset token addresses + [], // platform tokens addresses + ] + ); + + const proxyGovernor = await cNativeStakingStrategyProxy.governor(); + if (isFork && proxyGovernor != deployerAddr) { + const relayerSigner = await impersonateAccount( + addresses.mainnet.validatorRegistrator + ); + await withConfirmation( + cNativeStakingStrategyProxy + .connect(relayerSigner) + .transferGovernance(deployerAddr, await getTxOpts()) + ); + } else { + /* Before kicking off the deploy script make sure the Defender relayer transfers the governance + * of the proxy to the deployer account that shall be deploying this script so it will be able + * to initialize the proxy contract + * + * Run the following to make it happen, and comment this error block out: + * yarn run hardhat transferGovernanceNativeStakingProxy --index 3 --deployer 0xdeployerAddress --network mainnet + */ + if (proxyGovernor != deployerAddr) { + throw new Error( + `Native Staking Strategy proxy's governor: ${proxyGovernor} does not match current deployer ${deployerAddr}` + ); + } + } + + // 7. Transfer governance of the Native Staking Strategy proxy to the deployer + console.log(`About to claimGovernance of NativeStakingStrategyProxy`); + await withConfirmation( + cNativeStakingStrategyProxy + .connect(sDeployer) + .claimGovernance(await getTxOpts()) + ); + + // 8. Init the proxy to point at the implementation, set the governor, and call initialize + console.log(`About to initialize of NativeStakingStrategy2`); + await withConfirmation( + cNativeStakingStrategyProxy.connect(sDeployer)[proxyInitFunction]( + cNativeStakingStrategyImpl.address, // implementation address + addresses.mainnet.Timelock, // governance + initData, // data for call to the initialize function on the strategy + await getTxOpts() + ) + ); + + // 9. Safe approve SSV token spending + console.log(`About to safeApproveAllTokens of NativeStakingStrategy`); + await cNativeStakingStrategy.connect(sDeployer).safeApproveAllTokens(); + + // Governance Actions + // ---------------- + return { + name: `Deploy a third OETH Native Staking Strategy.`, + actions: [ + // 1. Add new strategy to vault + { + contract: cVaultAdmin, + signature: "approveStrategy(address)", + args: [cNativeStakingStrategyProxy.address], + }, + // 2. configure Harvester to support the strategy + { + contract: cHarvester, + signature: "setSupportedStrategy(address,bool)", + args: [cNativeStakingStrategyProxy.address, true], + }, + // 3. set harvester to the strategy + { + contract: cNativeStakingStrategy, + signature: "setHarvesterAddress(address)", + args: [cHarvesterProxy.address], + }, + // 4. configure the fuse interval + { + contract: cNativeStakingStrategy, + signature: "setFuseInterval(uint256,uint256)", + args: [ + ethers.utils.parseEther("21.6"), + ethers.utils.parseEther("25.6"), + ], + }, + // 5. set validator registrator to the Defender Relayer + { + contract: cNativeStakingStrategy, + signature: "setRegistrator(address)", + // The Defender Relayer + args: [addresses.mainnet.validatorRegistrator], + }, + // 6. set staking threshold + { + contract: cNativeStakingStrategy, + signature: "setStakeETHThreshold(uint256)", + // 16 validators before the 5/8 multisig has to call resetStakeETHTally + args: [ethers.utils.parseEther("512")], // 16 * 32ETH + }, + // 7. set staking monitor + { + contract: cNativeStakingStrategy, + signature: "setStakingMonitor(address)", + // The 5/8 multisig + args: [addresses.mainnet.Guardian], + }, + ], + }; + } +); diff --git a/contracts/deployments/mainnet/NativeStakingSSVStrategy3Proxy.json b/contracts/deployments/mainnet/NativeStakingSSVStrategy3Proxy.json new file mode 100644 index 0000000000..21421aed3a --- /dev/null +++ b/contracts/deployments/mainnet/NativeStakingSSVStrategy3Proxy.json @@ -0,0 +1,259 @@ +{ + "address": "0xE98538A0e8C2871C2482e1Be8cC6bd9F8E8fFD63", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousGovernor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "GovernorshipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousGovernor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "PendingGovernorshipTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "claimGovernance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "_initGovernor", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "isGovernor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newGovernor", + "type": "address" + } + ], + "name": "transferGovernance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0xa8492e63e9c7353e8d4d54868ecf1e18f130cd7883b5db14c5b5fe68a3e3ce80", + "args": [], + "numDeployments": 1, + "solcInputHash": "5e7101910c63b5cb160cf1f36fa86058", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousGovernor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newGovernor\",\"type\":\"address\"}],\"name\":\"GovernorshipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousGovernor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newGovernor\",\"type\":\"address\"}],\"name\":\"PendingGovernorshipTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimGovernance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_initGovernor\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isGovernor\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newGovernor\",\"type\":\"address\"}],\"name\":\"transferGovernance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"admin()\":{\"returns\":{\"_0\":\"The address of the proxy admin/it's also the governor.\"}},\"implementation()\":{\"returns\":{\"_0\":\"The address of the implementation.\"}},\"initialize(address,address,bytes)\":{\"details\":\"Contract initializer with Governor enforcement\",\"params\":{\"_data\":\"Data to send as msg.data to the implementation to initialize the proxied contract. It should include the signature and the parameters of the function to be called, as described in https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.\",\"_initGovernor\":\"Address of the initial Governor.\",\"_logic\":\"Address of the initial implementation.\"}},\"transferGovernance(address)\":{\"params\":{\"_newGovernor\":\"Address of the new Governor\"}},\"upgradeTo(address)\":{\"details\":\"Upgrade the backing implementation of the proxy. Only the admin can call this function.\",\"params\":{\"newImplementation\":\"Address of the new implementation.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the backing implementation of the proxy and call a function on the new implementation. This is useful to initialize the proxied contract.\",\"params\":{\"data\":\"Data to send as msg.data in the low level call. It should include the signature and the parameters of the function to be called, as described in https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.\",\"newImplementation\":\"Address of the new implementation.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"claimGovernance()\":{\"notice\":\"Claim Governance of the contract to a new account (`newGovernor`). Can only be called by the new Governor.\"},\"governor()\":{\"notice\":\"Returns the address of the current Governor.\"},\"isGovernor()\":{\"notice\":\"Returns true if the caller is the current Governor.\"},\"transferGovernance(address)\":{\"notice\":\"Transfers Governance of the contract to a new account (`newGovernor`). Can only be called by the current Governor. Must be claimed for this to complete\"}},\"notice\":\"NativeStakingSSVStrategy3Proxy delegates calls to NativeStakingSSVStrategy implementation\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/proxies/Proxies.sol\":\"NativeStakingSSVStrategyProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n assembly {\\n size := extcodesize(account)\\n }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x51b758a8815ecc9596c66c37d56b1d33883a444631a3f916b9fe65cb863ef7c4\",\"license\":\"MIT\"},\"contracts/governance/Governable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Base for contracts that are managed by the Origin Protocol's Governor.\\n * @dev Copy of the openzeppelin Ownable.sol contract with nomenclature change\\n * from owner to governor and renounce methods removed. Does not use\\n * Context.sol like Ownable.sol does for simplification.\\n * @author Origin Protocol Inc\\n */\\ncontract Governable {\\n // Storage position of the owner and pendingOwner of the contract\\n // keccak256(\\\"OUSD.governor\\\");\\n bytes32 private constant governorPosition =\\n 0x7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a;\\n\\n // keccak256(\\\"OUSD.pending.governor\\\");\\n bytes32 private constant pendingGovernorPosition =\\n 0x44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db;\\n\\n // keccak256(\\\"OUSD.reentry.status\\\");\\n bytes32 private constant reentryStatusPosition =\\n 0x53bf423e48ed90e97d02ab0ebab13b2a235a6bfbe9c321847d5c175333ac4535;\\n\\n // See OpenZeppelin ReentrancyGuard implementation\\n uint256 constant _NOT_ENTERED = 1;\\n uint256 constant _ENTERED = 2;\\n\\n event PendingGovernorshipTransfer(\\n address indexed previousGovernor,\\n address indexed newGovernor\\n );\\n\\n event GovernorshipTransferred(\\n address indexed previousGovernor,\\n address indexed newGovernor\\n );\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial Governor.\\n */\\n constructor() {\\n _setGovernor(msg.sender);\\n emit GovernorshipTransferred(address(0), _governor());\\n }\\n\\n /**\\n * @notice Returns the address of the current Governor.\\n */\\n function governor() public view returns (address) {\\n return _governor();\\n }\\n\\n /**\\n * @dev Returns the address of the current Governor.\\n */\\n function _governor() internal view returns (address governorOut) {\\n bytes32 position = governorPosition;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n governorOut := sload(position)\\n }\\n }\\n\\n /**\\n * @dev Returns the address of the pending Governor.\\n */\\n function _pendingGovernor()\\n internal\\n view\\n returns (address pendingGovernor)\\n {\\n bytes32 position = pendingGovernorPosition;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n pendingGovernor := sload(position)\\n }\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the Governor.\\n */\\n modifier onlyGovernor() {\\n require(isGovernor(), \\\"Caller is not the Governor\\\");\\n _;\\n }\\n\\n /**\\n * @notice Returns true if the caller is the current Governor.\\n */\\n function isGovernor() public view returns (bool) {\\n return msg.sender == _governor();\\n }\\n\\n function _setGovernor(address newGovernor) internal {\\n bytes32 position = governorPosition;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(position, newGovernor)\\n }\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and make it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n bytes32 position = reentryStatusPosition;\\n uint256 _reentry_status;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n _reentry_status := sload(position)\\n }\\n\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_reentry_status != _ENTERED, \\\"Reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(position, _ENTERED)\\n }\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(position, _NOT_ENTERED)\\n }\\n }\\n\\n function _setPendingGovernor(address newGovernor) internal {\\n bytes32 position = pendingGovernorPosition;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(position, newGovernor)\\n }\\n }\\n\\n /**\\n * @notice Transfers Governance of the contract to a new account (`newGovernor`).\\n * Can only be called by the current Governor. Must be claimed for this to complete\\n * @param _newGovernor Address of the new Governor\\n */\\n function transferGovernance(address _newGovernor) external onlyGovernor {\\n _setPendingGovernor(_newGovernor);\\n emit PendingGovernorshipTransfer(_governor(), _newGovernor);\\n }\\n\\n /**\\n * @notice Claim Governance of the contract to a new account (`newGovernor`).\\n * Can only be called by the new Governor.\\n */\\n function claimGovernance() external {\\n require(\\n msg.sender == _pendingGovernor(),\\n \\\"Only the pending Governor can complete the claim\\\"\\n );\\n _changeGovernor(msg.sender);\\n }\\n\\n /**\\n * @dev Change Governance of the contract to a new account (`newGovernor`).\\n * @param _newGovernor Address of the new Governor\\n */\\n function _changeGovernor(address _newGovernor) internal {\\n require(_newGovernor != address(0), \\\"New Governor is address(0)\\\");\\n emit GovernorshipTransferred(_governor(), _newGovernor);\\n _setGovernor(_newGovernor);\\n }\\n}\\n\",\"keccak256\":\"0xb7133d6ce7a9e673ff79fcedb3fd41ae6e58e251f94915bb65731abe524270b4\",\"license\":\"MIT\"},\"contracts/proxies/InitializeGovernedUpgradeabilityProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\n\\nimport { Governable } from \\\"../governance/Governable.sol\\\";\\n\\n/**\\n * @title BaseGovernedUpgradeabilityProxy\\n * @dev This contract combines an upgradeability proxy with our governor system.\\n * It is based on an older version of OpenZeppelins BaseUpgradeabilityProxy\\n * with Solidity ^0.8.0.\\n * @author Origin Protocol Inc\\n */\\ncontract InitializeGovernedUpgradeabilityProxy is Governable {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n * @param implementation Address of the new implementation.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Contract initializer with Governor enforcement\\n * @param _logic Address of the initial implementation.\\n * @param _initGovernor Address of the initial Governor.\\n * @param _data Data to send as msg.data to the implementation to initialize\\n * the proxied contract.\\n * It should include the signature and the parameters of the function to be\\n * called, as described in\\n * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.\\n * This parameter is optional, if no data is given the initialization call\\n * to proxied contract will be skipped.\\n */\\n function initialize(\\n address _logic,\\n address _initGovernor,\\n bytes calldata _data\\n ) public payable onlyGovernor {\\n require(_implementation() == address(0));\\n assert(\\n IMPLEMENTATION_SLOT ==\\n bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1)\\n );\\n _setImplementation(_logic);\\n if (_data.length > 0) {\\n (bool success, ) = _logic.delegatecall(_data);\\n require(success);\\n }\\n _changeGovernor(_initGovernor);\\n }\\n\\n /**\\n * @return The address of the proxy admin/it's also the governor.\\n */\\n function admin() external view returns (address) {\\n return _governor();\\n }\\n\\n /**\\n * @return The address of the implementation.\\n */\\n function implementation() external view returns (address) {\\n return _implementation();\\n }\\n\\n /**\\n * @dev Upgrade the backing implementation of the proxy.\\n * Only the admin can call this function.\\n * @param newImplementation Address of the new implementation.\\n */\\n function upgradeTo(address newImplementation) external onlyGovernor {\\n _upgradeTo(newImplementation);\\n }\\n\\n /**\\n * @dev Upgrade the backing implementation of the proxy and call a function\\n * on the new implementation.\\n * This is useful to initialize the proxied contract.\\n * @param newImplementation Address of the new implementation.\\n * @param data Data to send as msg.data in the low level call.\\n * It should include the signature and the parameters of the function to be called, as described in\\n * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n onlyGovernor\\n {\\n _upgradeTo(newImplementation);\\n (bool success, ) = newImplementation.delegatecall(data);\\n require(success);\\n }\\n\\n /**\\n * @dev Fallback function.\\n * Implemented entirely in `_fallback`.\\n */\\n fallback() external payable {\\n _fallback();\\n }\\n\\n /**\\n * @dev Delegates execution to an implementation contract.\\n * This is a low level function that doesn't return to its internal call site.\\n * It will return to the external caller whatever the implementation returns.\\n * @param _impl Address to delegate.\\n */\\n function _delegate(address _impl) internal {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), _impl, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev Function that is run as the first thing in the fallback function.\\n * Can be redefined in derived contracts to add functionality.\\n * Redefinitions must call super._willFallback().\\n */\\n function _willFallback() internal {}\\n\\n /**\\n * @dev fallback implementation.\\n * Extracted to enable manual triggering.\\n */\\n function _fallback() internal {\\n _willFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant IMPLEMENTATION_SLOT =\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation.\\n * @return impl Address of the current implementation\\n */\\n function _implementation() internal view returns (address impl) {\\n bytes32 slot = IMPLEMENTATION_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n impl := sload(slot)\\n }\\n }\\n\\n /**\\n * @dev Upgrades the proxy to a new implementation.\\n * @param newImplementation Address of the new implementation.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Sets the implementation address of the proxy.\\n * @param newImplementation Address of the new implementation.\\n */\\n function _setImplementation(address newImplementation) internal {\\n require(\\n Address.isContract(newImplementation),\\n \\\"Cannot set a proxy implementation to a non-contract address\\\"\\n );\\n\\n bytes32 slot = IMPLEMENTATION_SLOT;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, newImplementation)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf9bc33957fa41a745726edb6461a4bddca875a038c848286a059f0f22b7f184\",\"license\":\"MIT\"},\"contracts/proxies/Proxies.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { InitializeGovernedUpgradeabilityProxy } from \\\"./InitializeGovernedUpgradeabilityProxy.sol\\\";\\n\\n/**\\n * @notice OUSDProxy delegates calls to an OUSD implementation\\n */\\ncontract OUSDProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice WrappedOUSDProxy delegates calls to a WrappedOUSD implementation\\n */\\ncontract WrappedOUSDProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice VaultProxy delegates calls to a Vault implementation\\n */\\ncontract VaultProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice CompoundStrategyProxy delegates calls to a CompoundStrategy implementation\\n */\\ncontract CompoundStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice AaveStrategyProxy delegates calls to a AaveStrategy implementation\\n */\\ncontract AaveStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice ThreePoolStrategyProxy delegates calls to a ThreePoolStrategy implementation\\n */\\ncontract ThreePoolStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice ConvexStrategyProxy delegates calls to a ConvexStrategy implementation\\n */\\ncontract ConvexStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice HarvesterProxy delegates calls to a Harvester implementation\\n */\\ncontract HarvesterProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice DripperProxy delegates calls to a Dripper implementation\\n */\\ncontract DripperProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice MorphoCompoundStrategyProxy delegates calls to a MorphoCompoundStrategy implementation\\n */\\ncontract MorphoCompoundStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice ConvexOUSDMetaStrategyProxy delegates calls to a ConvexOUSDMetaStrategy implementation\\n */\\ncontract ConvexOUSDMetaStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice ConvexLUSDMetaStrategyProxy delegates calls to a ConvexalGeneralizedMetaStrategy implementation\\n */\\ncontract ConvexLUSDMetaStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice MorphoAaveStrategyProxy delegates calls to a MorphoCompoundStrategy implementation\\n */\\ncontract MorphoAaveStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice OETHProxy delegates calls to nowhere for now\\n */\\ncontract OETHProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice WOETHProxy delegates calls to nowhere for now\\n */\\ncontract WOETHProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice OETHVaultProxy delegates calls to a Vault implementation\\n */\\ncontract OETHVaultProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice OETHDripperProxy delegates calls to a OETHDripper implementation\\n */\\ncontract OETHDripperProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice OETHHarvesterProxy delegates calls to a Harvester implementation\\n */\\ncontract OETHHarvesterProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice FraxETHStrategyProxy delegates calls to a FraxETHStrategy implementation\\n */\\ncontract FraxETHStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice CurveEthStrategyProxy delegates calls to a CurveEthStrategy implementation\\n */\\ncontract ConvexEthMetaStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice BuybackProxy delegates calls to Buyback implementation\\n */\\ncontract BuybackProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice OETHMorphoAaveStrategyProxy delegates calls to a MorphoAaveStrategy implementation\\n */\\ncontract OETHMorphoAaveStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice OETHBalancerMetaPoolrEthStrategyProxy delegates calls to a BalancerMetaPoolStrategy implementation\\n */\\ncontract OETHBalancerMetaPoolrEthStrategyProxy is\\n InitializeGovernedUpgradeabilityProxy\\n{\\n\\n}\\n\\n/**\\n * @notice OETHBalancerMetaPoolwstEthStrategyProxy delegates calls to a BalancerMetaPoolStrategy implementation\\n */\\ncontract OETHBalancerMetaPoolwstEthStrategyProxy is\\n InitializeGovernedUpgradeabilityProxy\\n{\\n\\n}\\n\\n/**\\n * @notice FluxStrategyProxy delegates calls to a CompoundStrategy implementation\\n */\\ncontract FluxStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice MakerDsrStrategyProxy delegates calls to a Generalized4626Strategy implementation\\n */\\ncontract MakerDsrStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice FrxEthRedeemStrategyProxy delegates calls to a FrxEthRedeemStrategy implementation\\n */\\ncontract FrxEthRedeemStrategyProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice OETHBuybackProxy delegates calls to Buyback implementation\\n */\\ncontract OETHBuybackProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice BridgedWOETHProxy delegates calls to BridgedWOETH implementation\\n */\\ncontract BridgedWOETHProxy is InitializeGovernedUpgradeabilityProxy {\\n\\n}\\n\\n/**\\n * @notice NativeStakingSSVStrategy3Proxy delegates calls to NativeStakingSSVStrategy implementation\\n */\\ncontract NativeStakingSSVStrategy3Proxy is\\n InitializeGovernedUpgradeabilityProxy\\n{\\n\\n}\\n\\n/**\\n * @notice NativeStakingFeeAccumulatorProxy delegates calls to NativeStakingFeeCollector implementation\\n */\\ncontract NativeStakingFeeAccumulatorProxy is\\n InitializeGovernedUpgradeabilityProxy\\n{\\n\\n}\\n\",\"keccak256\":\"0x2e294507edd91494e1020a2a1c43502d2f5cba01266c228406562ecde7a2d872\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50610027336000805160206109df83398151915255565b6000805160206109df833981519152546040516001600160a01b03909116906000907fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a908290a36109628061007d6000396000f3fe6080604052600436106100865760003560e01c80635d36b190116100595780635d36b1901461010a578063c7af33521461011f578063cf7a1d7714610144578063d38bfff414610157578063f851a4401461009057610086565b80630c340a24146100905780633659cfe6146100c25780634f1ef286146100e25780635c60da1b146100f5575b61008e610177565b005b34801561009c57600080fd5b506100a5610197565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ce57600080fd5b5061008e6100dd366004610794565b6101b4565b61008e6100f0366004610817565b6101ed565b34801561010157600080fd5b506100a561028a565b34801561011657600080fd5b5061008e6102a2565b34801561012b57600080fd5b50610134610346565b60405190151581526020016100b9565b61008e6101523660046107b6565b610377565b34801561016357600080fd5b5061008e610172366004610794565b6104e0565b6101956101906000805160206108ed8339815191525490565b610584565b565b60006101af60008051602061090d8339815191525490565b905090565b6101bc610346565b6101e15760405162461bcd60e51b81526004016101d89061087a565b60405180910390fd5b6101ea816105a8565b50565b6101f5610346565b6102115760405162461bcd60e51b81526004016101d89061087a565b61021a836105a8565b6000836001600160a01b0316838360405161023692919061086a565b600060405180830381855af49150503d8060008114610271576040519150601f19603f3d011682016040523d82523d6000602084013e610276565b606091505b505090508061028457600080fd5b50505050565b60006101af6000805160206108ed8339815191525490565b7f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db546001600160a01b0316336001600160a01b03161461033d5760405162461bcd60e51b815260206004820152603060248201527f4f6e6c79207468652070656e64696e6720476f7665726e6f722063616e20636f60448201526f6d706c6574652074686520636c61696d60801b60648201526084016101d8565b610195336105e8565b600061035e60008051602061090d8339815191525490565b6001600160a01b0316336001600160a01b031614905090565b61037f610346565b61039b5760405162461bcd60e51b81526004016101d89061087a565b60006103b36000805160206108ed8339815191525490565b6001600160a01b0316146103c657600080fd5b6001600160a01b0384166104155760405162461bcd60e51b8152602060048201526016602482015275125b5c1b195b595b9d185d1a5bdb881b9bdd081cd95d60521b60448201526064016101d8565b61044060017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd6108b1565b6000805160206108ed8339815191521461045c5761045c6108d6565b610465846106a9565b80156104d7576000846001600160a01b0316838360405161048792919061086a565b600060405180830381855af49150503d80600081146104c2576040519150601f19603f3d011682016040523d82523d6000602084013e6104c7565b606091505b50509050806104d557600080fd5b505b610284836105e8565b6104e8610346565b6105045760405162461bcd60e51b81526004016101d89061087a565b61052c817f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db55565b806001600160a01b031661054c60008051602061090d8339815191525490565b6001600160a01b03167fa39cc5eb22d0f34d8beaefee8a3f17cc229c1a1d1ef87a5ad47313487b1c4f0d60405160405180910390a350565b3660008037600080366000845af43d6000803e8080156105a3573d6000f35b3d6000fd5b6105b1816106a9565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b03811661063e5760405162461bcd60e51b815260206004820152601a60248201527f4e657720476f7665726e6f72206973206164647265737328302900000000000060448201526064016101d8565b806001600160a01b031661065e60008051602061090d8339815191525490565b6001600160a01b03167fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a60405160405180910390a36101ea8160008051602061090d83398151915255565b803b61071d5760405162461bcd60e51b815260206004820152603b60248201527f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f60448201527f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000060648201526084016101d8565b6000805160206108ed83398151915255565b80356001600160a01b038116811461074657600080fd5b919050565b60008083601f84011261075d57600080fd5b50813567ffffffffffffffff81111561077557600080fd5b60208301915083602082850101111561078d57600080fd5b9250929050565b6000602082840312156107a657600080fd5b6107af8261072f565b9392505050565b600080600080606085870312156107cc57600080fd5b6107d58561072f565b93506107e36020860161072f565b9250604085013567ffffffffffffffff8111156107ff57600080fd5b61080b8782880161074b565b95989497509550505050565b60008060006040848603121561082c57600080fd5b6108358461072f565b9250602084013567ffffffffffffffff81111561085157600080fd5b61085d8682870161074b565b9497909650939450505050565b8183823760009101908152919050565b6020808252601a908201527f43616c6c6572206973206e6f742074686520476f7665726e6f72000000000000604082015260600190565b6000828210156108d157634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4aa26469706673582212207e3c71bc768398133a3acca228481a74d5430903370f13b78e3d0861e6840e7b64736f6c634300080700337bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a", + "deployedBytecode": "0x6080604052600436106100865760003560e01c80635d36b190116100595780635d36b1901461010a578063c7af33521461011f578063cf7a1d7714610144578063d38bfff414610157578063f851a4401461009057610086565b80630c340a24146100905780633659cfe6146100c25780634f1ef286146100e25780635c60da1b146100f5575b61008e610177565b005b34801561009c57600080fd5b506100a5610197565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ce57600080fd5b5061008e6100dd366004610794565b6101b4565b61008e6100f0366004610817565b6101ed565b34801561010157600080fd5b506100a561028a565b34801561011657600080fd5b5061008e6102a2565b34801561012b57600080fd5b50610134610346565b60405190151581526020016100b9565b61008e6101523660046107b6565b610377565b34801561016357600080fd5b5061008e610172366004610794565b6104e0565b6101956101906000805160206108ed8339815191525490565b610584565b565b60006101af60008051602061090d8339815191525490565b905090565b6101bc610346565b6101e15760405162461bcd60e51b81526004016101d89061087a565b60405180910390fd5b6101ea816105a8565b50565b6101f5610346565b6102115760405162461bcd60e51b81526004016101d89061087a565b61021a836105a8565b6000836001600160a01b0316838360405161023692919061086a565b600060405180830381855af49150503d8060008114610271576040519150601f19603f3d011682016040523d82523d6000602084013e610276565b606091505b505090508061028457600080fd5b50505050565b60006101af6000805160206108ed8339815191525490565b7f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db546001600160a01b0316336001600160a01b03161461033d5760405162461bcd60e51b815260206004820152603060248201527f4f6e6c79207468652070656e64696e6720476f7665726e6f722063616e20636f60448201526f6d706c6574652074686520636c61696d60801b60648201526084016101d8565b610195336105e8565b600061035e60008051602061090d8339815191525490565b6001600160a01b0316336001600160a01b031614905090565b61037f610346565b61039b5760405162461bcd60e51b81526004016101d89061087a565b60006103b36000805160206108ed8339815191525490565b6001600160a01b0316146103c657600080fd5b6001600160a01b0384166104155760405162461bcd60e51b8152602060048201526016602482015275125b5c1b195b595b9d185d1a5bdb881b9bdd081cd95d60521b60448201526064016101d8565b61044060017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd6108b1565b6000805160206108ed8339815191521461045c5761045c6108d6565b610465846106a9565b80156104d7576000846001600160a01b0316838360405161048792919061086a565b600060405180830381855af49150503d80600081146104c2576040519150601f19603f3d011682016040523d82523d6000602084013e6104c7565b606091505b50509050806104d557600080fd5b505b610284836105e8565b6104e8610346565b6105045760405162461bcd60e51b81526004016101d89061087a565b61052c817f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db55565b806001600160a01b031661054c60008051602061090d8339815191525490565b6001600160a01b03167fa39cc5eb22d0f34d8beaefee8a3f17cc229c1a1d1ef87a5ad47313487b1c4f0d60405160405180910390a350565b3660008037600080366000845af43d6000803e8080156105a3573d6000f35b3d6000fd5b6105b1816106a9565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b03811661063e5760405162461bcd60e51b815260206004820152601a60248201527f4e657720476f7665726e6f72206973206164647265737328302900000000000060448201526064016101d8565b806001600160a01b031661065e60008051602061090d8339815191525490565b6001600160a01b03167fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a60405160405180910390a36101ea8160008051602061090d83398151915255565b803b61071d5760405162461bcd60e51b815260206004820152603b60248201527f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f60448201527f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000060648201526084016101d8565b6000805160206108ed83398151915255565b80356001600160a01b038116811461074657600080fd5b919050565b60008083601f84011261075d57600080fd5b50813567ffffffffffffffff81111561077557600080fd5b60208301915083602082850101111561078d57600080fd5b9250929050565b6000602082840312156107a657600080fd5b6107af8261072f565b9392505050565b600080600080606085870312156107cc57600080fd5b6107d58561072f565b93506107e36020860161072f565b9250604085013567ffffffffffffffff8111156107ff57600080fd5b61080b8782880161074b565b95989497509550505050565b60008060006040848603121561082c57600080fd5b6108358461072f565b9250602084013567ffffffffffffffff81111561085157600080fd5b61085d8682870161074b565b9497909650939450505050565b8183823760009101908152919050565b6020808252601a908201527f43616c6c6572206973206e6f742074686520476f7665726e6f72000000000000604082015260600190565b6000828210156108d157634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4aa26469706673582212207e3c71bc768398133a3acca228481a74d5430903370f13b78e3d0861e6840e7b64736f6c63430008070033", + "libraries": {}, + "devdoc": { + "kind": "dev", + "methods": { + "admin()": { + "returns": { + "_0": "The address of the proxy admin/it's also the governor." + } + }, + "implementation()": { + "returns": { + "_0": "The address of the implementation." + } + }, + "initialize(address,address,bytes)": { + "details": "Contract initializer with Governor enforcement", + "params": { + "_data": "Data to send as msg.data to the implementation to initialize the proxied contract. It should include the signature and the parameters of the function to be called, as described in https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.", + "_initGovernor": "Address of the initial Governor.", + "_logic": "Address of the initial implementation." + } + }, + "transferGovernance(address)": { + "params": { + "_newGovernor": "Address of the new Governor" + } + }, + "upgradeTo(address)": { + "details": "Upgrade the backing implementation of the proxy. Only the admin can call this function.", + "params": { + "newImplementation": "Address of the new implementation." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the backing implementation of the proxy and call a function on the new implementation. This is useful to initialize the proxied contract.", + "params": { + "data": "Data to send as msg.data in the low level call. It should include the signature and the parameters of the function to be called, as described in https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.", + "newImplementation": "Address of the new implementation." + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "claimGovernance()": { + "notice": "Claim Governance of the contract to a new account (`newGovernor`). Can only be called by the new Governor." + }, + "governor()": { + "notice": "Returns the address of the current Governor." + }, + "isGovernor()": { + "notice": "Returns true if the caller is the current Governor." + }, + "transferGovernance(address)": { + "notice": "Transfers Governance of the contract to a new account (`newGovernor`). Can only be called by the current Governor. Must be claimed for this to complete" + } + }, + "notice": "NativeStakingSSVStrategy3Proxy delegates calls to NativeStakingSSVStrategy implementation", + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/test/strategies/nativeSsvStaking.mainnet.fork-test.js b/contracts/test/strategies/nativeSsvStaking.mainnet.fork-test.js index 006dbd48fb..6844cc9ddc 100644 --- a/contracts/test/strategies/nativeSsvStaking.mainnet.fork-test.js +++ b/contracts/test/strategies/nativeSsvStaking.mainnet.fork-test.js @@ -71,7 +71,6 @@ describe("ForkTest: Second Native SSV Staking Strategy", function () { nativeStakingSSVStrategy, nativeStakingFeeAccumulator, addresses: addresses.mainnet, - // TODO change to new SSV cluster when ready testValidator: { publicKey: "0xae24289bd670bfbdd3bc904596b475d080dde3415506f1abe1fb76ff292ff6bd743d710061b9e2b16fd8541a76fe53ee", @@ -88,3 +87,44 @@ describe("ForkTest: Second Native SSV Staking Strategy", function () { }; }); }); + +describe("ForkTest: Third Native SSV Staking Strategy", function () { + this.timeout(0); + + let fixture; + let nativeStakingSSVStrategy; + let nativeStakingFeeAccumulator; + beforeEach(async () => { + fixture = await loadFixture(); + nativeStakingSSVStrategy = await resolveContract( + "NativeStakingSSVStrategy3Proxy", + "NativeStakingSSVStrategy" + ); + nativeStakingFeeAccumulator = await resolveContract( + "NativeStakingFeeAccumulator3Proxy", + "FeeAccumulator" + ); + }); + + shouldBehaveLikeAnSsvStrategy(async () => { + return { + ...fixture, + nativeStakingSSVStrategy, + nativeStakingFeeAccumulator, + addresses: addresses.mainnet, + testValidator: { + publicKey: + "0x8a51c38c9c582a7fafc156cb2619c696e6fa835bb1d8692f5234d7284f571905f9763e428bf743d3a0cf3b9d0b3f41cc", + operatorIds: [338, 339, 340, 341], + sharesData: + "0x9209b998aa11eba67ac62d887efcba0e647ebf52a9353916b73155c47fecea3b0ac83978dc07eefc63df9b99a7ce4537178ae9da7c88fdb886af2ab4e66f0ed8c3aed924ebb4a3b15f99f23a9326d20c2e608a184c6de4dcaf14e0bb1fa9ad8599531b8cfcbe9eeda78b011124604c04dfacaab31da0796c18f4840114b7b48237e52b0c028f4c8f891173bfc0dbd1acb70244b0364a7e5e962109b73071860039a9c007256f1b2c3a3206abf54affe0f9b8b2469675c08ffd596d8c10446d1fb86fd875c7f329e40e5712a9749cd2c20c18f084f3f684817d8646b165da46b5393925be1b191ed674024296a0da0cb5922c5c6266a0facdf0b0e68d96a1a1a012a0260ae1f32f208ca5fbf34da5154e358d6a7e01d100599e1f36ce82a8ef7d594912b6717333db2ce68c7e7d26409709aa678b6b463cb697bbfbfca50fb19bdba6183ce616d91ebd83450530c3bd4a7dc424b43f991b86aa5cba262a0b7697b719f9b6bd9f7bdb5ae6387f65f41d47e30aab1afae33b54255a9b2fa1a26312ac26474ad43e6d16ccddceb6704fadf466e8b71530234d0475425c913f5d8ee00e2af74ca1dd4c727a732319c3e62f9ce8a093529eec4b826bf5767c326901ef6ed03ae31499f5d05231eb85e3086e1a34e23ffeacbb52755b8a63296c88db1f8f05e72dacd0711c72b3782012db8823295c1d6be511774d5c5f1ab5e4d4bb8ce7464b74d62a82968ef3d3136f1558fb5abc88dbd3be0c7334cb6d5dd5fcb5a2d7a5219e508ae016fa1c2d8f79c51c46a81b3322294805947b327adbeb7c2d62cf9a26e01e555300310ccb8f401fb250772548966192b5022c5589ca57d5848537d6d4da2a6090900fb8cdf848b26330f73156f6ba246891f6268cfe851ece05a0c5b4628f1743b1e894a625dc31b4387da0df0dfa78770bd953cedc4743ec1f1ff35e363dd6dc7deb8b4379ebb3dfea17d304a8df9af1c55382ba6fa28c834f5d702a273ab1563b598ee4a326a1a9e6ccc6179c66cd9263b501aae71332d3a27a282640d5edd6e04ee13b30374b56f193628b9cc661b803229a4996335ac6742aa2aea40d829303728e1cd6d9bc7f9a66bfd54da452a4cccf1472566df2b5876e03c96d4ce9f6f27d2bf567f412ad54a7265d65be31100640d2d577f2195f2c1e9cbe7822630a99d2906785df6d087f1eadc2122dae0808a81b6d199bbb2b2bb4fda37846bff597f084bd710736ef80f0decb9b82a08042bc1811fe184653d6a241dd12a078f105b1a47759a25b9e6ce727a492f7948a277146af6df687f2ea8a718157e429c701e1d4934462c054847237ed79998b36f6296c46fafdc47c400ee09cb6bdd1bba19541113ae022c5112cc088517cd611e895c8d7075feb0153353330bc958f639592990e246d8ddcfa85687b34f79482d11a37ee84cf938c7ffabe18418b5b5583681b32c1518261b96d73382f1dcdd1504c0c3bb7ad10173d5c24f87571415cec8fc52dd02ad1b5dfe7cffdc11458a54c0f8d7f1993f9843cd76aaf7740c88b9af964d497200a16ae89811491e2f3b1030908475dd9d6dc0879c53a7eab682de3f426377f419ee21c7288b0a0f2ec09b1655933bb30186e24f80f46eeef4f31fdbf6f8dfbf20ba45aca84a15ecada13c9150489eb33cc3f6398d9519ee01d94047fb9c45e1af226631d379c1bd729dca16ebbfc7958b2d7212de1fcc7959069286bd59d606415eb854bb933c94ab186544aef96c3d2ed74428f0e54dc5f2c45080e2340f18bdbbb3ff246b40dc27e834e8eebd7b437c3e0d76a02565e46039c0eae88805e5a6242e64851c79063bcbad35dab7a2d7d3c043f", + // This sig isn't correct but will do for testing + signature: + "0x90157a1c1b26384f0b4d41bec867d1a000f75e7b634ac7c4c6d8dfc0b0eaeb73bcc99586333d42df98c6b0a8c5ef0d8d071c68991afcd8fbbaa8b423e3632ee4fe0782bc03178a30a8bc6261f64f84a6c833fb96a0f29de1c34ede42c4a859b0", + // Calculated from npx hardhat depositRoot + depositDataRoot: + "0x3b8409ac7e028e595ac84735da6c19cdbc50931e5d6f910338614ea9660b5c86", + }, + }; + }); +}); diff --git a/contracts/utils/addresses.js b/contracts/utils/addresses.js index 1b5accb57f..f6b2edddee 100644 --- a/contracts/utils/addresses.js +++ b/contracts/utils/addresses.js @@ -269,6 +269,8 @@ addresses.mainnet.NativeStakingSSVStrategyProxy = "0x34eDb2ee25751eE67F68A45813B22811687C0238"; addresses.mainnet.NativeStakingSSVStrategy2Proxy = "0x4685dB8bF2Df743c861d71E6cFb5347222992076"; +addresses.mainnet.NativeStakingSSVStrategy3Proxy = + "0xE98538A0e8C2871C2482e1Be8cC6bd9F8E8fFD63"; // Defender relayer addresses.mainnet.validatorRegistrator =