ETH Price: $3,057.62 (+1.11%)
Gas: 3 Gwei

Contract

0x52d298Ff9e77E71C2EB1992260520E7b15257d99
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Swap And Deposit202717662024-07-09 21:57:471 hr ago1720562267IN
0x52d298Ff...b15257d99
0 ETH0.001384784.34405561
Swap And Deposit202716762024-07-09 21:39:471 hr ago1720561187IN
0x52d298Ff...b15257d99
0 ETH0.002306416.78254972
Swap And Deposit202716062024-07-09 21:25:471 hr ago1720560347IN
0x52d298Ff...b15257d99
0 ETH0.001651294.84537795
Swap And Deposit202705432024-07-09 17:51:475 hrs ago1720547507IN
0x52d298Ff...b15257d99
0 ETH0.002013996.00347852
Swap And Deposit202704892024-07-09 17:40:475 hrs ago1720546847IN
0x52d298Ff...b15257d99
0 ETH0.001961965.8433665
Swap And Deposit202704342024-07-09 17:29:475 hrs ago1720546187IN
0x52d298Ff...b15257d99
0 ETH0.002395387.13668919
Withdraw And Swa...202703872024-07-09 17:20:115 hrs ago1720545611IN
0x52d298Ff...b15257d99
0 ETH0.0033866110.34643808
Swap And Deposit202699662024-07-09 15:55:477 hrs ago1720540547IN
0x52d298Ff...b15257d99
0 ETH0.003698811.43802164
Swap And Deposit202698812024-07-09 15:38:357 hrs ago1720539515IN
0x52d298Ff...b15257d99
0 ETH0.0065949419.36780106
Swap And Deposit202689412024-07-09 12:29:4710 hrs ago1720528187IN
0x52d298Ff...b15257d99
0 ETH0.001093173.25361223
Swap And Deposit202680542024-07-09 9:30:4713 hrs ago1720517447IN
0x52d298Ff...b15257d99
0 ETH0.001411224.21027766
Swap And Deposit202672272024-07-09 6:43:5916 hrs ago1720507439IN
0x52d298Ff...b15257d99
0 ETH0.000820992.57027888
Redeem And Swap202634132024-07-08 17:55:1129 hrs ago1720461311IN
0x52d298Ff...b15257d99
0 ETH0.001222513.76807788
Swap And Deposit202629632024-07-08 16:24:1130 hrs ago1720455851IN
0x52d298Ff...b15257d99
0 ETH0.00223667.00913946
Redeem And Swap202628312024-07-08 15:57:3531 hrs ago1720454255IN
0x52d298Ff...b15257d99
0 ETH0.001954516.00257366
Swap And Deposit202624962024-07-08 14:50:1132 hrs ago1720450211IN
0x52d298Ff...b15257d99
0 ETH0.0049778714.59320845
Swap And Deposit202612382024-07-08 10:36:5936 hrs ago1720435019IN
0x52d298Ff...b15257d99
0 ETH0.0010323.18999385
Swap And Deposit202608862024-07-08 9:25:4737 hrs ago1720430747IN
0x52d298Ff...b15257d99
0 ETH0.001972425.88557722
Swap And Deposit202608412024-07-08 9:16:4737 hrs ago1720430207IN
0x52d298Ff...b15257d99
0 ETH0.002110846.29777714
Swap And Deposit202600072024-07-08 6:28:4740 hrs ago1720420127IN
0x52d298Ff...b15257d99
0 ETH0.000706962.07792807
Redeem And Swap202585652024-07-08 1:38:5945 hrs ago1720402739IN
0x52d298Ff...b15257d99
0 ETH0.001790885.51191397
Swap And Deposit202581392024-07-08 0:13:1147 hrs ago1720397591IN
0x52d298Ff...b15257d99
0 ETH0.000895112.6257049
Swap And Deposit202576992024-07-07 22:44:592 days ago1720392299IN
0x52d298Ff...b15257d99
0 ETH0.000967032.84714893
Swap And Deposit202537742024-07-07 9:35:112 days ago1720344911IN
0x52d298Ff...b15257d99
0 ETH0.000497021.48055725
Swap And Deposit202530342024-07-07 7:06:112 days ago1720335971IN
0x52d298Ff...b15257d99
0 ETH0.000404961.26821983
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PSMVariant1Actions

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 100000 runs

