Skip to content

Commit 2d94cb8

Browse files
authored
Merge pull request #230 from etherfi-protocol/v2.49
V2.49
2 parents b981dc5 + ab6aa94 commit 2d94cb8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+4043
-960
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222
[submodule "lib/eigenlayer-contracts"]
2323
path = lib/eigenlayer-contracts
2424
url = https://github.com/Layr-Labs/eigenlayer-contracts
25+
[submodule "lib/solady"]
26+
path = lib/solady
27+
url = https://github.com/Vectorized/solady
Binary file not shown.

deployment/deployed-contracts.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"EtherFiRedemptionManagerImplementation": "0xe6f40295A7500509faD08E924c91b0F050a7b84b",
3+
"EtherFiRedemptionManagerInstance": "0xDadEf1fFBFeaAB4f68A9fD181395F68b4e4E7Ae0",
4+
"EtherFiAdminImplementation": "0x683583979C8be7Bcfa41E788Ab38857dfF792f49",
5+
"EtherFiRewardsRouterImplementation": "0xe94bF0DF71002ff0165CF4daB461dEBC3978B0fa",
6+
"LiquidityPoolImplementation": "0xA6099d83A67a2c653feB5e4e48ec24C5aeE1C515",
7+
"WeETHImplementation": "0x353E98F34b6E5a8D9d1876Bf6dF01284d05837cB",
8+
"WithdrawRequestNFTImplementation": "0x685870a508b56c7f1002EEF5eFCFa01304474F61",
9+
"EtherFiNodesManagerImplementation": "0x572E25fD70b6eB9a3CaD1CE1D48E3CfB938767F1"
10+
}

foundry.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
src = 'src'
33
out = 'out'
44
libs = ['lib']
5-
fs_permissions = [{ access = "read-write", path = "./release"}, { access = "read", path = "./test" }]
5+
fs_permissions = [{ access = "read-write", path = "./release"}, { access = "read", path = "./test" }, { access = "read-write", path = "./operations" }, { access = "read-write", path = "./deployment" }]
66
gas_reports = ["*"]
77
optimizer_runs = 2000
88
extra_output = ["storageLayout"]
99
bytecode_hash = 'none'
1010
solc-version = '0.8.24'
1111

12+
[fuzz]
13+
max_shrink_iters = 100
14+
1215
# See more config options https://github.com/foundry-rs/foundry/tree/master/config
1316
[rpc_endpoints]
1417
mainnet = "${MAINNET_RPC_URL}"

lib/BucketLimiter.sol

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ library BucketLimiter {
7171
return limit.remaining >= amount;
7272
}
7373

74+
function consumable(Limit memory limit) external view returns (uint64) {
75+
_refill(limit);
76+
return limit.remaining;
77+
}
78+
7479
/*
7580
* Consumes the given amount from the bucket, if there is sufficient capacity, and returns
7681
* whether the bucket had enough remaining capacity to consume the amount.
@@ -104,18 +109,22 @@ library BucketLimiter {
104109
}
105110

106111
function _refill(Limit memory limit) internal view {
107-
// We allow for overflow here, as the delta is resilient against it.
108112
uint64 now_ = uint64(block.timestamp);
109-
uint64 delta;
113+
114+
if (now_ == limit.lastRefill) {
115+
return;
116+
}
117+
118+
uint256 delta;
110119
unchecked {
111120
delta = now_ - limit.lastRefill;
112121
}
113-
uint64 tokens = delta * limit.refillRate;
114-
uint64 newRemaining = limit.remaining + tokens;
122+
uint256 tokens = delta * uint256(limit.refillRate);
123+
uint256 newRemaining = uint256(limit.remaining) + tokens;
115124
if (newRemaining > limit.capacity) {
116125
limit.remaining = limit.capacity;
117126
} else {
118-
limit.remaining = newRemaining;
127+
limit.remaining = uint64(newRemaining);
119128
}
120129
limit.lastRefill = now_;
121130
}
@@ -157,4 +166,4 @@ library BucketLimiter {
157166
refill(limit);
158167
limit.remaining = remaining;
159168
}
160-
}
169+
}

lib/solady

Submodule solady added at 8583a6e
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"chainId": "1",
3+
"meta": { "txBuilderVersion": "1.16.5" },
4+
"transactions": [
5+
{
6+
"to": "0x9f26d4c958fd811a1f59b01b86be7dffc9d20761",
7+
"value": "0",
8+
"data": "0xe38335e500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000012cd17fdc855070e6b92a85ee62b7b5f78b031a423542fabd5d0ace52bdd8aea00000000000000000000000000000000000000000000000000000000000000020000000000000000000000007d5706f6ef3f89b3951e23e557cdfbc3239d4e2c000000000000000000000000308861a430be4cce5502d0a12724771fc6daf21600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000c44f1ef28600000000000000000000000078f424c42f006b046b927d49b6d7abef74ca67ae00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000044f8a025b40000000000000000000000009af1298993dc1f397973c62a5d47a284cf76844d0000000000000000000000000000000000000000000000000000000000001388000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44f1ef286000000000000000000000000a05d566bac16e2fbcec4cff68e89119ee2a96ef900000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024984856a3000000000000000000000000d5fd46f4df70a63d60a8563cad0444fcc25dce7f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
9+
}
10+
]
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"chainId": "1",
3+
"meta": { "txBuilderVersion": "1.16.5" },
4+
"transactions": [
5+
{
6+
"to": "0x9f26d4c958fd811a1f59b01b86be7dffc9d20761",
7+
"value": "0",
8+
"data": "0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000012cd17fdc855070e6b92a85ee62b7b5f78b031a423542fabd5d0ace52bdd8aea000000000000000000000000000000000000000000000000000000000003f48000000000000000000000000000000000000000000000000000000000000000020000000000000000000000007d5706f6ef3f89b3951e23e557cdfbc3239d4e2c000000000000000000000000308861a430be4cce5502d0a12724771fc6daf21600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000c44f1ef28600000000000000000000000078f424c42f006b046b927d49b6d7abef74ca67ae00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000044f8a025b40000000000000000000000009af1298993dc1f397973c62a5d47a284cf76844d0000000000000000000000000000000000000000000000000000000000001388000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a44f1ef286000000000000000000000000a05d566bac16e2fbcec4cff68e89119ee2a96ef900000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024984856a3000000000000000000000000d5fd46f4df70a63d60a8563cad0444fcc25dce7f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
9+
}
10+
]
11+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"data": "0x134008d300000000000000000000000062247d29b4b9becf4bb73e0c722cf6445cfc7ce9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000bd6d9e322298e0f92aa3165320fd6b939206883bdacb1d807c09161ab0cef9e000000000000000000000000000000000000000000000000000000000000000479ba509700000000000000000000000000000000000000000000000000000000",
3+
"to": "0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761",
4+
"value": 0
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"data": "0x01d5062a00000000000000000000000062247d29b4b9becf4bb73e0c722cf6445cfc7ce9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000bd6d9e322298e0f92aa3165320fd6b939206883bdacb1d807c09161ab0cef9e000000000000000000000000000000000000000000000000000000000003f480000000000000000000000000000000000000000000000000000000000000000479ba509700000000000000000000000000000000000000000000000000000000",
3+
"to": "0x9f26d4C958fD811A1F59B01B86Be7dFFc9d20761",
4+
"value": 0
5+
}

0 commit comments

Comments
 (0)