Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x3225737a9Bbb6473CB4a45b7244ACa2BeFdB276A
Balance 0 ETH
Nonce 1
Code Size 1428 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

1428 bytes
0x608060405234801561001057600080fd5b50600436106100625760003560e01c80634cf282fb1461006757806368f30150146100aa578063c11645bc146100bf578063f2c07aae146100e6578063f4b9fa75146100f9578063fa1e2e8614610120575b600080fd5b61008e7f000000000000000000000000dc035d45d973e3ec169d2276ddab16f1e407384f81565b6040516001600160a01b03909116815260200160405180910390f35b6100bd6100b83660046104fd565b610147565b005b61008e7f0000000000000000000000009759a6ac90977b93b58547b4a71c78317f391a2881565b6100bd6100f43660046104fd565b610326565b61008e7f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f81565b61008e7f0000000000000000000000003c0f895007ca717aa01c8693e59df1e8c3777feb81565b6040516323b872dd60e01b8152336004820152306024820152604481018290527f000000000000000000000000dc035d45d973e3ec169d2276ddab16f1e407384f6001600160a01b0316906323b872dd906064016020604051808303816000875af11580156101ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101de9190610535565b50604051633b4da69f60e01b8152306004820152602481018290527f0000000000000000000000003c0f895007ca717aa01c8693e59df1e8c3777feb6001600160a01b031690633b4da69f90604401600060405180830381600087803b15801561024757600080fd5b505af115801561025b573d6000803e3d6000fd5b505060405163ef693bed60e01b81526001600160a01b038581166004830152602482018590527f0000000000000000000000009759a6ac90977b93b58547b4a71c78317f391a2816925063ef693bed9150604401600060405180830381600087803b1580156102c957600080fd5b505af11580156102dd573d6000803e3d6000fd5b50506040518381526001600160a01b03851692503391507f9c7bd3b60b7e46fc1d7a38d88b7dd4be0e028b80b706848fc3c065eabc8e6a9b906020015b60405180910390a35050565b6040516323b872dd60e01b8152336004820152306024820152604481018290527f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610399573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103bd9190610535565b50604051633b4da69f60e01b8152306004820152602481018290527f0000000000000000000000009759a6ac90977b93b58547b4a71c78317f391a286001600160a01b031690633b4da69f90604401600060405180830381600087803b15801561042657600080fd5b505af115801561043a573d6000803e3d6000fd5b505060405163ef693bed60e01b81526001600160a01b038581166004830152602482018590527f0000000000000000000000003c0f895007ca717aa01c8693e59df1e8c3777feb16925063ef693bed9150604401600060405180830381600087803b1580156104a857600080fd5b505af11580156104bc573d6000803e3d6000fd5b50506040518381526001600160a01b03851692503391507f23889db6b244d239344deac88ec7781d810b3873fe323939d1ce0e8ac95642359060200161031a565b6000806040838503121561051057600080fd5b82356001600160a01b038116811461052757600080fd5b946020939093013593505050565b60006020828403121561054757600080fd5b8151801515811461055757600080fd5b939250505056fea2646970667358221220ac08dad19d57401b8f931b4e68013812a4d62ab10e4ae9620d8788772369bd2964736f6c63430008150033

Verified Source Code Partial Match

Compiler: v0.8.21+commit.d9974bed EVM: paris Optimization: Yes (200 runs)
DaiUsds.sol 84 lines
// SPDX-License-Identifier: AGPL-3.0-or-later

/// DaiUsds.sol -- Dai/Usds Exchanger

// Copyright (C) 2023 Dai Foundation
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.21;

interface JoinLike {
    function vat() external view returns (address);
    function join(address, uint256) external;
    function exit(address, uint256) external;
}

interface DaiJoinLike is JoinLike {
    function dai() external view returns (address);
}

interface UsdsJoinLike is JoinLike {
    function usds() external view returns (address);
}

interface GemLike {
    function approve(address, uint256) external returns (bool);
    function transferFrom(address, address, uint256) external returns (bool);
}

interface VatLike {
    function hope(address) external;
}

contract DaiUsds {
    DaiJoinLike  public immutable daiJoin;
    UsdsJoinLike public immutable usdsJoin;
    GemLike      public immutable dai;
    GemLike      public immutable usds;
    
    event DaiToUsds(address indexed caller, address indexed usr, uint256 wad);
    event UsdsToDai(address indexed caller, address indexed usr, uint256 wad);

    constructor(address daiJoin_, address usdsJoin_) {
        daiJoin  = DaiJoinLike(daiJoin_);
        usdsJoin = UsdsJoinLike(usdsJoin_);

        address vat = daiJoin.vat();
        require(vat == usdsJoin.vat(), "DaiUsds/vat-not-same");

        dai  = GemLike(daiJoin.dai());
        usds = GemLike(usdsJoin.usds());

        dai.approve(address(daiJoin), type(uint256).max);
        usds.approve(address(usdsJoin), type(uint256).max);

        VatLike(vat).hope(address(daiJoin));
        VatLike(vat).hope(address(usdsJoin));
    }

    function daiToUsds(address usr, uint256 wad) external {
        dai.transferFrom(msg.sender, address(this), wad);
        daiJoin.join(address(this), wad);
        usdsJoin.exit(usr, wad);
        emit DaiToUsds(msg.sender, usr, wad);
    }

    function usdsToDai(address usr, uint256 wad) external {
        usds.transferFrom(msg.sender, address(this), wad);
        usdsJoin.join(address(this), wad);
        daiJoin.exit(usr, wad);
        emit UsdsToDai(msg.sender, usr, wad);
    }
}

Read Contract

dai 0xf4b9fa75 → address
daiJoin 0xc11645bc → address
usds 0x4cf282fb → address
usdsJoin 0xfa1e2e86 → address

Write Contract 2 functions

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

daiToUsds 0xf2c07aae
address usr
uint256 wad
usdsToDai 0x68f30150
address usr
uint256 wad

Token Balances (1)

View Transfers →
DAI 0.0055

Recent Transactions

No transactions found for this address