Other Settings:
paris EvmVersion
File 1 of 3 : PSMVariant1Actions.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.25;

import { IERC20 }   from "lib/forge-std/src/interfaces/IERC20.sol";
import { IERC4626 } from "lib/forge-std/src/interfaces/IERC4626.sol";

interface PSMVariant1Like {
    function dai() external view returns (address);
    function gemJoin() external view returns (GemJoinLike);
    function buyGem(address usr, uint256 gemAmt) external;
    function sellGem(address usr, uint256 gemAmt) external;
    function tout() external view returns (uint256);
}

interface GemJoinLike {
    function gem() external view returns (address);
}

/**
 * @notice Actions for swapping in PSM and depositing in an ERC4626 token.
 * @dev    This is for the first version of the PSM.
 *         Code: https://github.com/makerdao/dss-psm/blob/222c96d4047e76680ed6803f07dd61aa2590e42b/src/psm.sol
 */
contract PSMVariant1Actions {

    uint256 private immutable GEM_CONVERSION_FACTOR;

    PSMVariant1Like public immutable psm;
    IERC20          public immutable dai;
    IERC20          public immutable gem;
    IERC4626        public immutable savingsToken;

    constructor(address _psm, address _savingsToken) {
        psm          = PSMVariant1Like(_psm);
        dai          = IERC20(psm.dai());
        gem          = IERC20(psm.gemJoin().gem());
        savingsToken = IERC4626(_savingsToken);

        GEM_CONVERSION_FACTOR = 10 ** (dai.decimals() - gem.decimals());

        // Infinite approvals
        gem.approve(address(psm.gemJoin()), type(uint256).max);  // For psm.sellGem()
        dai.approve(address(psm),           type(uint256).max);  // For psm.buyGem()
        dai.approve(address(savingsToken),  type(uint256).max);  // For savingsToken.deposit()
    }

    /**
     * @notice Swap `gem` for `dai` in the PSM and deposit in the `savingsToken`.
     * @dev    Please note that `minAmountOut` is measured in `dai` due to increasing value of the `savingsToken`.
     *         `minAmountOut` is used to protect in the case PSM fees change.
     * @param  receiver     The receiver of the `savingsToken`.
     * @param  amountIn     The amount of the `gem` to swap.
     * @param  minAmountOut The minimum amount of `dai` to receive.
     * @return amountOut    The amount of `dai` deposited into the `savingsToken`.
     */
    function swapAndDeposit(
        address receiver,
        uint256 amountIn,
        uint256 minAmountOut
    ) external returns (uint256 amountOut) {
        gem.transferFrom(msg.sender, address(this), amountIn);

        // There may be a balance in this contract, so we determine the difference
        uint256 balanceBefore = dai.balanceOf(address(this));
        psm.sellGem(address(this), amountIn);
        amountOut = dai.balanceOf(address(this)) - balanceBefore;
        require(amountOut >= minAmountOut, "PSMVariant1Actions/amount-out-too-low");

        savingsToken.deposit(amountOut, receiver);
    }

    /**
     * @notice Withdraw a specified amount of output `gem` with a maximum limit of `savingsToken` (in DAI units).
     *         Use this if you want an exact amount of `gem` tokens out. IE pay someone 10k exactly.
     * @dev    Please note that `maxAmountIn` is measured in `dai` due to increasing value of the `savingsToken`.
     *         `maxAmountIn` is used to protect in the case PSM fees change.
     * @param  receiver    The receiver of the `gem`.
     * @param  amountOut   The amount of `gem` you want to receive.
     * @param  maxAmountIn The maximum amount of `dai` to pay for this swap.
     * @return amountIn    The amount of `dai` used for the swap.
     */
    function withdrawAndSwap(
        address receiver,
        uint256 amountOut,
        uint256 maxAmountIn
    ) external returns (uint256 amountIn) {
        // Calculate the exact amount of required dai based on the expected output
        // We are performing the calculation at https://github.com/makerdao/dss-psm/blob/222c96d4047e76680ed6803f07dd61aa2590e42b/src/psm.sol#L121
        uint256 amountOut18 = amountOut * GEM_CONVERSION_FACTOR;
        savingsToken.withdraw(amountOut18 + amountOut18 * psm.tout() / 1e18, address(this), msg.sender);

        // There may be a balance in this contract, so we determine the difference
        uint256 balanceBefore = dai.balanceOf(address(this));
        psm.buyGem(receiver, amountOut);
        amountIn = balanceBefore - dai.balanceOf(address(this));
        require(amountIn <= maxAmountIn, "PSMVariant1Actions/amount-in-too-high");
    }

    /**
     * @notice Redeem a specified amount of `savingsToken` from the `savingsToken` for `dai` and swap for `gem` in the PSM.
     *         Use this if you want to withdraw everything.
     * @dev    Please note that this will leave dust due to rounding error in this contract.
     * @param  receiver     The receiver of the `gem`.
     * @param  shares       The amount of shares to redeem.
     * @param  minAmountOut The minimum amount of `gem` to receive.
     * @return amountOut    The amount of `gem` tokens received.
     */
    function redeemAndSwap(
        address receiver,
        uint256 shares,
        uint256 minAmountOut
    ) external returns (uint256 amountOut) {
        uint256 assets = savingsToken.redeem(shares, address(this), msg.sender);

        // Calculate the exact amount of gems we expect to receive given this amount of assets
        // We are reversing the calculation at https://github.com/makerdao/dss-psm/blob/222c96d4047e76680ed6803f07dd61aa2590e42b/src/psm.sol#L121
        // Note: Due to rounding, this may leave dai dust in the contract
        amountOut = assets * 1e18 / (GEM_CONVERSION_FACTOR * (1e18 + psm.tout()));
        require(amountOut >= minAmountOut, "PSMVariant1Actions/amount-out-too-low");
        psm.buyGem(receiver, amountOut);
    }

}

