ETH Price: $2,772.87 (+3.51%)

Contract

0x558EC79fe4b80BB60Ba63a8DDeb33dcAA8eb8335
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer66558922018-11-06 19:47:012299 days ago1541533621IN
0x558EC79f...AA8eb8335
0.04 ETH0.0022210141
Transfer66558662018-11-06 19:42:442299 days ago1541533364IN
0x558EC79f...AA8eb8335
0.05 ETH0.0021668440
Transfer66558492018-11-06 19:38:402299 days ago1541533120IN
0x558EC79f...AA8eb8335
1.6 ETH0.0028360141
Transfer66552272018-11-06 17:05:522300 days ago1541523952IN
0x558EC79f...AA8eb8335
0.1 ETH0.0028360141
Transfer66552242018-11-06 17:04:472300 days ago1541523887IN
0x558EC79f...AA8eb8335
0.05 ETH0.0027668440
Transfer66550372018-11-06 16:26:532300 days ago1541521613IN
0x558EC79f...AA8eb8335
0.02 ETH0.0022210141
Transfer66550132018-11-06 16:21:002300 days ago1541521260IN
0x558EC79f...AA8eb8335
0.19677389 ETH0.0010834220
Transfer66548042018-11-06 15:28:312300 days ago1541518111IN
0x558EC79f...AA8eb8335
0.05 ETH0.0028360141
Transfer66547272018-11-06 15:12:112300 days ago1541517131IN
0x558EC79f...AA8eb8335
0.03 ETH0.0013834220
Transfer66546672018-11-06 14:59:032300 days ago1541516343IN
0x558EC79f...AA8eb8335
0.01 ETH0.000529529.775
Transfer66546352018-11-06 14:51:342300 days ago1541515894IN
0x558EC79f...AA8eb8335
0.02 ETH0.0007954611.5

Latest 11 internal transactions

Advanced mode:
Parent Transaction Hash Block
From
To
66558922018-11-06 19:47:012299 days ago1541533621
0x558EC79f...AA8eb8335
0.04 ETH
66558662018-11-06 19:42:442299 days ago1541533364
0x558EC79f...AA8eb8335
0.05 ETH
66558492018-11-06 19:38:402299 days ago1541533120
0x558EC79f...AA8eb8335
1.6 ETH
66552272018-11-06 17:05:522300 days ago1541523952
0x558EC79f...AA8eb8335
0.1 ETH
66552242018-11-06 17:04:472300 days ago1541523887
0x558EC79f...AA8eb8335
0.05 ETH
66550372018-11-06 16:26:532300 days ago1541521613
0x558EC79f...AA8eb8335
0.02 ETH
66550132018-11-06 16:21:002300 days ago1541521260
0x558EC79f...AA8eb8335
0.19677389 ETH
66548042018-11-06 15:28:312300 days ago1541518111
0x558EC79f...AA8eb8335
0.05 ETH
66547272018-11-06 15:12:112300 days ago1541517131
0x558EC79f...AA8eb8335
0.03 ETH
66546672018-11-06 14:59:032300 days ago1541516343
0x558EC79f...AA8eb8335
0.01 ETH
66546352018-11-06 14:51:342300 days ago1541515894
0x558EC79f...AA8eb8335
0.02 ETH
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xcB44bcC5...a9E21c505
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
VotingChallengeProxy

Compiler Version
v0.4.25+commit.59dbf8f1

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-11-01
*/

pragma solidity ^0.4.17;

