Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 11 from a total of 11 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Subscribe | 8535247 | 1966 days ago | IN | 0 ETH | 0.00159521 | ||||
Subscribe | 8504886 | 1971 days ago | IN | 0 ETH | 0.00027742 | ||||
Subscribe | 8465153 | 1977 days ago | IN | 0 ETH | 0.00069357 | ||||
Subscribe | 8328530 | 1998 days ago | IN | 0 ETH | 0.00007629 | ||||
Subscribe | 8320909 | 1999 days ago | IN | 0 ETH | 0.00020807 | ||||
Subscribe | 8251359 | 2010 days ago | IN | 0 ETH | 0.00013871 | ||||
Subscribe | 7894574 | 2066 days ago | IN | 0 ETH | 0.00006935 | ||||
Subscribe | 7828328 | 2076 days ago | IN | 0 ETH | 0.00041614 | ||||
Subscribe | 7786938 | 2083 days ago | IN | 0 ETH | 0.00006935 | ||||
Subscribe | 7686933 | 2098 days ago | IN | 0 ETH | 0.00020807 | ||||
Subscribe | 7683242 | 2099 days ago | IN | 0 ETH | 0.00049243 |
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
Contract Source Code (Solidity)
/** *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
- No Contract Security Audit Submitted- Submit Audit Here
[{"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"}]
Contract Creation Code
6080604052600160025534801561001557600080fd5b50610811806100256000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80630fcafefe1461006c5780631fcb4ee41461008a57806351d5d80d146100ac5780638f449a051461010b578063c4804ef014610115578063fcae448414610171575b61006a61017b565b005b610074610391565b6040518082815260200191505060405180910390f35b610092610414565b604051808215151515815260200191505060405180910390f35b6100b4610424565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156100f75780820151818401526020810190506100dc565b505050509050019250505060405180910390f35b61011361017b565b005b6101576004803603602081101561012b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610530565b604051808215151515815260200191505060405180910390f35b6101796105da565b005b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806107c06026913960400191505060405180910390fd5b6000151561020c33610530565b151514610281576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f596f7520616c726561647920737562736372696265642e00000000000000000081525060200191505060405180910390fd5b600254600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555033600080600254815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002600081548092919060010191905055507fea9dde00ed9f1133889d723ccfcd41c6d6cc3120be2c167eae94d8b65b463f0133604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600080600090506000600190505b60025481101561040c57600080600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600115156103ed82610530565b151514156103fe5782806001019350505b50808060010191505061039f565b508091505090565b600061041f32610530565b905090565b60606000610430610391565b90506060816040519080825280602002602001820160405280156104635781602001602082028038833980820191505090505b50905060008090506000600190505b60025481101561052657600080600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600115156104c082610530565b1515141561051857808484815181106104d557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505082806001019350505b508080600101915050610472565b5081935050505090565b60008073ffffffffffffffffffffffffffffffffffffffff16600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461065e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806107c06026913960400191505060405180910390fd5b6001151561066b33610530565b1515146106e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f596f752068617665206e6f742073756273637269626564207965742e0000000081525060200191505060405180910390fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690557f8d2aae3bd92acf221b185992d11dffa4ff32f3b5f8d9a474d3b7a6ccf067a32133604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15056fe436f6e74726163747320617265206e6f7420616c6c6f77656420746f20696e7465726163742ea165627a7a723058203041e3c29dabd5cb2867a06109783ea68e825983169f91b10904647ef43306530029
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100625760003560e01c80630fcafefe1461006c5780631fcb4ee41461008a57806351d5d80d146100ac5780638f449a051461010b578063c4804ef014610115578063fcae448414610171575b61006a61017b565b005b610074610391565b6040518082815260200191505060405180910390f35b610092610414565b604051808215151515815260200191505060405180910390f35b6100b4610424565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156100f75780820151818401526020810190506100dc565b505050509050019250505060405180910390f35b61011361017b565b005b6101576004803603602081101561012b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610530565b604051808215151515815260200191505060405180910390f35b6101796105da565b005b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806107c06026913960400191505060405180910390fd5b6000151561020c33610530565b151514610281576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f596f7520616c726561647920737562736372696265642e00000000000000000081525060200191505060405180910390fd5b600254600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555033600080600254815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002600081548092919060010191905055507fea9dde00ed9f1133889d723ccfcd41c6d6cc3120be2c167eae94d8b65b463f0133604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600080600090506000600190505b60025481101561040c57600080600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600115156103ed82610530565b151514156103fe5782806001019350505b50808060010191505061039f565b508091505090565b600061041f32610530565b905090565b60606000610430610391565b90506060816040519080825280602002602001820160405280156104635781602001602082028038833980820191505090505b50905060008090506000600190505b60025481101561052657600080600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600115156104c082610530565b1515141561051857808484815181106104d557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505082806001019350505b508080600101915050610472565b5081935050505090565b60008073ffffffffffffffffffffffffffffffffffffffff16600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461065e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806107c06026913960400191505060405180910390fd5b6001151561066b33610530565b1515146106e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f596f752068617665206e6f742073756273637269626564207965742e0000000081525060200191505060405180910390fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690557f8d2aae3bd92acf221b185992d11dffa4ff32f3b5f8d9a474d3b7a6ccf067a32133604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15056fe436f6e74726163747320617265206e6f7420616c6c6f77656420746f20696e7465726163742ea165627a7a723058203041e3c29dabd5cb2867a06109783ea68e825983169f91b10904647ef43306530029
Swarm Source
bzzr://3041e3c29dabd5cb2867a06109783ea68e825983169f91b10904647ef4330653
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.