Last active
July 23, 2020 16:42
-
-
Save Neurone/83bfbd85ef79387f760154999eb4f192 to your computer and use it in GitHub Desktop.
Load this file into remix-ide (Realtime Ethereum Contract Compiler and Runtime) by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.9+commit.3e3065ac.js&optimize=false&gist=83bfbd85ef79387f760154999eb4f192
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
// https://ethereum.stackexchange.com/questions/85224/access-tuples-elements | |
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.5.0 <0.8.0; | |
contract myContract { | |
uint index; | |
function myFunction() public { | |
( , , uint256 standardDepositAmount, , ) = returnTuple(); | |
require(standardDepositAmount == 3); | |
// do something... | |
} | |
function returnTuple() public pure returns (uint, uint, uint, uint, uint) { | |
return (1, 2, 3, 4, 5); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment