ETH Price: $3,120.82 (+1.46%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Subscribe85352472019-09-12 13:44:291966 days ago1568295869IN
0x6198149b...6af304ED9
0 ETH0.0015952123
Subscribe85048862019-09-07 19:54:161971 days ago1567886056IN
0x6198149b...6af304ED9
0 ETH0.000277424
Subscribe84651532019-09-01 15:24:551977 days ago1567351495IN
0x6198149b...6af304ED9
0 ETH0.0006935710
Subscribe83285302019-08-11 9:40:241998 days ago1565516424IN
0x6198149b...6af304ED9
0 ETH0.000076291.1
Subscribe83209092019-08-10 5:19:561999 days ago1565414396IN
0x6198149b...6af304ED9
0 ETH0.000208073
Subscribe82513592019-07-30 10:11:122010 days ago1564481472IN
0x6198149b...6af304ED9
0 ETH0.000138712
Subscribe78945742019-06-04 18:58:342066 days ago1559674714IN
0x6198149b...6af304ED9
0 ETH0.000069351
Subscribe78283282019-05-25 10:45:322076 days ago1558781132IN
0x6198149b...6af304ED9
0 ETH0.000416146
Subscribe77869382019-05-18 22:55:482083 days ago1558220148IN
0x6198149b...6af304ED9
0 ETH0.000069351
Subscribe76869332019-05-03 8:17:012098 days ago1556871421IN
0x6198149b...6af304ED9
0 ETH0.000208073
Subscribe76832422019-05-02 18:20:142099 days ago1556821214IN
0x6198149b...6af304ED9
0 ETH0.000492437.1

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Whitelist

Compiler Version
v0.5.6+commit.b259423e

Optimization Enabled:
No with 200 runs

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

pragma solidity 0.5.6;

/// @author The Calystral Team
/// @title A subscriber contract
contract Whitelist {
    /// This mapping contains the index and subscriber addresses.
    mapping (uint => address) subscriberIndexToAddress;

    /// This mapping contains the addresses and subscriber status.
    mapping (address => uint) subscriberAddressToSubscribed;

    /// The current subscriber index.
    /// Caution: This wiil be likely unequal to the actual subscriber amount.
    /// This will be used as the index of a new subscriber.
    /// We start at 1 because 0 will be the indicator that an address is not a subscriber.
    uint subscriberIndex = 1;

    /// This event will be triggered when a subscription was done.
    event OnSubscribed(address subscriberAddress);

    /// This event will be triggered when a subscription was revoked.
    event OnUnsubscribed(address subscriberAddress);

    /// This modifier prevents other smart contracts from subscribing.
    modifier isNotAContract(){
        require (msg.sender == tx.origin, "Contracts are not allowed to interact.");
        _;
    }
    
    /// Fall back to the subscribe function if no specific function was called.
    function() external {
        subscribe();
    }
    
    /// Gets the subscriber list.
    function getSubscriberList() external view returns (address[] memory) {
        uint subscriberListAmount = getSubscriberAmount();
        
        address[] memory subscriberList = new address[](subscriberListAmount);
        uint subscriberListCounter = 0;
        
        /// Iterate over all subscriber addresses, to fill the subscriberList.
        for (uint i = 1; i < subscriberIndex; i++) {
            address subscriberAddress = subscriberIndexToAddress[i];

            /// Add the addresses which are actual subscribers only.
            if (isSubscriber(subscriberAddress) == true) {
                subscriberList[subscriberListCounter] = subscriberAddress;
                subscriberListCounter++;
            }
        }

        return subscriberList;
    }

    /// Gets the amount of subscriber.
    function getSubscriberAmount() public view returns (uint) {
        uint subscriberListAmount = 0;

        /// Iterate over all subscriber addresses, to get the actual subscriber amount.
        for (uint i = 1; i < subscriberIndex; i++) {
            address subscriberAddress = subscriberIndexToAddress[i];
            
            /// Count the addresses which are actual subscribers only.
            if (isSubscriber(subscriberAddress) == true) {
                subscriberListAmount++;
            }
        }

        return subscriberListAmount;
    }

    /// The sender's address will be added to the subscriber list
    function subscribe() public isNotAContract {
        require(isSubscriber(msg.sender) == false, "You already subscribed.");
        
        // New subscriber
        subscriberAddressToSubscribed[msg.sender] = subscriberIndex;
        subscriberIndexToAddress[subscriberIndex] = msg.sender;
        subscriberIndex++;

        emit OnSubscribed(msg.sender);
    }

    /// The sender's subscribtion will be revoked.
    function unsubscribe() external isNotAContract {
        require(isSubscriber(msg.sender) == true, "You have not subscribed yet.");

        uint index = subscriberAddressToSubscribed[msg.sender];
        delete subscriberIndexToAddress[index];

        emit OnUnsubscribed(msg.sender);
    }
    
    /// Checks wheter the transaction origin address is in the subscriber list
    function isSubscriber() external view returns (bool) {
        return isSubscriber(tx.origin);
    }

    /// Checks wheter the given address is in the subscriber list
    function isSubscriber(address subscriberAddress) public view returns (bool) {
        return subscriberIndexToAddress[subscriberAddressToSubscribed[subscriberAddress]] != address(0);
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"getSubscriberAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isSubscriber","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getSubscriberList","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"subscribe","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"subscriberAddress","type":"address"}],"name":"isSubscriber","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unsubscribe","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"subscriberAddress","type":"address"}],"name":"OnSubscribed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"subscriberAddress","type":"address"}],"name":"OnUnsubscribed","type":"event"}]

