More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Vault
Compiler Version
v0.8.28+commit.7893614a
Contract Source Code (Solidity)
/** *Submitted for verification at SonicScan.org on 2024-12-24 */ // SPDX-License-Identifier: UNKNOWN pragma solidity ^0.8.18; interface INonfungiblePositionManager { function WETH9() external view returns (address); struct MintParams { address token0; address token1; uint24 fee; int24 tickLower; int24 tickUpper; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; address recipient; uint256 deadline; } struct CollectParams { uint256 tokenId; address recipient; uint128 amount0Max; uint128 amount1Max; } function mint(MintParams memory params) external returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1); function collect(CollectParams calldata params) external returns (uint256 amount0, uint256 amount1); function safeTransferFrom(address from, address to, uint256 tokenId) external; } interface IERC721Receiver { function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4); } contract Vault is IERC721Receiver { address public owner; uint256 public tokenId; INonfungiblePositionManager public nfpm = INonfungiblePositionManager(0xf807Aca27B1550Fe778fD4E7013BB57480b17fAc); uint256 withdrawTime; constructor() { owner = msg.sender; withdrawTime = block.timestamp + 60 days; } function collectFees() external { require(msg.sender == owner, "Vault: FORBIDDEN"); nfpm.collect( INonfungiblePositionManager.CollectParams({ tokenId: tokenId, recipient: owner, amount0Max: type(uint128).max, amount1Max: type(uint128).max }) ); } function withdraw() external { require(msg.sender == owner); require(block.timestamp >= withdrawTime); nfpm.safeTransferFrom(address(this), msg.sender, tokenId); } function onERC721Received( address operator, address from, uint256 id, bytes calldata data ) external override returns (bytes4) { require(tokenId == 0, "Vault: LOCKED"); tokenId = id; return IERC721Receiver.onERC721Received.selector; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"collectFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nfpm","outputs":[{"internalType":"contract INonfungiblePositionManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052600280546001600160a01b03191673f807aca27b1550fe778fd4e7013bb57480b17fac1790553480156034575f5ffd5b505f80546001600160a01b03191633179055605142624f1a006058565b600355607c565b80820180821115607657634e487b7160e01b5f52601160045260245ffd5b92915050565b6103fa806100895f395ff3fe608060405234801561000f575f5ffd5b5060043610610060575f3560e01c8063150b7a021461006457806317d70f7c146100955780633ccfd60b146100ac5780637303e913146100b65780638da5cb5b146100e1578063c8796572146100f3575b5f5ffd5b61007761007236600461030d565b6100fb565b6040516001600160e01b031990911681526020015b60405180910390f35b61009e60015481565b60405190815260200161008c565b6100b4610156565b005b6002546100c9906001600160a01b031681565b6040516001600160a01b03909116815260200161008c565b5f546100c9906001600160a01b031681565b6100b46101e4565b5f6001545f146101425760405162461bcd60e51b815260206004820152600d60248201526c15985d5b1d0e881313d0d2d151609a1b60448201526064015b60405180910390fd5b50505060015550630a85bd0160e11b919050565b5f546001600160a01b0316331461016b575f5ffd5b600354421015610179575f5ffd5b600254600154604051632142170760e11b815230600482015233602482015260448101919091526001600160a01b03909116906342842e0e906064015f604051808303815f87803b1580156101cc575f5ffd5b505af11580156101de573d5f5f3e3d5ffd5b50505050565b5f546001600160a01b031633146102305760405162461bcd60e51b815260206004820152601060248201526f2b30bab63a1d102327a92124a22222a760811b6044820152606401610139565b6002546040805160808101825260015481525f546001600160a01b03908116602083019081526fffffffffffffffffffffffffffffffff83850181815260608501828152955163fc6f786560e01b8152945160048601529151831660248501529051811660448401529251909216606482015291169063fc6f78659060840160408051808303815f875af11580156102ca573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102ee91906103a2565b5050565b80356001600160a01b0381168114610308575f5ffd5b919050565b5f5f5f5f5f60808688031215610321575f5ffd5b61032a866102f2565b9450610338602087016102f2565b935060408601359250606086013567ffffffffffffffff81111561035a575f5ffd5b8601601f8101881361036a575f5ffd5b803567ffffffffffffffff811115610380575f5ffd5b886020828401011115610391575f5ffd5b959894975092955050506020019190565b5f5f604083850312156103b3575f5ffd5b50508051602090910151909290915056fea2646970667358221220638ad0d5098f7d6d24baeb53ba15b4fe0f284e2e5d127f552806aea538090bc564736f6c634300081c0033
Deployed Bytecode
0x608060405234801561000f575f5ffd5b5060043610610060575f3560e01c8063150b7a021461006457806317d70f7c146100955780633ccfd60b146100ac5780637303e913146100b65780638da5cb5b146100e1578063c8796572146100f3575b5f5ffd5b61007761007236600461030d565b6100fb565b6040516001600160e01b031990911681526020015b60405180910390f35b61009e60015481565b60405190815260200161008c565b6100b4610156565b005b6002546100c9906001600160a01b031681565b6040516001600160a01b03909116815260200161008c565b5f546100c9906001600160a01b031681565b6100b46101e4565b5f6001545f146101425760405162461bcd60e51b815260206004820152600d60248201526c15985d5b1d0e881313d0d2d151609a1b60448201526064015b60405180910390fd5b50505060015550630a85bd0160e11b919050565b5f546001600160a01b0316331461016b575f5ffd5b600354421015610179575f5ffd5b600254600154604051632142170760e11b815230600482015233602482015260448101919091526001600160a01b03909116906342842e0e906064015f604051808303815f87803b1580156101cc575f5ffd5b505af11580156101de573d5f5f3e3d5ffd5b50505050565b5f546001600160a01b031633146102305760405162461bcd60e51b815260206004820152601060248201526f2b30bab63a1d102327a92124a22222a760811b6044820152606401610139565b6002546040805160808101825260015481525f546001600160a01b03908116602083019081526fffffffffffffffffffffffffffffffff83850181815260608501828152955163fc6f786560e01b8152945160048601529151831660248501529051811660448401529251909216606482015291169063fc6f78659060840160408051808303815f875af11580156102ca573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102ee91906103a2565b5050565b80356001600160a01b0381168114610308575f5ffd5b919050565b5f5f5f5f5f60808688031215610321575f5ffd5b61032a866102f2565b9450610338602087016102f2565b935060408601359250606086013567ffffffffffffffff81111561035a575f5ffd5b8601601f8101881361036a575f5ffd5b803567ffffffffffffffff811115610380575f5ffd5b886020828401011115610391575f5ffd5b959894975092955050506020019190565b5f5f604083850312156103b3575f5ffd5b50508051602090910151909290915056fea2646970667358221220638ad0d5098f7d6d24baeb53ba15b4fe0f284e2e5d127f552806aea538090bc564736f6c634300081c0033
Deployed Bytecode Sourcemap
1022:1101:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1853:264;;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;;1162:33:1;;;1144:52;;1132:2;1117:18;1853:264:0;;;;;;;;1086:22;;;;;;;;;1353:25:1;;;1341:2;1326:18;1086:22:0;1207:177:1;1651:197:0;;;:::i;:::-;;1112:113;;;;;-1:-1:-1;;;;;1112:113:0;;;;;;-1:-1:-1;;;;;1587:32:1;;;1569:51;;1557:2;1542:18;1112:113:0;1389:237:1;1062:20:0;;;;;-1:-1:-1;;;;;1062:20:0;;;1356:287;;;:::i;1853:264::-;1987:6;2008:7;;2019:1;2008:12;2000:38;;;;-1:-1:-1;;;2000:38:0;;2041:2:1;2000:38:0;;;2023:21:1;2080:2;2060:18;;;2053:30;-1:-1:-1;;;2099:18:1;;;2092:43;2152:18;;2000:38:0;;;;;;;;;-1:-1:-1;;;2045:7:0;:12;-1:-1:-1;;;;2071:41:0;1853:264;-1:-1:-1;1853:264:0:o;1651:197::-;1713:5;;-1:-1:-1;;;;;1713:5:0;1699:10;:19;1691:28;;;;;;1757:12;;1738:15;:31;;1730:40;;;;;;1783:4;;;1832:7;1783:57;;-1:-1:-1;;;1783:57:0;;1813:4;1783:57;;;2383:51:1;1820:10:0;2450:18:1;;;2443:60;2519:18;;;2512:34;;;;-1:-1:-1;;;;;1783:4:0;;;;:21;;2356:18:1;;1783:57:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1651:197::o;1356:287::-;1415:5;;-1:-1:-1;;;;;1415:5:0;1401:10;:19;1393:48;;;;-1:-1:-1;;;1393:48:0;;2759:2:1;1393:48:0;;;2741:21:1;2798:2;2778:18;;;2771:30;-1:-1:-1;;;2817:18:1;;;2810:46;2873:18;;1393:48:0;2557:340:1;1393:48:0;1448:4;;1466:167;;;;;;;;1448:4;1524:7;1466:167;;-1:-1:-1;1549:5:0;-1:-1:-1;;;;;1549:5:0;;;1466:167;;;;;;1573:17;1466:167;;;;;;;;;;;;1448:190;;-1:-1:-1;;;1448:190:0;;3125:13:1;;1448:190:0;;;3107:32:1;3181:24;;3177:50;;3155:20;;;3148:80;3270:24;;3266:65;;3244:20;;;3237:95;3374:24;;3370:65;;;3348:20;;;3341:95;1448:4:0;;;:12;;3079:19:1;;1448:190:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;1356:287::o;14:173:1:-;82:20;;-1:-1:-1;;;;;131:31:1;;121:42;;111:70;;177:1;174;167:12;111:70;14:173;;;:::o;192:803::-;289:6;297;305;313;321;374:3;362:9;353:7;349:23;345:33;342:53;;;391:1;388;381:12;342:53;414:29;433:9;414:29;:::i;:::-;404:39;;462:38;496:2;485:9;481:18;462:38;:::i;:::-;452:48;;547:2;536:9;532:18;519:32;509:42;;602:2;591:9;587:18;574:32;629:18;621:6;618:30;615:50;;;661:1;658;651:12;615:50;684:22;;737:4;729:13;;725:27;-1:-1:-1;715:55:1;;766:1;763;756:12;715:55;806:2;793:16;832:18;824:6;821:30;818:50;;;864:1;861;854:12;818:50;909:7;904:2;895:6;891:2;887:15;883:24;880:37;877:57;;;930:1;927;920:12;877:57;192:803;;;;-1:-1:-1;192:803:1;;-1:-1:-1;;;961:2:1;953:11;;983:6;192:803::o;3447:343::-;3526:6;3534;3587:2;3575:9;3566:7;3562:23;3558:32;3555:52;;;3603:1;3600;3593:12;3555:52;-1:-1:-1;;3648:16:1;;3754:2;3739:18;;;3733:25;3648:16;;3733:25;;-1:-1:-1;3447:343:1:o
Swarm Source
ipfs://638ad0d5098f7d6d24baeb53ba15b4fe0f284e2e5d127f552806aea538090bc5
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.