Skip to content

Instantly share code, notes, and snippets.

@PatrickAlphaC
Created November 24, 2021 21:27
Embed
What would you like to do?
// This example code is designed to quickly deploy an example contract using Remix.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract EncodingFun {
function encodeThenDecode(uint256 value) public pure returns (uint256) {
bytes memory encodedData = abi.encodePacked(value);
uint256 decodedData = abi.decode(encodedData, (uint256));
return decodedData;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment