Skip to content
Verified contractPartial

Poll

Address0x8aa24d24713a41beb82bec6484bbe99a1c0dc34b
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.1.5

 

Same code

Only this contract

 

Details

Compiler
solc 0.1.5+commit.23865e39
Language
solidity
Optimization
No
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
397,148
Creation transaction
0x9d5f2ed5dd…2133a11963

Poll.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract Poll {
    struct PollData {
        address owner;
        string question;
        uint maxVotes;
        string options;
        bool closed;
    }

    event Voted(bytes32 v);

    bytes16[] public votes;
    uint numVotes;
    PollData public p;

    function Poll(string _options, string _question, uint _maxVotes) {
        p.owner = msg.sender;
        p.options = _options;
        p.question = _question;
        p.maxVotes = _maxVotes;
        p.closed = false;
    }

    function vote(bytes16 v) returns (uint) {
        if (msg.sender != p.owner || p.closed == true) return 0;
        votes[numVotes] = v;
        numVotes++;
        Voted(v);
        if (votes.length >= p.maxVotes) endPoll();
        return 1;
    }

    function endPoll() returns (uint) {
        if (msg.sender != p.owner) return 0;
        p.closed = true;
        return 1;
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.