File 2 of 3 : IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;

/// @dev Interface of the ERC20 standard as defined in the EIP.
/// @dev This includes the optional name, symbol, and decimals metadata.
interface IERC20 {
    /// @dev Emitted when `value` tokens are moved from one account (`from`) to another (`to`).
    event Transfer(address indexed from, address indexed to, uint256 value);

    /// @dev Emitted when the allowance of a `spender` for an `owner` is set, where `value`
    /// is the new allowance.
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /// @notice Returns the amount of tokens in existence.
    function totalSupply() external view returns (uint256);

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

    /// @notice Moves `amount` tokens from the caller's account to `to`.
    function transfer(address to, uint256 amount) external returns (bool);

    /// @notice Returns the remaining number of tokens that `spender` is allowed
    /// to spend on behalf of `owner`
    function allowance(address owner, address spender) external view returns (uint256);

    /// @notice Sets `amount` as the allowance of `spender` over the caller's tokens.
    /// @dev Be aware of front-running risks: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
    function approve(address spender, uint256 amount) external returns (bool);

    /// @notice Moves `amount` tokens from `from` to `to` using the allowance mechanism.
    /// `amount` is then deducted from the caller's allowance.
    function transferFrom(address from, address to, uint256 amount) external returns (bool);

    /// @notice Returns the name of the token.
    function name() external view returns (string memory);

    /// @notice Returns the symbol of the token.
    function symbol() external view returns (string memory);

    /// @notice Returns the decimals places of the token.
    function decimals() external view returns (uint8);
}

File 3 of 3 : IERC4626.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;

import "./IERC20.sol";

