Verified contractPartialMIT
FeelsGoodToken
Address0x9a66e1f1a12e2ed2c99036c34698432599f5591c
- Balance
0 ETH
- Transactions
436
- Compiler
solc 0.8.24
- Same code
11 more contracts
Details
- Compiler
- solc 0.8.24+commit.e11b9ed9
- Language
- solidity
- Optimization
- Yes, 10,000 runs
- EVM version
- cancun
- License
- MIT
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 25,624,317
- Creation transaction
- 0xd9ea873263…60708d306d
2 files
- src/FeelsGoodToken.solmain2.27 KB
- src/libraries/ProtocolConstants.sol2.03 KB
src/FeelsGoodToken.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import { ProtocolConstants } from "./libraries/ProtocolConstants.sol";
contract FeelsGoodToken {
error ZeroAddress();
error InsufficientBalance();
error InsufficientAllowance();
string public name;
string public symbol;
uint8 public constant decimals = 18;
uint256 public constant totalSupply = ProtocolConstants.TOKEN_SUPPLY;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor(string memory name_, string memory symbol_, address initialHolder) {
if (initialHolder == address(0)) revert ZeroAddress();
name = name_;
symbol = symbol_;
balanceOf[initialHolder] = totalSupply;
emit Transfer(address(0), initialHolder, totalSupply);
}
function approve(address spender, uint256 amount) external returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address to, uint256 amount) external returns (bool) {
_transfer(msg.sender, to, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) external returns (bool) {
uint256 allowed = allowance[from][msg.sender];
if (allowed != type(uint256).max) {
if (allowed < amount) revert InsufficientAllowance();
unchecked {
allowance[from][msg.sender] = allowed - amount;
}
emit Approval(from, msg.sender, allowance[from][msg.sender]);
}
_transfer(from, to, amount);
return true;
}
function _transfer(address from, address to, uint256 amount) private {
if (to == address(0)) revert ZeroAddress();
uint256 balance = balanceOf[from];
if (balance < amount) revert InsufficientBalance();
unchecked {
balanceOf[from] = balance - amount;
balanceOf[to] += amount;
}
emit Transfer(from, to, amount);
}
}
src/libraries/ProtocolConstants.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
library ProtocolConstants {
address internal constant ADMIN = 0x834CB9aEa2d5e335940928445B235E2d7D8B57dD;
address internal constant TREASURY = ADMIN;
address internal constant DEAD = 0x000000000000000000000000000000000000dEaD;
address internal constant PEPE = 0x6982508145454Ce325dDbE47a25d4ec3d2311933;
address internal constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address internal constant ETH_USD_CHAINLINK_FEED = 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419;
address internal constant UNISWAP_V3_FACTORY = 0x1F98431c8aD98523631AE4a59f267346ea31F984;
address internal constant SWAP_ROUTER = 0xE592427A0AEce92De3Edee1F18E0157C05861564;
address internal constant NONFUNGIBLE_POSITION_MANAGER =
0xC36442b4a4522E871399CD717aBDD847Ab11FE88;
address internal constant QUOTER_V2 = 0x61fFE014bA17989E743c5F6cB21bF9697530B21e;
uint24 internal constant FEE = 10_000;
int24 internal constant TICK_SPACING = 200;
int24 internal constant INITIAL_TICK_TOKEN0 = -1_000;
int24 internal constant INITIAL_TICK_TOKEN1 = 1_000;
int24 internal constant RANGE_WIDTH = 888_200;
int24 internal constant TOKEN0_UPPER_TICK = 887_200;
int24 internal constant TOKEN1_LOWER_TICK = -887_200;
// TickMath.getSqrtRatioAtTick(-1000) and TickMath.getSqrtRatioAtTick(1000).
uint160 internal constant SQRT_PRICE_X96_NEGATIVE_1000 = 75_364_347_830_767_020_784_054_125_655;
uint160 internal constant SQRT_PRICE_X96_POSITIVE_1000 = 83_290_069_058_676_223_003_182_343_270;
// Maximum usable ticks for the 1% tier's 200-tick spacing.
// TickMath.getSqrtRatioAtTick(-887200) and TickMath.getSqrtRatioAtTick(887200).
uint160 internal constant SQRT_PRICE_X96_NEGATIVE_887200 = 4_310_618_292;
uint160 internal constant SQRT_PRICE_X96_POSITIVE_887200 =
1_456_195_216_270_955_103_206_513_029_158_776_779_468_408_838_535;
uint256 internal constant TOKEN_SUPPLY = 1_000_000_000 ether;
}
Compiler settingsShow
{
"metadata": {
"appendCBOR": false,
"bytecodeHash": "none"
},
"optimizer": {
"runs": 10000,
"enabled": true
},
"evmVersion": "cancun",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.