Address Contract Verified
Address
0x9D03bb2092270648d7480049d0E58d2FcF0E5123
Balance
0 ETH
Nonce
1
Code Size
1352 bytes
Creator
0x937Ce2d6...fEd5 at tx 0x4100f658...5faa45
Indexed Transactions
0
Contract Bytecode
1352 bytes
0x6080806040526004361015610012575f80fd5b5f3560e01c908163205c2878146102fb575080632f4f21e2146101115780636f307dc3146100535780639b493d9a146100a35763d4bd8fdc14610053575f80fd5b3461009f575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261009f576020604051739994e35db50125e0df82e4c2dde62496ce3309998152f35b5f80fd5b3461009f575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261009f57602060405173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000058d97b57bb95320f9a05dc918aef65434969c2b2168152f35b3461009f5761011f3661043b565b9073ffffffffffffffffffffffffffffffffffffffff811680156102d35730146102ab576040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101839052916020836064815f739994e35db50125e0df82e4c2dde62496ce3309995af19182156102855761020693602093610290575b5060405193849283927fa9059cbb000000000000000000000000000000000000000000000000000000008452600484016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b03815f73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000058d97b57bb95320f9a05dc918aef65434969c2b2165af1801561028557610258575b602060405160018152f35b6102799060203d60201161027e575b610271818361048c565b8101906104fa565b61024d565b503d610267565b6040513d5f823e3d90fd5b6102a690843d861161027e57610271818361048c565b6101ae565b7f2007aa4c000000000000000000000000000000000000000000000000000000005f5260045ffd5b7fd92e233d000000000000000000000000000000000000000000000000000000005f5260045ffd5b3461009f576103093661043b565b73ffffffffffffffffffffffffffffffffffffffff821680156102d35730146102ab577f23b872dd000000000000000000000000000000000000000000000000000000008352336004840152306024840152604483018190526020836064815f7f00000000000000000000000058d97b57bb95320f9a05dc918aef65434969c2b273ffffffffffffffffffffffffffffffffffffffff165af19182156102855761040c93602093610290575060405193849283927fa9059cbb000000000000000000000000000000000000000000000000000000008452600484016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b03815f739994e35db50125e0df82e4c2dde62496ce3309995af180156102855761025857602060405160018152f35b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc604091011261009f5760043573ffffffffffffffffffffffffffffffffffffffff8116810361009f579060243590565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176104cd57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b9081602091031261009f5751801515810361009f579056fea26469706673582212206aea5d68435f480d7af9b94d09c7996c37c2411dc9ccadd7f41e0530c2b9e8f864736f6c634300081b0033
Verified Source Code Full Match
Compiler: v0.8.27+commit.40a35a09
EVM: cancun
Optimization: Yes (999999 runs)
Wrapper.sol 66 lines
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity 0.8.27;
import {IERC20} from
"../lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
/// @title Wrapper
/// @author Morpho Association
/// @custom:security-contact [email protected]
/// @notice The Wrapper contract to migrate from legacy MORPHO tokens.
contract Wrapper {
/* CONSTANTS */
/// @notice The address of the legacy Morpho token.
address public constant LEGACY_MORPHO = 0x9994E35Db50125E0DF82e4c2dde62496CE330999;
/* IMMUTABLES */
/// @notice The address of the new Morpho token.
address public immutable NEW_MORPHO;
/* ERRORS */
/// @notice Reverts if the address is the zero address.
error ZeroAddress();
/// @notice Reverts if the address is the contract address.
error SelfAddress();
/* CONSTRUCTOR */
/// @dev morphoToken address can be precomputed using create2.
constructor(address morphoToken) {
require(morphoToken != address(0), ZeroAddress());
NEW_MORPHO = morphoToken;
}
/* EXTERNAL */
/// @dev Compliant to `ERC20Wrapper` contract from OZ for convenience.
function depositFor(address account, uint256 value) external returns (bool) {
require(account != address(0), ZeroAddress());
require(account != address(this), SelfAddress());
IERC20(LEGACY_MORPHO).transferFrom(msg.sender, address(this), value);
IERC20(NEW_MORPHO).transfer(account, value);
return true;
}
/// @dev Compliant to `ERC20Wrapper` contract from OZ for convenience.
function withdrawTo(address account, uint256 value) external returns (bool) {
require(account != address(0), ZeroAddress());
require(account != address(this), SelfAddress());
IERC20(NEW_MORPHO).transferFrom(msg.sender, address(this), value);
IERC20(LEGACY_MORPHO).transfer(account, value);
return true;
}
/// @dev To ease wrapping via the bundler contract:
/// https://github.com/morpho-org/morpho-blue-bundlers/blob/main/src/ERC20WrapperBundler.sol
function underlying() external pure returns (address) {
return LEGACY_MORPHO;
}
}
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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);
}
Read Contract
LEGACY_MORPHO 0xd4bd8fdc → address
NEW_MORPHO 0x9b493d9a → address
underlying 0x6f307dc3 → address
Write Contract 2 functions
These functions modify contract state and require a wallet transaction to execute.
depositFor 0x2f4f21e2
address account
uint256 value
returns: bool
withdrawTo 0x205c2878
address account
uint256 value
returns: bool
Recent Transactions
No transactions found for this address