Last active
September 29, 2016 06:12
-
-
Save elenadimitrova/26eae4eed096b8ff1a92d33acc413e3a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/// @notice Checks if an address is 'locked' due to any present unresolved votes | |
function isAddressLocked(address _storageContract, address userAddress) | |
constant returns (bool) { | |
var zeroPollCloseTimeNext = EternalStorage(_storageContract) | |
.getUIntValue(sha3("Voting", userAddress, uint256(0), "nextTimestamp")); | |
// The list is empty, no unrevealed votes for this address | |
if (zeroPollCloseTimeNext == 0){ | |
return false; | |
} | |
// The poll is still open for voting and tokens transfer | |
if (now < zeroPollCloseTimeNext){ | |
return false; | |
} | |
else { | |
// The poll is closed for voting and is in the reveal period, during which all voters' tokens are locked until reveal | |
// Note: even after the poll is resolved, tokens remain locked until reveal | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment