Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- PollingEmitter
- Optimization enabled
- false
- Compiler version
- v0.6.6+commit.6c089d02
- EVM Version
- istanbul
- Verified at
- 2026-04-25T14:31:52.063607Z
browser/Polling.sol
pragma solidity >=0.5.0;
contract PollingEvents {
event PollCreated(
address indexed creator,
uint256 blockCreated,
uint256 indexed pollId,
uint256 startDate,
uint256 endDate,
string multiHash,
string url
);
event PollWithdrawn(
address indexed creator,
uint256 blockWithdrawn,
uint256 pollId
);
event Voted(
address indexed voter,
uint256 indexed pollId,
uint256 indexed optionId
);
}
contract PollingEmitter is PollingEvents {
uint256 public npoll;
function createPoll(uint256 startDate, uint256 endDate, string calldata multiHash, string calldata url)
external
{
uint256 startDate_ = startDate > now ? startDate : now;
require(endDate > startDate_, "polling-invalid-poll-window");
emit PollCreated(
msg.sender,
block.number,
npoll,
startDate_,
endDate,
multiHash,
url
);
require(npoll < uint(-1), "polling-too-many-polls");
npoll++;
}
function withdrawPoll(uint256 pollId)
external
{
emit PollWithdrawn(msg.sender, block.number, pollId);
}
function vote(uint256 pollId, uint256 optionId)
external
{
emit Voted(msg.sender, pollId, optionId);
}
function withdrawPoll(uint256[] calldata pollIds)
external
{
for (uint i = 0; i < pollIds.length; i++) {
emit PollWithdrawn(msg.sender, pollIds[i], block.number);
}
}
function vote(uint256[] calldata pollIds, uint256[] calldata optionIds)
external
{
require(pollIds.length == optionIds.length, "non-matching-length");
for (uint i = 0; i < pollIds.length; i++) {
emit Voted(msg.sender, pollIds[i], optionIds[i]);
}
}
}
Compiler Settings
{"remappings":[],"optimizer":{"runs":200,"enabled":false},"metadata":{"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"istanbul","compilationTarget":{"browser/Polling.sol":"PollingEmitter"}}
Contract ABI
[{"type":"event","name":"PollCreated","inputs":[{"type":"address","name":"creator","internalType":"address","indexed":true},{"type":"uint256","name":"blockCreated","internalType":"uint256","indexed":false},{"type":"uint256","name":"pollId","internalType":"uint256","indexed":true},{"type":"uint256","name":"startDate","internalType":"uint256","indexed":false},{"type":"uint256","name":"endDate","internalType":"uint256","indexed":false},{"type":"string","name":"multiHash","internalType":"string","indexed":false},{"type":"string","name":"url","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"PollWithdrawn","inputs":[{"type":"address","name":"creator","internalType":"address","indexed":true},{"type":"uint256","name":"blockWithdrawn","internalType":"uint256","indexed":false},{"type":"uint256","name":"pollId","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Voted","inputs":[{"type":"address","name":"voter","internalType":"address","indexed":true},{"type":"uint256","name":"pollId","internalType":"uint256","indexed":true},{"type":"uint256","name":"optionId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"createPoll","inputs":[{"type":"uint256","name":"startDate","internalType":"uint256"},{"type":"uint256","name":"endDate","internalType":"uint256"},{"type":"string","name":"multiHash","internalType":"string"},{"type":"string","name":"url","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"npoll","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"vote","inputs":[{"type":"uint256[]","name":"pollIds","internalType":"uint256[]"},{"type":"uint256[]","name":"optionIds","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"vote","inputs":[{"type":"uint256","name":"pollId","internalType":"uint256"},{"type":"uint256","name":"optionId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawPoll","inputs":[{"type":"uint256","name":"pollId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawPoll","inputs":[{"type":"uint256[]","name":"pollIds","internalType":"uint256[]"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b50610788806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063603af06f146100675780638196b3f7146100955780638733ece71461010e578063b384abef146101dc578063d35f19d714610214578063d54a817614610232575b600080fd5b6100936004803603602081101561007d57600080fd5b8101908080359060200190929190505050610314565b005b61010c600480360360208110156100ab57600080fd5b81019080803590602001906401000000008111156100c857600080fd5b8201836020820111156100da57600080fd5b803590602001918460208302840111640100000000831117156100fc57600080fd5b909192939192939050505061036d565b005b6101da6004803603604081101561012457600080fd5b810190808035906020019064010000000081111561014157600080fd5b82018360208201111561015357600080fd5b8035906020019184602083028401116401000000008311171561017557600080fd5b90919293919293908035906020019064010000000081111561019657600080fd5b8201836020820111156101a857600080fd5b803590602001918460208302840111640100000000831117156101ca57600080fd5b90919293919293905050506103f8565b005b610212600480360360408110156101f257600080fd5b810190808035906020019092919080359060200190929190505050610501565b005b61021c61054a565b6040518082815260200191505060405180910390f35b6103126004803603608081101561024857600080fd5b8101908080359060200190929190803590602001909291908035906020019064010000000081111561027957600080fd5b82018360208201111561028b57600080fd5b803590602001918460018302840111640100000000831117156102ad57600080fd5b9091929391929390803590602001906401000000008111156102ce57600080fd5b8201836020820111156102e057600080fd5b8035906020019184600183028401116401000000008311171561030257600080fd5b9091929391929390505050610550565b005b3373ffffffffffffffffffffffffffffffffffffffff167f7e816826910b70789c9de9051404b61689ff0e3dcb3e0d73f447b1d797fbdcb04383604051808381526020018281526020019250505060405180910390a250565b60008090505b828290508110156103f3573373ffffffffffffffffffffffffffffffffffffffff167f7e816826910b70789c9de9051404b61689ff0e3dcb3e0d73f447b1d797fbdcb08484848181106103c257fe5b9050602002013543604051808381526020018281526020019250505060405180910390a28080600101915050610373565b505050565b818190508484905014610473576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6e6f6e2d6d61746368696e672d6c656e6774680000000000000000000000000081525060200191505060405180910390fd5b60008090505b848490508110156104fa5782828281811061049057fe5b905060200201358585838181106104a357fe5b905060200201353373ffffffffffffffffffffffffffffffffffffffff167fea66f58e474bc09f580000e81f31b334d171db387d0c6098ba47bd897741679b60405160405180910390a48080600101915050610479565b5050505050565b80823373ffffffffffffffffffffffffffffffffffffffff167fea66f58e474bc09f580000e81f31b334d171db387d0c6098ba47bd897741679b60405160405180910390a45050565b60005481565b600042871161055f5742610561565b865b90508086116105d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f706f6c6c696e672d696e76616c69642d706f6c6c2d77696e646f77000000000081525060200191505060405180910390fd5b6000543373ffffffffffffffffffffffffffffffffffffffff167f4d9a807e05ec038d31d248a43818a2234c2a467865e998b3d4da029d9123b5c243848a8a8a8a8a6040518088815260200187815260200186815260200180602001806020018381038352878782818152602001925080828437600081840152601f19601f8201169050808301925050508381038252858582818152602001925080828437600081840152601f19601f820116905080830192505050995050505050505050505060405180910390a37fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60005410610738576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f706f6c6c696e672d746f6f2d6d616e792d706f6c6c730000000000000000000081525060200191505060405180910390fd5b60008081548092919060010191905055505050505050505056fea264697066735822122003aa7a189b0151dcd30db6acaaef93d418294725d0aa9b400f0a867044349b9164736f6c63430006060033
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063603af06f146100675780638196b3f7146100955780638733ece71461010e578063b384abef146101dc578063d35f19d714610214578063d54a817614610232575b600080fd5b6100936004803603602081101561007d57600080fd5b8101908080359060200190929190505050610314565b005b61010c600480360360208110156100ab57600080fd5b81019080803590602001906401000000008111156100c857600080fd5b8201836020820111156100da57600080fd5b803590602001918460208302840111640100000000831117156100fc57600080fd5b909192939192939050505061036d565b005b6101da6004803603604081101561012457600080fd5b810190808035906020019064010000000081111561014157600080fd5b82018360208201111561015357600080fd5b8035906020019184602083028401116401000000008311171561017557600080fd5b90919293919293908035906020019064010000000081111561019657600080fd5b8201836020820111156101a857600080fd5b803590602001918460208302840111640100000000831117156101ca57600080fd5b90919293919293905050506103f8565b005b610212600480360360408110156101f257600080fd5b810190808035906020019092919080359060200190929190505050610501565b005b61021c61054a565b6040518082815260200191505060405180910390f35b6103126004803603608081101561024857600080fd5b8101908080359060200190929190803590602001909291908035906020019064010000000081111561027957600080fd5b82018360208201111561028b57600080fd5b803590602001918460018302840111640100000000831117156102ad57600080fd5b9091929391929390803590602001906401000000008111156102ce57600080fd5b8201836020820111156102e057600080fd5b8035906020019184600183028401116401000000008311171561030257600080fd5b9091929391929390505050610550565b005b3373ffffffffffffffffffffffffffffffffffffffff167f7e816826910b70789c9de9051404b61689ff0e3dcb3e0d73f447b1d797fbdcb04383604051808381526020018281526020019250505060405180910390a250565b60008090505b828290508110156103f3573373ffffffffffffffffffffffffffffffffffffffff167f7e816826910b70789c9de9051404b61689ff0e3dcb3e0d73f447b1d797fbdcb08484848181106103c257fe5b9050602002013543604051808381526020018281526020019250505060405180910390a28080600101915050610373565b505050565b818190508484905014610473576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6e6f6e2d6d61746368696e672d6c656e6774680000000000000000000000000081525060200191505060405180910390fd5b60008090505b848490508110156104fa5782828281811061049057fe5b905060200201358585838181106104a357fe5b905060200201353373ffffffffffffffffffffffffffffffffffffffff167fea66f58e474bc09f580000e81f31b334d171db387d0c6098ba47bd897741679b60405160405180910390a48080600101915050610479565b5050505050565b80823373ffffffffffffffffffffffffffffffffffffffff167fea66f58e474bc09f580000e81f31b334d171db387d0c6098ba47bd897741679b60405160405180910390a45050565b60005481565b600042871161055f5742610561565b865b90508086116105d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f706f6c6c696e672d696e76616c69642d706f6c6c2d77696e646f77000000000081525060200191505060405180910390fd5b6000543373ffffffffffffffffffffffffffffffffffffffff167f4d9a807e05ec038d31d248a43818a2234c2a467865e998b3d4da029d9123b5c243848a8a8a8a8a6040518088815260200187815260200186815260200180602001806020018381038352878782818152602001925080828437600081840152601f19601f8201169050808301925050508381038252858582818152602001925080828437600081840152601f19601f820116905080830192505050995050505050505050505060405180910390a37fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60005410610738576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f706f6c6c696e672d746f6f2d6d616e792d706f6c6c730000000000000000000081525060200191505060405180910390fd5b60008081548092919060010191905055505050505050505056fea264697066735822122003aa7a189b0151dcd30db6acaaef93d418294725d0aa9b400f0a867044349b9164736f6c63430006060033