Contract 0x0207F989db6427Cd3f296A850664F9a6608eE8cb

 

Contract Overview

Balance:
0 BNB

BNB Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x6ddfb20244661896d2249f318e6cfe31ac92a7ff33620560b011476b77830bebSet Admin Status116812702021-10-11 13:22:394 days 21 hrs agoCoinSwap: Deployer IN  0x0207f989db6427cd3f296a850664f9a6608ee8cb0 BNB0.000225245
0x488ddbe3f0001ef31b459e43c4fb513147b06ed5035fd1039ba7afd1c5b8e810Set Admin Status109636972021-09-16 12:01:1829 days 23 hrs agoCoinSwap: Deployer IN  0x0207f989db6427cd3f296a850664f9a6608ee8cb0 BNB0.000225245
0x068eaedfd74cbb345bf652bbd625063310fae64e88ba58891ee60a4bb380b6c8Set Admin Status99086882021-08-10 12:17:1466 days 23 hrs agoCoinSwap: Deployer IN  0x0207f989db6427cd3f296a850664f9a6608ee8cb0 BNB0.000225245
0x2590810ab37ba45383fbe37eb83e217e55fad41190ce3321864a77fcc8adff4aSet Admin Status92881352021-07-19 8:14:5789 days 3 hrs agoCoinSwap: Deployer IN  0x0207f989db6427cd3f296a850664f9a6608ee8cb0 BNB0.000225245
0x915e19a9599698275c8002335f0205a1a4acf03fd1d33cac24477f5f8964edfeSet Admin Status86863072021-06-28 8:50:40110 days 2 hrs agoCoinSwap: Deployer IN  0x0207f989db6427cd3f296a850664f9a6608ee8cb0 BNB0.000225245
0xe45340eca54d9ab43ab64b65a2d0a66bd6a149d3732fbede08370585e407924bSet Admin Status75702882021-05-20 10:14:45149 days 1 hr agoCoinSwap: Deployer IN  0x0207f989db6427cd3f296a850664f9a6608ee8cb0 BNB0.000262806856
0x7ce7dda263523fc96de4f13d094d0654fc1134a79eaa0957aeae8498b54dacf0Set Admin Status70190892021-04-30 15:36:06168 days 19 hrs agoCoinSwap: Deployer IN  0x0207f989db6427cd3f296a850664f9a6608ee8cb0 BNB0.00090098
0xe99c18eac99fe90ca9ae1f1944d5c276a2b9bb1eb76dadcfe0662e73a724fdc40x6080604070190602021-04-30 15:34:39168 days 19 hrs agoCoinSwap: Deployer IN  Contract Creation0 BNB0.0088899
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CssReferral

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 3 : CSSReferral.sol
// SPDX-License-Identifier: MIT 
pragma solidity ^0.6.12;

 import "./libraries/Context.sol";
 import "./libraries/Address.sol";


contract CssReferral is Context {
    using Address for address;
    
    mapping(address => address) public referrers; // account_address -> referrer_address
    mapping(address => uint256) public referredCount; // referrer_address -> num_of_referred

    event Referral(address indexed referrer, address indexed farmer);
    event NextOwner(address indexed _owner);
    event NextOwnerApproved(address indexed _owner);
    event AdminStatus(address indexed _admin,bool _status);

    // Standard contract ownership transfer.
    address public owner;
    address private nextOwner;

    mapping(address => bool) public isAdmin;

    constructor () public {
        owner = msg.sender;
    }

    // Standard modifier on methods invokable only by contract owner.
    modifier onlyOwner {
        require(msg.sender == owner, "OnlyOwner methods called by non-owner.");
        _;
    }

    modifier onlyAdmin {
        require(isAdmin[msg.sender], "OnlyAdmin methods called by non-admin.");
        _;
    }

    // Standard contract ownership transfer implementation,
    function approveNextOwner(address _nextOwner) external onlyOwner {
        require(_nextOwner != owner, "Cannot approve current owner.");
 
        nextOwner = _nextOwner;
        emit NextOwner(nextOwner);
    }

    function acceptNextOwner() external {
        require(msg.sender == nextOwner, "Can only accept preapproved new owner.");
        owner = nextOwner;
        emit NextOwnerApproved(nextOwner);
    }

    function setCssReferral(address farmer, address referrer) external onlyAdmin {
        if (referrers[farmer] == address(0) && referrer != address(0)) {
            referrers[farmer] = referrer;
            referredCount[referrer] += 1;
            emit Referral(referrer, farmer);
        }
    }

    function getCssReferral(address farmer) external view returns (address) {
        return referrers[farmer];
    }

    // Set admin status.
    function setAdminStatus(address _admin, bool _status) external onlyOwner {
        require(_admin != address(0), 'Admin: admin address cannot be null');
        isAdmin[_admin] = _status;

        emit AdminStatus(  _admin,  _status);
    }
}

