ETH Price: $3,294.86 (+0.95%)

Contract

0x17dacAD8AA962963830136422E2EAa8d27D014f8
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Mint And Bridge216288162025-01-15 8:53:355 days ago1736931215IN
0x17dacAD8...d27D014f8
0.00002111 ETH0.002644643.73329514
Mint And Bridge216065052025-01-12 6:05:598 days ago1736661959IN
0x17dacAD8...d27D014f8
0.00002111 ETH0.001348632.28019806
Mint And Bridge216041482025-01-11 22:12:479 days ago1736633567IN
0x17dacAD8...d27D014f8
0.00002111 ETH0.003216974.54343262
Mint And Bridge215929292025-01-10 8:37:2310 days ago1736498243IN
0x17dacAD8...d27D014f8
0.00002122 ETH0.005308947.54660766
Mint And Bridge215139562024-12-30 7:59:5921 days ago1735545599IN
0x17dacAD8...d27D014f8
0.0000213 ETH0.002610184.38076969
Mint And Bridge215139522024-12-30 7:59:1121 days ago1735545551IN
0x17dacAD8...d27D014f8
0.0000213 ETH0.00302434.2556064
Mint And Bridge215103752024-12-29 19:59:4722 days ago1735502387IN
0x17dacAD8...d27D014f8
0.00002122 ETH0.002947244.18103379
Mint And Bridge215045992024-12-29 0:39:4722 days ago1735432787IN
0x17dacAD8...d27D014f8
0.00002122 ETH0.003815655.41385544
Mint And Bridge214836652024-12-26 2:30:1125 days ago1735180211IN
0x17dacAD8...d27D014f8
0.00002122 ETH0.003515294.97442632
Mint And Bridge214637182024-12-23 7:32:2328 days ago1734939143IN
0x17dacAD8...d27D014f8
0.0000213 ETH0.004085185.82020478
Mint And Bridge214572822024-12-22 9:56:3529 days ago1734861395IN
0x17dacAD8...d27D014f8
0.00002122 ETH0.004505686.33618305
Mint And Bridge214518532024-12-21 15:42:5930 days ago1734795779IN
0x17dacAD8...d27D014f8
0.00002122 ETH0.00480528.20051303
Mint And Bridge214333312024-12-19 1:36:3532 days ago1734572195IN
0x17dacAD8...d27D014f8
0.0000213 ETH0.0085587512.0773324
Mint And Bridge214278592024-12-18 7:14:3533 days ago1734506075IN
0x17dacAD8...d27D014f8
0.00002122 ETH0.0096996313.61880068
Mint And Bridge214271382024-12-18 4:49:3533 days ago1734497375IN
0x17dacAD8...d27D014f8
0.0000213 ETH0.0080146211.32471036
Mint And Bridge214015092024-12-14 15:00:2337 days ago1734188423IN
0x17dacAD8...d27D014f8
0.00002122 ETH0.006594669.35844771
Mint And Bridge213905612024-12-13 2:19:3538 days ago1734056375IN
0x17dacAD8...d27D014f8
0.0000213 ETH0.0073216412.47112114
Mint And Bridge213838352024-12-12 3:48:1139 days ago1733975291IN
0x17dacAD8...d27D014f8
0.0000213 ETH0.0135575819.16851465
Mint And Bridge213827732024-12-12 0:14:2339 days ago1733962463IN
0x17dacAD8...d27D014f8
0.00002122 ETH0.0171769824.33858543
Mint And Bridge213750152024-12-10 22:13:4741 days ago1733868827IN
0x17dacAD8...d27D014f8
0.0000213 ETH0.0116700316.63504898
Mint And Bridge213730732024-12-10 15:43:3541 days ago1733845415IN
0x17dacAD8...d27D014f8
0.0000213 ETH0.0472627867.52800497
Mint And Bridge213720622024-12-10 12:19:5941 days ago1733833199IN
0x17dacAD8...d27D014f8
0.0000213 ETH0.0125854317.79919016
Mint And Bridge213713122024-12-10 9:48:4741 days ago1733824127IN
0x17dacAD8...d27D014f8
0.0000213 ETH0.0110025915.57353036
Mint And Bridge213713072024-12-10 9:47:4741 days ago1733824067IN
0x17dacAD8...d27D014f8
0.0000213 ETH0.0133580816.14336858
Mint And Bridge213694722024-12-10 3:38:3541 days ago1733801915IN
0x17dacAD8...d27D014f8
0.0000213 ETH0.0187071426.74244408
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
216288162025-01-15 8:53:355 days ago1736931215
0x17dacAD8...d27D014f8
0.00002111 ETH
216065052025-01-12 6:05:598 days ago1736661959
0x17dacAD8...d27D014f8
0.00002111 ETH
216041482025-01-11 22:12:479 days ago1736633567
0x17dacAD8...d27D014f8
0.00002111 ETH
215929292025-01-10 8:37:2310 days ago1736498243
0x17dacAD8...d27D014f8
0.00002122 ETH
215139562024-12-30 7:59:5921 days ago1735545599
0x17dacAD8...d27D014f8
0.0000213 ETH
215139522024-12-30 7:59:1121 days ago1735545551
0x17dacAD8...d27D014f8
0.0000213 ETH
215103752024-12-29 19:59:4722 days ago1735502387
0x17dacAD8...d27D014f8
0.00002122 ETH
215045992024-12-29 0:39:4722 days ago1735432787
0x17dacAD8...d27D014f8
0.00002122 ETH
214836652024-12-26 2:30:1125 days ago1735180211
0x17dacAD8...d27D014f8
0.00002122 ETH
214637182024-12-23 7:32:2328 days ago1734939143
0x17dacAD8...d27D014f8
0.0000213 ETH
214572822024-12-22 9:56:3529 days ago1734861395
0x17dacAD8...d27D014f8
0.00002122 ETH
214518532024-12-21 15:42:5930 days ago1734795779
0x17dacAD8...d27D014f8
0.00002122 ETH
214333312024-12-19 1:36:3532 days ago1734572195
0x17dacAD8...d27D014f8
0.0000213 ETH
214278592024-12-18 7:14:3533 days ago1734506075
0x17dacAD8...d27D014f8
0.00002122 ETH
214271382024-12-18 4:49:3533 days ago1734497375
0x17dacAD8...d27D014f8
0.0000213 ETH
214015092024-12-14 15:00:2337 days ago1734188423
0x17dacAD8...d27D014f8
0.00002122 ETH
213905612024-12-13 2:19:3538 days ago1734056375
0x17dacAD8...d27D014f8
0.0000213 ETH
213838352024-12-12 3:48:1139 days ago1733975291
0x17dacAD8...d27D014f8
0.0000213 ETH
213827732024-12-12 0:14:2339 days ago1733962463
0x17dacAD8...d27D014f8
0.00002122 ETH
213750152024-12-10 22:13:4741 days ago1733868827
0x17dacAD8...d27D014f8
0.0000213 ETH
213730732024-12-10 15:43:3541 days ago1733845415
0x17dacAD8...d27D014f8
0.0000213 ETH
213720622024-12-10 12:19:5941 days ago1733833199
0x17dacAD8...d27D014f8
0.0000213 ETH
213713122024-12-10 9:48:4741 days ago1733824127
0x17dacAD8...d27D014f8
0.0000213 ETH
213713072024-12-10 9:47:4741 days ago1733824067
0x17dacAD8...d27D014f8
0.0000213 ETH
213694722024-12-10 3:38:3541 days ago1733801915
0x17dacAD8...d27D014f8
0.0000213 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
YBUSDBridge

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 12 : YBUSDBridge.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IYBUSD} from "./interface/IYBUSD.sol";
import {IBridgeMiddleware} from "./interface/IBridgeMiddleware.sol";

