Skip to content

Commit 3500d00

Browse files
Fix: liquid staking: interest validation
1 parent 148a12f commit 3500d00

File tree

3 files changed

+288
-2
lines changed

3 files changed

+288
-2
lines changed

.openzeppelin/unknown-22040.json

Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,292 @@
900900
}
901901
}
902902
}
903+
},
904+
"c175c6f01c5abf83d845d8ced9752ce588423d3788c359bee97f1d6ecb7ecebf": {
905+
"address": "0x7184DD655aacCCb28376Fa1B59e3712566Df670b",
906+
"txHash": "0xc1ee43f1da0b1399c4f473dc9a50ffe9be7a7847386e5af211fedc8342baaccd",
907+
"layout": {
908+
"solcVersion": "0.8.17",
909+
"storage": [
910+
{
911+
"label": "_initialized",
912+
"offset": 0,
913+
"slot": "0",
914+
"type": "t_uint8",
915+
"contract": "Initializable",
916+
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63",
917+
"retypedFrom": "bool"
918+
},
919+
{
920+
"label": "_initializing",
921+
"offset": 1,
922+
"slot": "0",
923+
"type": "t_bool",
924+
"contract": "Initializable",
925+
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68"
926+
},
927+
{
928+
"label": "__gap",
929+
"offset": 0,
930+
"slot": "1",
931+
"type": "t_array(t_uint256)50_storage",
932+
"contract": "ContextUpgradeable",
933+
"src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36"
934+
},
935+
{
936+
"label": "__gap",
937+
"offset": 0,
938+
"slot": "51",
939+
"type": "t_array(t_uint256)50_storage",
940+
"contract": "ERC165Upgradeable",
941+
"src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41"
942+
},
943+
{
944+
"label": "_roles",
945+
"offset": 0,
946+
"slot": "101",
947+
"type": "t_mapping(t_bytes32,t_struct(RoleData)179_storage)",
948+
"contract": "AccessControlUpgradeable",
949+
"src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:62"
950+
},
951+
{
952+
"label": "__gap",
953+
"offset": 0,
954+
"slot": "102",
955+
"type": "t_array(t_uint256)49_storage",
956+
"contract": "AccessControlUpgradeable",
957+
"src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260"
958+
},
959+
{
960+
"label": "nodeManager",
961+
"offset": 0,
962+
"slot": "151",
963+
"type": "t_contract(LiquidNodesManager)14548",
964+
"contract": "LiquidPool",
965+
"src": "contracts/staking/liquid/LiquidPool.sol:17"
966+
},
967+
{
968+
"label": "rewardsBank",
969+
"offset": 0,
970+
"slot": "152",
971+
"type": "t_contract(RewardsBank)10477",
972+
"contract": "LiquidPool",
973+
"src": "contracts/staking/liquid/LiquidPool.sol:18"
974+
},
975+
{
976+
"label": "tiers",
977+
"offset": 0,
978+
"slot": "153",
979+
"type": "t_contract(StakingTiers)15953",
980+
"contract": "LiquidPool",
981+
"src": "contracts/staking/liquid/LiquidPool.sol:19"
982+
},
983+
{
984+
"label": "lockKeeper",
985+
"offset": 0,
986+
"slot": "154",
987+
"type": "t_contract(LockKeeper)7804",
988+
"contract": "LiquidPool",
989+
"src": "contracts/staking/liquid/LiquidPool.sol:20"
990+
},
991+
{
992+
"label": "bondAddress",
993+
"offset": 0,
994+
"slot": "155",
995+
"type": "t_address",
996+
"contract": "LiquidPool",
997+
"src": "contracts/staking/liquid/LiquidPool.sol:21"
998+
},
999+
{
1000+
"label": "stAmb",
1001+
"offset": 0,
1002+
"slot": "156",
1003+
"type": "t_contract(StAMB)15759",
1004+
"contract": "LiquidPool",
1005+
"src": "contracts/staking/liquid/LiquidPool.sol:22"
1006+
},
1007+
{
1008+
"label": "minStakeValue",
1009+
"offset": 0,
1010+
"slot": "157",
1011+
"type": "t_uint256",
1012+
"contract": "LiquidPool",
1013+
"src": "contracts/staking/liquid/LiquidPool.sol:24"
1014+
},
1015+
{
1016+
"label": "unstakeLockTime",
1017+
"offset": 0,
1018+
"slot": "158",
1019+
"type": "t_uint256",
1020+
"contract": "LiquidPool",
1021+
"src": "contracts/staking/liquid/LiquidPool.sol:25"
1022+
},
1023+
{
1024+
"label": "interest",
1025+
"offset": 0,
1026+
"slot": "159",
1027+
"type": "t_uint256",
1028+
"contract": "LiquidPool",
1029+
"src": "contracts/staking/liquid/LiquidPool.sol:27"
1030+
},
1031+
{
1032+
"label": "interestPeriod",
1033+
"offset": 0,
1034+
"slot": "160",
1035+
"type": "t_uint256",
1036+
"contract": "LiquidPool",
1037+
"src": "contracts/staking/liquid/LiquidPool.sol:28"
1038+
},
1039+
{
1040+
"label": "lastInterestTime",
1041+
"offset": 0,
1042+
"slot": "161",
1043+
"type": "t_uint256",
1044+
"contract": "LiquidPool",
1045+
"src": "contracts/staking/liquid/LiquidPool.sol:29"
1046+
},
1047+
{
1048+
"label": "fastUnstakePenalty",
1049+
"offset": 0,
1050+
"slot": "162",
1051+
"type": "t_uint256",
1052+
"contract": "LiquidPool",
1053+
"src": "contracts/staking/liquid/LiquidPool.sol:30"
1054+
},
1055+
{
1056+
"label": "totalRewards",
1057+
"offset": 0,
1058+
"slot": "163",
1059+
"type": "t_uint256",
1060+
"contract": "LiquidPool",
1061+
"src": "contracts/staking/liquid/LiquidPool.sol:32"
1062+
},
1063+
{
1064+
"label": "totalRewardsDebt",
1065+
"offset": 0,
1066+
"slot": "164",
1067+
"type": "t_uint256",
1068+
"contract": "LiquidPool",
1069+
"src": "contracts/staking/liquid/LiquidPool.sol:33"
1070+
},
1071+
{
1072+
"label": "rewardsCanClaim",
1073+
"offset": 0,
1074+
"slot": "165",
1075+
"type": "t_mapping(t_address,t_uint256)",
1076+
"contract": "LiquidPool",
1077+
"src": "contracts/staking/liquid/LiquidPool.sol:36"
1078+
},
1079+
{
1080+
"label": "rewardsDebt",
1081+
"offset": 0,
1082+
"slot": "166",
1083+
"type": "t_mapping(t_address,t_uint256)",
1084+
"contract": "LiquidPool",
1085+
"src": "contracts/staking/liquid/LiquidPool.sol:40"
1086+
},
1087+
{
1088+
"label": "lockedWithdraws",
1089+
"offset": 0,
1090+
"slot": "167",
1091+
"type": "t_mapping(t_address,t_uint256)",
1092+
"contract": "LiquidPool",
1093+
"src": "contracts/staking/liquid/LiquidPool.sol:42"
1094+
},
1095+
{
1096+
"label": "__gap",
1097+
"offset": 0,
1098+
"slot": "168",
1099+
"type": "t_array(t_uint256)10_storage",
1100+
"contract": "LiquidPool",
1101+
"src": "contracts/staking/liquid/LiquidPool.sol:44"
1102+
}
1103+
],
1104+
"types": {
1105+
"t_address": {
1106+
"label": "address",
1107+
"numberOfBytes": "20"
1108+
},
1109+
"t_array(t_uint256)10_storage": {
1110+
"label": "uint256[10]",
1111+
"numberOfBytes": "320"
1112+
},
1113+
"t_array(t_uint256)49_storage": {
1114+
"label": "uint256[49]",
1115+
"numberOfBytes": "1568"
1116+
},
1117+
"t_array(t_uint256)50_storage": {
1118+
"label": "uint256[50]",
1119+
"numberOfBytes": "1600"
1120+
},
1121+
"t_bool": {
1122+
"label": "bool",
1123+
"numberOfBytes": "1"
1124+
},
1125+
"t_bytes32": {
1126+
"label": "bytes32",
1127+
"numberOfBytes": "32"
1128+
},
1129+
"t_contract(LiquidNodesManager)14548": {
1130+
"label": "contract LiquidNodesManager",
1131+
"numberOfBytes": "20"
1132+
},
1133+
"t_contract(LockKeeper)7804": {
1134+
"label": "contract LockKeeper",
1135+
"numberOfBytes": "20"
1136+
},
1137+
"t_contract(RewardsBank)10477": {
1138+
"label": "contract RewardsBank",
1139+
"numberOfBytes": "20"
1140+
},
1141+
"t_contract(StAMB)15759": {
1142+
"label": "contract StAMB",
1143+
"numberOfBytes": "20"
1144+
},
1145+
"t_contract(StakingTiers)15953": {
1146+
"label": "contract StakingTiers",
1147+
"numberOfBytes": "20"
1148+
},
1149+
"t_mapping(t_address,t_bool)": {
1150+
"label": "mapping(address => bool)",
1151+
"numberOfBytes": "32"
1152+
},
1153+
"t_mapping(t_address,t_uint256)": {
1154+
"label": "mapping(address => uint256)",
1155+
"numberOfBytes": "32"
1156+
},
1157+
"t_mapping(t_bytes32,t_struct(RoleData)179_storage)": {
1158+
"label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)",
1159+
"numberOfBytes": "32"
1160+
},
1161+
"t_struct(RoleData)179_storage": {
1162+
"label": "struct AccessControlUpgradeable.RoleData",
1163+
"members": [
1164+
{
1165+
"label": "members",
1166+
"type": "t_mapping(t_address,t_bool)",
1167+
"offset": 0,
1168+
"slot": "0"
1169+
},
1170+
{
1171+
"label": "adminRole",
1172+
"type": "t_bytes32",
1173+
"offset": 0,
1174+
"slot": "1"
1175+
}
1176+
],
1177+
"numberOfBytes": "64"
1178+
},
1179+
"t_uint256": {
1180+
"label": "uint256",
1181+
"numberOfBytes": "32"
1182+
},
1183+
"t_uint8": {
1184+
"label": "uint8",
1185+
"numberOfBytes": "1"
1186+
}
1187+
}
1188+
}
9031189
}
9041190
}
9051191
}

contracts/staking/liquid/LiquidPool.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ contract LiquidPool is UUPSUpgradeable, AccessControlUpgradeable, IOnBlockListen
8282
// ADMIN METHODS
8383

8484
function setInterest(uint interest_, uint interestPeriod_) public onlyRole(DEFAULT_ADMIN_ROLE) {
85-
require(interest_ >= 0 && interest_ <= 1000000, "Invalid percent value");
85+
require(interest_ >= 0 && interest_ <= BILLION, "Invalid percent value");
8686
interest = interest_;
8787
interestPeriod = interestPeriod_;
8888
}

deployments/22040.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@
16591659
"deployTx": "0xae6f3627d4174536697a1536fe5522a36c0ff9581c5374a73fd4187bf9caceb0",
16601660
"fullyQualifiedName": "contracts/staking/liquid/LiquidPool.sol:LiquidPool",
16611661
"proxy": {
1662-
"implementation": "0x18a6c40b56C985f2D3C8eB93cA331b1c5a582024",
1662+
"implementation": "0x7184DD655aacCCb28376Fa1B59e3712566Df670b",
16631663
"fullyQualifiedName": "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol:ERC1967Proxy"
16641664
}
16651665
}

0 commit comments

Comments
 (0)