Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x1aB34b03e2Edd2ad30a23B31f4Cc1B150227A773
Balance 0 ETH
Nonce 1
Code Size 1717 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

1717 bytes
0x608060405234801561000f575f80fd5b506004361061006b575f3560e01c806313e7c9d81461006f578063715018a6146100a65780638da5cb5b146100b05780639870d7fe146100c8578063ac8a584a146100db578063da5b4ffd146100ee578063f2fde38b14610101575b5f80fd5b61009161007d366004610529565b60016020525f908152604090205460ff1681565b60405190151581526020015b60405180910390f35b6100ae610114565b005b5f546001600160a01b031660405161009d919061054f565b6100ae6100d6366004610529565b610127565b6100ae6100e9366004610529565b6101b5565b6100ae6100fc3660046105ab565b610244565b6100ae61010f366004610529565b61033f565b61011c610385565b6101255f6103b1565b565b61012f610385565b6001600160a01b0381166101565760405163ccea9e6f60e01b815260040160405180910390fd5b6001600160a01b0381165f90815260016020819052604091829020805460ff19169091179055517fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d906101aa90839061054f565b60405180910390a150565b6101bd610385565b6001600160a01b0381165f9081526001602052604090205460ff166101f55760405163ccea9e6f60e01b815260040160405180910390fd5b6001600160a01b0381165f9081526001602052604090819020805460ff19169055517f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d906101aa90839061054f565b335f9081526001602052604090205460ff166102735760405163a5523ee560e01b815260040160405180910390fd5b8083141580610280575082155b1561029e5760405163251f56a160e21b815260040160405180910390fd5b5f5b818110156103385761032f8585838181106102bd576102bd610612565b90506020020160208101906102d29190610529565b8484848181106102e4576102e4610612565b90506020028101906102f69190610626565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061040092505050565b506001016102a0565b5050505050565b610347610385565b6001600160a01b038116610379575f604051631e4fbdf760e01b8152600401610370919061054f565b60405180910390fd5b610382816103b1565b50565b5f546001600160a01b03163314610125573360405163118cdaa760e01b8152600401610370919061054f565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606061040d83835f610414565b9392505050565b606081471015610439573060405163cd78605960e01b8152600401610370919061054f565b5f80856001600160a01b031684866040516104549190610669565b5f6040518083038185875af1925050503d805f811461048e576040519150601f19603f3d011682016040523d82523d5f602084013e610493565b606091505b50915091506104a38683836104ad565b9695505050505050565b6060826104c2576104bd82610500565b61040d565b81511580156104d957506001600160a01b0384163b155b156104f95783604051639996b31560e01b8152600401610370919061054f565b508061040d565b8051156105105780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5f60208284031215610539575f80fd5b81356001600160a01b038116811461040d575f80fd5b6001600160a01b0391909116815260200190565b5f8083601f840112610573575f80fd5b50813567ffffffffffffffff81111561058a575f80fd5b6020830191508360208260051b85010111156105a4575f80fd5b9250929050565b5f805f80604085870312156105be575f80fd5b843567ffffffffffffffff808211156105d5575f80fd5b6105e188838901610563565b909650945060208701359150808211156105f9575f80fd5b5061060687828801610563565b95989497509550505050565b634e487b7160e01b5f52603260045260245ffd5b5f808335601e1984360301811261063b575f80fd5b83018035915067ffffffffffffffff821115610655575f80fd5b6020019150368190038213156105a4575f80fd5b5f82518060208501845e5f92019182525091905056fea2646970667358221220443621c56e630c94a1b78dbcd91bdc68258673ed09d66373759c439a24c16d6a64736f6c63430008190033

Verified Source Code Full Match

Compiler: v0.8.25+commit.b61c2a91 EVM: cancun Optimization: Yes (100 runs)
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
Address.sol 159 lines
// 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();
        }
    }
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}
Errors.sol 67 lines
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;