/// @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in
/// https://eips.ethereum.org/EIPS/eip-4626
interface IERC4626 is IERC20 {
    event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);

    event Withdraw(
        address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares
    );

    /// @notice Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.
    /// @dev
    /// - MUST be an ERC-20 token contract.
    /// - MUST NOT revert.
    function asset() external view returns (address assetTokenAddress);

    /// @notice Returns the total amount of the underlying asset that is “managed” by Vault.
    /// @dev
    /// - SHOULD include any compounding that occurs from yield.
    /// - MUST be inclusive of any fees that are charged against assets in the Vault.
    /// - MUST NOT revert.
    function totalAssets() external view returns (uint256 totalManagedAssets);

    /// @notice Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal
    /// scenario where all the conditions are met.
    /// @dev
    /// - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
    /// - MUST NOT show any variations depending on the caller.
    /// - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
    /// - MUST NOT revert.
    ///
    /// NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
    /// “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
    /// from.
    function convertToShares(uint256 assets) external view returns (uint256 shares);

    /// @notice Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal
    /// scenario where all the conditions are met.
    /// @dev
    /// - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
    /// - MUST NOT show any variations depending on the caller.
    /// - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
    /// - MUST NOT revert.
    ///
    /// NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
    /// “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
    /// from.
    function convertToAssets(uint256 shares) external view returns (uint256 assets);

    /// @notice Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,
    /// through a deposit call.
    /// @dev
    /// - MUST return a limited value if receiver is subject to some deposit limit.
    /// - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.
    /// - MUST NOT revert.
    function maxDeposit(address receiver) external view returns (uint256 maxAssets);

    /// @notice Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given
    /// current on-chain conditions.
    /// @dev
    /// - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit
    ///   call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called
    ///   in the same transaction.
    /// - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the
    ///   deposit would be accepted, regardless if the user has enough tokens approved, etc.
    /// - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
    /// - MUST NOT revert.
    ///
    /// NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in
    /// share price or some other type of condition, meaning the depositor will lose assets by depositing.
    function previewDeposit(uint256 assets) external view returns (uint256 shares);

    /// @notice Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.
    /// @dev
    /// - MUST emit the Deposit event.
    /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
    ///   deposit execution, and are accounted for during deposit.
    /// - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not
    ///   approving enough underlying tokens to the Vault contract, etc).
    ///
    /// NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
    function deposit(uint256 assets, address receiver) external returns (uint256 shares);

    /// @notice Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.
    /// @dev
    /// - MUST return a limited value if receiver is subject to some mint limit.
    /// - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.
    /// - MUST NOT revert.
    function maxMint(address receiver) external view returns (uint256 maxShares);

    /// @notice Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given
    /// current on-chain conditions.
    /// @dev
    /// - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call
    ///   in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the
    ///   same transaction.
    /// - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint
    ///   would be accepted, regardless if the user has enough tokens approved, etc.
    /// - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
    /// - MUST NOT revert.
    ///
    /// NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in
    /// share price or some other type of condition, meaning the depositor will lose assets by minting.
    function previewMint(uint256 shares) external view returns (uint256 assets);

    /// @notice Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.
    /// @dev
    /// - MUST emit the Deposit event.
    /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint
    ///   execution, and are accounted for during mint.
    /// - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not
    ///   approving enough underlying tokens to the Vault contract, etc).
    ///
    /// NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
    function mint(uint256 shares, address receiver) external returns (uint256 assets);

    /// @notice Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the
    /// Vault, through a withdraw call.
    /// @dev
    /// - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
    /// - MUST NOT revert.
    function maxWithdraw(address owner) external view returns (uint256 maxAssets);

    /// @notice Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,
    /// given current on-chain conditions.
    /// @dev
    /// - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw
    ///   call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if
    ///   called
    ///   in the same transaction.
    /// - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though
    ///   the withdrawal would be accepted, regardless if the user has enough shares, etc.
    /// - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
    /// - MUST NOT revert.
    ///
    /// NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in
    /// share price or some other type of condition, meaning the depositor will lose assets by depositing.
    function previewWithdraw(uint256 assets) external view returns (uint256 shares);

    /// @notice Burns shares from owner and sends exactly assets of underlying tokens to receiver.
    /// @dev
    /// - MUST emit the Withdraw event.
    /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
    ///   withdraw execution, and are accounted for during withdraw.
    /// - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner
    ///   not having enough shares, etc).
    ///
    /// Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
    /// Those methods should be performed separately.
    function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);

    /// @notice Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,
    /// through a redeem call.
    /// @dev
    /// - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
    /// - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.
    /// - MUST NOT revert.
    function maxRedeem(address owner) external view returns (uint256 maxShares);

    /// @notice Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,
    /// given current on-chain conditions.
    /// @dev
    /// - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call
    ///   in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the
    ///   same transaction.
    /// - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the
    ///   redemption would be accepted, regardless if the user has enough shares, etc.
    /// - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
    /// - MUST NOT revert.
    ///
    /// NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in
    /// share price or some other type of condition, meaning the depositor will lose assets by redeeming.
    function previewRedeem(uint256 shares) external view returns (uint256 assets);

    /// @notice Burns exactly shares from owner and sends assets of underlying tokens to receiver.
    /// @dev
    /// - MUST emit the Withdraw event.
    /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
    ///   redeem execution, and are accounted for during redeem.
    /// - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner
    ///   not having enough shares, etc).
    ///
    /// NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
    /// Those methods should be performed separately.
    function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);
}

