Transaction Hash:
Block:
21928222 at Feb-26-2025 04:49:23 AM +UTC
Transaction Fee:
0.000282215156570625 ETH
$0.79
Gas Used:
170,375 Gas / 1.656435255 Gwei
Emitted Events:
172 |
WETH9.Deposit( dst=[Receiver] UniversalRouter, wad=36500000000000000 )
|
173 |
WETH9.Transfer( src=[Receiver] UniversalRouter, dst=UniswapV2Pair, wad=36500000000000000 )
|
174 |
COFFEE.Transfer( from=UniswapV2Pair, to=[Receiver] UniversalRouter, value=15329119386599279404643 )
|
175 |
UniswapV2Pair.Sync( reserve0=9211488261182701869224766, reserve1=21904074719367791687 )
|
176 |
UniswapV2Pair.Swap( sender=[Receiver] UniversalRouter, amount0In=0, amount1In=36500000000000000, amount0Out=15329119386599279404643, amount1Out=0, to=[Receiver] UniversalRouter )
|
177 |
COFFEE.Transfer( from=[Receiver] UniversalRouter, to=FeeCollector, value=38322798466498198511 )
|
178 |
COFFEE.Transfer( from=[Receiver] UniversalRouter, to=[Sender] 0x8a5604545270be050113be70ff30eedf7c7cdb97, value=15290796588132781206132 )
|
Account State Difference:
Address | Before | After | State Difference | ||
---|---|---|---|---|---|
0x18eF464f...8f6C48180 | |||||
0x24943569...5d3Fb5131 | |||||
0x4838B106...B0BAD5f97
Miner
| (Titan Builder) | 6.62098846599602956 Eth | 6.62115884099602956 Eth | 0.000170375 | |
0x8a560454...F7C7cdb97 |
0.040437997102333741 Eth
Nonce: 8
|
0.003655781945763116 Eth
Nonce: 9
| 0.036782215156570625 | ||
0xC02aaA39...83C756Cc2 | 2,923,213.998835488516276277 Eth | 2,923,214.035335488516276277 Eth | 0.0365 |
Execution Trace
ETH 0.0365
UniversalRouter.execute( commands=0x0B080604, inputs=[AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgayOfk1AAA==, AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgayOfk1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAwCqqObIj/o0KDlxPJ+rZCDx1bMIAAAAAAAAAAAAAAAAY70ZP1z7UhMEjOeql1ePI9sSBgA==, AAAAAAAAAAAAAAAAGO9GT9c+1ITBIznqpdXjyPbEgYAAAAAAAAAAAAAAAAAAAAD+4ToQOhDVk7muBrPgXy5+HAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ, AAAAAAAAAAAAAAAAGO9GT9c+1ITBIznqpdXjyPbEgYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAADOMqybSDxw08s], deadline=1740545915 )
- ETH 0.0365
WETH9.CALL( )
-
WETH9.transfer( dst=0x24943569b82657699d34C2f5D0e0A365d3Fb5131, wad=36500000000000000 ) => ( True )
-
COFFEE.balanceOf( account=0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD ) => ( 0 )
-
UniswapV2Pair.STATICCALL( )
-
WETH9.balanceOf( 0x24943569b82657699d34C2f5D0e0A365d3Fb5131 ) => ( 21904074719367791687 )
UniswapV2Pair.swap( amount0Out=15329119386599279404643, amount1Out=0, to=0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD, data=0x )
-
COFFEE.transfer( to=0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD, amount=15329119386599279404643 ) => ( True )
-
COFFEE.balanceOf( account=0x24943569b82657699d34C2f5D0e0A365d3Fb5131 ) => ( 9211488261182701869224766 )
-
WETH9.balanceOf( 0x24943569b82657699d34C2f5D0e0A365d3Fb5131 ) => ( 21904074719367791687 )
-
-
COFFEE.balanceOf( account=0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD ) => ( 15329119386599279404643 )
-
COFFEE.balanceOf( account=0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD ) => ( 15329119386599279404643 )
-
COFFEE.transfer( to=0x000000fee13a103A10D593b9AE06b3e05F2E7E1c, amount=38322798466498198511 ) => ( True )
-
COFFEE.balanceOf( account=0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD ) => ( 15290796588132781206132 )
-
COFFEE.transfer( to=0x8a5604545270BE050113BE70ff30eeDF7C7cdb97, amount=15290796588132781206132 ) => ( True )
execute[UniversalRouter (ln:16)]
execute[UniversalRouter (ln:21)]
execute[UniversalRouter (ln:21)]
File 1 of 5: UniversalRouter
File 2 of 5: WETH9
File 3 of 5: UniswapV2Pair
File 4 of 5: COFFEE
File 5 of 5: FeeCollector
12345678910111213141516// SPDX-License-Identifier: GPL-3.0-or-laterpragma solidity ^0.8.17;// Command implementationsimport {Dispatcher} from './base/Dispatcher.sol';import {RewardsCollector} from './base/RewardsCollector.sol';import {RouterParameters, RouterImmutables} from './base/RouterImmutables.sol';import {Commands} from './libraries/Commands.sol';import {IUniversalRouter} from './interfaces/IUniversalRouter.sol';contract UniversalRouter is RouterImmutables, IUniversalRouter, Dispatcher, RewardsCollector {modifier checkDeadline(uint256 deadline) {if (block.timestamp > deadline) revert TransactionDeadlinePassed();_;}constructor(RouterParameters memory params) RouterImmutables(params) {}/// @inheritdoc IUniversalRouterfunction execute(bytes calldata commands, bytes[] calldata inputs, uint256 deadline)
File 2 of 5: WETH9
12345678910111213141516// Copyright (C) 2015, 2016, 2017 Dapphub// This program is free software: you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation, either version 3 of the License, or// (at your option) any later version.// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU General Public License for more details.// You should have received a copy of the GNU General Public License// along with this program. If not, see <http://www.gnu.org/licenses/>.pragma solidity ^0.4.18;
File 3 of 5: UniswapV2Pair
12345678910111213141516// File: contracts/interfaces/IUniswapV2Pair.solpragma solidity >=0.5.0;interface IUniswapV2Pair {event Approval(address indexed owner, address indexed spender, uint value);event Transfer(address indexed from, address indexed to, uint value);function name() external pure returns (string memory);function symbol() external pure returns (string memory);function decimals() external pure returns (uint8);function totalSupply() external view returns (uint);function balanceOf(address owner) external view returns (uint);function allowance(address owner, address spender) external view returns (uint);function approve(address spender, uint value) external returns (bool);
File 4 of 5: COFFEE
1{"COFFEE.sol":{"content":"/*\nTwitter: x.com/weare_coffee?s=21\n\nTelegram: t.me/coffeeAI_portal\n\nWebsite: Coffee.to\n*/\n\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.22;\n\nimport \"./ERC20.sol\";\nimport \"./Ownable.sol\"; \n\ninterface IUniswapV2Router02 {\n functionswapExactTokensForETHSupportingFeeOnTransferTokens(uint256 amountIn,uint256 amountOutMin,address[] calldata path,address to,uint256 deadline)external;\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\n functionaddLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payablereturns (uint amountToken, uint amountETH, uint liquidity);\n}\ninterface IUniswapV2Factory {\n function createPair(address tokenA, addresstokenB) external returns (address pair);\n}\n\ncontract COFFEE is ERC20, Ownable {\n\n uint256 private buyTax = 20;\n uint256 private sellTax= 25;\n\n IUniswapV2Router02 private uniswapV2Router;\n address public uniswapV2Pair;\n mapping(address =\u003e bool) public isExempt;\n\n address private immutable marketingAddress;\n address private immutable taxAddress;\n\n uint256 public maxTransaction;\n uint256public maxTxLaunch;\n bool private launch = false;\n bool private launchLimits = true;\n uint256 private blockLaunch;\n uint256 privatelastSellBlock;\n uint256 private sellCount;\n uint256 private minSwap;\n uint256 private maxSwap;\n uint256 private _buyCount= 0;\nbool private inSwap;\n modifier lockTheSwap {\n inSwap = true;\n _;\n inSwap = false;\n }\n\n constructor(\naddress _taxAddress,\n address _marketingAddress,\n address _reserve,\n address _team,\n address _grants,\naddress _ps\n ) ERC20(\"COFFEE\", \"COFFEE\") Ownable() payable {\n uint256 totalSupply = 100000000 * 10**18;\n \nmarketingAddress = _marketingAddress;\n taxAddress = _taxAddress;\n\n isExempt[msg.sender] = true; \n isExempt[address(this)]= true; \n isExempt[_reserve] = true;\n isExempt[marketingAddress] = true; \n isExempt[taxAddress] = true; \nisExempt[_grants] = true;\n isExempt[_team] = true;\n isExempt[_ps] = true;\n\n _mint(_ps, totalSupply * 10 / 100); \n_mint(_team, totalSupply * 5 / 100); \n _mint(_grants, totalSupply * 10 / 100); \n _mint(_reserve, totalSupply * 8 / 100); \n_mint(_marketingAddress, totalSupply * 5 / 100); \n _mint(address(this), totalSupply * 62 / 100); \n\n uniswapV2Router =IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n uniswapV2Pair = address(\n IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH())\n );\n \n maxTransaction = totalSupply * 2 / 100;\nmaxTxLaunch = totalSupply * 5 / 1000; \n maxSwap = 150000 * 10**18;\n minSwap = 25000 * 10**18;\n }\n\n functionaddLiquidityETH() external onlyOwner {\n _approve(address(this), address(uniswapV2Router), balanceOf(address(this)));\nuniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n0,\n owner(),\n block.timestamp\n );\n }\n\n function getMinCaSwap() public view returns (uint256){\n return minSwap / 10**decimals();\n }\n\n function setMaxCaSwap(uint256 _maxSwap) external onlyOwner{\n maxSwap = _maxSwap* 10**decimals();\n }\n\n function setMinSwap(uint256 _minSwap) external onlyOwner{\n minSwap = _minSwap * 10**decimals();\n }\n\nfunction switchCaCanSell() external onlyOwner {\n if (inSwap){\n inSwap = false;\n } else {\n inSwap = true;\n }\n }\n\n function removeLaunchLimits() external onlyOwner {\n launchLimits = false;\n }\n\n function getMaxCASwap()public view returns (uint256){\n return maxSwap / 10**decimals();\n }\n\n function swapTokensEth(uint256 tokenAmount) internallockTheSwap {\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n \n address[] memory path = new address[](2);\n path[0] = address(this);\n path[1] = uniswapV2Router.WETH();\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n taxAddress,\nblock.timestamp\n );\n }\n\n function _transfer(address from, address to, uint256 value) internal virtual override {\n if(!isExempt[from] \u0026\u0026 !isExempt[to]) {\n require(launch, \"Not launched\");\n uint256 tax = 0;\n \nif (launchLimits \u0026\u0026 blockLaunch!=block.number){\n require(value \u003c= maxTxLaunch, \"MAX TX LIMIT\");\n} else {\n require(value \u003c= maxTransaction, \"MAX TX LIMIT\");\n }\n\n if (to == uniswapV2Pair) {\ntax = sellTax;\n uint256 tokensSwap = balanceOf(address(this));\n if (tokensSwap \u003e minSwap\u0026\u0026 !inSwap) {\n if (block.number \u003e lastSellBlock) {\n sellCount = 0;\n}\n if (sellCount \u003c 3){\n sellCount++;\n lastSellBlock = block.number;\nswapTokensEth(min(maxSwap, min(value, tokensSwap)));\n }\n }\n } else if (from ==uniswapV2Pair){\n tax = buyTax;\n if(block.number == blockLaunch){\n _buyCount++;\ntax = 0;\n require(_buyCount \u003c= 11,\"Exceeds buys on the first block.\");\n }\n }\n\nuint256 taxAmount = value * tax / 100;\n uint256 amountAfterTax = value - taxAmount;\n\n if (taxAmount \u003e 0){\nsuper._transfer(from, address(this), taxAmount);\n }\n super._transfer(from, to, amountAfterTax);\nreturn;\n }\n super._transfer(from, to, value);\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256){\nreturn (a\u003eb)?b:a;\n }\n\n function setMaxTx(uint256 newMaxTx) external onlyOwner {\n require(newMaxTx* 10**decimals() \u003e=totalSupply()/100); //Protect: MaxTx more then 1%\n maxTransaction= newMaxTx * 10**decimals();\n }\n\n function setExcludedWallet(address wAddress, bool isExcle) external onlyOwner {\n isExempt[wAddress] = isExcle;\n }\n \n function openTrading() externalonlyOwner {\n launch = true;\n blockLaunch = block.number;\n }\n \n function setTax(uint256 newBuyTax , uint256 newSellTax)external onlyOwner {\n require(newBuyTax \u003c 20 \u0026\u0026 newSellTax \u003c 20); //Protect: Tax less then 20%\n sellTax =newSellTax;\n buyTax = newBuyTax;\n }\n\n function removeAllLimits() external onlyOwner {\n launchLimits = false;\nmaxTransaction = totalSupply();\n }\n\n function exportETH() external {\n payable(marketingAddress).transfer(address(this).balance);\n}\n\n receive() external payable {}\n}\n"},"Context.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of thetransaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n *manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as anapplication\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\nfunction _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal viewvirtual returns (bytes calldata) {\n return msg.data;\n }\n}\n"},"ERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelinContracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./IERC20Metadata.sol\";\nimport \"./Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokensare created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see{ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n *this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * insteadreturning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance forall accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn\u0027t required by thespecification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address=\u003e uint256) private _balances;\n\n mapping(address =\u003e mapping(address =\u003e uint256)) private _allowances;\n\n uint256 private_totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n* All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_,string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n*/\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns thesymbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (stringmemory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * Forexample, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n *Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it\u0027s overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects anyof the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public viewvirtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\nfunction balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n* @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have abalance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n addressowner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n*/\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return_allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, theallowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n*\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns(bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See{IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See thenote at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n*\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``\u0027s tokens of at least\n * `amount`.\n */\n function transferFrom(addressfrom, address to, uint256 amount) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from,spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowancegranted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problemsdescribed in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n* - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns(bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n}\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to{approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicatingthe updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must haveallowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue)public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\nrequire(currentAllowance \u003e= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner,spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from`from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees,slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zeroaddress.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(address from, address to, uint256 amount) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\nrequire(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256fromBalance = _balances[from];\n require(fromBalance \u003e= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n_balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and thesum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from,to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`,increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n*\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\nrequire(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n_totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which ischecked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n_afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n *total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account`cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount)internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance \u003e= amount, \"ERC20: burn amount exceedsbalance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount \u003c=accountBalance \u003c= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n_afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` stokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certainsubsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n* - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\nrequire(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zeroaddress\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates`owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n* Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(addressowner, address spender, uint256 amount) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if(currentAllowance != type(uint256).max) {\n require(currentAllowance \u003e= amount, \"ERC20: insufficient allowance\");\nunchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hookthat is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when`from` and `to` are both non-zero, `amount` of ``from``\u0027s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount`tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``\u0027s tokens will be burned.\n * - `from` and `to` are neverboth zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function_beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n /**\n * @dev Hook that is called after any transferof tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero,`amount` of ``from``\u0027s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``\u0027s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n *To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(addressfrom, address to, uint256 amount) internal virtual {}\n}\n"},"IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts(last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n*/\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n* Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @devEmitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n eventApproval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n*/\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\nfunction balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller\u0027saccount to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n*/\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokensthat `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * Thisvalue changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns(uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller\u0027s tokens.\n *\n * Returns a booleanvalue indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n* that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate thisrace\n * condition is to first reduce the spender\u0027s allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender,uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism.`amount` is then deducted from the caller\u0027s\n * allowance.\n *\n * Returns a boolean value indicating whether the operationsucceeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns(bool);\n}\n"},"IERC20Metadata.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from theERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n*/\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n functionsymbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals()external view returns (uint8);\n}\n"},"Ownable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0)(access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access controlmechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owneraccount will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used throughinheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n*/\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, addressindexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n_transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifieronlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n functionowner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n*/\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n/**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by thecurrent owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionalitythat is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the currentowner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable:new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to anew account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner)internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n}\n}\n"}}
File 5 of 5: FeeCollector
12345678910111213141516// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity ^0.8.0;import {Owned} from "solmate/auth/Owned.sol";import {ERC20} from "solmate/tokens/ERC20.sol";import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";import {IFeeCollector} from "./interfaces/IFeeCollector.sol";import {IPermit2} from "./external/IPermit2.sol";/// @notice The collector of protocol fees that will be used to swap and send to a fee recipient address.contract FeeCollector is Owned, IFeeCollector {using SafeTransferLib for ERC20;address public universalRouter;ERC20 public immutable feeToken;IPermit2 public immutable permit2;uint256 public constant MAX_APPROVAL_AMOUNT = type(uint256).max;uint160 public constant MAX_PERMIT2_APPROVAL_AMOUNT = type(uint160).max;uint48 public constant MAX_PERMIT2_DEADLINE = type(uint48).max;