Address
0xd7661cce8eed01cbaa0188facdde2e46c4ebe4b0Current Holdings
$0.00
TXs sent
not counted
First Active
2025-11-11
block 24,996,345
Last Active
99 days ago
block 26,737,414
Funded By
not identified
Net worth historyi
2 snapshots · to block 27,427,956coverage change 26 Augcoverage change 27 Augcoverage change 27 Augcoverage change 27 Augcoverage change 27 Aug
exact matchCornTokensolc 0.8.24+commit.e11b9ed9runtime exact · creation exact
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface IUniswapV2PairLike { } // marker only
contract CornToken is ERC20, Ownable {
uint256 public constant MAX_SUPPLY = 88 * 1e18;
address public taxRecipient;
uint16 public buySellTaxBps = 500; // 5% = 500 bps
address public dexPair; // set after creating the pair
mapping(address => bool) public isExcludedFromFee;
event SetTaxRecipient(address indexed);
event SetBuySellTaxBps(uint16 oldBps, uint16 newBps);
event SetDexPair(address indexed);
event SetExcluded(address indexed, bool excluded);
constructor(address _treasury) ERC20("CORN", unicode"🌽") Ownable(msg.sender) {
_mint(msg.sender, MAX_SUPPLY);
taxRecipient = _treasury;
isExcludedFromFee[msg.sender] = true;
isExcludedFromFee[_treasury] = true;
}
function setTaxRecipient(address a) external onlyOwner {
require(a != address(0), "zero");
taxRecipient = a;
emit SetTaxRecipient(a);
}
function setBuySellTaxBps(uint16 bps) external onlyOwner {
require(bps <= 1000, "max 10%");
emit SetBuySellTaxBps(buySellTaxBps, bps);
buySellTaxBps = bps;
}
function setDexPair(address pair) external onlyOwner {
require(pair != address(0), "zero");
dexPair = pair;
emit SetDexPair(pair);
}
function setExcluded(address a, bool v) external onlyOwner {
isExcludedFromFee[a] = v;
emit SetExcluded(a, v);
}
function _update(address from, address to, uint256 amount) internal override {
// default transfer (no fee) if:
// - tax off, or
// - either side excluded, or
// - taxRecipient belum di-set
if (
buySellTaxBps == 0 ||
isExcludedFromFee[from] ||
isExcludedFromFee[to] ||
taxRecipient == address(0)
) {
super._update(from, to, amount);
return;
}
bool isBuy = from == dexPair && dexPair != address(0);
bool isSell = to == dexPair && dexPair != address(0);
if (isBuy || isSell) {
uint256 fee = (amount * buySellTaxBps) / 10_000;
uint256 net = amount - fee;
super._update(from, taxRecipient, fee);
super._update(from, to, net);
} else {
super._update(from, to, amount);
}
}
}