Skip to content

Instantly share code, notes, and snippets.

@devlongs
Last active August 4, 2022 13:02
Show Gist options
  • Save devlongs/f56bee8c8d8f7a91839851af528a842b to your computer and use it in GitHub Desktop.
Save devlongs/f56bee8c8d8f7a91839851af528a842b to your computer and use it in GitHub Desktop.
A snippet showing how tuple works in solidity.
// SPDX-License-Identifier:MIT
pragma solidity 0.8.0;
contract Tuple {
function getValues() public pure returns (int, bool) {
return (49, true);
}
function get() public pure returns (int) {
(int age, ) = getValues();
return age;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment