Sponsored:   Color Platform: Decentralized App Store - Special Airdrop For Everyone (~17 Sep), Register NOW!
Contract Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 2 txns
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity), NestedArrayFunctionCallDecoder (medium-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: AMLOveCoinVoting
Compiler Text: v0.4.21+commit.dfe3193c
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.18;

contract ForeignToken {
    function balanceOf(address _owner) public constant returns (uint256);
}

contract Owned {
    address public owner;
    address public newOwner;

    event OwnershipTransferred(address indexed _from, address indexed _to);

    function Owned() public {
        owner = msg.sender;
    }

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }

    function transferOwnership(address _newOwner) public onlyOwner {
        newOwner = _newOwner;
    }

    function acceptOwnership() public {
        require(msg.sender == newOwner);
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
        newOwner = address(0);
    }
}

contract AMLOveCoinVoting is Owned {
    address private _tokenAddress;
    bool public votingAllowed = false;

    mapping (address => bool) yaVoto;
    uint256 public votosTotales;
    uint256 public donacionCruzRoja;
    uint256 public donacionTeleton;
    uint256 public inclusionEnExchange;

    function AMLOveCoinVoting(address tokenAddress) public {
        _tokenAddress = tokenAddress;
        votingAllowed = true;
    }

    function enableVoting() onlyOwner public {
        votingAllowed = true;
    }

    function disableVoting() onlyOwner public {
        votingAllowed = false;
    }

    function vote(uint option) public {
        require(votingAllowed);
        require(option < 3);
        require(!yaVoto[msg.sender]);
        yaVoto[msg.sender] = true;
        ForeignToken token = ForeignToken(_tokenAddress);
        uint256 amount = token.balanceOf(msg.sender);
        require(amount > 0);
        votosTotales += amount;
        if (option == 0){
            donacionCruzRoja += amount;
        } else if (option == 1) {
            donacionTeleton += amount;
        } else if (option == 2) {
            inclusionEnExchange += amount;
        } else {
            assert(false);
        }        
    }
    
    function getStats() public view returns (
        uint256 _votosTotales,
        uint256 _donacionCruzRoja,
        uint256 _donacionTeleton,
        uint256 _inclusionEnExchange)
    {
        return (votosTotales, donacionCruzRoja, donacionTeleton, inclusionEnExchange);
    }
}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"option","type":"uint256"}],"name":"vote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"disableVoting","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"votosTotales","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"votingAllowed","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"inclusionEnExchange","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"donacionCruzRoja","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getStats","outputs":[{"name":"_votosTotales","type":"uint256"},{"name":"_donacionCruzRoja","type":"uint256"},{"name":"_donacionTeleton","type":"uint256"},{"name":"_inclusionEnExchange","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"enableVoting","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"donacionTeleton","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"tokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60606040526002805460a060020a60ff0219169055341561001f57600080fd5b60405160208061062f8339810160405280805160008054600160a060020a03338116600160a060020a0319928316179092556002805460a060020a60ff02199390941693909116929092171674010000000000000000000000000000000000000000179055505061059a806100956000396000f3006060604052600436106100c45763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630121b93f81146100c957806304cd1819146100e15780631464f516146100f457806317e760bb146101195780635e6fa5ea1461014057806379ba5097146101535780638da5cb5b1461016657806398547a4514610195578063c59d4847146101a8578063d4ee1d90146101e6578063eb4439fb146101f9578063f2fde38b1461020c578063ff668cbe1461022b575b600080fd5b34156100d457600080fd5b6100df60043561023e565b005b34156100ec57600080fd5b6100df6103a0565b34156100ff57600080fd5b6101076103db565b60405190815260200160405180910390f35b341561012457600080fd5b61012c6103e1565b604051901515815260200160405180910390f35b341561014b57600080fd5b610107610402565b341561015e57600080fd5b6100df610408565b341561017157600080fd5b610179610496565b604051600160a060020a03909116815260200160405180910390f35b34156101a057600080fd5b6101076104a5565b34156101b357600080fd5b6101bb6104ab565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b34156101f157600080fd5b6101796104bd565b341561020457600080fd5b6100df6104cc565b341561021757600080fd5b6100df600160a060020a036004351661051e565b341561023657600080fd5b610107610568565b600254600090819074010000000000000000000000000000000000000000900460ff16151561026c57600080fd5b6003831061027957600080fd5b600160a060020a03331660009081526003602052604090205460ff161561029f57600080fd5b600160a060020a033381811660009081526003602052604090819020805460ff19166001179055600254909216935083916370a082319190517c010000000000000000000000000000000000000000000000000000000063ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561032c57600080fd5b5af1151561033957600080fd5b50505060405180519150506000811161035157600080fd5b600480548201905582151561036d57600580548201905561039b565b826001141561038357600680548201905561039b565b826002141561039957600780548201905561039b565bfe5b505050565b60005433600160a060020a039081169116146103bb57600080fd5b6002805474ff000000000000000000000000000000000000000019169055565b60045481565b60025474010000000000000000000000000000000000000000900460ff1681565b60075481565b60015433600160a060020a0390811691161461042357600080fd5b600154600054600160a060020a0391821691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600054600160a060020a031681565b60055481565b60045460055460065460075490919293565b600154600160a060020a031681565b60005433600160a060020a039081169116146104e757600080fd5b6002805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b60005433600160a060020a0390811691161461053957600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600654815600a165627a7a72305820095f6bef56506a92a08b0d7133ca0cf9c7e79a8a872288aaf6027dea6cd466700029000000000000000000000000732e28b4a2fae96461f6b4cfae8165d8a0d464d6

    Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000732e28b4a2fae96461f6b4cfae8165d8a0d464d6

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000732e28b4a2fae96461f6b4cfae8165d8a0d464d6


   Swarm Source:
bzzr://095f6bef56506a92a08b0d7133ca0cf9c7e79a8a872288aaf6027dea6cd46670

 

View All
Block Age transaction Difficulty Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.