Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions contracts/evmx/fees/Credit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,22 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew
);
}

function rescue(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no needed atm

uint32 chainSlug_,
address token_,
uint256 amount_,
uint256 maxFees_,
address receiver_
) public onlyOwner{
// Add it to the queue and submit request
_createRequest(
chainSlug_,
address(this),
maxFees_,
abi.encodeCall(IFeesPlug.withdrawFees, (token_, receiver_, amount_))
);
}

function _createRequest(
uint32 chainSlug_,
address consumeFrom_,
Expand Down
3 changes: 3 additions & 0 deletions contracts/evmx/watcher/precompiles/WritePrecompile.sol
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ contract WritePrecompile is WritePrecompileStorage, Initializable, Ownable, Watc
} else {
queueParams_.overrideParams.gasLimit = 10_000_000; // other chains default gas limit
}
} else if (queueParams_.transaction.chainSlug == 999) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not need atm

// HyperEVM default gas limit
queueParams_.overrideParams.gasLimit = 1_500_000;
}
Comment on lines +137 to 140
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Remove the redundant else-if that prevents custom gas limits for HyperEVM.

Lines 137-139 unconditionally override any non-zero gasLimit to 1,500,000 for HyperEVM (chainSlug 999). This prevents callers from setting custom gas limits. The default is already handled at lines 131-133 when gasLimit == 0.

Apply this diff to remove the redundant override:

-        } else if (queueParams_.transaction.chainSlug == 999) {
-            // HyperEVM default gas limit
-            queueParams_.overrideParams.gasLimit = 1_500_000;
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} else if (queueParams_.transaction.chainSlug == 999) {
// HyperEVM default gas limit
queueParams_.overrideParams.gasLimit = 1_500_000;
}
}
🤖 Prompt for AI Agents
In contracts/evmx/watcher/precompiles/WritePrecompile.sol around lines 137 to
140, remove the redundant else-if block that unconditionally sets
queueParams_.overrideParams.gasLimit = 1_500_000 for chainSlug == 999 so callers
can supply custom non-zero gas limits; keep the existing default-setting logic
at lines 131-133 which should only set the HyperEVM default when gasLimit == 0,
and ensure no other code path overwrites a provided non-zero gasLimit for
chainSlug 999.


// For write precompile, encode the payload parameters
Expand Down
118 changes: 20 additions & 98 deletions deployments/dev_verification.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@
"0xbDE0D2da12F703Ccd275d721214745BccDCAD124",
"Socket",
"contracts/protocol/Socket.sol",
[
1,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[1, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"56": [
Expand Down Expand Up @@ -114,11 +110,7 @@
"0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a",
"Socket",
"contracts/protocol/Socket.sol",
[
56,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[56, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"100": [
Expand Down Expand Up @@ -175,11 +167,7 @@
"0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a",
"Socket",
"contracts/protocol/Socket.sol",
[
100,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[100, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"130": [
Expand Down Expand Up @@ -236,11 +224,7 @@
"0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38",
"Socket",
"contracts/protocol/Socket.sol",
[
130,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[130, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"137": [
Expand Down Expand Up @@ -297,11 +281,7 @@
"0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38",
"Socket",
"contracts/protocol/Socket.sol",
[
137,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[137, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"146": [
Expand Down Expand Up @@ -358,11 +338,7 @@
"0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a",
"Socket",
"contracts/protocol/Socket.sol",
[
146,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[146, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"169": [
Expand Down Expand Up @@ -419,11 +395,7 @@
"0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38",
"Socket",
"contracts/protocol/Socket.sol",
[
169,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[169, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"484": [
Expand Down Expand Up @@ -480,11 +452,7 @@
"0xbDE0D2da12F703Ccd275d721214745BccDCAD124",
"Socket",
"contracts/protocol/Socket.sol",
[
484,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[484, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"747": [
Expand Down Expand Up @@ -541,11 +509,7 @@
"0xbDE0D2da12F703Ccd275d721214745BccDCAD124",
"Socket",
"contracts/protocol/Socket.sol",
[
747,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[747, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"999": [
Expand Down Expand Up @@ -602,11 +566,7 @@
"0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38",
"Socket",
"contracts/protocol/Socket.sol",
[
999,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[999, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"1329": [
Expand Down Expand Up @@ -663,11 +623,7 @@
"0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38",
"Socket",
"contracts/protocol/Socket.sol",
[
1329,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[1329, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"5000": [
Expand Down Expand Up @@ -724,11 +680,7 @@
"0xd8afBbB32706E7544f075151D4666D5B0B1F22CA",
"Socket",
"contracts/protocol/Socket.sol",
[
5000,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[5000, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
],
[
"0xeAb2e310A53FD3Fb34C2944690a79DFB2e834F20",
Expand Down Expand Up @@ -783,11 +735,7 @@
"0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38",
"Socket",
"contracts/protocol/Socket.sol",
[
5000,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[5000, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"8453": [],
Expand Down Expand Up @@ -825,9 +773,7 @@
"0xEd2a3cd034D873096E40C7E2EfB0e5BE99bBbF7a",
"PromiseResolver",
"contracts/evmx/watcher/PromiseResolver.sol",
[
"0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d"
]
["0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d"]
],
[
"0x2ECF118De0d747980c5d934E78a5746B6b6fD441",
Expand Down Expand Up @@ -935,11 +881,7 @@
"0x5F77550E3072c913A20B2fbdAb14026fe0E8B450",
"Socket",
"contracts/protocol/Socket.sol",
[
43114,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[43114, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
],
[
"0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38",
Expand All @@ -954,11 +896,7 @@
"0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a",
"Socket",
"contracts/protocol/Socket.sol",
[
43114,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[43114, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"57073": [
Expand Down Expand Up @@ -1015,11 +953,7 @@
"0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38",
"Socket",
"contracts/protocol/Socket.sol",
[
57073,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[57073, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"59144": [
Expand Down Expand Up @@ -1076,11 +1010,7 @@
"0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a",
"Socket",
"contracts/protocol/Socket.sol",
[
59144,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[59144, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"80094": [
Expand Down Expand Up @@ -1137,11 +1067,7 @@
"0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38",
"Socket",
"contracts/protocol/Socket.sol",
[
80094,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[80094, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"84532": [],
Expand Down Expand Up @@ -1200,11 +1126,7 @@
"0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a",
"Socket",
"contracts/protocol/Socket.sol",
[
747474,
"0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18",
"EVMX"
]
[747474, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"]
]
],
"11155420": []
Expand Down
Loading