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
import "Ownable.sol"; | |
contract EternalStorage is Ownable { | |
function EternalStorage(){ | |
} | |
mapping(bytes32 => uint) UIntStorage; | |
function getUIntValue(bytes32 record) constant returns (uint){ |
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
mapping(bytes32 => address) public organisations; | |
function createOrganisation(bytes32 key_) | |
{ | |
var tokenLedger = new TokenLedger(); | |
var eternalStorage = new EternalStorage(); | |
var organisation = new Organisation(tokenLedger, eternalStorage); | |
eternalStorage.changeOwner(organisation); |
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
import "ProposalsLibrary.sol"; | |
import "EternalStorage.sol"; | |
contract Organisation | |
{ | |
using ProposalsLibrary for EternalStorage; | |
EternalStorage public eternalStorage; | |
function Organisation(address _tokenLedger) { | |
eternalStorage = new EternalStorage(); |
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
import "ITokenLedger.sol"; | |
import "ProposalsLibrary.sol"; | |
import "SecurityLibrary.sol"; | |
contract Organisation | |
{ | |
ITokenLedger public tokenLedger; | |
using ProposalsLibrary for address; | |
using SecurityLibrary for address; | |
address public eternalStorage; |
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
import "ITokenLedger.sol"; | |
import "ProposalsLibrary.sol"; | |
import "SecurityLibrary.sol"; | |
import "DataVerifiable.sol"; | |
contract Organisation is DataVerifiable | |
{ | |
ITokenLedger public tokenLedger; | |
using ProposalsLibrary for address; | |
using SecurityLibrary for address; |
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
import "EternalStorage.sol"; | |
library VotingLibrary { | |
modifier ensurePollStatus(address _storageContract, uint256 pollId, uint256 pollStatus){ | |
var currentStatus = EternalStorage(_storageContract).getUIntValue(sha3("Poll", pollId, "status")); | |
if (pollStatus != currentStatus) { throw; } | |
_ | |
} |
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; | |
} |
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
function onHoldBalanceOf(address _storageContract, address _account) | |
constant returns (uint256 balance) | |
{ | |
return EternalStorage(_storageContract).getUIntValue(keccak256("onhold:", _account)); | |
} | |
function onHoldBalanceSet(address _storageContract, address _account, uint256 _balance) | |
{ | |
var onHoldBalance = EternalStorage(_storageContract).getUIntValue(keccak256("onhold:", _account)); | |
EternalStorage(_storageContract).setUIntValue(keccak256("onhold:", _account), onHoldBalance + _balance); |
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
function generateVoteSecret(bytes32 salt, uint256 optionId) | |
returns (bytes32) | |
{ | |
return keccak256(salt, optionId); | |
} |
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
pragma solidity ^0.4.23; | |
contract ReviewableTaskCollection { | |
function addTask() { | |
} | |
struct Task { | |
bytes32 specificationHash; | |
uint256 dueDate; |