Skip to content
Verified contractPartial

Poll

Address0x26a57cedc6cbc02a8de504c7e1216daabda4184b
Balance

0 ETH

 

Transactions

451

 

Compiler

solc 0.1.7

 

Same code

43 more contracts

 

Details

Compiler
solc 0.1.7+commit.b4e666cc
Language
solidity
Optimization
No
License
Not stated
Match
Partialcreation code: no, runtime code: yes
Verified on Sourcify
Created in block
604,822
Creation transaction
0x55864eabaa…9b5c03ecb9

Poll.sol

// Submitted by EthereumHistory (ethereumhistory.com)
contract Poll {
    struct PollData {
        address owner;
        string question;
        uint maxVotes;
        string options;
        uint created;
        bool open;
        uint votes;
    }

    PollData public p;

    event NewVote(string vote);

    function vote(string text) returns (uint) {
        if (msg.sender != p.owner || p.open != true) return 0;
        p.votes += 1;
        NewVote(text);
        if (p.maxVotes > 0) {
            if (p.votes >= p.maxVotes) endPoll();
        }
        return 1;
    }

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

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.