Skip to content

Instantly share code, notes, and snippets.

@nhancv
Last active November 8, 2021 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nhancv/ce3d1d7a49a55b2213e89483e1dd5548 to your computer and use it in GitHub Desktop.
Save nhancv/ce3d1d7a49a55b2213e89483e1dd5548 to your computer and use it in GitHub Desktop.
AbiEncode
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
contract AbiEncode {
function encode() public pure returns (bytes memory) {
uint[2] memory amounts = [uint(1e18), uint(99e18)];
bytes memory userData = abi.encode(0, amounts);
return userData;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment