Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVolosnikov committed Aug 22, 2024
1 parent 5310926 commit 7ec0bec
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions system-contracts/contracts/EvmGasManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ contract EvmGasManager {

modifier onlySystemEvm() {
// cache use is safe since we do not support SELFDESTRUCT
uint256 slot = IS_ACCOUNT_EVM_PREFIX;
address _sender = msg.sender;
uint256 slot = IS_ACCOUNT_EVM_PREFIX | uint256(uint160(msg.sender));
bool isEVM;
assembly {
slot := add(slot, _sender)
isEVM := tload(slot)
}

Expand Down Expand Up @@ -135,13 +133,13 @@ contract EvmGasManager {
function consumeEvmFrame() external returns (uint256 passGas, bool isStatic) {
if (evmStackFrames.length == 0) return (INF_PASS_GAS, false);

EVMStackFrameInfo memory frameInfo = evmStackFrames[evmStackFrames.length - 1];
EVMStackFrameInfo storage frameInfo = evmStackFrames[evmStackFrames.length - 1];

passGas = frameInfo.passGas;
isStatic = frameInfo.isStatic;

// Mark as used
evmStackFrames[evmStackFrames.length - 1].passGas = INF_PASS_GAS;
frameInfo.passGas = INF_PASS_GAS;
}

function popEVMFrame() external {
Expand Down

0 comments on commit 7ec0bec

Please sign in to comment.