6080604052600160025534801561001557600080fd5b50610811806100256000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80630fcafefe1461006c5780631fcb4ee41461008a57806351d5d80d146100ac5780638f449a051461010b578063c4804ef014610115578063fcae448414610171575b61006a61017b565b005b610074610391565b6040518082815260200191505060405180910390f35b610092610414565b604051808215151515815260200191505060405180910390f35b6100b4610424565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156100f75780820151818401526020810190506100dc565b505050509050019250505060405180910390f35b61011361017b565b005b6101576004803603602081101561012b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610530565b604051808215151515815260200191505060405180910390f35b6101796105da565b005b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806107c06026913960400191505060405180910390fd5b6000151561020c33610530565b151514610281576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f596f7520616c726561647920737562736372696265642e00000000000000000081525060200191505060405180910390fd5b600254600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555033600080600254815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002600081548092919060010191905055507fea9dde00ed9f1133889d723ccfcd41c6d6cc3120be2c167eae94d8b65b463f0133604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600080600090506000600190505b60025481101561040c57600080600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600115156103ed82610530565b151514156103fe5782806001019350505b50808060010191505061039f565b508091505090565b600061041f32610530565b905090565b60606000610430610391565b90506060816040519080825280602002602001820160405280156104635781602001602082028038833980820191505090505b50905060008090506000600190505b60025481101561052657600080600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600115156104c082610530565b1515141561051857808484815181106104d557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505082806001019350505b508080600101915050610472565b5081935050505090565b60008073ffffffffffffffffffffffffffffffffffffffff16600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461065e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806107c06026913960400191505060405180910390fd5b6001151561066b33610530565b1515146106e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f596f752068617665206e6f742073756273637269626564207965742e0000000081525060200191505060405180910390fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690557f8d2aae3bd92acf221b185992d11dffa4ff32f3b5f8d9a474d3b7a6ccf067a32133604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15056fe436f6e74726163747320617265206e6f7420616c6c6f77656420746f20696e7465726163742ea165627a7a723058203041e3c29dabd5cb2867a06109783ea68e825983169f91b10904647ef43306530029

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100625760003560e01c80630fcafefe1461006c5780631fcb4ee41461008a57806351d5d80d146100ac5780638f449a051461010b578063c4804ef014610115578063fcae448414610171575b61006a61017b565b005b610074610391565b6040518082815260200191505060405180910390f35b610092610414565b604051808215151515815260200191505060405180910390f35b6100b4610424565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156100f75780820151818401526020810190506100dc565b505050509050019250505060405180910390f35b61011361017b565b005b6101576004803603602081101561012b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610530565b604051808215151515815260200191505060405180910390f35b6101796105da565b005b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806107c06026913960400191505060405180910390fd5b6000151561020c33610530565b151514610281576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f596f7520616c726561647920737562736372696265642e00000000000000000081525060200191505060405180910390fd5b600254600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555033600080600254815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002600081548092919060010191905055507fea9dde00ed9f1133889d723ccfcd41c6d6cc3120be2c167eae94d8b65b463f0133604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600080600090506000600190505b60025481101561040c57600080600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600115156103ed82610530565b151514156103fe5782806001019350505b50808060010191505061039f565b508091505090565b600061041f32610530565b905090565b60606000610430610391565b90506060816040519080825280602002602001820160405280156104635781602001602082028038833980820191505090505b50905060008090506000600190505b60025481101561052657600080600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600115156104c082610530565b1515141561051857808484815181106104d557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505082806001019350505b508080600101915050610472565b5081935050505090565b60008073ffffffffffffffffffffffffffffffffffffffff16600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461065e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806107c06026913960400191505060405180910390fd5b6001151561066b33610530565b1515146106e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f596f752068617665206e6f742073756273637269626564207965742e0000000081525060200191505060405180910390fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690557f8d2aae3bd92acf221b185992d11dffa4ff32f3b5f8d9a474d3b7a6ccf067a32133604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15056fe436f6e74726163747320617265206e6f7420616c6c6f77656420746f20696e7465726163742ea165627a7a723058203041e3c29dabd5cb2867a06109783ea68e825983169f91b10904647ef43306530029

Swarm Source

bzzr://3041e3c29dabd5cb2867a06109783ea68e825983169f91b10904647ef4330653

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  ]

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.