Address Contract Partially Verified
Address
0x613FAE856Ce7bCfd56bcd22b84b8048ffC070ca5
Balance
0 ETH
Nonce
1
Code Size
2158 bytes
Creator
0x3a6A3325...F974 at tx 0xeb4deff6...ccbec5
Indexed Transactions
0
Contract Bytecode
2158 bytes
0x608060405234801561000f575f80fd5b50600436106100ad575f3560e01c806306fdde03146100b1578063095ea7b3146100cf57806318160ddd146100f257806323b872dd14610104578063313ce567146101175780636afa67671461012657806370a082311461013a57806395d89b4114610162578063a9059cbb1461016a578063c694cc431461017d578063dd62ed3e14610185578063eff1d50e14610198578063f36ce210146101b8575b5f80fd5b6100b96101da565b6040516100c691906106aa565b60405180910390f35b6100e26100dd3660046106fa565b61026a565b60405190151581526020016100c6565b6002545b6040519081526020016100c6565b6100e2610112366004610722565b610283565b604051601281526020016100c6565b6005546100e290600160a01b900460ff1681565b6100f661014836600461075b565b6001600160a01b03165f9081526020819052604090205490565b6100b96102a6565b6100e26101783660046106fa565b6102b5565b6100e26102c2565b6100f661019336600461077b565b610334565b6005546101ab906001600160a01b031681565b6040516100c691906107ac565b6100e26101c636600461075b565b60066020525f908152604090205460ff1681565b6060600380546101e9906107c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610215906107c0565b80156102605780601f1061023757610100808354040283529160200191610260565b820191905f5260205f20905b81548152906001019060200180831161024357829003601f168201915b5050505050905090565b5f3361027781858561035e565b60019150505b92915050565b5f33610290858285610370565b61029b8585856103c0565b506001949350505050565b6060600480546101e9906107c0565b5f336102778185856103c0565b6005545f906001600160a01b0316331461031b5760405162461bcd60e51b8152602060048201526015602482015274086c2dcdcdee84092dcd2e8d2c2d8d2f4ca4088caf605b1b60448201526064015b60405180910390fd5b506005805460ff60a01b1916600160a01b179055600190565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b61036b83838360016104c5565b505050565b5f61037b8484610334565b90505f1981146103ba57818110156103ac57828183604051637dc7a0d960e11b8152600401610312939291906107f8565b6103ba84848484035f6104c5565b50505050565b6001600160a01b0383166103e9575f604051634b637e8f60e11b815260040161031291906107ac565b6001600160a01b038216610412575f60405163ec442f0560e01b815260040161031291906107ac565b600554600160a01b900460ff1615156001036104335761036b838383610597565b6001600160a01b0383165f9081526006602052604090205460ff1615156001148061047a57506001600160a01b0382165f9081526006602052604090205460ff1615156001145b6104ba5760405162461bcd60e51b81526020600482015260116024820152704e6f7420626f6e64696e6720637572766560781b6044820152606401610312565b61036b838383610597565b6001600160a01b0384166104ee575f60405163e602df0560e01b815260040161031291906107ac565b6001600160a01b038316610517575f604051634a1406b160e11b815260040161031291906107ac565b6001600160a01b038085165f90815260016020908152604080832093871683529290522082905580156103ba57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161058991815260200190565b60405180910390a350505050565b6001600160a01b0383166105c1578060025f8282546105b69190610819565b9091555061061e9050565b6001600160a01b0383165f90815260208190526040902054818110156106005783818360405163391434e360e21b8152600401610312939291906107f8565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b03821661063a57600280548290039055610658565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161069d91815260200190565b60405180910390a3505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b03811681146106f5575f80fd5b919050565b5f806040838503121561070b575f80fd5b610714836106df565b946020939093013593505050565b5f805f60608486031215610734575f80fd5b61073d846106df565b925061074b602085016106df565b9150604084013590509250925092565b5f6020828403121561076b575f80fd5b610774826106df565b9392505050565b5f806040838503121561078c575f80fd5b610795836106df565b91506107a3602084016106df565b90509250929050565b6001600160a01b0391909116815260200190565b600181811c908216806107d457607f821691505b6020821081036107f257634e487b7160e01b5f52602260045260245ffd5b50919050565b6001600160a01b039390931683526020830191909152604082015260600190565b8082018082111561027d57634e487b7160e01b5f52601160045260245ffdfea2646970667358221220ad9135bd7beff2d75f25d7930381ff944dedd75cc080ab20d0114c4540e743b764736f6c63430008190033
Verified Source Code Partial Match
Compiler: v0.8.25+commit.b61c2a91
EVM: cancun
Optimization: Yes (1 runs)
StandardToken.sol 549 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @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 Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
pragma solidity ^0.8.20;
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
pragma solidity ^0.8.20;
/**
* @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 meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
pragma solidity ^0.8.20;
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
pragma solidity ^0.8.20;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC-20
* applications.
*/
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address account => uint256) private _balances;
mapping(address account => mapping(address spender => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Skips emitting an {Approval} event indicating an allowance update. This is not
* required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(address from, address to, uint256 value) virtual internal {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* Emits a {Transfer} event.
*/
function _update(address from, address to, uint256 value) internal virtual {
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
_totalSupply += value;
} else {
uint256 fromBalance = _balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
_balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
_totalSupply -= value;
}
} else {
unchecked {
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
_balances[to] += value;
}
}
emit Transfer(from, to, value);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _mint(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(address(0), account, value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead
*/
function _burn(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(account, address(0), value);
}
/**
* @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
* true using the following override:
*
* ```solidity
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
_allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(spender, currentAllowance, value);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
}
interface IBondingCurveDeployer{
// function deployBondingCurve(address token, address router, string memory _web, string memory _tg, string memory _x, string memory _desc, string memory _tokenLogo, string memory _name, string memory _symbol, address _who) external returns (address bondingCurve);
function deployBondingCurve(address[] memory addresses, string memory _web, string memory _tg, string memory _x, string memory _desc, string memory _tokenLogo, string memory _name, string memory _symbol) external returns (address bondingCurve);
}
pragma solidity ^0.8.0;
contract StandardToken is ERC20 {
address public bondingCurve;
bool public dexInitialized = false;
mapping(address => bool) public isBondingCurve;
event Created(address bondingC);
constructor(string memory name, string memory symbol, string memory _website, string memory _tg, string memory _x, string memory _description, string memory _tokenLogo, address[] memory addresses) ERC20(name, symbol) {
IBondingCurveDeployer bondingCurveDeployer = IBondingCurveDeployer(0xa3c11A1506dbbBe523B1F01D7bDb01710E660786);
address[] memory localAddresses = addresses;
localAddresses[0] = address(this); // token
localAddresses[1] = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // router
localAddresses[2] = msg.sender; // deployer
localAddresses[3] = address(0x0); // placeholder helper
string memory localName = name;
string memory locanSybmol = symbol;
address curved = bondingCurveDeployer.deployBondingCurve(localAddresses, _website, _tg, _x, _description, _tokenLogo, localName, locanSybmol);
bondingCurve = curved;
_mint(curved, 1000000000 * 10 ** decimals());
isBondingCurve[curved] = true;
emit Created(curved);
}
function initializeDex() public returns(bool) {
require(msg.sender == bondingCurve, 'Cannot Initialize Dex');
dexInitialized = true;
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(address from, address to, uint256 value) override internal {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
if(dexInitialized == true){
_update(from, to, value);
} else {
require(isBondingCurve[from] == true || isBondingCurve[to] == true, 'Not bonding curve');
_update(from, to, value);
}
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
bondingCurve 0xeff1d50e → address
decimals 0x313ce567 → uint8
dexInitialized 0x6afa6767 → bool
isBondingCurve 0xf36ce210 → bool
name 0x06fdde03 → string
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 4 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 value
returns: bool
initializeDex 0xc694cc43
No parameters
returns: bool
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
Recent Transactions
No transactions found for this address