Address Contract Verified
Address
0xd68e4b0f3ae11cF50F1508EF280d1993dafc4b82
Balance
0 ETH
Nonce
1
Code Size
6186 bytes
Creator
0x1CD8878c...5854 at tx 0x72d196b1...eee140
Indexed Transactions
0
Contract Bytecode
6186 bytes
0x608060405234801561000f575f80fd5b50600436106100f3575f3560e01c80634bac0b4111610095578063a9059cbb11610064578063a9059cbb1461029b578063c16eea65146102cb578063dd62ed3e146102e9578063e8078d9414610319576100f3565b80634bac0b41146101ff57806370a082311461021d57806395d89b411461024d578063a457c2d71461026b576100f3565b806318160ddd116100d157806318160ddd1461016357806323b872dd14610181578063313ce567146101b157806339509351146101cf576100f3565b806306fdde03146100f7578063095ea7b31461011557806316f0115b14610145575b5f80fd5b6100ff610323565b60405161010c9190610e94565b60405180910390f35b61012f600480360381019061012a9190610f45565b6103b3565b60405161013c9190610f9d565b60405180910390f35b61014d6103d5565b60405161015a9190610fc5565b60405180910390f35b61016b6103fa565b6040516101789190610fed565b60405180910390f35b61019b60048036038101906101969190611006565b610403565b6040516101a89190610f9d565b60405180910390f35b6101b9610431565b6040516101c69190611071565b60405180910390f35b6101e960048036038101906101e49190610f45565b610439565b6040516101f69190610f9d565b60405180910390f35b61020761046f565b6040516102149190610e94565b60405180910390f35b6102376004803603810190610232919061108a565b6104ac565b6040516102449190610fed565b60405180910390f35b6102556104f1565b6040516102629190610e94565b60405180910390f35b61028560048036038101906102809190610f45565b610581565b6040516102929190610f9d565b60405180910390f35b6102b560048036038101906102b09190610f45565b6105f6565b6040516102c29190610f9d565b60405180910390f35b6102d3610618565b6040516102e09190610e94565b60405180910390f35b61030360048036038101906102fe91906110b5565b610655565b6040516103109190610fed565b60405180910390f35b6103216106d7565b005b60606003805461033290611120565b80601f016020809104026020016040519081016040528092919081815260200182805461035e90611120565b80156103a95780601f10610380576101008083540402835291602001916103a9565b820191905f5260205f20905b81548152906001019060200180831161038c57829003601f168201915b5050505050905090565b5f806103bd61093f565b90506103ca818585610946565b600191505092915050565b60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f600254905090565b5f8061040d61093f565b905061041a858285610b09565b610425858585610b94565b60019150509392505050565b5f6012905090565b5f8061044361093f565b90506104648185856104558589610655565b61045f919061117d565b610946565b600191505092915050565b60606040518060400160405280600c81526020017f47756163206e20726f6c6c210000000000000000000000000000000000000000815250905090565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b60606004805461050090611120565b80601f016020809104026020016040519081016040528092919081815260200182805461052c90611120565b80156105775780601f1061054e57610100808354040283529160200191610577565b820191905f5260205f20905b81548152906001019060200180831161055a57829003601f168201915b5050505050905090565b5f8061058b61093f565b90505f6105988286610655565b9050838110156105dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d490611220565b60405180910390fd5b6105ea8286868403610946565b60019250505092915050565b5f8061060061093f565b905061060d818585610b94565b600191505092915050565b60606040518060400160405280601881526020017f746f2067657420736d6173686564206f6e20746f617374210000000000000000815250905090565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b3073ffffffffffffffffffffffffffffffffffffffff1663095ea7b360055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff167f00000000000000000000000000000000000000000332e8a789bc7ef49e0000006040518363ffffffff1660e01b815260040161075392919061123e565b6020604051808303815f875af115801561076f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610793919061128f565b5060055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638831645660405180610160016040528060095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600a5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016101f462ffffff168152602001600760149054906101000a900460020b60020b8152602001600760179054906101000a900460020b60020b8152602001600b548152602001600c5481526020015f81526020015f81526020013073ffffffffffffffffffffffffffffffffffffffff1681526020016104b0426108da919061117d565b8152506040518263ffffffff1660e01b81526004016108f991906113ef565b6080604051808303815f875af1158015610915573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109399190611462565b50505050565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036109b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ab90611536565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610a22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a19906115c4565b60405180910390fd5b8060015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610afc9190610fed565b60405180910390a3505050565b5f610b148484610655565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610b8e5781811015610b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b779061162c565b60405180910390fd5b610b8d8484848403610946565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610c02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf9906116ba565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610c70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6790611748565b60405180910390fd5b610c7b838383610e00565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905081811015610cfe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf5906117d6565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550815f808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610de79190610fed565b60405180910390a3610dfa848484610e05565b50505050565b505050565b505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015610e41578082015181840152602081019050610e26565b5f8484015250505050565b5f601f19601f8301169050919050565b5f610e6682610e0a565b610e708185610e14565b9350610e80818560208601610e24565b610e8981610e4c565b840191505092915050565b5f6020820190508181035f830152610eac8184610e5c565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610ee182610eb8565b9050919050565b610ef181610ed7565b8114610efb575f80fd5b50565b5f81359050610f0c81610ee8565b92915050565b5f819050919050565b610f2481610f12565b8114610f2e575f80fd5b50565b5f81359050610f3f81610f1b565b92915050565b5f8060408385031215610f5b57610f5a610eb4565b5b5f610f6885828601610efe565b9250506020610f7985828601610f31565b9150509250929050565b5f8115159050919050565b610f9781610f83565b82525050565b5f602082019050610fb05f830184610f8e565b92915050565b610fbf81610ed7565b82525050565b5f602082019050610fd85f830184610fb6565b92915050565b610fe781610f12565b82525050565b5f6020820190506110005f830184610fde565b92915050565b5f805f6060848603121561101d5761101c610eb4565b5b5f61102a86828701610efe565b935050602061103b86828701610efe565b925050604061104c86828701610f31565b9150509250925092565b5f60ff82169050919050565b61106b81611056565b82525050565b5f6020820190506110845f830184611062565b92915050565b5f6020828403121561109f5761109e610eb4565b5b5f6110ac84828501610efe565b91505092915050565b5f80604083850312156110cb576110ca610eb4565b5b5f6110d885828601610efe565b92505060206110e985828601610efe565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061113757607f821691505b60208210810361114a576111496110f3565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61118782610f12565b915061119283610f12565b92508282019050808211156111aa576111a9611150565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f775f8201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b5f61120a602583610e14565b9150611215826111b0565b604082019050919050565b5f6020820190508181035f830152611237816111fe565b9050919050565b5f6040820190506112515f830185610fb6565b61125e6020830184610fde565b9392505050565b61126e81610f83565b8114611278575f80fd5b50565b5f8151905061128981611265565b92915050565b5f602082840312156112a4576112a3610eb4565b5b5f6112b18482850161127b565b91505092915050565b6112c381610ed7565b82525050565b5f62ffffff82169050919050565b6112e0816112c9565b82525050565b5f8160020b9050919050565b6112fb816112e6565b82525050565b61130a81610f12565b82525050565b61016082015f8201516113255f8501826112ba565b50602082015161133860208501826112ba565b50604082015161134b60408501826112d7565b50606082015161135e60608501826112f2565b50608082015161137160808501826112f2565b5060a082015161138460a0850182611301565b5060c082015161139760c0850182611301565b5060e08201516113aa60e0850182611301565b506101008201516113bf610100850182611301565b506101208201516113d46101208501826112ba565b506101408201516113e9610140850182611301565b50505050565b5f610160820190506114035f830184611310565b92915050565b5f8151905061141781610f1b565b92915050565b5f6fffffffffffffffffffffffffffffffff82169050919050565b6114418161141d565b811461144b575f80fd5b50565b5f8151905061145c81611438565b92915050565b5f805f806080858703121561147a57611479610eb4565b5b5f61148787828801611409565b94505060206114988782880161144e565b93505060406114a987828801611409565b92505060606114ba87828801611409565b91505092959194509250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f611520602483610e14565b915061152b826114c6565b604082019050919050565b5f6020820190508181035f83015261154d81611514565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f6115ae602283610e14565b91506115b982611554565b604082019050919050565b5f6020820190508181035f8301526115db816115a2565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000005f82015250565b5f611616601d83610e14565b9150611621826115e2565b602082019050919050565b5f6020820190508181035f8301526116438161160a565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f6116a4602583610e14565b91506116af8261164a565b604082019050919050565b5f6020820190508181035f8301526116d181611698565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f611732602383610e14565b915061173d826116d8565b604082019050919050565b5f6020820190508181035f83015261175f81611726565b9050919050565b7f45524332303a207472616e7366657220616d6f756e74206578636565647320625f8201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b5f6117c0602683610e14565b91506117cb82611766565b604082019050919050565b5f6020820190508181035f8301526117ed816117b4565b905091905056fea26469706673582212207178a5735eef92adb772faa1f745e25e99377d9d49cf4d38d938b9608f65a34864736f6c63430008150033
Verified Source Code Full Match
Compiler: v0.8.21+commit.d9974bed
EVM: shanghai
Optimization: No
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @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;
}
}
IERC20Metadata.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
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);
}
IERC20.sol 78 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
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 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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}
AVO.sol 142 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;
/**
* @title AvocadoToast
* @author memesonmondays.eth
*
* ▓▓▓▓▓▓ ▓▓▓▓▓▓
* ▓▓░░░░░░▓▓▓▓░░░░░░▓▓
* ▓▓░░░░░░░░░░░░░░░░░░░░▓▓
* ▓▓░░░░██ ░░░░██ ░░░░▓▓
* ▓▓░░░░░░░░░░░░░░░░▓▓
* ▓▓░░░░░░░░░░░░░░░░▓▓
* ▓▓░░▓▓▓▓▓▓▓▓▓▓░░░░▓▓
* ▓▓░░░░░ ░░░░░▓▓
* ▓▓░░░░░░░░░░░░░░░░▓▓
* ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
* https://AvocadoToken.xyz
* https://MemesOnMondays.com
* https://x.com/MemesOnMondays
*
* @notice Just like the delicious brunch dish,
* this memecoin is the perfect blend of thrill,
* zest, and healthy investment strategies! True
* to its name, Avocado Toast doesn’t only represent
* a social phenomenon but is poised to combine the
* new age excitement of crypto with an avocado twist
*/
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
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 createAndInitializePoolIfNecessary(
address token0,
address token1,
uint24 fee,
uint160 sqrtPriceX96
) external payable returns (address pool);
}
contract AvocadoToast is ERC20 {
/**
* @notice Laughter is the best medicine,
* almost as good for you as avocado toast!
*/
function whyDidTheAvocadoCrossTheRoad() external pure returns (string memory) {
return 'to get smashed on toast!';
}
/**
* @dev these jokes cost hundreds of dollars to
* deploy on Ethereum... maybe no one will see them
*/
function whatIsAvocadosFavoriteMusic() external pure returns (string memory) {
return 'Guac n roll!';
}
INonfungiblePositionManager posMan = INonfungiblePositionManager(0xC36442b4a4522E871399CD717aBDD847Ab11FE88);
address weth;
uint immutable uniswapSupply = 990_000_000 * 10 ** decimals();
uint immutable devSupply = 10_000_000 * 10 ** decimals();
uint24 constant fee = 500;
uint160 sqrtPriceX96;
int24 minTick;
int24 maxTick;
address public pool;
address token0;
address token1;
uint amount0Desired;
uint amount1Desired;
constructor() ERC20("AvocadoToast", "AVO") {
_mint(address(this), uniswapSupply);
_mint(msg.sender, devSupply);
if (block.chainid == 1 || block.chainid == 31337) {
weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
} else {
weth = 0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6;
}
setupUniswapV3();
pool = posMan.createAndInitializePoolIfNecessary(token0, token1, fee, sqrtPriceX96);
}
function setupUniswapV3() internal {
if (address(this) < weth) {
token0 = address(this);
token1 = weth;
sqrtPriceX96 = 35430489019307872761053455;
amount0Desired = uniswapSupply;
amount1Desired = 0;
minTick = -154250;
maxTick = 887270;
} else {
token0 = weth;
token1 = address(this);
sqrtPriceX96 = 177157811748422129510100785485839;
amount0Desired = 0;
amount1Desired = uniswapSupply;
minTick = -887270;
maxTick = 154250;
}
}
/**
* @notice 99% of liquidity is sent to Uniswap v3 and NFT LP token
* is locked in the contract with no methods to remove or redeem it
*/
function addLiquidity() external {
IERC20(address(this)).approve(address(posMan), uniswapSupply);
posMan.mint(INonfungiblePositionManager.MintParams({
token0: token0,
token1: token1,
fee: fee,
tickLower: minTick,
tickUpper: maxTick,
amount0Desired: amount0Desired,
amount1Desired: amount1Desired,
amount0Min: 0,
amount1Min: 0,
recipient: address(this),
deadline: block.timestamp + 1200
}));
}
}
ERC20.sol 365 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
/**
* @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}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* 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 ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => 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 override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override 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 override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override 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 `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` 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 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* 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 `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `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.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` 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.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
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);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
pool 0x16f0115b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
whatIsAvocadosFavoriteMusic 0x4bac0b41 → string
whyDidTheAvocadoCrossTheRoad 0xc16eea65 → string
Write Contract 6 functions
These functions modify contract state and require a wallet transaction to execute.
addLiquidity 0xe8078d94
No parameters
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
Recent Transactions
No transactions found for this address