More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Lock Liquidity | 9653412 | 21 hrs ago | IN | 0 S | 0.00458991 |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xdd89367D...f31F28FeC The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
LiquidityTimelock
Compiler Version
v0.8.26+commit.8a97fa7a
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.0; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract LiquidityTimelock is ReentrancyGuard, Ownable { uint256 public immutable unlockTime; address public lpTokenAddress; bool public isLocked = false; event LiquidityLocked(uint256 amount, uint256 lockTimestamp); event LiquidityUnlocked(uint256 amount, uint256 unlockTimestamp); constructor(uint256 _unlockTime) Ownable(msg.sender) { require(_unlockTime > block.timestamp, "Unlock time must be in the future"); unlockTime = _unlockTime; } function lockLiquidity(address _lpTokenAddress, uint256 _amount) external onlyOwner { require(!isLocked, "Liquidity already locked"); require(_lpTokenAddress != address(0), "Invalid LP token address"); require(_amount > 0, "Amount must be greater than 0"); IERC20 lpToken = IERC20(_lpTokenAddress); require(lpToken.balanceOf(msg.sender) >= _amount, "Insufficient LP token balance"); require(lpToken.allowance(msg.sender, address(this)) >= _amount, "Insufficient allowance"); lpToken.transferFrom(msg.sender, address(this), _amount); lpTokenAddress = _lpTokenAddress; isLocked = true; emit LiquidityLocked(_amount, block.timestamp); } function unlockLiquidity() external onlyOwner nonReentrant { require(isLocked, "Liquidity not locked"); require(block.timestamp >= unlockTime, "Unlock time not reached"); IERC20 lpToken = IERC20(lpTokenAddress); uint256 balance = lpToken.balanceOf(address(this)); require(balance > 0, "No liquidity to unlock"); isLocked = false; lpToken.transfer(owner(), balance); emit LiquidityUnlocked(balance, block.timestamp); } function getTimeRemaining() public view returns (uint256) { if (!isLocked) return 0; if (block.timestamp >= unlockTime) return 0; return unlockTime - block.timestamp; } function getLPTokenBalance() public view returns (uint256) { if (!isLocked) return 0; IERC20 lpToken = IERC20(lpTokenAddress); return lpToken.balanceOf(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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 Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at, * consider using {ReentrancyGuardTransient} instead. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
{ "optimizer": { "enabled": true, "runs": 9999 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint256","name":"_unlockTime","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockTimestamp","type":"uint256"}],"name":"LiquidityLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unlockTimestamp","type":"uint256"}],"name":"LiquidityUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"getLPTokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimeRemaining","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_lpTokenAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"lockLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lpTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unlockLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unlockTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100be5760003560e01c8063a4e2d63411610076578063dbc6f9741161005b578063dbc6f9741461019e578063f2fde38b146101a6578063f5ae497a146101b957600080fd5b8063a4e2d63414610161578063dac6270d1461019657600080fd5b80636b54acd9116100a75780636b54acd914610112578063715018a61461011a5780638da5cb5b1461012257600080fd5b8063251c1aa3146100c35780636a336304146100fd575b600080fd5b6100ea7f0000000000000000000000000000000000000000000000000000000068b60e1b81565b6040519081526020015b60405180910390f35b61011061010b366004610ce0565b6101d9565b005b610110610687565b6101106109e8565b60015473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f4565b6002546101869074010000000000000000000000000000000000000000900460ff1681565b60405190151581526020016100f4565b6100ea6109fa565b6100ea610a81565b6101106101b4366004610d0a565b610b46565b60025461013c9073ffffffffffffffffffffffffffffffffffffffff1681565b6101e1610baa565b60025474010000000000000000000000000000000000000000900460ff161561026b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4c697175696469747920616c7265616479206c6f636b6564000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166102e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c6964204c5020746f6b656e206164647265737300000000000000006044820152606401610262565b60008111610352576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610262565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523360048201528290829073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa1580156103c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e49190610d2c565b101561044c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f496e73756666696369656e74204c5020746f6b656e2062616c616e63650000006044820152606401610262565b6040517fdd62ed3e000000000000000000000000000000000000000000000000000000008152336004820152306024820152829073ffffffffffffffffffffffffffffffffffffffff83169063dd62ed3e90604401602060405180830381865afa1580156104be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e29190610d2c565b101561054a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e73756666696369656e7420616c6c6f77616e6365000000000000000000006044820152606401610262565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810183905273ffffffffffffffffffffffffffffffffffffffff8216906323b872dd906064016020604051808303816000875af11580156105c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e79190610d45565b50600280547fffffffffffffffffffffff0000000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff851617740100000000000000000000000000000000000000001790556040517fcb75aa8347c098d414422e8cafbbe4e2c1a229f5b27bf425984b2b9792aa787a9061067a9084904290918252602082015260400190565b60405180910390a1505050565b61068f610baa565b610697610bfd565b60025474010000000000000000000000000000000000000000900460ff1661071b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4c6971756964697479206e6f74206c6f636b65640000000000000000000000006044820152606401610262565b7f0000000000000000000000000000000000000000000000000000000068b60e1b4210156107a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f556e6c6f636b2074696d65206e6f7420726561636865640000000000000000006044820152606401610262565b6002546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff9091169060009082906370a0823190602401602060405180830381865afa158015610818573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083c9190610d2c565b9050600081116108a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4e6f206c697175696469747920746f20756e6c6f636b000000000000000000006044820152606401610262565b600280547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905573ffffffffffffffffffffffffffffffffffffffff821663a9059cbb61090b60015473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018490526044016020604051808303816000875af115801561097d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a19190610d45565b50604080518281524260208201527f0102cf15b2b04b36f88bda5389c47ed2ff41ccaa78b974aab6e4480b877bf4c9910160405180910390a150506109e66001600055565b565b6109f0610baa565b6109e66000610c40565b60025460009074010000000000000000000000000000000000000000900460ff16610a255750600090565b7f0000000000000000000000000000000000000000000000000000000068b60e1b4210610a525750600090565b610a7c427f0000000000000000000000000000000000000000000000000000000068b60e1b610d67565b905090565b60025460009074010000000000000000000000000000000000000000900460ff16610aac5750600090565b6002546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff9091169081906370a0823190602401602060405180830381865afa158015610b1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b409190610d2c565b91505090565b610b4e610baa565b73ffffffffffffffffffffffffffffffffffffffff8116610b9e576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610262565b610ba781610c40565b50565b60015473ffffffffffffffffffffffffffffffffffffffff1633146109e6576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610262565b600260005403610c39576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600055565b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610cdb57600080fd5b919050565b60008060408385031215610cf357600080fd5b610cfc83610cb7565b946020939093013593505050565b600060208284031215610d1c57600080fd5b610d2582610cb7565b9392505050565b600060208284031215610d3e57600080fd5b5051919050565b600060208284031215610d5757600080fd5b81518015158114610d2557600080fd5b81810381811115610da1577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9291505056fea2646970667358221220f7792570c5843a7efcb7e0fb06425c8bdc896650e356f53dfe33e46b4a82e09864736f6c634300081a0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.