Contract Address Details

0xD9916c7dd58Ee74a6c27Caa27990c631eeda71FB

DailyStats Last Balance Update: Block #7529302
Created by 0xaed1–13fa15 at 0xf01b–c2faf5

Balance

0 GEN

Fetching tokens...

Contract name:
DailyStats




Optimization enabled
false
Compiler version
v0.8.6+commit.11564f7e




EVM Version
default

Contract source code

/**
* Submitted for verification at blockscout.com on 2021-11-02 10:36:45.226979Z
*/
// File: @openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: contracts/DailyStats.sol
pragma solidity >=0.4.22 <0.9.0;
contract DailyStats is Ownable {
struct DailyStatsObject {
string date;
uint256 numberOfUsers;
uint256 numberOfTokenholders;
uint256 totalIncome;
}
string version;
DailyStatsObject data;
event DailyStatsUpdated(
string date,
uint256 numberOfUsers,
uint256 numberOfTokenholders,
uint256 totalIncome,
string version
);
constructor() {
version = "0.9.0";
}
function getNumberOfUsers() public view returns (uint256) {
return data.numberOfUsers;
}
function getNumberOfTokenholders() public view returns (uint256) {
return data.numberOfTokenholders;
}
function getTotalIncome() public view returns (uint256) {
return data.totalIncome;
}
function updateDailyStats(
string memory date,
uint256 numberOfUsers,
uint256 numberOfTokenholders,
uint256 totalIncome
) public onlyOwner {
data.date = date;
data.numberOfUsers = numberOfUsers;
data.numberOfTokenholders = numberOfTokenholders;
data.totalIncome = totalIncome;
emit DailyStatsUpdated(
date,
numberOfUsers,
numberOfTokenholders,
totalIncome,
version
);
}
}

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"DailyStatsUpdated","inputs":[{"type":"string","name":"date","internalType":"string","indexed":false},{"type":"uint256","name":"numberOfUsers","internalType":"uint256","indexed":false},{"type":"uint256","name":"numberOfTokenholders","internalType":"uint256","indexed":false},{"type":"uint256","name":"totalIncome","internalType":"uint256","indexed":false},{"type":"string","name":"version","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getNumberOfTokenholders","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getNumberOfUsers","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTotalIncome","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateDailyStats","inputs":[{"type":"string","name":"date","internalType":"string"},{"type":"uint256","name":"numberOfUsers","internalType":"uint256"},{"type":"uint256","name":"numberOfTokenholders","internalType":"uint256"},{"type":"uint256","name":"totalIncome","internalType":"uint256"}]}]
            

Contract Byte Code

0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063715018a61161005b578063715018a6146100dc5780638da5cb5b146100e65780639b6a3fbb14610104578063f2fde38b146101205761007d565b806313a6074a1461008257806324b6046a146100a05780634d009288146100be575b600080fd5b61008a61013c565b6040516100979190610896565b60405180910390f35b6100a8610148565b6040516100b59190610896565b60405180910390f35b6100c6610155565b6040516100d39190610896565b60405180910390f35b6100e4610162565b005b6100ee6101ea565b6040516100fb91906107da565b60405180910390f35b61011e6004803603810190610119919061063a565b610213565b005b61013a6004803603810190610135919061060d565b61030c565b005b60006002800154905090565b6000600260030154905090565b6000600260010154905090565b61016a610404565b73ffffffffffffffffffffffffffffffffffffffff166101886101ea565b73ffffffffffffffffffffffffffffffffffffffff16146101de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101d590610876565b60405180910390fd5b6101e8600061040c565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61021b610404565b73ffffffffffffffffffffffffffffffffffffffff166102396101ea565b73ffffffffffffffffffffffffffffffffffffffff161461028f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028690610876565b60405180910390fd5b83600260000190805190602001906102a89291906104d0565b5082600260010181905550816002800181905550806002600301819055507f5a0b7d0836bb4b93cee27e9899ce956c3cc7450df56a6df41dc88eda6b6d43748484848460016040516102fe9594939291906107f5565b60405180910390a150505050565b610314610404565b73ffffffffffffffffffffffffffffffffffffffff166103326101ea565b73ffffffffffffffffffffffffffffffffffffffff1614610388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161037f90610876565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156103f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ef90610856565b60405180910390fd5b6104018161040c565b50565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8280546104dc906109b6565b90600052602060002090601f0160209004810192826104fe5760008555610545565b82601f1061051757805160ff1916838001178555610545565b82800160010185558215610545579182015b82811115610544578251825591602001919060010190610529565b5b5090506105529190610556565b5090565b5b8082111561056f576000816000905550600101610557565b5090565b6000610586610581846108d6565b6108b1565b9050828152602081018484840111156105a2576105a1610a7c565b5b6105ad848285610974565b509392505050565b6000813590506105c481610b14565b92915050565b600082601f8301126105df576105de610a77565b5b81356105ef848260208601610573565b91505092915050565b60008135905061060781610b2b565b92915050565b60006020828403121561062357610622610a86565b5b6000610631848285016105b5565b91505092915050565b6000806000806080858703121561065457610653610a86565b5b600085013567ffffffffffffffff81111561067257610671610a81565b5b61067e878288016105ca565b945050602061068f878288016105f8565b93505060406106a0878288016105f8565b92505060606106b1878288016105f8565b91505092959194509250565b6106c681610938565b82525050565b60006106d78261091c565b6106e18185610927565b93506106f1818560208601610983565b6106fa81610a8b565b840191505092915050565b60008154610712816109b6565b61071c8186610927565b9450600182166000811461073757600181146107495761077c565b60ff198316865260208601935061077c565b61075285610907565b60005b8381101561077457815481890152600182019150602081019050610755565b808801955050505b50505092915050565b6000610792602683610927565b915061079d82610a9c565b604082019050919050565b60006107b5602083610927565b91506107c082610aeb565b602082019050919050565b6107d48161096a565b82525050565b60006020820190506107ef60008301846106bd565b92915050565b600060a082019050818103600083015261080f81886106cc565b905061081e60208301876107cb565b61082b60408301866107cb565b61083860608301856107cb565b818103608083015261084a8184610705565b90509695505050505050565b6000602082019050818103600083015261086f81610785565b9050919050565b6000602082019050818103600083015261088f816107a8565b9050919050565b60006020820190506108ab60008301846107cb565b92915050565b60006108bb6108cc565b90506108c782826109e8565b919050565b6000604051905090565b600067ffffffffffffffff8211156108f1576108f0610a48565b5b6108fa82610a8b565b9050602081019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600082825260208201905092915050565b60006109438261094a565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b838110156109a1578082015181840152602081019050610986565b838111156109b0576000848401525b50505050565b600060028204905060018216806109ce57607f821691505b602082108114156109e2576109e1610a19565b5b50919050565b6109f182610a8b565b810181811067ffffffffffffffff82111715610a1057610a0f610a48565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b610b1d81610938565b8114610b2857600080fd5b50565b610b348161096a565b8114610b3f57600080fd5b5056fea2646970667358221220b109a854a78e4d4f33741d26e0634befd2ebb6f23ccbae39f829c3acc2f8669d64736f6c63430008060033