Last active
June 20, 2020 12:47
-
-
Save ltfschoen/6729b192119314de0d789a1b1859f52e to your computer and use it in GitHub Desktop.
EncodeAndDecode
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
pragma solidity ^0.5.16; | |
contract EncodeAndDecode { | |
function encode() public view returns(bytes memory hash) { | |
return abi.encode(msg.sender, bytes("0xF785DaB2Cd075dC0a8011249357f2332972319fd")); | |
} | |
function decode(bytes memory hash) public view returns(address a, bytes memory b) { | |
(a,b) = abi.decode(hash, (address, bytes)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment