Created
February 25, 2023 21:36
-
-
Save PaulRBerg/34112227fac32d413c44b9fc5b9f86d4 to your computer and use it in GitHub Desktop.
Toy example to see how `abi.encode` works with zero values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.8.19; | |
contract Contract { | |
function foo(bytes32 seed) external view returns (bytes memory) { | |
return abi.encode(tx.origin, seed); | |
} | |
function getBytes32(uint256 number) external pure returns (bytes32) { | |
return bytes32(number); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment