Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
BalanceTracker
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 999999 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.15; import { Address } from "@openzeppelin/contracts/utils/Address.sol"; import { Math } from "@openzeppelin/contracts/utils/math/Math.sol"; import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import { SafeCall } from "@eth-optimism-bedrock/src/libraries/SafeCall.sol"; /** * @title BalanceTracker * @dev Funds system addresses and sends the remaining profits to the profit wallet. */ contract BalanceTracker is ReentrancyGuardUpgradeable { using Address for address; /*////////////////////////////////////////////////////////////// Constants //////////////////////////////////////////////////////////////*/ /** * @dev The maximum number of system addresses that can be funded. */ uint256 public constant MAX_SYSTEM_ADDRESS_COUNT = 20; /*////////////////////////////////////////////////////////////// Immutables //////////////////////////////////////////////////////////////*/ /** * @dev The address of the wallet receiving profits. */ address payable public immutable PROFIT_WALLET; /*////////////////////////////////////////////////////////////// VARIABLES //////////////////////////////////////////////////////////////*/ /** * @dev The system addresses being funded. */ address payable[] public systemAddresses; /** * @dev The target balances for system addresses. */ uint256[] public targetBalances; /*////////////////////////////////////////////////////////////// Events //////////////////////////////////////////////////////////////*/ /** * @dev Emitted when the BalanceTracker sends funds to a system address. * @param _systemAddress The system address being funded. * @param _success A boolean denoting whether a fund send occurred and its success or failure. * @param _balanceNeeded The amount of funds the given system address needs to reach its target balance. * @param _balanceSent The amount of funds sent to the system address. */ event ProcessedFunds( address indexed _systemAddress, bool indexed _success, uint256 _balanceNeeded, uint256 _balanceSent ); /** * @dev Emitted when the BalanceTracker attempts to send funds to the profit wallet. * @param _profitWallet The address of the profit wallet. * @param _success A boolean denoting the success or failure of fund send. * @param _balanceSent The amount of funds sent to the profit wallet. */ event SentProfit( address indexed _profitWallet, bool indexed _success, uint256 _balanceSent ); /** * @dev Emitted when funds are received. * @param _sender The address sending funds. * @param _amount The amount of funds received from the sender. */ event ReceivedFunds( address indexed _sender, uint256 _amount ); /*////////////////////////////////////////////////////////////// Constructor //////////////////////////////////////////////////////////////*/ /** * @dev Constructor for the BalanceTracker contract that sets an immutable variable. * @param _profitWallet The address to send remaining ETH profits to. */ constructor( address payable _profitWallet ) { require(_profitWallet != address(0), "BalanceTracker: PROFIT_WALLET cannot be address(0)"); PROFIT_WALLET = _profitWallet; _disableInitializers(); } /*////////////////////////////////////////////////////////////// External Functions //////////////////////////////////////////////////////////////*/ /** * @dev Initializes the BalanceTracker contract. * @param _systemAddresses The system addresses being funded. * @param _targetBalances The target balances for system addresses. */ function initialize( address payable[] memory _systemAddresses, uint256[] memory _targetBalances ) external reinitializer(2) { uint256 systemAddresesLength = _systemAddresses.length; require(systemAddresesLength > 0, "BalanceTracker: systemAddresses cannot have a length of zero"); require(systemAddresesLength <= MAX_SYSTEM_ADDRESS_COUNT, "BalanceTracker: systemAddresses cannot have a length greater than 20"); require(systemAddresesLength == _targetBalances.length, "BalanceTracker: systemAddresses and targetBalances length must be equal"); for (uint256 i; i < systemAddresesLength;) { require(_systemAddresses[i] != address(0), "BalanceTracker: systemAddresses cannot contain address(0)"); require(_targetBalances[i] > 0, "BalanceTracker: targetBalances cannot contain 0 target"); unchecked { i++; } } systemAddresses = _systemAddresses; targetBalances = _targetBalances; __ReentrancyGuard_init(); } /** * @dev Funds system addresses and sends remaining profits to the profit wallet. * */ function processFees() external nonReentrant { uint256 systemAddresesLength = systemAddresses.length; require(systemAddresesLength > 0, "BalanceTracker: systemAddresses cannot have a length of zero"); // Refills balances of systems addresses up to their target balances for (uint256 i; i < systemAddresesLength;) { refillBalanceIfNeeded(systemAddresses[i], targetBalances[i]); unchecked { i++; } } // Send remaining profits to profit wallet uint256 valueToSend = address(this).balance; bool success = SafeCall.send(PROFIT_WALLET, gasleft(), valueToSend); emit SentProfit(PROFIT_WALLET, success, valueToSend); } /** * @dev Fallback function to receive funds from L2 fee withdrawals and additional top up funds if * L2 fees are insufficient to fund L1 system addresses. */ receive() external payable { emit ReceivedFunds(msg.sender, msg.value); } /*////////////////////////////////////////////////////////////// Internal Functions //////////////////////////////////////////////////////////////*/ /** * @dev Checks the balance of the target address and refills it back up to the target balance if needed. * @param _systemAddress The system address being funded. * @param _targetBalance The target balance for the system address being funded. */ function refillBalanceIfNeeded(address _systemAddress, uint256 _targetBalance) internal { uint256 systemAddressBalance = _systemAddress.balance; if (systemAddressBalance >= _targetBalance) { emit ProcessedFunds(_systemAddress, false, 0, 0); return; } uint256 valueNeeded = _targetBalance - systemAddressBalance; uint256 balanceTrackerBalance = address(this).balance; uint256 valueToSend = valueNeeded > balanceTrackerBalance ? balanceTrackerBalance : valueNeeded; bool success = SafeCall.send(_systemAddress, gasleft(), valueToSend); emit ProcessedFunds(_systemAddress, success, valueNeeded, valueToSend); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @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.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @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, it is bubbled up by this * function (like regular Solidity function calls). * * 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. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @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`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.15; /// @title SafeCall /// @notice Perform low level safe calls library SafeCall { /// @notice Performs a low level call without copying any returndata. /// @dev Passes no calldata to the call context. /// @param _target Address to call /// @param _gas Amount of gas to pass to the call /// @param _value Amount of value to pass to the call function send(address _target, uint256 _gas, uint256 _value) internal returns (bool) { bool _success; assembly { _success := call( _gas, // gas _target, // recipient _value, // ether value 0, // inloc 0, // inlen 0, // outloc 0 // outlen ) } return _success; } /// @notice Perform a low level call without copying any returndata /// @param _target Address to call /// @param _gas Amount of gas to pass to the call /// @param _value Amount of value to pass to the call /// @param _calldata Calldata to pass to the call function call(address _target, uint256 _gas, uint256 _value, bytes memory _calldata) internal returns (bool) { bool _success; assembly { _success := call( _gas, // gas _target, // recipient _value, // ether value add(_calldata, 32), // inloc mload(_calldata), // inlen 0, // outloc 0 // outlen ) } return _success; } /// @notice Helper function to determine if there is sufficient gas remaining within the context /// to guarantee that the minimum gas requirement for a call will be met as well as /// optionally reserving a specified amount of gas for after the call has concluded. /// @param _minGas The minimum amount of gas that may be passed to the target context. /// @param _reservedGas Optional amount of gas to reserve for the caller after the execution /// of the target context. /// @return `true` if there is enough gas remaining to safely supply `_minGas` to the target /// context as well as reserve `_reservedGas` for the caller after the execution of /// the target context. /// @dev !!!!! FOOTGUN ALERT !!!!! /// 1.) The 40_000 base buffer is to account for the worst case of the dynamic cost of the /// `CALL` opcode's `address_access_cost`, `positive_value_cost`, and /// `value_to_empty_account_cost` factors with an added buffer of 5,700 gas. It is /// still possible to self-rekt by initiating a withdrawal with a minimum gas limit /// that does not account for the `memory_expansion_cost` & `code_execution_cost` /// factors of the dynamic cost of the `CALL` opcode. /// 2.) This function should *directly* precede the external call if possible. There is an /// added buffer to account for gas consumed between this check and the call, but it /// is only 5,700 gas. /// 3.) Because EIP-150 ensures that a maximum of 63/64ths of the remaining gas in the call /// frame may be passed to a subcontext, we need to ensure that the gas will not be /// truncated. /// 4.) Use wisely. This function is not a silver bullet. function hasMinGas(uint256 _minGas, uint256 _reservedGas) internal view returns (bool) { bool _hasMinGas; assembly { // Equation: gas × 63 ≥ minGas × 64 + 63(40_000 + reservedGas) _hasMinGas := iszero(lt(mul(gas(), 63), add(mul(_minGas, 64), mul(add(40000, _reservedGas), 63)))) } return _hasMinGas; } /// @notice Perform a low level call without copying any returndata. This function /// will revert if the call cannot be performed with the specified minimum /// gas. /// @param _target Address to call /// @param _minGas The minimum amount of gas that may be passed to the call /// @param _value Amount of value to pass to the call /// @param _calldata Calldata to pass to the call function callWithMinGas( address _target, uint256 _minGas, uint256 _value, bytes memory _calldata ) internal returns (bool) { bool _success; bool _hasMinGas = hasMinGas(_minGas, 0); assembly { // Assertion: gasleft() >= (_minGas * 64) / 63 + 40_000 if iszero(_hasMinGas) { // Store the "Error(string)" selector in scratch space. mstore(0, 0x08c379a0) // Store the pointer to the string length in scratch space. mstore(32, 32) // Store the string. // // SAFETY: // - We pad the beginning of the string with two zero bytes as well as the // length (24) to ensure that we override the free memory pointer at offset // 0x40. This is necessary because the free memory pointer is likely to // be greater than 1 byte when this function is called, but it is incredibly // unlikely that it will be greater than 3 bytes. As for the data within // 0x60, it is ensured that it is 0 due to 0x60 being the zero offset. // - It's fine to clobber the free memory pointer, we're reverting. mstore(88, 0x0000185361666543616c6c3a204e6f7420656e6f75676820676173) // Revert with 'Error("SafeCall: Not enough gas")' revert(28, 100) } // The call will be supplied at least ((_minGas * 64) / 63) gas due to the // above assertion. This ensures that, in all circumstances (except for when the // `_minGas` does not account for the `memory_expansion_cost` and `code_execution_cost` // factors of the dynamic cost of the `CALL` opcode), the call will receive at least // the minimum amount of gas specified. _success := call( gas(), // gas _target, // recipient _value, // ether value add(_calldata, 32), // inloc mload(_calldata), // inlen 0x00, // outloc 0x00 // outlen ) } return _success; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @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] * ``` * 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 Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 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. Equivalent to `reinitializer(1)`. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _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. * * `initializer` is equivalent to `reinitializer(1)`, so 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. * * 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. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _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() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @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. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @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://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @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, it is bubbled up by this * function (like regular Solidity function calls). * * 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. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @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`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // 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(errorMessage); } } } }
{ "remappings": [ "@eth-optimism-bedrock/=lib/optimism/packages/contracts-bedrock/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "@rari-capital/solmate/=lib/solmate/", "@base-contracts/=lib/base-contracts/", "solady/=lib/solady/src/", "base-contracts/=lib/base-contracts/src/", "clones-with-immutable-args/=lib/clones-with-immutable-args/src/", "ds-test/=lib/clones-with-immutable-args/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "openzeppelin/=lib/openzeppelin-contracts/contracts/", "optimism/=lib/optimism/packages/contracts-bedrock/src/", "solmate/=lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 999999 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address payable","name":"_profitWallet","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_systemAddress","type":"address"},{"indexed":true,"internalType":"bool","name":"_success","type":"bool"},{"indexed":false,"internalType":"uint256","name":"_balanceNeeded","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_balanceSent","type":"uint256"}],"name":"ProcessedFunds","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ReceivedFunds","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_profitWallet","type":"address"},{"indexed":true,"internalType":"bool","name":"_success","type":"bool"},{"indexed":false,"internalType":"uint256","name":"_balanceSent","type":"uint256"}],"name":"SentProfit","type":"event"},{"inputs":[],"name":"MAX_SYSTEM_ADDRESS_COUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROFIT_WALLET","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable[]","name":"_systemAddresses","type":"address[]"},{"internalType":"uint256[]","name":"_targetBalances","type":"uint256[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"processFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"systemAddresses","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"targetBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a03461018057601f61116138819003918201601f19168301916001600160401b038311848410176101855780849260209460405283398101031261018057516001600160a01b03811680820361018057156101205760805260005460ff8160081c166100cb5760ff80821610610090575b604051610fc5908161019c823960805181818161046b015261052e0152f35b60ff90811916176000557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160ff8152a138610071565b60405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608490fd5b60405162461bcd60e51b815260206004820152603260248201527f42616c616e6365547261636b65723a2050524f4649545f57414c4c45542063616044820152716e6e6f74206265206164647265737328302960701b6064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe60806040526004361015610023575b361561001957600080fd5b610021610d77565b005b6000803560e01c9081630a5657201461009e575080636d1eb022146100955780637fbbe46f1461008c578063927a1a7714610083578063981949e81461007a5763ba69ebed0361000e5761007561048f565b61000e565b5061007561041f565b50610075610399565b506100756102c3565b50610075610180565b346101085760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610108576004359060345482101561010857507f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1015460805260206080f35b80fd5b507f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b603454811015610173575b60346000527f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c10190600090565b61017b61010b565b610146565b50346101bb5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602060405160148152f35b600080fd5b507f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff82111761023457604052565b61023c6101c0565b604052565b60209067ffffffffffffffff811161025b575b60051b0190565b6102636101c0565b610254565b9080601f830112156101bb5781359061028861028383610241565b6101f0565b9182938184526020808095019260051b8201019283116101bb578301905b8282106102b4575050505090565b813581529083019083016102a6565b50346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb5767ffffffffffffffff6004358181116101bb57366023820112156101bb5780600401359061032361028383610241565b908192808352602460208094019160051b830101913683116101bb57602401905b82821061036d57602435858782116101bb57610367610021923690600401610268565b9061066d565b813573ffffffffffffffffffffffffffffffffffffffff811681036101bb578152908301908301610344565b50346101bb5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576004356033548110156101bb5773ffffffffffffffffffffffffffffffffffffffff60209160336000527f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a82015416604051908152f35b50346101bb5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101bb576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610108576001600281541461060f576002815560338054906104df8215156107de565b835b8281106105785784475a7fbadd9d7563efca77438dc132e885aa156837e0b784469f68fbd810cbfb6cda77610567610556858080808873ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168099f1151590565b604051948552939081906020820190565b0390a361057360018055565b604051f35b83908254811015610602575b8286526105fc6105ca827f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a82015473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff6105f56105eb8561013b565b90549060031b1c90565b9116610da5565b016104e1565b61060a61010b565b610584565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152fd5b9060005460ff8160081c161590816107d0575b501561074c576106f0916106ba60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006000541617600055565b6106eb6101007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff6000541617600055565b610c17565b61071d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff60005416600055565b604051600281527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a1565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152fd5b6002915060ff161038610680565b156107e557565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f42616c616e6365547261636b65723a2073797374656d4164647265737365732060448201527f63616e6e6f7420686176652061206c656e677468206f66207a65726f000000006064820152fd5b1561087057565b60a46040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604760248201527f42616c616e6365547261636b65723a2073797374656d4164647265737365732060448201527f616e642074617267657442616c616e636573206c656e677468206d757374206260648201527f6520657175616c000000000000000000000000000000000000000000000000006084820152fd5b602091815181101561092f575b60051b010190565b61093761010b565b610927565b1561094357565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f42616c616e6365547261636b65723a2073797374656d4164647265737365732060448201527f63616e6e6f7420636f6e7461696e2061646472657373283029000000000000006064820152fd5b156109ce57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f42616c616e6365547261636b65723a2074617267657442616c616e636573206360448201527f616e6e6f7420636f6e7461696e203020746172676574000000000000000000006064820152fd5b805190680100000000000000008211610b45575b60335482603355808310610b04575b5060208091019060336000527f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a826000925b848410610ab4575050505050565b6001838273ffffffffffffffffffffffffffffffffffffffff839451167fffffffffffffffffffffffff000000000000000000000000000000000000000086541617855501920193019290610aa6565b827f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a8291820191015b818110610b395750610a75565b60008155600101610b2c565b610b4d6101c0565b610a66565b805190680100000000000000008211610c0a575b60345482603455808310610bc9575b5060208091019060346000527f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c16000925b848410610bb4575050505050565b60018382829351855501920193019290610ba6565b827f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c191820191015b818110610bfe5750610b75565b60008155600101610bf1565b610c126101c0565b610b66565b91908251610c268115156107de565b60148111610ccd57610c3a82518214610869565b60005b818110610c62575050610c53610c589293610a52565b610b52565b610c60610f6f565b565b80610cb2610cab610c92610c786001958a61091a565b5173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b151561093c565b610cc7610cbf828661091a565b5115156109c7565b01610c3d565b60a46040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604460248201527f42616c616e6365547261636b65723a2073797374656d4164647265737365732060448201527f63616e6e6f7420686176652061206c656e67746820677265617465722074686160648201527f6e203230000000000000000000000000000000000000000000000000000000006084820152fd5b6040513481527f5741979df5f3e491501da74d3b0a83dd2496ab1f34929865b3e190a8ad75859a60203392a2565b9081319080821015610e9657818110610e6757034780821115610e2a5773ffffffffffffffffffffffffffffffffffffffff7f74273f98770936abfe9aad12868d2dbe403347b74b7f3a539d0359c123d5d31c915b610e256000808080858a5af19160405193849315159716958360209093929193604081019481520152565b0390a3565b507f74273f98770936abfe9aad12868d2dbe403347b74b7f3a539d0359c123d5d31c73ffffffffffffffffffffffffffffffffffffffff82610dfa565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50506000907f74273f98770936abfe9aad12868d2dbe403347b74b7f3a539d0359c123d5d31c604073ffffffffffffffffffffffffffffffffffffffff8151938585528560208601521692a3565b15610eeb57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152fd5b610f8960ff60005460081c16610f8481610ee4565b610ee4565b6001805556fea26469706673582212201bbe4bed07edc5c0d14484e3edf4908a50755b1acce2cce42f9502403be7908e64736f6c634300080f0033000000000000000000000000ec8103eb573150cb92f8af612e0072843db2295f
Deployed Bytecode
0x60806040526004361015610023575b361561001957600080fd5b610021610d77565b005b6000803560e01c9081630a5657201461009e575080636d1eb022146100955780637fbbe46f1461008c578063927a1a7714610083578063981949e81461007a5763ba69ebed0361000e5761007561048f565b61000e565b5061007561041f565b50610075610399565b506100756102c3565b50610075610180565b346101085760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610108576004359060345482101561010857507f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1015460805260206080f35b80fd5b507f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b603454811015610173575b60346000527f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c10190600090565b61017b61010b565b610146565b50346101bb5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602060405160148152f35b600080fd5b507f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff82111761023457604052565b61023c6101c0565b604052565b60209067ffffffffffffffff811161025b575b60051b0190565b6102636101c0565b610254565b9080601f830112156101bb5781359061028861028383610241565b6101f0565b9182938184526020808095019260051b8201019283116101bb578301905b8282106102b4575050505090565b813581529083019083016102a6565b50346101bb5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb5767ffffffffffffffff6004358181116101bb57366023820112156101bb5780600401359061032361028383610241565b908192808352602460208094019160051b830101913683116101bb57602401905b82821061036d57602435858782116101bb57610367610021923690600401610268565b9061066d565b813573ffffffffffffffffffffffffffffffffffffffff811681036101bb578152908301908301610344565b50346101bb5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb576004356033548110156101bb5773ffffffffffffffffffffffffffffffffffffffff60209160336000527f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a82015416604051908152f35b50346101bb5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101bb57602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ec8103eb573150cb92f8af612e0072843db2295f168152f35b50346101bb576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610108576001600281541461060f576002815560338054906104df8215156107de565b835b8281106105785784475a7fbadd9d7563efca77438dc132e885aa156837e0b784469f68fbd810cbfb6cda77610567610556858080808873ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ec8103eb573150cb92f8af612e0072843db2295f168099f1151590565b604051948552939081906020820190565b0390a361057360018055565b604051f35b83908254811015610602575b8286526105fc6105ca827f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a82015473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff6105f56105eb8561013b565b90549060031b1c90565b9116610da5565b016104e1565b61060a61010b565b610584565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152fd5b9060005460ff8160081c161590816107d0575b501561074c576106f0916106ba60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006000541617600055565b6106eb6101007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff6000541617600055565b610c17565b61071d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff60005416600055565b604051600281527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a1565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152fd5b6002915060ff161038610680565b156107e557565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f42616c616e6365547261636b65723a2073797374656d4164647265737365732060448201527f63616e6e6f7420686176652061206c656e677468206f66207a65726f000000006064820152fd5b1561087057565b60a46040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604760248201527f42616c616e6365547261636b65723a2073797374656d4164647265737365732060448201527f616e642074617267657442616c616e636573206c656e677468206d757374206260648201527f6520657175616c000000000000000000000000000000000000000000000000006084820152fd5b602091815181101561092f575b60051b010190565b61093761010b565b610927565b1561094357565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f42616c616e6365547261636b65723a2073797374656d4164647265737365732060448201527f63616e6e6f7420636f6e7461696e2061646472657373283029000000000000006064820152fd5b156109ce57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f42616c616e6365547261636b65723a2074617267657442616c616e636573206360448201527f616e6e6f7420636f6e7461696e203020746172676574000000000000000000006064820152fd5b805190680100000000000000008211610b45575b60335482603355808310610b04575b5060208091019060336000527f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a826000925b848410610ab4575050505050565b6001838273ffffffffffffffffffffffffffffffffffffffff839451167fffffffffffffffffffffffff000000000000000000000000000000000000000086541617855501920193019290610aa6565b827f82a75bdeeae8604d839476ae9efd8b0e15aa447e21bfd7f41283bb54e22c9a8291820191015b818110610b395750610a75565b60008155600101610b2c565b610b4d6101c0565b610a66565b805190680100000000000000008211610c0a575b60345482603455808310610bc9575b5060208091019060346000527f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c16000925b848410610bb4575050505050565b60018382829351855501920193019290610ba6565b827f46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c191820191015b818110610bfe5750610b75565b60008155600101610bf1565b610c126101c0565b610b66565b91908251610c268115156107de565b60148111610ccd57610c3a82518214610869565b60005b818110610c62575050610c53610c589293610a52565b610b52565b610c60610f6f565b565b80610cb2610cab610c92610c786001958a61091a565b5173ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b151561093c565b610cc7610cbf828661091a565b5115156109c7565b01610c3d565b60a46040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604460248201527f42616c616e6365547261636b65723a2073797374656d4164647265737365732060448201527f63616e6e6f7420686176652061206c656e67746820677265617465722074686160648201527f6e203230000000000000000000000000000000000000000000000000000000006084820152fd5b6040513481527f5741979df5f3e491501da74d3b0a83dd2496ab1f34929865b3e190a8ad75859a60203392a2565b9081319080821015610e9657818110610e6757034780821115610e2a5773ffffffffffffffffffffffffffffffffffffffff7f74273f98770936abfe9aad12868d2dbe403347b74b7f3a539d0359c123d5d31c915b610e256000808080858a5af19160405193849315159716958360209093929193604081019481520152565b0390a3565b507f74273f98770936abfe9aad12868d2dbe403347b74b7f3a539d0359c123d5d31c73ffffffffffffffffffffffffffffffffffffffff82610dfa565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50506000907f74273f98770936abfe9aad12868d2dbe403347b74b7f3a539d0359c123d5d31c604073ffffffffffffffffffffffffffffffffffffffff8151938585528560208601521692a3565b15610eeb57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152fd5b610f8960ff60005460081c16610f8481610ee4565b610ee4565b6001805556fea26469706673582212201bbe4bed07edc5c0d14484e3edf4908a50755b1acce2cce42f9502403be7908e64736f6c634300080f0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ec8103eb573150cb92f8af612e0072843db2295f
-----Decoded View---------------
Arg [0] : _profitWallet (address): 0xEc8103eb573150cB92f8AF612e0072843db2295F
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000ec8103eb573150cb92f8af612e0072843db2295f
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.