Skip to content

Commit c63edb4

Browse files
committed
more hex memory positions
1 parent a046071 commit c63edb4

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

contracts/metatx/ERC2771Forwarder.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ contract ERC2771Forwarder is EIP712, Nonces {
287287
uint256 gasLeft;
288288

289289
assembly ("memory-safe") {
290-
success := call(reqGas, to, value, add(data, 0x20), mload(data), 0, 0)
290+
success := call(reqGas, to, value, add(data, 0x20), mload(data), 0x00, 0x00)
291291
gasLeft := gas()
292292
}
293293

@@ -318,9 +318,9 @@ contract ERC2771Forwarder is EIP712, Nonces {
318318
// |-----------|----------|--------------------------------------------------------------------|
319319
// | | | result ↓ |
320320
// | 0x00:0x1F | selector | 0x0000000000000000000000000000000000000000000000000000000000000001 |
321-
success := staticcall(gas(), target, add(encodedParams, 0x20), mload(encodedParams), 0, 0x20)
321+
success := staticcall(gas(), target, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
322322
returnSize := returndatasize()
323-
returnValue := mload(0)
323+
returnValue := mload(0x00)
324324
}
325325

326326
return success && returnSize >= 0x20 && returnValue > 0;

contracts/proxy/Proxy.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ abstract contract Proxy {
2424
// Copy msg.data. We take full control of memory in this inline assembly
2525
// block because it will not return to Solidity code. We overwrite the
2626
// Solidity scratch pad at memory position 0.
27-
calldatacopy(0, 0, calldatasize())
27+
calldatacopy(0x00, 0x00, calldatasize())
2828

2929
// Call the implementation.
3030
// out and outsize are 0 because we don't know the size yet.
31-
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
31+
let result := delegatecall(gas(), implementation, 0x00, calldatasize(), 0x00, 0x00)
3232

3333
// Copy the returned data.
34-
returndatacopy(0, 0, returndatasize())
34+
returndatacopy(0x00, 0x00, returndatasize())
3535

3636
switch result
3737
// delegatecall returns 0 on error.
3838
case 0 {
39-
revert(0, returndatasize())
39+
revert(0x00, returndatasize())
4040
}
4141
default {
42-
return(0, returndatasize())
42+
return(0x00, returndatasize())
4343
}
4444
}
4545
}

contracts/utils/LowLevelCall.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ library LowLevelCall {
1717
/// @dev Same as {callNoReturn}, but allows to specify the value to be sent in the call.
1818
function callNoReturn(address target, uint256 value, bytes memory data) internal returns (bool success) {
1919
assembly ("memory-safe") {
20-
success := call(gas(), target, value, add(data, 0x20), mload(data), 0, 0)
20+
success := call(gas(), target, value, add(data, 0x20), mload(data), 0x00, 0x00)
2121
}
2222
}
2323

@@ -40,7 +40,7 @@ library LowLevelCall {
4040
bytes memory data
4141
) internal returns (bool success, bytes32 result1, bytes32 result2) {
4242
assembly ("memory-safe") {
43-
success := call(gas(), target, value, add(data, 0x20), mload(data), 0, 0x40)
43+
success := call(gas(), target, value, add(data, 0x20), mload(data), 0x00, 0x40)
4444
result1 := mload(0x00)
4545
result2 := mload(0x20)
4646
}
@@ -49,7 +49,7 @@ library LowLevelCall {
4949
/// @dev Performs a Solidity function call using a low level `staticcall` and ignoring the return data.
5050
function staticcallNoReturn(address target, bytes memory data) internal view returns (bool success) {
5151
assembly ("memory-safe") {
52-
success := staticcall(gas(), target, add(data, 0x20), mload(data), 0, 0)
52+
success := staticcall(gas(), target, add(data, 0x20), mload(data), 0x00, 0x00)
5353
}
5454
}
5555

0 commit comments

Comments
 (0)