Settings
{
  "remappings": [
    "ds-test/=lib/erc20-helpers/lib/forge-std/lib/ds-test/src/",
    "erc20-helpers/=lib/erc20-helpers/src/",
    "forge-std/=lib/forge-std/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 100000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_psm","type":"address"},{"internalType":"address","name":"_savingsToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"dai","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gem","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"psm","outputs":[{"internalType":"contract PSMVariant1Like","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"}],"name":"redeemAndSwap","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"savingsToken","outputs":[{"internalType":"contract IERC4626","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"}],"name":"swapAndDeposit","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"maxAmountIn","type":"uint256"}],"name":"withdrawAndSwap","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

61012060405234801561001157600080fd5b5060405161154c38038061154c83398101604081905261003091610470565b6001600160a01b03821660a08190526040805163f4b9fa7560e01b8152905163f4b9fa75916004808201926020929091908290030181865afa15801561007a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061009e91906104aa565b6001600160a01b031660c0816001600160a01b03168152505060a0516001600160a01b03166301664f666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011b91906104aa565b6001600160a01b0316637bd2bea76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610158573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017c91906104aa565b6001600160a01b0390811660e0819052908216610100526040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181865afa1580156101ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f291906104ce565b60c0516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610232573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025691906104ce565b6102609190610507565b61026b90600a61060a565b6080818152505060e0516001600160a01b031663095ea7b360a0516001600160a01b03166301664f666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e791906104aa565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260001960248201526044016020604051808303816000875af1158015610335573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103599190610619565b5060c05160a05160405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af11580156103b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d49190610619565b5060c0516101005160405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af115801561042c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104509190610619565b50505061063b565b6001600160a01b038116811461046d57600080fd5b50565b6000806040838503121561048357600080fd5b825161048e81610458565b602084015190925061049f81610458565b809150509250929050565b6000602082840312156104bc57600080fd5b81516104c781610458565b9392505050565b6000602082840312156104e057600080fd5b815160ff811681146104c757600080fd5b634e487b7160e01b600052601160045260246000fd5b60ff8281168282160390811115610520576105206104f1565b92915050565b600181815b80851115610561578160001904821115610547576105476104f1565b8085161561055457918102915b93841c939080029061052b565b509250929050565b60008261057857506001610520565b8161058557506000610520565b816001811461059b57600281146105a5576105c1565b6001915050610520565b60ff8411156105b6576105b66104f1565b50506001821b610520565b5060208310610133831016604e8410600b84101617156105e4575081810a610520565b6105ee8383610526565b8060001904821115610602576106026104f1565b029392505050565b60006104c760ff841683610569565b60006020828403121561062b57600080fd5b815180151581146104c757600080fd5b60805160a05160c05160e05161010051610e6d6106df6000396000818160d8015281816101c0015281816106420152610c8d015260008181610120015261091801526000818161016d01528181610368015281816104c1015281816109cc0152610b2401526000818160870152818161020501528181610437015281816106b3015281816108760152610a8401526000818161019701526107580152610e6d6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80637bd2bea71161005b5780637bd2bea71461011b578063850d6b31146101425780638fba2cee14610155578063f4b9fa751461016857600080fd5b806304bda2621461008257806306250ab1146100d357806357de6782146100fa575b600080fd5b6100a97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100a97f000000000000000000000000000000000000000000000000000000000000000081565b61010d610108366004610cfa565b61018f565b6040519081526020016100ca565b6100a97f000000000000000000000000000000000000000000000000000000000000000081565b61010d610150366004610cfa565b6105ed565b61010d610163366004610cfa565b6108da565b6100a97f000000000000000000000000000000000000000000000000000000000000000081565b6000806101bc7f000000000000000000000000000000000000000000000000000000000000000085610d77565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663b460af94670de0b6b3a76400007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663fae036d56040518163ffffffff1660e01b8152600401602060405180830381865afa15801561026e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102929190610d94565b61029c9085610d77565b6102a69190610dad565b6102b09084610de8565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815260048101919091523060248201523360448201526064016020604051808303816000875af1158015610312573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103369190610d94565b506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa1580156103c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e89190610d94565b6040517f8d7ef9bb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152602482018890529192507f000000000000000000000000000000000000000000000000000000000000000090911690638d7ef9bb90604401600060405180830381600087803b15801561047d57600080fd5b505af1158015610491573d6000803e3d6000fd5b50506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1692506370a082319150602401602060405180830381865afa15801561051f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105439190610d94565b61054d9082610dfb565b9250838311156105e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f50534d56617269616e7431416374696f6e732f616d6f756e742d696e2d746f6f60448201527f2d6869676800000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b50509392505050565b6040517fba08765200000000000000000000000000000000000000000000000000000000815260048101839052306024820152336044820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063ba087652906064016020604051808303816000875af115801561068b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106af9190610d94565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663fae036d56040518163ffffffff1660e01b8152600401602060405180830381865afa15801561071c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107409190610d94565b61075290670de0b6b3a7640000610de8565b61077c907f0000000000000000000000000000000000000000000000000000000000000000610d77565b61078e82670de0b6b3a7640000610d77565b6107989190610dad565b91508282101561082a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f50534d56617269616e7431416374696f6e732f616d6f756e742d6f75742d746f60448201527f6f2d6c6f7700000000000000000000000000000000000000000000000000000060648201526084016105db565b6040517f8d7ef9bb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018490527f00000000000000000000000000000000000000000000000000000000000000001690638d7ef9bb90604401600060405180830381600087803b1580156108ba57600080fd5b505af11580156108ce573d6000803e3d6000fd5b50505050509392505050565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018390526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906323b872dd906064016020604051808303816000875af1158015610976573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099a9190610e0e565b506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610a28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4c9190610d94565b6040517f95991276000000000000000000000000000000000000000000000000000000008152306004820152602481018690529091507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690639599127690604401600060405180830381600087803b158015610add57600080fd5b505af1158015610af1573d6000803e3d6000fd5b50506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201528392507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1691506370a0823190602401602060405180830381865afa158015610b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba59190610d94565b610baf9190610dfb565b915082821015610c41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f50534d56617269616e7431416374696f6e732f616d6f756e742d6f75742d746f60448201527f6f2d6c6f7700000000000000000000000000000000000000000000000000000060648201526084016105db565b6040517f6e553f650000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff86811660248301527f00000000000000000000000000000000000000000000000000000000000000001690636e553f65906044016020604051808303816000875af1158015610cd6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e49190610d94565b600080600060608486031215610d0f57600080fd5b833573ffffffffffffffffffffffffffffffffffffffff81168114610d3357600080fd5b95602085013595506040909401359392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610d8e57610d8e610d48565b92915050565b600060208284031215610da657600080fd5b5051919050565b600082610de3577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b80820180821115610d8e57610d8e610d48565b81810381811115610d8e57610d8e610d48565b600060208284031215610e2057600080fd5b81518015158114610e3057600080fd5b939250505056fea2646970667358221220bd32fde226aba31918dbcf0f47d96ebdea99f38b667c3c56295fc7a0f910799464736f6c6343000819003300000000000000000000000089b78cfa322f6c5de0abceecab66aee45393cc5a00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80637bd2bea71161005b5780637bd2bea71461011b578063850d6b31146101425780638fba2cee14610155578063f4b9fa751461016857600080fd5b806304bda2621461008257806306250ab1146100d357806357de6782146100fa575b600080fd5b6100a97f00000000000000000000000089b78cfa322f6c5de0abceecab66aee45393cc5a81565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100a97f00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea81565b61010d610108366004610cfa565b61018f565b6040519081526020016100ca565b6100a97f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b61010d610150366004610cfa565b6105ed565b61010d610163366004610cfa565b6108da565b6100a97f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f81565b6000806101bc7f000000000000000000000000000000000000000000000000000000e8d4a5100085610d77565b90507f00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea73ffffffffffffffffffffffffffffffffffffffff1663b460af94670de0b6b3a76400007f00000000000000000000000089b78cfa322f6c5de0abceecab66aee45393cc5a73ffffffffffffffffffffffffffffffffffffffff1663fae036d56040518163ffffffff1660e01b8152600401602060405180830381865afa15801561026e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102929190610d94565b61029c9085610d77565b6102a69190610dad565b6102b09084610de8565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815260048101919091523060248201523360448201526064016020604051808303816000875af1158015610312573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103369190610d94565b506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f73ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa1580156103c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e89190610d94565b6040517f8d7ef9bb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152602482018890529192507f00000000000000000000000089b78cfa322f6c5de0abceecab66aee45393cc5a90911690638d7ef9bb90604401600060405180830381600087803b15801561047d57600080fd5b505af1158015610491573d6000803e3d6000fd5b50506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f73ffffffffffffffffffffffffffffffffffffffff1692506370a082319150602401602060405180830381865afa15801561051f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105439190610d94565b61054d9082610dfb565b9250838311156105e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f50534d56617269616e7431416374696f6e732f616d6f756e742d696e2d746f6f60448201527f2d6869676800000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b50509392505050565b6040517fba08765200000000000000000000000000000000000000000000000000000000815260048101839052306024820152336044820152600090819073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea169063ba087652906064016020604051808303816000875af115801561068b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106af9190610d94565b90507f00000000000000000000000089b78cfa322f6c5de0abceecab66aee45393cc5a73ffffffffffffffffffffffffffffffffffffffff1663fae036d56040518163ffffffff1660e01b8152600401602060405180830381865afa15801561071c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107409190610d94565b61075290670de0b6b3a7640000610de8565b61077c907f000000000000000000000000000000000000000000000000000000e8d4a51000610d77565b61078e82670de0b6b3a7640000610d77565b6107989190610dad565b91508282101561082a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f50534d56617269616e7431416374696f6e732f616d6f756e742d6f75742d746f60448201527f6f2d6c6f7700000000000000000000000000000000000000000000000000000060648201526084016105db565b6040517f8d7ef9bb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018490527f00000000000000000000000089b78cfa322f6c5de0abceecab66aee45393cc5a1690638d7ef9bb90604401600060405180830381600087803b1580156108ba57600080fd5b505af11580156108ce573d6000803e3d6000fd5b50505050509392505050565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018390526000907f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff16906323b872dd906064016020604051808303816000875af1158015610976573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099a9190610e0e565b506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f73ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610a28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4c9190610d94565b6040517f95991276000000000000000000000000000000000000000000000000000000008152306004820152602481018690529091507f00000000000000000000000089b78cfa322f6c5de0abceecab66aee45393cc5a73ffffffffffffffffffffffffffffffffffffffff1690639599127690604401600060405180830381600087803b158015610add57600080fd5b505af1158015610af1573d6000803e3d6000fd5b50506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201528392507f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f73ffffffffffffffffffffffffffffffffffffffff1691506370a0823190602401602060405180830381865afa158015610b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba59190610d94565b610baf9190610dfb565b915082821015610c41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f50534d56617269616e7431416374696f6e732f616d6f756e742d6f75742d746f60448201527f6f2d6c6f7700000000000000000000000000000000000000000000000000000060648201526084016105db565b6040517f6e553f650000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff86811660248301527f00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea1690636e553f65906044016020604051808303816000875af1158015610cd6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e49190610d94565b600080600060608486031215610d0f57600080fd5b833573ffffffffffffffffffffffffffffffffffffffff81168114610d3357600080fd5b95602085013595506040909401359392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610d8e57610d8e610d48565b92915050565b600060208284031215610da657600080fd5b5051919050565b600082610de3577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b80820180821115610d8e57610d8e610d48565b81810381811115610d8e57610d8e610d48565b600060208284031215610e2057600080fd5b81518015158114610e3057600080fd5b939250505056fea2646970667358221220bd32fde226aba31918dbcf0f47d96ebdea99f38b667c3c56295fc7a0f910799464736f6c63430008190033

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

00000000000000000000000089b78cfa322f6c5de0abceecab66aee45393cc5a00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea

-----Decoded View---------------
Arg [0] : _psm (address): 0x89B78CfA322F6C5dE0aBcEecab66Aee45393cC5A
Arg [1] : _savingsToken (address): 0x83F20F44975D03b1b09e64809B757c47f942BEeA

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000089b78cfa322f6c5de0abceecab66aee45393cc5a
Arg [1] : 00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea


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  ]

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.