Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 19725590 | 126 days ago | IN | 0 ETH | 0.05001348 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
EETHDepositHelper
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 9999 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.23; pragma abicoder v2; import {SafeERC20, IERC20, IERC20Permit} from "@oz/token/ERC20/utils/SafeERC20.sol"; import {IERC20Upgradeable} from "@ozu/token/ERC20/IERC20Upgradeable.sol"; import {ContextUpgradeable} from "@ozu/utils/ContextUpgradeable.sol"; import {LibPermit} from "@src/lib/Permit.sol"; import {Error} from "@src/lib/Error.sol"; import {IeETH, IweETH} from "@src/interfaces/EtherFi.sol"; import {ICCDMHost} from "@src/interfaces/ICCDMHost.sol"; import {IVault} from "@src/interfaces/vault/IVault.sol"; enum RemoteChainType { /// @dev 421_614 ArbitrumSepolia, /// @dev 111_55_420 OptimismSepolia, /// @dev 2_442 PolygonZkEvmCardona, /// @dev 919 ModeSepolia, /// @dev 3_441_006 MantaPacificSepolia, /// @dev 42_161 ArbitrumMainnet, /// @dev 10 OptimismMainnet, /// @dev 1_101 PolygonZkEvmMainnet, /// @dev 34_443 ModeMainnet, /// @dev 169 MantaPacificMainnet } /// @title EtherFi eETH Deposit / Redeem Helper /// @author Eddy <[email protected]> /// @notice implements deposit and redeem for eETH, This includes auto conversion between eETH <-> weETH /// @dev If you want to use permit, you need to load the permit argument in the function contract EETHDepositHelper is ContextUpgradeable { using LibPermit for bytes; using LibPermit for IERC20Permit; using SafeERC20 for IERC20; using SafeERC20 for IERC20Permit; IeETH private _eETH; IweETH private _weETH; constructor() initializer {} function initialize(IeETH eETH_, IweETH weETH_) public initializer { if (address(eETH_) == address(0)) revert Error.InvalidAddress("eETH"); if (address(weETH_) == address(0)) revert Error.InvalidAddress("weETH"); _eETH = eETH_; _weETH = weETH_; } // Modifiers modifier nonZero(uint256 amount) { if (amount <= 0) { revert Error.ZeroAmount(); } _; } // View functions function eETH() external view returns (IeETH) { return _eETH; } function weETH() external view returns (IweETH) { return _weETH; } function previewDepositTo( RemoteChainType chainType, address ccdm, address receiver, address refundTo, uint256 amount, uint256 baseFee ) public view nonZero(amount) returns (uint256) { return ICCDMHost(ccdm).previewDeposit( _convertChainToDomain(chainType), address(_eETH), receiver, refundTo, _weETH.getWeETHByeETH(amount), baseFee ); } function previewDepositWeEthTo( RemoteChainType chainType, address ccdm, address receiver, address refundTo, uint256 amount, uint256 baseFee ) public view nonZero(amount) returns (uint256) { return ICCDMHost(ccdm).previewDeposit( _convertChainToDomain(chainType), address(_weETH), receiver, refundTo, amount, baseFee ); } // External functions //=========== deposit eETH function deposit(uint256 amount, address vault) external nonZero(amount) { IERC20(_eETH).safeTransferFrom(_msgSender(), address(this), amount); _deposit(_wrap(amount), vault); } /// @dev deposit with permit function deposit(uint256 amount, address vault, bytes calldata permitData) external nonZero(amount) { { (uint256 deadline, uint8 v, bytes32 r, bytes32 s) = permitData.decodeData(); IERC20Permit(_eETH).trustlessPermit(_msgSender(), address(this), amount, deadline, v, r, s); IERC20(_eETH).safeTransferFrom(_msgSender(), address(this), amount); } _deposit(_wrap(amount), vault); } function depositTo(RemoteChainType remoteChain, address ccdm, uint256 amount) external payable nonZero(amount) { IERC20(_eETH).safeTransferFrom(_msgSender(), address(this), amount); _depositTo(remoteChain, ccdm, _wrap(amount), _msgSender(), _msgSender()); } /// @dev deposit with permit function depositTo(RemoteChainType remoteChain, address ccdm, uint256 amount, bytes calldata permitData) external payable nonZero(amount) { { (uint256 deadline, uint8 v, bytes32 r, bytes32 s) = permitData.decodeData(); IERC20Permit(_eETH).trustlessPermit(_msgSender(), address(this), amount, deadline, v, r, s); IERC20(_eETH).safeTransferFrom(_msgSender(), address(this), amount); } _depositTo(remoteChain, ccdm, _wrap(amount), _msgSender(), _msgSender()); } function depositTo(RemoteChainType remoteChain, address ccdm, uint256 amount, address receiver, address refundTo) external payable nonZero(amount) { IERC20(_eETH).safeTransferFrom(_msgSender(), address(this), amount); _depositTo(remoteChain, ccdm, _wrap(amount), receiver, refundTo); } /// @dev deposit with permit function depositTo( RemoteChainType remoteChain, address ccdm, uint256 amount, address receiver, address refundTo, bytes calldata permitData ) external payable nonZero(amount) { { (uint256 deadline, uint8 v, bytes32 r, bytes32 s) = permitData.decodeData(); IERC20Permit(_eETH).trustlessPermit(_msgSender(), address(this), amount, deadline, v, r, s); IERC20(_eETH).safeTransferFrom(_msgSender(), address(this), amount); } _depositTo(remoteChain, ccdm, _wrap(amount), receiver, refundTo); } //=========== deposit weETH function depositWeEth(uint256 amount, address vault) external nonZero(amount) { IERC20(_weETH).safeTransferFrom(_msgSender(), address(this), amount); _deposit(amount, vault); } /// @dev deposit with permit function depositWeEth(uint256 amount, address vault, bytes calldata permitData) external nonZero(amount) { { (uint256 deadline, uint8 v, bytes32 r, bytes32 s) = permitData.decodeData(); IERC20Permit(_weETH).trustlessPermit(_msgSender(), address(this), amount, deadline, v, r, s); IERC20(_weETH).safeTransferFrom(_msgSender(), address(this), amount); } _deposit(amount, vault); } function depositWeEthTo(RemoteChainType remoteChain, address ccdm, uint256 amount) external payable nonZero(amount) { IERC20(_weETH).safeTransferFrom(_msgSender(), address(this), amount); _depositTo(remoteChain, ccdm, amount, _msgSender(), _msgSender()); } function depositWeEthTo( RemoteChainType remoteChain, address ccdm, uint256 amount, address receiver, address refundTo ) external payable nonZero(amount) { IERC20(_weETH).safeTransferFrom(_msgSender(), address(this), amount); _depositTo(remoteChain, ccdm, amount, receiver, refundTo); } function depositWeEthTo(RemoteChainType remoteChain, address ccdm, uint256 amount, bytes calldata permitData) external payable nonZero(amount) { { (uint256 deadline, uint8 v, bytes32 r, bytes32 s) = permitData.decodeData(); IERC20Permit(_weETH).trustlessPermit(_msgSender(), address(this), amount, deadline, v, r, s); IERC20(_weETH).safeTransferFrom(_msgSender(), address(this), amount); } _depositTo(remoteChain, ccdm, amount, _msgSender(), _msgSender()); } function depositWeEthTo( RemoteChainType remoteChain, address ccdm, uint256 amount, address receiver, address refundTo, bytes calldata permitData ) external payable nonZero(amount) { { (uint256 deadline, uint8 v, bytes32 r, bytes32 s) = permitData.decodeData(); IERC20Permit(_weETH).trustlessPermit(_msgSender(), address(this), amount, deadline, v, r, s); IERC20(_weETH).safeTransferFrom(_msgSender(), address(this), amount); } _depositTo(remoteChain, ccdm, amount, receiver, refundTo); } //=========== redeem function redeem(uint256 amount, address vault) external nonZero(amount) { IERC20(vault).safeTransferFrom(_msgSender(), address(this), amount); _redeem(amount, vault); } /// @dev redeem with permit function redeem(uint256 amount, address vault, bytes calldata permitData) external nonZero(amount) { (uint256 deadline, uint8 v, bytes32 r, bytes32 s) = permitData.decodeData(); IERC20Permit(vault).trustlessPermit(_msgSender(), address(this), amount, deadline, v, r, s); IERC20(vault).safeTransferFrom(_msgSender(), address(this), amount); _redeem(amount, vault); } // Internal functions function _wrap(uint256 amount) internal returns (uint256) { IERC20(_eETH).forceApprove(address(_weETH), amount); uint256 weETHAmount = _weETH.wrap(amount); return weETHAmount; } function _convertChainToDomain(RemoteChainType remoteChain) internal pure returns (uint32) { if (remoteChain == RemoteChainType.ArbitrumMainnet) return 42_161; if (remoteChain == RemoteChainType.OptimismMainnet) return 10; if (remoteChain == RemoteChainType.PolygonZkEvmMainnet) return 1_101; if (remoteChain == RemoteChainType.ModeMainnet) return 34_443; if (remoteChain == RemoteChainType.MantaPacificMainnet) return 169; if (remoteChain == RemoteChainType.ArbitrumSepolia) return 421_614; if (remoteChain == RemoteChainType.OptimismSepolia) return 111_55_420; if (remoteChain == RemoteChainType.PolygonZkEvmCardona) return 2_442; if (remoteChain == RemoteChainType.ModeSepolia) return 919; if (remoteChain == RemoteChainType.MantaPacificSepolia) return 3_441_006; revert("EETHDepositHelper: invalid remote chain"); } function _deposit(uint256 amount, address vault) internal { uint256 aboutToSpend = IVault(vault).previewDeposit(amount); IERC20(_weETH).forceApprove(address(vault), aboutToSpend); IVault(vault).deposit(aboutToSpend, _msgSender()); } function _depositTo(RemoteChainType remoteChain, address ccdm, uint256 amount, address receiver, address refundTo) internal { IERC20(_weETH).forceApprove(ccdm, amount); uint32 domain = _convertChainToDomain(remoteChain); // precalculate gas needed uint256 gas = ICCDMHost(ccdm).previewDeposit(domain, address(_weETH), receiver, refundTo, amount, block.basefee); if (msg.value < gas) { unchecked { revert Error.InsufficientFee(gas - msg.value); } } // call ccdm.deposit ICCDMHost(ccdm).deposit{value: gas}(domain, address(_weETH), receiver, refundTo, amount); // refund remaining gas unchecked { uint256 refund = msg.value - gas; if (refund > 0) { (bool ok, bytes memory ret) = payable(_msgSender()).call{value: refund}(""); if (!ok) { revert Error.EthTransferFailed(refund, ret); } } } } function _redeem(uint256 amount, address vault) internal { IVault(vault).redeem(amount, _msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../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 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.encodeWithSelector(token.transfer.selector, 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.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 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); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @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.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @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, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @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.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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 amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` 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 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.23; pragma abicoder v2; import {IERC20} from "@oz/token/ERC20/IERC20.sol"; import {IERC20Permit} from "@oz/token/ERC20/extensions/IERC20Permit.sol"; library LibPermit { bytes32 private constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); bytes32 internal constant EIP712_DOMAIN_TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 domain,address verifyingContract)"); function decodeData(bytes calldata data) internal pure returns (uint256 deadline, uint8 v, bytes32 r, bytes32 s) { deadline = uint256(bytes32(data[0:32])); v = uint8(data[32]); r = bytes32(data[33:65]); s = bytes32(data[65:97]); return (deadline, v, r, s); } function encodeData(uint256 deadline, uint8 v, bytes32 r, bytes32 s) internal pure returns (bytes memory) { return abi.encodePacked(deadline, v, r, s); } function trustlessPermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { // Try permit() before allowance check to advance nonce if possible try token.permit(owner, spender, value, deadline, v, r, s) { return; } catch { // Permit potentially got frontran. Continue anyways if allowance is sufficient. if (IERC20(address(token)).allowance(owner, spender) >= value) { return; } } revert("Permit failure"); } function makeDomainSeparator(string memory name, string memory version, uint256 _domain, address _contract) internal pure returns (bytes32) { return keccak256(abi.encode(EIP712_DOMAIN_TYPE_HASH, name, version, _domain, _contract)); } function makeStructHash(address _owner, address _spender, uint256 _value, uint256 _nonce, uint256 _deadline) internal pure returns (bytes32) { return keccak256(abi.encode(PERMIT_TYPEHASH, _owner, _spender, _value, _nonce, _deadline)); } function toTypedDataHashByAssembly(bytes32 _domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) { assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), _domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } function toTypedDataHash(bytes32 _domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", _domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.23; pragma abicoder v2; library Error { error Halted(); error Unauthorized(); error AssetNotSupportedForCrossChainDeposit(uint32 domain, address asset); error InsufficientCap(); error InsufficientFee(uint256 lack); error InsufficientLoad(); error InsufficientResolvedRedeem(uint256 left); error InsufficientBalance(uint256 left); error InvalidDomain(uint32 domain); error InvalidEpoch(string reason); error InvalidDepositRequest(string reason); error InvalidMsgLength(uint256 expected, uint256 actual); error InvalidMsgType(uint8 msgType); error InvalidVaultType(uint8 vaultType); error InvalidAddress(string typ); error InvalidThreshold(string typ); error VaultAlreadyDisconnected(address vault); error VaultAlreadyExists(address vault); error DeploymentFailed(string reason); error EthTransferFailed(uint256 amount, bytes ret); error BridgeNotOperational(uint32 domain); error ZeroAmount(); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.23; pragma abicoder v2; import {IERC20} from "@oz/token/ERC20/IERC20.sol"; import {IERC20Permit} from "@oz/token/ERC20/extensions/IERC20Permit.sol"; interface ILiquidityPool { struct PermitInput { uint256 value; uint256 deadline; uint8 v; bytes32 r; bytes32 s; } } interface IRateProvider { function getRate() external view returns (uint256); } interface IeETH is IERC20, IERC20Permit { function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalShares() external view returns (uint256); function shares(address _user) external view returns (uint256); function balanceOf(address _user) external view returns (uint256); function initialize(address _liquidityPool) external; function mintShares(address _user, uint256 _share) external; function burnShares(address _user, uint256 _share) external; function transferFrom(address _sender, address _recipient, uint256 _amount) external returns (bool); function transfer(address _recipient, uint256 _amount) external returns (bool); function approve(address _spender, uint256 _amount) external returns (bool); function increaseAllowance(address _spender, uint256 _increaseAmount) external returns (bool); function decreaseAllowance(address _spender, uint256 _decreaseAmount) external returns (bool); } interface IweETH is IRateProvider, IERC20, IERC20Permit { /// @notice Wraps eEth /// @param _eETHAmount the amount of eEth to wrap /// @return returns the amount of weEth the user receives function wrap(uint256 _eETHAmount) external returns (uint256); /// @notice Wraps eEth with PermitInput struct so user does not have to call approve on eeth contract /// @param _eETHAmount the amount of eEth to wrap /// @return returns the amount of weEth the user receives function wrapWithPermit(uint256 _eETHAmount, ILiquidityPool.PermitInput calldata _permit) external returns (uint256); /// @notice Unwraps weETH /// @param _weETHAmount the amount of weETH to unwrap /// @return returns the amount of eEth the user receives function unwrap(uint256 _weETHAmount) external returns (uint256); /// @notice Fetches the amount of weEth respective to the amount of eEth sent in /// @param _eETHAmount amount sent in /// @return The total number of shares for the specified amount function getWeETHByeETH(uint256 _eETHAmount) external view returns (uint256); /// @notice Fetches the amount of eEth respective to the amount of weEth sent in /// @param _weETHAmount amount sent in /// @return The total amount for the number of shares sent in function getEETHByWeETH(uint256 _weETHAmount) external view returns (uint256); function increaseAllowance(address _spender, uint256 _increaseAmount) external returns (bool); function decreaseAllowance(address _spender, uint256 _decreaseAmount) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.23; pragma abicoder v2; interface ICCDMHost { function previewDeposit( uint32 domain, address token, address receiver, address refundTo, uint256 amount, uint256 baseFee ) external view returns (uint256); function deposit(uint32 domain, address token, address receiver, address refundTo, uint256 amount) external payable; function deposit( uint32 domain, address token, address receiver, address refundTo, uint256 amount, bytes calldata permitData ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.23; pragma abicoder v2; import {IERC20Upgradeable} from "@ozu/token/ERC20/IERC20Upgradeable.sol"; enum Action { Deposit, Redeem, Mint, Burn, Transfer } enum VaultType { Basic, Rebased } interface IVault is IERC20Upgradeable { function vaultType() external view returns (VaultType); function isHalted(Action action) external view returns (bool); function previewDeposit(uint256 amount) external view returns (uint256); function previewRedeem(uint256 amount) external view returns (uint256); function deposit(uint256 amount, address receiver) external; function redeem(uint256 amount, address receiver) external; function halt(Action action) external; function resume(Action action) external; } interface ISudoVault is IVault { function manualDeposit(uint256 amount, address receiver) external returns (uint256); function manualRedeem(uint256 amount, address receiver) external returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @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 amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` 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 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @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. */ 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]. */ 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @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.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @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, it is bubbled up by this * function (like regular Solidity function calls). * * 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. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @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`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @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.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @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, it is bubbled up by this * function (like regular Solidity function calls). * * 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. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @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`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage); } } }
{ "remappings": [ "@src/=src/", "@script/=script/", "@test/=test/", "@std/=lib/forge-std/src/", "@solmate/=lib/solmate/src/", "@hpl/=node_modules/@hyperlane-xyz/core/contracts/", "@openzeppelin/=node_modules/@openzeppelin/", "@oz/=node_modules/@openzeppelin/contracts/", "@ozu/=node_modules/@openzeppelin/contracts-upgradeable/", "@eth-optimism/=node_modules/@eth-optimism/", "@hyperlane-xyz/=node_modules/@hyperlane-xyz/", "ds-test/=lib/forge-std/lib/ds-test/src/", "eth-gas-reporter/=node_modules/eth-gas-reporter/", "forge-std/=lib/forge-std/src/", "hardhat/=node_modules/hardhat/", "solmate/=lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 9999 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"ret","type":"bytes"}],"name":"EthTransferFailed","type":"error"},{"inputs":[{"internalType":"uint256","name":"lack","type":"uint256"}],"name":"InsufficientFee","type":"error"},{"inputs":[{"internalType":"string","name":"typ","type":"string"}],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"ZeroAmount","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"vault","type":"address"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"vault","type":"address"},{"internalType":"bytes","name":"permitData","type":"bytes"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum RemoteChainType","name":"remoteChain","type":"uint8"},{"internalType":"address","name":"ccdm","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bytes","name":"permitData","type":"bytes"}],"name":"depositTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"enum RemoteChainType","name":"remoteChain","type":"uint8"},{"internalType":"address","name":"ccdm","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"permitData","type":"bytes"}],"name":"depositTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"enum RemoteChainType","name":"remoteChain","type":"uint8"},{"internalType":"address","name":"ccdm","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"enum RemoteChainType","name":"remoteChain","type":"uint8"},{"internalType":"address","name":"ccdm","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"refundTo","type":"address"}],"name":"depositTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"vault","type":"address"}],"name":"depositWeEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"vault","type":"address"},{"internalType":"bytes","name":"permitData","type":"bytes"}],"name":"depositWeEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum RemoteChainType","name":"remoteChain","type":"uint8"},{"internalType":"address","name":"ccdm","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bytes","name":"permitData","type":"bytes"}],"name":"depositWeEthTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"enum RemoteChainType","name":"remoteChain","type":"uint8"},{"internalType":"address","name":"ccdm","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositWeEthTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"enum RemoteChainType","name":"remoteChain","type":"uint8"},{"internalType":"address","name":"ccdm","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"permitData","type":"bytes"}],"name":"depositWeEthTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"enum RemoteChainType","name":"remoteChain","type":"uint8"},{"internalType":"address","name":"ccdm","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"refundTo","type":"address"}],"name":"depositWeEthTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"eETH","outputs":[{"internalType":"contract IeETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IeETH","name":"eETH_","type":"address"},{"internalType":"contract IweETH","name":"weETH_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum RemoteChainType","name":"chainType","type":"uint8"},{"internalType":"address","name":"ccdm","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"baseFee","type":"uint256"}],"name":"previewDepositTo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum RemoteChainType","name":"chainType","type":"uint8"},{"internalType":"address","name":"ccdm","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"baseFee","type":"uint256"}],"name":"previewDepositWeEthTo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"vault","type":"address"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"vault","type":"address"},{"internalType":"bytes","name":"permitData","type":"bytes"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weETH","outputs":[{"internalType":"contract IweETH","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b50600054610100900460ff1615808015620000335750600054600160ff909116105b806200004f5750303b1580156200004f575060005460ff166001145b620000b75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff191660011790558015620000db576000805461ff0019166101001790555b801562000122576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5061213b80620001336000396000f3fe6080604052600436106101445760003560e01c806381d8d544116100c0578063c72bf7a511610074578063d9fe48ee11610059578063d9fe48ee14610320578063e39cabc514610333578063faa9bce91461034657600080fd5b8063c72bf7a5146102e2578063d855ef781461030057600080fd5b80638491dced116100a55780638491dced146102a9578063ab31bdac146102bc578063c4a43a60146102cf57600080fd5b806381d8d54414610276578063836519901461028957600080fd5b8063485cc955116101175780636e553f65116100fc5780636e553f65146102165780637bde82f2146102365780637f6a604a1461025657600080fd5b8063485cc955146101e35780636d7783aa1461020357600080fd5b80630de371e214610149578063267af66d146101805780632e325e04146101ae57806338116ba9146101c3575b600080fd5b34801561015557600080fd5b506033546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561018c57600080fd5b506101a061019b366004611c35565b610366565b604051908152602001610177565b6101c16101bc366004611cea565b61045c565b005b3480156101cf57600080fd5b506101a06101de366004611c35565b6104f3565b3480156101ef57600080fd5b506101c16101fe366004611d80565b61062d565b6101c1610211366004611cea565b6108e8565b34801561022257600080fd5b506101c1610231366004611db9565b61096d565b34801561024257600080fd5b506101c1610251366004611db9565b6109b9565b34801561026257600080fd5b506101c1610271366004611db9565b6109fa565b6101c1610284366004611dde565b610a3e565b34801561029557600080fd5b506101c16102a4366004611e4f565b610ad4565b6101c16102b7366004611eab565b610b5d565b6101c16102ca366004611eab565b610bab565b6101c16102dd366004611dde565b610bf1565b3480156102ee57600080fd5b506034546001600160a01b0316610163565b34801561030c57600080fd5b506101c161031b366004611e4f565b610c76565b6101c161032e366004611eea565b610cfa565b6101c1610341366004611eea565b610d49565b34801561035257600080fd5b506101c1610361366004611e4f565b610d90565b6000826000811161038a57604051631f2a200560e01b815260040160405180910390fd5b866001600160a01b031663e9d5353d6103a28a610e1a565b60345460405160e084901b7fffffffff0000000000000000000000000000000000000000000000000000000016815263ffffffff90921660048301526001600160a01b0390811660248301528981166044830152881660648201526084810187905260a4810186905260c4015b602060405180830381865afa15801561042c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104509190611f50565b98975050505050505050565b846000811161047e57604051631f2a200560e01b815260040160405180910390fd5b60008060008061048e8787610ff9565b93509350935093506104b86104a03390565b6033546001600160a01b031690308d88888888611070565b6104d0336033546001600160a01b031690308d61120e565b505050506104e988886104e2896112dd565b888861138d565b5050505050505050565b6000826000811161051757604051631f2a200560e01b815260040160405180910390fd5b866001600160a01b031663e9d5353d61052f8a610e1a565b6033546034546040517fd044fe9b000000000000000000000000000000000000000000000000000000008152600481018a90526001600160a01b03928316928c928c9291169063d044fe9b90602401602060405180830381865afa15801561059b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105bf9190611f50565b60405160e087901b7fffffffff0000000000000000000000000000000000000000000000000000000016815263ffffffff9590951660048601526001600160a01b03938416602486015291831660448501529091166064830152608482015260a4810186905260c40161040f565b600054610100900460ff161580801561064d5750600054600160ff909116105b806106675750303b158015610667575060005460ff166001145b6106f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561075657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6001600160a01b0383166107c8576040517f161eb5420000000000000000000000000000000000000000000000000000000081526004016106ef9060208082526004908201527f6545544800000000000000000000000000000000000000000000000000000000604082015260600190565b6001600160a01b038216610838576040517f161eb54200000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f776545544800000000000000000000000000000000000000000000000000000060448201526064016106ef565b603380546001600160a01b038086167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617909255603480549285169290911691909117905580156108e357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b846000811161090a57604051631f2a200560e01b815260040160405180910390fd5b60008060008061091a8787610ff9565b935093509350935061094461092c3390565b6034546001600160a01b031690308d88888888611070565b61095c336034546001600160a01b031690308d61120e565b505050506104e9888888888861138d565b816000811161098f57604051631f2a200560e01b815260040160405180910390fd5b6109a7336033546001600160a01b031690308661120e565b6108e36109b3846112dd565b836115e3565b81600081116109db57604051631f2a200560e01b815260040160405180910390fd5b6109f06001600160a01b03831633308661120e565b6108e3838361170f565b8160008111610a1c57604051631f2a200560e01b815260040160405180910390fd5b610a34336034546001600160a01b031690308661120e565b6108e383836115e3565b8260008111610a6057604051631f2a200560e01b815260040160405180910390fd5b600080600080610a708787610ff9565b9350935093509350610a9a610a823390565b6033546001600160a01b031690308b88888888611070565b610ab2336033546001600160a01b031690308b61120e565b50505050610acc8686610ac4876112dd565b335b3361138d565b505050505050565b8360008111610af657604051631f2a200560e01b815260040160405180910390fd5b600080600080610b068787610ff9565b9350935093509350610b30610b183390565b6034546001600160a01b031690308c88888888611070565b610b48336034546001600160a01b031690308c61120e565b50505050610b5685856115e3565b5050505050565b8060008111610b7f57604051631f2a200560e01b815260040160405180910390fd5b610b97336033546001600160a01b031690308561120e565b610ba58484610ac4856112dd565b50505050565b8060008111610bcd57604051631f2a200560e01b815260040160405180910390fd5b610be5336034546001600160a01b031690308561120e565b610ba584848433610ac6565b8260008111610c1357604051631f2a200560e01b815260040160405180910390fd5b600080600080610c238787610ff9565b9350935093509350610c4d610c353390565b6034546001600160a01b031690308b88888888611070565b610c65336034546001600160a01b031690308b61120e565b50505050610acc868686610ac63390565b8360008111610c9857604051631f2a200560e01b815260040160405180910390fd5b600080600080610ca88787610ff9565b9350935093509350610cd0610cba3390565b6001600160a01b038a1690308c88888888611070565b610ce56001600160a01b03891633308c61120e565b610cef898961170f565b505050505050505050565b8260008111610d1c57604051631f2a200560e01b815260040160405180910390fd5b610d34336033546001600160a01b031690308761120e565b610acc8686610d42876112dd565b868661138d565b8260008111610d6b57604051631f2a200560e01b815260040160405180910390fd5b610d83336034546001600160a01b031690308761120e565b610acc868686868661138d565b8360008111610db257604051631f2a200560e01b815260040160405180910390fd5b600080600080610dc28787610ff9565b9350935093509350610dec610dd43390565b6033546001600160a01b031690308c88888888611070565b610e04336033546001600160a01b031690308c61120e565b50505050610b56610e14866112dd565b856115e3565b60006005826009811115610e3057610e30611f69565b03610e3e575061a4b1919050565b6006826009811115610e5257610e52611f69565b03610e5f5750600a919050565b6007826009811115610e7357610e73611f69565b03610e81575061044d919050565b6008826009811115610e9557610e95611f69565b03610ea3575061868b919050565b6009826009811115610eb757610eb7611f69565b03610ec4575060a9919050565b6000826009811115610ed857610ed8611f69565b03610ee7575062066eee919050565b6001826009811115610efb57610efb611f69565b03610f0a575062aa37dc919050565b6002826009811115610f1e57610f1e611f69565b03610f2c575061098a919050565b6003826009811115610f4057610f40611f69565b03610f4e5750610397919050565b6004826009811115610f6257610f62611f69565b03610f7157506234816e919050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f454554484465706f73697448656c7065723a20696e76616c69642072656d6f7460448201527f6520636861696e0000000000000000000000000000000000000000000000000060648201526084016106ef565b600080808061100b6020828789611f98565b61101491611fc2565b93508585602081811061102957611029611ffe565b919091013560f81c93506110439050604160218789611f98565b61104c91611fc2565b915061105c606160418789611f98565b61106591611fc2565b905092959194509250565b6040517fd505accf0000000000000000000000000000000000000000000000000000000081526001600160a01b0388811660048301528781166024830152604482018790526064820186905260ff8516608483015260a4820184905260c4820183905289169063d505accf9060e401600060405180830381600087803b1580156110f957600080fd5b505af192505050801561110a575060015b6111a7576040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015287811660248301528691908a169063dd62ed3e90604401602060405180830381865afa158015611178573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119c9190611f50565b10156104e9576111ac565b6104e9565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f5065726d6974206661696c75726500000000000000000000000000000000000060448201526064016106ef565b6040516001600160a01b0380851660248301528316604482015260648101829052610ba59085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611793565b6034546033546000916112fd916001600160a01b03908116911684611895565b6034546040517fea598cb0000000000000000000000000000000000000000000000000000000008152600481018490526000916001600160a01b03169063ea598cb0906024016020604051808303816000875af1158015611362573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113869190611f50565b9392505050565b6034546113a4906001600160a01b03168585611895565b60006113af86610e1a565b6034546040517fe9d5353d00000000000000000000000000000000000000000000000000000000815263ffffffff831660048201526001600160a01b03918216602482015285821660448201528482166064820152608481018790524860a48201529192506000919087169063e9d5353d9060c401602060405180830381865afa158015611441573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114659190611f50565b9050803410156114a5576040517f4c4e635c00000000000000000000000000000000000000000000000000000000815234820360048201526024016106ef565b6034546040517f0f78384500000000000000000000000000000000000000000000000000000000815263ffffffff841660048201526001600160a01b039182166024820152858216604482015284821660648201526084810187905290871690630f78384590839060a4016000604051808303818588803b15801561152957600080fd5b505af115801561153d573d6000803e3d6000fd5b505050348381039250831490506104e9576040516000908190339084908381818185875af1925050503d8060008114611592576040519150601f19603f3d011682016040523d82523d6000602084013e611597565b606091505b5091509150816115d75782816040517f71de65d90000000000000000000000000000000000000000000000000000000081526004016106ef92919061209b565b50505050505050505050565b6040517fef8b30f7000000000000000000000000000000000000000000000000000000008152600481018390526000906001600160a01b0383169063ef8b30f790602401602060405180830381865afa158015611644573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116689190611f50565b603454909150611682906001600160a01b03168383611895565b6001600160a01b038216636e553f6582336040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526001600160a01b03166024820152604401600060405180830381600087803b1580156116f257600080fd5b505af1158015611706573d6000803e3d6000fd5b50505050505050565b6001600160a01b038116637bde82f283336040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526001600160a01b03166024820152604401600060405180830381600087803b15801561177f57600080fd5b505af1158015610acc573d6000803e3d6000fd5b60006117e8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661196b9092919063ffffffff16565b905080516000148061180957508080602001905181019061180991906120b4565b6108e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016106ef565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790526119148482611982565b610ba5576040516001600160a01b0384166024820152600060448201526119619085907f095ea7b3000000000000000000000000000000000000000000000000000000009060640161125b565b610ba58482611793565b606061197a8484600085611a2b565b949350505050565b6000806000846001600160a01b03168460405161199f91906120d6565b6000604051808303816000865af19150503d80600081146119dc576040519150601f19603f3d011682016040523d82523d6000602084013e6119e1565b606091505b5091509150818015611a0b575080511580611a0b575080806020019051810190611a0b91906120b4565b8015611a2057506001600160a01b0385163b15155b925050505b92915050565b606082471015611abd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016106ef565b600080866001600160a01b03168587604051611ad991906120d6565b60006040518083038185875af1925050503d8060008114611b16576040519150601f19603f3d011682016040523d82523d6000602084013e611b1b565b606091505b5091509150611b2c87838387611b37565b979650505050505050565b60608315611bc0578251600003611bb9576001600160a01b0385163b611bb9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106ef565b508161197a565b61197a8383815115611bd55781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ef91906120f2565b8035600a8110611c1857600080fd5b919050565b6001600160a01b0381168114611c3257600080fd5b50565b60008060008060008060c08789031215611c4e57600080fd5b611c5787611c09565b95506020870135611c6781611c1d565b94506040870135611c7781611c1d565b93506060870135611c8781611c1d565b9598949750929560808101359460a0909101359350915050565b60008083601f840112611cb357600080fd5b50813567ffffffffffffffff811115611ccb57600080fd5b602083019150836020828501011115611ce357600080fd5b9250929050565b600080600080600080600060c0888a031215611d0557600080fd5b611d0e88611c09565b96506020880135611d1e81611c1d565b9550604088013594506060880135611d3581611c1d565b93506080880135611d4581611c1d565b925060a088013567ffffffffffffffff811115611d6157600080fd5b611d6d8a828b01611ca1565b989b979a50959850939692959293505050565b60008060408385031215611d9357600080fd5b8235611d9e81611c1d565b91506020830135611dae81611c1d565b809150509250929050565b60008060408385031215611dcc57600080fd5b823591506020830135611dae81611c1d565b600080600080600060808688031215611df657600080fd5b611dff86611c09565b94506020860135611e0f81611c1d565b935060408601359250606086013567ffffffffffffffff811115611e3257600080fd5b611e3e88828901611ca1565b969995985093965092949392505050565b60008060008060608587031215611e6557600080fd5b843593506020850135611e7781611c1d565b9250604085013567ffffffffffffffff811115611e9357600080fd5b611e9f87828801611ca1565b95989497509550505050565b600080600060608486031215611ec057600080fd5b611ec984611c09565b92506020840135611ed981611c1d565b929592945050506040919091013590565b600080600080600060a08688031215611f0257600080fd5b611f0b86611c09565b94506020860135611f1b81611c1d565b9350604086013592506060860135611f3281611c1d565b91506080860135611f4281611c1d565b809150509295509295909350565b600060208284031215611f6257600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60008085851115611fa857600080fd5b83861115611fb557600080fd5b5050820193919092039150565b80356020831015611a25577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60005b83811015612048578181015183820152602001612030565b50506000910152565b6000815180845261206981602086016020860161202d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b82815260406020820152600061197a6040830184612051565b6000602082840312156120c657600080fd5b8151801515811461138657600080fd5b600082516120e881846020870161202d565b9190910192915050565b602081526000611386602083018461205156fea2646970667358221220a7c902918aebd3a33e06d519acb6d72c1818f3d75480787bb08f5aa50af9ce2764736f6c63430008170033
Deployed Bytecode
0x6080604052600436106101445760003560e01c806381d8d544116100c0578063c72bf7a511610074578063d9fe48ee11610059578063d9fe48ee14610320578063e39cabc514610333578063faa9bce91461034657600080fd5b8063c72bf7a5146102e2578063d855ef781461030057600080fd5b80638491dced116100a55780638491dced146102a9578063ab31bdac146102bc578063c4a43a60146102cf57600080fd5b806381d8d54414610276578063836519901461028957600080fd5b8063485cc955116101175780636e553f65116100fc5780636e553f65146102165780637bde82f2146102365780637f6a604a1461025657600080fd5b8063485cc955146101e35780636d7783aa1461020357600080fd5b80630de371e214610149578063267af66d146101805780632e325e04146101ae57806338116ba9146101c3575b600080fd5b34801561015557600080fd5b506033546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561018c57600080fd5b506101a061019b366004611c35565b610366565b604051908152602001610177565b6101c16101bc366004611cea565b61045c565b005b3480156101cf57600080fd5b506101a06101de366004611c35565b6104f3565b3480156101ef57600080fd5b506101c16101fe366004611d80565b61062d565b6101c1610211366004611cea565b6108e8565b34801561022257600080fd5b506101c1610231366004611db9565b61096d565b34801561024257600080fd5b506101c1610251366004611db9565b6109b9565b34801561026257600080fd5b506101c1610271366004611db9565b6109fa565b6101c1610284366004611dde565b610a3e565b34801561029557600080fd5b506101c16102a4366004611e4f565b610ad4565b6101c16102b7366004611eab565b610b5d565b6101c16102ca366004611eab565b610bab565b6101c16102dd366004611dde565b610bf1565b3480156102ee57600080fd5b506034546001600160a01b0316610163565b34801561030c57600080fd5b506101c161031b366004611e4f565b610c76565b6101c161032e366004611eea565b610cfa565b6101c1610341366004611eea565b610d49565b34801561035257600080fd5b506101c1610361366004611e4f565b610d90565b6000826000811161038a57604051631f2a200560e01b815260040160405180910390fd5b866001600160a01b031663e9d5353d6103a28a610e1a565b60345460405160e084901b7fffffffff0000000000000000000000000000000000000000000000000000000016815263ffffffff90921660048301526001600160a01b0390811660248301528981166044830152881660648201526084810187905260a4810186905260c4015b602060405180830381865afa15801561042c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104509190611f50565b98975050505050505050565b846000811161047e57604051631f2a200560e01b815260040160405180910390fd5b60008060008061048e8787610ff9565b93509350935093506104b86104a03390565b6033546001600160a01b031690308d88888888611070565b6104d0336033546001600160a01b031690308d61120e565b505050506104e988886104e2896112dd565b888861138d565b5050505050505050565b6000826000811161051757604051631f2a200560e01b815260040160405180910390fd5b866001600160a01b031663e9d5353d61052f8a610e1a565b6033546034546040517fd044fe9b000000000000000000000000000000000000000000000000000000008152600481018a90526001600160a01b03928316928c928c9291169063d044fe9b90602401602060405180830381865afa15801561059b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105bf9190611f50565b60405160e087901b7fffffffff0000000000000000000000000000000000000000000000000000000016815263ffffffff9590951660048601526001600160a01b03938416602486015291831660448501529091166064830152608482015260a4810186905260c40161040f565b600054610100900460ff161580801561064d5750600054600160ff909116105b806106675750303b158015610667575060005460ff166001145b6106f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561075657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6001600160a01b0383166107c8576040517f161eb5420000000000000000000000000000000000000000000000000000000081526004016106ef9060208082526004908201527f6545544800000000000000000000000000000000000000000000000000000000604082015260600190565b6001600160a01b038216610838576040517f161eb54200000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f776545544800000000000000000000000000000000000000000000000000000060448201526064016106ef565b603380546001600160a01b038086167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617909255603480549285169290911691909117905580156108e357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b846000811161090a57604051631f2a200560e01b815260040160405180910390fd5b60008060008061091a8787610ff9565b935093509350935061094461092c3390565b6034546001600160a01b031690308d88888888611070565b61095c336034546001600160a01b031690308d61120e565b505050506104e9888888888861138d565b816000811161098f57604051631f2a200560e01b815260040160405180910390fd5b6109a7336033546001600160a01b031690308661120e565b6108e36109b3846112dd565b836115e3565b81600081116109db57604051631f2a200560e01b815260040160405180910390fd5b6109f06001600160a01b03831633308661120e565b6108e3838361170f565b8160008111610a1c57604051631f2a200560e01b815260040160405180910390fd5b610a34336034546001600160a01b031690308661120e565b6108e383836115e3565b8260008111610a6057604051631f2a200560e01b815260040160405180910390fd5b600080600080610a708787610ff9565b9350935093509350610a9a610a823390565b6033546001600160a01b031690308b88888888611070565b610ab2336033546001600160a01b031690308b61120e565b50505050610acc8686610ac4876112dd565b335b3361138d565b505050505050565b8360008111610af657604051631f2a200560e01b815260040160405180910390fd5b600080600080610b068787610ff9565b9350935093509350610b30610b183390565b6034546001600160a01b031690308c88888888611070565b610b48336034546001600160a01b031690308c61120e565b50505050610b5685856115e3565b5050505050565b8060008111610b7f57604051631f2a200560e01b815260040160405180910390fd5b610b97336033546001600160a01b031690308561120e565b610ba58484610ac4856112dd565b50505050565b8060008111610bcd57604051631f2a200560e01b815260040160405180910390fd5b610be5336034546001600160a01b031690308561120e565b610ba584848433610ac6565b8260008111610c1357604051631f2a200560e01b815260040160405180910390fd5b600080600080610c238787610ff9565b9350935093509350610c4d610c353390565b6034546001600160a01b031690308b88888888611070565b610c65336034546001600160a01b031690308b61120e565b50505050610acc868686610ac63390565b8360008111610c9857604051631f2a200560e01b815260040160405180910390fd5b600080600080610ca88787610ff9565b9350935093509350610cd0610cba3390565b6001600160a01b038a1690308c88888888611070565b610ce56001600160a01b03891633308c61120e565b610cef898961170f565b505050505050505050565b8260008111610d1c57604051631f2a200560e01b815260040160405180910390fd5b610d34336033546001600160a01b031690308761120e565b610acc8686610d42876112dd565b868661138d565b8260008111610d6b57604051631f2a200560e01b815260040160405180910390fd5b610d83336034546001600160a01b031690308761120e565b610acc868686868661138d565b8360008111610db257604051631f2a200560e01b815260040160405180910390fd5b600080600080610dc28787610ff9565b9350935093509350610dec610dd43390565b6033546001600160a01b031690308c88888888611070565b610e04336033546001600160a01b031690308c61120e565b50505050610b56610e14866112dd565b856115e3565b60006005826009811115610e3057610e30611f69565b03610e3e575061a4b1919050565b6006826009811115610e5257610e52611f69565b03610e5f5750600a919050565b6007826009811115610e7357610e73611f69565b03610e81575061044d919050565b6008826009811115610e9557610e95611f69565b03610ea3575061868b919050565b6009826009811115610eb757610eb7611f69565b03610ec4575060a9919050565b6000826009811115610ed857610ed8611f69565b03610ee7575062066eee919050565b6001826009811115610efb57610efb611f69565b03610f0a575062aa37dc919050565b6002826009811115610f1e57610f1e611f69565b03610f2c575061098a919050565b6003826009811115610f4057610f40611f69565b03610f4e5750610397919050565b6004826009811115610f6257610f62611f69565b03610f7157506234816e919050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f454554484465706f73697448656c7065723a20696e76616c69642072656d6f7460448201527f6520636861696e0000000000000000000000000000000000000000000000000060648201526084016106ef565b600080808061100b6020828789611f98565b61101491611fc2565b93508585602081811061102957611029611ffe565b919091013560f81c93506110439050604160218789611f98565b61104c91611fc2565b915061105c606160418789611f98565b61106591611fc2565b905092959194509250565b6040517fd505accf0000000000000000000000000000000000000000000000000000000081526001600160a01b0388811660048301528781166024830152604482018790526064820186905260ff8516608483015260a4820184905260c4820183905289169063d505accf9060e401600060405180830381600087803b1580156110f957600080fd5b505af192505050801561110a575060015b6111a7576040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015287811660248301528691908a169063dd62ed3e90604401602060405180830381865afa158015611178573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119c9190611f50565b10156104e9576111ac565b6104e9565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f5065726d6974206661696c75726500000000000000000000000000000000000060448201526064016106ef565b6040516001600160a01b0380851660248301528316604482015260648101829052610ba59085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611793565b6034546033546000916112fd916001600160a01b03908116911684611895565b6034546040517fea598cb0000000000000000000000000000000000000000000000000000000008152600481018490526000916001600160a01b03169063ea598cb0906024016020604051808303816000875af1158015611362573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113869190611f50565b9392505050565b6034546113a4906001600160a01b03168585611895565b60006113af86610e1a565b6034546040517fe9d5353d00000000000000000000000000000000000000000000000000000000815263ffffffff831660048201526001600160a01b03918216602482015285821660448201528482166064820152608481018790524860a48201529192506000919087169063e9d5353d9060c401602060405180830381865afa158015611441573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114659190611f50565b9050803410156114a5576040517f4c4e635c00000000000000000000000000000000000000000000000000000000815234820360048201526024016106ef565b6034546040517f0f78384500000000000000000000000000000000000000000000000000000000815263ffffffff841660048201526001600160a01b039182166024820152858216604482015284821660648201526084810187905290871690630f78384590839060a4016000604051808303818588803b15801561152957600080fd5b505af115801561153d573d6000803e3d6000fd5b505050348381039250831490506104e9576040516000908190339084908381818185875af1925050503d8060008114611592576040519150601f19603f3d011682016040523d82523d6000602084013e611597565b606091505b5091509150816115d75782816040517f71de65d90000000000000000000000000000000000000000000000000000000081526004016106ef92919061209b565b50505050505050505050565b6040517fef8b30f7000000000000000000000000000000000000000000000000000000008152600481018390526000906001600160a01b0383169063ef8b30f790602401602060405180830381865afa158015611644573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116689190611f50565b603454909150611682906001600160a01b03168383611895565b6001600160a01b038216636e553f6582336040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526001600160a01b03166024820152604401600060405180830381600087803b1580156116f257600080fd5b505af1158015611706573d6000803e3d6000fd5b50505050505050565b6001600160a01b038116637bde82f283336040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526001600160a01b03166024820152604401600060405180830381600087803b15801561177f57600080fd5b505af1158015610acc573d6000803e3d6000fd5b60006117e8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661196b9092919063ffffffff16565b905080516000148061180957508080602001905181019061180991906120b4565b6108e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016106ef565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790526119148482611982565b610ba5576040516001600160a01b0384166024820152600060448201526119619085907f095ea7b3000000000000000000000000000000000000000000000000000000009060640161125b565b610ba58482611793565b606061197a8484600085611a2b565b949350505050565b6000806000846001600160a01b03168460405161199f91906120d6565b6000604051808303816000865af19150503d80600081146119dc576040519150601f19603f3d011682016040523d82523d6000602084013e6119e1565b606091505b5091509150818015611a0b575080511580611a0b575080806020019051810190611a0b91906120b4565b8015611a2057506001600160a01b0385163b15155b925050505b92915050565b606082471015611abd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016106ef565b600080866001600160a01b03168587604051611ad991906120d6565b60006040518083038185875af1925050503d8060008114611b16576040519150601f19603f3d011682016040523d82523d6000602084013e611b1b565b606091505b5091509150611b2c87838387611b37565b979650505050505050565b60608315611bc0578251600003611bb9576001600160a01b0385163b611bb9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106ef565b508161197a565b61197a8383815115611bd55781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ef91906120f2565b8035600a8110611c1857600080fd5b919050565b6001600160a01b0381168114611c3257600080fd5b50565b60008060008060008060c08789031215611c4e57600080fd5b611c5787611c09565b95506020870135611c6781611c1d565b94506040870135611c7781611c1d565b93506060870135611c8781611c1d565b9598949750929560808101359460a0909101359350915050565b60008083601f840112611cb357600080fd5b50813567ffffffffffffffff811115611ccb57600080fd5b602083019150836020828501011115611ce357600080fd5b9250929050565b600080600080600080600060c0888a031215611d0557600080fd5b611d0e88611c09565b96506020880135611d1e81611c1d565b9550604088013594506060880135611d3581611c1d565b93506080880135611d4581611c1d565b925060a088013567ffffffffffffffff811115611d6157600080fd5b611d6d8a828b01611ca1565b989b979a50959850939692959293505050565b60008060408385031215611d9357600080fd5b8235611d9e81611c1d565b91506020830135611dae81611c1d565b809150509250929050565b60008060408385031215611dcc57600080fd5b823591506020830135611dae81611c1d565b600080600080600060808688031215611df657600080fd5b611dff86611c09565b94506020860135611e0f81611c1d565b935060408601359250606086013567ffffffffffffffff811115611e3257600080fd5b611e3e88828901611ca1565b969995985093965092949392505050565b60008060008060608587031215611e6557600080fd5b843593506020850135611e7781611c1d565b9250604085013567ffffffffffffffff811115611e9357600080fd5b611e9f87828801611ca1565b95989497509550505050565b600080600060608486031215611ec057600080fd5b611ec984611c09565b92506020840135611ed981611c1d565b929592945050506040919091013590565b600080600080600060a08688031215611f0257600080fd5b611f0b86611c09565b94506020860135611f1b81611c1d565b9350604086013592506060860135611f3281611c1d565b91506080860135611f4281611c1d565b809150509295509295909350565b600060208284031215611f6257600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60008085851115611fa857600080fd5b83861115611fb557600080fd5b5050820193919092039150565b80356020831015611a25577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60005b83811015612048578181015183820152602001612030565b50506000910152565b6000815180845261206981602086016020860161202d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b82815260406020820152600061197a6040830184612051565b6000602082840312156120c657600080fd5b8151801515811461138657600080fd5b600082516120e881846020870161202d565b9190910192915050565b602081526000611386602083018461205156fea2646970667358221220a7c902918aebd3a33e06d519acb6d72c1818f3d75480787bb08f5aa50af9ce2764736f6c63430008170033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
BLAST | 100.00% | $2,526.04 | 0.0128 | $32.35 |
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.