File 2 of 3 : Context.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 3 of 3 : Address.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_admin","type":"address"},{"indexed":false,"internalType":"bool","name":"_status","type":"bool"}],"name":"AdminStatus","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"}],"name":"NextOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"}],"name":"NextOwnerApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"referrer","type":"address"},{"indexed":true,"internalType":"address","name":"farmer","type":"address"}],"name":"Referral","type":"event"},{"inputs":[],"name":"acceptNextOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nextOwner","type":"address"}],"name":"approveNextOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"farmer","type":"address"}],"name":"getCssReferral","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referredCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referrers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setAdminStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"farmer","type":"address"},{"internalType":"address","name":"referrer","type":"address"}],"name":"setCssReferral","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50600280546001600160a01b031916331790556106b1806100326000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c80634f5bee44116100665780634f5bee44146101725780635500ff84146101a25780638da5cb5b146101d0578063d06c54fb146101d8578063d579fd44146101e057610093565b8063208756931461009857806324d7806c146100da5780633f7b06d8146101145780634a3b68cc1461014c575b600080fd5b6100be600480360360208110156100ae57600080fd5b50356001600160a01b0316610206565b604080516001600160a01b039092168252519081900360200190f35b610100600480360360208110156100f057600080fd5b50356001600160a01b0316610224565b604080519115158252519081900360200190f35b61013a6004803603602081101561012a57600080fd5b50356001600160a01b0316610239565b60408051918252519081900360200190f35b6100be6004803603602081101561016257600080fd5b50356001600160a01b031661024b565b6101a06004803603604081101561018857600080fd5b506001600160a01b0381351690602001351515610266565b005b6101a0600480360360408110156101b857600080fd5b506001600160a01b0381358116916020013516610354565b6100be610446565b6101a0610455565b6101a0600480360360208110156101f657600080fd5b50356001600160a01b03166104ea565b6001600160a01b039081166000908152602081905260409020541690565b60046020526000908152604090205460ff1681565b60016020526000908152604090205481565b6000602081905290815260409020546001600160a01b031681565b6002546001600160a01b031633146102af5760405162461bcd60e51b81526004018080602001828103825260268152602001806106566026913960400191505060405180910390fd5b6001600160a01b0382166102f45760405162461bcd60e51b81526004018080602001828103825260238152602001806106336023913960400191505060405180910390fd5b6001600160a01b038216600081815260046020908152604091829020805460ff1916851515908117909155825190815291517fa48d59cca2d47a9af2944b3faa0767a844a798c580e3677e7d38052516b6ad199281900390910190a25050565b3360009081526004602052604090205460ff166103a25760405162461bcd60e51b81526004018080602001828103825260268152602001806105e76026913960400191505060405180910390fd5b6001600160a01b03828116600090815260208190526040902054161580156103d257506001600160a01b03811615155b15610442576001600160a01b0382811660008181526020818152604080832080546001600160a01b03191695871695861790558483526001918290528083208054909201909155519192917f9d05414fb79fac216c15606de5cc06664e91a254e4d5f57664d5f1beaf7fb7ef9190a35b5050565b6002546001600160a01b031681565b6003546001600160a01b0316331461049e5760405162461bcd60e51b815260040180806020018281038252602681526020018061060d6026913960400191505060405180910390fd5b600354600280546001600160a01b0319166001600160a01b0390921691821790556040517fe911afaae3db3062fa56af023bf22768644291b8d946783fe87a97290e2aafcc90600090a2565b6002546001600160a01b031633146105335760405162461bcd60e51b81526004018080602001828103825260268152602001806106566026913960400191505060405180910390fd5b6002546001600160a01b0382811691161415610596576040805162461bcd60e51b815260206004820152601d60248201527f43616e6e6f7420617070726f76652063757272656e74206f776e65722e000000604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f4d151e51375b4fdaf9936e86632614e68acac0981be8eec64e3b08f22c0bd17490600090a25056fe4f6e6c7941646d696e206d6574686f64732063616c6c6564206279206e6f6e2d61646d696e2e43616e206f6e6c792061636365707420707265617070726f766564206e6577206f776e65722e41646d696e3a2061646d696e20616464726573732063616e6e6f74206265206e756c6c4f6e6c794f776e6572206d6574686f64732063616c6c6564206279206e6f6e2d6f776e65722ea26469706673582212204bb28f8593502d6ca46846b88e0f6bb37b2818aa3aef93f95b53ed5f61e870a664736f6c634300060c0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.