// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)
pragma solidity ^0.8.20;
import {IAccessControlEnumerable} from "@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol";
import {AccessControlUpgradeable} from "../AccessControlUpgradeable.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";
/**
* @dev Extension of {AccessControl} that allows enumerating the members of each role.
*/
abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerable, AccessControlUpgradeable {
using EnumerableSet for EnumerableSet.AddressSet;
/// @custom:storage-location erc7201:openzeppelin.storage.AccessControlEnumerable
struct AccessControlEnumerableStorage {
mapping(bytes32 role => EnumerableSet.AddressSet) _roleMembers;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessControlEnumerable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant AccessControlEnumerableStorageLocation = 0xc1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000;
function _getAccessControlEnumerableStorage() private pure returns (AccessControlEnumerableStorage storage $) {
assembly {
$.slot := AccessControlEnumerableStorageLocation
}
}
function __AccessControlEnumerable_init() internal onlyInitializing {
}
function __AccessControlEnumerable_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {
AccessControlEnumerableStorage storage $ = _getAccessControlEnumerableStorage();
return $._roleMembers[role].at(index);
}
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {
AccessControlEnumerableStorage storage $ = _getAccessControlEnumerableStorage();
return $._roleMembers[role].length();
}
/**
* @dev Overload {AccessControl-_grantRole} to track enumerable memberships
*/
function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {
AccessControlEnumerableStorage storage $ = _getAccessControlEnumerableStorage();
bool granted = super._grantRole(role, account);
if (granted) {
$._roleMembers[role].add(account);
}
return granted;
}
/**
* @dev Overload {AccessControl-_revokeRole} to track enumerable memberships
*/
function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {
AccessControlEnumerableStorage storage $ = _getAccessControlEnumerableStorage();
bool revoked = super._revokeRole(role, account);
if (revoked) {
$._roleMembers[role].remove(account);
}
return revoked;
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)
pragma solidity ^0.8.20;
import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {ERC165Upgradeable} from "../utils/introspection/ERC165Upgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControl, ERC165Upgradeable {
struct RoleData {
mapping(address account => bool) hasRole;
bytes32 adminRole;
}
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/// @custom:storage-location erc7201:openzeppelin.storage.AccessControl
struct AccessControlStorage {
mapping(bytes32 role => RoleData) _roles;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessControl")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant AccessControlStorageLocation = 0x02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800;
function _getAccessControlStorage() private pure returns (AccessControlStorage storage $) {
assembly {
$.slot := AccessControlStorageLocation
}
}
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with an {AccessControlUnauthorizedAccount} error including the required role.
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
function __AccessControl_init() internal onlyInitializing {
}
function __AccessControl_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual returns (bool) {
AccessControlStorage storage $ = _getAccessControlStorage();
return $._roles[role].hasRole[account];
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
* is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
* is missing `role`.
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert AccessControlUnauthorizedAccount(account, role);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
AccessControlStorage storage $ = _getAccessControlStorage();
return $._roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address callerConfirmation) public virtual {
if (callerConfirmation != _msgSender()) {
revert AccessControlBadConfirmation();
}
_revokeRole(role, callerConfirmation);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
AccessControlStorage storage $ = _getAccessControlStorage();
bytes32 previousAdminRole = getRoleAdmin(role);
$._roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
AccessControlStorage storage $ = _getAccessControlStorage();
if (!hasRole(role, account)) {
$._roles[role].hasRole[account] = true;
emit RoleGranted(role, account, _msgSender());
return true;
} else {
return false;
}
}
/**
* @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
AccessControlStorage storage $ = _getAccessControlStorage();
if (hasRole(role, account)) {
$._roles[role].hasRole[account] = false;
emit RoleRevoked(role, account, _msgSender());
return true;
} else {
return false;
}
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import {FixedPointMathLib} from "@solmate/utils/FixedPointMathLib.sol";
import {IRateProvider} from "src/interfaces/IRateProvider.sol";
import {ERC20} from "@solmate/tokens/ERC20.sol";
import {SafeTransferLib} from "@solmate/utils/SafeTransferLib.sol";
import {BoringVault} from "src/base/BoringVault.sol";
import {Auth, Authority} from "@solmate/auth/Auth.sol";
import {IPausable} from "src/interfaces/IPausable.sol";
import {L1cmETH} from "src/L1cmETH.sol";
import {console} from "@forge-std/Test.sol";
contract AccountantWithRateProviders is Auth, IRateProvider, IPausable {
using FixedPointMathLib for uint256;
using SafeTransferLib for ERC20;
// ========================================= STRUCTS =========================================
/**
* @param payoutAddress the address `claimFees` sends fees to
* @param highwaterMark the highest value of the BoringVault's share price
* @param feesOwedInBase total pending fees owed in terms of base
* @param totalSharesLastUpdate total amount of shares the last exchange rate update
* @param exchangeRate the current exchange rate in terms of base
* @param allowedExchangeRateChangeUpper the max allowed change to exchange rate from an update
* @param allowedExchangeRateChangeLower the min allowed change to exchange rate from an update
* @param lastUpdateTimestamp the block timestamp of the last exchange rate update
* @param isPaused whether or not this contract is paused
* @param minimumUpdateDelayInSeconds the minimum amount of time that must pass between
* exchange rate updates, such that the update won't trigger the contract to be paused
* @param managementFee the management fee
* @param performanceFee the performance fee
*/
struct AccountantState {
address payoutAddress;
uint96 highwaterMark;
uint128 feesOwedInBase;
uint128 totalSharesLastUpdate;
uint96 exchangeRate;
uint16 allowedExchangeRateChangeUpper;
uint16 allowedExchangeRateChangeLower;
uint64 lastUpdateTimestamp;
bool isPaused;
uint24 minimumUpdateDelayInSeconds;
uint16 managementFee;
uint16 performanceFee;
}
/**
* @param isPeggedToBase whether or not the asset is 1:1 with the base asset
* @param rateProvider the rate provider for this asset if `isPeggedToBase` is false
*/
struct RateProviderData {
bool isPeggedToBase;
IRateProvider rateProvider;
}
// ========================================= STATE =========================================
/**
* @notice Store the accountant state in 3 packed slots.
*/
AccountantState public accountantState;
/**
* @notice Maps ERC20s to their RateProviderData.
*/
mapping(ERC20 => RateProviderData) public rateProviderData;
//============================== ERRORS ===============================
error AccountantWithRateProviders__UpperBoundTooSmall();
error AccountantWithRateProviders__LowerBoundTooLarge();
error AccountantWithRateProviders__ManagementFeeTooLarge();
error AccountantWithRateProviders__PerformanceFeeTooLarge();
error AccountantWithRateProviders__Paused();
error AccountantWithRateProviders__ZeroFeesOwed();
error AccountantWithRateProviders__OnlyCallableByBoringVault();
error AccountantWithRateProviders__UpdateDelayTooLarge();
error AccountantWithRateProviders__ExchangeRateAboveHighwaterMark();
//============================== EVENTS ===============================
event Paused();
event Unpaused();
event DelayInSecondsUpdated(uint24 oldDelay, uint24 newDelay);
event UpperBoundUpdated(uint16 oldBound, uint16 newBound);
event LowerBoundUpdated(uint16 oldBound, uint16 newBound);
event ManagementFeeUpdated(uint16 oldFee, uint16 newFee);
event PerformanceFeeUpdated(uint16 oldFee, uint16 newFee);
event PayoutAddressUpdated(address oldPayout, address newPayout);
event RateProviderUpdated(address asset, bool isPegged, address rateProvider);
event ExchangeRateUpdated(uint96 oldRate, uint96 newRate, uint64 currentTime);
event FeesClaimed(address indexed feeAsset, uint256 amount);
event HighwaterMarkReset();
//============================== IMMUTABLES ===============================
/**
* @notice The base asset rates are provided in.
*/
ERC20 public immutable base;
/**
* @notice The decimals rates are provided in.
*/
uint8 public immutable decimals;
/**
* @notice The BoringVault this accountant is working with.
* Used to determine share supply for fee calculation.
*/
BoringVault public immutable vault;
/**
* @notice The cmETH this accountant is working with.
*/
L1cmETH public immutable cmETH;
/**
* @notice One share of the BoringVault.
*/
uint256 internal immutable ONE_SHARE;
constructor(
address _owner,
address _vault,
address payoutAddress,
uint96 startingExchangeRate,
address _base,
uint16 allowedExchangeRateChangeUpper,
uint16 allowedExchangeRateChangeLower,
uint24 minimumUpdateDelayInSeconds,
uint16 managementFee,
uint16 performanceFee
) Auth(_owner, Authority(address(0))) {
base = ERC20(_base);
vault = BoringVault(payable(_vault));
cmETH = L1cmETH(address(vault.cmETH()));
decimals = cmETH.decimals();
ONE_SHARE = 10 ** cmETH.decimals();
accountantState = AccountantState({
payoutAddress: payoutAddress,
highwaterMark: startingExchangeRate,
feesOwedInBase: 0,
totalSharesLastUpdate: uint128(cmETH.totalSupply()),
exchangeRate: startingExchangeRate,
allowedExchangeRateChangeUpper: allowedExchangeRateChangeUpper,
allowedExchangeRateChangeLower: allowedExchangeRateChangeLower,
lastUpdateTimestamp: uint64(block.timestamp),
isPaused: false,
minimumUpdateDelayInSeconds: minimumUpdateDelayInSeconds,
managementFee: managementFee,
performanceFee: performanceFee
});
}
// ========================================= ADMIN FUNCTIONS =========================================
/**
* @notice Pause this contract, which prevents future calls to `updateExchangeRate`, and any safe rate
* calls will revert.
* @dev Callable by MULTISIG_ROLE.
*/
function pause() external requiresAuth {
accountantState.isPaused = true;
emit Paused();
}
/**
* @notice Unpause this contract, which allows future calls to `updateExchangeRate`, and any safe rate
* calls will stop reverting.
* @dev Callable by MULTISIG_ROLE.
*/
function unpause() external requiresAuth {
accountantState.isPaused = false;
emit Unpaused();
}
/**
* @notice Update the minimum time delay between `updateExchangeRate` calls.
* @dev There are no input requirements, as it is possible the admin would want
* the exchange rate updated as frequently as needed.
* @dev Callable by OWNER_ROLE.
*/
function updateDelay(uint24 minimumUpdateDelayInSeconds) external requiresAuth {
if (minimumUpdateDelayInSeconds > 14 days) {
revert AccountantWithRateProviders__UpdateDelayTooLarge();
}
uint24 oldDelay = accountantState.minimumUpdateDelayInSeconds;
accountantState.minimumUpdateDelayInSeconds = minimumUpdateDelayInSeconds;
emit DelayInSecondsUpdated(oldDelay, minimumUpdateDelayInSeconds);
}
/**
* @notice Update the allowed upper bound change of exchange rate between `updateExchangeRateCalls`.
* @dev Callable by OWNER_ROLE.
*/
function updateUpper(uint16 allowedExchangeRateChangeUpper) external requiresAuth {
if (allowedExchangeRateChangeUpper < 1e4) {
revert AccountantWithRateProviders__UpperBoundTooSmall();
}
uint16 oldBound = accountantState.allowedExchangeRateChangeUpper;
accountantState.allowedExchangeRateChangeUpper = allowedExchangeRateChangeUpper;
emit UpperBoundUpdated(oldBound, allowedExchangeRateChangeUpper);
}
/**
* @notice Update the allowed lower bound change of exchange rate between `updateExchangeRateCalls`.
* @dev Callable by OWNER_ROLE.
*/
function updateLower(uint16 allowedExchangeRateChangeLower) external requiresAuth {
if (allowedExchangeRateChangeLower > 1e4) {
revert AccountantWithRateProviders__LowerBoundTooLarge();
}
uint16 oldBound = accountantState.allowedExchangeRateChangeLower;
accountantState.allowedExchangeRateChangeLower = allowedExchangeRateChangeLower;
emit LowerBoundUpdated(oldBound, allowedExchangeRateChangeLower);
}
/**
* @notice Update the management fee to a new value.
* @dev Callable by OWNER_ROLE.
*/
function updateManagementFee(uint16 managementFee) external requiresAuth {
if (managementFee > 0.2e4) {
revert AccountantWithRateProviders__ManagementFeeTooLarge();
}
uint16 oldFee = accountantState.managementFee;
accountantState.managementFee = managementFee;
emit ManagementFeeUpdated(oldFee, managementFee);
}
/**
* @notice Update the performance fee to a new value.
* @dev Callable by OWNER_ROLE.
*/
function updatePerformanceFee(uint16 performanceFee) external requiresAuth {
if (performanceFee > 0.5e4) {
revert AccountantWithRateProviders__PerformanceFeeTooLarge();
}
uint16 oldFee = accountantState.performanceFee;
accountantState.performanceFee = performanceFee;
emit PerformanceFeeUpdated(oldFee, performanceFee);
}
/**
* @notice Update the payout address fees are sent to.
* @dev Callable by OWNER_ROLE.
*/
function updatePayoutAddress(address payoutAddress) external requiresAuth {
address oldPayout = accountantState.payoutAddress;
accountantState.payoutAddress = payoutAddress;
emit PayoutAddressUpdated(oldPayout, payoutAddress);
}
/**
* @notice Update the rate provider data for a specific `asset`.
* @dev Rate providers must return rates in terms of `base` or
* an asset pegged to base and they must use the same decimals
* as `asset`.
* @dev Callable by OWNER_ROLE.
*/
function setRateProviderData(ERC20 asset, bool isPeggedToBase, address rateProvider) external requiresAuth {
rateProviderData[asset] =
RateProviderData({isPeggedToBase: isPeggedToBase, rateProvider: IRateProvider(rateProvider)});
emit RateProviderUpdated(address(asset), isPeggedToBase, rateProvider);
}
/**
* @notice Reset the highwater mark to the current exchange rate.
* @dev Callable by OWNER_ROLE.
*/
function resetHighwaterMark() external requiresAuth {
AccountantState storage state = accountantState;
if (state.exchangeRate > state.highwaterMark) {
revert AccountantWithRateProviders__ExchangeRateAboveHighwaterMark();
}
uint64 currentTime = uint64(block.timestamp);
uint256 currentTotalShares = cmETH.totalSupply();
_calculateFeesOwed(state, state.exchangeRate, state.exchangeRate, currentTotalShares, currentTime);
state.totalSharesLastUpdate = uint128(currentTotalShares);
state.highwaterMark = accountantState.exchangeRate;
state.lastUpdateTimestamp = currentTime;
emit HighwaterMarkReset();
}
// ========================================= UPDATE EXCHANGE RATE/FEES FUNCTIONS =========================================
/**
* @notice Updates this contract exchangeRate.
* @dev If new exchange rate is outside of accepted bounds, or if not enough time has passed, this
* will pause the contract, and this function will NOT calculate fees owed.
* @dev Callable by UPDATE_EXCHANGE_RATE_ROLE.
*/
function updateExchangeRate(uint96 newExchangeRate) external requiresAuth {
AccountantState storage state = accountantState;
if (state.isPaused) revert AccountantWithRateProviders__Paused();
uint64 currentTime = uint64(block.timestamp);
uint256 currentExchangeRate = state.exchangeRate;
uint256 currentTotalShares = cmETH.totalSupply();
if (
currentTime < state.lastUpdateTimestamp + state.minimumUpdateDelayInSeconds
|| newExchangeRate > currentExchangeRate.mulDivDown(state.allowedExchangeRateChangeUpper, 1e4)
|| newExchangeRate < currentExchangeRate.mulDivDown(state.allowedExchangeRateChangeLower, 1e4)
) {
// Instead of reverting, pause the contract. This way the exchange rate updater is able to update the exchange rate
// to a better value, and pause it.
state.isPaused = true;
} else {
_calculateFeesOwed(state, newExchangeRate, currentExchangeRate, currentTotalShares, currentTime);
}
state.exchangeRate = newExchangeRate;
state.totalSharesLastUpdate = uint128(currentTotalShares);
state.lastUpdateTimestamp = currentTime;
emit ExchangeRateUpdated(uint96(currentExchangeRate), newExchangeRate, currentTime);
}
/**
* @notice Claim pending fees.
* @dev This function must be called by the BoringVault.
* @dev This function will lose precision if the exchange rate
* decimals is greater than the feeAsset's decimals.
*/
function claimFees(ERC20 feeAsset) external {
if (msg.sender != address(vault)) {
revert AccountantWithRateProviders__OnlyCallableByBoringVault();
}
AccountantState storage state = accountantState;
if (state.isPaused) revert AccountantWithRateProviders__Paused();
if (state.feesOwedInBase == 0) {
revert AccountantWithRateProviders__ZeroFeesOwed();
}
// Determine amount of fees owed in feeAsset.
uint256 feesOwedInFeeAsset;
RateProviderData memory data = rateProviderData[feeAsset];
if (address(feeAsset) == address(base)) {
feesOwedInFeeAsset = state.feesOwedInBase;
} else {
uint8 feeAssetDecimals = ERC20(feeAsset).decimals();
uint256 feesOwedInBaseUsingFeeAssetDecimals =
changeDecimals(state.feesOwedInBase, decimals, feeAssetDecimals);
if (data.isPeggedToBase) {
feesOwedInFeeAsset = feesOwedInBaseUsingFeeAssetDecimals;
} else {
uint256 rate = data.rateProvider.getRate();
feesOwedInFeeAsset = feesOwedInBaseUsingFeeAssetDecimals.mulDivDown(10 ** feeAssetDecimals, rate);
}
}
// Zero out fees owed.
state.feesOwedInBase = 0;
// Transfer fee asset to payout address.
feeAsset.safeTransferFrom(msg.sender, state.payoutAddress, feesOwedInFeeAsset);
emit FeesClaimed(address(feeAsset), feesOwedInFeeAsset);
}
// ========================================= RATE FUNCTIONS =========================================
/**
* @notice Get this BoringVault's current rate in the base.
*/
function getRate() public view returns (uint256 rate) {
rate = accountantState.exchangeRate;
}
/**
* @notice Get this BoringVault's current rate in the base.
* @dev Revert if paused.
*/
function getRateSafe() external view returns (uint256 rate) {
if (accountantState.isPaused) {
revert AccountantWithRateProviders__Paused();
}
rate = getRate();
}
/**
* @notice Get this BoringVault's current rate in the provided quote.
* @dev `quote` must have its RateProviderData set, else this will revert.
* @dev This function will lose precision if the exchange rate
* decimals is greater than the quote's decimals.
*/
function getRateInQuote(ERC20 quote) public view returns (uint256 rateInQuote) {
if (address(quote) == address(base)) {
rateInQuote = accountantState.exchangeRate;
} else {
RateProviderData memory data = rateProviderData[quote];
uint8 quoteDecimals = ERC20(quote).decimals();
uint256 exchangeRateInQuoteDecimals = changeDecimals(accountantState.exchangeRate, decimals, quoteDecimals);
if (data.isPeggedToBase) {
rateInQuote = exchangeRateInQuoteDecimals;
} else {
uint256 quoteRate = data.rateProvider.getRate();
uint256 oneQuote = 10 ** quoteDecimals;
rateInQuote = oneQuote.mulDivDown(exchangeRateInQuoteDecimals, quoteRate);
}
}
}
/**
* @notice Get this BoringVault's current rate in the provided quote.
* @dev `quote` must have its RateProviderData set, else this will revert.
* @dev Revert if paused.
*/
function getRateInQuoteSafe(ERC20 quote) external view returns (uint256 rateInQuote) {
if (accountantState.isPaused) {
revert AccountantWithRateProviders__Paused();
}
rateInQuote = getRateInQuote(quote);
}
// ========================================= INTERNAL HELPER FUNCTIONS =========================================
/**
* @notice Used to change the decimals of precision used for an amount.
*/
function changeDecimals(uint256 amount, uint8 fromDecimals, uint8 toDecimals) internal pure returns (uint256) {
if (fromDecimals == toDecimals) {
return amount;
} else if (fromDecimals < toDecimals) {
return amount * 10 ** (toDecimals - fromDecimals);
} else {
return amount / 10 ** (fromDecimals - toDecimals);
}
}
/**
* @notice Calculate fees owed in base.
* @dev This function will update the highwater mark if the new exchange rate is higher.
*/
function _calculateFeesOwed(
AccountantState storage state,
uint96 newExchangeRate,
uint256 currentExchangeRate,
uint256 currentTotalShares,
uint64 currentTime
) internal {
// Only update fees if we are not paused.
// Update fee accounting.
uint256 shareSupplyToUse = currentTotalShares;
// Use the minimum between current total supply and total supply for last update.
if (state.totalSharesLastUpdate < shareSupplyToUse) {
shareSupplyToUse = state.totalSharesLastUpdate;
}
// Determine management fees owned.
uint256 timeDelta = currentTime - state.lastUpdateTimestamp;
uint256 minimumAssets = newExchangeRate > currentExchangeRate
? shareSupplyToUse.mulDivDown(currentExchangeRate, ONE_SHARE)
: shareSupplyToUse.mulDivDown(newExchangeRate, ONE_SHARE);
uint256 managementFeesAnnual = minimumAssets.mulDivDown(state.managementFee, 1e4);
uint256 newFeesOwedInBase = managementFeesAnnual.mulDivDown(timeDelta, 365 days);
console.log("minimum assets: ", minimumAssets);
// Account for performance fees.
if (newExchangeRate > state.highwaterMark) {
if (state.performanceFee > 0) {
uint256 changeInExchangeRate = newExchangeRate - state.highwaterMark;
uint256 yieldEarned = changeInExchangeRate.mulDivDown(shareSupplyToUse, ONE_SHARE);
uint256 performanceFeesOwedInBase = yieldEarned.mulDivDown(state.performanceFee, 1e4);
newFeesOwedInBase += performanceFeesOwedInBase;
}
// Always update the highwater mark if the new exchange rate is higher.
// This way if we are not iniitiall taking performance fees, we can start taking them
// without back charging them on past performance.
state.highwaterMark = newExchangeRate;
}
state.feesOwedInBase += uint128(newFeesOwedInBase);
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Provides a flexible and updatable auth pattern which is completely separate from application logic.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Auth.sol)
/// @author Modified from Dappsys (https://github.com/dapphub/ds-auth/blob/master/src/auth.sol)
abstract contract Auth {
event OwnershipTransferred(address indexed user, address indexed newOwner);
event AuthorityUpdated(address indexed user, Authority indexed newAuthority);
address public owner;
Authority public authority;
constructor(address _owner, Authority _authority) {
owner = _owner;
authority = _authority;
emit OwnershipTransferred(msg.sender, _owner);
emit AuthorityUpdated(msg.sender, _authority);
}
modifier requiresAuth() virtual {
require(isAuthorized(msg.sender, msg.sig), "UNAUTHORIZED");
_;
}
function isAuthorized(address user, bytes4 functionSig) internal view virtual returns (bool) {
Authority auth = authority; // Memoizing authority saves us a warm SLOAD, around 100 gas.
// Checking if the caller is the owner only after calling the authority saves gas in most cases, but be
// aware that this makes protected functions uncallable even to the owner if the authority is out of order.
return (address(auth) != address(0) && auth.canCall(user, address(this), functionSig)) || user == owner;
}
function setAuthority(Authority newAuthority) public virtual {
// We check if the caller is the owner first because we want to ensure they can
// always swap out the authority even if it's reverting or using up a lot of gas.
require(msg.sender == owner || authority.canCall(msg.sender, address(this), msg.sig));
authority = newAuthority;
emit AuthorityUpdated(msg.sender, newAuthority);
}
function transferOwnership(address newOwner) public virtual requiresAuth {
owner = newOwner;
emit OwnershipTransferred(msg.sender, newOwner);
}
}
/// @notice A generic interface for a contract which provides authorization data to an Auth instance.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Auth.sol)
/// @author Modified from Dappsys (https://github.com/dapphub/ds-auth/blob/master/src/auth.sol)
interface Authority {
function canCall(
address user,
address target,
bytes4 functionSig
) external view returns (bool);
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;
import {StdStorage} from "./StdStorage.sol";
import {Vm, VmSafe} from "./Vm.sol";
abstract contract CommonBase {
// Cheat code address, 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D.
address internal constant VM_ADDRESS = address(uint160(uint256(keccak256("hevm cheat code"))));
// console.sol and console2.sol work by executing a staticcall to this address.
address internal constant CONSOLE = 0x000000000000000000636F6e736F6c652e6c6f67;
// Used when deploying with create2, https://github.com/Arachnid/deterministic-deployment-proxy.
address internal constant CREATE2_FACTORY = 0x4e59b44847b379578588920cA78FbF26c0B4956C;
// Default address for tx.origin and msg.sender, 0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38.
address internal constant DEFAULT_SENDER = address(uint160(uint256(keccak256("foundry default caller"))));
// Address of the test contract, deployed by the DEFAULT_SENDER.
address internal constant DEFAULT_TEST_CONTRACT = 0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f;
// Deterministic deployment address of the Multicall3 contract.
address internal constant MULTICALL3_ADDRESS = 0xcA11bde05977b3631167028862bE2a173976CA11;
// The order of the secp256k1 curve.
uint256 internal constant SECP256K1_ORDER =
115792089237316195423570985008687907852837564279074904382605163141518161494337;
uint256 internal constant UINT256_MAX =
115792089237316195423570985008687907853269984665640564039457584007913129639935;
Vm internal constant vm = Vm(VM_ADDRESS);
StdStorage internal stdstore;
}
abstract contract TestBase is CommonBase {}
abstract contract ScriptBase is CommonBase {
VmSafe internal constant vmSafe = VmSafe(VM_ADDRESS);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
interface BeforeTransferHook {
function beforeTransfer(address from, address to, address operator) external view;
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import {SafeTransferLib} from "@solmate/utils/SafeTransferLib.sol";
import {ERC20} from "@solmate/tokens/ERC20.sol";
import {Auth, Authority} from "@solmate/auth/Auth.sol";
import {IL1cmETH} from "src/interfaces/IL1cmETH.sol";
contract BoringVault is Auth, ERC721Holder, ERC1155Holder {
using Address for address;
using SafeTransferLib for ERC20;
//============================== STATE ===============================
/**
* @notice The cmETH token to mint/burn on user entry/exit.
* @dev cmETH is an upgradeable contract, so an immutable type is used, additionally
* if cmETH stops following the `IL1cmETH` interface, this contract
* will start reverting on user entry/exit.
*/
IL1cmETH public cmETH;
//============================== EVENTS ===============================
event Enter(address indexed from, address indexed asset, uint256 amount, address indexed to, uint256 shares);
event Exit(address indexed to, address indexed asset, uint256 amount, address indexed from, uint256 shares);
//============================== CONSTRUCTOR ===============================
constructor(address _owner, address _cmETH) Auth(_owner, Authority(address(0))) {
cmETH = IL1cmETH(_cmETH);
}
//============================== MANAGE ===============================
/**
* @notice Allows manager to make an arbitrary function call from this contract.
* @dev Callable by MANAGER_ROLE.
*/
function manage(address target, bytes calldata data, uint256 value)
external
requiresAuth
returns (bytes memory result)
{
result = target.functionCallWithValue(data, value);
}
/**
* @notice Allows manager to make arbitrary function calls from this contract.
* @dev Callable by MANAGER_ROLE.
*/
function manage(address[] calldata targets, bytes[] calldata data, uint256[] calldata values)
external
requiresAuth
returns (bytes[] memory results)
{
uint256 targetsLength = targets.length;
results = new bytes[](targetsLength);
for (uint256 i; i < targetsLength; ++i) {
results[i] = targets[i].functionCallWithValue(data[i], values[i]);
}
}
//============================== ENTER ===============================
/**
* @notice Allows minter to mint shares, in exchange for assets.
* @dev If assetAmount is zero, no assets are transferred in.
* @dev Callable by MINTER_ROLE.
*/
function enter(address from, ERC20 asset, uint256 assetAmount, address to, uint256 shareAmount)
external
requiresAuth
{
// Transfer assets in
if (assetAmount > 0) {
asset.safeTransferFrom(from, address(this), assetAmount);
}
// Mint shares.
cmETH.mint(to, shareAmount);
emit Enter(from, address(asset), assetAmount, to, shareAmount);
}
//============================== EXIT ===============================
/**
* @notice Allows burner to burn shares, in exchange for assets.
* @dev If assetAmount is zero, no assets are transferred out.
* @dev Callable by BURNER_ROLE.
*/
function exit(address to, ERC20 asset, uint256 assetAmount, address from, uint256 shareAmount)
external
requiresAuth
{
// Burn shares.
cmETH.burn(from, shareAmount);
// Transfer assets out.
if (assetAmount > 0) asset.safeTransfer(to, assetAmount);
emit Exit(to, address(asset), assetAmount, from, shareAmount);
}
//============================== RECEIVE ===============================
receive() external payable {}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import {AccessControlEnumerableUpgradeable} from "openzeppelin-upgradeable/access/extensions/AccessControlEnumerableUpgradeable.sol";
import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol";
import {IBlockListClient} from "./interfaces/ITransferBlockList.sol";
/**
* @title BlocklistClient
* @notice This abstract contract manages state for upgradeable blocklist
* clients
*/
abstract contract BlockListClientUpgradeable is Initializable, IBlockListClient, AccessControlEnumerableUpgradeable {
// errors
error BlocklistZeroAddress();
error BlockedAccount();
/// @custom:storage-location erc7201:storage.BlockList
struct BlocklistStorage {
address blocklist;
}
// keccak256(abi.encode(uint256(keccak256("storage.BlockList")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant BlocklistStorageLocation = 0x8b10dc3a8ffcc75bc517f513160e5993f2893462bfc79b47d34bca818016ba00;
function _getBlocklistStorage() internal pure returns (BlocklistStorage storage $) {
assembly {
$.slot := BlocklistStorageLocation
}
}
/**
* @notice Initialize the contract by setting blocklist variable
*
* @param _blocklist Address of the blocklist contract
*
* @dev Function should be called by the inheriting contract on
* initialization
*/
function __BlocklistClientInitializable_init(address _blocklist) internal onlyInitializing {
__AccessControlEnumerable_init();
__BlocklistClientInitializable_init_unchained(_blocklist);
}
/**
* @dev Internal function to future-proof parent linearization. Matches OZ
* upgradeable suggestions
*/
function __BlocklistClientInitializable_init_unchained(address _blocklist) internal onlyInitializing {
_setBlocklist(_blocklist);
}
/**
* @notice Get the blocklist address for this client
*/
function blocklist() public view virtual returns (address) {
BlocklistStorage storage $ = _getBlocklistStorage();
return $.blocklist;
}
/**
* @notice Sets the blocklist address for this client
*
* @param _blocklist The new blocklist address
*/
function setBlocklist(address _blocklist) external virtual {
_setBlocklist(_blocklist);
}
/**
* @notice Checks whether an address has been blocked
*
* @param account The account to check
*/
function isBlocked(address account) external view virtual returns (bool) {
return _isBlocked(account);
}
/**
* @notice Sets the blocklist address for this client
*
* @param _blocklist The new blocklist address
*/
function _setBlocklist(address _blocklist) internal {
if (_blocklist == address(0)) {
revert BlocklistZeroAddress();
}
BlocklistStorage storage $ = _getBlocklistStorage();
address oldBlocklist = address($.blocklist);
$.blocklist = _blocklist;
emit BlocklistSet(oldBlocklist, _blocklist);
}
/**
* @notice Checks whether an address has been blocked
*
* @param account The account to check
*/
function _isBlocked(address account) internal view returns (bool) {
BlocklistStorage storage $ = _getBlocklistStorage();
if ($.blocklist.code.length != 0) {
return IBlockListClient($.blocklist).isBlocked(account);
}
return false;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol";
import {ISanctionsListClient} from "./interfaces/ITransferSanctionList.sol";
/**
* @title SanctionsListClient
* @notice This abstract contract manages state for upgradeable sanctionsList
* clients
*/
abstract contract SanctionsListClientUpgradeable is Initializable, ISanctionsListClient {
// errors
/// @notice Error for when caller attempts to set the `sanctionsList` reference to the zero address
error SanctionsListZeroAddress();
/// @notice Error for when caller attempts to perform an action on a sanctioned account
error SanctionedAccount();
/// @custom:storage-location erc7201:storage.BareVault
struct SanctionsListStorage {
address sanctionsList;
}
// keccak256(abi.encode(uint256(keccak256("storage.SanctionsList")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant SanctionsListStorageLocation = 0x446d7f77ff282b2aa61ea27272a164f51bf50ee624d04aed3bd04af3b9af8f00;
function _getSanctionsListStorage() internal pure returns (SanctionsListStorage storage $) {
assembly {
$.slot := SanctionsListStorageLocation
}
}
/**
* @notice Initialize the contract by setting SanctionsList variable
*
* @param _sanctionsList Address of the sanctionsList contract
*
* @dev Function should be called by the inheriting contract on
* initialization
*/
function __SanctionsListClientInitializable_init(address _sanctionsList) internal onlyInitializing {
__SanctionsListClientInitializable_init_unchained(_sanctionsList);
}
/**
* @dev Internal function to future-proof parent linearization. Matches OZ
* upgradeable suggestions
*/
function __SanctionsListClientInitializable_init_unchained(address _sanctionsList) internal onlyInitializing {
_setSanctionsList(_sanctionsList);
}
/**
* @notice Sets the sanctionsList address for this client
*/
function sanctionsList() public virtual view returns (address) {
SanctionsListStorage storage $ = _getSanctionsListStorage();
return $.sanctionsList;
}
/**
* @notice Sets the sanctionsList address for this client
*
* @param _sanctionsList The new sanctionsList address
*/
function setSanctionsList(address _sanctionsList) external virtual {
_setSanctionsList(_sanctionsList);
}
/**
* @notice Checks whether an address has been blocked
*
* @param account The account to check
*/
function isSanctioned(address account) external virtual view returns (bool) {
return _isSanctioned(account);
}
/**
* @notice Sets the sanctionsList address for this client
*
* @param _sanctionsList The new sanctionsList address
*/
function _setSanctionsList(address _sanctionsList) internal {
if (_sanctionsList == address(0)) {
revert SanctionsListZeroAddress();
}
SanctionsListStorage storage $ = _getSanctionsListStorage();
address oldSanctionsList = address($.sanctionsList);
$.sanctionsList = _sanctionsList;
emit SanctionsListSet(oldSanctionsList, _sanctionsList);
}
/**
* @notice Checks whether an address has been blocked
*
* @param account The account to check
*/
function _isSanctioned(address account) internal view returns (bool) {
SanctionsListStorage storage $ = _getSanctionsListStorage();
if ($.sanctionsList.code.length != 0) {
return ISanctionsListClient($.sanctionsList).isSanctioned(account);
}
return false;
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @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 ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
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;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import {ERC20} from "@solmate/tokens/ERC20.sol";
import {WETH} from "@solmate/tokens/WETH.sol";
import {BoringVault} from "src/base/BoringVault.sol";
import {AccountantWithRateProviders} from "src/base/Roles/AccountantWithRateProviders.sol";
import {FixedPointMathLib} from "@solmate/utils/FixedPointMathLib.sol";
import {SafeTransferLib} from "@solmate/utils/SafeTransferLib.sol";
import {BeforeTransferHook} from "src/interfaces/BeforeTransferHook.sol";
import {Auth, Authority} from "@solmate/auth/Auth.sol";
import {ReentrancyGuard} from "@solmate/utils/ReentrancyGuard.sol";
import {IPausable} from "src/interfaces/IPausable.sol";
import {L1cmETH} from "src/L1cmETH.sol";
contract DelayedWithdraw is Auth, ReentrancyGuard, IPausable {
using SafeTransferLib for BoringVault;
using SafeTransferLib for ERC20;
using FixedPointMathLib for uint256;
// ========================================= STRUCTS =========================================
/**
* @param allowWithdraws Whether or not withdrawals are allowed for this asset.
* @param withdrawDelay The delay in seconds before a requested withdrawal can be completed.
* @param completionWindow The window in seconds that a withdrawal can be completed after the maturity.
* @param outstandingShares The total number of shares that are currently outstanding for an asset.
* @param withdrawFee The fee that is charged when a withdrawal is completed.
* @param maxLoss The maximum loss that can be incurred when completing a withdrawal, evaluating the
* exchange rate at time of withdraw, compared to time of completion.
*/
struct WithdrawAsset {
bool allowWithdraws;
uint32 withdrawDelay;
uint32 completionWindow;
uint128 outstandingShares;
uint16 withdrawFee;
uint16 maxLoss;
}
/**
* @param allowThirdPartyToComplete Whether or not a 3rd party can complete a withdraw on behalf of a user.
* @param maxLoss The maximum loss that can be incurred when completing a withdrawal,
* use zero for global WithdrawAsset.maxLoss.
* @param maturity The time at which the withdrawal can be completed.
* @param shares The number of shares that are requested to be withdrawn.
* @param exchangeRateAtTimeOfRequest The exchange rate at the time of the request.
*/
struct WithdrawRequest {
bool allowThirdPartyToComplete;
uint16 maxLoss;
uint40 maturity;
uint96 shares;
uint96 exchangeRateAtTimeOfRequest;
}
// ========================================= CONSTANTS =========================================
/**
* @notice The largest withdraw fee that can be set.
*/
uint16 internal constant MAX_WITHDRAW_FEE = 0.2e4;
/**
* @notice The largest max loss that can be set.
*/
uint16 internal constant MAX_LOSS = 0.5e4;
/**
* @notice The default completion window for a withdrawal asset.
*/
uint32 internal constant DEFAULT_COMPLETION_WINDOW = 7 days;
// ========================================= STATE =========================================
/**
* @notice The address that receives the fee when a withdrawal is completed.
*/
address public feeAddress;
/**
* @notice Used to pause calls to `requestWithdraw`, and `completeWithdraw`.
*/
bool public isPaused;
/**
* @notice Whether or not the contract should pull funds from the Boring Vault when completing a withdrawal,
* or use funds the BoringVault has previously sent to this contract.
*/
bool public pullFundsFromVault;
/**
* @notice The mapping of assets to their respective withdrawal settings.
*/
mapping(ERC20 => WithdrawAsset) public withdrawAssets;
/**
* @notice The mapping of users to withdraw asset to their withdrawal requests.
*/
mapping(address => mapping(ERC20 => WithdrawRequest))
public withdrawRequests;
//============================== ERRORS ===============================
error DelayedWithdraw__WithdrawFeeTooHigh();
error DelayedWithdraw__MaxLossTooLarge();
error DelayedWithdraw__AlreadySetup();
error DelayedWithdraw__WithdrawsNotAllowed();
error DelayedWithdraw__WithdrawNotMatured();
error DelayedWithdraw__NoSharesToWithdraw();
error DelayedWithdraw__MaxLossExceeded();
error DelayedWithdraw__BadAddress();
error DelayedWithdraw__ThirdPartyCompletionNotAllowed();
error DelayedWithdraw__RequestPastCompletionWindow();
error DelayedWithdraw__Paused();
error DelayedWithdraw__CallerNotBoringVault();
error DelayedWithdraw__CannotWithdrawBoringToken();
//============================== EVENTS ===============================
event WithdrawRequested(
address indexed account,
ERC20 indexed asset,
uint96 shares,
uint40 maturity
);
event WithdrawCancelled(
address indexed account,
ERC20 indexed asset,
uint96 shares
);
event WithdrawCompleted(
address indexed account,
ERC20 indexed asset,
uint256 shares,
uint256 assets
);
event FeeAddressSet(address newFeeAddress);
event SetupWithdrawalsInAsset(
address indexed asset,
uint64 withdrawDelay,
uint16 withdrawFee,
uint16 maxLoss
);
event WithdrawDelayUpdated(address indexed asset, uint32 newWithdrawDelay);
event CompletionWindowUpdated(
address indexed asset,
uint32 newCompletionWindow
);
event WithdrawFeeUpdated(address indexed asset, uint16 newWithdrawFee);
event MaxLossUpdated(address indexed asset, uint16 newMaxLoss);
event WithdrawalsStopped(address indexed asset);
event ThirdPartyCompletionChanged(
address indexed account,
ERC20 indexed asset,
bool allowed
);
event Paused();
event Unpaused();
event PullFundsFromVaultUpdated(bool _pullFundsFromVault);
//============================== IMMUTABLES ===============================
/**
* @notice The accountant contract that is used to get the exchange rate of assets.
*/
AccountantWithRateProviders internal immutable accountant;
/**
* @notice The BoringVault contract that users are withdrawing from.
*/
BoringVault internal immutable boringVault;
/**
* @notice The cmETH this accountant is working with.
*/
L1cmETH public immutable cmETH;
/**
* @notice Constant that represents 1 share.
*/
uint256 internal immutable ONE_SHARE;
constructor(
address _owner,
address _boringVault,
address _accountant,
address _feeAddress
) Auth(_owner, Authority(address(0))) {
accountant = AccountantWithRateProviders(_accountant);
boringVault = BoringVault(payable(_boringVault));
cmETH = L1cmETH(address(boringVault.cmETH()));
ONE_SHARE = 10 ** cmETH.decimals();
if (_feeAddress == address(0)) revert DelayedWithdraw__BadAddress();
feeAddress = _feeAddress;
}
// ========================================= ADMIN FUNCTIONS =========================================
/**
* @notice Pause this contract, which prevents future calls to `manageVaultWithMerkleVerification`.
* @dev Callable by MULTISIG_ROLE.
*/
function pause() external requiresAuth {
isPaused = true;
emit Paused();
}
/**
* @notice Unpause this contract, which allows future calls to `manageVaultWithMerkleVerification`.
* @dev Callable by MULTISIG_ROLE.
*/
function unpause() external requiresAuth {
isPaused = false;
emit Unpaused();
}
/**
* @notice Stops withdrawals for a specific asset.
* @dev Callable by MULTISIG_ROLE.
*/
function stopWithdrawalsInAsset(ERC20 asset) external requiresAuth {
WithdrawAsset storage withdrawAsset = withdrawAssets[asset];
if (!withdrawAsset.allowWithdraws)
revert DelayedWithdraw__WithdrawsNotAllowed();
withdrawAsset.allowWithdraws = false;
emit WithdrawalsStopped(address(asset));
}
/**
* @notice Sets up the withdrawal settings for a specific asset.
* @dev Callable by OWNER_ROLE.
*/
function setupWithdrawAsset(
ERC20 asset,
uint32 withdrawDelay,
uint32 completionWindow,
uint16 withdrawFee,
uint16 maxLoss
) external requiresAuth {
WithdrawAsset storage withdrawAsset = withdrawAssets[asset];
if (withdrawFee > MAX_WITHDRAW_FEE)
revert DelayedWithdraw__WithdrawFeeTooHigh();
if (maxLoss > MAX_LOSS) revert DelayedWithdraw__MaxLossTooLarge();
if (withdrawAsset.allowWithdraws)
revert DelayedWithdraw__AlreadySetup();
withdrawAsset.allowWithdraws = true;
withdrawAsset.withdrawDelay = withdrawDelay;
withdrawAsset.completionWindow = completionWindow;
withdrawAsset.withdrawFee = withdrawFee;
withdrawAsset.maxLoss = maxLoss;
emit SetupWithdrawalsInAsset(
address(asset),
withdrawDelay,
withdrawFee,
maxLoss
);
}
/**
* @notice Changes the withdraw delay for a specific asset.
* @dev Callable by MULTISIG_ROLE.
*/
function changeWithdrawDelay(
ERC20 asset,
uint32 withdrawDelay
) external requiresAuth {
WithdrawAsset storage withdrawAsset = withdrawAssets[asset];
if (!withdrawAsset.allowWithdraws)
revert DelayedWithdraw__WithdrawsNotAllowed();
withdrawAsset.withdrawDelay = withdrawDelay;
emit WithdrawDelayUpdated(address(asset), withdrawDelay);
}
/**
* @notice Changes the completion window for a specific asset.
* @dev Callable by MULTISIG_ROLE.
*/
function changeCompletionWindow(
ERC20 asset,
uint32 completionWindow
) external requiresAuth {
WithdrawAsset storage withdrawAsset = withdrawAssets[asset];
if (!withdrawAsset.allowWithdraws)
revert DelayedWithdraw__WithdrawsNotAllowed();
withdrawAsset.completionWindow = completionWindow;
emit CompletionWindowUpdated(address(asset), completionWindow);
}
/**
* @notice Changes the withdraw fee for a specific asset.
* @dev Callable by OWNER_ROLE.
*/
function changeWithdrawFee(
ERC20 asset,
uint16 withdrawFee
) external requiresAuth {
WithdrawAsset storage withdrawAsset = withdrawAssets[asset];
if (!withdrawAsset.allowWithdraws)
revert DelayedWithdraw__WithdrawsNotAllowed();
if (withdrawFee > MAX_WITHDRAW_FEE)
revert DelayedWithdraw__WithdrawFeeTooHigh();
withdrawAsset.withdrawFee = withdrawFee;
emit WithdrawFeeUpdated(address(asset), withdrawFee);
}
/**
* @notice Changes the max loss for a specific asset.
* @dev Callable by OWNER_ROLE.
* @dev Since maxLoss is a global value based off some withdraw asset, it is possible that a user
* creates a request, then the maxLoss is updated to some value the user is not comfortable with.
* In this case the user should cancel their request. However this is not always possible, so a
* better course of action would be if the maxLoss needs to be updated, the asset can be fully removed.
* Then all exisitng requests for that asset can be cancelled, and finally the maxLoss can be updated.
*/
function changeMaxLoss(ERC20 asset, uint16 maxLoss) external requiresAuth {
WithdrawAsset storage withdrawAsset = withdrawAssets[asset];
if (!withdrawAsset.allowWithdraws)
revert DelayedWithdraw__WithdrawsNotAllowed();
if (maxLoss > MAX_LOSS) revert DelayedWithdraw__MaxLossTooLarge();
withdrawAsset.maxLoss = maxLoss;
emit MaxLossUpdated(address(asset), maxLoss);
}
/**
* @notice Changes the fee address.
* @dev Callable by STRATEGIST_MULTISIG_ROLE.
*/
function setFeeAddress(address _feeAddress) external requiresAuth {
if (_feeAddress == address(0)) revert DelayedWithdraw__BadAddress();
feeAddress = _feeAddress;
emit FeeAddressSet(_feeAddress);
}
/**
* @notice Cancels a user's withdrawal request.
* @dev Callable by MULTISIG_ROLE, and STRATEGIST_MULTISIG_ROLE.
*/
function cancelUserWithdraw(
ERC20 asset,
address user
) external requiresAuth {
_cancelWithdraw(asset, user);
}
/**
* @notice Completes a user's withdrawal request.
* @dev Admins can complete requests even if they are outside the completion window.
* @dev Callable by MULTISIG_ROLE, and STRATEGIST_MULTISIG_ROLE.
*/
function completeUserWithdraw(
ERC20 asset,
address user
) external requiresAuth returns (uint256 assetsOut) {
WithdrawAsset storage withdrawAsset = withdrawAssets[asset];
WithdrawRequest storage req = withdrawRequests[user][asset];
assetsOut = _completeWithdraw(asset, user, withdrawAsset, req);
}
/**
* @notice Changes the global setting for whether or not to pull funds from the vault when completing a withdrawal.
* @dev Callable by OWNER_ROLE.
*/
function setPullFundsFromVault(
bool _pullFundsFromVault
) external requiresAuth {
pullFundsFromVault = _pullFundsFromVault;
emit PullFundsFromVaultUpdated(_pullFundsFromVault);
}
/**
* @notice Withdraws a non boring token from the contract.
* @dev Callable by BoringVault.
* @dev Eventhough withdrawing the BoringVault share from this contract requires
* a malicious leaf in the merkle tree, we explicitly revert if `token`
* is the BoringVault.
* @dev For future reference if this function selector is ever changed, the
* associated function selector must be updated in `BaseDecoderAndSanitizer.sol`.
*/
function withdrawNonBoringToken(ERC20 token, uint256 amount) external {
if (msg.sender != address(boringVault))
revert DelayedWithdraw__CallerNotBoringVault();
if (address(token) == address(cmETH))
revert DelayedWithdraw__CannotWithdrawBoringToken();
if (amount == type(uint256).max) {
amount = token.balanceOf(address(this));
}
token.safeTransfer(address(boringVault), amount);
}
// ========================================= PUBLIC FUNCTIONS =========================================
/**
* @notice Allows a user to set whether or not a 3rd party can complete withdraws on behalf of them.
*/
function setAllowThirdPartyToComplete(
ERC20 asset,
bool allow
) external requiresAuth {
withdrawRequests[msg.sender][asset].allowThirdPartyToComplete = allow;
emit ThirdPartyCompletionChanged(msg.sender, asset, allow);
}
/**
* @notice Requests a withdrawal of shares for a specific asset.
* @dev Publicly callable.
*/
function requestWithdraw(
ERC20 asset,
uint96 shares,
uint16 maxLoss,
bool allowThirdPartyToComplete
) external requiresAuth nonReentrant {
if (isPaused) revert DelayedWithdraw__Paused();
WithdrawAsset storage withdrawAsset = withdrawAssets[asset];
if (!withdrawAsset.allowWithdraws)
revert DelayedWithdraw__WithdrawsNotAllowed();
if (maxLoss > MAX_LOSS) revert DelayedWithdraw__MaxLossTooLarge();
ERC20(address(cmETH)).safeTransferFrom(
msg.sender,
address(this),
shares
);
withdrawAsset.outstandingShares += shares;
WithdrawRequest storage req = withdrawRequests[msg.sender][asset];
req.shares += shares;
uint40 maturity = uint40(block.timestamp + withdrawAsset.withdrawDelay);
req.maturity = maturity;
req.exchangeRateAtTimeOfRequest = uint96(
accountant.getRateInQuoteSafe(asset)
);
req.maxLoss = maxLoss;
req.allowThirdPartyToComplete = allowThirdPartyToComplete;
emit WithdrawRequested(msg.sender, asset, shares, maturity);
}
/**
* @notice Cancels msg.sender's withdrawal request.
* @dev Publicly callable.
*/
function cancelWithdraw(ERC20 asset) external requiresAuth nonReentrant {
_cancelWithdraw(asset, msg.sender);
}
/**
* @notice Completes a user's withdrawal request.
* @dev Publicly callable.
*/
function completeWithdraw(
ERC20 asset,
address account
) external requiresAuth nonReentrant returns (uint256 assetsOut) {
if (isPaused) revert DelayedWithdraw__Paused();
WithdrawAsset storage withdrawAsset = withdrawAssets[asset];
WithdrawRequest storage req = withdrawRequests[account][asset];
uint32 completionWindow = withdrawAsset.completionWindow > 0
? withdrawAsset.completionWindow
: DEFAULT_COMPLETION_WINDOW;
if (block.timestamp > (req.maturity + completionWindow))
revert DelayedWithdraw__RequestPastCompletionWindow();
if (msg.sender != account && !req.allowThirdPartyToComplete) {
revert DelayedWithdraw__ThirdPartyCompletionNotAllowed();
}
assetsOut = _completeWithdraw(asset, account, withdrawAsset, req);
}
// ========================================= VIEW FUNCTIONS =========================================
/**
* @notice Helper function to view the outstanding withdraw debt for a specific asset.
*/
function viewOutstandingDebt(
ERC20 asset
) public view returns (uint256 debt) {
uint256 rate = accountant.getRateInQuoteSafe(asset);
debt = rate.mulDivDown(
withdrawAssets[asset].outstandingShares,
ONE_SHARE
);
}
/**
* @notice Helper function to view the outstanding withdraw debt for multiple assets.
*/
function viewOutstandingDebts(
ERC20[] calldata assets
) external view returns (uint256[] memory debts) {
debts = new uint256[](assets.length);
for (uint256 i = 0; i < assets.length; i++) {
debts[i] = viewOutstandingDebt(assets[i]);
}
}
// ========================================= INTERNAL FUNCTIONS =========================================
/**
* @notice Internal helper function that implements shared logic for cancelling a user's withdrawal request.
*/
function _cancelWithdraw(ERC20 asset, address account) internal {
WithdrawAsset storage withdrawAsset = withdrawAssets[asset];
// We do not check if `asset` is allowed, to handle edge cases where the asset is no longer allowed.
WithdrawRequest storage req = withdrawRequests[account][asset];
uint96 shares = req.shares;
if (shares == 0) revert DelayedWithdraw__NoSharesToWithdraw();
withdrawAsset.outstandingShares -= shares;
req.shares = 0;
ERC20(address(cmETH)).safeTransfer(account, shares);
emit WithdrawCancelled(account, asset, shares);
}
/**
* @notice Internal helper function that implements shared logic for completing a user's withdrawal request.
*/
function _completeWithdraw(
ERC20 asset,
address account,
WithdrawAsset storage withdrawAsset,
WithdrawRequest storage req
) internal returns (uint256 assetsOut) {
if (!withdrawAsset.allowWithdraws)
revert DelayedWithdraw__WithdrawsNotAllowed();
if (block.timestamp < req.maturity)
revert DelayedWithdraw__WithdrawNotMatured();
if (req.shares == 0) revert DelayedWithdraw__NoSharesToWithdraw();
uint256 currentExchangeRate = accountant.getRateInQuoteSafe(asset);
uint256 minRate = req.exchangeRateAtTimeOfRequest < currentExchangeRate
? req.exchangeRateAtTimeOfRequest
: currentExchangeRate;
uint256 maxRate = req.exchangeRateAtTimeOfRequest < currentExchangeRate
? currentExchangeRate
: req.exchangeRateAtTimeOfRequest;
// If user has set a maxLoss use that, otherwise use the global maxLoss.
uint16 maxLoss = req.maxLoss > 0 ? req.maxLoss : withdrawAsset.maxLoss;
// Make sure minRate * maxLoss is greater than or equal to maxRate.
if (minRate.mulDivDown(1e4 + maxLoss, 1e4) < maxRate)
revert DelayedWithdraw__MaxLossExceeded();
uint256 shares = req.shares;
// Safe to cast shares to a uint128 since req.shares is constrained to be less than 2^96.
withdrawAsset.outstandingShares -= uint128(shares);
if (withdrawAsset.withdrawFee > 0) {
// Handle withdraw fee.
uint256 fee = uint256(shares).mulDivDown(
withdrawAsset.withdrawFee,
1e4
);
shares -= fee;
// Transfer fee to feeAddress.
ERC20(address(cmETH)).safeTransfer(feeAddress, fee);
}
// Calculate assets out.
assetsOut = shares.mulDivDown(minRate, ONE_SHARE);
req.shares = 0;
if (pullFundsFromVault) {
// Burn shares and transfer assets to user.
boringVault.exit(account, asset, assetsOut, address(this), shares);
} else {
// Burn shares.
boringVault.exit(account, asset, 0, address(this), shares);
// Transfer assets to user.
asset.safeTransfer(account, assetsOut);
}
emit WithdrawCompleted(account, asset, shares, assetsOut);
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/utils/ERC1155Holder.sol)
pragma solidity ^0.8.20;
import {IERC165, ERC165} from "../../../utils/introspection/ERC165.sol";
import {IERC1155Receiver} from "../IERC1155Receiver.sol";
/**
* @dev Simple implementation of `IERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
*
* IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
* stuck.
*/
abstract contract ERC1155Holder is ERC165, IERC1155Receiver {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
}
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC1155Received.selector;
}
function onERC1155BatchReceived(
address,
address,
uint256[] memory,
uint256[] memory,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC1155BatchReceived.selector;
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165Upgradeable is Initializable, IERC165 {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
/*//////////////////////////////////////////////////////////////
METADATA STORAGE
//////////////////////////////////////////////////////////////*/
string public name;
string public symbol;
uint8 public immutable decimals;
/*//////////////////////////////////////////////////////////////
ERC20 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
/*//////////////////////////////////////////////////////////////
EIP-2612 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 internal immutable INITIAL_CHAIN_ID;
bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;
mapping(address => uint256) public nonces;
/*//////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////*/
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals
) {
name = _name;
symbol = _symbol;
decimals = _decimals;
INITIAL_CHAIN_ID = block.chainid;
INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
}
/*//////////////////////////////////////////////////////////////
ERC20 LOGIC
//////////////////////////////////////////////////////////////*/
function approve(address spender, uint256 amount) public virtual returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address to, uint256 amount) public virtual returns (bool) {
balanceOf[msg.sender] -= amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(msg.sender, to, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual returns (bool) {
uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.
if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;
balanceOf[from] -= amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(from, to, amount);
return true;
}
/*//////////////////////////////////////////////////////////////
EIP-2612 LOGIC
//////////////////////////////////////////////////////////////*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public virtual {
require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");
// Unchecked because the only math done is incrementing
// the owner's nonce which cannot realistically overflow.
unchecked {
address recoveredAddress = ecrecover(
keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR(),
keccak256(
abi.encode(
keccak256(
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
),
owner,
spender,
value,
nonces[owner]++,
deadline
)
)
)
),
v,
r,
s
);
require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");
allowance[recoveredAddress][spender] = value;
}
emit Approval(owner, spender, value);
}
function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
}
function computeDomainSeparator() internal view virtual returns (bytes32) {
return
keccak256(
abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
keccak256("1"),
block.chainid,
address(this)
)
);
}
/*//////////////////////////////////////////////////////////////
INTERNAL MINT/BURN LOGIC
//////////////////////////////////////////////////////////////*/
function _mint(address to, uint256 amount) internal virtual {
totalSupply += amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(address(0), to, amount);
}
function _burn(address from, uint256 amount) internal virtual {
balanceOf[from] -= amount;
// Cannot underflow because a user's balance
// will never be larger than the total supply.
unchecked {
totalSupply -= amount;
}
emit Transfer(from, address(0), amount);
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {ContextUpgradeable} from "../../utils/ContextUpgradeable.sol";
import {IERC20Errors} from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol";
import {Initializable} from "../../proxy/utils/Initializable.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}.
*
* 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.
*/
abstract contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20, IERC20Metadata, IERC20Errors {
/// @custom:storage-location erc7201:openzeppelin.storage.ERC20
struct ERC20Storage {
mapping(address account => uint256) _balances;
mapping(address account => mapping(address spender => uint256)) _allowances;
uint256 _totalSupply;
string _name;
string _symbol;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC20")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant ERC20StorageLocation = 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00;
function _getERC20Storage() private pure returns (ERC20Storage storage $) {
assembly {
$.slot := ERC20StorageLocation
}
}
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC20_init_unchained(name_, symbol_);
}
function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
ERC20Storage storage $ = _getERC20Storage();
$._name = name_;
$._symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
ERC20Storage storage $ = _getERC20Storage();
return $._name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
ERC20Storage storage $ = _getERC20Storage();
return $._symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual returns (uint256) {
ERC20Storage storage $ = _getERC20Storage();
return $._totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual returns (uint256) {
ERC20Storage storage $ = _getERC20Storage();
return $._balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual returns (uint256) {
ERC20Storage storage $ = _getERC20Storage();
return $._allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* 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 `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(address from, address to, uint256 value) internal {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* Emits a {Transfer} event.
*/
function _update(address from, address to, uint256 value) internal virtual {
ERC20Storage storage $ = _getERC20Storage();
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
$._totalSupply += value;
} else {
uint256 fromBalance = $._balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
$._balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
$._totalSupply -= value;
}
} else {
unchecked {
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
$._balances[to] += value;
}
}
emit Transfer(from, to, value);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _mint(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(address(0), account, value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead
*/
function _burn(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(account, address(0), value);
}
/**
* @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
* true using the following override:
* ```
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
ERC20Storage storage $ = _getERC20Storage();
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
$._allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(spender, currentAllowance, value);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/utils/ERC721Holder.sol)
pragma solidity ^0.8.20;
import {IERC721Receiver} from "../IERC721Receiver.sol";
/**
* @dev Implementation of the {IERC721Receiver} interface.
*
* Accepts all token transfers.
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or
* {IERC721-setApprovalForAll}.
*/
abstract contract ERC721Holder is IERC721Receiver {
/**
* @dev See {IERC721Receiver-onERC721Received}.
*
* Always returns `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {
return this.onERC721Received.selector;
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.
pragma solidity ^0.8.20;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```solidity
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*
* [WARNING]
* ====
* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
* unusable.
* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
*
* In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
* array of EnumerableSet.
* ====
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position is the index of the value in the `values` array plus 1.
// Position 0 is used to mean a value is not in the set.
mapping(bytes32 value => uint256) _positions;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._positions[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We cache the value's position to prevent multiple reads from the same storage slot
uint256 position = set._positions[value];
if (position != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 valueIndex = position - 1;
uint256 lastIndex = set._values.length - 1;
if (valueIndex != lastIndex) {
bytes32 lastValue = set._values[lastIndex];
// Move the lastValue to the index where the value to delete is
set._values[valueIndex] = lastValue;
// Update the tracked position of the lastValue (that was just moved)
set._positions[lastValue] = position;
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the tracked position for the deleted slot
delete set._positions[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._positions[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
}
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Arithmetic library with operations for fixed-point numbers.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol)
/// @author Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol)
library FixedPointMathLib {
/*//////////////////////////////////////////////////////////////
SIMPLIFIED FIXED POINT OPERATIONS
//////////////////////////////////////////////////////////////*/
uint256 internal constant MAX_UINT256 = 2**256 - 1;
uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s.
function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down.
}
function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up.
}
function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down.
}
function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up.
}
/*//////////////////////////////////////////////////////////////
LOW LEVEL FIXED POINT OPERATIONS
//////////////////////////////////////////////////////////////*/
function mulDivDown(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y))
if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) {
revert(0, 0)
}
// Divide x * y by the denominator.
z := div(mul(x, y), denominator)
}
}
function mulDivUp(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y))
if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) {
revert(0, 0)
}
// If x * y modulo the denominator is strictly greater than 0,
// 1 is added to round up the division of x * y by the denominator.
z := add(gt(mod(mul(x, y), denominator), 0), div(mul(x, y), denominator))
}
}
function rpow(
uint256 x,
uint256 n,
uint256 scalar
) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
switch x
case 0 {
switch n
case 0 {
// 0 ** 0 = 1
z := scalar
}
default {
// 0 ** n = 0
z := 0
}
}
default {
switch mod(n, 2)
case 0 {
// If n is even, store scalar in z for now.
z := scalar
}
default {
// If n is odd, store x in z for now.
z := x
}
// Shifting right by 1 is like dividing by 2.
let half := shr(1, scalar)
for {
// Shift n right by 1 before looping to halve it.
n := shr(1, n)
} n {
// Shift n right by 1 each iteration to halve it.
n := shr(1, n)
} {
// Revert immediately if x ** 2 would overflow.
// Equivalent to iszero(eq(div(xx, x), x)) here.
if shr(128, x) {
revert(0, 0)
}
// Store x squared.
let xx := mul(x, x)
// Round to the nearest number.
let xxRound := add(xx, half)
// Revert if xx + half overflowed.
if lt(xxRound, xx) {
revert(0, 0)
}
// Set x to scaled xxRound.
x := div(xxRound, scalar)
// If n is even:
if mod(n, 2) {
// Compute z * x.
let zx := mul(z, x)
// If z * x overflowed:
if iszero(eq(div(zx, x), z)) {
// Revert if x is non-zero.
if iszero(iszero(x)) {
revert(0, 0)
}
}
// Round to the nearest number.
let zxRound := add(zx, half)
// Revert if zx + half overflowed.
if lt(zxRound, zx) {
revert(0, 0)
}
// Return properly scaled zxRound.
z := div(zxRound, scalar)
}
}
}
}
}
/*//////////////////////////////////////////////////////////////
GENERAL NUMBER UTILITIES
//////////////////////////////////////////////////////////////*/
function sqrt(uint256 x) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
let y := x // We start y at x, which will help us make our initial estimate.
z := 181 // The "correct" value is 1, but this saves a multiplication later.
// This segment is to get a reasonable initial estimate for the Babylonian method. With a bad
// start, the correct # of bits increases ~linearly each iteration instead of ~quadratically.
// We check y >= 2^(k + 8) but shift right by k bits
// each branch to ensure that if x >= 256, then y >= 256.
if iszero(lt(y, 0x10000000000000000000000000000000000)) {
y := shr(128, y)
z := shl(64, z)
}
if iszero(lt(y, 0x1000000000000000000)) {
y := shr(64, y)
z := shl(32, z)
}
if iszero(lt(y, 0x10000000000)) {
y := shr(32, y)
z := shl(16, z)
}
if iszero(lt(y, 0x1000000)) {
y := shr(16, y)
z := shl(8, z)
}
// Goal was to get z*z*y within a small factor of x. More iterations could
// get y in a tighter range. Currently, we will have y in [256, 256*2^16).
// We ensured y >= 256 so that the relative difference between y and y+1 is small.
// That's not possible if x < 256 but we can just verify those cases exhaustively.
// Now, z*z*y <= x < z*z*(y+1), and y <= 2^(16+8), and either y >= 256, or x < 256.
// Correctness can be checked exhaustively for x < 256, so we assume y >= 256.
// Then z*sqrt(y) is within sqrt(257)/sqrt(256) of sqrt(x), or about 20bps.
// For s in the range [1/256, 256], the estimate f(s) = (181/1024) * (s+1) is in the range
// (1/2.84 * sqrt(s), 2.84 * sqrt(s)), with largest error when s = 1 and when s = 256 or 1/256.
// Since y is in [256, 256*2^16), let a = y/65536, so that a is in [1/256, 256). Then we can estimate
// sqrt(y) using sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2^18.
// There is no overflow risk here since y < 2^136 after the first branch above.
z := shr(18, mul(z, add(y, 65536))) // A mul() is saved from starting z at 181.
// Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough.
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
// If x+1 is a perfect square, the Babylonian method cycles between
// floor(sqrt(x)) and ceil(sqrt(x)). This statement ensures we return floor.
// See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division
// Since the ceil is rare, we save gas on the assignment and repeat division in the rare case.
// If you don't care whether the floor or ceil square root is returned, you can remove this statement.
z := sub(z, lt(div(x, z), z))
}
}
function unsafeMod(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Mod x by y. Note this will return
// 0 instead of reverting if y is zero.
z := mod(x, y)
}
}
function unsafeDiv(uint256 x, uint256 y) internal pure returns (uint256 r) {
/// @solidity memory-safe-assembly
assembly {
// Divide x by y. Note this will return
// 0 instead of reverting if y is zero.
r := div(x, y)
}
}
function unsafeDivUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Add 1 to x * y if x % y > 0. Note this will
// return 0 instead of reverting if y is zero.
z := add(gt(mod(x, y), 0), div(x, y))
}
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)
pragma solidity ^0.8.20;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev The `account` is missing a role.
*/
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);
/**
* @dev The caller of a function is not the expected one.
*
* NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
*/
error AccessControlBadConfirmation();
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*/
function renounceRole(bytes32 role, address callerConfirmation) external;
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)
pragma solidity ^0.8.20;
import {IAccessControl} from "../IAccessControl.sol";
/**
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
*/
interface IAccessControlEnumerable is IAccessControl {
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) external view returns (address);
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) external view returns (uint256);
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Interface that must be implemented by smart contracts in order to receive
* ERC-1155 token transfers.
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* 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[EIP 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);
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;
/// @dev Interface of the ERC20 standard as defined in the EIP.
/// @dev This includes the optional name, symbol, and decimals metadata.
interface IERC20 {
/// @dev Emitted when `value` tokens are moved from one account (`from`) to another (`to`).
event Transfer(address indexed from, address indexed to, uint256 value);
/// @dev Emitted when the allowance of a `spender` for an `owner` is set, where `value`
/// is the new allowance.
event Approval(address indexed owner, address indexed spender, uint256 value);
/// @notice Returns the amount of tokens in existence.
function totalSupply() external view returns (uint256);
/// @notice Returns the amount of tokens owned by `account`.
function balanceOf(address account) external view returns (uint256);
/// @notice Moves `amount` tokens from the caller's account to `to`.
function transfer(address to, uint256 amount) external returns (bool);
/// @notice Returns the remaining number of tokens that `spender` is allowed
/// to spend on behalf of `owner`
function allowance(address owner, address spender) external view returns (uint256);
/// @notice Sets `amount` as the allowance of `spender` over the caller's tokens.
/// @dev Be aware of front-running risks: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
function approve(address spender, uint256 amount) external returns (bool);
/// @notice Moves `amount` tokens from `from` to `to` using the allowance mechanism.
/// `amount` is then deducted from the caller's allowance.
function transferFrom(address from, address to, uint256 amount) external returns (bool);
/// @notice Returns the name of the token.
function name() external view returns (string memory);
/// @notice Returns the symbol of the token.
function symbol() external view returns (string memory);
/// @notice Returns the decimals places of the token.
function decimals() external view returns (uint8);
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;
import "./IERC165.sol";
/// @title ERC-721 Non-Fungible Token Standard
/// @dev See https://eips.ethereum.org/EIPS/eip-721
/// Note: the ERC-165 identifier for this interface is 0x80ac58cd.
interface IERC721 is IERC165 {
/// @dev This emits when ownership of any NFT changes by any mechanism.
/// This event emits when NFTs are created (`from` == 0) and destroyed
/// (`to` == 0). Exception: during contract creation, any number of NFTs
/// may be created and assigned without emitting Transfer. At the time of
/// any transfer, the approved address for that NFT (if any) is reset to none.
event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
/// @dev This emits when the approved address for an NFT is changed or
/// reaffirmed. The zero address indicates there is no approved address.
/// When a Transfer event emits, this also indicates that the approved
/// address for that NFT (if any) is reset to none.
event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);
/// @dev This emits when an operator is enabled or disabled for an owner.
/// The operator can manage all NFTs of the owner.
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
/// @notice Count all NFTs assigned to an owner
/// @dev NFTs assigned to the zero address are considered invalid, and this
/// function throws for queries about the zero address.
/// @param _owner An address for whom to query the balance
/// @return The number of NFTs owned by `_owner`, possibly zero
function balanceOf(address _owner) external view returns (uint256);
/// @notice Find the owner of an NFT
/// @dev NFTs assigned to zero address are considered invalid, and queries
/// about them do throw.
/// @param _tokenId The identifier for an NFT
/// @return The address of the owner of the NFT
function ownerOf(uint256 _tokenId) external view returns (address);
/// @notice Transfers the ownership of an NFT from one address to another address
/// @dev Throws unless `msg.sender` is the current owner, an authorized
/// operator, or the approved address for this NFT. Throws if `_from` is
/// not the current owner. Throws if `_to` is the zero address. Throws if
/// `_tokenId` is not a valid NFT. When transfer is complete, this function
/// checks if `_to` is a smart contract (code size > 0). If so, it calls
/// `onERC721Received` on `_to` and throws if the return value is not
/// `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`.
/// @param _from The current owner of the NFT
/// @param _to The new owner
/// @param _tokenId The NFT to transfer
/// @param data Additional data with no specified format, sent in call to `_to`
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata data) external payable;
/// @notice Transfers the ownership of an NFT from one address to another address
/// @dev This works identically to the other function with an extra data parameter,
/// except this function just sets data to "".
/// @param _from The current owner of the NFT
/// @param _to The new owner
/// @param _tokenId The NFT to transfer
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable;
/// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE
/// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE
/// THEY MAY BE PERMANENTLY LOST
/// @dev Throws unless `msg.sender` is the current owner, an authorized
/// operator, or the approved address for this NFT. Throws if `_from` is
/// not the current owner. Throws if `_to` is the zero address. Throws if
/// `_tokenId` is not a valid NFT.
/// @param _from The current owner of the NFT
/// @param _to The new owner
/// @param _tokenId The NFT to transfer
function transferFrom(address _from, address _to, uint256 _tokenId) external payable;
/// @notice Change or reaffirm the approved address for an NFT
/// @dev The zero address indicates there is no approved address.
/// Throws unless `msg.sender` is the current NFT owner, or an authorized
/// operator of the current owner.
/// @param _approved The new approved NFT controller
/// @param _tokenId The NFT to approve
function approve(address _approved, uint256 _tokenId) external payable;
/// @notice Enable or disable approval for a third party ("operator") to manage
/// all of `msg.sender`'s assets
/// @dev Emits the ApprovalForAll event. The contract MUST allow
/// multiple operators per owner.
/// @param _operator Address to add to the set of authorized operators
/// @param _approved True if the operator is approved, false to revoke approval
function setApprovalForAll(address _operator, bool _approved) external;
/// @notice Get the approved address for a single NFT
/// @dev Throws if `_tokenId` is not a valid NFT.
/// @param _tokenId The NFT to find the approved address for
/// @return The approved address for this NFT, or the zero address if there is none
function getApproved(uint256 _tokenId) external view returns (address);
/// @notice Query if an address is an authorized operator for another address
/// @param _owner The address that owns the NFTs
/// @param _operator The address that acts on behalf of the owner
/// @return True if `_operator` is an approved operator for `_owner`, false otherwise
function isApprovedForAll(address _owner, address _operator) external view returns (bool);
}
/// @dev Note: the ERC-165 identifier for this interface is 0x150b7a02.
interface IERC721TokenReceiver {
/// @notice Handle the receipt of an NFT
/// @dev The ERC721 smart contract calls this function on the recipient
/// after a `transfer`. This function MAY throw to revert and reject the
/// transfer. Return of other than the magic value MUST result in the
/// transaction being reverted.
/// Note: the contract address is always the message sender.
/// @param _operator The address which called `safeTransferFrom` function
/// @param _from The address which previously owned the token
/// @param _tokenId The NFT identifier which is being transferred
/// @param _data Additional data with no specified format
/// @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
/// unless throwing
function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data)
external
returns (bytes4);
}
/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
/// @dev See https://eips.ethereum.org/EIPS/eip-721
/// Note: the ERC-165 identifier for this interface is 0x5b5e139f.
interface IERC721Metadata is IERC721 {
/// @notice A descriptive name for a collection of NFTs in this contract
function name() external view returns (string memory _name);
/// @notice An abbreviated name for NFTs in this contract
function symbol() external view returns (string memory _symbol);
/// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
/// @dev Throws if `_tokenId` is not a valid NFT. URIs are defined in RFC
/// 3986. The URI may point to a JSON file that conforms to the "ERC721
/// Metadata JSON Schema".
function tokenURI(uint256 _tokenId) external view returns (string memory);
}
/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
/// @dev See https://eips.ethereum.org/EIPS/eip-721
/// Note: the ERC-165 identifier for this interface is 0x780e9d63.
interface IERC721Enumerable is IERC721 {
/// @notice Count NFTs tracked by this contract
/// @return A count of valid NFTs tracked by this contract, where each one of
/// them has an assigned and queryable owner not equal to the zero address
function totalSupply() external view returns (uint256);
/// @notice Enumerate valid NFTs
/// @dev Throws if `_index` >= `totalSupply()`.
/// @param _index A counter less than `totalSupply()`
/// @return The token identifier for the `_index`th NFT,
/// (sort order not specified)
function tokenByIndex(uint256 _index) external view returns (uint256);
/// @notice Enumerate NFTs assigned to an owner
/// @dev Throws if `_index` >= `balanceOf(_owner)` or if
/// `_owner` is the zero address, representing invalid NFTs.
/// @param _owner An address where we are interested in NFTs owned by them
/// @param _index A counter less than `balanceOf(_owner)`
/// @return The token identifier for the `_index`th NFT assigned to `_owner`,
/// (sort order not specified)
function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256);
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.20;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be
* reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
interface IL1cmETH {
/// @notice Mint cmETH when deposit mETH
/// @param _to The address of the owner.
/// @param _amount The amount minted.
function mint(address _to, uint256 _amount) external;
// @dev Burn cmETH
/// @notice Burn cmETH when claim mETH withdraw
/// @param _from The address of the burner
/// @param _amount The amount will burn
function burn(address _from, uint256 _amount) external;
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
interface IStatusRead {
/// @notice Flag indicating if staking is paused.
function isTransferPaused() external view returns (bool);
}
interface IL1StatusRead is IStatusRead {
/// @notice Flag indicating if allocation is paused.
function isOriginalMintBurnPaused() external view returns (bool);
}
interface IL2StatusRead is IStatusRead {
/// @notice return exchange rate.
function exchangeRate() external view returns (uint256);
/// @notice return capacity.
function capacity() external view returns (uint256);
/// @notice return enabled status.
function enabled() external view returns (bool);
}
interface IStatusWrite {
/// @notice quote configration send.
function quote(uint32 eid, bytes calldata message, bytes calldata options) external view returns (uint256, uint256);
/// @notice Update set TransferPaused status on local.
function setIsTransferPaused(bool isPaused) external;
/// @notice Update set TransferPaused status on target chain.
function setIsTransferPausedFor(uint32 eid, bool isPaused) external payable;
/// @notice Update set ExchangeRate on target chain.
function setExchangeRateFor(uint32 eid, uint256 rate) external payable;
/// @notice Update set Enable on target chain.
function setEnableFor(uint32 eid, bool flag) external payable;
/// @notice Update set Bridging Capacity on target chain.
function setCapFor(uint32 eid, uint256 cap) external payable;
}
interface IL1StatusWrite is IStatusWrite {
/// @notice Update set OriginalMintBurnPaused status on local.
function setIsOriginalMintBurnPaused(bool isPaused) external;
}
interface ConfigEvents {
/// @notice Emitted when a protocol bridging configuration has been updated.
/// @param setterSelector The selector of the function that updated the configuration.
/// @param setterSignature The signature of the function that updated the configuration.
/// @param value The abi-encoded data passed to the function that updated the configuration. Since this event will
/// only be emitted by setters, this data corresponds to the updated values in the protocol configuration.
event BridgingConfigChanged(bytes4 indexed setterSelector, string setterSignature, bytes value);
}
interface PauserEvents {
/// @notice Emitted when a flag has been updated.
/// @param selector The selector of the flag that was updated.
/// @param isPaused The new value of the flag.
/// @param flagName The name of the flag that was updated.
event FlagUpdated(bytes4 indexed selector, bool indexed isPaused, string flagName);
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;
pragma experimental ABIEncoderV2;
interface IMulticall3 {
struct Call {
address target;
bytes callData;
}
struct Call3 {
address target;
bool allowFailure;
bytes callData;
}
struct Call3Value {
address target;
bool allowFailure;
uint256 value;
bytes callData;
}
struct Result {
bool success;
bytes returnData;
}
function aggregate(Call[] calldata calls)
external
payable
returns (uint256 blockNumber, bytes[] memory returnData);
function aggregate3(Call3[] calldata calls) external payable returns (Result[] memory returnData);
function aggregate3Value(Call3Value[] calldata calls) external payable returns (Result[] memory returnData);
function blockAndAggregate(Call[] calldata calls)
external
payable
returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData);
function getBasefee() external view returns (uint256 basefee);
function getBlockHash(uint256 blockNumber) external view returns (bytes32 blockHash);
function getBlockNumber() external view returns (uint256 blockNumber);
function getChainId() external view returns (uint256 chainid);
function getCurrentBlockCoinbase() external view returns (address coinbase);
function getCurrentBlockDifficulty() external view returns (uint256 difficulty);
function getCurrentBlockGasLimit() external view returns (uint256 gaslimit);
function getCurrentBlockTimestamp() external view returns (uint256 timestamp);
function getEthBalance(address addr) external view returns (uint256 balance);
function getLastBlockHash() external view returns (bytes32 blockHash);
function tryAggregate(bool requireSuccess, Call[] calldata calls)
external
payable
returns (Result[] memory returnData);
function tryBlockAndAggregate(bool requireSuccess, Call[] calldata calls)
external
payable
returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
interface IPausable {
function pause() external;
function unpause() external;
}
// SPDX-License-Identifier: GPL-3.0-or-later
// 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.8.0;
interface IRateProvider {
function getRate() external view returns (uint256);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
// @dev inspired by ONDO-USDY
interface IBlockListClient {
/// @notice Returns the address of the blocklist that this client setup
function blocklist() external view returns (address);
/// @notice Update the blocklist address
function setBlocklist(address registry) external;
/// @notice Check if a address is blocked or not
function isBlocked(address account) external view returns (bool);
/**
* @dev Event for when the blocklist reference is set
* @param oldBlocklist The old blocklist
* @param newBlocklist The new blocklist
*/
event BlocklistSet(address oldBlocklist, address newBlocklist);
}
interface IBlockList {
function addToBlocklist(address[] calldata accounts) external;
function removeFromBlocklist(address[] calldata accounts) external;
function isBlocked(address account) external view returns (bool);
/**
* @notice Event emitted when addresses are added to the blocklist
* @param accounts The addresses that were added to the blocklist
*/
event BlockedAddressesAdded(address[] accounts);
/**
* @notice Event emitted when addresses are removed from the blocklist
* @param accounts The addresses that were removed from the blocklist
*/
event BlockedAddressesRemoved(address[] accounts);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
// @dev inspired by ONDO-USDY
interface ISanctionsListClient {
/// @notice Returns address of the sanctions list that this client setup
function sanctionsList() external view returns (address);
/// @notice Update the sanctions list reference
function setSanctionsList(address sanctionsList) external;
// @notice check is the address is sanctioned
function isSanctioned(address addr) external view returns (bool);
/**
* @dev Event for when the sanctions list reference is set
* @param oldSanctionsList The old list
* @param newSanctionsList The new list
*/
event SanctionsListSet(address oldSanctionsList, address newSanctionsList);
}
interface IISanctionsList {
function addToSanctionsList(address[] calldata accounts) external;
function removeFromSanctionsList(address[] calldata accounts) external;
function isSanctioned(address account) external view returns (bool);
/**
* @dev Event for when the sanctions list reference is set
* @param addr The address sanctioned
*/
event SanctionedAddress(address indexed addr);
/**
* @dev Event for when the sanctions list reference is set
* @param addr The address not sanctioned
*/
event NonSanctionedAddress(address indexed addr);
/**
* @dev Event for when the sanctions list reference is set
* @param addrs The address list sanctioned
*/
event SanctionedAddressesAdded(address[] addrs);
/**
* @dev Event for when the sanctions list reference is set
* @param addrs The address list not sanctioned
*/
event SanctionedAddressesRemoved(address[] addrs);
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reininitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 1;
if (isTopLevelCall) {
$._initializing = true;
}
_;
if (isTopLevelCall) {
$._initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import {ERC20Upgradeable} from "openzeppelin-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import {AccessControlEnumerableUpgradeable} from "openzeppelin-upgradeable/access/extensions/AccessControlEnumerableUpgradeable.sol";
import {SanctionsListClientUpgradeable} from "./ClientSanctionsListUpgradeable.sol";
import {BlockListClientUpgradeable} from "./ClientBlockListUpgradable.sol";
import {IL1StatusRead} from "./interfaces/IMessagingStatus.sol";
import {ProtocolEvents} from "./interfaces/ProtocolEvents.sol";
import {IL1cmETH} from "./interfaces/IL1cmETH.sol";
contract L1cmETH is
IL1cmETH,
ProtocolEvents,
ERC20Upgradeable,
AccessControlEnumerableUpgradeable,
BlockListClientUpgradeable,
SanctionsListClientUpgradeable
{
// errors
error Paused();
error ChainNotExpected();
error MaxSupplyOutOfBound();
error UnexpectedInitializeParams();
/// @notice Role allowed trigger administrative tasks such as setup configurations
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");
/// @notice Role to request mint / burn.
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
/// @notice The maximum amount of cmETH that can be minted during the original mint process.
/// @dev This is used as an additional safeguard to create a maximum supply amount in the protocol. As the protocol
/// scales up this value will be increased to allow for more deposit.
uint256 public maxTotalSupply;
// messaging status setup
address public status;
struct Init {
address admin;
address manager;
address minter;
address burner;
address status;
string name;
string symbol;
uint256 maxSupply;
address blocklist;
address sanctionList;
}
// @dev _token is the proxy address of L1cmETH
constructor() {
_disableInitializers();
}
/**
* @dev Initializes the OFT with the provided name, symbol, and delegate.
* @dev The delegate typically should be set as the admin of the contract.
* @dev Ownable is not initialized here on purpose. It should be initialized in the child contract to
* accommodate the different version of Ownable.
*/
function initialize(Init memory init) external initializer {
if (
init.admin == address(0) ||
init.manager == address(0) ||
init.minter == address(0) ||
init.burner == address(0) ||
init.status == address(0)
) {
revert UnexpectedInitializeParams();
}
__ERC20_init(init.name, init.symbol);
// set admin roles
_setRoleAdmin(MANAGER_ROLE, DEFAULT_ADMIN_ROLE);
_setRoleAdmin(MINTER_ROLE, DEFAULT_ADMIN_ROLE);
_setRoleAdmin(BURNER_ROLE, DEFAULT_ADMIN_ROLE);
// grant admin roles
_grantRole(DEFAULT_ADMIN_ROLE, init.admin);
// grant sub roles
_grantRole(MANAGER_ROLE, init.manager);
_grantRole(MINTER_ROLE, init.minter);
_grantRole(BURNER_ROLE, init.burner);
status = init.status;
maxTotalSupply = init.maxSupply;
_setBlocklist(init.blocklist);
_setSanctionsList(init.sanctionList);
}
// @notice Original mint when deposit mETH.
function mint(address _to, uint256 _amount) external onlyRole(MINTER_ROLE) {
if (IL1StatusRead(status).isOriginalMintBurnPaused()) {
revert Paused();
}
if (maxTotalSupply != 0 && totalSupply() + _amount > maxTotalSupply) {
revert MaxSupplyOutOfBound();
}
_mint(_to, _amount);
}
// @notice Original burn when withdraw mETH.
function burn(address _from, uint256 _amount) external onlyRole(BURNER_ROLE) {
if (IL1StatusRead(status).isOriginalMintBurnPaused()) {
revert Paused();
}
_burn(_from, _amount);
}
/// @notice Sets the maxTotalSupply variable.
/// Note: We intentionally allow this to be set lower than the current totalSupply so that the amount can be
/// adjusted downwards by withdraw.
/// See also {maxTotalSupply}.
function setMaxTotalSupply(uint256 newMaxTotalSupply) external payable onlyRole(MANAGER_ROLE) {
maxTotalSupply = newMaxTotalSupply;
emit ProtocolConfigChanged(
this.setMaxTotalSupply.selector, "setMaxTotalSupply(uint256)", abi.encode(newMaxTotalSupply)
);
}
function setBlocklist(address _blocklist) external override onlyRole(MANAGER_ROLE) {
_setBlocklist(_blocklist);
}
function setSanctionsList(address _sanctionsList) external override onlyRole(MANAGER_ROLE) {
_setSanctionsList(_sanctionsList);
}
function _update(address from, address to, uint256 value) internal override {
if (IL1StatusRead(status).isTransferPaused()) {
revert Paused();
}
// Check constraints when `transferFrom` is called to facliitate
// a transfer between two parties that are not `from` or `to`.
if (from != msg.sender && to != msg.sender) {
require(!_isBlocked(msg.sender), "cmETH: 'sender' address blocked");
require(!_isSanctioned(msg.sender), "cmETH: 'sender' address sanctioned");
}
if (from != address(0)) {
// If not minting
require(!_isBlocked(from), "cmETH: 'from' address blocked");
require(!_isSanctioned(from), "cmETH: 'from' address sanctioned");
}
if (to != address(0)) {
// If not burning
require(!_isBlocked(to), "cmETH: 'to' address blocked");
require(!_isSanctioned(to), "cmETH: 'to' address sanctioned");
}
super._update(from, to, value);
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;
import {IERC20} from "../interfaces/IERC20.sol";
/// @notice This is a mock contract of the ERC20 standard for testing purposes only, it SHOULD NOT be used in production.
/// @dev Forked from: https://github.com/transmissions11/solmate/blob/0384dbaaa4fcb5715738a9254a7c0a4cb62cf458/src/tokens/ERC20.sol
contract MockERC20 is IERC20 {
/*//////////////////////////////////////////////////////////////
METADATA STORAGE
//////////////////////////////////////////////////////////////*/
string internal _name;
string internal _symbol;
uint8 internal _decimals;
function name() external view override returns (string memory) {
return _name;
}
function symbol() external view override returns (string memory) {
return _symbol;
}
function decimals() external view override returns (uint8) {
return _decimals;
}
/*//////////////////////////////////////////////////////////////
ERC20 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 internal _totalSupply;
mapping(address => uint256) internal _balanceOf;
mapping(address => mapping(address => uint256)) internal _allowance;
function totalSupply() external view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address owner) external view override returns (uint256) {
return _balanceOf[owner];
}
function allowance(address owner, address spender) external view override returns (uint256) {
return _allowance[owner][spender];
}
/*//////////////////////////////////////////////////////////////
EIP-2612 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 internal INITIAL_CHAIN_ID;
bytes32 internal INITIAL_DOMAIN_SEPARATOR;
mapping(address => uint256) public nonces;
/*//////////////////////////////////////////////////////////////
INITIALIZE
//////////////////////////////////////////////////////////////*/
/// @dev A bool to track whether the contract has been initialized.
bool private initialized;
/// @dev To hide constructor warnings across solc versions due to different constructor visibility requirements and
/// syntaxes, we add an initialization function that can be called only once.
function initialize(string memory name_, string memory symbol_, uint8 decimals_) public {
require(!initialized, "ALREADY_INITIALIZED");
_name = name_;
_symbol = symbol_;
_decimals = decimals_;
INITIAL_CHAIN_ID = _pureChainId();
INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
initialized = true;
}
/*//////////////////////////////////////////////////////////////
ERC20 LOGIC
//////////////////////////////////////////////////////////////*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address to, uint256 amount) public virtual override returns (bool) {
_balanceOf[msg.sender] = _sub(_balanceOf[msg.sender], amount);
_balanceOf[to] = _add(_balanceOf[to], amount);
emit Transfer(msg.sender, to, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
uint256 allowed = _allowance[from][msg.sender]; // Saves gas for limited approvals.
if (allowed != ~uint256(0)) _allowance[from][msg.sender] = _sub(allowed, amount);
_balanceOf[from] = _sub(_balanceOf[from], amount);
_balanceOf[to] = _add(_balanceOf[to], amount);
emit Transfer(from, to, amount);
return true;
}
/*//////////////////////////////////////////////////////////////
EIP-2612 LOGIC
//////////////////////////////////////////////////////////////*/
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
public
virtual
{
require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");
address recoveredAddress = ecrecover(
keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR(),
keccak256(
abi.encode(
keccak256(
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
),
owner,
spender,
value,
nonces[owner]++,
deadline
)
)
)
),
v,
r,
s
);
require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");
_allowance[recoveredAddress][spender] = value;
emit Approval(owner, spender, value);
}
function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
return _pureChainId() == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
}
function computeDomainSeparator() internal view virtual returns (bytes32) {
return keccak256(
abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(_name)),
keccak256("1"),
_pureChainId(),
address(this)
)
);
}
/*//////////////////////////////////////////////////////////////
INTERNAL MINT/BURN LOGIC
//////////////////////////////////////////////////////////////*/
function _mint(address to, uint256 amount) internal virtual {
_totalSupply = _add(_totalSupply, amount);
_balanceOf[to] = _add(_balanceOf[to], amount);
emit Transfer(address(0), to, amount);
}
function _burn(address from, uint256 amount) internal virtual {
_balanceOf[from] = _sub(_balanceOf[from], amount);
_totalSupply = _sub(_totalSupply, amount);
emit Transfer(from, address(0), amount);
}
/*//////////////////////////////////////////////////////////////
INTERNAL SAFE MATH LOGIC
//////////////////////////////////////////////////////////////*/
function _add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ERC20: addition overflow");
return c;
}
function _sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(a >= b, "ERC20: subtraction underflow");
return a - b;
}
/*//////////////////////////////////////////////////////////////
HELPERS
//////////////////////////////////////////////////////////////*/
// We use this complex approach of `_viewChainId` and `_pureChainId` to ensure there are no
// compiler warnings when accessing chain ID in any solidity version supported by forge-std. We
// can't simply access the chain ID in a normal view or pure function because the solc View Pure
// Checker changed `chainid` from pure to view in 0.8.0.
function _viewChainId() private view returns (uint256 chainId) {
// Assembly required since `block.chainid` was introduced in 0.8.0.
assembly {
chainId := chainid()
}
address(this); // Silence warnings in older Solc versions.
}
function _pureChainId() private pure returns (uint256 chainId) {
function() internal view returns (uint256) fnIn = _viewChainId;
function() internal pure returns (uint256) pureChainId;
assembly {
pureChainId := fnIn
}
chainId = pureChainId();
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;
import {IERC721Metadata, IERC721TokenReceiver} from "../interfaces/IERC721.sol";
/// @notice This is a mock contract of the ERC721 standard for testing purposes only, it SHOULD NOT be used in production.
/// @dev Forked from: https://github.com/transmissions11/solmate/blob/0384dbaaa4fcb5715738a9254a7c0a4cb62cf458/src/tokens/ERC721.sol
contract MockERC721 is IERC721Metadata {
/*//////////////////////////////////////////////////////////////
METADATA STORAGE/LOGIC
//////////////////////////////////////////////////////////////*/
string internal _name;
string internal _symbol;
function name() external view override returns (string memory) {
return _name;
}
function symbol() external view override returns (string memory) {
return _symbol;
}
function tokenURI(uint256 id) public view virtual override returns (string memory) {}
/*//////////////////////////////////////////////////////////////
ERC721 BALANCE/OWNER STORAGE
//////////////////////////////////////////////////////////////*/
mapping(uint256 => address) internal _ownerOf;
mapping(address => uint256) internal _balanceOf;
function ownerOf(uint256 id) public view virtual override returns (address owner) {
require((owner = _ownerOf[id]) != address(0), "NOT_MINTED");
}
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ZERO_ADDRESS");
return _balanceOf[owner];
}
/*//////////////////////////////////////////////////////////////
ERC721 APPROVAL STORAGE
//////////////////////////////////////////////////////////////*/
mapping(uint256 => address) internal _getApproved;
mapping(address => mapping(address => bool)) internal _isApprovedForAll;
function getApproved(uint256 id) public view virtual override returns (address) {
return _getApproved[id];
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _isApprovedForAll[owner][operator];
}
/*//////////////////////////////////////////////////////////////
INITIALIZE
//////////////////////////////////////////////////////////////*/
/// @dev A bool to track whether the contract has been initialized.
bool private initialized;
/// @dev To hide constructor warnings across solc versions due to different constructor visibility requirements and
/// syntaxes, we add an initialization function that can be called only once.
function initialize(string memory name_, string memory symbol_) public {
require(!initialized, "ALREADY_INITIALIZED");
_name = name_;
_symbol = symbol_;
initialized = true;
}
/*//////////////////////////////////////////////////////////////
ERC721 LOGIC
//////////////////////////////////////////////////////////////*/
function approve(address spender, uint256 id) public payable virtual override {
address owner = _ownerOf[id];
require(msg.sender == owner || _isApprovedForAll[owner][msg.sender], "NOT_AUTHORIZED");
_getApproved[id] = spender;
emit Approval(owner, spender, id);
}
function setApprovalForAll(address operator, bool approved) public virtual override {
_isApprovedForAll[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
}
function transferFrom(address from, address to, uint256 id) public payable virtual override {
require(from == _ownerOf[id], "WRONG_FROM");
require(to != address(0), "INVALID_RECIPIENT");
require(
msg.sender == from || _isApprovedForAll[from][msg.sender] || msg.sender == _getApproved[id],
"NOT_AUTHORIZED"
);
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
_balanceOf[from]--;
_balanceOf[to]++;
_ownerOf[id] = to;
delete _getApproved[id];
emit Transfer(from, to, id);
}
function safeTransferFrom(address from, address to, uint256 id) public payable virtual override {
transferFrom(from, to, id);
require(
!_isContract(to)
|| IERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, "")
== IERC721TokenReceiver.onERC721Received.selector,
"UNSAFE_RECIPIENT"
);
}
function safeTransferFrom(address from, address to, uint256 id, bytes memory data)
public
payable
virtual
override
{
transferFrom(from, to, id);
require(
!_isContract(to)
|| IERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, data)
== IERC721TokenReceiver.onERC721Received.selector,
"UNSAFE_RECIPIENT"
);
}
/*//////////////////////////////////////////////////////////////
ERC165 LOGIC
//////////////////////////////////////////////////////////////*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == 0x01ffc9a7 // ERC165 Interface ID for ERC165
|| interfaceId == 0x80ac58cd // ERC165 Interface ID for ERC721
|| interfaceId == 0x5b5e139f; // ERC165 Interface ID for ERC721Metadata
}
/*//////////////////////////////////////////////////////////////
INTERNAL MINT/BURN LOGIC
//////////////////////////////////////////////////////////////*/
function _mint(address to, uint256 id) internal virtual {
require(to != address(0), "INVALID_RECIPIENT");
require(_ownerOf[id] == address(0), "ALREADY_MINTED");
// Counter overflow is incredibly unrealistic.
_balanceOf[to]++;
_ownerOf[id] = to;
emit Transfer(address(0), to, id);
}
function _burn(uint256 id) internal virtual {
address owner = _ownerOf[id];
require(owner != address(0), "NOT_MINTED");
_balanceOf[owner]--;
delete _ownerOf[id];
delete _getApproved[id];
emit Transfer(owner, address(0), id);
}
/*//////////////////////////////////////////////////////////////
INTERNAL SAFE MINT LOGIC
//////////////////////////////////////////////////////////////*/
function _safeMint(address to, uint256 id) internal virtual {
_mint(to, id);
require(
!_isContract(to)
|| IERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, "")
== IERC721TokenReceiver.onERC721Received.selector,
"UNSAFE_RECIPIENT"
);
}
function _safeMint(address to, uint256 id, bytes memory data) internal virtual {
_mint(to, id);
require(
!_isContract(to)
|| IERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, data)
== IERC721TokenReceiver.onERC721Received.selector,
"UNSAFE_RECIPIENT"
);
}
/*//////////////////////////////////////////////////////////////
HELPERS
//////////////////////////////////////////////////////////////*/
function _isContract(address _addr) private view returns (bool) {
uint256 codeLength;
// Assembly required for versions < 0.8.0 to check extcodesize.
assembly {
codeLength := extcodesize(_addr)
}
return codeLength > 0;
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface ProtocolEvents {
/// @notice Emitted when a protocol configuration has been updated.
/// @param setterSelector The selector of the function that updated the configuration.
/// @param setterSignature The signature of the function that updated the configuration.
/// @param value The abi-encoded data passed to the function that updated the configuration. Since this event will
/// only be emitted by setters, this data corresponds to the updated values in the protocol configuration.
event ProtocolConfigChanged(bytes4 indexed setterSelector, string setterSignature, bytes value);
}
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Gas optimized reentrancy protection for smart contracts.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ReentrancyGuard.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol)
abstract contract ReentrancyGuard {
uint256 private locked = 1;
modifier nonReentrant() virtual {
require(locked == 1, "REENTRANCY");
locked = 2;
_;
locked = 1;
}
}
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import {ERC20} from "../tokens/ERC20.sol";
/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
/*//////////////////////////////////////////////////////////////
ETH OPERATIONS
//////////////////////////////////////////////////////////////*/
function safeTransferETH(address to, uint256 amount) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
// Transfer the ETH and store if it succeeded or not.
success := call(gas(), to, amount, 0, 0, 0, 0)
}
require(success, "ETH_TRANSFER_FAILED");
}
/*//////////////////////////////////////////////////////////////
ERC20 OPERATIONS
//////////////////////////////////////////////////////////////*/
function safeTransferFrom(
ERC20 token,
address from,
address to,
uint256 amount
) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
// Get a pointer to some free memory.
let freeMemoryPointer := mload(0x40)
// Write the abi-encoded calldata into memory, beginning with the function selector.
mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "from" argument.
mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.
success := and(
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
// We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
// We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
// Counterintuitively, this call must be positioned second to the or() call in the
// surrounding and() call or else returndatasize() will be zero during the computation.
call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
)
}
require(success, "TRANSFER_FROM_FAILED");
}
function safeTransfer(
ERC20 token,
address to,
uint256 amount
) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
// Get a pointer to some free memory.
let freeMemoryPointer := mload(0x40)
// Write the abi-encoded calldata into memory, beginning with the function selector.
mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.
success := and(
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
// We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
// We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
// Counterintuitively, this call must be positioned second to the or() call in the
// surrounding and() call or else returndatasize() will be zero during the computation.
call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
)
}
require(success, "TRANSFER_FAILED");
}
function safeApprove(
ERC20 token,
address to,
uint256 amount
) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
// Get a pointer to some free memory.
let freeMemoryPointer := mload(0x40)
// Write the abi-encoded calldata into memory, beginning with the function selector.
mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.
success := and(
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
// We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
// We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
// Counterintuitively, this call must be positioned second to the or() call in the
// surrounding and() call or else returndatasize() will be zero during the computation.
call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
)
}
require(success, "APPROVE_FAILED");
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;
pragma experimental ABIEncoderV2;
import {Vm} from "./Vm.sol";
abstract contract StdAssertions {
Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
event log(string);
event logs(bytes);
event log_address(address);
event log_bytes32(bytes32);
event log_int(int256);
event log_uint(uint256);
event log_bytes(bytes);
event log_string(string);
event log_named_address(string key, address val);
event log_named_bytes32(string key, bytes32 val);
event log_named_decimal_int(string key, int256 val, uint256 decimals);
event log_named_decimal_uint(string key, uint256 val, uint256 decimals);
event log_named_int(string key, int256 val);
event log_named_uint(string key, uint256 val);
event log_named_bytes(string key, bytes val);
event log_named_string(string key, string val);
event log_array(uint256[] val);
event log_array(int256[] val);
event log_array(address[] val);
event log_named_array(string key, uint256[] val);
event log_named_array(string key, int256[] val);
event log_named_array(string key, address[] val);
bool private _failed;
function failed() public view returns (bool) {
if (_failed) {
return _failed;
} else {
return vm.load(address(vm), bytes32("failed")) != bytes32(0);
}
}
function fail() internal virtual {
vm.store(address(vm), bytes32("failed"), bytes32(uint256(1)));
_failed = true;
}
function assertTrue(bool data) internal pure virtual {
vm.assertTrue(data);
}
function assertTrue(bool data, string memory err) internal pure virtual {
vm.assertTrue(data, err);
}
function assertFalse(bool data) internal pure virtual {
vm.assertFalse(data);
}
function assertFalse(bool data, string memory err) internal pure virtual {
vm.assertFalse(data, err);
}
function assertEq(bool left, bool right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(bool left, bool right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
function assertEq(uint256 left, uint256 right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(uint256 left, uint256 right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
function assertEqDecimal(uint256 left, uint256 right, uint256 decimals) internal pure virtual {
vm.assertEqDecimal(left, right, decimals);
}
function assertEqDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal pure virtual {
vm.assertEqDecimal(left, right, decimals, err);
}
function assertEq(int256 left, int256 right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(int256 left, int256 right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
function assertEqDecimal(int256 left, int256 right, uint256 decimals) internal pure virtual {
vm.assertEqDecimal(left, right, decimals);
}
function assertEqDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal pure virtual {
vm.assertEqDecimal(left, right, decimals, err);
}
function assertEq(address left, address right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(address left, address right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
function assertEq(bytes32 left, bytes32 right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(bytes32 left, bytes32 right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
function assertEq32(bytes32 left, bytes32 right) internal pure virtual {
assertEq(left, right);
}
function assertEq32(bytes32 left, bytes32 right, string memory err) internal pure virtual {
assertEq(left, right, err);
}
function assertEq(string memory left, string memory right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(string memory left, string memory right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
function assertEq(bytes memory left, bytes memory right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(bytes memory left, bytes memory right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
function assertEq(bool[] memory left, bool[] memory right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(bool[] memory left, bool[] memory right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
function assertEq(uint256[] memory left, uint256[] memory right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(uint256[] memory left, uint256[] memory right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
function assertEq(int256[] memory left, int256[] memory right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(int256[] memory left, int256[] memory right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
function assertEq(address[] memory left, address[] memory right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(address[] memory left, address[] memory right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
function assertEq(bytes32[] memory left, bytes32[] memory right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(bytes32[] memory left, bytes32[] memory right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
function assertEq(string[] memory left, string[] memory right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(string[] memory left, string[] memory right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
function assertEq(bytes[] memory left, bytes[] memory right) internal pure virtual {
vm.assertEq(left, right);
}
function assertEq(bytes[] memory left, bytes[] memory right, string memory err) internal pure virtual {
vm.assertEq(left, right, err);
}
// Legacy helper
function assertEqUint(uint256 left, uint256 right) internal pure virtual {
assertEq(left, right);
}
function assertNotEq(bool left, bool right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(bool left, bool right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertNotEq(uint256 left, uint256 right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(uint256 left, uint256 right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertNotEqDecimal(uint256 left, uint256 right, uint256 decimals) internal pure virtual {
vm.assertNotEqDecimal(left, right, decimals);
}
function assertNotEqDecimal(uint256 left, uint256 right, uint256 decimals, string memory err)
internal
pure
virtual
{
vm.assertNotEqDecimal(left, right, decimals, err);
}
function assertNotEq(int256 left, int256 right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(int256 left, int256 right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertNotEqDecimal(int256 left, int256 right, uint256 decimals) internal pure virtual {
vm.assertNotEqDecimal(left, right, decimals);
}
function assertNotEqDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal pure virtual {
vm.assertNotEqDecimal(left, right, decimals, err);
}
function assertNotEq(address left, address right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(address left, address right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertNotEq(bytes32 left, bytes32 right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(bytes32 left, bytes32 right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertNotEq32(bytes32 left, bytes32 right) internal pure virtual {
assertNotEq(left, right);
}
function assertNotEq32(bytes32 left, bytes32 right, string memory err) internal pure virtual {
assertNotEq(left, right, err);
}
function assertNotEq(string memory left, string memory right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(string memory left, string memory right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertNotEq(bytes memory left, bytes memory right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(bytes memory left, bytes memory right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertNotEq(bool[] memory left, bool[] memory right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(bool[] memory left, bool[] memory right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertNotEq(uint256[] memory left, uint256[] memory right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(uint256[] memory left, uint256[] memory right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertNotEq(int256[] memory left, int256[] memory right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(int256[] memory left, int256[] memory right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertNotEq(address[] memory left, address[] memory right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(address[] memory left, address[] memory right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertNotEq(bytes32[] memory left, bytes32[] memory right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(bytes32[] memory left, bytes32[] memory right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertNotEq(string[] memory left, string[] memory right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(string[] memory left, string[] memory right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertNotEq(bytes[] memory left, bytes[] memory right) internal pure virtual {
vm.assertNotEq(left, right);
}
function assertNotEq(bytes[] memory left, bytes[] memory right, string memory err) internal pure virtual {
vm.assertNotEq(left, right, err);
}
function assertLt(uint256 left, uint256 right) internal pure virtual {
vm.assertLt(left, right);
}
function assertLt(uint256 left, uint256 right, string memory err) internal pure virtual {
vm.assertLt(left, right, err);
}
function assertLtDecimal(uint256 left, uint256 right, uint256 decimals) internal pure virtual {
vm.assertLtDecimal(left, right, decimals);
}
function assertLtDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal pure virtual {
vm.assertLtDecimal(left, right, decimals, err);
}
function assertLt(int256 left, int256 right) internal pure virtual {
vm.assertLt(left, right);
}
function assertLt(int256 left, int256 right, string memory err) internal pure virtual {
vm.assertLt(left, right, err);
}
function assertLtDecimal(int256 left, int256 right, uint256 decimals) internal pure virtual {
vm.assertLtDecimal(left, right, decimals);
}
function assertLtDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal pure virtual {
vm.assertLtDecimal(left, right, decimals, err);
}
function assertGt(uint256 left, uint256 right) internal pure virtual {
vm.assertGt(left, right);
}
function assertGt(uint256 left, uint256 right, string memory err) internal pure virtual {
vm.assertGt(left, right, err);
}
function assertGtDecimal(uint256 left, uint256 right, uint256 decimals) internal pure virtual {
vm.assertGtDecimal(left, right, decimals);
}
function assertGtDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal pure virtual {
vm.assertGtDecimal(left, right, decimals, err);
}
function assertGt(int256 left, int256 right) internal pure virtual {
vm.assertGt(left, right);
}
function assertGt(int256 left, int256 right, string memory err) internal pure virtual {
vm.assertGt(left, right, err);
}
function assertGtDecimal(int256 left, int256 right, uint256 decimals) internal pure virtual {
vm.assertGtDecimal(left, right, decimals);
}
function assertGtDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal pure virtual {
vm.assertGtDecimal(left, right, decimals, err);
}
function assertLe(uint256 left, uint256 right) internal pure virtual {
vm.assertLe(left, right);
}
function assertLe(uint256 left, uint256 right, string memory err) internal pure virtual {
vm.assertLe(left, right, err);
}
function assertLeDecimal(uint256 left, uint256 right, uint256 decimals) internal pure virtual {
vm.assertLeDecimal(left, right, decimals);
}
function assertLeDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal pure virtual {
vm.assertLeDecimal(left, right, decimals, err);
}
function assertLe(int256 left, int256 right) internal pure virtual {
vm.assertLe(left, right);
}
function assertLe(int256 left, int256 right, string memory err) internal pure virtual {
vm.assertLe(left, right, err);
}
function assertLeDecimal(int256 left, int256 right, uint256 decimals) internal pure virtual {
vm.assertLeDecimal(left, right, decimals);
}
function assertLeDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal pure virtual {
vm.assertLeDecimal(left, right, decimals, err);
}
function assertGe(uint256 left, uint256 right) internal pure virtual {
vm.assertGe(left, right);
}
function assertGe(uint256 left, uint256 right, string memory err) internal pure virtual {
vm.assertGe(left, right, err);
}
function assertGeDecimal(uint256 left, uint256 right, uint256 decimals) internal pure virtual {
vm.assertGeDecimal(left, right, decimals);
}
function assertGeDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal pure virtual {
vm.assertGeDecimal(left, right, decimals, err);
}
function assertGe(int256 left, int256 right) internal pure virtual {
vm.assertGe(left, right);
}
function assertGe(int256 left, int256 right, string memory err) internal pure virtual {
vm.assertGe(left, right, err);
}
function assertGeDecimal(int256 left, int256 right, uint256 decimals) internal pure virtual {
vm.assertGeDecimal(left, right, decimals);
}
function assertGeDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal pure virtual {
vm.assertGeDecimal(left, right, decimals, err);
}
function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta) internal pure virtual {
vm.assertApproxEqAbs(left, right, maxDelta);
}
function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta, string memory err)
internal
pure
virtual
{
vm.assertApproxEqAbs(left, right, maxDelta, err);
}
function assertApproxEqAbsDecimal(uint256 left, uint256 right, uint256 maxDelta, uint256 decimals)
internal
pure
virtual
{
vm.assertApproxEqAbsDecimal(left, right, maxDelta, decimals);
}
function assertApproxEqAbsDecimal(
uint256 left,
uint256 right,
uint256 maxDelta,
uint256 decimals,
string memory err
) internal pure virtual {
vm.assertApproxEqAbsDecimal(left, right, maxDelta, decimals, err);
}
function assertApproxEqAbs(int256 left, int256 right, uint256 maxDelta) internal pure virtual {
vm.assertApproxEqAbs(left, right, maxDelta);
}
function assertApproxEqAbs(int256 left, int256 right, uint256 maxDelta, string memory err) internal pure virtual {
vm.assertApproxEqAbs(left, right, maxDelta, err);
}
function assertApproxEqAbsDecimal(int256 left, int256 right, uint256 maxDelta, uint256 decimals)
internal
pure
virtual
{
vm.assertApproxEqAbsDecimal(left, right, maxDelta, decimals);
}
function assertApproxEqAbsDecimal(int256 left, int256 right, uint256 maxDelta, uint256 decimals, string memory err)
internal
pure
virtual
{
vm.assertApproxEqAbsDecimal(left, right, maxDelta, decimals, err);
}
function assertApproxEqRel(
uint256 left,
uint256 right,
uint256 maxPercentDelta // An 18 decimal fixed point number, where 1e18 == 100%
) internal pure virtual {
vm.assertApproxEqRel(left, right, maxPercentDelta);
}
function assertApproxEqRel(
uint256 left,
uint256 right,
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
string memory err
) internal pure virtual {
vm.assertApproxEqRel(left, right, maxPercentDelta, err);
}
function assertApproxEqRelDecimal(
uint256 left,
uint256 right,
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
uint256 decimals
) internal pure virtual {
vm.assertApproxEqRelDecimal(left, right, maxPercentDelta, decimals);
}
function assertApproxEqRelDecimal(
uint256 left,
uint256 right,
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
uint256 decimals,
string memory err
) internal pure virtual {
vm.assertApproxEqRelDecimal(left, right, maxPercentDelta, decimals, err);
}
function assertApproxEqRel(int256 left, int256 right, uint256 maxPercentDelta) internal pure virtual {
vm.assertApproxEqRel(left, right, maxPercentDelta);
}
function assertApproxEqRel(
int256 left,
int256 right,
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
string memory err
) internal pure virtual {
vm.assertApproxEqRel(left, right, maxPercentDelta, err);
}
function assertApproxEqRelDecimal(
int256 left,
int256 right,
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
uint256 decimals
) internal pure virtual {
vm.assertApproxEqRelDecimal(left, right, maxPercentDelta, decimals);
}
function assertApproxEqRelDecimal(
int256 left,
int256 right,
uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100%
uint256 decimals,
string memory err
) internal pure virtual {
vm.assertApproxEqRelDecimal(left, right, maxPercentDelta, decimals, err);
}
// Inherited from DSTest, not used but kept for backwards-compatibility
function checkEq0(bytes memory left, bytes memory right) internal pure returns (bool) {
return keccak256(left) == keccak256(right);
}
function assertEq0(bytes memory left, bytes memory right) internal pure virtual {
assertEq(left, right);
}
function assertEq0(bytes memory left, bytes memory right, string memory err) internal pure virtual {
assertEq(left, right, err);
}
function assertNotEq0(bytes memory left, bytes memory right) internal pure virtual {
assertNotEq(left, right);
}
function assertNotEq0(bytes memory left, bytes memory right, string memory err) internal pure virtual {
assertNotEq(left, right, err);
}
function assertEqCall(address target, bytes memory callDataA, bytes memory callDataB) internal virtual {
assertEqCall(target, callDataA, target, callDataB, true);
}
function assertEqCall(address targetA, bytes memory callDataA, address targetB, bytes memory callDataB)
internal
virtual
{
assertEqCall(targetA, callDataA, targetB, callDataB, true);
}
function assertEqCall(address target, bytes memory callDataA, bytes memory callDataB, bool strictRevertData)
internal
virtual
{
assertEqCall(target, callDataA, target, callDataB, strictRevertData);
}
function assertEqCall(
address targetA,
bytes memory callDataA,
address targetB,
bytes memory callDataB,
bool strictRevertData
) internal virtual {
(bool successA, bytes memory returnDataA) = address(targetA).call(callDataA);
(bool successB, bytes memory returnDataB) = address(targetB).call(callDataB);
if (successA && successB) {
assertEq(returnDataA, returnDataB, "Call return data does not match");
}
if (!successA && !successB && strictRevertData) {
assertEq(returnDataA, returnDataB, "Call revert data does not match");
}
if (!successA && successB) {
emit log("Error: Calls were not equal");
emit log_named_bytes(" Left call revert data", returnDataA);
emit log_named_bytes(" Right call return data", returnDataB);
revert("assertion failed");
}
if (successA && !successB) {
emit log("Error: Calls were not equal");
emit log_named_bytes(" Left call return data", returnDataA);
emit log_named_bytes(" Right call revert data", returnDataB);
revert("assertion failed");
}
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;
import {VmSafe} from "./Vm.sol";
/**
* StdChains provides information about EVM compatible chains that can be used in scripts/tests.
* For each chain, the chain's name, chain ID, and a default RPC URL are provided. Chains are
* identified by their alias, which is the same as the alias in the `[rpc_endpoints]` section of
* the `foundry.toml` file. For best UX, ensure the alias in the `foundry.toml` file match the
* alias used in this contract, which can be found as the first argument to the
* `setChainWithDefaultRpcUrl` call in the `initializeStdChains` function.
*
* There are two main ways to use this contract:
* 1. Set a chain with `setChain(string memory chainAlias, ChainData memory chain)` or
* `setChain(string memory chainAlias, Chain memory chain)`
* 2. Get a chain with `getChain(string memory chainAlias)` or `getChain(uint256 chainId)`.
*
* The first time either of those are used, chains are initialized with the default set of RPC URLs.
* This is done in `initializeStdChains`, which uses `setChainWithDefaultRpcUrl`. Defaults are recorded in
* `defaultRpcUrls`.
*
* The `setChain` function is straightforward, and it simply saves off the given chain data.
*
* The `getChain` methods use `getChainWithUpdatedRpcUrl` to return a chain. For example, let's say
* we want to retrieve the RPC URL for `mainnet`:
* - If you have specified data with `setChain`, it will return that.
* - If you have configured a mainnet RPC URL in `foundry.toml`, it will return the URL, provided it
* is valid (e.g. a URL is specified, or an environment variable is given and exists).
* - If neither of the above conditions is met, the default data is returned.
*
* Summarizing the above, the prioritization hierarchy is `setChain` -> `foundry.toml` -> environment variable -> defaults.
*/
abstract contract StdChains {
VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code")))));
bool private stdChainsInitialized;
struct ChainData {
string name;
uint256 chainId;
string rpcUrl;
}
struct Chain {
// The chain name.
string name;
// The chain's Chain ID.
uint256 chainId;
// The chain's alias. (i.e. what gets specified in `foundry.toml`).
string chainAlias;
// A default RPC endpoint for this chain.
// NOTE: This default RPC URL is included for convenience to facilitate quick tests and
// experimentation. Do not use this RPC URL for production test suites, CI, or other heavy
// usage as you will be throttled and this is a disservice to others who need this endpoint.
string rpcUrl;
}
// Maps from the chain's alias (matching the alias in the `foundry.toml` file) to chain data.
mapping(string => Chain) private chains;
// Maps from the chain's alias to it's default RPC URL.
mapping(string => string) private defaultRpcUrls;
// Maps from a chain ID to it's alias.
mapping(uint256 => string) private idToAlias;
bool private fallbackToDefaultRpcUrls = true;
// The RPC URL will be fetched from config or defaultRpcUrls if possible.
function getChain(string memory chainAlias) internal virtual returns (Chain memory chain) {
require(bytes(chainAlias).length != 0, "StdChains getChain(string): Chain alias cannot be the empty string.");
initializeStdChains();
chain = chains[chainAlias];
require(
chain.chainId != 0,
string(abi.encodePacked("StdChains getChain(string): Chain with alias \"", chainAlias, "\" not found."))
);
chain = getChainWithUpdatedRpcUrl(chainAlias, chain);
}
function getChain(uint256 chainId) internal virtual returns (Chain memory chain) {
require(chainId != 0, "StdChains getChain(uint256): Chain ID cannot be 0.");
initializeStdChains();
string memory chainAlias = idToAlias[chainId];
chain = chains[chainAlias];
require(
chain.chainId != 0,
string(abi.encodePacked("StdChains getChain(uint256): Chain with ID ", vm.toString(chainId), " not found."))
);
chain = getChainWithUpdatedRpcUrl(chainAlias, chain);
}
// set chain info, with priority to argument's rpcUrl field.
function setChain(string memory chainAlias, ChainData memory chain) internal virtual {
require(
bytes(chainAlias).length != 0,
"StdChains setChain(string,ChainData): Chain alias cannot be the empty string."
);
require(chain.chainId != 0, "StdChains setChain(string,ChainData): Chain ID cannot be 0.");
initializeStdChains();
string memory foundAlias = idToAlias[chain.chainId];
require(
bytes(foundAlias).length == 0 || keccak256(bytes(foundAlias)) == keccak256(bytes(chainAlias)),
string(
abi.encodePacked(
"StdChains setChain(string,ChainData): Chain ID ",
vm.toString(chain.chainId),
" already used by \"",
foundAlias,
"\"."
)
)
);
uint256 oldChainId = chains[chainAlias].chainId;
delete idToAlias[oldChainId];
chains[chainAlias] =
Chain({name: chain.name, chainId: chain.chainId, chainAlias: chainAlias, rpcUrl: chain.rpcUrl});
idToAlias[chain.chainId] = chainAlias;
}
// set chain info, with priority to argument's rpcUrl field.
function setChain(string memory chainAlias, Chain memory chain) internal virtual {
setChain(chainAlias, ChainData({name: chain.name, chainId: chain.chainId, rpcUrl: chain.rpcUrl}));
}
function _toUpper(string memory str) private pure returns (string memory) {
bytes memory strb = bytes(str);
bytes memory copy = new bytes(strb.length);
for (uint256 i = 0; i < strb.length; i++) {
bytes1 b = strb[i];
if (b >= 0x61 && b <= 0x7A) {
copy[i] = bytes1(uint8(b) - 32);
} else {
copy[i] = b;
}
}
return string(copy);
}
// lookup rpcUrl, in descending order of priority:
// current -> config (foundry.toml) -> environment variable -> default
function getChainWithUpdatedRpcUrl(string memory chainAlias, Chain memory chain)
private
view
returns (Chain memory)
{
if (bytes(chain.rpcUrl).length == 0) {
try vm.rpcUrl(chainAlias) returns (string memory configRpcUrl) {
chain.rpcUrl = configRpcUrl;
} catch (bytes memory err) {
string memory envName = string(abi.encodePacked(_toUpper(chainAlias), "_RPC_URL"));
if (fallbackToDefaultRpcUrls) {
chain.rpcUrl = vm.envOr(envName, defaultRpcUrls[chainAlias]);
} else {
chain.rpcUrl = vm.envString(envName);
}
// Distinguish 'not found' from 'cannot read'
// The upstream error thrown by forge for failing cheats changed so we check both the old and new versions
bytes memory oldNotFoundError =
abi.encodeWithSignature("CheatCodeError", string(abi.encodePacked("invalid rpc url ", chainAlias)));
bytes memory newNotFoundError = abi.encodeWithSignature(
"CheatcodeError(string)", string(abi.encodePacked("invalid rpc url: ", chainAlias))
);
bytes32 errHash = keccak256(err);
if (
(errHash != keccak256(oldNotFoundError) && errHash != keccak256(newNotFoundError))
|| bytes(chain.rpcUrl).length == 0
) {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, err), mload(err))
}
}
}
}
return chain;
}
function setFallbackToDefaultRpcUrls(bool useDefault) internal {
fallbackToDefaultRpcUrls = useDefault;
}
function initializeStdChains() private {
if (stdChainsInitialized) return;
stdChainsInitialized = true;
// If adding an RPC here, make sure to test the default RPC URL in `test_Rpcs` in `StdChains.t.sol`
setChainWithDefaultRpcUrl("anvil", ChainData("Anvil", 31337, "http://127.0.0.1:8545"));
setChainWithDefaultRpcUrl(
"mainnet", ChainData("Mainnet", 1, "https://eth-mainnet.alchemyapi.io/v2/pwc5rmJhrdoaSEfimoKEmsvOjKSmPDrP")
);
setChainWithDefaultRpcUrl(
"sepolia", ChainData("Sepolia", 11155111, "https://sepolia.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001")
);
setChainWithDefaultRpcUrl("holesky", ChainData("Holesky", 17000, "https://rpc.holesky.ethpandaops.io"));
setChainWithDefaultRpcUrl("optimism", ChainData("Optimism", 10, "https://mainnet.optimism.io"));
setChainWithDefaultRpcUrl(
"optimism_sepolia", ChainData("Optimism Sepolia", 11155420, "https://sepolia.optimism.io")
);
setChainWithDefaultRpcUrl("arbitrum_one", ChainData("Arbitrum One", 42161, "https://arb1.arbitrum.io/rpc"));
setChainWithDefaultRpcUrl(
"arbitrum_one_sepolia", ChainData("Arbitrum One Sepolia", 421614, "https://sepolia-rollup.arbitrum.io/rpc")
);
setChainWithDefaultRpcUrl("arbitrum_nova", ChainData("Arbitrum Nova", 42170, "https://nova.arbitrum.io/rpc"));
setChainWithDefaultRpcUrl("polygon", ChainData("Polygon", 137, "https://polygon-rpc.com"));
setChainWithDefaultRpcUrl(
"polygon_amoy", ChainData("Polygon Amoy", 80002, "https://rpc-amoy.polygon.technology")
);
setChainWithDefaultRpcUrl("avalanche", ChainData("Avalanche", 43114, "https://api.avax.network/ext/bc/C/rpc"));
setChainWithDefaultRpcUrl(
"avalanche_fuji", ChainData("Avalanche Fuji", 43113, "https://api.avax-test.network/ext/bc/C/rpc")
);
setChainWithDefaultRpcUrl(
"bnb_smart_chain", ChainData("BNB Smart Chain", 56, "https://bsc-dataseed1.binance.org")
);
setChainWithDefaultRpcUrl(
"bnb_smart_chain_testnet",
ChainData("BNB Smart Chain Testnet", 97, "https://rpc.ankr.com/bsc_testnet_chapel")
);
setChainWithDefaultRpcUrl("gnosis_chain", ChainData("Gnosis Chain", 100, "https://rpc.gnosischain.com"));
setChainWithDefaultRpcUrl("moonbeam", ChainData("Moonbeam", 1284, "https://rpc.api.moonbeam.network"));
setChainWithDefaultRpcUrl(
"moonriver", ChainData("Moonriver", 1285, "https://rpc.api.moonriver.moonbeam.network")
);
setChainWithDefaultRpcUrl("moonbase", ChainData("Moonbase", 1287, "https://rpc.testnet.moonbeam.network"));
setChainWithDefaultRpcUrl("base_sepolia", ChainData("Base Sepolia", 84532, "https://sepolia.base.org"));
setChainWithDefaultRpcUrl("base", ChainData("Base", 8453, "https://mainnet.base.org"));
setChainWithDefaultRpcUrl("blast_sepolia", ChainData("Blast Sepolia", 168587773, "https://sepolia.blast.io"));
setChainWithDefaultRpcUrl("blast", ChainData("Blast", 81457, "https://rpc.blast.io"));
setChainWithDefaultRpcUrl("fantom_opera", ChainData("Fantom Opera", 250, "https://rpc.ankr.com/fantom/"));
setChainWithDefaultRpcUrl(
"fantom_opera_testnet", ChainData("Fantom Opera Testnet", 4002, "https://rpc.ankr.com/fantom_testnet/")
);
setChainWithDefaultRpcUrl("fraxtal", ChainData("Fraxtal", 252, "https://rpc.frax.com"));
setChainWithDefaultRpcUrl("fraxtal_testnet", ChainData("Fraxtal Testnet", 2522, "https://rpc.testnet.frax.com"));
setChainWithDefaultRpcUrl(
"berachain_bartio_testnet", ChainData("Berachain bArtio Testnet", 80084, "https://bartio.rpc.berachain.com")
);
}
// set chain info, with priority to chainAlias' rpc url in foundry.toml
function setChainWithDefaultRpcUrl(string memory chainAlias, ChainData memory chain) private {
string memory rpcUrl = chain.rpcUrl;
defaultRpcUrls[chainAlias] = rpcUrl;
chain.rpcUrl = "";
setChain(chainAlias, chain);
chain.rpcUrl = rpcUrl; // restore argument
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;
pragma experimental ABIEncoderV2;
import {StdStorage, stdStorage} from "./StdStorage.sol";
import {console2} from "./console2.sol";
import {Vm} from "./Vm.sol";
abstract contract StdCheatsSafe {
Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
uint256 private constant UINT256_MAX =
115792089237316195423570985008687907853269984665640564039457584007913129639935;
bool private gasMeteringOff;
// Data structures to parse Transaction objects from the broadcast artifact
// that conform to EIP1559. The Raw structs is what is parsed from the JSON
// and then converted to the one that is used by the user for better UX.
struct RawTx1559 {
string[] arguments;
address contractAddress;
string contractName;
// json value name = function
string functionSig;
bytes32 hash;
// json value name = tx
RawTx1559Detail txDetail;
// json value name = type
string opcode;
}
struct RawTx1559Detail {
AccessList[] accessList;
bytes data;
address from;
bytes gas;
bytes nonce;
address to;
bytes txType;
bytes value;
}
struct Tx1559 {
string[] arguments;
address contractAddress;
string contractName;
string functionSig;
bytes32 hash;
Tx1559Detail txDetail;
string opcode;
}
struct Tx1559Detail {
AccessList[] accessList;
bytes data;
address from;
uint256 gas;
uint256 nonce;
address to;
uint256 txType;
uint256 value;
}
// Data structures to parse Transaction objects from the broadcast artifact
// that DO NOT conform to EIP1559. The Raw structs is what is parsed from the JSON
// and then converted to the one that is used by the user for better UX.
struct TxLegacy {
string[] arguments;
address contractAddress;
string contractName;
string functionSig;
string hash;
string opcode;
TxDetailLegacy transaction;
}
struct TxDetailLegacy {
AccessList[] accessList;
uint256 chainId;
bytes data;
address from;
uint256 gas;
uint256 gasPrice;
bytes32 hash;
uint256 nonce;
bytes1 opcode;
bytes32 r;
bytes32 s;
uint256 txType;
address to;
uint8 v;
uint256 value;
}
struct AccessList {
address accessAddress;
bytes32[] storageKeys;
}
// Data structures to parse Receipt objects from the broadcast artifact.
// The Raw structs is what is parsed from the JSON
// and then converted to the one that is used by the user for better UX.
struct RawReceipt {
bytes32 blockHash;
bytes blockNumber;
address contractAddress;
bytes cumulativeGasUsed;
bytes effectiveGasPrice;
address from;
bytes gasUsed;
RawReceiptLog[] logs;
bytes logsBloom;
bytes status;
address to;
bytes32 transactionHash;
bytes transactionIndex;
}
struct Receipt {
bytes32 blockHash;
uint256 blockNumber;
address contractAddress;
uint256 cumulativeGasUsed;
uint256 effectiveGasPrice;
address from;
uint256 gasUsed;
ReceiptLog[] logs;
bytes logsBloom;
uint256 status;
address to;
bytes32 transactionHash;
uint256 transactionIndex;
}
// Data structures to parse the entire broadcast artifact, assuming the
// transactions conform to EIP1559.
struct EIP1559ScriptArtifact {
string[] libraries;
string path;
string[] pending;
Receipt[] receipts;
uint256 timestamp;
Tx1559[] transactions;
TxReturn[] txReturns;
}
struct RawEIP1559ScriptArtifact {
string[] libraries;
string path;
string[] pending;
RawReceipt[] receipts;
TxReturn[] txReturns;
uint256 timestamp;
RawTx1559[] transactions;
}
struct RawReceiptLog {
// json value = address
address logAddress;
bytes32 blockHash;
bytes blockNumber;
bytes data;
bytes logIndex;
bool removed;
bytes32[] topics;
bytes32 transactionHash;
bytes transactionIndex;
bytes transactionLogIndex;
}
struct ReceiptLog {
// json value = address
address logAddress;
bytes32 blockHash;
uint256 blockNumber;
bytes data;
uint256 logIndex;
bytes32[] topics;
uint256 transactionIndex;
uint256 transactionLogIndex;
bool removed;
}
struct TxReturn {
string internalType;
string value;
}
struct Account {
address addr;
uint256 key;
}
enum AddressType {
Payable,
NonPayable,
ZeroAddress,
Precompile,
ForgeAddress
}
// Checks that `addr` is not blacklisted by token contracts that have a blacklist.
function assumeNotBlacklisted(address token, address addr) internal view virtual {
// Nothing to check if `token` is not a contract.
uint256 tokenCodeSize;
assembly {
tokenCodeSize := extcodesize(token)
}
require(tokenCodeSize > 0, "StdCheats assumeNotBlacklisted(address,address): Token address is not a contract.");
bool success;
bytes memory returnData;
// 4-byte selector for `isBlacklisted(address)`, used by USDC.
(success, returnData) = token.staticcall(abi.encodeWithSelector(0xfe575a87, addr));
vm.assume(!success || abi.decode(returnData, (bool)) == false);
// 4-byte selector for `isBlackListed(address)`, used by USDT.
(success, returnData) = token.staticcall(abi.encodeWithSelector(0xe47d6060, addr));
vm.assume(!success || abi.decode(returnData, (bool)) == false);
}
// Checks that `addr` is not blacklisted by token contracts that have a blacklist.
// This is identical to `assumeNotBlacklisted(address,address)` but with a different name, for
// backwards compatibility, since this name was used in the original PR which has already has
// a release. This function can be removed in a future release once we want a breaking change.
function assumeNoBlacklisted(address token, address addr) internal view virtual {
assumeNotBlacklisted(token, addr);
}
function assumeAddressIsNot(address addr, AddressType addressType) internal virtual {
if (addressType == AddressType.Payable) {
assumeNotPayable(addr);
} else if (addressType == AddressType.NonPayable) {
assumePayable(addr);
} else if (addressType == AddressType.ZeroAddress) {
assumeNotZeroAddress(addr);
} else if (addressType == AddressType.Precompile) {
assumeNotPrecompile(addr);
} else if (addressType == AddressType.ForgeAddress) {
assumeNotForgeAddress(addr);
}
}
function assumeAddressIsNot(address addr, AddressType addressType1, AddressType addressType2) internal virtual {
assumeAddressIsNot(addr, addressType1);
assumeAddressIsNot(addr, addressType2);
}
function assumeAddressIsNot(
address addr,
AddressType addressType1,
AddressType addressType2,
AddressType addressType3
) internal virtual {
assumeAddressIsNot(addr, addressType1);
assumeAddressIsNot(addr, addressType2);
assumeAddressIsNot(addr, addressType3);
}
function assumeAddressIsNot(
address addr,
AddressType addressType1,
AddressType addressType2,
AddressType addressType3,
AddressType addressType4
) internal virtual {
assumeAddressIsNot(addr, addressType1);
assumeAddressIsNot(addr, addressType2);
assumeAddressIsNot(addr, addressType3);
assumeAddressIsNot(addr, addressType4);
}
// This function checks whether an address, `addr`, is payable. It works by sending 1 wei to
// `addr` and checking the `success` return value.
// NOTE: This function may result in state changes depending on the fallback/receive logic
// implemented by `addr`, which should be taken into account when this function is used.
function _isPayable(address addr) private returns (bool) {
require(
addr.balance < UINT256_MAX,
"StdCheats _isPayable(address): Balance equals max uint256, so it cannot receive any more funds"
);
uint256 origBalanceTest = address(this).balance;
uint256 origBalanceAddr = address(addr).balance;
vm.deal(address(this), 1);
(bool success,) = payable(addr).call{value: 1}("");
// reset balances
vm.deal(address(this), origBalanceTest);
vm.deal(addr, origBalanceAddr);
return success;
}
// NOTE: This function may result in state changes depending on the fallback/receive logic
// implemented by `addr`, which should be taken into account when this function is used. See the
// `_isPayable` method for more information.
function assumePayable(address addr) internal virtual {
vm.assume(_isPayable(addr));
}
function assumeNotPayable(address addr) internal virtual {
vm.assume(!_isPayable(addr));
}
function assumeNotZeroAddress(address addr) internal pure virtual {
vm.assume(addr != address(0));
}
function assumeNotPrecompile(address addr) internal pure virtual {
assumeNotPrecompile(addr, _pureChainId());
}
function assumeNotPrecompile(address addr, uint256 chainId) internal pure virtual {
// Note: For some chains like Optimism these are technically predeploys (i.e. bytecode placed at a specific
// address), but the same rationale for excluding them applies so we include those too.
// These should be present on all EVM-compatible chains.
vm.assume(addr < address(0x1) || addr > address(0x9));
// forgefmt: disable-start
if (chainId == 10 || chainId == 420) {
// https://github.com/ethereum-optimism/optimism/blob/eaa371a0184b56b7ca6d9eb9cb0a2b78b2ccd864/op-bindings/predeploys/addresses.go#L6-L21
vm.assume(addr < address(0x4200000000000000000000000000000000000000) || addr > address(0x4200000000000000000000000000000000000800));
} else if (chainId == 42161 || chainId == 421613) {
// https://developer.arbitrum.io/useful-addresses#arbitrum-precompiles-l2-same-on-all-arb-chains
vm.assume(addr < address(0x0000000000000000000000000000000000000064) || addr > address(0x0000000000000000000000000000000000000068));
} else if (chainId == 43114 || chainId == 43113) {
// https://github.com/ava-labs/subnet-evm/blob/47c03fd007ecaa6de2c52ea081596e0a88401f58/precompile/params.go#L18-L59
vm.assume(addr < address(0x0100000000000000000000000000000000000000) || addr > address(0x01000000000000000000000000000000000000ff));
vm.assume(addr < address(0x0200000000000000000000000000000000000000) || addr > address(0x02000000000000000000000000000000000000FF));
vm.assume(addr < address(0x0300000000000000000000000000000000000000) || addr > address(0x03000000000000000000000000000000000000Ff));
}
// forgefmt: disable-end
}
function assumeNotForgeAddress(address addr) internal pure virtual {
// vm, console, and Create2Deployer addresses
vm.assume(
addr != address(vm) && addr != 0x000000000000000000636F6e736F6c652e6c6f67
&& addr != 0x4e59b44847b379578588920cA78FbF26c0B4956C
);
}
function readEIP1559ScriptArtifact(string memory path)
internal
view
virtual
returns (EIP1559ScriptArtifact memory)
{
string memory data = vm.readFile(path);
bytes memory parsedData = vm.parseJson(data);
RawEIP1559ScriptArtifact memory rawArtifact = abi.decode(parsedData, (RawEIP1559ScriptArtifact));
EIP1559ScriptArtifact memory artifact;
artifact.libraries = rawArtifact.libraries;
artifact.path = rawArtifact.path;
artifact.timestamp = rawArtifact.timestamp;
artifact.pending = rawArtifact.pending;
artifact.txReturns = rawArtifact.txReturns;
artifact.receipts = rawToConvertedReceipts(rawArtifact.receipts);
artifact.transactions = rawToConvertedEIPTx1559s(rawArtifact.transactions);
return artifact;
}
function rawToConvertedEIPTx1559s(RawTx1559[] memory rawTxs) internal pure virtual returns (Tx1559[] memory) {
Tx1559[] memory txs = new Tx1559[](rawTxs.length);
for (uint256 i; i < rawTxs.length; i++) {
txs[i] = rawToConvertedEIPTx1559(rawTxs[i]);
}
return txs;
}
function rawToConvertedEIPTx1559(RawTx1559 memory rawTx) internal pure virtual returns (Tx1559 memory) {
Tx1559 memory transaction;
transaction.arguments = rawTx.arguments;
transaction.contractName = rawTx.contractName;
transaction.functionSig = rawTx.functionSig;
transaction.hash = rawTx.hash;
transaction.txDetail = rawToConvertedEIP1559Detail(rawTx.txDetail);
transaction.opcode = rawTx.opcode;
return transaction;
}
function rawToConvertedEIP1559Detail(RawTx1559Detail memory rawDetail)
internal
pure
virtual
returns (Tx1559Detail memory)
{
Tx1559Detail memory txDetail;
txDetail.data = rawDetail.data;
txDetail.from = rawDetail.from;
txDetail.to = rawDetail.to;
txDetail.nonce = _bytesToUint(rawDetail.nonce);
txDetail.txType = _bytesToUint(rawDetail.txType);
txDetail.value = _bytesToUint(rawDetail.value);
txDetail.gas = _bytesToUint(rawDetail.gas);
txDetail.accessList = rawDetail.accessList;
return txDetail;
}
function readTx1559s(string memory path) internal view virtual returns (Tx1559[] memory) {
string memory deployData = vm.readFile(path);
bytes memory parsedDeployData = vm.parseJson(deployData, ".transactions");
RawTx1559[] memory rawTxs = abi.decode(parsedDeployData, (RawTx1559[]));
return rawToConvertedEIPTx1559s(rawTxs);
}
function readTx1559(string memory path, uint256 index) internal view virtual returns (Tx1559 memory) {
string memory deployData = vm.readFile(path);
string memory key = string(abi.encodePacked(".transactions[", vm.toString(index), "]"));
bytes memory parsedDeployData = vm.parseJson(deployData, key);
RawTx1559 memory rawTx = abi.decode(parsedDeployData, (RawTx1559));
return rawToConvertedEIPTx1559(rawTx);
}
// Analogous to readTransactions, but for receipts.
function readReceipts(string memory path) internal view virtual returns (Receipt[] memory) {
string memory deployData = vm.readFile(path);
bytes memory parsedDeployData = vm.parseJson(deployData, ".receipts");
RawReceipt[] memory rawReceipts = abi.decode(parsedDeployData, (RawReceipt[]));
return rawToConvertedReceipts(rawReceipts);
}
function readReceipt(string memory path, uint256 index) internal view virtual returns (Receipt memory) {
string memory deployData = vm.readFile(path);
string memory key = string(abi.encodePacked(".receipts[", vm.toString(index), "]"));
bytes memory parsedDeployData = vm.parseJson(deployData, key);
RawReceipt memory rawReceipt = abi.decode(parsedDeployData, (RawReceipt));
return rawToConvertedReceipt(rawReceipt);
}
function rawToConvertedReceipts(RawReceipt[] memory rawReceipts) internal pure virtual returns (Receipt[] memory) {
Receipt[] memory receipts = new Receipt[](rawReceipts.length);
for (uint256 i; i < rawReceipts.length; i++) {
receipts[i] = rawToConvertedReceipt(rawReceipts[i]);
}
return receipts;
}
function rawToConvertedReceipt(RawReceipt memory rawReceipt) internal pure virtual returns (Receipt memory) {
Receipt memory receipt;
receipt.blockHash = rawReceipt.blockHash;
receipt.to = rawReceipt.to;
receipt.from = rawReceipt.from;
receipt.contractAddress = rawReceipt.contractAddress;
receipt.effectiveGasPrice = _bytesToUint(rawReceipt.effectiveGasPrice);
receipt.cumulativeGasUsed = _bytesToUint(rawReceipt.cumulativeGasUsed);
receipt.gasUsed = _bytesToUint(rawReceipt.gasUsed);
receipt.status = _bytesToUint(rawReceipt.status);
receipt.transactionIndex = _bytesToUint(rawReceipt.transactionIndex);
receipt.blockNumber = _bytesToUint(rawReceipt.blockNumber);
receipt.logs = rawToConvertedReceiptLogs(rawReceipt.logs);
receipt.logsBloom = rawReceipt.logsBloom;
receipt.transactionHash = rawReceipt.transactionHash;
return receipt;
}
function rawToConvertedReceiptLogs(RawReceiptLog[] memory rawLogs)
internal
pure
virtual
returns (ReceiptLog[] memory)
{
ReceiptLog[] memory logs = new ReceiptLog[](rawLogs.length);
for (uint256 i; i < rawLogs.length; i++) {
logs[i].logAddress = rawLogs[i].logAddress;
logs[i].blockHash = rawLogs[i].blockHash;
logs[i].blockNumber = _bytesToUint(rawLogs[i].blockNumber);
logs[i].data = rawLogs[i].data;
logs[i].logIndex = _bytesToUint(rawLogs[i].logIndex);
logs[i].topics = rawLogs[i].topics;
logs[i].transactionIndex = _bytesToUint(rawLogs[i].transactionIndex);
logs[i].transactionLogIndex = _bytesToUint(rawLogs[i].transactionLogIndex);
logs[i].removed = rawLogs[i].removed;
}
return logs;
}
// Deploy a contract by fetching the contract bytecode from
// the artifacts directory
// e.g. `deployCode(code, abi.encode(arg1,arg2,arg3))`
function deployCode(string memory what, bytes memory args) internal virtual returns (address addr) {
bytes memory bytecode = abi.encodePacked(vm.getCode(what), args);
/// @solidity memory-safe-assembly
assembly {
addr := create(0, add(bytecode, 0x20), mload(bytecode))
}
require(addr != address(0), "StdCheats deployCode(string,bytes): Deployment failed.");
}
function deployCode(string memory what) internal virtual returns (address addr) {
bytes memory bytecode = vm.getCode(what);
/// @solidity memory-safe-assembly
assembly {
addr := create(0, add(bytecode, 0x20), mload(bytecode))
}
require(addr != address(0), "StdCheats deployCode(string): Deployment failed.");
}
/// @dev deploy contract with value on construction
function deployCode(string memory what, bytes memory args, uint256 val) internal virtual returns (address addr) {
bytes memory bytecode = abi.encodePacked(vm.getCode(what), args);
/// @solidity memory-safe-assembly
assembly {
addr := create(val, add(bytecode, 0x20), mload(bytecode))
}
require(addr != address(0), "StdCheats deployCode(string,bytes,uint256): Deployment failed.");
}
function deployCode(string memory what, uint256 val) internal virtual returns (address addr) {
bytes memory bytecode = vm.getCode(what);
/// @solidity memory-safe-assembly
assembly {
addr := create(val, add(bytecode, 0x20), mload(bytecode))
}
require(addr != address(0), "StdCheats deployCode(string,uint256): Deployment failed.");
}
// creates a labeled address and the corresponding private key
function makeAddrAndKey(string memory name) internal virtual returns (address addr, uint256 privateKey) {
privateKey = uint256(keccak256(abi.encodePacked(name)));
addr = vm.addr(privateKey);
vm.label(addr, name);
}
// creates a labeled address
function makeAddr(string memory name) internal virtual returns (address addr) {
(addr,) = makeAddrAndKey(name);
}
// Destroys an account immediately, sending the balance to beneficiary.
// Destroying means: balance will be zero, code will be empty, and nonce will be 0
// This is similar to selfdestruct but not identical: selfdestruct destroys code and nonce
// only after tx ends, this will run immediately.
function destroyAccount(address who, address beneficiary) internal virtual {
uint256 currBalance = who.balance;
vm.etch(who, abi.encode());
vm.deal(who, 0);
vm.resetNonce(who);
uint256 beneficiaryBalance = beneficiary.balance;
vm.deal(beneficiary, currBalance + beneficiaryBalance);
}
// creates a struct containing both a labeled address and the corresponding private key
function makeAccount(string memory name) internal virtual returns (Account memory account) {
(account.addr, account.key) = makeAddrAndKey(name);
}
function deriveRememberKey(string memory mnemonic, uint32 index)
internal
virtual
returns (address who, uint256 privateKey)
{
privateKey = vm.deriveKey(mnemonic, index);
who = vm.rememberKey(privateKey);
}
function _bytesToUint(bytes memory b) private pure returns (uint256) {
require(b.length <= 32, "StdCheats _bytesToUint(bytes): Bytes length exceeds 32.");
return abi.decode(abi.encodePacked(new bytes(32 - b.length), b), (uint256));
}
function isFork() internal view virtual returns (bool status) {
try vm.activeFork() {
status = true;
} catch (bytes memory) {}
}
modifier skipWhenForking() {
if (!isFork()) {
_;
}
}
modifier skipWhenNotForking() {
if (isFork()) {
_;
}
}
modifier noGasMetering() {
vm.pauseGasMetering();
// To prevent turning gas monitoring back on with nested functions that use this modifier,
// we check if gasMetering started in the off position. If it did, we don't want to turn
// it back on until we exit the top level function that used the modifier
//
// i.e. funcA() noGasMetering { funcB() }, where funcB has noGasMetering as well.
// funcA will have `gasStartedOff` as false, funcB will have it as true,
// so we only turn metering back on at the end of the funcA
bool gasStartedOff = gasMeteringOff;
gasMeteringOff = true;
_;
// if gas metering was on when this modifier was called, turn it back on at the end
if (!gasStartedOff) {
gasMeteringOff = false;
vm.resumeGasMetering();
}
}
// We use this complex approach of `_viewChainId` and `_pureChainId` to ensure there are no
// compiler warnings when accessing chain ID in any solidity version supported by forge-std. We
// can't simply access the chain ID in a normal view or pure function because the solc View Pure
// Checker changed `chainid` from pure to view in 0.8.0.
function _viewChainId() private view returns (uint256 chainId) {
// Assembly required since `block.chainid` was introduced in 0.8.0.
assembly {
chainId := chainid()
}
address(this); // Silence warnings in older Solc versions.
}
function _pureChainId() private pure returns (uint256 chainId) {
function() internal view returns (uint256) fnIn = _viewChainId;
function() internal pure returns (uint256) pureChainId;
assembly {
pureChainId := fnIn
}
chainId = pureChainId();
}
}
// Wrappers around cheatcodes to avoid footguns
abstract contract StdCheats is StdCheatsSafe {
using stdStorage for StdStorage;
StdStorage private stdstore;
Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
address private constant CONSOLE2_ADDRESS = 0x000000000000000000636F6e736F6c652e6c6f67;
// Skip forward or rewind time by the specified number of seconds
function skip(uint256 time) internal virtual {
vm.warp(block.timestamp + time);
}
function rewind(uint256 time) internal virtual {
vm.warp(block.timestamp - time);
}
// Setup a prank from an address that has some ether
function hoax(address msgSender) internal virtual {
vm.deal(msgSender, 1 << 128);
vm.prank(msgSender);
}
function hoax(address msgSender, uint256 give) internal virtual {
vm.deal(msgSender, give);
vm.prank(msgSender);
}
function hoax(address msgSender, address origin) internal virtual {
vm.deal(msgSender, 1 << 128);
vm.prank(msgSender, origin);
}
function hoax(address msgSender, address origin, uint256 give) internal virtual {
vm.deal(msgSender, give);
vm.prank(msgSender, origin);
}
// Start perpetual prank from an address that has some ether
function startHoax(address msgSender) internal virtual {
vm.deal(msgSender, 1 << 128);
vm.startPrank(msgSender);
}
function startHoax(address msgSender, uint256 give) internal virtual {
vm.deal(msgSender, give);
vm.startPrank(msgSender);
}
// Start perpetual prank from an address that has some ether
// tx.origin is set to the origin parameter
function startHoax(address msgSender, address origin) internal virtual {
vm.deal(msgSender, 1 << 128);
vm.startPrank(msgSender, origin);
}
function startHoax(address msgSender, address origin, uint256 give) internal virtual {
vm.deal(msgSender, give);
vm.startPrank(msgSender, origin);
}
function changePrank(address msgSender) internal virtual {
console2_log_StdCheats("changePrank is deprecated. Please use vm.startPrank instead.");
vm.stopPrank();
vm.startPrank(msgSender);
}
function changePrank(address msgSender, address txOrigin) internal virtual {
vm.stopPrank();
vm.startPrank(msgSender, txOrigin);
}
// The same as Vm's `deal`
// Use the alternative signature for ERC20 tokens
function deal(address to, uint256 give) internal virtual {
vm.deal(to, give);
}
// Set the balance of an account for any ERC20 token
// Use the alternative signature to update `totalSupply`
function deal(address token, address to, uint256 give) internal virtual {
deal(token, to, give, false);
}
// Set the balance of an account for any ERC1155 token
// Use the alternative signature to update `totalSupply`
function dealERC1155(address token, address to, uint256 id, uint256 give) internal virtual {
dealERC1155(token, to, id, give, false);
}
function deal(address token, address to, uint256 give, bool adjust) internal virtual {
// get current balance
(, bytes memory balData) = token.staticcall(abi.encodeWithSelector(0x70a08231, to));
uint256 prevBal = abi.decode(balData, (uint256));
// update balance
stdstore.target(token).sig(0x70a08231).with_key(to).checked_write(give);
// update total supply
if (adjust) {
(, bytes memory totSupData) = token.staticcall(abi.encodeWithSelector(0x18160ddd));
uint256 totSup = abi.decode(totSupData, (uint256));
if (give < prevBal) {
totSup -= (prevBal - give);
} else {
totSup += (give - prevBal);
}
stdstore.target(token).sig(0x18160ddd).checked_write(totSup);
}
}
function dealERC1155(address token, address to, uint256 id, uint256 give, bool adjust) internal virtual {
// get current balance
(, bytes memory balData) = token.staticcall(abi.encodeWithSelector(0x00fdd58e, to, id));
uint256 prevBal = abi.decode(balData, (uint256));
// update balance
stdstore.target(token).sig(0x00fdd58e).with_key(to).with_key(id).checked_write(give);
// update total supply
if (adjust) {
(, bytes memory totSupData) = token.staticcall(abi.encodeWithSelector(0xbd85b039, id));
require(
totSupData.length != 0,
"StdCheats deal(address,address,uint,uint,bool): target contract is not ERC1155Supply."
);
uint256 totSup = abi.decode(totSupData, (uint256));
if (give < prevBal) {
totSup -= (prevBal - give);
} else {
totSup += (give - prevBal);
}
stdstore.target(token).sig(0xbd85b039).with_key(id).checked_write(totSup);
}
}
function dealERC721(address token, address to, uint256 id) internal virtual {
// check if token id is already minted and the actual owner.
(bool successMinted, bytes memory ownerData) = token.staticcall(abi.encodeWithSelector(0x6352211e, id));
require(successMinted, "StdCheats deal(address,address,uint,bool): id not minted.");
// get owner current balance
(, bytes memory fromBalData) =
token.staticcall(abi.encodeWithSelector(0x70a08231, abi.decode(ownerData, (address))));
uint256 fromPrevBal = abi.decode(fromBalData, (uint256));
// get new user current balance
(, bytes memory toBalData) = token.staticcall(abi.encodeWithSelector(0x70a08231, to));
uint256 toPrevBal = abi.decode(toBalData, (uint256));
// update balances
stdstore.target(token).sig(0x70a08231).with_key(abi.decode(ownerData, (address))).checked_write(--fromPrevBal);
stdstore.target(token).sig(0x70a08231).with_key(to).checked_write(++toPrevBal);
// update owner
stdstore.target(token).sig(0x6352211e).with_key(id).checked_write(to);
}
function deployCodeTo(string memory what, address where) internal virtual {
deployCodeTo(what, "", 0, where);
}
function deployCodeTo(string memory what, bytes memory args, address where) internal virtual {
deployCodeTo(what, args, 0, where);
}
function deployCodeTo(string memory what, bytes memory args, uint256 value, address where) internal virtual {
bytes memory creationCode = vm.getCode(what);
vm.etch(where, abi.encodePacked(creationCode, args));
(bool success, bytes memory runtimeBytecode) = where.call{value: value}("");
require(success, "StdCheats deployCodeTo(string,bytes,uint256,address): Failed to create runtime bytecode.");
vm.etch(where, runtimeBytecode);
}
// Used to prevent the compilation of console, which shortens the compilation time when console is not used elsewhere.
function console2_log_StdCheats(string memory p0) private view {
(bool status,) = address(CONSOLE2_ADDRESS).staticcall(abi.encodeWithSignature("log(string)", p0));
status;
}
}
// SPDX-License-Identifier: MIT
// Panics work for versions >=0.8.0, but we lowered the pragma to make this compatible with Test
pragma solidity >=0.6.2 <0.9.0;
library stdError {
bytes public constant assertionError = abi.encodeWithSignature("Panic(uint256)", 0x01);
bytes public constant arithmeticError = abi.encodeWithSignature("Panic(uint256)", 0x11);
bytes public constant divisionError = abi.encodeWithSignature("Panic(uint256)", 0x12);
bytes public constant enumConversionError = abi.encodeWithSignature("Panic(uint256)", 0x21);
bytes public constant encodeStorageError = abi.encodeWithSignature("Panic(uint256)", 0x22);
bytes public constant popError = abi.encodeWithSignature("Panic(uint256)", 0x31);
bytes public constant indexOOBError = abi.encodeWithSignature("Panic(uint256)", 0x32);
bytes public constant memOverflowError = abi.encodeWithSignature("Panic(uint256)", 0x41);
bytes public constant zeroVarError = abi.encodeWithSignature("Panic(uint256)", 0x51);
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;
pragma experimental ABIEncoderV2;
abstract contract StdInvariant {
struct FuzzSelector {
address addr;
bytes4[] selectors;
}
struct FuzzArtifactSelector {
string artifact;
bytes4[] selectors;
}
struct FuzzInterface {
address addr;
string[] artifacts;
}
address[] private _excludedContracts;
address[] private _excludedSenders;
address[] private _targetedContracts;
address[] private _targetedSenders;
string[] private _excludedArtifacts;
string[] private _targetedArtifacts;
FuzzArtifactSelector[] private _targetedArtifactSelectors;
FuzzSelector[] private _excludedSelectors;
FuzzSelector[] private _targetedSelectors;
FuzzInterface[] private _targetedInterfaces;
// Functions for users:
// These are intended to be called in tests.
function excludeContract(address newExcludedContract_) internal {
_excludedContracts.push(newExcludedContract_);
}
function excludeSelector(FuzzSelector memory newExcludedSelector_) internal {
_excludedSelectors.push(newExcludedSelector_);
}
function excludeSender(address newExcludedSender_) internal {
_excludedSenders.push(newExcludedSender_);
}
function excludeArtifact(string memory newExcludedArtifact_) internal {
_excludedArtifacts.push(newExcludedArtifact_);
}
function targetArtifact(string memory newTargetedArtifact_) internal {
_targetedArtifacts.push(newTargetedArtifact_);
}
function targetArtifactSelector(FuzzArtifactSelector memory newTargetedArtifactSelector_) internal {
_targetedArtifactSelectors.push(newTargetedArtifactSelector_);
}
function targetContract(address newTargetedContract_) internal {
_targetedContracts.push(newTargetedContract_);
}
function targetSelector(FuzzSelector memory newTargetedSelector_) internal {
_targetedSelectors.push(newTargetedSelector_);
}
function targetSender(address newTargetedSender_) internal {
_targetedSenders.push(newTargetedSender_);
}
function targetInterface(FuzzInterface memory newTargetedInterface_) internal {
_targetedInterfaces.push(newTargetedInterface_);
}
// Functions for forge:
// These are called by forge to run invariant tests and don't need to be called in tests.
function excludeArtifacts() public view returns (string[] memory excludedArtifacts_) {
excludedArtifacts_ = _excludedArtifacts;
}
function excludeContracts() public view returns (address[] memory excludedContracts_) {
excludedContracts_ = _excludedContracts;
}
function excludeSelectors() public view returns (FuzzSelector[] memory excludedSelectors_) {
excludedSelectors_ = _excludedSelectors;
}
function excludeSenders() public view returns (address[] memory excludedSenders_) {
excludedSenders_ = _excludedSenders;
}
function targetArtifacts() public view returns (string[] memory targetedArtifacts_) {
targetedArtifacts_ = _targetedArtifacts;
}
function targetArtifactSelectors() public view returns (FuzzArtifactSelector[] memory targetedArtifactSelectors_) {
targetedArtifactSelectors_ = _targetedArtifactSelectors;
}
function targetContracts() public view returns (address[] memory targetedContracts_) {
targetedContracts_ = _targetedContracts;
}
function targetSelectors() public view returns (FuzzSelector[] memory targetedSelectors_) {
targetedSelectors_ = _targetedSelectors;
}
function targetSenders() public view returns (address[] memory targetedSenders_) {
targetedSenders_ = _targetedSenders;
}
function targetInterfaces() public view returns (FuzzInterface[] memory targetedInterfaces_) {
targetedInterfaces_ = _targetedInterfaces;
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;
pragma experimental ABIEncoderV2;
import {VmSafe} from "./Vm.sol";
// Helpers for parsing and writing JSON files
// To parse:
// ```
// using stdJson for string;
// string memory json = vm.readFile("<some_path>");
// json.readUint("<json_path>");
// ```
// To write:
// ```
// using stdJson for string;
// string memory json = "json";
// json.serialize("a", uint256(123));
// string memory semiFinal = json.serialize("b", string("test"));
// string memory finalJson = json.serialize("c", semiFinal);
// finalJson.write("<some_path>");
// ```
library stdJson {
VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code")))));
function parseRaw(string memory json, string memory key) internal pure returns (bytes memory) {
return vm.parseJson(json, key);
}
function readUint(string memory json, string memory key) internal pure returns (uint256) {
return vm.parseJsonUint(json, key);
}
function readUintArray(string memory json, string memory key) internal pure returns (uint256[] memory) {
return vm.parseJsonUintArray(json, key);
}
function readInt(string memory json, string memory key) internal pure returns (int256) {
return vm.parseJsonInt(json, key);
}
function readIntArray(string memory json, string memory key) internal pure returns (int256[] memory) {
return vm.parseJsonIntArray(json, key);
}
function readBytes32(string memory json, string memory key) internal pure returns (bytes32) {
return vm.parseJsonBytes32(json, key);
}
function readBytes32Array(string memory json, string memory key) internal pure returns (bytes32[] memory) {
return vm.parseJsonBytes32Array(json, key);
}
function readString(string memory json, string memory key) internal pure returns (string memory) {
return vm.parseJsonString(json, key);
}
function readStringArray(string memory json, string memory key) internal pure returns (string[] memory) {
return vm.parseJsonStringArray(json, key);
}
function readAddress(string memory json, string memory key) internal pure returns (address) {
return vm.parseJsonAddress(json, key);
}
function readAddressArray(string memory json, string memory key) internal pure returns (address[] memory) {
return vm.parseJsonAddressArray(json, key);
}
function readBool(string memory json, string memory key) internal pure returns (bool) {
return vm.parseJsonBool(json, key);
}
function readBoolArray(string memory json, string memory key) internal pure returns (bool[] memory) {
return vm.parseJsonBoolArray(json, key);
}
function readBytes(string memory json, string memory key) internal pure returns (bytes memory) {
return vm.parseJsonBytes(json, key);
}
function readBytesArray(string memory json, string memory key) internal pure returns (bytes[] memory) {
return vm.parseJsonBytesArray(json, key);
}
function serialize(string memory jsonKey, string memory rootObject) internal returns (string memory) {
return vm.serializeJson(jsonKey, rootObject);
}
function serialize(string memory jsonKey, string memory key, bool value) internal returns (string memory) {
return vm.serializeBool(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, bool[] memory value)
internal
returns (string memory)
{
return vm.serializeBool(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, uint256 value) internal returns (string memory) {
return vm.serializeUint(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, uint256[] memory value)
internal
returns (string memory)
{
return vm.serializeUint(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, int256 value) internal returns (string memory) {
return vm.serializeInt(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, int256[] memory value)
internal
returns (string memory)
{
return vm.serializeInt(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, address value) internal returns (string memory) {
return vm.serializeAddress(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, address[] memory value)
internal
returns (string memory)
{
return vm.serializeAddress(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, bytes32 value) internal returns (string memory) {
return vm.serializeBytes32(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, bytes32[] memory value)
internal
returns (string memory)
{
return vm.serializeBytes32(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, bytes memory value) internal returns (string memory) {
return vm.serializeBytes(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, bytes[] memory value)
internal
returns (string memory)
{
return vm.serializeBytes(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, string memory value)
internal
returns (string memory)
{
return vm.serializeString(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, string[] memory value)
internal
returns (string memory)
{
return vm.serializeString(jsonKey, key, value);
}
function write(string memory jsonKey, string memory path) internal {
vm.writeJson(jsonKey, path);
}
function write(string memory jsonKey, string memory path, string memory valueKey) internal {
vm.writeJson(jsonKey, path, valueKey);
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;
library stdMath {
int256 private constant INT256_MIN = -57896044618658097711785492504343953926634992332820282019728792003956564819968;
function abs(int256 a) internal pure returns (uint256) {
// Required or it will fail when `a = type(int256).min`
if (a == INT256_MIN) {
return 57896044618658097711785492504343953926634992332820282019728792003956564819968;
}
return uint256(a > 0 ? a : -a);
}
function delta(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a - b : b - a;
}
function delta(int256 a, int256 b) internal pure returns (uint256) {
// a and b are of the same sign
// this works thanks to two's complement, the left-most bit is the sign bit
if ((a ^ b) > -1) {
return delta(abs(a), abs(b));
}
// a and b are of opposite signs
return abs(a) + abs(b);
}
function percentDelta(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 absDelta = delta(a, b);
return absDelta * 1e18 / b;
}
function percentDelta(int256 a, int256 b) internal pure returns (uint256) {
uint256 absDelta = delta(a, b);
uint256 absB = abs(b);
return absDelta * 1e18 / absB;
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;
import {Vm} from "./Vm.sol";
struct FindData {
uint256 slot;
uint256 offsetLeft;
uint256 offsetRight;
bool found;
}
struct StdStorage {
mapping(address => mapping(bytes4 => mapping(bytes32 => FindData))) finds;
bytes32[] _keys;
bytes4 _sig;
uint256 _depth;
address _target;
bytes32 _set;
bool _enable_packed_slots;
bytes _calldata;
}
library stdStorageSafe {
event SlotFound(address who, bytes4 fsig, bytes32 keysHash, uint256 slot);
event WARNING_UninitedSlot(address who, uint256 slot);
Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
uint256 constant UINT256_MAX = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
function sigs(string memory sigStr) internal pure returns (bytes4) {
return bytes4(keccak256(bytes(sigStr)));
}
function getCallParams(StdStorage storage self) internal view returns (bytes memory) {
if (self._calldata.length == 0) {
return flatten(self._keys);
} else {
return self._calldata;
}
}
// Calls target contract with configured parameters
function callTarget(StdStorage storage self) internal view returns (bool, bytes32) {
bytes memory cald = abi.encodePacked(self._sig, getCallParams(self));
(bool success, bytes memory rdat) = self._target.staticcall(cald);
bytes32 result = bytesToBytes32(rdat, 32 * self._depth);
return (success, result);
}
// Tries mutating slot value to determine if the targeted value is stored in it.
// If current value is 0, then we are setting slot value to type(uint256).max
// Otherwise, we set it to 0. That way, return value should always be affected.
function checkSlotMutatesCall(StdStorage storage self, bytes32 slot) internal returns (bool) {
bytes32 prevSlotValue = vm.load(self._target, slot);
(bool success, bytes32 prevReturnValue) = callTarget(self);
bytes32 testVal = prevReturnValue == bytes32(0) ? bytes32(UINT256_MAX) : bytes32(0);
vm.store(self._target, slot, testVal);
(, bytes32 newReturnValue) = callTarget(self);
vm.store(self._target, slot, prevSlotValue);
return (success && (prevReturnValue != newReturnValue));
}
// Tries setting one of the bits in slot to 1 until return value changes.
// Index of resulted bit is an offset packed slot has from left/right side
function findOffset(StdStorage storage self, bytes32 slot, bool left) internal returns (bool, uint256) {
for (uint256 offset = 0; offset < 256; offset++) {
uint256 valueToPut = left ? (1 << (255 - offset)) : (1 << offset);
vm.store(self._target, slot, bytes32(valueToPut));
(bool success, bytes32 data) = callTarget(self);
if (success && (uint256(data) > 0)) {
return (true, offset);
}
}
return (false, 0);
}
function findOffsets(StdStorage storage self, bytes32 slot) internal returns (bool, uint256, uint256) {
bytes32 prevSlotValue = vm.load(self._target, slot);
(bool foundLeft, uint256 offsetLeft) = findOffset(self, slot, true);
(bool foundRight, uint256 offsetRight) = findOffset(self, slot, false);
// `findOffset` may mutate slot value, so we are setting it to initial value
vm.store(self._target, slot, prevSlotValue);
return (foundLeft && foundRight, offsetLeft, offsetRight);
}
function find(StdStorage storage self) internal returns (FindData storage) {
return find(self, true);
}
/// @notice find an arbitrary storage slot given a function sig, input data, address of the contract and a value to check against
// slot complexity:
// if flat, will be bytes32(uint256(uint));
// if map, will be keccak256(abi.encode(key, uint(slot)));
// if deep map, will be keccak256(abi.encode(key1, keccak256(abi.encode(key0, uint(slot)))));
// if map struct, will be bytes32(uint256(keccak256(abi.encode(key1, keccak256(abi.encode(key0, uint(slot)))))) + structFieldDepth);
function find(StdStorage storage self, bool _clear) internal returns (FindData storage) {
address who = self._target;
bytes4 fsig = self._sig;
uint256 field_depth = self._depth;
bytes memory params = getCallParams(self);
// calldata to test against
if (self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))].found) {
if (_clear) {
clear(self);
}
return self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))];
}
vm.record();
(, bytes32 callResult) = callTarget(self);
(bytes32[] memory reads,) = vm.accesses(address(who));
if (reads.length == 0) {
revert("stdStorage find(StdStorage): No storage use detected for target.");
} else {
for (uint256 i = 0; i < reads.length; i++) {
bytes32 prev = vm.load(who, reads[i]);
if (prev == bytes32(0)) {
emit WARNING_UninitedSlot(who, uint256(reads[i]));
}
if (!checkSlotMutatesCall(self, reads[i])) {
continue;
}
(uint256 offsetLeft, uint256 offsetRight) = (0, 0);
if (self._enable_packed_slots) {
bool found;
(found, offsetLeft, offsetRight) = findOffsets(self, reads[i]);
if (!found) {
continue;
}
}
// Check that value between found offsets is equal to the current call result
uint256 curVal = (uint256(prev) & getMaskByOffsets(offsetLeft, offsetRight)) >> offsetRight;
if (uint256(callResult) != curVal) {
continue;
}
emit SlotFound(who, fsig, keccak256(abi.encodePacked(params, field_depth)), uint256(reads[i]));
self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))] =
FindData(uint256(reads[i]), offsetLeft, offsetRight, true);
break;
}
}
require(
self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))].found,
"stdStorage find(StdStorage): Slot(s) not found."
);
if (_clear) {
clear(self);
}
return self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))];
}
function target(StdStorage storage self, address _target) internal returns (StdStorage storage) {
self._target = _target;
return self;
}
function sig(StdStorage storage self, bytes4 _sig) internal returns (StdStorage storage) {
self._sig = _sig;
return self;
}
function sig(StdStorage storage self, string memory _sig) internal returns (StdStorage storage) {
self._sig = sigs(_sig);
return self;
}
function with_calldata(StdStorage storage self, bytes memory _calldata) internal returns (StdStorage storage) {
self._calldata = _calldata;
return self;
}
function with_key(StdStorage storage self, address who) internal returns (StdStorage storage) {
self._keys.push(bytes32(uint256(uint160(who))));
return self;
}
function with_key(StdStorage storage self, uint256 amt) internal returns (StdStorage storage) {
self._keys.push(bytes32(amt));
return self;
}
function with_key(StdStorage storage self, bytes32 key) internal returns (StdStorage storage) {
self._keys.push(key);
return self;
}
function enable_packed_slots(StdStorage storage self) internal returns (StdStorage storage) {
self._enable_packed_slots = true;
return self;
}
function depth(StdStorage storage self, uint256 _depth) internal returns (StdStorage storage) {
self._depth = _depth;
return self;
}
function read(StdStorage storage self) private returns (bytes memory) {
FindData storage data = find(self, false);
uint256 mask = getMaskByOffsets(data.offsetLeft, data.offsetRight);
uint256 value = (uint256(vm.load(self._target, bytes32(data.slot))) & mask) >> data.offsetRight;
clear(self);
return abi.encode(value);
}
function read_bytes32(StdStorage storage self) internal returns (bytes32) {
return abi.decode(read(self), (bytes32));
}
function read_bool(StdStorage storage self) internal returns (bool) {
int256 v = read_int(self);
if (v == 0) return false;
if (v == 1) return true;
revert("stdStorage read_bool(StdStorage): Cannot decode. Make sure you are reading a bool.");
}
function read_address(StdStorage storage self) internal returns (address) {
return abi.decode(read(self), (address));
}
function read_uint(StdStorage storage self) internal returns (uint256) {
return abi.decode(read(self), (uint256));
}
function read_int(StdStorage storage self) internal returns (int256) {
return abi.decode(read(self), (int256));
}
function parent(StdStorage storage self) internal returns (uint256, bytes32) {
address who = self._target;
uint256 field_depth = self._depth;
vm.startMappingRecording();
uint256 child = find(self, true).slot - field_depth;
(bool found, bytes32 key, bytes32 parent_slot) = vm.getMappingKeyAndParentOf(who, bytes32(child));
if (!found) {
revert(
"stdStorage read_bool(StdStorage): Cannot find parent. Make sure you give a slot and startMappingRecording() has been called."
);
}
return (uint256(parent_slot), key);
}
function root(StdStorage storage self) internal returns (uint256) {
address who = self._target;
uint256 field_depth = self._depth;
vm.startMappingRecording();
uint256 child = find(self, true).slot - field_depth;
bool found;
bytes32 root_slot;
bytes32 parent_slot;
(found,, parent_slot) = vm.getMappingKeyAndParentOf(who, bytes32(child));
if (!found) {
revert(
"stdStorage read_bool(StdStorage): Cannot find parent. Make sure you give a slot and startMappingRecording() has been called."
);
}
while (found) {
root_slot = parent_slot;
(found,, parent_slot) = vm.getMappingKeyAndParentOf(who, bytes32(root_slot));
}
return uint256(root_slot);
}
function bytesToBytes32(bytes memory b, uint256 offset) private pure returns (bytes32) {
bytes32 out;
uint256 max = b.length > 32 ? 32 : b.length;
for (uint256 i = 0; i < max; i++) {
out |= bytes32(b[offset + i] & 0xFF) >> (i * 8);
}
return out;
}
function flatten(bytes32[] memory b) private pure returns (bytes memory) {
bytes memory result = new bytes(b.length * 32);
for (uint256 i = 0; i < b.length; i++) {
bytes32 k = b[i];
/// @solidity memory-safe-assembly
assembly {
mstore(add(result, add(32, mul(32, i))), k)
}
}
return result;
}
function clear(StdStorage storage self) internal {
delete self._target;
delete self._sig;
delete self._keys;
delete self._depth;
delete self._enable_packed_slots;
delete self._calldata;
}
// Returns mask which contains non-zero bits for values between `offsetLeft` and `offsetRight`
// (slotValue & mask) >> offsetRight will be the value of the given packed variable
function getMaskByOffsets(uint256 offsetLeft, uint256 offsetRight) internal pure returns (uint256 mask) {
// mask = ((1 << (256 - (offsetRight + offsetLeft))) - 1) << offsetRight;
// using assembly because (1 << 256) causes overflow
assembly {
mask := shl(offsetRight, sub(shl(sub(256, add(offsetRight, offsetLeft)), 1), 1))
}
}
// Returns slot value with updated packed variable.
function getUpdatedSlotValue(bytes32 curValue, uint256 varValue, uint256 offsetLeft, uint256 offsetRight)
internal
pure
returns (bytes32 newValue)
{
return bytes32((uint256(curValue) & ~getMaskByOffsets(offsetLeft, offsetRight)) | (varValue << offsetRight));
}
}
library stdStorage {
Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
function sigs(string memory sigStr) internal pure returns (bytes4) {
return stdStorageSafe.sigs(sigStr);
}
function find(StdStorage storage self) internal returns (uint256) {
return find(self, true);
}
function find(StdStorage storage self, bool _clear) internal returns (uint256) {
return stdStorageSafe.find(self, _clear).slot;
}
function target(StdStorage storage self, address _target) internal returns (StdStorage storage) {
return stdStorageSafe.target(self, _target);
}
function sig(StdStorage storage self, bytes4 _sig) internal returns (StdStorage storage) {
return stdStorageSafe.sig(self, _sig);
}
function sig(StdStorage storage self, string memory _sig) internal returns (StdStorage storage) {
return stdStorageSafe.sig(self, _sig);
}
function with_key(StdStorage storage self, address who) internal returns (StdStorage storage) {
return stdStorageSafe.with_key(self, who);
}
function with_key(StdStorage storage self, uint256 amt) internal returns (StdStorage storage) {
return stdStorageSafe.with_key(self, amt);
}
function with_key(StdStorage storage self, bytes32 key) internal returns (StdStorage storage) {
return stdStorageSafe.with_key(self, key);
}
function with_calldata(StdStorage storage self, bytes memory _calldata) internal returns (StdStorage storage) {
return stdStorageSafe.with_calldata(self, _calldata);
}
function enable_packed_slots(StdStorage storage self) internal returns (StdStorage storage) {
return stdStorageSafe.enable_packed_slots(self);
}
function depth(StdStorage storage self, uint256 _depth) internal returns (StdStorage storage) {
return stdStorageSafe.depth(self, _depth);
}
function clear(StdStorage storage self) internal {
stdStorageSafe.clear(self);
}
function checked_write(StdStorage storage self, address who) internal {
checked_write(self, bytes32(uint256(uint160(who))));
}
function checked_write(StdStorage storage self, uint256 amt) internal {
checked_write(self, bytes32(amt));
}
function checked_write_int(StdStorage storage self, int256 val) internal {
checked_write(self, bytes32(uint256(val)));
}
function checked_write(StdStorage storage self, bool write) internal {
bytes32 t;
/// @solidity memory-safe-assembly
assembly {
t := write
}
checked_write(self, t);
}
function checked_write(StdStorage storage self, bytes32 set) internal {
address who = self._target;
bytes4 fsig = self._sig;
uint256 field_depth = self._depth;
bytes memory params = stdStorageSafe.getCallParams(self);
if (!self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))].found) {
find(self, false);
}
FindData storage data = self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))];
if ((data.offsetLeft + data.offsetRight) > 0) {
uint256 maxVal = 2 ** (256 - (data.offsetLeft + data.offsetRight));
require(
uint256(set) < maxVal,
string(
abi.encodePacked(
"stdStorage find(StdStorage): Packed slot. We can't fit value greater than ",
vm.toString(maxVal)
)
)
);
}
bytes32 curVal = vm.load(who, bytes32(data.slot));
bytes32 valToSet = stdStorageSafe.getUpdatedSlotValue(curVal, uint256(set), data.offsetLeft, data.offsetRight);
vm.store(who, bytes32(data.slot), valToSet);
(bool success, bytes32 callResult) = stdStorageSafe.callTarget(self);
if (!success || callResult != set) {
vm.store(who, bytes32(data.slot), curVal);
revert("stdStorage find(StdStorage): Failed to write value.");
}
clear(self);
}
function read_bytes32(StdStorage storage self) internal returns (bytes32) {
return stdStorageSafe.read_bytes32(self);
}
function read_bool(StdStorage storage self) internal returns (bool) {
return stdStorageSafe.read_bool(self);
}
function read_address(StdStorage storage self) internal returns (address) {
return stdStorageSafe.read_address(self);
}
function read_uint(StdStorage storage self) internal returns (uint256) {
return stdStorageSafe.read_uint(self);
}
function read_int(StdStorage storage self) internal returns (int256) {
return stdStorageSafe.read_int(self);
}
function parent(StdStorage storage self) internal returns (uint256, bytes32) {
return stdStorageSafe.parent(self);
}
function root(StdStorage storage self) internal returns (uint256) {
return stdStorageSafe.root(self);
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
import {VmSafe} from "./Vm.sol";
library StdStyle {
VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code")))));
string constant RED = "\u001b[91m";
string constant GREEN = "\u001b[92m";
string constant YELLOW = "\u001b[93m";
string constant BLUE = "\u001b[94m";
string constant MAGENTA = "\u001b[95m";
string constant CYAN = "\u001b[96m";
string constant BOLD = "\u001b[1m";
string constant DIM = "\u001b[2m";
string constant ITALIC = "\u001b[3m";
string constant UNDERLINE = "\u001b[4m";
string constant INVERSE = "\u001b[7m";
string constant RESET = "\u001b[0m";
function styleConcat(string memory style, string memory self) private pure returns (string memory) {
return string(abi.encodePacked(style, self, RESET));
}
function red(string memory self) internal pure returns (string memory) {
return styleConcat(RED, self);
}
function red(uint256 self) internal pure returns (string memory) {
return red(vm.toString(self));
}
function red(int256 self) internal pure returns (string memory) {
return red(vm.toString(self));
}
function red(address self) internal pure returns (string memory) {
return red(vm.toString(self));
}
function red(bool self) internal pure returns (string memory) {
return red(vm.toString(self));
}
function redBytes(bytes memory self) internal pure returns (string memory) {
return red(vm.toString(self));
}
function redBytes32(bytes32 self) internal pure returns (string memory) {
return red(vm.toString(self));
}
function green(string memory self) internal pure returns (string memory) {
return styleConcat(GREEN, self);
}
function green(uint256 self) internal pure returns (string memory) {
return green(vm.toString(self));
}
function green(int256 self) internal pure returns (string memory) {
return green(vm.toString(self));
}
function green(address self) internal pure returns (string memory) {
return green(vm.toString(self));
}
function green(bool self) internal pure returns (string memory) {
return green(vm.toString(self));
}
function greenBytes(bytes memory self) internal pure returns (string memory) {
return green(vm.toString(self));
}
function greenBytes32(bytes32 self) internal pure returns (string memory) {
return green(vm.toString(self));
}
function yellow(string memory self) internal pure returns (string memory) {
return styleConcat(YELLOW, self);
}
function yellow(uint256 self) internal pure returns (string memory) {
return yellow(vm.toString(self));
}
function yellow(int256 self) internal pure returns (string memory) {
return yellow(vm.toString(self));
}
function yellow(address self) internal pure returns (string memory) {
return yellow(vm.toString(self));
}
function yellow(bool self) internal pure returns (string memory) {
return yellow(vm.toString(self));
}
function yellowBytes(bytes memory self) internal pure returns (string memory) {
return yellow(vm.toString(self));
}
function yellowBytes32(bytes32 self) internal pure returns (string memory) {
return yellow(vm.toString(self));
}
function blue(string memory self) internal pure returns (string memory) {
return styleConcat(BLUE, self);
}
function blue(uint256 self) internal pure returns (string memory) {
return blue(vm.toString(self));
}
function blue(int256 self) internal pure returns (string memory) {
return blue(vm.toString(self));
}
function blue(address self) internal pure returns (string memory) {
return blue(vm.toString(self));
}
function blue(bool self) internal pure returns (string memory) {
return blue(vm.toString(self));
}
function blueBytes(bytes memory self) internal pure returns (string memory) {
return blue(vm.toString(self));
}
function blueBytes32(bytes32 self) internal pure returns (string memory) {
return blue(vm.toString(self));
}
function magenta(string memory self) internal pure returns (string memory) {
return styleConcat(MAGENTA, self);
}
function magenta(uint256 self) internal pure returns (string memory) {
return magenta(vm.toString(self));
}
function magenta(int256 self) internal pure returns (string memory) {
return magenta(vm.toString(self));
}
function magenta(address self) internal pure returns (string memory) {
return magenta(vm.toString(self));
}
function magenta(bool self) internal pure returns (string memory) {
return magenta(vm.toString(self));
}
function magentaBytes(bytes memory self) internal pure returns (string memory) {
return magenta(vm.toString(self));
}
function magentaBytes32(bytes32 self) internal pure returns (string memory) {
return magenta(vm.toString(self));
}
function cyan(string memory self) internal pure returns (string memory) {
return styleConcat(CYAN, self);
}
function cyan(uint256 self) internal pure returns (string memory) {
return cyan(vm.toString(self));
}
function cyan(int256 self) internal pure returns (string memory) {
return cyan(vm.toString(self));
}
function cyan(address self) internal pure returns (string memory) {
return cyan(vm.toString(self));
}
function cyan(bool self) internal pure returns (string memory) {
return cyan(vm.toString(self));
}
function cyanBytes(bytes memory self) internal pure returns (string memory) {
return cyan(vm.toString(self));
}
function cyanBytes32(bytes32 self) internal pure returns (string memory) {
return cyan(vm.toString(self));
}
function bold(string memory self) internal pure returns (string memory) {
return styleConcat(BOLD, self);
}
function bold(uint256 self) internal pure returns (string memory) {
return bold(vm.toString(self));
}
function bold(int256 self) internal pure returns (string memory) {
return bold(vm.toString(self));
}
function bold(address self) internal pure returns (string memory) {
return bold(vm.toString(self));
}
function bold(bool self) internal pure returns (string memory) {
return bold(vm.toString(self));
}
function boldBytes(bytes memory self) internal pure returns (string memory) {
return bold(vm.toString(self));
}
function boldBytes32(bytes32 self) internal pure returns (string memory) {
return bold(vm.toString(self));
}
function dim(string memory self) internal pure returns (string memory) {
return styleConcat(DIM, self);
}
function dim(uint256 self) internal pure returns (string memory) {
return dim(vm.toString(self));
}
function dim(int256 self) internal pure returns (string memory) {
return dim(vm.toString(self));
}
function dim(address self) internal pure returns (string memory) {
return dim(vm.toString(self));
}
function dim(bool self) internal pure returns (string memory) {
return dim(vm.toString(self));
}
function dimBytes(bytes memory self) internal pure returns (string memory) {
return dim(vm.toString(self));
}
function dimBytes32(bytes32 self) internal pure returns (string memory) {
return dim(vm.toString(self));
}
function italic(string memory self) internal pure returns (string memory) {
return styleConcat(ITALIC, self);
}
function italic(uint256 self) internal pure returns (string memory) {
return italic(vm.toString(self));
}
function italic(int256 self) internal pure returns (string memory) {
return italic(vm.toString(self));
}
function italic(address self) internal pure returns (string memory) {
return italic(vm.toString(self));
}
function italic(bool self) internal pure returns (string memory) {
return italic(vm.toString(self));
}
function italicBytes(bytes memory self) internal pure returns (string memory) {
return italic(vm.toString(self));
}
function italicBytes32(bytes32 self) internal pure returns (string memory) {
return italic(vm.toString(self));
}
function underline(string memory self) internal pure returns (string memory) {
return styleConcat(UNDERLINE, self);
}
function underline(uint256 self) internal pure returns (string memory) {
return underline(vm.toString(self));
}
function underline(int256 self) internal pure returns (string memory) {
return underline(vm.toString(self));
}
function underline(address self) internal pure returns (string memory) {
return underline(vm.toString(self));
}
function underline(bool self) internal pure returns (string memory) {
return underline(vm.toString(self));
}
function underlineBytes(bytes memory self) internal pure returns (string memory) {
return underline(vm.toString(self));
}
function underlineBytes32(bytes32 self) internal pure returns (string memory) {
return underline(vm.toString(self));
}
function inverse(string memory self) internal pure returns (string memory) {
return styleConcat(INVERSE, self);
}
function inverse(uint256 self) internal pure returns (string memory) {
return inverse(vm.toString(self));
}
function inverse(int256 self) internal pure returns (string memory) {
return inverse(vm.toString(self));
}
function inverse(address self) internal pure returns (string memory) {
return inverse(vm.toString(self));
}
function inverse(bool self) internal pure returns (string memory) {
return inverse(vm.toString(self));
}
function inverseBytes(bytes memory self) internal pure returns (string memory) {
return inverse(vm.toString(self));
}
function inverseBytes32(bytes32 self) internal pure returns (string memory) {
return inverse(vm.toString(self));
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;
pragma experimental ABIEncoderV2;
import {VmSafe} from "./Vm.sol";
// Helpers for parsing and writing TOML files
// To parse:
// ```
// using stdToml for string;
// string memory toml = vm.readFile("<some_path>");
// toml.readUint("<json_path>");
// ```
// To write:
// ```
// using stdToml for string;
// string memory json = "json";
// json.serialize("a", uint256(123));
// string memory semiFinal = json.serialize("b", string("test"));
// string memory finalJson = json.serialize("c", semiFinal);
// finalJson.write("<some_path>");
// ```
library stdToml {
VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code")))));
function parseRaw(string memory toml, string memory key) internal pure returns (bytes memory) {
return vm.parseToml(toml, key);
}
function readUint(string memory toml, string memory key) internal pure returns (uint256) {
return vm.parseTomlUint(toml, key);
}
function readUintArray(string memory toml, string memory key) internal pure returns (uint256[] memory) {
return vm.parseTomlUintArray(toml, key);
}
function readInt(string memory toml, string memory key) internal pure returns (int256) {
return vm.parseTomlInt(toml, key);
}
function readIntArray(string memory toml, string memory key) internal pure returns (int256[] memory) {
return vm.parseTomlIntArray(toml, key);
}
function readBytes32(string memory toml, string memory key) internal pure returns (bytes32) {
return vm.parseTomlBytes32(toml, key);
}
function readBytes32Array(string memory toml, string memory key) internal pure returns (bytes32[] memory) {
return vm.parseTomlBytes32Array(toml, key);
}
function readString(string memory toml, string memory key) internal pure returns (string memory) {
return vm.parseTomlString(toml, key);
}
function readStringArray(string memory toml, string memory key) internal pure returns (string[] memory) {
return vm.parseTomlStringArray(toml, key);
}
function readAddress(string memory toml, string memory key) internal pure returns (address) {
return vm.parseTomlAddress(toml, key);
}
function readAddressArray(string memory toml, string memory key) internal pure returns (address[] memory) {
return vm.parseTomlAddressArray(toml, key);
}
function readBool(string memory toml, string memory key) internal pure returns (bool) {
return vm.parseTomlBool(toml, key);
}
function readBoolArray(string memory toml, string memory key) internal pure returns (bool[] memory) {
return vm.parseTomlBoolArray(toml, key);
}
function readBytes(string memory toml, string memory key) internal pure returns (bytes memory) {
return vm.parseTomlBytes(toml, key);
}
function readBytesArray(string memory toml, string memory key) internal pure returns (bytes[] memory) {
return vm.parseTomlBytesArray(toml, key);
}
function serialize(string memory jsonKey, string memory rootObject) internal returns (string memory) {
return vm.serializeJson(jsonKey, rootObject);
}
function serialize(string memory jsonKey, string memory key, bool value) internal returns (string memory) {
return vm.serializeBool(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, bool[] memory value)
internal
returns (string memory)
{
return vm.serializeBool(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, uint256 value) internal returns (string memory) {
return vm.serializeUint(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, uint256[] memory value)
internal
returns (string memory)
{
return vm.serializeUint(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, int256 value) internal returns (string memory) {
return vm.serializeInt(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, int256[] memory value)
internal
returns (string memory)
{
return vm.serializeInt(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, address value) internal returns (string memory) {
return vm.serializeAddress(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, address[] memory value)
internal
returns (string memory)
{
return vm.serializeAddress(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, bytes32 value) internal returns (string memory) {
return vm.serializeBytes32(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, bytes32[] memory value)
internal
returns (string memory)
{
return vm.serializeBytes32(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, bytes memory value) internal returns (string memory) {
return vm.serializeBytes(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, bytes[] memory value)
internal
returns (string memory)
{
return vm.serializeBytes(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, string memory value)
internal
returns (string memory)
{
return vm.serializeString(jsonKey, key, value);
}
function serialize(string memory jsonKey, string memory key, string[] memory value)
internal
returns (string memory)
{
return vm.serializeString(jsonKey, key, value);
}
function write(string memory jsonKey, string memory path) internal {
vm.writeToml(jsonKey, path);
}
function write(string memory jsonKey, string memory path, string memory valueKey) internal {
vm.writeToml(jsonKey, path, valueKey);
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;
pragma experimental ABIEncoderV2;
import {IMulticall3} from "./interfaces/IMulticall3.sol";
import {MockERC20} from "./mocks/MockERC20.sol";
import {MockERC721} from "./mocks/MockERC721.sol";
import {VmSafe} from "./Vm.sol";
abstract contract StdUtils {
/*//////////////////////////////////////////////////////////////////////////
CONSTANTS
//////////////////////////////////////////////////////////////////////////*/
IMulticall3 private constant multicall = IMulticall3(0xcA11bde05977b3631167028862bE2a173976CA11);
VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code")))));
address private constant CONSOLE2_ADDRESS = 0x000000000000000000636F6e736F6c652e6c6f67;
uint256 private constant INT256_MIN_ABS =
57896044618658097711785492504343953926634992332820282019728792003956564819968;
uint256 private constant SECP256K1_ORDER =
115792089237316195423570985008687907852837564279074904382605163141518161494337;
uint256 private constant UINT256_MAX =
115792089237316195423570985008687907853269984665640564039457584007913129639935;
// Used by default when deploying with create2, https://github.com/Arachnid/deterministic-deployment-proxy.
address private constant CREATE2_FACTORY = 0x4e59b44847b379578588920cA78FbF26c0B4956C;
/*//////////////////////////////////////////////////////////////////////////
INTERNAL FUNCTIONS
//////////////////////////////////////////////////////////////////////////*/
function _bound(uint256 x, uint256 min, uint256 max) internal pure virtual returns (uint256 result) {
require(min <= max, "StdUtils bound(uint256,uint256,uint256): Max is less than min.");
// If x is between min and max, return x directly. This is to ensure that dictionary values
// do not get shifted if the min is nonzero. More info: https://github.com/foundry-rs/forge-std/issues/188
if (x >= min && x <= max) return x;
uint256 size = max - min + 1;
// If the value is 0, 1, 2, 3, wrap that to min, min+1, min+2, min+3. Similarly for the UINT256_MAX side.
// This helps ensure coverage of the min/max values.
if (x <= 3 && size > x) return min + x;
if (x >= UINT256_MAX - 3 && size > UINT256_MAX - x) return max - (UINT256_MAX - x);
// Otherwise, wrap x into the range [min, max], i.e. the range is inclusive.
if (x > max) {
uint256 diff = x - max;
uint256 rem = diff % size;
if (rem == 0) return max;
result = min + rem - 1;
} else if (x < min) {
uint256 diff = min - x;
uint256 rem = diff % size;
if (rem == 0) return min;
result = max - rem + 1;
}
}
function bound(uint256 x, uint256 min, uint256 max) internal pure virtual returns (uint256 result) {
result = _bound(x, min, max);
console2_log_StdUtils("Bound result", result);
}
function _bound(int256 x, int256 min, int256 max) internal pure virtual returns (int256 result) {
require(min <= max, "StdUtils bound(int256,int256,int256): Max is less than min.");
// Shifting all int256 values to uint256 to use _bound function. The range of two types are:
// int256 : -(2**255) ~ (2**255 - 1)
// uint256: 0 ~ (2**256 - 1)
// So, add 2**255, INT256_MIN_ABS to the integer values.
//
// If the given integer value is -2**255, we cannot use `-uint256(-x)` because of the overflow.
// So, use `~uint256(x) + 1` instead.
uint256 _x = x < 0 ? (INT256_MIN_ABS - ~uint256(x) - 1) : (uint256(x) + INT256_MIN_ABS);
uint256 _min = min < 0 ? (INT256_MIN_ABS - ~uint256(min) - 1) : (uint256(min) + INT256_MIN_ABS);
uint256 _max = max < 0 ? (INT256_MIN_ABS - ~uint256(max) - 1) : (uint256(max) + INT256_MIN_ABS);
uint256 y = _bound(_x, _min, _max);
// To move it back to int256 value, subtract INT256_MIN_ABS at here.
result = y < INT256_MIN_ABS ? int256(~(INT256_MIN_ABS - y) + 1) : int256(y - INT256_MIN_ABS);
}
function bound(int256 x, int256 min, int256 max) internal pure virtual returns (int256 result) {
result = _bound(x, min, max);
console2_log_StdUtils("Bound result", vm.toString(result));
}
function boundPrivateKey(uint256 privateKey) internal pure virtual returns (uint256 result) {
result = _bound(privateKey, 1, SECP256K1_ORDER - 1);
}
function bytesToUint(bytes memory b) internal pure virtual returns (uint256) {
require(b.length <= 32, "StdUtils bytesToUint(bytes): Bytes length exceeds 32.");
return abi.decode(abi.encodePacked(new bytes(32 - b.length), b), (uint256));
}
/// @dev Compute the address a contract will be deployed at for a given deployer address and nonce
/// @notice adapted from Solmate implementation (https://github.com/Rari-Capital/solmate/blob/main/src/utils/LibRLP.sol)
function computeCreateAddress(address deployer, uint256 nonce) internal pure virtual returns (address) {
console2_log_StdUtils("computeCreateAddress is deprecated. Please use vm.computeCreateAddress instead.");
return vm.computeCreateAddress(deployer, nonce);
}
function computeCreate2Address(bytes32 salt, bytes32 initcodeHash, address deployer)
internal
pure
virtual
returns (address)
{
console2_log_StdUtils("computeCreate2Address is deprecated. Please use vm.computeCreate2Address instead.");
return vm.computeCreate2Address(salt, initcodeHash, deployer);
}
/// @dev returns the address of a contract created with CREATE2 using the default CREATE2 deployer
function computeCreate2Address(bytes32 salt, bytes32 initCodeHash) internal pure returns (address) {
console2_log_StdUtils("computeCreate2Address is deprecated. Please use vm.computeCreate2Address instead.");
return vm.computeCreate2Address(salt, initCodeHash);
}
/// @dev returns an initialized mock ERC20 contract
function deployMockERC20(string memory name, string memory symbol, uint8 decimals)
internal
returns (MockERC20 mock)
{
mock = new MockERC20();
mock.initialize(name, symbol, decimals);
}
/// @dev returns an initialized mock ERC721 contract
function deployMockERC721(string memory name, string memory symbol) internal returns (MockERC721 mock) {
mock = new MockERC721();
mock.initialize(name, symbol);
}
/// @dev returns the hash of the init code (creation code + no args) used in CREATE2 with no constructor arguments
/// @param creationCode the creation code of a contract C, as returned by type(C).creationCode
function hashInitCode(bytes memory creationCode) internal pure returns (bytes32) {
return hashInitCode(creationCode, "");
}
/// @dev returns the hash of the init code (creation code + ABI-encoded args) used in CREATE2
/// @param creationCode the creation code of a contract C, as returned by type(C).creationCode
/// @param args the ABI-encoded arguments to the constructor of C
function hashInitCode(bytes memory creationCode, bytes memory args) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(creationCode, args));
}
// Performs a single call with Multicall3 to query the ERC-20 token balances of the given addresses.
function getTokenBalances(address token, address[] memory addresses)
internal
virtual
returns (uint256[] memory balances)
{
uint256 tokenCodeSize;
assembly {
tokenCodeSize := extcodesize(token)
}
require(tokenCodeSize > 0, "StdUtils getTokenBalances(address,address[]): Token address is not a contract.");
// ABI encode the aggregate call to Multicall3.
uint256 length = addresses.length;
IMulticall3.Call[] memory calls = new IMulticall3.Call[](length);
for (uint256 i = 0; i < length; ++i) {
// 0x70a08231 = bytes4("balanceOf(address)"))
calls[i] = IMulticall3.Call({target: token, callData: abi.encodeWithSelector(0x70a08231, (addresses[i]))});
}
// Make the aggregate call.
(, bytes[] memory returnData) = multicall.aggregate(calls);
// ABI decode the return data and return the balances.
balances = new uint256[](length);
for (uint256 i = 0; i < length; ++i) {
balances[i] = abi.decode(returnData[i], (uint256));
}
}
/*//////////////////////////////////////////////////////////////////////////
PRIVATE FUNCTIONS
//////////////////////////////////////////////////////////////////////////*/
function addressFromLast20Bytes(bytes32 bytesValue) private pure returns (address) {
return address(uint160(uint256(bytesValue)));
}
// This section is used to prevent the compilation of console, which shortens the compilation time when console is
// not used elsewhere. We also trick the compiler into letting us make the console log methods as `pure` to avoid
// any breaking changes to function signatures.
function _castLogPayloadViewToPure(function(bytes memory) internal view fnIn)
internal
pure
returns (function(bytes memory) internal pure fnOut)
{
assembly {
fnOut := fnIn
}
}
function _sendLogPayload(bytes memory payload) internal pure {
_castLogPayloadViewToPure(_sendLogPayloadView)(payload);
}
function _sendLogPayloadView(bytes memory payload) private view {
uint256 payloadLength = payload.length;
address consoleAddress = CONSOLE2_ADDRESS;
/// @solidity memory-safe-assembly
assembly {
let payloadStart := add(payload, 32)
let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0)
}
}
function console2_log_StdUtils(string memory p0) private pure {
_sendLogPayload(abi.encodeWithSignature("log(string)", p0));
}
function console2_log_StdUtils(string memory p0, uint256 p1) private pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint256)", p0, p1));
}
function console2_log_StdUtils(string memory p0, string memory p1) private pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1));
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;
pragma experimental ABIEncoderV2;
// 💬 ABOUT
// Forge Std's default Test.
// 🧩 MODULES
import {console} from "./console.sol";
import {console2} from "./console2.sol";
import {safeconsole} from "./safeconsole.sol";
import {StdAssertions} from "./StdAssertions.sol";
import {StdChains} from "./StdChains.sol";
import {StdCheats} from "./StdCheats.sol";
import {stdError} from "./StdError.sol";
import {StdInvariant} from "./StdInvariant.sol";
import {stdJson} from "./StdJson.sol";
import {stdMath} from "./StdMath.sol";
import {StdStorage, stdStorage} from "./StdStorage.sol";
import {StdStyle} from "./StdStyle.sol";
import {stdToml} from "./StdToml.sol";
import {StdUtils} from "./StdUtils.sol";
import {Vm} from "./Vm.sol";
// 📦 BOILERPLATE
import {TestBase} from "./Base.sol";
// ⭐️ TEST
abstract contract Test is TestBase, StdAssertions, StdChains, StdCheats, StdInvariant, StdUtils {
// Note: IS_TEST() must return true.
bool public IS_TEST = true;
}
// Automatically @generated by scripts/vm.py. Do not modify manually.
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.2 <0.9.0;
pragma experimental ABIEncoderV2;
/// The `VmSafe` interface does not allow manipulation of the EVM state or other actions that may
/// result in Script simulations differing from on-chain execution. It is recommended to only use
/// these cheats in scripts.
interface VmSafe {
/// A modification applied to either `msg.sender` or `tx.origin`. Returned by `readCallers`.
enum CallerMode {
// No caller modification is currently active.
None,
// A one time broadcast triggered by a `vm.broadcast()` call is currently active.
Broadcast,
// A recurrent broadcast triggered by a `vm.startBroadcast()` call is currently active.
RecurrentBroadcast,
// A one time prank triggered by a `vm.prank()` call is currently active.
Prank,
// A recurrent prank triggered by a `vm.startPrank()` call is currently active.
RecurrentPrank
}
/// The kind of account access that occurred.
enum AccountAccessKind {
// The account was called.
Call,
// The account was called via delegatecall.
DelegateCall,
// The account was called via callcode.
CallCode,
// The account was called via staticcall.
StaticCall,
// The account was created.
Create,
// The account was selfdestructed.
SelfDestruct,
// Synthetic access indicating the current context has resumed after a previous sub-context (AccountAccess).
Resume,
// The account's balance was read.
Balance,
// The account's codesize was read.
Extcodesize,
// The account's codehash was read.
Extcodehash,
// The account's code was copied.
Extcodecopy
}
/// Forge execution contexts.
enum ForgeContext {
// Test group execution context (test, coverage or snapshot).
TestGroup,
// `forge test` execution context.
Test,
// `forge coverage` execution context.
Coverage,
// `forge snapshot` execution context.
Snapshot,
// Script group execution context (dry run, broadcast or resume).
ScriptGroup,
// `forge script` execution context.
ScriptDryRun,
// `forge script --broadcast` execution context.
ScriptBroadcast,
// `forge script --resume` execution context.
ScriptResume,
// Unknown `forge` execution context.
Unknown
}
/// An Ethereum log. Returned by `getRecordedLogs`.
struct Log {
// The topics of the log, including the signature, if any.
bytes32[] topics;
// The raw data of the log.
bytes data;
// The address of the log's emitter.
address emitter;
}
/// An RPC URL and its alias. Returned by `rpcUrlStructs`.
struct Rpc {
// The alias of the RPC URL.
string key;
// The RPC URL.
string url;
}
/// An RPC log object. Returned by `eth_getLogs`.
struct EthGetLogs {
// The address of the log's emitter.
address emitter;
// The topics of the log, including the signature, if any.
bytes32[] topics;
// The raw data of the log.
bytes data;
// The block hash.
bytes32 blockHash;
// The block number.
uint64 blockNumber;
// The transaction hash.
bytes32 transactionHash;
// The transaction index in the block.
uint64 transactionIndex;
// The log index.
uint256 logIndex;
// Whether the log was removed.
bool removed;
}
/// A single entry in a directory listing. Returned by `readDir`.
struct DirEntry {
// The error message, if any.
string errorMessage;
// The path of the entry.
string path;
// The depth of the entry.
uint64 depth;
// Whether the entry is a directory.
bool isDir;
// Whether the entry is a symlink.
bool isSymlink;
}
/// Metadata information about a file.
/// This structure is returned from the `fsMetadata` function and represents known
/// metadata about a file such as its permissions, size, modification
/// times, etc.
struct FsMetadata {
// True if this metadata is for a directory.
bool isDir;
// True if this metadata is for a symlink.
bool isSymlink;
// The size of the file, in bytes, this metadata is for.
uint256 length;
// True if this metadata is for a readonly (unwritable) file.
bool readOnly;
// The last modification time listed in this metadata.
uint256 modified;
// The last access time of this metadata.
uint256 accessed;
// The creation time listed in this metadata.
uint256 created;
}
/// A wallet with a public and private key.
struct Wallet {
// The wallet's address.
address addr;
// The wallet's public key `X`.
uint256 publicKeyX;
// The wallet's public key `Y`.
uint256 publicKeyY;
// The wallet's private key.
uint256 privateKey;
}
/// The result of a `tryFfi` call.
struct FfiResult {
// The exit code of the call.
int32 exitCode;
// The optionally hex-decoded `stdout` data.
bytes stdout;
// The `stderr` data.
bytes stderr;
}
/// Information on the chain and fork.
struct ChainInfo {
// The fork identifier. Set to zero if no fork is active.
uint256 forkId;
// The chain ID of the current fork.
uint256 chainId;
}
/// The result of a `stopAndReturnStateDiff` call.
struct AccountAccess {
// The chain and fork the access occurred.
ChainInfo chainInfo;
// The kind of account access that determines what the account is.
// If kind is Call, DelegateCall, StaticCall or CallCode, then the account is the callee.
// If kind is Create, then the account is the newly created account.
// If kind is SelfDestruct, then the account is the selfdestruct recipient.
// If kind is a Resume, then account represents a account context that has resumed.
AccountAccessKind kind;
// The account that was accessed.
// It's either the account created, callee or a selfdestruct recipient for CREATE, CALL or SELFDESTRUCT.
address account;
// What accessed the account.
address accessor;
// If the account was initialized or empty prior to the access.
// An account is considered initialized if it has code, a
// non-zero nonce, or a non-zero balance.
bool initialized;
// The previous balance of the accessed account.
uint256 oldBalance;
// The potential new balance of the accessed account.
// That is, all balance changes are recorded here, even if reverts occurred.
uint256 newBalance;
// Code of the account deployed by CREATE.
bytes deployedCode;
// Value passed along with the account access
uint256 value;
// Input data provided to the CREATE or CALL
bytes data;
// If this access reverted in either the current or parent context.
bool reverted;
// An ordered list of storage accesses made during an account access operation.
StorageAccess[] storageAccesses;
// Call depth traversed during the recording of state differences
uint64 depth;
}
/// The storage accessed during an `AccountAccess`.
struct StorageAccess {
// The account whose storage was accessed.
address account;
// The slot that was accessed.
bytes32 slot;
// If the access was a write.
bool isWrite;
// The previous value of the slot.
bytes32 previousValue;
// The new value of the slot.
bytes32 newValue;
// If the access was reverted.
bool reverted;
}
/// Gas used. Returned by `lastCallGas`.
struct Gas {
// The gas limit of the call.
uint64 gasLimit;
// The total gas used.
uint64 gasTotalUsed;
// DEPRECATED: The amount of gas used for memory expansion. Ref: <https://github.com/foundry-rs/foundry/pull/7934#pullrequestreview-2069236939>
uint64 gasMemoryUsed;
// The amount of gas refunded.
int64 gasRefunded;
// The amount of gas remaining.
uint64 gasRemaining;
}
// ======== Environment ========
/// Gets the environment variable `name` and parses it as `address`.
/// Reverts if the variable was not found or could not be parsed.
function envAddress(string calldata name) external view returns (address value);
/// Gets the environment variable `name` and parses it as an array of `address`, delimited by `delim`.
/// Reverts if the variable was not found or could not be parsed.
function envAddress(string calldata name, string calldata delim) external view returns (address[] memory value);
/// Gets the environment variable `name` and parses it as `bool`.
/// Reverts if the variable was not found or could not be parsed.
function envBool(string calldata name) external view returns (bool value);
/// Gets the environment variable `name` and parses it as an array of `bool`, delimited by `delim`.
/// Reverts if the variable was not found or could not be parsed.
function envBool(string calldata name, string calldata delim) external view returns (bool[] memory value);
/// Gets the environment variable `name` and parses it as `bytes32`.
/// Reverts if the variable was not found or could not be parsed.
function envBytes32(string calldata name) external view returns (bytes32 value);
/// Gets the environment variable `name` and parses it as an array of `bytes32`, delimited by `delim`.
/// Reverts if the variable was not found or could not be parsed.
function envBytes32(string calldata name, string calldata delim) external view returns (bytes32[] memory value);
/// Gets the environment variable `name` and parses it as `bytes`.
/// Reverts if the variable was not found or could not be parsed.
function envBytes(string calldata name) external view returns (bytes memory value);
/// Gets the environment variable `name` and parses it as an array of `bytes`, delimited by `delim`.
/// Reverts if the variable was not found or could not be parsed.
function envBytes(string calldata name, string calldata delim) external view returns (bytes[] memory value);
/// Gets the environment variable `name` and returns true if it exists, else returns false.
function envExists(string calldata name) external view returns (bool result);
/// Gets the environment variable `name` and parses it as `int256`.
/// Reverts if the variable was not found or could not be parsed.
function envInt(string calldata name) external view returns (int256 value);
/// Gets the environment variable `name` and parses it as an array of `int256`, delimited by `delim`.
/// Reverts if the variable was not found or could not be parsed.
function envInt(string calldata name, string calldata delim) external view returns (int256[] memory value);
/// Gets the environment variable `name` and parses it as `bool`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, bool defaultValue) external view returns (bool value);
/// Gets the environment variable `name` and parses it as `uint256`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, uint256 defaultValue) external view returns (uint256 value);
/// Gets the environment variable `name` and parses it as an array of `address`, delimited by `delim`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, string calldata delim, address[] calldata defaultValue)
external
view
returns (address[] memory value);
/// Gets the environment variable `name` and parses it as an array of `bytes32`, delimited by `delim`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, string calldata delim, bytes32[] calldata defaultValue)
external
view
returns (bytes32[] memory value);
/// Gets the environment variable `name` and parses it as an array of `string`, delimited by `delim`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, string calldata delim, string[] calldata defaultValue)
external
view
returns (string[] memory value);
/// Gets the environment variable `name` and parses it as an array of `bytes`, delimited by `delim`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, string calldata delim, bytes[] calldata defaultValue)
external
view
returns (bytes[] memory value);
/// Gets the environment variable `name` and parses it as `int256`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, int256 defaultValue) external view returns (int256 value);
/// Gets the environment variable `name` and parses it as `address`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, address defaultValue) external view returns (address value);
/// Gets the environment variable `name` and parses it as `bytes32`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, bytes32 defaultValue) external view returns (bytes32 value);
/// Gets the environment variable `name` and parses it as `string`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, string calldata defaultValue) external view returns (string memory value);
/// Gets the environment variable `name` and parses it as `bytes`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, bytes calldata defaultValue) external view returns (bytes memory value);
/// Gets the environment variable `name` and parses it as an array of `bool`, delimited by `delim`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, string calldata delim, bool[] calldata defaultValue)
external
view
returns (bool[] memory value);
/// Gets the environment variable `name` and parses it as an array of `uint256`, delimited by `delim`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, string calldata delim, uint256[] calldata defaultValue)
external
view
returns (uint256[] memory value);
/// Gets the environment variable `name` and parses it as an array of `int256`, delimited by `delim`.
/// Reverts if the variable could not be parsed.
/// Returns `defaultValue` if the variable was not found.
function envOr(string calldata name, string calldata delim, int256[] calldata defaultValue)
external
view
returns (int256[] memory value);
/// Gets the environment variable `name` and parses it as `string`.
/// Reverts if the variable was not found or could not be parsed.
function envString(string calldata name) external view returns (string memory value);
/// Gets the environment variable `name` and parses it as an array of `string`, delimited by `delim`.
/// Reverts if the variable was not found or could not be parsed.
function envString(string calldata name, string calldata delim) external view returns (string[] memory value);
/// Gets the environment variable `name` and parses it as `uint256`.
/// Reverts if the variable was not found or could not be parsed.
function envUint(string calldata name) external view returns (uint256 value);
/// Gets the environment variable `name` and parses it as an array of `uint256`, delimited by `delim`.
/// Reverts if the variable was not found or could not be parsed.
function envUint(string calldata name, string calldata delim) external view returns (uint256[] memory value);
/// Returns true if `forge` command was executed in given context.
function isContext(ForgeContext context) external view returns (bool result);
/// Sets environment variables.
function setEnv(string calldata name, string calldata value) external;
// ======== EVM ========
/// Gets all accessed reads and write slot from a `vm.record` session, for a given address.
function accesses(address target) external returns (bytes32[] memory readSlots, bytes32[] memory writeSlots);
/// Gets the address for a given private key.
function addr(uint256 privateKey) external pure returns (address keyAddr);
/// Gets all the logs according to specified filter.
function eth_getLogs(uint256 fromBlock, uint256 toBlock, address target, bytes32[] calldata topics)
external
returns (EthGetLogs[] memory logs);
/// Gets the current `block.blobbasefee`.
/// You should use this instead of `block.blobbasefee` if you use `vm.blobBaseFee`, as `block.blobbasefee` is assumed to be constant across a transaction,
/// and as a result will get optimized out by the compiler.
/// See https://github.com/foundry-rs/foundry/issues/6180
function getBlobBaseFee() external view returns (uint256 blobBaseFee);
/// Gets the current `block.number`.
/// You should use this instead of `block.number` if you use `vm.roll`, as `block.number` is assumed to be constant across a transaction,
/// and as a result will get optimized out by the compiler.
/// See https://github.com/foundry-rs/foundry/issues/6180
function getBlockNumber() external view returns (uint256 height);
/// Gets the current `block.timestamp`.
/// You should use this instead of `block.timestamp` if you use `vm.warp`, as `block.timestamp` is assumed to be constant across a transaction,
/// and as a result will get optimized out by the compiler.
/// See https://github.com/foundry-rs/foundry/issues/6180
function getBlockTimestamp() external view returns (uint256 timestamp);
/// Gets the map key and parent of a mapping at a given slot, for a given address.
function getMappingKeyAndParentOf(address target, bytes32 elementSlot)
external
returns (bool found, bytes32 key, bytes32 parent);
/// Gets the number of elements in the mapping at the given slot, for a given address.
function getMappingLength(address target, bytes32 mappingSlot) external returns (uint256 length);
/// Gets the elements at index idx of the mapping at the given slot, for a given address. The
/// index must be less than the length of the mapping (i.e. the number of keys in the mapping).
function getMappingSlotAt(address target, bytes32 mappingSlot, uint256 idx) external returns (bytes32 value);
/// Gets the nonce of an account.
function getNonce(address account) external view returns (uint64 nonce);
/// Gets all the recorded logs.
function getRecordedLogs() external returns (Log[] memory logs);
/// Gets the gas used in the last call.
function lastCallGas() external view returns (Gas memory gas);
/// Loads a storage slot from an address.
function load(address target, bytes32 slot) external view returns (bytes32 data);
/// Pauses gas metering (i.e. gas usage is not counted). Noop if already paused.
function pauseGasMetering() external;
/// Records all storage reads and writes.
function record() external;
/// Record all the transaction logs.
function recordLogs() external;
/// Resumes gas metering (i.e. gas usage is counted again). Noop if already on.
function resumeGasMetering() external;
/// Performs an Ethereum JSON-RPC request to the current fork URL.
function rpc(string calldata method, string calldata params) external returns (bytes memory data);
/// Signs `digest` with `privateKey` using the secp256r1 curve.
function signP256(uint256 privateKey, bytes32 digest) external pure returns (bytes32 r, bytes32 s);
/// Signs `digest` with `privateKey` using the secp256k1 curve.
function sign(uint256 privateKey, bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s);
/// Signs `digest` with signer provided to script using the secp256k1 curve.
/// If `--sender` is provided, the signer with provided address is used, otherwise,
/// if exactly one signer is provided to the script, that signer is used.
/// Raises error if signer passed through `--sender` does not match any unlocked signers or
/// if `--sender` is not provided and not exactly one signer is passed to the script.
function sign(bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s);
/// Signs `digest` with signer provided to script using the secp256k1 curve.
/// Raises error if none of the signers passed into the script have provided address.
function sign(address signer, bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s);
/// Starts recording all map SSTOREs for later retrieval.
function startMappingRecording() external;
/// Record all account accesses as part of CREATE, CALL or SELFDESTRUCT opcodes in order,
/// along with the context of the calls
function startStateDiffRecording() external;
/// Returns an ordered array of all account accesses from a `vm.startStateDiffRecording` session.
function stopAndReturnStateDiff() external returns (AccountAccess[] memory accountAccesses);
/// Stops recording all map SSTOREs for later retrieval and clears the recorded data.
function stopMappingRecording() external;
// ======== Filesystem ========
/// Closes file for reading, resetting the offset and allowing to read it from beginning with readLine.
/// `path` is relative to the project root.
function closeFile(string calldata path) external;
/// Copies the contents of one file to another. This function will **overwrite** the contents of `to`.
/// On success, the total number of bytes copied is returned and it is equal to the length of the `to` file as reported by `metadata`.
/// Both `from` and `to` are relative to the project root.
function copyFile(string calldata from, string calldata to) external returns (uint64 copied);
/// Creates a new, empty directory at the provided path.
/// This cheatcode will revert in the following situations, but is not limited to just these cases:
/// - User lacks permissions to modify `path`.
/// - A parent of the given path doesn't exist and `recursive` is false.
/// - `path` already exists and `recursive` is false.
/// `path` is relative to the project root.
function createDir(string calldata path, bool recursive) external;
/// Returns true if the given path points to an existing entity, else returns false.
function exists(string calldata path) external returns (bool result);
/// Performs a foreign function call via the terminal.
function ffi(string[] calldata commandInput) external returns (bytes memory result);
/// Given a path, query the file system to get information about a file, directory, etc.
function fsMetadata(string calldata path) external view returns (FsMetadata memory metadata);
/// Gets the creation bytecode from an artifact file. Takes in the relative path to the json file or the path to the
/// artifact in the form of <path>:<contract>:<version> where <contract> and <version> parts are optional.
function getCode(string calldata artifactPath) external view returns (bytes memory creationBytecode);
/// Gets the deployed bytecode from an artifact file. Takes in the relative path to the json file or the path to the
/// artifact in the form of <path>:<contract>:<version> where <contract> and <version> parts are optional.
function getDeployedCode(string calldata artifactPath) external view returns (bytes memory runtimeBytecode);
/// Returns true if the path exists on disk and is pointing at a directory, else returns false.
function isDir(string calldata path) external returns (bool result);
/// Returns true if the path exists on disk and is pointing at a regular file, else returns false.
function isFile(string calldata path) external returns (bool result);
/// Get the path of the current project root.
function projectRoot() external view returns (string memory path);
/// Prompts the user for a string value in the terminal.
function prompt(string calldata promptText) external returns (string memory input);
/// Prompts the user for an address in the terminal.
function promptAddress(string calldata promptText) external returns (address);
/// Prompts the user for a hidden string value in the terminal.
function promptSecret(string calldata promptText) external returns (string memory input);
/// Prompts the user for hidden uint256 in the terminal (usually pk).
function promptSecretUint(string calldata promptText) external returns (uint256);
/// Prompts the user for uint256 in the terminal.
function promptUint(string calldata promptText) external returns (uint256);
/// Reads the directory at the given path recursively, up to `maxDepth`.
/// `maxDepth` defaults to 1, meaning only the direct children of the given directory will be returned.
/// Follows symbolic links if `followLinks` is true.
function readDir(string calldata path) external view returns (DirEntry[] memory entries);
/// See `readDir(string)`.
function readDir(string calldata path, uint64 maxDepth) external view returns (DirEntry[] memory entries);
/// See `readDir(string)`.
function readDir(string calldata path, uint64 maxDepth, bool followLinks)
external
view
returns (DirEntry[] memory entries);
/// Reads the entire content of file to string. `path` is relative to the project root.
function readFile(string calldata path) external view returns (string memory data);
/// Reads the entire content of file as binary. `path` is relative to the project root.
function readFileBinary(string calldata path) external view returns (bytes memory data);
/// Reads next line of file to string.
function readLine(string calldata path) external view returns (string memory line);
/// Reads a symbolic link, returning the path that the link points to.
/// This cheatcode will revert in the following situations, but is not limited to just these cases:
/// - `path` is not a symbolic link.
/// - `path` does not exist.
function readLink(string calldata linkPath) external view returns (string memory targetPath);
/// Removes a directory at the provided path.
/// This cheatcode will revert in the following situations, but is not limited to just these cases:
/// - `path` doesn't exist.
/// - `path` isn't a directory.
/// - User lacks permissions to modify `path`.
/// - The directory is not empty and `recursive` is false.
/// `path` is relative to the project root.
function removeDir(string calldata path, bool recursive) external;
/// Removes a file from the filesystem.
/// This cheatcode will revert in the following situations, but is not limited to just these cases:
/// - `path` points to a directory.
/// - The file doesn't exist.
/// - The user lacks permissions to remove the file.
/// `path` is relative to the project root.
function removeFile(string calldata path) external;
/// Performs a foreign function call via terminal and returns the exit code, stdout, and stderr.
function tryFfi(string[] calldata commandInput) external returns (FfiResult memory result);
/// Returns the time since unix epoch in milliseconds.
function unixTime() external returns (uint256 milliseconds);
/// Writes data to file, creating a file if it does not exist, and entirely replacing its contents if it does.
/// `path` is relative to the project root.
function writeFile(string calldata path, string calldata data) external;
/// Writes binary data to a file, creating a file if it does not exist, and entirely replacing its contents if it does.
/// `path` is relative to the project root.
function writeFileBinary(string calldata path, bytes calldata data) external;
/// Writes line to file, creating a file if it does not exist.
/// `path` is relative to the project root.
function writeLine(string calldata path, string calldata data) external;
// ======== JSON ========
/// Checks if `key` exists in a JSON object
/// `keyExists` is being deprecated in favor of `keyExistsJson`. It will be removed in future versions.
function keyExists(string calldata json, string calldata key) external view returns (bool);
/// Checks if `key` exists in a JSON object.
function keyExistsJson(string calldata json, string calldata key) external view returns (bool);
/// Parses a string of JSON data at `key` and coerces it to `address`.
function parseJsonAddress(string calldata json, string calldata key) external pure returns (address);
/// Parses a string of JSON data at `key` and coerces it to `address[]`.
function parseJsonAddressArray(string calldata json, string calldata key)
external
pure
returns (address[] memory);
/// Parses a string of JSON data at `key` and coerces it to `bool`.
function parseJsonBool(string calldata json, string calldata key) external pure returns (bool);
/// Parses a string of JSON data at `key` and coerces it to `bool[]`.
function parseJsonBoolArray(string calldata json, string calldata key) external pure returns (bool[] memory);
/// Parses a string of JSON data at `key` and coerces it to `bytes`.
function parseJsonBytes(string calldata json, string calldata key) external pure returns (bytes memory);
/// Parses a string of JSON data at `key` and coerces it to `bytes32`.
function parseJsonBytes32(string calldata json, string calldata key) external pure returns (bytes32);
/// Parses a string of JSON data at `key` and coerces it to `bytes32[]`.
function parseJsonBytes32Array(string calldata json, string calldata key)
external
pure
returns (bytes32[] memory);
/// Parses a string of JSON data at `key` and coerces it to `bytes[]`.
function parseJsonBytesArray(string calldata json, string calldata key) external pure returns (bytes[] memory);
/// Parses a string of JSON data at `key` and coerces it to `int256`.
function parseJsonInt(string calldata json, string calldata key) external pure returns (int256);
/// Parses a string of JSON data at `key` and coerces it to `int256[]`.
function parseJsonIntArray(string calldata json, string calldata key) external pure returns (int256[] memory);
/// Returns an array of all the keys in a JSON object.
function parseJsonKeys(string calldata json, string calldata key) external pure returns (string[] memory keys);
/// Parses a string of JSON data at `key` and coerces it to `string`.
function parseJsonString(string calldata json, string calldata key) external pure returns (string memory);
/// Parses a string of JSON data at `key` and coerces it to `string[]`.
function parseJsonStringArray(string calldata json, string calldata key) external pure returns (string[] memory);
/// Parses a string of JSON data at `key` and coerces it to `uint256`.
function parseJsonUint(string calldata json, string calldata key) external pure returns (uint256);
/// Parses a string of JSON data at `key` and coerces it to `uint256[]`.
function parseJsonUintArray(string calldata json, string calldata key) external pure returns (uint256[] memory);
/// ABI-encodes a JSON object.
function parseJson(string calldata json) external pure returns (bytes memory abiEncodedData);
/// ABI-encodes a JSON object at `key`.
function parseJson(string calldata json, string calldata key) external pure returns (bytes memory abiEncodedData);
/// See `serializeJson`.
function serializeAddress(string calldata objectKey, string calldata valueKey, address value)
external
returns (string memory json);
/// See `serializeJson`.
function serializeAddress(string calldata objectKey, string calldata valueKey, address[] calldata values)
external
returns (string memory json);
/// See `serializeJson`.
function serializeBool(string calldata objectKey, string calldata valueKey, bool value)
external
returns (string memory json);
/// See `serializeJson`.
function serializeBool(string calldata objectKey, string calldata valueKey, bool[] calldata values)
external
returns (string memory json);
/// See `serializeJson`.
function serializeBytes32(string calldata objectKey, string calldata valueKey, bytes32 value)
external
returns (string memory json);
/// See `serializeJson`.
function serializeBytes32(string calldata objectKey, string calldata valueKey, bytes32[] calldata values)
external
returns (string memory json);
/// See `serializeJson`.
function serializeBytes(string calldata objectKey, string calldata valueKey, bytes calldata value)
external
returns (string memory json);
/// See `serializeJson`.
function serializeBytes(string calldata objectKey, string calldata valueKey, bytes[] calldata values)
external
returns (string memory json);
/// See `serializeJson`.
function serializeInt(string calldata objectKey, string calldata valueKey, int256 value)
external
returns (string memory json);
/// See `serializeJson`.
function serializeInt(string calldata objectKey, string calldata valueKey, int256[] calldata values)
external
returns (string memory json);
/// Serializes a key and value to a JSON object stored in-memory that can be later written to a file.
/// Returns the stringified version of the specific JSON file up to that moment.
function serializeJson(string calldata objectKey, string calldata value) external returns (string memory json);
/// See `serializeJson`.
function serializeString(string calldata objectKey, string calldata valueKey, string calldata value)
external
returns (string memory json);
/// See `serializeJson`.
function serializeString(string calldata objectKey, string calldata valueKey, string[] calldata values)
external
returns (string memory json);
/// See `serializeJson`.
function serializeUintToHex(string calldata objectKey, string calldata valueKey, uint256 value)
external
returns (string memory json);
/// See `serializeJson`.
function serializeUint(string calldata objectKey, string calldata valueKey, uint256 value)
external
returns (string memory json);
/// See `serializeJson`.
function serializeUint(string calldata objectKey, string calldata valueKey, uint256[] calldata values)
external
returns (string memory json);
/// Write a serialized JSON object to a file. If the file exists, it will be overwritten.
function writeJson(string calldata json, string calldata path) external;
/// Write a serialized JSON object to an **existing** JSON file, replacing a value with key = <value_key.>
/// This is useful to replace a specific value of a JSON file, without having to parse the entire thing.
function writeJson(string calldata json, string calldata path, string calldata valueKey) external;
// ======== Scripting ========
/// Has the next call (at this call depth only) create transactions that can later be signed and sent onchain.
/// Broadcasting address is determined by checking the following in order:
/// 1. If `--sender` argument was provided, that address is used.
/// 2. If exactly one signer (e.g. private key, hw wallet, keystore) is set when `forge broadcast` is invoked, that signer is used.
/// 3. Otherwise, default foundry sender (1804c8AB1F12E6bbf3894d4083f33e07309d1f38) is used.
function broadcast() external;
/// Has the next call (at this call depth only) create a transaction with the address provided
/// as the sender that can later be signed and sent onchain.
function broadcast(address signer) external;
/// Has the next call (at this call depth only) create a transaction with the private key
/// provided as the sender that can later be signed and sent onchain.
function broadcast(uint256 privateKey) external;
/// Has all subsequent calls (at this call depth only) create transactions that can later be signed and sent onchain.
/// Broadcasting address is determined by checking the following in order:
/// 1. If `--sender` argument was provided, that address is used.
/// 2. If exactly one signer (e.g. private key, hw wallet, keystore) is set when `forge broadcast` is invoked, that signer is used.
/// 3. Otherwise, default foundry sender (1804c8AB1F12E6bbf3894d4083f33e07309d1f38) is used.
function startBroadcast() external;
/// Has all subsequent calls (at this call depth only) create transactions with the address
/// provided that can later be signed and sent onchain.
function startBroadcast(address signer) external;
/// Has all subsequent calls (at this call depth only) create transactions with the private key
/// provided that can later be signed and sent onchain.
function startBroadcast(uint256 privateKey) external;
/// Stops collecting onchain transactions.
function stopBroadcast() external;
// ======== String ========
/// Returns the index of the first occurrence of a `key` in an `input` string.
/// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `key` is not found.
/// Returns 0 in case of an empty `key`.
function indexOf(string calldata input, string calldata key) external pure returns (uint256);
/// Parses the given `string` into an `address`.
function parseAddress(string calldata stringifiedValue) external pure returns (address parsedValue);
/// Parses the given `string` into a `bool`.
function parseBool(string calldata stringifiedValue) external pure returns (bool parsedValue);
/// Parses the given `string` into `bytes`.
function parseBytes(string calldata stringifiedValue) external pure returns (bytes memory parsedValue);
/// Parses the given `string` into a `bytes32`.
function parseBytes32(string calldata stringifiedValue) external pure returns (bytes32 parsedValue);
/// Parses the given `string` into a `int256`.
function parseInt(string calldata stringifiedValue) external pure returns (int256 parsedValue);
/// Parses the given `string` into a `uint256`.
function parseUint(string calldata stringifiedValue) external pure returns (uint256 parsedValue);
/// Replaces occurrences of `from` in the given `string` with `to`.
function replace(string calldata input, string calldata from, string calldata to)
external
pure
returns (string memory output);
/// Splits the given `string` into an array of strings divided by the `delimiter`.
function split(string calldata input, string calldata delimiter) external pure returns (string[] memory outputs);
/// Converts the given `string` value to Lowercase.
function toLowercase(string calldata input) external pure returns (string memory output);
/// Converts the given value to a `string`.
function toString(address value) external pure returns (string memory stringifiedValue);
/// Converts the given value to a `string`.
function toString(bytes calldata value) external pure returns (string memory stringifiedValue);
/// Converts the given value to a `string`.
function toString(bytes32 value) external pure returns (string memory stringifiedValue);
/// Converts the given value to a `string`.
function toString(bool value) external pure returns (string memory stringifiedValue);
/// Converts the given value to a `string`.
function toString(uint256 value) external pure returns (string memory stringifiedValue);
/// Converts the given value to a `string`.
function toString(int256 value) external pure returns (string memory stringifiedValue);
/// Converts the given `string` value to Uppercase.
function toUppercase(string calldata input) external pure returns (string memory output);
/// Trims leading and trailing whitespace from the given `string` value.
function trim(string calldata input) external pure returns (string memory output);
// ======== Testing ========
/// Compares two `uint256` values. Expects difference to be less than or equal to `maxDelta`.
/// Formats values with decimals in failure message.
function assertApproxEqAbsDecimal(uint256 left, uint256 right, uint256 maxDelta, uint256 decimals) external pure;
/// Compares two `uint256` values. Expects difference to be less than or equal to `maxDelta`.
/// Formats values with decimals in failure message. Includes error message into revert string on failure.
function assertApproxEqAbsDecimal(
uint256 left,
uint256 right,
uint256 maxDelta,
uint256 decimals,
string calldata error
) external pure;
/// Compares two `int256` values. Expects difference to be less than or equal to `maxDelta`.
/// Formats values with decimals in failure message.
function assertApproxEqAbsDecimal(int256 left, int256 right, uint256 maxDelta, uint256 decimals) external pure;
/// Compares two `int256` values. Expects difference to be less than or equal to `maxDelta`.
/// Formats values with decimals in failure message. Includes error message into revert string on failure.
function assertApproxEqAbsDecimal(
int256 left,
int256 right,
uint256 maxDelta,
uint256 decimals,
string calldata error
) external pure;
/// Compares two `uint256` values. Expects difference to be less than or equal to `maxDelta`.
function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta) external pure;
/// Compares two `uint256` values. Expects difference to be less than or equal to `maxDelta`.
/// Includes error message into revert string on failure.
function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta, string calldata error) external pure;
/// Compares two `int256` values. Expects difference to be less than or equal to `maxDelta`.
function assertApproxEqAbs(int256 left, int256 right, uint256 maxDelta) external pure;
/// Compares two `int256` values. Expects difference to be less than or equal to `maxDelta`.
/// Includes error message into revert string on failure.
function assertApproxEqAbs(int256 left, int256 right, uint256 maxDelta, string calldata error) external pure;
/// Compares two `uint256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
/// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
/// Formats values with decimals in failure message.
function assertApproxEqRelDecimal(uint256 left, uint256 right, uint256 maxPercentDelta, uint256 decimals)
external
pure;
/// Compares two `uint256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
/// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
/// Formats values with decimals in failure message. Includes error message into revert string on failure.
function assertApproxEqRelDecimal(
uint256 left,
uint256 right,
uint256 maxPercentDelta,
uint256 decimals,
string calldata error
) external pure;
/// Compares two `int256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
/// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
/// Formats values with decimals in failure message.
function assertApproxEqRelDecimal(int256 left, int256 right, uint256 maxPercentDelta, uint256 decimals)
external
pure;
/// Compares two `int256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
/// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
/// Formats values with decimals in failure message. Includes error message into revert string on failure.
function assertApproxEqRelDecimal(
int256 left,
int256 right,
uint256 maxPercentDelta,
uint256 decimals,
string calldata error
) external pure;
/// Compares two `uint256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
/// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
function assertApproxEqRel(uint256 left, uint256 right, uint256 maxPercentDelta) external pure;
/// Compares two `uint256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
/// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
/// Includes error message into revert string on failure.
function assertApproxEqRel(uint256 left, uint256 right, uint256 maxPercentDelta, string calldata error)
external
pure;
/// Compares two `int256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
/// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
function assertApproxEqRel(int256 left, int256 right, uint256 maxPercentDelta) external pure;
/// Compares two `int256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
/// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
/// Includes error message into revert string on failure.
function assertApproxEqRel(int256 left, int256 right, uint256 maxPercentDelta, string calldata error)
external
pure;
/// Asserts that two `uint256` values are equal, formatting them with decimals in failure message.
function assertEqDecimal(uint256 left, uint256 right, uint256 decimals) external pure;
/// Asserts that two `uint256` values are equal, formatting them with decimals in failure message.
/// Includes error message into revert string on failure.
function assertEqDecimal(uint256 left, uint256 right, uint256 decimals, string calldata error) external pure;
/// Asserts that two `int256` values are equal, formatting them with decimals in failure message.
function assertEqDecimal(int256 left, int256 right, uint256 decimals) external pure;
/// Asserts that two `int256` values are equal, formatting them with decimals in failure message.
/// Includes error message into revert string on failure.
function assertEqDecimal(int256 left, int256 right, uint256 decimals, string calldata error) external pure;
/// Asserts that two `bool` values are equal.
function assertEq(bool left, bool right) external pure;
/// Asserts that two `bool` values are equal and includes error message into revert string on failure.
function assertEq(bool left, bool right, string calldata error) external pure;
/// Asserts that two `string` values are equal.
function assertEq(string calldata left, string calldata right) external pure;
/// Asserts that two `string` values are equal and includes error message into revert string on failure.
function assertEq(string calldata left, string calldata right, string calldata error) external pure;
/// Asserts that two `bytes` values are equal.
function assertEq(bytes calldata left, bytes calldata right) external pure;
/// Asserts that two `bytes` values are equal and includes error message into revert string on failure.
function assertEq(bytes calldata left, bytes calldata right, string calldata error) external pure;
/// Asserts that two arrays of `bool` values are equal.
function assertEq(bool[] calldata left, bool[] calldata right) external pure;
/// Asserts that two arrays of `bool` values are equal and includes error message into revert string on failure.
function assertEq(bool[] calldata left, bool[] calldata right, string calldata error) external pure;
/// Asserts that two arrays of `uint256 values are equal.
function assertEq(uint256[] calldata left, uint256[] calldata right) external pure;
/// Asserts that two arrays of `uint256` values are equal and includes error message into revert string on failure.
function assertEq(uint256[] calldata left, uint256[] calldata right, string calldata error) external pure;
/// Asserts that two arrays of `int256` values are equal.
function assertEq(int256[] calldata left, int256[] calldata right) external pure;
/// Asserts that two arrays of `int256` values are equal and includes error message into revert string on failure.
function assertEq(int256[] calldata left, int256[] calldata right, string calldata error) external pure;
/// Asserts that two `uint256` values are equal.
function assertEq(uint256 left, uint256 right) external pure;
/// Asserts that two arrays of `address` values are equal.
function assertEq(address[] calldata left, address[] calldata right) external pure;
/// Asserts that two arrays of `address` values are equal and includes error message into revert string on failure.
function assertEq(address[] calldata left, address[] calldata right, string calldata error) external pure;
/// Asserts that two arrays of `bytes32` values are equal.
function assertEq(bytes32[] calldata left, bytes32[] calldata right) external pure;
/// Asserts that two arrays of `bytes32` values are equal and includes error message into revert string on failure.
function assertEq(bytes32[] calldata left, bytes32[] calldata right, string calldata error) external pure;
/// Asserts that two arrays of `string` values are equal.
function assertEq(string[] calldata left, string[] calldata right) external pure;
/// Asserts that two arrays of `string` values are equal and includes error message into revert string on failure.
function assertEq(string[] calldata left, string[] calldata right, string calldata error) external pure;
/// Asserts that two arrays of `bytes` values are equal.
function assertEq(bytes[] calldata left, bytes[] calldata right) external pure;
/// Asserts that two arrays of `bytes` values are equal and includes error message into revert string on failure.
function assertEq(bytes[] calldata left, bytes[] calldata right, string calldata error) external pure;
/// Asserts that two `uint256` values are equal and includes error message into revert string on failure.
function assertEq(uint256 left, uint256 right, string calldata error) external pure;
/// Asserts that two `int256` values are equal.
function assertEq(int256 left, int256 right) external pure;
/// Asserts that two `int256` values are equal and includes error message into revert string on failure.
function assertEq(int256 left, int256 right, string calldata error) external pure;
/// Asserts that two `address` values are equal.
function assertEq(address left, address right) external pure;
/// Asserts that two `address` values are equal and includes error message into revert string on failure.
function assertEq(address left, address right, string calldata error) external pure;
/// Asserts that two `bytes32` values are equal.
function assertEq(bytes32 left, bytes32 right) external pure;
/// Asserts that two `bytes32` values are equal and includes error message into revert string on failure.
function assertEq(bytes32 left, bytes32 right, string calldata error) external pure;
/// Asserts that the given condition is false.
function assertFalse(bool condition) external pure;
/// Asserts that the given condition is false and includes error message into revert string on failure.
function assertFalse(bool condition, string calldata error) external pure;
/// Compares two `uint256` values. Expects first value to be greater than or equal to second.
/// Formats values with decimals in failure message.
function assertGeDecimal(uint256 left, uint256 right, uint256 decimals) external pure;
/// Compares two `uint256` values. Expects first value to be greater than or equal to second.
/// Formats values with decimals in failure message. Includes error message into revert string on failure.
function assertGeDecimal(uint256 left, uint256 right, uint256 decimals, string calldata error) external pure;
/// Compares two `int256` values. Expects first value to be greater than or equal to second.
/// Formats values with decimals in failure message.
function assertGeDecimal(int256 left, int256 right, uint256 decimals) external pure;
/// Compares two `int256` values. Expects first value to be greater than or equal to second.
/// Formats values with decimals in failure message. Includes error message into revert string on failure.
function assertGeDecimal(int256 left, int256 right, uint256 decimals, string calldata error) external pure;
/// Compares two `uint256` values. Expects first value to be greater than or equal to second.
function assertGe(uint256 left, uint256 right) external pure;
/// Compares two `uint256` values. Expects first value to be greater than or equal to second.
/// Includes error message into revert string on failure.
function assertGe(uint256 left, uint256 right, string calldata error) external pure;
/// Compares two `int256` values. Expects first value to be greater than or equal to second.
function assertGe(int256 left, int256 right) external pure;
/// Compares two `int256` values. Expects first value to be greater than or equal to second.
/// Includes error message into revert string on failure.
function assertGe(int256 left, int256 right, string calldata error) external pure;
/// Compares two `uint256` values. Expects first value to be greater than second.
/// Formats values with decimals in failure message.
function assertGtDecimal(uint256 left, uint256 right, uint256 decimals) external pure;
/// Compares two `uint256` values. Expects first value to be greater than second.
/// Formats values with decimals in failure message. Includes error message into revert string on failure.
function assertGtDecimal(uint256 left, uint256 right, uint256 decimals, string calldata error) external pure;
/// Compares two `int256` values. Expects first value to be greater than second.
/// Formats values with decimals in failure message.
function assertGtDecimal(int256 left, int256 right, uint256 decimals) external pure;
/// Compares two `int256` values. Expects first value to be greater than second.
/// Formats values with decimals in failure message. Includes error message into revert string on failure.
function assertGtDecimal(int256 left, int256 right, uint256 decimals, string calldata error) external pure;
/// Compares two `uint256` values. Expects first value to be greater than second.
function assertGt(uint256 left, uint256 right) external pure;
/// Compares two `uint256` values. Expects first value to be greater than second.
/// Includes error message into revert string on failure.
function assertGt(uint256 left, uint256 right, string calldata error) external pure;
/// Compares two `int256` values. Expects first value to be greater than second.
function assertGt(int256 left, int256 right) external pure;
/// Compares two `int256` values. Expects first value to be greater than second.
/// Includes error message into revert string on failure.
function assertGt(int256 left, int256 right, string calldata error) external pure;
/// Compares two `uint256` values. Expects first value to be less than or equal to second.
/// Formats values with decimals in failure message.
function assertLeDecimal(uint256 left, uint256 right, uint256 decimals) external pure;
/// Compares two `uint256` values. Expects first value to be less than or equal to second.
/// Formats values with decimals in failure message. Includes error message into revert string on failure.
function assertLeDecimal(uint256 left, uint256 right, uint256 decimals, string calldata error) external pure;
/// Compares two `int256` values. Expects first value to be less than or equal to second.
/// Formats values with decimals in failure message.
function assertLeDecimal(int256 left, int256 right, uint256 decimals) external pure;
/// Compares two `int256` values. Expects first value to be less than or equal to second.
/// Formats values with decimals in failure message. Includes error message into revert string on failure.
function assertLeDecimal(int256 left, int256 right, uint256 decimals, string calldata error) external pure;
/// Compares two `uint256` values. Expects first value to be less than or equal to second.
function assertLe(uint256 left, uint256 right) external pure;
/// Compares two `uint256` values. Expects first value to be less than or equal to second.
/// Includes error message into revert string on failure.
function assertLe(uint256 left, uint256 right, string calldata error) external pure;
/// Compares two `int256` values. Expects first value to be less than or equal to second.
function assertLe(int256 left, int256 right) external pure;
/// Compares two `int256` values. Expects first value to be less than or equal to second.
/// Includes error message into revert string on failure.
function assertLe(int256 left, int256 right, string calldata error) external pure;
/// Compares two `uint256` values. Expects first value to be less than second.
/// Formats values with decimals in failure message.
function assertLtDecimal(uint256 left, uint256 right, uint256 decimals) external pure;
/// Compares two `uint256` values. Expects first value to be less than second.
/// Formats values with decimals in failure message. Includes error message into revert string on failure.
function assertLtDecimal(uint256 left, uint256 right, uint256 decimals, string calldata error) external pure;
/// Compares two `int256` values. Expects first value to be less than second.
/// Formats values with decimals in failure message.
function assertLtDecimal(int256 left, int256 right, uint256 decimals) external pure;
/// Compares two `int256` values. Expects first value to be less than second.
/// Formats values with decimals in failure message. Includes error message into revert string on failure.
function assertLtDecimal(int256 left, int256 right, uint256 decimals, string calldata error) external pure;
/// Compares two `uint256` values. Expects first value to be less than second.
function assertLt(uint256 left, uint256 right) external pure;
/// Compares two `uint256` values. Expects first value to be less than second.
/// Includes error message into revert string on failure.
function assertLt(uint256 left, uint256 right, string calldata error) external pure;
/// Compares two `int256` values. Expects first value to be less than second.
function assertLt(int256 left, int256 right) external pure;
/// Compares two `int256` values. Expects first value to be less than second.
/// Includes error message into revert string on failure.
function assertLt(int256 left, int256 right, string calldata error) external pure;
/// Asserts that two `uint256` values are not equal, formatting them with decimals in failure message.
function assertNotEqDecimal(uint256 left, uint256 right, uint256 decimals) external pure;
/// Asserts that two `uint256` values are not equal, formatting them with decimals in failure message.
/// Includes error message into revert string on failure.
function assertNotEqDecimal(uint256 left, uint256 right, uint256 decimals, string calldata error) external pure;
/// Asserts that two `int256` values are not equal, formatting them with decimals in failure message.
function assertNotEqDecimal(int256 left, int256 right, uint256 decimals) external pure;
/// Asserts that two `int256` values are not equal, formatting them with decimals in failure message.
/// Includes error message into revert string on failure.
function assertNotEqDecimal(int256 left, int256 right, uint256 decimals, string calldata error) external pure;
/// Asserts that two `bool` values are not equal.
function assertNotEq(bool left, bool right) external pure;
/// Asserts that two `bool` values are not equal and includes error message into revert string on failure.
function assertNotEq(bool left, bool right, string calldata error) external pure;
/// Asserts that two `string` values are not equal.
function assertNotEq(string calldata left, string calldata right) external pure;
/// Asserts that two `string` values are not equal and includes error message into revert string on failure.
function assertNotEq(string calldata left, string calldata right, string calldata error) external pure;
/// Asserts that two `bytes` values are not equal.
function assertNotEq(bytes calldata left, bytes calldata right) external pure;
/// Asserts that two `bytes` values are not equal and includes error message into revert string on failure.
function assertNotEq(bytes calldata left, bytes calldata right, string calldata error) external pure;
/// Asserts that two arrays of `bool` values are not equal.
function assertNotEq(bool[] calldata left, bool[] calldata right) external pure;
/// Asserts that two arrays of `bool` values are not equal and includes error message into revert string on failure.
function assertNotEq(bool[] calldata left, bool[] calldata right, string calldata error) external pure;
/// Asserts that two arrays of `uint256` values are not equal.
function assertNotEq(uint256[] calldata left, uint256[] calldata right) external pure;
/// Asserts that two arrays of `uint256` values are not equal and includes error message into revert string on failure.
function assertNotEq(uint256[] calldata left, uint256[] calldata right, string calldata error) external pure;
/// Asserts that two arrays of `int256` values are not equal.
function assertNotEq(int256[] calldata left, int256[] calldata right) external pure;
/// Asserts that two arrays of `int256` values are not equal and includes error message into revert string on failure.
function assertNotEq(int256[] calldata left, int256[] calldata right, string calldata error) external pure;
/// Asserts that two `uint256` values are not equal.
function assertNotEq(uint256 left, uint256 right) external pure;
/// Asserts that two arrays of `address` values are not equal.
function assertNotEq(address[] calldata left, address[] calldata right) external pure;
/// Asserts that two arrays of `address` values are not equal and includes error message into revert string on failure.
function assertNotEq(address[] calldata left, address[] calldata right, string calldata error) external pure;
/// Asserts that two arrays of `bytes32` values are not equal.
function assertNotEq(bytes32[] calldata left, bytes32[] calldata right) external pure;
/// Asserts that two arrays of `bytes32` values are not equal and includes error message into revert string on failure.
function assertNotEq(bytes32[] calldata left, bytes32[] calldata right, string calldata error) external pure;
/// Asserts that two arrays of `string` values are not equal.
function assertNotEq(string[] calldata left, string[] calldata right) external pure;
/// Asserts that two arrays of `string` values are not equal and includes error message into revert string on failure.
function assertNotEq(string[] calldata left, string[] calldata right, string calldata error) external pure;
/// Asserts that two arrays of `bytes` values are not equal.
function assertNotEq(bytes[] calldata left, bytes[] calldata right) external pure;
/// Asserts that two arrays of `bytes` values are not equal and includes error message into revert string on failure.
function assertNotEq(bytes[] calldata left, bytes[] calldata right, string calldata error) external pure;
/// Asserts that two `uint256` values are not equal and includes error message into revert string on failure.
function assertNotEq(uint256 left, uint256 right, string calldata error) external pure;
/// Asserts that two `int256` values are not equal.
function assertNotEq(int256 left, int256 right) external pure;
/// Asserts that two `int256` values are not equal and includes error message into revert string on failure.
function assertNotEq(int256 left, int256 right, string calldata error) external pure;
/// Asserts that two `address` values are not equal.
function assertNotEq(address left, address right) external pure;
/// Asserts that two `address` values are not equal and includes error message into revert string on failure.
function assertNotEq(address left, address right, string calldata error) external pure;
/// Asserts that two `bytes32` values are not equal.
function assertNotEq(bytes32 left, bytes32 right) external pure;
/// Asserts that two `bytes32` values are not equal and includes error message into revert string on failure.
function assertNotEq(bytes32 left, bytes32 right, string calldata error) external pure;
/// Asserts that the given condition is true.
function assertTrue(bool condition) external pure;
/// Asserts that the given condition is true and includes error message into revert string on failure.
function assertTrue(bool condition, string calldata error) external pure;
/// If the condition is false, discard this run's fuzz inputs and generate new ones.
function assume(bool condition) external pure;
/// Writes a breakpoint to jump to in the debugger.
function breakpoint(string calldata char) external;
/// Writes a conditional breakpoint to jump to in the debugger.
function breakpoint(string calldata char, bool value) external;
/// Returns the RPC url for the given alias.
function rpcUrl(string calldata rpcAlias) external view returns (string memory json);
/// Returns all rpc urls and their aliases as structs.
function rpcUrlStructs() external view returns (Rpc[] memory urls);
/// Returns all rpc urls and their aliases `[alias, url][]`.
function rpcUrls() external view returns (string[2][] memory urls);
/// Suspends execution of the main thread for `duration` milliseconds.
function sleep(uint256 duration) external;
// ======== Toml ========
/// Checks if `key` exists in a TOML table.
function keyExistsToml(string calldata toml, string calldata key) external view returns (bool);
/// Parses a string of TOML data at `key` and coerces it to `address`.
function parseTomlAddress(string calldata toml, string calldata key) external pure returns (address);
/// Parses a string of TOML data at `key` and coerces it to `address[]`.
function parseTomlAddressArray(string calldata toml, string calldata key)
external
pure
returns (address[] memory);
/// Parses a string of TOML data at `key` and coerces it to `bool`.
function parseTomlBool(string calldata toml, string calldata key) external pure returns (bool);
/// Parses a string of TOML data at `key` and coerces it to `bool[]`.
function parseTomlBoolArray(string calldata toml, string calldata key) external pure returns (bool[] memory);
/// Parses a string of TOML data at `key` and coerces it to `bytes`.
function parseTomlBytes(string calldata toml, string calldata key) external pure returns (bytes memory);
/// Parses a string of TOML data at `key` and coerces it to `bytes32`.
function parseTomlBytes32(string calldata toml, string calldata key) external pure returns (bytes32);
/// Parses a string of TOML data at `key` and coerces it to `bytes32[]`.
function parseTomlBytes32Array(string calldata toml, string calldata key)
external
pure
returns (bytes32[] memory);
/// Parses a string of TOML data at `key` and coerces it to `bytes[]`.
function parseTomlBytesArray(string calldata toml, string calldata key) external pure returns (bytes[] memory);
/// Parses a string of TOML data at `key` and coerces it to `int256`.
function parseTomlInt(string calldata toml, string calldata key) external pure returns (int256);
/// Parses a string of TOML data at `key` and coerces it to `int256[]`.
function parseTomlIntArray(string calldata toml, string calldata key) external pure returns (int256[] memory);
/// Returns an array of all the keys in a TOML table.
function parseTomlKeys(string calldata toml, string calldata key) external pure returns (string[] memory keys);
/// Parses a string of TOML data at `key` and coerces it to `string`.
function parseTomlString(string calldata toml, string calldata key) external pure returns (string memory);
/// Parses a string of TOML data at `key` and coerces it to `string[]`.
function parseTomlStringArray(string calldata toml, string calldata key) external pure returns (string[] memory);
/// Parses a string of TOML data at `key` and coerces it to `uint256`.
function parseTomlUint(string calldata toml, string calldata key) external pure returns (uint256);
/// Parses a string of TOML data at `key` and coerces it to `uint256[]`.
function parseTomlUintArray(string calldata toml, string calldata key) external pure returns (uint256[] memory);
/// ABI-encodes a TOML table.
function parseToml(string calldata toml) external pure returns (bytes memory abiEncodedData);
/// ABI-encodes a TOML table at `key`.
function parseToml(string calldata toml, string calldata key) external pure returns (bytes memory abiEncodedData);
/// Takes serialized JSON, converts to TOML and write a serialized TOML to a file.
function writeToml(string calldata json, string calldata path) external;
/// Takes serialized JSON, converts to TOML and write a serialized TOML table to an **existing** TOML file, replacing a value with key = <value_key.>
/// This is useful to replace a specific value of a TOML file, without having to parse the entire thing.
function writeToml(string calldata json, string calldata path, string calldata valueKey) external;
// ======== Utilities ========
/// Compute the address of a contract created with CREATE2 using the given CREATE2 deployer.
function computeCreate2Address(bytes32 salt, bytes32 initCodeHash, address deployer)
external
pure
returns (address);
/// Compute the address of a contract created with CREATE2 using the default CREATE2 deployer.
function computeCreate2Address(bytes32 salt, bytes32 initCodeHash) external pure returns (address);
/// Compute the address a contract will be deployed at for a given deployer address and nonce.
function computeCreateAddress(address deployer, uint256 nonce) external pure returns (address);
/// Derives a private key from the name, labels the account with that name, and returns the wallet.
function createWallet(string calldata walletLabel) external returns (Wallet memory wallet);
/// Generates a wallet from the private key and returns the wallet.
function createWallet(uint256 privateKey) external returns (Wallet memory wallet);
/// Generates a wallet from the private key, labels the account with that name, and returns the wallet.
function createWallet(uint256 privateKey, string calldata walletLabel) external returns (Wallet memory wallet);
/// Derive a private key from a provided mnenomic string (or mnenomic file path)
/// at the derivation path `m/44'/60'/0'/0/{index}`.
function deriveKey(string calldata mnemonic, uint32 index) external pure returns (uint256 privateKey);
/// Derive a private key from a provided mnenomic string (or mnenomic file path)
/// at `{derivationPath}{index}`.
function deriveKey(string calldata mnemonic, string calldata derivationPath, uint32 index)
external
pure
returns (uint256 privateKey);
/// Derive a private key from a provided mnenomic string (or mnenomic file path) in the specified language
/// at the derivation path `m/44'/60'/0'/0/{index}`.
function deriveKey(string calldata mnemonic, uint32 index, string calldata language)
external
pure
returns (uint256 privateKey);
/// Derive a private key from a provided mnenomic string (or mnenomic file path) in the specified language
/// at `{derivationPath}{index}`.
function deriveKey(string calldata mnemonic, string calldata derivationPath, uint32 index, string calldata language)
external
pure
returns (uint256 privateKey);
/// Returns ENS namehash for provided string.
function ensNamehash(string calldata name) external pure returns (bytes32);
/// Gets the label for the specified address.
function getLabel(address account) external view returns (string memory currentLabel);
/// Get a `Wallet`'s nonce.
function getNonce(Wallet calldata wallet) external returns (uint64 nonce);
/// Labels an address in call traces.
function label(address account, string calldata newLabel) external;
/// Returns a random `address`.
function randomAddress() external returns (address);
/// Returns a random uint256 value.
function randomUint() external returns (uint256);
/// Returns random uin256 value between the provided range (=min..=max).
function randomUint(uint256 min, uint256 max) external returns (uint256);
/// Adds a private key to the local forge wallet and returns the address.
function rememberKey(uint256 privateKey) external returns (address keyAddr);
/// Signs data with a `Wallet`.
function sign(Wallet calldata wallet, bytes32 digest) external returns (uint8 v, bytes32 r, bytes32 s);
/// Encodes a `bytes` value to a base64url string.
function toBase64URL(bytes calldata data) external pure returns (string memory);
/// Encodes a `string` value to a base64url string.
function toBase64URL(string calldata data) external pure returns (string memory);
/// Encodes a `bytes` value to a base64 string.
function toBase64(bytes calldata data) external pure returns (string memory);
/// Encodes a `string` value to a base64 string.
function toBase64(string calldata data) external pure returns (string memory);
}
/// The `Vm` interface does allow manipulation of the EVM state. These are all intended to be used
/// in tests, but it is not recommended to use these cheats in scripts.
interface Vm is VmSafe {
// ======== EVM ========
/// Returns the identifier of the currently active fork. Reverts if no fork is currently active.
function activeFork() external view returns (uint256 forkId);
/// In forking mode, explicitly grant the given address cheatcode access.
function allowCheatcodes(address account) external;
/// Sets `block.blobbasefee`
function blobBaseFee(uint256 newBlobBaseFee) external;
/// Sets the blobhashes in the transaction.
/// Not available on EVM versions before Cancun.
/// If used on unsupported EVM versions it will revert.
function blobhashes(bytes32[] calldata hashes) external;
/// Sets `block.chainid`.
function chainId(uint256 newChainId) external;
/// Clears all mocked calls.
function clearMockedCalls() external;
/// Sets `block.coinbase`.
function coinbase(address newCoinbase) external;
/// Creates a new fork with the given endpoint and the _latest_ block and returns the identifier of the fork.
function createFork(string calldata urlOrAlias) external returns (uint256 forkId);
/// Creates a new fork with the given endpoint and block and returns the identifier of the fork.
function createFork(string calldata urlOrAlias, uint256 blockNumber) external returns (uint256 forkId);
/// Creates a new fork with the given endpoint and at the block the given transaction was mined in,
/// replays all transaction mined in the block before the transaction, and returns the identifier of the fork.
function createFork(string calldata urlOrAlias, bytes32 txHash) external returns (uint256 forkId);
/// Creates and also selects a new fork with the given endpoint and the latest block and returns the identifier of the fork.
function createSelectFork(string calldata urlOrAlias) external returns (uint256 forkId);
/// Creates and also selects a new fork with the given endpoint and block and returns the identifier of the fork.
function createSelectFork(string calldata urlOrAlias, uint256 blockNumber) external returns (uint256 forkId);
/// Creates and also selects new fork with the given endpoint and at the block the given transaction was mined in,
/// replays all transaction mined in the block before the transaction, returns the identifier of the fork.
function createSelectFork(string calldata urlOrAlias, bytes32 txHash) external returns (uint256 forkId);
/// Sets an address' balance.
function deal(address account, uint256 newBalance) external;
/// Removes the snapshot with the given ID created by `snapshot`.
/// Takes the snapshot ID to delete.
/// Returns `true` if the snapshot was successfully deleted.
/// Returns `false` if the snapshot does not exist.
function deleteSnapshot(uint256 snapshotId) external returns (bool success);
/// Removes _all_ snapshots previously created by `snapshot`.
function deleteSnapshots() external;
/// Sets `block.difficulty`.
/// Not available on EVM versions from Paris onwards. Use `prevrandao` instead.
/// Reverts if used on unsupported EVM versions.
function difficulty(uint256 newDifficulty) external;
/// Dump a genesis JSON file's `allocs` to disk.
function dumpState(string calldata pathToStateJson) external;
/// Sets an address' code.
function etch(address target, bytes calldata newRuntimeBytecode) external;
/// Sets `block.basefee`.
function fee(uint256 newBasefee) external;
/// Gets the blockhashes from the current transaction.
/// Not available on EVM versions before Cancun.
/// If used on unsupported EVM versions it will revert.
function getBlobhashes() external view returns (bytes32[] memory hashes);
/// Returns true if the account is marked as persistent.
function isPersistent(address account) external view returns (bool persistent);
/// Load a genesis JSON file's `allocs` into the in-memory revm state.
function loadAllocs(string calldata pathToAllocsJson) external;
/// Marks that the account(s) should use persistent storage across fork swaps in a multifork setup
/// Meaning, changes made to the state of this account will be kept when switching forks.
function makePersistent(address account) external;
/// See `makePersistent(address)`.
function makePersistent(address account0, address account1) external;
/// See `makePersistent(address)`.
function makePersistent(address account0, address account1, address account2) external;
/// See `makePersistent(address)`.
function makePersistent(address[] calldata accounts) external;
/// Reverts a call to an address with specified revert data.
function mockCallRevert(address callee, bytes calldata data, bytes calldata revertData) external;
/// Reverts a call to an address with a specific `msg.value`, with specified revert data.
function mockCallRevert(address callee, uint256 msgValue, bytes calldata data, bytes calldata revertData)
external;
/// Mocks a call to an address, returning specified data.
/// Calldata can either be strict or a partial match, e.g. if you only
/// pass a Solidity selector to the expected calldata, then the entire Solidity
/// function will be mocked.
function mockCall(address callee, bytes calldata data, bytes calldata returnData) external;
/// Mocks a call to an address with a specific `msg.value`, returning specified data.
/// Calldata match takes precedence over `msg.value` in case of ambiguity.
function mockCall(address callee, uint256 msgValue, bytes calldata data, bytes calldata returnData) external;
/// Sets the *next* call's `msg.sender` to be the input address.
function prank(address msgSender) external;
/// Sets the *next* call's `msg.sender` to be the input address, and the `tx.origin` to be the second input.
function prank(address msgSender, address txOrigin) external;
/// Sets `block.prevrandao`.
/// Not available on EVM versions before Paris. Use `difficulty` instead.
/// If used on unsupported EVM versions it will revert.
function prevrandao(bytes32 newPrevrandao) external;
/// Sets `block.prevrandao`.
/// Not available on EVM versions before Paris. Use `difficulty` instead.
/// If used on unsupported EVM versions it will revert.
function prevrandao(uint256 newPrevrandao) external;
/// Reads the current `msg.sender` and `tx.origin` from state and reports if there is any active caller modification.
function readCallers() external returns (CallerMode callerMode, address msgSender, address txOrigin);
/// Resets the nonce of an account to 0 for EOAs and 1 for contract accounts.
function resetNonce(address account) external;
/// Revert the state of the EVM to a previous snapshot
/// Takes the snapshot ID to revert to.
/// Returns `true` if the snapshot was successfully reverted.
/// Returns `false` if the snapshot does not exist.
/// **Note:** This does not automatically delete the snapshot. To delete the snapshot use `deleteSnapshot`.
function revertTo(uint256 snapshotId) external returns (bool success);
/// Revert the state of the EVM to a previous snapshot and automatically deletes the snapshots
/// Takes the snapshot ID to revert to.
/// Returns `true` if the snapshot was successfully reverted and deleted.
/// Returns `false` if the snapshot does not exist.
function revertToAndDelete(uint256 snapshotId) external returns (bool success);
/// Revokes persistent status from the address, previously added via `makePersistent`.
function revokePersistent(address account) external;
/// See `revokePersistent(address)`.
function revokePersistent(address[] calldata accounts) external;
/// Sets `block.height`.
function roll(uint256 newHeight) external;
/// Updates the currently active fork to given block number
/// This is similar to `roll` but for the currently active fork.
function rollFork(uint256 blockNumber) external;
/// Updates the currently active fork to given transaction. This will `rollFork` with the number
/// of the block the transaction was mined in and replays all transaction mined before it in the block.
function rollFork(bytes32 txHash) external;
/// Updates the given fork to given block number.
function rollFork(uint256 forkId, uint256 blockNumber) external;
/// Updates the given fork to block number of the given transaction and replays all transaction mined before it in the block.
function rollFork(uint256 forkId, bytes32 txHash) external;
/// Takes a fork identifier created by `createFork` and sets the corresponding forked state as active.
function selectFork(uint256 forkId) external;
/// Sets the nonce of an account. Must be higher than the current nonce of the account.
function setNonce(address account, uint64 newNonce) external;
/// Sets the nonce of an account to an arbitrary value.
function setNonceUnsafe(address account, uint64 newNonce) external;
/// Snapshot the current state of the evm.
/// Returns the ID of the snapshot that was created.
/// To revert a snapshot use `revertTo`.
function snapshot() external returns (uint256 snapshotId);
/// Sets all subsequent calls' `msg.sender` to be the input address until `stopPrank` is called.
function startPrank(address msgSender) external;
/// Sets all subsequent calls' `msg.sender` to be the input address until `stopPrank` is called, and the `tx.origin` to be the second input.
function startPrank(address msgSender, address txOrigin) external;
/// Resets subsequent calls' `msg.sender` to be `address(this)`.
function stopPrank() external;
/// Stores a value to an address' storage slot.
function store(address target, bytes32 slot, bytes32 value) external;
/// Fetches the given transaction from the active fork and executes it on the current state.
function transact(bytes32 txHash) external;
/// Fetches the given transaction from the given fork and executes it on the current state.
function transact(uint256 forkId, bytes32 txHash) external;
/// Sets `tx.gasprice`.
function txGasPrice(uint256 newGasPrice) external;
/// Sets `block.timestamp`.
function warp(uint256 newTimestamp) external;
// ======== Testing ========
/// Expect a call to an address with the specified `msg.value` and calldata, and a *minimum* amount of gas.
function expectCallMinGas(address callee, uint256 msgValue, uint64 minGas, bytes calldata data) external;
/// Expect given number of calls to an address with the specified `msg.value` and calldata, and a *minimum* amount of gas.
function expectCallMinGas(address callee, uint256 msgValue, uint64 minGas, bytes calldata data, uint64 count)
external;
/// Expects a call to an address with the specified calldata.
/// Calldata can either be a strict or a partial match.
function expectCall(address callee, bytes calldata data) external;
/// Expects given number of calls to an address with the specified calldata.
function expectCall(address callee, bytes calldata data, uint64 count) external;
/// Expects a call to an address with the specified `msg.value` and calldata.
function expectCall(address callee, uint256 msgValue, bytes calldata data) external;
/// Expects given number of calls to an address with the specified `msg.value` and calldata.
function expectCall(address callee, uint256 msgValue, bytes calldata data, uint64 count) external;
/// Expect a call to an address with the specified `msg.value`, gas, and calldata.
function expectCall(address callee, uint256 msgValue, uint64 gas, bytes calldata data) external;
/// Expects given number of calls to an address with the specified `msg.value`, gas, and calldata.
function expectCall(address callee, uint256 msgValue, uint64 gas, bytes calldata data, uint64 count) external;
/// Prepare an expected log with (bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData.).
/// Call this function, then emit an event, then call a function. Internally after the call, we check if
/// logs were emitted in the expected order with the expected topics and data (as specified by the booleans).
function expectEmit(bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData) external;
/// Same as the previous method, but also checks supplied address against emitting contract.
function expectEmit(bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData, address emitter)
external;
/// Prepare an expected log with all topic and data checks enabled.
/// Call this function, then emit an event, then call a function. Internally after the call, we check if
/// logs were emitted in the expected order with the expected topics and data.
function expectEmit() external;
/// Same as the previous method, but also checks supplied address against emitting contract.
function expectEmit(address emitter) external;
/// Expects an error on next call with any revert data.
function expectRevert() external;
/// Expects an error on next call that starts with the revert data.
function expectRevert(bytes4 revertData) external;
/// Expects an error on next call that exactly matches the revert data.
function expectRevert(bytes calldata revertData) external;
/// Only allows memory writes to offsets [0x00, 0x60) ∪ [min, max) in the current subcontext. If any other
/// memory is written to, the test will fail. Can be called multiple times to add more ranges to the set.
function expectSafeMemory(uint64 min, uint64 max) external;
/// Only allows memory writes to offsets [0x00, 0x60) ∪ [min, max) in the next created subcontext.
/// If any other memory is written to, the test will fail. Can be called multiple times to add more ranges
/// to the set.
function expectSafeMemoryCall(uint64 min, uint64 max) external;
/// Marks a test as skipped. Must be called at the top of the test.
function skip(bool skipTest) external;
/// Stops all safe memory expectation in the current subcontext.
function stopExpectSafeMemory() external;
}
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import {ERC20} from "./ERC20.sol";
import {SafeTransferLib} from "../utils/SafeTransferLib.sol";
/// @notice Minimalist and modern Wrapped Ether implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/WETH.sol)
/// @author Inspired by WETH9 (https://github.com/dapphub/ds-weth/blob/master/src/weth9.sol)
contract WETH is ERC20("Wrapped Ether", "WETH", 18) {
using SafeTransferLib for address;
event Deposit(address indexed from, uint256 amount);
event Withdrawal(address indexed to, uint256 amount);
function deposit() public payable virtual {
_mint(msg.sender, msg.value);
emit Deposit(msg.sender, msg.value);
}
function withdraw(uint256 amount) public virtual {
_burn(msg.sender, amount);
emit Withdrawal(msg.sender, amount);
msg.sender.safeTransferETH(amount);
}
receive() external payable virtual {
deposit();
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
library console {
address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67);
function _castLogPayloadViewToPure(
function(bytes memory) internal view fnIn
) internal pure returns (function(bytes memory) internal pure fnOut) {
assembly {
fnOut := fnIn
}
}
function _sendLogPayload(bytes memory payload) internal pure {
_castLogPayloadViewToPure(_sendLogPayloadView)(payload);
}
function _sendLogPayloadView(bytes memory payload) private view {
uint256 payloadLength = payload.length;
address consoleAddress = CONSOLE_ADDRESS;
/// @solidity memory-safe-assembly
assembly {
let payloadStart := add(payload, 32)
let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0)
}
}
function log() internal pure {
_sendLogPayload(abi.encodeWithSignature("log()"));
}
function logInt(int p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(int)", p0));
}
function logUint(uint p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint)", p0));
}
function logString(string memory p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string)", p0));
}
function logBool(bool p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool)", p0));
}
function logAddress(address p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address)", p0));
}
function logBytes(bytes memory p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes)", p0));
}
function logBytes1(bytes1 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0));
}
function logBytes2(bytes2 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0));
}
function logBytes3(bytes3 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0));
}
function logBytes4(bytes4 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0));
}
function logBytes5(bytes5 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0));
}
function logBytes6(bytes6 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0));
}
function logBytes7(bytes7 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0));
}
function logBytes8(bytes8 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0));
}
function logBytes9(bytes9 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0));
}
function logBytes10(bytes10 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0));
}
function logBytes11(bytes11 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0));
}
function logBytes12(bytes12 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0));
}
function logBytes13(bytes13 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0));
}
function logBytes14(bytes14 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0));
}
function logBytes15(bytes15 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0));
}
function logBytes16(bytes16 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0));
}
function logBytes17(bytes17 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0));
}
function logBytes18(bytes18 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0));
}
function logBytes19(bytes19 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0));
}
function logBytes20(bytes20 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0));
}
function logBytes21(bytes21 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0));
}
function logBytes22(bytes22 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0));
}
function logBytes23(bytes23 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0));
}
function logBytes24(bytes24 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0));
}
function logBytes25(bytes25 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0));
}
function logBytes26(bytes26 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0));
}
function logBytes27(bytes27 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0));
}
function logBytes28(bytes28 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0));
}
function logBytes29(bytes29 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0));
}
function logBytes30(bytes30 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0));
}
function logBytes31(bytes31 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0));
}
function logBytes32(bytes32 p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0));
}
function log(uint p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint)", p0));
}
function log(int p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(int)", p0));
}
function log(string memory p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string)", p0));
}
function log(bool p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool)", p0));
}
function log(address p0) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address)", p0));
}
function log(uint p0, uint p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint)", p0, p1));
}
function log(uint p0, string memory p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string)", p0, p1));
}
function log(uint p0, bool p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool)", p0, p1));
}
function log(uint p0, address p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address)", p0, p1));
}
function log(string memory p0, uint p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint)", p0, p1));
}
function log(string memory p0, int p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,int)", p0, p1));
}
function log(string memory p0, string memory p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1));
}
function log(string memory p0, bool p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1));
}
function log(string memory p0, address p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1));
}
function log(bool p0, uint p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint)", p0, p1));
}
function log(bool p0, string memory p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1));
}
function log(bool p0, bool p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1));
}
function log(bool p0, address p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1));
}
function log(address p0, uint p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint)", p0, p1));
}
function log(address p0, string memory p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1));
}
function log(address p0, bool p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1));
}
function log(address p0, address p1) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1));
}
function log(uint p0, uint p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint)", p0, p1, p2));
}
function log(uint p0, uint p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string)", p0, p1, p2));
}
function log(uint p0, uint p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool)", p0, p1, p2));
}
function log(uint p0, uint p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address)", p0, p1, p2));
}
function log(uint p0, string memory p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint)", p0, p1, p2));
}
function log(uint p0, string memory p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,string)", p0, p1, p2));
}
function log(uint p0, string memory p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool)", p0, p1, p2));
}
function log(uint p0, string memory p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,address)", p0, p1, p2));
}
function log(uint p0, bool p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint)", p0, p1, p2));
}
function log(uint p0, bool p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string)", p0, p1, p2));
}
function log(uint p0, bool p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool)", p0, p1, p2));
}
function log(uint p0, bool p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address)", p0, p1, p2));
}
function log(uint p0, address p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint)", p0, p1, p2));
}
function log(uint p0, address p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,string)", p0, p1, p2));
}
function log(uint p0, address p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool)", p0, p1, p2));
}
function log(uint p0, address p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,address)", p0, p1, p2));
}
function log(string memory p0, uint p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint)", p0, p1, p2));
}
function log(string memory p0, uint p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,string)", p0, p1, p2));
}
function log(string memory p0, uint p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool)", p0, p1, p2));
}
function log(string memory p0, uint p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,address)", p0, p1, p2));
}
function log(string memory p0, string memory p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,uint)", p0, p1, p2));
}
function log(string memory p0, string memory p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2));
}
function log(string memory p0, string memory p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2));
}
function log(string memory p0, string memory p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2));
}
function log(string memory p0, bool p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint)", p0, p1, p2));
}
function log(string memory p0, bool p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2));
}
function log(string memory p0, bool p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2));
}
function log(string memory p0, bool p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2));
}
function log(string memory p0, address p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,uint)", p0, p1, p2));
}
function log(string memory p0, address p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2));
}
function log(string memory p0, address p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2));
}
function log(string memory p0, address p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2));
}
function log(bool p0, uint p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint)", p0, p1, p2));
}
function log(bool p0, uint p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string)", p0, p1, p2));
}
function log(bool p0, uint p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool)", p0, p1, p2));
}
function log(bool p0, uint p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address)", p0, p1, p2));
}
function log(bool p0, string memory p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint)", p0, p1, p2));
}
function log(bool p0, string memory p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2));
}
function log(bool p0, string memory p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2));
}
function log(bool p0, string memory p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2));
}
function log(bool p0, bool p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint)", p0, p1, p2));
}
function log(bool p0, bool p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2));
}
function log(bool p0, bool p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2));
}
function log(bool p0, bool p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2));
}
function log(bool p0, address p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint)", p0, p1, p2));
}
function log(bool p0, address p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2));
}
function log(bool p0, address p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2));
}
function log(bool p0, address p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2));
}
function log(address p0, uint p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint)", p0, p1, p2));
}
function log(address p0, uint p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,string)", p0, p1, p2));
}
function log(address p0, uint p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool)", p0, p1, p2));
}
function log(address p0, uint p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,address)", p0, p1, p2));
}
function log(address p0, string memory p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,uint)", p0, p1, p2));
}
function log(address p0, string memory p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2));
}
function log(address p0, string memory p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2));
}
function log(address p0, string memory p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2));
}
function log(address p0, bool p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint)", p0, p1, p2));
}
function log(address p0, bool p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2));
}
function log(address p0, bool p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2));
}
function log(address p0, bool p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2));
}
function log(address p0, address p1, uint p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,uint)", p0, p1, p2));
}
function log(address p0, address p1, string memory p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2));
}
function log(address p0, address p1, bool p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2));
}
function log(address p0, address p1, address p2) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2));
}
function log(uint p0, uint p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,uint)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,string)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,bool)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,address)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,uint)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,string)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,bool)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,address)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,uint)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,string)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,bool)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,address)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,uint)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,string)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,bool)", p0, p1, p2, p3));
}
function log(uint p0, uint p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,address)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,uint)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,string)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,bool)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,address)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,uint)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,string)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,bool)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,string,address)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,uint)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,string)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,bool)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,address)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,uint)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,string)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,bool)", p0, p1, p2, p3));
}
function log(uint p0, string memory p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,string,address,address)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,uint)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,string)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,bool)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,address)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,uint)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,string)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,bool)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,address)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,uint)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,string)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,bool)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,address)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,uint)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,string)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,bool)", p0, p1, p2, p3));
}
function log(uint p0, bool p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,address)", p0, p1, p2, p3));
}
function log(uint p0, address p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,uint)", p0, p1, p2, p3));
}
function log(uint p0, address p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,string)", p0, p1, p2, p3));
}
function log(uint p0, address p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,bool)", p0, p1, p2, p3));
}
function log(uint p0, address p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,address)", p0, p1, p2, p3));
}
function log(uint p0, address p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,uint)", p0, p1, p2, p3));
}
function log(uint p0, address p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,string)", p0, p1, p2, p3));
}
function log(uint p0, address p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,bool)", p0, p1, p2, p3));
}
function log(uint p0, address p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,string,address)", p0, p1, p2, p3));
}
function log(uint p0, address p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,uint)", p0, p1, p2, p3));
}
function log(uint p0, address p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,string)", p0, p1, p2, p3));
}
function log(uint p0, address p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,bool)", p0, p1, p2, p3));
}
function log(uint p0, address p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,address)", p0, p1, p2, p3));
}
function log(uint p0, address p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,uint)", p0, p1, p2, p3));
}
function log(uint p0, address p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,string)", p0, p1, p2, p3));
}
function log(uint p0, address p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,bool)", p0, p1, p2, p3));
}
function log(uint p0, address p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(uint,address,address,address)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,uint)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,string)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,bool)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,address)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,uint)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,string)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,bool)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,string,address)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,uint)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,string)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,bool)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,address)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,uint)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,string)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,bool)", p0, p1, p2, p3));
}
function log(string memory p0, uint p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,uint,address,address)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,uint)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,string)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,bool)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,uint,address)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3));
}
function log(string memory p0, string memory p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,uint)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,string)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,bool)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,address)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3));
}
function log(string memory p0, bool p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,uint)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,string)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,bool)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,uint,address)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3));
}
function log(string memory p0, address p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,uint)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,string)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,bool)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,address)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,uint)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,string)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,bool)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,address)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,uint)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,string)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,bool)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,address)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,uint)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,string)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,bool)", p0, p1, p2, p3));
}
function log(bool p0, uint p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,address)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,uint)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,string)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,bool)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,address)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3));
}
function log(bool p0, string memory p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,uint)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,string)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,bool)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,address)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3));
}
function log(bool p0, bool p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3));
}
function log(bool p0, address p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,uint)", p0, p1, p2, p3));
}
function log(bool p0, address p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,string)", p0, p1, p2, p3));
}
function log(bool p0, address p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,bool)", p0, p1, p2, p3));
}
function log(bool p0, address p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,address)", p0, p1, p2, p3));
}
function log(bool p0, address p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint)", p0, p1, p2, p3));
}
function log(bool p0, address p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3));
}
function log(bool p0, address p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3));
}
function log(bool p0, address p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3));
}
function log(bool p0, address p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint)", p0, p1, p2, p3));
}
function log(bool p0, address p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3));
}
function log(bool p0, address p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3));
}
function log(bool p0, address p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3));
}
function log(bool p0, address p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint)", p0, p1, p2, p3));
}
function log(bool p0, address p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3));
}
function log(bool p0, address p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3));
}
function log(bool p0, address p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3));
}
function log(address p0, uint p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,uint)", p0, p1, p2, p3));
}
function log(address p0, uint p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,string)", p0, p1, p2, p3));
}
function log(address p0, uint p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,bool)", p0, p1, p2, p3));
}
function log(address p0, uint p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,address)", p0, p1, p2, p3));
}
function log(address p0, uint p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,uint)", p0, p1, p2, p3));
}
function log(address p0, uint p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,string)", p0, p1, p2, p3));
}
function log(address p0, uint p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,bool)", p0, p1, p2, p3));
}
function log(address p0, uint p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,string,address)", p0, p1, p2, p3));
}
function log(address p0, uint p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,uint)", p0, p1, p2, p3));
}
function log(address p0, uint p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,string)", p0, p1, p2, p3));
}
function log(address p0, uint p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,bool)", p0, p1, p2, p3));
}
function log(address p0, uint p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,address)", p0, p1, p2, p3));
}
function log(address p0, uint p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,uint)", p0, p1, p2, p3));
}
function log(address p0, uint p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,string)", p0, p1, p2, p3));
}
function log(address p0, uint p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,bool)", p0, p1, p2, p3));
}
function log(address p0, uint p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,uint,address,address)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,uint)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,string)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,bool)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,uint,address)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3));
}
function log(address p0, string memory p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3));
}
function log(address p0, bool p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,uint)", p0, p1, p2, p3));
}
function log(address p0, bool p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,string)", p0, p1, p2, p3));
}
function log(address p0, bool p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,bool)", p0, p1, p2, p3));
}
function log(address p0, bool p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,address)", p0, p1, p2, p3));
}
function log(address p0, bool p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint)", p0, p1, p2, p3));
}
function log(address p0, bool p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3));
}
function log(address p0, bool p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3));
}
function log(address p0, bool p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3));
}
function log(address p0, bool p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint)", p0, p1, p2, p3));
}
function log(address p0, bool p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3));
}
function log(address p0, bool p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3));
}
function log(address p0, bool p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3));
}
function log(address p0, bool p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint)", p0, p1, p2, p3));
}
function log(address p0, bool p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3));
}
function log(address p0, bool p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3));
}
function log(address p0, bool p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3));
}
function log(address p0, address p1, uint p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,uint)", p0, p1, p2, p3));
}
function log(address p0, address p1, uint p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,string)", p0, p1, p2, p3));
}
function log(address p0, address p1, uint p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,bool)", p0, p1, p2, p3));
}
function log(address p0, address p1, uint p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,uint,address)", p0, p1, p2, p3));
}
function log(address p0, address p1, string memory p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint)", p0, p1, p2, p3));
}
function log(address p0, address p1, string memory p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3));
}
function log(address p0, address p1, string memory p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3));
}
function log(address p0, address p1, string memory p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3));
}
function log(address p0, address p1, bool p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint)", p0, p1, p2, p3));
}
function log(address p0, address p1, bool p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3));
}
function log(address p0, address p1, bool p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3));
}
function log(address p0, address p1, bool p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3));
}
function log(address p0, address p1, address p2, uint p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint)", p0, p1, p2, p3));
}
function log(address p0, address p1, address p2, string memory p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3));
}
function log(address p0, address p1, address p2, bool p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3));
}
function log(address p0, address p1, address p2, address p3) internal pure {
_sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3));
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
import {console as console2} from "./console.sol";
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;
/// @author philogy <https://github.com/philogy>
/// @dev Code generated automatically by script.
library safeconsole {
uint256 constant CONSOLE_ADDR = 0x000000000000000000000000000000000000000000636F6e736F6c652e6c6f67;
// Credit to [0age](https://twitter.com/z0age/status/1654922202930888704) and [0xdapper](https://github.com/foundry-rs/forge-std/pull/374)
// for the view-to-pure log trick.
function _sendLogPayload(uint256 offset, uint256 size) private pure {
function(uint256, uint256) internal view fnIn = _sendLogPayloadView;
function(uint256, uint256) internal pure pureSendLogPayload;
assembly {
pureSendLogPayload := fnIn
}
pureSendLogPayload(offset, size);
}
function _sendLogPayloadView(uint256 offset, uint256 size) private view {
assembly {
pop(staticcall(gas(), CONSOLE_ADDR, offset, size, 0x0, 0x0))
}
}
function _memcopy(uint256 fromOffset, uint256 toOffset, uint256 length) private pure {
function(uint256, uint256, uint256) internal view fnIn = _memcopyView;
function(uint256, uint256, uint256) internal pure pureMemcopy;
assembly {
pureMemcopy := fnIn
}
pureMemcopy(fromOffset, toOffset, length);
}
function _memcopyView(uint256 fromOffset, uint256 toOffset, uint256 length) private view {
assembly {
pop(staticcall(gas(), 0x4, fromOffset, length, toOffset, length))
}
}
function logMemory(uint256 offset, uint256 length) internal pure {
if (offset >= 0x60) {
// Sufficient memory before slice to prepare call header.
bytes32 m0;
bytes32 m1;
bytes32 m2;
assembly {
m0 := mload(sub(offset, 0x60))
m1 := mload(sub(offset, 0x40))
m2 := mload(sub(offset, 0x20))
// Selector of `logBytes(bytes)`.
mstore(sub(offset, 0x60), 0xe17bf956)
mstore(sub(offset, 0x40), 0x20)
mstore(sub(offset, 0x20), length)
}
_sendLogPayload(offset - 0x44, length + 0x44);
assembly {
mstore(sub(offset, 0x60), m0)
mstore(sub(offset, 0x40), m1)
mstore(sub(offset, 0x20), m2)
}
} else {
// Insufficient space, so copy slice forward, add header and reverse.
bytes32 m0;
bytes32 m1;
bytes32 m2;
uint256 endOffset = offset + length;
assembly {
m0 := mload(add(endOffset, 0x00))
m1 := mload(add(endOffset, 0x20))
m2 := mload(add(endOffset, 0x40))
}
_memcopy(offset, offset + 0x60, length);
assembly {
// Selector of `logBytes(bytes)`.
mstore(add(offset, 0x00), 0xe17bf956)
mstore(add(offset, 0x20), 0x20)
mstore(add(offset, 0x40), length)
}
_sendLogPayload(offset + 0x1c, length + 0x44);
_memcopy(offset + 0x60, offset, length);
assembly {
mstore(add(endOffset, 0x00), m0)
mstore(add(endOffset, 0x20), m1)
mstore(add(endOffset, 0x40), m2)
}
}
}
function log(address p0) internal pure {
bytes32 m0;
bytes32 m1;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
// Selector of `log(address)`.
mstore(0x00, 0x2c2ecbc2)
mstore(0x20, p0)
}
_sendLogPayload(0x1c, 0x24);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
}
}
function log(bool p0) internal pure {
bytes32 m0;
bytes32 m1;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
// Selector of `log(bool)`.
mstore(0x00, 0x32458eed)
mstore(0x20, p0)
}
_sendLogPayload(0x1c, 0x24);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
}
}
function log(uint256 p0) internal pure {
bytes32 m0;
bytes32 m1;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
// Selector of `log(uint256)`.
mstore(0x00, 0xf82c50f1)
mstore(0x20, p0)
}
_sendLogPayload(0x1c, 0x24);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
}
}
function log(bytes32 p0) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(string)`.
mstore(0x00, 0x41304fac)
mstore(0x20, 0x20)
writeString(0x40, p0)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(address p0, address p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
// Selector of `log(address,address)`.
mstore(0x00, 0xdaf0d4aa)
mstore(0x20, p0)
mstore(0x40, p1)
}
_sendLogPayload(0x1c, 0x44);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
}
}
function log(address p0, bool p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
// Selector of `log(address,bool)`.
mstore(0x00, 0x75b605d3)
mstore(0x20, p0)
mstore(0x40, p1)
}
_sendLogPayload(0x1c, 0x44);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
}
}
function log(address p0, uint256 p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
// Selector of `log(address,uint256)`.
mstore(0x00, 0x8309e8a8)
mstore(0x20, p0)
mstore(0x40, p1)
}
_sendLogPayload(0x1c, 0x44);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
}
}
function log(address p0, bytes32 p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,string)`.
mstore(0x00, 0x759f86bb)
mstore(0x20, p0)
mstore(0x40, 0x40)
writeString(0x60, p1)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, address p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
// Selector of `log(bool,address)`.
mstore(0x00, 0x853c4849)
mstore(0x20, p0)
mstore(0x40, p1)
}
_sendLogPayload(0x1c, 0x44);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
}
}
function log(bool p0, bool p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
// Selector of `log(bool,bool)`.
mstore(0x00, 0x2a110e83)
mstore(0x20, p0)
mstore(0x40, p1)
}
_sendLogPayload(0x1c, 0x44);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
}
}
function log(bool p0, uint256 p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
// Selector of `log(bool,uint256)`.
mstore(0x00, 0x399174d3)
mstore(0x20, p0)
mstore(0x40, p1)
}
_sendLogPayload(0x1c, 0x44);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
}
}
function log(bool p0, bytes32 p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,string)`.
mstore(0x00, 0x8feac525)
mstore(0x20, p0)
mstore(0x40, 0x40)
writeString(0x60, p1)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, address p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
// Selector of `log(uint256,address)`.
mstore(0x00, 0x69276c86)
mstore(0x20, p0)
mstore(0x40, p1)
}
_sendLogPayload(0x1c, 0x44);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
}
}
function log(uint256 p0, bool p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
// Selector of `log(uint256,bool)`.
mstore(0x00, 0x1c9d7eb3)
mstore(0x20, p0)
mstore(0x40, p1)
}
_sendLogPayload(0x1c, 0x44);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
}
}
function log(uint256 p0, uint256 p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
// Selector of `log(uint256,uint256)`.
mstore(0x00, 0xf666715a)
mstore(0x20, p0)
mstore(0x40, p1)
}
_sendLogPayload(0x1c, 0x44);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
}
}
function log(uint256 p0, bytes32 p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,string)`.
mstore(0x00, 0x643fd0df)
mstore(0x20, p0)
mstore(0x40, 0x40)
writeString(0x60, p1)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bytes32 p0, address p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(string,address)`.
mstore(0x00, 0x319af333)
mstore(0x20, 0x40)
mstore(0x40, p1)
writeString(0x60, p0)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bytes32 p0, bool p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(string,bool)`.
mstore(0x00, 0xc3b55635)
mstore(0x20, 0x40)
mstore(0x40, p1)
writeString(0x60, p0)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bytes32 p0, uint256 p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(string,uint256)`.
mstore(0x00, 0xb60e72cc)
mstore(0x20, 0x40)
mstore(0x40, p1)
writeString(0x60, p0)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bytes32 p0, bytes32 p1) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,string)`.
mstore(0x00, 0x4b5c4277)
mstore(0x20, 0x40)
mstore(0x40, 0x80)
writeString(0x60, p0)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, address p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(address,address,address)`.
mstore(0x00, 0x018c84c2)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(address p0, address p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(address,address,bool)`.
mstore(0x00, 0xf2a66286)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(address p0, address p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(address,address,uint256)`.
mstore(0x00, 0x17fe6185)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(address p0, address p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(address,address,string)`.
mstore(0x00, 0x007150be)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x60)
writeString(0x80, p2)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(address p0, bool p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(address,bool,address)`.
mstore(0x00, 0xf11699ed)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(address p0, bool p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(address,bool,bool)`.
mstore(0x00, 0xeb830c92)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(address p0, bool p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(address,bool,uint256)`.
mstore(0x00, 0x9c4f99fb)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(address p0, bool p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(address,bool,string)`.
mstore(0x00, 0x212255cc)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x60)
writeString(0x80, p2)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(address p0, uint256 p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(address,uint256,address)`.
mstore(0x00, 0x7bc0d848)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(address p0, uint256 p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(address,uint256,bool)`.
mstore(0x00, 0x678209a8)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(address p0, uint256 p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(address,uint256,uint256)`.
mstore(0x00, 0xb69bcaf6)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(address p0, uint256 p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(address,uint256,string)`.
mstore(0x00, 0xa1f2e8aa)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x60)
writeString(0x80, p2)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(address p0, bytes32 p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(address,string,address)`.
mstore(0x00, 0xf08744e8)
mstore(0x20, p0)
mstore(0x40, 0x60)
mstore(0x60, p2)
writeString(0x80, p1)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(address p0, bytes32 p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(address,string,bool)`.
mstore(0x00, 0xcf020fb1)
mstore(0x20, p0)
mstore(0x40, 0x60)
mstore(0x60, p2)
writeString(0x80, p1)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(address p0, bytes32 p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(address,string,uint256)`.
mstore(0x00, 0x67dd6ff1)
mstore(0x20, p0)
mstore(0x40, 0x60)
mstore(0x60, p2)
writeString(0x80, p1)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(address p0, bytes32 p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
// Selector of `log(address,string,string)`.
mstore(0x00, 0xfb772265)
mstore(0x20, p0)
mstore(0x40, 0x60)
mstore(0x60, 0xa0)
writeString(0x80, p1)
writeString(0xc0, p2)
}
_sendLogPayload(0x1c, 0xe4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
}
}
function log(bool p0, address p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(bool,address,address)`.
mstore(0x00, 0xd2763667)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(bool p0, address p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(bool,address,bool)`.
mstore(0x00, 0x18c9c746)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(bool p0, address p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(bool,address,uint256)`.
mstore(0x00, 0x5f7b9afb)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(bool p0, address p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(bool,address,string)`.
mstore(0x00, 0xde9a9270)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x60)
writeString(0x80, p2)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bool p0, bool p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(bool,bool,address)`.
mstore(0x00, 0x1078f68d)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(bool p0, bool p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(bool,bool,bool)`.
mstore(0x00, 0x50709698)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(bool p0, bool p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(bool,bool,uint256)`.
mstore(0x00, 0x12f21602)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(bool p0, bool p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(bool,bool,string)`.
mstore(0x00, 0x2555fa46)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x60)
writeString(0x80, p2)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bool p0, uint256 p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(bool,uint256,address)`.
mstore(0x00, 0x088ef9d2)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(bool p0, uint256 p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(bool,uint256,bool)`.
mstore(0x00, 0xe8defba9)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(bool p0, uint256 p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(bool,uint256,uint256)`.
mstore(0x00, 0x37103367)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(bool p0, uint256 p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(bool,uint256,string)`.
mstore(0x00, 0xc3fc3970)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x60)
writeString(0x80, p2)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bool p0, bytes32 p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(bool,string,address)`.
mstore(0x00, 0x9591b953)
mstore(0x20, p0)
mstore(0x40, 0x60)
mstore(0x60, p2)
writeString(0x80, p1)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bool p0, bytes32 p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(bool,string,bool)`.
mstore(0x00, 0xdbb4c247)
mstore(0x20, p0)
mstore(0x40, 0x60)
mstore(0x60, p2)
writeString(0x80, p1)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bool p0, bytes32 p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(bool,string,uint256)`.
mstore(0x00, 0x1093ee11)
mstore(0x20, p0)
mstore(0x40, 0x60)
mstore(0x60, p2)
writeString(0x80, p1)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bool p0, bytes32 p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
// Selector of `log(bool,string,string)`.
mstore(0x00, 0xb076847f)
mstore(0x20, p0)
mstore(0x40, 0x60)
mstore(0x60, 0xa0)
writeString(0x80, p1)
writeString(0xc0, p2)
}
_sendLogPayload(0x1c, 0xe4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
}
}
function log(uint256 p0, address p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(uint256,address,address)`.
mstore(0x00, 0xbcfd9be0)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(uint256 p0, address p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(uint256,address,bool)`.
mstore(0x00, 0x9b6ec042)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(uint256 p0, address p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(uint256,address,uint256)`.
mstore(0x00, 0x5a9b5ed5)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(uint256 p0, address p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(uint256,address,string)`.
mstore(0x00, 0x63cb41f9)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x60)
writeString(0x80, p2)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(uint256 p0, bool p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(uint256,bool,address)`.
mstore(0x00, 0x35085f7b)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(uint256 p0, bool p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(uint256,bool,bool)`.
mstore(0x00, 0x20718650)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(uint256 p0, bool p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(uint256,bool,uint256)`.
mstore(0x00, 0x20098014)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(uint256 p0, bool p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(uint256,bool,string)`.
mstore(0x00, 0x85775021)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x60)
writeString(0x80, p2)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(uint256 p0, uint256 p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(uint256,uint256,address)`.
mstore(0x00, 0x5c96b331)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(uint256 p0, uint256 p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(uint256,uint256,bool)`.
mstore(0x00, 0x4766da72)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(uint256 p0, uint256 p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
// Selector of `log(uint256,uint256,uint256)`.
mstore(0x00, 0xd1ed7a3c)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
}
_sendLogPayload(0x1c, 0x64);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
}
}
function log(uint256 p0, uint256 p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(uint256,uint256,string)`.
mstore(0x00, 0x71d04af2)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x60)
writeString(0x80, p2)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(uint256 p0, bytes32 p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(uint256,string,address)`.
mstore(0x00, 0x7afac959)
mstore(0x20, p0)
mstore(0x40, 0x60)
mstore(0x60, p2)
writeString(0x80, p1)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(uint256 p0, bytes32 p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(uint256,string,bool)`.
mstore(0x00, 0x4ceda75a)
mstore(0x20, p0)
mstore(0x40, 0x60)
mstore(0x60, p2)
writeString(0x80, p1)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(uint256 p0, bytes32 p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(uint256,string,uint256)`.
mstore(0x00, 0x37aa7d4c)
mstore(0x20, p0)
mstore(0x40, 0x60)
mstore(0x60, p2)
writeString(0x80, p1)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(uint256 p0, bytes32 p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
// Selector of `log(uint256,string,string)`.
mstore(0x00, 0xb115611f)
mstore(0x20, p0)
mstore(0x40, 0x60)
mstore(0x60, 0xa0)
writeString(0x80, p1)
writeString(0xc0, p2)
}
_sendLogPayload(0x1c, 0xe4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
}
}
function log(bytes32 p0, address p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(string,address,address)`.
mstore(0x00, 0xfcec75e0)
mstore(0x20, 0x60)
mstore(0x40, p1)
mstore(0x60, p2)
writeString(0x80, p0)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bytes32 p0, address p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(string,address,bool)`.
mstore(0x00, 0xc91d5ed4)
mstore(0x20, 0x60)
mstore(0x40, p1)
mstore(0x60, p2)
writeString(0x80, p0)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bytes32 p0, address p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(string,address,uint256)`.
mstore(0x00, 0x0d26b925)
mstore(0x20, 0x60)
mstore(0x40, p1)
mstore(0x60, p2)
writeString(0x80, p0)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bytes32 p0, address p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
// Selector of `log(string,address,string)`.
mstore(0x00, 0xe0e9ad4f)
mstore(0x20, 0x60)
mstore(0x40, p1)
mstore(0x60, 0xa0)
writeString(0x80, p0)
writeString(0xc0, p2)
}
_sendLogPayload(0x1c, 0xe4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
}
}
function log(bytes32 p0, bool p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(string,bool,address)`.
mstore(0x00, 0x932bbb38)
mstore(0x20, 0x60)
mstore(0x40, p1)
mstore(0x60, p2)
writeString(0x80, p0)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bytes32 p0, bool p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(string,bool,bool)`.
mstore(0x00, 0x850b7ad6)
mstore(0x20, 0x60)
mstore(0x40, p1)
mstore(0x60, p2)
writeString(0x80, p0)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bytes32 p0, bool p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(string,bool,uint256)`.
mstore(0x00, 0xc95958d6)
mstore(0x20, 0x60)
mstore(0x40, p1)
mstore(0x60, p2)
writeString(0x80, p0)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bytes32 p0, bool p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
// Selector of `log(string,bool,string)`.
mstore(0x00, 0xe298f47d)
mstore(0x20, 0x60)
mstore(0x40, p1)
mstore(0x60, 0xa0)
writeString(0x80, p0)
writeString(0xc0, p2)
}
_sendLogPayload(0x1c, 0xe4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
}
}
function log(bytes32 p0, uint256 p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(string,uint256,address)`.
mstore(0x00, 0x1c7ec448)
mstore(0x20, 0x60)
mstore(0x40, p1)
mstore(0x60, p2)
writeString(0x80, p0)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bytes32 p0, uint256 p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(string,uint256,bool)`.
mstore(0x00, 0xca7733b1)
mstore(0x20, 0x60)
mstore(0x40, p1)
mstore(0x60, p2)
writeString(0x80, p0)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bytes32 p0, uint256 p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
// Selector of `log(string,uint256,uint256)`.
mstore(0x00, 0xca47c4eb)
mstore(0x20, 0x60)
mstore(0x40, p1)
mstore(0x60, p2)
writeString(0x80, p0)
}
_sendLogPayload(0x1c, 0xa4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
}
}
function log(bytes32 p0, uint256 p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
// Selector of `log(string,uint256,string)`.
mstore(0x00, 0x5970e089)
mstore(0x20, 0x60)
mstore(0x40, p1)
mstore(0x60, 0xa0)
writeString(0x80, p0)
writeString(0xc0, p2)
}
_sendLogPayload(0x1c, 0xe4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
}
}
function log(bytes32 p0, bytes32 p1, address p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
// Selector of `log(string,string,address)`.
mstore(0x00, 0x95ed0195)
mstore(0x20, 0x60)
mstore(0x40, 0xa0)
mstore(0x60, p2)
writeString(0x80, p0)
writeString(0xc0, p1)
}
_sendLogPayload(0x1c, 0xe4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
}
}
function log(bytes32 p0, bytes32 p1, bool p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
// Selector of `log(string,string,bool)`.
mstore(0x00, 0xb0e0f9b5)
mstore(0x20, 0x60)
mstore(0x40, 0xa0)
mstore(0x60, p2)
writeString(0x80, p0)
writeString(0xc0, p1)
}
_sendLogPayload(0x1c, 0xe4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
}
}
function log(bytes32 p0, bytes32 p1, uint256 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
// Selector of `log(string,string,uint256)`.
mstore(0x00, 0x5821efa1)
mstore(0x20, 0x60)
mstore(0x40, 0xa0)
mstore(0x60, p2)
writeString(0x80, p0)
writeString(0xc0, p1)
}
_sendLogPayload(0x1c, 0xe4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
}
}
function log(bytes32 p0, bytes32 p1, bytes32 p2) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
// Selector of `log(string,string,string)`.
mstore(0x00, 0x2ced7cef)
mstore(0x20, 0x60)
mstore(0x40, 0xa0)
mstore(0x60, 0xe0)
writeString(0x80, p0)
writeString(0xc0, p1)
writeString(0x100, p2)
}
_sendLogPayload(0x1c, 0x124);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
}
}
function log(address p0, address p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,address,address,address)`.
mstore(0x00, 0x665bf134)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, address p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,address,address,bool)`.
mstore(0x00, 0x0e378994)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, address p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,address,address,uint256)`.
mstore(0x00, 0x94250d77)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, address p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,address,address,string)`.
mstore(0x00, 0xf808da20)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, address p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,address,bool,address)`.
mstore(0x00, 0x9f1bc36e)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, address p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,address,bool,bool)`.
mstore(0x00, 0x2cd4134a)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, address p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,address,bool,uint256)`.
mstore(0x00, 0x3971e78c)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, address p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,address,bool,string)`.
mstore(0x00, 0xaa6540c8)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, address p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,address,uint256,address)`.
mstore(0x00, 0x8da6def5)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, address p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,address,uint256,bool)`.
mstore(0x00, 0x9b4254e2)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, address p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,address,uint256,uint256)`.
mstore(0x00, 0xbe553481)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, address p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,address,uint256,string)`.
mstore(0x00, 0xfdb4f990)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, address p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,address,string,address)`.
mstore(0x00, 0x8f736d16)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, address p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,address,string,bool)`.
mstore(0x00, 0x6f1a594e)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, address p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,address,string,uint256)`.
mstore(0x00, 0xef1cefe7)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, address p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(address,address,string,string)`.
mstore(0x00, 0x21bdaf25)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, 0xc0)
writeString(0xa0, p2)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(address p0, bool p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,bool,address,address)`.
mstore(0x00, 0x660375dd)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, bool p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,bool,address,bool)`.
mstore(0x00, 0xa6f50b0f)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, bool p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,bool,address,uint256)`.
mstore(0x00, 0xa75c59de)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, bool p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,bool,address,string)`.
mstore(0x00, 0x2dd778e6)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bool p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,bool,bool,address)`.
mstore(0x00, 0xcf394485)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, bool p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,bool,bool,bool)`.
mstore(0x00, 0xcac43479)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, bool p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,bool,bool,uint256)`.
mstore(0x00, 0x8c4e5de6)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, bool p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,bool,bool,string)`.
mstore(0x00, 0xdfc4a2e8)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bool p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,bool,uint256,address)`.
mstore(0x00, 0xccf790a1)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, bool p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,bool,uint256,bool)`.
mstore(0x00, 0xc4643e20)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, bool p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,bool,uint256,uint256)`.
mstore(0x00, 0x386ff5f4)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, bool p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,bool,uint256,string)`.
mstore(0x00, 0x0aa6cfad)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bool p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,bool,string,address)`.
mstore(0x00, 0x19fd4956)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bool p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,bool,string,bool)`.
mstore(0x00, 0x50ad461d)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bool p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,bool,string,uint256)`.
mstore(0x00, 0x80e6a20b)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bool p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(address,bool,string,string)`.
mstore(0x00, 0x475c5c33)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, 0xc0)
writeString(0xa0, p2)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(address p0, uint256 p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,uint256,address,address)`.
mstore(0x00, 0x478d1c62)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, uint256 p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,uint256,address,bool)`.
mstore(0x00, 0xa1bcc9b3)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, uint256 p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,uint256,address,uint256)`.
mstore(0x00, 0x100f650e)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, uint256 p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,uint256,address,string)`.
mstore(0x00, 0x1da986ea)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, uint256 p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,uint256,bool,address)`.
mstore(0x00, 0xa31bfdcc)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, uint256 p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,uint256,bool,bool)`.
mstore(0x00, 0x3bf5e537)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, uint256 p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,uint256,bool,uint256)`.
mstore(0x00, 0x22f6b999)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, uint256 p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,uint256,bool,string)`.
mstore(0x00, 0xc5ad85f9)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, uint256 p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,uint256,uint256,address)`.
mstore(0x00, 0x20e3984d)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, uint256 p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,uint256,uint256,bool)`.
mstore(0x00, 0x66f1bc67)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, uint256 p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(address,uint256,uint256,uint256)`.
mstore(0x00, 0x34f0e636)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(address p0, uint256 p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,uint256,uint256,string)`.
mstore(0x00, 0x4a28c017)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, uint256 p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,uint256,string,address)`.
mstore(0x00, 0x5c430d47)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, uint256 p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,uint256,string,bool)`.
mstore(0x00, 0xcf18105c)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, uint256 p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,uint256,string,uint256)`.
mstore(0x00, 0xbf01f891)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, uint256 p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(address,uint256,string,string)`.
mstore(0x00, 0x88a8c406)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, 0xc0)
writeString(0xa0, p2)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(address p0, bytes32 p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,string,address,address)`.
mstore(0x00, 0x0d36fa20)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bytes32 p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,string,address,bool)`.
mstore(0x00, 0x0df12b76)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bytes32 p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,string,address,uint256)`.
mstore(0x00, 0x457fe3cf)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bytes32 p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(address,string,address,string)`.
mstore(0x00, 0xf7e36245)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p1)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(address p0, bytes32 p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,string,bool,address)`.
mstore(0x00, 0x205871c2)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bytes32 p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,string,bool,bool)`.
mstore(0x00, 0x5f1d5c9f)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bytes32 p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,string,bool,uint256)`.
mstore(0x00, 0x515e38b6)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bytes32 p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(address,string,bool,string)`.
mstore(0x00, 0xbc0b61fe)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p1)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(address p0, bytes32 p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,string,uint256,address)`.
mstore(0x00, 0x63183678)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bytes32 p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,string,uint256,bool)`.
mstore(0x00, 0x0ef7e050)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bytes32 p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(address,string,uint256,uint256)`.
mstore(0x00, 0x1dc8e1b8)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(address p0, bytes32 p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(address,string,uint256,string)`.
mstore(0x00, 0x448830a8)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p1)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(address p0, bytes32 p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(address,string,string,address)`.
mstore(0x00, 0xa04e2f87)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p1)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(address p0, bytes32 p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(address,string,string,bool)`.
mstore(0x00, 0x35a5071f)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p1)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(address p0, bytes32 p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(address,string,string,uint256)`.
mstore(0x00, 0x159f8927)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p1)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(address p0, bytes32 p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
bytes32 m10;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
m10 := mload(0x140)
// Selector of `log(address,string,string,string)`.
mstore(0x00, 0x5d02c50b)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, 0xc0)
mstore(0x80, 0x100)
writeString(0xa0, p1)
writeString(0xe0, p2)
writeString(0x120, p3)
}
_sendLogPayload(0x1c, 0x144);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
mstore(0x140, m10)
}
}
function log(bool p0, address p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,address,address,address)`.
mstore(0x00, 0x1d14d001)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, address p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,address,address,bool)`.
mstore(0x00, 0x46600be0)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, address p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,address,address,uint256)`.
mstore(0x00, 0x0c66d1be)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, address p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,address,address,string)`.
mstore(0x00, 0xd812a167)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, address p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,address,bool,address)`.
mstore(0x00, 0x1c41a336)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, address p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,address,bool,bool)`.
mstore(0x00, 0x6a9c478b)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, address p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,address,bool,uint256)`.
mstore(0x00, 0x07831502)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, address p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,address,bool,string)`.
mstore(0x00, 0x4a66cb34)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, address p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,address,uint256,address)`.
mstore(0x00, 0x136b05dd)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, address p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,address,uint256,bool)`.
mstore(0x00, 0xd6019f1c)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, address p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,address,uint256,uint256)`.
mstore(0x00, 0x7bf181a1)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, address p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,address,uint256,string)`.
mstore(0x00, 0x51f09ff8)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, address p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,address,string,address)`.
mstore(0x00, 0x6f7c603e)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, address p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,address,string,bool)`.
mstore(0x00, 0xe2bfd60b)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, address p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,address,string,uint256)`.
mstore(0x00, 0xc21f64c7)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, address p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(bool,address,string,string)`.
mstore(0x00, 0xa73c1db6)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, 0xc0)
writeString(0xa0, p2)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bool p0, bool p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,bool,address,address)`.
mstore(0x00, 0xf4880ea4)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, bool p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,bool,address,bool)`.
mstore(0x00, 0xc0a302d8)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, bool p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,bool,address,uint256)`.
mstore(0x00, 0x4c123d57)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, bool p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,bool,address,string)`.
mstore(0x00, 0xa0a47963)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bool p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,bool,bool,address)`.
mstore(0x00, 0x8c329b1a)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, bool p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,bool,bool,bool)`.
mstore(0x00, 0x3b2a5ce0)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, bool p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,bool,bool,uint256)`.
mstore(0x00, 0x6d7045c1)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, bool p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,bool,bool,string)`.
mstore(0x00, 0x2ae408d4)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bool p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,bool,uint256,address)`.
mstore(0x00, 0x54a7a9a0)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, bool p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,bool,uint256,bool)`.
mstore(0x00, 0x619e4d0e)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, bool p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,bool,uint256,uint256)`.
mstore(0x00, 0x0bb00eab)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, bool p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,bool,uint256,string)`.
mstore(0x00, 0x7dd4d0e0)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bool p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,bool,string,address)`.
mstore(0x00, 0xf9ad2b89)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bool p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,bool,string,bool)`.
mstore(0x00, 0xb857163a)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bool p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,bool,string,uint256)`.
mstore(0x00, 0xe3a9ca2f)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bool p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(bool,bool,string,string)`.
mstore(0x00, 0x6d1e8751)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, 0xc0)
writeString(0xa0, p2)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bool p0, uint256 p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,uint256,address,address)`.
mstore(0x00, 0x26f560a8)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, uint256 p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,uint256,address,bool)`.
mstore(0x00, 0xb4c314ff)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, uint256 p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,uint256,address,uint256)`.
mstore(0x00, 0x1537dc87)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, uint256 p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,uint256,address,string)`.
mstore(0x00, 0x1bb3b09a)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, uint256 p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,uint256,bool,address)`.
mstore(0x00, 0x9acd3616)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, uint256 p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,uint256,bool,bool)`.
mstore(0x00, 0xceb5f4d7)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, uint256 p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,uint256,bool,uint256)`.
mstore(0x00, 0x7f9bbca2)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, uint256 p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,uint256,bool,string)`.
mstore(0x00, 0x9143dbb1)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, uint256 p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,uint256,uint256,address)`.
mstore(0x00, 0x00dd87b9)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, uint256 p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,uint256,uint256,bool)`.
mstore(0x00, 0xbe984353)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, uint256 p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(bool,uint256,uint256,uint256)`.
mstore(0x00, 0x374bb4b2)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(bool p0, uint256 p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,uint256,uint256,string)`.
mstore(0x00, 0x8e69fb5d)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, uint256 p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,uint256,string,address)`.
mstore(0x00, 0xfedd1fff)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, uint256 p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,uint256,string,bool)`.
mstore(0x00, 0xe5e70b2b)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, uint256 p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,uint256,string,uint256)`.
mstore(0x00, 0x6a1199e2)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, uint256 p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(bool,uint256,string,string)`.
mstore(0x00, 0xf5bc2249)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, 0xc0)
writeString(0xa0, p2)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bool p0, bytes32 p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,string,address,address)`.
mstore(0x00, 0x2b2b18dc)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bytes32 p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,string,address,bool)`.
mstore(0x00, 0x6dd434ca)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bytes32 p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,string,address,uint256)`.
mstore(0x00, 0xa5cada94)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bytes32 p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(bool,string,address,string)`.
mstore(0x00, 0x12d6c788)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p1)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bool p0, bytes32 p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,string,bool,address)`.
mstore(0x00, 0x538e06ab)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bytes32 p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,string,bool,bool)`.
mstore(0x00, 0xdc5e935b)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bytes32 p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,string,bool,uint256)`.
mstore(0x00, 0x1606a393)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bytes32 p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(bool,string,bool,string)`.
mstore(0x00, 0x483d0416)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p1)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bool p0, bytes32 p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,string,uint256,address)`.
mstore(0x00, 0x1596a1ce)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bytes32 p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,string,uint256,bool)`.
mstore(0x00, 0x6b0e5d53)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bytes32 p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(bool,string,uint256,uint256)`.
mstore(0x00, 0x28863fcb)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bool p0, bytes32 p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(bool,string,uint256,string)`.
mstore(0x00, 0x1ad96de6)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p1)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bool p0, bytes32 p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(bool,string,string,address)`.
mstore(0x00, 0x97d394d8)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p1)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bool p0, bytes32 p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(bool,string,string,bool)`.
mstore(0x00, 0x1e4b87e5)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p1)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bool p0, bytes32 p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(bool,string,string,uint256)`.
mstore(0x00, 0x7be0c3eb)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p1)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bool p0, bytes32 p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
bytes32 m10;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
m10 := mload(0x140)
// Selector of `log(bool,string,string,string)`.
mstore(0x00, 0x1762e32a)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, 0xc0)
mstore(0x80, 0x100)
writeString(0xa0, p1)
writeString(0xe0, p2)
writeString(0x120, p3)
}
_sendLogPayload(0x1c, 0x144);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
mstore(0x140, m10)
}
}
function log(uint256 p0, address p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,address,address,address)`.
mstore(0x00, 0x2488b414)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, address p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,address,address,bool)`.
mstore(0x00, 0x091ffaf5)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, address p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,address,address,uint256)`.
mstore(0x00, 0x736efbb6)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, address p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,address,address,string)`.
mstore(0x00, 0x031c6f73)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, address p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,address,bool,address)`.
mstore(0x00, 0xef72c513)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, address p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,address,bool,bool)`.
mstore(0x00, 0xe351140f)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, address p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,address,bool,uint256)`.
mstore(0x00, 0x5abd992a)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, address p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,address,bool,string)`.
mstore(0x00, 0x90fb06aa)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, address p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,address,uint256,address)`.
mstore(0x00, 0x15c127b5)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, address p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,address,uint256,bool)`.
mstore(0x00, 0x5f743a7c)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, address p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,address,uint256,uint256)`.
mstore(0x00, 0x0c9cd9c1)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, address p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,address,uint256,string)`.
mstore(0x00, 0xddb06521)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, address p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,address,string,address)`.
mstore(0x00, 0x9cba8fff)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, address p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,address,string,bool)`.
mstore(0x00, 0xcc32ab07)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, address p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,address,string,uint256)`.
mstore(0x00, 0x46826b5d)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, address p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(uint256,address,string,string)`.
mstore(0x00, 0x3e128ca3)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, 0xc0)
writeString(0xa0, p2)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(uint256 p0, bool p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,bool,address,address)`.
mstore(0x00, 0xa1ef4cbb)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, bool p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,bool,address,bool)`.
mstore(0x00, 0x454d54a5)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, bool p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,bool,address,uint256)`.
mstore(0x00, 0x078287f5)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, bool p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,bool,address,string)`.
mstore(0x00, 0xade052c7)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bool p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,bool,bool,address)`.
mstore(0x00, 0x69640b59)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, bool p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,bool,bool,bool)`.
mstore(0x00, 0xb6f577a1)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, bool p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,bool,bool,uint256)`.
mstore(0x00, 0x7464ce23)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, bool p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,bool,bool,string)`.
mstore(0x00, 0xdddb9561)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bool p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,bool,uint256,address)`.
mstore(0x00, 0x88cb6041)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, bool p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,bool,uint256,bool)`.
mstore(0x00, 0x91a02e2a)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, bool p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,bool,uint256,uint256)`.
mstore(0x00, 0xc6acc7a8)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, bool p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,bool,uint256,string)`.
mstore(0x00, 0xde03e774)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bool p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,bool,string,address)`.
mstore(0x00, 0xef529018)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bool p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,bool,string,bool)`.
mstore(0x00, 0xeb928d7f)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bool p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,bool,string,uint256)`.
mstore(0x00, 0x2c1d0746)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bool p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(uint256,bool,string,string)`.
mstore(0x00, 0x68c8b8bd)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, 0xc0)
writeString(0xa0, p2)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(uint256 p0, uint256 p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,uint256,address,address)`.
mstore(0x00, 0x56a5d1b1)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, uint256 p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,uint256,address,bool)`.
mstore(0x00, 0x15cac476)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, uint256 p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,uint256,address,uint256)`.
mstore(0x00, 0x88f6e4b2)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, uint256 p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,uint256,address,string)`.
mstore(0x00, 0x6cde40b8)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, uint256 p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,uint256,bool,address)`.
mstore(0x00, 0x9a816a83)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, uint256 p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,uint256,bool,bool)`.
mstore(0x00, 0xab085ae6)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, uint256 p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,uint256,bool,uint256)`.
mstore(0x00, 0xeb7f6fd2)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, uint256 p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,uint256,bool,string)`.
mstore(0x00, 0xa5b4fc99)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, uint256 p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,uint256,uint256,address)`.
mstore(0x00, 0xfa8185af)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, uint256 p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,uint256,uint256,bool)`.
mstore(0x00, 0xc598d185)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, uint256 p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
assembly {
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
// Selector of `log(uint256,uint256,uint256,uint256)`.
mstore(0x00, 0x193fb800)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
}
_sendLogPayload(0x1c, 0x84);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
}
}
function log(uint256 p0, uint256 p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,uint256,uint256,string)`.
mstore(0x00, 0x59cfcbe3)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0x80)
writeString(0xa0, p3)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, uint256 p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,uint256,string,address)`.
mstore(0x00, 0x42d21db7)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, uint256 p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,uint256,string,bool)`.
mstore(0x00, 0x7af6ab25)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, uint256 p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,uint256,string,uint256)`.
mstore(0x00, 0x5da297eb)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, p3)
writeString(0xa0, p2)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, uint256 p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(uint256,uint256,string,string)`.
mstore(0x00, 0x27d8afd2)
mstore(0x20, p0)
mstore(0x40, p1)
mstore(0x60, 0x80)
mstore(0x80, 0xc0)
writeString(0xa0, p2)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(uint256 p0, bytes32 p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,string,address,address)`.
mstore(0x00, 0x6168ed61)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bytes32 p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,string,address,bool)`.
mstore(0x00, 0x90c30a56)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bytes32 p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,string,address,uint256)`.
mstore(0x00, 0xe8d3018d)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bytes32 p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(uint256,string,address,string)`.
mstore(0x00, 0x9c3adfa1)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p1)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(uint256 p0, bytes32 p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,string,bool,address)`.
mstore(0x00, 0xae2ec581)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bytes32 p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,string,bool,bool)`.
mstore(0x00, 0xba535d9c)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bytes32 p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,string,bool,uint256)`.
mstore(0x00, 0xcf009880)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bytes32 p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(uint256,string,bool,string)`.
mstore(0x00, 0xd2d423cd)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p1)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(uint256 p0, bytes32 p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,string,uint256,address)`.
mstore(0x00, 0x3b2279b4)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bytes32 p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,string,uint256,bool)`.
mstore(0x00, 0x691a8f74)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bytes32 p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(uint256,string,uint256,uint256)`.
mstore(0x00, 0x82c25b74)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p1)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(uint256 p0, bytes32 p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(uint256,string,uint256,string)`.
mstore(0x00, 0xb7b914ca)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p1)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(uint256 p0, bytes32 p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(uint256,string,string,address)`.
mstore(0x00, 0xd583c602)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p1)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(uint256 p0, bytes32 p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(uint256,string,string,bool)`.
mstore(0x00, 0xb3a6b6bd)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p1)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(uint256 p0, bytes32 p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(uint256,string,string,uint256)`.
mstore(0x00, 0xb028c9bd)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p1)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(uint256 p0, bytes32 p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
bytes32 m10;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
m10 := mload(0x140)
// Selector of `log(uint256,string,string,string)`.
mstore(0x00, 0x21ad0683)
mstore(0x20, p0)
mstore(0x40, 0x80)
mstore(0x60, 0xc0)
mstore(0x80, 0x100)
writeString(0xa0, p1)
writeString(0xe0, p2)
writeString(0x120, p3)
}
_sendLogPayload(0x1c, 0x144);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
mstore(0x140, m10)
}
}
function log(bytes32 p0, address p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,address,address,address)`.
mstore(0x00, 0xed8f28f6)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, address p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,address,address,bool)`.
mstore(0x00, 0xb59dbd60)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, address p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,address,address,uint256)`.
mstore(0x00, 0x8ef3f399)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, address p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,address,address,string)`.
mstore(0x00, 0x800a1c67)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p0)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, address p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,address,bool,address)`.
mstore(0x00, 0x223603bd)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, address p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,address,bool,bool)`.
mstore(0x00, 0x79884c2b)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, address p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,address,bool,uint256)`.
mstore(0x00, 0x3e9f866a)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, address p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,address,bool,string)`.
mstore(0x00, 0x0454c079)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p0)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, address p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,address,uint256,address)`.
mstore(0x00, 0x63fb8bc5)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, address p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,address,uint256,bool)`.
mstore(0x00, 0xfc4845f0)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, address p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,address,uint256,uint256)`.
mstore(0x00, 0xf8f51b1e)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, address p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,address,uint256,string)`.
mstore(0x00, 0x5a477632)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p0)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, address p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,address,string,address)`.
mstore(0x00, 0xaabc9a31)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, address p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,address,string,bool)`.
mstore(0x00, 0x5f15d28c)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, address p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,address,string,uint256)`.
mstore(0x00, 0x91d1112e)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, address p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
bytes32 m10;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
m10 := mload(0x140)
// Selector of `log(string,address,string,string)`.
mstore(0x00, 0x245986f2)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, 0xc0)
mstore(0x80, 0x100)
writeString(0xa0, p0)
writeString(0xe0, p2)
writeString(0x120, p3)
}
_sendLogPayload(0x1c, 0x144);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
mstore(0x140, m10)
}
}
function log(bytes32 p0, bool p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,bool,address,address)`.
mstore(0x00, 0x33e9dd1d)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, bool p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,bool,address,bool)`.
mstore(0x00, 0x958c28c6)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, bool p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,bool,address,uint256)`.
mstore(0x00, 0x5d08bb05)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, bool p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,bool,address,string)`.
mstore(0x00, 0x2d8e33a4)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p0)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bool p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,bool,bool,address)`.
mstore(0x00, 0x7190a529)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, bool p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,bool,bool,bool)`.
mstore(0x00, 0x895af8c5)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, bool p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,bool,bool,uint256)`.
mstore(0x00, 0x8e3f78a9)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, bool p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,bool,bool,string)`.
mstore(0x00, 0x9d22d5dd)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p0)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bool p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,bool,uint256,address)`.
mstore(0x00, 0x935e09bf)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, bool p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,bool,uint256,bool)`.
mstore(0x00, 0x8af7cf8a)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, bool p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,bool,uint256,uint256)`.
mstore(0x00, 0x64b5bb67)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, bool p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,bool,uint256,string)`.
mstore(0x00, 0x742d6ee7)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p0)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bool p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,bool,string,address)`.
mstore(0x00, 0xe0625b29)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bool p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,bool,string,bool)`.
mstore(0x00, 0x3f8a701d)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bool p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,bool,string,uint256)`.
mstore(0x00, 0x24f91465)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bool p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
bytes32 m10;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
m10 := mload(0x140)
// Selector of `log(string,bool,string,string)`.
mstore(0x00, 0xa826caeb)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, 0xc0)
mstore(0x80, 0x100)
writeString(0xa0, p0)
writeString(0xe0, p2)
writeString(0x120, p3)
}
_sendLogPayload(0x1c, 0x144);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
mstore(0x140, m10)
}
}
function log(bytes32 p0, uint256 p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,uint256,address,address)`.
mstore(0x00, 0x5ea2b7ae)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, uint256 p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,uint256,address,bool)`.
mstore(0x00, 0x82112a42)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, uint256 p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,uint256,address,uint256)`.
mstore(0x00, 0x4f04fdc6)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, uint256 p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,uint256,address,string)`.
mstore(0x00, 0x9ffb2f93)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p0)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, uint256 p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,uint256,bool,address)`.
mstore(0x00, 0xe0e95b98)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, uint256 p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,uint256,bool,bool)`.
mstore(0x00, 0x354c36d6)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, uint256 p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,uint256,bool,uint256)`.
mstore(0x00, 0xe41b6f6f)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, uint256 p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,uint256,bool,string)`.
mstore(0x00, 0xabf73a98)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p0)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, uint256 p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,uint256,uint256,address)`.
mstore(0x00, 0xe21de278)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, uint256 p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,uint256,uint256,bool)`.
mstore(0x00, 0x7626db92)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, uint256 p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
// Selector of `log(string,uint256,uint256,uint256)`.
mstore(0x00, 0xa7a87853)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
}
_sendLogPayload(0x1c, 0xc4);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
}
}
function log(bytes32 p0, uint256 p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,uint256,uint256,string)`.
mstore(0x00, 0x854b3496)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, p2)
mstore(0x80, 0xc0)
writeString(0xa0, p0)
writeString(0xe0, p3)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, uint256 p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,uint256,string,address)`.
mstore(0x00, 0x7c4632a4)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, uint256 p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,uint256,string,bool)`.
mstore(0x00, 0x7d24491d)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, uint256 p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,uint256,string,uint256)`.
mstore(0x00, 0xc67ea9d1)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, 0xc0)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p2)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, uint256 p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
bytes32 m10;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
m10 := mload(0x140)
// Selector of `log(string,uint256,string,string)`.
mstore(0x00, 0x5ab84e1f)
mstore(0x20, 0x80)
mstore(0x40, p1)
mstore(0x60, 0xc0)
mstore(0x80, 0x100)
writeString(0xa0, p0)
writeString(0xe0, p2)
writeString(0x120, p3)
}
_sendLogPayload(0x1c, 0x144);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
mstore(0x140, m10)
}
}
function log(bytes32 p0, bytes32 p1, address p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,string,address,address)`.
mstore(0x00, 0x439c7bef)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p1)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bytes32 p1, address p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,string,address,bool)`.
mstore(0x00, 0x5ccd4e37)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p1)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bytes32 p1, address p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,string,address,uint256)`.
mstore(0x00, 0x7cc3c607)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p1)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bytes32 p1, address p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
bytes32 m10;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
m10 := mload(0x140)
// Selector of `log(string,string,address,string)`.
mstore(0x00, 0xeb1bff80)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, p2)
mstore(0x80, 0x100)
writeString(0xa0, p0)
writeString(0xe0, p1)
writeString(0x120, p3)
}
_sendLogPayload(0x1c, 0x144);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
mstore(0x140, m10)
}
}
function log(bytes32 p0, bytes32 p1, bool p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,string,bool,address)`.
mstore(0x00, 0xc371c7db)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p1)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bytes32 p1, bool p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,string,bool,bool)`.
mstore(0x00, 0x40785869)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p1)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bytes32 p1, bool p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,string,bool,uint256)`.
mstore(0x00, 0xd6aefad2)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p1)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bytes32 p1, bool p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
bytes32 m10;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
m10 := mload(0x140)
// Selector of `log(string,string,bool,string)`.
mstore(0x00, 0x5e84b0ea)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, p2)
mstore(0x80, 0x100)
writeString(0xa0, p0)
writeString(0xe0, p1)
writeString(0x120, p3)
}
_sendLogPayload(0x1c, 0x144);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
mstore(0x140, m10)
}
}
function log(bytes32 p0, bytes32 p1, uint256 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,string,uint256,address)`.
mstore(0x00, 0x1023f7b2)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p1)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bytes32 p1, uint256 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,string,uint256,bool)`.
mstore(0x00, 0xc3a8a654)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p1)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bytes32 p1, uint256 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
// Selector of `log(string,string,uint256,uint256)`.
mstore(0x00, 0xf45d7d2c)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, p2)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p1)
}
_sendLogPayload(0x1c, 0x104);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
}
}
function log(bytes32 p0, bytes32 p1, uint256 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
bytes32 m10;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
m10 := mload(0x140)
// Selector of `log(string,string,uint256,string)`.
mstore(0x00, 0x5d1a971a)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, p2)
mstore(0x80, 0x100)
writeString(0xa0, p0)
writeString(0xe0, p1)
writeString(0x120, p3)
}
_sendLogPayload(0x1c, 0x144);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
mstore(0x140, m10)
}
}
function log(bytes32 p0, bytes32 p1, bytes32 p2, address p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
bytes32 m10;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
m10 := mload(0x140)
// Selector of `log(string,string,string,address)`.
mstore(0x00, 0x6d572f44)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, 0x100)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p1)
writeString(0x120, p2)
}
_sendLogPayload(0x1c, 0x144);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
mstore(0x140, m10)
}
}
function log(bytes32 p0, bytes32 p1, bytes32 p2, bool p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
bytes32 m10;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
m10 := mload(0x140)
// Selector of `log(string,string,string,bool)`.
mstore(0x00, 0x2c1754ed)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, 0x100)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p1)
writeString(0x120, p2)
}
_sendLogPayload(0x1c, 0x144);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
mstore(0x140, m10)
}
}
function log(bytes32 p0, bytes32 p1, bytes32 p2, uint256 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
bytes32 m10;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
m10 := mload(0x140)
// Selector of `log(string,string,string,uint256)`.
mstore(0x00, 0x8eafb02b)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, 0x100)
mstore(0x80, p3)
writeString(0xa0, p0)
writeString(0xe0, p1)
writeString(0x120, p2)
}
_sendLogPayload(0x1c, 0x144);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
mstore(0x140, m10)
}
}
function log(bytes32 p0, bytes32 p1, bytes32 p2, bytes32 p3) internal pure {
bytes32 m0;
bytes32 m1;
bytes32 m2;
bytes32 m3;
bytes32 m4;
bytes32 m5;
bytes32 m6;
bytes32 m7;
bytes32 m8;
bytes32 m9;
bytes32 m10;
bytes32 m11;
bytes32 m12;
assembly {
function writeString(pos, w) {
let length := 0
for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } }
mstore(pos, length)
let shift := sub(256, shl(3, length))
mstore(add(pos, 0x20), shl(shift, shr(shift, w)))
}
m0 := mload(0x00)
m1 := mload(0x20)
m2 := mload(0x40)
m3 := mload(0x60)
m4 := mload(0x80)
m5 := mload(0xa0)
m6 := mload(0xc0)
m7 := mload(0xe0)
m8 := mload(0x100)
m9 := mload(0x120)
m10 := mload(0x140)
m11 := mload(0x160)
m12 := mload(0x180)
// Selector of `log(string,string,string,string)`.
mstore(0x00, 0xde68f20a)
mstore(0x20, 0x80)
mstore(0x40, 0xc0)
mstore(0x60, 0x100)
mstore(0x80, 0x140)
writeString(0xa0, p0)
writeString(0xe0, p1)
writeString(0x120, p2)
writeString(0x160, p3)
}
_sendLogPayload(0x1c, 0x184);
assembly {
mstore(0x00, m0)
mstore(0x20, m1)
mstore(0x40, m2)
mstore(0x60, m3)
mstore(0x80, m4)
mstore(0xa0, m5)
mstore(0xc0, m6)
mstore(0xe0, m7)
mstore(0x100, m8)
mstore(0x120, m9)
mstore(0x140, m10)
mstore(0x160, m11)
mstore(0x180, m12)
}
}
}
{
"compilationTarget": {
"src/base/Roles/DelayedWithdraw.sol": "DelayedWithdraw"
},
"evmVersion": "shanghai",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [
":@ccip/=lib/ccip/",
":@ds-test/=lib/forge-std/lib/ds-test/src/",
":@forge-std/=lib/forge-std/src/",
":@layerzerolabs/lz-evm-messagelib-v2/=lib/lz-upgradable/messagelib/",
":@layerzerolabs/lz-evm-oapp-v2/=lib/lz-upgradable/oapp/",
":@layerzerolabs/lz-evm-protocol-v2/=lib/lz-upgradable/protocol/",
":@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
":@solmate/=lib/solmate/src/",
":LayerZero-v2/=lib/LayerZero-v2/",
":ccip/=lib/ccip/",
":ds-test/=lib/forge-std/lib/ds-test/src/",
":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
":forge-std/=lib/forge-std/src/",
":lz-upgradable/=lib/lz-upgradable/oapp/",
":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
":openzeppelin-contracts/=lib/openzeppelin-contracts/",
":openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
":openzeppelin/=lib/openzeppelin-contracts/contracts/",
":solidity-bytes-utils/=lib/solidity-bytes-utils/",
":solmate/=lib/solmate/src/"
]
}
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_boringVault","type":"address"},{"internalType":"address","name":"_accountant","type":"address"},{"internalType":"address","name":"_feeAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"DelayedWithdraw__AlreadySetup","type":"error"},{"inputs":[],"name":"DelayedWithdraw__BadAddress","type":"error"},{"inputs":[],"name":"DelayedWithdraw__CallerNotBoringVault","type":"error"},{"inputs":[],"name":"DelayedWithdraw__CannotWithdrawBoringToken","type":"error"},{"inputs":[],"name":"DelayedWithdraw__MaxLossExceeded","type":"error"},{"inputs":[],"name":"DelayedWithdraw__MaxLossTooLarge","type":"error"},{"inputs":[],"name":"DelayedWithdraw__NoSharesToWithdraw","type":"error"},{"inputs":[],"name":"DelayedWithdraw__Paused","type":"error"},{"inputs":[],"name":"DelayedWithdraw__RequestPastCompletionWindow","type":"error"},{"inputs":[],"name":"DelayedWithdraw__ThirdPartyCompletionNotAllowed","type":"error"},{"inputs":[],"name":"DelayedWithdraw__WithdrawFeeTooHigh","type":"error"},{"inputs":[],"name":"DelayedWithdraw__WithdrawNotMatured","type":"error"},{"inputs":[],"name":"DelayedWithdraw__WithdrawsNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"contract Authority","name":"newAuthority","type":"address"}],"name":"AuthorityUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint32","name":"newCompletionWindow","type":"uint32"}],"name":"CompletionWindowUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newFeeAddress","type":"address"}],"name":"FeeAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint16","name":"newMaxLoss","type":"uint16"}],"name":"MaxLossUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_pullFundsFromVault","type":"bool"}],"name":"PullFundsFromVaultUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint64","name":"withdrawDelay","type":"uint64"},{"indexed":false,"internalType":"uint16","name":"withdrawFee","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"maxLoss","type":"uint16"}],"name":"SetupWithdrawalsInAsset","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"contract ERC20","name":"asset","type":"address"},{"indexed":false,"internalType":"bool","name":"allowed","type":"bool"}],"name":"ThirdPartyCompletionChanged","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"contract ERC20","name":"asset","type":"address"},{"indexed":false,"internalType":"uint96","name":"shares","type":"uint96"}],"name":"WithdrawCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"contract ERC20","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"}],"name":"WithdrawCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint32","name":"newWithdrawDelay","type":"uint32"}],"name":"WithdrawDelayUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint16","name":"newWithdrawFee","type":"uint16"}],"name":"WithdrawFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"contract ERC20","name":"asset","type":"address"},{"indexed":false,"internalType":"uint96","name":"shares","type":"uint96"},{"indexed":false,"internalType":"uint40","name":"maturity","type":"uint40"}],"name":"WithdrawRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"}],"name":"WithdrawalsStopped","type":"event"},{"inputs":[],"name":"authority","outputs":[{"internalType":"contract Authority","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"cancelUserWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"}],"name":"cancelWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"},{"internalType":"uint32","name":"completionWindow","type":"uint32"}],"name":"changeCompletionWindow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"},{"internalType":"uint16","name":"maxLoss","type":"uint16"}],"name":"changeMaxLoss","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"},{"internalType":"uint32","name":"withdrawDelay","type":"uint32"}],"name":"changeWithdrawDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"},{"internalType":"uint16","name":"withdrawFee","type":"uint16"}],"name":"changeWithdrawFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cmETH","outputs":[{"internalType":"contract L1cmETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"completeUserWithdraw","outputs":[{"internalType":"uint256","name":"assetsOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"completeWithdraw","outputs":[{"internalType":"uint256","name":"assetsOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pullFundsFromVault","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"},{"internalType":"uint96","name":"shares","type":"uint96"},{"internalType":"uint16","name":"maxLoss","type":"uint16"},{"internalType":"bool","name":"allowThirdPartyToComplete","type":"bool"}],"name":"requestWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"},{"internalType":"bool","name":"allow","type":"bool"}],"name":"setAllowThirdPartyToComplete","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract Authority","name":"newAuthority","type":"address"}],"name":"setAuthority","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"setFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_pullFundsFromVault","type":"bool"}],"name":"setPullFundsFromVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"},{"internalType":"uint32","name":"withdrawDelay","type":"uint32"},{"internalType":"uint32","name":"completionWindow","type":"uint32"},{"internalType":"uint16","name":"withdrawFee","type":"uint16"},{"internalType":"uint16","name":"maxLoss","type":"uint16"}],"name":"setupWithdrawAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"}],"name":"stopWithdrawalsInAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"asset","type":"address"}],"name":"viewOutstandingDebt","outputs":[{"internalType":"uint256","name":"debt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ERC20[]","name":"assets","type":"address[]"}],"name":"viewOutstandingDebts","outputs":[{"internalType":"uint256[]","name":"debts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"name":"withdrawAssets","outputs":[{"internalType":"bool","name":"allowWithdraws","type":"bool"},{"internalType":"uint32","name":"withdrawDelay","type":"uint32"},{"internalType":"uint32","name":"completionWindow","type":"uint32"},{"internalType":"uint128","name":"outstandingShares","type":"uint128"},{"internalType":"uint16","name":"withdrawFee","type":"uint16"},{"internalType":"uint16","name":"maxLoss","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawNonBoringToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"contract ERC20","name":"","type":"address"}],"name":"withdrawRequests","outputs":[{"internalType":"bool","name":"allowThirdPartyToComplete","type":"bool"},{"internalType":"uint16","name":"maxLoss","type":"uint16"},{"internalType":"uint40","name":"maturity","type":"uint40"},{"internalType":"uint96","name":"shares","type":"uint96"},{"internalType":"uint96","name":"exchangeRateAtTimeOfRequest","type":"uint96"}],"stateMutability":"view","type":"function"}]