/**
    This contract represents a sort of time-limited challenge,
    where users can vote for some candidates.
    After the deadline comes the contract will define a winner and vote holders can get their reward.
**/
contract VotingChallenge {
    uint public challengeDuration;
    uint public challengePrize;
    uint public creatorPrize;
    uint public cryptoVersusPrize;
    uint public challengeStarted;
    uint public candidatesNumber;
    address public creator;
    uint16 public creatorFee;       // measured in in tenths of a percent
    address public cryptoVersusWallet;
    uint16 public cryptoVersusFee;  // measured in in tenths of a percent
    uint public winner;
    bool public isVotingPeriod;
    bool public beforeVoting;
    uint[] public votes;
    mapping( address => mapping (uint => uint)) public userVotesDistribution;
    uint private lastPayment;

    // Modifiers
    modifier inVotingPeriod() {
        require(isVotingPeriod);
        _;
    }

    modifier afterVotingPeriod() {
        require(!isVotingPeriod);
        _;
    }

    modifier onlyCreator() {
        require(msg.sender == creator);
        _;
    }

    // Events
    event ChallengeBegins(address _creator, uint16 _creatorFee, uint _candidatesNumber, uint _challengeDuration);
    event NewVotesFor(address _participant, uint _candidate, uint _votes);
    event TransferVotes(address _from, address _to, uint _candidateIndex, uint _votes);
    event EndOfChallenge(uint _winner, uint _winnerVotes, uint _challengePrize);
    event RewardWasPaid(address _participant, uint _amount);
    event CreatorRewardWasPaid(address _creator, uint _amount);
    event CryptoVersusRewardWasPaid(address _cryptoVersusWallet, uint _amount);

    // Constructor
    constructor(uint _challengeDuration, uint _candidatesNumber, uint16 _creatorFee) public {
        challengeDuration = _challengeDuration;
        candidatesNumber = _candidatesNumber;
        votes.length = candidatesNumber + 1; // we will never use the first elements of array (with zero index)
        creator = msg.sender;
        cryptoVersusWallet = 0xa0bedE75cfeEF0266f8A31b47074F5f9fBE1df80;
        creatorFee = _creatorFee;
        cryptoVersusFee = 25;
        beforeVoting = true;

        // Check that creatorFee and cryptoVersusFee are less than 1000
        if(creatorFee > 1000) {
            creatorFee = 1000;
            cryptoVersusFee = 0;
            return;
        }
        if(cryptoVersusFee > 1000) {
            cryptoVersusFee = 1000;
            creatorFee = 0;
            return;
        }
        if(creatorFee + cryptoVersusFee > 1000) {
            cryptoVersusFee = 1000 - creatorFee;
        }
    }

    // Last block timestamp getter
    function getTime() public view returns (uint) {
        return now;
    }

    function getAllVotes() public view returns (uint[]) {
        return votes;
    }

    // Start challenge
    function startChallenge() public onlyCreator {
        require(beforeVoting);
        isVotingPeriod = true;
        beforeVoting = false;
        challengeStarted = now;

        emit ChallengeBegins(creator, creatorFee, candidatesNumber, challengeDuration);
    }

    // Change creator address
    function changeCreator(address newCreator) public onlyCreator {
        creator = newCreator;
    }

    // Change Crypto Versus wallet address
    function changeWallet(address newWallet) public {
        require(msg.sender == cryptoVersusWallet);
        cryptoVersusWallet = newWallet;
    }

    // Vote for candidate
    function voteForCandidate(uint candidate) public payable inVotingPeriod {
        require(candidate <= candidatesNumber);
        require(candidate > 0);
        require(msg.value > 0);

        lastPayment = msg.value;
        if(checkEndOfChallenge()) {
            msg.sender.transfer(lastPayment);
            return;
        }
        lastPayment = 0;

        // Add new votes for community
        votes[candidate] += msg.value;

        // Change the votes distribution
        userVotesDistribution[msg.sender][candidate] += msg.value;

        // Fire the event
        emit NewVotesFor(msg.sender, candidate, msg.value);
    }

    // Vote for candidate
    function voteForCandidate_(uint candidate, address sender) public payable inVotingPeriod {
        require(candidate <= candidatesNumber);
        require(candidate > 0);
        require(msg.value > 0);

        lastPayment = msg.value;
        if(checkEndOfChallenge()) {
            sender.transfer(lastPayment);
            return;
        }
        lastPayment = 0;

        // Add new votes for community
        votes[candidate] += msg.value;

        // Change the votes distribution
        userVotesDistribution[sender][candidate] += msg.value;

        // Fire the event
        emit NewVotesFor(sender, candidate, msg.value);
    }

    // Transfer votes to anybody
    function transferVotes (address to, uint candidate) public inVotingPeriod {
        require(userVotesDistribution[msg.sender][candidate] > 0);
        uint votesToTransfer = userVotesDistribution[msg.sender][candidate];
        userVotesDistribution[msg.sender][candidate] = 0;
        userVotesDistribution[to][candidate] += votesToTransfer;

        // Fire the event
        emit TransferVotes(msg.sender, to, candidate, votesToTransfer);
    }

    // Check the deadline
    // If success then define a winner and close the challenge
    function checkEndOfChallenge() public inVotingPeriod returns (bool) {
        if (challengeStarted + challengeDuration > now)
            return false;
        uint theWinner;
        uint winnerVotes;
        uint actualBalance = address(this).balance - lastPayment;

        for (uint i = 1; i <= candidatesNumber; i++) {
            if (votes[i] > winnerVotes) {
                winnerVotes = votes[i];
                theWinner = i;
            }
        }
        winner = theWinner;
        creatorPrize = (actualBalance * creatorFee) / 1000;
        cryptoVersusPrize = (actualBalance * cryptoVersusFee) / 1000;
        challengePrize = actualBalance - creatorPrize - cryptoVersusPrize;
        isVotingPeriod = false;

        // Fire the event
        emit EndOfChallenge(winner, winnerVotes, challengePrize);
        return true;
    }

    // Send a reward if user voted for a winner
    function getReward() public afterVotingPeriod {
        if (userVotesDistribution[msg.sender][winner] > 0) {
            // Compute a vote ratio and send the reward
            uint userVotesForWinner = userVotesDistribution[msg.sender][winner];
            userVotesDistribution[msg.sender][winner] = 0;
            uint reward = (challengePrize * userVotesForWinner) / votes[winner];
            msg.sender.transfer(reward);

            // Fire the event
            emit RewardWasPaid(msg.sender, reward);
        }
    }

    // Send a reward if user voted for a winner
    function sendReward(address to) public afterVotingPeriod {
        if (userVotesDistribution[to][winner] > 0) {
            // Compute a vote ratio and send the reward
            uint userVotesForWinner = userVotesDistribution[to][winner];
            userVotesDistribution[to][winner] = 0;
            uint reward = (challengePrize * userVotesForWinner) / votes[winner];
            to.transfer(reward);

            // Fire the event
            emit RewardWasPaid(to, reward);
        }
    }

    // Send a reward to challenge creator
    function sendCreatorReward() public afterVotingPeriod {
        if (creatorPrize > 0) {
            uint creatorReward = creatorPrize;
            creatorPrize = 0;
            creator.transfer(creatorReward);

            // Fire the event
            emit CreatorRewardWasPaid(creator, creatorReward);
        }
    }

    // Send a reward to cryptoVersusWallet
    function sendCryptoVersusReward() public afterVotingPeriod {
        if (cryptoVersusPrize > 0) {
            uint cryptoVersusReward = cryptoVersusPrize;
            cryptoVersusPrize = 0;
            cryptoVersusWallet.transfer(cryptoVersusReward);

            // Fire the event
            emit CryptoVersusRewardWasPaid(cryptoVersusWallet, cryptoVersusReward);
        }
    }
}

contract VotingChallengeProxy {
    VotingChallenge challenge;
    uint candidate;

    constructor(address _mainAddress, uint _candidate) public {
        challenge = VotingChallenge(_mainAddress);
        candidate = _candidate;
    }

    function() public payable {
        challenge.voteForCandidate_.value(msg.value)(candidate, msg.sender);
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"name":"_mainAddress","type":"address"},{"name":"_candidate","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"}]

Deployed Bytecode

0x60806040819052600080546001547faa306d790000000000000000000000000000000000000000000000000000000084526084523360a45273ffffffffffffffffffffffffffffffffffffffff169163aa306d7991349160c491906044818588803b158015606c57600080fd5b505af1158015607f573d6000803e3d6000fd5b50505050500000a165627a7a72305820d910b7efd1ef37ff1d82b835cd82099249d1165a9826d246e36e5db4dc73ce5e0029

Swarm Source

bzzr://d910b7efd1ef37ff1d82b835cd82099249d1165a9826d246e36e5db4dc73ce5e

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.