Verified contractExactMIT
Treasury
Address0xcb70ed7282c97ae95d9beeedef7ebd0f1d533c0b
- Balance
0 ETH
- Transactions
5
- Compiler
solc 0.8.35
- Same code
Only this contract
Details
- Compiler
- solc 0.8.35+commit.47b9dedd
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- cancun
- Via IR
- yes
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 25,213,985
- Creation transaction
- 0x546944c651…540591c6b5
14 files
- src/Treasury.solmain14.38 KB
- lib/openzeppelin-contracts/contracts/access/Ownable.sol3.1 KB
- lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol4.45 KB
- lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol193 B
- lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol182 B
- lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol2.78 KB
- lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol13.31 KB
- lib/openzeppelin-contracts/contracts/utils/Context.sol963 B
- lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol4.77 KB
- lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol4.18 KB
- lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol871 B
- src/BasisLedger.sol2.62 KB
- src/interfaces/ISwapRouter.sol824 B
- src/interfaces/ITFLOBuyback.sol142 B
src/Treasury.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.35;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ISwapRouter} from "./interfaces/ISwapRouter.sol";
import {ITFLOBuyback} from "./interfaces/ITFLOBuyback.sol";
import {BasisLedger} from "./BasisLedger.sol";
/// @title Treasury
/// @notice Holds ETH from fee harvesting; deploys it into a team-curated eligible-token universe
/// via deterministic round-robin buys; tracks per-token tranches; routes sale proceeds
/// to the TFLO buyback. v1 design: owner-only `triggerBuy` / `executeSell` with caller-
/// supplied `minOut` for slippage protection (see ARCHITECTURE.md §1 centralization note).
contract Treasury is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
using BasisLedger for BasisLedger.Tranche[];
// ── External refs (immutable) ──────────────────────────────────────────────────────────────
ISwapRouter public immutable SWAP_ROUTER;
ITFLOBuyback public immutable BUYBACK;
// ── Upper bounds only (from ARCHITECTURE.md §3.1, §3.2) ────────────────────────────────────
// No lower bound on buyThreshold / sellGainBps: the owner sets sensible values and is solely
// responsible for them (v1 trusted-owner model, §9.16). A 0 sellGainBps disables the
// realized-gain floor entirely (any sale, incl. a loss, passes) — this is the deliberate
// emergency-exit lever, not an accident. Only the upper caps are enforced on-chain.
uint256 public constant MAX_BUY_THRESHOLD = 10 ether;
uint16 public constant MAX_SELL_GAIN_BPS = 5000;
uint8 public constant MAX_ELIGIBLE_TOKENS = 50;
uint8 public constant PER_BUY_CAP_MULTIPLIER = 2;
// ── Storage (see ARCHITECTURE.md §5) ───────────────────────────────────────────────────────
mapping(address => BasisLedger.Tranche[]) public _tranches;
address[] public eligibleTokens;
mapping(address => bool) public isEligible;
uint256 public nextBuyIndex;
uint256 public buyThreshold;
uint16 public sellGainBps;
/// @notice Secondary caller authorized to invoke `triggerBuy` / `executeSell`.
/// Starts at address(0); owner sets via `setTrader`. The v2 TWAP-validating
/// trigger contract is installed here without transferring ownership.
address public trader;
// ── Events ─────────────────────────────────────────────────────────────────────────────────
event Bought(address indexed winner, uint256 indexed idx, uint256 ethSpent, uint256 tokenOut);
event Sold(
address indexed token,
uint256 indexed trancheIndex,
uint256 amount,
uint256 ethReceived,
uint256 realizedGainBps
);
event EligibleAdded(address indexed token);
event EligibleRemoved(address indexed token);
event BuyThresholdSet(uint256 newValue);
event SellGainBpsSet(uint16 newValue);
event TraderSet(address indexed oldTrader, address indexed newTrader);
// ── Errors ─────────────────────────────────────────────────────────────────────────────────
error BuyThresholdOutOfBounds(uint256 value);
error SellGainBpsOutOfBounds(uint16 value);
error AlreadyEligible(address token);
error NotEligible(address token);
error EligibleListFull();
error InsufficientTreasuryBalance(uint256 balance, uint256 threshold);
error NoEligibleTokens();
error TrancheOutOfRange(address token, uint256 trancheIndex);
error TrancheAlreadySold();
error RealizedGainBelowFloor(uint256 realized, uint256 floor);
error NotOwnerOrTrader(address caller);
/// @param swapRouter SwapRouter — forwards operator-built Universal Router routes.
/// @param buyback TFLOBuyback — final hop on every sell.
/// @param defaultBuyThreshold Initial buy threshold (must be within MIN/MAX).
/// @param defaultSellGainBps Initial sell-gain floor (must be within MIN/MAX).
constructor(
ISwapRouter swapRouter,
ITFLOBuyback buyback,
uint256 defaultBuyThreshold,
uint16 defaultSellGainBps
) Ownable(msg.sender) {
if (defaultBuyThreshold > MAX_BUY_THRESHOLD) {
revert BuyThresholdOutOfBounds(defaultBuyThreshold);
}
if (defaultSellGainBps > MAX_SELL_GAIN_BPS) {
revert SellGainBpsOutOfBounds(defaultSellGainBps);
}
SWAP_ROUTER = swapRouter;
BUYBACK = buyback;
buyThreshold = defaultBuyThreshold;
sellGainBps = defaultSellGainBps;
}
receive() external payable {}
// ── Owner config setters ───────────────────────────────────────────────────────────────────
function setBuyThreshold(uint256 value) external onlyOwner {
if (value > MAX_BUY_THRESHOLD) {
revert BuyThresholdOutOfBounds(value);
}
buyThreshold = value;
emit BuyThresholdSet(value);
}
function setSellGainBps(uint16 value) external onlyOwner {
if (value > MAX_SELL_GAIN_BPS) {
revert SellGainBpsOutOfBounds(value);
}
sellGainBps = value;
emit SellGainBpsSet(value);
}
/// @notice Assign (or clear, with address(0)) the secondary caller permitted to invoke
/// `triggerBuy` / `executeSell`. Single-step; the owner is solely responsible
/// for vetting the new address (matches the project's single-step `Ownable` posture).
function setTrader(address newTrader) external onlyOwner {
address old = trader;
trader = newTrader;
emit TraderSet(old, newTrader);
}
/// @notice Add a token to the round-robin buy universe. How it is traded (which
/// pools / route) is decided off-chain per trade by the operator's router
/// and supplied as Universal Router calldata to `triggerBuy`/`executeSell`
/// — there is no on-chain pool descriptor (see ARCHITECTURE.md §5).
function addEligibleToken(address token) external onlyOwner {
if (eligibleTokens.length >= MAX_ELIGIBLE_TOKENS) revert EligibleListFull();
if (isEligible[token]) revert AlreadyEligible(token);
eligibleTokens.push(token);
isEligible[token] = true;
// One-time, never-decreased max approval to SwapRouter. Sells pull the tranche via
// SwapRouter.transferFrom, so granting the allowance once here removes the per-sell
// approval from executeSell. The allowance is never reduced (removeEligibleToken leaves
// it intact) so retained tranches stay sellable forever — see §9.9.
IERC20(token).forceApprove(address(SWAP_ROUTER), type(uint256).max);
emit EligibleAdded(token);
}
function removeEligibleToken(address token) external onlyOwner {
if (!isEligible[token]) revert NotEligible(token);
// Swap-and-pop on eligibleTokens[]. nextBuyIndex is NEVER mutated.
uint256 len = eligibleTokens.length;
for (uint256 i = 0; i < len; ) {
if (eligibleTokens[i] == token) {
if (i != len - 1) {
eligibleTokens[i] = eligibleTokens[len - 1];
}
eligibleTokens.pop();
break;
}
unchecked { ++i; }
}
isEligible[token] = false;
// _tranches[token] intentionally retained so historical holdings stay sellable
// forever (the off-chain router can still build a sell route) — see §9.9.
emit EligibleRemoved(token);
}
// ── Owner-or-trader trade triggers (v1: caller-supplied minOut from off-chain quoter) ──────
function _requireOwnerOrTrader() internal view {
if (msg.sender != owner() && msg.sender != trader) revert NotOwnerOrTrader(msg.sender);
}
/// @param commands Universal Router command bytes for the ETH→winner route (operator-built).
/// @param inputs Per-command inputs. The route MUST output the winning token to this Treasury.
/// @param minOut Minimum winning-token amount; enforced by SwapRouter's balance-delta check.
function triggerBuy(
bytes calldata commands,
bytes[] calldata inputs,
uint256 minOut
) external nonReentrant {
_requireOwnerOrTrader();
uint256 balance = address(this).balance;
if (balance < buyThreshold) revert InsufficientTreasuryBalance(balance, buyThreshold);
uint256 len = eligibleTokens.length;
if (len == 0) revert NoEligibleTokens();
uint256 idx = nextBuyIndex % len;
address winner = eligibleTokens[idx];
// Effects-before-interactions: increment cursor BEFORE the swap.
// Monotonic non-decreasing (modulo applied at READ; never on store) per ARCHITECTURE.md §9.
unchecked { nextBuyIndex = nextBuyIndex + 1; }
uint256 ethToSpend = balance < buyThreshold * PER_BUY_CAP_MULTIPLIER
? balance
: buyThreshold * PER_BUY_CAP_MULTIPLIER;
// The route is operator-built and must target `winner`; if it does not, the
// balance-delta check in SwapRouter sees no `winner` received and reverts.
uint256 out = SWAP_ROUTER.swapExactEthForToken{value: ethToSpend}(
winner,
commands,
inputs,
minOut
);
_tranches[winner].pushTranche(winner, out, ethToSpend);
emit Bought(winner, idx, ethToSpend, out);
}
/// @param commands Universal Router command bytes for the token→ETH route (operator-built).
/// @param inputs Per-command inputs. The route MUST output native ETH to this Treasury.
function executeSell(
address token,
uint256 trancheIndex,
bytes calldata commands,
bytes[] calldata inputs,
uint256 minOutSell,
uint128 minOutBuyback
) external nonReentrant {
_requireOwnerOrTrader();
BasisLedger.Tranche[] storage arr = _tranches[token];
if (trancheIndex >= arr.length) revert TrancheOutOfRange(token, trancheIndex);
BasisLedger.Tranche storage t = arr[trancheIndex];
if (t.sold) revert TrancheAlreadySold();
// No approval here: addEligibleToken granted SwapRouter a never-decreased max allowance.
uint256 ethReceived = SWAP_ROUTER.swapExactTokenForEth(
token,
t.amount,
commands,
inputs,
minOutSell
);
// Realized-gain floor — measured on actual ETH received, not on an oracle estimate.
uint256 realized = ethReceived <= t.ethSpent
? 0
: ((ethReceived - t.ethSpent) * 10_000) / t.ethSpent;
if (realized < sellGainBps) revert RealizedGainBelowFloor(realized, sellGainBps);
t.sold = true;
BUYBACK.buyAndBurn{value: ethReceived}(minOutBuyback);
emit Sold(token, trancheIndex, t.amount, ethReceived, realized);
}
// ── View externals ─────────────────────────────────────────────────────────────────────────
function eligibleTokensLength() external view returns (uint256) {
return eligibleTokens.length;
}
function getEligibleTokens() external view returns (address[] memory) {
return eligibleTokens;
}
function getTranches(address token) external view returns (BasisLedger.Tranche[] memory) {
return _tranches[token];
}
/// @notice Convenience for the dashboard: previews the token that the next `triggerBuy` will
/// target. Reverts if no tokens are eligible.
function previewNextBuyTarget() external view returns (address) {
uint256 len = eligibleTokens.length;
if (len == 0) revert NoEligibleTokens();
return eligibleTokens[nextBuyIndex % len];
}
// >>> TEST-ONLY EMERGENCY SURFACE — DELETE BEFORE MAINNET (CLAUDE.md checklist #1) >>>
// Recovers held ETH (harvest payouts) + arbitrary ERC20 balances (bought tranches) that the
// protocol otherwise never releases — Treasury has no withdraw by design (ARCHITECTURE.md §9).
// Lets a smoke-test deployment's capital be fully recouped. Hands the owner a full rug lever;
// acceptable only for a throwaway test instance. The caller passes the token list off-chain
// (Treasury keeps no enumerable "all tokens held" set); zero-balance entries are skipped. The
// error + event are co-located so the whole surface is one contiguous, greppable delete.
error EthTransferFailed();
event EmergencyWithdrawn(address indexed to, uint256 ethAmount, address[] tokens);
function emergencyWithdraw(address[] calldata tokens, address to) external onlyOwner nonReentrant {
for (uint256 i = 0; i < tokens.length; ) {
uint256 bal = IERC20(tokens[i]).balanceOf(address(this));
if (bal > 0) IERC20(tokens[i]).safeTransfer(to, bal);
unchecked { ++i; }
}
uint256 ethBal = address(this).balance;
if (ethBal > 0) {
(bool ok, ) = to.call{value: ethBal}("");
if (!ok) revert EthTransferFailed();
}
emit EmergencyWithdrawn(to, ethBal, tokens);
}
// <<< END TEST-ONLY <<<
}
lib/openzeppelin-contracts/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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);
}
}
lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)
pragma solidity >=0.6.2;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}
lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)
pragma solidity >=0.4.16;
import {IERC165} from "../utils/introspection/IERC165.sol";
lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)
pragma solidity >=0.4.16;
import {IERC20} from "../token/ERC20/IERC20.sol";
lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)
pragma solidity >=0.4.16;
/**
* @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);
}
lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
if (!_safeTransfer(token, to, value, true)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
if (!_safeTransferFrom(token, from, to, value, true)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _safeTransfer(token, to, value, false);
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _safeTransferFrom(token, from, to, value, false);
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
if (!_safeApprove(token, spender, value, false)) {
if (!_safeApprove(token, spender, 0, true)) revert SafeERC20FailedOperation(address(token));
if (!_safeApprove(token, spender, value, true)) revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Oppositely, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity `token.transfer(to, value)` call, relaxing the requirement on the return value: the
* return value is optional (but if data is returned, it must not be false).
*
* @param token The token targeted by the call.
* @param to The recipient of the tokens
* @param value The amount of token to transfer
* @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
*/
function _safeTransfer(IERC20 token, address to, uint256 value, bool bubble) private returns (bool success) {
bytes4 selector = IERC20.transfer.selector;
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(0x00, selector)
mstore(0x04, and(to, shr(96, not(0))))
mstore(0x24, value)
success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)
// if call success and return is true, all is good.
// otherwise (not success or return is not true), we need to perform further checks
if iszero(and(success, eq(mload(0x00), 1))) {
// if the call was a failure and bubble is enabled, bubble the error
if and(iszero(success), bubble) {
returndatacopy(fmp, 0x00, returndatasize())
revert(fmp, returndatasize())
}
// if the return value is not true, then the call is only successful if:
// - the token address has code
// - the returndata is empty
success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
}
mstore(0x40, fmp)
}
}
/**
* @dev Imitates a Solidity `token.transferFrom(from, to, value)` call, relaxing the requirement on the return
* value: the return value is optional (but if data is returned, it must not be false).
*
* @param token The token targeted by the call.
* @param from The sender of the tokens
* @param to The recipient of the tokens
* @param value The amount of token to transfer
* @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
*/
function _safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value,
bool bubble
) private returns (bool success) {
bytes4 selector = IERC20.transferFrom.selector;
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(0x00, selector)
mstore(0x04, and(from, shr(96, not(0))))
mstore(0x24, and(to, shr(96, not(0))))
mstore(0x44, value)
success := call(gas(), token, 0, 0x00, 0x64, 0x00, 0x20)
// if call success and return is true, all is good.
// otherwise (not success or return is not true), we need to perform further checks
if iszero(and(success, eq(mload(0x00), 1))) {
// if the call was a failure and bubble is enabled, bubble the error
if and(iszero(success), bubble) {
returndatacopy(fmp, 0x00, returndatasize())
revert(fmp, returndatasize())
}
// if the return value is not true, then the call is only successful if:
// - the token address has code
// - the returndata is empty
success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
}
mstore(0x40, fmp)
mstore(0x60, 0)
}
}
/**
* @dev Imitates a Solidity `token.approve(spender, value)` call, relaxing the requirement on the return value:
* the return value is optional (but if data is returned, it must not be false).
*
* @param token The token targeted by the call.
* @param spender The spender of the tokens
* @param value The amount of token to transfer
* @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
*/
function _safeApprove(IERC20 token, address spender, uint256 value, bool bubble) private returns (bool success) {
bytes4 selector = IERC20.approve.selector;
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(0x00, selector)
mstore(0x04, and(spender, shr(96, not(0))))
mstore(0x24, value)
success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)
// if call success and return is true, all is good.
// otherwise (not success or return is not true), we need to perform further checks
if iszero(and(success, eq(mload(0x00), 1))) {
// if the call was a failure and bubble is enabled, bubble the error
if and(iszero(success), bubble) {
returndatacopy(fmp, 0x00, returndatasize())
revert(fmp, returndatasize())
}
// if the return value is not true, then the call is only successful if:
// - the token address has code
// - the returndata is empty
success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
}
mstore(0x40, fmp)
}
}
}
lib/openzeppelin-contracts/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
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;
}
}
lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
import {StorageSlot} from "./StorageSlot.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*
* IMPORTANT: Deprecated. This storage-based reentrancy guard will be removed and replaced
* by the {ReentrancyGuardTransient} variant in v6.0.
*
* @custom:stateless
*/
abstract contract ReentrancyGuard {
using StorageSlot for bytes32;
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant REENTRANCY_GUARD_STORAGE =
0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_reentrancyGuardStorageSlot().getUint256Slot().value = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
/**
* @dev A `view` only version of {nonReentrant}. Use to block view functions
* from being called, preventing reading from inconsistent contract state.
*
* CAUTION: This is a "view" modifier and does not change the reentrancy
* status. Use it only on view functions. For payable or non-payable functions,
* use the standard {nonReentrant} modifier instead.
*/
modifier nonReentrantView() {
_nonReentrantBeforeView();
_;
}
function _nonReentrantBeforeView() private view {
if (_reentrancyGuardEntered()) {
revert ReentrancyGuardReentrantCall();
}
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
_nonReentrantBeforeView();
// Any calls to nonReentrant after this point will fail
_reentrancyGuardStorageSlot().getUint256Slot().value = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_reentrancyGuardStorageSlot().getUint256Slot().value = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _reentrancyGuardStorageSlot().getUint256Slot().value == ENTERED;
}
function _reentrancyGuardStorageSlot() internal pure virtual returns (bytes32) {
return REENTRANCY_GUARD_STORAGE;
}
}
lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC-1967 implementation slot:
* ```solidity
* contract ERC1967 {
* // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* TIP: Consider using this library along with {SlotDerivation}.
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct Int256Slot {
int256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Int256Slot` with member `value` located at `slot`.
*/
function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
/**
* @dev Returns a `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
}
lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
src/BasisLedger.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.35;
/// @title BasisLedger
/// @notice Per-token tranche bookkeeping used by `Treasury`. Append-only; `sold` flips on
/// a successful `executeSell`, the entry is never removed. Price-source-agnostic —
/// `gainBps` takes an ETH-per-token quote from the caller.
library BasisLedger {
struct Tranche {
address token;
uint128 amount; // token units held in this tranche
uint128 ethSpent; // ETH spent acquiring this tranche
uint40 boughtAt; // block.timestamp at acquisition
bool sold; // true once executeSell consumed this tranche
}
/// @notice Append a new tranche to a per-token array. Amount + ethSpent must fit in 128 bits.
function pushTranche(
Tranche[] storage tranches,
address token,
uint256 amount,
uint256 ethSpent
) internal returns (uint256 index) {
if (amount > type(uint128).max) revert AmountOverflow();
if (ethSpent > type(uint128).max) revert EthSpentOverflow();
index = tranches.length;
tranches.push(Tranche({
token: token,
amount: uint128(amount),
ethSpent: uint128(ethSpent),
boughtAt: uint40(block.timestamp),
sold: false
}));
}
function markSold(Tranche storage t) internal {
t.sold = true;
}
/// @notice Realised-gain measurement against a supplied ETH-per-token quote (1e18-scaled).
/// Used by view paths only; `Treasury.executeSell` computes the trustless variant
/// (realized gain on actual ETH received) inline against `ethSpent`.
/// @return basis-points gain, or 0 if the tranche would be at or below cost.
function gainBps(Tranche memory t, uint256 ethPerToken1e18) internal pure returns (uint256) {
// ethValue = amount * ethPerToken1e18 / 1e18
// We multiply uint128 * uint256 — the intermediate cannot overflow because
// amount <= 2^128 - 1 and ethPerToken1e18 < 2^128 in any realistic scenario
// (1e18 wei per token = ~$3000/token at $3000/ETH); 2^128 ~= 3.4e38 which is
// ~3.4e20 ETH per token, well above any sane value.
uint256 ethValue = (uint256(t.amount) * ethPerToken1e18) / 1e18;
if (ethValue <= t.ethSpent) return 0;
unchecked {
// ethValue > t.ethSpent (checked above), so the subtraction can't underflow.
return ((ethValue - t.ethSpent) * 10_000) / t.ethSpent;
}
}
error AmountOverflow();
error EthSpentOverflow();
}
src/interfaces/ISwapRouter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.35;
/// @notice Thin forwarder around Uniswap's Universal Router. The off-chain router
/// (backend `services/routing`) computes the full `(commands, inputs)` —
/// spanning V2/V3/V4 and any stablecoin/WETH intermediaries — and the
/// contract enforces `minOut` via a balance-delta check on the caller.
interface ISwapRouter {
function swapExactEthForToken(
address tokenOut,
bytes calldata commands,
bytes[] calldata inputs,
uint256 minOut
) external payable returns (uint256 out);
function swapExactTokenForEth(
address tokenIn,
uint256 amountIn,
bytes calldata commands,
bytes[] calldata inputs,
uint256 minOut
) external returns (uint256 ethOut);
}
src/interfaces/ITFLOBuyback.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.35;
interface ITFLOBuyback {
function buyAndBurn(uint128 minOut) external payable;
}
Compiler settingsShow
{
"viaIR": true,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "cancun",
"remappings": [
"forge-std/=lib/forge-std/src/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@uniswap/v4-core/=lib/v4-core/",
"v4-core/=lib/v4-core/src/",
"v4-periphery/=lib/v4-periphery/src/",
"permit2/=lib/permit2/",
"universal-router/=lib/universal-router/contracts/",
"@ensdomains/=lib/v4-core/node_modules/@ensdomains/",
"@uniswap/v2-core/=lib/universal-router/node_modules/@uniswap/v2-core/",
"@uniswap/v3-core/=lib/universal-router/node_modules/@uniswap/v3-core/",
"@uniswap/v3-periphery/=lib/universal-router/lib/v3-periphery/",
"@uniswap/v4-periphery/=lib/universal-router/lib/v4-periphery/",
"ds-test/=lib/universal-router/lib/solmate/lib/ds-test/src/",
"erc4626-tests/=lib/v4-core/lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-gas-snapshot/=lib/permit2/lib/forge-gas-snapshot/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"hardhat/=lib/v4-core/node_modules/hardhat/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"solmate/=lib/universal-router/lib/solmate/",
"v3-periphery/=lib/universal-router/lib/v3-periphery/contracts/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.