interface ITetherToken {
    function approve(address _spender, uint256 _value) external;
}

contract YBUSDBridge is Ownable, Pausable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    error ZERO_ADDRESS();
    error ZERO_AMOUNT();
    error INVALID_TOKEN_ID();
    error INSUFFICIENT_BALANCE();

    // @dev Emitted when MintAndBridge L1 tx success. This doesn't mean that the conterpart L2 tx will success
    //  `canonicalTxHash` is the L2 tx hash, which can be used to check if the L2 tx is processed successfully.
    event MintAndBridge(
        address indexed sender,
        address indexed l2Recevier,
        uint256 amount,
        bytes32 canonicalTxHash
    );

    IERC20 public dai;
    IERC20 public usdt;
    IERC20 public usdc;
    IYBUSD public ybUSD;
    IBridgeMiddleware public bridgeMiddleware;

    /// @param _ybUSD ybUSD address
    /// @param _bridgeMiddleware bridgeMiddleware address
    constructor(
        address _dai,
        address _usdc,
        address _usdt,
        address _ybUSD,
        address _bridgeMiddleware
    ) Ownable(msg.sender) {
        if (
            _dai == address(0) ||
            _usdc == address(0) ||
            _usdt == address(0) ||
            _ybUSD == address(0) ||
            _bridgeMiddleware == address(0)
        ) {
            revert ZERO_ADDRESS();
        }

        dai = IERC20(_dai);
        usdc = IERC20(_usdc);
        usdt = IERC20(_usdt);
        ybUSD = IYBUSD(_ybUSD);
        bridgeMiddleware = IBridgeMiddleware(_bridgeMiddleware);
        dai.approve(address(ybUSD), type(uint256).max);
        ITetherToken(_usdt).approve(address(ybUSD), type(uint256).max);
        usdc.approve(address(ybUSD), type(uint256).max);
        // Approve the bridgeMiddleware to transfer ybUSD from this contract
        ybUSD.approve(address(bridgeMiddleware), type(uint256).max);
    }

    /// @dev Pause the contract
    function pause() external onlyOwner {
        dai.approve(address(ybUSD), 0);
        ITetherToken(address(usdt)).approve(address(ybUSD), 0);
        usdc.approve(address(ybUSD), 0);
        ybUSD.approve(address(bridgeMiddleware), 0);
        return _pause();
    }

    /// @dev Unpause the contract
    function unpause() external onlyOwner {
        dai.approve(address(ybUSD), type(uint256).max);
        ITetherToken(address(usdt)).approve(address(ybUSD), type(uint256).max);
        usdc.approve(address(ybUSD), type(uint256).max);
        ybUSD.approve(address(bridgeMiddleware), type(uint256).max);
        return _unpause();
    }

    /// Deposit DAI/USDC/USDT to mint ybUSD and bridge them to L2 within the same transaction
    ///
    /// @param _l2Receiver The receiver that will receive the minted tokens on L2
    /// @param _amount The amount of DAI/(USDC/USDT swapped to DAI) to deposit into the ybUSD contract
    /// @param _stableCoinType 0 = DAI, 1 = USDC, 2 = USDT
    /// @param _minAmountAccepted minimum Amount user like to accept when swapping USDC/USDT to DAI
    /// @param _l2GasLimit The estimated gas limit of the L2 tx
    /// @param _refundRecipient who can retreive if the L1 to L2 transfer failed
    /// @return canonicalTxHash The canonical L2 tx hash, which can be used to track the L2 tx status.
    function mintAndBridge(
        address _l2Receiver,
        uint256 _amount,
        uint128 _stableCoinType,
        uint256 _minAmountAccepted,
        uint256 _l2GasLimit,
        uint256 _l2GasPerPubdataByteLimit,
        address _refundRecipient
    )
        external
        payable
        whenNotPaused
        nonReentrant
        returns (bytes32 canonicalTxHash)
    {
        uint256 ybUSDAmount;
        if (_l2Receiver == address(0) || _refundRecipient == address(0)) {
            revert ZERO_ADDRESS();
        }
        if (
            _amount == 0 || _l2GasLimit == 0 || _l2GasPerPubdataByteLimit == 0
        ) {
            revert ZERO_AMOUNT();
        }
        if (_stableCoinType == 0) {
            if (dai.balanceOf(msg.sender) < _amount)
                revert INSUFFICIENT_BALANCE();
            dai.safeTransferFrom(msg.sender, address(this), _amount);
            ybUSDAmount = ybUSD.deposit(_amount);
        } else if (_stableCoinType == 1 || _stableCoinType == 2) {
            if (_minAmountAccepted == 0) {
                revert ZERO_AMOUNT();
            }
            if (_stableCoinType == 1) {
                if (usdc.balanceOf(msg.sender) < _amount)
                    revert INSUFFICIENT_BALANCE();
                usdc.safeTransferFrom(msg.sender, address(this), _amount);
            } else if (_stableCoinType == 2) {
                if (usdt.balanceOf(msg.sender) < _amount)
                    revert INSUFFICIENT_BALANCE();
                usdt.safeTransferFrom(msg.sender, address(this), _amount);
            }

            ybUSDAmount = ybUSD.swapAndDeposit(
                _stableCoinType,
                _amount,
                _minAmountAccepted
            );
        } else {
            revert INVALID_TOKEN_ID();
        }
        // Bridge the minted ybUSD to L2
        canonicalTxHash = bridgeMiddleware.bridge{value: msg.value}(
            _l2Receiver,
            address(ybUSD),
            ybUSDAmount,
            _l2GasLimit,
            _l2GasPerPubdataByteLimit,
            _refundRecipient
        );

        emit MintAndBridge(
            msg.sender,
            _l2Receiver,
            ybUSDAmount,
            canonicalTxHash
        );
    }
}

