Back to HomePart of The Piper Merriam CollectionDeployer Piper Merriam(0xd3cda9...293601) Deployment Block 2,304,698 Deployment Date Sep 22, 2016, 06:17 AM Code Size 1005.0 B
Contract 0xdb6d68e1d8c3...2e502b4c67ba
Deployed September 22, 2016 (9 years ago)Block 2,304,698
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.
DAO Fork EraVerified Source
Key Facts
DAO Fork Era
The controversial fork to recover funds from The DAO hack.
Block span: 1,920,000 — 2,462,999
July 20, 2016 — October 18, 2016
Bytecode Overview
Opcodes1,005
Unique Opcodes126
Jump Instructions54
Storage Operations23
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"
}
}
}