From ffae9785eb2b64fc35e24037f84600ed457cfee7 Mon Sep 17 00:00:00 2001 From: Shebin John Date: Thu, 9 Jan 2025 11:32:34 +0100 Subject: [PATCH] I-02. Some comments say keccak instead of keccak256 --- contracts/common/SecuredTokenTransfer.sol | 2 +- contracts/proxies/SafeProxy.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/common/SecuredTokenTransfer.sol b/contracts/common/SecuredTokenTransfer.sol index 359eb231a..382bcb059 100644 --- a/contracts/common/SecuredTokenTransfer.sol +++ b/contracts/common/SecuredTokenTransfer.sol @@ -16,7 +16,7 @@ abstract contract SecuredTokenTransfer { * @return transferred Returns true if the transfer was successful */ function transferToken(address token, address receiver, uint256 amount) internal returns (bool transferred) { - // 0xa9059cbb - keccak("transfer(address,uint256)") + // 0xa9059cbb - bytes4(keccak256("transfer(address,uint256)")) bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount); /* solhint-disable no-inline-assembly */ /// @solidity memory-safe-assembly diff --git a/contracts/proxies/SafeProxy.sol b/contracts/proxies/SafeProxy.sol index 42e0f477c..10c4931af 100644 --- a/contracts/proxies/SafeProxy.sol +++ b/contracts/proxies/SafeProxy.sol @@ -38,7 +38,7 @@ contract SafeProxy { /* solhint-disable no-inline-assembly */ assembly { let _singleton := sload(0) - // 0xa619486e == keccak("masterCopy()"). The value is right padded to 32-bytes with 0s + // 0xa619486e == bytes4(keccak256("masterCopy()")). The value is right padded to 32-bytes with 0s if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) { // We mask the singleton address when handling the `masterCopy()` call to ensure that it is correctly // ABI-encoded. We do this by shifting the address left by 96 bits (or 12 bytes) and then storing it in