Skip to content

Commit

Permalink
Add comments about used function selectors in yul
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVolosnikov committed Jan 2, 2025
1 parent 1d8f871 commit 20f37ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions system-contracts/contracts/EvmEmulator.yul
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,14 @@ object "EvmEmulator" {
}

function getRawCodeHash(addr) -> hash {
// function getRawCodeHash(address _address)
mstore(0, 0x4DE2E46800000000000000000000000000000000000000000000000000000000)
mstore(4, addr)
hash := fetchFromSystemContract(ACCOUNT_CODE_STORAGE_SYSTEM_CONTRACT(), 36)
}

function getEvmExtcodehash(addr) -> evmCodeHash {
// function evmCodeHash(address _address)
mstore(0, 0x54A3314700000000000000000000000000000000000000000000000000000000)
mstore(4, addr)
evmCodeHash := fetchFromSystemContract(DEPLOYER_SYSTEM_CONTRACT(), 36)
Expand Down Expand Up @@ -3309,12 +3311,14 @@ object "EvmEmulator" {
}

function getRawCodeHash(addr) -> hash {
// function getRawCodeHash(address _address)
mstore(0, 0x4DE2E46800000000000000000000000000000000000000000000000000000000)
mstore(4, addr)
hash := fetchFromSystemContract(ACCOUNT_CODE_STORAGE_SYSTEM_CONTRACT(), 36)
}

function getEvmExtcodehash(addr) -> evmCodeHash {
// function evmCodeHash(address _address)
mstore(0, 0x54A3314700000000000000000000000000000000000000000000000000000000)
mstore(4, addr)
evmCodeHash := fetchFromSystemContract(DEPLOYER_SYSTEM_CONTRACT(), 36)
Expand Down
1 change: 1 addition & 0 deletions system-contracts/contracts/EvmGasManager.yul
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ object "EvmGasManager" {
}

function $llvm_AlwaysInline_llvm$__getRawSenderCodeHash() -> hash {
// function getRawCodeHash(address _address)
mstore(0, 0x4DE2E46800000000000000000000000000000000000000000000000000000000)
mstore(4, caller())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,14 @@ function getRawNonce(addr) -> nonce {
}

function getRawCodeHash(addr) -> hash {
// function getRawCodeHash(address _address)
mstore(0, 0x4DE2E46800000000000000000000000000000000000000000000000000000000)
mstore(4, addr)
hash := fetchFromSystemContract(ACCOUNT_CODE_STORAGE_SYSTEM_CONTRACT(), 36)
}

function getEvmExtcodehash(addr) -> evmCodeHash {
// function evmCodeHash(address _address)
mstore(0, 0x54A3314700000000000000000000000000000000000000000000000000000000)
mstore(4, addr)
evmCodeHash := fetchFromSystemContract(DEPLOYER_SYSTEM_CONTRACT(), 36)
Expand Down

0 comments on commit 20f37ff

Please sign in to comment.