Source Code
Latest 25 from a total of 20,379 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Deposit To Lyra | 41302761 | 43 mins ago | IN | 0.0000013 ETH | 0.00000224 | ||||
| Deposit To Lyra | 41296938 | 3 hrs ago | IN | 0.00000225 ETH | 0.00000237 | ||||
| Deposit To Lyra | 41296536 | 4 hrs ago | IN | 0.00000225 ETH | 0.0000079 | ||||
| Deposit To Lyra | 41295813 | 4 hrs ago | IN | 0.00000111 ETH | 0.00000712 | ||||
| Deposit ETH To L... | 41295273 | 4 hrs ago | IN | 90.00000111 ETH | 0.00000535 | ||||
| Deposit To Lyra | 41294364 | 5 hrs ago | IN | 0.0000014 ETH | 0.00000204 | ||||
| Deposit To Lyra | 41293432 | 5 hrs ago | IN | 0.0000014 ETH | 0.00000203 | ||||
| Deposit ETH To L... | 41293234 | 6 hrs ago | IN | 15.0010014 ETH | 0.00000175 | ||||
| Deposit To Lyra | 41292796 | 6 hrs ago | IN | 0.0000014 ETH | 0.00000263 | ||||
| Deposit ETH To L... | 41292660 | 6 hrs ago | IN | 5.00000639 ETH | 0.00000364 | ||||
| Deposit To Lyra | 41291622 | 6 hrs ago | IN | 0.00000639 ETH | 0.00000567 | ||||
| Deposit To Lyra | 41288882 | 8 hrs ago | IN | 0.00000114 ETH | 0.00003405 | ||||
| Deposit To Lyra | 41284863 | 10 hrs ago | IN | 0.00000125 ETH | 0.00000428 | ||||
| Deposit To Lyra | 41281291 | 12 hrs ago | IN | 0.00000125 ETH | 0.00000386 | ||||
| Deposit ETH To L... | 41275137 | 16 hrs ago | IN | 2.85000072 ETH | 0.00000063 | ||||
| Deposit To Lyra | 41267377 | 20 hrs ago | IN | 0.00000069 ETH | 0.00000075 | ||||
| Deposit To Lyra | 41257979 | 25 hrs ago | IN | 0.00000068 ETH | 0.00000112 | ||||
| Deposit To Lyra | 41256840 | 26 hrs ago | IN | 0.00000068 ETH | 0.00000066 | ||||
| Deposit To Lyra | 41254762 | 27 hrs ago | IN | 0.00000068 ETH | 0.0000006 | ||||
| Deposit To Lyra | 41253171 | 28 hrs ago | IN | 0.00000068 ETH | 0.00000057 | ||||
| Deposit To Lyra | 41253056 | 28 hrs ago | IN | 0.00000068 ETH | 0.00000047 | ||||
| Deposit ETH To L... | 41252514 | 28 hrs ago | IN | 4.50000068 ETH | 0.00000028 | ||||
| Deposit To Lyra | 41248908 | 30 hrs ago | IN | 0.00000084 ETH | 0.00000078 | ||||
| Deposit ETH To L... | 41247821 | 31 hrs ago | IN | 10.00000084 ETH | 0.0000006 | ||||
| Deposit To Lyra | 41247580 | 31 hrs ago | IN | 0.00000083 ETH | 0.00000056 |
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 41302761 | 43 mins ago | 0.0000013 ETH | ||||
| 41296938 | 3 hrs ago | 0.00000225 ETH | ||||
| 41296536 | 4 hrs ago | 0.00000225 ETH | ||||
| 41295813 | 4 hrs ago | 0.00000111 ETH | ||||
| 41295273 | 4 hrs ago | 0.00000111 ETH | ||||
| 41295273 | 4 hrs ago | 90 ETH | ||||
| 41294364 | 5 hrs ago | 0.0000014 ETH | ||||
| 41293432 | 5 hrs ago | 0.0000014 ETH | ||||
| 41293234 | 6 hrs ago | 0.0000014 ETH | ||||
| 41293234 | 6 hrs ago | 15.001 ETH | ||||
| 41292796 | 6 hrs ago | 0.0000014 ETH | ||||
| 41292660 | 6 hrs ago | 0.00000639 ETH | ||||
| 41292660 | 6 hrs ago | 5 ETH | ||||
| 41291622 | 6 hrs ago | 0.00000639 ETH | ||||
| 41288882 | 8 hrs ago | 0.00000114 ETH | ||||
| 41284863 | 10 hrs ago | 0.00000125 ETH | ||||
| 41281291 | 12 hrs ago | 0.00000125 ETH | ||||
| 41275137 | 16 hrs ago | 0.00000072 ETH | ||||
| 41275137 | 16 hrs ago | 2.85 ETH | ||||
| 41267377 | 20 hrs ago | 0.00000069 ETH | ||||
| 41257979 | 25 hrs ago | 0.00000068 ETH | ||||
| 41256840 | 26 hrs ago | 0.00000068 ETH | ||||
| 41254762 | 27 hrs ago | 0.00000068 ETH | ||||
| 41253171 | 28 hrs ago | 0.00000068 ETH | ||||
| 41253056 | 28 hrs ago | 0.00000068 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
LyraDepositWrapper
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 2000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import {IERC20} from "../../lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import {IWETH} from "../interfaces/IWETH.sol";
import {ISocketVault} from "../interfaces/ISocketVault.sol";
import {ILightAccountFactory} from "../interfaces/ILightAccountFactory.sol";
/**
* @title LyraDepositWrapper
* @dev Helper contract to wrap ETH into L2 WETH, or deposit any token to L2 smart contract wallet address
*/
contract LyraDepositWrapper {
///@dev L2 USDC address.
address public immutable weth;
///@dev Light Account factory address.
address public constant lightAccountFactory = 0x000000893A26168158fbeaDD9335Be5bC96592E2;
constructor(address _weth) {
weth = _weth;
}
/**
* @notice Wrap ETH into WETH and deposit to Lyra Chain via socket vault
*/
function depositETHToLyra(address socketVault, bool isSCW, uint256 gasLimit, address connector) external payable {
uint256 socketFee = ISocketVault(socketVault).getMinFees(connector, gasLimit);
uint256 depositAmount = msg.value - socketFee;
IWETH(weth).deposit{value: depositAmount}();
IERC20(weth).approve(socketVault, type(uint256).max);
address recipient = _getL2Receiver(isSCW);
ISocketVault(socketVault).depositToAppChain{value: socketFee}(recipient, depositAmount, gasLimit, connector);
}
/**
* @notice Deposit any token to Lyra Chain via socket vault.
* @dev This function help calculate L2 smart wallet addresses for users
*/
function depositToLyra(
address token,
address socketVault,
bool isSCW,
uint256 amount,
uint256 gasLimit,
address connector
) external payable {
IERC20(token).transferFrom(msg.sender, address(this), amount);
IERC20(token).approve(socketVault, type(uint256).max);
address recipient = _getL2Receiver(isSCW);
ISocketVault(socketVault).depositToAppChain{value: msg.value}(recipient, amount, gasLimit, connector);
}
/**
* @notice Return the receiver address on L2
*/
function _getL2Receiver(bool isScwWallet) internal view returns (address) {
if (isScwWallet) {
return ILightAccountFactory(lightAccountFactory).getAddress(msg.sender, 0);
} else {
return msg.sender;
}
}
receive() external payable {}
}// 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);
}pragma solidity >=0.5.0;
interface IWETH {
function deposit() external payable;
function transfer(address to, uint256 value) external returns (bool);
function withdraw(uint256) external;
}// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
interface ISocketVault {
function depositToAppChain(address receiver_, uint256 amount_, uint256 msgGasLimit_, address connector_)
external
payable;
function __token() external view returns (address);
function getMinFees(address connector, uint256 minGasLimit) external view returns (uint256);
}// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
interface ILightAccountFactory {
/**
* @notice Create an account, and return its address.
* Returns the address even if the account is already deployed.
* @dev During UserOperation execution, this method is called only if the account is not deployed.
* This method returns an existing account address so that entryPoint.getSenderAddress() would work even after account creation.
* @param owner The owner of the account to be created
* @param salt A salt, which can be changed to create multiple accounts with the same owner
* @return ret The address of either the newly deployed account or an existing account with this owner and salt
*/
function createAccount(address owner, uint256 salt) external returns (address ret);
/**
* @notice Calculate the counterfactual address of this account as it would be returned by createAccount()
* @param owner The owner of the account to be created
* @param salt A salt, which can be changed to create multiple accounts with the same owner
* @return The address of the account that would be created with createAccount()
*/
function getAddress(address owner, uint256 salt) external view returns (address);
}{
"remappings": [
"account-abstraction/=lib/account-abstraction/contracts/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"account-abstraction/=lib/account-abstraction/contracts/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin/=lib/openzeppelin-contracts/contracts/",
"relay-context-contracts/=lib/relay-context-contracts/contracts/"
],
"optimizer": {
"enabled": true,
"runs": 2000
},
"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
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"socketVault","type":"address"},{"internalType":"bool","name":"isSCW","type":"bool"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"address","name":"connector","type":"address"}],"name":"depositETHToLyra","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"socketVault","type":"address"},{"internalType":"bool","name":"isSCW","type":"bool"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"address","name":"connector","type":"address"}],"name":"depositToLyra","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"lightAccountFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60a060405234801561001057600080fd5b5060405161084438038061084483398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516107ac610098600039600081816076015281816101a6015261026f01526107ac6000f3fe6080604052600436106100435760003560e01c806323d8817a1461004f5780633fc8cef3146100645780637e902d57146100c1578063f4e8cd69146100e657600080fd5b3661004a57005b600080fd5b61006261005d36600461061f565b6100f9565b005b34801561007057600080fd5b506100987f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100cd57600080fd5b5061009870893a26168158fbeadd9335be5bc96592e281565b6100626100f4366004610672565b610393565b6040517f8367080f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301526024820184905260009190861690638367080f90604401602060405180830381865afa158015610170573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019491906106e2565b905060006101a282346106fb565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561020c57600080fd5b505af1158015610220573d6000803e3d6000fd5b50506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a8116600483015260001960248301527f000000000000000000000000000000000000000000000000000000000000000016935063095ea7b3925060440190506020604051808303816000875af11580156102bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e09190610735565b5060006102ec86610547565b6040517f864f6a7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8083166004830152602482018590526044820188905286811660648301529192509088169063864f6a7a9085906084015b6000604051808303818588803b15801561037157600080fd5b505af1158015610385573d6000803e3d6000fd5b505050505050505050505050565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810184905273ffffffffffffffffffffffffffffffffffffffff8716906323b872dd906064016020604051808303816000875af115801561040c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104309190610735565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152600019602483015287169063095ea7b3906044016020604051808303816000875af11580156104a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cb9190610735565b5060006104d785610547565b6040517f864f6a7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8083166004830152602482018790526044820186905284811660648301529192509087169063864f6a7a903490608401610358565b600081156105e5576040517f8cb84e180000000000000000000000000000000000000000000000000000000081523360048201526000602482015270893a26168158fbeadd9335be5bc96592e290638cb84e1890604401602060405180830381865afa1580156105bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105df9190610759565b92915050565b5033919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461060e57600080fd5b50565b801515811461060e57600080fd5b6000806000806080858703121561063557600080fd5b8435610640816105ec565b9350602085013561065081610611565b9250604085013591506060850135610667816105ec565b939692955090935050565b60008060008060008060c0878903121561068b57600080fd5b8635610696816105ec565b955060208701356106a6816105ec565b945060408701356106b681610611565b9350606087013592506080870135915060a08701356106d4816105ec565b809150509295509295509295565b6000602082840312156106f457600080fd5b5051919050565b818103818111156105df577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006020828403121561074757600080fd5b815161075281610611565b9392505050565b60006020828403121561076b57600080fd5b8151610752816105ec56fea2646970667358221220b0d419648160dbf66f804445469b0f5031d6bc2712e7878f7c23ec7858d7c62864736f6c634300081500330000000000000000000000004200000000000000000000000000000000000006
Deployed Bytecode
0x6080604052600436106100435760003560e01c806323d8817a1461004f5780633fc8cef3146100645780637e902d57146100c1578063f4e8cd69146100e657600080fd5b3661004a57005b600080fd5b61006261005d36600461061f565b6100f9565b005b34801561007057600080fd5b506100987f000000000000000000000000420000000000000000000000000000000000000681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100cd57600080fd5b5061009870893a26168158fbeadd9335be5bc96592e281565b6100626100f4366004610672565b610393565b6040517f8367080f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301526024820184905260009190861690638367080f90604401602060405180830381865afa158015610170573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019491906106e2565b905060006101a282346106fb565b90507f000000000000000000000000420000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561020c57600080fd5b505af1158015610220573d6000803e3d6000fd5b50506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a8116600483015260001960248301527f000000000000000000000000420000000000000000000000000000000000000616935063095ea7b3925060440190506020604051808303816000875af11580156102bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e09190610735565b5060006102ec86610547565b6040517f864f6a7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8083166004830152602482018590526044820188905286811660648301529192509088169063864f6a7a9085906084015b6000604051808303818588803b15801561037157600080fd5b505af1158015610385573d6000803e3d6000fd5b505050505050505050505050565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810184905273ffffffffffffffffffffffffffffffffffffffff8716906323b872dd906064016020604051808303816000875af115801561040c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104309190610735565b506040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152600019602483015287169063095ea7b3906044016020604051808303816000875af11580156104a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cb9190610735565b5060006104d785610547565b6040517f864f6a7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8083166004830152602482018790526044820186905284811660648301529192509087169063864f6a7a903490608401610358565b600081156105e5576040517f8cb84e180000000000000000000000000000000000000000000000000000000081523360048201526000602482015270893a26168158fbeadd9335be5bc96592e290638cb84e1890604401602060405180830381865afa1580156105bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105df9190610759565b92915050565b5033919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461060e57600080fd5b50565b801515811461060e57600080fd5b6000806000806080858703121561063557600080fd5b8435610640816105ec565b9350602085013561065081610611565b9250604085013591506060850135610667816105ec565b939692955090935050565b60008060008060008060c0878903121561068b57600080fd5b8635610696816105ec565b955060208701356106a6816105ec565b945060408701356106b681610611565b9350606087013592506080870135915060a08701356106d4816105ec565b809150509295509295509295565b6000602082840312156106f457600080fd5b5051919050565b818103818111156105df577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006020828403121561074757600080fd5b815161075281610611565b9392505050565b60006020828403121561076b57600080fd5b8151610752816105ec56fea2646970667358221220b0d419648160dbf66f804445469b0f5031d6bc2712e7878f7c23ec7858d7c62864736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004200000000000000000000000000000000000006
-----Decoded View---------------
Arg [0] : _weth (address): 0x4200000000000000000000000000000000000006
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000004200000000000000000000000000000000000006
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$1.97
Net Worth in ETH
0.000686
Token Allocations
ETH
100.00%
Multichain Portfolio | 35 Chains
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.