diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..9e15be3 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v16.20.0 diff --git a/.openzeppelin/bsc-testnet.json b/.openzeppelin/bsc-testnet.json new file mode 100644 index 0000000..712259f --- /dev/null +++ b/.openzeppelin/bsc-testnet.json @@ -0,0 +1,1334 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0xe298A4C809422249c3770AA114b5BD82062ae9F6", + "txHash": "0x74e56afaa1ce9b591ed9434c755802db3ecca6f24512bd3209fa5b0678056fdf" + }, + "proxies": [ + { + "address": "0x40Eb4C82f7c1588a02Ff9283c62245748581EBF4", + "txHash": "0x6c60240bd4f7ad7c9b0ae3751abd5794b0a30f6efb94c894cee5e14c664f13ee", + "kind": "transparent" + }, + { + "address": "0xbAA6d3E68764cD12029b2625353417537af5bCA7", + "txHash": "0xaff2e07dec78c42d37c96750487b58bc3578813ba8dac0f1761d419eb11cc37a", + "kind": "transparent" + }, + { + "address": "0xa45D6eF640a52B425324c9Bb65b90C6958f3d81d", + "txHash": "0x91b7fc60969ffdb19b767dfd3047ab704ce889bb663bca10df1795767d37b43f", + "kind": "transparent" + }, + { + "address": "0x7CdFba1Ee6A8D1e688B4B34A56b62287ce400802", + "txHash": "0xa5642452b238ffc6ca3815f585c1fb0c5528c73f2322b736760d617b239d0b91", + "kind": "transparent" + } + ], + "impls": { + "02fd28b1e1bd81ee646ceef9fe2168b0aea2b988d371c7fb9107e1c9533808f2": { + "address": "0xA5c22dF21B31f6dC536a05021eF807e23009CBB4", + "txHash": "0x8d63333a2cc26a648a0c0c0b8c3c8952f5c29cdbfdc0b5cf0345a4e57b8732e4", + "layout": { + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:87" + }, + { + "label": "addressStore", + "offset": 0, + "slot": "101", + "type": "t_contract(IAddressStore)7749", + "contract": "FeeVault", + "src": "contracts/FeeVault.sol:23" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IAddressStore)7749": { + "label": "contract IAddressStore", + "numberOfBytes": "20" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "c889b0244a7b49a993df114990fa1ba5439aef439ab246c7f99e5678962f0ca1": { + "address": "0x5d48dc760484Ef0DeA9cA9e24f69A28d76304DC3", + "txHash": "0x6dd6e7359ee21b80fea824bce12cc9b5ec28fc19adc467b87ce051ee6305a856", + "layout": { + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "101", + "type": "t_mapping(t_bytes32,t_struct(RoleData)179_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:61" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:247" + }, + { + "label": "_roleMembers", + "offset": 0, + "slot": "151", + "type": "t_mapping(t_bytes32,t_struct(AddressSet)1814_storage)", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:76" + }, + { + "label": "addressStore", + "offset": 0, + "slot": "201", + "type": "t_contract(IAddressStore)7749", + "contract": "StakePool", + "src": "contracts/StakePool.sol:77" + }, + { + "label": "config", + "offset": 0, + "slot": "202", + "type": "t_struct(Data)7387_storage", + "contract": "StakePool", + "src": "contracts/StakePool.sol:78" + }, + { + "label": "_paused", + "offset": 0, + "slot": "209", + "type": "t_bool", + "contract": "StakePool", + "src": "contracts/StakePool.sol:80" + }, + { + "label": "_status", + "offset": 0, + "slot": "210", + "type": "t_uint256", + "contract": "StakePool", + "src": "contracts/StakePool.sol:81" + }, + { + "label": "bnbToUnbond", + "offset": 0, + "slot": "211", + "type": "t_uint256", + "contract": "StakePool", + "src": "contracts/StakePool.sol:88" + }, + { + "label": "bnbUnbonding", + "offset": 0, + "slot": "212", + "type": "t_uint256", + "contract": "StakePool", + "src": "contracts/StakePool.sol:93" + }, + { + "label": "claimReserve", + "offset": 0, + "slot": "213", + "type": "t_uint256", + "contract": "StakePool", + "src": "contracts/StakePool.sol:100" + }, + { + "label": "exchangeRate", + "offset": 0, + "slot": "214", + "type": "t_struct(Data)7477_storage", + "contract": "StakePool", + "src": "contracts/StakePool.sol:105" + }, + { + "label": "claimReqs", + "offset": 0, + "slot": "216", + "type": "t_mapping(t_address,t_array(t_struct(ClaimRequest)5868_storage)dyn_storage)", + "contract": "StakePool", + "src": "contracts/StakePool.sol:110" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(ClaimRequest)5868_storage)dyn_storage": { + "label": "struct StakePool.ClaimRequest[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IAddressStore)7749": { + "label": "contract IAddressStore", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_array(t_struct(ClaimRequest)5868_storage)dyn_storage)": { + "label": "mapping(address => struct StakePool.ClaimRequest[])", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(AddressSet)1814_storage)": { + "label": "mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)179_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(AddressSet)1814_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)1513_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "64" + }, + "t_struct(ClaimRequest)5868_storage": { + "label": "struct StakePool.ClaimRequest", + "members": [ + { + "label": "weiToReturn", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "createdAt", + "type": "t_uint256", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Data)7387_storage": { + "label": "struct Config.Data", + "members": [ + { + "label": "bcStakingWallet", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "minBNBDeposit", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "minTokenWithdrawal", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "cooldownPeriod", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "fee", + "type": "t_struct(Data)7632_storage", + "offset": 0, + "slot": "4" + } + ], + "numberOfBytes": "224" + }, + "t_struct(Data)7477_storage": { + "label": "struct ExchangeRate.Data", + "members": [ + { + "label": "totalWei", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "poolTokenSupply", + "type": "t_uint256", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Data)7632_storage": { + "label": "struct FeeDistribution.Data", + "members": [ + { + "label": "reward", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "deposit", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "withdraw", + "type": "t_uint256", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_struct(RoleData)179_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)1513_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "169282a0e8f7c3c1cc32ef21e360a7b3308a21d46c54b6186c2ed534d572c913": { + "address": "0x62D362B203607e9559E1777F5dabA53cb88B277b", + "txHash": "0xf25cd5900033254ede216ca7702109bdbcc1c23672327ced6cbb6fb21766ecfd", + "layout": { + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:87" + }, + { + "label": "_addressStore", + "offset": 0, + "slot": "101", + "type": "t_contract(IAddressStore)8884", + "contract": "FeeVault", + "src": "contracts/FeeVault.sol:23" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IAddressStore)8884": { + "label": "contract IAddressStore", + "numberOfBytes": "20" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "3a34a6f392dc673175121c322b46e4313fc0c6647d60ef48a539073aebc59190": { + "address": "0xE73eCdb903d72C661423c2Ee08b41D9Ee8D19381", + "txHash": "0x0bdc5a095aaa7a63d4ba93c9148b48c62811bad0905135a73f2f8044fec684d5", + "layout": { + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "101", + "type": "t_mapping(t_bytes32,t_struct(RoleData)179_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:61" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:247" + }, + { + "label": "_roleMembers", + "offset": 0, + "slot": "151", + "type": "t_mapping(t_bytes32,t_struct(AddressSet)2207_storage)", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:76" + }, + { + "label": "_addressStore", + "offset": 0, + "slot": "201", + "type": "t_contract(IAddressStore)8884", + "contract": "StakePool", + "src": "contracts/StakePool.sol:78" + }, + { + "label": "config", + "offset": 0, + "slot": "202", + "type": "t_struct(Data)8453_storage", + "contract": "StakePool", + "src": "contracts/StakePool.sol:79" + }, + { + "label": "_paused", + "offset": 0, + "slot": "211", + "type": "t_bool", + "contract": "StakePool", + "src": "contracts/StakePool.sol:81" + }, + { + "label": "_status", + "offset": 0, + "slot": "212", + "type": "t_uint256", + "contract": "StakePool", + "src": "contracts/StakePool.sol:82" + }, + { + "label": "_bnbToUnbond", + "offset": 0, + "slot": "213", + "type": "t_int256", + "contract": "StakePool", + "src": "contracts/StakePool.sol:98" + }, + { + "label": "_bnbUnbonding", + "offset": 0, + "slot": "214", + "type": "t_uint256", + "contract": "StakePool", + "src": "contracts/StakePool.sol:110" + }, + { + "label": "_claimReserve", + "offset": 0, + "slot": "215", + "type": "t_uint256", + "contract": "StakePool", + "src": "contracts/StakePool.sol:123" + }, + { + "label": "exchangeRate", + "offset": 0, + "slot": "216", + "type": "t_struct(Data)8602_storage", + "contract": "StakePool", + "src": "contracts/StakePool.sol:128" + }, + { + "label": "claimReqs", + "offset": 0, + "slot": "218", + "type": "t_mapping(t_address,t_array(t_struct(ClaimRequest)6518_storage)dyn_storage)", + "contract": "StakePool", + "src": "contracts/StakePool.sol:133" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(ClaimRequest)6518_storage)dyn_storage": { + "label": "struct StakePool.ClaimRequest[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IAddressStore)8884": { + "label": "contract IAddressStore", + "numberOfBytes": "20" + }, + "t_int256": { + "label": "int256", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_array(t_struct(ClaimRequest)6518_storage)dyn_storage)": { + "label": "mapping(address => struct StakePool.ClaimRequest[])", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(AddressSet)2207_storage)": { + "label": "mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)179_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(AddressSet)2207_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)1906_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "64" + }, + "t_struct(ClaimRequest)6518_storage": { + "label": "struct StakePool.ClaimRequest", + "members": [ + { + "label": "weiToReturn", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "createdAt", + "type": "t_uint256", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Data)8453_storage": { + "label": "struct Config.Data", + "members": [ + { + "label": "bcStakingWallet", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "minCrossChainTransfer", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "transferOutTimeout", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "minBNBDeposit", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "minTokenWithdrawal", + "type": "t_uint256", + "offset": 0, + "slot": "4" + }, + { + "label": "cooldownPeriod", + "type": "t_uint256", + "offset": 0, + "slot": "5" + }, + { + "label": "fee", + "type": "t_struct(Data)8757_storage", + "offset": 0, + "slot": "6" + } + ], + "numberOfBytes": "288" + }, + "t_struct(Data)8602_storage": { + "label": "struct ExchangeRate.Data", + "members": [ + { + "label": "totalWei", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "poolTokenSupply", + "type": "t_uint256", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Data)8757_storage": { + "label": "struct FeeDistribution.Data", + "members": [ + { + "label": "reward", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "deposit", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "withdraw", + "type": "t_uint256", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_struct(RoleData)179_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)1906_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "5a29f2b3f0824864ff12c3289a0e1e4c78417324f11ae0b60f5bbb167b39d40f": { + "address": "0x87a4E882802e5A10160Ec410f9A472db829E9E85", + "txHash": "0xff573ce3be5494761f2fc8cd015bc63eb4ffc3f4dea8f00c1c8c47a2f5e8b167", + "layout": { + "solcVersion": "0.8.7", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "101", + "type": "t_mapping(t_bytes32,t_struct(RoleData)179_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:61" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:247" + }, + { + "label": "_roleMembers", + "offset": 0, + "slot": "151", + "type": "t_mapping(t_bytes32,t_struct(AddressSet)2490_storage)", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:76" + }, + { + "label": "_addressStore", + "offset": 0, + "slot": "201", + "type": "t_contract(IAddressStore)5166", + "contract": "StakePool", + "src": "contracts/StakePool.sol:82" + }, + { + "label": "config", + "offset": 0, + "slot": "202", + "type": "t_struct(Data)4735_storage", + "contract": "StakePool", + "src": "contracts/StakePool.sol:83" + }, + { + "label": "_paused", + "offset": 0, + "slot": "211", + "type": "t_bool", + "contract": "StakePool", + "src": "contracts/StakePool.sol:85" + }, + { + "label": "_status", + "offset": 0, + "slot": "212", + "type": "t_uint256", + "contract": "StakePool", + "src": "contracts/StakePool.sol:86" + }, + { + "label": "_bnbToUnbond", + "offset": 0, + "slot": "213", + "type": "t_int256", + "contract": "StakePool", + "src": "contracts/StakePool.sol:102" + }, + { + "label": "_bnbUnbonding", + "offset": 0, + "slot": "214", + "type": "t_uint256", + "contract": "StakePool", + "src": "contracts/StakePool.sol:114" + }, + { + "label": "_claimReserve", + "offset": 0, + "slot": "215", + "type": "t_uint256", + "contract": "StakePool", + "src": "contracts/StakePool.sol:127" + }, + { + "label": "exchangeRate", + "offset": 0, + "slot": "216", + "type": "t_struct(Data)4884_storage", + "contract": "StakePool", + "src": "contracts/StakePool.sol:132" + }, + { + "label": "claimReqs", + "offset": 0, + "slot": "218", + "type": "t_mapping(t_address,t_array(t_struct(ClaimRequest)2987_storage)dyn_storage)", + "contract": "StakePool", + "src": "contracts/StakePool.sol:137" + }, + { + "label": "domainSeparator", + "offset": 0, + "slot": "219", + "type": "t_bytes32", + "contract": "StakePool", + "src": "contracts/StakePool.sol:144" + }, + { + "label": "claimTypehash", + "offset": 0, + "slot": "220", + "type": "t_bytes32", + "contract": "StakePool", + "src": "contracts/StakePool.sol:149" + }, + { + "label": "claimFeeConfig", + "offset": 0, + "slot": "221", + "type": "t_struct(ClaimFeeConfigData)4629_storage", + "contract": "StakePool", + "src": "contracts/StakePool.sol:154" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(ClaimRequest)2987_storage)dyn_storage": { + "label": "struct StakePool.ClaimRequest[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IAddressStore)5166": { + "label": "contract IAddressStore", + "numberOfBytes": "20" + }, + "t_int256": { + "label": "int256", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_array(t_struct(ClaimRequest)2987_storage)dyn_storage)": { + "label": "mapping(address => struct StakePool.ClaimRequest[])", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(AddressSet)2490_storage)": { + "label": "mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)179_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(AddressSet)2490_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)2189_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "64" + }, + "t_struct(ClaimFeeConfigData)4629_storage": { + "label": "struct ClaimFeeConfig.ClaimFeeConfigData", + "members": [ + { + "label": "instantClaimFeePercentage", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "automatedClaimFee", + "type": "t_uint256", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(ClaimRequest)2987_storage": { + "label": "struct StakePool.ClaimRequest", + "members": [ + { + "label": "weiToReturn", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "createdAt", + "type": "t_uint256", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Data)4735_storage": { + "label": "struct Config.Data", + "members": [ + { + "label": "bcStakingWallet", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "minCrossChainTransfer", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "transferOutTimeout", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "minBNBDeposit", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "minTokenWithdrawal", + "type": "t_uint256", + "offset": 0, + "slot": "4" + }, + { + "label": "cooldownPeriod", + "type": "t_uint256", + "offset": 0, + "slot": "5" + }, + { + "label": "fee", + "type": "t_struct(Data)5039_storage", + "offset": 0, + "slot": "6" + } + ], + "numberOfBytes": "288" + }, + "t_struct(Data)4884_storage": { + "label": "struct ExchangeRate.Data", + "members": [ + { + "label": "totalWei", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "poolTokenSupply", + "type": "t_uint256", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Data)5039_storage": { + "label": "struct FeeDistribution.Data", + "members": [ + { + "label": "reward", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "deposit", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "withdraw", + "type": "t_uint256", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_struct(RoleData)179_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)2189_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + } + } + } + \ No newline at end of file diff --git a/.openzeppelin/unknown-97.json b/.openzeppelin/unknown-97.json deleted file mode 100644 index 15ca90f..0000000 --- a/.openzeppelin/unknown-97.json +++ /dev/null @@ -1,459 +0,0 @@ -{ - "manifestVersion": "3.2", - "admin": { - "address": "0xe298A4C809422249c3770AA114b5BD82062ae9F6", - "txHash": "0x74e56afaa1ce9b591ed9434c755802db3ecca6f24512bd3209fa5b0678056fdf" - }, - "proxies": [ - { - "address": "0x40Eb4C82f7c1588a02Ff9283c62245748581EBF4", - "txHash": "0x6c60240bd4f7ad7c9b0ae3751abd5794b0a30f6efb94c894cee5e14c664f13ee", - "kind": "transparent" - }, - { - "address": "0xbAA6d3E68764cD12029b2625353417537af5bCA7", - "txHash": "0xaff2e07dec78c42d37c96750487b58bc3578813ba8dac0f1761d419eb11cc37a", - "kind": "transparent" - } - ], - "impls": { - "02fd28b1e1bd81ee646ceef9fe2168b0aea2b988d371c7fb9107e1c9533808f2": { - "address": "0xA5c22dF21B31f6dC536a05021eF807e23009CBB4", - "txHash": "0x8d63333a2cc26a648a0c0c0b8c3c8952f5c29cdbfdc0b5cf0345a4e57b8732e4", - "layout": { - "storage": [ - { - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8", - "contract": "Initializable", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", - "retypedFrom": "bool" - }, - { - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool", - "contract": "Initializable", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" - }, - { - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage", - "contract": "ContextUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" - }, - { - "label": "_owner", - "offset": 0, - "slot": "51", - "type": "t_address", - "contract": "OwnableUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" - }, - { - "label": "__gap", - "offset": 0, - "slot": "52", - "type": "t_array(t_uint256)49_storage", - "contract": "OwnableUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:87" - }, - { - "label": "addressStore", - "offset": 0, - "slot": "101", - "type": "t_contract(IAddressStore)7749", - "contract": "FeeVault", - "src": "contracts/FeeVault.sol:23" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)49_storage": { - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "t_array(t_uint256)50_storage": { - "label": "uint256[50]", - "numberOfBytes": "1600" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_contract(IAddressStore)7749": { - "label": "contract IAddressStore", - "numberOfBytes": "20" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "label": "uint8", - "numberOfBytes": "1" - } - } - } - }, - "c889b0244a7b49a993df114990fa1ba5439aef439ab246c7f99e5678962f0ca1": { - "address": "0x5d48dc760484Ef0DeA9cA9e24f69A28d76304DC3", - "txHash": "0x6dd6e7359ee21b80fea824bce12cc9b5ec28fc19adc467b87ce051ee6305a856", - "layout": { - "storage": [ - { - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8", - "contract": "Initializable", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", - "retypedFrom": "bool" - }, - { - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool", - "contract": "Initializable", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" - }, - { - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage", - "contract": "ContextUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" - }, - { - "label": "__gap", - "offset": 0, - "slot": "51", - "type": "t_array(t_uint256)50_storage", - "contract": "ERC165Upgradeable", - "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" - }, - { - "label": "_roles", - "offset": 0, - "slot": "101", - "type": "t_mapping(t_bytes32,t_struct(RoleData)179_storage)", - "contract": "AccessControlUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:61" - }, - { - "label": "__gap", - "offset": 0, - "slot": "102", - "type": "t_array(t_uint256)49_storage", - "contract": "AccessControlUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:247" - }, - { - "label": "_roleMembers", - "offset": 0, - "slot": "151", - "type": "t_mapping(t_bytes32,t_struct(AddressSet)1814_storage)", - "contract": "AccessControlEnumerableUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:22" - }, - { - "label": "__gap", - "offset": 0, - "slot": "152", - "type": "t_array(t_uint256)49_storage", - "contract": "AccessControlEnumerableUpgradeable", - "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:76" - }, - { - "label": "addressStore", - "offset": 0, - "slot": "201", - "type": "t_contract(IAddressStore)7749", - "contract": "StakePool", - "src": "contracts/StakePool.sol:77" - }, - { - "label": "config", - "offset": 0, - "slot": "202", - "type": "t_struct(Data)7387_storage", - "contract": "StakePool", - "src": "contracts/StakePool.sol:78" - }, - { - "label": "_paused", - "offset": 0, - "slot": "209", - "type": "t_bool", - "contract": "StakePool", - "src": "contracts/StakePool.sol:80" - }, - { - "label": "_status", - "offset": 0, - "slot": "210", - "type": "t_uint256", - "contract": "StakePool", - "src": "contracts/StakePool.sol:81" - }, - { - "label": "bnbToUnbond", - "offset": 0, - "slot": "211", - "type": "t_uint256", - "contract": "StakePool", - "src": "contracts/StakePool.sol:88" - }, - { - "label": "bnbUnbonding", - "offset": 0, - "slot": "212", - "type": "t_uint256", - "contract": "StakePool", - "src": "contracts/StakePool.sol:93" - }, - { - "label": "claimReserve", - "offset": 0, - "slot": "213", - "type": "t_uint256", - "contract": "StakePool", - "src": "contracts/StakePool.sol:100" - }, - { - "label": "exchangeRate", - "offset": 0, - "slot": "214", - "type": "t_struct(Data)7477_storage", - "contract": "StakePool", - "src": "contracts/StakePool.sol:105" - }, - { - "label": "claimReqs", - "offset": 0, - "slot": "216", - "type": "t_mapping(t_address,t_array(t_struct(ClaimRequest)5868_storage)dyn_storage)", - "contract": "StakePool", - "src": "contracts/StakePool.sol:110" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_bytes32)dyn_storage": { - "label": "bytes32[]", - "numberOfBytes": "32" - }, - "t_array(t_struct(ClaimRequest)5868_storage)dyn_storage": { - "label": "struct StakePool.ClaimRequest[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)49_storage": { - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "t_array(t_uint256)50_storage": { - "label": "uint256[50]", - "numberOfBytes": "1600" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(IAddressStore)7749": { - "label": "contract IAddressStore", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_array(t_struct(ClaimRequest)5868_storage)dyn_storage)": { - "label": "mapping(address => struct StakePool.ClaimRequest[])", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_bool)": { - "label": "mapping(address => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_bytes32,t_struct(AddressSet)1814_storage)": { - "label": "mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet)", - "numberOfBytes": "32" - }, - "t_mapping(t_bytes32,t_struct(RoleData)179_storage)": { - "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", - "numberOfBytes": "32" - }, - "t_mapping(t_bytes32,t_uint256)": { - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32" - }, - "t_struct(AddressSet)1814_storage": { - "label": "struct EnumerableSetUpgradeable.AddressSet", - "members": [ - { - "label": "_inner", - "type": "t_struct(Set)1513_storage", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "64" - }, - "t_struct(ClaimRequest)5868_storage": { - "label": "struct StakePool.ClaimRequest", - "members": [ - { - "label": "weiToReturn", - "type": "t_uint256", - "offset": 0, - "slot": "0" - }, - { - "label": "createdAt", - "type": "t_uint256", - "offset": 0, - "slot": "1" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Data)7387_storage": { - "label": "struct Config.Data", - "members": [ - { - "label": "bcStakingWallet", - "type": "t_address", - "offset": 0, - "slot": "0" - }, - { - "label": "minBNBDeposit", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "minTokenWithdrawal", - "type": "t_uint256", - "offset": 0, - "slot": "2" - }, - { - "label": "cooldownPeriod", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "fee", - "type": "t_struct(Data)7632_storage", - "offset": 0, - "slot": "4" - } - ], - "numberOfBytes": "224" - }, - "t_struct(Data)7477_storage": { - "label": "struct ExchangeRate.Data", - "members": [ - { - "label": "totalWei", - "type": "t_uint256", - "offset": 0, - "slot": "0" - }, - { - "label": "poolTokenSupply", - "type": "t_uint256", - "offset": 0, - "slot": "1" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Data)7632_storage": { - "label": "struct FeeDistribution.Data", - "members": [ - { - "label": "reward", - "type": "t_uint256", - "offset": 0, - "slot": "0" - }, - { - "label": "deposit", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "withdraw", - "type": "t_uint256", - "offset": 0, - "slot": "2" - } - ], - "numberOfBytes": "96" - }, - "t_struct(RoleData)179_storage": { - "label": "struct AccessControlUpgradeable.RoleData", - "members": [ - { - "label": "members", - "type": "t_mapping(t_address,t_bool)", - "offset": 0, - "slot": "0" - }, - { - "label": "adminRole", - "type": "t_bytes32", - "offset": 0, - "slot": "1" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Set)1513_storage": { - "label": "struct EnumerableSetUpgradeable.Set", - "members": [ - { - "label": "_values", - "type": "t_array(t_bytes32)dyn_storage", - "offset": 0, - "slot": "0" - }, - { - "label": "_indexes", - "type": "t_mapping(t_bytes32,t_uint256)", - "offset": 0, - "slot": "1" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "label": "uint8", - "numberOfBytes": "1" - } - } - } - } - } -} diff --git a/hardhat.config.ts b/hardhat.config.ts index d6230ac..d033995 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -115,8 +115,7 @@ export default { blockGasLimit: 40000000, }, testnet: { - // url: 'https://data-seed-prebsc-1-s1.binance.org:8545', - url: 'https://rpc.ankr.com/bsc_testnet_chapel', + url: 'https://data-seed-prebsc-1-s1.binance.org:8545/', chainId: 97, gasPrice: 20000000000, blockGasLimit: 40000000, diff --git a/helpers/deployments.ts b/helpers/deployments.ts index 3eb7d6c..7e15147 100644 --- a/helpers/deployments.ts +++ b/helpers/deployments.ts @@ -3,7 +3,6 @@ import { BigNumberish } from "ethers"; import { ethers, upgrades } from "hardhat"; import { StakePoolConfig, StakePoolConfigV2 } from '../scripts/types/config'; import { Contracts } from './types'; -import { STAKE_POOL_CONFIG_V2 } from '../test/helpers/constants'; export async function deployAddressStore(): Promise { const AddressStore = await ethers.getContractFactory("AddressStore"); diff --git a/scripts/local-deployment.ts b/scripts/local-deployment.ts new file mode 100644 index 0000000..69d8ff0 --- /dev/null +++ b/scripts/local-deployment.ts @@ -0,0 +1,46 @@ +import { CONFIG } from './types/config'; +import { deployAllContracts, upgradeStakePoolV2 } from '../helpers/deployments'; +import { StakePoolConfigV2 } from './../scripts/types/config'; +import { BigNumber } from 'ethers'; +import { ethers } from 'hardhat'; +import { Provider } from '@ethersproject/providers'; +import { DAY_SECONDS, STAKE_POOL_CONFIG, STAKE_POOL_CONFIG_V2 } from '../test/helpers/constants'; +import { fillAddressStore } from '../helpers/setUps/addressStore'; +import { Contracts } from '../helpers/types'; +import { stakePoolSetUp } from '../helpers/setUps/stakePool'; + +// NOTE: ERC-1820 Registry deployed by default, check the hardhat config file. + +async function main() { + console.log("Ecosystem local deployment"); + console.log("mnemonic:", CONFIG.mnemonic); + const [deployer, bot] = await ethers.getSigners(); + console.log("deployer address", await deployer.getAddress()); + console.log("deployer balance", await deployer.getBalance()); + const provider = deployer.provider as Provider; + console.log("network", await provider.getNetwork()); + + const contracts = await deployAllContracts( + DAY_SECONDS, + STAKE_POOL_CONFIG, + STAKE_POOL_CONFIG_V2, + [deployer.address], + [deployer.address] + ); + + console.log("stake pool address"); + console.log(contracts.stakePool.address); + + console.log("filling address store"); + await fillAddressStore(contracts); + + console.log("setting up stake pool"); + await stakePoolSetUp(contracts.stakePool, bot.address); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main().catch(error => { + console.error(error); + process.exit(1); +}); diff --git a/scripts/migrate-v2-testnet.ts b/scripts/migrate-v2-testnet.ts new file mode 100644 index 0000000..83275fd --- /dev/null +++ b/scripts/migrate-v2-testnet.ts @@ -0,0 +1,28 @@ +import { CONFIG } from './types/config'; +import { upgradeStakePoolV2 } from '../helpers/deployments'; +import { StakePoolConfigV2 } from './types/config'; +import { BigNumber } from 'ethers'; +import { ethers } from 'hardhat'; +import { Provider } from '@ethersproject/providers'; + +async function main() { + console.log("Executing V2 StakePool upgrade - testnet"); + console.log(CONFIG.mnemonic); + const [deployer] = await ethers.getSigners(); + console.log("deployer address", await deployer.getAddress()); + console.log("deployer balance", await deployer.getBalance()); + const provider = deployer.provider as Provider; + console.log("network", await provider.getNetwork()); + const claimFeeConfig: StakePoolConfigV2 = { + automatedClaimFee: BigNumber.from("500000000000000"), // 0.0005 ETH, + instantClaimFeePercentage: BigNumber.from(1) // 1% Fee + } + await upgradeStakePoolV2(CONFIG.stakePool.address, claimFeeConfig); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main().catch(error => { + console.error(error); + process.exit(1); +}); diff --git a/scripts/stakepool.ts b/scripts/stakepool.ts new file mode 100644 index 0000000..22721fc --- /dev/null +++ b/scripts/stakepool.ts @@ -0,0 +1,28 @@ +import { CONFIG } from './types/config'; +import { deployAllContracts, upgradeStakePoolV2 } from '../helpers/deployments'; +import { StakePoolConfigV2 } from './types/config'; +import { BigNumber } from 'ethers'; +import { ethers } from 'hardhat'; +import { Provider } from '@ethersproject/providers'; +import { DAY_SECONDS, STAKE_POOL_CONFIG, STAKE_POOL_CONFIG_V2 } from '../test/helpers/constants'; +import { fillAddressStore } from '../helpers/setUps/addressStore'; +import { Contracts } from '../helpers/types'; +import { stakePoolSetUp } from '../helpers/setUps/stakePool'; + +// NOTE: ERC-1820 Registry deployed by default, check the hardhat config file. + +async function main() { + const STAKE_POOL_ADDRESS = "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853"; + + const stakePool = await ethers.getContractAt("StakePool", STAKE_POOL_ADDRESS); + + console.log(await stakePool.config()); + console.log(await stakePool.claimFeeConfig()); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main().catch(error => { + console.error(error); + process.exit(1); +}); diff --git a/scripts/unpause.ts b/scripts/unpause.ts new file mode 100644 index 0000000..f1084df --- /dev/null +++ b/scripts/unpause.ts @@ -0,0 +1,24 @@ +import { CONFIG } from './types/config'; +import { ethers } from 'hardhat'; +import { Provider } from '@ethersproject/providers'; + +async function main() { + console.log("Executing V2 StakePool unpause"); + console.log(CONFIG.mnemonic); + const [deployer] = await ethers.getSigners(); + console.log("deployer address", await deployer.getAddress()); + console.log("deployer balance", await deployer.getBalance()); + const provider = deployer.provider as Provider; + console.log("network", await provider.getNetwork()); + const stakePool = await ethers.getContractAt("StakePool", CONFIG.stakePool.address); + const tx = await stakePool.unpause(); + const txReceipt = await tx.wait(); + console.log(txReceipt.transactionHash); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main().catch(error => { + console.error(error); + process.exit(1); +});