Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 16 from a total of 16 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Create Vesting W... | 17621452 | 531 days ago | IN | 0 ETH | 0.00457498 | ||||
Create Vesting W... | 17621452 | 531 days ago | IN | 0 ETH | 0.00471362 | ||||
Create Vesting W... | 17614088 | 532 days ago | IN | 0 ETH | 0.00485226 | ||||
Create Vesting W... | 17613743 | 532 days ago | IN | 0 ETH | 0.00443635 | ||||
Create Vesting W... | 17613743 | 532 days ago | IN | 0 ETH | 0.00443635 | ||||
Create Vesting W... | 17613693 | 532 days ago | IN | 0 ETH | 0.00443635 | ||||
Create Vesting W... | 17613693 | 532 days ago | IN | 0 ETH | 0.00443635 | ||||
Create Vesting W... | 17613693 | 532 days ago | IN | 0 ETH | 0.00443635 | ||||
Create Vesting W... | 17613644 | 532 days ago | IN | 0 ETH | 0.00512953 | ||||
Create Vesting W... | 17613643 | 532 days ago | IN | 0 ETH | 0.00512953 | ||||
Create Vesting W... | 17613643 | 532 days ago | IN | 0 ETH | 0.00512953 | ||||
Create Vesting W... | 17613643 | 532 days ago | IN | 0 ETH | 0.00512953 | ||||
Create Vesting W... | 17613643 | 532 days ago | IN | 0 ETH | 0.00512953 | ||||
Create Vesting W... | 17613643 | 532 days ago | IN | 0 ETH | 0.00512953 | ||||
Create Vesting W... | 17613643 | 532 days ago | IN | 0 ETH | 0.00512953 | ||||
Create Vesting W... | 17591163 | 536 days ago | IN | 0 ETH | 0.00318835 |
Latest 17 internal transactions
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
17621452 | 531 days ago | Contract Creation | 0 ETH | |||
17621452 | 531 days ago | Contract Creation | 0 ETH | |||
17614088 | 532 days ago | Contract Creation | 0 ETH | |||
17613743 | 532 days ago | Contract Creation | 0 ETH | |||
17613743 | 532 days ago | Contract Creation | 0 ETH | |||
17613693 | 532 days ago | Contract Creation | 0 ETH | |||
17613693 | 532 days ago | Contract Creation | 0 ETH | |||
17613693 | 532 days ago | Contract Creation | 0 ETH | |||
17613644 | 532 days ago | Contract Creation | 0 ETH | |||
17613643 | 532 days ago | Contract Creation | 0 ETH | |||
17613643 | 532 days ago | Contract Creation | 0 ETH | |||
17613643 | 532 days ago | Contract Creation | 0 ETH | |||
17613643 | 532 days ago | Contract Creation | 0 ETH | |||
17613643 | 532 days ago | Contract Creation | 0 ETH | |||
17613643 | 532 days ago | Contract Creation | 0 ETH | |||
17591163 | 536 days ago | Contract Creation | 0 ETH | |||
17420316 | 560 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
VestingWalletFactory
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 3 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol"; import {CliffVestingWallet} from "./CliffVestingWallet.sol"; contract VestingWalletFactory { event CreateVesting(address indexed addr); CliffVestingWallet public immutable impl; constructor() { CliffVestingWallet _impl = new CliffVestingWallet(); _impl.initialize(address(this), 0, 0, 0); impl = _impl; } /// @notice Create a vesting wallet contract /// @dev Emits a CreateVesting event with address of the wallet /// @param _beneficiary the address that will receive vesting tokens or eth /// @param _startTimestamp the timestamp when vesting starts /// @param _durationSeconds duration of vesting in seconds /// @param _cliffSeconds cliff, before which no vesting occurs. If 0, no cliff is used. function createVestingWallet( address _beneficiary, uint64 _startTimestamp, uint64 _durationSeconds, uint64 _cliffSeconds ) public { CliffVestingWallet clone = CliffVestingWallet( payable(Clones.clone(address(impl))) ); clone.initialize( _beneficiary, _startTimestamp, _durationSeconds, _cliffSeconds ); emit CreateVesting(address(clone)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (finance/VestingWallet.sol) pragma solidity ^0.8.0; import "../token/ERC20/utils/SafeERC20Upgradeable.sol"; import "../utils/AddressUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/math/MathUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @title VestingWallet * @dev This contract handles the vesting of Eth and ERC20 tokens for a given beneficiary. Custody of multiple tokens * can be given to this contract, which will release the token to the beneficiary following a given vesting schedule. * The vesting schedule is customizable through the {vestedAmount} function. * * Any token transferred to this contract will follow the vesting schedule as if they were locked from the beginning. * Consequently, if the vesting has already started, any amount of tokens sent to this contract will (at least partly) * be immediately releasable. */ contract VestingWalletUpgradeable is Initializable, ContextUpgradeable { event EtherReleased(uint256 amount); event ERC20Released(address indexed token, uint256 amount); uint256 private _released; mapping(address => uint256) private _erc20Released; address private _beneficiary; uint64 private _start; uint64 private _duration; /** * @dev Set the beneficiary, start timestamp and vesting duration of the vesting wallet. */ function __VestingWallet_init( address beneficiaryAddress, uint64 startTimestamp, uint64 durationSeconds ) internal onlyInitializing { __VestingWallet_init_unchained(beneficiaryAddress, startTimestamp, durationSeconds); } function __VestingWallet_init_unchained( address beneficiaryAddress, uint64 startTimestamp, uint64 durationSeconds ) internal onlyInitializing { require(beneficiaryAddress != address(0), "VestingWallet: beneficiary is zero address"); _beneficiary = beneficiaryAddress; _start = startTimestamp; _duration = durationSeconds; } /** * @dev The contract should be able to receive Eth. */ receive() external payable virtual {} /** * @dev Getter for the beneficiary address. */ function beneficiary() public view virtual returns (address) { return _beneficiary; } /** * @dev Getter for the start timestamp. */ function start() public view virtual returns (uint256) { return _start; } /** * @dev Getter for the vesting duration. */ function duration() public view virtual returns (uint256) { return _duration; } /** * @dev Amount of eth already released */ function released() public view virtual returns (uint256) { return _released; } /** * @dev Amount of token already released */ function released(address token) public view virtual returns (uint256) { return _erc20Released[token]; } /** * @dev Release the native token (ether) that have already vested. * * Emits a {TokensReleased} event. */ function release() public virtual { uint256 releasable = vestedAmount(uint64(block.timestamp)) - released(); _released += releasable; emit EtherReleased(releasable); AddressUpgradeable.sendValue(payable(beneficiary()), releasable); } /** * @dev Release the tokens that have already vested. * * Emits a {TokensReleased} event. */ function release(address token) public virtual { uint256 releasable = vestedAmount(token, uint64(block.timestamp)) - released(token); _erc20Released[token] += releasable; emit ERC20Released(token, releasable); SafeERC20Upgradeable.safeTransfer(IERC20Upgradeable(token), beneficiary(), releasable); } /** * @dev Calculates the amount of ether that has already vested. Default implementation is a linear vesting curve. */ function vestedAmount(uint64 timestamp) public view virtual returns (uint256) { return _vestingSchedule(address(this).balance + released(), timestamp); } /** * @dev Calculates the amount of tokens that has already vested. Default implementation is a linear vesting curve. */ function vestedAmount(address token, uint64 timestamp) public view virtual returns (uint256) { return _vestingSchedule(IERC20Upgradeable(token).balanceOf(address(this)) + released(token), timestamp); } /** * @dev Virtual implementation of the vesting formula. This returns the amout vested, as a function of time, for * an asset given its total historical allocation. */ function _vestingSchedule(uint256 totalAllocation, uint64 timestamp) internal view virtual returns (uint256) { if (timestamp < start()) { return 0; } else if (timestamp > start() + duration()) { return totalAllocation; } else { return (totalAllocation * (timestamp - start())) / duration(); } } /** * 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[48] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; 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. * * 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 initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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); /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable { using AddressUpgradeable for address; function safeTransfer( IERC20Upgradeable token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20Upgradeable 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( IERC20Upgradeable 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)); } function safeIncreaseAllowance( IERC20Upgradeable token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20Upgradeable token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @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(IERC20Upgradeable 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"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.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 * ==== * * [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://diligence.consensys.net/posts/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.5.11/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 functionCall(target, data, "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"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(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) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// 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; } /** * 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 // OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/Clones.sol) pragma solidity ^0.8.0; /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create(0, 0x09, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create2(0, 0x09, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(add(ptr, 0x38), deployer) mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff) mstore(add(ptr, 0x14), implementation) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73) mstore(add(ptr, 0x58), salt) mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37)) predicted := keccak256(add(ptr, 0x43), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } }
// SPDX-License-Identifier: MIT // Adapted from https://github.com/Uniswap/governance/blob/master/contracts/TreasuryVester.sol pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import {VestingWalletUpgradeable} from "@openzeppelin/contracts-upgradeable-4.5.0/finance/VestingWalletUpgradeable.sol"; contract CliffVestingWallet is VestingWalletUpgradeable { uint64 private _cliff; function initialize( address beneficiaryAddress, uint64 startTimestamp, uint64 durationSeconds, uint64 cliffSeconds ) public initializer { require( cliffSeconds <= durationSeconds, "VestingWallet: cliff > duration" ); __VestingWallet_init( beneficiaryAddress, startTimestamp, durationSeconds ); _cliff = cliffSeconds; } function cliff() public view returns (uint256) { return _cliff; } function _vestingSchedule(uint256 totalAllocation, uint64 timestamp) internal view override returns (uint256) { if (timestamp < start() + _cliff) { return 0; } return super._vestingSchedule(totalAllocation, timestamp); } }
{ "optimizer": { "enabled": true, "runs": 3 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"}],"name":"CreateVesting","type":"event"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint64","name":"_startTimestamp","type":"uint64"},{"internalType":"uint64","name":"_durationSeconds","type":"uint64"},{"internalType":"uint64","name":"_cliffSeconds","type":"uint64"}],"name":"createVestingWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"impl","outputs":[{"internalType":"contract CliffVestingWallet","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a060405234801561001057600080fd5b50600060405161001f906100c2565b604051809103906000f08015801561003b573d6000803e3d6000fd5b5060405163df3d330560e01b81523060048201526000602482018190526044820181905260648201529091506001600160a01b0382169063df3d330590608401600060405180830381600087803b15801561009557600080fd5b505af11580156100a9573d6000803e3d6000fd5b5050505060601b6001600160601b0319166080526100cf565b610e03806103b483390190565b60805160601c6102c26100f26000396000818160400152609a01526102c26000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80638abf60771461003b578063ee3eebe11461007e575b600080fd5b6100627f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b61009161008c36600461022c565b610093565b005b60006100be7f0000000000000000000000000000000000000000000000000000000000000000610177565b60405163df3d330560e01b81526001600160a01b0387811660048301526001600160401b0380881660248401528087166044840152851660648301529192509082169063df3d330590608401600060405180830381600087803b15801561012457600080fd5b505af1158015610138573d6000803e3d6000fd5b50506040516001600160a01b03841692507f4b8f3b1768957541be0e6215cc4d5901e78431ef74b7eeb77af1baa83c024b3d9150600090a25050505050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b0381166102105760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015260640160405180910390fd5b919050565b80356001600160401b038116811461021057600080fd5b60008060008060808587031215610241578384fd5b84356001600160a01b0381168114610257578485fd5b935061026560208601610215565b925061027360408601610215565b915061028160608601610215565b90509295919450925056fea264697066735822122082ebfceb0768b3a88760e35383f0270d65c9414ded4cb83233fbf7c734698c0b64736f6c63430008040033608060405234801561001057600080fd5b50610de3806100206000396000f3fe6080604052600436106100905760003560e01c80630a17b06b1461009c5780630fb5a6b4146100cf57806313d033c0146100e4578063191655871461010257806338af3eed14610124578063810ec23b1461014657806386d1a69f14610166578063961325211461017b5780639852595c14610190578063be9a6555146101b0578063df3d3305146101c557600080fd5b3661009757005b600080fd5b3480156100a857600080fd5b506100bc6100b7366004610c31565b6101e5565b6040519081526020015b60405180910390f35b3480156100db57600080fd5b506100bc610209565b3480156100f057600080fd5b506067546001600160401b03166100bc565b34801561010e57600080fd5b5061012261011d366004610b5a565b610218565b005b34801561013057600080fd5b506101396102bd565b6040516100c69190610c67565b34801561015257600080fd5b506100bc610161366004610b74565b6102cc565b34801561017257600080fd5b50610122610367565b34801561018757600080fd5b506033546100bc565b34801561019c57600080fd5b506100bc6101ab366004610b5a565b6103e5565b3480156101bc57600080fd5b506100bc610400565b3480156101d157600080fd5b506101226101e0366004610ba6565b610416565b60006102036101f360335490565b6101fd9047610cf9565b83610564565b92915050565b6036546001600160401b031690565b6000610223826103e5565b61022d83426102cc565b6102379190610d50565b6001600160a01b038316600090815260346020526040812080549293508392909190610264908490610cf9565b90915550506040518181526001600160a01b038316907fc0e523490dd523c33b1878c9eb14ff46991e3f5b2cd33710918618f2a39cba1b9060200160405180910390a26102b9826102b36102bd565b836105a7565b5050565b6035546001600160a01b031690565b60006103606102da846103e5565b6040516370a0823160e01b81526001600160a01b038616906370a0823190610306903090600401610c67565b60206040518083038186803b15801561031e57600080fd5b505afa158015610332573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103569190610c19565b6101fd9190610cf9565b9392505050565b600061037260335490565b61037b426101e5565b6103859190610d50565b905080603360008282546103999190610cf9565b90915550506040518181527fda9d4e5f101b8b9b1c5b76d0c5a9f7923571acfc02376aa076b75a8c080c956b9060200160405180910390a16103e26103dc6102bd565b826105fe565b50565b6001600160a01b031660009081526034602052604090205490565b603554600160a01b90046001600160401b031690565b600054610100900460ff166104315760005460ff1615610439565b610439610714565b6104a15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b600054610100900460ff161580156104c3576000805461ffff19166101011790555b826001600160401b0316826001600160401b031611156105255760405162461bcd60e51b815260206004820152601f60248201527f56657374696e6757616c6c65743a20636c696666203e206475726174696f6e006044820152606401610498565b610530858585610725565b606780546001600160401b0319166001600160401b038416179055801561055d576000805461ff00191690555b5050505050565b6067546000906001600160401b031661057b610400565b6105859190610cf9565b826001600160401b0316101561059d57506000610203565b6103608383610757565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526105f99084906107e8565b505050565b8047101561064e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610498565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461069b576040519150601f19603f3d011682016040523d82523d6000602084013e6106a0565b606091505b50509050806105f95760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610498565b600061071f306108ba565b15905090565b600054610100900460ff1661074c5760405162461bcd60e51b815260040161049890610cae565b6105f98383836108c9565b6000610761610400565b826001600160401b0316101561077957506000610203565b610781610209565b610789610400565b6107939190610cf9565b826001600160401b031611156107aa575081610203565b6107b2610209565b6107ba610400565b6107cd906001600160401b038516610d50565b6107d79085610d31565b6107e19190610d11565b9050610203565b600061083d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166109a89092919063ffffffff16565b8051909150156105f9578080602001905181019061085b9190610bf9565b6105f95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610498565b6001600160a01b03163b151590565b600054610100900460ff166108f05760405162461bcd60e51b815260040161049890610cae565b6001600160a01b0383166109595760405162461bcd60e51b815260206004820152602a60248201527f56657374696e6757616c6c65743a2062656e6566696369617279206973207a65604482015269726f206164647265737360b01b6064820152608401610498565b603580546001600160a01b03949094166001600160e01b031990941693909317600160a01b6001600160401b039384160217909255603680546001600160401b03191692909116919091179055565b60606109b784846000856109bf565b949350505050565b606082471015610a205760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610498565b610a29856108ba565b610a755760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610498565b600080866001600160a01b03168587604051610a919190610c4b565b60006040518083038185875af1925050503d8060008114610ace576040519150601f19603f3d011682016040523d82523d6000602084013e610ad3565b606091505b5091509150610ae3828286610aee565b979650505050505050565b60608315610afd575081610360565b825115610b0d5782518084602001fd5b8160405162461bcd60e51b81526004016104989190610c7b565b80356001600160a01b0381168114610b3e57600080fd5b919050565b80356001600160401b0381168114610b3e57600080fd5b600060208284031215610b6b578081fd5b61036082610b27565b60008060408385031215610b86578081fd5b610b8f83610b27565b9150610b9d60208401610b43565b90509250929050565b60008060008060808587031215610bbb578182fd5b610bc485610b27565b9350610bd260208601610b43565b9250610be060408601610b43565b9150610bee60608601610b43565b905092959194509250565b600060208284031215610c0a578081fd5b81518015158114610360578182fd5b600060208284031215610c2a578081fd5b5051919050565b600060208284031215610c42578081fd5b61036082610b43565b60008251610c5d818460208701610d67565b9190910192915050565b6001600160a01b0391909116815260200190565b6020815260008251806020840152610c9a816040850160208701610d67565b601f01601f19169190910160400192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008219821115610d0c57610d0c610d97565b500190565b600082610d2c57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615610d4b57610d4b610d97565b500290565b600082821015610d6257610d62610d97565b500390565b60005b83811015610d82578181015183820152602001610d6a565b83811115610d91576000848401525b50505050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220a00cc923e6211fcf91e82865ba770b791f108dd3f6779df00c4ba48b0186358664736f6c63430008040033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100365760003560e01c80638abf60771461003b578063ee3eebe11461007e575b600080fd5b6100627f000000000000000000000000a5cca623368ffe543c6748903bb38a8f2f463f5f81565b6040516001600160a01b03909116815260200160405180910390f35b61009161008c36600461022c565b610093565b005b60006100be7f000000000000000000000000a5cca623368ffe543c6748903bb38a8f2f463f5f610177565b60405163df3d330560e01b81526001600160a01b0387811660048301526001600160401b0380881660248401528087166044840152851660648301529192509082169063df3d330590608401600060405180830381600087803b15801561012457600080fd5b505af1158015610138573d6000803e3d6000fd5b50506040516001600160a01b03841692507f4b8f3b1768957541be0e6215cc4d5901e78431ef74b7eeb77af1baa83c024b3d9150600090a25050505050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b0381166102105760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015260640160405180910390fd5b919050565b80356001600160401b038116811461021057600080fd5b60008060008060808587031215610241578384fd5b84356001600160a01b0381168114610257578485fd5b935061026560208601610215565b925061027360408601610215565b915061028160608601610215565b90509295919450925056fea264697066735822122082ebfceb0768b3a88760e35383f0270d65c9414ded4cb83233fbf7c734698c0b64736f6c63430008040033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.