diff --git a/.circleci/config.yml b/.circleci/config.yml index 3ff2b9a7..9a113fb1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -113,7 +113,7 @@ jobs: command: | circleci tests glob 'test/**/*.test.js' | circleci tests split | - xargs yarn coverage --testfiles + xargs -I {} yarn coverage --testfiles "{}" - run: name: Upload coverage command: | diff --git a/.openzeppelin/mainnet.json b/.openzeppelin/mainnet.json index 86495f11..23e71950 100644 --- a/.openzeppelin/mainnet.json +++ b/.openzeppelin/mainnet.json @@ -2,45 +2,7 @@ "manifestVersion": "3.2", "admin": { "address": "0x4A09D1f7abB11b6e29c5b1cA639d092F687c3827", - "txHash": "0xd2df25e396c492cb17be180105086837cbab798dbc0dc7300a104eb067ef24dd", - "deployTransaction": { - "hash": "0xd2df25e396c492cb17be180105086837cbab798dbc0dc7300a104eb067ef24dd", - "type": 2, - "accessList": [], - "blockHash": null, - "blockNumber": null, - "transactionIndex": null, - "confirmations": 0, - "from": "0x9e42Ad694d5C4c5510217c657C992FEAA9b3C382", - "gasPrice": { - "type": "BigNumber", - "hex": "0x03c68832bd" - }, - "maxPriorityFeePerGas": { - "type": "BigNumber", - "hex": "0x77359400" - }, - "maxFeePerGas": { - "type": "BigNumber", - "hex": "0x03c68832bd" - }, - "gasLimit": { - "type": "BigNumber", - "hex": "0x0762b4" - }, - "to": null, - "value": { - "type": "BigNumber", - "hex": "0x00" - }, - "nonce": 3, - "data": "0x608060405234801561001057600080fd5b50600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350610759806100616000396000f3fe60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead146101645761007b565b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b366004610515565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee366004610554565b610292565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f36600461058c565b61031c565b34801561013057600080fd5b506100d161013f366004610554565b6103ad565b34801561015057600080fd5b506100d161015f366004610515565b610405565b34801561017057600080fd5b506100a061017f366004610515565b6104ef565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d9190610538565b949350505050565b6000546001600160a01b031633146102485760405162461bcd60e51b815260040161023f906106c0565b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146102bc5760405162461bcd60e51b815260040161023f906106c0565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b15801561030057600080fd5b505af1158015610314573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146103465760405162461bcd60e51b815260040161023f906106c0565b60405163278f794360e11b81526001600160a01b03841690634f1ef286903490610376908690869060040161065d565b6000604051808303818588803b15801561038f57600080fd5b505af11580156103a3573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146103d75760405162461bcd60e51b815260040161023f906106c0565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe6906024016102e6565b6000546001600160a01b0316331461042f5760405162461bcd60e51b815260040161023f906106c0565b6001600160a01b0381166104945760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023f565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b600060208284031215610526578081fd5b81356105318161070b565b9392505050565b600060208284031215610549578081fd5b81516105318161070b565b60008060408385031215610566578081fd5b82356105718161070b565b915060208301356105818161070b565b809150509250929050565b6000806000606084860312156105a0578081fd5b83356105ab8161070b565b925060208401356105bb8161070b565b9150604084013567ffffffffffffffff808211156105d7578283fd5b818601915086601f8301126105ea578283fd5b8135818111156105fc576105fc6106f5565b604051601f8201601f19908116603f01168101908382118183101715610624576106246106f5565b8160405282815289602084870101111561063c578586fd5b82602086016020830137856020848301015280955050505050509250925092565b600060018060a01b038416825260206040818401528351806040850152825b818110156106985785810183015185820160600152820161067c565b818111156106a95783606083870101525b50601f01601f191692909201606001949350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461072057600080fd5b5056fea2646970667358221220d849f96f3086b9f82cdcf665adb8c697ace05638da1c7c16ab2d26293717af6764736f6c63430008020033", - "r": "0xd7d428d8d97b630a52ddb3b496f9bc1ffe195818b4abf04559bfc3c8db419f05", - "s": "0x6898ece768bff6b43e84e92dc491d21876f4c5d3c94eb8e8365719b499562f6a", - "v": 0, - "creates": "0x4A09D1f7abB11b6e29c5b1cA639d092F687c3827", - "chainId": 1 - } + "txHash": "0xd2df25e396c492cb17be180105086837cbab798dbc0dc7300a104eb067ef24dd" }, "proxies": [ { @@ -1559,6 +1521,824 @@ } } } + }, + "7fd6ce2334cde0676b0b2647e133a232483e5ff5295e190fdfb68460e14e4fe6": { + "address": "0x9E6631d118C28b3d61c68F14FF30a99f7e91963a", + "txHash": "0xc98d6ef0cb814086d04bad9c6d4596ad2f2d7d4ac05fd409d5bf28e166c2bf77", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30" + }, + { + "contract": "ContextUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:31" + }, + { + "contract": "PausableUpgradeable", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:28" + }, + { + "contract": "PausableUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:96" + }, + { + "contract": "AccessControlUpgradeable", + "label": "_roles", + "type": "t_mapping(t_bytes32,t_struct(RoleData)39_storage)", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:61" + }, + { + "contract": "AccessControlUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:225" + }, + { + "contract": "ERC20Upgradeable", + "label": "_allowances", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts/tokens/ERC20Upgradeable.sol:38" + }, + { + "contract": "ERC20Upgradeable", + "label": "_name", + "type": "t_string_storage", + "src": "contracts/tokens/ERC20Upgradeable.sol:40" + }, + { + "contract": "ERC20Upgradeable", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts/tokens/ERC20Upgradeable.sol:41" + }, + { + "contract": "ERC20Upgradeable", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts/tokens/ERC20Upgradeable.sol:42" + }, + { + "contract": "ERC20Upgradeable", + "label": "__gap", + "type": "t_array(t_uint256)44_storage", + "src": "contracts/tokens/ERC20Upgradeable.sol:225" + }, + { + "contract": "EIP712Upgradeable", + "label": "_HASHED_NAME", + "type": "t_bytes32", + "src": "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol:27" + }, + { + "contract": "EIP712Upgradeable", + "label": "_HASHED_VERSION", + "type": "t_bytes32", + "src": "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol:28" + }, + { + "contract": "EIP712Upgradeable", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol:120" + }, + { + "contract": "ERC20PermitUpgradeable", + "label": "_nonces", + "type": "t_mapping(t_address,t_struct(Counter)1701_storage)", + "src": "contracts/tokens/ERC20PermitUpgradeable.sol:26" + }, + { + "contract": "ERC20PermitUpgradeable", + "label": "_PERMIT_TYPEHASH", + "type": "t_bytes32", + "src": "contracts/tokens/ERC20PermitUpgradeable.sol:29" + }, + { + "contract": "ERC20PermitUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "contracts/tokens/ERC20PermitUpgradeable.sol:88" + }, + { + "contract": "RewardEthToken", + "label": "stakedEthToken", + "type": "t_contract(IStakedEthToken)6059", + "src": "contracts/tokens/RewardEthToken.sol:26" + }, + { + "contract": "RewardEthToken", + "label": "oracles", + "type": "t_address", + "src": "contracts/tokens/RewardEthToken.sol:29" + }, + { + "contract": "RewardEthToken", + "label": "checkpoints", + "type": "t_mapping(t_address,t_struct(Checkpoint)5805_storage)", + "src": "contracts/tokens/RewardEthToken.sol:32" + }, + { + "contract": "RewardEthToken", + "label": "protocolFeeRecipient", + "type": "t_address", + "src": "contracts/tokens/RewardEthToken.sol:35" + }, + { + "contract": "RewardEthToken", + "label": "protocolFee", + "type": "t_uint256", + "src": "contracts/tokens/RewardEthToken.sol:38" + }, + { + "contract": "RewardEthToken", + "label": "totalRewards", + "type": "t_uint128", + "src": "contracts/tokens/RewardEthToken.sol:41" + }, + { + "contract": "RewardEthToken", + "label": "rewardPerToken", + "type": "t_uint128", + "src": "contracts/tokens/RewardEthToken.sol:44" + }, + { + "contract": "RewardEthToken", + "label": "lastUpdateBlockNumber", + "type": "t_uint256", + "src": "contracts/tokens/RewardEthToken.sol:47" + }, + { + "contract": "RewardEthToken", + "label": "merkleDistributor", + "type": "t_address", + "src": "contracts/tokens/RewardEthToken.sol:50" + }, + { + "contract": "RewardEthToken", + "label": "rewardsDisabled", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts/tokens/RewardEthToken.sol:53" + }, + { + "contract": "RewardEthToken", + "label": "whiteListManager", + "type": "t_contract(IWhiteListManager)6122", + "src": "contracts/tokens/RewardEthToken.sol:56" + }, + { + "contract": "RewardEthToken", + "label": "feesEscrow", + "type": "t_contract(IFeesEscrow)5070", + "src": "contracts/tokens/RewardEthToken.sol:59" + } + ], + "types": { + "t_contract(IStakedEthToken)6059": { + "label": "contract IStakedEthToken" + }, + "t_address": { + "label": "address" + }, + "t_mapping(t_address,t_struct(Checkpoint)5805_storage)": { + "label": "mapping(address => struct IRewardEthToken.Checkpoint)" + }, + "t_struct(Checkpoint)5805_storage": { + "label": "struct IRewardEthToken.Checkpoint", + "members": [ + { + "label": "reward", + "type": "t_uint128" + }, + { + "label": "rewardPerToken", + "type": "t_uint128" + } + ] + }, + "t_uint128": { + "label": "uint128" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(IWhiteListManager)6122": { + "label": "contract IWhiteListManager" + }, + "t_contract(IFeesEscrow)5070": { + "label": "contract IFeesEscrow" + }, + "t_mapping(t_address,t_struct(Counter)1701_storage)": { + "label": "mapping(address => struct CountersUpgradeable.Counter)" + }, + "t_struct(Counter)1701_storage": { + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "label": "_value", + "type": "t_uint256" + } + ] + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_array(t_uint256)44_storage": { + "label": "uint256[44]" + }, + "t_mapping(t_bytes32,t_struct(RoleData)39_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)" + }, + "t_struct(RoleData)39_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_struct(AddressSet)2017_storage" + }, + { + "label": "adminRole", + "type": "t_bytes32" + } + ] + }, + "t_struct(AddressSet)2017_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)1752_storage" + } + ] + }, + "t_struct(Set)1752_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ] + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)" + } + } + } + }, + "83177ed02c0ca3c0e4fa134c74b7e2eeb24aace613a5f2c56b54b64c29577aa1": { + "address": "0x822f08EaAf73156fe255D49827D048b8Ef7B86B2", + "txHash": "0x8d05c28436897f18c8a6a5ad1d83a571f2b3f95e6712d79779c861304b54e04b", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30" + }, + { + "contract": "ContextUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:31" + }, + { + "contract": "PausableUpgradeable", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:28" + }, + { + "contract": "PausableUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:96" + }, + { + "contract": "AccessControlUpgradeable", + "label": "_roles", + "type": "t_mapping(t_bytes32,t_struct(RoleData)39_storage)", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:61" + }, + { + "contract": "AccessControlUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:225" + }, + { + "contract": "Pool", + "label": "activatedValidators", + "type": "t_uint256", + "src": "contracts/pool/Pool.sol:26" + }, + { + "contract": "Pool", + "label": "withdrawalCredentials", + "type": "t_bytes32", + "src": "contracts/pool/Pool.sol:29" + }, + { + "contract": "Pool", + "label": "validatorRegistration", + "type": "t_contract(IDepositContract)5055", + "src": "contracts/pool/Pool.sol:32" + }, + { + "contract": "Pool", + "label": "stakedEthToken", + "type": "t_contract(IStakedEthToken)6059", + "src": "contracts/pool/Pool.sol:35" + }, + { + "contract": "Pool", + "label": "validators", + "type": "t_contract(IPoolValidators)5793", + "src": "contracts/pool/Pool.sol:38" + }, + { + "contract": "Pool", + "label": "oracles", + "type": "t_address", + "src": "contracts/pool/Pool.sol:41" + }, + { + "contract": "Pool", + "label": "whiteListManager", + "type": "t_contract(IWhiteListManager)6122", + "src": "contracts/pool/Pool.sol:44" + }, + { + "contract": "Pool", + "label": "activations", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))", + "src": "contracts/pool/Pool.sol:47" + }, + { + "contract": "Pool", + "label": "pendingValidators", + "type": "t_uint256", + "src": "contracts/pool/Pool.sol:50" + }, + { + "contract": "Pool", + "label": "minActivatingDeposit", + "type": "t_uint256", + "src": "contracts/pool/Pool.sol:53" + }, + { + "contract": "Pool", + "label": "pendingValidatorsLimit", + "type": "t_uint256", + "src": "contracts/pool/Pool.sol:56" + } + ], + "types": { + "t_uint256": { + "label": "uint256" + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_contract(IDepositContract)5055": { + "label": "contract IDepositContract" + }, + "t_contract(IStakedEthToken)6059": { + "label": "contract IStakedEthToken" + }, + "t_contract(IPoolValidators)5793": { + "label": "contract IPoolValidators" + }, + "t_address": { + "label": "address" + }, + "t_contract(IWhiteListManager)6122": { + "label": "contract IWhiteListManager" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_uint256))": { + "label": "mapping(address => mapping(uint256 => uint256))" + }, + "t_mapping(t_uint256,t_uint256)": { + "label": "mapping(uint256 => uint256)" + }, + "t_mapping(t_bytes32,t_struct(RoleData)39_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)" + }, + "t_struct(RoleData)39_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_struct(AddressSet)2017_storage" + }, + { + "label": "adminRole", + "type": "t_bytes32" + } + ] + }, + "t_struct(AddressSet)2017_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)1752_storage" + } + ] + }, + "t_struct(Set)1752_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ] + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_bool": { + "label": "bool" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + } + } + } + }, + "adec22e85a9f029911971aa406f0e031cd90ba13be41cce9d5b5615181a321eb": { + "address": "0x6FFa613eD41585B1c1e517A78d140cFBD68be639", + "txHash": "0xf3310d46fa205260d5a1d900a7ae6b5c93a1bee08a85a9df11279b226699a550", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30" + }, + { + "contract": "ContextUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:31" + }, + { + "contract": "PausableUpgradeable", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:28" + }, + { + "contract": "PausableUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:96" + }, + { + "contract": "AccessControlUpgradeable", + "label": "_roles", + "type": "t_mapping(t_bytes32,t_struct(RoleData)39_storage)", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:61" + }, + { + "contract": "AccessControlUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:225" + }, + { + "contract": "ERC20Upgradeable", + "label": "_allowances", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts/tokens/ERC20Upgradeable.sol:38" + }, + { + "contract": "ERC20Upgradeable", + "label": "_name", + "type": "t_string_storage", + "src": "contracts/tokens/ERC20Upgradeable.sol:40" + }, + { + "contract": "ERC20Upgradeable", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts/tokens/ERC20Upgradeable.sol:41" + }, + { + "contract": "ERC20Upgradeable", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts/tokens/ERC20Upgradeable.sol:42" + }, + { + "contract": "ERC20Upgradeable", + "label": "__gap", + "type": "t_array(t_uint256)44_storage", + "src": "contracts/tokens/ERC20Upgradeable.sol:225" + }, + { + "contract": "EIP712Upgradeable", + "label": "_HASHED_NAME", + "type": "t_bytes32", + "src": "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol:27" + }, + { + "contract": "EIP712Upgradeable", + "label": "_HASHED_VERSION", + "type": "t_bytes32", + "src": "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol:28" + }, + { + "contract": "EIP712Upgradeable", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol:120" + }, + { + "contract": "ERC20PermitUpgradeable", + "label": "_nonces", + "type": "t_mapping(t_address,t_struct(Counter)1701_storage)", + "src": "contracts/tokens/ERC20PermitUpgradeable.sol:26" + }, + { + "contract": "ERC20PermitUpgradeable", + "label": "_PERMIT_TYPEHASH", + "type": "t_bytes32", + "src": "contracts/tokens/ERC20PermitUpgradeable.sol:29" + }, + { + "contract": "ERC20PermitUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "contracts/tokens/ERC20PermitUpgradeable.sol:88" + }, + { + "contract": "RewardEthToken", + "label": "stakedEthToken", + "type": "t_contract(IStakedEthToken)6059", + "src": "contracts/tokens/RewardEthToken.sol:26" + }, + { + "contract": "RewardEthToken", + "label": "oracles", + "type": "t_address", + "src": "contracts/tokens/RewardEthToken.sol:29" + }, + { + "contract": "RewardEthToken", + "label": "checkpoints", + "type": "t_mapping(t_address,t_struct(Checkpoint)5805_storage)", + "src": "contracts/tokens/RewardEthToken.sol:32" + }, + { + "contract": "RewardEthToken", + "label": "protocolFeeRecipient", + "type": "t_address", + "src": "contracts/tokens/RewardEthToken.sol:35" + }, + { + "contract": "RewardEthToken", + "label": "protocolFee", + "type": "t_uint256", + "src": "contracts/tokens/RewardEthToken.sol:38" + }, + { + "contract": "RewardEthToken", + "label": "totalRewards", + "type": "t_uint128", + "src": "contracts/tokens/RewardEthToken.sol:41" + }, + { + "contract": "RewardEthToken", + "label": "rewardPerToken", + "type": "t_uint128", + "src": "contracts/tokens/RewardEthToken.sol:44" + }, + { + "contract": "RewardEthToken", + "label": "lastUpdateBlockNumber", + "type": "t_uint256", + "src": "contracts/tokens/RewardEthToken.sol:47" + }, + { + "contract": "RewardEthToken", + "label": "merkleDistributor", + "type": "t_address", + "src": "contracts/tokens/RewardEthToken.sol:50" + }, + { + "contract": "RewardEthToken", + "label": "rewardsDisabled", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts/tokens/RewardEthToken.sol:53" + }, + { + "contract": "RewardEthToken", + "label": "whiteListManager", + "type": "t_contract(IWhiteListManager)6122", + "src": "contracts/tokens/RewardEthToken.sol:56" + }, + { + "contract": "RewardEthToken", + "label": "feesEscrow", + "type": "t_contract(IFeesEscrow)5070", + "src": "contracts/tokens/RewardEthToken.sol:59" + } + ], + "types": { + "t_contract(IStakedEthToken)6059": { + "label": "contract IStakedEthToken" + }, + "t_address": { + "label": "address" + }, + "t_mapping(t_address,t_struct(Checkpoint)5805_storage)": { + "label": "mapping(address => struct IRewardEthToken.Checkpoint)" + }, + "t_struct(Checkpoint)5805_storage": { + "label": "struct IRewardEthToken.Checkpoint", + "members": [ + { + "label": "reward", + "type": "t_uint128" + }, + { + "label": "rewardPerToken", + "type": "t_uint128" + } + ] + }, + "t_uint128": { + "label": "uint128" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(IWhiteListManager)6122": { + "label": "contract IWhiteListManager" + }, + "t_contract(IFeesEscrow)5070": { + "label": "contract IFeesEscrow" + }, + "t_mapping(t_address,t_struct(Counter)1701_storage)": { + "label": "mapping(address => struct CountersUpgradeable.Counter)" + }, + "t_struct(Counter)1701_storage": { + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "label": "_value", + "type": "t_uint256" + } + ] + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_array(t_uint256)44_storage": { + "label": "uint256[44]" + }, + "t_mapping(t_bytes32,t_struct(RoleData)39_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)" + }, + "t_struct(RoleData)39_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_struct(AddressSet)2017_storage" + }, + { + "label": "adminRole", + "type": "t_bytes32" + } + ] + }, + "t_struct(AddressSet)2017_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)1752_storage" + } + ] + }, + "t_struct(Set)1752_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ] + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)" + } + } + } } } } diff --git a/.openzeppelin/unknown-31337.json b/.openzeppelin/unknown-31337.json index 86495f11..23e71950 100644 --- a/.openzeppelin/unknown-31337.json +++ b/.openzeppelin/unknown-31337.json @@ -2,45 +2,7 @@ "manifestVersion": "3.2", "admin": { "address": "0x4A09D1f7abB11b6e29c5b1cA639d092F687c3827", - "txHash": "0xd2df25e396c492cb17be180105086837cbab798dbc0dc7300a104eb067ef24dd", - "deployTransaction": { - "hash": "0xd2df25e396c492cb17be180105086837cbab798dbc0dc7300a104eb067ef24dd", - "type": 2, - "accessList": [], - "blockHash": null, - "blockNumber": null, - "transactionIndex": null, - "confirmations": 0, - "from": "0x9e42Ad694d5C4c5510217c657C992FEAA9b3C382", - "gasPrice": { - "type": "BigNumber", - "hex": "0x03c68832bd" - }, - "maxPriorityFeePerGas": { - "type": "BigNumber", - "hex": "0x77359400" - }, - "maxFeePerGas": { - "type": "BigNumber", - "hex": "0x03c68832bd" - }, - "gasLimit": { - "type": "BigNumber", - "hex": "0x0762b4" - }, - "to": null, - "value": { - "type": "BigNumber", - "hex": "0x00" - }, - "nonce": 3, - "data": "0x608060405234801561001057600080fd5b50600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350610759806100616000396000f3fe60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead146101645761007b565b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b366004610515565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee366004610554565b610292565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f36600461058c565b61031c565b34801561013057600080fd5b506100d161013f366004610554565b6103ad565b34801561015057600080fd5b506100d161015f366004610515565b610405565b34801561017057600080fd5b506100a061017f366004610515565b6104ef565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d9190610538565b949350505050565b6000546001600160a01b031633146102485760405162461bcd60e51b815260040161023f906106c0565b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146102bc5760405162461bcd60e51b815260040161023f906106c0565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b15801561030057600080fd5b505af1158015610314573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146103465760405162461bcd60e51b815260040161023f906106c0565b60405163278f794360e11b81526001600160a01b03841690634f1ef286903490610376908690869060040161065d565b6000604051808303818588803b15801561038f57600080fd5b505af11580156103a3573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146103d75760405162461bcd60e51b815260040161023f906106c0565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe6906024016102e6565b6000546001600160a01b0316331461042f5760405162461bcd60e51b815260040161023f906106c0565b6001600160a01b0381166104945760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023f565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b600060208284031215610526578081fd5b81356105318161070b565b9392505050565b600060208284031215610549578081fd5b81516105318161070b565b60008060408385031215610566578081fd5b82356105718161070b565b915060208301356105818161070b565b809150509250929050565b6000806000606084860312156105a0578081fd5b83356105ab8161070b565b925060208401356105bb8161070b565b9150604084013567ffffffffffffffff808211156105d7578283fd5b818601915086601f8301126105ea578283fd5b8135818111156105fc576105fc6106f5565b604051601f8201601f19908116603f01168101908382118183101715610624576106246106f5565b8160405282815289602084870101111561063c578586fd5b82602086016020830137856020848301015280955050505050509250925092565b600060018060a01b038416825260206040818401528351806040850152825b818110156106985785810183015185820160600152820161067c565b818111156106a95783606083870101525b50601f01601f191692909201606001949350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461072057600080fd5b5056fea2646970667358221220d849f96f3086b9f82cdcf665adb8c697ace05638da1c7c16ab2d26293717af6764736f6c63430008020033", - "r": "0xd7d428d8d97b630a52ddb3b496f9bc1ffe195818b4abf04559bfc3c8db419f05", - "s": "0x6898ece768bff6b43e84e92dc491d21876f4c5d3c94eb8e8365719b499562f6a", - "v": 0, - "creates": "0x4A09D1f7abB11b6e29c5b1cA639d092F687c3827", - "chainId": 1 - } + "txHash": "0xd2df25e396c492cb17be180105086837cbab798dbc0dc7300a104eb067ef24dd" }, "proxies": [ { @@ -1559,6 +1521,824 @@ } } } + }, + "7fd6ce2334cde0676b0b2647e133a232483e5ff5295e190fdfb68460e14e4fe6": { + "address": "0x9E6631d118C28b3d61c68F14FF30a99f7e91963a", + "txHash": "0xc98d6ef0cb814086d04bad9c6d4596ad2f2d7d4ac05fd409d5bf28e166c2bf77", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30" + }, + { + "contract": "ContextUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:31" + }, + { + "contract": "PausableUpgradeable", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:28" + }, + { + "contract": "PausableUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:96" + }, + { + "contract": "AccessControlUpgradeable", + "label": "_roles", + "type": "t_mapping(t_bytes32,t_struct(RoleData)39_storage)", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:61" + }, + { + "contract": "AccessControlUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:225" + }, + { + "contract": "ERC20Upgradeable", + "label": "_allowances", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts/tokens/ERC20Upgradeable.sol:38" + }, + { + "contract": "ERC20Upgradeable", + "label": "_name", + "type": "t_string_storage", + "src": "contracts/tokens/ERC20Upgradeable.sol:40" + }, + { + "contract": "ERC20Upgradeable", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts/tokens/ERC20Upgradeable.sol:41" + }, + { + "contract": "ERC20Upgradeable", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts/tokens/ERC20Upgradeable.sol:42" + }, + { + "contract": "ERC20Upgradeable", + "label": "__gap", + "type": "t_array(t_uint256)44_storage", + "src": "contracts/tokens/ERC20Upgradeable.sol:225" + }, + { + "contract": "EIP712Upgradeable", + "label": "_HASHED_NAME", + "type": "t_bytes32", + "src": "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol:27" + }, + { + "contract": "EIP712Upgradeable", + "label": "_HASHED_VERSION", + "type": "t_bytes32", + "src": "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol:28" + }, + { + "contract": "EIP712Upgradeable", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol:120" + }, + { + "contract": "ERC20PermitUpgradeable", + "label": "_nonces", + "type": "t_mapping(t_address,t_struct(Counter)1701_storage)", + "src": "contracts/tokens/ERC20PermitUpgradeable.sol:26" + }, + { + "contract": "ERC20PermitUpgradeable", + "label": "_PERMIT_TYPEHASH", + "type": "t_bytes32", + "src": "contracts/tokens/ERC20PermitUpgradeable.sol:29" + }, + { + "contract": "ERC20PermitUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "contracts/tokens/ERC20PermitUpgradeable.sol:88" + }, + { + "contract": "RewardEthToken", + "label": "stakedEthToken", + "type": "t_contract(IStakedEthToken)6059", + "src": "contracts/tokens/RewardEthToken.sol:26" + }, + { + "contract": "RewardEthToken", + "label": "oracles", + "type": "t_address", + "src": "contracts/tokens/RewardEthToken.sol:29" + }, + { + "contract": "RewardEthToken", + "label": "checkpoints", + "type": "t_mapping(t_address,t_struct(Checkpoint)5805_storage)", + "src": "contracts/tokens/RewardEthToken.sol:32" + }, + { + "contract": "RewardEthToken", + "label": "protocolFeeRecipient", + "type": "t_address", + "src": "contracts/tokens/RewardEthToken.sol:35" + }, + { + "contract": "RewardEthToken", + "label": "protocolFee", + "type": "t_uint256", + "src": "contracts/tokens/RewardEthToken.sol:38" + }, + { + "contract": "RewardEthToken", + "label": "totalRewards", + "type": "t_uint128", + "src": "contracts/tokens/RewardEthToken.sol:41" + }, + { + "contract": "RewardEthToken", + "label": "rewardPerToken", + "type": "t_uint128", + "src": "contracts/tokens/RewardEthToken.sol:44" + }, + { + "contract": "RewardEthToken", + "label": "lastUpdateBlockNumber", + "type": "t_uint256", + "src": "contracts/tokens/RewardEthToken.sol:47" + }, + { + "contract": "RewardEthToken", + "label": "merkleDistributor", + "type": "t_address", + "src": "contracts/tokens/RewardEthToken.sol:50" + }, + { + "contract": "RewardEthToken", + "label": "rewardsDisabled", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts/tokens/RewardEthToken.sol:53" + }, + { + "contract": "RewardEthToken", + "label": "whiteListManager", + "type": "t_contract(IWhiteListManager)6122", + "src": "contracts/tokens/RewardEthToken.sol:56" + }, + { + "contract": "RewardEthToken", + "label": "feesEscrow", + "type": "t_contract(IFeesEscrow)5070", + "src": "contracts/tokens/RewardEthToken.sol:59" + } + ], + "types": { + "t_contract(IStakedEthToken)6059": { + "label": "contract IStakedEthToken" + }, + "t_address": { + "label": "address" + }, + "t_mapping(t_address,t_struct(Checkpoint)5805_storage)": { + "label": "mapping(address => struct IRewardEthToken.Checkpoint)" + }, + "t_struct(Checkpoint)5805_storage": { + "label": "struct IRewardEthToken.Checkpoint", + "members": [ + { + "label": "reward", + "type": "t_uint128" + }, + { + "label": "rewardPerToken", + "type": "t_uint128" + } + ] + }, + "t_uint128": { + "label": "uint128" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(IWhiteListManager)6122": { + "label": "contract IWhiteListManager" + }, + "t_contract(IFeesEscrow)5070": { + "label": "contract IFeesEscrow" + }, + "t_mapping(t_address,t_struct(Counter)1701_storage)": { + "label": "mapping(address => struct CountersUpgradeable.Counter)" + }, + "t_struct(Counter)1701_storage": { + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "label": "_value", + "type": "t_uint256" + } + ] + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_array(t_uint256)44_storage": { + "label": "uint256[44]" + }, + "t_mapping(t_bytes32,t_struct(RoleData)39_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)" + }, + "t_struct(RoleData)39_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_struct(AddressSet)2017_storage" + }, + { + "label": "adminRole", + "type": "t_bytes32" + } + ] + }, + "t_struct(AddressSet)2017_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)1752_storage" + } + ] + }, + "t_struct(Set)1752_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ] + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)" + } + } + } + }, + "83177ed02c0ca3c0e4fa134c74b7e2eeb24aace613a5f2c56b54b64c29577aa1": { + "address": "0x822f08EaAf73156fe255D49827D048b8Ef7B86B2", + "txHash": "0x8d05c28436897f18c8a6a5ad1d83a571f2b3f95e6712d79779c861304b54e04b", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30" + }, + { + "contract": "ContextUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:31" + }, + { + "contract": "PausableUpgradeable", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:28" + }, + { + "contract": "PausableUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:96" + }, + { + "contract": "AccessControlUpgradeable", + "label": "_roles", + "type": "t_mapping(t_bytes32,t_struct(RoleData)39_storage)", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:61" + }, + { + "contract": "AccessControlUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:225" + }, + { + "contract": "Pool", + "label": "activatedValidators", + "type": "t_uint256", + "src": "contracts/pool/Pool.sol:26" + }, + { + "contract": "Pool", + "label": "withdrawalCredentials", + "type": "t_bytes32", + "src": "contracts/pool/Pool.sol:29" + }, + { + "contract": "Pool", + "label": "validatorRegistration", + "type": "t_contract(IDepositContract)5055", + "src": "contracts/pool/Pool.sol:32" + }, + { + "contract": "Pool", + "label": "stakedEthToken", + "type": "t_contract(IStakedEthToken)6059", + "src": "contracts/pool/Pool.sol:35" + }, + { + "contract": "Pool", + "label": "validators", + "type": "t_contract(IPoolValidators)5793", + "src": "contracts/pool/Pool.sol:38" + }, + { + "contract": "Pool", + "label": "oracles", + "type": "t_address", + "src": "contracts/pool/Pool.sol:41" + }, + { + "contract": "Pool", + "label": "whiteListManager", + "type": "t_contract(IWhiteListManager)6122", + "src": "contracts/pool/Pool.sol:44" + }, + { + "contract": "Pool", + "label": "activations", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))", + "src": "contracts/pool/Pool.sol:47" + }, + { + "contract": "Pool", + "label": "pendingValidators", + "type": "t_uint256", + "src": "contracts/pool/Pool.sol:50" + }, + { + "contract": "Pool", + "label": "minActivatingDeposit", + "type": "t_uint256", + "src": "contracts/pool/Pool.sol:53" + }, + { + "contract": "Pool", + "label": "pendingValidatorsLimit", + "type": "t_uint256", + "src": "contracts/pool/Pool.sol:56" + } + ], + "types": { + "t_uint256": { + "label": "uint256" + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_contract(IDepositContract)5055": { + "label": "contract IDepositContract" + }, + "t_contract(IStakedEthToken)6059": { + "label": "contract IStakedEthToken" + }, + "t_contract(IPoolValidators)5793": { + "label": "contract IPoolValidators" + }, + "t_address": { + "label": "address" + }, + "t_contract(IWhiteListManager)6122": { + "label": "contract IWhiteListManager" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_uint256))": { + "label": "mapping(address => mapping(uint256 => uint256))" + }, + "t_mapping(t_uint256,t_uint256)": { + "label": "mapping(uint256 => uint256)" + }, + "t_mapping(t_bytes32,t_struct(RoleData)39_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)" + }, + "t_struct(RoleData)39_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_struct(AddressSet)2017_storage" + }, + { + "label": "adminRole", + "type": "t_bytes32" + } + ] + }, + "t_struct(AddressSet)2017_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)1752_storage" + } + ] + }, + "t_struct(Set)1752_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ] + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_bool": { + "label": "bool" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + } + } + } + }, + "adec22e85a9f029911971aa406f0e031cd90ba13be41cce9d5b5615181a321eb": { + "address": "0x6FFa613eD41585B1c1e517A78d140cFBD68be639", + "txHash": "0xf3310d46fa205260d5a1d900a7ae6b5c93a1bee08a85a9df11279b226699a550", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30" + }, + { + "contract": "ContextUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:31" + }, + { + "contract": "PausableUpgradeable", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:28" + }, + { + "contract": "PausableUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:96" + }, + { + "contract": "AccessControlUpgradeable", + "label": "_roles", + "type": "t_mapping(t_bytes32,t_struct(RoleData)39_storage)", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:61" + }, + { + "contract": "AccessControlUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:225" + }, + { + "contract": "ERC20Upgradeable", + "label": "_allowances", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts/tokens/ERC20Upgradeable.sol:38" + }, + { + "contract": "ERC20Upgradeable", + "label": "_name", + "type": "t_string_storage", + "src": "contracts/tokens/ERC20Upgradeable.sol:40" + }, + { + "contract": "ERC20Upgradeable", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts/tokens/ERC20Upgradeable.sol:41" + }, + { + "contract": "ERC20Upgradeable", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts/tokens/ERC20Upgradeable.sol:42" + }, + { + "contract": "ERC20Upgradeable", + "label": "__gap", + "type": "t_array(t_uint256)44_storage", + "src": "contracts/tokens/ERC20Upgradeable.sol:225" + }, + { + "contract": "EIP712Upgradeable", + "label": "_HASHED_NAME", + "type": "t_bytes32", + "src": "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol:27" + }, + { + "contract": "EIP712Upgradeable", + "label": "_HASHED_VERSION", + "type": "t_bytes32", + "src": "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol:28" + }, + { + "contract": "EIP712Upgradeable", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol:120" + }, + { + "contract": "ERC20PermitUpgradeable", + "label": "_nonces", + "type": "t_mapping(t_address,t_struct(Counter)1701_storage)", + "src": "contracts/tokens/ERC20PermitUpgradeable.sol:26" + }, + { + "contract": "ERC20PermitUpgradeable", + "label": "_PERMIT_TYPEHASH", + "type": "t_bytes32", + "src": "contracts/tokens/ERC20PermitUpgradeable.sol:29" + }, + { + "contract": "ERC20PermitUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "contracts/tokens/ERC20PermitUpgradeable.sol:88" + }, + { + "contract": "RewardEthToken", + "label": "stakedEthToken", + "type": "t_contract(IStakedEthToken)6059", + "src": "contracts/tokens/RewardEthToken.sol:26" + }, + { + "contract": "RewardEthToken", + "label": "oracles", + "type": "t_address", + "src": "contracts/tokens/RewardEthToken.sol:29" + }, + { + "contract": "RewardEthToken", + "label": "checkpoints", + "type": "t_mapping(t_address,t_struct(Checkpoint)5805_storage)", + "src": "contracts/tokens/RewardEthToken.sol:32" + }, + { + "contract": "RewardEthToken", + "label": "protocolFeeRecipient", + "type": "t_address", + "src": "contracts/tokens/RewardEthToken.sol:35" + }, + { + "contract": "RewardEthToken", + "label": "protocolFee", + "type": "t_uint256", + "src": "contracts/tokens/RewardEthToken.sol:38" + }, + { + "contract": "RewardEthToken", + "label": "totalRewards", + "type": "t_uint128", + "src": "contracts/tokens/RewardEthToken.sol:41" + }, + { + "contract": "RewardEthToken", + "label": "rewardPerToken", + "type": "t_uint128", + "src": "contracts/tokens/RewardEthToken.sol:44" + }, + { + "contract": "RewardEthToken", + "label": "lastUpdateBlockNumber", + "type": "t_uint256", + "src": "contracts/tokens/RewardEthToken.sol:47" + }, + { + "contract": "RewardEthToken", + "label": "merkleDistributor", + "type": "t_address", + "src": "contracts/tokens/RewardEthToken.sol:50" + }, + { + "contract": "RewardEthToken", + "label": "rewardsDisabled", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts/tokens/RewardEthToken.sol:53" + }, + { + "contract": "RewardEthToken", + "label": "whiteListManager", + "type": "t_contract(IWhiteListManager)6122", + "src": "contracts/tokens/RewardEthToken.sol:56" + }, + { + "contract": "RewardEthToken", + "label": "feesEscrow", + "type": "t_contract(IFeesEscrow)5070", + "src": "contracts/tokens/RewardEthToken.sol:59" + } + ], + "types": { + "t_contract(IStakedEthToken)6059": { + "label": "contract IStakedEthToken" + }, + "t_address": { + "label": "address" + }, + "t_mapping(t_address,t_struct(Checkpoint)5805_storage)": { + "label": "mapping(address => struct IRewardEthToken.Checkpoint)" + }, + "t_struct(Checkpoint)5805_storage": { + "label": "struct IRewardEthToken.Checkpoint", + "members": [ + { + "label": "reward", + "type": "t_uint128" + }, + { + "label": "rewardPerToken", + "type": "t_uint128" + } + ] + }, + "t_uint128": { + "label": "uint128" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(IWhiteListManager)6122": { + "label": "contract IWhiteListManager" + }, + "t_contract(IFeesEscrow)5070": { + "label": "contract IFeesEscrow" + }, + "t_mapping(t_address,t_struct(Counter)1701_storage)": { + "label": "mapping(address => struct CountersUpgradeable.Counter)" + }, + "t_struct(Counter)1701_storage": { + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "label": "_value", + "type": "t_uint256" + } + ] + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_array(t_uint256)44_storage": { + "label": "uint256[44]" + }, + "t_mapping(t_bytes32,t_struct(RoleData)39_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)" + }, + "t_struct(RoleData)39_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_struct(AddressSet)2017_storage" + }, + { + "label": "adminRole", + "type": "t_bytes32" + } + ] + }, + "t_struct(AddressSet)2017_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)1752_storage" + } + ] + }, + "t_struct(Set)1752_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ] + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)" + } + } + } } } } diff --git a/abi/AccessControlUpgradeable.json b/abi/AccessControlUpgradeable.json new file mode 100644 index 00000000..54cbec42 --- /dev/null +++ b/abi/AccessControlUpgradeable.json @@ -0,0 +1,230 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/IMerkleDistributor.json b/abi/IMerkleDistributor.json new file mode 100644 index 00000000..461b2716 --- /dev/null +++ b/abi/IMerkleDistributor.json @@ -0,0 +1,373 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "Claimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "merkleRoot", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "merkleProofs", + "type": "string" + } + ], + "name": "MerkleRootUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "origin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "rewardsLink", + "type": "string" + } + ], + "name": "OneTimeDistributionAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startBlock", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endBlock", + "type": "uint256" + } + ], + "name": "PeriodicDistributionAdded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "bytes32[]", + "name": "merkleProof", + "type": "bytes32[]" + } + ], + "name": "claim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_merkleRoot", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_wordIndex", + "type": "uint256" + } + ], + "name": "claimedBitMap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "origin", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "string", + "name": "rewardsLink", + "type": "string" + } + ], + "name": "distributeOneTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "durationInBlocks", + "type": "uint256" + } + ], + "name": "distributePeriodically", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + }, + { + "internalType": "address", + "name": "_rewardEthToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_oracles", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "isClaimed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastUpdateBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "merkleRoot", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracles", + "outputs": [ + { + "internalType": "contract IOracles", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardEthToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "newMerkleRoot", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "merkleProofs", + "type": "string" + } + ], + "name": "setMerkleRoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/IOracles.json b/abi/IOracles.json new file mode 100644 index 00000000..b1d60471 --- /dev/null +++ b/abi/IOracles.json @@ -0,0 +1,345 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "oracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "merkleRoot", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "merkleProofs", + "type": "string" + } + ], + "name": "MerkleRootVoteSubmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oracle", + "type": "address" + } + ], + "name": "OracleAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oracle", + "type": "address" + } + ], + "name": "OracleRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "oracles", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "RegisterValidatorsVoteSubmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "oracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "activatedValidators", + "type": "uint256" + } + ], + "name": "RewardsVoteSubmitted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "addOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentRewardsNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentValidatorsNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + }, + { + "internalType": "address", + "name": "_rewardEthToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_pool", + "type": "address" + }, + { + "internalType": "address", + "name": "_poolValidators", + "type": "address" + }, + { + "internalType": "address", + "name": "_merkleDistributor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isMerkleRootVoting", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isOracle", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "withdrawalCredentials", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "depositDataRoot", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "publicKey", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct IPoolValidators.DepositData[]", + "name": "depositData", + "type": "tuple[]" + }, + { + "internalType": "bytes32[][]", + "name": "merkleProofs", + "type": "bytes32[][]" + }, + { + "internalType": "bytes32", + "name": "validatorsDepositRoot", + "type": "bytes32" + }, + { + "internalType": "bytes[]", + "name": "signatures", + "type": "bytes[]" + } + ], + "name": "registerValidators", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "removeOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "merkleRoot", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "merkleProofs", + "type": "string" + }, + { + "internalType": "bytes[]", + "name": "signatures", + "type": "bytes[]" + } + ], + "name": "submitMerkleRoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "totalRewards", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "activatedValidators", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "signatures", + "type": "bytes[]" + } + ], + "name": "submitRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/IPool.json b/abi/IPool.json new file mode 100644 index 00000000..fa680b90 --- /dev/null +++ b/abi/IPool.json @@ -0,0 +1,510 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "validatorIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "Activated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "activatedValidators", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ActivatedValidatorsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "validatorIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "ActivationScheduled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "minActivatingDeposit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "MinActivatingDepositUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "pendingValidatorsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PendingValidatorsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "partner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "StakedWithPartner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "StakedWithReferrer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "publicKey", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "ValidatorRegistered", + "type": "event" + }, + { + "inputs": [], + "name": "VALIDATOR_TOTAL_DEPOSIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "validatorIndex", + "type": "uint256" + } + ], + "name": "activate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "validatorIndexes", + "type": "uint256[]" + } + ], + "name": "activateMultiple", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "activatedValidators", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "validatorIndex", + "type": "uint256" + } + ], + "name": "activations", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "validatorIndex", + "type": "uint256" + } + ], + "name": "canActivate", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minActivatingDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingValidators", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingValidatorsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "receiveFees", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "withdrawalCredentials", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "depositDataRoot", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "publicKey", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct IPoolValidators.DepositData", + "name": "depositData", + "type": "tuple" + } + ], + "name": "registerValidator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newActivatedValidators", + "type": "uint256" + } + ], + "name": "setActivatedValidators", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newMinActivatingDeposit", + "type": "uint256" + } + ], + "name": "setMinActivatingDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newPendingValidatorsLimit", + "type": "uint256" + } + ], + "name": "setPendingValidatorsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stake", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "stakeOnBehalf", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "partner", + "type": "address" + } + ], + "name": "stakeWithPartner", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "partner", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "stakeWithPartnerOnBehalf", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "stakeWithReferrer", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "stakeWithReferrerOnBehalf", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "validatorRegistration", + "outputs": [ + { + "internalType": "contract IDepositContract", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawalCredentials", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/abi/IPoolEscrow.json b/abi/IPoolEscrow.json new file mode 100644 index 00000000..b2f34e03 --- /dev/null +++ b/abi/IPoolEscrow.json @@ -0,0 +1,129 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferApplied", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "currentOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "futureOwner", + "type": "address" + } + ], + "name": "OwnershipTransferCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "payee", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdrawn", + "type": "event" + }, + { + "inputs": [], + "name": "applyOwnershipTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "commitOwnershipTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "futureOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "payee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/IPoolValidators.json b/abi/IPoolValidators.json new file mode 100644 index 00000000..5512a370 --- /dev/null +++ b/abi/IPoolValidators.json @@ -0,0 +1,213 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "depositDataMerkleRoot", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "depositDataMerkleProofs", + "type": "string" + } + ], + "name": "OperatorAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "OperatorCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "OperatorRemoved", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_operator", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "depositDataMerkleRoot", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "depositDataMerkleProofs", + "type": "string" + } + ], + "name": "addOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "commitOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_operator", + "type": "address" + } + ], + "name": "getOperator", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_admin", + "type": "address" + }, + { + "internalType": "address", + "name": "_pool", + "type": "address" + }, + { + "internalType": "address", + "name": "_oracles", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "validatorId", + "type": "bytes32" + } + ], + "name": "isValidatorRegistered", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "withdrawalCredentials", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "depositDataRoot", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "publicKey", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct IPoolValidators.DepositData", + "name": "depositData", + "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "merkleProof", + "type": "bytes32[]" + } + ], + "name": "registerValidator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_operator", + "type": "address" + } + ], + "name": "removeOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/IRewardEthToken.json b/abi/IRewardEthToken.json new file mode 100644 index 00000000..afcbf47b --- /dev/null +++ b/abi/IRewardEthToken.json @@ -0,0 +1,524 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "ProtocolFeeRecipientUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "protocolFee", + "type": "uint256" + } + ], + "name": "ProtocolFeeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isDisabled", + "type": "bool" + } + ], + "name": "RewardsToggled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "periodRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardPerToken", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "distributorReward", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "protocolReward", + "type": "uint256" + } + ], + "name": "RewardsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "checkpoints", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "claim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lastUpdateBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "merkleDistributor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolFeeRecipient", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardPerToken", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "rewardsDisabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_protocolFee", + "type": "uint256" + } + ], + "name": "setProtocolFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "setProtocolFeeRecipient", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bool", + "name": "isDisabled", + "type": "bool" + } + ], + "name": "setRewardsDisabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalRewards", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "updateRewardCheckpoint", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account1", + "type": "address" + }, + { + "internalType": "address", + "name": "account2", + "type": "address" + } + ], + "name": "updateRewardCheckpoints", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newTotalRewards", + "type": "uint256" + } + ], + "name": "updateTotalRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFeesEscrow", + "name": "_feesEscrow", + "type": "address" + } + ], + "name": "upgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/IRoles.json b/abi/IRoles.json new file mode 100644 index 00000000..29fef019 --- /dev/null +++ b/abi/IRoles.json @@ -0,0 +1,141 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "OperatorRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "revenueShare", + "type": "uint256" + } + ], + "name": "OperatorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "partner", + "type": "address" + } + ], + "name": "PartnerRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "partner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "revenueShare", + "type": "uint256" + } + ], + "name": "PartnerUpdated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "removeOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "removePartner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "revenueShare", + "type": "uint256" + } + ], + "name": "setOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "revenueShare", + "type": "uint256" + } + ], + "name": "setPartner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/IStakedEthToken.json b/abi/IStakedEthToken.json new file mode 100644 index 00000000..3b942a2a --- /dev/null +++ b/abi/IStakedEthToken.json @@ -0,0 +1,275 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "distributorPrincipal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + }, + { + "internalType": "address", + "name": "_pool", + "type": "address" + }, + { + "internalType": "address", + "name": "_rewardEthToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_whiteListManager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bool", + "name": "isDisabled", + "type": "bool" + } + ], + "name": "toggleRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalDeposits", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abi/IWhiteListManager.json b/abi/IWhiteListManager.json new file mode 100644 index 00000000..fd0858df --- /dev/null +++ b/abi/IWhiteListManager.json @@ -0,0 +1,142 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "ManagerAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "ManagerRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "WhiteListUpdated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "addManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "removeManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "updateWhiteList", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "whitelistedAccounts", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/abi/Pool.json b/abi/Pool.json index ae4e3705..d5600711 100644 --- a/abi/Pool.json +++ b/abi/Pool.json @@ -125,25 +125,6 @@ "name": "PendingValidatorsLimitUpdated", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Refunded", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -550,59 +531,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "admin", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_withdrawalCredentials", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "_validatorRegistration", - "type": "address" - }, - { - "internalType": "address", - "name": "_stakedEthToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_validators", - "type": "address" - }, - { - "internalType": "address", - "name": "_oracles", - "type": "address" - }, - { - "internalType": "address", - "name": "_whiteListManager", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_minActivatingDeposit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_pendingValidatorsLimit", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -702,7 +630,7 @@ }, { "inputs": [], - "name": "refund", + "name": "receiveFees", "outputs": [], "stateMutability": "payable", "type": "function" diff --git a/abi/RewardEthToken.json b/abi/RewardEthToken.json index 279f7897..031fdbde 100644 --- a/abi/RewardEthToken.json +++ b/abi/RewardEthToken.json @@ -571,49 +571,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "admin", - "type": "address" - }, - { - "internalType": "address", - "name": "_stakedEthToken", - "type": "address" - }, - { - "internalType": "address", - "name": "_oracles", - "type": "address" - }, - { - "internalType": "address", - "name": "_protocolFeeRecipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_protocolFee", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_merkleDistributor", - "type": "address" - }, - { - "internalType": "address", - "name": "_whiteListManager", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -1096,5 +1053,18 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFeesEscrow", + "name": "_feesEscrow", + "type": "address" + } + ], + "name": "upgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } ] diff --git a/audits/2022-09-16-Pessimistic.pdf b/audits/2022-09-16-Pessimistic.pdf new file mode 100644 index 00000000..02f80ee5 Binary files /dev/null and b/audits/2022-09-16-Pessimistic.pdf differ diff --git a/contracts/interfaces/IFeesEscrow.sol b/contracts/interfaces/IFeesEscrow.sol new file mode 100644 index 00000000..12ca5026 --- /dev/null +++ b/contracts/interfaces/IFeesEscrow.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: AGPL-3.0-only + +pragma solidity 0.7.5; + +/** + * @dev Interface of the FeesEscrow contract. + */ +interface IFeesEscrow { + /** + * @dev Event for tracking fees withdrawals to Pool contract. + * @param amount - the number of fees. + */ + event FeesTransferred(uint256 amount); + + /** + * @dev Function is used to transfer accumulated rewards to Pool contract. + * Can only be executed by the RewardEthToken contract. + */ + function transferToPool() external returns (uint256); +} diff --git a/contracts/interfaces/IPool.sol b/contracts/interfaces/IPool.sol index 8b3c0437..1770946b 100644 --- a/contracts/interfaces/IPool.sol +++ b/contracts/interfaces/IPool.sol @@ -17,13 +17,6 @@ interface IPool { */ event ValidatorRegistered(bytes publicKey, address operator); - /** - * @dev Event for tracking refunds. - * @param sender - address of the refund sender. - * @param amount - refunded amount. - */ - event Refunded(address indexed sender, uint256 amount); - /** * @dev Event for tracking scheduled deposit activation. * @param sender - address of the deposit sender. @@ -77,30 +70,6 @@ interface IPool { */ event StakedWithReferrer(address indexed referrer, uint256 amount); - /** - * @dev Function for initializing the Pool contract. - * @param admin - address of the contract admin. - * @param _withdrawalCredentials - withdrawal credentials for the pool validators. - * @param _validatorRegistration - address of the ValidatorRegistration contract. - * @param _stakedEthToken - address of the StakedEthToken contract. - * @param _validators - address of the Validators contract. - * @param _oracles - address of the Oracles contract. - * @param _whiteListManager - address of the WhiteListManager contract. - * @param _minActivatingDeposit - minimal deposit amount considered for the activation. - * @param _pendingValidatorsLimit - pending validators limit. When it's exceeded, the deposits will be set for the activation. - */ - function initialize( - address admin, - bytes32 _withdrawalCredentials, - address _validatorRegistration, - address _stakedEthToken, - address _validators, - address _oracles, - address _whiteListManager, - uint256 _minActivatingDeposit, - uint256 _pendingValidatorsLimit - ) external; - /** * @dev Function for getting the total validator deposit. */ @@ -170,6 +139,11 @@ interface IPool { */ function validatorRegistration() external view returns (IDepositContract); + /** + * @dev Function for receiving native tokens without minting sETH. + */ + function receiveFees() external payable; + /** * @dev Function for staking ether to the pool to the different tokens' recipient. * @param recipient - address of the tokens recipient. @@ -228,10 +202,4 @@ interface IPool { * @param depositData - the deposit data to submit for the validator. */ function registerValidator(IPoolValidators.DepositData calldata depositData) external; - - /** - * @dev Function for refunding to the pool. - * Can only be executed by the account with admin role. - */ - function refund() external payable; } diff --git a/contracts/interfaces/IRewardEthToken.sol b/contracts/interfaces/IRewardEthToken.sol index a89817c7..33b362f7 100644 --- a/contracts/interfaces/IRewardEthToken.sol +++ b/contracts/interfaces/IRewardEthToken.sol @@ -3,6 +3,7 @@ pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; +import "./IFeesEscrow.sol"; /** * @dev Interface of the RewardEthToken contract. @@ -53,26 +54,6 @@ interface IRewardEthToken is IERC20Upgradeable { uint256 protocolReward ); - /** - * @dev Function for initializing the RewardEthToken contract. - * @param admin - address of the contract admin. - * @param _stakedEthToken - address of the StakedEthToken contract. - * @param _oracles - address of the Oracles contract. - * @param _protocolFeeRecipient - address of the protocol fee recipient. - * @param _protocolFee - protocol fee. - * @param _merkleDistributor - address of the MerkleDistributor contract. - * @param _whiteListManager - address of the WhiteListManager contract. - */ - function initialize( - address admin, - address _stakedEthToken, - address _oracles, - address _protocolFeeRecipient, - uint256 _protocolFee, - address _merkleDistributor, - address _whiteListManager - ) external; - /** * @dev Function for getting the address of the merkle distributor. */ @@ -135,6 +116,13 @@ interface IRewardEthToken is IERC20Upgradeable { */ function rewardsDisabled(address account) external view returns (bool); + /** + * @dev Function for upgrading the RewardEthToken contract. The `initialize` function must be defined + * if deploying contract for the first time that will initialize the state variables above. + * @param _feesEscrow - address of the FeesEscrow contract. + */ + function upgrade(IFeesEscrow _feesEscrow) external; + /** * @dev Function for updating account's reward checkpoint. * @param account - address of the account to update the reward checkpoint for. diff --git a/contracts/pool/FeesEscrow.sol b/contracts/pool/FeesEscrow.sol new file mode 100644 index 00000000..07b4d604 --- /dev/null +++ b/contracts/pool/FeesEscrow.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: AGPL-3.0-only + +pragma solidity 0.7.5; + +import "../interfaces/IPool.sol"; +import "../interfaces/IFeesEscrow.sol"; + +/** + * @title FeesEscrow + * + * @dev FeesEscrow contract is used to receive tips from validators and transfer + * them to the Pool contract via calling transferToPool method by RewardEthToken contract. + */ +contract FeesEscrow is IFeesEscrow { + // @dev Pool contract's address. + IPool private immutable pool; + + // @dev RewardEthToken contract's address. + address private immutable rewardEthToken; + + constructor(IPool _pool, address _rewardEthToken) { + pool = _pool; + rewardEthToken = _rewardEthToken; + } + + /** + * @dev See {IFeesEscrow-transferToPool}. + */ + function transferToPool() external override returns (uint256) { + require(msg.sender == rewardEthToken, "FeesEscrow: invalid caller"); + + uint256 balance = address(this).balance; + + if (balance == 0) { + return balance; + } + + pool.receiveFees{value: balance}(); + + emit FeesTransferred(balance); + + return balance; + } + + /** + * @dev Allows FeesEscrow contract to receive MEV rewards and priority fees. Later these rewards will be transferred + * to the `Pool` contract by `FeesEscrow.transferToPool` method which is called by the `RewardEthToken` contract. + */ + receive() external payable {} +} diff --git a/contracts/pool/Pool.sol b/contracts/pool/Pool.sol index b4eba897..0a089fe8 100644 --- a/contracts/pool/Pool.sol +++ b/contracts/pool/Pool.sol @@ -55,46 +55,6 @@ contract Pool is IPool, OwnablePausableUpgradeable { // @dev Pending validators percent limit. If it's not exceeded tokens can be minted immediately. uint256 public override pendingValidatorsLimit; - /** - * @dev See {IPool-initialize}. - */ - function initialize( - address admin, - bytes32 _withdrawalCredentials, - address _validatorRegistration, - address _stakedEthToken, - address _validators, - address _oracles, - address _whiteListManager, - uint256 _minActivatingDeposit, - uint256 _pendingValidatorsLimit - ) - external override initializer - { - require(admin != address(0), "Pool: invalid admin address"); - require(_withdrawalCredentials != "", "Pool: invalid withdrawal credentials"); - require(_validatorRegistration != address(0), "Pool: invalid ValidatorRegistration address"); - require(_stakedEthToken != address(0), "Pool: invalid StakedEthToken address"); - require(_validators != address(0), "Pool: invalid Validators address"); - require(_oracles != address(0), "Pool: invalid Oracles address"); - require(_pendingValidatorsLimit < 1e4, "Pool: invalid limit"); - - __OwnablePausableUpgradeable_init(admin); - - withdrawalCredentials = _withdrawalCredentials; - validatorRegistration = IDepositContract(_validatorRegistration); - stakedEthToken = IStakedEthToken(_stakedEthToken); - validators = IPoolValidators(_validators); - oracles = _oracles; - whiteListManager = IWhiteListManager(_whiteListManager); - - minActivatingDeposit = _minActivatingDeposit; - emit MinActivatingDepositUpdated(_minActivatingDeposit, msg.sender); - - pendingValidatorsLimit = _pendingValidatorsLimit; - emit PendingValidatorsLimitUpdated(_pendingValidatorsLimit, msg.sender); - } - /** * @dev See {IPool-setMinActivatingDeposit}. */ @@ -138,6 +98,11 @@ contract Pool is IPool, OwnablePausableUpgradeable { _stake(recipient, msg.value); } + /** + * @dev See {IPool-receiveFees}. + */ + function receiveFees() external payable override {} + /** * @dev Function for staking ETH using transfer. */ @@ -275,16 +240,4 @@ contract Pool is IPool, OwnablePausableUpgradeable { depositData.depositDataRoot ); } - - /** - * @dev See {IPool-refund}. - */ - function refund() external override payable { - require( - hasRole(DEFAULT_ADMIN_ROLE, msg.sender) && whiteListManager.whitelistedAccounts(msg.sender), - "Pool: access denied" - ); - require(msg.value > 0, "Pool: invalid refund amount"); - emit Refunded(msg.sender, msg.value); - } } diff --git a/contracts/tokens/RewardEthToken.sol b/contracts/tokens/RewardEthToken.sol index 241991cd..ab39a413 100644 --- a/contracts/tokens/RewardEthToken.sol +++ b/contracts/tokens/RewardEthToken.sol @@ -7,9 +7,9 @@ import "@openzeppelin/contracts-upgradeable/utils/SafeCastUpgradeable.sol"; import "../presets/OwnablePausableUpgradeable.sol"; import "../interfaces/IStakedEthToken.sol"; import "../interfaces/IRewardEthToken.sol"; -import "../interfaces/IMerkleDistributor.sol"; import "../interfaces/IOracles.sol"; import "../interfaces/IWhiteListManager.sol"; +import "../interfaces/IFeesEscrow.sol"; import "./ERC20PermitUpgradeable.sol"; /** @@ -55,38 +55,8 @@ contract RewardEthToken is IRewardEthToken, OwnablePausableUpgradeable, ERC20Per // @dev Address of the WhiteListManager contract. IWhiteListManager private whiteListManager; - /** - * @dev See {IRewardEthToken-initialize}. - */ - function initialize( - address admin, - address _stakedEthToken, - address _oracles, - address _protocolFeeRecipient, - uint256 _protocolFee, - address _merkleDistributor, - address _whiteListManager - ) - external override initializer - { - require(admin != address(0), "RewardEthToken: invalid admin address"); - require(_stakedEthToken != address(0), "RewardEthToken: invalid StakedEthToken address"); - require(_oracles != address(0), "RewardEthToken: invalid Oracles address"); - require(_protocolFeeRecipient != address(0), "RewardEthToken: invalid protocol fee recipient address"); - require(_protocolFee < 1e4, "RewardEthToken: invalid protocol fee"); - require(_merkleDistributor != address(0), "RewardEthToken: invalid MerkleDistributor address"); - - __OwnablePausableUpgradeable_init(admin); - __ERC20_init("Reward ETH Harbour", "rETH-h"); - __ERC20Permit_init("Reward ETH Harbour"); - - stakedEthToken = IStakedEthToken(_stakedEthToken); - oracles = _oracles; - protocolFeeRecipient = _protocolFeeRecipient; - protocolFee = _protocolFee; - merkleDistributor = _merkleDistributor; - whiteListManager = IWhiteListManager(_whiteListManager); - } + // @dev Address of the FeesEscrow contract. + IFeesEscrow private feesEscrow; /** * @dev See {IRewardEthToken-setRewardsDisabled}. @@ -177,6 +147,15 @@ contract RewardEthToken is IRewardEthToken, OwnablePausableUpgradeable, ERC20Per emit Transfer(sender, recipient, amount); } + /** + * @dev See {IRewardEthToken-upgrade}. + */ + function upgrade(IFeesEscrow _feesEscrow) external override onlyAdmin whenPaused { + require(address(feesEscrow) == address(0), "RewardEthToken: FeesEscrow address already set"); + + feesEscrow = _feesEscrow; + } + /** * @dev See {IRewardEthToken-updateRewardCheckpoint}. */ @@ -239,6 +218,7 @@ contract RewardEthToken is IRewardEthToken, OwnablePausableUpgradeable, ERC20Per function updateTotalRewards(uint256 newTotalRewards) external override { require(msg.sender == oracles, "RewardEthToken: access denied"); + newTotalRewards = newTotalRewards.add(feesEscrow.transferToPool()); uint256 periodRewards = newTotalRewards.sub(totalRewards); if (periodRewards == 0) { lastUpdateBlockNumber = block.number; diff --git a/deployments/index.js b/deployments/index.js index 83339ee5..20609944 100644 --- a/deployments/index.js +++ b/deployments/index.js @@ -1,10 +1,59 @@ -const { contracts } = require('./settings'); +const { white } = require('chalk'); +const { ethers, upgrades, config } = require('hardhat'); +const { contracts, contractSettings } = require('./settings'); + +function log(message) { + if (config != null && config.suppressLogs !== true) { + console.log(message); + } +} + +async function upgradePool() { + const signer = await ethers.provider.getSigner(contractSettings.admin); + const Pool = await ethers.getContractFactory('Pool', signer); + + // upgrade Pool to new implementation + const proxy = await upgrades.upgradeProxy(contracts.pool, Pool); + await proxy.deployed(); +} + +async function upgradeRewardEthToken() { + const signer = await ethers.provider.getSigner(contractSettings.admin); + const RewardEthToken = await ethers.getContractFactory( + 'RewardEthToken', + signer + ); + let rewardEthToken = await RewardEthToken.attach(contracts.rewardEthToken); + + // pause + if (!(await rewardEthToken.paused())) { + await rewardEthToken.pause(); + } + + // upgrade RewardEthToken to new implementation + const proxy = await upgrades.upgradeProxy( + contracts.rewardEthToken, + RewardEthToken + ); + await proxy.deployed(); + + // call upgrade + await rewardEthToken.upgrade(contracts.feesEscrow); + + return rewardEthToken.unpause(); +} async function deployContracts() { return contracts; } async function upgradeContracts() { + await deployContracts(); + await upgradePool(); + log(white('Upgraded Pool contract')); + await upgradeRewardEthToken(); + log(white('Upgraded RewardEthToken contract')); + return contracts; } diff --git a/deployments/settings.js b/deployments/settings.js index ad24f643..77410d39 100644 --- a/deployments/settings.js +++ b/deployments/settings.js @@ -35,6 +35,7 @@ if (hre.hardhatArguments && hre.hardhatArguments.network === 'goerli') { rewardEthToken: '0xCBE26dbC91B05C160050167107154780F36CeAAB', merkleDistributor: '0x07E8291591eaC73Dd93b079e3E68e171094bA9e1', roles: '0xFe5947f029308F854db0cDA57e68C43f6C21a207', + feesEscrow: '0xB5230EBE5b1a9299A5C44f459ED2E8EB7496F581', contractChecker: '0x02c75acFd94E124C2696F785e4fcaf8248471FE4', whiteListManager: '0x57a9cbED053f37EB67d6f5932b1F2f9Afbe347F3', }; diff --git a/hardhat.config.js b/hardhat.config.js index d3abbcc2..d7d678ee 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -10,7 +10,7 @@ require('hardhat-contract-sizer'); require('hardhat-abi-exporter'); require('@nomiclabs/hardhat-etherscan'); -const BLOCK_NUMBER = 14800220; +const BLOCK_NUMBER = 15545460; const OPTIMIZER_RUNS = 5000000; const log = (...text) => console.log(gray(...['└─> [DEBUG]'].concat(text))); diff --git a/networks/goerli.md b/networks/goerli.md index 83f7614f..2b49fa2d 100644 --- a/networks/goerli.md +++ b/networks/goerli.md @@ -5,6 +5,11 @@ - Contract: [0x896634387c415eFb1d51da80aDf3D90616281949](https://goerli.etherscan.io/address/0x896634387c415eFb1d51da80aDf3D90616281949) - Transaction: [0xec0f7f40f882097c22a09ed9df82474f5710d7e02d1023f1df17538fb8163f62](https://goerli.etherscan.io/tx/0xec0f7f40f882097c22a09ed9df82474f5710d7e02d1023f1df17538fb8163f62) +### Upgrade to v1.1.0 + +- Implementation: [0xA5f6ca3b7753B5F057d6A9d8Bb3d7B8d68187338](https://goerli.etherscan.io/address/0xA5f6ca3b7753B5F057d6A9d8Bb3d7B8d68187338) +- Transaction: [0x9c4b4fa61fc74e41407394b5e15fb54ad17d6e6e9b2fae5984c72bafb4c2d35e](https://goerli.etherscan.io/tx/0x9c4b4fa61fc74e41407394b5e15fb54ad17d6e6e9b2fae5984c72bafb4c2d35e) + ## Pool Escrow - Contract: [0x6DfC9682E3C3263758ad96E2b2ba9822167f81Ee](https://goerli.etherscan.io/address/0x6DfC9682E3C3263758ad96E2b2ba9822167f81Ee) @@ -30,6 +35,11 @@ - Contract: [0xbA9aD2A3Ef7A372900644aBe9D82eCD3Fa8CF8dD](https://goerli.etherscan.io/address/0xbA9aD2A3Ef7A372900644aBe9D82eCD3Fa8CF8dD) - Transaction: [0x19856616e1567dab34662875d7b9c0d8531136d918c9f47ec07a04d507df5e41](https://goerli.etherscan.io/tx/0x19856616e1567dab34662875d7b9c0d8531136d918c9f47ec07a04d507df5e41) +### Upgrade to v1.1.0 + +- Contract: [0x3Da2a9d579fDf28742dc35Ca384978BcC142eB20](https://goerli.etherscan.io/address/0x3Da2a9d579fDf28742dc35Ca384978BcC142eB20) +- Transaction: [0x4dbbbb497d26b71c2d1107ed4e9d12fcab9d34399ec95d088b592afc06c24fba](https://goerli.etherscan.io/tx/0x4dbbbb497d26b71c2d1107ed4e9d12fcab9d34399ec95d088b592afc06c24fba) + ## Oracles - Contract: [0x4E9CA30186E829D7712ADFEEE491c0c6C46E1AED](https://goerli.etherscan.io/address/0x4E9CA30186E829D7712ADFEEE491c0c6C46E1AED) diff --git a/networks/mainnet.md b/networks/mainnet.md index 9b4319c3..b5f9545a 100644 --- a/networks/mainnet.md +++ b/networks/mainnet.md @@ -5,11 +5,21 @@ - Contract: [0xeA6b7151b138c274eD8d4D61328352545eF2D4b7](https://etherscan.io/address/0xeA6b7151b138c274eD8d4D61328352545eF2D4b7) - Transaction: [0xcf553ddf554b6ef4632fd17661675d92f459942d68ac3c883f292a642ef42697](https://etherscan.io/tx/0xcf553ddf554b6ef4632fd17661675d92f459942d68ac3c883f292a642ef42697) +### Upgrade to v1.1.0 + +- Implementation: [0x822f08EaAf73156fe255D49827D048b8Ef7B86B2](https://etherscan.io/address/0x822f08EaAf73156fe255D49827D048b8Ef7B86B2) +- Transaction: [0x8d05c28436897f18c8a6a5ad1d83a571f2b3f95e6712d79779c861304b54e04b](https://goerli.etherscan.io/tx/0x8d05c28436897f18c8a6a5ad1d83a571f2b3f95e6712d79779c861304b54e04b) + ## Pool Escrow - Contract: [0x6DfC9682E3C3263758ad96E2b2ba9822167f81Ee](https://etherscan.io/address/0x5c631621b897f467dd6a91855a0bc97d77b78dc0) - Transaction: [0x4d46bbe103c88c6abfae3646077aee2400bd29cee35504be59a48aeeb6772959](https://etherscan.io/tx/0x4d46bbe103c88c6abfae3646077aee2400bd29cee35504be59a48aeeb6772959) +## Fees Escrow + +- Contract: [0xB5230EBE5b1a9299A5C44f459ED2E8EB7496F581](https://etherscan.io/address/0xB5230EBE5b1a9299A5C44f459ED2E8EB7496F581) +- Transaction: [0x237be8aefc3905978659e9202c18665f304e15300a194633bec5e04a53d77227](https://etherscan.io/tx/0x237be8aefc3905978659e9202c18665f304e15300a194633bec5e04a53d77227) + ## Pool Validators - Contract: [0x270Ad793b7BB315A9fd07F1FFFd8AB1e3621dF7E](https://etherscan.io/address/0x270ad793b7bb315a9fd07f1fffd8ab1e3621df7e) @@ -30,6 +40,16 @@ - Contract: [0xCBE26dbC91B05C160050167107154780F36CeAAB](https://etherscan.io/address/0xcbe26dbc91b05c160050167107154780f36ceaab) - Transaction: [0x21ae95ec6730603c90f2f529b1f7013a58a0d240101e52ad4f90d04e4fb85719](https://etherscan.io/tx/0x21ae95ec6730603c90f2f529b1f7013a58a0d240101e52ad4f90d04e4fb85719) +### Upgrade to v1.1.0 + +- Implementation: [0x9E6631d118C28b3d61c68F14FF30a99f7e91963a](https://etherscan.io/address/0x9E6631d118C28b3d61c68F14FF30a99f7e91963a) +- Transaction: [0xc98d6ef0cb814086d04bad9c6d4596ad2f2d7d4ac05fd409d5bf28e166c2bf77](https://goerli.etherscan.io/tx/0xc98d6ef0cb814086d04bad9c6d4596ad2f2d7d4ac05fd409d5bf28e166c2bf77) + +### Upgrade to v1.1.1 + +- Implementation: [0x6FFa613eD41585B1c1e517A78d140cFBD68be639](https://etherscan.io/address/0x6FFa613eD41585B1c1e517A78d140cFBD68be639) +- Transaction: [0xf3310d46fa205260d5a1d900a7ae6b5c93a1bee08a85a9df11279b226699a550](https://goerli.etherscan.io/tx/0xf3310d46fa205260d5a1d900a7ae6b5c93a1bee08a85a9df11279b226699a550) + ## Oracles - Contract: [0x16c0020fC507C675eA8A3A817416adA3D95c661b](https://etherscan.io/address/0x16c0020fC507C675eA8A3A817416adA3D95c661b) diff --git a/test/oracles/Oracles.test.js b/test/oracles/Oracles.test.js index 04b226e6..60ab1c79 100644 --- a/test/oracles/Oracles.test.js +++ b/test/oracles/Oracles.test.js @@ -6,6 +6,7 @@ const { ether, BN, send, + balance, } = require('@openzeppelin/test-helpers'); const { impersonateAccount, @@ -155,9 +156,11 @@ contract('Oracles', ([_, anyone, operator, ...accounts]) => { newActivatedValidators, oracleAccounts, candidateId, + feesEscrowBalance, signatures; beforeEach(async () => { + feesEscrowBalance = await balance.current(contracts.feesEscrow); oracleAccounts = await setupOracleAccounts({ oracles, accounts, admin }); prevTotalRewards = await rewardEthToken.totalRewards(); newTotalRewards = prevTotalRewards.add(ether('10')); @@ -279,12 +282,7 @@ contract('Oracles', ([_, anyone, operator, ...accounts]) => { // check values updates expect(await rewardEthToken.totalRewards()).to.bignumber.equal( - newTotalRewards - ); - - // update submitted - expect(await rewardEthToken.totalRewards()).to.bignumber.equal( - newTotalRewards + newTotalRewards.add(feesEscrowBalance) ); expect(await pool.activatedValidators()).to.bignumber.equal( newActivatedValidators diff --git a/test/pool/FeesEscrow.test.js b/test/pool/FeesEscrow.test.js new file mode 100644 index 00000000..1cf8c082 --- /dev/null +++ b/test/pool/FeesEscrow.test.js @@ -0,0 +1,91 @@ +const { contracts, contractSettings } = require('../../deployments/settings'); +const { impersonateAccount, resetFork } = require('../utils'); +const { upgradeContracts } = require('../../deployments'); +const { + send, + ether, + expectRevert, + BN, + balance, +} = require('@openzeppelin/test-helpers'); +const { ethers } = require('hardhat'); +const { expect } = require('chai'); + +const Pool = artifacts.require('Pool'); +const FeesEscrow = artifacts.require('FeesEscrow'); + +let feesEscrow; +let pool; +let rewardEthToken; + +contract('FeesEscrow', (accounts) => { + let [sender] = accounts; + + beforeEach(async () => { + await impersonateAccount(contractSettings.admin); + await send.ether(sender, contractSettings.admin, ether('2')); + let upgradedContracts = await upgradeContracts(); + + const RewardEthToken = await ethers.getContractFactory('RewardEthToken'); + rewardEthToken = await RewardEthToken.attach( + upgradedContracts.rewardEthToken + ); + feesEscrow = await FeesEscrow.at(upgradedContracts.feesEscrow); + pool = await Pool.at(upgradedContracts.pool); + + // Zero balance for Pool contract before each test + await network.provider.send('hardhat_setBalance', [ + upgradedContracts.pool, + '0x0', + ]); + }); + + afterEach(async () => resetFork()); + + it('transferToPool from RewardEthToken', async () => { + await impersonateAccount(contracts.oracles); + const oraclesSigner = await ethers.getSigner(contracts.oracles); + const feesEscrowBalance = await balance.current(contracts.feesEscrow); + const feesAmount = ether('1'); + + // Ensure zero balances before miner's reward distribution to FeesEscrow contract + const poolBalanceBefore = await balance.current(pool.address); + expect(poolBalanceBefore.toString()).to.be.bignumber.equal(new BN('0')); + + // Send fees from "validator" to FeesEscrow contract + await send.ether(sender, feesEscrow.address, feesAmount.toString()); + + // set oracles balance to call rewardEthToken.updateTotalRewards() + await ethers.provider.send('hardhat_setBalance', [ + oraclesSigner.address, + '0x100000000000000000', + ]); + + const newTotalRewards = ether('100000'); + await rewardEthToken + .connect(oraclesSigner) + .updateTotalRewards(newTotalRewards.toString()); + + // Ensure all fees transferred from FeesEscrow contract to Pool contract + const poolBalanceAfter = await balance.current(pool.address); + expect(poolBalanceAfter.toString()).to.be.bignumber.equal( + poolBalanceBefore.add(feesEscrowBalance).add(feesAmount).toString() + ); + + const feesEscrowBalanceAfterTransfer = await balance.current( + feesEscrow.address + ); + expect(feesEscrowBalanceAfterTransfer.toString()).to.be.bignumber.equal( + new BN('0') + ); + }); + + it('transferToPool from invalid caller', async () => { + // Send fees from "validator" to FeesEscrow contract + await send.ether(sender, feesEscrow.address, ether('1').toString()); + await expectRevert( + feesEscrow.transferToPool(), + 'FeesEscrow: invalid caller' + ); + }); +}); diff --git a/test/pool/stake.test.js b/test/pool/stake.test.js index e81e21e5..f4c08563 100644 --- a/test/pool/stake.test.js +++ b/test/pool/stake.test.js @@ -690,25 +690,4 @@ contract('Pool (stake)', (accounts) => { 'Pool: access denied' ); }); - - it('not admin cannot refund', async () => { - await expectRevert( - pool.refund({ - from: sender1, - }), - 'Pool: access denied' - ); - }); - - it('admin can refund', async () => { - await whiteListManager.updateWhiteList(admin, true, { from: admin }); - let receipt = await pool.refund({ - from: admin, - value: ether('1'), - }); - await expectEvent(receipt, 'Refunded', { - sender: admin, - amount: ether('1'), - }); - }); }); diff --git a/test/tokens/RewardEthToken.test.js b/test/tokens/RewardEthToken.test.js index 969842a2..43667fa4 100644 --- a/test/tokens/RewardEthToken.test.js +++ b/test/tokens/RewardEthToken.test.js @@ -7,9 +7,10 @@ const { ether, constants, send, + balance, } = require('@openzeppelin/test-helpers'); const { upgradeContracts } = require('../../deployments'); -const { contractSettings } = require('../../deployments/settings'); +const { contractSettings, contracts } = require('../../deployments/settings'); const { stopImpersonatingAccount, impersonateAccount, @@ -136,6 +137,13 @@ contract('RewardEthToken', ([sender, merkleDistributor, ...accounts]) => { }); describe('updateTotalRewards', () => { + let feesEscrowBalance; + + beforeEach(async () => { + await send.ether(admin, contracts.feesEscrow, ether('1')); + feesEscrowBalance = await balance.current(contracts.feesEscrow); + }); + it('anyone cannot update rewards', async () => { await expectRevert( rewardEthToken.updateTotalRewards(ether('10'), { @@ -161,6 +169,7 @@ contract('RewardEthToken', ([sender, merkleDistributor, ...accounts]) => { totalRewards: newTotalRewards, oracleAccounts, }); + newTotalRewards = newTotalRewards.add(feesEscrowBalance); await expectEvent.inTransaction( receipt.tx, RewardEthToken, @@ -187,28 +196,6 @@ contract('RewardEthToken', ([sender, merkleDistributor, ...accounts]) => { }); }); - it('oracles can update rewards', async () => { - let prevTotalRewards = await rewardEthToken.totalRewards(); - let newTotalRewards = prevTotalRewards.add(ether('10')); - let receipt = await setTotalRewards({ - rewardEthToken, - oracles, - pool, - totalRewards: newTotalRewards, - oracleAccounts, - }); - await expectEvent.inTransaction( - receipt.tx, - RewardEthToken, - 'RewardsUpdated', - { - periodRewards: newTotalRewards.sub(prevTotalRewards), - totalRewards: newTotalRewards, - protocolReward: ether('0.8'), - } - ); - }); - it('assigns protocol fee to distributor', async () => { await rewardEthToken.setProtocolFeeRecipient(constants.ZERO_ADDRESS, { from: admin, @@ -224,12 +211,14 @@ contract('RewardEthToken', ([sender, merkleDistributor, ...accounts]) => { totalRewards: newTotalRewards, oracleAccounts, }); + periodReward = periodReward.add(feesEscrowBalance); + newTotalRewards = newTotalRewards.add(feesEscrowBalance); await expectEvent.inTransaction( receipt.tx, RewardEthToken, 'RewardsUpdated', { - periodRewards: newTotalRewards.sub(prevTotalRewards), + periodRewards: periodReward, totalRewards: newTotalRewards, protocolReward: periodReward .mul(await rewardEthToken.protocolFee()) @@ -261,6 +250,8 @@ contract('RewardEthToken', ([sender, merkleDistributor, ...accounts]) => { value: stakedAmount2, }); + await send.ether(admin, contracts.feesEscrow, ether('1')); + let feesEscrowBalance = await balance.current(contracts.feesEscrow); totalSupply = (await rewardEthToken.totalSupply()).add(ether('10')); await setTotalRewards({ totalRewards: totalSupply, @@ -269,6 +260,7 @@ contract('RewardEthToken', ([sender, merkleDistributor, ...accounts]) => { oracles, oracleAccounts, }); + totalSupply = totalSupply.add(feesEscrowBalance); rewardAmount1 = await rewardEthToken.balanceOf(sender1); rewardAmount2 = await rewardEthToken.balanceOf(sender2); @@ -277,24 +269,7 @@ contract('RewardEthToken', ([sender, merkleDistributor, ...accounts]) => { it('cannot transfer to zero address', async () => { await expectRevert( - rewardEthToken.transfer(constants.ZERO_ADDRESS, rewardAmount1, { - from: sender1, - }), - 'RewardEthToken: invalid receiver' - ); - - await checkRewardEthToken({ - rewardEthToken, - totalSupply, - account: sender1, - balance: rewardAmount1, - }); - }); - - it('cannot transfer to not whitelisted account', async () => { - await whiteListManager.updateWhiteList(sender2, false, { from: admin }); - await expectRevert( - rewardEthToken.transfer(sender2, rewardAmount1, { + rewardEthToken.transfer(constants.ZERO_ADDRESS, stakedAmount1, { from: sender1, }), 'RewardEthToken: invalid receiver' diff --git a/test/utils.js b/test/utils.js index 93ecae74..6acfeeb1 100644 --- a/test/utils.js +++ b/test/utils.js @@ -1,8 +1,13 @@ const { expect } = require('chai'); const hre = require('hardhat'); const { hexlify, keccak256, defaultAbiCoder } = require('ethers/lib/utils'); -const { BN, ether, expectEvent } = require('@openzeppelin/test-helpers'); -const { contractSettings, contracts } = require('../deployments/settings'); +const { + BN, + ether, + expectEvent, + balance, +} = require('@openzeppelin/test-helpers'); +const { contracts, contractSettings } = require('../deployments/settings'); const iDepositContract = artifacts.require('IDepositContract'); const StakeWiseToken = artifacts.require('IERC20Upgradeable'); @@ -150,6 +155,7 @@ async function setTotalRewards({ let signature = await web3.eth.sign(candidateId, oracleAccounts[i]); signatures.push(signature); } + let feesEscrowBalance = await balance.current(contracts.feesEscrow); // update total rewards let receipt = await oracles.submitRewards( @@ -160,7 +166,9 @@ async function setTotalRewards({ from: oracleAccounts[0], } ); - expect(await rewardEthToken.totalSupply()).to.bignumber.equal(totalRewards); + expect(await rewardEthToken.totalSupply()).to.bignumber.equal( + totalRewards.add(feesEscrowBalance) + ); return receipt; }