File 2 of 12 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 12 : IERC20Metadata.sol
// 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);
}

File 4 of 12 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 5 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

File 6 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 7 of 12 : Address.sol
// 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();
        }
    }
}

File 8 of 12 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 9 of 12 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    bool private _paused;

    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 10 of 12 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @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 ReentrancyGuard {
    // 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;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _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() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

File 11 of 12 : IBridgeMiddleware.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

interface IBridgeMiddleware {
    function bridgehub() external view returns (address);
    function bridge(
        address _l2Receiver,
        address _token,
        uint256 _amount,
        uint256 _l2GasLimit,
        uint256 _l2GasPerPubdataByteLimit,
        address _refundRecipient
    ) external payable returns (bytes32 canonicalTxHash);
}

File 12 of 12 : IYBUSD.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";

interface IYBUSD is IERC20Metadata {
    function deposit(uint256 _amount) external returns (uint256);
    function swapAndDeposit(uint128 j, uint256 dx, uint256 min_dy) external returns (uint256);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200,
    "details": {
      "yul": false
    }
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_dai","type":"address"},{"internalType":"address","name":"_usdc","type":"address"},{"internalType":"address","name":"_usdt","type":"address"},{"internalType":"address","name":"_ybUSD","type":"address"},{"internalType":"address","name":"_bridgeMiddleware","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"INSUFFICIENT_BALANCE","type":"error"},{"inputs":[],"name":"INVALID_TOKEN_ID","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"ZERO_ADDRESS","type":"error"},{"inputs":[],"name":"ZERO_AMOUNT","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"l2Recevier","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"canonicalTxHash","type":"bytes32"}],"name":"MintAndBridge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"bridgeMiddleware","outputs":[{"internalType":"contract IBridgeMiddleware","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dai","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_l2Receiver","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint128","name":"_stableCoinType","type":"uint128"},{"internalType":"uint256","name":"_minAmountAccepted","type":"uint256"},{"internalType":"uint256","name":"_l2GasLimit","type":"uint256"},{"internalType":"uint256","name":"_l2GasPerPubdataByteLimit","type":"uint256"},{"internalType":"address","name":"_refundRecipient","type":"address"}],"name":"mintAndBridge","outputs":[{"internalType":"bytes32","name":"canonicalTxHash","type":"bytes32"}],"stateMutability":"payable","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":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","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":[],"name":"usdc","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdt","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ybUSD","outputs":[{"internalType":"contract IYBUSD","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b5060405162001709380380620017098339810160408190526200003491620003be565b338062000062576000604051631e4fbdf760e01b815260040162000059919062000453565b60405180910390fd5b6200006d8162000334565b506000805460ff60a01b19169055600180556001600160a01b03851615806200009d57506001600160a01b038416155b80620000b057506001600160a01b038316155b80620000c357506001600160a01b038216155b80620000d657506001600160a01b038116155b15620000f55760405163538ba4f960e01b815260040160405180910390fd5b600280546001600160a01b03199081166001600160a01b03888116918217909355600480548316888516178155600380548416888616179055600580548416878616908117909155600680549094169486169490941790925560405163095ea7b360e01b8152909263095ea7b392620001739260001991016200046a565b6020604051808303816000875af115801562000193573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001b99190620004a6565b5060055460405163095ea7b360e01b81526001600160a01b038581169263095ea7b392620001f29290911690600019906004016200046a565b600060405180830381600087803b1580156200020d57600080fd5b505af115801562000222573d6000803e3d6000fd5b50506004805460055460405163095ea7b360e01b81526001600160a01b03928316955063095ea7b394506200026193919092169160001991016200046a565b6020604051808303816000875af115801562000281573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002a79190620004a6565b5060055460065460405163095ea7b360e01b81526001600160a01b039283169263095ea7b392620002e292911690600019906004016200046a565b6020604051808303816000875af115801562000302573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003289190620004a6565b505050505050620004d3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006001600160a01b0382165b92915050565b620003a28162000384565b8114620003ae57600080fd5b50565b8051620003918162000397565b600080600080600060a08688031215620003db57620003db600080fd5b6000620003e98888620003b1565b9550506020620003fc88828901620003b1565b94505060406200040f88828901620003b1565b93505060606200042288828901620003b1565b92505060806200043588828901620003b1565b9150509295509295909350565b6200044d8162000384565b82525050565b6020810162000391828462000442565b806200044d565b604081016200047a828562000442565b62000489602083018462000463565b9392505050565b801515620003a2565b8051620003918162000490565b600060208284031215620004bd57620004bd600080fd5b6000620004cb848462000499565b949350505050565b61122680620004e36000396000f3fe6080604052600436106100a75760003560e01c80638456cb59116100645780638456cb59146101755780638da5cb5b1461018a578063a504d2af146101b0578063a6365e8b146101d0578063f2fde38b146101f0578063f4b9fa751461021057600080fd5b80632f48ab7d146100ac5780633e413bee146100e25780633f4ba83a146101025780635c975abb14610119578063715018a6146101405780637c37088d14610155575b600080fd5b3480156100b857600080fd5b506003546100cc906001600160a01b031681565b6040516100d99190610ed2565b60405180910390f35b3480156100ee57600080fd5b506004546100cc906001600160a01b031681565b34801561010e57600080fd5b50610117610230565b005b34801561012557600080fd5b50600054600160a01b900460ff166040516100d99190610ee8565b34801561014c57600080fd5b50610117610421565b610168610163366004610f51565b610433565b6040516100d99190610ff6565b34801561018157600080fd5b506101176108d9565b34801561019657600080fd5b506000546001600160a01b03166040516100d9919061100d565b3480156101bc57600080fd5b506005546100cc906001600160a01b031681565b3480156101dc57600080fd5b506006546100cc906001600160a01b031681565b3480156101fc57600080fd5b5061011761020b36600461101b565b610ac4565b34801561021c57600080fd5b506002546100cc906001600160a01b031681565b610238610b0b565b60025460055460405163095ea7b360e01b81526001600160a01b039283169263095ea7b3926102709291169060001990600401611044565b6020604051808303816000875af115801561028f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b39190611072565b5060035460055460405163095ea7b360e01b81526001600160a01b039283169263095ea7b3926102ec9291169060001990600401611044565b600060405180830381600087803b15801561030657600080fd5b505af115801561031a573d6000803e3d6000fd5b50506004805460055460405163095ea7b360e01b81526001600160a01b03928316955063095ea7b394506103579391909216916000199101611044565b6020604051808303816000875af1158015610376573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061039a9190611072565b5060055460065460405163095ea7b360e01b81526001600160a01b039283169263095ea7b3926103d39291169060001990600401611044565b6020604051808303816000875af11580156103f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104169190611072565b5061041f610b38565b565b610429610b0b565b61041f6000610b87565b600061043d610bd7565b610445610c02565b60006001600160a01b038916158061046457506001600160a01b038316155b156104825760405163538ba4f960e01b815260040160405180910390fd5b87158061048d575084155b80610496575083155b156104b457604051630f6fa54560e41b815260040160405180910390fd5b866001600160801b03166000036105e7576002546040516370a0823160e01b815289916001600160a01b0316906370a08231906104f590339060040161100d565b602060405180830381865afa158015610512573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610536919061109e565b101561055557604051632858f9ab60e11b815260040160405180910390fd5b60025461056d906001600160a01b031633308b610c2c565b60055460405163b6b55f2560e01b81526001600160a01b039091169063b6b55f259061059d908b90600401610ff6565b6020604051808303816000875af11580156105bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e0919061109e565b90506107f3565b866001600160801b0316600114806106085750866001600160801b03166002145b156107da578560000361062e57604051630f6fa54560e41b815260040160405180910390fd5b866001600160801b03166001036106ed57600480546040516370a0823160e01b81528a926001600160a01b03909216916370a08231916106709133910161100d565b602060405180830381865afa15801561068d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b1919061109e565b10156106d057604051632858f9ab60e11b815260040160405180910390fd5b6004546106e8906001600160a01b031633308b610c2c565b6107a6565b866001600160801b03166002036107a6576003546040516370a0823160e01b815289916001600160a01b0316906370a082319061072e90339060040161100d565b602060405180830381865afa15801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f919061109e565b101561078e57604051632858f9ab60e11b815260040160405180910390fd5b6003546107a6906001600160a01b031633308b610c2c565b6005546040516366956b0560e11b81526001600160a01b039091169063cd2ad60a9061059d908a908c908b906004016110ce565b60405163b49aa3b560e01b815260040160405180910390fd5b600654600554604051634558de4f60e11b81526001600160a01b0392831692638ab1bc9e923492610832928f92169087908c908c908c906004016110f6565b60206040518083038185885af1158015610850573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610875919061109e565b9150886001600160a01b0316336001600160a01b03167f246c050bc7f8460805c071235f1a32b8ffd2350ce7818fee4d0094bdb27b3adf83856040516108bc929190611145565b60405180910390a3506108ce60018055565b979650505050505050565b6108e1610b0b565b60025460055460405163095ea7b360e01b81526001600160a01b039283169263095ea7b39261091892911690600090600401611168565b6020604051808303816000875af1158015610937573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095b9190611072565b5060035460055460405163095ea7b360e01b81526001600160a01b039283169263095ea7b39261099392911690600090600401611168565b600060405180830381600087803b1580156109ad57600080fd5b505af11580156109c1573d6000803e3d6000fd5b50506004805460055460405163095ea7b360e01b81526001600160a01b03928316955063095ea7b394506109fd93919092169160009101611168565b6020604051808303816000875af1158015610a1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a409190611072565b5060055460065460405163095ea7b360e01b81526001600160a01b039283169263095ea7b392610a7892911690600090600401611168565b6020604051808303816000875af1158015610a97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abb9190611072565b5061041f610c8c565b610acc610b0b565b6001600160a01b038116610aff576000604051631e4fbdf760e01b8152600401610af6919061100d565b60405180910390fd5b610b0881610b87565b50565b6000546001600160a01b0316331461041f573360405163118cdaa760e01b8152600401610af6919061100d565b610b40610ccf565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610b7d919061100d565b60405180910390a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600054600160a01b900460ff161561041f5760405163d93c066560e01b815260040160405180910390fd5b600260015403610c2557604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b610c8684856001600160a01b03166323b872dd868686604051602401610c5493929190611183565b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050610cf9565b50505050565b610c94610bd7565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610b703390565b600054600160a01b900460ff1661041f57604051638dfc202b60e01b815260040160405180910390fd5b6000610d0e6001600160a01b03841683610d58565b90508051600014158015610d33575080806020019051810190610d319190611072565b155b15610d535782604051635274afe760e01b8152600401610af6919061100d565b505050565b6060610d6683836000610d6f565b90505b92915050565b606081471015610d94573060405163cd78605960e01b8152600401610af6919061100d565b600080856001600160a01b03168486604051610db091906111e4565b60006040518083038185875af1925050503d8060008114610ded576040519150601f19603f3d011682016040523d82523d6000602084013e610df2565b606091505b5091509150610e02868383610e0e565b925050505b9392505050565b606082610e2357610e1e82610e61565b610e07565b8151158015610e3a57506001600160a01b0384163b155b15610e5a5783604051639996b31560e01b8152600401610af6919061100d565b5080610e07565b805115610e715780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6000610d696001600160a01b038316610ea1565b90565b6001600160a01b031690565b6000610d6982610e8a565b6000610d6982610ead565b610ecc81610eb8565b82525050565b60208101610d698284610ec3565b801515610ecc565b60208101610d698284610ee0565b60006001600160a01b038216610d69565b610f1081610ef6565b8114610b0857600080fd5b8035610d6981610f07565b80610f10565b8035610d6981610f26565b6001600160801b038116610f10565b8035610d6981610f37565b600080600080600080600060e0888a031215610f6f57610f6f600080fd5b6000610f7b8a8a610f1b565b9750506020610f8c8a828b01610f2c565b9650506040610f9d8a828b01610f46565b9550506060610fae8a828b01610f2c565b9450506080610fbf8a828b01610f2c565b93505060a0610fd08a828b01610f2c565b92505060c0610fe18a828b01610f1b565b91505092959891949750929550565b80610ecc565b60208101610d698284610ff0565b610ecc81610ef6565b60208101610d698284611004565b60006020828403121561103057611030600080fd5b600061103c8484610f1b565b949350505050565b604081016110528285611004565b610e076020830184610ff0565b801515610f10565b8051610d698161105f565b60006020828403121561108757611087600080fd5b600061103c8484611067565b8051610d6981610f26565b6000602082840312156110b3576110b3600080fd5b600061103c8484611093565b6001600160801b038116610ecc565b606081016110dc82866110bf565b6110e96020830185610ff0565b61103c6040830184610ff0565b60c081016111048289611004565b6111116020830188611004565b61111e6040830187610ff0565b61112b6060830186610ff0565b6111386080830185610ff0565b6108ce60a0830184611004565b604081016110528285610ff0565b6000610d69610e9e8381565b610ecc81611153565b604081016111768285611004565b610e07602083018461115f565b606081016111918286611004565b6110e96020830185611004565b60005b838110156111b95781810151838201526020016111a1565b50506000910152565b60006111cc825190565b6111da81856020860161119e565b9290920192915050565b6000610e0782846111c256fea26469706673582212202236f04225b719be0ae338c706abb3057dfdf869496c03d3822ee54ac7bdd82564736f6c634300081800330000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000fa59075dfce274e028b58bddfcc3d709960f594a0000000000000000000000003766eb5f07dbc60d39a2059a9a29fd9b7d3c356d

Deployed Bytecode

0x6080604052600436106100a75760003560e01c80638456cb59116100645780638456cb59146101755780638da5cb5b1461018a578063a504d2af146101b0578063a6365e8b146101d0578063f2fde38b146101f0578063f4b9fa751461021057600080fd5b80632f48ab7d146100ac5780633e413bee146100e25780633f4ba83a146101025780635c975abb14610119578063715018a6146101405780637c37088d14610155575b600080fd5b3480156100b857600080fd5b506003546100cc906001600160a01b031681565b6040516100d99190610ed2565b60405180910390f35b3480156100ee57600080fd5b506004546100cc906001600160a01b031681565b34801561010e57600080fd5b50610117610230565b005b34801561012557600080fd5b50600054600160a01b900460ff166040516100d99190610ee8565b34801561014c57600080fd5b50610117610421565b610168610163366004610f51565b610433565b6040516100d99190610ff6565b34801561018157600080fd5b506101176108d9565b34801561019657600080fd5b506000546001600160a01b03166040516100d9919061100d565b3480156101bc57600080fd5b506005546100cc906001600160a01b031681565b3480156101dc57600080fd5b506006546100cc906001600160a01b031681565b3480156101fc57600080fd5b5061011761020b36600461101b565b610ac4565b34801561021c57600080fd5b506002546100cc906001600160a01b031681565b610238610b0b565b60025460055460405163095ea7b360e01b81526001600160a01b039283169263095ea7b3926102709291169060001990600401611044565b6020604051808303816000875af115801561028f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b39190611072565b5060035460055460405163095ea7b360e01b81526001600160a01b039283169263095ea7b3926102ec9291169060001990600401611044565b600060405180830381600087803b15801561030657600080fd5b505af115801561031a573d6000803e3d6000fd5b50506004805460055460405163095ea7b360e01b81526001600160a01b03928316955063095ea7b394506103579391909216916000199101611044565b6020604051808303816000875af1158015610376573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061039a9190611072565b5060055460065460405163095ea7b360e01b81526001600160a01b039283169263095ea7b3926103d39291169060001990600401611044565b6020604051808303816000875af11580156103f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104169190611072565b5061041f610b38565b565b610429610b0b565b61041f6000610b87565b600061043d610bd7565b610445610c02565b60006001600160a01b038916158061046457506001600160a01b038316155b156104825760405163538ba4f960e01b815260040160405180910390fd5b87158061048d575084155b80610496575083155b156104b457604051630f6fa54560e41b815260040160405180910390fd5b866001600160801b03166000036105e7576002546040516370a0823160e01b815289916001600160a01b0316906370a08231906104f590339060040161100d565b602060405180830381865afa158015610512573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610536919061109e565b101561055557604051632858f9ab60e11b815260040160405180910390fd5b60025461056d906001600160a01b031633308b610c2c565b60055460405163b6b55f2560e01b81526001600160a01b039091169063b6b55f259061059d908b90600401610ff6565b6020604051808303816000875af11580156105bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e0919061109e565b90506107f3565b866001600160801b0316600114806106085750866001600160801b03166002145b156107da578560000361062e57604051630f6fa54560e41b815260040160405180910390fd5b866001600160801b03166001036106ed57600480546040516370a0823160e01b81528a926001600160a01b03909216916370a08231916106709133910161100d565b602060405180830381865afa15801561068d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b1919061109e565b10156106d057604051632858f9ab60e11b815260040160405180910390fd5b6004546106e8906001600160a01b031633308b610c2c565b6107a6565b866001600160801b03166002036107a6576003546040516370a0823160e01b815289916001600160a01b0316906370a082319061072e90339060040161100d565b602060405180830381865afa15801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f919061109e565b101561078e57604051632858f9ab60e11b815260040160405180910390fd5b6003546107a6906001600160a01b031633308b610c2c565b6005546040516366956b0560e11b81526001600160a01b039091169063cd2ad60a9061059d908a908c908b906004016110ce565b60405163b49aa3b560e01b815260040160405180910390fd5b600654600554604051634558de4f60e11b81526001600160a01b0392831692638ab1bc9e923492610832928f92169087908c908c908c906004016110f6565b60206040518083038185885af1158015610850573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610875919061109e565b9150886001600160a01b0316336001600160a01b03167f246c050bc7f8460805c071235f1a32b8ffd2350ce7818fee4d0094bdb27b3adf83856040516108bc929190611145565b60405180910390a3506108ce60018055565b979650505050505050565b6108e1610b0b565b60025460055460405163095ea7b360e01b81526001600160a01b039283169263095ea7b39261091892911690600090600401611168565b6020604051808303816000875af1158015610937573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095b9190611072565b5060035460055460405163095ea7b360e01b81526001600160a01b039283169263095ea7b39261099392911690600090600401611168565b600060405180830381600087803b1580156109ad57600080fd5b505af11580156109c1573d6000803e3d6000fd5b50506004805460055460405163095ea7b360e01b81526001600160a01b03928316955063095ea7b394506109fd93919092169160009101611168565b6020604051808303816000875af1158015610a1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a409190611072565b5060055460065460405163095ea7b360e01b81526001600160a01b039283169263095ea7b392610a7892911690600090600401611168565b6020604051808303816000875af1158015610a97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abb9190611072565b5061041f610c8c565b610acc610b0b565b6001600160a01b038116610aff576000604051631e4fbdf760e01b8152600401610af6919061100d565b60405180910390fd5b610b0881610b87565b50565b6000546001600160a01b0316331461041f573360405163118cdaa760e01b8152600401610af6919061100d565b610b40610ccf565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610b7d919061100d565b60405180910390a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600054600160a01b900460ff161561041f5760405163d93c066560e01b815260040160405180910390fd5b600260015403610c2557604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b610c8684856001600160a01b03166323b872dd868686604051602401610c5493929190611183565b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050610cf9565b50505050565b610c94610bd7565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610b703390565b600054600160a01b900460ff1661041f57604051638dfc202b60e01b815260040160405180910390fd5b6000610d0e6001600160a01b03841683610d58565b90508051600014158015610d33575080806020019051810190610d319190611072565b155b15610d535782604051635274afe760e01b8152600401610af6919061100d565b505050565b6060610d6683836000610d6f565b90505b92915050565b606081471015610d94573060405163cd78605960e01b8152600401610af6919061100d565b600080856001600160a01b03168486604051610db091906111e4565b60006040518083038185875af1925050503d8060008114610ded576040519150601f19603f3d011682016040523d82523d6000602084013e610df2565b606091505b5091509150610e02868383610e0e565b925050505b9392505050565b606082610e2357610e1e82610e61565b610e07565b8151158015610e3a57506001600160a01b0384163b155b15610e5a5783604051639996b31560e01b8152600401610af6919061100d565b5080610e07565b805115610e715780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6000610d696001600160a01b038316610ea1565b90565b6001600160a01b031690565b6000610d6982610e8a565b6000610d6982610ead565b610ecc81610eb8565b82525050565b60208101610d698284610ec3565b801515610ecc565b60208101610d698284610ee0565b60006001600160a01b038216610d69565b610f1081610ef6565b8114610b0857600080fd5b8035610d6981610f07565b80610f10565b8035610d6981610f26565b6001600160801b038116610f10565b8035610d6981610f37565b600080600080600080600060e0888a031215610f6f57610f6f600080fd5b6000610f7b8a8a610f1b565b9750506020610f8c8a828b01610f2c565b9650506040610f9d8a828b01610f46565b9550506060610fae8a828b01610f2c565b9450506080610fbf8a828b01610f2c565b93505060a0610fd08a828b01610f2c565b92505060c0610fe18a828b01610f1b565b91505092959891949750929550565b80610ecc565b60208101610d698284610ff0565b610ecc81610ef6565b60208101610d698284611004565b60006020828403121561103057611030600080fd5b600061103c8484610f1b565b949350505050565b604081016110528285611004565b610e076020830184610ff0565b801515610f10565b8051610d698161105f565b60006020828403121561108757611087600080fd5b600061103c8484611067565b8051610d6981610f26565b6000602082840312156110b3576110b3600080fd5b600061103c8484611093565b6001600160801b038116610ecc565b606081016110dc82866110bf565b6110e96020830185610ff0565b61103c6040830184610ff0565b60c081016111048289611004565b6111116020830188611004565b61111e6040830187610ff0565b61112b6060830186610ff0565b6111386080830185610ff0565b6108ce60a0830184611004565b604081016110528285610ff0565b6000610d69610e9e8381565b610ecc81611153565b604081016111768285611004565b610e07602083018461115f565b606081016111918286611004565b6110e96020830185611004565b60005b838110156111b95781810151838201526020016111a1565b50506000910152565b60006111cc825190565b6111da81856020860161119e565b9290920192915050565b6000610e0782846111c256fea26469706673582212202236f04225b719be0ae338c706abb3057dfdf869496c03d3822ee54ac7bdd82564736f6c63430008180033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000fa59075dfce274e028b58bddfcc3d709960f594a0000000000000000000000003766eb5f07dbc60d39a2059a9a29fd9b7d3c356d

-----Decoded View---------------
Arg [0] : _dai (address): 0x6B175474E89094C44Da98b954EedeAC495271d0F
Arg [1] : _usdc (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [2] : _usdt (address): 0xdAC17F958D2ee523a2206206994597C13D831ec7
Arg [3] : _ybUSD (address): 0xFA59075DfCE274E028b58BdDFcC3D709960F594a
Arg [4] : _bridgeMiddleware (address): 0x3766Eb5F07DBc60d39a2059A9A29fD9b7D3C356D

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f
Arg [1] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [2] : 000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7
Arg [3] : 000000000000000000000000fa59075dfce274e028b58bddfcc3d709960f594a
Arg [4] : 0000000000000000000000003766eb5f07dbc60d39a2059a9a29fd9b7d3c356d


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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.