Contract 0xf2602d298541...1cd394d2ce3b
This contract is not yet documented
Know something about this contract? Switch to the History tab and suggest an edit to help preserve Ethereum history.
Key Facts
DAO Fork Era
The controversial fork to recover funds from The DAO hack.
Bytecode Overview
Verified Source Available
This contract has verified source code on Etherscan.
Show source code (Solidity)
{
"language": "Solidity",
"sources": {
"ETCSurvey.sol": {
"content": "contract Devcon2Interface {\r\n function isTokenOwner(address _owner) constant returns (bool);\r\n function ownedToken(address _owner) constant returns (bytes32 tokenId);\r\n}\r\n\r\n\r\ncontract Survey {\r\n Devcon2Interface public devcon2Token;\r\n\r\n // Mapping from tokenId to boolean noting whether this token has responded.\r\n mapping (bytes32 => bool) public hasResponded;\r\n \r\n // The timestamp when this survey will end.\r\n uint public surveyEndAt;\r\n\r\n // The question we wish to ask the token holders.\r\n string public question;\r\n\r\n // An array of answer options.\r\n bytes32[] public responseOptions;\r\n\r\n // Helper for accessing the number of options programatically.\r\n uint public numResponseOptions;\r\n\r\n // Histogram of the responses as a mapping from option index to number of\r\n // responses for that option.\r\n mapping (uint => uint) public responseCounts;\r\n\r\n // Total number of responses.\r\n uint public numResponses;\r\n\r\n // Event for logging response submissions.\r\n event Response(bytes32 indexed tokenId, uint responseId);\r\n\r\n /// @dev Sets up the survey contract\r\n /// @param tokenAddress Address of Devcon2 Identity Token contract.\r\n /// @param duration Integer duration the survey should remain open and accept answers.\r\n /// @param _question String the survey question.\r\n /// @param _responseOptions Array of Bytes32 allowed survey response options.\r\n function Survey(address tokenAddress, uint duration, string _question, bytes32[] _responseOptions) {\r\n devcon2Token = Devcon2Interface(tokenAddress);\r\n question = _question;\r\n numResponseOptions = _responseOptions.length;\r\n for (uint i=0; i < numResponseOptions; i++) {\r\n responseOptions.push(_responseOptions[i]);\r\n }\r\n surveyEndAt = now + duration;\r\n }\r\n\r\n /// @dev Respond to the survey\r\n /// @param responseId Integer index of the response option being submitted.\r\n function respond(uint responseId) returns (bool) {\r\n // Check our survey hasn't ended.\r\n if (now >= surveyEndAt) return false;\r\n\r\n // Only allow token holders\r\n if (!devcon2Token.isTokenOwner(msg.sender)) return false;\r\n\r\n // Each token has a unique bytes32 identifier. Since tokens are\r\n // transferable, we want to use this value instead of the owner address\r\n // for preventing the same owner from responding multiple times.\r\n var tokenId = devcon2Token.ownedToken(msg.sender);\r\n\r\n // Sanity check. The 0x0 token is invalid which means something went\r\n // wrong.\r\n if (tokenId == 0x0) throw;\r\n\r\n // verify that this token has not yet responded.\r\n if (hasResponded[tokenId]) return false;\r\n\r\n // verify the response is valid\r\n if (responseId >= responseOptions.length) return false;\r\n\r\n responseCounts[responseId] += 1;\r\n\r\n // log the response.\r\n Response(tokenId, responseId);\r\n\r\n // Mark this token as having responded to the question.\r\n hasResponded[tokenId] = true;\r\n\r\n // increment the response counter\r\n numResponses += 1;\r\n }\r\n}\r\n\r\n\r\ncontract MainnetSurvey is Survey {\r\n function MainnetSurvey(uint duration, string _question, bytes32[] _responseOptions) Survey(0xabf65a51c7adc3bdef0adf8992884be38072c184, duration, _question, _responseOptions) {\r\n }\r\n}\r\n\r\n\r\ncontract ETCSurvey is MainnetSurvey {\r\n function ETCSurvey() MainnetSurvey(\r\n 2 weeks,\r\n \"Do plan to pursue any development or involvement on the Ethereum Classic blockchain\",\r\n _options\r\n )\r\n {\r\n bytes32[] memory _options = new bytes32[](4);\r\n _options[0] = \"No Answer\";\r\n _options[1] = \"Yes\";\r\n _options[2] = \"No\";\r\n _options[3] = \"Undecided\";\r\n }\r\n}"
}
},
"settings": {
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"compilationTarget": {
"ETCSurvey.sol": "ETCSurvey"
}
}
}External Links
Related contracts
MemberRegistry
Same deployerOwner-controlled dynamic-array member registry.
0x1f3b19...7c161aAugust 13, 2015Members
Same deployerOwner-controlled member registry with array + mapping tracking.
0xaeb2ac...a5fd37August 14, 2015MembershipRoster
Same deployerAn Ethereum Public Trust roster contract for adding, removing, and checking members.
0xf1d327...aa0455August 14, 2015KillMul
Same deployerTest/utility contract with `suicide(address)` kill switch and a `multiply2` helper.
0x3e5e1f...7c78cdAugust 14, 2015Members
Same deployerOwner-controlled member registry using sequential id + mapping storage.
0xc6810e...db4e6fAugust 14, 2015EthereumAlarmClock
Same deployerThe first deployment of Piper Merriam's Ethereum Alarm Clock, a smart contract protocol for scheduling transactions at future block numbers, launched on Septemb
0xb0059e...cc0cc1September 22, 2015