library Errors {
    // Revert Errors:
    error CallerNotOperator(); // 0xa5523ee5
    error CallerNotRebalancer(); // 0xbd72e291
    error CallerNotVault(); // 0xedd7338f
    error CallerNotMinter(); // 0x5eee367a
    error CallerNotWhiteList(); // 0xf37be7b6
    error ExitFeeRateTooHigh(); // 0xf4d1caab
    error ExceededMaxDeposit(); // 0x3bc9ae09
    error FlashloanInProgress(); // 0x772ac4e8
    error IncorrectState(); // 0x508c9390
    error InfoExpired(); // 0x4ddf4a65
    error InvalidAccount(); // 0x6d187b28
    error InvalidAdapter(); // 0xfbf66df1
    error InvalidAdmin(); // 0xb5eba9f0
    error InvalidAsset(); // 0xc891add2
    error InvalidCaller(); // 0x48f5c3ed
    error InvalidClaimTime(); // 0x1221b97b
    error InvalidFeeReceiver(); // 0xd200485c
    error InvalidFlashloanCall(); // 0xd2208d52
    error InvalidFlashloanHelper(); // 0x8690f016
    error InvalidFlashloanProvider(); // 0xb6b48551
    error InvalidGasLimit(); // 0x98bdb2e0
    error InvalidInitiator(); // 0xbfda1f28
    error InvalidLength(); // 0x947d5a84
    error InvalidLimit(); // 0xe55fb509
    error InvalidManagementFeeClaimPeriod(); // 0x4022e4f6
    error InvalidManagementFeeRate(); // 0x09aa66eb
    error InvalidMarketCapacity(); // 0xc9034604
    error InvalidNetAssets(); // 0x6da79d69
    error InvalidNewOperator(); // 0xba0cdec5
    error InvalidOperator(); // 0xccea9e6f
    error InvalidOracle(); // 0x9589a27d
    error InvalidRebalancer(); // 0xff288a8e
    error InvalidRedeemOperator(); // 0xd214a597
    error InvalidSafeProtocolRatio(); // 0x7c6b23d6
    error InvalidShares(); // 0x6edcc523
    error InvalidTarget(); // 0x82d5d76a
    error InvalidToken(); // 0xc1ab6dc1
    error InvalidTokenId(); // 0x3f6cc768
    error InvalidUnderlyingToken(); // 0x2fb86f96
    error InvalidVault(); // 0xd03a6320
    error InvalidWithdrawalUser(); // 0x36c17319
    error ManagementFeeRateTooHigh(); // 0x09aa66eb
    error ManagementFeeClaimPeriodTooShort(); // 0x4022e4f6
    error MarketCapacityTooLow(); // 0xc9034604
    error NotSupportedYet(); // 0xfb89ba2a
    error PriceNotUpdated(); // 0x1f4bcb2b
    error PriceUpdatePeriodTooLong(); // 0xe88d3ecb
    error RatioOutOfRange(); // 0x9179cbfa
    error RevenueFeeRateTooHigh(); // 0x0674143f
    error UnSupportedOperation(); // 0xe9ec8129
    error UnsupportedToken(); // 0x6a172882
    error WithdrawZero(); // 0x7ea773a9

    // for 1inch swap
    error OneInchInvalidReceiver(); // 0xd540519e
    error OneInchInvalidToken(); // 0x8e7ad912
    error OneInchInvalidInputAmount(); // 0x672b500f
    error OneInchInvalidFunctionSignature(); // 0x247f51aa
    error OneInchUnexpectedSpentAmount(); // 0x295ada05
    error OneInchUnexpectedReturnAmount(); // 0x05e64ca8
    error OneInchNotSupported(); // 0x04b2de78
}
Manager.sol 71 lines
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./libraries/Errors.sol";

/**
 * @title Manager
 * @author Naturelab
 * @dev This contract is used to manage KMS addresses for batch operations.
 */
contract Manager is Ownable {
    mapping(address => bool) public operators;

    /**
     * @dev Initializes the contract by setting the admin and adding the initial operator to the whitelist.
     * @param _admin The address of the contract owner, it will be a multisignature address.
     * @param _initialOperator The address of the initial operator.
     */
    constructor(address _admin, address _initialOperator) Ownable(_admin) {
        operators[_initialOperator] = true;
    }

    // Event emitted when an operator is added to the whitelist
    event OperatorAdded(address operator);

    // Event emitted when an operator is removed from the whitelist
    event OperatorRemoved(address operator);

    // Modifier to restrict function access to the operators in the whitelist
    modifier onlyOperator() {
        if (!operators[msg.sender]) revert Errors.CallerNotOperator();
        _;
    }

    /**
     * @dev Allows the owner to add a new operator to the whitelist.
     * Emits an OperatorAdded event.
     * @param _operator The address of the operator to add.
     */
    function addOperator(address _operator) external onlyOwner {
        if (_operator == address(0)) revert Errors.InvalidOperator();
        operators[_operator] = true;
        emit OperatorAdded(_operator);
    }

    /**
     * @dev Allows the owner to remove an operator from the whitelist.
     * Emits an OperatorRemoved event.
     * @param _operator The address of the operator to remove.
     */
    function removeOperator(address _operator) external onlyOwner {
        if (!operators[_operator]) revert Errors.InvalidOperator();
        operators[_operator] = false;
        emit OperatorRemoved(_operator);
    }

    /**
     * @dev Allows operators to make multiple calls to different addresses in a single transaction.
     * @param _addresses An array of addresses to call.
     * @param _callBytes An array of call data bytes, each corresponding to a call to be made to the addresses.
     */
    function multiCall(address[] calldata _addresses, bytes[] calldata _callBytes) external onlyOperator {
        if (_callBytes.length != _addresses.length || _addresses.length == 0) revert Errors.InvalidLength();

        for (uint256 i = 0; i < _callBytes.length; ++i) {
            Address.functionCall(_addresses[i], _callBytes[i]);
        }
    }
}

Read Contract

operators 0x13e7c9d8 → bool
owner 0x8da5cb5b → address

Write Contract 5 functions

These functions modify contract state and require a wallet transaction to execute.

addOperator 0x9870d7fe
address _operator
multiCall 0xda5b4ffd
address[] _addresses
bytes[] _callBytes
removeOperator 0xac8a584a
address _operator
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner

Recent Transactions

No transactions found for this address