Contract 0x3EF349d4CfFf5D4E802a1f64e8e61311699132C2

 
Txn Hash
Block
From
To
Value [Txn Fee]
0xaab08cc66c29fcbd78e31d2e007d55119b4ca8590c6fbbfbda1adbbfb539149f28428882020-12-05 21:42:0980 days 20 hrs agoKeep3rb Network: Deployer IN  Contract Creation0 BNB0.0036382
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Keep3rbLibrary

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at BscScan.com on 2020-12-05
*/

// SPDX-License-Identifier: MIT


pragma solidity ^0.6.12;


library SafeMath {
    function add(uint a, uint b) internal pure returns (uint) {
        uint c = a + b;
        require(c >= a, "add: +");

        return c;
    }
   function add(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
        uint c = a + b;
        require(c >= a, errorMessage);

        return c;
    }
   function sub(uint a, uint b) internal pure returns (uint) {
        return sub(a, b, "sub: -");
    }
   function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
        require(b <= a, errorMessage);
        uint c = a - b;

        return c;
    }
  function mul(uint a, uint b) internal pure returns (uint) {
       if (a == 0) {
            return 0;
        }
        uint c = a * b;
        require(c / a == b, "mul: *");

        return c;
    }
  function mul(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
       if (a == 0) {
            return 0;
        }
        uint c = a * b;
        require(c / a == b, errorMessage);
        return c;
    }
  function div(uint a, uint b) internal pure returns (uint) {
        return div(a, b, "div: /");
    }
  function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
        require(b > 0, errorMessage);
        uint c = a / b;
        return c;
    }
   function mod(uint a, uint b) internal pure returns (uint) {
        return mod(a, b, "mod: %");
    }
  function mod(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
        require(b != 0, errorMessage);
        return a % b;
    }
}


contract ReentrancyGuard {
   uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

    modifier nonReentrant() {
       require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
       _status = _ENTERED;
       _;
       _status = _NOT_ENTERED;
    }
}


interface IERC20 {
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    }

library Address {
    function isContract(address account) internal view returns (bool) {
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }
    function toPayable(address account) internal pure returns (address payable) {
        return address(uint160(account));
    }
   function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient");

        // solhint-disable-next-line avoid-call-value
        (bool success, ) = recipient.call{value:amount}("");
        require(success, "Address: reverted");
    }
}
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: < 0");
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function callOptionalReturn(IERC20 token, bytes memory data) private {
           // solhint-disable-next-line max-line-length
        require(address(token).isContract(), "SafeERC20: !contract");
        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "SafeERC20: low-level call failed");
     if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: !succeed");
        }
    }
}

library Keep3rbLibrary {
    function getReserve(address pair, address reserve) external view returns (uint) {
        (uint _r0, uint _r1,) = ICheeseSwapPair(pair).getReserves();
        if (ICheeseSwapPair(pair).token0() == reserve) {
            return _r0;
        } else if (ICheeseSwapPair(pair).token1() == reserve) {
            return _r1;
        } else {
            return 0;
        }
    }
}

interface ICheeseSwapPair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"pair","type":"address"},{"internalType":"address","name":"reserve","type":"address"}],"name":"getReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

610254610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c8063cbc3ab531461003a575b600080fd5b6100686004803603604081101561005057600080fd5b506001600160a01b038135811691602001351661007a565b60408051918252519081900360200190f35b6000806000846001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156100b857600080fd5b505afa1580156100cc573d6000803e3d6000fd5b505050506040513d60608110156100e257600080fd5b50805160209182015160408051630dfe168160e01b815290516dffffffffffffffffffffffffffff93841696509290911693506001600160a01b038088169390891692630dfe1681926004808201939291829003018186803b15801561014757600080fd5b505afa15801561015b573d6000803e3d6000fd5b505050506040513d602081101561017157600080fd5b50516001600160a01b0316141561018a57509050610218565b836001600160a01b0316856001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156101cd57600080fd5b505afa1580156101e1573d6000803e3d6000fd5b505050506040513d60208110156101f757600080fd5b50516001600160a01b031614156102115791506102189050565b6000925050505b9291505056fea264697066735822122044c553f9f22b1e66bcd811166b1b4fa746ac794bd9b35892718d259758941f6d64736f6c634300060c0033

Deployed ByteCode Sourcemap

5817:416:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;5847:383;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;5847:383:0;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;5921:4;5939:8;5949;5978:4;-1:-1:-1;;;;;5962:33:0;;:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5962:35:0;;;;;;;;6012:30;;-1:-1:-1;;;6012:30:0;;;;5938:59;;;;;-1:-1:-1;5938:59:0;;;;;-1:-1:-1;;;;;;6012:41:0;;;;:28;;;;;;:30;;;;;5962:35;6012:30;;;;;;:28;:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6012:30:0;-1:-1:-1;;;;;6012:41:0;;6008:215;;;-1:-1:-1;6077:3:0;-1:-1:-1;6070:10:0;;6008:215;6136:7;-1:-1:-1;;;;;6102:41:0;6118:4;-1:-1:-1;;;;;6102:28:0;;:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6102:30:0;-1:-1:-1;;;;;6102:41:0;;6098:125;;;6167:3;-1:-1:-1;6160:10:0;;-1:-1:-1;6160:10:0;6098:125;6210:1;6203:8;;;;5847:383;;;;;:::o

Swarm Source

ipfs://44c553f9f22b1e66bcd811166b1b4fa746ac794bd9b35892718d259758941f6d
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.