diff --git a/contracts/contracts/mocks/BeaconChainDepositContractMock.sol b/contracts/contracts/mocks/BeaconChainDepositContractMock.sol deleted file mode 100644 index 3d8b995efe..0000000000 --- a/contracts/contracts/mocks/BeaconChainDepositContractMock.sol +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -contract BeaconChainDepositContractMock { - /// @notice A processed deposit event. - event DepositEvent( - bytes pubkey, - bytes withdrawal_credentials, - bytes amount, - bytes signature, - bytes index - ); - - /// @notice Submit a Phase 0 DepositData object. - /// @param pubkey A BLS12-381 public key. - /// @param withdrawal_credentials Commitment to a public key for withdrawals. - /// @param signature A BLS12-381 signature. - /// @param deposit_data_root The SHA-256 hash of the SSZ-encoded DepositData object. - /// Used as a protection against malformed input. - function deposit( - bytes calldata pubkey, - bytes calldata withdrawal_credentials, - bytes calldata signature, - bytes32 deposit_data_root - ) external payable { - // Extended ABI length checks since dynamic types are used. - require(pubkey.length == 48, "DepositContract: invalid pubkey length"); - require( - withdrawal_credentials.length == 32, - "DepositContract: invalid withdrawal_credentials length" - ); - require( - signature.length == 96, - "DepositContract: invalid signature length" - ); - - // Check deposit amount - require(msg.value >= 1 ether, "DepositContract: deposit value too low"); - require( - msg.value % 1 gwei == 0, - "DepositContract: deposit value not multiple of gwei" - ); - uint256 deposit_amount = msg.value / 1 gwei; - require( - deposit_amount <= type(uint64).max, - "DepositContract: deposit value too high" - ); - require( - deposit_data_root != 0, - "DepositContract: invalid deposit_data_root" - ); - } -} diff --git a/contracts/contracts/mocks/MockDepositContract.sol b/contracts/contracts/mocks/MockDepositContract.sol new file mode 100644 index 0000000000..dbe41ec780 --- /dev/null +++ b/contracts/contracts/mocks/MockDepositContract.sol @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import { IDepositContract } from "./../interfaces/IDepositContract.sol"; + +contract MockDepositContract is IDepositContract { + uint256 deposit_count; + + function deposit( + bytes calldata pubkey, + bytes calldata withdrawal_credentials, + bytes calldata signature, + bytes32 deposit_data_root + ) external payable override { + require(pubkey.length == 48, "DepositContract: invalid pubkey length"); + require( + withdrawal_credentials.length == 32, + "DepositContract: invalid withdrawal_credentials length" + ); + require( + signature.length == 96, + "DepositContract: invalid signature length" + ); + + // Check deposit amount + require(msg.value >= 1 ether, "DepositContract: deposit value too low"); + require( + msg.value % 1 gwei == 0, + "DepositContract: deposit value not multiple of gwei" + ); + uint256 deposit_amount = msg.value / 1 gwei; + require( + deposit_amount <= type(uint64).max, + "DepositContract: deposit value too high" + ); + + // Emit `DepositEvent` log + bytes memory amount = to_little_endian_64(uint64(deposit_amount)); + emit DepositEvent( + pubkey, + withdrawal_credentials, + amount, + signature, + to_little_endian_64(uint64(deposit_count)) + ); + require( + deposit_data_root != 0, + "DepositContract: invalid deposit_data_root" + ); + } + + function get_deposit_root() external view override returns (bytes32) { + // just return some bytes32 + return sha256(abi.encodePacked(deposit_count, bytes16(0))); + } + + /// @notice Query the current deposit count. + /// @return The deposit count encoded as a little endian 64-bit number. + function get_deposit_count() external view override returns (bytes memory) { + return to_little_endian_64(uint64(deposit_count)); + } + + function to_little_endian_64(uint64 value) + internal + pure + returns (bytes memory ret) + { + ret = new bytes(8); + bytes8 bytesValue = bytes8(value); + // Byteswapping during copying to bytes. + ret[0] = bytesValue[7]; + ret[1] = bytesValue[6]; + ret[2] = bytesValue[5]; + ret[3] = bytesValue[4]; + ret[4] = bytesValue[3]; + ret[5] = bytesValue[2]; + ret[6] = bytesValue[1]; + ret[7] = bytesValue[0]; + } +} diff --git a/contracts/contracts/mocks/MockSSVNetwork.sol b/contracts/contracts/mocks/MockSSVNetwork.sol index b2ef1e8509..38b36e3e5f 100644 --- a/contracts/contracts/mocks/MockSSVNetwork.sol +++ b/contracts/contracts/mocks/MockSSVNetwork.sol @@ -1,6 +1,32 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +import { Cluster } from "./../interfaces/ISSVNetwork.sol"; + contract MockSSVNetwork { - constructor() {} + function registerValidator( + bytes calldata publicKey, + uint64[] calldata operatorIds, + bytes calldata sharesData, + uint256 amount, + Cluster memory cluster + ) external {} + + function exitValidator( + bytes calldata publicKey, + uint64[] calldata operatorIds + ) external {} + + function removeValidator( + bytes calldata publicKey, + uint64[] calldata operatorIds, + Cluster memory cluster + ) external {} + + function deposit( + address clusterOwner, + uint64[] calldata operatorIds, + uint256 amount, + Cluster memory cluster + ) external {} } diff --git a/contracts/contracts/strategies/NativeStaking/ValidatorRegistrator.sol b/contracts/contracts/strategies/NativeStaking/ValidatorRegistrator.sol index a34079abd5..219ebfb45e 100644 --- a/contracts/contracts/strategies/NativeStaking/ValidatorRegistrator.sol +++ b/contracts/contracts/strategies/NativeStaking/ValidatorRegistrator.sol @@ -37,9 +37,15 @@ abstract contract ValidatorRegistrator is Governable, Pausable { uint256 public activeDepositedValidators; /// @notice State of the validators keccak256(pubKey) => state mapping(bytes32 => VALIDATOR_STATE) public validatorsStates; - + /// @notice The account that is allowed to modify stakeETHThreshold and reset stakeETHTally + address public stakingMonitor; + /// @notice Amount of ETH that can be staked before staking on the contract is suspended + /// and the governor needs to approve further staking + uint256 public stakeETHThreshold; + /// @notice Amount of ETH that can has been staked since the last governor approval. + uint256 public stakeETHTally; // For future use - uint256[50] private __gap; + uint256[47] private __gap; enum VALIDATOR_STATE { REGISTERED, // validator is registered on the SSV network @@ -49,10 +55,13 @@ abstract contract ValidatorRegistrator is Governable, Pausable { } event RegistratorChanged(address newAddress); + event StakingMonitorChanged(address newAddress); event ETHStaked(bytes pubkey, uint256 amount, bytes withdrawal_credentials); event SSVValidatorRegistered(bytes pubkey, uint64[] operatorIds); event SSVValidatorExitInitiated(bytes pubkey, uint64[] operatorIds); event SSVValidatorExitCompleted(bytes pubkey, uint64[] operatorIds); + event StakeETHThresholdChanged(uint256 amount); + event StakeETHTallyReset(); /// @dev Throws if called by any account other than the Registrator modifier onlyRegistrator() { @@ -63,6 +72,12 @@ abstract contract ValidatorRegistrator is Governable, Pausable { _; } + /// @dev Throws if called by any account other than the Staking monitor + modifier onlyStakingMonitor() { + require(msg.sender == stakingMonitor, "Caller is not the Monitor"); + _; + } + /// @dev Throws if called by any account other than the Strategist modifier onlyStrategist() { require( @@ -94,6 +109,25 @@ abstract contract ValidatorRegistrator is Governable, Pausable { validatorRegistrator = _address; } + /// @notice Set the address of the staking monitor that is allowed to reset stakeETHTally + function setStakingMonitor(address _address) external onlyGovernor { + emit StakingMonitorChanged(_address); + stakingMonitor = _address; + } + + /// @notice Set the amount of ETH that can be staked before staking monitor + // needs to a approve further staking by resetting the stake ETH tally + function setStakeETHThreshold(uint256 _amount) external onlyGovernor { + emit StakeETHThresholdChanged(_amount); + stakeETHThreshold = _amount; + } + + /// @notice Reset the stakeETHTally + function resetStakeETHTally() external onlyStakingMonitor { + emit StakeETHTallyReset(); + stakeETHTally = 0; + } + /// @notice Stakes WETH to the node validators /// @param validators A list of validator data needed to stake. /// The `ValidatorStakeData` struct contains the pubkey, signature and depositDataRoot. @@ -112,6 +146,12 @@ abstract contract ValidatorRegistrator is Governable, Pausable { "insufficient WETH" ); + require( + stakeETHTally + requiredETH <= stakeETHThreshold, + "Staking ETH over threshold" + ); + stakeETHTally += requiredETH; + // Convert required ETH from WETH IWETH9(WETH_TOKEN_ADDRESS).withdraw(requiredETH); _wethWithdrawnAndStaked(requiredETH); diff --git a/contracts/deploy/holesky/010_upgrade_strategy.js b/contracts/deploy/holesky/010_upgrade_strategy.js new file mode 100644 index 0000000000..a073a9d2b1 --- /dev/null +++ b/contracts/deploy/holesky/010_upgrade_strategy.js @@ -0,0 +1,48 @@ +const { upgradeNativeStakingSSVStrategy } = require("../deployActions"); +const { withConfirmation } = require("../../utils/deploy"); +const { resolveContract } = require("../../utils/resolvers"); +const addresses = require("../../utils/addresses"); +const { parseEther } = require("ethers/lib/utils"); +// const { impersonateAndFund } = require("../../utils/signers.js"); + +const mainExport = async () => { + console.log("Running 010 deployment on Holesky..."); + + console.log("Upgrading native staking strategy"); + await upgradeNativeStakingSSVStrategy(); + + const cNativeStakingStrategy = await resolveContract( + "NativeStakingSSVStrategyProxy", + "NativeStakingSSVStrategy" + ); + + const { governorAddr } = await getNamedAccounts(); + const sGovernor = await ethers.provider.getSigner(governorAddr); + + await withConfirmation( + cNativeStakingStrategy + .connect(sGovernor) + // Holesky defender relayer + .setStakingMonitor(addresses.holesky.Guardian) + ); + + await withConfirmation( + cNativeStakingStrategy + .connect(sGovernor) + .setStakeETHThreshold(parseEther("64")) + ); + + console.log( + `Set the staking monitor to ${addresses.holesky.Guardian} and stake ETH threshold to 32 ETH` + ); + + console.log("Running 010 deployment done"); + return true; +}; + +mainExport.id = "010_upgrade_strategy"; +mainExport.tags = []; +mainExport.dependencies = []; +mainExport.skip = () => false; + +module.exports = mainExport; diff --git a/contracts/deploy/mainnet/000_mock.js b/contracts/deploy/mainnet/000_mock.js index 1de8037eb4..0c3fac6db7 100644 --- a/contracts/deploy/mainnet/000_mock.js +++ b/contracts/deploy/mainnet/000_mock.js @@ -136,6 +136,11 @@ const deployMocks = async ({ getNamedAccounts, deployments }) => { from: deployerAddr, }); + // Mock SSV Network + await deploy("MockDepositContract", { + from: deployerAddr, + }); + const dai = await ethers.getContract("MockDAI"); const usdc = await ethers.getContract("MockUSDC"); const usdt = await ethers.getContract("MockUSDT"); @@ -425,10 +430,6 @@ const deployMocks = async ({ getNamedAccounts, deployments }) => { from: deployerAddr, }); - await deploy("BeaconChainDepositContractMock", { - from: deployerAddr, - }); - console.log("000_mock deploy done."); return true; diff --git a/contracts/deploy/mainnet/097_native_ssv_staking.js b/contracts/deploy/mainnet/097_native_ssv_staking.js index 70503d6891..64fa655a42 100644 --- a/contracts/deploy/mainnet/097_native_ssv_staking.js +++ b/contracts/deploy/mainnet/097_native_ssv_staking.js @@ -197,7 +197,21 @@ module.exports = deploymentWithGovernanceProposal( signature: "setRegistrator(address)", args: [addresses.mainnet.validatorRegistrator], }, - // 6. Upgrade the OETH Harvester + // 6. set staking threshold + { + contract: cStrategy, + signature: "setStakeETHThreshold(uint256)", + // TODO: confirm this number makes sense + args: [ethers.utils.parseEther("1024")], // 32ETH * 32 + }, + // 7. set staking monitor + { + contract: cStrategy, + signature: "setStakingMonitor(address)", + // The 5/8 multisig + args: [addresses.mainnet.Guardian], + }, + // 8. Upgrade the OETH Harvester { contract: cOETHHarvesterProxy, signature: "upgradeTo(address)", diff --git a/contracts/deployments/holesky/.migrations.json b/contracts/deployments/holesky/.migrations.json index 4335e20f75..f9a0e00a78 100644 --- a/contracts/deployments/holesky/.migrations.json +++ b/contracts/deployments/holesky/.migrations.json @@ -7,5 +7,6 @@ "006_update_registrator": 1715184342, "007_upgrade_strategy": 1715251466, "008_upgrade_strategy": 1715341541, - "009_upgrade_strategy": 1716360052 + "009_upgrade_strategy": 1716360052, + "010_upgrade_strategy": 1716890877 } \ No newline at end of file diff --git a/contracts/deployments/holesky/NativeStakingSSVStrategy.json b/contracts/deployments/holesky/NativeStakingSSVStrategy.json index f466e3a4fb..4600085e5f 100644 --- a/contracts/deployments/holesky/NativeStakingSSVStrategy.json +++ b/contracts/deployments/holesky/NativeStakingSSVStrategy.json @@ -1,5 +1,5 @@ { - "address": "0xa48dE0659EA8d9CFC293F47FD0d74d644690EB4B", + "address": "0x0D875FD10401F57e117bd53f82411c706247AD4f", "abi": [ { "inputs": [ @@ -422,6 +422,38 @@ "name": "SSVValidatorRegistered", "type": "event" }, + { + "anonymous": false, + "inputs": [], + "name": "StakeETHTallyReset", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "StakeETHThresholdChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "StakingMonitorChanged", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -1054,6 +1086,13 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "resetStakeETHTally", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -1155,6 +1194,58 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "setStakeETHThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "setStakingMonitor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stakeETHTally", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakeETHThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -1185,6 +1276,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "stakingMonitor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -1315,34 +1419,34 @@ "type": "receive" } ], - "transactionHash": "0x8ca768edbc9a7d1fc3fcd31ced7c70f27cba30f49f1916f6a7f68934956feb76", + "transactionHash": "0x065cc099e02ada3882563847d84334b70335d2c03ef455ffb1710506b00a329c", "receipt": { "to": null, "from": "0x1b94CA50D3Ad9f8368851F8526132272d1a5028C", - "contractAddress": "0xa48dE0659EA8d9CFC293F47FD0d74d644690EB4B", - "transactionIndex": 8, - "gasUsed": "4205791", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000002004000000000000002000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000010000000000000000000000000000000000000000020000000000000000008000000000000000000000000000000000000000000000000", - "blockHash": "0x1a290a506c0cf9148a26e778adacf7bd59da033eede5b446f4f2a8b0ce51f393", - "transactionHash": "0x8ca768edbc9a7d1fc3fcd31ced7c70f27cba30f49f1916f6a7f68934956feb76", + "contractAddress": "0x0D875FD10401F57e117bd53f82411c706247AD4f", + "transactionIndex": 130, + "gasUsed": "4375470", + "logsBloom": "0x00000000000000000002000000000000000000000000000000000000000000000000000000000000000000040000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000000004000000000000002000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000000000010000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xb813c87a79b54dfd4eeb9cebc658d24eb347d0b2e94ec4f40934550ef9e6681b", + "transactionHash": "0x065cc099e02ada3882563847d84334b70335d2c03ef455ffb1710506b00a329c", "logs": [ { - "transactionIndex": 8, - "blockNumber": 1589658, - "transactionHash": "0x8ca768edbc9a7d1fc3fcd31ced7c70f27cba30f49f1916f6a7f68934956feb76", - "address": "0xa48dE0659EA8d9CFC293F47FD0d74d644690EB4B", + "transactionIndex": 130, + "blockNumber": 1626892, + "transactionHash": "0x065cc099e02ada3882563847d84334b70335d2c03ef455ffb1710506b00a329c", + "address": "0x0D875FD10401F57e117bd53f82411c706247AD4f", "topics": [ "0xc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000001b94ca50d3ad9f8368851f8526132272d1a5028c" ], "data": "0x", - "logIndex": 12, - "blockHash": "0x1a290a506c0cf9148a26e778adacf7bd59da033eede5b446f4f2a8b0ce51f393" + "logIndex": 209, + "blockHash": "0xb813c87a79b54dfd4eeb9cebc658d24eb347d0b2e94ec4f40934550ef9e6681b" } ], - "blockNumber": 1589658, - "cumulativeGasUsed": "4985268", + "blockNumber": 1626892, + "cumulativeGasUsed": "13590958", "status": 1, "byzantium": true }, @@ -1357,11 +1461,11 @@ "0x65a289f4BF934c964C942eFF6E6F83b6481BE550", "0x4242424242424242424242424242424242424242" ], - "numDeployments": 4, - "solcInputHash": "279a9fe8a2da81dca55abd3c6ec521f8", - "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"platformAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaultAddress\",\"type\":\"address\"}],\"internalType\":\"struct InitializableAbstractStrategy.BaseStrategyConfig\",\"name\":\"_baseConfig\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"_wethAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ssvToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ssvNetwork\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_feeAccumulator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beaconChainDepositContract\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AccountingConsensusRewards\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"noOfValidators\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remainingValidators\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wethSentToVault\",\"type\":\"uint256\"}],\"name\":\"AccountingFullyWithdrawnValidator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"validatorsDelta\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"consensusRewardsDelta\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wethToVault\",\"type\":\"uint256\"}],\"name\":\"AccountingManuallyFixed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remainingValidators\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wethSentToVault\",\"type\":\"uint256\"}],\"name\":\"AccountingValidatorSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_pToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"pubkey\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"withdrawal_credentials\",\"type\":\"bytes\"}],\"name\":\"ETHStaked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"name\":\"FuseIntervalUpdated\",\"type\":\"event\"},{\"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\":false,\"internalType\":\"address\",\"name\":\"_oldHarvesterAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_newHarvesterAddress\",\"type\":\"address\"}],\"name\":\"HarvesterAddressesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_pToken\",\"type\":\"address\"}],\"name\":\"PTokenAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_pToken\",\"type\":\"address\"}],\"name\":\"PTokenRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"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\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"RegistratorChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"_oldAddresses\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"_newAddresses\",\"type\":\"address[]\"}],\"name\":\"RewardTokenAddressesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"rewardToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"RewardTokenCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"pubkey\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"}],\"name\":\"SSVValidatorExitCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"pubkey\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"}],\"name\":\"SSVValidatorExitInitiated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"pubkey\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"}],\"name\":\"SSVValidatorRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_pToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BEACON_CHAIN_DEPOSIT_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FEE_ACCUMULATOR_ADDRESS\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_STAKE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_FIX_ACCOUNTING_CADENCE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SSV_NETWORK_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SSV_TOKEN_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VAULT_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WETH_TOKEN_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"activeDepositedValidators\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"assetToPToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"}],\"name\":\"checkBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimGovernance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"collectRewardTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"consensusRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"validatorCount\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"networkFeeIndex\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"index\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"internalType\":\"struct Cluster\",\"name\":\"cluster\",\"type\":\"tuple\"}],\"name\":\"depositSSV\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositedWethAccountedFor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"doAccounting\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"accountingValid\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"publicKey\",\"type\":\"bytes\"},{\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"}],\"name\":\"exitSsvValidator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fuseIntervalEnd\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fuseIntervalStart\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRewardTokenAddresses\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"harvesterAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_rewardTokenAddresses\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_assets\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_pTokens\",\"type\":\"address[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isGovernor\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastFixAccountingBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"_validatorsDelta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"_consensusRewardsDelta\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"_ethToVaultAmount\",\"type\":\"uint256\"}],\"name\":\"manuallyFixAccounting\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"platformAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"publicKey\",\"type\":\"bytes\"},{\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"},{\"internalType\":\"bytes\",\"name\":\"sharesData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"validatorCount\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"networkFeeIndex\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"index\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"internalType\":\"struct Cluster\",\"name\":\"cluster\",\"type\":\"tuple\"}],\"name\":\"registerSsvValidator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_assetIndex\",\"type\":\"uint256\"}],\"name\":\"removePToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"publicKey\",\"type\":\"bytes\"},{\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"validatorCount\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"networkFeeIndex\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"index\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"internalType\":\"struct Cluster\",\"name\":\"cluster\",\"type\":\"tuple\"}],\"name\":\"removeSsvValidator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"rewardTokenAddresses\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"safeApproveAllTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_fuseIntervalStart\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fuseIntervalEnd\",\"type\":\"uint256\"}],\"name\":\"setFuseInterval\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_harvesterAddress\",\"type\":\"address\"}],\"name\":\"setHarvesterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_pToken\",\"type\":\"address\"}],\"name\":\"setPTokenAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"setRegistrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_rewardTokenAddresses\",\"type\":\"address[]\"}],\"name\":\"setRewardTokenAddresses\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"pubkey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"depositDataRoot\",\"type\":\"bytes32\"}],\"internalType\":\"struct ValidatorStakeData[]\",\"name\":\"validators\",\"type\":\"tuple[]\"}],\"name\":\"stakeEth\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"}],\"name\":\"supportsAsset\",\"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\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transferToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"validatorRegistrator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"validatorsStates\",\"outputs\":[{\"internalType\":\"enum ValidatorRegistrator.VALIDATOR_STATE\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vaultAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Origin Protocol Inc\",\"details\":\"This contract handles WETH and ETH and in some operations interchanges between the two. Any WETH that is on the contract across multiple blocks (and not just transitory within a transaction) is considered an asset. Meaning deposits increase the balance of the asset and withdrawal decrease it. As opposed to all our other strategies the WETH doesn't immediately get deposited into an underlying strategy and can be present across multiple blocks waiting to be unwrapped to ETH and staked to validators. This separation of WETH and ETH is required since the rewards (reward token) is also in ETH. To simplify the accounting of WETH there is another difference in behavior compared to the other strategies. To withdraw WETH asset - exit message is posted to validators and the ETH hits this contract with multiple days delay. In order to simplify the WETH accounting upon detection of such an event the ValidatorAccountant immediately wraps ETH to WETH and sends it to the Vault. On the other hand any ETH on the contract (across multiple blocks) is there either: - as a result of already accounted for consensus rewards - as a result of not yet accounted for consensus rewards - as a results of not yet accounted for full validator withdrawals (or validator slashes) Even though the strategy assets and rewards are a very similar asset the consensus layer rewards and the execution layer rewards are considered rewards and those are dripped to the Vault over a configurable time interval and not immediately.\",\"kind\":\"dev\",\"methods\":{\"checkBalance(address)\":{\"params\":{\"_asset\":\"Address of weth asset\"},\"returns\":{\"balance\":\" Total value of (W)ETH\"}},\"constructor\":{\"params\":{\"_baseConfig\":\"Base strategy config with platformAddress (ERC-4626 Vault contract), eg sfrxETH or sDAI, and vaultAddress (OToken Vault contract), eg VaultProxy or OETHVaultProxy\",\"_beaconChainDepositContract\":\"Address of the beacon chain deposit contract\",\"_feeAccumulator\":\"Address of the fee accumulator receiving execution layer validator rewards\",\"_ssvNetwork\":\"Address of the SSV Network contract\",\"_ssvToken\":\"Address of the Erc20 SSV Token contract\",\"_wethAddress\":\"Address of the Erc20 WETH Token contract\"}},\"deposit(address,uint256)\":{\"params\":{\"_amount\":\"Amount of assets that were transferred to the strategy by the vault.\",\"_asset\":\"Address of asset to deposit. Has to be WETH.\"}},\"depositSSV(uint64[],uint256,(uint32,uint64,uint64,bool,uint256))\":{\"details\":\"A SSV cluster is defined by the SSVOwnerAddress and the set of operatorIds. uses \\\"onlyStrategist\\\" modifier so continuous front-running can't DOS our maintenance service that tries to top up SSV tokens.\",\"params\":{\"cluster\":\"The SSV cluster details that must be derived from emitted events from the SSVNetwork contract.\"}},\"doAccounting()\":{\"details\":\"This function could in theory be permission-less but lets allow only the Registrator (Defender Action) to call it for now.\",\"returns\":{\"accountingValid\":\"true if accounting was successful, false if fuse is blown\"}},\"getRewardTokenAddresses()\":{\"returns\":{\"_0\":\"address[] the reward token addresses.\"}},\"initialize(address[],address[],address[])\":{\"params\":{\"_assets\":\"Addresses of initial supported assets\",\"_pTokens\":\"Platform Token corresponding addresses\",\"_rewardTokenAddresses\":\"Address of reward token for platform\"}},\"manuallyFixAccounting(int256,int256,uint256)\":{\"details\":\"There is a case when a validator(s) gets slashed so much that the eth swept from the beacon chain enters the fuse area and there are no consensus rewards on the contract to \\\"dip into\\\"/use. To increase the amount of unaccounted ETH over the fuse end interval we need to reduce the amount of active deposited validators and immediately send WETH to the vault, so it doesn't interfere with further accounting.\",\"params\":{\"_consensusRewardsDelta\":\"adjust the accounted for consensus rewards up or down\",\"_ethToVaultAmount\":\"the amount of ETH that gets wrapped into WETH and sent to the Vault\",\"_validatorsDelta\":\"adjust the active validators by up to plus three or minus three\"}},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"removePToken(uint256)\":{\"params\":{\"_assetIndex\":\"Index of the asset to be removed\"}},\"setHarvesterAddress(address)\":{\"params\":{\"_harvesterAddress\":\"Address of the harvester contract.\"}},\"setPTokenAddress(address,address)\":{\"params\":{\"_asset\":\"Address for the asset\",\"_pToken\":\"Address for the corresponding platform token\"}},\"setRewardTokenAddresses(address[])\":{\"params\":{\"_rewardTokenAddresses\":\"Array of reward token addresses\"}},\"stakeEth((bytes,bytes,bytes32)[])\":{\"params\":{\"validators\":\"A list of validator data needed to stake. The `ValidatorStakeData` struct contains the pubkey, signature and depositDataRoot. Only the registrator can call this function.\"}},\"supportsAsset(address)\":{\"params\":{\"_asset\":\"The address of the asset token.\"}},\"transferGovernance(address)\":{\"params\":{\"_newGovernor\":\"Address of the new Governor\"}},\"transferToken(address,uint256)\":{\"params\":{\"_amount\":\"Amount of the asset to transfer\",\"_asset\":\"Address for the asset\"}},\"withdraw(address,address,uint256)\":{\"params\":{\"_amount\":\"Amount of WETH to withdraw\",\"_asset\":\"WETH to withdraw\",\"_recipient\":\"Address to receive withdrawn assets\"}}},\"stateVariables\":{\"FEE_ACCUMULATOR_ADDRESS\":{\"details\":\"this address will receive Execution layer rewards - These are rewards earned for executing transactions on the Ethereum network as part of block proposals. They include priority fees (fees paid by users for their transactions to be included) and MEV rewards (rewards for arranging transactions in a way that benefits the validator).\"},\"depositedWethAccountedFor\":{\"details\":\"This contract receives WETH as the deposit asset, but unlike other strategies doesn't immediately deposit it to an underlying platform. Rather a special privilege account stakes it to the validators. For that reason calling WETH.balanceOf(this) in a deposit function can contain WETH that has just been deposited and also WETH that has previously been deposited. To keep a correct count we need to keep track of WETH that has already been accounted for. This value represents the amount of WETH balance of this contract that has already been accounted for by the deposit events. It is important to note that this variable is not concerned with WETH that is a result of full/partial withdrawal of the validators. It is strictly concerned with WETH that has been deposited and is waiting to be staked.\"}},\"title\":\"Native Staking SSV Strategy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"BEACON_CHAIN_DEPOSIT_CONTRACT()\":{\"notice\":\"The address of the beacon chain deposit contract\"},\"FEE_ACCUMULATOR_ADDRESS()\":{\"notice\":\"Fee collector address\"},\"MAX_STAKE()\":{\"notice\":\"The maximum amount of ETH that can be staked by a validator\"},\"MIN_FIX_ACCOUNTING_CADENCE()\":{\"notice\":\"The minimum amount of blocks that need to pass between two calls to manuallyFixAccounting\"},\"SSV_NETWORK_ADDRESS()\":{\"notice\":\"The address of the SSV Network contract used to interface with\"},\"SSV_TOKEN_ADDRESS()\":{\"notice\":\"SSV ERC20 token that serves as a payment for operating SSV validators\"},\"VAULT_ADDRESS()\":{\"notice\":\"Address of the OETH Vault proxy contract\"},\"WETH_TOKEN_ADDRESS()\":{\"notice\":\"The address of the Wrapped ETH (WETH) token contract\"},\"activeDepositedValidators()\":{\"notice\":\"The number of validators that have 32 (!) ETH actively deposited. When a new deposit to a validator happens this number increases, when a validator exit is detected this number decreases.\"},\"assetToPToken(address)\":{\"notice\":\"asset => pToken (Platform Specific Token Address)\"},\"checkBalance(address)\":{\"notice\":\"Returns the total value of (W)ETH that is staked to the validators and WETH deposits that are still to be staked. This does not include ETH from consensus rewards sitting in this strategy or ETH from MEV rewards in the FeeAccumulator. These rewards are harvested and sent to the Dripper so will eventually be sent to the Vault as WETH.\"},\"claimGovernance()\":{\"notice\":\"Claim Governance of the contract to a new account (`newGovernor`). Can only be called by the new Governor.\"},\"collectRewardTokens()\":{\"notice\":\"Collect accumulated reward token and send to Vault.\"},\"consensusRewards()\":{\"notice\":\"Keeps track of the total consensus rewards swept from the beacon chain\"},\"deposit(address,uint256)\":{\"notice\":\"Unlike other strategies, this does not deposit assets into the underlying platform. It just checks the asset is WETH and emits the Deposit event. To deposit WETH into validators `registerSsvValidator` and `stakeEth` must be used. Will NOT revert if the strategy is paused from an accounting failure.\"},\"depositAll()\":{\"notice\":\"Unlike other strategies, this does not deposit assets into the underlying platform. It just emits the Deposit event. To deposit WETH into validators `registerSsvValidator` and `stakeEth` must be used. Will NOT revert if the strategy is paused from an accounting failure.\"},\"depositSSV(uint64[],uint256,(uint32,uint64,uint64,bool,uint256))\":{\"notice\":\"Deposits more SSV Tokens to the SSV Network contract which is used to pay the SSV Operators.\"},\"doAccounting()\":{\"notice\":\"This notion page offers a good explanation of how the accounting functions https://www.notion.so/originprotocol/Limited-simplified-native-staking-accounting-67a217c8420d40678eb943b9da0ee77d In short, after dividing by 32, if the ETH remaining on the contract falls between 0 and fuseIntervalStart, the accounting function will treat that ETH as Beacon chain consensus rewards. On the contrary, if after dividing by 32, the ETH remaining on the contract falls between fuseIntervalEnd and 32, the accounting function will treat that as a validator slashing.Perform the accounting attributing beacon chain ETH to either full or partial withdrawals. Returns true when accounting is valid and fuse isn't \\\"blown\\\". Returns false when fuse is blown.\"},\"exitSsvValidator(bytes,uint64[])\":{\"notice\":\"Exit a validator from the Beacon chain. The staked ETH will eventually swept to this native staking strategy. Only the registrator can call this function.\"},\"fuseIntervalEnd()\":{\"notice\":\"end of fuse interval\"},\"fuseIntervalStart()\":{\"notice\":\"start of fuse interval\"},\"getRewardTokenAddresses()\":{\"notice\":\"Get the reward token addresses.\"},\"governor()\":{\"notice\":\"Returns the address of the current Governor.\"},\"harvesterAddress()\":{\"notice\":\"Address of the Harvester contract allowed to collect reward tokens\"},\"initialize(address[],address[],address[])\":{\"notice\":\"initialize function, to set up initial internal state\"},\"isGovernor()\":{\"notice\":\"Returns true if the caller is the current Governor.\"},\"lastFixAccountingBlockNumber()\":{\"notice\":\"last block number manuallyFixAccounting has been called\"},\"manuallyFixAccounting(int256,int256,uint256)\":{\"notice\":\"Allow the Strategist to fix the accounting of this strategy and unpause.\"},\"platformAddress()\":{\"notice\":\"Address of the underlying platform\"},\"registerSsvValidator(bytes,uint64[],bytes,uint256,(uint32,uint64,uint64,bool,uint256))\":{\"notice\":\"Registers a new validator in the SSV Cluster. Only the registrator can call this function.\"},\"removePToken(uint256)\":{\"notice\":\"Remove a supported asset by passing its index. This method can only be called by the system Governor\"},\"removeSsvValidator(bytes,uint64[],(uint32,uint64,uint64,bool,uint256))\":{\"notice\":\"Remove a validator from the SSV Cluster. Make sure `exitSsvValidator` is called before and the validate has exited the Beacon chain. If removed before the validator has exited the beacon chain will result in the validator being slashed. Only the registrator can call this function.\"},\"rewardTokenAddresses(uint256)\":{\"notice\":\"Address of the reward tokens. eg CRV, BAL, CVX, AURA\"},\"safeApproveAllTokens()\":{\"notice\":\"Approves the SSV Network contract to transfer SSV tokens for deposits\"},\"setFuseInterval(uint256,uint256)\":{\"notice\":\"set fuse interval values\"},\"setHarvesterAddress(address)\":{\"notice\":\"Set the Harvester contract that can collect rewards.\"},\"setPTokenAddress(address,address)\":{\"notice\":\"Provide support for asset by passing its pToken address. This method can only be called by the system Governor\"},\"setRegistrator(address)\":{\"notice\":\"Set the address of the registrator which can register, exit and remove validators\"},\"setRewardTokenAddresses(address[])\":{\"notice\":\"Set the reward token addresses. Any old addresses will be overwritten.\"},\"stakeEth((bytes,bytes,bytes32)[])\":{\"notice\":\"Stakes WETH to the node validators\"},\"supportsAsset(address)\":{\"notice\":\"Returns bool indicating whether asset is supported by strategy.\"},\"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\"},\"transferToken(address,uint256)\":{\"notice\":\"Transfer token to governor. Intended for recovering tokens stuck in strategy contracts, i.e. mistaken sends.\"},\"validatorRegistrator()\":{\"notice\":\"Address of the registrator - allowed to register, exit and remove validators\"},\"validatorsStates(bytes32)\":{\"notice\":\"State of the validators keccak256(pubKey) => state\"},\"vaultAddress()\":{\"notice\":\"Address of the OToken vault\"},\"withdraw(address,address,uint256)\":{\"notice\":\"Withdraw WETH from this contract. Used only if some WETH for is lingering on the contract. That can happen when: - the deposit was not a multiple of 32 WETH - someone sent WETH directly to this contract Will NOT revert if the strategy is paused from an accounting failure.\"},\"withdrawAll()\":{\"notice\":\"transfer all WETH deposits back to the vault. This does not withdraw from the validators. That has to be done separately with the `exitSsvValidator` and `removeSsvValidator` operations. This does not withdraw any execution rewards from the FeeAccumulator or consensus rewards in this strategy. Any ETH in this strategy that was swept from a full validator withdrawal will not be withdrawn. ETH from full validator withdrawals is sent to the Vault using `doAccounting`. Will NOT revert if the strategy is paused from an accounting failure.\"}},\"notice\":\"Strategy to deploy funds into DVT validators powered by the SSV Network\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol\":\"NativeStakingSSVStrategy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/security/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract Pausable is Context {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n require(!paused(), \\\"Pausable: paused\\\");\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n require(paused(), \\\"Pausable: not paused\\\");\\n _;\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0xe68ed7fb8766ed1e888291f881e36b616037f852b37d96877045319ad298ba87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x61437cb513a887a1bbad006e7b1c8b414478427d33de47c5600af3c748f108da\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc3d946432c0ddbb1f846a0d3985be71299df331b91d06732152117f62f0be2b5\",\"license\":\"MIT\"},\"@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\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a / b + (a % b == 0 ? 0 : 1);\\n }\\n}\\n\",\"keccak256\":\"0xfaad496c1c944b6259b7dc70b4865eb1775d6402bc0c81b38a0b24d9f525ae37\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// CAUTION\\n// This version of SafeMath should only be used with Solidity 0.8 or later,\\n// because it relies on the compiler's built in overflow checks.\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations.\\n *\\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\\n * now has built in overflow checking.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a + b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a * b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator.\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(\\n uint256 a,\\n uint256 b,\\n string memory errorMessage\\n ) internal pure returns (uint256) {\\n unchecked {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(\\n uint256 a,\\n uint256 b,\\n string memory errorMessage\\n ) internal pure returns (uint256) {\\n unchecked {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(\\n uint256 a,\\n uint256 b,\\n string memory errorMessage\\n ) internal pure returns (uint256) {\\n unchecked {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa2f576be637946f767aa56601c26d717f48a0aff44f82e46f13807eea1009a21\",\"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/interfaces/IBasicToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBasicToken {\\n function symbol() external view returns (string memory);\\n\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0xa562062698aa12572123b36dfd2072f1a39e44fed2031cc19c2c9fd522f96ec2\",\"license\":\"MIT\"},\"contracts/interfaces/IDepositContract.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IDepositContract {\\n /// @notice A processed deposit event.\\n event DepositEvent(\\n bytes pubkey,\\n bytes withdrawal_credentials,\\n bytes amount,\\n bytes signature,\\n bytes index\\n );\\n\\n /// @notice Submit a Phase 0 DepositData object.\\n /// @param pubkey A BLS12-381 public key.\\n /// @param withdrawal_credentials Commitment to a public key for withdrawals.\\n /// @param signature A BLS12-381 signature.\\n /// @param deposit_data_root The SHA-256 hash of the SSZ-encoded DepositData object.\\n /// Used as a protection against malformed input.\\n function deposit(\\n bytes calldata pubkey,\\n bytes calldata withdrawal_credentials,\\n bytes calldata signature,\\n bytes32 deposit_data_root\\n ) external payable;\\n\\n /// @notice Query the current deposit root hash.\\n /// @return The deposit root hash.\\n function get_deposit_root() external view returns (bytes32);\\n\\n /// @notice Query the current deposit count.\\n /// @return The deposit count encoded as a little endian 64-bit number.\\n function get_deposit_count() external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x598f90bdbc854250bbd5991426bfb43367207e64e33109c41aa8b54323fd8d8e\",\"license\":\"MIT\"},\"contracts/interfaces/ISSVNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nstruct Cluster {\\n uint32 validatorCount;\\n uint64 networkFeeIndex;\\n uint64 index;\\n bool active;\\n uint256 balance;\\n}\\n\\ninterface ISSVNetwork {\\n /**********/\\n /* Errors */\\n /**********/\\n\\n error CallerNotOwner(); // 0x5cd83192\\n error CallerNotWhitelisted(); // 0x8c6e5d71\\n error FeeTooLow(); // 0x732f9413\\n error FeeExceedsIncreaseLimit(); // 0x958065d9\\n error NoFeeDeclared(); // 0x1d226c30\\n error ApprovalNotWithinTimeframe(); // 0x97e4b518\\n error OperatorDoesNotExist(); // 0x961e3e8c\\n error InsufficientBalance(); // 0xf4d678b8\\n error ValidatorDoesNotExist(); // 0xe51315d2\\n error ClusterNotLiquidatable(); // 0x60300a8d\\n error InvalidPublicKeyLength(); // 0x637297a4\\n error InvalidOperatorIdsLength(); // 0x38186224\\n error ClusterAlreadyEnabled(); // 0x3babafd2\\n error ClusterIsLiquidated(); // 0x95a0cf33\\n error ClusterDoesNotExists(); // 0x185e2b16\\n error IncorrectClusterState(); // 0x12e04c87\\n error UnsortedOperatorsList(); // 0xdd020e25\\n error NewBlockPeriodIsBelowMinimum(); // 0x6e6c9cac\\n error ExceedValidatorLimit(); // 0x6df5ab76\\n error TokenTransferFailed(); // 0x045c4b02\\n error SameFeeChangeNotAllowed(); // 0xc81272f8\\n error FeeIncreaseNotAllowed(); // 0x410a2b6c\\n error NotAuthorized(); // 0xea8e4eb5\\n error OperatorsListNotUnique(); // 0xa5a1ff5d\\n error OperatorAlreadyExists(); // 0x289c9494\\n error TargetModuleDoesNotExist(); // 0x8f9195fb\\n error MaxValueExceeded(); // 0x91aa3017\\n error FeeTooHigh(); // 0xcd4e6167\\n error PublicKeysSharesLengthMismatch(); // 0x9ad467b8\\n error IncorrectValidatorStateWithData(bytes publicKey); // 0x89307938\\n error ValidatorAlreadyExistsWithData(bytes publicKey); // 0x388e7999\\n error EmptyPublicKeysList(); // df83e679\\n\\n // legacy errors\\n error ValidatorAlreadyExists(); // 0x8d09a73e\\n error IncorrectValidatorState(); // 0x2feda3c1\\n\\n event AdminChanged(address previousAdmin, address newAdmin);\\n event BeaconUpgraded(address indexed beacon);\\n event ClusterDeposited(\\n address indexed owner,\\n uint64[] operatorIds,\\n uint256 value,\\n Cluster cluster\\n );\\n event ClusterLiquidated(\\n address indexed owner,\\n uint64[] operatorIds,\\n Cluster cluster\\n );\\n event ClusterReactivated(\\n address indexed owner,\\n uint64[] operatorIds,\\n Cluster cluster\\n );\\n event ClusterWithdrawn(\\n address indexed owner,\\n uint64[] operatorIds,\\n uint256 value,\\n Cluster cluster\\n );\\n event DeclareOperatorFeePeriodUpdated(uint64 value);\\n event ExecuteOperatorFeePeriodUpdated(uint64 value);\\n event FeeRecipientAddressUpdated(\\n address indexed owner,\\n address recipientAddress\\n );\\n event Initialized(uint8 version);\\n event LiquidationThresholdPeriodUpdated(uint64 value);\\n event MinimumLiquidationCollateralUpdated(uint256 value);\\n event NetworkEarningsWithdrawn(uint256 value, address recipient);\\n event NetworkFeeUpdated(uint256 oldFee, uint256 newFee);\\n event OperatorAdded(\\n uint64 indexed operatorId,\\n address indexed owner,\\n bytes publicKey,\\n uint256 fee\\n );\\n event OperatorFeeDeclarationCancelled(\\n address indexed owner,\\n uint64 indexed operatorId\\n );\\n event OperatorFeeDeclared(\\n address indexed owner,\\n uint64 indexed operatorId,\\n uint256 blockNumber,\\n uint256 fee\\n );\\n event OperatorFeeExecuted(\\n address indexed owner,\\n uint64 indexed operatorId,\\n uint256 blockNumber,\\n uint256 fee\\n );\\n event OperatorFeeIncreaseLimitUpdated(uint64 value);\\n event OperatorMaximumFeeUpdated(uint64 maxFee);\\n event OperatorRemoved(uint64 indexed operatorId);\\n event OperatorWhitelistUpdated(\\n uint64 indexed operatorId,\\n address whitelisted\\n );\\n event OperatorWithdrawn(\\n address indexed owner,\\n uint64 indexed operatorId,\\n uint256 value\\n );\\n event OwnershipTransferStarted(\\n address indexed previousOwner,\\n address indexed newOwner\\n );\\n event OwnershipTransferred(\\n address indexed previousOwner,\\n address indexed newOwner\\n );\\n event Upgraded(address indexed implementation);\\n event ValidatorAdded(\\n address indexed owner,\\n uint64[] operatorIds,\\n bytes publicKey,\\n bytes shares,\\n Cluster cluster\\n );\\n event ValidatorExited(\\n address indexed owner,\\n uint64[] operatorIds,\\n bytes publicKey\\n );\\n event ValidatorRemoved(\\n address indexed owner,\\n uint64[] operatorIds,\\n bytes publicKey,\\n Cluster cluster\\n );\\n\\n fallback() external;\\n\\n function acceptOwnership() external;\\n\\n function cancelDeclaredOperatorFee(uint64 operatorId) external;\\n\\n function declareOperatorFee(uint64 operatorId, uint256 fee) external;\\n\\n function deposit(\\n address clusterOwner,\\n uint64[] memory operatorIds,\\n uint256 amount,\\n Cluster memory cluster\\n ) external;\\n\\n function executeOperatorFee(uint64 operatorId) external;\\n\\n function exitValidator(bytes memory publicKey, uint64[] memory operatorIds)\\n external;\\n\\n function getVersion() external pure returns (string memory version);\\n\\n function initialize(\\n address token_,\\n address ssvOperators_,\\n address ssvClusters_,\\n address ssvDAO_,\\n address ssvViews_,\\n uint64 minimumBlocksBeforeLiquidation_,\\n uint256 minimumLiquidationCollateral_,\\n uint32 validatorsPerOperatorLimit_,\\n uint64 declareOperatorFeePeriod_,\\n uint64 executeOperatorFeePeriod_,\\n uint64 operatorMaxFeeIncrease_\\n ) external;\\n\\n function liquidate(\\n address clusterOwner,\\n uint64[] memory operatorIds,\\n Cluster memory cluster\\n ) external;\\n\\n function owner() external view returns (address);\\n\\n function pendingOwner() external view returns (address);\\n\\n function proxiableUUID() external view returns (bytes32);\\n\\n function reactivate(\\n uint64[] memory operatorIds,\\n uint256 amount,\\n Cluster memory cluster\\n ) external;\\n\\n function reduceOperatorFee(uint64 operatorId, uint256 fee) external;\\n\\n function registerOperator(bytes memory publicKey, uint256 fee)\\n external\\n returns (uint64 id);\\n\\n function registerValidator(\\n bytes memory publicKey,\\n uint64[] memory operatorIds,\\n bytes memory sharesData,\\n uint256 amount,\\n Cluster memory cluster\\n ) external;\\n\\n function removeOperator(uint64 operatorId) external;\\n\\n function removeValidator(\\n bytes memory publicKey,\\n uint64[] memory operatorIds,\\n Cluster memory cluster\\n ) external;\\n\\n function renounceOwnership() external;\\n\\n function setFeeRecipientAddress(address recipientAddress) external;\\n\\n function setOperatorWhitelist(uint64 operatorId, address whitelisted)\\n external;\\n\\n function transferOwnership(address newOwner) external;\\n\\n function updateDeclareOperatorFeePeriod(uint64 timeInSeconds) external;\\n\\n function updateExecuteOperatorFeePeriod(uint64 timeInSeconds) external;\\n\\n function updateLiquidationThresholdPeriod(uint64 blocks) external;\\n\\n function updateMaximumOperatorFee(uint64 maxFee) external;\\n\\n function updateMinimumLiquidationCollateral(uint256 amount) external;\\n\\n function updateModule(uint8 moduleId, address moduleAddress) external;\\n\\n function updateNetworkFee(uint256 fee) external;\\n\\n function updateOperatorFeeIncreaseLimit(uint64 percentage) external;\\n\\n function upgradeTo(address newImplementation) external;\\n\\n function upgradeToAndCall(address newImplementation, bytes memory data)\\n external\\n payable;\\n\\n function withdraw(\\n uint64[] memory operatorIds,\\n uint256 amount,\\n Cluster memory cluster\\n ) external;\\n\\n function withdrawAllOperatorEarnings(uint64 operatorId) external;\\n\\n function withdrawNetworkEarnings(uint256 amount) external;\\n\\n function withdrawOperatorEarnings(uint64 operatorId, uint256 amount)\\n external;\\n}\\n\",\"keccak256\":\"0xbef02bd5257e61dec0a6be4b1531064a7fdfeb4043885443a1902fb5d1b23e1b\",\"license\":\"MIT\"},\"contracts/interfaces/IStrategy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Platform interface to integrate with lending platform like Compound, AAVE etc.\\n */\\ninterface IStrategy {\\n /**\\n * @dev Deposit the given asset to platform\\n * @param _asset asset address\\n * @param _amount Amount to deposit\\n */\\n function deposit(address _asset, uint256 _amount) external;\\n\\n /**\\n * @dev Deposit the entire balance of all supported assets in the Strategy\\n * to the platform\\n */\\n function depositAll() external;\\n\\n /**\\n * @dev Withdraw given asset from Lending platform\\n */\\n function withdraw(\\n address _recipient,\\n address _asset,\\n uint256 _amount\\n ) external;\\n\\n /**\\n * @dev Liquidate all assets in strategy and return them to Vault.\\n */\\n function withdrawAll() external;\\n\\n /**\\n * @dev Returns the current balance of the given asset.\\n */\\n function checkBalance(address _asset)\\n external\\n view\\n returns (uint256 balance);\\n\\n /**\\n * @dev Returns bool indicating whether strategy supports asset.\\n */\\n function supportsAsset(address _asset) external view returns (bool);\\n\\n /**\\n * @dev Collect reward tokens from the Strategy.\\n */\\n function collectRewardTokens() external;\\n\\n /**\\n * @dev The address array of the reward tokens for the Strategy.\\n */\\n function getRewardTokenAddresses() external view returns (address[] memory);\\n}\\n\",\"keccak256\":\"0xb291e409a9b95527f9ed19cd6bff8eeb9921a21c1f5194a48c0bb9ce6613959a\",\"license\":\"MIT\"},\"contracts/interfaces/IVault.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { VaultStorage } from \\\"../vault/VaultStorage.sol\\\";\\n\\ninterface IVault {\\n event AssetSupported(address _asset);\\n event AssetDefaultStrategyUpdated(address _asset, address _strategy);\\n event AssetAllocated(address _asset, address _strategy, uint256 _amount);\\n event StrategyApproved(address _addr);\\n event StrategyRemoved(address _addr);\\n event Mint(address _addr, uint256 _value);\\n event Redeem(address _addr, uint256 _value);\\n event CapitalPaused();\\n event CapitalUnpaused();\\n event RebasePaused();\\n event RebaseUnpaused();\\n event VaultBufferUpdated(uint256 _vaultBuffer);\\n event RedeemFeeUpdated(uint256 _redeemFeeBps);\\n event PriceProviderUpdated(address _priceProvider);\\n event AllocateThresholdUpdated(uint256 _threshold);\\n event RebaseThresholdUpdated(uint256 _threshold);\\n event StrategistUpdated(address _address);\\n event MaxSupplyDiffChanged(uint256 maxSupplyDiff);\\n event YieldDistribution(address _to, uint256 _yield, uint256 _fee);\\n event TrusteeFeeBpsChanged(uint256 _basis);\\n event TrusteeAddressChanged(address _address);\\n event SwapperChanged(address _address);\\n event SwapAllowedUndervalueChanged(uint256 _basis);\\n event SwapSlippageChanged(address _asset, uint256 _basis);\\n event Swapped(\\n address indexed _fromAsset,\\n address indexed _toAsset,\\n uint256 _fromAssetAmount,\\n uint256 _toAssetAmount\\n );\\n\\n // Governable.sol\\n function transferGovernance(address _newGovernor) external;\\n\\n function claimGovernance() external;\\n\\n function governor() external view returns (address);\\n\\n // VaultAdmin.sol\\n function setPriceProvider(address _priceProvider) external;\\n\\n function priceProvider() external view returns (address);\\n\\n function setRedeemFeeBps(uint256 _redeemFeeBps) external;\\n\\n function redeemFeeBps() external view returns (uint256);\\n\\n function setVaultBuffer(uint256 _vaultBuffer) external;\\n\\n function vaultBuffer() external view returns (uint256);\\n\\n function setAutoAllocateThreshold(uint256 _threshold) external;\\n\\n function autoAllocateThreshold() external view returns (uint256);\\n\\n function setRebaseThreshold(uint256 _threshold) external;\\n\\n function rebaseThreshold() external view returns (uint256);\\n\\n function setStrategistAddr(address _address) external;\\n\\n function strategistAddr() external view returns (address);\\n\\n function setMaxSupplyDiff(uint256 _maxSupplyDiff) external;\\n\\n function maxSupplyDiff() external view returns (uint256);\\n\\n function setTrusteeAddress(address _address) external;\\n\\n function trusteeAddress() external view returns (address);\\n\\n function setTrusteeFeeBps(uint256 _basis) external;\\n\\n function trusteeFeeBps() external view returns (uint256);\\n\\n function ousdMetaStrategy() external view returns (address);\\n\\n function setSwapper(address _swapperAddr) external;\\n\\n function setSwapAllowedUndervalue(uint16 _percentageBps) external;\\n\\n function setOracleSlippage(address _asset, uint16 _allowedOracleSlippageBps)\\n external;\\n\\n function supportAsset(address _asset, uint8 _supportsAsset) external;\\n\\n function approveStrategy(address _addr) external;\\n\\n function removeStrategy(address _addr) external;\\n\\n function setAssetDefaultStrategy(address _asset, address _strategy)\\n external;\\n\\n function assetDefaultStrategies(address _asset)\\n external\\n view\\n returns (address);\\n\\n function pauseRebase() external;\\n\\n function unpauseRebase() external;\\n\\n function rebasePaused() external view returns (bool);\\n\\n function pauseCapital() external;\\n\\n function unpauseCapital() external;\\n\\n function capitalPaused() external view returns (bool);\\n\\n function transferToken(address _asset, uint256 _amount) external;\\n\\n function priceUnitMint(address asset) external view returns (uint256);\\n\\n function priceUnitRedeem(address asset) external view returns (uint256);\\n\\n function withdrawAllFromStrategy(address _strategyAddr) external;\\n\\n function withdrawAllFromStrategies() external;\\n\\n function withdrawFromStrategy(\\n address _strategyFromAddress,\\n address[] calldata _assets,\\n uint256[] calldata _amounts\\n ) external;\\n\\n function depositToStrategy(\\n address _strategyToAddress,\\n address[] calldata _assets,\\n uint256[] calldata _amounts\\n ) external;\\n\\n // VaultCore.sol\\n function mint(\\n address _asset,\\n uint256 _amount,\\n uint256 _minimumOusdAmount\\n ) external;\\n\\n function mintForStrategy(uint256 _amount) external;\\n\\n function redeem(uint256 _amount, uint256 _minimumUnitAmount) external;\\n\\n function burnForStrategy(uint256 _amount) external;\\n\\n function redeemAll(uint256 _minimumUnitAmount) external;\\n\\n function allocate() external;\\n\\n function rebase() external;\\n\\n function swapCollateral(\\n address fromAsset,\\n address toAsset,\\n uint256 fromAssetAmount,\\n uint256 minToAssetAmount,\\n bytes calldata data\\n ) external returns (uint256 toAssetAmount);\\n\\n function totalValue() external view returns (uint256 value);\\n\\n function checkBalance(address _asset) external view returns (uint256);\\n\\n function calculateRedeemOutputs(uint256 _amount)\\n external\\n view\\n returns (uint256[] memory);\\n\\n function getAssetCount() external view returns (uint256);\\n\\n function getAssetConfig(address _asset)\\n external\\n view\\n returns (VaultStorage.Asset memory config);\\n\\n function getAllAssets() external view returns (address[] memory);\\n\\n function getStrategyCount() external view returns (uint256);\\n\\n function swapper() external view returns (address);\\n\\n function allowedSwapUndervalue() external view returns (uint256);\\n\\n function getAllStrategies() external view returns (address[] memory);\\n\\n function isSupportedAsset(address _asset) external view returns (bool);\\n\\n function netOusdMintForStrategyThreshold() external view returns (uint256);\\n\\n function setOusdMetaStrategy(address _ousdMetaStrategy) external;\\n\\n function setNetOusdMintForStrategyThreshold(uint256 _threshold) external;\\n\\n function netOusdMintedForStrategy() external view returns (int256);\\n\\n function weth() external view returns (address);\\n\\n function cacheWETHAssetIndex() external;\\n\\n function wethAssetIndex() external view returns (uint256);\\n\\n function initialize(address, address) external;\\n\\n function setAdminImpl(address) external;\\n\\n function removeAsset(address _asset) external;\\n}\\n\",\"keccak256\":\"0xa03ba17b6224bec26290794760fc807e017260406037b4f812970701888e72c8\",\"license\":\"MIT\"},\"contracts/interfaces/IWETH9.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IWETH9 {\\n event Approval(address indexed src, address indexed guy, uint256 wad);\\n event Deposit(address indexed dst, uint256 wad);\\n event Transfer(address indexed src, address indexed dst, uint256 wad);\\n event Withdrawal(address indexed src, uint256 wad);\\n\\n function allowance(address, address) external view returns (uint256);\\n\\n function approve(address guy, uint256 wad) external returns (bool);\\n\\n function balanceOf(address) external view returns (uint256);\\n\\n function decimals() external view returns (uint8);\\n\\n function deposit() external payable;\\n\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function transfer(address dst, uint256 wad) external returns (bool);\\n\\n function transferFrom(\\n address src,\\n address dst,\\n uint256 wad\\n ) external returns (bool);\\n\\n function withdraw(uint256 wad) external;\\n}\\n\",\"keccak256\":\"0x05b7dce6c24d3cd4e48b5c6346d86e5e40ecc3291bcdf3f3ef091c98fc826519\",\"license\":\"MIT\"},\"contracts/strategies/NativeStaking/FeeAccumulator.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 Fee Accumulator for Native Staking SSV Strategy\\n * @notice Receives execution rewards which includes tx fees and\\n * MEV rewards like tx priority and tx ordering.\\n * It does NOT include swept ETH from beacon chain consensus rewards or full validator withdrawals.\\n * @author Origin Protocol Inc\\n */\\ncontract FeeAccumulator is Governable {\\n /// @notice The address of the Native Staking Strategy\\n address public immutable STRATEGY;\\n\\n /**\\n * @param _strategy Address of the Native Staking Strategy\\n */\\n constructor(address _strategy) {\\n STRATEGY = _strategy;\\n }\\n\\n /**\\n * @notice sends all ETH in this FeeAccumulator contract to the Native Staking Strategy.\\n * @return eth The amount of execution rewards that were sent to the Native Staking Strategy\\n */\\n function collect() external returns (uint256 eth) {\\n require(msg.sender == STRATEGY, \\\"Caller is not the Strategy\\\");\\n\\n eth = address(this).balance;\\n if (eth > 0) {\\n // Send the ETH to the Native Staking Strategy\\n Address.sendValue(payable(STRATEGY), eth);\\n }\\n }\\n\\n /**\\n * @dev Accept ETH\\n */\\n receive() external payable {}\\n}\\n\",\"keccak256\":\"0xb8fda3b87dc5d6f8aee4bf1d015a585211e5b5a319dfa4b0f4770e3f5a2d5939\",\"license\":\"MIT\"},\"contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\n\\nimport { InitializableAbstractStrategy } from \\\"../../utils/InitializableAbstractStrategy.sol\\\";\\nimport { IWETH9 } from \\\"../../interfaces/IWETH9.sol\\\";\\nimport { FeeAccumulator } from \\\"./FeeAccumulator.sol\\\";\\nimport { ValidatorAccountant } from \\\"./ValidatorAccountant.sol\\\";\\n\\nstruct ValidatorStakeData {\\n bytes pubkey;\\n bytes signature;\\n bytes32 depositDataRoot;\\n}\\n\\n/// @title Native Staking SSV Strategy\\n/// @notice Strategy to deploy funds into DVT validators powered by the SSV Network\\n/// @author Origin Protocol Inc\\n/// @dev This contract handles WETH and ETH and in some operations interchanges between the two. Any WETH that\\n/// is on the contract across multiple blocks (and not just transitory within a transaction) is considered an\\n/// asset. Meaning deposits increase the balance of the asset and withdrawal decrease it. As opposed to all\\n/// our other strategies the WETH doesn't immediately get deposited into an underlying strategy and can be present\\n/// across multiple blocks waiting to be unwrapped to ETH and staked to validators. This separation of WETH and ETH is\\n/// required since the rewards (reward token) is also in ETH.\\n///\\n/// To simplify the accounting of WETH there is another difference in behavior compared to the other strategies.\\n/// To withdraw WETH asset - exit message is posted to validators and the ETH hits this contract with multiple days\\n/// delay. In order to simplify the WETH accounting upon detection of such an event the ValidatorAccountant\\n/// immediately wraps ETH to WETH and sends it to the Vault.\\n///\\n/// On the other hand any ETH on the contract (across multiple blocks) is there either:\\n/// - as a result of already accounted for consensus rewards\\n/// - as a result of not yet accounted for consensus rewards\\n/// - as a results of not yet accounted for full validator withdrawals (or validator slashes)\\n///\\n/// Even though the strategy assets and rewards are a very similar asset the consensus layer rewards and the\\n/// execution layer rewards are considered rewards and those are dripped to the Vault over a configurable time\\n/// interval and not immediately.\\ncontract NativeStakingSSVStrategy is\\n ValidatorAccountant,\\n InitializableAbstractStrategy\\n{\\n using SafeERC20 for IERC20;\\n\\n /// @notice SSV ERC20 token that serves as a payment for operating SSV validators\\n address public immutable SSV_TOKEN_ADDRESS;\\n /// @notice Fee collector address\\n /// @dev this address will receive Execution layer rewards - These are rewards earned for\\n /// executing transactions on the Ethereum network as part of block proposals. They include\\n /// priority fees (fees paid by users for their transactions to be included) and MEV rewards\\n /// (rewards for arranging transactions in a way that benefits the validator).\\n address payable public immutable FEE_ACCUMULATOR_ADDRESS;\\n\\n /// @dev This contract receives WETH as the deposit asset, but unlike other strategies doesn't immediately\\n /// deposit it to an underlying platform. Rather a special privilege account stakes it to the validators.\\n /// For that reason calling WETH.balanceOf(this) in a deposit function can contain WETH that has just been\\n /// deposited and also WETH that has previously been deposited. To keep a correct count we need to keep track\\n /// of WETH that has already been accounted for.\\n /// This value represents the amount of WETH balance of this contract that has already been accounted for by the\\n /// deposit events.\\n /// It is important to note that this variable is not concerned with WETH that is a result of full/partial\\n /// withdrawal of the validators. It is strictly concerned with WETH that has been deposited and is waiting to\\n /// be staked.\\n uint256 public depositedWethAccountedFor;\\n\\n // For future use\\n uint256[49] private __gap;\\n\\n /// @param _baseConfig Base strategy config with platformAddress (ERC-4626 Vault contract), eg sfrxETH or sDAI,\\n /// and vaultAddress (OToken Vault contract), eg VaultProxy or OETHVaultProxy\\n /// @param _wethAddress Address of the Erc20 WETH Token contract\\n /// @param _ssvToken Address of the Erc20 SSV Token contract\\n /// @param _ssvNetwork Address of the SSV Network contract\\n /// @param _feeAccumulator Address of the fee accumulator receiving execution layer validator rewards\\n /// @param _beaconChainDepositContract Address of the beacon chain deposit contract\\n constructor(\\n BaseStrategyConfig memory _baseConfig,\\n address _wethAddress,\\n address _ssvToken,\\n address _ssvNetwork,\\n address _feeAccumulator,\\n address _beaconChainDepositContract\\n )\\n InitializableAbstractStrategy(_baseConfig)\\n ValidatorAccountant(\\n _wethAddress,\\n _baseConfig.vaultAddress,\\n _beaconChainDepositContract,\\n _ssvNetwork\\n )\\n {\\n SSV_TOKEN_ADDRESS = _ssvToken;\\n FEE_ACCUMULATOR_ADDRESS = payable(_feeAccumulator);\\n }\\n\\n /// @notice initialize function, to set up initial internal state\\n /// @param _rewardTokenAddresses Address of reward token for platform\\n /// @param _assets Addresses of initial supported assets\\n /// @param _pTokens Platform Token corresponding addresses\\n function initialize(\\n address[] memory _rewardTokenAddresses,\\n address[] memory _assets,\\n address[] memory _pTokens\\n ) external onlyGovernor initializer {\\n InitializableAbstractStrategy._initialize(\\n _rewardTokenAddresses,\\n _assets,\\n _pTokens\\n );\\n }\\n\\n /// @dev Convert accumulated ETH to WETH and send to the Harvester.\\n /// Will revert if the strategy is paused for accounting.\\n function _collectRewardTokens() internal override whenNotPaused {\\n // collect ETH from execution rewards from the fee accumulator\\n uint256 executionRewards = FeeAccumulator(FEE_ACCUMULATOR_ADDRESS)\\n .collect();\\n\\n // total ETH rewards to be harvested = execution rewards + consensus rewards\\n uint256 ethRewards = executionRewards + consensusRewards;\\n\\n require(\\n address(this).balance >= ethRewards,\\n \\\"insufficient eth balance\\\"\\n );\\n\\n if (ethRewards > 0) {\\n // reset the counter keeping track of beacon chain consensus rewards\\n consensusRewards = 0;\\n\\n // Convert ETH rewards to WETH\\n IWETH9(WETH_TOKEN_ADDRESS).deposit{ value: ethRewards }();\\n\\n emit RewardTokenCollected(\\n harvesterAddress,\\n WETH_TOKEN_ADDRESS,\\n ethRewards\\n );\\n IERC20(WETH_TOKEN_ADDRESS).safeTransfer(\\n harvesterAddress,\\n ethRewards\\n );\\n }\\n }\\n\\n /// @notice Unlike other strategies, this does not deposit assets into the underlying platform.\\n /// It just checks the asset is WETH and emits the Deposit event.\\n /// To deposit WETH into validators `registerSsvValidator` and `stakeEth` must be used.\\n /// Will NOT revert if the strategy is paused from an accounting failure.\\n /// @param _asset Address of asset to deposit. Has to be WETH.\\n /// @param _amount Amount of assets that were transferred to the strategy by the vault.\\n function deposit(address _asset, uint256 _amount)\\n external\\n override\\n onlyVault\\n nonReentrant\\n {\\n require(_asset == WETH_TOKEN_ADDRESS, \\\"Unsupported asset\\\");\\n depositedWethAccountedFor += _amount;\\n _deposit(_asset, _amount);\\n }\\n\\n /// @dev Deposit WETH to this strategy so it can later be staked into a validator.\\n /// @param _asset Address of WETH\\n /// @param _amount Amount of WETH to deposit\\n function _deposit(address _asset, uint256 _amount) internal {\\n require(_amount > 0, \\\"Must deposit something\\\");\\n /*\\n * We could do a check here that would revert when \\\"_amount % 32 ether != 0\\\". With the idea of\\n * not allowing deposits that will result in WETH sitting on the strategy after all the possible batches\\n * of 32ETH have been staked.\\n * But someone could mess with our strategy by sending some WETH to it. And we might want to deposit just\\n * enough WETH to add it up to 32 so it can be staked. For that reason the check is left out.\\n *\\n * WETH sitting on the strategy won't interfere with the accounting since accounting only operates on ETH.\\n */\\n emit Deposit(_asset, address(0), _amount);\\n }\\n\\n /// @notice Unlike other strategies, this does not deposit assets into the underlying platform.\\n /// It just emits the Deposit event.\\n /// To deposit WETH into validators `registerSsvValidator` and `stakeEth` must be used.\\n /// Will NOT revert if the strategy is paused from an accounting failure.\\n function depositAll() external override onlyVault nonReentrant {\\n uint256 wethBalance = IERC20(WETH_TOKEN_ADDRESS).balanceOf(\\n address(this)\\n );\\n uint256 newWeth = wethBalance - depositedWethAccountedFor;\\n\\n if (newWeth > 0) {\\n depositedWethAccountedFor = wethBalance;\\n\\n _deposit(WETH_TOKEN_ADDRESS, newWeth);\\n }\\n }\\n\\n /// @notice Withdraw WETH from this contract. Used only if some WETH for is lingering on the contract. That\\n /// can happen when:\\n /// - the deposit was not a multiple of 32 WETH\\n /// - someone sent WETH directly to this contract\\n /// Will NOT revert if the strategy is paused from an accounting failure.\\n /// @param _recipient Address to receive withdrawn assets\\n /// @param _asset WETH to withdraw\\n /// @param _amount Amount of WETH to withdraw\\n function withdraw(\\n address _recipient,\\n address _asset,\\n uint256 _amount\\n ) external override onlyVault nonReentrant {\\n _withdraw(_recipient, _asset, _amount);\\n }\\n\\n function _withdraw(\\n address _recipient,\\n address _asset,\\n uint256 _amount\\n ) internal {\\n require(_amount > 0, \\\"Must withdraw something\\\");\\n require(_recipient != address(0), \\\"Must specify recipient\\\");\\n\\n emit Withdrawal(_asset, address(0), _amount);\\n IERC20(_asset).safeTransfer(_recipient, _amount);\\n }\\n\\n /// @notice transfer all WETH deposits back to the vault.\\n /// This does not withdraw from the validators. That has to be done separately with the\\n /// `exitSsvValidator` and `removeSsvValidator` operations.\\n /// This does not withdraw any execution rewards from the FeeAccumulator or\\n /// consensus rewards in this strategy.\\n /// Any ETH in this strategy that was swept from a full validator withdrawal will not be withdrawn.\\n /// ETH from full validator withdrawals is sent to the Vault using `doAccounting`.\\n /// Will NOT revert if the strategy is paused from an accounting failure.\\n function withdrawAll() external override onlyVaultOrGovernor nonReentrant {\\n uint256 wethBalance = IERC20(WETH_TOKEN_ADDRESS).balanceOf(\\n address(this)\\n );\\n if (wethBalance > 0) {\\n _withdraw(vaultAddress, WETH_TOKEN_ADDRESS, wethBalance);\\n }\\n }\\n\\n function _abstractSetPToken(address _asset, address) internal override {}\\n\\n /// @notice Returns the total value of (W)ETH that is staked to the validators\\n /// and WETH deposits that are still to be staked.\\n /// This does not include ETH from consensus rewards sitting in this strategy\\n /// or ETH from MEV rewards in the FeeAccumulator. These rewards are harvested\\n /// and sent to the Dripper so will eventually be sent to the Vault as WETH.\\n /// @param _asset Address of weth asset\\n /// @return balance Total value of (W)ETH\\n function checkBalance(address _asset)\\n external\\n view\\n override\\n returns (uint256 balance)\\n {\\n require(_asset == WETH_TOKEN_ADDRESS, \\\"Unsupported asset\\\");\\n\\n balance =\\n // add the ETH that has been staked in validators\\n activeDepositedValidators *\\n 32 ether +\\n // add the WETH in the strategy from deposits that are still to be staked\\n IERC20(WETH_TOKEN_ADDRESS).balanceOf(address(this));\\n }\\n\\n function pause() external onlyStrategist {\\n _pause();\\n }\\n\\n /// @notice Returns bool indicating whether asset is supported by strategy.\\n /// @param _asset The address of the asset token.\\n function supportsAsset(address _asset) public view override returns (bool) {\\n return _asset == WETH_TOKEN_ADDRESS;\\n }\\n\\n /// @notice Approves the SSV Network contract to transfer SSV tokens for deposits\\n function safeApproveAllTokens() external override {\\n /// @dev Approves the SSV Network contract to transfer SSV tokens for deposits\\n IERC20(SSV_TOKEN_ADDRESS).approve(\\n SSV_NETWORK_ADDRESS,\\n type(uint256).max\\n );\\n }\\n\\n /**\\n * @notice Only accept ETH from the FeeAccumulator and the WETH contract - required when\\n * unwrapping WETH just before staking it to the validator\\n * @dev don't want to receive donations from anyone else as this will\\n * mess with the accounting of the consensus rewards and validator full withdrawals\\n */\\n receive() external payable {\\n require(\\n msg.sender == FEE_ACCUMULATOR_ADDRESS ||\\n msg.sender == WETH_TOKEN_ADDRESS,\\n \\\"eth not from allowed contracts\\\"\\n );\\n }\\n\\n function _wethWithdrawnToVault(uint256 _amount) internal override {\\n emit Withdrawal(WETH_TOKEN_ADDRESS, address(0), _amount);\\n }\\n\\n function _wethWithdrawnAndStaked(uint256 _amount) internal override {\\n /* In an ideal world we wouldn't need to reduce the deduction amount when the\\n * depositedWethAccountedFor is smaller than the _amount.\\n *\\n * The reason this is required is that a malicious actor could sent WETH direclty\\n * to this contract and that would circumvent the increase of depositedWethAccountedFor\\n * property. When the ETH would be staked the depositedWethAccountedFor amount could\\n * be deducted so much that it would be negative.\\n */\\n uint256 deductAmount = Math.min(_amount, depositedWethAccountedFor);\\n depositedWethAccountedFor -= deductAmount;\\n }\\n}\\n\",\"keccak256\":\"0x937ce31cd4b90ad532fdde874dc02eaf0a29a800c2c2292d2d6cb71afa75f32d\",\"license\":\"MIT\"},\"contracts/strategies/NativeStaking/ValidatorAccountant.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ValidatorRegistrator } from \\\"./ValidatorRegistrator.sol\\\";\\nimport { IWETH9 } from \\\"../../interfaces/IWETH9.sol\\\";\\n\\n/// @title Validator Accountant\\n/// @notice Attributes the ETH swept from beacon chain validators to this strategy contract\\n/// as either full or partial withdrawals. Partial withdrawals being consensus rewards.\\n/// Full withdrawals are from exited validators.\\n/// @author Origin Protocol Inc\\nabstract contract ValidatorAccountant is ValidatorRegistrator {\\n /// @notice The minimum amount of blocks that need to pass between two calls to manuallyFixAccounting\\n uint256 public constant MIN_FIX_ACCOUNTING_CADENCE = 7200; // 1 day\\n /// @notice The maximum amount of ETH that can be staked by a validator\\n /// @dev this can change in the future with EIP-7251, Increase the MAX_EFFECTIVE_BALANCE\\n uint256 public constant MAX_STAKE = 32 ether;\\n\\n /// @notice Keeps track of the total consensus rewards swept from the beacon chain\\n uint256 public consensusRewards;\\n\\n /// @notice start of fuse interval\\n uint256 public fuseIntervalStart;\\n /// @notice end of fuse interval\\n uint256 public fuseIntervalEnd;\\n /// @notice last block number manuallyFixAccounting has been called\\n uint256 public lastFixAccountingBlockNumber;\\n\\n uint256[49] private __gap;\\n\\n event FuseIntervalUpdated(uint256 start, uint256 end);\\n event AccountingFullyWithdrawnValidator(\\n uint256 noOfValidators,\\n uint256 remainingValidators,\\n uint256 wethSentToVault\\n );\\n event AccountingValidatorSlashed(\\n uint256 remainingValidators,\\n uint256 wethSentToVault\\n );\\n event AccountingConsensusRewards(uint256 amount);\\n\\n event AccountingManuallyFixed(\\n int256 validatorsDelta,\\n int256 consensusRewardsDelta,\\n uint256 wethToVault\\n );\\n\\n /// @param _wethAddress Address of the Erc20 WETH Token contract\\n /// @param _vaultAddress Address of the Vault\\n /// @param _beaconChainDepositContract Address of the beacon chain deposit contract\\n /// @param _ssvNetwork Address of the SSV Network contract\\n constructor(\\n address _wethAddress,\\n address _vaultAddress,\\n address _beaconChainDepositContract,\\n address _ssvNetwork\\n )\\n ValidatorRegistrator(\\n _wethAddress,\\n _vaultAddress,\\n _beaconChainDepositContract,\\n _ssvNetwork\\n )\\n {}\\n\\n /// @notice set fuse interval values\\n function setFuseInterval(\\n uint256 _fuseIntervalStart,\\n uint256 _fuseIntervalEnd\\n ) external onlyGovernor {\\n require(\\n _fuseIntervalStart < _fuseIntervalEnd &&\\n _fuseIntervalStart < 32 ether &&\\n _fuseIntervalEnd < 32 ether &&\\n _fuseIntervalEnd - _fuseIntervalStart >= 4 ether,\\n \\\"incorrect fuse interval\\\"\\n );\\n\\n emit FuseIntervalUpdated(_fuseIntervalStart, _fuseIntervalEnd);\\n\\n fuseIntervalStart = _fuseIntervalStart;\\n fuseIntervalEnd = _fuseIntervalEnd;\\n }\\n\\n /* solhint-disable max-line-length */\\n /// This notion page offers a good explanation of how the accounting functions\\n /// https://www.notion.so/originprotocol/Limited-simplified-native-staking-accounting-67a217c8420d40678eb943b9da0ee77d\\n /// In short, after dividing by 32, if the ETH remaining on the contract falls between 0 and fuseIntervalStart,\\n /// the accounting function will treat that ETH as Beacon chain consensus rewards.\\n /// On the contrary, if after dividing by 32, the ETH remaining on the contract falls between fuseIntervalEnd and 32,\\n /// the accounting function will treat that as a validator slashing.\\n /// @notice Perform the accounting attributing beacon chain ETH to either full or partial withdrawals. Returns true when\\n /// accounting is valid and fuse isn't \\\"blown\\\". Returns false when fuse is blown.\\n /// @dev This function could in theory be permission-less but lets allow only the Registrator (Defender Action) to call it\\n /// for now.\\n /// @return accountingValid true if accounting was successful, false if fuse is blown\\n /* solhint-enable max-line-length */\\n function doAccounting()\\n external\\n onlyRegistrator\\n whenNotPaused\\n returns (bool accountingValid)\\n {\\n // pause the accounting on failure\\n accountingValid = _doAccounting(true);\\n }\\n\\n // slither-disable-start reentrancy-eth\\n function _doAccounting(bool pauseOnFail)\\n internal\\n returns (bool accountingValid)\\n {\\n if (address(this).balance < consensusRewards) {\\n return _failAccounting(pauseOnFail);\\n }\\n\\n // Calculate all the new ETH that has been swept to the contract since the last accounting\\n uint256 newSweptETH = address(this).balance - consensusRewards;\\n accountingValid = true;\\n\\n // send the ETH that is from fully withdrawn validators to the Vault\\n if (newSweptETH >= MAX_STAKE) {\\n uint256 fullyWithdrawnValidators;\\n // safe since MAX_STAKE is hardcoded to 32ETH\\n unchecked {\\n // explicitly cast to uint256 as we want to round to a whole number of validators\\n fullyWithdrawnValidators = uint256(newSweptETH / MAX_STAKE);\\n }\\n activeDepositedValidators -= fullyWithdrawnValidators;\\n\\n uint256 wethToVault = MAX_STAKE * fullyWithdrawnValidators;\\n IWETH9(WETH_TOKEN_ADDRESS).deposit{ value: wethToVault }();\\n // slither-disable-next-line unchecked-transfer\\n IWETH9(WETH_TOKEN_ADDRESS).transfer(VAULT_ADDRESS, wethToVault);\\n _wethWithdrawnToVault(wethToVault);\\n\\n emit AccountingFullyWithdrawnValidator(\\n fullyWithdrawnValidators,\\n activeDepositedValidators,\\n wethToVault\\n );\\n }\\n\\n uint256 ethRemaining = address(this).balance - consensusRewards;\\n // should be less than a whole validator stake\\n require(ethRemaining < 32 ether, \\\"unexpected accounting\\\");\\n\\n // If no Beacon chain consensus rewards swept\\n if (ethRemaining == 0) {\\n // do nothing\\n return accountingValid;\\n }\\n // Beacon chain consensus rewards swept (partial validator withdrawals)\\n else if (ethRemaining < fuseIntervalStart) {\\n // solhint-disable-next-line reentrancy\\n consensusRewards += ethRemaining;\\n emit AccountingConsensusRewards(ethRemaining);\\n }\\n // Beacon chain consensus rewards swept but also a slashed validator fully exited\\n else if (ethRemaining > fuseIntervalEnd) {\\n IWETH9(WETH_TOKEN_ADDRESS).deposit{ value: ethRemaining }();\\n // slither-disable-next-line unchecked-transfer\\n IWETH9(WETH_TOKEN_ADDRESS).transfer(VAULT_ADDRESS, ethRemaining);\\n activeDepositedValidators -= 1;\\n\\n _wethWithdrawnToVault(ethRemaining);\\n\\n emit AccountingValidatorSlashed(\\n activeDepositedValidators,\\n ethRemaining\\n );\\n }\\n // Oh no... Fuse is blown. The Strategist needs to adjust the accounting values.\\n else {\\n return _failAccounting(pauseOnFail);\\n }\\n }\\n\\n // slither-disable-end reentrancy-eth\\n\\n /// @dev pause any further accounting if required and return false\\n function _failAccounting(bool pauseOnFail)\\n internal\\n returns (bool accountingValid)\\n {\\n // pause if not already\\n if (pauseOnFail) {\\n _pause();\\n }\\n // fail the accounting\\n accountingValid = false;\\n }\\n\\n /// @notice Allow the Strategist to fix the accounting of this strategy and unpause.\\n /// @param _validatorsDelta adjust the active validators by up to plus three or minus three\\n /// @param _consensusRewardsDelta adjust the accounted for consensus rewards up or down\\n /// @param _ethToVaultAmount the amount of ETH that gets wrapped into WETH and sent to the Vault\\n /// @dev There is a case when a validator(s) gets slashed so much that the eth swept from\\n /// the beacon chain enters the fuse area and there are no consensus rewards on the contract\\n /// to \\\"dip into\\\"/use. To increase the amount of unaccounted ETH over the fuse end interval\\n /// we need to reduce the amount of active deposited validators and immediately send WETH\\n /// to the vault, so it doesn't interfere with further accounting.\\n function manuallyFixAccounting(\\n int256 _validatorsDelta,\\n int256 _consensusRewardsDelta,\\n uint256 _ethToVaultAmount\\n ) external onlyStrategist whenPaused {\\n require(\\n lastFixAccountingBlockNumber + MIN_FIX_ACCOUNTING_CADENCE <\\n block.number,\\n \\\"manuallyFixAccounting called too soon\\\"\\n );\\n require(\\n _validatorsDelta >= -3 &&\\n _validatorsDelta <= 3 &&\\n // new value must be positive\\n int256(activeDepositedValidators) + _validatorsDelta >= 0,\\n \\\"invalid validatorsDelta\\\"\\n );\\n require(\\n _consensusRewardsDelta >= -332 ether &&\\n _consensusRewardsDelta <= 332 ether &&\\n // new value must be positive\\n int256(consensusRewards) + _consensusRewardsDelta >= 0,\\n \\\"invalid consensusRewardsDelta\\\"\\n );\\n require(_ethToVaultAmount <= 32 ether * 3, \\\"invalid wethToVaultAmount\\\");\\n\\n emit AccountingManuallyFixed(\\n _validatorsDelta,\\n _consensusRewardsDelta,\\n _ethToVaultAmount\\n );\\n\\n activeDepositedValidators = uint256(\\n int256(activeDepositedValidators) + _validatorsDelta\\n );\\n consensusRewards = uint256(\\n int256(consensusRewards) + _consensusRewardsDelta\\n );\\n lastFixAccountingBlockNumber = block.number;\\n if (_ethToVaultAmount > 0) {\\n IWETH9(WETH_TOKEN_ADDRESS).deposit{ value: _ethToVaultAmount }();\\n // slither-disable-next-line unchecked-transfer\\n IWETH9(WETH_TOKEN_ADDRESS).transfer(\\n VAULT_ADDRESS,\\n _ethToVaultAmount\\n );\\n _wethWithdrawnToVault(_ethToVaultAmount);\\n }\\n\\n // rerun the accounting to see if it has now been fixed.\\n // Do not pause the accounting on failure as it is already paused\\n require(_doAccounting(false), \\\"fuse still blown\\\");\\n\\n // unpause since doAccounting was successful\\n _unpause();\\n }\\n\\n /***************************************\\n Abstract\\n ****************************************/\\n\\n /// @dev allows for NativeStakingSSVStrategy contract to emit Withdrawal event\\n function _wethWithdrawnToVault(uint256 _amount) internal virtual;\\n}\\n\",\"keccak256\":\"0x0adba45b3fa66233c9e9bc0575ca388ebcd027cba2546278c5887065b95da708\",\"license\":\"MIT\"},\"contracts/strategies/NativeStaking/ValidatorRegistrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { Pausable } from \\\"@openzeppelin/contracts/security/Pausable.sol\\\";\\nimport { Governable } from \\\"../../governance/Governable.sol\\\";\\nimport { IDepositContract } from \\\"../../interfaces/IDepositContract.sol\\\";\\nimport { IVault } from \\\"../../interfaces/IVault.sol\\\";\\nimport { IWETH9 } from \\\"../../interfaces/IWETH9.sol\\\";\\nimport { ISSVNetwork, Cluster } from \\\"../../interfaces/ISSVNetwork.sol\\\";\\n\\nstruct ValidatorStakeData {\\n bytes pubkey;\\n bytes signature;\\n bytes32 depositDataRoot;\\n}\\n\\n/**\\n * @title Registrator of the validators\\n * @notice This contract implements all the required functionality to register, exit and remove validators.\\n * @author Origin Protocol Inc\\n */\\nabstract contract ValidatorRegistrator is Governable, Pausable {\\n /// @notice The address of the Wrapped ETH (WETH) token contract\\n address public immutable WETH_TOKEN_ADDRESS;\\n /// @notice The address of the beacon chain deposit contract\\n address public immutable BEACON_CHAIN_DEPOSIT_CONTRACT;\\n /// @notice The address of the SSV Network contract used to interface with\\n address public immutable SSV_NETWORK_ADDRESS;\\n /// @notice Address of the OETH Vault proxy contract\\n address public immutable VAULT_ADDRESS;\\n\\n /// @notice Address of the registrator - allowed to register, exit and remove validators\\n address public validatorRegistrator;\\n /// @notice The number of validators that have 32 (!) ETH actively deposited. When a new deposit\\n /// to a validator happens this number increases, when a validator exit is detected this number\\n /// decreases.\\n uint256 public activeDepositedValidators;\\n /// @notice State of the validators keccak256(pubKey) => state\\n mapping(bytes32 => VALIDATOR_STATE) public validatorsStates;\\n\\n // For future use\\n uint256[50] private __gap;\\n\\n enum VALIDATOR_STATE {\\n REGISTERED, // validator is registered on the SSV network\\n STAKED, // validator has funds staked\\n EXITING, // exit message has been posted and validator is in the process of exiting\\n EXIT_COMPLETE // validator has funds withdrawn to the EigenPod and is removed from the SSV\\n }\\n\\n event RegistratorChanged(address newAddress);\\n event ETHStaked(bytes pubkey, uint256 amount, bytes withdrawal_credentials);\\n event SSVValidatorRegistered(bytes pubkey, uint64[] operatorIds);\\n event SSVValidatorExitInitiated(bytes pubkey, uint64[] operatorIds);\\n event SSVValidatorExitCompleted(bytes pubkey, uint64[] operatorIds);\\n\\n /// @dev Throws if called by any account other than the Registrator\\n modifier onlyRegistrator() {\\n require(\\n msg.sender == validatorRegistrator,\\n \\\"Caller is not the Registrator\\\"\\n );\\n _;\\n }\\n\\n /// @dev Throws if called by any account other than the Strategist\\n modifier onlyStrategist() {\\n require(\\n msg.sender == IVault(VAULT_ADDRESS).strategistAddr(),\\n \\\"Caller is not the Strategist\\\"\\n );\\n _;\\n }\\n\\n /// @param _wethAddress Address of the Erc20 WETH Token contract\\n /// @param _vaultAddress Address of the Vault\\n /// @param _beaconChainDepositContract Address of the beacon chain deposit contract\\n /// @param _ssvNetwork Address of the SSV Network contract\\n constructor(\\n address _wethAddress,\\n address _vaultAddress,\\n address _beaconChainDepositContract,\\n address _ssvNetwork\\n ) {\\n WETH_TOKEN_ADDRESS = _wethAddress;\\n BEACON_CHAIN_DEPOSIT_CONTRACT = _beaconChainDepositContract;\\n SSV_NETWORK_ADDRESS = _ssvNetwork;\\n VAULT_ADDRESS = _vaultAddress;\\n }\\n\\n /// @notice Set the address of the registrator which can register, exit and remove validators\\n function setRegistrator(address _address) external onlyGovernor {\\n emit RegistratorChanged(_address);\\n validatorRegistrator = _address;\\n }\\n\\n /// @notice Stakes WETH to the node validators\\n /// @param validators A list of validator data needed to stake.\\n /// The `ValidatorStakeData` struct contains the pubkey, signature and depositDataRoot.\\n /// Only the registrator can call this function.\\n // slither-disable-start reentrancy-eth\\n function stakeEth(ValidatorStakeData[] calldata validators)\\n external\\n onlyRegistrator\\n whenNotPaused\\n {\\n uint256 requiredETH = validators.length * 32 ether;\\n\\n // Check there is enough WETH from the deposits sitting in this strategy contract\\n require(\\n requiredETH <= IWETH9(WETH_TOKEN_ADDRESS).balanceOf(address(this)),\\n \\\"insufficient WETH\\\"\\n );\\n\\n // Convert required ETH from WETH\\n IWETH9(WETH_TOKEN_ADDRESS).withdraw(requiredETH);\\n _wethWithdrawnAndStaked(requiredETH);\\n\\n uint256 validatorsLength = validators.length;\\n // For each validator\\n for (uint256 i = 0; i < validatorsLength; ) {\\n bytes32 pubkeyHash = keccak256(validators[i].pubkey);\\n VALIDATOR_STATE currentState = validatorsStates[pubkeyHash];\\n\\n require(\\n currentState == VALIDATOR_STATE.REGISTERED,\\n \\\"Validator not registered\\\"\\n );\\n\\n /* 0x01 to indicate that withdrawal credentials will contain an EOA address that the sweeping function\\n * can sweep funds to.\\n * bytes11(0) to fill up the required zeros\\n * remaining bytes20 are for the address\\n */\\n bytes memory withdrawal_credentials = abi.encodePacked(\\n bytes1(0x01),\\n bytes11(0),\\n address(this)\\n );\\n IDepositContract(BEACON_CHAIN_DEPOSIT_CONTRACT).deposit{\\n value: 32 ether\\n }(\\n validators[i].pubkey,\\n withdrawal_credentials,\\n validators[i].signature,\\n validators[i].depositDataRoot\\n );\\n\\n emit ETHStaked(\\n validators[i].pubkey,\\n 32 ether,\\n withdrawal_credentials\\n );\\n\\n validatorsStates[pubkeyHash] = VALIDATOR_STATE.STAKED;\\n\\n unchecked {\\n ++i;\\n }\\n }\\n // save gas by changing this storage variable only once rather each time in the loop.\\n activeDepositedValidators += validatorsLength;\\n }\\n\\n // slither-disable-end reentrancy-eth\\n\\n /// @notice Registers a new validator in the SSV Cluster.\\n /// Only the registrator can call this function.\\n function registerSsvValidator(\\n bytes calldata publicKey,\\n uint64[] calldata operatorIds,\\n bytes calldata sharesData,\\n uint256 amount,\\n Cluster calldata cluster\\n ) external onlyRegistrator whenNotPaused {\\n ISSVNetwork(SSV_NETWORK_ADDRESS).registerValidator(\\n publicKey,\\n operatorIds,\\n sharesData,\\n amount,\\n cluster\\n );\\n validatorsStates[keccak256(publicKey)] = VALIDATOR_STATE.REGISTERED;\\n emit SSVValidatorRegistered(publicKey, operatorIds);\\n }\\n\\n /// @notice Exit a validator from the Beacon chain.\\n /// The staked ETH will eventually swept to this native staking strategy.\\n /// Only the registrator can call this function.\\n // slither-disable-start reentrancy-no-eth\\n function exitSsvValidator(\\n bytes calldata publicKey,\\n uint64[] calldata operatorIds\\n ) external onlyRegistrator whenNotPaused {\\n VALIDATOR_STATE currentState = validatorsStates[keccak256(publicKey)];\\n require(currentState == VALIDATOR_STATE.STAKED, \\\"Validator not staked\\\");\\n\\n ISSVNetwork(SSV_NETWORK_ADDRESS).exitValidator(publicKey, operatorIds);\\n emit SSVValidatorExitInitiated(publicKey, operatorIds);\\n\\n validatorsStates[keccak256(publicKey)] = VALIDATOR_STATE.EXITING;\\n }\\n\\n // slither-disable-end reentrancy-no-eth\\n\\n /// @notice Remove a validator from the SSV Cluster.\\n /// Make sure `exitSsvValidator` is called before and the validate has exited the Beacon chain.\\n /// If removed before the validator has exited the beacon chain will result in the validator being slashed.\\n /// Only the registrator can call this function.\\n // slither-disable-start reentrancy-no-eth\\n function removeSsvValidator(\\n bytes calldata publicKey,\\n uint64[] calldata operatorIds,\\n Cluster calldata cluster\\n ) external onlyRegistrator whenNotPaused {\\n VALIDATOR_STATE currentState = validatorsStates[keccak256(publicKey)];\\n require(\\n currentState == VALIDATOR_STATE.EXITING,\\n \\\"Validator not exiting\\\"\\n );\\n\\n ISSVNetwork(SSV_NETWORK_ADDRESS).removeValidator(\\n publicKey,\\n operatorIds,\\n cluster\\n );\\n emit SSVValidatorExitCompleted(publicKey, operatorIds);\\n\\n validatorsStates[keccak256(publicKey)] = VALIDATOR_STATE.EXIT_COMPLETE;\\n }\\n\\n // slither-disable-end reentrancy-no-eth\\n\\n /// @notice Deposits more SSV Tokens to the SSV Network contract which is used to pay the SSV Operators.\\n /// @dev A SSV cluster is defined by the SSVOwnerAddress and the set of operatorIds.\\n /// uses \\\"onlyStrategist\\\" modifier so continuous front-running can't DOS our maintenance service\\n /// that tries to top up SSV tokens.\\n /// @param cluster The SSV cluster details that must be derived from emitted events from the SSVNetwork contract.\\n function depositSSV(\\n uint64[] memory operatorIds,\\n uint256 amount,\\n Cluster memory cluster\\n ) external onlyStrategist {\\n ISSVNetwork(SSV_NETWORK_ADDRESS).deposit(\\n address(this),\\n operatorIds,\\n amount,\\n cluster\\n );\\n }\\n\\n /***************************************\\n Abstract\\n ****************************************/\\n\\n /// @dev allows for NativeStakingSSVStrategy contract know how much WETH had been staked\\n function _wethWithdrawnAndStaked(uint256 _amount) internal virtual;\\n}\\n\",\"keccak256\":\"0xb9a6e9b02ff8437f5389df287438f14cfea6dc27739942f278ef224d579474fb\",\"license\":\"MIT\"},\"contracts/token/OUSD.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title OUSD Token Contract\\n * @dev ERC20 compatible contract for OUSD\\n * @dev Implements an elastic supply\\n * @author Origin Protocol Inc\\n */\\nimport { SafeMath } from \\\"@openzeppelin/contracts/utils/math/SafeMath.sol\\\";\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\n\\nimport { Initializable } from \\\"../utils/Initializable.sol\\\";\\nimport { InitializableERC20Detailed } from \\\"../utils/InitializableERC20Detailed.sol\\\";\\nimport { StableMath } from \\\"../utils/StableMath.sol\\\";\\nimport { Governable } from \\\"../governance/Governable.sol\\\";\\n\\n/**\\n * NOTE that this is an ERC20 token but the invariant that the sum of\\n * balanceOf(x) for all x is not >= totalSupply(). This is a consequence of the\\n * rebasing design. Any integrations with OUSD should be aware.\\n */\\n\\ncontract OUSD is Initializable, InitializableERC20Detailed, Governable {\\n using SafeMath for uint256;\\n using StableMath for uint256;\\n\\n event TotalSupplyUpdatedHighres(\\n uint256 totalSupply,\\n uint256 rebasingCredits,\\n uint256 rebasingCreditsPerToken\\n );\\n event AccountRebasingEnabled(address account);\\n event AccountRebasingDisabled(address account);\\n\\n enum RebaseOptions {\\n NotSet,\\n OptOut,\\n OptIn\\n }\\n\\n uint256 private constant MAX_SUPPLY = ~uint128(0); // (2^128) - 1\\n uint256 public _totalSupply;\\n mapping(address => mapping(address => uint256)) private _allowances;\\n address public vaultAddress = address(0);\\n mapping(address => uint256) private _creditBalances;\\n uint256 private _rebasingCredits;\\n uint256 private _rebasingCreditsPerToken;\\n // Frozen address/credits are non rebasing (value is held in contracts which\\n // do not receive yield unless they explicitly opt in)\\n uint256 public nonRebasingSupply;\\n mapping(address => uint256) public nonRebasingCreditsPerToken;\\n mapping(address => RebaseOptions) public rebaseState;\\n mapping(address => uint256) public isUpgraded;\\n\\n uint256 private constant RESOLUTION_INCREASE = 1e9;\\n\\n function initialize(\\n string calldata _nameArg,\\n string calldata _symbolArg,\\n address _vaultAddress,\\n uint256 _initialCreditsPerToken\\n ) external onlyGovernor initializer {\\n InitializableERC20Detailed._initialize(_nameArg, _symbolArg, 18);\\n _rebasingCreditsPerToken = _initialCreditsPerToken;\\n vaultAddress = _vaultAddress;\\n }\\n\\n /**\\n * @dev Verifies that the caller is the Vault contract\\n */\\n modifier onlyVault() {\\n require(vaultAddress == msg.sender, \\\"Caller is not the Vault\\\");\\n _;\\n }\\n\\n /**\\n * @return The total supply of OUSD.\\n */\\n function totalSupply() public view override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @return Low resolution rebasingCreditsPerToken\\n */\\n function rebasingCreditsPerToken() public view returns (uint256) {\\n return _rebasingCreditsPerToken / RESOLUTION_INCREASE;\\n }\\n\\n /**\\n * @return Low resolution total number of rebasing credits\\n */\\n function rebasingCredits() public view returns (uint256) {\\n return _rebasingCredits / RESOLUTION_INCREASE;\\n }\\n\\n /**\\n * @return High resolution rebasingCreditsPerToken\\n */\\n function rebasingCreditsPerTokenHighres() public view returns (uint256) {\\n return _rebasingCreditsPerToken;\\n }\\n\\n /**\\n * @return High resolution total number of rebasing credits\\n */\\n function rebasingCreditsHighres() public view returns (uint256) {\\n return _rebasingCredits;\\n }\\n\\n /**\\n * @dev Gets the balance of the specified address.\\n * @param _account Address to query the balance of.\\n * @return A uint256 representing the amount of base units owned by the\\n * specified address.\\n */\\n function balanceOf(address _account)\\n public\\n view\\n override\\n returns (uint256)\\n {\\n if (_creditBalances[_account] == 0) return 0;\\n return\\n _creditBalances[_account].divPrecisely(_creditsPerToken(_account));\\n }\\n\\n /**\\n * @dev Gets the credits balance of the specified address.\\n * @dev Backwards compatible with old low res credits per token.\\n * @param _account The address to query the balance of.\\n * @return (uint256, uint256) Credit balance and credits per token of the\\n * address\\n */\\n function creditsBalanceOf(address _account)\\n public\\n view\\n returns (uint256, uint256)\\n {\\n uint256 cpt = _creditsPerToken(_account);\\n if (cpt == 1e27) {\\n // For a period before the resolution upgrade, we created all new\\n // contract accounts at high resolution. Since they are not changing\\n // as a result of this upgrade, we will return their true values\\n return (_creditBalances[_account], cpt);\\n } else {\\n return (\\n _creditBalances[_account] / RESOLUTION_INCREASE,\\n cpt / RESOLUTION_INCREASE\\n );\\n }\\n }\\n\\n /**\\n * @dev Gets the credits balance of the specified address.\\n * @param _account The address to query the balance of.\\n * @return (uint256, uint256, bool) Credit balance, credits per token of the\\n * address, and isUpgraded\\n */\\n function creditsBalanceOfHighres(address _account)\\n public\\n view\\n returns (\\n uint256,\\n uint256,\\n bool\\n )\\n {\\n return (\\n _creditBalances[_account],\\n _creditsPerToken(_account),\\n isUpgraded[_account] == 1\\n );\\n }\\n\\n /**\\n * @dev Transfer tokens to a specified address.\\n * @param _to the address to transfer to.\\n * @param _value the amount to be transferred.\\n * @return true on success.\\n */\\n function transfer(address _to, uint256 _value)\\n public\\n override\\n returns (bool)\\n {\\n require(_to != address(0), \\\"Transfer to zero address\\\");\\n require(\\n _value <= balanceOf(msg.sender),\\n \\\"Transfer greater than balance\\\"\\n );\\n\\n _executeTransfer(msg.sender, _to, _value);\\n\\n emit Transfer(msg.sender, _to, _value);\\n\\n return true;\\n }\\n\\n /**\\n * @dev Transfer tokens from one address to another.\\n * @param _from The address you want to send tokens from.\\n * @param _to The address you want to transfer to.\\n * @param _value The amount of tokens to be transferred.\\n */\\n function transferFrom(\\n address _from,\\n address _to,\\n uint256 _value\\n ) public override returns (bool) {\\n require(_to != address(0), \\\"Transfer to zero address\\\");\\n require(_value <= balanceOf(_from), \\\"Transfer greater than balance\\\");\\n\\n _allowances[_from][msg.sender] = _allowances[_from][msg.sender].sub(\\n _value\\n );\\n\\n _executeTransfer(_from, _to, _value);\\n\\n emit Transfer(_from, _to, _value);\\n\\n return true;\\n }\\n\\n /**\\n * @dev Update the count of non rebasing credits in response to a transfer\\n * @param _from The address you want to send tokens from.\\n * @param _to The address you want to transfer to.\\n * @param _value Amount of OUSD to transfer\\n */\\n function _executeTransfer(\\n address _from,\\n address _to,\\n uint256 _value\\n ) internal {\\n bool isNonRebasingTo = _isNonRebasingAccount(_to);\\n bool isNonRebasingFrom = _isNonRebasingAccount(_from);\\n\\n // Credits deducted and credited might be different due to the\\n // differing creditsPerToken used by each account\\n uint256 creditsCredited = _value.mulTruncate(_creditsPerToken(_to));\\n uint256 creditsDeducted = _value.mulTruncate(_creditsPerToken(_from));\\n\\n _creditBalances[_from] = _creditBalances[_from].sub(\\n creditsDeducted,\\n \\\"Transfer amount exceeds balance\\\"\\n );\\n _creditBalances[_to] = _creditBalances[_to].add(creditsCredited);\\n\\n if (isNonRebasingTo && !isNonRebasingFrom) {\\n // Transfer to non-rebasing account from rebasing account, credits\\n // are removed from the non rebasing tally\\n nonRebasingSupply = nonRebasingSupply.add(_value);\\n // Update rebasingCredits by subtracting the deducted amount\\n _rebasingCredits = _rebasingCredits.sub(creditsDeducted);\\n } else if (!isNonRebasingTo && isNonRebasingFrom) {\\n // Transfer to rebasing account from non-rebasing account\\n // Decreasing non-rebasing credits by the amount that was sent\\n nonRebasingSupply = nonRebasingSupply.sub(_value);\\n // Update rebasingCredits by adding the credited amount\\n _rebasingCredits = _rebasingCredits.add(creditsCredited);\\n }\\n }\\n\\n /**\\n * @dev Function to check the amount of tokens that _owner has allowed to\\n * `_spender`.\\n * @param _owner The address which owns the funds.\\n * @param _spender The address which will spend the funds.\\n * @return The number of tokens still available for the _spender.\\n */\\n function allowance(address _owner, address _spender)\\n public\\n view\\n override\\n returns (uint256)\\n {\\n return _allowances[_owner][_spender];\\n }\\n\\n /**\\n * @dev Approve the passed address to spend the specified amount of tokens\\n * on behalf of msg.sender. This method is included for ERC20\\n * compatibility. `increaseAllowance` and `decreaseAllowance` should be\\n * used instead.\\n *\\n * Changing an allowance with this method brings the risk that someone\\n * may transfer both the old and the new allowance - if they are both\\n * greater than zero - if a transfer transaction is mined before the\\n * later approve() call is mined.\\n * @param _spender The address which will spend the funds.\\n * @param _value The amount of tokens to be spent.\\n */\\n function approve(address _spender, uint256 _value)\\n public\\n override\\n returns (bool)\\n {\\n _allowances[msg.sender][_spender] = _value;\\n emit Approval(msg.sender, _spender, _value);\\n return true;\\n }\\n\\n /**\\n * @dev Increase the amount of tokens that an owner has allowed to\\n * `_spender`.\\n * This method should be used instead of approve() to avoid the double\\n * approval vulnerability described above.\\n * @param _spender The address which will spend the funds.\\n * @param _addedValue The amount of tokens to increase the allowance by.\\n */\\n function increaseAllowance(address _spender, uint256 _addedValue)\\n public\\n returns (bool)\\n {\\n _allowances[msg.sender][_spender] = _allowances[msg.sender][_spender]\\n .add(_addedValue);\\n emit Approval(msg.sender, _spender, _allowances[msg.sender][_spender]);\\n return true;\\n }\\n\\n /**\\n * @dev Decrease the amount of tokens that an owner has allowed to\\n `_spender`.\\n * @param _spender The address which will spend the funds.\\n * @param _subtractedValue The amount of tokens to decrease the allowance\\n * by.\\n */\\n function decreaseAllowance(address _spender, uint256 _subtractedValue)\\n public\\n returns (bool)\\n {\\n uint256 oldValue = _allowances[msg.sender][_spender];\\n if (_subtractedValue >= oldValue) {\\n _allowances[msg.sender][_spender] = 0;\\n } else {\\n _allowances[msg.sender][_spender] = oldValue.sub(_subtractedValue);\\n }\\n emit Approval(msg.sender, _spender, _allowances[msg.sender][_spender]);\\n return true;\\n }\\n\\n /**\\n * @dev Mints new tokens, increasing totalSupply.\\n */\\n function mint(address _account, uint256 _amount) external onlyVault {\\n _mint(_account, _amount);\\n }\\n\\n /**\\n * @dev Creates `_amount` tokens and assigns them to `_account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements\\n *\\n * - `to` cannot be the zero address.\\n */\\n function _mint(address _account, uint256 _amount) internal nonReentrant {\\n require(_account != address(0), \\\"Mint to the zero address\\\");\\n\\n bool isNonRebasingAccount = _isNonRebasingAccount(_account);\\n\\n uint256 creditAmount = _amount.mulTruncate(_creditsPerToken(_account));\\n _creditBalances[_account] = _creditBalances[_account].add(creditAmount);\\n\\n // If the account is non rebasing and doesn't have a set creditsPerToken\\n // then set it i.e. this is a mint from a fresh contract\\n if (isNonRebasingAccount) {\\n nonRebasingSupply = nonRebasingSupply.add(_amount);\\n } else {\\n _rebasingCredits = _rebasingCredits.add(creditAmount);\\n }\\n\\n _totalSupply = _totalSupply.add(_amount);\\n\\n require(_totalSupply < MAX_SUPPLY, \\\"Max supply\\\");\\n\\n emit Transfer(address(0), _account, _amount);\\n }\\n\\n /**\\n * @dev Burns tokens, decreasing totalSupply.\\n */\\n function burn(address account, uint256 amount) external onlyVault {\\n _burn(account, amount);\\n }\\n\\n /**\\n * @dev Destroys `_amount` tokens from `_account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements\\n *\\n * - `_account` cannot be the zero address.\\n * - `_account` must have at least `_amount` tokens.\\n */\\n function _burn(address _account, uint256 _amount) internal nonReentrant {\\n require(_account != address(0), \\\"Burn from the zero address\\\");\\n if (_amount == 0) {\\n return;\\n }\\n\\n bool isNonRebasingAccount = _isNonRebasingAccount(_account);\\n uint256 creditAmount = _amount.mulTruncate(_creditsPerToken(_account));\\n uint256 currentCredits = _creditBalances[_account];\\n\\n // Remove the credits, burning rounding errors\\n if (\\n currentCredits == creditAmount || currentCredits - 1 == creditAmount\\n ) {\\n // Handle dust from rounding\\n _creditBalances[_account] = 0;\\n } else if (currentCredits > creditAmount) {\\n _creditBalances[_account] = _creditBalances[_account].sub(\\n creditAmount\\n );\\n } else {\\n revert(\\\"Remove exceeds balance\\\");\\n }\\n\\n // Remove from the credit tallies and non-rebasing supply\\n if (isNonRebasingAccount) {\\n nonRebasingSupply = nonRebasingSupply.sub(_amount);\\n } else {\\n _rebasingCredits = _rebasingCredits.sub(creditAmount);\\n }\\n\\n _totalSupply = _totalSupply.sub(_amount);\\n\\n emit Transfer(_account, address(0), _amount);\\n }\\n\\n /**\\n * @dev Get the credits per token for an account. Returns a fixed amount\\n * if the account is non-rebasing.\\n * @param _account Address of the account.\\n */\\n function _creditsPerToken(address _account)\\n internal\\n view\\n returns (uint256)\\n {\\n if (nonRebasingCreditsPerToken[_account] != 0) {\\n return nonRebasingCreditsPerToken[_account];\\n } else {\\n return _rebasingCreditsPerToken;\\n }\\n }\\n\\n /**\\n * @dev Is an account using rebasing accounting or non-rebasing accounting?\\n * Also, ensure contracts are non-rebasing if they have not opted in.\\n * @param _account Address of the account.\\n */\\n function _isNonRebasingAccount(address _account) internal returns (bool) {\\n bool isContract = Address.isContract(_account);\\n if (isContract && rebaseState[_account] == RebaseOptions.NotSet) {\\n _ensureRebasingMigration(_account);\\n }\\n return nonRebasingCreditsPerToken[_account] > 0;\\n }\\n\\n /**\\n * @dev Ensures internal account for rebasing and non-rebasing credits and\\n * supply is updated following deployment of frozen yield change.\\n */\\n function _ensureRebasingMigration(address _account) internal {\\n if (nonRebasingCreditsPerToken[_account] == 0) {\\n emit AccountRebasingDisabled(_account);\\n if (_creditBalances[_account] == 0) {\\n // Since there is no existing balance, we can directly set to\\n // high resolution, and do not have to do any other bookkeeping\\n nonRebasingCreditsPerToken[_account] = 1e27;\\n } else {\\n // Migrate an existing account:\\n\\n // Set fixed credits per token for this account\\n nonRebasingCreditsPerToken[_account] = _rebasingCreditsPerToken;\\n // Update non rebasing supply\\n nonRebasingSupply = nonRebasingSupply.add(balanceOf(_account));\\n // Update credit tallies\\n _rebasingCredits = _rebasingCredits.sub(\\n _creditBalances[_account]\\n );\\n }\\n }\\n }\\n\\n /**\\n * @notice Enable rebasing for an account.\\n * @dev Add a contract address to the non-rebasing exception list. The\\n * address's balance will be part of rebases and the account will be exposed\\n * to upside and downside.\\n * @param _account Address of the account.\\n */\\n function governanceRebaseOptIn(address _account)\\n public\\n nonReentrant\\n onlyGovernor\\n {\\n _rebaseOptIn(_account);\\n }\\n\\n /**\\n * @dev Add a contract address to the non-rebasing exception list. The\\n * address's balance will be part of rebases and the account will be exposed\\n * to upside and downside.\\n */\\n function rebaseOptIn() public nonReentrant {\\n _rebaseOptIn(msg.sender);\\n }\\n\\n function _rebaseOptIn(address _account) internal {\\n require(_isNonRebasingAccount(_account), \\\"Account has not opted out\\\");\\n\\n // Convert balance into the same amount at the current exchange rate\\n uint256 newCreditBalance = _creditBalances[_account]\\n .mul(_rebasingCreditsPerToken)\\n .div(_creditsPerToken(_account));\\n\\n // Decreasing non rebasing supply\\n nonRebasingSupply = nonRebasingSupply.sub(balanceOf(_account));\\n\\n _creditBalances[_account] = newCreditBalance;\\n\\n // Increase rebasing credits, totalSupply remains unchanged so no\\n // adjustment necessary\\n _rebasingCredits = _rebasingCredits.add(_creditBalances[_account]);\\n\\n rebaseState[_account] = RebaseOptions.OptIn;\\n\\n // Delete any fixed credits per token\\n delete nonRebasingCreditsPerToken[_account];\\n emit AccountRebasingEnabled(_account);\\n }\\n\\n /**\\n * @dev Explicitly mark that an address is non-rebasing.\\n */\\n function rebaseOptOut() public nonReentrant {\\n require(!_isNonRebasingAccount(msg.sender), \\\"Account has not opted in\\\");\\n\\n // Increase non rebasing supply\\n nonRebasingSupply = nonRebasingSupply.add(balanceOf(msg.sender));\\n // Set fixed credits per token\\n nonRebasingCreditsPerToken[msg.sender] = _rebasingCreditsPerToken;\\n\\n // Decrease rebasing credits, total supply remains unchanged so no\\n // adjustment necessary\\n _rebasingCredits = _rebasingCredits.sub(_creditBalances[msg.sender]);\\n\\n // Mark explicitly opted out of rebasing\\n rebaseState[msg.sender] = RebaseOptions.OptOut;\\n emit AccountRebasingDisabled(msg.sender);\\n }\\n\\n /**\\n * @dev Modify the supply without minting new tokens. This uses a change in\\n * the exchange rate between \\\"credits\\\" and OUSD tokens to change balances.\\n * @param _newTotalSupply New total supply of OUSD.\\n */\\n function changeSupply(uint256 _newTotalSupply)\\n external\\n onlyVault\\n nonReentrant\\n {\\n require(_totalSupply > 0, \\\"Cannot increase 0 supply\\\");\\n\\n if (_totalSupply == _newTotalSupply) {\\n emit TotalSupplyUpdatedHighres(\\n _totalSupply,\\n _rebasingCredits,\\n _rebasingCreditsPerToken\\n );\\n return;\\n }\\n\\n _totalSupply = _newTotalSupply > MAX_SUPPLY\\n ? MAX_SUPPLY\\n : _newTotalSupply;\\n\\n _rebasingCreditsPerToken = _rebasingCredits.divPrecisely(\\n _totalSupply.sub(nonRebasingSupply)\\n );\\n\\n require(_rebasingCreditsPerToken > 0, \\\"Invalid change in supply\\\");\\n\\n _totalSupply = _rebasingCredits\\n .divPrecisely(_rebasingCreditsPerToken)\\n .add(nonRebasingSupply);\\n\\n emit TotalSupplyUpdatedHighres(\\n _totalSupply,\\n _rebasingCredits,\\n _rebasingCreditsPerToken\\n );\\n }\\n}\\n\",\"keccak256\":\"0x2dc66b1ba02716d64eb47dd9117fda62650d8b57669e6c351437e0ad29ad5f19\",\"license\":\"MIT\"},\"contracts/utils/Helpers.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBasicToken } from \\\"../interfaces/IBasicToken.sol\\\";\\n\\nlibrary Helpers {\\n /**\\n * @notice Fetch the `symbol()` from an ERC20 token\\n * @dev Grabs the `symbol()` from a contract\\n * @param _token Address of the ERC20 token\\n * @return string Symbol of the ERC20 token\\n */\\n function getSymbol(address _token) internal view returns (string memory) {\\n string memory symbol = IBasicToken(_token).symbol();\\n return symbol;\\n }\\n\\n /**\\n * @notice Fetch the `decimals()` from an ERC20 token\\n * @dev Grabs the `decimals()` from a contract and fails if\\n * the decimal value does not live within a certain range\\n * @param _token Address of the ERC20 token\\n * @return uint256 Decimals of the ERC20 token\\n */\\n function getDecimals(address _token) internal view returns (uint256) {\\n uint256 decimals = IBasicToken(_token).decimals();\\n require(\\n decimals >= 4 && decimals <= 18,\\n \\\"Token must have sufficient decimal places\\\"\\n );\\n\\n return decimals;\\n }\\n}\\n\",\"keccak256\":\"0x108b7a69e0140da0072ca18f90a03a3340574400f81aa6076cd2cccdf13699c2\",\"license\":\"MIT\"},\"contracts/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Base contract any contracts that need to initialize state after deployment.\\n * @author Origin Protocol Inc\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n require(\\n initializing || !initialized,\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n\\n bool isTopLevelCall = !initializing;\\n if (isTopLevelCall) {\\n initializing = true;\\n initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n initializing = false;\\n }\\n }\\n\\n uint256[50] private ______gap;\\n}\\n\",\"keccak256\":\"0xaadbcc138114afed4af4f353c2ced2916e6ee14be91434789187f192caf0d786\",\"license\":\"MIT\"},\"contracts/utils/InitializableAbstractStrategy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Base contract for vault strategies.\\n * @author Origin Protocol Inc\\n */\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport { Initializable } from \\\"../utils/Initializable.sol\\\";\\nimport { Governable } from \\\"../governance/Governable.sol\\\";\\nimport { IVault } from \\\"../interfaces/IVault.sol\\\";\\n\\nabstract contract InitializableAbstractStrategy is Initializable, Governable {\\n using SafeERC20 for IERC20;\\n\\n event PTokenAdded(address indexed _asset, address _pToken);\\n event PTokenRemoved(address indexed _asset, address _pToken);\\n event Deposit(address indexed _asset, address _pToken, uint256 _amount);\\n event Withdrawal(address indexed _asset, address _pToken, uint256 _amount);\\n event RewardTokenCollected(\\n address recipient,\\n address rewardToken,\\n uint256 amount\\n );\\n event RewardTokenAddressesUpdated(\\n address[] _oldAddresses,\\n address[] _newAddresses\\n );\\n event HarvesterAddressesUpdated(\\n address _oldHarvesterAddress,\\n address _newHarvesterAddress\\n );\\n\\n /// @notice Address of the underlying platform\\n address public immutable platformAddress;\\n /// @notice Address of the OToken vault\\n address public immutable vaultAddress;\\n\\n /// @dev Replaced with an immutable variable\\n // slither-disable-next-line constable-states\\n address private _deprecated_platformAddress;\\n\\n /// @dev Replaced with an immutable\\n // slither-disable-next-line constable-states\\n address private _deprecated_vaultAddress;\\n\\n /// @notice asset => pToken (Platform Specific Token Address)\\n mapping(address => address) public assetToPToken;\\n\\n /// @notice Full list of all assets supported by the strategy\\n address[] internal assetsMapped;\\n\\n // Deprecated: Reward token address\\n // slither-disable-next-line constable-states\\n address private _deprecated_rewardTokenAddress;\\n\\n // Deprecated: now resides in Harvester's rewardTokenConfigs\\n // slither-disable-next-line constable-states\\n uint256 private _deprecated_rewardLiquidationThreshold;\\n\\n /// @notice Address of the Harvester contract allowed to collect reward tokens\\n address public harvesterAddress;\\n\\n /// @notice Address of the reward tokens. eg CRV, BAL, CVX, AURA\\n address[] public rewardTokenAddresses;\\n\\n /* Reserved for future expansion. Used to be 100 storage slots\\n * and has decreased to accommodate:\\n * - harvesterAddress\\n * - rewardTokenAddresses\\n */\\n int256[98] private _reserved;\\n\\n struct BaseStrategyConfig {\\n address platformAddress; // Address of the underlying platform\\n address vaultAddress; // Address of the OToken's Vault\\n }\\n\\n /**\\n * @param _config The platform and OToken vault addresses\\n */\\n constructor(BaseStrategyConfig memory _config) {\\n platformAddress = _config.platformAddress;\\n vaultAddress = _config.vaultAddress;\\n }\\n\\n /**\\n * @dev Internal initialize function, to set up initial internal state\\n * @param _rewardTokenAddresses Address of reward token for platform\\n * @param _assets Addresses of initial supported assets\\n * @param _pTokens Platform Token corresponding addresses\\n */\\n function _initialize(\\n address[] memory _rewardTokenAddresses,\\n address[] memory _assets,\\n address[] memory _pTokens\\n ) internal {\\n rewardTokenAddresses = _rewardTokenAddresses;\\n\\n uint256 assetCount = _assets.length;\\n require(assetCount == _pTokens.length, \\\"Invalid input arrays\\\");\\n for (uint256 i = 0; i < assetCount; ++i) {\\n _setPTokenAddress(_assets[i], _pTokens[i]);\\n }\\n }\\n\\n /**\\n * @notice Collect accumulated reward token and send to Vault.\\n */\\n function collectRewardTokens() external virtual onlyHarvester nonReentrant {\\n _collectRewardTokens();\\n }\\n\\n /**\\n * @dev Default implementation that transfers reward tokens to the Harvester\\n * Implementing strategies need to add custom logic to collect the rewards.\\n */\\n function _collectRewardTokens() internal virtual {\\n uint256 rewardTokenCount = rewardTokenAddresses.length;\\n for (uint256 i = 0; i < rewardTokenCount; ++i) {\\n IERC20 rewardToken = IERC20(rewardTokenAddresses[i]);\\n uint256 balance = rewardToken.balanceOf(address(this));\\n if (balance > 0) {\\n emit RewardTokenCollected(\\n harvesterAddress,\\n address(rewardToken),\\n balance\\n );\\n rewardToken.safeTransfer(harvesterAddress, balance);\\n }\\n }\\n }\\n\\n /**\\n * @dev Verifies that the caller is the Vault.\\n */\\n modifier onlyVault() {\\n require(msg.sender == vaultAddress, \\\"Caller is not the Vault\\\");\\n _;\\n }\\n\\n /**\\n * @dev Verifies that the caller is the Harvester.\\n */\\n modifier onlyHarvester() {\\n require(msg.sender == harvesterAddress, \\\"Caller is not the Harvester\\\");\\n _;\\n }\\n\\n /**\\n * @dev Verifies that the caller is the Vault or Governor.\\n */\\n modifier onlyVaultOrGovernor() {\\n require(\\n msg.sender == vaultAddress || msg.sender == governor(),\\n \\\"Caller is not the Vault or Governor\\\"\\n );\\n _;\\n }\\n\\n /**\\n * @dev Verifies that the caller is the Vault, Governor, or Strategist.\\n */\\n modifier onlyVaultOrGovernorOrStrategist() {\\n require(\\n msg.sender == vaultAddress ||\\n msg.sender == governor() ||\\n msg.sender == IVault(vaultAddress).strategistAddr(),\\n \\\"Caller is not the Vault, Governor, or Strategist\\\"\\n );\\n _;\\n }\\n\\n /**\\n * @notice Set the reward token addresses. Any old addresses will be overwritten.\\n * @param _rewardTokenAddresses Array of reward token addresses\\n */\\n function setRewardTokenAddresses(address[] calldata _rewardTokenAddresses)\\n external\\n onlyGovernor\\n {\\n uint256 rewardTokenCount = _rewardTokenAddresses.length;\\n for (uint256 i = 0; i < rewardTokenCount; ++i) {\\n require(\\n _rewardTokenAddresses[i] != address(0),\\n \\\"Can not set an empty address as a reward token\\\"\\n );\\n }\\n\\n emit RewardTokenAddressesUpdated(\\n rewardTokenAddresses,\\n _rewardTokenAddresses\\n );\\n rewardTokenAddresses = _rewardTokenAddresses;\\n }\\n\\n /**\\n * @notice Get the reward token addresses.\\n * @return address[] the reward token addresses.\\n */\\n function getRewardTokenAddresses()\\n external\\n view\\n returns (address[] memory)\\n {\\n return rewardTokenAddresses;\\n }\\n\\n /**\\n * @notice Provide support for asset by passing its pToken address.\\n * This method can only be called by the system Governor\\n * @param _asset Address for the asset\\n * @param _pToken Address for the corresponding platform token\\n */\\n function setPTokenAddress(address _asset, address _pToken)\\n external\\n virtual\\n onlyGovernor\\n {\\n _setPTokenAddress(_asset, _pToken);\\n }\\n\\n /**\\n * @notice Remove a supported asset by passing its index.\\n * This method can only be called by the system Governor\\n * @param _assetIndex Index of the asset to be removed\\n */\\n function removePToken(uint256 _assetIndex) external virtual onlyGovernor {\\n require(_assetIndex < assetsMapped.length, \\\"Invalid index\\\");\\n address asset = assetsMapped[_assetIndex];\\n address pToken = assetToPToken[asset];\\n\\n if (_assetIndex < assetsMapped.length - 1) {\\n assetsMapped[_assetIndex] = assetsMapped[assetsMapped.length - 1];\\n }\\n assetsMapped.pop();\\n assetToPToken[asset] = address(0);\\n\\n emit PTokenRemoved(asset, pToken);\\n }\\n\\n /**\\n * @notice Provide support for asset by passing its pToken address.\\n * Add to internal mappings and execute the platform specific,\\n * abstract method `_abstractSetPToken`\\n * @param _asset Address for the asset\\n * @param _pToken Address for the corresponding platform token\\n */\\n function _setPTokenAddress(address _asset, address _pToken) internal {\\n require(assetToPToken[_asset] == address(0), \\\"pToken already set\\\");\\n require(\\n _asset != address(0) && _pToken != address(0),\\n \\\"Invalid addresses\\\"\\n );\\n\\n assetToPToken[_asset] = _pToken;\\n assetsMapped.push(_asset);\\n\\n emit PTokenAdded(_asset, _pToken);\\n\\n _abstractSetPToken(_asset, _pToken);\\n }\\n\\n /**\\n * @notice Transfer token to governor. Intended for recovering tokens stuck in\\n * strategy contracts, i.e. mistaken sends.\\n * @param _asset Address for the asset\\n * @param _amount Amount of the asset to transfer\\n */\\n function transferToken(address _asset, uint256 _amount)\\n public\\n onlyGovernor\\n {\\n require(!supportsAsset(_asset), \\\"Cannot transfer supported asset\\\");\\n IERC20(_asset).safeTransfer(governor(), _amount);\\n }\\n\\n /**\\n * @notice Set the Harvester contract that can collect rewards.\\n * @param _harvesterAddress Address of the harvester contract.\\n */\\n function setHarvesterAddress(address _harvesterAddress)\\n external\\n onlyGovernor\\n {\\n emit HarvesterAddressesUpdated(harvesterAddress, _harvesterAddress);\\n harvesterAddress = _harvesterAddress;\\n }\\n\\n /***************************************\\n Abstract\\n ****************************************/\\n\\n function _abstractSetPToken(address _asset, address _pToken)\\n internal\\n virtual;\\n\\n function safeApproveAllTokens() external virtual;\\n\\n /**\\n * @notice Deposit an amount of assets into the platform\\n * @param _asset Address for the asset\\n * @param _amount Units of asset to deposit\\n */\\n function deposit(address _asset, uint256 _amount) external virtual;\\n\\n /**\\n * @notice Deposit all supported assets in this strategy contract to the platform\\n */\\n function depositAll() external virtual;\\n\\n /**\\n * @notice Withdraw an `amount` of assets from the platform and\\n * send to the `_recipient`.\\n * @param _recipient Address to which the asset should be sent\\n * @param _asset Address of the asset\\n * @param _amount Units of asset to withdraw\\n */\\n function withdraw(\\n address _recipient,\\n address _asset,\\n uint256 _amount\\n ) external virtual;\\n\\n /**\\n * @notice Withdraw all supported assets from platform and\\n * sends to the OToken's Vault.\\n */\\n function withdrawAll() external virtual;\\n\\n /**\\n * @notice Get the total asset value held in the platform.\\n * This includes any interest that was generated since depositing.\\n * @param _asset Address of the asset\\n * @return balance Total value of the asset in the platform\\n */\\n function checkBalance(address _asset)\\n external\\n view\\n virtual\\n returns (uint256 balance);\\n\\n /**\\n * @notice Check if an asset is supported.\\n * @param _asset Address of the asset\\n * @return bool Whether asset is supported\\n */\\n function supportsAsset(address _asset) public view virtual returns (bool);\\n}\\n\",\"keccak256\":\"0x5e17bb3db9f9e1014b7c5c836547f8fa81e02af7568c0bb8f2a2e0e7c2192db4\",\"license\":\"MIT\"},\"contracts/utils/InitializableERC20Detailed.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n * @dev Optional functions from the ERC20 standard.\\n * Converted from openzeppelin/contracts/token/ERC20/ERC20Detailed.sol\\n * @author Origin Protocol Inc\\n */\\nabstract contract InitializableERC20Detailed is IERC20 {\\n // Storage gap to skip storage from prior to OUSD reset\\n uint256[100] private _____gap;\\n\\n string private _name;\\n string private _symbol;\\n uint8 private _decimals;\\n\\n /**\\n * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of\\n * these values are immutable: they can only be set once during\\n * construction.\\n * @notice To avoid variable shadowing appended `Arg` after arguments name.\\n */\\n function _initialize(\\n string memory nameArg,\\n string memory symbolArg,\\n uint8 decimalsArg\\n ) internal {\\n _name = nameArg;\\n _symbol = symbolArg;\\n _decimals = decimalsArg;\\n }\\n\\n /**\\n * @notice Returns the name of the token.\\n */\\n function name() public view returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @notice Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @notice Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view returns (uint8) {\\n return _decimals;\\n }\\n}\\n\",\"keccak256\":\"0xe35ac2d813a30d845a3b52bba72588d7e936c2b3f3373d15568c14db46aeed60\",\"license\":\"MIT\"},\"contracts/utils/StableMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { SafeMath } from \\\"@openzeppelin/contracts/utils/math/SafeMath.sol\\\";\\n\\n// Based on StableMath from Stability Labs Pty. Ltd.\\n// https://github.com/mstable/mStable-contracts/blob/master/contracts/shared/StableMath.sol\\n\\nlibrary StableMath {\\n using SafeMath for uint256;\\n\\n /**\\n * @dev Scaling unit for use in specific calculations,\\n * where 1 * 10**18, or 1e18 represents a unit '1'\\n */\\n uint256 private constant FULL_SCALE = 1e18;\\n\\n /***************************************\\n Helpers\\n ****************************************/\\n\\n /**\\n * @dev Adjust the scale of an integer\\n * @param to Decimals to scale to\\n * @param from Decimals to scale from\\n */\\n function scaleBy(\\n uint256 x,\\n uint256 to,\\n uint256 from\\n ) internal pure returns (uint256) {\\n if (to > from) {\\n x = x.mul(10**(to - from));\\n } else if (to < from) {\\n // slither-disable-next-line divide-before-multiply\\n x = x.div(10**(from - to));\\n }\\n return x;\\n }\\n\\n /***************************************\\n Precise Arithmetic\\n ****************************************/\\n\\n /**\\n * @dev Multiplies two precise units, and then truncates by the full scale\\n * @param x Left hand input to multiplication\\n * @param y Right hand input to multiplication\\n * @return Result after multiplying the two inputs and then dividing by the shared\\n * scale unit\\n */\\n function mulTruncate(uint256 x, uint256 y) internal pure returns (uint256) {\\n return mulTruncateScale(x, y, FULL_SCALE);\\n }\\n\\n /**\\n * @dev Multiplies two precise units, and then truncates by the given scale. For example,\\n * when calculating 90% of 10e18, (10e18 * 9e17) / 1e18 = (9e36) / 1e18 = 9e18\\n * @param x Left hand input to multiplication\\n * @param y Right hand input to multiplication\\n * @param scale Scale unit\\n * @return Result after multiplying the two inputs and then dividing by the shared\\n * scale unit\\n */\\n function mulTruncateScale(\\n uint256 x,\\n uint256 y,\\n uint256 scale\\n ) internal pure returns (uint256) {\\n // e.g. assume scale = fullScale\\n // z = 10e18 * 9e17 = 9e36\\n uint256 z = x.mul(y);\\n // return 9e36 / 1e18 = 9e18\\n return z.div(scale);\\n }\\n\\n /**\\n * @dev Multiplies two precise units, and then truncates by the full scale, rounding up the result\\n * @param x Left hand input to multiplication\\n * @param y Right hand input to multiplication\\n * @return Result after multiplying the two inputs and then dividing by the shared\\n * scale unit, rounded up to the closest base unit.\\n */\\n function mulTruncateCeil(uint256 x, uint256 y)\\n internal\\n pure\\n returns (uint256)\\n {\\n // e.g. 8e17 * 17268172638 = 138145381104e17\\n uint256 scaled = x.mul(y);\\n // e.g. 138145381104e17 + 9.99...e17 = 138145381113.99...e17\\n uint256 ceil = scaled.add(FULL_SCALE.sub(1));\\n // e.g. 13814538111.399...e18 / 1e18 = 13814538111\\n return ceil.div(FULL_SCALE);\\n }\\n\\n /**\\n * @dev Precisely divides two units, by first scaling the left hand operand. Useful\\n * for finding percentage weightings, i.e. 8e18/10e18 = 80% (or 8e17)\\n * @param x Left hand input to division\\n * @param y Right hand input to division\\n * @return Result after multiplying the left operand by the scale, and\\n * executing the division on the right hand input.\\n */\\n function divPrecisely(uint256 x, uint256 y)\\n internal\\n pure\\n returns (uint256)\\n {\\n // e.g. 8e18 * 1e18 = 8e36\\n uint256 z = x.mul(FULL_SCALE);\\n // e.g. 8e36 / 10e18 = 8e17\\n return z.div(y);\\n }\\n}\\n\",\"keccak256\":\"0x1eb49f6f79045d9e0a8e1dced8e01d9e559e5fac554dcbb53e43140b601b04e7\",\"license\":\"MIT\"},\"contracts/vault/VaultStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title OToken VaultStorage contract\\n * @notice The VaultStorage contract defines the storage for the Vault contracts\\n * @author Origin Protocol Inc\\n */\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\n\\nimport { IStrategy } from \\\"../interfaces/IStrategy.sol\\\";\\nimport { Governable } from \\\"../governance/Governable.sol\\\";\\nimport { OUSD } from \\\"../token/OUSD.sol\\\";\\nimport { Initializable } from \\\"../utils/Initializable.sol\\\";\\nimport \\\"../utils/Helpers.sol\\\";\\n\\ncontract VaultStorage is Initializable, Governable {\\n using SafeERC20 for IERC20;\\n\\n event AssetSupported(address _asset);\\n event AssetRemoved(address _asset);\\n event AssetDefaultStrategyUpdated(address _asset, address _strategy);\\n event AssetAllocated(address _asset, address _strategy, uint256 _amount);\\n event StrategyApproved(address _addr);\\n event StrategyRemoved(address _addr);\\n event Mint(address _addr, uint256 _value);\\n event Redeem(address _addr, uint256 _value);\\n event CapitalPaused();\\n event CapitalUnpaused();\\n event RebasePaused();\\n event RebaseUnpaused();\\n event VaultBufferUpdated(uint256 _vaultBuffer);\\n event OusdMetaStrategyUpdated(address _ousdMetaStrategy);\\n event RedeemFeeUpdated(uint256 _redeemFeeBps);\\n event PriceProviderUpdated(address _priceProvider);\\n event AllocateThresholdUpdated(uint256 _threshold);\\n event RebaseThresholdUpdated(uint256 _threshold);\\n event StrategistUpdated(address _address);\\n event MaxSupplyDiffChanged(uint256 maxSupplyDiff);\\n event YieldDistribution(address _to, uint256 _yield, uint256 _fee);\\n event TrusteeFeeBpsChanged(uint256 _basis);\\n event TrusteeAddressChanged(address _address);\\n event NetOusdMintForStrategyThresholdChanged(uint256 _threshold);\\n event SwapperChanged(address _address);\\n event SwapAllowedUndervalueChanged(uint256 _basis);\\n event SwapSlippageChanged(address _asset, uint256 _basis);\\n event Swapped(\\n address indexed _fromAsset,\\n address indexed _toAsset,\\n uint256 _fromAssetAmount,\\n uint256 _toAssetAmount\\n );\\n\\n // Assets supported by the Vault, i.e. Stablecoins\\n enum UnitConversion {\\n DECIMALS,\\n GETEXCHANGERATE\\n }\\n // Changed to fit into a single storage slot so the decimals needs to be recached\\n struct Asset {\\n // Note: OETHVaultCore doesn't use `isSupported` when minting,\\n // redeeming or checking balance of assets.\\n bool isSupported;\\n UnitConversion unitConversion;\\n uint8 decimals;\\n // Max allowed slippage from the Oracle price when swapping collateral assets in basis points.\\n // For example 40 == 0.4% slippage\\n uint16 allowedOracleSlippageBps;\\n }\\n\\n /// @dev mapping of supported vault assets to their configuration\\n // slither-disable-next-line uninitialized-state\\n mapping(address => Asset) internal assets;\\n /// @dev list of all assets supported by the vault.\\n // slither-disable-next-line uninitialized-state\\n address[] internal allAssets;\\n\\n // Strategies approved for use by the Vault\\n struct Strategy {\\n bool isSupported;\\n uint256 _deprecated; // Deprecated storage slot\\n }\\n /// @dev mapping of strategy contracts to their configiration\\n mapping(address => Strategy) internal strategies;\\n /// @dev list of all vault strategies\\n address[] internal allStrategies;\\n\\n /// @notice Address of the Oracle price provider contract\\n // slither-disable-next-line uninitialized-state\\n address public priceProvider;\\n /// @notice pause rebasing if true\\n bool public rebasePaused = false;\\n /// @notice pause operations that change the OToken supply.\\n /// eg mint, redeem, allocate, mint/burn for strategy\\n bool public capitalPaused = true;\\n /// @notice Redemption fee in basis points. eg 50 = 0.5%\\n uint256 public redeemFeeBps;\\n /// @notice Percentage of assets to keep in Vault to handle (most) withdrawals. 100% = 1e18.\\n uint256 public vaultBuffer;\\n /// @notice OToken mints over this amount automatically allocate funds. 18 decimals.\\n uint256 public autoAllocateThreshold;\\n /// @notice OToken mints over this amount automatically rebase. 18 decimals.\\n uint256 public rebaseThreshold;\\n\\n /// @dev Address of the OToken token. eg OUSD or OETH.\\n // slither-disable-next-line uninitialized-state\\n OUSD internal oUSD;\\n\\n //keccak256(\\\"OUSD.vault.governor.admin.impl\\\");\\n bytes32 constant adminImplPosition =\\n 0xa2bd3d3cf188a41358c8b401076eb59066b09dec5775650c0de4c55187d17bd9;\\n\\n // Address of the contract responsible for post rebase syncs with AMMs\\n address private _deprecated_rebaseHooksAddr = address(0);\\n\\n // Deprecated: Address of Uniswap\\n // slither-disable-next-line constable-states\\n address private _deprecated_uniswapAddr = address(0);\\n\\n /// @notice Address of the Strategist\\n address public strategistAddr = address(0);\\n\\n /// @notice Mapping of asset address to the Strategy that they should automatically\\n // be allocated to\\n // slither-disable-next-line uninitialized-state\\n mapping(address => address) public assetDefaultStrategies;\\n\\n /// @notice Max difference between total supply and total value of assets. 18 decimals.\\n // slither-disable-next-line uninitialized-state\\n uint256 public maxSupplyDiff;\\n\\n /// @notice Trustee contract that can collect a percentage of yield\\n address public trusteeAddress;\\n\\n /// @notice Amount of yield collected in basis points. eg 2000 = 20%\\n uint256 public trusteeFeeBps;\\n\\n /// @dev Deprecated: Tokens that should be swapped for stablecoins\\n address[] private _deprecated_swapTokens;\\n\\n uint256 constant MINT_MINIMUM_UNIT_PRICE = 0.998e18;\\n\\n /// @notice Metapool strategy that is allowed to mint/burn OTokens without changing collateral\\n address public ousdMetaStrategy = address(0);\\n\\n /// @notice How much OTokens are currently minted by the strategy\\n int256 public netOusdMintedForStrategy = 0;\\n\\n /// @notice How much net total OTokens are allowed to be minted by all strategies\\n uint256 public netOusdMintForStrategyThreshold = 0;\\n\\n uint256 constant MIN_UNIT_PRICE_DRIFT = 0.7e18;\\n uint256 constant MAX_UNIT_PRICE_DRIFT = 1.3e18;\\n\\n /// @notice Collateral swap configuration.\\n /// @dev is packed into a single storage slot to save gas.\\n struct SwapConfig {\\n // Contract that swaps the vault's collateral assets\\n address swapper;\\n // Max allowed percentage the total value can drop below the total supply in basis points.\\n // For example 100 == 1%\\n uint16 allowedUndervalueBps;\\n }\\n SwapConfig internal swapConfig = SwapConfig(address(0), 0);\\n\\n // For future use\\n uint256[50] private __gap;\\n\\n /**\\n * @notice set the implementation for the admin, this needs to be in a base class else we cannot set it\\n * @param newImpl address of the implementation\\n */\\n function setAdminImpl(address newImpl) external onlyGovernor {\\n require(\\n Address.isContract(newImpl),\\n \\\"new implementation is not a contract\\\"\\n );\\n bytes32 position = adminImplPosition;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(position, newImpl)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcbdb87104749e20c8411bc2acbfa0b7d48e876e3f4e1c46c9a7b00fcdb9722d9\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101806040523480156200001257600080fd5b5060405162004e7a38038062004e7a833981016040819052620000359162000138565b8585876020015183868383838362000053336200010860201b60201c565b60008051602062004e5a833981519152546040516001600160a01b03909116906000907fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a908290a36033805460ff191690556001600160601b0319606094851b811660805291841b821660a052831b811660c05290821b811660e0528651821b811661010052602090960151811b86166101205298891b851661014052505050509190931b1661016052506200021392505050565b60008051602062004e5a83398151915255565b80516001600160a01b03811681146200013357600080fd5b919050565b60008060008060008086880360e08112156200015357600080fd5b60408112156200016257600080fd5b50604080519081016001600160401b03811182821017156200019457634e487b7160e01b600052604160045260246000fd5b604052620001a2886200011b565b8152620001b2602089016200011b565b60208201529550620001c7604088016200011b565b9450620001d7606088016200011b565b9350620001e7608088016200011b565b9250620001f760a088016200011b565b91506200020760c088016200011b565b90509295509295509295565b60805160601c60a05160601c60c05160601c60e05160601c6101005160601c6101205160601c6101405160601c6101605160601c614aa3620003b7600039600081816102f8015281816109ec0152612f750152600081816105ce01526124a50152600081816104a201528181610dd50152818161197c01528181611af5015281816128040152612a8c015260006109b801526000818161075301528181610b9d015281816118aa01528181611b4501528181611f090152818161356101526137bb015260008181610a4b01528181610c730152818161177c015281816124750152818161258d015261298201526000818161090d01526114be01526000818161032a0152818161052c0152818161082401528181610b0401528181610e4a01528181611032015281816110ba015281816112690152818161134401528181611a6601528181611b1601528181611e8301528181611f3801528181612b1701528181612bbf0152818161307a015281816130ff0152818161317301528181613410015281816134db015281816135900152818161373501526137ea0152614aa36000f3fe6080604052600436106102e85760003560e01c8063853828b611610190578063c7af3352116100dc578063d9f00ec711610095578063de5f62681161006f578063de5f626814610a0e578063e752923914610a23578063f1188e4014610a39578063f6ca71b014610a6d57600080fd5b8063d9f00ec714610986578063dbe55e56146109a6578063dd505df6146109da57600080fd5b8063c7af3352146108c9578063c98517c5146108de578063cceab750146108fb578063d059f6ef1461092f578063d38bfff414610946578063d9caed121461096657600080fd5b80639da0e46211610149578063ab12edf511610123578063ab12edf514610854578063ad1728cb14610874578063bb1b918d14610889578063c2e1e3f4146108a957600080fd5b80639da0e462146107b5578063a4f98af4146107f2578063aa388af61461080757600080fd5b8063853828b6146106e757806387bae867146106fc5780638d7c0e46146107215780639092c31c146107415780639136616a1461077557806396d538bb1461079557600080fd5b80635c975abb1161024f57806367c7066c1161020857806371a735f3116101e257806371a735f31461067c5780637b2d9b2c1461069c578063842f5c46146106bc5780638456cb59146106d257600080fd5b806367c7066c1461061c5780636e811d381461063c5780636ef387951461065c57600080fd5b80635c975abb146105635780635d36b190146105875780635f5152261461059c5780636093d380146105bc57806363092383146105f057806366e3667e1461060657600080fd5b8063430bf08a116102a1578063430bf08a14610490578063435356d1146104c457806347e7ef24146104e4578063484be81214610504578063579a7e1a1461051a5780635a063f631461054e57600080fd5b80630c340a24146103a45780630ed57b3a146103d65780630fc3b4c4146103f65780631072cbea1461042c57806322495dc81461044c5780633c8649591461046c57600080fd5b3661039f57336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061034c5750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b61039d5760405162461bcd60e51b815260206004820152601e60248201527f657468206e6f742066726f6d20616c6c6f77656420636f6e747261637473000060448201526064015b60405180910390fd5b005b600080fd5b3480156103b057600080fd5b506103b9610a8f565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156103e257600080fd5b5061039d6103f1366004613e46565b610aac565b34801561040257600080fd5b506103b9610411366004613e0c565b609f602052600090815260409020546001600160a01b031681565b34801561043857600080fd5b5061039d610447366004613ec0565b610ade565b34801561045857600080fd5b5061039d610467366004613fb4565b610b9b565b34801561047857600080fd5b5061048260695481565b6040519081526020016103cd565b34801561049c57600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b3480156104d057600080fd5b5061039d6104df366004613f2d565b610ce5565b3480156104f057600080fd5b5061039d6104ff366004613ec0565b610dca565b34801561051057600080fd5b50610482606a5481565b34801561052657600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b34801561055a57600080fd5b5061039d610ee9565b34801561056f57600080fd5b5060335460ff165b60405190151581526020016103cd565b34801561059357600080fd5b5061039d610f88565b3480156105a857600080fd5b506104826105b7366004613e0c565b61102e565b3480156105c857600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b3480156105fc57600080fd5b50610482611c2081565b34801561061257600080fd5b5061048260345481565b34801561062857600080fd5b5060a3546103b9906001600160a01b031681565b34801561064857600080fd5b5061039d610657366004613e0c565b611162565b34801561066857600080fd5b5061039d610677366004613eec565b6111ea565b34801561068857600080fd5b5061039d6106973660046141c2565b611685565b3480156106a857600080fd5b506103b96106b736600461408a565b61187e565b3480156106c857600080fd5b5061048260685481565b3480156106de57600080fd5b5061039d6118a8565b3480156106f357600080fd5b5061039d611971565b34801561070857600080fd5b506033546103b99061010090046001600160a01b031681565b34801561072d57600080fd5b5061039d61073c366004614243565b611b43565b34801561074d57600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b34801561078157600080fd5b5061039d61079036600461408a565b612018565b3480156107a157600080fd5b5061039d6107b0366004613eec565b6121e3565b3480156107c157600080fd5b506107e56107d036600461408a565b60356020526000908152604090205460ff1681565b6040516103cd91906146ae565b3480156107fe57600080fd5b50610577612303565b34801561081357600080fd5b50610577610822366004613e0c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b34801561086057600080fd5b5061039d61086f366004614288565b612362565b34801561088057600080fd5b5061039d61245e565b34801561089557600080fd5b5061039d6108a436600461410e565b612524565b3480156108b557600080fd5b5061039d6108c4366004613e0c565b612697565b3480156108d557600080fd5b50610577612724565b3480156108ea57600080fd5b506104826801bc16d674ec80000081565b34801561090757600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b34801561093b57600080fd5b506104826101075481565b34801561095257600080fd5b5061039d610961366004613e0c565b612755565b34801561097257600080fd5b5061039d610981366004613e7f565b6127f9565b34801561099257600080fd5b5061039d6109a13660046140a3565b61288c565b3480156109b257600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b3480156109e657600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b348015610a1a57600080fd5b5061039d612a81565b348015610a2f57600080fd5b50610482606b5481565b348015610a4557600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b348015610a7957600080fd5b50610a82612bee565b6040516103cd9190614484565b6000610aa7600080516020614a4e8339815191525490565b905090565b610ab4612724565b610ad05760405162461bcd60e51b815260040161039490614720565b610ada8282612c50565b5050565b610ae6612724565b610b025760405162461bcd60e51b815260040161039490614720565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169083161415610b7f5760405162461bcd60e51b815260206004820152601f60248201527f43616e6e6f74207472616e7366657220737570706f72746564206173736574006044820152606401610394565b610ada610b8a610a8f565b6001600160a01b0384169083612daf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610bf457600080fd5b505afa158015610c08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2c9190613e29565b6001600160a01b0316336001600160a01b031614610c5c5760405162461bcd60e51b8152600401610394906147e0565b60405163bc26e7e560e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063bc26e7e590610cae9030908790879087906004016143d4565b600060405180830381600087803b158015610cc857600080fd5b505af1158015610cdc573d6000803e3d6000fd5b50505050505050565b610ced612724565b610d095760405162461bcd60e51b815260040161039490614720565b600054610100900460ff1680610d22575060005460ff16155b610d855760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610394565b600054610100900460ff16158015610da7576000805461ffff19166101011790555b610db2848484612e01565b8015610dc4576000805461ff00191690555b50505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e125760405162461bcd60e51b8152600401610394906146e9565b600080516020614a2e83398151915280546002811415610e445760405162461bcd60e51b8152600401610394906147b8565b600282557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b031614610ebd5760405162461bcd60e51b8152602060048201526011602482015270155b9cdd5c1c1bdc9d195908185cdcd95d607a1b6044820152606401610394565b826101076000828254610ed09190614907565b90915550610ee090508484612ebc565b50600190555050565b60a3546001600160a01b03163314610f435760405162461bcd60e51b815260206004820152601b60248201527f43616c6c6572206973206e6f74207468652048617276657374657200000000006044820152606401610394565b600080516020614a2e83398151915280546002811415610f755760405162461bcd60e51b8152600401610394906147b8565b60028255610f81612f4e565b5060019055565b7f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db546001600160a01b0316336001600160a01b0316146110235760405162461bcd60e51b815260206004820152603060248201527f4f6e6c79207468652070656e64696e6720476f7665726e6f722063616e20636f60448201526f6d706c6574652074686520636c61696d60801b6064820152608401610394565b61102c3361319c565b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316146110a55760405162461bcd60e51b8152602060048201526011602482015270155b9cdd5c1c1bdc9d195908185cdcd95d607a1b6044820152606401610394565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b15801561110457600080fd5b505afa158015611118573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113c919061426f565b603454611152906801bc16d674ec80000061491f565b61115c9190614907565b92915050565b61116a612724565b6111865760405162461bcd60e51b815260040161039490614720565b6040516001600160a01b03821681527f83f29c79feb71f8fba9d0fbc4ba5f0982a28b6b1e868b3fc50e6400d100bca0f9060200160405180910390a1603380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60335461010090046001600160a01b031633146112195760405162461bcd60e51b815260040161039490614781565b60335460ff161561123c5760405162461bcd60e51b815260040161039490614757565b6000611251826801bc16d674ec80000061491f565b6040516370a0823160e01b81523060048201529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b1580156112b357600080fd5b505afa1580156112c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112eb919061426f565b81111561132e5760405162461bcd60e51b81526020600482015260116024820152700d2dce6eaccccd2c6d2cadce840ae8aa89607b1b6044820152606401610394565b604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561139057600080fd5b505af11580156113a4573d6000803e3d6000fd5b505050506113b18161325d565b8160005b818110156116675760008585838181106113d1576113d16149de565b90506020028101906113e3919061485d565b6113ed9080614817565b6040516113fb9291906143a8565b6040805191829003909120600081815260356020529182205490925060ff169081600381111561142d5761142d6149b2565b1461147a5760405162461bcd60e51b815260206004820152601860248201527f56616c696461746f72206e6f74207265676973746572656400000000000000006044820152606401610394565b60408051600160f81b60208201526000602182018190526bffffffffffffffffffffffff193060601b16602c830152910160405160208183030381529060405290507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663228951186801bc16d674ec8000008a8a88818110611507576115076149de565b9050602002810190611519919061485d565b6115239080614817565b858d8d8b818110611536576115366149de565b9050602002810190611548919061485d565b611556906020810190614817565b8f8f8d818110611568576115686149de565b905060200281019061157a919061485d565b604001356040518863ffffffff1660e01b815260040161159f96959493929190614633565b6000604051808303818588803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050507ffeb31a79d38edb1b090d516e4df3e273651179c6f2c2ec53a9a22ae015b70ba9888886818110611604576116046149de565b9050602002810190611616919061485d565b6116209080614817565b6801bc16d674ec8000008460405161163b9493929190614682565b60405180910390a150506000908152603560205260409020805460ff19166001908117909155016113b5565b50806034600082825461167a9190614907565b909155505050505050565b60335461010090046001600160a01b031633146116b45760405162461bcd60e51b815260040161039490614781565b60335460ff16156116d75760405162461bcd60e51b815260040161039490614757565b60006035600087876040516116ed9291906143a8565b604080519182900390912082526020820192909252016000205460ff1690506002816003811115611720576117206149b2565b146117655760405162461bcd60e51b815260206004820152601560248201527456616c696461746f72206e6f742065786974696e6760581b6044820152606401610394565b6040516312b3fc1960e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906312b3fc19906117b990899089908990899089906004016145f2565b600060405180830381600087803b1580156117d357600080fd5b505af11580156117e7573d6000803e3d6000fd5b505050507ff72821b8777f002ccdf6326f1242d9e0f762eb077668b67bebe640535378066d868686866040516118209493929190614569565b60405180910390a1600360356000888860405161183e9291906143a8565b60408051918290039091208252602082019290925201600020805460ff19166001836003811115611871576118716149b2565b0217905550505050505050565b60a4818154811061188e57600080fd5b6000918252602090912001546001600160a01b0316905081565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561190157600080fd5b505afa158015611915573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119399190613e29565b6001600160a01b0316336001600160a01b0316146119695760405162461bcd60e51b8152600401610394906147e0565b61102c61328a565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806119c057506119ab610a8f565b6001600160a01b0316336001600160a01b0316145b611a185760405162461bcd60e51b815260206004820152602360248201527f43616c6c6572206973206e6f7420746865205661756c74206f7220476f7665726044820152623737b960e91b6064820152608401610394565b600080516020614a2e83398151915280546002811415611a4a5760405162461bcd60e51b8152600401610394906147b8565b600282556040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015611ab057600080fd5b505afa158015611ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ae8919061426f565b90508015611b3b57611b3b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000836132ff565b505060019055565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611b9c57600080fd5b505afa158015611bb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bd49190613e29565b6001600160a01b0316336001600160a01b031614611c045760405162461bcd60e51b8152600401610394906147e0565b60335460ff16611c4d5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610394565b43611c20606b54611c5e9190614907565b10611cb95760405162461bcd60e51b815260206004820152602560248201527f6d616e75616c6c794669784163636f756e74696e672063616c6c656420746f6f6044820152641039b7b7b760d91b6064820152608401610394565b6002198312158015611ccc575060038313155b8015611ce65750600083603454611ce391906148c6565b12155b611d325760405162461bcd60e51b815260206004820152601760248201527f696e76616c69642076616c696461746f727344656c74610000000000000000006044820152606401610394565b6811ff6cf0fd15afffff198212158015611d5557506811ff6cf0fd15b000008213155b8015611d6f5750600082606854611d6c91906148c6565b12155b611dbb5760405162461bcd60e51b815260206004820152601d60248201527f696e76616c696420636f6e73656e7375735265776172647344656c74610000006044820152606401610394565b68053444835ec5800000811115611e145760405162461bcd60e51b815260206004820152601960248201527f696e76616c69642077657468546f5661756c74416d6f756e74000000000000006044820152606401610394565b60408051848152602081018490529081018290527f80d022717ea022455c5886b8dd8a29c037570aae58aeb4d7b136d7a10ec2e4319060600160405180910390a182603454611e6391906148c6565b603455606854611e749083906148c6565b60685543606b558015611fc2577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015611edc57600080fd5b505af1158015611ef0573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b158015611f8057600080fd5b505af1158015611f94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb8919061406d565b50611fc2816133f7565b611fcc600061345f565b61200b5760405162461bcd60e51b815260206004820152601060248201526f333ab9b29039ba34b63610313637bbb760811b6044820152606401610394565b6120136138de565b505050565b612020612724565b61203c5760405162461bcd60e51b815260040161039490614720565b60a054811061207d5760405162461bcd60e51b815260206004820152600d60248201526c092dcecc2d8d2c840d2dcc8caf609b1b6044820152606401610394565b600060a08281548110612092576120926149de565b60009182526020808320909101546001600160a01b03908116808452609f90925260409092205460a054919350909116906120cf9060019061493e565b8310156121515760a080546120e69060019061493e565b815481106120f6576120f66149de565b60009182526020909120015460a080546001600160a01b039092169185908110612122576121226149de565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b60a0805480612162576121626149c8565b60008281526020808220600019908401810180546001600160a01b031990811690915593019093556001600160a01b03858116808352609f855260409283902080549094169093559051908416815290917f16b7600acff27e39a8a96056b3d533045298de927507f5c1d97e4accde60488c910160405180910390a2505050565b6121eb612724565b6122075760405162461bcd60e51b815260040161039490614720565b8060005b818110156122ba576000848483818110612227576122276149de565b905060200201602081019061223c9190613e0c565b6001600160a01b031614156122aa5760405162461bcd60e51b815260206004820152602e60248201527f43616e206e6f742073657420616e20656d70747920616464726573732061732060448201526d30903932bbb0b932103a37b5b2b760911b6064820152608401610394565b6122b381614981565b905061220b565b507f04c0b9649497d316554306e53678d5f5f5dbc3a06f97dec13ff4cfe98b986bbc60a484846040516122ef939291906144d1565b60405180910390a1610dc460a48484613b65565b60335460009061010090046001600160a01b031633146123355760405162461bcd60e51b815260040161039490614781565b60335460ff16156123585760405162461bcd60e51b815260040161039490614757565b610aa7600161345f565b61236a612724565b6123865760405162461bcd60e51b815260040161039490614720565b808210801561239d57506801bc16d674ec80000082105b80156123b157506801bc16d674ec80000081105b80156123ce5750673782dace9d9000006123cb838361493e565b10155b61241a5760405162461bcd60e51b815260206004820152601760248201527f696e636f7272656374206675736520696e74657276616c0000000000000000006044820152606401610394565b60408051838152602081018390527fcb8d24e46eb3c402bf344ee60a6576cba9ef2f59ea1af3b311520704924e901a910160405180910390a1606991909155606a55565b60405163095ea7b360e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260001960248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b390604401602060405180830381600087803b1580156124e957600080fd5b505af11580156124fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612521919061406d565b50565b60335461010090046001600160a01b031633146125535760405162461bcd60e51b815260040161039490614781565b60335460ff16156125765760405162461bcd60e51b815260040161039490614757565b6040516301ba3ee760e21b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906306e8fb9c906125d0908b908b908b908b908b908b908b908b90600401614590565b600060405180830381600087803b1580156125ea57600080fd5b505af11580156125fe573d6000803e3d6000fd5b505050506000603560008a8a6040516126189291906143a8565b60408051918290039091208252602082019290925201600020805460ff1916600183600381111561264b5761264b6149b2565b02179055507f75c4a66b2c6c28cf46db7131182a812e4fbbb2f0591377aa83a737909a9b68c3888888886040516126859493929190614569565b60405180910390a15050505050505050565b61269f612724565b6126bb5760405162461bcd60e51b815260040161039490614720565b60a354604080516001600160a01b03928316815291831660208301527fe48386b84419f4d36e0f96c10cc3510b6fb1a33795620c5098b22472bbe90796910160405180910390a160a380546001600160a01b0319166001600160a01b0392909216919091179055565b600061273c600080516020614a4e8339815191525490565b6001600160a01b0316336001600160a01b031614905090565b61275d612724565b6127795760405162461bcd60e51b815260040161039490614720565b6127a1817f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db55565b806001600160a01b03166127c1600080516020614a4e8339815191525490565b6001600160a01b03167fa39cc5eb22d0f34d8beaefee8a3f17cc229c1a1d1ef87a5ad47313487b1c4f0d60405160405180910390a350565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146128415760405162461bcd60e51b8152600401610394906146e9565b600080516020614a2e833981519152805460028114156128735760405162461bcd60e51b8152600401610394906147b8565b600282556128828585856132ff565b5060019055505050565b60335461010090046001600160a01b031633146128bb5760405162461bcd60e51b815260040161039490614781565b60335460ff16156128de5760405162461bcd60e51b815260040161039490614757565b60006035600086866040516128f49291906143a8565b604080519182900390912082526020820192909252016000205460ff1690506001816003811115612927576129276149b2565b1461296b5760405162461bcd60e51b815260206004820152601460248201527315985b1a59185d1bdc881b9bdd081cdd185ad95960621b6044820152606401610394565b604051633877322b60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690633877322b906129bd908890889088908890600401614569565b600060405180830381600087803b1580156129d757600080fd5b505af11580156129eb573d6000803e3d6000fd5b505050507ff8821da16f5ed966b41e0343c3eff9903af782d74f99f1689dd9d4562b6545b385858585604051612a249493929190614569565b60405180910390a16002603560008787604051612a429291906143a8565b60408051918290039091208252602082019290925201600020805460ff19166001836003811115612a7557612a756149b2565b02179055505050505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612ac95760405162461bcd60e51b8152600401610394906146e9565b600080516020614a2e83398151915280546002811415612afb5760405162461bcd60e51b8152600401610394906147b8565b600282556040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015612b6157600080fd5b505afa158015612b75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b99919061426f565b905060006101075482612bac919061493e565b90508015612be457610107829055612be47f000000000000000000000000000000000000000000000000000000000000000082612ebc565b5050600182555050565b606060a4805480602002602001604051908101604052809291908181526020018280548015612c4657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612c28575b5050505050905090565b6001600160a01b038281166000908152609f60205260409020541615612cad5760405162461bcd60e51b81526020600482015260126024820152711c151bdad95b88185b1c9958591e481cd95d60721b6044820152606401610394565b6001600160a01b03821615801590612ccd57506001600160a01b03811615155b612d0d5760405162461bcd60e51b8152602060048201526011602482015270496e76616c69642061646472657373657360781b6044820152606401610394565b6001600160a01b038281166000818152609f6020908152604080832080549587166001600160a01b0319968716811790915560a0805460018101825594527f78fdc8d422c49ced035a9edf18d00d3c6a8d81df210f3e5e448e045e77b41e8890930180549095168417909455925190815290917fef6485b84315f9b1483beffa32aae9a0596890395e3d7521f1c5fbb51790e765910160405180910390a25050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612013908490613958565b8251612e149060a4906020860190613bc8565b50815181518114612e5e5760405162461bcd60e51b8152602060048201526014602482015273496e76616c696420696e7075742061727261797360601b6044820152606401610394565b60005b81811015612eb557612ea5848281518110612e7e57612e7e6149de565b6020026020010151848381518110612e9857612e986149de565b6020026020010151612c50565b612eae81614981565b9050612e61565b5050505050565b60008111612f055760405162461bcd60e51b81526020600482015260166024820152754d757374206465706f73697420736f6d657468696e6760501b6044820152606401610394565b6040805160008152602081018390526001600160a01b038416917f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62910160405180910390a25050565b60335460ff1615612f715760405162461bcd60e51b815260040161039490614757565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e52253816040518163ffffffff1660e01b8152600401602060405180830381600087803b158015612fce57600080fd5b505af1158015612fe2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613006919061426f565b90506000606854826130189190614907565b90508047101561306a5760405162461bcd60e51b815260206004820152601860248201527f696e73756666696369656e74206574682062616c616e636500000000000000006044820152606401610394565b8015610ada5760006068819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156130d357600080fd5b505af11580156130e7573d6000803e3d6000fd5b505060a354604080516001600160a01b0392831681527f0000000000000000000000000000000000000000000000000000000000000000909216602083015281018590527ff6c07a063ed4e63808eb8da7112d46dbcd38de2b40a73dbcc9353c5a94c723539350606001915061315a9050565b60405180910390a160a354610ada906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911683612daf565b6001600160a01b0381166131f25760405162461bcd60e51b815260206004820152601a60248201527f4e657720476f7665726e6f7220697320616464726573732830290000000000006044820152606401610394565b806001600160a01b0316613212600080516020614a4e8339815191525490565b6001600160a01b03167fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a60405160405180910390a361252181600080516020614a4e83398151915255565b600061326c8261010754613a2a565b9050806101076000828254613281919061493e565b90915550505050565b60335460ff16156132ad5760405162461bcd60e51b815260040161039490614757565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586132e23390565b6040516001600160a01b03909116815260200160405180910390a1565b6000811161334f5760405162461bcd60e51b815260206004820152601760248201527f4d75737420776974686472617720736f6d657468696e670000000000000000006044820152606401610394565b6001600160a01b03831661339e5760405162461bcd60e51b8152602060048201526016602482015275135d5cdd081cdc1958da599e481c9958da5c1a595b9d60521b6044820152606401610394565b6040805160008152602081018390526001600160a01b038416917f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b6398910160405180910390a26120136001600160a01b0383168483612daf565b6040805160008152602081018390526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016917f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b6398910160405180910390a250565b60006068544710156134745761115c82613a42565b600060685447613484919061493e565b9050600191506801bc16d674ec80000081106136615760006801bc16d674ec8000008204905080603460008282546134bc919061493e565b90915550600090506134d7826801bc16d674ec80000061491f565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561353457600080fd5b505af1158015613548573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b1580156135d857600080fd5b505af11580156135ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613610919061406d565b5061361a816133f7565b60345460408051848152602081019290925281018290527fbe7040030ff7b347853214bf49820c6d455fedf58f3815f85c7bc5216993682b9060600160405180910390a150505b600060685447613671919061493e565b90506801bc16d674ec80000081106136c35760405162461bcd60e51b8152602060048201526015602482015274756e6578706563746564206163636f756e74696e6760581b6044820152606401610394565b806136cf575050919050565b6069548110156137295780606860008282546136eb9190614907565b90915550506040518181527f7a745a2c63a535068f52ceca27debd5297bbad5f7f37ec53d044a59d0362445d906020015b60405180910390a16138d7565b606a548111156138c6577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561378e57600080fd5b505af11580156137a2573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b15801561383257600080fd5b505af1158015613846573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061386a919061406d565b5060016034600082825461387e919061493e565b9091555061388d9050816133f7565b60345460408051918252602082018390527f6aa7e30787b26429ced603a7aba8b19c4b5d5bcf29a3257da953c8d53bcaa3a6910161371c565b6138cf84613a42565b949350505050565b5050919050565b60335460ff166139275760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610394565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336132e2565b60006139ad826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613a5a9092919063ffffffff16565b80519091501561201357808060200190518101906139cb919061406d565b6120135760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610394565b6000818310613a395781613a3b565b825b9392505050565b60008115613a5257613a5261328a565b506000919050565b60606138cf848460008585843b613ab35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610394565b600080866001600160a01b03168587604051613acf91906143b8565b60006040518083038185875af1925050503d8060008114613b0c576040519150601f19603f3d011682016040523d82523d6000602084013e613b11565b606091505b5091509150613b21828286613b2c565b979650505050505050565b60608315613b3b575081613a3b565b825115613b4b5782518084602001fd5b8160405162461bcd60e51b815260040161039491906146d6565b828054828255906000526020600020908101928215613bb8579160200282015b82811115613bb85781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190613b85565b50613bc4929150613c1d565b5090565b828054828255906000526020600020908101928215613bb8579160200282015b82811115613bb857825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613be8565b5b80821115613bc45760008155600101613c1e565b60008083601f840112613c4457600080fd5b5081356001600160401b03811115613c5b57600080fd5b6020830191508360208260051b8501011115613c7657600080fd5b9250929050565b600082601f830112613c8e57600080fd5b81356020613ca3613c9e836148a3565b614873565b80838252828201915082860187848660051b8901011115613cc357600080fd5b60005b85811015613ceb578135613cd981614a0a565b84529284019290840190600101613cc6565b5090979650505050505050565b60008083601f840112613d0a57600080fd5b5081356001600160401b03811115613d2157600080fd5b602083019150836020828501011115613c7657600080fd5b600060a08284031215613d4b57600080fd5b50919050565b600060a08284031215613d6357600080fd5b60405160a081018181106001600160401b0382111715613d8557613d856149f4565b604052905080613d9483613ddc565b8152613da260208401613df5565b6020820152613db360408401613df5565b60408201526060830135613dc681614a1f565b6060820152608092830135920191909152919050565b803563ffffffff81168114613df057600080fd5b919050565b80356001600160401b0381168114613df057600080fd5b600060208284031215613e1e57600080fd5b8135613a3b81614a0a565b600060208284031215613e3b57600080fd5b8151613a3b81614a0a565b60008060408385031215613e5957600080fd5b8235613e6481614a0a565b91506020830135613e7481614a0a565b809150509250929050565b600080600060608486031215613e9457600080fd5b8335613e9f81614a0a565b92506020840135613eaf81614a0a565b929592945050506040919091013590565b60008060408385031215613ed357600080fd5b8235613ede81614a0a565b946020939093013593505050565b60008060208385031215613eff57600080fd5b82356001600160401b03811115613f1557600080fd5b613f2185828601613c32565b90969095509350505050565b600080600060608486031215613f4257600080fd5b83356001600160401b0380821115613f5957600080fd5b613f6587838801613c7d565b94506020860135915080821115613f7b57600080fd5b613f8787838801613c7d565b93506040860135915080821115613f9d57600080fd5b50613faa86828701613c7d565b9150509250925092565b600080600060e08486031215613fc957600080fd5b83356001600160401b03811115613fdf57600080fd5b8401601f81018613613ff057600080fd5b80356020614000613c9e836148a3565b8083825282820191508285018a848660051b880101111561402057600080fd5b600095505b8486101561404a5761403681613df5565b835260019590950194918301918301614025565b509650508601359350614064915086905060408601613d51565b90509250925092565b60006020828403121561407f57600080fd5b8151613a3b81614a1f565b60006020828403121561409c57600080fd5b5035919050565b600080600080604085870312156140b957600080fd5b84356001600160401b03808211156140d057600080fd5b6140dc88838901613cf8565b909650945060208701359150808211156140f557600080fd5b5061410287828801613c32565b95989497509550505050565b600080600080600080600080610120898b03121561412b57600080fd5b88356001600160401b038082111561414257600080fd5b61414e8c838d01613cf8565b909a50985060208b013591508082111561416757600080fd5b6141738c838d01613c32565b909850965060408b013591508082111561418c57600080fd5b506141998b828c01613cf8565b909550935050606089013591506141b38a60808b01613d39565b90509295985092959890939650565b600080600080600060e086880312156141da57600080fd5b85356001600160401b03808211156141f157600080fd5b6141fd89838a01613cf8565b9097509550602088013591508082111561421657600080fd5b5061422388828901613c32565b909450925061423790508760408801613d39565b90509295509295909350565b60008060006060848603121561425857600080fd5b505081359360208301359350604090920135919050565b60006020828403121561428157600080fd5b5051919050565b6000806040838503121561429b57600080fd5b50508035926020909101359150565b8183526000602080850194508260005b858110156142e6576001600160401b036142d383613df5565b16875295820195908201906001016142ba565b509495945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008151808452614332816020860160208601614955565b601f01601f19169290920160200192915050565b63ffffffff61435482613ddc565b16825261436360208201613df5565b6001600160401b0380821660208501528061438060408501613df5565b1660408501525050606081013561439681614a1f565b15156060830152608090810135910152565b8183823760009101908152919050565b600082516143ca818460208701614955565b9190910192915050565b6001600160a01b03851681526101006020808301829052855191830182905260009161012084019187810191845b818110156144275783516001600160401b031685529382019392820192600101614402565b505082935086604086015263ffffffff865116606086015280860151925050506001600160401b0380821660808501528060408601511660a085015250506060830151151560c0830152608083015160e083015295945050505050565b6020808252825182820181905260009190848201906040850190845b818110156144c55783516001600160a01b0316835292840192918401916001016144a0565b50909695505050505050565b6000604082016040835280865480835260608501915087600052602092508260002060005b8281101561451b5781546001600160a01b0316845292840192600191820191016144f6565b505050838103828501528481528590820160005b8681101561455d57823561454281614a0a565b6001600160a01b03168252918301919083019060010161452f565b50979650505050505050565b60408152600061457d6040830186886142f1565b8281036020840152613b218185876142aa565b60006101208083526145a58184018b8d6142f1565b905082810360208401526145ba81898b6142aa565b905082810360408401526145cf8187896142f1565b9150508360608301526145e56080830184614346565b9998505050505050505050565b60e08152600061460660e0830187896142f1565b82810360208401526146198186886142aa565b9150506146296040830184614346565b9695505050505050565b60808152600061464760808301888a6142f1565b8281036020840152614659818861431a565b9050828103604084015261466e8186886142f1565b915050826060830152979650505050505050565b6060815260006146966060830186886142f1565b8460208401528281036040840152613b21818561431a565b60208101600483106146d057634e487b7160e01b600052602160045260246000fd5b91905290565b602081526000613a3b602083018461431a565b60208082526017908201527f43616c6c6572206973206e6f7420746865205661756c74000000000000000000604082015260600190565b6020808252601a908201527f43616c6c6572206973206e6f742074686520476f7665726e6f72000000000000604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601d908201527f43616c6c6572206973206e6f7420746865205265676973747261746f72000000604082015260600190565b6020808252600e908201526d1499595b9d1c985b9d0818d85b1b60921b604082015260600190565b6020808252601c908201527f43616c6c6572206973206e6f7420746865205374726174656769737400000000604082015260600190565b6000808335601e1984360301811261482e57600080fd5b8301803591506001600160401b0382111561484857600080fd5b602001915036819003821315613c7657600080fd5b60008235605e198336030181126143ca57600080fd5b604051601f8201601f191681016001600160401b038111828210171561489b5761489b6149f4565b604052919050565b60006001600160401b038211156148bc576148bc6149f4565b5060051b60200190565b600080821280156001600160ff1b03849003851316156148e8576148e861499c565b600160ff1b83900384128116156149015761490161499c565b50500190565b6000821982111561491a5761491a61499c565b500190565b60008160001904831182151516156149395761493961499c565b500290565b6000828210156149505761495061499c565b500390565b60005b83811015614970578181015183820152602001614958565b83811115610dc45750506000910152565b60006000198214156149955761499561499c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461252157600080fd5b801515811461252157600080fdfe53bf423e48ed90e97d02ab0ebab13b2a235a6bfbe9c321847d5c175333ac45357bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4aa2646970667358221220e7e50cde0c8998aadaf7928bf094efc09a4ab9f91b5a4d0db51e66b9307dc59264736f6c634300080700337bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a", - "deployedBytecode": "0x6080604052600436106102e85760003560e01c8063853828b611610190578063c7af3352116100dc578063d9f00ec711610095578063de5f62681161006f578063de5f626814610a0e578063e752923914610a23578063f1188e4014610a39578063f6ca71b014610a6d57600080fd5b8063d9f00ec714610986578063dbe55e56146109a6578063dd505df6146109da57600080fd5b8063c7af3352146108c9578063c98517c5146108de578063cceab750146108fb578063d059f6ef1461092f578063d38bfff414610946578063d9caed121461096657600080fd5b80639da0e46211610149578063ab12edf511610123578063ab12edf514610854578063ad1728cb14610874578063bb1b918d14610889578063c2e1e3f4146108a957600080fd5b80639da0e462146107b5578063a4f98af4146107f2578063aa388af61461080757600080fd5b8063853828b6146106e757806387bae867146106fc5780638d7c0e46146107215780639092c31c146107415780639136616a1461077557806396d538bb1461079557600080fd5b80635c975abb1161024f57806367c7066c1161020857806371a735f3116101e257806371a735f31461067c5780637b2d9b2c1461069c578063842f5c46146106bc5780638456cb59146106d257600080fd5b806367c7066c1461061c5780636e811d381461063c5780636ef387951461065c57600080fd5b80635c975abb146105635780635d36b190146105875780635f5152261461059c5780636093d380146105bc57806363092383146105f057806366e3667e1461060657600080fd5b8063430bf08a116102a1578063430bf08a14610490578063435356d1146104c457806347e7ef24146104e4578063484be81214610504578063579a7e1a1461051a5780635a063f631461054e57600080fd5b80630c340a24146103a45780630ed57b3a146103d65780630fc3b4c4146103f65780631072cbea1461042c57806322495dc81461044c5780633c8649591461046c57600080fd5b3661039f57336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061034c5750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b61039d5760405162461bcd60e51b815260206004820152601e60248201527f657468206e6f742066726f6d20616c6c6f77656420636f6e747261637473000060448201526064015b60405180910390fd5b005b600080fd5b3480156103b057600080fd5b506103b9610a8f565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156103e257600080fd5b5061039d6103f1366004613e46565b610aac565b34801561040257600080fd5b506103b9610411366004613e0c565b609f602052600090815260409020546001600160a01b031681565b34801561043857600080fd5b5061039d610447366004613ec0565b610ade565b34801561045857600080fd5b5061039d610467366004613fb4565b610b9b565b34801561047857600080fd5b5061048260695481565b6040519081526020016103cd565b34801561049c57600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b3480156104d057600080fd5b5061039d6104df366004613f2d565b610ce5565b3480156104f057600080fd5b5061039d6104ff366004613ec0565b610dca565b34801561051057600080fd5b50610482606a5481565b34801561052657600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b34801561055a57600080fd5b5061039d610ee9565b34801561056f57600080fd5b5060335460ff165b60405190151581526020016103cd565b34801561059357600080fd5b5061039d610f88565b3480156105a857600080fd5b506104826105b7366004613e0c565b61102e565b3480156105c857600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b3480156105fc57600080fd5b50610482611c2081565b34801561061257600080fd5b5061048260345481565b34801561062857600080fd5b5060a3546103b9906001600160a01b031681565b34801561064857600080fd5b5061039d610657366004613e0c565b611162565b34801561066857600080fd5b5061039d610677366004613eec565b6111ea565b34801561068857600080fd5b5061039d6106973660046141c2565b611685565b3480156106a857600080fd5b506103b96106b736600461408a565b61187e565b3480156106c857600080fd5b5061048260685481565b3480156106de57600080fd5b5061039d6118a8565b3480156106f357600080fd5b5061039d611971565b34801561070857600080fd5b506033546103b99061010090046001600160a01b031681565b34801561072d57600080fd5b5061039d61073c366004614243565b611b43565b34801561074d57600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b34801561078157600080fd5b5061039d61079036600461408a565b612018565b3480156107a157600080fd5b5061039d6107b0366004613eec565b6121e3565b3480156107c157600080fd5b506107e56107d036600461408a565b60356020526000908152604090205460ff1681565b6040516103cd91906146ae565b3480156107fe57600080fd5b50610577612303565b34801561081357600080fd5b50610577610822366004613e0c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b34801561086057600080fd5b5061039d61086f366004614288565b612362565b34801561088057600080fd5b5061039d61245e565b34801561089557600080fd5b5061039d6108a436600461410e565b612524565b3480156108b557600080fd5b5061039d6108c4366004613e0c565b612697565b3480156108d557600080fd5b50610577612724565b3480156108ea57600080fd5b506104826801bc16d674ec80000081565b34801561090757600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b34801561093b57600080fd5b506104826101075481565b34801561095257600080fd5b5061039d610961366004613e0c565b612755565b34801561097257600080fd5b5061039d610981366004613e7f565b6127f9565b34801561099257600080fd5b5061039d6109a13660046140a3565b61288c565b3480156109b257600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b3480156109e657600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b348015610a1a57600080fd5b5061039d612a81565b348015610a2f57600080fd5b50610482606b5481565b348015610a4557600080fd5b506103b97f000000000000000000000000000000000000000000000000000000000000000081565b348015610a7957600080fd5b50610a82612bee565b6040516103cd9190614484565b6000610aa7600080516020614a4e8339815191525490565b905090565b610ab4612724565b610ad05760405162461bcd60e51b815260040161039490614720565b610ada8282612c50565b5050565b610ae6612724565b610b025760405162461bcd60e51b815260040161039490614720565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169083161415610b7f5760405162461bcd60e51b815260206004820152601f60248201527f43616e6e6f74207472616e7366657220737570706f72746564206173736574006044820152606401610394565b610ada610b8a610a8f565b6001600160a01b0384169083612daf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610bf457600080fd5b505afa158015610c08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2c9190613e29565b6001600160a01b0316336001600160a01b031614610c5c5760405162461bcd60e51b8152600401610394906147e0565b60405163bc26e7e560e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063bc26e7e590610cae9030908790879087906004016143d4565b600060405180830381600087803b158015610cc857600080fd5b505af1158015610cdc573d6000803e3d6000fd5b50505050505050565b610ced612724565b610d095760405162461bcd60e51b815260040161039490614720565b600054610100900460ff1680610d22575060005460ff16155b610d855760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610394565b600054610100900460ff16158015610da7576000805461ffff19166101011790555b610db2848484612e01565b8015610dc4576000805461ff00191690555b50505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e125760405162461bcd60e51b8152600401610394906146e9565b600080516020614a2e83398151915280546002811415610e445760405162461bcd60e51b8152600401610394906147b8565b600282557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b031614610ebd5760405162461bcd60e51b8152602060048201526011602482015270155b9cdd5c1c1bdc9d195908185cdcd95d607a1b6044820152606401610394565b826101076000828254610ed09190614907565b90915550610ee090508484612ebc565b50600190555050565b60a3546001600160a01b03163314610f435760405162461bcd60e51b815260206004820152601b60248201527f43616c6c6572206973206e6f74207468652048617276657374657200000000006044820152606401610394565b600080516020614a2e83398151915280546002811415610f755760405162461bcd60e51b8152600401610394906147b8565b60028255610f81612f4e565b5060019055565b7f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db546001600160a01b0316336001600160a01b0316146110235760405162461bcd60e51b815260206004820152603060248201527f4f6e6c79207468652070656e64696e6720476f7665726e6f722063616e20636f60448201526f6d706c6574652074686520636c61696d60801b6064820152608401610394565b61102c3361319c565b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316146110a55760405162461bcd60e51b8152602060048201526011602482015270155b9cdd5c1c1bdc9d195908185cdcd95d607a1b6044820152606401610394565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b15801561110457600080fd5b505afa158015611118573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113c919061426f565b603454611152906801bc16d674ec80000061491f565b61115c9190614907565b92915050565b61116a612724565b6111865760405162461bcd60e51b815260040161039490614720565b6040516001600160a01b03821681527f83f29c79feb71f8fba9d0fbc4ba5f0982a28b6b1e868b3fc50e6400d100bca0f9060200160405180910390a1603380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60335461010090046001600160a01b031633146112195760405162461bcd60e51b815260040161039490614781565b60335460ff161561123c5760405162461bcd60e51b815260040161039490614757565b6000611251826801bc16d674ec80000061491f565b6040516370a0823160e01b81523060048201529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b1580156112b357600080fd5b505afa1580156112c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112eb919061426f565b81111561132e5760405162461bcd60e51b81526020600482015260116024820152700d2dce6eaccccd2c6d2cadce840ae8aa89607b1b6044820152606401610394565b604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561139057600080fd5b505af11580156113a4573d6000803e3d6000fd5b505050506113b18161325d565b8160005b818110156116675760008585838181106113d1576113d16149de565b90506020028101906113e3919061485d565b6113ed9080614817565b6040516113fb9291906143a8565b6040805191829003909120600081815260356020529182205490925060ff169081600381111561142d5761142d6149b2565b1461147a5760405162461bcd60e51b815260206004820152601860248201527f56616c696461746f72206e6f74207265676973746572656400000000000000006044820152606401610394565b60408051600160f81b60208201526000602182018190526bffffffffffffffffffffffff193060601b16602c830152910160405160208183030381529060405290507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663228951186801bc16d674ec8000008a8a88818110611507576115076149de565b9050602002810190611519919061485d565b6115239080614817565b858d8d8b818110611536576115366149de565b9050602002810190611548919061485d565b611556906020810190614817565b8f8f8d818110611568576115686149de565b905060200281019061157a919061485d565b604001356040518863ffffffff1660e01b815260040161159f96959493929190614633565b6000604051808303818588803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050507ffeb31a79d38edb1b090d516e4df3e273651179c6f2c2ec53a9a22ae015b70ba9888886818110611604576116046149de565b9050602002810190611616919061485d565b6116209080614817565b6801bc16d674ec8000008460405161163b9493929190614682565b60405180910390a150506000908152603560205260409020805460ff19166001908117909155016113b5565b50806034600082825461167a9190614907565b909155505050505050565b60335461010090046001600160a01b031633146116b45760405162461bcd60e51b815260040161039490614781565b60335460ff16156116d75760405162461bcd60e51b815260040161039490614757565b60006035600087876040516116ed9291906143a8565b604080519182900390912082526020820192909252016000205460ff1690506002816003811115611720576117206149b2565b146117655760405162461bcd60e51b815260206004820152601560248201527456616c696461746f72206e6f742065786974696e6760581b6044820152606401610394565b6040516312b3fc1960e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906312b3fc19906117b990899089908990899089906004016145f2565b600060405180830381600087803b1580156117d357600080fd5b505af11580156117e7573d6000803e3d6000fd5b505050507ff72821b8777f002ccdf6326f1242d9e0f762eb077668b67bebe640535378066d868686866040516118209493929190614569565b60405180910390a1600360356000888860405161183e9291906143a8565b60408051918290039091208252602082019290925201600020805460ff19166001836003811115611871576118716149b2565b0217905550505050505050565b60a4818154811061188e57600080fd5b6000918252602090912001546001600160a01b0316905081565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561190157600080fd5b505afa158015611915573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119399190613e29565b6001600160a01b0316336001600160a01b0316146119695760405162461bcd60e51b8152600401610394906147e0565b61102c61328a565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806119c057506119ab610a8f565b6001600160a01b0316336001600160a01b0316145b611a185760405162461bcd60e51b815260206004820152602360248201527f43616c6c6572206973206e6f7420746865205661756c74206f7220476f7665726044820152623737b960e91b6064820152608401610394565b600080516020614a2e83398151915280546002811415611a4a5760405162461bcd60e51b8152600401610394906147b8565b600282556040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015611ab057600080fd5b505afa158015611ac4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ae8919061426f565b90508015611b3b57611b3b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000836132ff565b505060019055565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611b9c57600080fd5b505afa158015611bb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bd49190613e29565b6001600160a01b0316336001600160a01b031614611c045760405162461bcd60e51b8152600401610394906147e0565b60335460ff16611c4d5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610394565b43611c20606b54611c5e9190614907565b10611cb95760405162461bcd60e51b815260206004820152602560248201527f6d616e75616c6c794669784163636f756e74696e672063616c6c656420746f6f6044820152641039b7b7b760d91b6064820152608401610394565b6002198312158015611ccc575060038313155b8015611ce65750600083603454611ce391906148c6565b12155b611d325760405162461bcd60e51b815260206004820152601760248201527f696e76616c69642076616c696461746f727344656c74610000000000000000006044820152606401610394565b6811ff6cf0fd15afffff198212158015611d5557506811ff6cf0fd15b000008213155b8015611d6f5750600082606854611d6c91906148c6565b12155b611dbb5760405162461bcd60e51b815260206004820152601d60248201527f696e76616c696420636f6e73656e7375735265776172647344656c74610000006044820152606401610394565b68053444835ec5800000811115611e145760405162461bcd60e51b815260206004820152601960248201527f696e76616c69642077657468546f5661756c74416d6f756e74000000000000006044820152606401610394565b60408051848152602081018490529081018290527f80d022717ea022455c5886b8dd8a29c037570aae58aeb4d7b136d7a10ec2e4319060600160405180910390a182603454611e6391906148c6565b603455606854611e749083906148c6565b60685543606b558015611fc2577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015611edc57600080fd5b505af1158015611ef0573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b158015611f8057600080fd5b505af1158015611f94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb8919061406d565b50611fc2816133f7565b611fcc600061345f565b61200b5760405162461bcd60e51b815260206004820152601060248201526f333ab9b29039ba34b63610313637bbb760811b6044820152606401610394565b6120136138de565b505050565b612020612724565b61203c5760405162461bcd60e51b815260040161039490614720565b60a054811061207d5760405162461bcd60e51b815260206004820152600d60248201526c092dcecc2d8d2c840d2dcc8caf609b1b6044820152606401610394565b600060a08281548110612092576120926149de565b60009182526020808320909101546001600160a01b03908116808452609f90925260409092205460a054919350909116906120cf9060019061493e565b8310156121515760a080546120e69060019061493e565b815481106120f6576120f66149de565b60009182526020909120015460a080546001600160a01b039092169185908110612122576121226149de565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b60a0805480612162576121626149c8565b60008281526020808220600019908401810180546001600160a01b031990811690915593019093556001600160a01b03858116808352609f855260409283902080549094169093559051908416815290917f16b7600acff27e39a8a96056b3d533045298de927507f5c1d97e4accde60488c910160405180910390a2505050565b6121eb612724565b6122075760405162461bcd60e51b815260040161039490614720565b8060005b818110156122ba576000848483818110612227576122276149de565b905060200201602081019061223c9190613e0c565b6001600160a01b031614156122aa5760405162461bcd60e51b815260206004820152602e60248201527f43616e206e6f742073657420616e20656d70747920616464726573732061732060448201526d30903932bbb0b932103a37b5b2b760911b6064820152608401610394565b6122b381614981565b905061220b565b507f04c0b9649497d316554306e53678d5f5f5dbc3a06f97dec13ff4cfe98b986bbc60a484846040516122ef939291906144d1565b60405180910390a1610dc460a48484613b65565b60335460009061010090046001600160a01b031633146123355760405162461bcd60e51b815260040161039490614781565b60335460ff16156123585760405162461bcd60e51b815260040161039490614757565b610aa7600161345f565b61236a612724565b6123865760405162461bcd60e51b815260040161039490614720565b808210801561239d57506801bc16d674ec80000082105b80156123b157506801bc16d674ec80000081105b80156123ce5750673782dace9d9000006123cb838361493e565b10155b61241a5760405162461bcd60e51b815260206004820152601760248201527f696e636f7272656374206675736520696e74657276616c0000000000000000006044820152606401610394565b60408051838152602081018390527fcb8d24e46eb3c402bf344ee60a6576cba9ef2f59ea1af3b311520704924e901a910160405180910390a1606991909155606a55565b60405163095ea7b360e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260001960248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b390604401602060405180830381600087803b1580156124e957600080fd5b505af11580156124fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612521919061406d565b50565b60335461010090046001600160a01b031633146125535760405162461bcd60e51b815260040161039490614781565b60335460ff16156125765760405162461bcd60e51b815260040161039490614757565b6040516301ba3ee760e21b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906306e8fb9c906125d0908b908b908b908b908b908b908b908b90600401614590565b600060405180830381600087803b1580156125ea57600080fd5b505af11580156125fe573d6000803e3d6000fd5b505050506000603560008a8a6040516126189291906143a8565b60408051918290039091208252602082019290925201600020805460ff1916600183600381111561264b5761264b6149b2565b02179055507f75c4a66b2c6c28cf46db7131182a812e4fbbb2f0591377aa83a737909a9b68c3888888886040516126859493929190614569565b60405180910390a15050505050505050565b61269f612724565b6126bb5760405162461bcd60e51b815260040161039490614720565b60a354604080516001600160a01b03928316815291831660208301527fe48386b84419f4d36e0f96c10cc3510b6fb1a33795620c5098b22472bbe90796910160405180910390a160a380546001600160a01b0319166001600160a01b0392909216919091179055565b600061273c600080516020614a4e8339815191525490565b6001600160a01b0316336001600160a01b031614905090565b61275d612724565b6127795760405162461bcd60e51b815260040161039490614720565b6127a1817f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db55565b806001600160a01b03166127c1600080516020614a4e8339815191525490565b6001600160a01b03167fa39cc5eb22d0f34d8beaefee8a3f17cc229c1a1d1ef87a5ad47313487b1c4f0d60405160405180910390a350565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146128415760405162461bcd60e51b8152600401610394906146e9565b600080516020614a2e833981519152805460028114156128735760405162461bcd60e51b8152600401610394906147b8565b600282556128828585856132ff565b5060019055505050565b60335461010090046001600160a01b031633146128bb5760405162461bcd60e51b815260040161039490614781565b60335460ff16156128de5760405162461bcd60e51b815260040161039490614757565b60006035600086866040516128f49291906143a8565b604080519182900390912082526020820192909252016000205460ff1690506001816003811115612927576129276149b2565b1461296b5760405162461bcd60e51b815260206004820152601460248201527315985b1a59185d1bdc881b9bdd081cdd185ad95960621b6044820152606401610394565b604051633877322b60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690633877322b906129bd908890889088908890600401614569565b600060405180830381600087803b1580156129d757600080fd5b505af11580156129eb573d6000803e3d6000fd5b505050507ff8821da16f5ed966b41e0343c3eff9903af782d74f99f1689dd9d4562b6545b385858585604051612a249493929190614569565b60405180910390a16002603560008787604051612a429291906143a8565b60408051918290039091208252602082019290925201600020805460ff19166001836003811115612a7557612a756149b2565b02179055505050505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612ac95760405162461bcd60e51b8152600401610394906146e9565b600080516020614a2e83398151915280546002811415612afb5760405162461bcd60e51b8152600401610394906147b8565b600282556040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015612b6157600080fd5b505afa158015612b75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b99919061426f565b905060006101075482612bac919061493e565b90508015612be457610107829055612be47f000000000000000000000000000000000000000000000000000000000000000082612ebc565b5050600182555050565b606060a4805480602002602001604051908101604052809291908181526020018280548015612c4657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612c28575b5050505050905090565b6001600160a01b038281166000908152609f60205260409020541615612cad5760405162461bcd60e51b81526020600482015260126024820152711c151bdad95b88185b1c9958591e481cd95d60721b6044820152606401610394565b6001600160a01b03821615801590612ccd57506001600160a01b03811615155b612d0d5760405162461bcd60e51b8152602060048201526011602482015270496e76616c69642061646472657373657360781b6044820152606401610394565b6001600160a01b038281166000818152609f6020908152604080832080549587166001600160a01b0319968716811790915560a0805460018101825594527f78fdc8d422c49ced035a9edf18d00d3c6a8d81df210f3e5e448e045e77b41e8890930180549095168417909455925190815290917fef6485b84315f9b1483beffa32aae9a0596890395e3d7521f1c5fbb51790e765910160405180910390a25050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612013908490613958565b8251612e149060a4906020860190613bc8565b50815181518114612e5e5760405162461bcd60e51b8152602060048201526014602482015273496e76616c696420696e7075742061727261797360601b6044820152606401610394565b60005b81811015612eb557612ea5848281518110612e7e57612e7e6149de565b6020026020010151848381518110612e9857612e986149de565b6020026020010151612c50565b612eae81614981565b9050612e61565b5050505050565b60008111612f055760405162461bcd60e51b81526020600482015260166024820152754d757374206465706f73697420736f6d657468696e6760501b6044820152606401610394565b6040805160008152602081018390526001600160a01b038416917f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62910160405180910390a25050565b60335460ff1615612f715760405162461bcd60e51b815260040161039490614757565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e52253816040518163ffffffff1660e01b8152600401602060405180830381600087803b158015612fce57600080fd5b505af1158015612fe2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613006919061426f565b90506000606854826130189190614907565b90508047101561306a5760405162461bcd60e51b815260206004820152601860248201527f696e73756666696369656e74206574682062616c616e636500000000000000006044820152606401610394565b8015610ada5760006068819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156130d357600080fd5b505af11580156130e7573d6000803e3d6000fd5b505060a354604080516001600160a01b0392831681527f0000000000000000000000000000000000000000000000000000000000000000909216602083015281018590527ff6c07a063ed4e63808eb8da7112d46dbcd38de2b40a73dbcc9353c5a94c723539350606001915061315a9050565b60405180910390a160a354610ada906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911683612daf565b6001600160a01b0381166131f25760405162461bcd60e51b815260206004820152601a60248201527f4e657720476f7665726e6f7220697320616464726573732830290000000000006044820152606401610394565b806001600160a01b0316613212600080516020614a4e8339815191525490565b6001600160a01b03167fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a60405160405180910390a361252181600080516020614a4e83398151915255565b600061326c8261010754613a2a565b9050806101076000828254613281919061493e565b90915550505050565b60335460ff16156132ad5760405162461bcd60e51b815260040161039490614757565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586132e23390565b6040516001600160a01b03909116815260200160405180910390a1565b6000811161334f5760405162461bcd60e51b815260206004820152601760248201527f4d75737420776974686472617720736f6d657468696e670000000000000000006044820152606401610394565b6001600160a01b03831661339e5760405162461bcd60e51b8152602060048201526016602482015275135d5cdd081cdc1958da599e481c9958da5c1a595b9d60521b6044820152606401610394565b6040805160008152602081018390526001600160a01b038416917f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b6398910160405180910390a26120136001600160a01b0383168483612daf565b6040805160008152602081018390526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016917f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b6398910160405180910390a250565b60006068544710156134745761115c82613a42565b600060685447613484919061493e565b9050600191506801bc16d674ec80000081106136615760006801bc16d674ec8000008204905080603460008282546134bc919061493e565b90915550600090506134d7826801bc16d674ec80000061491f565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561353457600080fd5b505af1158015613548573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b1580156135d857600080fd5b505af11580156135ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613610919061406d565b5061361a816133f7565b60345460408051848152602081019290925281018290527fbe7040030ff7b347853214bf49820c6d455fedf58f3815f85c7bc5216993682b9060600160405180910390a150505b600060685447613671919061493e565b90506801bc16d674ec80000081106136c35760405162461bcd60e51b8152602060048201526015602482015274756e6578706563746564206163636f756e74696e6760581b6044820152606401610394565b806136cf575050919050565b6069548110156137295780606860008282546136eb9190614907565b90915550506040518181527f7a745a2c63a535068f52ceca27debd5297bbad5f7f37ec53d044a59d0362445d906020015b60405180910390a16138d7565b606a548111156138c6577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561378e57600080fd5b505af11580156137a2573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b15801561383257600080fd5b505af1158015613846573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061386a919061406d565b5060016034600082825461387e919061493e565b9091555061388d9050816133f7565b60345460408051918252602082018390527f6aa7e30787b26429ced603a7aba8b19c4b5d5bcf29a3257da953c8d53bcaa3a6910161371c565b6138cf84613a42565b949350505050565b5050919050565b60335460ff166139275760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610394565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336132e2565b60006139ad826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613a5a9092919063ffffffff16565b80519091501561201357808060200190518101906139cb919061406d565b6120135760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610394565b6000818310613a395781613a3b565b825b9392505050565b60008115613a5257613a5261328a565b506000919050565b60606138cf848460008585843b613ab35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610394565b600080866001600160a01b03168587604051613acf91906143b8565b60006040518083038185875af1925050503d8060008114613b0c576040519150601f19603f3d011682016040523d82523d6000602084013e613b11565b606091505b5091509150613b21828286613b2c565b979650505050505050565b60608315613b3b575081613a3b565b825115613b4b5782518084602001fd5b8160405162461bcd60e51b815260040161039491906146d6565b828054828255906000526020600020908101928215613bb8579160200282015b82811115613bb85781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190613b85565b50613bc4929150613c1d565b5090565b828054828255906000526020600020908101928215613bb8579160200282015b82811115613bb857825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613be8565b5b80821115613bc45760008155600101613c1e565b60008083601f840112613c4457600080fd5b5081356001600160401b03811115613c5b57600080fd5b6020830191508360208260051b8501011115613c7657600080fd5b9250929050565b600082601f830112613c8e57600080fd5b81356020613ca3613c9e836148a3565b614873565b80838252828201915082860187848660051b8901011115613cc357600080fd5b60005b85811015613ceb578135613cd981614a0a565b84529284019290840190600101613cc6565b5090979650505050505050565b60008083601f840112613d0a57600080fd5b5081356001600160401b03811115613d2157600080fd5b602083019150836020828501011115613c7657600080fd5b600060a08284031215613d4b57600080fd5b50919050565b600060a08284031215613d6357600080fd5b60405160a081018181106001600160401b0382111715613d8557613d856149f4565b604052905080613d9483613ddc565b8152613da260208401613df5565b6020820152613db360408401613df5565b60408201526060830135613dc681614a1f565b6060820152608092830135920191909152919050565b803563ffffffff81168114613df057600080fd5b919050565b80356001600160401b0381168114613df057600080fd5b600060208284031215613e1e57600080fd5b8135613a3b81614a0a565b600060208284031215613e3b57600080fd5b8151613a3b81614a0a565b60008060408385031215613e5957600080fd5b8235613e6481614a0a565b91506020830135613e7481614a0a565b809150509250929050565b600080600060608486031215613e9457600080fd5b8335613e9f81614a0a565b92506020840135613eaf81614a0a565b929592945050506040919091013590565b60008060408385031215613ed357600080fd5b8235613ede81614a0a565b946020939093013593505050565b60008060208385031215613eff57600080fd5b82356001600160401b03811115613f1557600080fd5b613f2185828601613c32565b90969095509350505050565b600080600060608486031215613f4257600080fd5b83356001600160401b0380821115613f5957600080fd5b613f6587838801613c7d565b94506020860135915080821115613f7b57600080fd5b613f8787838801613c7d565b93506040860135915080821115613f9d57600080fd5b50613faa86828701613c7d565b9150509250925092565b600080600060e08486031215613fc957600080fd5b83356001600160401b03811115613fdf57600080fd5b8401601f81018613613ff057600080fd5b80356020614000613c9e836148a3565b8083825282820191508285018a848660051b880101111561402057600080fd5b600095505b8486101561404a5761403681613df5565b835260019590950194918301918301614025565b509650508601359350614064915086905060408601613d51565b90509250925092565b60006020828403121561407f57600080fd5b8151613a3b81614a1f565b60006020828403121561409c57600080fd5b5035919050565b600080600080604085870312156140b957600080fd5b84356001600160401b03808211156140d057600080fd5b6140dc88838901613cf8565b909650945060208701359150808211156140f557600080fd5b5061410287828801613c32565b95989497509550505050565b600080600080600080600080610120898b03121561412b57600080fd5b88356001600160401b038082111561414257600080fd5b61414e8c838d01613cf8565b909a50985060208b013591508082111561416757600080fd5b6141738c838d01613c32565b909850965060408b013591508082111561418c57600080fd5b506141998b828c01613cf8565b909550935050606089013591506141b38a60808b01613d39565b90509295985092959890939650565b600080600080600060e086880312156141da57600080fd5b85356001600160401b03808211156141f157600080fd5b6141fd89838a01613cf8565b9097509550602088013591508082111561421657600080fd5b5061422388828901613c32565b909450925061423790508760408801613d39565b90509295509295909350565b60008060006060848603121561425857600080fd5b505081359360208301359350604090920135919050565b60006020828403121561428157600080fd5b5051919050565b6000806040838503121561429b57600080fd5b50508035926020909101359150565b8183526000602080850194508260005b858110156142e6576001600160401b036142d383613df5565b16875295820195908201906001016142ba565b509495945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008151808452614332816020860160208601614955565b601f01601f19169290920160200192915050565b63ffffffff61435482613ddc565b16825261436360208201613df5565b6001600160401b0380821660208501528061438060408501613df5565b1660408501525050606081013561439681614a1f565b15156060830152608090810135910152565b8183823760009101908152919050565b600082516143ca818460208701614955565b9190910192915050565b6001600160a01b03851681526101006020808301829052855191830182905260009161012084019187810191845b818110156144275783516001600160401b031685529382019392820192600101614402565b505082935086604086015263ffffffff865116606086015280860151925050506001600160401b0380821660808501528060408601511660a085015250506060830151151560c0830152608083015160e083015295945050505050565b6020808252825182820181905260009190848201906040850190845b818110156144c55783516001600160a01b0316835292840192918401916001016144a0565b50909695505050505050565b6000604082016040835280865480835260608501915087600052602092508260002060005b8281101561451b5781546001600160a01b0316845292840192600191820191016144f6565b505050838103828501528481528590820160005b8681101561455d57823561454281614a0a565b6001600160a01b03168252918301919083019060010161452f565b50979650505050505050565b60408152600061457d6040830186886142f1565b8281036020840152613b218185876142aa565b60006101208083526145a58184018b8d6142f1565b905082810360208401526145ba81898b6142aa565b905082810360408401526145cf8187896142f1565b9150508360608301526145e56080830184614346565b9998505050505050505050565b60e08152600061460660e0830187896142f1565b82810360208401526146198186886142aa565b9150506146296040830184614346565b9695505050505050565b60808152600061464760808301888a6142f1565b8281036020840152614659818861431a565b9050828103604084015261466e8186886142f1565b915050826060830152979650505050505050565b6060815260006146966060830186886142f1565b8460208401528281036040840152613b21818561431a565b60208101600483106146d057634e487b7160e01b600052602160045260246000fd5b91905290565b602081526000613a3b602083018461431a565b60208082526017908201527f43616c6c6572206973206e6f7420746865205661756c74000000000000000000604082015260600190565b6020808252601a908201527f43616c6c6572206973206e6f742074686520476f7665726e6f72000000000000604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601d908201527f43616c6c6572206973206e6f7420746865205265676973747261746f72000000604082015260600190565b6020808252600e908201526d1499595b9d1c985b9d0818d85b1b60921b604082015260600190565b6020808252601c908201527f43616c6c6572206973206e6f7420746865205374726174656769737400000000604082015260600190565b6000808335601e1984360301811261482e57600080fd5b8301803591506001600160401b0382111561484857600080fd5b602001915036819003821315613c7657600080fd5b60008235605e198336030181126143ca57600080fd5b604051601f8201601f191681016001600160401b038111828210171561489b5761489b6149f4565b604052919050565b60006001600160401b038211156148bc576148bc6149f4565b5060051b60200190565b600080821280156001600160ff1b03849003851316156148e8576148e861499c565b600160ff1b83900384128116156149015761490161499c565b50500190565b6000821982111561491a5761491a61499c565b500190565b60008160001904831182151516156149395761493961499c565b500290565b6000828210156149505761495061499c565b500390565b60005b83811015614970578181015183820152602001614958565b83811115610dc45750506000910152565b60006000198214156149955761499561499c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461252157600080fd5b801515811461252157600080fdfe53bf423e48ed90e97d02ab0ebab13b2a235a6bfbe9c321847d5c175333ac45357bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4aa2646970667358221220e7e50cde0c8998aadaf7928bf094efc09a4ab9f91b5a4d0db51e66b9307dc59264736f6c63430008070033", + "numDeployments": 5, + "solcInputHash": "a7af3565925bcd06d3e7b2ed59f01c90", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"platformAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaultAddress\",\"type\":\"address\"}],\"internalType\":\"struct InitializableAbstractStrategy.BaseStrategyConfig\",\"name\":\"_baseConfig\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"_wethAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ssvToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ssvNetwork\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_feeAccumulator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beaconChainDepositContract\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AccountingConsensusRewards\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"noOfValidators\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remainingValidators\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wethSentToVault\",\"type\":\"uint256\"}],\"name\":\"AccountingFullyWithdrawnValidator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"validatorsDelta\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"consensusRewardsDelta\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wethToVault\",\"type\":\"uint256\"}],\"name\":\"AccountingManuallyFixed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remainingValidators\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wethSentToVault\",\"type\":\"uint256\"}],\"name\":\"AccountingValidatorSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_pToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"pubkey\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"withdrawal_credentials\",\"type\":\"bytes\"}],\"name\":\"ETHStaked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"name\":\"FuseIntervalUpdated\",\"type\":\"event\"},{\"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\":false,\"internalType\":\"address\",\"name\":\"_oldHarvesterAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_newHarvesterAddress\",\"type\":\"address\"}],\"name\":\"HarvesterAddressesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_pToken\",\"type\":\"address\"}],\"name\":\"PTokenAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_pToken\",\"type\":\"address\"}],\"name\":\"PTokenRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"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\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"RegistratorChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"_oldAddresses\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"_newAddresses\",\"type\":\"address[]\"}],\"name\":\"RewardTokenAddressesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"rewardToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"RewardTokenCollected\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"pubkey\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"}],\"name\":\"SSVValidatorExitCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"pubkey\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"}],\"name\":\"SSVValidatorExitInitiated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"pubkey\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"}],\"name\":\"SSVValidatorRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"StakeETHTallyReset\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"StakeETHThresholdChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"StakingMonitorChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_pToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BEACON_CHAIN_DEPOSIT_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FEE_ACCUMULATOR_ADDRESS\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_STAKE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_FIX_ACCOUNTING_CADENCE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SSV_NETWORK_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SSV_TOKEN_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VAULT_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WETH_TOKEN_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"activeDepositedValidators\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"assetToPToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"}],\"name\":\"checkBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimGovernance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"collectRewardTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"consensusRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"validatorCount\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"networkFeeIndex\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"index\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"internalType\":\"struct Cluster\",\"name\":\"cluster\",\"type\":\"tuple\"}],\"name\":\"depositSSV\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositedWethAccountedFor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"doAccounting\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"accountingValid\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"publicKey\",\"type\":\"bytes\"},{\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"}],\"name\":\"exitSsvValidator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fuseIntervalEnd\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fuseIntervalStart\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRewardTokenAddresses\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"harvesterAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_rewardTokenAddresses\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_assets\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_pTokens\",\"type\":\"address[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isGovernor\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastFixAccountingBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"_validatorsDelta\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"_consensusRewardsDelta\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"_ethToVaultAmount\",\"type\":\"uint256\"}],\"name\":\"manuallyFixAccounting\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"platformAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"publicKey\",\"type\":\"bytes\"},{\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"},{\"internalType\":\"bytes\",\"name\":\"sharesData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"validatorCount\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"networkFeeIndex\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"index\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"internalType\":\"struct Cluster\",\"name\":\"cluster\",\"type\":\"tuple\"}],\"name\":\"registerSsvValidator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_assetIndex\",\"type\":\"uint256\"}],\"name\":\"removePToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"publicKey\",\"type\":\"bytes\"},{\"internalType\":\"uint64[]\",\"name\":\"operatorIds\",\"type\":\"uint64[]\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"validatorCount\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"networkFeeIndex\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"index\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"internalType\":\"struct Cluster\",\"name\":\"cluster\",\"type\":\"tuple\"}],\"name\":\"removeSsvValidator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resetStakeETHTally\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"rewardTokenAddresses\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"safeApproveAllTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_fuseIntervalStart\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fuseIntervalEnd\",\"type\":\"uint256\"}],\"name\":\"setFuseInterval\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_harvesterAddress\",\"type\":\"address\"}],\"name\":\"setHarvesterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_pToken\",\"type\":\"address\"}],\"name\":\"setPTokenAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"setRegistrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_rewardTokenAddresses\",\"type\":\"address[]\"}],\"name\":\"setRewardTokenAddresses\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"setStakeETHThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"setStakingMonitor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stakeETHTally\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stakeETHThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"pubkey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"depositDataRoot\",\"type\":\"bytes32\"}],\"internalType\":\"struct ValidatorStakeData[]\",\"name\":\"validators\",\"type\":\"tuple[]\"}],\"name\":\"stakeEth\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stakingMonitor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"}],\"name\":\"supportsAsset\",\"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\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transferToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"validatorRegistrator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"validatorsStates\",\"outputs\":[{\"internalType\":\"enum ValidatorRegistrator.VALIDATOR_STATE\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vaultAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Origin Protocol Inc\",\"details\":\"This contract handles WETH and ETH and in some operations interchanges between the two. Any WETH that is on the contract across multiple blocks (and not just transitory within a transaction) is considered an asset. Meaning deposits increase the balance of the asset and withdrawal decrease it. As opposed to all our other strategies the WETH doesn't immediately get deposited into an underlying strategy and can be present across multiple blocks waiting to be unwrapped to ETH and staked to validators. This separation of WETH and ETH is required since the rewards (reward token) is also in ETH. To simplify the accounting of WETH there is another difference in behavior compared to the other strategies. To withdraw WETH asset - exit message is posted to validators and the ETH hits this contract with multiple days delay. In order to simplify the WETH accounting upon detection of such an event the ValidatorAccountant immediately wraps ETH to WETH and sends it to the Vault. On the other hand any ETH on the contract (across multiple blocks) is there either: - as a result of already accounted for consensus rewards - as a result of not yet accounted for consensus rewards - as a results of not yet accounted for full validator withdrawals (or validator slashes) Even though the strategy assets and rewards are a very similar asset the consensus layer rewards and the execution layer rewards are considered rewards and those are dripped to the Vault over a configurable time interval and not immediately.\",\"kind\":\"dev\",\"methods\":{\"checkBalance(address)\":{\"params\":{\"_asset\":\"Address of weth asset\"},\"returns\":{\"balance\":\" Total value of (W)ETH\"}},\"constructor\":{\"params\":{\"_baseConfig\":\"Base strategy config with platformAddress (ERC-4626 Vault contract), eg sfrxETH or sDAI, and vaultAddress (OToken Vault contract), eg VaultProxy or OETHVaultProxy\",\"_beaconChainDepositContract\":\"Address of the beacon chain deposit contract\",\"_feeAccumulator\":\"Address of the fee accumulator receiving execution layer validator rewards\",\"_ssvNetwork\":\"Address of the SSV Network contract\",\"_ssvToken\":\"Address of the Erc20 SSV Token contract\",\"_wethAddress\":\"Address of the Erc20 WETH Token contract\"}},\"deposit(address,uint256)\":{\"params\":{\"_amount\":\"Amount of assets that were transferred to the strategy by the vault.\",\"_asset\":\"Address of asset to deposit. Has to be WETH.\"}},\"depositSSV(uint64[],uint256,(uint32,uint64,uint64,bool,uint256))\":{\"details\":\"A SSV cluster is defined by the SSVOwnerAddress and the set of operatorIds. uses \\\"onlyStrategist\\\" modifier so continuous front-running can't DOS our maintenance service that tries to top up SSV tokens.\",\"params\":{\"cluster\":\"The SSV cluster details that must be derived from emitted events from the SSVNetwork contract.\"}},\"doAccounting()\":{\"details\":\"This function could in theory be permission-less but lets allow only the Registrator (Defender Action) to call it for now.\",\"returns\":{\"accountingValid\":\"true if accounting was successful, false if fuse is blown\"}},\"getRewardTokenAddresses()\":{\"returns\":{\"_0\":\"address[] the reward token addresses.\"}},\"initialize(address[],address[],address[])\":{\"params\":{\"_assets\":\"Addresses of initial supported assets\",\"_pTokens\":\"Platform Token corresponding addresses\",\"_rewardTokenAddresses\":\"Address of reward token for platform\"}},\"manuallyFixAccounting(int256,int256,uint256)\":{\"details\":\"There is a case when a validator(s) gets slashed so much that the eth swept from the beacon chain enters the fuse area and there are no consensus rewards on the contract to \\\"dip into\\\"/use. To increase the amount of unaccounted ETH over the fuse end interval we need to reduce the amount of active deposited validators and immediately send WETH to the vault, so it doesn't interfere with further accounting.\",\"params\":{\"_consensusRewardsDelta\":\"adjust the accounted for consensus rewards up or down\",\"_ethToVaultAmount\":\"the amount of ETH that gets wrapped into WETH and sent to the Vault\",\"_validatorsDelta\":\"adjust the active validators by up to plus three or minus three\"}},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"removePToken(uint256)\":{\"params\":{\"_assetIndex\":\"Index of the asset to be removed\"}},\"setHarvesterAddress(address)\":{\"params\":{\"_harvesterAddress\":\"Address of the harvester contract.\"}},\"setPTokenAddress(address,address)\":{\"params\":{\"_asset\":\"Address for the asset\",\"_pToken\":\"Address for the corresponding platform token\"}},\"setRewardTokenAddresses(address[])\":{\"params\":{\"_rewardTokenAddresses\":\"Array of reward token addresses\"}},\"stakeEth((bytes,bytes,bytes32)[])\":{\"params\":{\"validators\":\"A list of validator data needed to stake. The `ValidatorStakeData` struct contains the pubkey, signature and depositDataRoot. Only the registrator can call this function.\"}},\"supportsAsset(address)\":{\"params\":{\"_asset\":\"The address of the asset token.\"}},\"transferGovernance(address)\":{\"params\":{\"_newGovernor\":\"Address of the new Governor\"}},\"transferToken(address,uint256)\":{\"params\":{\"_amount\":\"Amount of the asset to transfer\",\"_asset\":\"Address for the asset\"}},\"withdraw(address,address,uint256)\":{\"params\":{\"_amount\":\"Amount of WETH to withdraw\",\"_asset\":\"WETH to withdraw\",\"_recipient\":\"Address to receive withdrawn assets\"}}},\"stateVariables\":{\"FEE_ACCUMULATOR_ADDRESS\":{\"details\":\"this address will receive Execution layer rewards - These are rewards earned for executing transactions on the Ethereum network as part of block proposals. They include priority fees (fees paid by users for their transactions to be included) and MEV rewards (rewards for arranging transactions in a way that benefits the validator).\"},\"depositedWethAccountedFor\":{\"details\":\"This contract receives WETH as the deposit asset, but unlike other strategies doesn't immediately deposit it to an underlying platform. Rather a special privilege account stakes it to the validators. For that reason calling WETH.balanceOf(this) in a deposit function can contain WETH that has just been deposited and also WETH that has previously been deposited. To keep a correct count we need to keep track of WETH that has already been accounted for. This value represents the amount of WETH balance of this contract that has already been accounted for by the deposit events. It is important to note that this variable is not concerned with WETH that is a result of full/partial withdrawal of the validators. It is strictly concerned with WETH that has been deposited and is waiting to be staked.\"}},\"title\":\"Native Staking SSV Strategy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"BEACON_CHAIN_DEPOSIT_CONTRACT()\":{\"notice\":\"The address of the beacon chain deposit contract\"},\"FEE_ACCUMULATOR_ADDRESS()\":{\"notice\":\"Fee collector address\"},\"MAX_STAKE()\":{\"notice\":\"The maximum amount of ETH that can be staked by a validator\"},\"MIN_FIX_ACCOUNTING_CADENCE()\":{\"notice\":\"The minimum amount of blocks that need to pass between two calls to manuallyFixAccounting\"},\"SSV_NETWORK_ADDRESS()\":{\"notice\":\"The address of the SSV Network contract used to interface with\"},\"SSV_TOKEN_ADDRESS()\":{\"notice\":\"SSV ERC20 token that serves as a payment for operating SSV validators\"},\"VAULT_ADDRESS()\":{\"notice\":\"Address of the OETH Vault proxy contract\"},\"WETH_TOKEN_ADDRESS()\":{\"notice\":\"The address of the Wrapped ETH (WETH) token contract\"},\"activeDepositedValidators()\":{\"notice\":\"The number of validators that have 32 (!) ETH actively deposited. When a new deposit to a validator happens this number increases, when a validator exit is detected this number decreases.\"},\"assetToPToken(address)\":{\"notice\":\"asset => pToken (Platform Specific Token Address)\"},\"checkBalance(address)\":{\"notice\":\"Returns the total value of (W)ETH that is staked to the validators and WETH deposits that are still to be staked. This does not include ETH from consensus rewards sitting in this strategy or ETH from MEV rewards in the FeeAccumulator. These rewards are harvested and sent to the Dripper so will eventually be sent to the Vault as WETH.\"},\"claimGovernance()\":{\"notice\":\"Claim Governance of the contract to a new account (`newGovernor`). Can only be called by the new Governor.\"},\"collectRewardTokens()\":{\"notice\":\"Collect accumulated reward token and send to Vault.\"},\"consensusRewards()\":{\"notice\":\"Keeps track of the total consensus rewards swept from the beacon chain\"},\"deposit(address,uint256)\":{\"notice\":\"Unlike other strategies, this does not deposit assets into the underlying platform. It just checks the asset is WETH and emits the Deposit event. To deposit WETH into validators `registerSsvValidator` and `stakeEth` must be used. Will NOT revert if the strategy is paused from an accounting failure.\"},\"depositAll()\":{\"notice\":\"Unlike other strategies, this does not deposit assets into the underlying platform. It just emits the Deposit event. To deposit WETH into validators `registerSsvValidator` and `stakeEth` must be used. Will NOT revert if the strategy is paused from an accounting failure.\"},\"depositSSV(uint64[],uint256,(uint32,uint64,uint64,bool,uint256))\":{\"notice\":\"Deposits more SSV Tokens to the SSV Network contract which is used to pay the SSV Operators.\"},\"doAccounting()\":{\"notice\":\"This notion page offers a good explanation of how the accounting functions https://www.notion.so/originprotocol/Limited-simplified-native-staking-accounting-67a217c8420d40678eb943b9da0ee77d In short, after dividing by 32, if the ETH remaining on the contract falls between 0 and fuseIntervalStart, the accounting function will treat that ETH as Beacon chain consensus rewards. On the contrary, if after dividing by 32, the ETH remaining on the contract falls between fuseIntervalEnd and 32, the accounting function will treat that as a validator slashing.Perform the accounting attributing beacon chain ETH to either full or partial withdrawals. Returns true when accounting is valid and fuse isn't \\\"blown\\\". Returns false when fuse is blown.\"},\"exitSsvValidator(bytes,uint64[])\":{\"notice\":\"Exit a validator from the Beacon chain. The staked ETH will eventually swept to this native staking strategy. Only the registrator can call this function.\"},\"fuseIntervalEnd()\":{\"notice\":\"end of fuse interval\"},\"fuseIntervalStart()\":{\"notice\":\"start of fuse interval\"},\"getRewardTokenAddresses()\":{\"notice\":\"Get the reward token addresses.\"},\"governor()\":{\"notice\":\"Returns the address of the current Governor.\"},\"harvesterAddress()\":{\"notice\":\"Address of the Harvester contract allowed to collect reward tokens\"},\"initialize(address[],address[],address[])\":{\"notice\":\"initialize function, to set up initial internal state\"},\"isGovernor()\":{\"notice\":\"Returns true if the caller is the current Governor.\"},\"lastFixAccountingBlockNumber()\":{\"notice\":\"last block number manuallyFixAccounting has been called\"},\"manuallyFixAccounting(int256,int256,uint256)\":{\"notice\":\"Allow the Strategist to fix the accounting of this strategy and unpause.\"},\"platformAddress()\":{\"notice\":\"Address of the underlying platform\"},\"registerSsvValidator(bytes,uint64[],bytes,uint256,(uint32,uint64,uint64,bool,uint256))\":{\"notice\":\"Registers a new validator in the SSV Cluster. Only the registrator can call this function.\"},\"removePToken(uint256)\":{\"notice\":\"Remove a supported asset by passing its index. This method can only be called by the system Governor\"},\"removeSsvValidator(bytes,uint64[],(uint32,uint64,uint64,bool,uint256))\":{\"notice\":\"Remove a validator from the SSV Cluster. Make sure `exitSsvValidator` is called before and the validate has exited the Beacon chain. If removed before the validator has exited the beacon chain will result in the validator being slashed. Only the registrator can call this function.\"},\"resetStakeETHTally()\":{\"notice\":\"Reset the stakeETHTally\"},\"rewardTokenAddresses(uint256)\":{\"notice\":\"Address of the reward tokens. eg CRV, BAL, CVX, AURA\"},\"safeApproveAllTokens()\":{\"notice\":\"Approves the SSV Network contract to transfer SSV tokens for deposits\"},\"setFuseInterval(uint256,uint256)\":{\"notice\":\"set fuse interval values\"},\"setHarvesterAddress(address)\":{\"notice\":\"Set the Harvester contract that can collect rewards.\"},\"setPTokenAddress(address,address)\":{\"notice\":\"Provide support for asset by passing its pToken address. This method can only be called by the system Governor\"},\"setRegistrator(address)\":{\"notice\":\"Set the address of the registrator which can register, exit and remove validators\"},\"setRewardTokenAddresses(address[])\":{\"notice\":\"Set the reward token addresses. Any old addresses will be overwritten.\"},\"setStakeETHThreshold(uint256)\":{\"notice\":\"Set the amount of ETH that can be staked before staking monitor\"},\"setStakingMonitor(address)\":{\"notice\":\"Set the address of the staking monitor that is allowed to reset stakeETHTally\"},\"stakeETHTally()\":{\"notice\":\"Amount of ETH that can has been staked since the last governor approval.\"},\"stakeETHThreshold()\":{\"notice\":\"Amount of ETH that can be staked before staking on the contract is suspended and the governor needs to approve further staking\"},\"stakeEth((bytes,bytes,bytes32)[])\":{\"notice\":\"Stakes WETH to the node validators\"},\"stakingMonitor()\":{\"notice\":\"The account that is allowed to modify stakeETHThreshold and reset stakeETHTally\"},\"supportsAsset(address)\":{\"notice\":\"Returns bool indicating whether asset is supported by strategy.\"},\"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\"},\"transferToken(address,uint256)\":{\"notice\":\"Transfer token to governor. Intended for recovering tokens stuck in strategy contracts, i.e. mistaken sends.\"},\"validatorRegistrator()\":{\"notice\":\"Address of the registrator - allowed to register, exit and remove validators\"},\"validatorsStates(bytes32)\":{\"notice\":\"State of the validators keccak256(pubKey) => state\"},\"vaultAddress()\":{\"notice\":\"Address of the OToken vault\"},\"withdraw(address,address,uint256)\":{\"notice\":\"Withdraw WETH from this contract. Used only if some WETH for is lingering on the contract. That can happen when: - the deposit was not a multiple of 32 WETH - someone sent WETH directly to this contract Will NOT revert if the strategy is paused from an accounting failure.\"},\"withdrawAll()\":{\"notice\":\"transfer all WETH deposits back to the vault. This does not withdraw from the validators. That has to be done separately with the `exitSsvValidator` and `removeSsvValidator` operations. This does not withdraw any execution rewards from the FeeAccumulator or consensus rewards in this strategy. Any ETH in this strategy that was swept from a full validator withdrawal will not be withdrawn. ETH from full validator withdrawals is sent to the Vault using `doAccounting`. Will NOT revert if the strategy is paused from an accounting failure.\"}},\"notice\":\"Strategy to deploy funds into DVT validators powered by the SSV Network\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol\":\"NativeStakingSSVStrategy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/security/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract Pausable is Context {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n require(!paused(), \\\"Pausable: paused\\\");\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n require(paused(), \\\"Pausable: not paused\\\");\\n _;\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0xe68ed7fb8766ed1e888291f881e36b616037f852b37d96877045319ad298ba87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x61437cb513a887a1bbad006e7b1c8b414478427d33de47c5600af3c748f108da\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc3d946432c0ddbb1f846a0d3985be71299df331b91d06732152117f62f0be2b5\",\"license\":\"MIT\"},\"@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\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a / b + (a % b == 0 ? 0 : 1);\\n }\\n}\\n\",\"keccak256\":\"0xfaad496c1c944b6259b7dc70b4865eb1775d6402bc0c81b38a0b24d9f525ae37\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// CAUTION\\n// This version of SafeMath should only be used with Solidity 0.8 or later,\\n// because it relies on the compiler's built in overflow checks.\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations.\\n *\\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\\n * now has built in overflow checking.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a + b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a * b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator.\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(\\n uint256 a,\\n uint256 b,\\n string memory errorMessage\\n ) internal pure returns (uint256) {\\n unchecked {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(\\n uint256 a,\\n uint256 b,\\n string memory errorMessage\\n ) internal pure returns (uint256) {\\n unchecked {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(\\n uint256 a,\\n uint256 b,\\n string memory errorMessage\\n ) internal pure returns (uint256) {\\n unchecked {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa2f576be637946f767aa56601c26d717f48a0aff44f82e46f13807eea1009a21\",\"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/interfaces/IBasicToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBasicToken {\\n function symbol() external view returns (string memory);\\n\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0xa562062698aa12572123b36dfd2072f1a39e44fed2031cc19c2c9fd522f96ec2\",\"license\":\"MIT\"},\"contracts/interfaces/IDepositContract.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IDepositContract {\\n /// @notice A processed deposit event.\\n event DepositEvent(\\n bytes pubkey,\\n bytes withdrawal_credentials,\\n bytes amount,\\n bytes signature,\\n bytes index\\n );\\n\\n /// @notice Submit a Phase 0 DepositData object.\\n /// @param pubkey A BLS12-381 public key.\\n /// @param withdrawal_credentials Commitment to a public key for withdrawals.\\n /// @param signature A BLS12-381 signature.\\n /// @param deposit_data_root The SHA-256 hash of the SSZ-encoded DepositData object.\\n /// Used as a protection against malformed input.\\n function deposit(\\n bytes calldata pubkey,\\n bytes calldata withdrawal_credentials,\\n bytes calldata signature,\\n bytes32 deposit_data_root\\n ) external payable;\\n\\n /// @notice Query the current deposit root hash.\\n /// @return The deposit root hash.\\n function get_deposit_root() external view returns (bytes32);\\n\\n /// @notice Query the current deposit count.\\n /// @return The deposit count encoded as a little endian 64-bit number.\\n function get_deposit_count() external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x598f90bdbc854250bbd5991426bfb43367207e64e33109c41aa8b54323fd8d8e\",\"license\":\"MIT\"},\"contracts/interfaces/ISSVNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nstruct Cluster {\\n uint32 validatorCount;\\n uint64 networkFeeIndex;\\n uint64 index;\\n bool active;\\n uint256 balance;\\n}\\n\\ninterface ISSVNetwork {\\n /**********/\\n /* Errors */\\n /**********/\\n\\n error CallerNotOwner(); // 0x5cd83192\\n error CallerNotWhitelisted(); // 0x8c6e5d71\\n error FeeTooLow(); // 0x732f9413\\n error FeeExceedsIncreaseLimit(); // 0x958065d9\\n error NoFeeDeclared(); // 0x1d226c30\\n error ApprovalNotWithinTimeframe(); // 0x97e4b518\\n error OperatorDoesNotExist(); // 0x961e3e8c\\n error InsufficientBalance(); // 0xf4d678b8\\n error ValidatorDoesNotExist(); // 0xe51315d2\\n error ClusterNotLiquidatable(); // 0x60300a8d\\n error InvalidPublicKeyLength(); // 0x637297a4\\n error InvalidOperatorIdsLength(); // 0x38186224\\n error ClusterAlreadyEnabled(); // 0x3babafd2\\n error ClusterIsLiquidated(); // 0x95a0cf33\\n error ClusterDoesNotExists(); // 0x185e2b16\\n error IncorrectClusterState(); // 0x12e04c87\\n error UnsortedOperatorsList(); // 0xdd020e25\\n error NewBlockPeriodIsBelowMinimum(); // 0x6e6c9cac\\n error ExceedValidatorLimit(); // 0x6df5ab76\\n error TokenTransferFailed(); // 0x045c4b02\\n error SameFeeChangeNotAllowed(); // 0xc81272f8\\n error FeeIncreaseNotAllowed(); // 0x410a2b6c\\n error NotAuthorized(); // 0xea8e4eb5\\n error OperatorsListNotUnique(); // 0xa5a1ff5d\\n error OperatorAlreadyExists(); // 0x289c9494\\n error TargetModuleDoesNotExist(); // 0x8f9195fb\\n error MaxValueExceeded(); // 0x91aa3017\\n error FeeTooHigh(); // 0xcd4e6167\\n error PublicKeysSharesLengthMismatch(); // 0x9ad467b8\\n error IncorrectValidatorStateWithData(bytes publicKey); // 0x89307938\\n error ValidatorAlreadyExistsWithData(bytes publicKey); // 0x388e7999\\n error EmptyPublicKeysList(); // df83e679\\n\\n // legacy errors\\n error ValidatorAlreadyExists(); // 0x8d09a73e\\n error IncorrectValidatorState(); // 0x2feda3c1\\n\\n event AdminChanged(address previousAdmin, address newAdmin);\\n event BeaconUpgraded(address indexed beacon);\\n event ClusterDeposited(\\n address indexed owner,\\n uint64[] operatorIds,\\n uint256 value,\\n Cluster cluster\\n );\\n event ClusterLiquidated(\\n address indexed owner,\\n uint64[] operatorIds,\\n Cluster cluster\\n );\\n event ClusterReactivated(\\n address indexed owner,\\n uint64[] operatorIds,\\n Cluster cluster\\n );\\n event ClusterWithdrawn(\\n address indexed owner,\\n uint64[] operatorIds,\\n uint256 value,\\n Cluster cluster\\n );\\n event DeclareOperatorFeePeriodUpdated(uint64 value);\\n event ExecuteOperatorFeePeriodUpdated(uint64 value);\\n event FeeRecipientAddressUpdated(\\n address indexed owner,\\n address recipientAddress\\n );\\n event Initialized(uint8 version);\\n event LiquidationThresholdPeriodUpdated(uint64 value);\\n event MinimumLiquidationCollateralUpdated(uint256 value);\\n event NetworkEarningsWithdrawn(uint256 value, address recipient);\\n event NetworkFeeUpdated(uint256 oldFee, uint256 newFee);\\n event OperatorAdded(\\n uint64 indexed operatorId,\\n address indexed owner,\\n bytes publicKey,\\n uint256 fee\\n );\\n event OperatorFeeDeclarationCancelled(\\n address indexed owner,\\n uint64 indexed operatorId\\n );\\n event OperatorFeeDeclared(\\n address indexed owner,\\n uint64 indexed operatorId,\\n uint256 blockNumber,\\n uint256 fee\\n );\\n event OperatorFeeExecuted(\\n address indexed owner,\\n uint64 indexed operatorId,\\n uint256 blockNumber,\\n uint256 fee\\n );\\n event OperatorFeeIncreaseLimitUpdated(uint64 value);\\n event OperatorMaximumFeeUpdated(uint64 maxFee);\\n event OperatorRemoved(uint64 indexed operatorId);\\n event OperatorWhitelistUpdated(\\n uint64 indexed operatorId,\\n address whitelisted\\n );\\n event OperatorWithdrawn(\\n address indexed owner,\\n uint64 indexed operatorId,\\n uint256 value\\n );\\n event OwnershipTransferStarted(\\n address indexed previousOwner,\\n address indexed newOwner\\n );\\n event OwnershipTransferred(\\n address indexed previousOwner,\\n address indexed newOwner\\n );\\n event Upgraded(address indexed implementation);\\n event ValidatorAdded(\\n address indexed owner,\\n uint64[] operatorIds,\\n bytes publicKey,\\n bytes shares,\\n Cluster cluster\\n );\\n event ValidatorExited(\\n address indexed owner,\\n uint64[] operatorIds,\\n bytes publicKey\\n );\\n event ValidatorRemoved(\\n address indexed owner,\\n uint64[] operatorIds,\\n bytes publicKey,\\n Cluster cluster\\n );\\n\\n fallback() external;\\n\\n function acceptOwnership() external;\\n\\n function cancelDeclaredOperatorFee(uint64 operatorId) external;\\n\\n function declareOperatorFee(uint64 operatorId, uint256 fee) external;\\n\\n function deposit(\\n address clusterOwner,\\n uint64[] memory operatorIds,\\n uint256 amount,\\n Cluster memory cluster\\n ) external;\\n\\n function executeOperatorFee(uint64 operatorId) external;\\n\\n function exitValidator(bytes memory publicKey, uint64[] memory operatorIds)\\n external;\\n\\n function getVersion() external pure returns (string memory version);\\n\\n function initialize(\\n address token_,\\n address ssvOperators_,\\n address ssvClusters_,\\n address ssvDAO_,\\n address ssvViews_,\\n uint64 minimumBlocksBeforeLiquidation_,\\n uint256 minimumLiquidationCollateral_,\\n uint32 validatorsPerOperatorLimit_,\\n uint64 declareOperatorFeePeriod_,\\n uint64 executeOperatorFeePeriod_,\\n uint64 operatorMaxFeeIncrease_\\n ) external;\\n\\n function liquidate(\\n address clusterOwner,\\n uint64[] memory operatorIds,\\n Cluster memory cluster\\n ) external;\\n\\n function owner() external view returns (address);\\n\\n function pendingOwner() external view returns (address);\\n\\n function proxiableUUID() external view returns (bytes32);\\n\\n function reactivate(\\n uint64[] memory operatorIds,\\n uint256 amount,\\n Cluster memory cluster\\n ) external;\\n\\n function reduceOperatorFee(uint64 operatorId, uint256 fee) external;\\n\\n function registerOperator(bytes memory publicKey, uint256 fee)\\n external\\n returns (uint64 id);\\n\\n function registerValidator(\\n bytes memory publicKey,\\n uint64[] memory operatorIds,\\n bytes memory sharesData,\\n uint256 amount,\\n Cluster memory cluster\\n ) external;\\n\\n function removeOperator(uint64 operatorId) external;\\n\\n function removeValidator(\\n bytes memory publicKey,\\n uint64[] memory operatorIds,\\n Cluster memory cluster\\n ) external;\\n\\n function renounceOwnership() external;\\n\\n function setFeeRecipientAddress(address recipientAddress) external;\\n\\n function setOperatorWhitelist(uint64 operatorId, address whitelisted)\\n external;\\n\\n function transferOwnership(address newOwner) external;\\n\\n function updateDeclareOperatorFeePeriod(uint64 timeInSeconds) external;\\n\\n function updateExecuteOperatorFeePeriod(uint64 timeInSeconds) external;\\n\\n function updateLiquidationThresholdPeriod(uint64 blocks) external;\\n\\n function updateMaximumOperatorFee(uint64 maxFee) external;\\n\\n function updateMinimumLiquidationCollateral(uint256 amount) external;\\n\\n function updateModule(uint8 moduleId, address moduleAddress) external;\\n\\n function updateNetworkFee(uint256 fee) external;\\n\\n function updateOperatorFeeIncreaseLimit(uint64 percentage) external;\\n\\n function upgradeTo(address newImplementation) external;\\n\\n function upgradeToAndCall(address newImplementation, bytes memory data)\\n external\\n payable;\\n\\n function withdraw(\\n uint64[] memory operatorIds,\\n uint256 amount,\\n Cluster memory cluster\\n ) external;\\n\\n function withdrawAllOperatorEarnings(uint64 operatorId) external;\\n\\n function withdrawNetworkEarnings(uint256 amount) external;\\n\\n function withdrawOperatorEarnings(uint64 operatorId, uint256 amount)\\n external;\\n}\\n\",\"keccak256\":\"0xbef02bd5257e61dec0a6be4b1531064a7fdfeb4043885443a1902fb5d1b23e1b\",\"license\":\"MIT\"},\"contracts/interfaces/IStrategy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Platform interface to integrate with lending platform like Compound, AAVE etc.\\n */\\ninterface IStrategy {\\n /**\\n * @dev Deposit the given asset to platform\\n * @param _asset asset address\\n * @param _amount Amount to deposit\\n */\\n function deposit(address _asset, uint256 _amount) external;\\n\\n /**\\n * @dev Deposit the entire balance of all supported assets in the Strategy\\n * to the platform\\n */\\n function depositAll() external;\\n\\n /**\\n * @dev Withdraw given asset from Lending platform\\n */\\n function withdraw(\\n address _recipient,\\n address _asset,\\n uint256 _amount\\n ) external;\\n\\n /**\\n * @dev Liquidate all assets in strategy and return them to Vault.\\n */\\n function withdrawAll() external;\\n\\n /**\\n * @dev Returns the current balance of the given asset.\\n */\\n function checkBalance(address _asset)\\n external\\n view\\n returns (uint256 balance);\\n\\n /**\\n * @dev Returns bool indicating whether strategy supports asset.\\n */\\n function supportsAsset(address _asset) external view returns (bool);\\n\\n /**\\n * @dev Collect reward tokens from the Strategy.\\n */\\n function collectRewardTokens() external;\\n\\n /**\\n * @dev The address array of the reward tokens for the Strategy.\\n */\\n function getRewardTokenAddresses() external view returns (address[] memory);\\n}\\n\",\"keccak256\":\"0xb291e409a9b95527f9ed19cd6bff8eeb9921a21c1f5194a48c0bb9ce6613959a\",\"license\":\"MIT\"},\"contracts/interfaces/IVault.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { VaultStorage } from \\\"../vault/VaultStorage.sol\\\";\\n\\ninterface IVault {\\n event AssetSupported(address _asset);\\n event AssetDefaultStrategyUpdated(address _asset, address _strategy);\\n event AssetAllocated(address _asset, address _strategy, uint256 _amount);\\n event StrategyApproved(address _addr);\\n event StrategyRemoved(address _addr);\\n event Mint(address _addr, uint256 _value);\\n event Redeem(address _addr, uint256 _value);\\n event CapitalPaused();\\n event CapitalUnpaused();\\n event RebasePaused();\\n event RebaseUnpaused();\\n event VaultBufferUpdated(uint256 _vaultBuffer);\\n event RedeemFeeUpdated(uint256 _redeemFeeBps);\\n event PriceProviderUpdated(address _priceProvider);\\n event AllocateThresholdUpdated(uint256 _threshold);\\n event RebaseThresholdUpdated(uint256 _threshold);\\n event StrategistUpdated(address _address);\\n event MaxSupplyDiffChanged(uint256 maxSupplyDiff);\\n event YieldDistribution(address _to, uint256 _yield, uint256 _fee);\\n event TrusteeFeeBpsChanged(uint256 _basis);\\n event TrusteeAddressChanged(address _address);\\n event SwapperChanged(address _address);\\n event SwapAllowedUndervalueChanged(uint256 _basis);\\n event SwapSlippageChanged(address _asset, uint256 _basis);\\n event Swapped(\\n address indexed _fromAsset,\\n address indexed _toAsset,\\n uint256 _fromAssetAmount,\\n uint256 _toAssetAmount\\n );\\n\\n // Governable.sol\\n function transferGovernance(address _newGovernor) external;\\n\\n function claimGovernance() external;\\n\\n function governor() external view returns (address);\\n\\n // VaultAdmin.sol\\n function setPriceProvider(address _priceProvider) external;\\n\\n function priceProvider() external view returns (address);\\n\\n function setRedeemFeeBps(uint256 _redeemFeeBps) external;\\n\\n function redeemFeeBps() external view returns (uint256);\\n\\n function setVaultBuffer(uint256 _vaultBuffer) external;\\n\\n function vaultBuffer() external view returns (uint256);\\n\\n function setAutoAllocateThreshold(uint256 _threshold) external;\\n\\n function autoAllocateThreshold() external view returns (uint256);\\n\\n function setRebaseThreshold(uint256 _threshold) external;\\n\\n function rebaseThreshold() external view returns (uint256);\\n\\n function setStrategistAddr(address _address) external;\\n\\n function strategistAddr() external view returns (address);\\n\\n function setMaxSupplyDiff(uint256 _maxSupplyDiff) external;\\n\\n function maxSupplyDiff() external view returns (uint256);\\n\\n function setTrusteeAddress(address _address) external;\\n\\n function trusteeAddress() external view returns (address);\\n\\n function setTrusteeFeeBps(uint256 _basis) external;\\n\\n function trusteeFeeBps() external view returns (uint256);\\n\\n function ousdMetaStrategy() external view returns (address);\\n\\n function setSwapper(address _swapperAddr) external;\\n\\n function setSwapAllowedUndervalue(uint16 _percentageBps) external;\\n\\n function setOracleSlippage(address _asset, uint16 _allowedOracleSlippageBps)\\n external;\\n\\n function supportAsset(address _asset, uint8 _supportsAsset) external;\\n\\n function approveStrategy(address _addr) external;\\n\\n function removeStrategy(address _addr) external;\\n\\n function setAssetDefaultStrategy(address _asset, address _strategy)\\n external;\\n\\n function assetDefaultStrategies(address _asset)\\n external\\n view\\n returns (address);\\n\\n function pauseRebase() external;\\n\\n function unpauseRebase() external;\\n\\n function rebasePaused() external view returns (bool);\\n\\n function pauseCapital() external;\\n\\n function unpauseCapital() external;\\n\\n function capitalPaused() external view returns (bool);\\n\\n function transferToken(address _asset, uint256 _amount) external;\\n\\n function priceUnitMint(address asset) external view returns (uint256);\\n\\n function priceUnitRedeem(address asset) external view returns (uint256);\\n\\n function withdrawAllFromStrategy(address _strategyAddr) external;\\n\\n function withdrawAllFromStrategies() external;\\n\\n function withdrawFromStrategy(\\n address _strategyFromAddress,\\n address[] calldata _assets,\\n uint256[] calldata _amounts\\n ) external;\\n\\n function depositToStrategy(\\n address _strategyToAddress,\\n address[] calldata _assets,\\n uint256[] calldata _amounts\\n ) external;\\n\\n // VaultCore.sol\\n function mint(\\n address _asset,\\n uint256 _amount,\\n uint256 _minimumOusdAmount\\n ) external;\\n\\n function mintForStrategy(uint256 _amount) external;\\n\\n function redeem(uint256 _amount, uint256 _minimumUnitAmount) external;\\n\\n function burnForStrategy(uint256 _amount) external;\\n\\n function redeemAll(uint256 _minimumUnitAmount) external;\\n\\n function allocate() external;\\n\\n function rebase() external;\\n\\n function swapCollateral(\\n address fromAsset,\\n address toAsset,\\n uint256 fromAssetAmount,\\n uint256 minToAssetAmount,\\n bytes calldata data\\n ) external returns (uint256 toAssetAmount);\\n\\n function totalValue() external view returns (uint256 value);\\n\\n function checkBalance(address _asset) external view returns (uint256);\\n\\n function calculateRedeemOutputs(uint256 _amount)\\n external\\n view\\n returns (uint256[] memory);\\n\\n function getAssetCount() external view returns (uint256);\\n\\n function getAssetConfig(address _asset)\\n external\\n view\\n returns (VaultStorage.Asset memory config);\\n\\n function getAllAssets() external view returns (address[] memory);\\n\\n function getStrategyCount() external view returns (uint256);\\n\\n function swapper() external view returns (address);\\n\\n function allowedSwapUndervalue() external view returns (uint256);\\n\\n function getAllStrategies() external view returns (address[] memory);\\n\\n function isSupportedAsset(address _asset) external view returns (bool);\\n\\n function netOusdMintForStrategyThreshold() external view returns (uint256);\\n\\n function setOusdMetaStrategy(address _ousdMetaStrategy) external;\\n\\n function setNetOusdMintForStrategyThreshold(uint256 _threshold) external;\\n\\n function netOusdMintedForStrategy() external view returns (int256);\\n\\n function weth() external view returns (address);\\n\\n function cacheWETHAssetIndex() external;\\n\\n function wethAssetIndex() external view returns (uint256);\\n\\n function initialize(address, address) external;\\n\\n function setAdminImpl(address) external;\\n\\n function removeAsset(address _asset) external;\\n}\\n\",\"keccak256\":\"0xa03ba17b6224bec26290794760fc807e017260406037b4f812970701888e72c8\",\"license\":\"MIT\"},\"contracts/interfaces/IWETH9.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IWETH9 {\\n event Approval(address indexed src, address indexed guy, uint256 wad);\\n event Deposit(address indexed dst, uint256 wad);\\n event Transfer(address indexed src, address indexed dst, uint256 wad);\\n event Withdrawal(address indexed src, uint256 wad);\\n\\n function allowance(address, address) external view returns (uint256);\\n\\n function approve(address guy, uint256 wad) external returns (bool);\\n\\n function balanceOf(address) external view returns (uint256);\\n\\n function decimals() external view returns (uint8);\\n\\n function deposit() external payable;\\n\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function transfer(address dst, uint256 wad) external returns (bool);\\n\\n function transferFrom(\\n address src,\\n address dst,\\n uint256 wad\\n ) external returns (bool);\\n\\n function withdraw(uint256 wad) external;\\n}\\n\",\"keccak256\":\"0x05b7dce6c24d3cd4e48b5c6346d86e5e40ecc3291bcdf3f3ef091c98fc826519\",\"license\":\"MIT\"},\"contracts/strategies/NativeStaking/FeeAccumulator.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 Fee Accumulator for Native Staking SSV Strategy\\n * @notice Receives execution rewards which includes tx fees and\\n * MEV rewards like tx priority and tx ordering.\\n * It does NOT include swept ETH from beacon chain consensus rewards or full validator withdrawals.\\n * @author Origin Protocol Inc\\n */\\ncontract FeeAccumulator is Governable {\\n /// @notice The address of the Native Staking Strategy\\n address public immutable STRATEGY;\\n\\n /**\\n * @param _strategy Address of the Native Staking Strategy\\n */\\n constructor(address _strategy) {\\n STRATEGY = _strategy;\\n }\\n\\n /**\\n * @notice sends all ETH in this FeeAccumulator contract to the Native Staking Strategy.\\n * @return eth The amount of execution rewards that were sent to the Native Staking Strategy\\n */\\n function collect() external returns (uint256 eth) {\\n require(msg.sender == STRATEGY, \\\"Caller is not the Strategy\\\");\\n\\n eth = address(this).balance;\\n if (eth > 0) {\\n // Send the ETH to the Native Staking Strategy\\n Address.sendValue(payable(STRATEGY), eth);\\n }\\n }\\n\\n /**\\n * @dev Accept ETH\\n */\\n receive() external payable {}\\n}\\n\",\"keccak256\":\"0xb8fda3b87dc5d6f8aee4bf1d015a585211e5b5a319dfa4b0f4770e3f5a2d5939\",\"license\":\"MIT\"},\"contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\n\\nimport { InitializableAbstractStrategy } from \\\"../../utils/InitializableAbstractStrategy.sol\\\";\\nimport { IWETH9 } from \\\"../../interfaces/IWETH9.sol\\\";\\nimport { FeeAccumulator } from \\\"./FeeAccumulator.sol\\\";\\nimport { ValidatorAccountant } from \\\"./ValidatorAccountant.sol\\\";\\n\\nstruct ValidatorStakeData {\\n bytes pubkey;\\n bytes signature;\\n bytes32 depositDataRoot;\\n}\\n\\n/// @title Native Staking SSV Strategy\\n/// @notice Strategy to deploy funds into DVT validators powered by the SSV Network\\n/// @author Origin Protocol Inc\\n/// @dev This contract handles WETH and ETH and in some operations interchanges between the two. Any WETH that\\n/// is on the contract across multiple blocks (and not just transitory within a transaction) is considered an\\n/// asset. Meaning deposits increase the balance of the asset and withdrawal decrease it. As opposed to all\\n/// our other strategies the WETH doesn't immediately get deposited into an underlying strategy and can be present\\n/// across multiple blocks waiting to be unwrapped to ETH and staked to validators. This separation of WETH and ETH is\\n/// required since the rewards (reward token) is also in ETH.\\n///\\n/// To simplify the accounting of WETH there is another difference in behavior compared to the other strategies.\\n/// To withdraw WETH asset - exit message is posted to validators and the ETH hits this contract with multiple days\\n/// delay. In order to simplify the WETH accounting upon detection of such an event the ValidatorAccountant\\n/// immediately wraps ETH to WETH and sends it to the Vault.\\n///\\n/// On the other hand any ETH on the contract (across multiple blocks) is there either:\\n/// - as a result of already accounted for consensus rewards\\n/// - as a result of not yet accounted for consensus rewards\\n/// - as a results of not yet accounted for full validator withdrawals (or validator slashes)\\n///\\n/// Even though the strategy assets and rewards are a very similar asset the consensus layer rewards and the\\n/// execution layer rewards are considered rewards and those are dripped to the Vault over a configurable time\\n/// interval and not immediately.\\ncontract NativeStakingSSVStrategy is\\n ValidatorAccountant,\\n InitializableAbstractStrategy\\n{\\n using SafeERC20 for IERC20;\\n\\n /// @notice SSV ERC20 token that serves as a payment for operating SSV validators\\n address public immutable SSV_TOKEN_ADDRESS;\\n /// @notice Fee collector address\\n /// @dev this address will receive Execution layer rewards - These are rewards earned for\\n /// executing transactions on the Ethereum network as part of block proposals. They include\\n /// priority fees (fees paid by users for their transactions to be included) and MEV rewards\\n /// (rewards for arranging transactions in a way that benefits the validator).\\n address payable public immutable FEE_ACCUMULATOR_ADDRESS;\\n\\n /// @dev This contract receives WETH as the deposit asset, but unlike other strategies doesn't immediately\\n /// deposit it to an underlying platform. Rather a special privilege account stakes it to the validators.\\n /// For that reason calling WETH.balanceOf(this) in a deposit function can contain WETH that has just been\\n /// deposited and also WETH that has previously been deposited. To keep a correct count we need to keep track\\n /// of WETH that has already been accounted for.\\n /// This value represents the amount of WETH balance of this contract that has already been accounted for by the\\n /// deposit events.\\n /// It is important to note that this variable is not concerned with WETH that is a result of full/partial\\n /// withdrawal of the validators. It is strictly concerned with WETH that has been deposited and is waiting to\\n /// be staked.\\n uint256 public depositedWethAccountedFor;\\n\\n // For future use\\n uint256[49] private __gap;\\n\\n /// @param _baseConfig Base strategy config with platformAddress (ERC-4626 Vault contract), eg sfrxETH or sDAI,\\n /// and vaultAddress (OToken Vault contract), eg VaultProxy or OETHVaultProxy\\n /// @param _wethAddress Address of the Erc20 WETH Token contract\\n /// @param _ssvToken Address of the Erc20 SSV Token contract\\n /// @param _ssvNetwork Address of the SSV Network contract\\n /// @param _feeAccumulator Address of the fee accumulator receiving execution layer validator rewards\\n /// @param _beaconChainDepositContract Address of the beacon chain deposit contract\\n constructor(\\n BaseStrategyConfig memory _baseConfig,\\n address _wethAddress,\\n address _ssvToken,\\n address _ssvNetwork,\\n address _feeAccumulator,\\n address _beaconChainDepositContract\\n )\\n InitializableAbstractStrategy(_baseConfig)\\n ValidatorAccountant(\\n _wethAddress,\\n _baseConfig.vaultAddress,\\n _beaconChainDepositContract,\\n _ssvNetwork\\n )\\n {\\n SSV_TOKEN_ADDRESS = _ssvToken;\\n FEE_ACCUMULATOR_ADDRESS = payable(_feeAccumulator);\\n }\\n\\n /// @notice initialize function, to set up initial internal state\\n /// @param _rewardTokenAddresses Address of reward token for platform\\n /// @param _assets Addresses of initial supported assets\\n /// @param _pTokens Platform Token corresponding addresses\\n function initialize(\\n address[] memory _rewardTokenAddresses,\\n address[] memory _assets,\\n address[] memory _pTokens\\n ) external onlyGovernor initializer {\\n InitializableAbstractStrategy._initialize(\\n _rewardTokenAddresses,\\n _assets,\\n _pTokens\\n );\\n }\\n\\n /// @dev Convert accumulated ETH to WETH and send to the Harvester.\\n /// Will revert if the strategy is paused for accounting.\\n function _collectRewardTokens() internal override whenNotPaused {\\n // collect ETH from execution rewards from the fee accumulator\\n uint256 executionRewards = FeeAccumulator(FEE_ACCUMULATOR_ADDRESS)\\n .collect();\\n\\n // total ETH rewards to be harvested = execution rewards + consensus rewards\\n uint256 ethRewards = executionRewards + consensusRewards;\\n\\n require(\\n address(this).balance >= ethRewards,\\n \\\"insufficient eth balance\\\"\\n );\\n\\n if (ethRewards > 0) {\\n // reset the counter keeping track of beacon chain consensus rewards\\n consensusRewards = 0;\\n\\n // Convert ETH rewards to WETH\\n IWETH9(WETH_TOKEN_ADDRESS).deposit{ value: ethRewards }();\\n\\n emit RewardTokenCollected(\\n harvesterAddress,\\n WETH_TOKEN_ADDRESS,\\n ethRewards\\n );\\n IERC20(WETH_TOKEN_ADDRESS).safeTransfer(\\n harvesterAddress,\\n ethRewards\\n );\\n }\\n }\\n\\n /// @notice Unlike other strategies, this does not deposit assets into the underlying platform.\\n /// It just checks the asset is WETH and emits the Deposit event.\\n /// To deposit WETH into validators `registerSsvValidator` and `stakeEth` must be used.\\n /// Will NOT revert if the strategy is paused from an accounting failure.\\n /// @param _asset Address of asset to deposit. Has to be WETH.\\n /// @param _amount Amount of assets that were transferred to the strategy by the vault.\\n function deposit(address _asset, uint256 _amount)\\n external\\n override\\n onlyVault\\n nonReentrant\\n {\\n require(_asset == WETH_TOKEN_ADDRESS, \\\"Unsupported asset\\\");\\n depositedWethAccountedFor += _amount;\\n _deposit(_asset, _amount);\\n }\\n\\n /// @dev Deposit WETH to this strategy so it can later be staked into a validator.\\n /// @param _asset Address of WETH\\n /// @param _amount Amount of WETH to deposit\\n function _deposit(address _asset, uint256 _amount) internal {\\n require(_amount > 0, \\\"Must deposit something\\\");\\n /*\\n * We could do a check here that would revert when \\\"_amount % 32 ether != 0\\\". With the idea of\\n * not allowing deposits that will result in WETH sitting on the strategy after all the possible batches\\n * of 32ETH have been staked.\\n * But someone could mess with our strategy by sending some WETH to it. And we might want to deposit just\\n * enough WETH to add it up to 32 so it can be staked. For that reason the check is left out.\\n *\\n * WETH sitting on the strategy won't interfere with the accounting since accounting only operates on ETH.\\n */\\n emit Deposit(_asset, address(0), _amount);\\n }\\n\\n /// @notice Unlike other strategies, this does not deposit assets into the underlying platform.\\n /// It just emits the Deposit event.\\n /// To deposit WETH into validators `registerSsvValidator` and `stakeEth` must be used.\\n /// Will NOT revert if the strategy is paused from an accounting failure.\\n function depositAll() external override onlyVault nonReentrant {\\n uint256 wethBalance = IERC20(WETH_TOKEN_ADDRESS).balanceOf(\\n address(this)\\n );\\n uint256 newWeth = wethBalance - depositedWethAccountedFor;\\n\\n if (newWeth > 0) {\\n depositedWethAccountedFor = wethBalance;\\n\\n _deposit(WETH_TOKEN_ADDRESS, newWeth);\\n }\\n }\\n\\n /// @notice Withdraw WETH from this contract. Used only if some WETH for is lingering on the contract. That\\n /// can happen when:\\n /// - the deposit was not a multiple of 32 WETH\\n /// - someone sent WETH directly to this contract\\n /// Will NOT revert if the strategy is paused from an accounting failure.\\n /// @param _recipient Address to receive withdrawn assets\\n /// @param _asset WETH to withdraw\\n /// @param _amount Amount of WETH to withdraw\\n function withdraw(\\n address _recipient,\\n address _asset,\\n uint256 _amount\\n ) external override onlyVault nonReentrant {\\n _withdraw(_recipient, _asset, _amount);\\n }\\n\\n function _withdraw(\\n address _recipient,\\n address _asset,\\n uint256 _amount\\n ) internal {\\n require(_amount > 0, \\\"Must withdraw something\\\");\\n require(_recipient != address(0), \\\"Must specify recipient\\\");\\n\\n emit Withdrawal(_asset, address(0), _amount);\\n IERC20(_asset).safeTransfer(_recipient, _amount);\\n }\\n\\n /// @notice transfer all WETH deposits back to the vault.\\n /// This does not withdraw from the validators. That has to be done separately with the\\n /// `exitSsvValidator` and `removeSsvValidator` operations.\\n /// This does not withdraw any execution rewards from the FeeAccumulator or\\n /// consensus rewards in this strategy.\\n /// Any ETH in this strategy that was swept from a full validator withdrawal will not be withdrawn.\\n /// ETH from full validator withdrawals is sent to the Vault using `doAccounting`.\\n /// Will NOT revert if the strategy is paused from an accounting failure.\\n function withdrawAll() external override onlyVaultOrGovernor nonReentrant {\\n uint256 wethBalance = IERC20(WETH_TOKEN_ADDRESS).balanceOf(\\n address(this)\\n );\\n if (wethBalance > 0) {\\n _withdraw(vaultAddress, WETH_TOKEN_ADDRESS, wethBalance);\\n }\\n }\\n\\n function _abstractSetPToken(address _asset, address) internal override {}\\n\\n /// @notice Returns the total value of (W)ETH that is staked to the validators\\n /// and WETH deposits that are still to be staked.\\n /// This does not include ETH from consensus rewards sitting in this strategy\\n /// or ETH from MEV rewards in the FeeAccumulator. These rewards are harvested\\n /// and sent to the Dripper so will eventually be sent to the Vault as WETH.\\n /// @param _asset Address of weth asset\\n /// @return balance Total value of (W)ETH\\n function checkBalance(address _asset)\\n external\\n view\\n override\\n returns (uint256 balance)\\n {\\n require(_asset == WETH_TOKEN_ADDRESS, \\\"Unsupported asset\\\");\\n\\n balance =\\n // add the ETH that has been staked in validators\\n activeDepositedValidators *\\n 32 ether +\\n // add the WETH in the strategy from deposits that are still to be staked\\n IERC20(WETH_TOKEN_ADDRESS).balanceOf(address(this));\\n }\\n\\n function pause() external onlyStrategist {\\n _pause();\\n }\\n\\n /// @notice Returns bool indicating whether asset is supported by strategy.\\n /// @param _asset The address of the asset token.\\n function supportsAsset(address _asset) public view override returns (bool) {\\n return _asset == WETH_TOKEN_ADDRESS;\\n }\\n\\n /// @notice Approves the SSV Network contract to transfer SSV tokens for deposits\\n function safeApproveAllTokens() external override {\\n /// @dev Approves the SSV Network contract to transfer SSV tokens for deposits\\n IERC20(SSV_TOKEN_ADDRESS).approve(\\n SSV_NETWORK_ADDRESS,\\n type(uint256).max\\n );\\n }\\n\\n /**\\n * @notice Only accept ETH from the FeeAccumulator and the WETH contract - required when\\n * unwrapping WETH just before staking it to the validator\\n * @dev don't want to receive donations from anyone else as this will\\n * mess with the accounting of the consensus rewards and validator full withdrawals\\n */\\n receive() external payable {\\n require(\\n msg.sender == FEE_ACCUMULATOR_ADDRESS ||\\n msg.sender == WETH_TOKEN_ADDRESS,\\n \\\"eth not from allowed contracts\\\"\\n );\\n }\\n\\n function _wethWithdrawnToVault(uint256 _amount) internal override {\\n emit Withdrawal(WETH_TOKEN_ADDRESS, address(0), _amount);\\n }\\n\\n function _wethWithdrawnAndStaked(uint256 _amount) internal override {\\n /* In an ideal world we wouldn't need to reduce the deduction amount when the\\n * depositedWethAccountedFor is smaller than the _amount.\\n *\\n * The reason this is required is that a malicious actor could sent WETH direclty\\n * to this contract and that would circumvent the increase of depositedWethAccountedFor\\n * property. When the ETH would be staked the depositedWethAccountedFor amount could\\n * be deducted so much that it would be negative.\\n */\\n uint256 deductAmount = Math.min(_amount, depositedWethAccountedFor);\\n depositedWethAccountedFor -= deductAmount;\\n }\\n}\\n\",\"keccak256\":\"0x937ce31cd4b90ad532fdde874dc02eaf0a29a800c2c2292d2d6cb71afa75f32d\",\"license\":\"MIT\"},\"contracts/strategies/NativeStaking/ValidatorAccountant.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { ValidatorRegistrator } from \\\"./ValidatorRegistrator.sol\\\";\\nimport { IWETH9 } from \\\"../../interfaces/IWETH9.sol\\\";\\n\\n/// @title Validator Accountant\\n/// @notice Attributes the ETH swept from beacon chain validators to this strategy contract\\n/// as either full or partial withdrawals. Partial withdrawals being consensus rewards.\\n/// Full withdrawals are from exited validators.\\n/// @author Origin Protocol Inc\\nabstract contract ValidatorAccountant is ValidatorRegistrator {\\n /// @notice The minimum amount of blocks that need to pass between two calls to manuallyFixAccounting\\n uint256 public constant MIN_FIX_ACCOUNTING_CADENCE = 7200; // 1 day\\n /// @notice The maximum amount of ETH that can be staked by a validator\\n /// @dev this can change in the future with EIP-7251, Increase the MAX_EFFECTIVE_BALANCE\\n uint256 public constant MAX_STAKE = 32 ether;\\n\\n /// @notice Keeps track of the total consensus rewards swept from the beacon chain\\n uint256 public consensusRewards;\\n\\n /// @notice start of fuse interval\\n uint256 public fuseIntervalStart;\\n /// @notice end of fuse interval\\n uint256 public fuseIntervalEnd;\\n /// @notice last block number manuallyFixAccounting has been called\\n uint256 public lastFixAccountingBlockNumber;\\n\\n uint256[49] private __gap;\\n\\n event FuseIntervalUpdated(uint256 start, uint256 end);\\n event AccountingFullyWithdrawnValidator(\\n uint256 noOfValidators,\\n uint256 remainingValidators,\\n uint256 wethSentToVault\\n );\\n event AccountingValidatorSlashed(\\n uint256 remainingValidators,\\n uint256 wethSentToVault\\n );\\n event AccountingConsensusRewards(uint256 amount);\\n\\n event AccountingManuallyFixed(\\n int256 validatorsDelta,\\n int256 consensusRewardsDelta,\\n uint256 wethToVault\\n );\\n\\n /// @param _wethAddress Address of the Erc20 WETH Token contract\\n /// @param _vaultAddress Address of the Vault\\n /// @param _beaconChainDepositContract Address of the beacon chain deposit contract\\n /// @param _ssvNetwork Address of the SSV Network contract\\n constructor(\\n address _wethAddress,\\n address _vaultAddress,\\n address _beaconChainDepositContract,\\n address _ssvNetwork\\n )\\n ValidatorRegistrator(\\n _wethAddress,\\n _vaultAddress,\\n _beaconChainDepositContract,\\n _ssvNetwork\\n )\\n {}\\n\\n /// @notice set fuse interval values\\n function setFuseInterval(\\n uint256 _fuseIntervalStart,\\n uint256 _fuseIntervalEnd\\n ) external onlyGovernor {\\n require(\\n _fuseIntervalStart < _fuseIntervalEnd &&\\n _fuseIntervalStart < 32 ether &&\\n _fuseIntervalEnd < 32 ether &&\\n _fuseIntervalEnd - _fuseIntervalStart >= 4 ether,\\n \\\"incorrect fuse interval\\\"\\n );\\n\\n emit FuseIntervalUpdated(_fuseIntervalStart, _fuseIntervalEnd);\\n\\n fuseIntervalStart = _fuseIntervalStart;\\n fuseIntervalEnd = _fuseIntervalEnd;\\n }\\n\\n /* solhint-disable max-line-length */\\n /// This notion page offers a good explanation of how the accounting functions\\n /// https://www.notion.so/originprotocol/Limited-simplified-native-staking-accounting-67a217c8420d40678eb943b9da0ee77d\\n /// In short, after dividing by 32, if the ETH remaining on the contract falls between 0 and fuseIntervalStart,\\n /// the accounting function will treat that ETH as Beacon chain consensus rewards.\\n /// On the contrary, if after dividing by 32, the ETH remaining on the contract falls between fuseIntervalEnd and 32,\\n /// the accounting function will treat that as a validator slashing.\\n /// @notice Perform the accounting attributing beacon chain ETH to either full or partial withdrawals. Returns true when\\n /// accounting is valid and fuse isn't \\\"blown\\\". Returns false when fuse is blown.\\n /// @dev This function could in theory be permission-less but lets allow only the Registrator (Defender Action) to call it\\n /// for now.\\n /// @return accountingValid true if accounting was successful, false if fuse is blown\\n /* solhint-enable max-line-length */\\n function doAccounting()\\n external\\n onlyRegistrator\\n whenNotPaused\\n returns (bool accountingValid)\\n {\\n // pause the accounting on failure\\n accountingValid = _doAccounting(true);\\n }\\n\\n // slither-disable-start reentrancy-eth\\n function _doAccounting(bool pauseOnFail)\\n internal\\n returns (bool accountingValid)\\n {\\n if (address(this).balance < consensusRewards) {\\n return _failAccounting(pauseOnFail);\\n }\\n\\n // Calculate all the new ETH that has been swept to the contract since the last accounting\\n uint256 newSweptETH = address(this).balance - consensusRewards;\\n accountingValid = true;\\n\\n // send the ETH that is from fully withdrawn validators to the Vault\\n if (newSweptETH >= MAX_STAKE) {\\n uint256 fullyWithdrawnValidators;\\n // safe since MAX_STAKE is hardcoded to 32ETH\\n unchecked {\\n // explicitly cast to uint256 as we want to round to a whole number of validators\\n fullyWithdrawnValidators = uint256(newSweptETH / MAX_STAKE);\\n }\\n activeDepositedValidators -= fullyWithdrawnValidators;\\n\\n uint256 wethToVault = MAX_STAKE * fullyWithdrawnValidators;\\n IWETH9(WETH_TOKEN_ADDRESS).deposit{ value: wethToVault }();\\n // slither-disable-next-line unchecked-transfer\\n IWETH9(WETH_TOKEN_ADDRESS).transfer(VAULT_ADDRESS, wethToVault);\\n _wethWithdrawnToVault(wethToVault);\\n\\n emit AccountingFullyWithdrawnValidator(\\n fullyWithdrawnValidators,\\n activeDepositedValidators,\\n wethToVault\\n );\\n }\\n\\n uint256 ethRemaining = address(this).balance - consensusRewards;\\n // should be less than a whole validator stake\\n require(ethRemaining < 32 ether, \\\"unexpected accounting\\\");\\n\\n // If no Beacon chain consensus rewards swept\\n if (ethRemaining == 0) {\\n // do nothing\\n return accountingValid;\\n }\\n // Beacon chain consensus rewards swept (partial validator withdrawals)\\n else if (ethRemaining < fuseIntervalStart) {\\n // solhint-disable-next-line reentrancy\\n consensusRewards += ethRemaining;\\n emit AccountingConsensusRewards(ethRemaining);\\n }\\n // Beacon chain consensus rewards swept but also a slashed validator fully exited\\n else if (ethRemaining > fuseIntervalEnd) {\\n IWETH9(WETH_TOKEN_ADDRESS).deposit{ value: ethRemaining }();\\n // slither-disable-next-line unchecked-transfer\\n IWETH9(WETH_TOKEN_ADDRESS).transfer(VAULT_ADDRESS, ethRemaining);\\n activeDepositedValidators -= 1;\\n\\n _wethWithdrawnToVault(ethRemaining);\\n\\n emit AccountingValidatorSlashed(\\n activeDepositedValidators,\\n ethRemaining\\n );\\n }\\n // Oh no... Fuse is blown. The Strategist needs to adjust the accounting values.\\n else {\\n return _failAccounting(pauseOnFail);\\n }\\n }\\n\\n // slither-disable-end reentrancy-eth\\n\\n /// @dev pause any further accounting if required and return false\\n function _failAccounting(bool pauseOnFail)\\n internal\\n returns (bool accountingValid)\\n {\\n // pause if not already\\n if (pauseOnFail) {\\n _pause();\\n }\\n // fail the accounting\\n accountingValid = false;\\n }\\n\\n /// @notice Allow the Strategist to fix the accounting of this strategy and unpause.\\n /// @param _validatorsDelta adjust the active validators by up to plus three or minus three\\n /// @param _consensusRewardsDelta adjust the accounted for consensus rewards up or down\\n /// @param _ethToVaultAmount the amount of ETH that gets wrapped into WETH and sent to the Vault\\n /// @dev There is a case when a validator(s) gets slashed so much that the eth swept from\\n /// the beacon chain enters the fuse area and there are no consensus rewards on the contract\\n /// to \\\"dip into\\\"/use. To increase the amount of unaccounted ETH over the fuse end interval\\n /// we need to reduce the amount of active deposited validators and immediately send WETH\\n /// to the vault, so it doesn't interfere with further accounting.\\n function manuallyFixAccounting(\\n int256 _validatorsDelta,\\n int256 _consensusRewardsDelta,\\n uint256 _ethToVaultAmount\\n ) external onlyStrategist whenPaused {\\n require(\\n lastFixAccountingBlockNumber + MIN_FIX_ACCOUNTING_CADENCE <\\n block.number,\\n \\\"manuallyFixAccounting called too soon\\\"\\n );\\n require(\\n _validatorsDelta >= -3 &&\\n _validatorsDelta <= 3 &&\\n // new value must be positive\\n int256(activeDepositedValidators) + _validatorsDelta >= 0,\\n \\\"invalid validatorsDelta\\\"\\n );\\n require(\\n _consensusRewardsDelta >= -332 ether &&\\n _consensusRewardsDelta <= 332 ether &&\\n // new value must be positive\\n int256(consensusRewards) + _consensusRewardsDelta >= 0,\\n \\\"invalid consensusRewardsDelta\\\"\\n );\\n require(_ethToVaultAmount <= 32 ether * 3, \\\"invalid wethToVaultAmount\\\");\\n\\n emit AccountingManuallyFixed(\\n _validatorsDelta,\\n _consensusRewardsDelta,\\n _ethToVaultAmount\\n );\\n\\n activeDepositedValidators = uint256(\\n int256(activeDepositedValidators) + _validatorsDelta\\n );\\n consensusRewards = uint256(\\n int256(consensusRewards) + _consensusRewardsDelta\\n );\\n lastFixAccountingBlockNumber = block.number;\\n if (_ethToVaultAmount > 0) {\\n IWETH9(WETH_TOKEN_ADDRESS).deposit{ value: _ethToVaultAmount }();\\n // slither-disable-next-line unchecked-transfer\\n IWETH9(WETH_TOKEN_ADDRESS).transfer(\\n VAULT_ADDRESS,\\n _ethToVaultAmount\\n );\\n _wethWithdrawnToVault(_ethToVaultAmount);\\n }\\n\\n // rerun the accounting to see if it has now been fixed.\\n // Do not pause the accounting on failure as it is already paused\\n require(_doAccounting(false), \\\"fuse still blown\\\");\\n\\n // unpause since doAccounting was successful\\n _unpause();\\n }\\n\\n /***************************************\\n Abstract\\n ****************************************/\\n\\n /// @dev allows for NativeStakingSSVStrategy contract to emit Withdrawal event\\n function _wethWithdrawnToVault(uint256 _amount) internal virtual;\\n}\\n\",\"keccak256\":\"0x0adba45b3fa66233c9e9bc0575ca388ebcd027cba2546278c5887065b95da708\",\"license\":\"MIT\"},\"contracts/strategies/NativeStaking/ValidatorRegistrator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { Pausable } from \\\"@openzeppelin/contracts/security/Pausable.sol\\\";\\nimport { Governable } from \\\"../../governance/Governable.sol\\\";\\nimport { IDepositContract } from \\\"../../interfaces/IDepositContract.sol\\\";\\nimport { IVault } from \\\"../../interfaces/IVault.sol\\\";\\nimport { IWETH9 } from \\\"../../interfaces/IWETH9.sol\\\";\\nimport { ISSVNetwork, Cluster } from \\\"../../interfaces/ISSVNetwork.sol\\\";\\n\\nstruct ValidatorStakeData {\\n bytes pubkey;\\n bytes signature;\\n bytes32 depositDataRoot;\\n}\\n\\n/**\\n * @title Registrator of the validators\\n * @notice This contract implements all the required functionality to register, exit and remove validators.\\n * @author Origin Protocol Inc\\n */\\nabstract contract ValidatorRegistrator is Governable, Pausable {\\n /// @notice The address of the Wrapped ETH (WETH) token contract\\n address public immutable WETH_TOKEN_ADDRESS;\\n /// @notice The address of the beacon chain deposit contract\\n address public immutable BEACON_CHAIN_DEPOSIT_CONTRACT;\\n /// @notice The address of the SSV Network contract used to interface with\\n address public immutable SSV_NETWORK_ADDRESS;\\n /// @notice Address of the OETH Vault proxy contract\\n address public immutable VAULT_ADDRESS;\\n\\n /// @notice Address of the registrator - allowed to register, exit and remove validators\\n address public validatorRegistrator;\\n /// @notice The number of validators that have 32 (!) ETH actively deposited. When a new deposit\\n /// to a validator happens this number increases, when a validator exit is detected this number\\n /// decreases.\\n uint256 public activeDepositedValidators;\\n /// @notice State of the validators keccak256(pubKey) => state\\n mapping(bytes32 => VALIDATOR_STATE) public validatorsStates;\\n /// @notice The account that is allowed to modify stakeETHThreshold and reset stakeETHTally\\n address public stakingMonitor;\\n /// @notice Amount of ETH that can be staked before staking on the contract is suspended\\n /// and the governor needs to approve further staking\\n uint256 public stakeETHThreshold;\\n /// @notice Amount of ETH that can has been staked since the last governor approval.\\n uint256 public stakeETHTally;\\n // For future use\\n uint256[47] private __gap;\\n\\n enum VALIDATOR_STATE {\\n REGISTERED, // validator is registered on the SSV network\\n STAKED, // validator has funds staked\\n EXITING, // exit message has been posted and validator is in the process of exiting\\n EXIT_COMPLETE // validator has funds withdrawn to the EigenPod and is removed from the SSV\\n }\\n\\n event RegistratorChanged(address newAddress);\\n event StakingMonitorChanged(address newAddress);\\n event ETHStaked(bytes pubkey, uint256 amount, bytes withdrawal_credentials);\\n event SSVValidatorRegistered(bytes pubkey, uint64[] operatorIds);\\n event SSVValidatorExitInitiated(bytes pubkey, uint64[] operatorIds);\\n event SSVValidatorExitCompleted(bytes pubkey, uint64[] operatorIds);\\n event StakeETHThresholdChanged(uint256 amount);\\n event StakeETHTallyReset();\\n\\n /// @dev Throws if called by any account other than the Registrator\\n modifier onlyRegistrator() {\\n require(\\n msg.sender == validatorRegistrator,\\n \\\"Caller is not the Registrator\\\"\\n );\\n _;\\n }\\n\\n /// @dev Throws if called by any account other than the Staking monitor\\n modifier onlyStakingMonitor() {\\n require(msg.sender == stakingMonitor, \\\"Caller is not the Monitor\\\");\\n _;\\n }\\n\\n /// @dev Throws if called by any account other than the Strategist\\n modifier onlyStrategist() {\\n require(\\n msg.sender == IVault(VAULT_ADDRESS).strategistAddr(),\\n \\\"Caller is not the Strategist\\\"\\n );\\n _;\\n }\\n\\n /// @param _wethAddress Address of the Erc20 WETH Token contract\\n /// @param _vaultAddress Address of the Vault\\n /// @param _beaconChainDepositContract Address of the beacon chain deposit contract\\n /// @param _ssvNetwork Address of the SSV Network contract\\n constructor(\\n address _wethAddress,\\n address _vaultAddress,\\n address _beaconChainDepositContract,\\n address _ssvNetwork\\n ) {\\n WETH_TOKEN_ADDRESS = _wethAddress;\\n BEACON_CHAIN_DEPOSIT_CONTRACT = _beaconChainDepositContract;\\n SSV_NETWORK_ADDRESS = _ssvNetwork;\\n VAULT_ADDRESS = _vaultAddress;\\n }\\n\\n /// @notice Set the address of the registrator which can register, exit and remove validators\\n function setRegistrator(address _address) external onlyGovernor {\\n emit RegistratorChanged(_address);\\n validatorRegistrator = _address;\\n }\\n\\n /// @notice Set the address of the staking monitor that is allowed to reset stakeETHTally\\n function setStakingMonitor(address _address) external onlyGovernor {\\n emit StakingMonitorChanged(_address);\\n stakingMonitor = _address;\\n }\\n\\n /// @notice Set the amount of ETH that can be staked before staking monitor\\n // needs to a approve further staking by resetting the stake ETH tally\\n function setStakeETHThreshold(uint256 _amount) external onlyGovernor {\\n emit StakeETHThresholdChanged(_amount);\\n stakeETHThreshold = _amount;\\n }\\n\\n /// @notice Reset the stakeETHTally\\n function resetStakeETHTally() external onlyStakingMonitor {\\n emit StakeETHTallyReset();\\n stakeETHTally = 0;\\n }\\n\\n /// @notice Stakes WETH to the node validators\\n /// @param validators A list of validator data needed to stake.\\n /// The `ValidatorStakeData` struct contains the pubkey, signature and depositDataRoot.\\n /// Only the registrator can call this function.\\n // slither-disable-start reentrancy-eth\\n function stakeEth(ValidatorStakeData[] calldata validators)\\n external\\n onlyRegistrator\\n whenNotPaused\\n {\\n uint256 requiredETH = validators.length * 32 ether;\\n\\n // Check there is enough WETH from the deposits sitting in this strategy contract\\n require(\\n requiredETH <= IWETH9(WETH_TOKEN_ADDRESS).balanceOf(address(this)),\\n \\\"insufficient WETH\\\"\\n );\\n\\n require(\\n stakeETHTally + requiredETH <= stakeETHThreshold,\\n \\\"Staking ETH over threshold\\\"\\n );\\n stakeETHTally += requiredETH;\\n\\n // Convert required ETH from WETH\\n IWETH9(WETH_TOKEN_ADDRESS).withdraw(requiredETH);\\n _wethWithdrawnAndStaked(requiredETH);\\n\\n /* 0x01 to indicate that withdrawal credentials will contain an EOA address that the sweeping function\\n * can sweep funds to.\\n * bytes11(0) to fill up the required zeros\\n * remaining bytes20 are for the address\\n */\\n bytes memory withdrawal_credentials = abi.encodePacked(\\n bytes1(0x01),\\n bytes11(0),\\n address(this)\\n );\\n\\n uint256 validatorsLength = validators.length;\\n // For each validator\\n for (uint256 i = 0; i < validatorsLength; ) {\\n bytes32 pubkeyHash = keccak256(validators[i].pubkey);\\n VALIDATOR_STATE currentState = validatorsStates[pubkeyHash];\\n\\n require(\\n currentState == VALIDATOR_STATE.REGISTERED,\\n \\\"Validator not registered\\\"\\n );\\n\\n IDepositContract(BEACON_CHAIN_DEPOSIT_CONTRACT).deposit{\\n value: 32 ether\\n }(\\n validators[i].pubkey,\\n withdrawal_credentials,\\n validators[i].signature,\\n validators[i].depositDataRoot\\n );\\n\\n emit ETHStaked(\\n validators[i].pubkey,\\n 32 ether,\\n withdrawal_credentials\\n );\\n\\n validatorsStates[pubkeyHash] = VALIDATOR_STATE.STAKED;\\n\\n unchecked {\\n ++i;\\n }\\n }\\n // save gas by changing this storage variable only once rather each time in the loop.\\n activeDepositedValidators += validatorsLength;\\n }\\n\\n // slither-disable-end reentrancy-eth\\n\\n /// @notice Registers a new validator in the SSV Cluster.\\n /// Only the registrator can call this function.\\n function registerSsvValidator(\\n bytes calldata publicKey,\\n uint64[] calldata operatorIds,\\n bytes calldata sharesData,\\n uint256 amount,\\n Cluster calldata cluster\\n ) external onlyRegistrator whenNotPaused {\\n ISSVNetwork(SSV_NETWORK_ADDRESS).registerValidator(\\n publicKey,\\n operatorIds,\\n sharesData,\\n amount,\\n cluster\\n );\\n validatorsStates[keccak256(publicKey)] = VALIDATOR_STATE.REGISTERED;\\n emit SSVValidatorRegistered(publicKey, operatorIds);\\n }\\n\\n /// @notice Exit a validator from the Beacon chain.\\n /// The staked ETH will eventually swept to this native staking strategy.\\n /// Only the registrator can call this function.\\n // slither-disable-start reentrancy-no-eth\\n function exitSsvValidator(\\n bytes calldata publicKey,\\n uint64[] calldata operatorIds\\n ) external onlyRegistrator whenNotPaused {\\n VALIDATOR_STATE currentState = validatorsStates[keccak256(publicKey)];\\n require(currentState == VALIDATOR_STATE.STAKED, \\\"Validator not staked\\\");\\n\\n ISSVNetwork(SSV_NETWORK_ADDRESS).exitValidator(publicKey, operatorIds);\\n emit SSVValidatorExitInitiated(publicKey, operatorIds);\\n\\n validatorsStates[keccak256(publicKey)] = VALIDATOR_STATE.EXITING;\\n }\\n\\n // slither-disable-end reentrancy-no-eth\\n\\n /// @notice Remove a validator from the SSV Cluster.\\n /// Make sure `exitSsvValidator` is called before and the validate has exited the Beacon chain.\\n /// If removed before the validator has exited the beacon chain will result in the validator being slashed.\\n /// Only the registrator can call this function.\\n // slither-disable-start reentrancy-no-eth\\n function removeSsvValidator(\\n bytes calldata publicKey,\\n uint64[] calldata operatorIds,\\n Cluster calldata cluster\\n ) external onlyRegistrator whenNotPaused {\\n VALIDATOR_STATE currentState = validatorsStates[keccak256(publicKey)];\\n require(\\n currentState == VALIDATOR_STATE.EXITING,\\n \\\"Validator not exiting\\\"\\n );\\n\\n ISSVNetwork(SSV_NETWORK_ADDRESS).removeValidator(\\n publicKey,\\n operatorIds,\\n cluster\\n );\\n emit SSVValidatorExitCompleted(publicKey, operatorIds);\\n\\n validatorsStates[keccak256(publicKey)] = VALIDATOR_STATE.EXIT_COMPLETE;\\n }\\n\\n // slither-disable-end reentrancy-no-eth\\n\\n /// @notice Deposits more SSV Tokens to the SSV Network contract which is used to pay the SSV Operators.\\n /// @dev A SSV cluster is defined by the SSVOwnerAddress and the set of operatorIds.\\n /// uses \\\"onlyStrategist\\\" modifier so continuous front-running can't DOS our maintenance service\\n /// that tries to top up SSV tokens.\\n /// @param cluster The SSV cluster details that must be derived from emitted events from the SSVNetwork contract.\\n function depositSSV(\\n uint64[] memory operatorIds,\\n uint256 amount,\\n Cluster memory cluster\\n ) external onlyStrategist {\\n ISSVNetwork(SSV_NETWORK_ADDRESS).deposit(\\n address(this),\\n operatorIds,\\n amount,\\n cluster\\n );\\n }\\n\\n /***************************************\\n Abstract\\n ****************************************/\\n\\n /// @dev allows for NativeStakingSSVStrategy contract know how much WETH had been staked\\n function _wethWithdrawnAndStaked(uint256 _amount) internal virtual;\\n}\\n\",\"keccak256\":\"0xe2aace3979938c643a5c5ece3869c0901cad82b86be03d64a64192071522da7f\",\"license\":\"MIT\"},\"contracts/token/OUSD.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title OUSD Token Contract\\n * @dev ERC20 compatible contract for OUSD\\n * @dev Implements an elastic supply\\n * @author Origin Protocol Inc\\n */\\nimport { SafeMath } from \\\"@openzeppelin/contracts/utils/math/SafeMath.sol\\\";\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\n\\nimport { Initializable } from \\\"../utils/Initializable.sol\\\";\\nimport { InitializableERC20Detailed } from \\\"../utils/InitializableERC20Detailed.sol\\\";\\nimport { StableMath } from \\\"../utils/StableMath.sol\\\";\\nimport { Governable } from \\\"../governance/Governable.sol\\\";\\n\\n/**\\n * NOTE that this is an ERC20 token but the invariant that the sum of\\n * balanceOf(x) for all x is not >= totalSupply(). This is a consequence of the\\n * rebasing design. Any integrations with OUSD should be aware.\\n */\\n\\ncontract OUSD is Initializable, InitializableERC20Detailed, Governable {\\n using SafeMath for uint256;\\n using StableMath for uint256;\\n\\n event TotalSupplyUpdatedHighres(\\n uint256 totalSupply,\\n uint256 rebasingCredits,\\n uint256 rebasingCreditsPerToken\\n );\\n event AccountRebasingEnabled(address account);\\n event AccountRebasingDisabled(address account);\\n\\n enum RebaseOptions {\\n NotSet,\\n OptOut,\\n OptIn\\n }\\n\\n uint256 private constant MAX_SUPPLY = ~uint128(0); // (2^128) - 1\\n uint256 public _totalSupply;\\n mapping(address => mapping(address => uint256)) private _allowances;\\n address public vaultAddress = address(0);\\n mapping(address => uint256) private _creditBalances;\\n uint256 private _rebasingCredits;\\n uint256 private _rebasingCreditsPerToken;\\n // Frozen address/credits are non rebasing (value is held in contracts which\\n // do not receive yield unless they explicitly opt in)\\n uint256 public nonRebasingSupply;\\n mapping(address => uint256) public nonRebasingCreditsPerToken;\\n mapping(address => RebaseOptions) public rebaseState;\\n mapping(address => uint256) public isUpgraded;\\n\\n uint256 private constant RESOLUTION_INCREASE = 1e9;\\n\\n function initialize(\\n string calldata _nameArg,\\n string calldata _symbolArg,\\n address _vaultAddress,\\n uint256 _initialCreditsPerToken\\n ) external onlyGovernor initializer {\\n InitializableERC20Detailed._initialize(_nameArg, _symbolArg, 18);\\n _rebasingCreditsPerToken = _initialCreditsPerToken;\\n vaultAddress = _vaultAddress;\\n }\\n\\n /**\\n * @dev Verifies that the caller is the Vault contract\\n */\\n modifier onlyVault() {\\n require(vaultAddress == msg.sender, \\\"Caller is not the Vault\\\");\\n _;\\n }\\n\\n /**\\n * @return The total supply of OUSD.\\n */\\n function totalSupply() public view override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @return Low resolution rebasingCreditsPerToken\\n */\\n function rebasingCreditsPerToken() public view returns (uint256) {\\n return _rebasingCreditsPerToken / RESOLUTION_INCREASE;\\n }\\n\\n /**\\n * @return Low resolution total number of rebasing credits\\n */\\n function rebasingCredits() public view returns (uint256) {\\n return _rebasingCredits / RESOLUTION_INCREASE;\\n }\\n\\n /**\\n * @return High resolution rebasingCreditsPerToken\\n */\\n function rebasingCreditsPerTokenHighres() public view returns (uint256) {\\n return _rebasingCreditsPerToken;\\n }\\n\\n /**\\n * @return High resolution total number of rebasing credits\\n */\\n function rebasingCreditsHighres() public view returns (uint256) {\\n return _rebasingCredits;\\n }\\n\\n /**\\n * @dev Gets the balance of the specified address.\\n * @param _account Address to query the balance of.\\n * @return A uint256 representing the amount of base units owned by the\\n * specified address.\\n */\\n function balanceOf(address _account)\\n public\\n view\\n override\\n returns (uint256)\\n {\\n if (_creditBalances[_account] == 0) return 0;\\n return\\n _creditBalances[_account].divPrecisely(_creditsPerToken(_account));\\n }\\n\\n /**\\n * @dev Gets the credits balance of the specified address.\\n * @dev Backwards compatible with old low res credits per token.\\n * @param _account The address to query the balance of.\\n * @return (uint256, uint256) Credit balance and credits per token of the\\n * address\\n */\\n function creditsBalanceOf(address _account)\\n public\\n view\\n returns (uint256, uint256)\\n {\\n uint256 cpt = _creditsPerToken(_account);\\n if (cpt == 1e27) {\\n // For a period before the resolution upgrade, we created all new\\n // contract accounts at high resolution. Since they are not changing\\n // as a result of this upgrade, we will return their true values\\n return (_creditBalances[_account], cpt);\\n } else {\\n return (\\n _creditBalances[_account] / RESOLUTION_INCREASE,\\n cpt / RESOLUTION_INCREASE\\n );\\n }\\n }\\n\\n /**\\n * @dev Gets the credits balance of the specified address.\\n * @param _account The address to query the balance of.\\n * @return (uint256, uint256, bool) Credit balance, credits per token of the\\n * address, and isUpgraded\\n */\\n function creditsBalanceOfHighres(address _account)\\n public\\n view\\n returns (\\n uint256,\\n uint256,\\n bool\\n )\\n {\\n return (\\n _creditBalances[_account],\\n _creditsPerToken(_account),\\n isUpgraded[_account] == 1\\n );\\n }\\n\\n /**\\n * @dev Transfer tokens to a specified address.\\n * @param _to the address to transfer to.\\n * @param _value the amount to be transferred.\\n * @return true on success.\\n */\\n function transfer(address _to, uint256 _value)\\n public\\n override\\n returns (bool)\\n {\\n require(_to != address(0), \\\"Transfer to zero address\\\");\\n require(\\n _value <= balanceOf(msg.sender),\\n \\\"Transfer greater than balance\\\"\\n );\\n\\n _executeTransfer(msg.sender, _to, _value);\\n\\n emit Transfer(msg.sender, _to, _value);\\n\\n return true;\\n }\\n\\n /**\\n * @dev Transfer tokens from one address to another.\\n * @param _from The address you want to send tokens from.\\n * @param _to The address you want to transfer to.\\n * @param _value The amount of tokens to be transferred.\\n */\\n function transferFrom(\\n address _from,\\n address _to,\\n uint256 _value\\n ) public override returns (bool) {\\n require(_to != address(0), \\\"Transfer to zero address\\\");\\n require(_value <= balanceOf(_from), \\\"Transfer greater than balance\\\");\\n\\n _allowances[_from][msg.sender] = _allowances[_from][msg.sender].sub(\\n _value\\n );\\n\\n _executeTransfer(_from, _to, _value);\\n\\n emit Transfer(_from, _to, _value);\\n\\n return true;\\n }\\n\\n /**\\n * @dev Update the count of non rebasing credits in response to a transfer\\n * @param _from The address you want to send tokens from.\\n * @param _to The address you want to transfer to.\\n * @param _value Amount of OUSD to transfer\\n */\\n function _executeTransfer(\\n address _from,\\n address _to,\\n uint256 _value\\n ) internal {\\n bool isNonRebasingTo = _isNonRebasingAccount(_to);\\n bool isNonRebasingFrom = _isNonRebasingAccount(_from);\\n\\n // Credits deducted and credited might be different due to the\\n // differing creditsPerToken used by each account\\n uint256 creditsCredited = _value.mulTruncate(_creditsPerToken(_to));\\n uint256 creditsDeducted = _value.mulTruncate(_creditsPerToken(_from));\\n\\n _creditBalances[_from] = _creditBalances[_from].sub(\\n creditsDeducted,\\n \\\"Transfer amount exceeds balance\\\"\\n );\\n _creditBalances[_to] = _creditBalances[_to].add(creditsCredited);\\n\\n if (isNonRebasingTo && !isNonRebasingFrom) {\\n // Transfer to non-rebasing account from rebasing account, credits\\n // are removed from the non rebasing tally\\n nonRebasingSupply = nonRebasingSupply.add(_value);\\n // Update rebasingCredits by subtracting the deducted amount\\n _rebasingCredits = _rebasingCredits.sub(creditsDeducted);\\n } else if (!isNonRebasingTo && isNonRebasingFrom) {\\n // Transfer to rebasing account from non-rebasing account\\n // Decreasing non-rebasing credits by the amount that was sent\\n nonRebasingSupply = nonRebasingSupply.sub(_value);\\n // Update rebasingCredits by adding the credited amount\\n _rebasingCredits = _rebasingCredits.add(creditsCredited);\\n }\\n }\\n\\n /**\\n * @dev Function to check the amount of tokens that _owner has allowed to\\n * `_spender`.\\n * @param _owner The address which owns the funds.\\n * @param _spender The address which will spend the funds.\\n * @return The number of tokens still available for the _spender.\\n */\\n function allowance(address _owner, address _spender)\\n public\\n view\\n override\\n returns (uint256)\\n {\\n return _allowances[_owner][_spender];\\n }\\n\\n /**\\n * @dev Approve the passed address to spend the specified amount of tokens\\n * on behalf of msg.sender. This method is included for ERC20\\n * compatibility. `increaseAllowance` and `decreaseAllowance` should be\\n * used instead.\\n *\\n * Changing an allowance with this method brings the risk that someone\\n * may transfer both the old and the new allowance - if they are both\\n * greater than zero - if a transfer transaction is mined before the\\n * later approve() call is mined.\\n * @param _spender The address which will spend the funds.\\n * @param _value The amount of tokens to be spent.\\n */\\n function approve(address _spender, uint256 _value)\\n public\\n override\\n returns (bool)\\n {\\n _allowances[msg.sender][_spender] = _value;\\n emit Approval(msg.sender, _spender, _value);\\n return true;\\n }\\n\\n /**\\n * @dev Increase the amount of tokens that an owner has allowed to\\n * `_spender`.\\n * This method should be used instead of approve() to avoid the double\\n * approval vulnerability described above.\\n * @param _spender The address which will spend the funds.\\n * @param _addedValue The amount of tokens to increase the allowance by.\\n */\\n function increaseAllowance(address _spender, uint256 _addedValue)\\n public\\n returns (bool)\\n {\\n _allowances[msg.sender][_spender] = _allowances[msg.sender][_spender]\\n .add(_addedValue);\\n emit Approval(msg.sender, _spender, _allowances[msg.sender][_spender]);\\n return true;\\n }\\n\\n /**\\n * @dev Decrease the amount of tokens that an owner has allowed to\\n `_spender`.\\n * @param _spender The address which will spend the funds.\\n * @param _subtractedValue The amount of tokens to decrease the allowance\\n * by.\\n */\\n function decreaseAllowance(address _spender, uint256 _subtractedValue)\\n public\\n returns (bool)\\n {\\n uint256 oldValue = _allowances[msg.sender][_spender];\\n if (_subtractedValue >= oldValue) {\\n _allowances[msg.sender][_spender] = 0;\\n } else {\\n _allowances[msg.sender][_spender] = oldValue.sub(_subtractedValue);\\n }\\n emit Approval(msg.sender, _spender, _allowances[msg.sender][_spender]);\\n return true;\\n }\\n\\n /**\\n * @dev Mints new tokens, increasing totalSupply.\\n */\\n function mint(address _account, uint256 _amount) external onlyVault {\\n _mint(_account, _amount);\\n }\\n\\n /**\\n * @dev Creates `_amount` tokens and assigns them to `_account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements\\n *\\n * - `to` cannot be the zero address.\\n */\\n function _mint(address _account, uint256 _amount) internal nonReentrant {\\n require(_account != address(0), \\\"Mint to the zero address\\\");\\n\\n bool isNonRebasingAccount = _isNonRebasingAccount(_account);\\n\\n uint256 creditAmount = _amount.mulTruncate(_creditsPerToken(_account));\\n _creditBalances[_account] = _creditBalances[_account].add(creditAmount);\\n\\n // If the account is non rebasing and doesn't have a set creditsPerToken\\n // then set it i.e. this is a mint from a fresh contract\\n if (isNonRebasingAccount) {\\n nonRebasingSupply = nonRebasingSupply.add(_amount);\\n } else {\\n _rebasingCredits = _rebasingCredits.add(creditAmount);\\n }\\n\\n _totalSupply = _totalSupply.add(_amount);\\n\\n require(_totalSupply < MAX_SUPPLY, \\\"Max supply\\\");\\n\\n emit Transfer(address(0), _account, _amount);\\n }\\n\\n /**\\n * @dev Burns tokens, decreasing totalSupply.\\n */\\n function burn(address account, uint256 amount) external onlyVault {\\n _burn(account, amount);\\n }\\n\\n /**\\n * @dev Destroys `_amount` tokens from `_account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements\\n *\\n * - `_account` cannot be the zero address.\\n * - `_account` must have at least `_amount` tokens.\\n */\\n function _burn(address _account, uint256 _amount) internal nonReentrant {\\n require(_account != address(0), \\\"Burn from the zero address\\\");\\n if (_amount == 0) {\\n return;\\n }\\n\\n bool isNonRebasingAccount = _isNonRebasingAccount(_account);\\n uint256 creditAmount = _amount.mulTruncate(_creditsPerToken(_account));\\n uint256 currentCredits = _creditBalances[_account];\\n\\n // Remove the credits, burning rounding errors\\n if (\\n currentCredits == creditAmount || currentCredits - 1 == creditAmount\\n ) {\\n // Handle dust from rounding\\n _creditBalances[_account] = 0;\\n } else if (currentCredits > creditAmount) {\\n _creditBalances[_account] = _creditBalances[_account].sub(\\n creditAmount\\n );\\n } else {\\n revert(\\\"Remove exceeds balance\\\");\\n }\\n\\n // Remove from the credit tallies and non-rebasing supply\\n if (isNonRebasingAccount) {\\n nonRebasingSupply = nonRebasingSupply.sub(_amount);\\n } else {\\n _rebasingCredits = _rebasingCredits.sub(creditAmount);\\n }\\n\\n _totalSupply = _totalSupply.sub(_amount);\\n\\n emit Transfer(_account, address(0), _amount);\\n }\\n\\n /**\\n * @dev Get the credits per token for an account. Returns a fixed amount\\n * if the account is non-rebasing.\\n * @param _account Address of the account.\\n */\\n function _creditsPerToken(address _account)\\n internal\\n view\\n returns (uint256)\\n {\\n if (nonRebasingCreditsPerToken[_account] != 0) {\\n return nonRebasingCreditsPerToken[_account];\\n } else {\\n return _rebasingCreditsPerToken;\\n }\\n }\\n\\n /**\\n * @dev Is an account using rebasing accounting or non-rebasing accounting?\\n * Also, ensure contracts are non-rebasing if they have not opted in.\\n * @param _account Address of the account.\\n */\\n function _isNonRebasingAccount(address _account) internal returns (bool) {\\n bool isContract = Address.isContract(_account);\\n if (isContract && rebaseState[_account] == RebaseOptions.NotSet) {\\n _ensureRebasingMigration(_account);\\n }\\n return nonRebasingCreditsPerToken[_account] > 0;\\n }\\n\\n /**\\n * @dev Ensures internal account for rebasing and non-rebasing credits and\\n * supply is updated following deployment of frozen yield change.\\n */\\n function _ensureRebasingMigration(address _account) internal {\\n if (nonRebasingCreditsPerToken[_account] == 0) {\\n emit AccountRebasingDisabled(_account);\\n if (_creditBalances[_account] == 0) {\\n // Since there is no existing balance, we can directly set to\\n // high resolution, and do not have to do any other bookkeeping\\n nonRebasingCreditsPerToken[_account] = 1e27;\\n } else {\\n // Migrate an existing account:\\n\\n // Set fixed credits per token for this account\\n nonRebasingCreditsPerToken[_account] = _rebasingCreditsPerToken;\\n // Update non rebasing supply\\n nonRebasingSupply = nonRebasingSupply.add(balanceOf(_account));\\n // Update credit tallies\\n _rebasingCredits = _rebasingCredits.sub(\\n _creditBalances[_account]\\n );\\n }\\n }\\n }\\n\\n /**\\n * @notice Enable rebasing for an account.\\n * @dev Add a contract address to the non-rebasing exception list. The\\n * address's balance will be part of rebases and the account will be exposed\\n * to upside and downside.\\n * @param _account Address of the account.\\n */\\n function governanceRebaseOptIn(address _account)\\n public\\n nonReentrant\\n onlyGovernor\\n {\\n _rebaseOptIn(_account);\\n }\\n\\n /**\\n * @dev Add a contract address to the non-rebasing exception list. The\\n * address's balance will be part of rebases and the account will be exposed\\n * to upside and downside.\\n */\\n function rebaseOptIn() public nonReentrant {\\n _rebaseOptIn(msg.sender);\\n }\\n\\n function _rebaseOptIn(address _account) internal {\\n require(_isNonRebasingAccount(_account), \\\"Account has not opted out\\\");\\n\\n // Convert balance into the same amount at the current exchange rate\\n uint256 newCreditBalance = _creditBalances[_account]\\n .mul(_rebasingCreditsPerToken)\\n .div(_creditsPerToken(_account));\\n\\n // Decreasing non rebasing supply\\n nonRebasingSupply = nonRebasingSupply.sub(balanceOf(_account));\\n\\n _creditBalances[_account] = newCreditBalance;\\n\\n // Increase rebasing credits, totalSupply remains unchanged so no\\n // adjustment necessary\\n _rebasingCredits = _rebasingCredits.add(_creditBalances[_account]);\\n\\n rebaseState[_account] = RebaseOptions.OptIn;\\n\\n // Delete any fixed credits per token\\n delete nonRebasingCreditsPerToken[_account];\\n emit AccountRebasingEnabled(_account);\\n }\\n\\n /**\\n * @dev Explicitly mark that an address is non-rebasing.\\n */\\n function rebaseOptOut() public nonReentrant {\\n require(!_isNonRebasingAccount(msg.sender), \\\"Account has not opted in\\\");\\n\\n // Increase non rebasing supply\\n nonRebasingSupply = nonRebasingSupply.add(balanceOf(msg.sender));\\n // Set fixed credits per token\\n nonRebasingCreditsPerToken[msg.sender] = _rebasingCreditsPerToken;\\n\\n // Decrease rebasing credits, total supply remains unchanged so no\\n // adjustment necessary\\n _rebasingCredits = _rebasingCredits.sub(_creditBalances[msg.sender]);\\n\\n // Mark explicitly opted out of rebasing\\n rebaseState[msg.sender] = RebaseOptions.OptOut;\\n emit AccountRebasingDisabled(msg.sender);\\n }\\n\\n /**\\n * @dev Modify the supply without minting new tokens. This uses a change in\\n * the exchange rate between \\\"credits\\\" and OUSD tokens to change balances.\\n * @param _newTotalSupply New total supply of OUSD.\\n */\\n function changeSupply(uint256 _newTotalSupply)\\n external\\n onlyVault\\n nonReentrant\\n {\\n require(_totalSupply > 0, \\\"Cannot increase 0 supply\\\");\\n\\n if (_totalSupply == _newTotalSupply) {\\n emit TotalSupplyUpdatedHighres(\\n _totalSupply,\\n _rebasingCredits,\\n _rebasingCreditsPerToken\\n );\\n return;\\n }\\n\\n _totalSupply = _newTotalSupply > MAX_SUPPLY\\n ? MAX_SUPPLY\\n : _newTotalSupply;\\n\\n _rebasingCreditsPerToken = _rebasingCredits.divPrecisely(\\n _totalSupply.sub(nonRebasingSupply)\\n );\\n\\n require(_rebasingCreditsPerToken > 0, \\\"Invalid change in supply\\\");\\n\\n _totalSupply = _rebasingCredits\\n .divPrecisely(_rebasingCreditsPerToken)\\n .add(nonRebasingSupply);\\n\\n emit TotalSupplyUpdatedHighres(\\n _totalSupply,\\n _rebasingCredits,\\n _rebasingCreditsPerToken\\n );\\n }\\n}\\n\",\"keccak256\":\"0x2dc66b1ba02716d64eb47dd9117fda62650d8b57669e6c351437e0ad29ad5f19\",\"license\":\"MIT\"},\"contracts/utils/Helpers.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IBasicToken } from \\\"../interfaces/IBasicToken.sol\\\";\\n\\nlibrary Helpers {\\n /**\\n * @notice Fetch the `symbol()` from an ERC20 token\\n * @dev Grabs the `symbol()` from a contract\\n * @param _token Address of the ERC20 token\\n * @return string Symbol of the ERC20 token\\n */\\n function getSymbol(address _token) internal view returns (string memory) {\\n string memory symbol = IBasicToken(_token).symbol();\\n return symbol;\\n }\\n\\n /**\\n * @notice Fetch the `decimals()` from an ERC20 token\\n * @dev Grabs the `decimals()` from a contract and fails if\\n * the decimal value does not live within a certain range\\n * @param _token Address of the ERC20 token\\n * @return uint256 Decimals of the ERC20 token\\n */\\n function getDecimals(address _token) internal view returns (uint256) {\\n uint256 decimals = IBasicToken(_token).decimals();\\n require(\\n decimals >= 4 && decimals <= 18,\\n \\\"Token must have sufficient decimal places\\\"\\n );\\n\\n return decimals;\\n }\\n}\\n\",\"keccak256\":\"0x108b7a69e0140da0072ca18f90a03a3340574400f81aa6076cd2cccdf13699c2\",\"license\":\"MIT\"},\"contracts/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Base contract any contracts that need to initialize state after deployment.\\n * @author Origin Protocol Inc\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n require(\\n initializing || !initialized,\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n\\n bool isTopLevelCall = !initializing;\\n if (isTopLevelCall) {\\n initializing = true;\\n initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n initializing = false;\\n }\\n }\\n\\n uint256[50] private ______gap;\\n}\\n\",\"keccak256\":\"0xaadbcc138114afed4af4f353c2ced2916e6ee14be91434789187f192caf0d786\",\"license\":\"MIT\"},\"contracts/utils/InitializableAbstractStrategy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Base contract for vault strategies.\\n * @author Origin Protocol Inc\\n */\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport { Initializable } from \\\"../utils/Initializable.sol\\\";\\nimport { Governable } from \\\"../governance/Governable.sol\\\";\\nimport { IVault } from \\\"../interfaces/IVault.sol\\\";\\n\\nabstract contract InitializableAbstractStrategy is Initializable, Governable {\\n using SafeERC20 for IERC20;\\n\\n event PTokenAdded(address indexed _asset, address _pToken);\\n event PTokenRemoved(address indexed _asset, address _pToken);\\n event Deposit(address indexed _asset, address _pToken, uint256 _amount);\\n event Withdrawal(address indexed _asset, address _pToken, uint256 _amount);\\n event RewardTokenCollected(\\n address recipient,\\n address rewardToken,\\n uint256 amount\\n );\\n event RewardTokenAddressesUpdated(\\n address[] _oldAddresses,\\n address[] _newAddresses\\n );\\n event HarvesterAddressesUpdated(\\n address _oldHarvesterAddress,\\n address _newHarvesterAddress\\n );\\n\\n /// @notice Address of the underlying platform\\n address public immutable platformAddress;\\n /// @notice Address of the OToken vault\\n address public immutable vaultAddress;\\n\\n /// @dev Replaced with an immutable variable\\n // slither-disable-next-line constable-states\\n address private _deprecated_platformAddress;\\n\\n /// @dev Replaced with an immutable\\n // slither-disable-next-line constable-states\\n address private _deprecated_vaultAddress;\\n\\n /// @notice asset => pToken (Platform Specific Token Address)\\n mapping(address => address) public assetToPToken;\\n\\n /// @notice Full list of all assets supported by the strategy\\n address[] internal assetsMapped;\\n\\n // Deprecated: Reward token address\\n // slither-disable-next-line constable-states\\n address private _deprecated_rewardTokenAddress;\\n\\n // Deprecated: now resides in Harvester's rewardTokenConfigs\\n // slither-disable-next-line constable-states\\n uint256 private _deprecated_rewardLiquidationThreshold;\\n\\n /// @notice Address of the Harvester contract allowed to collect reward tokens\\n address public harvesterAddress;\\n\\n /// @notice Address of the reward tokens. eg CRV, BAL, CVX, AURA\\n address[] public rewardTokenAddresses;\\n\\n /* Reserved for future expansion. Used to be 100 storage slots\\n * and has decreased to accommodate:\\n * - harvesterAddress\\n * - rewardTokenAddresses\\n */\\n int256[98] private _reserved;\\n\\n struct BaseStrategyConfig {\\n address platformAddress; // Address of the underlying platform\\n address vaultAddress; // Address of the OToken's Vault\\n }\\n\\n /**\\n * @param _config The platform and OToken vault addresses\\n */\\n constructor(BaseStrategyConfig memory _config) {\\n platformAddress = _config.platformAddress;\\n vaultAddress = _config.vaultAddress;\\n }\\n\\n /**\\n * @dev Internal initialize function, to set up initial internal state\\n * @param _rewardTokenAddresses Address of reward token for platform\\n * @param _assets Addresses of initial supported assets\\n * @param _pTokens Platform Token corresponding addresses\\n */\\n function _initialize(\\n address[] memory _rewardTokenAddresses,\\n address[] memory _assets,\\n address[] memory _pTokens\\n ) internal {\\n rewardTokenAddresses = _rewardTokenAddresses;\\n\\n uint256 assetCount = _assets.length;\\n require(assetCount == _pTokens.length, \\\"Invalid input arrays\\\");\\n for (uint256 i = 0; i < assetCount; ++i) {\\n _setPTokenAddress(_assets[i], _pTokens[i]);\\n }\\n }\\n\\n /**\\n * @notice Collect accumulated reward token and send to Vault.\\n */\\n function collectRewardTokens() external virtual onlyHarvester nonReentrant {\\n _collectRewardTokens();\\n }\\n\\n /**\\n * @dev Default implementation that transfers reward tokens to the Harvester\\n * Implementing strategies need to add custom logic to collect the rewards.\\n */\\n function _collectRewardTokens() internal virtual {\\n uint256 rewardTokenCount = rewardTokenAddresses.length;\\n for (uint256 i = 0; i < rewardTokenCount; ++i) {\\n IERC20 rewardToken = IERC20(rewardTokenAddresses[i]);\\n uint256 balance = rewardToken.balanceOf(address(this));\\n if (balance > 0) {\\n emit RewardTokenCollected(\\n harvesterAddress,\\n address(rewardToken),\\n balance\\n );\\n rewardToken.safeTransfer(harvesterAddress, balance);\\n }\\n }\\n }\\n\\n /**\\n * @dev Verifies that the caller is the Vault.\\n */\\n modifier onlyVault() {\\n require(msg.sender == vaultAddress, \\\"Caller is not the Vault\\\");\\n _;\\n }\\n\\n /**\\n * @dev Verifies that the caller is the Harvester.\\n */\\n modifier onlyHarvester() {\\n require(msg.sender == harvesterAddress, \\\"Caller is not the Harvester\\\");\\n _;\\n }\\n\\n /**\\n * @dev Verifies that the caller is the Vault or Governor.\\n */\\n modifier onlyVaultOrGovernor() {\\n require(\\n msg.sender == vaultAddress || msg.sender == governor(),\\n \\\"Caller is not the Vault or Governor\\\"\\n );\\n _;\\n }\\n\\n /**\\n * @dev Verifies that the caller is the Vault, Governor, or Strategist.\\n */\\n modifier onlyVaultOrGovernorOrStrategist() {\\n require(\\n msg.sender == vaultAddress ||\\n msg.sender == governor() ||\\n msg.sender == IVault(vaultAddress).strategistAddr(),\\n \\\"Caller is not the Vault, Governor, or Strategist\\\"\\n );\\n _;\\n }\\n\\n /**\\n * @notice Set the reward token addresses. Any old addresses will be overwritten.\\n * @param _rewardTokenAddresses Array of reward token addresses\\n */\\n function setRewardTokenAddresses(address[] calldata _rewardTokenAddresses)\\n external\\n onlyGovernor\\n {\\n uint256 rewardTokenCount = _rewardTokenAddresses.length;\\n for (uint256 i = 0; i < rewardTokenCount; ++i) {\\n require(\\n _rewardTokenAddresses[i] != address(0),\\n \\\"Can not set an empty address as a reward token\\\"\\n );\\n }\\n\\n emit RewardTokenAddressesUpdated(\\n rewardTokenAddresses,\\n _rewardTokenAddresses\\n );\\n rewardTokenAddresses = _rewardTokenAddresses;\\n }\\n\\n /**\\n * @notice Get the reward token addresses.\\n * @return address[] the reward token addresses.\\n */\\n function getRewardTokenAddresses()\\n external\\n view\\n returns (address[] memory)\\n {\\n return rewardTokenAddresses;\\n }\\n\\n /**\\n * @notice Provide support for asset by passing its pToken address.\\n * This method can only be called by the system Governor\\n * @param _asset Address for the asset\\n * @param _pToken Address for the corresponding platform token\\n */\\n function setPTokenAddress(address _asset, address _pToken)\\n external\\n virtual\\n onlyGovernor\\n {\\n _setPTokenAddress(_asset, _pToken);\\n }\\n\\n /**\\n * @notice Remove a supported asset by passing its index.\\n * This method can only be called by the system Governor\\n * @param _assetIndex Index of the asset to be removed\\n */\\n function removePToken(uint256 _assetIndex) external virtual onlyGovernor {\\n require(_assetIndex < assetsMapped.length, \\\"Invalid index\\\");\\n address asset = assetsMapped[_assetIndex];\\n address pToken = assetToPToken[asset];\\n\\n if (_assetIndex < assetsMapped.length - 1) {\\n assetsMapped[_assetIndex] = assetsMapped[assetsMapped.length - 1];\\n }\\n assetsMapped.pop();\\n assetToPToken[asset] = address(0);\\n\\n emit PTokenRemoved(asset, pToken);\\n }\\n\\n /**\\n * @notice Provide support for asset by passing its pToken address.\\n * Add to internal mappings and execute the platform specific,\\n * abstract method `_abstractSetPToken`\\n * @param _asset Address for the asset\\n * @param _pToken Address for the corresponding platform token\\n */\\n function _setPTokenAddress(address _asset, address _pToken) internal {\\n require(assetToPToken[_asset] == address(0), \\\"pToken already set\\\");\\n require(\\n _asset != address(0) && _pToken != address(0),\\n \\\"Invalid addresses\\\"\\n );\\n\\n assetToPToken[_asset] = _pToken;\\n assetsMapped.push(_asset);\\n\\n emit PTokenAdded(_asset, _pToken);\\n\\n _abstractSetPToken(_asset, _pToken);\\n }\\n\\n /**\\n * @notice Transfer token to governor. Intended for recovering tokens stuck in\\n * strategy contracts, i.e. mistaken sends.\\n * @param _asset Address for the asset\\n * @param _amount Amount of the asset to transfer\\n */\\n function transferToken(address _asset, uint256 _amount)\\n public\\n onlyGovernor\\n {\\n require(!supportsAsset(_asset), \\\"Cannot transfer supported asset\\\");\\n IERC20(_asset).safeTransfer(governor(), _amount);\\n }\\n\\n /**\\n * @notice Set the Harvester contract that can collect rewards.\\n * @param _harvesterAddress Address of the harvester contract.\\n */\\n function setHarvesterAddress(address _harvesterAddress)\\n external\\n onlyGovernor\\n {\\n emit HarvesterAddressesUpdated(harvesterAddress, _harvesterAddress);\\n harvesterAddress = _harvesterAddress;\\n }\\n\\n /***************************************\\n Abstract\\n ****************************************/\\n\\n function _abstractSetPToken(address _asset, address _pToken)\\n internal\\n virtual;\\n\\n function safeApproveAllTokens() external virtual;\\n\\n /**\\n * @notice Deposit an amount of assets into the platform\\n * @param _asset Address for the asset\\n * @param _amount Units of asset to deposit\\n */\\n function deposit(address _asset, uint256 _amount) external virtual;\\n\\n /**\\n * @notice Deposit all supported assets in this strategy contract to the platform\\n */\\n function depositAll() external virtual;\\n\\n /**\\n * @notice Withdraw an `amount` of assets from the platform and\\n * send to the `_recipient`.\\n * @param _recipient Address to which the asset should be sent\\n * @param _asset Address of the asset\\n * @param _amount Units of asset to withdraw\\n */\\n function withdraw(\\n address _recipient,\\n address _asset,\\n uint256 _amount\\n ) external virtual;\\n\\n /**\\n * @notice Withdraw all supported assets from platform and\\n * sends to the OToken's Vault.\\n */\\n function withdrawAll() external virtual;\\n\\n /**\\n * @notice Get the total asset value held in the platform.\\n * This includes any interest that was generated since depositing.\\n * @param _asset Address of the asset\\n * @return balance Total value of the asset in the platform\\n */\\n function checkBalance(address _asset)\\n external\\n view\\n virtual\\n returns (uint256 balance);\\n\\n /**\\n * @notice Check if an asset is supported.\\n * @param _asset Address of the asset\\n * @return bool Whether asset is supported\\n */\\n function supportsAsset(address _asset) public view virtual returns (bool);\\n}\\n\",\"keccak256\":\"0x5e17bb3db9f9e1014b7c5c836547f8fa81e02af7568c0bb8f2a2e0e7c2192db4\",\"license\":\"MIT\"},\"contracts/utils/InitializableERC20Detailed.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n * @dev Optional functions from the ERC20 standard.\\n * Converted from openzeppelin/contracts/token/ERC20/ERC20Detailed.sol\\n * @author Origin Protocol Inc\\n */\\nabstract contract InitializableERC20Detailed is IERC20 {\\n // Storage gap to skip storage from prior to OUSD reset\\n uint256[100] private _____gap;\\n\\n string private _name;\\n string private _symbol;\\n uint8 private _decimals;\\n\\n /**\\n * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of\\n * these values are immutable: they can only be set once during\\n * construction.\\n * @notice To avoid variable shadowing appended `Arg` after arguments name.\\n */\\n function _initialize(\\n string memory nameArg,\\n string memory symbolArg,\\n uint8 decimalsArg\\n ) internal {\\n _name = nameArg;\\n _symbol = symbolArg;\\n _decimals = decimalsArg;\\n }\\n\\n /**\\n * @notice Returns the name of the token.\\n */\\n function name() public view returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @notice Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @notice Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view returns (uint8) {\\n return _decimals;\\n }\\n}\\n\",\"keccak256\":\"0xe35ac2d813a30d845a3b52bba72588d7e936c2b3f3373d15568c14db46aeed60\",\"license\":\"MIT\"},\"contracts/utils/StableMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { SafeMath } from \\\"@openzeppelin/contracts/utils/math/SafeMath.sol\\\";\\n\\n// Based on StableMath from Stability Labs Pty. Ltd.\\n// https://github.com/mstable/mStable-contracts/blob/master/contracts/shared/StableMath.sol\\n\\nlibrary StableMath {\\n using SafeMath for uint256;\\n\\n /**\\n * @dev Scaling unit for use in specific calculations,\\n * where 1 * 10**18, or 1e18 represents a unit '1'\\n */\\n uint256 private constant FULL_SCALE = 1e18;\\n\\n /***************************************\\n Helpers\\n ****************************************/\\n\\n /**\\n * @dev Adjust the scale of an integer\\n * @param to Decimals to scale to\\n * @param from Decimals to scale from\\n */\\n function scaleBy(\\n uint256 x,\\n uint256 to,\\n uint256 from\\n ) internal pure returns (uint256) {\\n if (to > from) {\\n x = x.mul(10**(to - from));\\n } else if (to < from) {\\n // slither-disable-next-line divide-before-multiply\\n x = x.div(10**(from - to));\\n }\\n return x;\\n }\\n\\n /***************************************\\n Precise Arithmetic\\n ****************************************/\\n\\n /**\\n * @dev Multiplies two precise units, and then truncates by the full scale\\n * @param x Left hand input to multiplication\\n * @param y Right hand input to multiplication\\n * @return Result after multiplying the two inputs and then dividing by the shared\\n * scale unit\\n */\\n function mulTruncate(uint256 x, uint256 y) internal pure returns (uint256) {\\n return mulTruncateScale(x, y, FULL_SCALE);\\n }\\n\\n /**\\n * @dev Multiplies two precise units, and then truncates by the given scale. For example,\\n * when calculating 90% of 10e18, (10e18 * 9e17) / 1e18 = (9e36) / 1e18 = 9e18\\n * @param x Left hand input to multiplication\\n * @param y Right hand input to multiplication\\n * @param scale Scale unit\\n * @return Result after multiplying the two inputs and then dividing by the shared\\n * scale unit\\n */\\n function mulTruncateScale(\\n uint256 x,\\n uint256 y,\\n uint256 scale\\n ) internal pure returns (uint256) {\\n // e.g. assume scale = fullScale\\n // z = 10e18 * 9e17 = 9e36\\n uint256 z = x.mul(y);\\n // return 9e36 / 1e18 = 9e18\\n return z.div(scale);\\n }\\n\\n /**\\n * @dev Multiplies two precise units, and then truncates by the full scale, rounding up the result\\n * @param x Left hand input to multiplication\\n * @param y Right hand input to multiplication\\n * @return Result after multiplying the two inputs and then dividing by the shared\\n * scale unit, rounded up to the closest base unit.\\n */\\n function mulTruncateCeil(uint256 x, uint256 y)\\n internal\\n pure\\n returns (uint256)\\n {\\n // e.g. 8e17 * 17268172638 = 138145381104e17\\n uint256 scaled = x.mul(y);\\n // e.g. 138145381104e17 + 9.99...e17 = 138145381113.99...e17\\n uint256 ceil = scaled.add(FULL_SCALE.sub(1));\\n // e.g. 13814538111.399...e18 / 1e18 = 13814538111\\n return ceil.div(FULL_SCALE);\\n }\\n\\n /**\\n * @dev Precisely divides two units, by first scaling the left hand operand. Useful\\n * for finding percentage weightings, i.e. 8e18/10e18 = 80% (or 8e17)\\n * @param x Left hand input to division\\n * @param y Right hand input to division\\n * @return Result after multiplying the left operand by the scale, and\\n * executing the division on the right hand input.\\n */\\n function divPrecisely(uint256 x, uint256 y)\\n internal\\n pure\\n returns (uint256)\\n {\\n // e.g. 8e18 * 1e18 = 8e36\\n uint256 z = x.mul(FULL_SCALE);\\n // e.g. 8e36 / 10e18 = 8e17\\n return z.div(y);\\n }\\n}\\n\",\"keccak256\":\"0x1eb49f6f79045d9e0a8e1dced8e01d9e559e5fac554dcbb53e43140b601b04e7\",\"license\":\"MIT\"},\"contracts/vault/VaultStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title OToken VaultStorage contract\\n * @notice The VaultStorage contract defines the storage for the Vault contracts\\n * @author Origin Protocol Inc\\n */\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\n\\nimport { IStrategy } from \\\"../interfaces/IStrategy.sol\\\";\\nimport { Governable } from \\\"../governance/Governable.sol\\\";\\nimport { OUSD } from \\\"../token/OUSD.sol\\\";\\nimport { Initializable } from \\\"../utils/Initializable.sol\\\";\\nimport \\\"../utils/Helpers.sol\\\";\\n\\ncontract VaultStorage is Initializable, Governable {\\n using SafeERC20 for IERC20;\\n\\n event AssetSupported(address _asset);\\n event AssetRemoved(address _asset);\\n event AssetDefaultStrategyUpdated(address _asset, address _strategy);\\n event AssetAllocated(address _asset, address _strategy, uint256 _amount);\\n event StrategyApproved(address _addr);\\n event StrategyRemoved(address _addr);\\n event Mint(address _addr, uint256 _value);\\n event Redeem(address _addr, uint256 _value);\\n event CapitalPaused();\\n event CapitalUnpaused();\\n event RebasePaused();\\n event RebaseUnpaused();\\n event VaultBufferUpdated(uint256 _vaultBuffer);\\n event OusdMetaStrategyUpdated(address _ousdMetaStrategy);\\n event RedeemFeeUpdated(uint256 _redeemFeeBps);\\n event PriceProviderUpdated(address _priceProvider);\\n event AllocateThresholdUpdated(uint256 _threshold);\\n event RebaseThresholdUpdated(uint256 _threshold);\\n event StrategistUpdated(address _address);\\n event MaxSupplyDiffChanged(uint256 maxSupplyDiff);\\n event YieldDistribution(address _to, uint256 _yield, uint256 _fee);\\n event TrusteeFeeBpsChanged(uint256 _basis);\\n event TrusteeAddressChanged(address _address);\\n event NetOusdMintForStrategyThresholdChanged(uint256 _threshold);\\n event SwapperChanged(address _address);\\n event SwapAllowedUndervalueChanged(uint256 _basis);\\n event SwapSlippageChanged(address _asset, uint256 _basis);\\n event Swapped(\\n address indexed _fromAsset,\\n address indexed _toAsset,\\n uint256 _fromAssetAmount,\\n uint256 _toAssetAmount\\n );\\n\\n // Assets supported by the Vault, i.e. Stablecoins\\n enum UnitConversion {\\n DECIMALS,\\n GETEXCHANGERATE\\n }\\n // Changed to fit into a single storage slot so the decimals needs to be recached\\n struct Asset {\\n // Note: OETHVaultCore doesn't use `isSupported` when minting,\\n // redeeming or checking balance of assets.\\n bool isSupported;\\n UnitConversion unitConversion;\\n uint8 decimals;\\n // Max allowed slippage from the Oracle price when swapping collateral assets in basis points.\\n // For example 40 == 0.4% slippage\\n uint16 allowedOracleSlippageBps;\\n }\\n\\n /// @dev mapping of supported vault assets to their configuration\\n // slither-disable-next-line uninitialized-state\\n mapping(address => Asset) internal assets;\\n /// @dev list of all assets supported by the vault.\\n // slither-disable-next-line uninitialized-state\\n address[] internal allAssets;\\n\\n // Strategies approved for use by the Vault\\n struct Strategy {\\n bool isSupported;\\n uint256 _deprecated; // Deprecated storage slot\\n }\\n /// @dev mapping of strategy contracts to their configiration\\n mapping(address => Strategy) internal strategies;\\n /// @dev list of all vault strategies\\n address[] internal allStrategies;\\n\\n /// @notice Address of the Oracle price provider contract\\n // slither-disable-next-line uninitialized-state\\n address public priceProvider;\\n /// @notice pause rebasing if true\\n bool public rebasePaused = false;\\n /// @notice pause operations that change the OToken supply.\\n /// eg mint, redeem, allocate, mint/burn for strategy\\n bool public capitalPaused = true;\\n /// @notice Redemption fee in basis points. eg 50 = 0.5%\\n uint256 public redeemFeeBps;\\n /// @notice Percentage of assets to keep in Vault to handle (most) withdrawals. 100% = 1e18.\\n uint256 public vaultBuffer;\\n /// @notice OToken mints over this amount automatically allocate funds. 18 decimals.\\n uint256 public autoAllocateThreshold;\\n /// @notice OToken mints over this amount automatically rebase. 18 decimals.\\n uint256 public rebaseThreshold;\\n\\n /// @dev Address of the OToken token. eg OUSD or OETH.\\n // slither-disable-next-line uninitialized-state\\n OUSD internal oUSD;\\n\\n //keccak256(\\\"OUSD.vault.governor.admin.impl\\\");\\n bytes32 constant adminImplPosition =\\n 0xa2bd3d3cf188a41358c8b401076eb59066b09dec5775650c0de4c55187d17bd9;\\n\\n // Address of the contract responsible for post rebase syncs with AMMs\\n address private _deprecated_rebaseHooksAddr = address(0);\\n\\n // Deprecated: Address of Uniswap\\n // slither-disable-next-line constable-states\\n address private _deprecated_uniswapAddr = address(0);\\n\\n /// @notice Address of the Strategist\\n address public strategistAddr = address(0);\\n\\n /// @notice Mapping of asset address to the Strategy that they should automatically\\n // be allocated to\\n // slither-disable-next-line uninitialized-state\\n mapping(address => address) public assetDefaultStrategies;\\n\\n /// @notice Max difference between total supply and total value of assets. 18 decimals.\\n // slither-disable-next-line uninitialized-state\\n uint256 public maxSupplyDiff;\\n\\n /// @notice Trustee contract that can collect a percentage of yield\\n address public trusteeAddress;\\n\\n /// @notice Amount of yield collected in basis points. eg 2000 = 20%\\n uint256 public trusteeFeeBps;\\n\\n /// @dev Deprecated: Tokens that should be swapped for stablecoins\\n address[] private _deprecated_swapTokens;\\n\\n uint256 constant MINT_MINIMUM_UNIT_PRICE = 0.998e18;\\n\\n /// @notice Metapool strategy that is allowed to mint/burn OTokens without changing collateral\\n address public ousdMetaStrategy = address(0);\\n\\n /// @notice How much OTokens are currently minted by the strategy\\n int256 public netOusdMintedForStrategy = 0;\\n\\n /// @notice How much net total OTokens are allowed to be minted by all strategies\\n uint256 public netOusdMintForStrategyThreshold = 0;\\n\\n uint256 constant MIN_UNIT_PRICE_DRIFT = 0.7e18;\\n uint256 constant MAX_UNIT_PRICE_DRIFT = 1.3e18;\\n\\n /// @notice Collateral swap configuration.\\n /// @dev is packed into a single storage slot to save gas.\\n struct SwapConfig {\\n // Contract that swaps the vault's collateral assets\\n address swapper;\\n // Max allowed percentage the total value can drop below the total supply in basis points.\\n // For example 100 == 1%\\n uint16 allowedUndervalueBps;\\n }\\n SwapConfig internal swapConfig = SwapConfig(address(0), 0);\\n\\n // For future use\\n uint256[50] private __gap;\\n\\n /**\\n * @notice set the implementation for the admin, this needs to be in a base class else we cannot set it\\n * @param newImpl address of the implementation\\n */\\n function setAdminImpl(address newImpl) external onlyGovernor {\\n require(\\n Address.isContract(newImpl),\\n \\\"new implementation is not a contract\\\"\\n );\\n bytes32 position = adminImplPosition;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(position, newImpl)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcbdb87104749e20c8411bc2acbfa0b7d48e876e3f4e1c46c9a7b00fcdb9722d9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6101806040523480156200001257600080fd5b506040516200518c3803806200518c833981016040819052620000359162000138565b8585876020015183868383838362000053336200010860201b60201c565b6000805160206200516c833981519152546040516001600160a01b03909116906000907fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a908290a36033805460ff191690556001600160601b0319606094851b811660805291841b821660a052831b811660c05290821b811660e0528651821b811661010052602090960151811b86166101205298891b851661014052505050509190931b1661016052506200021392505050565b6000805160206200516c83398151915255565b80516001600160a01b03811681146200013357600080fd5b919050565b60008060008060008086880360e08112156200015357600080fd5b60408112156200016257600080fd5b50604080519081016001600160401b03811182821017156200019457634e487b7160e01b600052604160045260246000fd5b604052620001a2886200011b565b8152620001b2602089016200011b565b60208201529550620001c7604088016200011b565b9450620001d7606088016200011b565b9350620001e7608088016200011b565b9250620001f760a088016200011b565b91506200020760c088016200011b565b90509295509295509295565b60805160601c60a05160601c60c05160601c60e05160601c6101005160601c6101205160601c6101405160601c6101605160601c614db5620003b76000396000818161038a01528181610af40152613287015260008181610680015261272d01526000818161053401528181610f0801528181611b8201528181611cfb01528181612a8c0152612d1401526000610ac001526000818161083b01528181610cd001528181611ab001528181611d4b0152818161210f015281816138730152613acd015260008181610b7e01528181610da601528181611982015281816126fd015281816128150152612c0a015260008181610a1501526116c40152600081816103bc015281816105de0152818161092c01528181610c3701528181610f7d015281816111c101528181611249015281816113f80152818161154901528181611c6c01528181611d1c015281816120890152818161213e01528181612d9f01528181612e470152818161338c015281816134110152818161348501528181613722015281816137ed015281816138a201528181613a470152613afc0152614db56000f3fe60806040526004361061037a5760003560e01c8063853828b6116101d1578063c7af335211610102578063dbe55e56116100a0578063e75292391161006f578063e752923914610b41578063ee7afe2d14610b57578063f1188e4014610b6c578063f6ca71b014610ba057600080fd5b8063dbe55e5614610aae578063dd505df614610ae2578063de34d71314610b16578063de5f626814610b2c57600080fd5b8063d059f6ef116100dc578063d059f6ef14610a37578063d38bfff414610a4e578063d9caed1214610a6e578063d9f00ec714610a8e57600080fd5b8063c7af3352146109d1578063c98517c5146109e6578063cceab75014610a0357600080fd5b8063a3b81e731161016f578063ab12edf511610149578063ab12edf51461095c578063ad1728cb1461097c578063bb1b918d14610991578063c2e1e3f4146109b157600080fd5b8063a3b81e73146108da578063a4f98af4146108fa578063aa388af61461090f57600080fd5b80639092c31c116101ab5780639092c31c146108295780639136616a1461085d57806396d538bb1461087d5780639da0e4621461089d57600080fd5b8063853828b6146107cf57806387bae867146107e45780638d7c0e461461080957600080fd5b80635d36b190116102ab5780636ef38795116102495780637b2d9b2c116102235780637b2d9b2c1461076e5780637b8962f71461078e578063842f5c46146107a45780638456cb59146107ba57600080fd5b80636ef387951461070e57806371a735f31461072e5780637260f8261461074e57600080fd5b8063630923831161028557806363092383146106a257806366e3667e146106b857806367c7066c146106ce5780636e811d38146106ee57600080fd5b80635d36b190146106395780635f5152261461064e5780636093d3801461066e57600080fd5b8063435356d1116103185780635205c380116102f25780635205c380146105ac578063579a7e1a146105cc5780635a063f63146106005780635c975abb1461061557600080fd5b8063435356d11461055657806347e7ef2414610576578063484be8121461059657600080fd5b80631072cbea116103545780631072cbea146104be57806322495dc8146104de5780633c864959146104fe578063430bf08a1461052257600080fd5b80630c340a24146104365780630ed57b3a146104685780630fc3b4c41461048857600080fd5b3661043157336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806103de5750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b61042f5760405162461bcd60e51b815260206004820152601e60248201527f657468206e6f742066726f6d20616c6c6f77656420636f6e747261637473000060448201526064015b60405180910390fd5b005b600080fd5b34801561044257600080fd5b5061044b610bc2565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561047457600080fd5b5061042f610483366004614158565b610bdf565b34801561049457600080fd5b5061044b6104a336600461411e565b609f602052600090815260409020546001600160a01b031681565b3480156104ca57600080fd5b5061042f6104d93660046141d2565b610c11565b3480156104ea57600080fd5b5061042f6104f93660046142c6565b610cce565b34801561050a57600080fd5b5061051460695481565b60405190815260200161045f565b34801561052e57600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b34801561056257600080fd5b5061042f61057136600461423f565b610e18565b34801561058257600080fd5b5061042f6105913660046141d2565b610efd565b3480156105a257600080fd5b50610514606a5481565b3480156105b857600080fd5b5061042f6105c736600461439c565b61101c565b3480156105d857600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b34801561060c57600080fd5b5061042f611078565b34801561062157600080fd5b5060335460ff165b604051901515815260200161045f565b34801561064557600080fd5b5061042f611117565b34801561065a57600080fd5b5061051461066936600461411e565b6111bd565b34801561067a57600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b3480156106ae57600080fd5b50610514611c2081565b3480156106c457600080fd5b5061051460345481565b3480156106da57600080fd5b5060a35461044b906001600160a01b031681565b3480156106fa57600080fd5b5061042f61070936600461411e565b6112f1565b34801561071a57600080fd5b5061042f6107293660046141fe565b611379565b34801561073a57600080fd5b5061042f6107493660046144d4565b61188b565b34801561075a57600080fd5b5060365461044b906001600160a01b031681565b34801561077a57600080fd5b5061044b61078936600461439c565b611a84565b34801561079a57600080fd5b5061051460375481565b3480156107b057600080fd5b5061051460685481565b3480156107c657600080fd5b5061042f611aae565b3480156107db57600080fd5b5061042f611b77565b3480156107f057600080fd5b5060335461044b9061010090046001600160a01b031681565b34801561081557600080fd5b5061042f610824366004614555565b611d49565b34801561083557600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b34801561086957600080fd5b5061042f61087836600461439c565b61221e565b34801561088957600080fd5b5061042f6108983660046141fe565b6123e9565b3480156108a957600080fd5b506108cd6108b836600461439c565b60356020526000908152604090205460ff1681565b60405161045f91906149c0565b3480156108e657600080fd5b5061042f6108f536600461411e565b612509565b34801561090657600080fd5b5061062961258b565b34801561091b57600080fd5b5061062961092a36600461411e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b34801561096857600080fd5b5061042f61097736600461459a565b6125ea565b34801561098857600080fd5b5061042f6126e6565b34801561099d57600080fd5b5061042f6109ac366004614420565b6127ac565b3480156109bd57600080fd5b5061042f6109cc36600461411e565b61291f565b3480156109dd57600080fd5b506106296129ac565b3480156109f257600080fd5b506105146801bc16d674ec80000081565b348015610a0f57600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b348015610a4357600080fd5b506105146101075481565b348015610a5a57600080fd5b5061042f610a6936600461411e565b6129dd565b348015610a7a57600080fd5b5061042f610a89366004614191565b612a81565b348015610a9a57600080fd5b5061042f610aa93660046143b5565b612b14565b348015610aba57600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b348015610aee57600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b348015610b2257600080fd5b5061051460385481565b348015610b3857600080fd5b5061042f612d09565b348015610b4d57600080fd5b50610514606b5481565b348015610b6357600080fd5b5061042f612e76565b348015610b7857600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b348015610bac57600080fd5b50610bb5612f00565b60405161045f9190614796565b6000610bda600080516020614d608339815191525490565b905090565b610be76129ac565b610c035760405162461bcd60e51b815260040161042690614a32565b610c0d8282612f62565b5050565b610c196129ac565b610c355760405162461bcd60e51b815260040161042690614a32565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169083161415610cb25760405162461bcd60e51b815260206004820152601f60248201527f43616e6e6f74207472616e7366657220737570706f72746564206173736574006044820152606401610426565b610c0d610cbd610bc2565b6001600160a01b03841690836130c1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2757600080fd5b505afa158015610d3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5f919061413b565b6001600160a01b0316336001600160a01b031614610d8f5760405162461bcd60e51b815260040161042690614af2565b60405163bc26e7e560e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063bc26e7e590610de19030908790879087906004016146e6565b600060405180830381600087803b158015610dfb57600080fd5b505af1158015610e0f573d6000803e3d6000fd5b50505050505050565b610e206129ac565b610e3c5760405162461bcd60e51b815260040161042690614a32565b600054610100900460ff1680610e55575060005460ff16155b610eb85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610426565b600054610100900460ff16158015610eda576000805461ffff19166101011790555b610ee5848484613113565b8015610ef7576000805461ff00191690555b50505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f455760405162461bcd60e51b8152600401610426906149fb565b600080516020614d4083398151915280546002811415610f775760405162461bcd60e51b815260040161042690614aca565b600282557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b031614610ff05760405162461bcd60e51b8152602060048201526011602482015270155b9cdd5c1c1bdc9d195908185cdcd95d607a1b6044820152606401610426565b8261010760008282546110039190614c19565b90915550611013905084846131ce565b50600190555050565b6110246129ac565b6110405760405162461bcd60e51b815260040161042690614a32565b6040518181527fe26b067424903962f951f568e52ec9a3bbe1589526ea54a4e69ca6eaae1a4c779060200160405180910390a1603755565b60a3546001600160a01b031633146110d25760405162461bcd60e51b815260206004820152601b60248201527f43616c6c6572206973206e6f74207468652048617276657374657200000000006044820152606401610426565b600080516020614d40833981519152805460028114156111045760405162461bcd60e51b815260040161042690614aca565b60028255611110613260565b5060019055565b7f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db546001600160a01b0316336001600160a01b0316146111b25760405162461bcd60e51b815260206004820152603060248201527f4f6e6c79207468652070656e64696e6720476f7665726e6f722063616e20636f60448201526f6d706c6574652074686520636c61696d60801b6064820152608401610426565b6111bb336134ae565b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316146112345760405162461bcd60e51b8152602060048201526011602482015270155b9cdd5c1c1bdc9d195908185cdcd95d607a1b6044820152606401610426565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b15801561129357600080fd5b505afa1580156112a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112cb9190614581565b6034546112e1906801bc16d674ec800000614c31565b6112eb9190614c19565b92915050565b6112f96129ac565b6113155760405162461bcd60e51b815260040161042690614a32565b6040516001600160a01b03821681527f83f29c79feb71f8fba9d0fbc4ba5f0982a28b6b1e868b3fc50e6400d100bca0f9060200160405180910390a1603380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60335461010090046001600160a01b031633146113a85760405162461bcd60e51b815260040161042690614a93565b60335460ff16156113cb5760405162461bcd60e51b815260040161042690614a69565b60006113e0826801bc16d674ec800000614c31565b6040516370a0823160e01b81523060048201529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b15801561144257600080fd5b505afa158015611456573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147a9190614581565b8111156114bd5760405162461bcd60e51b81526020600482015260116024820152700d2dce6eaccccd2c6d2cadce840ae8aa89607b1b6044820152606401610426565b603754816038546114ce9190614c19565b111561151c5760405162461bcd60e51b815260206004820152601a60248201527f5374616b696e6720455448206f766572207468726573686f6c640000000000006044820152606401610426565b806038600082825461152e9190614c19565b9091555050604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561159557600080fd5b505af11580156115a9573d6000803e3d6000fd5b505050506115b68161356f565b60408051600160f81b60208201526000602182018190526bffffffffffffffffffffffff193060601b16602c830152910160408051601f1981840301815291905290508260005b8181101561186c57600086868381811061161957611619614cf0565b905060200281019061162b9190614b6f565b6116359080614b29565b6040516116439291906146ba565b6040805191829003909120600081815260356020529182205490925060ff169081600381111561167557611675614cc4565b146116c25760405162461bcd60e51b815260206004820152601860248201527f56616c696461746f72206e6f74207265676973746572656400000000000000006044820152606401610426565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663228951186801bc16d674ec8000008a8a8781811061170d5761170d614cf0565b905060200281019061171f9190614b6f565b6117299080614b29565b898d8d8a81811061173c5761173c614cf0565b905060200281019061174e9190614b6f565b61175c906020810190614b29565b8f8f8c81811061176e5761176e614cf0565b90506020028101906117809190614b6f565b604001356040518863ffffffff1660e01b81526004016117a596959493929190614945565b6000604051808303818588803b1580156117be57600080fd5b505af11580156117d2573d6000803e3d6000fd5b50505050507ffeb31a79d38edb1b090d516e4df3e273651179c6f2c2ec53a9a22ae015b70ba988888581811061180a5761180a614cf0565b905060200281019061181c9190614b6f565b6118269080614b29565b6801bc16d674ec800000886040516118419493929190614994565b60405180910390a1506000908152603560205260409020805460ff19166001908117909155016115fd565b50806034600082825461187f9190614c19565b90915550505050505050565b60335461010090046001600160a01b031633146118ba5760405162461bcd60e51b815260040161042690614a93565b60335460ff16156118dd5760405162461bcd60e51b815260040161042690614a69565b60006035600087876040516118f39291906146ba565b604080519182900390912082526020820192909252016000205460ff169050600281600381111561192657611926614cc4565b1461196b5760405162461bcd60e51b815260206004820152601560248201527456616c696461746f72206e6f742065786974696e6760581b6044820152606401610426565b6040516312b3fc1960e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906312b3fc19906119bf9089908990899089908990600401614904565b600060405180830381600087803b1580156119d957600080fd5b505af11580156119ed573d6000803e3d6000fd5b505050507ff72821b8777f002ccdf6326f1242d9e0f762eb077668b67bebe640535378066d86868686604051611a26949392919061487b565b60405180910390a16003603560008888604051611a449291906146ba565b60408051918290039091208252602082019290925201600020805460ff19166001836003811115611a7757611a77614cc4565b0217905550505050505050565b60a48181548110611a9457600080fd5b6000918252602090912001546001600160a01b0316905081565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611b0757600080fd5b505afa158015611b1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3f919061413b565b6001600160a01b0316336001600160a01b031614611b6f5760405162461bcd60e51b815260040161042690614af2565b6111bb61359c565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480611bc65750611bb1610bc2565b6001600160a01b0316336001600160a01b0316145b611c1e5760405162461bcd60e51b815260206004820152602360248201527f43616c6c6572206973206e6f7420746865205661756c74206f7220476f7665726044820152623737b960e91b6064820152608401610426565b600080516020614d4083398151915280546002811415611c505760405162461bcd60e51b815260040161042690614aca565b600282556040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015611cb657600080fd5b505afa158015611cca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cee9190614581565b90508015611d4157611d417f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000083613611565b505060019055565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611da257600080fd5b505afa158015611db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dda919061413b565b6001600160a01b0316336001600160a01b031614611e0a5760405162461bcd60e51b815260040161042690614af2565b60335460ff16611e535760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610426565b43611c20606b54611e649190614c19565b10611ebf5760405162461bcd60e51b815260206004820152602560248201527f6d616e75616c6c794669784163636f756e74696e672063616c6c656420746f6f6044820152641039b7b7b760d91b6064820152608401610426565b6002198312158015611ed2575060038313155b8015611eec5750600083603454611ee99190614bd8565b12155b611f385760405162461bcd60e51b815260206004820152601760248201527f696e76616c69642076616c696461746f727344656c74610000000000000000006044820152606401610426565b6811ff6cf0fd15afffff198212158015611f5b57506811ff6cf0fd15b000008213155b8015611f755750600082606854611f729190614bd8565b12155b611fc15760405162461bcd60e51b815260206004820152601d60248201527f696e76616c696420636f6e73656e7375735265776172647344656c74610000006044820152606401610426565b68053444835ec580000081111561201a5760405162461bcd60e51b815260206004820152601960248201527f696e76616c69642077657468546f5661756c74416d6f756e74000000000000006044820152606401610426565b60408051848152602081018490529081018290527f80d022717ea022455c5886b8dd8a29c037570aae58aeb4d7b136d7a10ec2e4319060600160405180910390a1826034546120699190614bd8565b60345560685461207a908390614bd8565b60685543606b5580156121c8577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156120e257600080fd5b505af11580156120f6573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b15801561218657600080fd5b505af115801561219a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121be919061437f565b506121c881613709565b6121d26000613771565b6122115760405162461bcd60e51b815260206004820152601060248201526f333ab9b29039ba34b63610313637bbb760811b6044820152606401610426565b612219613bf0565b505050565b6122266129ac565b6122425760405162461bcd60e51b815260040161042690614a32565b60a05481106122835760405162461bcd60e51b815260206004820152600d60248201526c092dcecc2d8d2c840d2dcc8caf609b1b6044820152606401610426565b600060a0828154811061229857612298614cf0565b60009182526020808320909101546001600160a01b03908116808452609f90925260409092205460a054919350909116906122d590600190614c50565b8310156123575760a080546122ec90600190614c50565b815481106122fc576122fc614cf0565b60009182526020909120015460a080546001600160a01b03909216918590811061232857612328614cf0565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b60a080548061236857612368614cda565b60008281526020808220600019908401810180546001600160a01b031990811690915593019093556001600160a01b03858116808352609f855260409283902080549094169093559051908416815290917f16b7600acff27e39a8a96056b3d533045298de927507f5c1d97e4accde60488c910160405180910390a2505050565b6123f16129ac565b61240d5760405162461bcd60e51b815260040161042690614a32565b8060005b818110156124c057600084848381811061242d5761242d614cf0565b9050602002016020810190612442919061411e565b6001600160a01b031614156124b05760405162461bcd60e51b815260206004820152602e60248201527f43616e206e6f742073657420616e20656d70747920616464726573732061732060448201526d30903932bbb0b932103a37b5b2b760911b6064820152608401610426565b6124b981614c93565b9050612411565b507f04c0b9649497d316554306e53678d5f5f5dbc3a06f97dec13ff4cfe98b986bbc60a484846040516124f5939291906147e3565b60405180910390a1610ef760a48484613e77565b6125116129ac565b61252d5760405162461bcd60e51b815260040161042690614a32565b6040516001600160a01b03821681527f3329861a0008b3348767567d2405492b997abd79a088d0f2cef6b1a09a8e7ff79060200160405180910390a1603680546001600160a01b0319166001600160a01b0392909216919091179055565b60335460009061010090046001600160a01b031633146125bd5760405162461bcd60e51b815260040161042690614a93565b60335460ff16156125e05760405162461bcd60e51b815260040161042690614a69565b610bda6001613771565b6125f26129ac565b61260e5760405162461bcd60e51b815260040161042690614a32565b808210801561262557506801bc16d674ec80000082105b801561263957506801bc16d674ec80000081105b80156126565750673782dace9d9000006126538383614c50565b10155b6126a25760405162461bcd60e51b815260206004820152601760248201527f696e636f7272656374206675736520696e74657276616c0000000000000000006044820152606401610426565b60408051838152602081018390527fcb8d24e46eb3c402bf344ee60a6576cba9ef2f59ea1af3b311520704924e901a910160405180910390a1606991909155606a55565b60405163095ea7b360e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260001960248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b390604401602060405180830381600087803b15801561277157600080fd5b505af1158015612785573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127a9919061437f565b50565b60335461010090046001600160a01b031633146127db5760405162461bcd60e51b815260040161042690614a93565b60335460ff16156127fe5760405162461bcd60e51b815260040161042690614a69565b6040516301ba3ee760e21b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906306e8fb9c90612858908b908b908b908b908b908b908b908b906004016148a2565b600060405180830381600087803b15801561287257600080fd5b505af1158015612886573d6000803e3d6000fd5b505050506000603560008a8a6040516128a09291906146ba565b60408051918290039091208252602082019290925201600020805460ff191660018360038111156128d3576128d3614cc4565b02179055507f75c4a66b2c6c28cf46db7131182a812e4fbbb2f0591377aa83a737909a9b68c38888888860405161290d949392919061487b565b60405180910390a15050505050505050565b6129276129ac565b6129435760405162461bcd60e51b815260040161042690614a32565b60a354604080516001600160a01b03928316815291831660208301527fe48386b84419f4d36e0f96c10cc3510b6fb1a33795620c5098b22472bbe90796910160405180910390a160a380546001600160a01b0319166001600160a01b0392909216919091179055565b60006129c4600080516020614d608339815191525490565b6001600160a01b0316336001600160a01b031614905090565b6129e56129ac565b612a015760405162461bcd60e51b815260040161042690614a32565b612a29817f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db55565b806001600160a01b0316612a49600080516020614d608339815191525490565b6001600160a01b03167fa39cc5eb22d0f34d8beaefee8a3f17cc229c1a1d1ef87a5ad47313487b1c4f0d60405160405180910390a350565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612ac95760405162461bcd60e51b8152600401610426906149fb565b600080516020614d4083398151915280546002811415612afb5760405162461bcd60e51b815260040161042690614aca565b60028255612b0a858585613611565b5060019055505050565b60335461010090046001600160a01b03163314612b435760405162461bcd60e51b815260040161042690614a93565b60335460ff1615612b665760405162461bcd60e51b815260040161042690614a69565b6000603560008686604051612b7c9291906146ba565b604080519182900390912082526020820192909252016000205460ff1690506001816003811115612baf57612baf614cc4565b14612bf35760405162461bcd60e51b815260206004820152601460248201527315985b1a59185d1bdc881b9bdd081cdd185ad95960621b6044820152606401610426565b604051633877322b60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690633877322b90612c4590889088908890889060040161487b565b600060405180830381600087803b158015612c5f57600080fd5b505af1158015612c73573d6000803e3d6000fd5b505050507ff8821da16f5ed966b41e0343c3eff9903af782d74f99f1689dd9d4562b6545b385858585604051612cac949392919061487b565b60405180910390a16002603560008787604051612cca9291906146ba565b60408051918290039091208252602082019290925201600020805460ff19166001836003811115612cfd57612cfd614cc4565b02179055505050505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612d515760405162461bcd60e51b8152600401610426906149fb565b600080516020614d4083398151915280546002811415612d835760405162461bcd60e51b815260040161042690614aca565b600282556040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015612de957600080fd5b505afa158015612dfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e219190614581565b905060006101075482612e349190614c50565b90508015612e6c57610107829055612e6c7f0000000000000000000000000000000000000000000000000000000000000000826131ce565b5050600182555050565b6036546001600160a01b03163314612ed05760405162461bcd60e51b815260206004820152601960248201527f43616c6c6572206973206e6f7420746865204d6f6e69746f72000000000000006044820152606401610426565b6040517fe765a88a37047c5d793dce22b9ceb5a0f5039d276da139b4c7d29613f341f11090600090a16000603855565b606060a4805480602002602001604051908101604052809291908181526020018280548015612f5857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612f3a575b5050505050905090565b6001600160a01b038281166000908152609f60205260409020541615612fbf5760405162461bcd60e51b81526020600482015260126024820152711c151bdad95b88185b1c9958591e481cd95d60721b6044820152606401610426565b6001600160a01b03821615801590612fdf57506001600160a01b03811615155b61301f5760405162461bcd60e51b8152602060048201526011602482015270496e76616c69642061646472657373657360781b6044820152606401610426565b6001600160a01b038281166000818152609f6020908152604080832080549587166001600160a01b0319968716811790915560a0805460018101825594527f78fdc8d422c49ced035a9edf18d00d3c6a8d81df210f3e5e448e045e77b41e8890930180549095168417909455925190815290917fef6485b84315f9b1483beffa32aae9a0596890395e3d7521f1c5fbb51790e765910160405180910390a25050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612219908490613c6a565b82516131269060a4906020860190613eda565b508151815181146131705760405162461bcd60e51b8152602060048201526014602482015273496e76616c696420696e7075742061727261797360601b6044820152606401610426565b60005b818110156131c7576131b784828151811061319057613190614cf0565b60200260200101518483815181106131aa576131aa614cf0565b6020026020010151612f62565b6131c081614c93565b9050613173565b5050505050565b600081116132175760405162461bcd60e51b81526020600482015260166024820152754d757374206465706f73697420736f6d657468696e6760501b6044820152606401610426565b6040805160008152602081018390526001600160a01b038416917f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62910160405180910390a25050565b60335460ff16156132835760405162461bcd60e51b815260040161042690614a69565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e52253816040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156132e057600080fd5b505af11580156132f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133189190614581565b905060006068548261332a9190614c19565b90508047101561337c5760405162461bcd60e51b815260206004820152601860248201527f696e73756666696369656e74206574682062616c616e636500000000000000006044820152606401610426565b8015610c0d5760006068819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156133e557600080fd5b505af11580156133f9573d6000803e3d6000fd5b505060a354604080516001600160a01b0392831681527f0000000000000000000000000000000000000000000000000000000000000000909216602083015281018590527ff6c07a063ed4e63808eb8da7112d46dbcd38de2b40a73dbcc9353c5a94c723539350606001915061346c9050565b60405180910390a160a354610c0d906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169116836130c1565b6001600160a01b0381166135045760405162461bcd60e51b815260206004820152601a60248201527f4e657720476f7665726e6f7220697320616464726573732830290000000000006044820152606401610426565b806001600160a01b0316613524600080516020614d608339815191525490565b6001600160a01b03167fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a60405160405180910390a36127a981600080516020614d6083398151915255565b600061357e8261010754613d3c565b90508061010760008282546135939190614c50565b90915550505050565b60335460ff16156135bf5760405162461bcd60e51b815260040161042690614a69565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586135f43390565b6040516001600160a01b03909116815260200160405180910390a1565b600081116136615760405162461bcd60e51b815260206004820152601760248201527f4d75737420776974686472617720736f6d657468696e670000000000000000006044820152606401610426565b6001600160a01b0383166136b05760405162461bcd60e51b8152602060048201526016602482015275135d5cdd081cdc1958da599e481c9958da5c1a595b9d60521b6044820152606401610426565b6040805160008152602081018390526001600160a01b038416917f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b6398910160405180910390a26122196001600160a01b03831684836130c1565b6040805160008152602081018390526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016917f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b6398910160405180910390a250565b6000606854471015613786576112eb82613d54565b6000606854476137969190614c50565b9050600191506801bc16d674ec80000081106139735760006801bc16d674ec8000008204905080603460008282546137ce9190614c50565b90915550600090506137e9826801bc16d674ec800000614c31565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561384657600080fd5b505af115801561385a573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b1580156138ea57600080fd5b505af11580156138fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613922919061437f565b5061392c81613709565b60345460408051848152602081019290925281018290527fbe7040030ff7b347853214bf49820c6d455fedf58f3815f85c7bc5216993682b9060600160405180910390a150505b6000606854476139839190614c50565b90506801bc16d674ec80000081106139d55760405162461bcd60e51b8152602060048201526015602482015274756e6578706563746564206163636f756e74696e6760581b6044820152606401610426565b806139e1575050919050565b606954811015613a3b5780606860008282546139fd9190614c19565b90915550506040518181527f7a745a2c63a535068f52ceca27debd5297bbad5f7f37ec53d044a59d0362445d906020015b60405180910390a1613be9565b606a54811115613bd8577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015613aa057600080fd5b505af1158015613ab4573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b158015613b4457600080fd5b505af1158015613b58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b7c919061437f565b50600160346000828254613b909190614c50565b90915550613b9f905081613709565b60345460408051918252602082018390527f6aa7e30787b26429ced603a7aba8b19c4b5d5bcf29a3257da953c8d53bcaa3a69101613a2e565b613be184613d54565b949350505050565b5050919050565b60335460ff16613c395760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610426565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336135f4565b6000613cbf826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613d6c9092919063ffffffff16565b8051909150156122195780806020019051810190613cdd919061437f565b6122195760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610426565b6000818310613d4b5781613d4d565b825b9392505050565b60008115613d6457613d6461359c565b506000919050565b6060613be1848460008585843b613dc55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610426565b600080866001600160a01b03168587604051613de191906146ca565b60006040518083038185875af1925050503d8060008114613e1e576040519150601f19603f3d011682016040523d82523d6000602084013e613e23565b606091505b5091509150613e33828286613e3e565b979650505050505050565b60608315613e4d575081613d4d565b825115613e5d5782518084602001fd5b8160405162461bcd60e51b815260040161042691906149e8565b828054828255906000526020600020908101928215613eca579160200282015b82811115613eca5781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190613e97565b50613ed6929150613f2f565b5090565b828054828255906000526020600020908101928215613eca579160200282015b82811115613eca57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613efa565b5b80821115613ed65760008155600101613f30565b60008083601f840112613f5657600080fd5b5081356001600160401b03811115613f6d57600080fd5b6020830191508360208260051b8501011115613f8857600080fd5b9250929050565b600082601f830112613fa057600080fd5b81356020613fb5613fb083614bb5565b614b85565b80838252828201915082860187848660051b8901011115613fd557600080fd5b60005b85811015613ffd578135613feb81614d1c565b84529284019290840190600101613fd8565b5090979650505050505050565b60008083601f84011261401c57600080fd5b5081356001600160401b0381111561403357600080fd5b602083019150836020828501011115613f8857600080fd5b600060a0828403121561405d57600080fd5b50919050565b600060a0828403121561407557600080fd5b60405160a081018181106001600160401b038211171561409757614097614d06565b6040529050806140a6836140ee565b81526140b460208401614107565b60208201526140c560408401614107565b604082015260608301356140d881614d31565b6060820152608092830135920191909152919050565b803563ffffffff8116811461410257600080fd5b919050565b80356001600160401b038116811461410257600080fd5b60006020828403121561413057600080fd5b8135613d4d81614d1c565b60006020828403121561414d57600080fd5b8151613d4d81614d1c565b6000806040838503121561416b57600080fd5b823561417681614d1c565b9150602083013561418681614d1c565b809150509250929050565b6000806000606084860312156141a657600080fd5b83356141b181614d1c565b925060208401356141c181614d1c565b929592945050506040919091013590565b600080604083850312156141e557600080fd5b82356141f081614d1c565b946020939093013593505050565b6000806020838503121561421157600080fd5b82356001600160401b0381111561422757600080fd5b61423385828601613f44565b90969095509350505050565b60008060006060848603121561425457600080fd5b83356001600160401b038082111561426b57600080fd5b61427787838801613f8f565b9450602086013591508082111561428d57600080fd5b61429987838801613f8f565b935060408601359150808211156142af57600080fd5b506142bc86828701613f8f565b9150509250925092565b600080600060e084860312156142db57600080fd5b83356001600160401b038111156142f157600080fd5b8401601f8101861361430257600080fd5b80356020614312613fb083614bb5565b8083825282820191508285018a848660051b880101111561433257600080fd5b600095505b8486101561435c5761434881614107565b835260019590950194918301918301614337565b509650508601359350614376915086905060408601614063565b90509250925092565b60006020828403121561439157600080fd5b8151613d4d81614d31565b6000602082840312156143ae57600080fd5b5035919050565b600080600080604085870312156143cb57600080fd5b84356001600160401b03808211156143e257600080fd5b6143ee8883890161400a565b9096509450602087013591508082111561440757600080fd5b5061441487828801613f44565b95989497509550505050565b600080600080600080600080610120898b03121561443d57600080fd5b88356001600160401b038082111561445457600080fd5b6144608c838d0161400a565b909a50985060208b013591508082111561447957600080fd5b6144858c838d01613f44565b909850965060408b013591508082111561449e57600080fd5b506144ab8b828c0161400a565b909550935050606089013591506144c58a60808b0161404b565b90509295985092959890939650565b600080600080600060e086880312156144ec57600080fd5b85356001600160401b038082111561450357600080fd5b61450f89838a0161400a565b9097509550602088013591508082111561452857600080fd5b5061453588828901613f44565b90945092506145499050876040880161404b565b90509295509295909350565b60008060006060848603121561456a57600080fd5b505081359360208301359350604090920135919050565b60006020828403121561459357600080fd5b5051919050565b600080604083850312156145ad57600080fd5b50508035926020909101359150565b8183526000602080850194508260005b858110156145f8576001600160401b036145e583614107565b16875295820195908201906001016145cc565b509495945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008151808452614644816020860160208601614c67565b601f01601f19169290920160200192915050565b63ffffffff614666826140ee565b16825261467560208201614107565b6001600160401b0380821660208501528061469260408501614107565b166040850152505060608101356146a881614d31565b15156060830152608090810135910152565b8183823760009101908152919050565b600082516146dc818460208701614c67565b9190910192915050565b6001600160a01b03851681526101006020808301829052855191830182905260009161012084019187810191845b818110156147395783516001600160401b031685529382019392820192600101614714565b505082935086604086015263ffffffff865116606086015280860151925050506001600160401b0380821660808501528060408601511660a085015250506060830151151560c0830152608083015160e083015295945050505050565b6020808252825182820181905260009190848201906040850190845b818110156147d75783516001600160a01b0316835292840192918401916001016147b2565b50909695505050505050565b6000604082016040835280865480835260608501915087600052602092508260002060005b8281101561482d5781546001600160a01b031684529284019260019182019101614808565b505050838103828501528481528590820160005b8681101561486f57823561485481614d1c565b6001600160a01b031682529183019190830190600101614841565b50979650505050505050565b60408152600061488f604083018688614603565b8281036020840152613e338185876145bc565b60006101208083526148b78184018b8d614603565b905082810360208401526148cc81898b6145bc565b905082810360408401526148e1818789614603565b9150508360608301526148f76080830184614658565b9998505050505050505050565b60e08152600061491860e083018789614603565b828103602084015261492b8186886145bc565b91505061493b6040830184614658565b9695505050505050565b60808152600061495960808301888a614603565b828103602084015261496b818861462c565b90508281036040840152614980818688614603565b915050826060830152979650505050505050565b6060815260006149a8606083018688614603565b8460208401528281036040840152613e33818561462c565b60208101600483106149e257634e487b7160e01b600052602160045260246000fd5b91905290565b602081526000613d4d602083018461462c565b60208082526017908201527f43616c6c6572206973206e6f7420746865205661756c74000000000000000000604082015260600190565b6020808252601a908201527f43616c6c6572206973206e6f742074686520476f7665726e6f72000000000000604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601d908201527f43616c6c6572206973206e6f7420746865205265676973747261746f72000000604082015260600190565b6020808252600e908201526d1499595b9d1c985b9d0818d85b1b60921b604082015260600190565b6020808252601c908201527f43616c6c6572206973206e6f7420746865205374726174656769737400000000604082015260600190565b6000808335601e19843603018112614b4057600080fd5b8301803591506001600160401b03821115614b5a57600080fd5b602001915036819003821315613f8857600080fd5b60008235605e198336030181126146dc57600080fd5b604051601f8201601f191681016001600160401b0381118282101715614bad57614bad614d06565b604052919050565b60006001600160401b03821115614bce57614bce614d06565b5060051b60200190565b600080821280156001600160ff1b0384900385131615614bfa57614bfa614cae565b600160ff1b8390038412811615614c1357614c13614cae565b50500190565b60008219821115614c2c57614c2c614cae565b500190565b6000816000190483118215151615614c4b57614c4b614cae565b500290565b600082821015614c6257614c62614cae565b500390565b60005b83811015614c82578181015183820152602001614c6a565b83811115610ef75750506000910152565b6000600019821415614ca757614ca7614cae565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146127a957600080fd5b80151581146127a957600080fdfe53bf423e48ed90e97d02ab0ebab13b2a235a6bfbe9c321847d5c175333ac45357bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4aa264697066735822122036fc9aa0014d1fbbc8fbac98689c50c4cc2fb4601ee35cd2b4f5b5f97319fc4864736f6c634300080700337bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a", + "deployedBytecode": "0x60806040526004361061037a5760003560e01c8063853828b6116101d1578063c7af335211610102578063dbe55e56116100a0578063e75292391161006f578063e752923914610b41578063ee7afe2d14610b57578063f1188e4014610b6c578063f6ca71b014610ba057600080fd5b8063dbe55e5614610aae578063dd505df614610ae2578063de34d71314610b16578063de5f626814610b2c57600080fd5b8063d059f6ef116100dc578063d059f6ef14610a37578063d38bfff414610a4e578063d9caed1214610a6e578063d9f00ec714610a8e57600080fd5b8063c7af3352146109d1578063c98517c5146109e6578063cceab75014610a0357600080fd5b8063a3b81e731161016f578063ab12edf511610149578063ab12edf51461095c578063ad1728cb1461097c578063bb1b918d14610991578063c2e1e3f4146109b157600080fd5b8063a3b81e73146108da578063a4f98af4146108fa578063aa388af61461090f57600080fd5b80639092c31c116101ab5780639092c31c146108295780639136616a1461085d57806396d538bb1461087d5780639da0e4621461089d57600080fd5b8063853828b6146107cf57806387bae867146107e45780638d7c0e461461080957600080fd5b80635d36b190116102ab5780636ef38795116102495780637b2d9b2c116102235780637b2d9b2c1461076e5780637b8962f71461078e578063842f5c46146107a45780638456cb59146107ba57600080fd5b80636ef387951461070e57806371a735f31461072e5780637260f8261461074e57600080fd5b8063630923831161028557806363092383146106a257806366e3667e146106b857806367c7066c146106ce5780636e811d38146106ee57600080fd5b80635d36b190146106395780635f5152261461064e5780636093d3801461066e57600080fd5b8063435356d1116103185780635205c380116102f25780635205c380146105ac578063579a7e1a146105cc5780635a063f63146106005780635c975abb1461061557600080fd5b8063435356d11461055657806347e7ef2414610576578063484be8121461059657600080fd5b80631072cbea116103545780631072cbea146104be57806322495dc8146104de5780633c864959146104fe578063430bf08a1461052257600080fd5b80630c340a24146104365780630ed57b3a146104685780630fc3b4c41461048857600080fd5b3661043157336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806103de5750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b61042f5760405162461bcd60e51b815260206004820152601e60248201527f657468206e6f742066726f6d20616c6c6f77656420636f6e747261637473000060448201526064015b60405180910390fd5b005b600080fd5b34801561044257600080fd5b5061044b610bc2565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561047457600080fd5b5061042f610483366004614158565b610bdf565b34801561049457600080fd5b5061044b6104a336600461411e565b609f602052600090815260409020546001600160a01b031681565b3480156104ca57600080fd5b5061042f6104d93660046141d2565b610c11565b3480156104ea57600080fd5b5061042f6104f93660046142c6565b610cce565b34801561050a57600080fd5b5061051460695481565b60405190815260200161045f565b34801561052e57600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b34801561056257600080fd5b5061042f61057136600461423f565b610e18565b34801561058257600080fd5b5061042f6105913660046141d2565b610efd565b3480156105a257600080fd5b50610514606a5481565b3480156105b857600080fd5b5061042f6105c736600461439c565b61101c565b3480156105d857600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b34801561060c57600080fd5b5061042f611078565b34801561062157600080fd5b5060335460ff165b604051901515815260200161045f565b34801561064557600080fd5b5061042f611117565b34801561065a57600080fd5b5061051461066936600461411e565b6111bd565b34801561067a57600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b3480156106ae57600080fd5b50610514611c2081565b3480156106c457600080fd5b5061051460345481565b3480156106da57600080fd5b5060a35461044b906001600160a01b031681565b3480156106fa57600080fd5b5061042f61070936600461411e565b6112f1565b34801561071a57600080fd5b5061042f6107293660046141fe565b611379565b34801561073a57600080fd5b5061042f6107493660046144d4565b61188b565b34801561075a57600080fd5b5060365461044b906001600160a01b031681565b34801561077a57600080fd5b5061044b61078936600461439c565b611a84565b34801561079a57600080fd5b5061051460375481565b3480156107b057600080fd5b5061051460685481565b3480156107c657600080fd5b5061042f611aae565b3480156107db57600080fd5b5061042f611b77565b3480156107f057600080fd5b5060335461044b9061010090046001600160a01b031681565b34801561081557600080fd5b5061042f610824366004614555565b611d49565b34801561083557600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b34801561086957600080fd5b5061042f61087836600461439c565b61221e565b34801561088957600080fd5b5061042f6108983660046141fe565b6123e9565b3480156108a957600080fd5b506108cd6108b836600461439c565b60356020526000908152604090205460ff1681565b60405161045f91906149c0565b3480156108e657600080fd5b5061042f6108f536600461411e565b612509565b34801561090657600080fd5b5061062961258b565b34801561091b57600080fd5b5061062961092a36600461411e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b34801561096857600080fd5b5061042f61097736600461459a565b6125ea565b34801561098857600080fd5b5061042f6126e6565b34801561099d57600080fd5b5061042f6109ac366004614420565b6127ac565b3480156109bd57600080fd5b5061042f6109cc36600461411e565b61291f565b3480156109dd57600080fd5b506106296129ac565b3480156109f257600080fd5b506105146801bc16d674ec80000081565b348015610a0f57600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b348015610a4357600080fd5b506105146101075481565b348015610a5a57600080fd5b5061042f610a6936600461411e565b6129dd565b348015610a7a57600080fd5b5061042f610a89366004614191565b612a81565b348015610a9a57600080fd5b5061042f610aa93660046143b5565b612b14565b348015610aba57600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b348015610aee57600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b348015610b2257600080fd5b5061051460385481565b348015610b3857600080fd5b5061042f612d09565b348015610b4d57600080fd5b50610514606b5481565b348015610b6357600080fd5b5061042f612e76565b348015610b7857600080fd5b5061044b7f000000000000000000000000000000000000000000000000000000000000000081565b348015610bac57600080fd5b50610bb5612f00565b60405161045f9190614796565b6000610bda600080516020614d608339815191525490565b905090565b610be76129ac565b610c035760405162461bcd60e51b815260040161042690614a32565b610c0d8282612f62565b5050565b610c196129ac565b610c355760405162461bcd60e51b815260040161042690614a32565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169083161415610cb25760405162461bcd60e51b815260206004820152601f60248201527f43616e6e6f74207472616e7366657220737570706f72746564206173736574006044820152606401610426565b610c0d610cbd610bc2565b6001600160a01b03841690836130c1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2757600080fd5b505afa158015610d3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5f919061413b565b6001600160a01b0316336001600160a01b031614610d8f5760405162461bcd60e51b815260040161042690614af2565b60405163bc26e7e560e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063bc26e7e590610de19030908790879087906004016146e6565b600060405180830381600087803b158015610dfb57600080fd5b505af1158015610e0f573d6000803e3d6000fd5b50505050505050565b610e206129ac565b610e3c5760405162461bcd60e51b815260040161042690614a32565b600054610100900460ff1680610e55575060005460ff16155b610eb85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610426565b600054610100900460ff16158015610eda576000805461ffff19166101011790555b610ee5848484613113565b8015610ef7576000805461ff00191690555b50505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f455760405162461bcd60e51b8152600401610426906149fb565b600080516020614d4083398151915280546002811415610f775760405162461bcd60e51b815260040161042690614aca565b600282557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b031614610ff05760405162461bcd60e51b8152602060048201526011602482015270155b9cdd5c1c1bdc9d195908185cdcd95d607a1b6044820152606401610426565b8261010760008282546110039190614c19565b90915550611013905084846131ce565b50600190555050565b6110246129ac565b6110405760405162461bcd60e51b815260040161042690614a32565b6040518181527fe26b067424903962f951f568e52ec9a3bbe1589526ea54a4e69ca6eaae1a4c779060200160405180910390a1603755565b60a3546001600160a01b031633146110d25760405162461bcd60e51b815260206004820152601b60248201527f43616c6c6572206973206e6f74207468652048617276657374657200000000006044820152606401610426565b600080516020614d40833981519152805460028114156111045760405162461bcd60e51b815260040161042690614aca565b60028255611110613260565b5060019055565b7f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db546001600160a01b0316336001600160a01b0316146111b25760405162461bcd60e51b815260206004820152603060248201527f4f6e6c79207468652070656e64696e6720476f7665726e6f722063616e20636f60448201526f6d706c6574652074686520636c61696d60801b6064820152608401610426565b6111bb336134ae565b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316146112345760405162461bcd60e51b8152602060048201526011602482015270155b9cdd5c1c1bdc9d195908185cdcd95d607a1b6044820152606401610426565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b15801561129357600080fd5b505afa1580156112a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112cb9190614581565b6034546112e1906801bc16d674ec800000614c31565b6112eb9190614c19565b92915050565b6112f96129ac565b6113155760405162461bcd60e51b815260040161042690614a32565b6040516001600160a01b03821681527f83f29c79feb71f8fba9d0fbc4ba5f0982a28b6b1e868b3fc50e6400d100bca0f9060200160405180910390a1603380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60335461010090046001600160a01b031633146113a85760405162461bcd60e51b815260040161042690614a93565b60335460ff16156113cb5760405162461bcd60e51b815260040161042690614a69565b60006113e0826801bc16d674ec800000614c31565b6040516370a0823160e01b81523060048201529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b15801561144257600080fd5b505afa158015611456573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147a9190614581565b8111156114bd5760405162461bcd60e51b81526020600482015260116024820152700d2dce6eaccccd2c6d2cadce840ae8aa89607b1b6044820152606401610426565b603754816038546114ce9190614c19565b111561151c5760405162461bcd60e51b815260206004820152601a60248201527f5374616b696e6720455448206f766572207468726573686f6c640000000000006044820152606401610426565b806038600082825461152e9190614c19565b9091555050604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561159557600080fd5b505af11580156115a9573d6000803e3d6000fd5b505050506115b68161356f565b60408051600160f81b60208201526000602182018190526bffffffffffffffffffffffff193060601b16602c830152910160408051601f1981840301815291905290508260005b8181101561186c57600086868381811061161957611619614cf0565b905060200281019061162b9190614b6f565b6116359080614b29565b6040516116439291906146ba565b6040805191829003909120600081815260356020529182205490925060ff169081600381111561167557611675614cc4565b146116c25760405162461bcd60e51b815260206004820152601860248201527f56616c696461746f72206e6f74207265676973746572656400000000000000006044820152606401610426565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663228951186801bc16d674ec8000008a8a8781811061170d5761170d614cf0565b905060200281019061171f9190614b6f565b6117299080614b29565b898d8d8a81811061173c5761173c614cf0565b905060200281019061174e9190614b6f565b61175c906020810190614b29565b8f8f8c81811061176e5761176e614cf0565b90506020028101906117809190614b6f565b604001356040518863ffffffff1660e01b81526004016117a596959493929190614945565b6000604051808303818588803b1580156117be57600080fd5b505af11580156117d2573d6000803e3d6000fd5b50505050507ffeb31a79d38edb1b090d516e4df3e273651179c6f2c2ec53a9a22ae015b70ba988888581811061180a5761180a614cf0565b905060200281019061181c9190614b6f565b6118269080614b29565b6801bc16d674ec800000886040516118419493929190614994565b60405180910390a1506000908152603560205260409020805460ff19166001908117909155016115fd565b50806034600082825461187f9190614c19565b90915550505050505050565b60335461010090046001600160a01b031633146118ba5760405162461bcd60e51b815260040161042690614a93565b60335460ff16156118dd5760405162461bcd60e51b815260040161042690614a69565b60006035600087876040516118f39291906146ba565b604080519182900390912082526020820192909252016000205460ff169050600281600381111561192657611926614cc4565b1461196b5760405162461bcd60e51b815260206004820152601560248201527456616c696461746f72206e6f742065786974696e6760581b6044820152606401610426565b6040516312b3fc1960e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906312b3fc19906119bf9089908990899089908990600401614904565b600060405180830381600087803b1580156119d957600080fd5b505af11580156119ed573d6000803e3d6000fd5b505050507ff72821b8777f002ccdf6326f1242d9e0f762eb077668b67bebe640535378066d86868686604051611a26949392919061487b565b60405180910390a16003603560008888604051611a449291906146ba565b60408051918290039091208252602082019290925201600020805460ff19166001836003811115611a7757611a77614cc4565b0217905550505050505050565b60a48181548110611a9457600080fd5b6000918252602090912001546001600160a01b0316905081565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611b0757600080fd5b505afa158015611b1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3f919061413b565b6001600160a01b0316336001600160a01b031614611b6f5760405162461bcd60e51b815260040161042690614af2565b6111bb61359c565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480611bc65750611bb1610bc2565b6001600160a01b0316336001600160a01b0316145b611c1e5760405162461bcd60e51b815260206004820152602360248201527f43616c6c6572206973206e6f7420746865205661756c74206f7220476f7665726044820152623737b960e91b6064820152608401610426565b600080516020614d4083398151915280546002811415611c505760405162461bcd60e51b815260040161042690614aca565b600282556040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015611cb657600080fd5b505afa158015611cca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cee9190614581565b90508015611d4157611d417f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000083613611565b505060019055565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663570d8e1d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611da257600080fd5b505afa158015611db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dda919061413b565b6001600160a01b0316336001600160a01b031614611e0a5760405162461bcd60e51b815260040161042690614af2565b60335460ff16611e535760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610426565b43611c20606b54611e649190614c19565b10611ebf5760405162461bcd60e51b815260206004820152602560248201527f6d616e75616c6c794669784163636f756e74696e672063616c6c656420746f6f6044820152641039b7b7b760d91b6064820152608401610426565b6002198312158015611ed2575060038313155b8015611eec5750600083603454611ee99190614bd8565b12155b611f385760405162461bcd60e51b815260206004820152601760248201527f696e76616c69642076616c696461746f727344656c74610000000000000000006044820152606401610426565b6811ff6cf0fd15afffff198212158015611f5b57506811ff6cf0fd15b000008213155b8015611f755750600082606854611f729190614bd8565b12155b611fc15760405162461bcd60e51b815260206004820152601d60248201527f696e76616c696420636f6e73656e7375735265776172647344656c74610000006044820152606401610426565b68053444835ec580000081111561201a5760405162461bcd60e51b815260206004820152601960248201527f696e76616c69642077657468546f5661756c74416d6f756e74000000000000006044820152606401610426565b60408051848152602081018490529081018290527f80d022717ea022455c5886b8dd8a29c037570aae58aeb4d7b136d7a10ec2e4319060600160405180910390a1826034546120699190614bd8565b60345560685461207a908390614bd8565b60685543606b5580156121c8577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156120e257600080fd5b505af11580156120f6573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b15801561218657600080fd5b505af115801561219a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121be919061437f565b506121c881613709565b6121d26000613771565b6122115760405162461bcd60e51b815260206004820152601060248201526f333ab9b29039ba34b63610313637bbb760811b6044820152606401610426565b612219613bf0565b505050565b6122266129ac565b6122425760405162461bcd60e51b815260040161042690614a32565b60a05481106122835760405162461bcd60e51b815260206004820152600d60248201526c092dcecc2d8d2c840d2dcc8caf609b1b6044820152606401610426565b600060a0828154811061229857612298614cf0565b60009182526020808320909101546001600160a01b03908116808452609f90925260409092205460a054919350909116906122d590600190614c50565b8310156123575760a080546122ec90600190614c50565b815481106122fc576122fc614cf0565b60009182526020909120015460a080546001600160a01b03909216918590811061232857612328614cf0565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b60a080548061236857612368614cda565b60008281526020808220600019908401810180546001600160a01b031990811690915593019093556001600160a01b03858116808352609f855260409283902080549094169093559051908416815290917f16b7600acff27e39a8a96056b3d533045298de927507f5c1d97e4accde60488c910160405180910390a2505050565b6123f16129ac565b61240d5760405162461bcd60e51b815260040161042690614a32565b8060005b818110156124c057600084848381811061242d5761242d614cf0565b9050602002016020810190612442919061411e565b6001600160a01b031614156124b05760405162461bcd60e51b815260206004820152602e60248201527f43616e206e6f742073657420616e20656d70747920616464726573732061732060448201526d30903932bbb0b932103a37b5b2b760911b6064820152608401610426565b6124b981614c93565b9050612411565b507f04c0b9649497d316554306e53678d5f5f5dbc3a06f97dec13ff4cfe98b986bbc60a484846040516124f5939291906147e3565b60405180910390a1610ef760a48484613e77565b6125116129ac565b61252d5760405162461bcd60e51b815260040161042690614a32565b6040516001600160a01b03821681527f3329861a0008b3348767567d2405492b997abd79a088d0f2cef6b1a09a8e7ff79060200160405180910390a1603680546001600160a01b0319166001600160a01b0392909216919091179055565b60335460009061010090046001600160a01b031633146125bd5760405162461bcd60e51b815260040161042690614a93565b60335460ff16156125e05760405162461bcd60e51b815260040161042690614a69565b610bda6001613771565b6125f26129ac565b61260e5760405162461bcd60e51b815260040161042690614a32565b808210801561262557506801bc16d674ec80000082105b801561263957506801bc16d674ec80000081105b80156126565750673782dace9d9000006126538383614c50565b10155b6126a25760405162461bcd60e51b815260206004820152601760248201527f696e636f7272656374206675736520696e74657276616c0000000000000000006044820152606401610426565b60408051838152602081018390527fcb8d24e46eb3c402bf344ee60a6576cba9ef2f59ea1af3b311520704924e901a910160405180910390a1606991909155606a55565b60405163095ea7b360e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260001960248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b390604401602060405180830381600087803b15801561277157600080fd5b505af1158015612785573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127a9919061437f565b50565b60335461010090046001600160a01b031633146127db5760405162461bcd60e51b815260040161042690614a93565b60335460ff16156127fe5760405162461bcd60e51b815260040161042690614a69565b6040516301ba3ee760e21b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906306e8fb9c90612858908b908b908b908b908b908b908b908b906004016148a2565b600060405180830381600087803b15801561287257600080fd5b505af1158015612886573d6000803e3d6000fd5b505050506000603560008a8a6040516128a09291906146ba565b60408051918290039091208252602082019290925201600020805460ff191660018360038111156128d3576128d3614cc4565b02179055507f75c4a66b2c6c28cf46db7131182a812e4fbbb2f0591377aa83a737909a9b68c38888888860405161290d949392919061487b565b60405180910390a15050505050505050565b6129276129ac565b6129435760405162461bcd60e51b815260040161042690614a32565b60a354604080516001600160a01b03928316815291831660208301527fe48386b84419f4d36e0f96c10cc3510b6fb1a33795620c5098b22472bbe90796910160405180910390a160a380546001600160a01b0319166001600160a01b0392909216919091179055565b60006129c4600080516020614d608339815191525490565b6001600160a01b0316336001600160a01b031614905090565b6129e56129ac565b612a015760405162461bcd60e51b815260040161042690614a32565b612a29817f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db55565b806001600160a01b0316612a49600080516020614d608339815191525490565b6001600160a01b03167fa39cc5eb22d0f34d8beaefee8a3f17cc229c1a1d1ef87a5ad47313487b1c4f0d60405160405180910390a350565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612ac95760405162461bcd60e51b8152600401610426906149fb565b600080516020614d4083398151915280546002811415612afb5760405162461bcd60e51b815260040161042690614aca565b60028255612b0a858585613611565b5060019055505050565b60335461010090046001600160a01b03163314612b435760405162461bcd60e51b815260040161042690614a93565b60335460ff1615612b665760405162461bcd60e51b815260040161042690614a69565b6000603560008686604051612b7c9291906146ba565b604080519182900390912082526020820192909252016000205460ff1690506001816003811115612baf57612baf614cc4565b14612bf35760405162461bcd60e51b815260206004820152601460248201527315985b1a59185d1bdc881b9bdd081cdd185ad95960621b6044820152606401610426565b604051633877322b60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690633877322b90612c4590889088908890889060040161487b565b600060405180830381600087803b158015612c5f57600080fd5b505af1158015612c73573d6000803e3d6000fd5b505050507ff8821da16f5ed966b41e0343c3eff9903af782d74f99f1689dd9d4562b6545b385858585604051612cac949392919061487b565b60405180910390a16002603560008787604051612cca9291906146ba565b60408051918290039091208252602082019290925201600020805460ff19166001836003811115612cfd57612cfd614cc4565b02179055505050505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612d515760405162461bcd60e51b8152600401610426906149fb565b600080516020614d4083398151915280546002811415612d835760405162461bcd60e51b815260040161042690614aca565b600282556040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015612de957600080fd5b505afa158015612dfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e219190614581565b905060006101075482612e349190614c50565b90508015612e6c57610107829055612e6c7f0000000000000000000000000000000000000000000000000000000000000000826131ce565b5050600182555050565b6036546001600160a01b03163314612ed05760405162461bcd60e51b815260206004820152601960248201527f43616c6c6572206973206e6f7420746865204d6f6e69746f72000000000000006044820152606401610426565b6040517fe765a88a37047c5d793dce22b9ceb5a0f5039d276da139b4c7d29613f341f11090600090a16000603855565b606060a4805480602002602001604051908101604052809291908181526020018280548015612f5857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612f3a575b5050505050905090565b6001600160a01b038281166000908152609f60205260409020541615612fbf5760405162461bcd60e51b81526020600482015260126024820152711c151bdad95b88185b1c9958591e481cd95d60721b6044820152606401610426565b6001600160a01b03821615801590612fdf57506001600160a01b03811615155b61301f5760405162461bcd60e51b8152602060048201526011602482015270496e76616c69642061646472657373657360781b6044820152606401610426565b6001600160a01b038281166000818152609f6020908152604080832080549587166001600160a01b0319968716811790915560a0805460018101825594527f78fdc8d422c49ced035a9edf18d00d3c6a8d81df210f3e5e448e045e77b41e8890930180549095168417909455925190815290917fef6485b84315f9b1483beffa32aae9a0596890395e3d7521f1c5fbb51790e765910160405180910390a25050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612219908490613c6a565b82516131269060a4906020860190613eda565b508151815181146131705760405162461bcd60e51b8152602060048201526014602482015273496e76616c696420696e7075742061727261797360601b6044820152606401610426565b60005b818110156131c7576131b784828151811061319057613190614cf0565b60200260200101518483815181106131aa576131aa614cf0565b6020026020010151612f62565b6131c081614c93565b9050613173565b5050505050565b600081116132175760405162461bcd60e51b81526020600482015260166024820152754d757374206465706f73697420736f6d657468696e6760501b6044820152606401610426565b6040805160008152602081018390526001600160a01b038416917f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62910160405180910390a25050565b60335460ff16156132835760405162461bcd60e51b815260040161042690614a69565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e52253816040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156132e057600080fd5b505af11580156132f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133189190614581565b905060006068548261332a9190614c19565b90508047101561337c5760405162461bcd60e51b815260206004820152601860248201527f696e73756666696369656e74206574682062616c616e636500000000000000006044820152606401610426565b8015610c0d5760006068819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156133e557600080fd5b505af11580156133f9573d6000803e3d6000fd5b505060a354604080516001600160a01b0392831681527f0000000000000000000000000000000000000000000000000000000000000000909216602083015281018590527ff6c07a063ed4e63808eb8da7112d46dbcd38de2b40a73dbcc9353c5a94c723539350606001915061346c9050565b60405180910390a160a354610c0d906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169116836130c1565b6001600160a01b0381166135045760405162461bcd60e51b815260206004820152601a60248201527f4e657720476f7665726e6f7220697320616464726573732830290000000000006044820152606401610426565b806001600160a01b0316613524600080516020614d608339815191525490565b6001600160a01b03167fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a60405160405180910390a36127a981600080516020614d6083398151915255565b600061357e8261010754613d3c565b90508061010760008282546135939190614c50565b90915550505050565b60335460ff16156135bf5760405162461bcd60e51b815260040161042690614a69565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586135f43390565b6040516001600160a01b03909116815260200160405180910390a1565b600081116136615760405162461bcd60e51b815260206004820152601760248201527f4d75737420776974686472617720736f6d657468696e670000000000000000006044820152606401610426565b6001600160a01b0383166136b05760405162461bcd60e51b8152602060048201526016602482015275135d5cdd081cdc1958da599e481c9958da5c1a595b9d60521b6044820152606401610426565b6040805160008152602081018390526001600160a01b038416917f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b6398910160405180910390a26122196001600160a01b03831684836130c1565b6040805160008152602081018390526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016917f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b6398910160405180910390a250565b6000606854471015613786576112eb82613d54565b6000606854476137969190614c50565b9050600191506801bc16d674ec80000081106139735760006801bc16d674ec8000008204905080603460008282546137ce9190614c50565b90915550600090506137e9826801bc16d674ec800000614c31565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561384657600080fd5b505af115801561385a573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b1580156138ea57600080fd5b505af11580156138fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613922919061437f565b5061392c81613709565b60345460408051848152602081019290925281018290527fbe7040030ff7b347853214bf49820c6d455fedf58f3815f85c7bc5216993682b9060600160405180910390a150505b6000606854476139839190614c50565b90506801bc16d674ec80000081106139d55760405162461bcd60e51b8152602060048201526015602482015274756e6578706563746564206163636f756e74696e6760581b6044820152606401610426565b806139e1575050919050565b606954811015613a3b5780606860008282546139fd9190614c19565b90915550506040518181527f7a745a2c63a535068f52ceca27debd5297bbad5f7f37ec53d044a59d0362445d906020015b60405180910390a1613be9565b606a54811115613bd8577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015613aa057600080fd5b505af1158015613ab4573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b158015613b4457600080fd5b505af1158015613b58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b7c919061437f565b50600160346000828254613b909190614c50565b90915550613b9f905081613709565b60345460408051918252602082018390527f6aa7e30787b26429ced603a7aba8b19c4b5d5bcf29a3257da953c8d53bcaa3a69101613a2e565b613be184613d54565b949350505050565b5050919050565b60335460ff16613c395760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610426565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336135f4565b6000613cbf826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613d6c9092919063ffffffff16565b8051909150156122195780806020019051810190613cdd919061437f565b6122195760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610426565b6000818310613d4b5781613d4d565b825b9392505050565b60008115613d6457613d6461359c565b506000919050565b6060613be1848460008585843b613dc55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610426565b600080866001600160a01b03168587604051613de191906146ca565b60006040518083038185875af1925050503d8060008114613e1e576040519150601f19603f3d011682016040523d82523d6000602084013e613e23565b606091505b5091509150613e33828286613e3e565b979650505050505050565b60608315613e4d575081613d4d565b825115613e5d5782518084602001fd5b8160405162461bcd60e51b815260040161042691906149e8565b828054828255906000526020600020908101928215613eca579160200282015b82811115613eca5781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190613e97565b50613ed6929150613f2f565b5090565b828054828255906000526020600020908101928215613eca579160200282015b82811115613eca57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613efa565b5b80821115613ed65760008155600101613f30565b60008083601f840112613f5657600080fd5b5081356001600160401b03811115613f6d57600080fd5b6020830191508360208260051b8501011115613f8857600080fd5b9250929050565b600082601f830112613fa057600080fd5b81356020613fb5613fb083614bb5565b614b85565b80838252828201915082860187848660051b8901011115613fd557600080fd5b60005b85811015613ffd578135613feb81614d1c565b84529284019290840190600101613fd8565b5090979650505050505050565b60008083601f84011261401c57600080fd5b5081356001600160401b0381111561403357600080fd5b602083019150836020828501011115613f8857600080fd5b600060a0828403121561405d57600080fd5b50919050565b600060a0828403121561407557600080fd5b60405160a081018181106001600160401b038211171561409757614097614d06565b6040529050806140a6836140ee565b81526140b460208401614107565b60208201526140c560408401614107565b604082015260608301356140d881614d31565b6060820152608092830135920191909152919050565b803563ffffffff8116811461410257600080fd5b919050565b80356001600160401b038116811461410257600080fd5b60006020828403121561413057600080fd5b8135613d4d81614d1c565b60006020828403121561414d57600080fd5b8151613d4d81614d1c565b6000806040838503121561416b57600080fd5b823561417681614d1c565b9150602083013561418681614d1c565b809150509250929050565b6000806000606084860312156141a657600080fd5b83356141b181614d1c565b925060208401356141c181614d1c565b929592945050506040919091013590565b600080604083850312156141e557600080fd5b82356141f081614d1c565b946020939093013593505050565b6000806020838503121561421157600080fd5b82356001600160401b0381111561422757600080fd5b61423385828601613f44565b90969095509350505050565b60008060006060848603121561425457600080fd5b83356001600160401b038082111561426b57600080fd5b61427787838801613f8f565b9450602086013591508082111561428d57600080fd5b61429987838801613f8f565b935060408601359150808211156142af57600080fd5b506142bc86828701613f8f565b9150509250925092565b600080600060e084860312156142db57600080fd5b83356001600160401b038111156142f157600080fd5b8401601f8101861361430257600080fd5b80356020614312613fb083614bb5565b8083825282820191508285018a848660051b880101111561433257600080fd5b600095505b8486101561435c5761434881614107565b835260019590950194918301918301614337565b509650508601359350614376915086905060408601614063565b90509250925092565b60006020828403121561439157600080fd5b8151613d4d81614d31565b6000602082840312156143ae57600080fd5b5035919050565b600080600080604085870312156143cb57600080fd5b84356001600160401b03808211156143e257600080fd5b6143ee8883890161400a565b9096509450602087013591508082111561440757600080fd5b5061441487828801613f44565b95989497509550505050565b600080600080600080600080610120898b03121561443d57600080fd5b88356001600160401b038082111561445457600080fd5b6144608c838d0161400a565b909a50985060208b013591508082111561447957600080fd5b6144858c838d01613f44565b909850965060408b013591508082111561449e57600080fd5b506144ab8b828c0161400a565b909550935050606089013591506144c58a60808b0161404b565b90509295985092959890939650565b600080600080600060e086880312156144ec57600080fd5b85356001600160401b038082111561450357600080fd5b61450f89838a0161400a565b9097509550602088013591508082111561452857600080fd5b5061453588828901613f44565b90945092506145499050876040880161404b565b90509295509295909350565b60008060006060848603121561456a57600080fd5b505081359360208301359350604090920135919050565b60006020828403121561459357600080fd5b5051919050565b600080604083850312156145ad57600080fd5b50508035926020909101359150565b8183526000602080850194508260005b858110156145f8576001600160401b036145e583614107565b16875295820195908201906001016145cc565b509495945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008151808452614644816020860160208601614c67565b601f01601f19169290920160200192915050565b63ffffffff614666826140ee565b16825261467560208201614107565b6001600160401b0380821660208501528061469260408501614107565b166040850152505060608101356146a881614d31565b15156060830152608090810135910152565b8183823760009101908152919050565b600082516146dc818460208701614c67565b9190910192915050565b6001600160a01b03851681526101006020808301829052855191830182905260009161012084019187810191845b818110156147395783516001600160401b031685529382019392820192600101614714565b505082935086604086015263ffffffff865116606086015280860151925050506001600160401b0380821660808501528060408601511660a085015250506060830151151560c0830152608083015160e083015295945050505050565b6020808252825182820181905260009190848201906040850190845b818110156147d75783516001600160a01b0316835292840192918401916001016147b2565b50909695505050505050565b6000604082016040835280865480835260608501915087600052602092508260002060005b8281101561482d5781546001600160a01b031684529284019260019182019101614808565b505050838103828501528481528590820160005b8681101561486f57823561485481614d1c565b6001600160a01b031682529183019190830190600101614841565b50979650505050505050565b60408152600061488f604083018688614603565b8281036020840152613e338185876145bc565b60006101208083526148b78184018b8d614603565b905082810360208401526148cc81898b6145bc565b905082810360408401526148e1818789614603565b9150508360608301526148f76080830184614658565b9998505050505050505050565b60e08152600061491860e083018789614603565b828103602084015261492b8186886145bc565b91505061493b6040830184614658565b9695505050505050565b60808152600061495960808301888a614603565b828103602084015261496b818861462c565b90508281036040840152614980818688614603565b915050826060830152979650505050505050565b6060815260006149a8606083018688614603565b8460208401528281036040840152613e33818561462c565b60208101600483106149e257634e487b7160e01b600052602160045260246000fd5b91905290565b602081526000613d4d602083018461462c565b60208082526017908201527f43616c6c6572206973206e6f7420746865205661756c74000000000000000000604082015260600190565b6020808252601a908201527f43616c6c6572206973206e6f742074686520476f7665726e6f72000000000000604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601d908201527f43616c6c6572206973206e6f7420746865205265676973747261746f72000000604082015260600190565b6020808252600e908201526d1499595b9d1c985b9d0818d85b1b60921b604082015260600190565b6020808252601c908201527f43616c6c6572206973206e6f7420746865205374726174656769737400000000604082015260600190565b6000808335601e19843603018112614b4057600080fd5b8301803591506001600160401b03821115614b5a57600080fd5b602001915036819003821315613f8857600080fd5b60008235605e198336030181126146dc57600080fd5b604051601f8201601f191681016001600160401b0381118282101715614bad57614bad614d06565b604052919050565b60006001600160401b03821115614bce57614bce614d06565b5060051b60200190565b600080821280156001600160ff1b0384900385131615614bfa57614bfa614cae565b600160ff1b8390038412811615614c1357614c13614cae565b50500190565b60008219821115614c2c57614c2c614cae565b500190565b6000816000190483118215151615614c4b57614c4b614cae565b500290565b600082821015614c6257614c62614cae565b500390565b60005b83811015614c82578181015183820152602001614c6a565b83811115610ef75750506000910152565b6000600019821415614ca757614ca7614cae565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146127a957600080fd5b80151581146127a957600080fdfe53bf423e48ed90e97d02ab0ebab13b2a235a6bfbe9c321847d5c175333ac45357bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4aa264697066735822122036fc9aa0014d1fbbc8fbac98689c50c4cc2fb4601ee35cd2b4f5b5f97319fc4864736f6c63430008070033", "libraries": {}, "devdoc": { "author": "Origin Protocol Inc", @@ -1587,6 +1691,9 @@ "removeSsvValidator(bytes,uint64[],(uint32,uint64,uint64,bool,uint256))": { "notice": "Remove a validator from the SSV Cluster. Make sure `exitSsvValidator` is called before and the validate has exited the Beacon chain. If removed before the validator has exited the beacon chain will result in the validator being slashed. Only the registrator can call this function." }, + "resetStakeETHTally()": { + "notice": "Reset the stakeETHTally" + }, "rewardTokenAddresses(uint256)": { "notice": "Address of the reward tokens. eg CRV, BAL, CVX, AURA" }, @@ -1608,9 +1715,24 @@ "setRewardTokenAddresses(address[])": { "notice": "Set the reward token addresses. Any old addresses will be overwritten." }, + "setStakeETHThreshold(uint256)": { + "notice": "Set the amount of ETH that can be staked before staking monitor" + }, + "setStakingMonitor(address)": { + "notice": "Set the address of the staking monitor that is allowed to reset stakeETHTally" + }, + "stakeETHTally()": { + "notice": "Amount of ETH that can has been staked since the last governor approval." + }, + "stakeETHThreshold()": { + "notice": "Amount of ETH that can be staked before staking on the contract is suspended and the governor needs to approve further staking" + }, "stakeEth((bytes,bytes,bytes32)[])": { "notice": "Stakes WETH to the node validators" }, + "stakingMonitor()": { + "notice": "The account that is allowed to modify stakeETHThreshold and reset stakeETHTally" + }, "supportsAsset(address)": { "notice": "Returns bool indicating whether asset is supported by strategy." }, @@ -1642,7 +1764,7 @@ "storageLayout": { "storage": [ { - "astId": 41769, + "astId": 5553, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "initialized", "offset": 0, @@ -1650,7 +1772,7 @@ "type": "t_bool" }, { - "astId": 41772, + "astId": 5556, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "initializing", "offset": 1, @@ -1658,7 +1780,7 @@ "type": "t_bool" }, { - "astId": 41812, + "astId": 5596, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "______gap", "offset": 0, @@ -1666,7 +1788,7 @@ "type": "t_array(t_uint256)50_storage" }, { - "astId": 656, + "astId": 17, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "_paused", "offset": 0, @@ -1674,7 +1796,7 @@ "type": "t_bool" }, { - "astId": 34884, + "astId": 3709, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "validatorRegistrator", "offset": 1, @@ -1682,7 +1804,7 @@ "type": "t_address" }, { - "astId": 34887, + "astId": 3712, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "activeDepositedValidators", "offset": 0, @@ -1690,23 +1812,47 @@ "type": "t_uint256" }, { - "astId": 34893, + "astId": 3718, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "validatorsStates", "offset": 0, "slot": "53", - "type": "t_mapping(t_bytes32,t_enum(VALIDATOR_STATE)34902)" + "type": "t_mapping(t_bytes32,t_enum(VALIDATOR_STATE)3736)" }, { - "astId": 34897, + "astId": 3721, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", - "label": "__gap", + "label": "stakingMonitor", "offset": 0, "slot": "54", - "type": "t_array(t_uint256)50_storage" + "type": "t_address" + }, + { + "astId": 3724, + "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", + "label": "stakeETHThreshold", + "offset": 0, + "slot": "55", + "type": "t_uint256" + }, + { + "astId": 3727, + "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", + "label": "stakeETHTally", + "offset": 0, + "slot": "56", + "type": "t_uint256" }, { - "astId": 34379, + "astId": 3731, + "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", + "label": "__gap", + "offset": 0, + "slot": "57", + "type": "t_array(t_uint256)47_storage" + }, + { + "astId": 3204, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "consensusRewards", "offset": 0, @@ -1714,7 +1860,7 @@ "type": "t_uint256" }, { - "astId": 34382, + "astId": 3207, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "fuseIntervalStart", "offset": 0, @@ -1722,7 +1868,7 @@ "type": "t_uint256" }, { - "astId": 34385, + "astId": 3210, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "fuseIntervalEnd", "offset": 0, @@ -1730,7 +1876,7 @@ "type": "t_uint256" }, { - "astId": 34388, + "astId": 3213, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "lastFixAccountingBlockNumber", "offset": 0, @@ -1738,7 +1884,7 @@ "type": "t_uint256" }, { - "astId": 34392, + "astId": 3217, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "__gap", "offset": 0, @@ -1746,7 +1892,7 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 41892, + "astId": 5676, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "_deprecated_platformAddress", "offset": 0, @@ -1754,7 +1900,7 @@ "type": "t_address" }, { - "astId": 41895, + "astId": 5679, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "_deprecated_vaultAddress", "offset": 0, @@ -1762,7 +1908,7 @@ "type": "t_address" }, { - "astId": 41900, + "astId": 5684, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "assetToPToken", "offset": 0, @@ -1770,7 +1916,7 @@ "type": "t_mapping(t_address,t_address)" }, { - "astId": 41904, + "astId": 5688, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "assetsMapped", "offset": 0, @@ -1778,7 +1924,7 @@ "type": "t_array(t_address)dyn_storage" }, { - "astId": 41906, + "astId": 5690, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "_deprecated_rewardTokenAddress", "offset": 0, @@ -1786,7 +1932,7 @@ "type": "t_address" }, { - "astId": 41908, + "astId": 5692, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "_deprecated_rewardLiquidationThreshold", "offset": 0, @@ -1794,7 +1940,7 @@ "type": "t_uint256" }, { - "astId": 41911, + "astId": 5695, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "harvesterAddress", "offset": 0, @@ -1802,7 +1948,7 @@ "type": "t_address" }, { - "astId": 41915, + "astId": 5699, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "rewardTokenAddresses", "offset": 0, @@ -1810,7 +1956,7 @@ "type": "t_array(t_address)dyn_storage" }, { - "astId": 41919, + "astId": 5703, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "_reserved", "offset": 0, @@ -1818,7 +1964,7 @@ "type": "t_array(t_int256)98_storage" }, { - "astId": 33893, + "astId": 2718, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "depositedWethAccountedFor", "offset": 0, @@ -1826,7 +1972,7 @@ "type": "t_uint256" }, { - "astId": 33897, + "astId": 2722, "contract": "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol:NativeStakingSSVStrategy", "label": "__gap", "offset": 0, @@ -1852,6 +1998,12 @@ "label": "int256[98]", "numberOfBytes": "3136" }, + "t_array(t_uint256)47_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[47]", + "numberOfBytes": "1504" + }, "t_array(t_uint256)49_storage": { "base": "t_uint256", "encoding": "inplace", @@ -1874,7 +2026,7 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_enum(VALIDATOR_STATE)34902": { + "t_enum(VALIDATOR_STATE)3736": { "encoding": "inplace", "label": "enum ValidatorRegistrator.VALIDATOR_STATE", "numberOfBytes": "1" @@ -1891,12 +2043,12 @@ "numberOfBytes": "32", "value": "t_address" }, - "t_mapping(t_bytes32,t_enum(VALIDATOR_STATE)34902)": { + "t_mapping(t_bytes32,t_enum(VALIDATOR_STATE)3736)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => enum ValidatorRegistrator.VALIDATOR_STATE)", "numberOfBytes": "32", - "value": "t_enum(VALIDATOR_STATE)34902" + "value": "t_enum(VALIDATOR_STATE)3736" }, "t_uint256": { "encoding": "inplace", diff --git a/contracts/deployments/holesky/solcInputs/a7af3565925bcd06d3e7b2ed59f01c90.json b/contracts/deployments/holesky/solcInputs/a7af3565925bcd06d3e7b2ed59f01c90.json new file mode 100644 index 0000000000..3b7662b904 --- /dev/null +++ b/contracts/deployments/holesky/solcInputs/a7af3565925bcd06d3e7b2ed59f01c90.json @@ -0,0 +1,107 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/security/Pausable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n function safeTransfer(\n IERC20 token,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(\n IERC20 token,\n address from,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n uint256 newAllowance = token.allowance(address(this), spender) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) {\n // Return data is optional\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@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" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a / b + (a % b == 0 ? 0 : 1);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)\n\npragma solidity ^0.8.0;\n\n// CAUTION\n// This version of SafeMath should only be used with Solidity 0.8 or later,\n// because it relies on the compiler's built in overflow checks.\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations.\n *\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\n * now has built in overflow checking.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a + b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator.\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b <= a, errorMessage);\n return a - b;\n }\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a / b;\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a % b;\n }\n }\n}\n" + }, + "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" + }, + "contracts/interfaces/IBasicToken.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IBasicToken {\n function symbol() external view returns (string memory);\n\n function decimals() external view returns (uint8);\n}\n" + }, + "contracts/interfaces/IDepositContract.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IDepositContract {\n /// @notice A processed deposit event.\n event DepositEvent(\n bytes pubkey,\n bytes withdrawal_credentials,\n bytes amount,\n bytes signature,\n bytes index\n );\n\n /// @notice Submit a Phase 0 DepositData object.\n /// @param pubkey A BLS12-381 public key.\n /// @param withdrawal_credentials Commitment to a public key for withdrawals.\n /// @param signature A BLS12-381 signature.\n /// @param deposit_data_root The SHA-256 hash of the SSZ-encoded DepositData object.\n /// Used as a protection against malformed input.\n function deposit(\n bytes calldata pubkey,\n bytes calldata withdrawal_credentials,\n bytes calldata signature,\n bytes32 deposit_data_root\n ) external payable;\n\n /// @notice Query the current deposit root hash.\n /// @return The deposit root hash.\n function get_deposit_root() external view returns (bytes32);\n\n /// @notice Query the current deposit count.\n /// @return The deposit count encoded as a little endian 64-bit number.\n function get_deposit_count() external view returns (bytes memory);\n}\n" + }, + "contracts/interfaces/ISSVNetwork.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nstruct Cluster {\n uint32 validatorCount;\n uint64 networkFeeIndex;\n uint64 index;\n bool active;\n uint256 balance;\n}\n\ninterface ISSVNetwork {\n /**********/\n /* Errors */\n /**********/\n\n error CallerNotOwner(); // 0x5cd83192\n error CallerNotWhitelisted(); // 0x8c6e5d71\n error FeeTooLow(); // 0x732f9413\n error FeeExceedsIncreaseLimit(); // 0x958065d9\n error NoFeeDeclared(); // 0x1d226c30\n error ApprovalNotWithinTimeframe(); // 0x97e4b518\n error OperatorDoesNotExist(); // 0x961e3e8c\n error InsufficientBalance(); // 0xf4d678b8\n error ValidatorDoesNotExist(); // 0xe51315d2\n error ClusterNotLiquidatable(); // 0x60300a8d\n error InvalidPublicKeyLength(); // 0x637297a4\n error InvalidOperatorIdsLength(); // 0x38186224\n error ClusterAlreadyEnabled(); // 0x3babafd2\n error ClusterIsLiquidated(); // 0x95a0cf33\n error ClusterDoesNotExists(); // 0x185e2b16\n error IncorrectClusterState(); // 0x12e04c87\n error UnsortedOperatorsList(); // 0xdd020e25\n error NewBlockPeriodIsBelowMinimum(); // 0x6e6c9cac\n error ExceedValidatorLimit(); // 0x6df5ab76\n error TokenTransferFailed(); // 0x045c4b02\n error SameFeeChangeNotAllowed(); // 0xc81272f8\n error FeeIncreaseNotAllowed(); // 0x410a2b6c\n error NotAuthorized(); // 0xea8e4eb5\n error OperatorsListNotUnique(); // 0xa5a1ff5d\n error OperatorAlreadyExists(); // 0x289c9494\n error TargetModuleDoesNotExist(); // 0x8f9195fb\n error MaxValueExceeded(); // 0x91aa3017\n error FeeTooHigh(); // 0xcd4e6167\n error PublicKeysSharesLengthMismatch(); // 0x9ad467b8\n error IncorrectValidatorStateWithData(bytes publicKey); // 0x89307938\n error ValidatorAlreadyExistsWithData(bytes publicKey); // 0x388e7999\n error EmptyPublicKeysList(); // df83e679\n\n // legacy errors\n error ValidatorAlreadyExists(); // 0x8d09a73e\n error IncorrectValidatorState(); // 0x2feda3c1\n\n event AdminChanged(address previousAdmin, address newAdmin);\n event BeaconUpgraded(address indexed beacon);\n event ClusterDeposited(\n address indexed owner,\n uint64[] operatorIds,\n uint256 value,\n Cluster cluster\n );\n event ClusterLiquidated(\n address indexed owner,\n uint64[] operatorIds,\n Cluster cluster\n );\n event ClusterReactivated(\n address indexed owner,\n uint64[] operatorIds,\n Cluster cluster\n );\n event ClusterWithdrawn(\n address indexed owner,\n uint64[] operatorIds,\n uint256 value,\n Cluster cluster\n );\n event DeclareOperatorFeePeriodUpdated(uint64 value);\n event ExecuteOperatorFeePeriodUpdated(uint64 value);\n event FeeRecipientAddressUpdated(\n address indexed owner,\n address recipientAddress\n );\n event Initialized(uint8 version);\n event LiquidationThresholdPeriodUpdated(uint64 value);\n event MinimumLiquidationCollateralUpdated(uint256 value);\n event NetworkEarningsWithdrawn(uint256 value, address recipient);\n event NetworkFeeUpdated(uint256 oldFee, uint256 newFee);\n event OperatorAdded(\n uint64 indexed operatorId,\n address indexed owner,\n bytes publicKey,\n uint256 fee\n );\n event OperatorFeeDeclarationCancelled(\n address indexed owner,\n uint64 indexed operatorId\n );\n event OperatorFeeDeclared(\n address indexed owner,\n uint64 indexed operatorId,\n uint256 blockNumber,\n uint256 fee\n );\n event OperatorFeeExecuted(\n address indexed owner,\n uint64 indexed operatorId,\n uint256 blockNumber,\n uint256 fee\n );\n event OperatorFeeIncreaseLimitUpdated(uint64 value);\n event OperatorMaximumFeeUpdated(uint64 maxFee);\n event OperatorRemoved(uint64 indexed operatorId);\n event OperatorWhitelistUpdated(\n uint64 indexed operatorId,\n address whitelisted\n );\n event OperatorWithdrawn(\n address indexed owner,\n uint64 indexed operatorId,\n uint256 value\n );\n event OwnershipTransferStarted(\n address indexed previousOwner,\n address indexed newOwner\n );\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n event Upgraded(address indexed implementation);\n event ValidatorAdded(\n address indexed owner,\n uint64[] operatorIds,\n bytes publicKey,\n bytes shares,\n Cluster cluster\n );\n event ValidatorExited(\n address indexed owner,\n uint64[] operatorIds,\n bytes publicKey\n );\n event ValidatorRemoved(\n address indexed owner,\n uint64[] operatorIds,\n bytes publicKey,\n Cluster cluster\n );\n\n fallback() external;\n\n function acceptOwnership() external;\n\n function cancelDeclaredOperatorFee(uint64 operatorId) external;\n\n function declareOperatorFee(uint64 operatorId, uint256 fee) external;\n\n function deposit(\n address clusterOwner,\n uint64[] memory operatorIds,\n uint256 amount,\n Cluster memory cluster\n ) external;\n\n function executeOperatorFee(uint64 operatorId) external;\n\n function exitValidator(bytes memory publicKey, uint64[] memory operatorIds)\n external;\n\n function getVersion() external pure returns (string memory version);\n\n function initialize(\n address token_,\n address ssvOperators_,\n address ssvClusters_,\n address ssvDAO_,\n address ssvViews_,\n uint64 minimumBlocksBeforeLiquidation_,\n uint256 minimumLiquidationCollateral_,\n uint32 validatorsPerOperatorLimit_,\n uint64 declareOperatorFeePeriod_,\n uint64 executeOperatorFeePeriod_,\n uint64 operatorMaxFeeIncrease_\n ) external;\n\n function liquidate(\n address clusterOwner,\n uint64[] memory operatorIds,\n Cluster memory cluster\n ) external;\n\n function owner() external view returns (address);\n\n function pendingOwner() external view returns (address);\n\n function proxiableUUID() external view returns (bytes32);\n\n function reactivate(\n uint64[] memory operatorIds,\n uint256 amount,\n Cluster memory cluster\n ) external;\n\n function reduceOperatorFee(uint64 operatorId, uint256 fee) external;\n\n function registerOperator(bytes memory publicKey, uint256 fee)\n external\n returns (uint64 id);\n\n function registerValidator(\n bytes memory publicKey,\n uint64[] memory operatorIds,\n bytes memory sharesData,\n uint256 amount,\n Cluster memory cluster\n ) external;\n\n function removeOperator(uint64 operatorId) external;\n\n function removeValidator(\n bytes memory publicKey,\n uint64[] memory operatorIds,\n Cluster memory cluster\n ) external;\n\n function renounceOwnership() external;\n\n function setFeeRecipientAddress(address recipientAddress) external;\n\n function setOperatorWhitelist(uint64 operatorId, address whitelisted)\n external;\n\n function transferOwnership(address newOwner) external;\n\n function updateDeclareOperatorFeePeriod(uint64 timeInSeconds) external;\n\n function updateExecuteOperatorFeePeriod(uint64 timeInSeconds) external;\n\n function updateLiquidationThresholdPeriod(uint64 blocks) external;\n\n function updateMaximumOperatorFee(uint64 maxFee) external;\n\n function updateMinimumLiquidationCollateral(uint256 amount) external;\n\n function updateModule(uint8 moduleId, address moduleAddress) external;\n\n function updateNetworkFee(uint256 fee) external;\n\n function updateOperatorFeeIncreaseLimit(uint64 percentage) external;\n\n function upgradeTo(address newImplementation) external;\n\n function upgradeToAndCall(address newImplementation, bytes memory data)\n external\n payable;\n\n function withdraw(\n uint64[] memory operatorIds,\n uint256 amount,\n Cluster memory cluster\n ) external;\n\n function withdrawAllOperatorEarnings(uint64 operatorId) external;\n\n function withdrawNetworkEarnings(uint256 amount) external;\n\n function withdrawOperatorEarnings(uint64 operatorId, uint256 amount)\n external;\n}\n" + }, + "contracts/interfaces/IStrategy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @title Platform interface to integrate with lending platform like Compound, AAVE etc.\n */\ninterface IStrategy {\n /**\n * @dev Deposit the given asset to platform\n * @param _asset asset address\n * @param _amount Amount to deposit\n */\n function deposit(address _asset, uint256 _amount) external;\n\n /**\n * @dev Deposit the entire balance of all supported assets in the Strategy\n * to the platform\n */\n function depositAll() external;\n\n /**\n * @dev Withdraw given asset from Lending platform\n */\n function withdraw(\n address _recipient,\n address _asset,\n uint256 _amount\n ) external;\n\n /**\n * @dev Liquidate all assets in strategy and return them to Vault.\n */\n function withdrawAll() external;\n\n /**\n * @dev Returns the current balance of the given asset.\n */\n function checkBalance(address _asset)\n external\n view\n returns (uint256 balance);\n\n /**\n * @dev Returns bool indicating whether strategy supports asset.\n */\n function supportsAsset(address _asset) external view returns (bool);\n\n /**\n * @dev Collect reward tokens from the Strategy.\n */\n function collectRewardTokens() external;\n\n /**\n * @dev The address array of the reward tokens for the Strategy.\n */\n function getRewardTokenAddresses() external view returns (address[] memory);\n}\n" + }, + "contracts/interfaces/IVault.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { VaultStorage } from \"../vault/VaultStorage.sol\";\n\ninterface IVault {\n event AssetSupported(address _asset);\n event AssetDefaultStrategyUpdated(address _asset, address _strategy);\n event AssetAllocated(address _asset, address _strategy, uint256 _amount);\n event StrategyApproved(address _addr);\n event StrategyRemoved(address _addr);\n event Mint(address _addr, uint256 _value);\n event Redeem(address _addr, uint256 _value);\n event CapitalPaused();\n event CapitalUnpaused();\n event RebasePaused();\n event RebaseUnpaused();\n event VaultBufferUpdated(uint256 _vaultBuffer);\n event RedeemFeeUpdated(uint256 _redeemFeeBps);\n event PriceProviderUpdated(address _priceProvider);\n event AllocateThresholdUpdated(uint256 _threshold);\n event RebaseThresholdUpdated(uint256 _threshold);\n event StrategistUpdated(address _address);\n event MaxSupplyDiffChanged(uint256 maxSupplyDiff);\n event YieldDistribution(address _to, uint256 _yield, uint256 _fee);\n event TrusteeFeeBpsChanged(uint256 _basis);\n event TrusteeAddressChanged(address _address);\n event SwapperChanged(address _address);\n event SwapAllowedUndervalueChanged(uint256 _basis);\n event SwapSlippageChanged(address _asset, uint256 _basis);\n event Swapped(\n address indexed _fromAsset,\n address indexed _toAsset,\n uint256 _fromAssetAmount,\n uint256 _toAssetAmount\n );\n\n // Governable.sol\n function transferGovernance(address _newGovernor) external;\n\n function claimGovernance() external;\n\n function governor() external view returns (address);\n\n // VaultAdmin.sol\n function setPriceProvider(address _priceProvider) external;\n\n function priceProvider() external view returns (address);\n\n function setRedeemFeeBps(uint256 _redeemFeeBps) external;\n\n function redeemFeeBps() external view returns (uint256);\n\n function setVaultBuffer(uint256 _vaultBuffer) external;\n\n function vaultBuffer() external view returns (uint256);\n\n function setAutoAllocateThreshold(uint256 _threshold) external;\n\n function autoAllocateThreshold() external view returns (uint256);\n\n function setRebaseThreshold(uint256 _threshold) external;\n\n function rebaseThreshold() external view returns (uint256);\n\n function setStrategistAddr(address _address) external;\n\n function strategistAddr() external view returns (address);\n\n function setMaxSupplyDiff(uint256 _maxSupplyDiff) external;\n\n function maxSupplyDiff() external view returns (uint256);\n\n function setTrusteeAddress(address _address) external;\n\n function trusteeAddress() external view returns (address);\n\n function setTrusteeFeeBps(uint256 _basis) external;\n\n function trusteeFeeBps() external view returns (uint256);\n\n function ousdMetaStrategy() external view returns (address);\n\n function setSwapper(address _swapperAddr) external;\n\n function setSwapAllowedUndervalue(uint16 _percentageBps) external;\n\n function setOracleSlippage(address _asset, uint16 _allowedOracleSlippageBps)\n external;\n\n function supportAsset(address _asset, uint8 _supportsAsset) external;\n\n function approveStrategy(address _addr) external;\n\n function removeStrategy(address _addr) external;\n\n function setAssetDefaultStrategy(address _asset, address _strategy)\n external;\n\n function assetDefaultStrategies(address _asset)\n external\n view\n returns (address);\n\n function pauseRebase() external;\n\n function unpauseRebase() external;\n\n function rebasePaused() external view returns (bool);\n\n function pauseCapital() external;\n\n function unpauseCapital() external;\n\n function capitalPaused() external view returns (bool);\n\n function transferToken(address _asset, uint256 _amount) external;\n\n function priceUnitMint(address asset) external view returns (uint256);\n\n function priceUnitRedeem(address asset) external view returns (uint256);\n\n function withdrawAllFromStrategy(address _strategyAddr) external;\n\n function withdrawAllFromStrategies() external;\n\n function withdrawFromStrategy(\n address _strategyFromAddress,\n address[] calldata _assets,\n uint256[] calldata _amounts\n ) external;\n\n function depositToStrategy(\n address _strategyToAddress,\n address[] calldata _assets,\n uint256[] calldata _amounts\n ) external;\n\n // VaultCore.sol\n function mint(\n address _asset,\n uint256 _amount,\n uint256 _minimumOusdAmount\n ) external;\n\n function mintForStrategy(uint256 _amount) external;\n\n function redeem(uint256 _amount, uint256 _minimumUnitAmount) external;\n\n function burnForStrategy(uint256 _amount) external;\n\n function redeemAll(uint256 _minimumUnitAmount) external;\n\n function allocate() external;\n\n function rebase() external;\n\n function swapCollateral(\n address fromAsset,\n address toAsset,\n uint256 fromAssetAmount,\n uint256 minToAssetAmount,\n bytes calldata data\n ) external returns (uint256 toAssetAmount);\n\n function totalValue() external view returns (uint256 value);\n\n function checkBalance(address _asset) external view returns (uint256);\n\n function calculateRedeemOutputs(uint256 _amount)\n external\n view\n returns (uint256[] memory);\n\n function getAssetCount() external view returns (uint256);\n\n function getAssetConfig(address _asset)\n external\n view\n returns (VaultStorage.Asset memory config);\n\n function getAllAssets() external view returns (address[] memory);\n\n function getStrategyCount() external view returns (uint256);\n\n function swapper() external view returns (address);\n\n function allowedSwapUndervalue() external view returns (uint256);\n\n function getAllStrategies() external view returns (address[] memory);\n\n function isSupportedAsset(address _asset) external view returns (bool);\n\n function netOusdMintForStrategyThreshold() external view returns (uint256);\n\n function setOusdMetaStrategy(address _ousdMetaStrategy) external;\n\n function setNetOusdMintForStrategyThreshold(uint256 _threshold) external;\n\n function netOusdMintedForStrategy() external view returns (int256);\n\n function weth() external view returns (address);\n\n function cacheWETHAssetIndex() external;\n\n function wethAssetIndex() external view returns (uint256);\n\n function initialize(address, address) external;\n\n function setAdminImpl(address) external;\n\n function removeAsset(address _asset) external;\n}\n" + }, + "contracts/interfaces/IWETH9.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IWETH9 {\n event Approval(address indexed src, address indexed guy, uint256 wad);\n event Deposit(address indexed dst, uint256 wad);\n event Transfer(address indexed src, address indexed dst, uint256 wad);\n event Withdrawal(address indexed src, uint256 wad);\n\n function allowance(address, address) external view returns (uint256);\n\n function approve(address guy, uint256 wad) external returns (bool);\n\n function balanceOf(address) external view returns (uint256);\n\n function decimals() external view returns (uint8);\n\n function deposit() external payable;\n\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function totalSupply() external view returns (uint256);\n\n function transfer(address dst, uint256 wad) external returns (bool);\n\n function transferFrom(\n address src,\n address dst,\n uint256 wad\n ) external returns (bool);\n\n function withdraw(uint256 wad) external;\n}\n" + }, + "contracts/strategies/NativeStaking/FeeAccumulator.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 Fee Accumulator for Native Staking SSV Strategy\n * @notice Receives execution rewards which includes tx fees and\n * MEV rewards like tx priority and tx ordering.\n * It does NOT include swept ETH from beacon chain consensus rewards or full validator withdrawals.\n * @author Origin Protocol Inc\n */\ncontract FeeAccumulator is Governable {\n /// @notice The address of the Native Staking Strategy\n address public immutable STRATEGY;\n\n /**\n * @param _strategy Address of the Native Staking Strategy\n */\n constructor(address _strategy) {\n STRATEGY = _strategy;\n }\n\n /**\n * @notice sends all ETH in this FeeAccumulator contract to the Native Staking Strategy.\n * @return eth The amount of execution rewards that were sent to the Native Staking Strategy\n */\n function collect() external returns (uint256 eth) {\n require(msg.sender == STRATEGY, \"Caller is not the Strategy\");\n\n eth = address(this).balance;\n if (eth > 0) {\n // Send the ETH to the Native Staking Strategy\n Address.sendValue(payable(STRATEGY), eth);\n }\n }\n\n /**\n * @dev Accept ETH\n */\n receive() external payable {}\n}\n" + }, + "contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\n\nimport { InitializableAbstractStrategy } from \"../../utils/InitializableAbstractStrategy.sol\";\nimport { IWETH9 } from \"../../interfaces/IWETH9.sol\";\nimport { FeeAccumulator } from \"./FeeAccumulator.sol\";\nimport { ValidatorAccountant } from \"./ValidatorAccountant.sol\";\n\nstruct ValidatorStakeData {\n bytes pubkey;\n bytes signature;\n bytes32 depositDataRoot;\n}\n\n/// @title Native Staking SSV Strategy\n/// @notice Strategy to deploy funds into DVT validators powered by the SSV Network\n/// @author Origin Protocol Inc\n/// @dev This contract handles WETH and ETH and in some operations interchanges between the two. Any WETH that\n/// is on the contract across multiple blocks (and not just transitory within a transaction) is considered an\n/// asset. Meaning deposits increase the balance of the asset and withdrawal decrease it. As opposed to all\n/// our other strategies the WETH doesn't immediately get deposited into an underlying strategy and can be present\n/// across multiple blocks waiting to be unwrapped to ETH and staked to validators. This separation of WETH and ETH is\n/// required since the rewards (reward token) is also in ETH.\n///\n/// To simplify the accounting of WETH there is another difference in behavior compared to the other strategies.\n/// To withdraw WETH asset - exit message is posted to validators and the ETH hits this contract with multiple days\n/// delay. In order to simplify the WETH accounting upon detection of such an event the ValidatorAccountant\n/// immediately wraps ETH to WETH and sends it to the Vault.\n///\n/// On the other hand any ETH on the contract (across multiple blocks) is there either:\n/// - as a result of already accounted for consensus rewards\n/// - as a result of not yet accounted for consensus rewards\n/// - as a results of not yet accounted for full validator withdrawals (or validator slashes)\n///\n/// Even though the strategy assets and rewards are a very similar asset the consensus layer rewards and the\n/// execution layer rewards are considered rewards and those are dripped to the Vault over a configurable time\n/// interval and not immediately.\ncontract NativeStakingSSVStrategy is\n ValidatorAccountant,\n InitializableAbstractStrategy\n{\n using SafeERC20 for IERC20;\n\n /// @notice SSV ERC20 token that serves as a payment for operating SSV validators\n address public immutable SSV_TOKEN_ADDRESS;\n /// @notice Fee collector address\n /// @dev this address will receive Execution layer rewards - These are rewards earned for\n /// executing transactions on the Ethereum network as part of block proposals. They include\n /// priority fees (fees paid by users for their transactions to be included) and MEV rewards\n /// (rewards for arranging transactions in a way that benefits the validator).\n address payable public immutable FEE_ACCUMULATOR_ADDRESS;\n\n /// @dev This contract receives WETH as the deposit asset, but unlike other strategies doesn't immediately\n /// deposit it to an underlying platform. Rather a special privilege account stakes it to the validators.\n /// For that reason calling WETH.balanceOf(this) in a deposit function can contain WETH that has just been\n /// deposited and also WETH that has previously been deposited. To keep a correct count we need to keep track\n /// of WETH that has already been accounted for.\n /// This value represents the amount of WETH balance of this contract that has already been accounted for by the\n /// deposit events.\n /// It is important to note that this variable is not concerned with WETH that is a result of full/partial\n /// withdrawal of the validators. It is strictly concerned with WETH that has been deposited and is waiting to\n /// be staked.\n uint256 public depositedWethAccountedFor;\n\n // For future use\n uint256[49] private __gap;\n\n /// @param _baseConfig Base strategy config with platformAddress (ERC-4626 Vault contract), eg sfrxETH or sDAI,\n /// and vaultAddress (OToken Vault contract), eg VaultProxy or OETHVaultProxy\n /// @param _wethAddress Address of the Erc20 WETH Token contract\n /// @param _ssvToken Address of the Erc20 SSV Token contract\n /// @param _ssvNetwork Address of the SSV Network contract\n /// @param _feeAccumulator Address of the fee accumulator receiving execution layer validator rewards\n /// @param _beaconChainDepositContract Address of the beacon chain deposit contract\n constructor(\n BaseStrategyConfig memory _baseConfig,\n address _wethAddress,\n address _ssvToken,\n address _ssvNetwork,\n address _feeAccumulator,\n address _beaconChainDepositContract\n )\n InitializableAbstractStrategy(_baseConfig)\n ValidatorAccountant(\n _wethAddress,\n _baseConfig.vaultAddress,\n _beaconChainDepositContract,\n _ssvNetwork\n )\n {\n SSV_TOKEN_ADDRESS = _ssvToken;\n FEE_ACCUMULATOR_ADDRESS = payable(_feeAccumulator);\n }\n\n /// @notice initialize function, to set up initial internal state\n /// @param _rewardTokenAddresses Address of reward token for platform\n /// @param _assets Addresses of initial supported assets\n /// @param _pTokens Platform Token corresponding addresses\n function initialize(\n address[] memory _rewardTokenAddresses,\n address[] memory _assets,\n address[] memory _pTokens\n ) external onlyGovernor initializer {\n InitializableAbstractStrategy._initialize(\n _rewardTokenAddresses,\n _assets,\n _pTokens\n );\n }\n\n /// @dev Convert accumulated ETH to WETH and send to the Harvester.\n /// Will revert if the strategy is paused for accounting.\n function _collectRewardTokens() internal override whenNotPaused {\n // collect ETH from execution rewards from the fee accumulator\n uint256 executionRewards = FeeAccumulator(FEE_ACCUMULATOR_ADDRESS)\n .collect();\n\n // total ETH rewards to be harvested = execution rewards + consensus rewards\n uint256 ethRewards = executionRewards + consensusRewards;\n\n require(\n address(this).balance >= ethRewards,\n \"insufficient eth balance\"\n );\n\n if (ethRewards > 0) {\n // reset the counter keeping track of beacon chain consensus rewards\n consensusRewards = 0;\n\n // Convert ETH rewards to WETH\n IWETH9(WETH_TOKEN_ADDRESS).deposit{ value: ethRewards }();\n\n emit RewardTokenCollected(\n harvesterAddress,\n WETH_TOKEN_ADDRESS,\n ethRewards\n );\n IERC20(WETH_TOKEN_ADDRESS).safeTransfer(\n harvesterAddress,\n ethRewards\n );\n }\n }\n\n /// @notice Unlike other strategies, this does not deposit assets into the underlying platform.\n /// It just checks the asset is WETH and emits the Deposit event.\n /// To deposit WETH into validators `registerSsvValidator` and `stakeEth` must be used.\n /// Will NOT revert if the strategy is paused from an accounting failure.\n /// @param _asset Address of asset to deposit. Has to be WETH.\n /// @param _amount Amount of assets that were transferred to the strategy by the vault.\n function deposit(address _asset, uint256 _amount)\n external\n override\n onlyVault\n nonReentrant\n {\n require(_asset == WETH_TOKEN_ADDRESS, \"Unsupported asset\");\n depositedWethAccountedFor += _amount;\n _deposit(_asset, _amount);\n }\n\n /// @dev Deposit WETH to this strategy so it can later be staked into a validator.\n /// @param _asset Address of WETH\n /// @param _amount Amount of WETH to deposit\n function _deposit(address _asset, uint256 _amount) internal {\n require(_amount > 0, \"Must deposit something\");\n /*\n * We could do a check here that would revert when \"_amount % 32 ether != 0\". With the idea of\n * not allowing deposits that will result in WETH sitting on the strategy after all the possible batches\n * of 32ETH have been staked.\n * But someone could mess with our strategy by sending some WETH to it. And we might want to deposit just\n * enough WETH to add it up to 32 so it can be staked. For that reason the check is left out.\n *\n * WETH sitting on the strategy won't interfere with the accounting since accounting only operates on ETH.\n */\n emit Deposit(_asset, address(0), _amount);\n }\n\n /// @notice Unlike other strategies, this does not deposit assets into the underlying platform.\n /// It just emits the Deposit event.\n /// To deposit WETH into validators `registerSsvValidator` and `stakeEth` must be used.\n /// Will NOT revert if the strategy is paused from an accounting failure.\n function depositAll() external override onlyVault nonReentrant {\n uint256 wethBalance = IERC20(WETH_TOKEN_ADDRESS).balanceOf(\n address(this)\n );\n uint256 newWeth = wethBalance - depositedWethAccountedFor;\n\n if (newWeth > 0) {\n depositedWethAccountedFor = wethBalance;\n\n _deposit(WETH_TOKEN_ADDRESS, newWeth);\n }\n }\n\n /// @notice Withdraw WETH from this contract. Used only if some WETH for is lingering on the contract. That\n /// can happen when:\n /// - the deposit was not a multiple of 32 WETH\n /// - someone sent WETH directly to this contract\n /// Will NOT revert if the strategy is paused from an accounting failure.\n /// @param _recipient Address to receive withdrawn assets\n /// @param _asset WETH to withdraw\n /// @param _amount Amount of WETH to withdraw\n function withdraw(\n address _recipient,\n address _asset,\n uint256 _amount\n ) external override onlyVault nonReentrant {\n _withdraw(_recipient, _asset, _amount);\n }\n\n function _withdraw(\n address _recipient,\n address _asset,\n uint256 _amount\n ) internal {\n require(_amount > 0, \"Must withdraw something\");\n require(_recipient != address(0), \"Must specify recipient\");\n\n emit Withdrawal(_asset, address(0), _amount);\n IERC20(_asset).safeTransfer(_recipient, _amount);\n }\n\n /// @notice transfer all WETH deposits back to the vault.\n /// This does not withdraw from the validators. That has to be done separately with the\n /// `exitSsvValidator` and `removeSsvValidator` operations.\n /// This does not withdraw any execution rewards from the FeeAccumulator or\n /// consensus rewards in this strategy.\n /// Any ETH in this strategy that was swept from a full validator withdrawal will not be withdrawn.\n /// ETH from full validator withdrawals is sent to the Vault using `doAccounting`.\n /// Will NOT revert if the strategy is paused from an accounting failure.\n function withdrawAll() external override onlyVaultOrGovernor nonReentrant {\n uint256 wethBalance = IERC20(WETH_TOKEN_ADDRESS).balanceOf(\n address(this)\n );\n if (wethBalance > 0) {\n _withdraw(vaultAddress, WETH_TOKEN_ADDRESS, wethBalance);\n }\n }\n\n function _abstractSetPToken(address _asset, address) internal override {}\n\n /// @notice Returns the total value of (W)ETH that is staked to the validators\n /// and WETH deposits that are still to be staked.\n /// This does not include ETH from consensus rewards sitting in this strategy\n /// or ETH from MEV rewards in the FeeAccumulator. These rewards are harvested\n /// and sent to the Dripper so will eventually be sent to the Vault as WETH.\n /// @param _asset Address of weth asset\n /// @return balance Total value of (W)ETH\n function checkBalance(address _asset)\n external\n view\n override\n returns (uint256 balance)\n {\n require(_asset == WETH_TOKEN_ADDRESS, \"Unsupported asset\");\n\n balance =\n // add the ETH that has been staked in validators\n activeDepositedValidators *\n 32 ether +\n // add the WETH in the strategy from deposits that are still to be staked\n IERC20(WETH_TOKEN_ADDRESS).balanceOf(address(this));\n }\n\n function pause() external onlyStrategist {\n _pause();\n }\n\n /// @notice Returns bool indicating whether asset is supported by strategy.\n /// @param _asset The address of the asset token.\n function supportsAsset(address _asset) public view override returns (bool) {\n return _asset == WETH_TOKEN_ADDRESS;\n }\n\n /// @notice Approves the SSV Network contract to transfer SSV tokens for deposits\n function safeApproveAllTokens() external override {\n /// @dev Approves the SSV Network contract to transfer SSV tokens for deposits\n IERC20(SSV_TOKEN_ADDRESS).approve(\n SSV_NETWORK_ADDRESS,\n type(uint256).max\n );\n }\n\n /**\n * @notice Only accept ETH from the FeeAccumulator and the WETH contract - required when\n * unwrapping WETH just before staking it to the validator\n * @dev don't want to receive donations from anyone else as this will\n * mess with the accounting of the consensus rewards and validator full withdrawals\n */\n receive() external payable {\n require(\n msg.sender == FEE_ACCUMULATOR_ADDRESS ||\n msg.sender == WETH_TOKEN_ADDRESS,\n \"eth not from allowed contracts\"\n );\n }\n\n function _wethWithdrawnToVault(uint256 _amount) internal override {\n emit Withdrawal(WETH_TOKEN_ADDRESS, address(0), _amount);\n }\n\n function _wethWithdrawnAndStaked(uint256 _amount) internal override {\n /* In an ideal world we wouldn't need to reduce the deduction amount when the\n * depositedWethAccountedFor is smaller than the _amount.\n *\n * The reason this is required is that a malicious actor could sent WETH direclty\n * to this contract and that would circumvent the increase of depositedWethAccountedFor\n * property. When the ETH would be staked the depositedWethAccountedFor amount could\n * be deducted so much that it would be negative.\n */\n uint256 deductAmount = Math.min(_amount, depositedWethAccountedFor);\n depositedWethAccountedFor -= deductAmount;\n }\n}\n" + }, + "contracts/strategies/NativeStaking/ValidatorAccountant.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { ValidatorRegistrator } from \"./ValidatorRegistrator.sol\";\nimport { IWETH9 } from \"../../interfaces/IWETH9.sol\";\n\n/// @title Validator Accountant\n/// @notice Attributes the ETH swept from beacon chain validators to this strategy contract\n/// as either full or partial withdrawals. Partial withdrawals being consensus rewards.\n/// Full withdrawals are from exited validators.\n/// @author Origin Protocol Inc\nabstract contract ValidatorAccountant is ValidatorRegistrator {\n /// @notice The minimum amount of blocks that need to pass between two calls to manuallyFixAccounting\n uint256 public constant MIN_FIX_ACCOUNTING_CADENCE = 7200; // 1 day\n /// @notice The maximum amount of ETH that can be staked by a validator\n /// @dev this can change in the future with EIP-7251, Increase the MAX_EFFECTIVE_BALANCE\n uint256 public constant MAX_STAKE = 32 ether;\n\n /// @notice Keeps track of the total consensus rewards swept from the beacon chain\n uint256 public consensusRewards;\n\n /// @notice start of fuse interval\n uint256 public fuseIntervalStart;\n /// @notice end of fuse interval\n uint256 public fuseIntervalEnd;\n /// @notice last block number manuallyFixAccounting has been called\n uint256 public lastFixAccountingBlockNumber;\n\n uint256[49] private __gap;\n\n event FuseIntervalUpdated(uint256 start, uint256 end);\n event AccountingFullyWithdrawnValidator(\n uint256 noOfValidators,\n uint256 remainingValidators,\n uint256 wethSentToVault\n );\n event AccountingValidatorSlashed(\n uint256 remainingValidators,\n uint256 wethSentToVault\n );\n event AccountingConsensusRewards(uint256 amount);\n\n event AccountingManuallyFixed(\n int256 validatorsDelta,\n int256 consensusRewardsDelta,\n uint256 wethToVault\n );\n\n /// @param _wethAddress Address of the Erc20 WETH Token contract\n /// @param _vaultAddress Address of the Vault\n /// @param _beaconChainDepositContract Address of the beacon chain deposit contract\n /// @param _ssvNetwork Address of the SSV Network contract\n constructor(\n address _wethAddress,\n address _vaultAddress,\n address _beaconChainDepositContract,\n address _ssvNetwork\n )\n ValidatorRegistrator(\n _wethAddress,\n _vaultAddress,\n _beaconChainDepositContract,\n _ssvNetwork\n )\n {}\n\n /// @notice set fuse interval values\n function setFuseInterval(\n uint256 _fuseIntervalStart,\n uint256 _fuseIntervalEnd\n ) external onlyGovernor {\n require(\n _fuseIntervalStart < _fuseIntervalEnd &&\n _fuseIntervalStart < 32 ether &&\n _fuseIntervalEnd < 32 ether &&\n _fuseIntervalEnd - _fuseIntervalStart >= 4 ether,\n \"incorrect fuse interval\"\n );\n\n emit FuseIntervalUpdated(_fuseIntervalStart, _fuseIntervalEnd);\n\n fuseIntervalStart = _fuseIntervalStart;\n fuseIntervalEnd = _fuseIntervalEnd;\n }\n\n /* solhint-disable max-line-length */\n /// This notion page offers a good explanation of how the accounting functions\n /// https://www.notion.so/originprotocol/Limited-simplified-native-staking-accounting-67a217c8420d40678eb943b9da0ee77d\n /// In short, after dividing by 32, if the ETH remaining on the contract falls between 0 and fuseIntervalStart,\n /// the accounting function will treat that ETH as Beacon chain consensus rewards.\n /// On the contrary, if after dividing by 32, the ETH remaining on the contract falls between fuseIntervalEnd and 32,\n /// the accounting function will treat that as a validator slashing.\n /// @notice Perform the accounting attributing beacon chain ETH to either full or partial withdrawals. Returns true when\n /// accounting is valid and fuse isn't \"blown\". Returns false when fuse is blown.\n /// @dev This function could in theory be permission-less but lets allow only the Registrator (Defender Action) to call it\n /// for now.\n /// @return accountingValid true if accounting was successful, false if fuse is blown\n /* solhint-enable max-line-length */\n function doAccounting()\n external\n onlyRegistrator\n whenNotPaused\n returns (bool accountingValid)\n {\n // pause the accounting on failure\n accountingValid = _doAccounting(true);\n }\n\n // slither-disable-start reentrancy-eth\n function _doAccounting(bool pauseOnFail)\n internal\n returns (bool accountingValid)\n {\n if (address(this).balance < consensusRewards) {\n return _failAccounting(pauseOnFail);\n }\n\n // Calculate all the new ETH that has been swept to the contract since the last accounting\n uint256 newSweptETH = address(this).balance - consensusRewards;\n accountingValid = true;\n\n // send the ETH that is from fully withdrawn validators to the Vault\n if (newSweptETH >= MAX_STAKE) {\n uint256 fullyWithdrawnValidators;\n // safe since MAX_STAKE is hardcoded to 32ETH\n unchecked {\n // explicitly cast to uint256 as we want to round to a whole number of validators\n fullyWithdrawnValidators = uint256(newSweptETH / MAX_STAKE);\n }\n activeDepositedValidators -= fullyWithdrawnValidators;\n\n uint256 wethToVault = MAX_STAKE * fullyWithdrawnValidators;\n IWETH9(WETH_TOKEN_ADDRESS).deposit{ value: wethToVault }();\n // slither-disable-next-line unchecked-transfer\n IWETH9(WETH_TOKEN_ADDRESS).transfer(VAULT_ADDRESS, wethToVault);\n _wethWithdrawnToVault(wethToVault);\n\n emit AccountingFullyWithdrawnValidator(\n fullyWithdrawnValidators,\n activeDepositedValidators,\n wethToVault\n );\n }\n\n uint256 ethRemaining = address(this).balance - consensusRewards;\n // should be less than a whole validator stake\n require(ethRemaining < 32 ether, \"unexpected accounting\");\n\n // If no Beacon chain consensus rewards swept\n if (ethRemaining == 0) {\n // do nothing\n return accountingValid;\n }\n // Beacon chain consensus rewards swept (partial validator withdrawals)\n else if (ethRemaining < fuseIntervalStart) {\n // solhint-disable-next-line reentrancy\n consensusRewards += ethRemaining;\n emit AccountingConsensusRewards(ethRemaining);\n }\n // Beacon chain consensus rewards swept but also a slashed validator fully exited\n else if (ethRemaining > fuseIntervalEnd) {\n IWETH9(WETH_TOKEN_ADDRESS).deposit{ value: ethRemaining }();\n // slither-disable-next-line unchecked-transfer\n IWETH9(WETH_TOKEN_ADDRESS).transfer(VAULT_ADDRESS, ethRemaining);\n activeDepositedValidators -= 1;\n\n _wethWithdrawnToVault(ethRemaining);\n\n emit AccountingValidatorSlashed(\n activeDepositedValidators,\n ethRemaining\n );\n }\n // Oh no... Fuse is blown. The Strategist needs to adjust the accounting values.\n else {\n return _failAccounting(pauseOnFail);\n }\n }\n\n // slither-disable-end reentrancy-eth\n\n /// @dev pause any further accounting if required and return false\n function _failAccounting(bool pauseOnFail)\n internal\n returns (bool accountingValid)\n {\n // pause if not already\n if (pauseOnFail) {\n _pause();\n }\n // fail the accounting\n accountingValid = false;\n }\n\n /// @notice Allow the Strategist to fix the accounting of this strategy and unpause.\n /// @param _validatorsDelta adjust the active validators by up to plus three or minus three\n /// @param _consensusRewardsDelta adjust the accounted for consensus rewards up or down\n /// @param _ethToVaultAmount the amount of ETH that gets wrapped into WETH and sent to the Vault\n /// @dev There is a case when a validator(s) gets slashed so much that the eth swept from\n /// the beacon chain enters the fuse area and there are no consensus rewards on the contract\n /// to \"dip into\"/use. To increase the amount of unaccounted ETH over the fuse end interval\n /// we need to reduce the amount of active deposited validators and immediately send WETH\n /// to the vault, so it doesn't interfere with further accounting.\n function manuallyFixAccounting(\n int256 _validatorsDelta,\n int256 _consensusRewardsDelta,\n uint256 _ethToVaultAmount\n ) external onlyStrategist whenPaused {\n require(\n lastFixAccountingBlockNumber + MIN_FIX_ACCOUNTING_CADENCE <\n block.number,\n \"manuallyFixAccounting called too soon\"\n );\n require(\n _validatorsDelta >= -3 &&\n _validatorsDelta <= 3 &&\n // new value must be positive\n int256(activeDepositedValidators) + _validatorsDelta >= 0,\n \"invalid validatorsDelta\"\n );\n require(\n _consensusRewardsDelta >= -332 ether &&\n _consensusRewardsDelta <= 332 ether &&\n // new value must be positive\n int256(consensusRewards) + _consensusRewardsDelta >= 0,\n \"invalid consensusRewardsDelta\"\n );\n require(_ethToVaultAmount <= 32 ether * 3, \"invalid wethToVaultAmount\");\n\n emit AccountingManuallyFixed(\n _validatorsDelta,\n _consensusRewardsDelta,\n _ethToVaultAmount\n );\n\n activeDepositedValidators = uint256(\n int256(activeDepositedValidators) + _validatorsDelta\n );\n consensusRewards = uint256(\n int256(consensusRewards) + _consensusRewardsDelta\n );\n lastFixAccountingBlockNumber = block.number;\n if (_ethToVaultAmount > 0) {\n IWETH9(WETH_TOKEN_ADDRESS).deposit{ value: _ethToVaultAmount }();\n // slither-disable-next-line unchecked-transfer\n IWETH9(WETH_TOKEN_ADDRESS).transfer(\n VAULT_ADDRESS,\n _ethToVaultAmount\n );\n _wethWithdrawnToVault(_ethToVaultAmount);\n }\n\n // rerun the accounting to see if it has now been fixed.\n // Do not pause the accounting on failure as it is already paused\n require(_doAccounting(false), \"fuse still blown\");\n\n // unpause since doAccounting was successful\n _unpause();\n }\n\n /***************************************\n Abstract\n ****************************************/\n\n /// @dev allows for NativeStakingSSVStrategy contract to emit Withdrawal event\n function _wethWithdrawnToVault(uint256 _amount) internal virtual;\n}\n" + }, + "contracts/strategies/NativeStaking/ValidatorRegistrator.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { Pausable } from \"@openzeppelin/contracts/security/Pausable.sol\";\nimport { Governable } from \"../../governance/Governable.sol\";\nimport { IDepositContract } from \"../../interfaces/IDepositContract.sol\";\nimport { IVault } from \"../../interfaces/IVault.sol\";\nimport { IWETH9 } from \"../../interfaces/IWETH9.sol\";\nimport { ISSVNetwork, Cluster } from \"../../interfaces/ISSVNetwork.sol\";\n\nstruct ValidatorStakeData {\n bytes pubkey;\n bytes signature;\n bytes32 depositDataRoot;\n}\n\n/**\n * @title Registrator of the validators\n * @notice This contract implements all the required functionality to register, exit and remove validators.\n * @author Origin Protocol Inc\n */\nabstract contract ValidatorRegistrator is Governable, Pausable {\n /// @notice The address of the Wrapped ETH (WETH) token contract\n address public immutable WETH_TOKEN_ADDRESS;\n /// @notice The address of the beacon chain deposit contract\n address public immutable BEACON_CHAIN_DEPOSIT_CONTRACT;\n /// @notice The address of the SSV Network contract used to interface with\n address public immutable SSV_NETWORK_ADDRESS;\n /// @notice Address of the OETH Vault proxy contract\n address public immutable VAULT_ADDRESS;\n\n /// @notice Address of the registrator - allowed to register, exit and remove validators\n address public validatorRegistrator;\n /// @notice The number of validators that have 32 (!) ETH actively deposited. When a new deposit\n /// to a validator happens this number increases, when a validator exit is detected this number\n /// decreases.\n uint256 public activeDepositedValidators;\n /// @notice State of the validators keccak256(pubKey) => state\n mapping(bytes32 => VALIDATOR_STATE) public validatorsStates;\n /// @notice The account that is allowed to modify stakeETHThreshold and reset stakeETHTally\n address public stakingMonitor;\n /// @notice Amount of ETH that can be staked before staking on the contract is suspended\n /// and the governor needs to approve further staking\n uint256 public stakeETHThreshold;\n /// @notice Amount of ETH that can has been staked since the last governor approval.\n uint256 public stakeETHTally;\n // For future use\n uint256[47] private __gap;\n\n enum VALIDATOR_STATE {\n REGISTERED, // validator is registered on the SSV network\n STAKED, // validator has funds staked\n EXITING, // exit message has been posted and validator is in the process of exiting\n EXIT_COMPLETE // validator has funds withdrawn to the EigenPod and is removed from the SSV\n }\n\n event RegistratorChanged(address newAddress);\n event StakingMonitorChanged(address newAddress);\n event ETHStaked(bytes pubkey, uint256 amount, bytes withdrawal_credentials);\n event SSVValidatorRegistered(bytes pubkey, uint64[] operatorIds);\n event SSVValidatorExitInitiated(bytes pubkey, uint64[] operatorIds);\n event SSVValidatorExitCompleted(bytes pubkey, uint64[] operatorIds);\n event StakeETHThresholdChanged(uint256 amount);\n event StakeETHTallyReset();\n\n /// @dev Throws if called by any account other than the Registrator\n modifier onlyRegistrator() {\n require(\n msg.sender == validatorRegistrator,\n \"Caller is not the Registrator\"\n );\n _;\n }\n\n /// @dev Throws if called by any account other than the Staking monitor\n modifier onlyStakingMonitor() {\n require(msg.sender == stakingMonitor, \"Caller is not the Monitor\");\n _;\n }\n\n /// @dev Throws if called by any account other than the Strategist\n modifier onlyStrategist() {\n require(\n msg.sender == IVault(VAULT_ADDRESS).strategistAddr(),\n \"Caller is not the Strategist\"\n );\n _;\n }\n\n /// @param _wethAddress Address of the Erc20 WETH Token contract\n /// @param _vaultAddress Address of the Vault\n /// @param _beaconChainDepositContract Address of the beacon chain deposit contract\n /// @param _ssvNetwork Address of the SSV Network contract\n constructor(\n address _wethAddress,\n address _vaultAddress,\n address _beaconChainDepositContract,\n address _ssvNetwork\n ) {\n WETH_TOKEN_ADDRESS = _wethAddress;\n BEACON_CHAIN_DEPOSIT_CONTRACT = _beaconChainDepositContract;\n SSV_NETWORK_ADDRESS = _ssvNetwork;\n VAULT_ADDRESS = _vaultAddress;\n }\n\n /// @notice Set the address of the registrator which can register, exit and remove validators\n function setRegistrator(address _address) external onlyGovernor {\n emit RegistratorChanged(_address);\n validatorRegistrator = _address;\n }\n\n /// @notice Set the address of the staking monitor that is allowed to reset stakeETHTally\n function setStakingMonitor(address _address) external onlyGovernor {\n emit StakingMonitorChanged(_address);\n stakingMonitor = _address;\n }\n\n /// @notice Set the amount of ETH that can be staked before staking monitor\n // needs to a approve further staking by resetting the stake ETH tally\n function setStakeETHThreshold(uint256 _amount) external onlyGovernor {\n emit StakeETHThresholdChanged(_amount);\n stakeETHThreshold = _amount;\n }\n\n /// @notice Reset the stakeETHTally\n function resetStakeETHTally() external onlyStakingMonitor {\n emit StakeETHTallyReset();\n stakeETHTally = 0;\n }\n\n /// @notice Stakes WETH to the node validators\n /// @param validators A list of validator data needed to stake.\n /// The `ValidatorStakeData` struct contains the pubkey, signature and depositDataRoot.\n /// Only the registrator can call this function.\n // slither-disable-start reentrancy-eth\n function stakeEth(ValidatorStakeData[] calldata validators)\n external\n onlyRegistrator\n whenNotPaused\n {\n uint256 requiredETH = validators.length * 32 ether;\n\n // Check there is enough WETH from the deposits sitting in this strategy contract\n require(\n requiredETH <= IWETH9(WETH_TOKEN_ADDRESS).balanceOf(address(this)),\n \"insufficient WETH\"\n );\n\n require(\n stakeETHTally + requiredETH <= stakeETHThreshold,\n \"Staking ETH over threshold\"\n );\n stakeETHTally += requiredETH;\n\n // Convert required ETH from WETH\n IWETH9(WETH_TOKEN_ADDRESS).withdraw(requiredETH);\n _wethWithdrawnAndStaked(requiredETH);\n\n /* 0x01 to indicate that withdrawal credentials will contain an EOA address that the sweeping function\n * can sweep funds to.\n * bytes11(0) to fill up the required zeros\n * remaining bytes20 are for the address\n */\n bytes memory withdrawal_credentials = abi.encodePacked(\n bytes1(0x01),\n bytes11(0),\n address(this)\n );\n\n uint256 validatorsLength = validators.length;\n // For each validator\n for (uint256 i = 0; i < validatorsLength; ) {\n bytes32 pubkeyHash = keccak256(validators[i].pubkey);\n VALIDATOR_STATE currentState = validatorsStates[pubkeyHash];\n\n require(\n currentState == VALIDATOR_STATE.REGISTERED,\n \"Validator not registered\"\n );\n\n IDepositContract(BEACON_CHAIN_DEPOSIT_CONTRACT).deposit{\n value: 32 ether\n }(\n validators[i].pubkey,\n withdrawal_credentials,\n validators[i].signature,\n validators[i].depositDataRoot\n );\n\n emit ETHStaked(\n validators[i].pubkey,\n 32 ether,\n withdrawal_credentials\n );\n\n validatorsStates[pubkeyHash] = VALIDATOR_STATE.STAKED;\n\n unchecked {\n ++i;\n }\n }\n // save gas by changing this storage variable only once rather each time in the loop.\n activeDepositedValidators += validatorsLength;\n }\n\n // slither-disable-end reentrancy-eth\n\n /// @notice Registers a new validator in the SSV Cluster.\n /// Only the registrator can call this function.\n function registerSsvValidator(\n bytes calldata publicKey,\n uint64[] calldata operatorIds,\n bytes calldata sharesData,\n uint256 amount,\n Cluster calldata cluster\n ) external onlyRegistrator whenNotPaused {\n ISSVNetwork(SSV_NETWORK_ADDRESS).registerValidator(\n publicKey,\n operatorIds,\n sharesData,\n amount,\n cluster\n );\n validatorsStates[keccak256(publicKey)] = VALIDATOR_STATE.REGISTERED;\n emit SSVValidatorRegistered(publicKey, operatorIds);\n }\n\n /// @notice Exit a validator from the Beacon chain.\n /// The staked ETH will eventually swept to this native staking strategy.\n /// Only the registrator can call this function.\n // slither-disable-start reentrancy-no-eth\n function exitSsvValidator(\n bytes calldata publicKey,\n uint64[] calldata operatorIds\n ) external onlyRegistrator whenNotPaused {\n VALIDATOR_STATE currentState = validatorsStates[keccak256(publicKey)];\n require(currentState == VALIDATOR_STATE.STAKED, \"Validator not staked\");\n\n ISSVNetwork(SSV_NETWORK_ADDRESS).exitValidator(publicKey, operatorIds);\n emit SSVValidatorExitInitiated(publicKey, operatorIds);\n\n validatorsStates[keccak256(publicKey)] = VALIDATOR_STATE.EXITING;\n }\n\n // slither-disable-end reentrancy-no-eth\n\n /// @notice Remove a validator from the SSV Cluster.\n /// Make sure `exitSsvValidator` is called before and the validate has exited the Beacon chain.\n /// If removed before the validator has exited the beacon chain will result in the validator being slashed.\n /// Only the registrator can call this function.\n // slither-disable-start reentrancy-no-eth\n function removeSsvValidator(\n bytes calldata publicKey,\n uint64[] calldata operatorIds,\n Cluster calldata cluster\n ) external onlyRegistrator whenNotPaused {\n VALIDATOR_STATE currentState = validatorsStates[keccak256(publicKey)];\n require(\n currentState == VALIDATOR_STATE.EXITING,\n \"Validator not exiting\"\n );\n\n ISSVNetwork(SSV_NETWORK_ADDRESS).removeValidator(\n publicKey,\n operatorIds,\n cluster\n );\n emit SSVValidatorExitCompleted(publicKey, operatorIds);\n\n validatorsStates[keccak256(publicKey)] = VALIDATOR_STATE.EXIT_COMPLETE;\n }\n\n // slither-disable-end reentrancy-no-eth\n\n /// @notice Deposits more SSV Tokens to the SSV Network contract which is used to pay the SSV Operators.\n /// @dev A SSV cluster is defined by the SSVOwnerAddress and the set of operatorIds.\n /// uses \"onlyStrategist\" modifier so continuous front-running can't DOS our maintenance service\n /// that tries to top up SSV tokens.\n /// @param cluster The SSV cluster details that must be derived from emitted events from the SSVNetwork contract.\n function depositSSV(\n uint64[] memory operatorIds,\n uint256 amount,\n Cluster memory cluster\n ) external onlyStrategist {\n ISSVNetwork(SSV_NETWORK_ADDRESS).deposit(\n address(this),\n operatorIds,\n amount,\n cluster\n );\n }\n\n /***************************************\n Abstract\n ****************************************/\n\n /// @dev allows for NativeStakingSSVStrategy contract know how much WETH had been staked\n function _wethWithdrawnAndStaked(uint256 _amount) internal virtual;\n}\n" + }, + "contracts/token/OUSD.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @title OUSD Token Contract\n * @dev ERC20 compatible contract for OUSD\n * @dev Implements an elastic supply\n * @author Origin Protocol Inc\n */\nimport { SafeMath } from \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\nimport { Initializable } from \"../utils/Initializable.sol\";\nimport { InitializableERC20Detailed } from \"../utils/InitializableERC20Detailed.sol\";\nimport { StableMath } from \"../utils/StableMath.sol\";\nimport { Governable } from \"../governance/Governable.sol\";\n\n/**\n * NOTE that this is an ERC20 token but the invariant that the sum of\n * balanceOf(x) for all x is not >= totalSupply(). This is a consequence of the\n * rebasing design. Any integrations with OUSD should be aware.\n */\n\ncontract OUSD is Initializable, InitializableERC20Detailed, Governable {\n using SafeMath for uint256;\n using StableMath for uint256;\n\n event TotalSupplyUpdatedHighres(\n uint256 totalSupply,\n uint256 rebasingCredits,\n uint256 rebasingCreditsPerToken\n );\n event AccountRebasingEnabled(address account);\n event AccountRebasingDisabled(address account);\n\n enum RebaseOptions {\n NotSet,\n OptOut,\n OptIn\n }\n\n uint256 private constant MAX_SUPPLY = ~uint128(0); // (2^128) - 1\n uint256 public _totalSupply;\n mapping(address => mapping(address => uint256)) private _allowances;\n address public vaultAddress = address(0);\n mapping(address => uint256) private _creditBalances;\n uint256 private _rebasingCredits;\n uint256 private _rebasingCreditsPerToken;\n // Frozen address/credits are non rebasing (value is held in contracts which\n // do not receive yield unless they explicitly opt in)\n uint256 public nonRebasingSupply;\n mapping(address => uint256) public nonRebasingCreditsPerToken;\n mapping(address => RebaseOptions) public rebaseState;\n mapping(address => uint256) public isUpgraded;\n\n uint256 private constant RESOLUTION_INCREASE = 1e9;\n\n function initialize(\n string calldata _nameArg,\n string calldata _symbolArg,\n address _vaultAddress,\n uint256 _initialCreditsPerToken\n ) external onlyGovernor initializer {\n InitializableERC20Detailed._initialize(_nameArg, _symbolArg, 18);\n _rebasingCreditsPerToken = _initialCreditsPerToken;\n vaultAddress = _vaultAddress;\n }\n\n /**\n * @dev Verifies that the caller is the Vault contract\n */\n modifier onlyVault() {\n require(vaultAddress == msg.sender, \"Caller is not the Vault\");\n _;\n }\n\n /**\n * @return The total supply of OUSD.\n */\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @return Low resolution rebasingCreditsPerToken\n */\n function rebasingCreditsPerToken() public view returns (uint256) {\n return _rebasingCreditsPerToken / RESOLUTION_INCREASE;\n }\n\n /**\n * @return Low resolution total number of rebasing credits\n */\n function rebasingCredits() public view returns (uint256) {\n return _rebasingCredits / RESOLUTION_INCREASE;\n }\n\n /**\n * @return High resolution rebasingCreditsPerToken\n */\n function rebasingCreditsPerTokenHighres() public view returns (uint256) {\n return _rebasingCreditsPerToken;\n }\n\n /**\n * @return High resolution total number of rebasing credits\n */\n function rebasingCreditsHighres() public view returns (uint256) {\n return _rebasingCredits;\n }\n\n /**\n * @dev Gets the balance of the specified address.\n * @param _account Address to query the balance of.\n * @return A uint256 representing the amount of base units owned by the\n * specified address.\n */\n function balanceOf(address _account)\n public\n view\n override\n returns (uint256)\n {\n if (_creditBalances[_account] == 0) return 0;\n return\n _creditBalances[_account].divPrecisely(_creditsPerToken(_account));\n }\n\n /**\n * @dev Gets the credits balance of the specified address.\n * @dev Backwards compatible with old low res credits per token.\n * @param _account The address to query the balance of.\n * @return (uint256, uint256) Credit balance and credits per token of the\n * address\n */\n function creditsBalanceOf(address _account)\n public\n view\n returns (uint256, uint256)\n {\n uint256 cpt = _creditsPerToken(_account);\n if (cpt == 1e27) {\n // For a period before the resolution upgrade, we created all new\n // contract accounts at high resolution. Since they are not changing\n // as a result of this upgrade, we will return their true values\n return (_creditBalances[_account], cpt);\n } else {\n return (\n _creditBalances[_account] / RESOLUTION_INCREASE,\n cpt / RESOLUTION_INCREASE\n );\n }\n }\n\n /**\n * @dev Gets the credits balance of the specified address.\n * @param _account The address to query the balance of.\n * @return (uint256, uint256, bool) Credit balance, credits per token of the\n * address, and isUpgraded\n */\n function creditsBalanceOfHighres(address _account)\n public\n view\n returns (\n uint256,\n uint256,\n bool\n )\n {\n return (\n _creditBalances[_account],\n _creditsPerToken(_account),\n isUpgraded[_account] == 1\n );\n }\n\n /**\n * @dev Transfer tokens to a specified address.\n * @param _to the address to transfer to.\n * @param _value the amount to be transferred.\n * @return true on success.\n */\n function transfer(address _to, uint256 _value)\n public\n override\n returns (bool)\n {\n require(_to != address(0), \"Transfer to zero address\");\n require(\n _value <= balanceOf(msg.sender),\n \"Transfer greater than balance\"\n );\n\n _executeTransfer(msg.sender, _to, _value);\n\n emit Transfer(msg.sender, _to, _value);\n\n return true;\n }\n\n /**\n * @dev Transfer tokens from one address to another.\n * @param _from The address you want to send tokens from.\n * @param _to The address you want to transfer to.\n * @param _value The amount of tokens to be transferred.\n */\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) public override returns (bool) {\n require(_to != address(0), \"Transfer to zero address\");\n require(_value <= balanceOf(_from), \"Transfer greater than balance\");\n\n _allowances[_from][msg.sender] = _allowances[_from][msg.sender].sub(\n _value\n );\n\n _executeTransfer(_from, _to, _value);\n\n emit Transfer(_from, _to, _value);\n\n return true;\n }\n\n /**\n * @dev Update the count of non rebasing credits in response to a transfer\n * @param _from The address you want to send tokens from.\n * @param _to The address you want to transfer to.\n * @param _value Amount of OUSD to transfer\n */\n function _executeTransfer(\n address _from,\n address _to,\n uint256 _value\n ) internal {\n bool isNonRebasingTo = _isNonRebasingAccount(_to);\n bool isNonRebasingFrom = _isNonRebasingAccount(_from);\n\n // Credits deducted and credited might be different due to the\n // differing creditsPerToken used by each account\n uint256 creditsCredited = _value.mulTruncate(_creditsPerToken(_to));\n uint256 creditsDeducted = _value.mulTruncate(_creditsPerToken(_from));\n\n _creditBalances[_from] = _creditBalances[_from].sub(\n creditsDeducted,\n \"Transfer amount exceeds balance\"\n );\n _creditBalances[_to] = _creditBalances[_to].add(creditsCredited);\n\n if (isNonRebasingTo && !isNonRebasingFrom) {\n // Transfer to non-rebasing account from rebasing account, credits\n // are removed from the non rebasing tally\n nonRebasingSupply = nonRebasingSupply.add(_value);\n // Update rebasingCredits by subtracting the deducted amount\n _rebasingCredits = _rebasingCredits.sub(creditsDeducted);\n } else if (!isNonRebasingTo && isNonRebasingFrom) {\n // Transfer to rebasing account from non-rebasing account\n // Decreasing non-rebasing credits by the amount that was sent\n nonRebasingSupply = nonRebasingSupply.sub(_value);\n // Update rebasingCredits by adding the credited amount\n _rebasingCredits = _rebasingCredits.add(creditsCredited);\n }\n }\n\n /**\n * @dev Function to check the amount of tokens that _owner has allowed to\n * `_spender`.\n * @param _owner The address which owns the funds.\n * @param _spender The address which will spend the funds.\n * @return The number of tokens still available for the _spender.\n */\n function allowance(address _owner, address _spender)\n public\n view\n override\n returns (uint256)\n {\n return _allowances[_owner][_spender];\n }\n\n /**\n * @dev Approve the passed address to spend the specified amount of tokens\n * on behalf of msg.sender. This method is included for ERC20\n * compatibility. `increaseAllowance` and `decreaseAllowance` should be\n * used instead.\n *\n * Changing an allowance with this method brings the risk that someone\n * may transfer both the old and the new allowance - if they are both\n * greater than zero - if a transfer transaction is mined before the\n * later approve() call is mined.\n * @param _spender The address which will spend the funds.\n * @param _value The amount of tokens to be spent.\n */\n function approve(address _spender, uint256 _value)\n public\n override\n returns (bool)\n {\n _allowances[msg.sender][_spender] = _value;\n emit Approval(msg.sender, _spender, _value);\n return true;\n }\n\n /**\n * @dev Increase the amount of tokens that an owner has allowed to\n * `_spender`.\n * This method should be used instead of approve() to avoid the double\n * approval vulnerability described above.\n * @param _spender The address which will spend the funds.\n * @param _addedValue The amount of tokens to increase the allowance by.\n */\n function increaseAllowance(address _spender, uint256 _addedValue)\n public\n returns (bool)\n {\n _allowances[msg.sender][_spender] = _allowances[msg.sender][_spender]\n .add(_addedValue);\n emit Approval(msg.sender, _spender, _allowances[msg.sender][_spender]);\n return true;\n }\n\n /**\n * @dev Decrease the amount of tokens that an owner has allowed to\n `_spender`.\n * @param _spender The address which will spend the funds.\n * @param _subtractedValue The amount of tokens to decrease the allowance\n * by.\n */\n function decreaseAllowance(address _spender, uint256 _subtractedValue)\n public\n returns (bool)\n {\n uint256 oldValue = _allowances[msg.sender][_spender];\n if (_subtractedValue >= oldValue) {\n _allowances[msg.sender][_spender] = 0;\n } else {\n _allowances[msg.sender][_spender] = oldValue.sub(_subtractedValue);\n }\n emit Approval(msg.sender, _spender, _allowances[msg.sender][_spender]);\n return true;\n }\n\n /**\n * @dev Mints new tokens, increasing totalSupply.\n */\n function mint(address _account, uint256 _amount) external onlyVault {\n _mint(_account, _amount);\n }\n\n /**\n * @dev Creates `_amount` tokens and assigns them to `_account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements\n *\n * - `to` cannot be the zero address.\n */\n function _mint(address _account, uint256 _amount) internal nonReentrant {\n require(_account != address(0), \"Mint to the zero address\");\n\n bool isNonRebasingAccount = _isNonRebasingAccount(_account);\n\n uint256 creditAmount = _amount.mulTruncate(_creditsPerToken(_account));\n _creditBalances[_account] = _creditBalances[_account].add(creditAmount);\n\n // If the account is non rebasing and doesn't have a set creditsPerToken\n // then set it i.e. this is a mint from a fresh contract\n if (isNonRebasingAccount) {\n nonRebasingSupply = nonRebasingSupply.add(_amount);\n } else {\n _rebasingCredits = _rebasingCredits.add(creditAmount);\n }\n\n _totalSupply = _totalSupply.add(_amount);\n\n require(_totalSupply < MAX_SUPPLY, \"Max supply\");\n\n emit Transfer(address(0), _account, _amount);\n }\n\n /**\n * @dev Burns tokens, decreasing totalSupply.\n */\n function burn(address account, uint256 amount) external onlyVault {\n _burn(account, amount);\n }\n\n /**\n * @dev Destroys `_amount` tokens from `_account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements\n *\n * - `_account` cannot be the zero address.\n * - `_account` must have at least `_amount` tokens.\n */\n function _burn(address _account, uint256 _amount) internal nonReentrant {\n require(_account != address(0), \"Burn from the zero address\");\n if (_amount == 0) {\n return;\n }\n\n bool isNonRebasingAccount = _isNonRebasingAccount(_account);\n uint256 creditAmount = _amount.mulTruncate(_creditsPerToken(_account));\n uint256 currentCredits = _creditBalances[_account];\n\n // Remove the credits, burning rounding errors\n if (\n currentCredits == creditAmount || currentCredits - 1 == creditAmount\n ) {\n // Handle dust from rounding\n _creditBalances[_account] = 0;\n } else if (currentCredits > creditAmount) {\n _creditBalances[_account] = _creditBalances[_account].sub(\n creditAmount\n );\n } else {\n revert(\"Remove exceeds balance\");\n }\n\n // Remove from the credit tallies and non-rebasing supply\n if (isNonRebasingAccount) {\n nonRebasingSupply = nonRebasingSupply.sub(_amount);\n } else {\n _rebasingCredits = _rebasingCredits.sub(creditAmount);\n }\n\n _totalSupply = _totalSupply.sub(_amount);\n\n emit Transfer(_account, address(0), _amount);\n }\n\n /**\n * @dev Get the credits per token for an account. Returns a fixed amount\n * if the account is non-rebasing.\n * @param _account Address of the account.\n */\n function _creditsPerToken(address _account)\n internal\n view\n returns (uint256)\n {\n if (nonRebasingCreditsPerToken[_account] != 0) {\n return nonRebasingCreditsPerToken[_account];\n } else {\n return _rebasingCreditsPerToken;\n }\n }\n\n /**\n * @dev Is an account using rebasing accounting or non-rebasing accounting?\n * Also, ensure contracts are non-rebasing if they have not opted in.\n * @param _account Address of the account.\n */\n function _isNonRebasingAccount(address _account) internal returns (bool) {\n bool isContract = Address.isContract(_account);\n if (isContract && rebaseState[_account] == RebaseOptions.NotSet) {\n _ensureRebasingMigration(_account);\n }\n return nonRebasingCreditsPerToken[_account] > 0;\n }\n\n /**\n * @dev Ensures internal account for rebasing and non-rebasing credits and\n * supply is updated following deployment of frozen yield change.\n */\n function _ensureRebasingMigration(address _account) internal {\n if (nonRebasingCreditsPerToken[_account] == 0) {\n emit AccountRebasingDisabled(_account);\n if (_creditBalances[_account] == 0) {\n // Since there is no existing balance, we can directly set to\n // high resolution, and do not have to do any other bookkeeping\n nonRebasingCreditsPerToken[_account] = 1e27;\n } else {\n // Migrate an existing account:\n\n // Set fixed credits per token for this account\n nonRebasingCreditsPerToken[_account] = _rebasingCreditsPerToken;\n // Update non rebasing supply\n nonRebasingSupply = nonRebasingSupply.add(balanceOf(_account));\n // Update credit tallies\n _rebasingCredits = _rebasingCredits.sub(\n _creditBalances[_account]\n );\n }\n }\n }\n\n /**\n * @notice Enable rebasing for an account.\n * @dev Add a contract address to the non-rebasing exception list. The\n * address's balance will be part of rebases and the account will be exposed\n * to upside and downside.\n * @param _account Address of the account.\n */\n function governanceRebaseOptIn(address _account)\n public\n nonReentrant\n onlyGovernor\n {\n _rebaseOptIn(_account);\n }\n\n /**\n * @dev Add a contract address to the non-rebasing exception list. The\n * address's balance will be part of rebases and the account will be exposed\n * to upside and downside.\n */\n function rebaseOptIn() public nonReentrant {\n _rebaseOptIn(msg.sender);\n }\n\n function _rebaseOptIn(address _account) internal {\n require(_isNonRebasingAccount(_account), \"Account has not opted out\");\n\n // Convert balance into the same amount at the current exchange rate\n uint256 newCreditBalance = _creditBalances[_account]\n .mul(_rebasingCreditsPerToken)\n .div(_creditsPerToken(_account));\n\n // Decreasing non rebasing supply\n nonRebasingSupply = nonRebasingSupply.sub(balanceOf(_account));\n\n _creditBalances[_account] = newCreditBalance;\n\n // Increase rebasing credits, totalSupply remains unchanged so no\n // adjustment necessary\n _rebasingCredits = _rebasingCredits.add(_creditBalances[_account]);\n\n rebaseState[_account] = RebaseOptions.OptIn;\n\n // Delete any fixed credits per token\n delete nonRebasingCreditsPerToken[_account];\n emit AccountRebasingEnabled(_account);\n }\n\n /**\n * @dev Explicitly mark that an address is non-rebasing.\n */\n function rebaseOptOut() public nonReentrant {\n require(!_isNonRebasingAccount(msg.sender), \"Account has not opted in\");\n\n // Increase non rebasing supply\n nonRebasingSupply = nonRebasingSupply.add(balanceOf(msg.sender));\n // Set fixed credits per token\n nonRebasingCreditsPerToken[msg.sender] = _rebasingCreditsPerToken;\n\n // Decrease rebasing credits, total supply remains unchanged so no\n // adjustment necessary\n _rebasingCredits = _rebasingCredits.sub(_creditBalances[msg.sender]);\n\n // Mark explicitly opted out of rebasing\n rebaseState[msg.sender] = RebaseOptions.OptOut;\n emit AccountRebasingDisabled(msg.sender);\n }\n\n /**\n * @dev Modify the supply without minting new tokens. This uses a change in\n * the exchange rate between \"credits\" and OUSD tokens to change balances.\n * @param _newTotalSupply New total supply of OUSD.\n */\n function changeSupply(uint256 _newTotalSupply)\n external\n onlyVault\n nonReentrant\n {\n require(_totalSupply > 0, \"Cannot increase 0 supply\");\n\n if (_totalSupply == _newTotalSupply) {\n emit TotalSupplyUpdatedHighres(\n _totalSupply,\n _rebasingCredits,\n _rebasingCreditsPerToken\n );\n return;\n }\n\n _totalSupply = _newTotalSupply > MAX_SUPPLY\n ? MAX_SUPPLY\n : _newTotalSupply;\n\n _rebasingCreditsPerToken = _rebasingCredits.divPrecisely(\n _totalSupply.sub(nonRebasingSupply)\n );\n\n require(_rebasingCreditsPerToken > 0, \"Invalid change in supply\");\n\n _totalSupply = _rebasingCredits\n .divPrecisely(_rebasingCreditsPerToken)\n .add(nonRebasingSupply);\n\n emit TotalSupplyUpdatedHighres(\n _totalSupply,\n _rebasingCredits,\n _rebasingCreditsPerToken\n );\n }\n}\n" + }, + "contracts/utils/Helpers.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { IBasicToken } from \"../interfaces/IBasicToken.sol\";\n\nlibrary Helpers {\n /**\n * @notice Fetch the `symbol()` from an ERC20 token\n * @dev Grabs the `symbol()` from a contract\n * @param _token Address of the ERC20 token\n * @return string Symbol of the ERC20 token\n */\n function getSymbol(address _token) internal view returns (string memory) {\n string memory symbol = IBasicToken(_token).symbol();\n return symbol;\n }\n\n /**\n * @notice Fetch the `decimals()` from an ERC20 token\n * @dev Grabs the `decimals()` from a contract and fails if\n * the decimal value does not live within a certain range\n * @param _token Address of the ERC20 token\n * @return uint256 Decimals of the ERC20 token\n */\n function getDecimals(address _token) internal view returns (uint256) {\n uint256 decimals = IBasicToken(_token).decimals();\n require(\n decimals >= 4 && decimals <= 18,\n \"Token must have sufficient decimal places\"\n );\n\n return decimals;\n }\n}\n" + }, + "contracts/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @title Base contract any contracts that need to initialize state after deployment.\n * @author Origin Protocol Inc\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n require(\n initializing || !initialized,\n \"Initializable: contract is already initialized\"\n );\n\n bool isTopLevelCall = !initializing;\n if (isTopLevelCall) {\n initializing = true;\n initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n initializing = false;\n }\n }\n\n uint256[50] private ______gap;\n}\n" + }, + "contracts/utils/InitializableAbstractStrategy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @title Base contract for vault strategies.\n * @author Origin Protocol Inc\n */\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\nimport { Initializable } from \"../utils/Initializable.sol\";\nimport { Governable } from \"../governance/Governable.sol\";\nimport { IVault } from \"../interfaces/IVault.sol\";\n\nabstract contract InitializableAbstractStrategy is Initializable, Governable {\n using SafeERC20 for IERC20;\n\n event PTokenAdded(address indexed _asset, address _pToken);\n event PTokenRemoved(address indexed _asset, address _pToken);\n event Deposit(address indexed _asset, address _pToken, uint256 _amount);\n event Withdrawal(address indexed _asset, address _pToken, uint256 _amount);\n event RewardTokenCollected(\n address recipient,\n address rewardToken,\n uint256 amount\n );\n event RewardTokenAddressesUpdated(\n address[] _oldAddresses,\n address[] _newAddresses\n );\n event HarvesterAddressesUpdated(\n address _oldHarvesterAddress,\n address _newHarvesterAddress\n );\n\n /// @notice Address of the underlying platform\n address public immutable platformAddress;\n /// @notice Address of the OToken vault\n address public immutable vaultAddress;\n\n /// @dev Replaced with an immutable variable\n // slither-disable-next-line constable-states\n address private _deprecated_platformAddress;\n\n /// @dev Replaced with an immutable\n // slither-disable-next-line constable-states\n address private _deprecated_vaultAddress;\n\n /// @notice asset => pToken (Platform Specific Token Address)\n mapping(address => address) public assetToPToken;\n\n /// @notice Full list of all assets supported by the strategy\n address[] internal assetsMapped;\n\n // Deprecated: Reward token address\n // slither-disable-next-line constable-states\n address private _deprecated_rewardTokenAddress;\n\n // Deprecated: now resides in Harvester's rewardTokenConfigs\n // slither-disable-next-line constable-states\n uint256 private _deprecated_rewardLiquidationThreshold;\n\n /// @notice Address of the Harvester contract allowed to collect reward tokens\n address public harvesterAddress;\n\n /// @notice Address of the reward tokens. eg CRV, BAL, CVX, AURA\n address[] public rewardTokenAddresses;\n\n /* Reserved for future expansion. Used to be 100 storage slots\n * and has decreased to accommodate:\n * - harvesterAddress\n * - rewardTokenAddresses\n */\n int256[98] private _reserved;\n\n struct BaseStrategyConfig {\n address platformAddress; // Address of the underlying platform\n address vaultAddress; // Address of the OToken's Vault\n }\n\n /**\n * @param _config The platform and OToken vault addresses\n */\n constructor(BaseStrategyConfig memory _config) {\n platformAddress = _config.platformAddress;\n vaultAddress = _config.vaultAddress;\n }\n\n /**\n * @dev Internal initialize function, to set up initial internal state\n * @param _rewardTokenAddresses Address of reward token for platform\n * @param _assets Addresses of initial supported assets\n * @param _pTokens Platform Token corresponding addresses\n */\n function _initialize(\n address[] memory _rewardTokenAddresses,\n address[] memory _assets,\n address[] memory _pTokens\n ) internal {\n rewardTokenAddresses = _rewardTokenAddresses;\n\n uint256 assetCount = _assets.length;\n require(assetCount == _pTokens.length, \"Invalid input arrays\");\n for (uint256 i = 0; i < assetCount; ++i) {\n _setPTokenAddress(_assets[i], _pTokens[i]);\n }\n }\n\n /**\n * @notice Collect accumulated reward token and send to Vault.\n */\n function collectRewardTokens() external virtual onlyHarvester nonReentrant {\n _collectRewardTokens();\n }\n\n /**\n * @dev Default implementation that transfers reward tokens to the Harvester\n * Implementing strategies need to add custom logic to collect the rewards.\n */\n function _collectRewardTokens() internal virtual {\n uint256 rewardTokenCount = rewardTokenAddresses.length;\n for (uint256 i = 0; i < rewardTokenCount; ++i) {\n IERC20 rewardToken = IERC20(rewardTokenAddresses[i]);\n uint256 balance = rewardToken.balanceOf(address(this));\n if (balance > 0) {\n emit RewardTokenCollected(\n harvesterAddress,\n address(rewardToken),\n balance\n );\n rewardToken.safeTransfer(harvesterAddress, balance);\n }\n }\n }\n\n /**\n * @dev Verifies that the caller is the Vault.\n */\n modifier onlyVault() {\n require(msg.sender == vaultAddress, \"Caller is not the Vault\");\n _;\n }\n\n /**\n * @dev Verifies that the caller is the Harvester.\n */\n modifier onlyHarvester() {\n require(msg.sender == harvesterAddress, \"Caller is not the Harvester\");\n _;\n }\n\n /**\n * @dev Verifies that the caller is the Vault or Governor.\n */\n modifier onlyVaultOrGovernor() {\n require(\n msg.sender == vaultAddress || msg.sender == governor(),\n \"Caller is not the Vault or Governor\"\n );\n _;\n }\n\n /**\n * @dev Verifies that the caller is the Vault, Governor, or Strategist.\n */\n modifier onlyVaultOrGovernorOrStrategist() {\n require(\n msg.sender == vaultAddress ||\n msg.sender == governor() ||\n msg.sender == IVault(vaultAddress).strategistAddr(),\n \"Caller is not the Vault, Governor, or Strategist\"\n );\n _;\n }\n\n /**\n * @notice Set the reward token addresses. Any old addresses will be overwritten.\n * @param _rewardTokenAddresses Array of reward token addresses\n */\n function setRewardTokenAddresses(address[] calldata _rewardTokenAddresses)\n external\n onlyGovernor\n {\n uint256 rewardTokenCount = _rewardTokenAddresses.length;\n for (uint256 i = 0; i < rewardTokenCount; ++i) {\n require(\n _rewardTokenAddresses[i] != address(0),\n \"Can not set an empty address as a reward token\"\n );\n }\n\n emit RewardTokenAddressesUpdated(\n rewardTokenAddresses,\n _rewardTokenAddresses\n );\n rewardTokenAddresses = _rewardTokenAddresses;\n }\n\n /**\n * @notice Get the reward token addresses.\n * @return address[] the reward token addresses.\n */\n function getRewardTokenAddresses()\n external\n view\n returns (address[] memory)\n {\n return rewardTokenAddresses;\n }\n\n /**\n * @notice Provide support for asset by passing its pToken address.\n * This method can only be called by the system Governor\n * @param _asset Address for the asset\n * @param _pToken Address for the corresponding platform token\n */\n function setPTokenAddress(address _asset, address _pToken)\n external\n virtual\n onlyGovernor\n {\n _setPTokenAddress(_asset, _pToken);\n }\n\n /**\n * @notice Remove a supported asset by passing its index.\n * This method can only be called by the system Governor\n * @param _assetIndex Index of the asset to be removed\n */\n function removePToken(uint256 _assetIndex) external virtual onlyGovernor {\n require(_assetIndex < assetsMapped.length, \"Invalid index\");\n address asset = assetsMapped[_assetIndex];\n address pToken = assetToPToken[asset];\n\n if (_assetIndex < assetsMapped.length - 1) {\n assetsMapped[_assetIndex] = assetsMapped[assetsMapped.length - 1];\n }\n assetsMapped.pop();\n assetToPToken[asset] = address(0);\n\n emit PTokenRemoved(asset, pToken);\n }\n\n /**\n * @notice Provide support for asset by passing its pToken address.\n * Add to internal mappings and execute the platform specific,\n * abstract method `_abstractSetPToken`\n * @param _asset Address for the asset\n * @param _pToken Address for the corresponding platform token\n */\n function _setPTokenAddress(address _asset, address _pToken) internal {\n require(assetToPToken[_asset] == address(0), \"pToken already set\");\n require(\n _asset != address(0) && _pToken != address(0),\n \"Invalid addresses\"\n );\n\n assetToPToken[_asset] = _pToken;\n assetsMapped.push(_asset);\n\n emit PTokenAdded(_asset, _pToken);\n\n _abstractSetPToken(_asset, _pToken);\n }\n\n /**\n * @notice Transfer token to governor. Intended for recovering tokens stuck in\n * strategy contracts, i.e. mistaken sends.\n * @param _asset Address for the asset\n * @param _amount Amount of the asset to transfer\n */\n function transferToken(address _asset, uint256 _amount)\n public\n onlyGovernor\n {\n require(!supportsAsset(_asset), \"Cannot transfer supported asset\");\n IERC20(_asset).safeTransfer(governor(), _amount);\n }\n\n /**\n * @notice Set the Harvester contract that can collect rewards.\n * @param _harvesterAddress Address of the harvester contract.\n */\n function setHarvesterAddress(address _harvesterAddress)\n external\n onlyGovernor\n {\n emit HarvesterAddressesUpdated(harvesterAddress, _harvesterAddress);\n harvesterAddress = _harvesterAddress;\n }\n\n /***************************************\n Abstract\n ****************************************/\n\n function _abstractSetPToken(address _asset, address _pToken)\n internal\n virtual;\n\n function safeApproveAllTokens() external virtual;\n\n /**\n * @notice Deposit an amount of assets into the platform\n * @param _asset Address for the asset\n * @param _amount Units of asset to deposit\n */\n function deposit(address _asset, uint256 _amount) external virtual;\n\n /**\n * @notice Deposit all supported assets in this strategy contract to the platform\n */\n function depositAll() external virtual;\n\n /**\n * @notice Withdraw an `amount` of assets from the platform and\n * send to the `_recipient`.\n * @param _recipient Address to which the asset should be sent\n * @param _asset Address of the asset\n * @param _amount Units of asset to withdraw\n */\n function withdraw(\n address _recipient,\n address _asset,\n uint256 _amount\n ) external virtual;\n\n /**\n * @notice Withdraw all supported assets from platform and\n * sends to the OToken's Vault.\n */\n function withdrawAll() external virtual;\n\n /**\n * @notice Get the total asset value held in the platform.\n * This includes any interest that was generated since depositing.\n * @param _asset Address of the asset\n * @return balance Total value of the asset in the platform\n */\n function checkBalance(address _asset)\n external\n view\n virtual\n returns (uint256 balance);\n\n /**\n * @notice Check if an asset is supported.\n * @param _asset Address of the asset\n * @return bool Whether asset is supported\n */\n function supportsAsset(address _asset) public view virtual returns (bool);\n}\n" + }, + "contracts/utils/InitializableERC20Detailed.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/**\n * @dev Optional functions from the ERC20 standard.\n * Converted from openzeppelin/contracts/token/ERC20/ERC20Detailed.sol\n * @author Origin Protocol Inc\n */\nabstract contract InitializableERC20Detailed is IERC20 {\n // Storage gap to skip storage from prior to OUSD reset\n uint256[100] private _____gap;\n\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of\n * these values are immutable: they can only be set once during\n * construction.\n * @notice To avoid variable shadowing appended `Arg` after arguments name.\n */\n function _initialize(\n string memory nameArg,\n string memory symbolArg,\n uint8 decimalsArg\n ) internal {\n _name = nameArg;\n _symbol = symbolArg;\n _decimals = decimalsArg;\n }\n\n /**\n * @notice Returns the name of the token.\n */\n function name() public view returns (string memory) {\n return _name;\n }\n\n /**\n * @notice Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n /**\n * @notice Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n}\n" + }, + "contracts/utils/StableMath.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { SafeMath } from \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\n\n// Based on StableMath from Stability Labs Pty. Ltd.\n// https://github.com/mstable/mStable-contracts/blob/master/contracts/shared/StableMath.sol\n\nlibrary StableMath {\n using SafeMath for uint256;\n\n /**\n * @dev Scaling unit for use in specific calculations,\n * where 1 * 10**18, or 1e18 represents a unit '1'\n */\n uint256 private constant FULL_SCALE = 1e18;\n\n /***************************************\n Helpers\n ****************************************/\n\n /**\n * @dev Adjust the scale of an integer\n * @param to Decimals to scale to\n * @param from Decimals to scale from\n */\n function scaleBy(\n uint256 x,\n uint256 to,\n uint256 from\n ) internal pure returns (uint256) {\n if (to > from) {\n x = x.mul(10**(to - from));\n } else if (to < from) {\n // slither-disable-next-line divide-before-multiply\n x = x.div(10**(from - to));\n }\n return x;\n }\n\n /***************************************\n Precise Arithmetic\n ****************************************/\n\n /**\n * @dev Multiplies two precise units, and then truncates by the full scale\n * @param x Left hand input to multiplication\n * @param y Right hand input to multiplication\n * @return Result after multiplying the two inputs and then dividing by the shared\n * scale unit\n */\n function mulTruncate(uint256 x, uint256 y) internal pure returns (uint256) {\n return mulTruncateScale(x, y, FULL_SCALE);\n }\n\n /**\n * @dev Multiplies two precise units, and then truncates by the given scale. For example,\n * when calculating 90% of 10e18, (10e18 * 9e17) / 1e18 = (9e36) / 1e18 = 9e18\n * @param x Left hand input to multiplication\n * @param y Right hand input to multiplication\n * @param scale Scale unit\n * @return Result after multiplying the two inputs and then dividing by the shared\n * scale unit\n */\n function mulTruncateScale(\n uint256 x,\n uint256 y,\n uint256 scale\n ) internal pure returns (uint256) {\n // e.g. assume scale = fullScale\n // z = 10e18 * 9e17 = 9e36\n uint256 z = x.mul(y);\n // return 9e36 / 1e18 = 9e18\n return z.div(scale);\n }\n\n /**\n * @dev Multiplies two precise units, and then truncates by the full scale, rounding up the result\n * @param x Left hand input to multiplication\n * @param y Right hand input to multiplication\n * @return Result after multiplying the two inputs and then dividing by the shared\n * scale unit, rounded up to the closest base unit.\n */\n function mulTruncateCeil(uint256 x, uint256 y)\n internal\n pure\n returns (uint256)\n {\n // e.g. 8e17 * 17268172638 = 138145381104e17\n uint256 scaled = x.mul(y);\n // e.g. 138145381104e17 + 9.99...e17 = 138145381113.99...e17\n uint256 ceil = scaled.add(FULL_SCALE.sub(1));\n // e.g. 13814538111.399...e18 / 1e18 = 13814538111\n return ceil.div(FULL_SCALE);\n }\n\n /**\n * @dev Precisely divides two units, by first scaling the left hand operand. Useful\n * for finding percentage weightings, i.e. 8e18/10e18 = 80% (or 8e17)\n * @param x Left hand input to division\n * @param y Right hand input to division\n * @return Result after multiplying the left operand by the scale, and\n * executing the division on the right hand input.\n */\n function divPrecisely(uint256 x, uint256 y)\n internal\n pure\n returns (uint256)\n {\n // e.g. 8e18 * 1e18 = 8e36\n uint256 z = x.mul(FULL_SCALE);\n // e.g. 8e36 / 10e18 = 8e17\n return z.div(y);\n }\n}\n" + }, + "contracts/vault/VaultStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @title OToken VaultStorage contract\n * @notice The VaultStorage contract defines the storage for the Vault contracts\n * @author Origin Protocol Inc\n */\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\nimport { IStrategy } from \"../interfaces/IStrategy.sol\";\nimport { Governable } from \"../governance/Governable.sol\";\nimport { OUSD } from \"../token/OUSD.sol\";\nimport { Initializable } from \"../utils/Initializable.sol\";\nimport \"../utils/Helpers.sol\";\n\ncontract VaultStorage is Initializable, Governable {\n using SafeERC20 for IERC20;\n\n event AssetSupported(address _asset);\n event AssetRemoved(address _asset);\n event AssetDefaultStrategyUpdated(address _asset, address _strategy);\n event AssetAllocated(address _asset, address _strategy, uint256 _amount);\n event StrategyApproved(address _addr);\n event StrategyRemoved(address _addr);\n event Mint(address _addr, uint256 _value);\n event Redeem(address _addr, uint256 _value);\n event CapitalPaused();\n event CapitalUnpaused();\n event RebasePaused();\n event RebaseUnpaused();\n event VaultBufferUpdated(uint256 _vaultBuffer);\n event OusdMetaStrategyUpdated(address _ousdMetaStrategy);\n event RedeemFeeUpdated(uint256 _redeemFeeBps);\n event PriceProviderUpdated(address _priceProvider);\n event AllocateThresholdUpdated(uint256 _threshold);\n event RebaseThresholdUpdated(uint256 _threshold);\n event StrategistUpdated(address _address);\n event MaxSupplyDiffChanged(uint256 maxSupplyDiff);\n event YieldDistribution(address _to, uint256 _yield, uint256 _fee);\n event TrusteeFeeBpsChanged(uint256 _basis);\n event TrusteeAddressChanged(address _address);\n event NetOusdMintForStrategyThresholdChanged(uint256 _threshold);\n event SwapperChanged(address _address);\n event SwapAllowedUndervalueChanged(uint256 _basis);\n event SwapSlippageChanged(address _asset, uint256 _basis);\n event Swapped(\n address indexed _fromAsset,\n address indexed _toAsset,\n uint256 _fromAssetAmount,\n uint256 _toAssetAmount\n );\n\n // Assets supported by the Vault, i.e. Stablecoins\n enum UnitConversion {\n DECIMALS,\n GETEXCHANGERATE\n }\n // Changed to fit into a single storage slot so the decimals needs to be recached\n struct Asset {\n // Note: OETHVaultCore doesn't use `isSupported` when minting,\n // redeeming or checking balance of assets.\n bool isSupported;\n UnitConversion unitConversion;\n uint8 decimals;\n // Max allowed slippage from the Oracle price when swapping collateral assets in basis points.\n // For example 40 == 0.4% slippage\n uint16 allowedOracleSlippageBps;\n }\n\n /// @dev mapping of supported vault assets to their configuration\n // slither-disable-next-line uninitialized-state\n mapping(address => Asset) internal assets;\n /// @dev list of all assets supported by the vault.\n // slither-disable-next-line uninitialized-state\n address[] internal allAssets;\n\n // Strategies approved for use by the Vault\n struct Strategy {\n bool isSupported;\n uint256 _deprecated; // Deprecated storage slot\n }\n /// @dev mapping of strategy contracts to their configiration\n mapping(address => Strategy) internal strategies;\n /// @dev list of all vault strategies\n address[] internal allStrategies;\n\n /// @notice Address of the Oracle price provider contract\n // slither-disable-next-line uninitialized-state\n address public priceProvider;\n /// @notice pause rebasing if true\n bool public rebasePaused = false;\n /// @notice pause operations that change the OToken supply.\n /// eg mint, redeem, allocate, mint/burn for strategy\n bool public capitalPaused = true;\n /// @notice Redemption fee in basis points. eg 50 = 0.5%\n uint256 public redeemFeeBps;\n /// @notice Percentage of assets to keep in Vault to handle (most) withdrawals. 100% = 1e18.\n uint256 public vaultBuffer;\n /// @notice OToken mints over this amount automatically allocate funds. 18 decimals.\n uint256 public autoAllocateThreshold;\n /// @notice OToken mints over this amount automatically rebase. 18 decimals.\n uint256 public rebaseThreshold;\n\n /// @dev Address of the OToken token. eg OUSD or OETH.\n // slither-disable-next-line uninitialized-state\n OUSD internal oUSD;\n\n //keccak256(\"OUSD.vault.governor.admin.impl\");\n bytes32 constant adminImplPosition =\n 0xa2bd3d3cf188a41358c8b401076eb59066b09dec5775650c0de4c55187d17bd9;\n\n // Address of the contract responsible for post rebase syncs with AMMs\n address private _deprecated_rebaseHooksAddr = address(0);\n\n // Deprecated: Address of Uniswap\n // slither-disable-next-line constable-states\n address private _deprecated_uniswapAddr = address(0);\n\n /// @notice Address of the Strategist\n address public strategistAddr = address(0);\n\n /// @notice Mapping of asset address to the Strategy that they should automatically\n // be allocated to\n // slither-disable-next-line uninitialized-state\n mapping(address => address) public assetDefaultStrategies;\n\n /// @notice Max difference between total supply and total value of assets. 18 decimals.\n // slither-disable-next-line uninitialized-state\n uint256 public maxSupplyDiff;\n\n /// @notice Trustee contract that can collect a percentage of yield\n address public trusteeAddress;\n\n /// @notice Amount of yield collected in basis points. eg 2000 = 20%\n uint256 public trusteeFeeBps;\n\n /// @dev Deprecated: Tokens that should be swapped for stablecoins\n address[] private _deprecated_swapTokens;\n\n uint256 constant MINT_MINIMUM_UNIT_PRICE = 0.998e18;\n\n /// @notice Metapool strategy that is allowed to mint/burn OTokens without changing collateral\n address public ousdMetaStrategy = address(0);\n\n /// @notice How much OTokens are currently minted by the strategy\n int256 public netOusdMintedForStrategy = 0;\n\n /// @notice How much net total OTokens are allowed to be minted by all strategies\n uint256 public netOusdMintForStrategyThreshold = 0;\n\n uint256 constant MIN_UNIT_PRICE_DRIFT = 0.7e18;\n uint256 constant MAX_UNIT_PRICE_DRIFT = 1.3e18;\n\n /// @notice Collateral swap configuration.\n /// @dev is packed into a single storage slot to save gas.\n struct SwapConfig {\n // Contract that swaps the vault's collateral assets\n address swapper;\n // Max allowed percentage the total value can drop below the total supply in basis points.\n // For example 100 == 1%\n uint16 allowedUndervalueBps;\n }\n SwapConfig internal swapConfig = SwapConfig(address(0), 0);\n\n // For future use\n uint256[50] private __gap;\n\n /**\n * @notice set the implementation for the admin, this needs to be in a base class else we cannot set it\n * @param newImpl address of the implementation\n */\n function setAdminImpl(address newImpl) external onlyGovernor {\n require(\n Address.isContract(newImpl),\n \"new implementation is not a contract\"\n );\n bytes32 position = adminImplPosition;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(position, newImpl)\n }\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/contracts/docs/NativeStakingSSVStrategySquashed.svg b/contracts/docs/NativeStakingSSVStrategySquashed.svg index 86d64e08ec..1efe2f1314 100644 --- a/contracts/docs/NativeStakingSSVStrategySquashed.svg +++ b/contracts/docs/NativeStakingSSVStrategySquashed.svg @@ -4,135 +4,145 @@ - - + + UmlClassDiagram - + 284 - -NativeStakingSSVStrategy -../contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol - -Private: -   governorPosition: bytes32 <<Governable>> -   pendingGovernorPosition: bytes32 <<Governable>> -   reentryStatusPosition: bytes32 <<Governable>> -   _paused: bool <<Pausable>> -   __gap: uint256[50] <<ValidatorRegistrator>> -   __gap: uint256[49] <<ValidatorAccountant>> -   initialized: bool <<Initializable>> -   initializing: bool <<Initializable>> -   ______gap: uint256[50] <<Initializable>> -   _deprecated_platformAddress: address <<InitializableAbstractStrategy>> -   _deprecated_vaultAddress: address <<InitializableAbstractStrategy>> -   _deprecated_rewardTokenAddress: address <<InitializableAbstractStrategy>> -   _deprecated_rewardLiquidationThreshold: uint256 <<InitializableAbstractStrategy>> -   _reserved: int256[98] <<InitializableAbstractStrategy>> -   __gap: uint256[49] <<NativeStakingSSVStrategy>> -Internal: -   assetsMapped: address[] <<InitializableAbstractStrategy>> -Public: -   _NOT_ENTERED: uint256 <<Governable>> -   _ENTERED: uint256 <<Governable>> -   WETH_TOKEN_ADDRESS: address <<ValidatorRegistrator>> -   BEACON_CHAIN_DEPOSIT_CONTRACT: address <<ValidatorRegistrator>> -   SSV_NETWORK_ADDRESS: address <<ValidatorRegistrator>> -   VAULT_ADDRESS: address <<ValidatorRegistrator>> -   validatorRegistrator: address <<ValidatorRegistrator>> -   activeDepositedValidators: uint256 <<ValidatorRegistrator>> -   validatorsStates: mapping(bytes32=>VALIDATOR_STATE) <<ValidatorRegistrator>> -   MIN_FIX_ACCOUNTING_CADENCE: uint256 <<ValidatorAccountant>> -   MAX_STAKE: uint256 <<ValidatorAccountant>> -   consensusRewards: uint256 <<ValidatorAccountant>> -   fuseIntervalStart: uint256 <<ValidatorAccountant>> -   fuseIntervalEnd: uint256 <<ValidatorAccountant>> -   lastFixAccountingBlockNumber: uint256 <<ValidatorAccountant>> -   platformAddress: address <<InitializableAbstractStrategy>> -   vaultAddress: address <<InitializableAbstractStrategy>> -   assetToPToken: mapping(address=>address) <<InitializableAbstractStrategy>> -   harvesterAddress: address <<InitializableAbstractStrategy>> -   rewardTokenAddresses: address[] <<InitializableAbstractStrategy>> -   SSV_TOKEN_ADDRESS: address <<NativeStakingSSVStrategy>> -   FEE_ACCUMULATOR_ADDRESS: address <<NativeStakingSSVStrategy>> -   depositedWethAccountedFor: uint256 <<NativeStakingSSVStrategy>> - -Internal: -    _governor(): (governorOut: address) <<Governable>> -    _pendingGovernor(): (pendingGovernor: address) <<Governable>> -    _setGovernor(newGovernor: address) <<Governable>> -    _setPendingGovernor(newGovernor: address) <<Governable>> -    _changeGovernor(_newGovernor: address) <<Governable>> -    _msgSender(): address <<Context>> -    _msgData(): bytes <<Context>> -    _pause() <<whenNotPaused>> <<Pausable>> -    _unpause() <<whenPaused>> <<Pausable>> -    _wethWithdrawnAndStaked(_amount: uint256) <<NativeStakingSSVStrategy>> -    _doAccounting(pauseOnFail: bool): (accountingValid: bool) <<ValidatorAccountant>> -    _failAccounting(pauseOnFail: bool): (accountingValid: bool) <<ValidatorAccountant>> -    _wethWithdrawnToVault(_amount: uint256) <<NativeStakingSSVStrategy>> -    _initialize(_rewardTokenAddresses: address[], _assets: address[], _pTokens: address[]) <<InitializableAbstractStrategy>> -    _collectRewardTokens() <<whenNotPaused>> <<NativeStakingSSVStrategy>> -    _setPTokenAddress(_asset: address, _pToken: address) <<InitializableAbstractStrategy>> -    _abstractSetPToken(_asset: address, address) <<NativeStakingSSVStrategy>> -    _deposit(_asset: address, _amount: uint256) <<NativeStakingSSVStrategy>> -    _withdraw(_recipient: address, _asset: address, _amount: uint256) <<NativeStakingSSVStrategy>> -External: -    <<payable>> null() <<NativeStakingSSVStrategy>> -    transferGovernance(_newGovernor: address) <<onlyGovernor>> <<Governable>> -    claimGovernance() <<Governable>> -    setRegistrator(_address: address) <<onlyGovernor>> <<ValidatorRegistrator>> -    stakeEth(validators: ValidatorStakeData[]) <<onlyRegistrator, whenNotPaused>> <<ValidatorRegistrator>> -    registerSsvValidator(publicKey: bytes, operatorIds: uint64[], sharesData: bytes, amount: uint256, cluster: Cluster) <<onlyRegistrator, whenNotPaused>> <<ValidatorRegistrator>> -    exitSsvValidator(publicKey: bytes, operatorIds: uint64[]) <<onlyRegistrator, whenNotPaused>> <<ValidatorRegistrator>> -    removeSsvValidator(publicKey: bytes, operatorIds: uint64[], cluster: Cluster) <<onlyRegistrator, whenNotPaused>> <<ValidatorRegistrator>> -    depositSSV(operatorIds: uint64[], amount: uint256, cluster: Cluster) <<onlyStrategist>> <<ValidatorRegistrator>> -    setFuseInterval(_fuseIntervalStart: uint256, _fuseIntervalEnd: uint256) <<onlyGovernor>> <<ValidatorAccountant>> -    doAccounting(): (accountingValid: bool) <<onlyRegistrator, whenNotPaused>> <<ValidatorAccountant>> -    manuallyFixAccounting(_validatorsDelta: int256, _consensusRewardsDelta: int256, _ethToVaultAmount: uint256) <<onlyStrategist, whenPaused>> <<ValidatorAccountant>> -    collectRewardTokens() <<onlyHarvester, nonReentrant>> <<InitializableAbstractStrategy>> -    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() <<NativeStakingSSVStrategy>> -    deposit(_asset: address, _amount: uint256) <<onlyVault, nonReentrant>> <<NativeStakingSSVStrategy>> -    depositAll() <<onlyVault, nonReentrant>> <<NativeStakingSSVStrategy>> -    withdraw(_recipient: address, _asset: address, _amount: uint256) <<onlyVault, nonReentrant>> <<NativeStakingSSVStrategy>> -    withdrawAll() <<onlyVaultOrGovernor, nonReentrant>> <<NativeStakingSSVStrategy>> -    checkBalance(_asset: address): (balance: uint256) <<NativeStakingSSVStrategy>> -    initialize(_rewardTokenAddresses: address[], _assets: address[], _pTokens: address[]) <<onlyGovernor, initializer>> <<NativeStakingSSVStrategy>> -    pause() <<onlyStrategist>> <<NativeStakingSSVStrategy>> -Public: -    <<event>> PendingGovernorshipTransfer(previousGovernor: address, newGovernor: address) <<Governable>> -    <<event>> GovernorshipTransferred(previousGovernor: address, newGovernor: address) <<Governable>> -    <<event>> Paused(account: address) <<Pausable>> -    <<event>> Unpaused(account: address) <<Pausable>> -    <<event>> RegistratorChanged(newAddress: address) <<ValidatorRegistrator>> -    <<event>> ETHStaked(pubkey: bytes, amount: uint256, withdrawal_credentials: bytes) <<ValidatorRegistrator>> -    <<event>> SSVValidatorRegistered(pubkey: bytes, operatorIds: uint64[]) <<ValidatorRegistrator>> -    <<event>> SSVValidatorExitInitiated(pubkey: bytes, operatorIds: uint64[]) <<ValidatorRegistrator>> -    <<event>> SSVValidatorExitCompleted(pubkey: bytes, operatorIds: uint64[]) <<ValidatorRegistrator>> -    <<event>> FuseIntervalUpdated(start: uint256, end: uint256) <<ValidatorAccountant>> -    <<event>> AccountingFullyWithdrawnValidator(noOfValidators: uint256, remainingValidators: uint256, wethSentToVault: uint256) <<ValidatorAccountant>> -    <<event>> AccountingValidatorSlashed(remainingValidators: uint256, wethSentToVault: uint256) <<ValidatorAccountant>> -    <<event>> AccountingConsensusRewards(amount: uint256) <<ValidatorAccountant>> -    <<event>> AccountingManuallyFixed(validatorsDelta: int256, consensusRewardsDelta: int256, wethToVault: uint256) <<ValidatorAccountant>> -    <<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>> -    <<modifier>> onlyGovernor() <<Governable>> -    <<modifier>> nonReentrant() <<Governable>> -    <<modifier>> whenNotPaused() <<Pausable>> -    <<modifier>> whenPaused() <<Pausable>> -    <<modifier>> onlyRegistrator() <<ValidatorRegistrator>> + +NativeStakingSSVStrategy +../contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol + +Private: +   governorPosition: bytes32 <<Governable>> +   pendingGovernorPosition: bytes32 <<Governable>> +   reentryStatusPosition: bytes32 <<Governable>> +   _paused: bool <<Pausable>> +   __gap: uint256[47] <<ValidatorRegistrator>> +   __gap: uint256[49] <<ValidatorAccountant>> +   initialized: bool <<Initializable>> +   initializing: bool <<Initializable>> +   ______gap: uint256[50] <<Initializable>> +   _deprecated_platformAddress: address <<InitializableAbstractStrategy>> +   _deprecated_vaultAddress: address <<InitializableAbstractStrategy>> +   _deprecated_rewardTokenAddress: address <<InitializableAbstractStrategy>> +   _deprecated_rewardLiquidationThreshold: uint256 <<InitializableAbstractStrategy>> +   _reserved: int256[98] <<InitializableAbstractStrategy>> +   __gap: uint256[49] <<NativeStakingSSVStrategy>> +Internal: +   assetsMapped: address[] <<InitializableAbstractStrategy>> +Public: +   _NOT_ENTERED: uint256 <<Governable>> +   _ENTERED: uint256 <<Governable>> +   WETH_TOKEN_ADDRESS: address <<ValidatorRegistrator>> +   BEACON_CHAIN_DEPOSIT_CONTRACT: address <<ValidatorRegistrator>> +   SSV_NETWORK_ADDRESS: address <<ValidatorRegistrator>> +   VAULT_ADDRESS: address <<ValidatorRegistrator>> +   validatorRegistrator: address <<ValidatorRegistrator>> +   activeDepositedValidators: uint256 <<ValidatorRegistrator>> +   validatorsStates: mapping(bytes32=>VALIDATOR_STATE) <<ValidatorRegistrator>> +   stakingMonitor: address <<ValidatorRegistrator>> +   stakeETHThreshold: uint256 <<ValidatorRegistrator>> +   stakeETHTally: uint256 <<ValidatorRegistrator>> +   MIN_FIX_ACCOUNTING_CADENCE: uint256 <<ValidatorAccountant>> +   MAX_STAKE: uint256 <<ValidatorAccountant>> +   consensusRewards: uint256 <<ValidatorAccountant>> +   fuseIntervalStart: uint256 <<ValidatorAccountant>> +   fuseIntervalEnd: uint256 <<ValidatorAccountant>> +   lastFixAccountingBlockNumber: uint256 <<ValidatorAccountant>> +   platformAddress: address <<InitializableAbstractStrategy>> +   vaultAddress: address <<InitializableAbstractStrategy>> +   assetToPToken: mapping(address=>address) <<InitializableAbstractStrategy>> +   harvesterAddress: address <<InitializableAbstractStrategy>> +   rewardTokenAddresses: address[] <<InitializableAbstractStrategy>> +   SSV_TOKEN_ADDRESS: address <<NativeStakingSSVStrategy>> +   FEE_ACCUMULATOR_ADDRESS: address <<NativeStakingSSVStrategy>> +   depositedWethAccountedFor: uint256 <<NativeStakingSSVStrategy>> + +Internal: +    _governor(): (governorOut: address) <<Governable>> +    _pendingGovernor(): (pendingGovernor: address) <<Governable>> +    _setGovernor(newGovernor: address) <<Governable>> +    _setPendingGovernor(newGovernor: address) <<Governable>> +    _changeGovernor(_newGovernor: address) <<Governable>> +    _msgSender(): address <<Context>> +    _msgData(): bytes <<Context>> +    _pause() <<whenNotPaused>> <<Pausable>> +    _unpause() <<whenPaused>> <<Pausable>> +    _wethWithdrawnAndStaked(_amount: uint256) <<NativeStakingSSVStrategy>> +    _doAccounting(pauseOnFail: bool): (accountingValid: bool) <<ValidatorAccountant>> +    _failAccounting(pauseOnFail: bool): (accountingValid: bool) <<ValidatorAccountant>> +    _wethWithdrawnToVault(_amount: uint256) <<NativeStakingSSVStrategy>> +    _initialize(_rewardTokenAddresses: address[], _assets: address[], _pTokens: address[]) <<InitializableAbstractStrategy>> +    _collectRewardTokens() <<whenNotPaused>> <<NativeStakingSSVStrategy>> +    _setPTokenAddress(_asset: address, _pToken: address) <<InitializableAbstractStrategy>> +    _abstractSetPToken(_asset: address, address) <<NativeStakingSSVStrategy>> +    _deposit(_asset: address, _amount: uint256) <<NativeStakingSSVStrategy>> +    _withdraw(_recipient: address, _asset: address, _amount: uint256) <<NativeStakingSSVStrategy>> +External: +    <<payable>> null() <<NativeStakingSSVStrategy>> +    transferGovernance(_newGovernor: address) <<onlyGovernor>> <<Governable>> +    claimGovernance() <<Governable>> +    setRegistrator(_address: address) <<onlyGovernor>> <<ValidatorRegistrator>> +    setStakingMonitor(_address: address) <<onlyGovernor>> <<ValidatorRegistrator>> +    setStakeETHThreshold(_amount: uint256) <<onlyGovernor>> <<ValidatorRegistrator>> +    resetStakeETHTally() <<onlyStakingMonitor>> <<ValidatorRegistrator>> +    stakeEth(validators: ValidatorStakeData[]) <<onlyRegistrator, whenNotPaused>> <<ValidatorRegistrator>> +    registerSsvValidator(publicKey: bytes, operatorIds: uint64[], sharesData: bytes, amount: uint256, cluster: Cluster) <<onlyRegistrator, whenNotPaused>> <<ValidatorRegistrator>> +    exitSsvValidator(publicKey: bytes, operatorIds: uint64[]) <<onlyRegistrator, whenNotPaused>> <<ValidatorRegistrator>> +    removeSsvValidator(publicKey: bytes, operatorIds: uint64[], cluster: Cluster) <<onlyRegistrator, whenNotPaused>> <<ValidatorRegistrator>> +    depositSSV(operatorIds: uint64[], amount: uint256, cluster: Cluster) <<onlyStrategist>> <<ValidatorRegistrator>> +    setFuseInterval(_fuseIntervalStart: uint256, _fuseIntervalEnd: uint256) <<onlyGovernor>> <<ValidatorAccountant>> +    doAccounting(): (accountingValid: bool) <<onlyRegistrator, whenNotPaused>> <<ValidatorAccountant>> +    manuallyFixAccounting(_validatorsDelta: int256, _consensusRewardsDelta: int256, _ethToVaultAmount: uint256) <<onlyStrategist, whenPaused>> <<ValidatorAccountant>> +    collectRewardTokens() <<onlyHarvester, nonReentrant>> <<InitializableAbstractStrategy>> +    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() <<NativeStakingSSVStrategy>> +    deposit(_asset: address, _amount: uint256) <<onlyVault, nonReentrant>> <<NativeStakingSSVStrategy>> +    depositAll() <<onlyVault, nonReentrant>> <<NativeStakingSSVStrategy>> +    withdraw(_recipient: address, _asset: address, _amount: uint256) <<onlyVault, nonReentrant>> <<NativeStakingSSVStrategy>> +    withdrawAll() <<onlyVaultOrGovernor, nonReentrant>> <<NativeStakingSSVStrategy>> +    checkBalance(_asset: address): (balance: uint256) <<NativeStakingSSVStrategy>> +    initialize(_rewardTokenAddresses: address[], _assets: address[], _pTokens: address[]) <<onlyGovernor, initializer>> <<NativeStakingSSVStrategy>> +    pause() <<onlyStrategist>> <<NativeStakingSSVStrategy>> +Public: +    <<event>> PendingGovernorshipTransfer(previousGovernor: address, newGovernor: address) <<Governable>> +    <<event>> GovernorshipTransferred(previousGovernor: address, newGovernor: address) <<Governable>> +    <<event>> Paused(account: address) <<Pausable>> +    <<event>> Unpaused(account: address) <<Pausable>> +    <<event>> RegistratorChanged(newAddress: address) <<ValidatorRegistrator>> +    <<event>> StakingMonitorChanged(newAddress: address) <<ValidatorRegistrator>> +    <<event>> ETHStaked(pubkey: bytes, amount: uint256, withdrawal_credentials: bytes) <<ValidatorRegistrator>> +    <<event>> SSVValidatorRegistered(pubkey: bytes, operatorIds: uint64[]) <<ValidatorRegistrator>> +    <<event>> SSVValidatorExitInitiated(pubkey: bytes, operatorIds: uint64[]) <<ValidatorRegistrator>> +    <<event>> SSVValidatorExitCompleted(pubkey: bytes, operatorIds: uint64[]) <<ValidatorRegistrator>> +    <<event>> StakeETHThresholdChanged(amount: uint256) <<ValidatorRegistrator>> +    <<event>> StakeETHTallyReset() <<ValidatorRegistrator>> +    <<event>> FuseIntervalUpdated(start: uint256, end: uint256) <<ValidatorAccountant>> +    <<event>> AccountingFullyWithdrawnValidator(noOfValidators: uint256, remainingValidators: uint256, wethSentToVault: uint256) <<ValidatorAccountant>> +    <<event>> AccountingValidatorSlashed(remainingValidators: uint256, wethSentToVault: uint256) <<ValidatorAccountant>> +    <<event>> AccountingConsensusRewards(amount: uint256) <<ValidatorAccountant>> +    <<event>> AccountingManuallyFixed(validatorsDelta: int256, consensusRewardsDelta: int256, wethToVault: uint256) <<ValidatorAccountant>> +    <<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>> +    <<modifier>> onlyGovernor() <<Governable>> +    <<modifier>> nonReentrant() <<Governable>> +    <<modifier>> whenNotPaused() <<Pausable>> +    <<modifier>> whenPaused() <<Pausable>> +    <<modifier>> onlyRegistrator() <<ValidatorRegistrator>> +    <<modifier>> onlyStakingMonitor() <<ValidatorRegistrator>>    <<modifier>> onlyStrategist() <<ValidatorRegistrator>>    <<modifier>> initializer() <<Initializable>>    <<modifier>> onlyVault() <<InitializableAbstractStrategy>> diff --git a/contracts/docs/NativeStakingSSVStrategyStorage.svg b/contracts/docs/NativeStakingSSVStrategyStorage.svg index 27ada6cae1..965a544007 100644 --- a/contracts/docs/NativeStakingSSVStrategyStorage.svg +++ b/contracts/docs/NativeStakingSSVStrategyStorage.svg @@ -4,26 +4,32 @@ - - + + StorageDiagram - + 3 - -NativeStakingSSVStrategy <<Contract>> - -slot + +NativeStakingSSVStrategy <<Contract>> + +slot + +0 + +1 + +2 -0 +3 -1 +4 -2 +5 -3-52 +6-52 53 @@ -60,20 +66,28 @@ 263 264-312 - -type: <inherited contract>.variable (bytes) + +type: <inherited contract>.variable (bytes) + +unallocated (11) + +address: ValidatorRegistrator.validatorRegistrator (20) + +bool: Pausable._paused (1) + +uint256: ValidatorRegistrator.activeDepositedValidators (32) + +mapping(bytes32=>VALIDATOR_STATE): ValidatorRegistrator.validatorsStates (32) -unallocated (11) - -address: ValidatorRegistrator.validatorRegistrator (20) - -bool: Pausable._paused (1) +unallocated (12) + +address: ValidatorRegistrator.stakingMonitor (20) -uint256: ValidatorRegistrator.activeDepositedValidators (32) +uint256: ValidatorRegistrator.stakeETHThreshold (32) -mapping(bytes32=>VALIDATOR_STATE): ValidatorRegistrator.validatorsStates (32) +uint256: ValidatorRegistrator.stakeETHTally (32) -uint256[50]: ValidatorRegistrator.__gap (1600) +uint256[47]: ValidatorRegistrator.__gap (1504) uint256: ValidatorAccountant.consensusRewards (32) @@ -126,48 +140,48 @@ 1 - -address[]: assetsMapped <<Array>> -0x78fdc8d422c49ced035a9edf18d00d3c6a8d81df210f3e5e448e045e77b41e88 - -offset - -0 - -type: variable (bytes) - -unallocated (12) - -address (20) + +address[]: assetsMapped <<Array>> +0x78fdc8d422c49ced035a9edf18d00d3c6a8d81df210f3e5e448e045e77b41e88 + +offset + +0 + +type: variable (bytes) + +unallocated (12) + +address (20) -3:18->1 - - +3:21->1 + + 2 - -address[]: rewardTokenAddresses <<Array>> -0xe434dc35da084cf8d7e8186688ea2dacb53db7003d427af3abf351bd9d0a4e8d - -offset - -0 - -type: variable (bytes) - -unallocated (12) - -address (20) + +address[]: rewardTokenAddresses <<Array>> +0xe434dc35da084cf8d7e8186688ea2dacb53db7003d427af3abf351bd9d0a4e8d + +offset + +0 + +type: variable (bytes) + +unallocated (12) + +address (20) -3:23->2 - - +3:26->2 + + diff --git a/contracts/tasks/validator.js b/contracts/tasks/validator.js index 992ac02b67..ee033a6162 100644 --- a/contracts/tasks/validator.js +++ b/contracts/tasks/validator.js @@ -264,11 +264,32 @@ const stakingContractPaused = async (contracts) => { const stakingContractHas32ETH = async (contracts) => { const address = contracts.nativeStakingStrategy.address; const wethBalance = await contracts.WETH.balanceOf(address); + log( + `Native Staking Strategy has ${formatUnits(wethBalance, 18)} WETH in total` + ); + + const stakeETHThreshold = contracts.nativeStakingStrategy.stakeETHThreshold(); + const stakeETHTally = contracts.nativeStakingStrategy.stakeETHTally(); + const remainingETH = stakeETHThreshold.sub(stakeETHTally); + log( + `Native Staking Strategy has staked ${formatUnits( + stakeETHTally + )} of ${formatUnits(stakeETHThreshold)} ETH with ${formatUnits( + remainingETH + )} ETH remaining` + ); + // Take the minimum of the remainingETH and the WETH balance + const availableETH = wethBalance.gt(remainingETH) + ? remainingETH + : wethBalance; log( - `Native staking contract has ${formatUnits(wethBalance, 18)} WETH in total` + `Native Staking Strategy has ${formatUnits( + availableETH + )} ETH available to stake` ); - return wethBalance.gte(parseEther("32")); + + return availableETH.gte(parseEther("32")); }; /* Make a GET or POST request to P2P service diff --git a/contracts/test/_fixture.js b/contracts/test/_fixture.js index 9c87c52f43..ab50a047b0 100644 --- a/contracts/test/_fixture.js +++ b/contracts/test/_fixture.js @@ -1617,6 +1617,7 @@ async function nativeStakingSSVStrategyFixture() { addresses.mainnet.SSVNetwork ); } else { + fixture.ssvNetwork = await ethers.getContract("MockSSVNetwork"); const { governorAddr } = await getNamedAccounts(); const { oethVault, weth, nativeStakingSSVStrategy } = fixture; const sGovernor = await ethers.provider.getSigner(governorAddr); @@ -1641,6 +1642,8 @@ async function nativeStakingSSVStrategyFixture() { await nativeStakingSSVStrategy .connect(sGovernor) .setRegistrator(governorAddr); + + fixture.validatorRegistrator = sGovernor; } return fixture; diff --git a/contracts/test/behaviour/ssvStrategy.js b/contracts/test/behaviour/ssvStrategy.js index 39c292fda6..afd756915e 100644 --- a/contracts/test/behaviour/ssvStrategy.js +++ b/contracts/test/behaviour/ssvStrategy.js @@ -82,6 +82,14 @@ const shouldBehaveLikeAnSsvStrategy = (context) => { addresses.validatorRegistrator, "Incorrect validator registrator" ); + await expect(await nativeStakingSSVStrategy.stakingMonitor()).to.equal( + addresses.Guardian, + "Incorrect staking monitor" + ); + await expect(await nativeStakingSSVStrategy.stakeETHThreshold()).to.gt( + 0, + "stake ETH threshold" + ); }); }); diff --git a/contracts/test/helpers.js b/contracts/test/helpers.js index bf9d563032..dffb37668a 100644 --- a/contracts/test/helpers.js +++ b/contracts/test/helpers.js @@ -489,9 +489,8 @@ const getAssetAddresses = async (deployments) => { BAL: (await deployments.get("MockBAL")).address, SSV: (await deployments.get("MockSSV")).address, SSVNetwork: (await deployments.get("MockSSVNetwork")).address, - beaconChainDepositContract: ( - await deployments.get("BeaconChainDepositContractMock") - ).address, + beaconChainDepositContract: (await deployments.get("MockDepositContract")) + .address, }; try { diff --git a/contracts/test/strategies/nativeSSVStaking.js b/contracts/test/strategies/nativeSSVStaking.js index 27fb8c92b3..26ac2fa84a 100644 --- a/contracts/test/strategies/nativeSSVStaking.js +++ b/contracts/test/strategies/nativeSSVStaking.js @@ -14,6 +14,8 @@ const { shouldBehaveLikeHarvestable } = require("../behaviour/harvestable"); const { shouldBehaveLikeStrategy } = require("../behaviour/strategy"); const { MAX_UINT256 } = require("../../utils/constants"); const { impersonateAndFund } = require("../../utils/signers"); +const { ethUnits } = require("../helpers"); +const { setERC20TokenBalance } = require("../_fund"); const { zero } = require("../../utils/addresses"); const minFixAccountingCadence = 7200 + 1; @@ -24,6 +26,26 @@ const { const loadFixture = createFixtureLoader(nativeStakingSSVStrategyFixture); +const testValidator = { + publicKey: + "0xaba6acd335d524a89fb89b9977584afdb23f34a6742547fa9ec1c656fbd2bfc0e7a234460328c2731828c9a43be06e25", + operatorIds: [348, 352, 361, 377], + sharesData: + "0x859f01c8f609cb5cb91f0c98e9b39b077775f10302d0db0edc4ea65e692c97920d5169f6281845a956404c0ba90b88060b74aa3755347441a5729b90bf30a449fa568e21915d11733c7135602b2a3d1a4dce41218ecb0fdb1788ee7e48a9ebd4b4b34f62deea20e9212ce78040dcad2e6382c2f4d4c8b3515a840e1693574068e26c0d58f17dc47d30efe4393f2660dc988aba6166b67732e8df7d9a69d316f330779b2fa4d14712d3bb60436d912bab4464c7c31ae8d2a966d7829063821fc899cc3ec4a8c7098b042323eb9d9cc4d5e945c6d5e6d4eb1b2484163d4b8cd83eea4cc195a68320f023b4d2405cda5110a2eea2c12b70abd9b6bfb567a7850a95fe073a0485c787744efc8658789b0faaff0d942b3c7b89540f594d007936f23c3e7c79fabfe1e2c49199a3f374198e231ca391909ca05ee3c89a7292207131653f6f2f5f5d638d4789a8029001b93827f6f45ef062c9a9d1360a3aedae00fbb8c34495056bacc98c6cecfc1171c84a1e47f3bc328539dbbcd6c79c2aebf7833c684bd807cc8c4dfd6b660e64aece6adf659a969851cf976dead050e9d14aa9c358326c0c0f0cb747041830e124ec872fcf6f82e7f05024da9e6bad10319ca085a0d1519b04c60738043babc1f5a144655e6a28922c2734701c5c93b845996589b8fd246e1bcd97570951cdbed032eeb9c2ac49ac8aeb2e988b6a5513ddcef9ca9bd592c0bce7d38041b52e69e85cda5fd0b84f905c7212b299cf265ee603add20d6459e0841dd05524e96574eebb46473151ec10a08873f7075e15342852f9f16aeb8305211706632475c39ccd8da33969390d035f8a68324e7adced66a726f80532b425cc82dd52a2edc10989db0167317b472a0016215dae35b4c26b28c0ebcf56e115eb32231449812e9ce866a8c0b3128878d3878f5be0670051a8bf94807123c54e6ea2f51607e32c2fe1b132c905c81965dd6d2a7474aa40b65f18d34084a74ba9a21fbdfba3bfaf6b11175d85f03181d655fda086d8dbe2f03dfa2e1b7140b1d9dc68fc9e22f184ed278599d29f6660af128e4c548de6926912d920e35575db90338a1a840f8d8842685f5b459fda573eaf5c5180e3369fc50faa681941dbe7dec83ee9649f30c1a0eac1f8a42fb3083d9274f4c622e2aa1e74b70fa6c027b4f23e1f80bfc4f69248b4d0b3e0eee9372869f97eb89d8d155e469191c48834ad58dd831f1b73409d71fccb958b6582a4ac3f98bcffff2abd393cbe64d7397ada699ecc75301e3be9e9b4ee92a990202c6a5e5112de5ea9cd666f41cdac4611575c8efe2137d6132cd4d4eea0de159eab44588a88f887e4263f673fb365415df537c77a4aaaee12dceff022eafcb8e6973eec7e18eb65cfeefa845b79754ec52a9270f0a7e570b1dd2171e629d498f34e6371726fa8cfe6863f9263c5222a953a44612944183789ad1020de8da527bf850429558dda7896059476e497284512c946d7a57acda3c3ee722d280c0d0daf758d6be88db48e96e14124832c38aa6d0dd38baeb4f246b01d7b0beb55c3983fb182cbf630b778384cc13ab6216611bc1eab94ffe17bb1e829700c99ec28fae1a87eaefd9c8edc4cdf3b6f2b07d85e0d8090ddfb2df4280dacd13a1f30cf946f5606940dc3f75622159b1c6f84bfdbd4ba9fa0f1d522f52bc2049da53f0d06931d650ef1274eb0247844c36349617095f9734e89be683fd7bd5001b416d800c53ec8e8eb533c418a83e803daf6fdfd552ca745bb2b24d8abe899ea89572524343386a035b675e9d5eeae81aefb3a24397f36fe501c66b27d1c0e453fcc975c888d9d6d5a4ca0a4b32b41deebed70", + signature: + "0x90157a1c1b26384f0b4d41bec867d1a000f75e7b634ac7c4c6d8dfc0b0eaeb73bcc99586333d42df98c6b0a8c5ef0d8d071c68991afcd8fbbaa8b423e3632ee4fe0782bc03178a30a8bc6261f64f84a6c833fb96a0f29de1c34ede42c4a859b0", + depositDataRoot: + "0xdbe778a625c68446f3cc8b2009753a5e7dd7c37b8721ee98a796bb9179dfe8ac", +}; + +const emptyCluster = [ + 0, // validatorCount + 0, // networkFeeIndex + 0, // index + true, // active + 0, // balance +]; + describe("Unit test: Native SSV Staking Strategy", function () { this.timeout(0); @@ -1015,6 +1037,116 @@ describe("Unit test: Native SSV Staking Strategy", function () { } }); + describe("Register and stake validators", async () => { + beforeEach(async () => { + const { weth, josh, anna, governor, ssv, nativeStakingSSVStrategy } = + fixture; + + await setERC20TokenBalance( + nativeStakingSSVStrategy.address, + ssv, + "1000", + hre + ); + + await weth + .connect(josh) + .transfer(nativeStakingSSVStrategy.address, ethUnits("256")); + + const stakeThreshold = ethers.utils.parseEther("64"); + + await nativeStakingSSVStrategy + .connect(governor) + .setStakingMonitor(anna.address); + + await nativeStakingSSVStrategy + .connect(governor) + .setStakeETHThreshold(stakeThreshold); + }); + + const stakeValidator = async (validators, stakeTresholdErrorTriggered) => { + const { nativeStakingSSVStrategy, validatorRegistrator } = fixture; + + // there is a limitation to this function as it will only check for + // a failure transaction with the last stake call + for (let i = 0; i < validators; i++) { + const stakeAmount = ethUnits("32"); + // Register a new validator with the SSV Network + await nativeStakingSSVStrategy + .connect(validatorRegistrator) + .registerSsvValidator( + testValidator.publicKey, + testValidator.operatorIds, + testValidator.sharesData, + stakeAmount, + emptyCluster + ); + + // Stake ETH to the new validator + const tx = nativeStakingSSVStrategy + .connect(validatorRegistrator) + .stakeEth([ + { + pubkey: testValidator.publicKey, + signature: testValidator.signature, + depositDataRoot: testValidator.depositDataRoot, + }, + ]); + + if (stakeTresholdErrorTriggered && i == validators - 1) { + await expect(tx).to.be.revertedWith("Staking ETH over threshold"); + } else { + await tx; + } + } + }; + + it("Should stake to a validator", async () => { + await stakeValidator(1, false); + }); + + it("Should stake to 2 validators", async () => { + await stakeValidator(2, false); + }); + + it("Should not stake to 3 validators as stake threshold is triggered", async () => { + await stakeValidator(3, true); + }); + + it("Should stake to 2 validators continually when threshold is reset", async () => { + const { anna, nativeStakingSSVStrategy } = fixture; + + const resetThreshold = async () => { + await nativeStakingSSVStrategy.connect(anna).resetStakeETHTally(); + }; + + await stakeValidator(2, false); + await resetThreshold(); + await stakeValidator(2, false); + await resetThreshold(); + await stakeValidator(2, false); + await resetThreshold(); + }); + + it("Should not reset stake tally if not governor", async () => { + const { josh, nativeStakingSSVStrategy } = fixture; + + await expect( + nativeStakingSSVStrategy.connect(josh).resetStakeETHTally() + ).to.be.revertedWith("Caller is not the Monitor"); + }); + + it("Should not set stake threshold if not governor", async () => { + const { josh, nativeStakingSSVStrategy } = fixture; + + await expect( + nativeStakingSSVStrategy + .connect(josh) + .setStakeETHThreshold(ethUnits("32")) + ).to.be.revertedWith("Caller is not the Governor"); + }); + }); + it("Deposit alternate deposit_data_root ", async () => { const { depositContractUtils } = fixture; diff --git a/contracts/test/strategies/ousd-metapool-balanced-pool.fork-test.js b/contracts/test/strategies/ousd-metapool-balanced-pool.fork-test.js index 1cfac51a8f..5267a2f62e 100644 --- a/contracts/test/strategies/ousd-metapool-balanced-pool.fork-test.js +++ b/contracts/test/strategies/ousd-metapool-balanced-pool.fork-test.js @@ -80,7 +80,7 @@ describe("ForkTest: Convex 3pool/OUSD Meta Strategy - Balanced Metapool", functi const currentBalance = await ousd.connect(anna).balanceOf(anna.address); // Now try to redeem the amount - const redeemAmount = ousdUnits("29990"); + const redeemAmount = ousdUnits("29900"); await vault.connect(anna).redeem(redeemAmount, 0); // User balance should be down by 30k diff --git a/contracts/utils/addresses.js b/contracts/utils/addresses.js index 9e99c8e283..c1d5e42395 100644 --- a/contracts/utils/addresses.js +++ b/contracts/utils/addresses.js @@ -126,7 +126,7 @@ addresses.mainnet.ccipWoethTokenPool = // WETH Token addresses.mainnet.WETH = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"; // Deployed OUSD contracts -addresses.mainnet.Guardian = "0xbe2AB3d3d8F6a32b96414ebbd865dBD276d3d899"; // ERC 20 owner multisig. +addresses.mainnet.Guardian = "0xbe2AB3d3d8F6a32b96414ebbd865dBD276d3d899"; // 5/8 multisig. addresses.mainnet.VaultProxy = "0xE75D77B1865Ae93c7eaa3040B038D7aA7BC02F70"; addresses.mainnet.Vault = "0xf251Cb9129fdb7e9Ca5cad097dE3eA70caB9d8F9"; addresses.mainnet.OUSDProxy = "0x2A8e1E676Ec238d8A992307B495b45B3fEAa5e86"; @@ -279,8 +279,12 @@ addresses.holesky.NativeStakingSSVStrategyProxy = "0xcf4a9e80Ddb173cc17128A361B98B9A140e3932E"; addresses.holesky.OETHVaultProxy = "0x19d2bAaBA949eFfa163bFB9efB53ed8701aA5dD9"; + +addresses.holesky.Governor = "0x1b94CA50D3Ad9f8368851F8526132272d1a5028C"; // Address of the Holesky defender relayer addresses.holesky.validatorRegistrator = "0x3C6B0c7835a2E2E0A45889F64DcE4ee14c1D5CB4"; +// Address of the Holesky defender relayer +addresses.holesky.Guardian = "0x3C6B0c7835a2E2E0A45889F64DcE4ee14c1D5CB4"; module.exports = addresses;