Description:
Smart contract deployed on Ethereum with Factory features.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"contracts/curves/CliffLinearVestingCurve.sol": {
"content": "// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;
/*
______ _______ __
/ \ | \ | \
| ▓▓▓▓▓▓\ ______ ______ | ▓▓▓▓▓▓▓\ ______ _______ ____| ▓▓
| ▓▓__| ▓▓ / \ / \ | ▓▓__/ ▓▓ / \ | \ / ▓▓
| ▓▓ ▓▓| ▓▓▓▓▓▓\| ▓▓▓▓▓▓\| ▓▓ ▓▓| ▓▓▓▓▓▓\| ▓▓▓▓▓▓▓\| ▓▓▓▓▓▓▓
| ▓▓▓▓▓▓▓▓| ▓▓ | ▓▓| ▓▓ ▓▓| ▓▓▓▓▓▓▓\| ▓▓ | ▓▓| ▓▓ | ▓▓| ▓▓ | ▓▓
| ▓▓ | ▓▓| ▓▓__/ ▓▓| ▓▓▓▓▓▓▓▓| ▓▓__/ ▓▓| ▓▓__/ ▓▓| ▓▓ | ▓▓| ▓▓__| ▓▓
| ▓▓ | ▓▓| ▓▓ ▓▓ \▓▓ \| ▓▓ ▓▓ \▓▓ ▓▓| ▓▓ | ▓▓ \▓▓ ▓▓
\▓▓ \▓▓| ▓▓▓▓▓▓▓ \▓▓▓▓▓▓▓ \▓▓▓▓▓▓▓ \▓▓▓▓▓▓ \▓▓ \▓▓ \▓▓▓▓▓▓▓
| ▓▓
| ▓▓
\▓▓
* App: https://Ape.Bond
* Medium: https://ApeBond.medium.com
* Twitter: https://twitter.com/ApeBond
* Telegram: https://t.me/ape_bond
* Announcements: https://t.me/ApeBond_news
* Discord: https://ApeBond.click/discord
* Reddit: https://ApeBond.click/reddit
* Instagram: https://instagram.com/ape.bond
* GitHub: https://github.com/ApeSwapFinance
*/
import "./IVestingCurve.sol";
contract CliffLinearVestingCurve is IVestingCurve {
/// @notice Duration of the cliff period in seconds
uint256 public immutable cliff;
/**
* @notice Constructor to set the cliff duration
* @param _cliff Duration of the cliff period in seconds
*/
constructor(uint256 _cliff) {
cliff = _cliff;
}
/**
* @dev See {IVestingCurve-getVestedPayoutAtTime}.
*/
function getVestedPayoutAtTime(
uint256 totalPayout,
uint256 vestingTerm,
uint256 startTimestamp,
uint256 checkTimestamp
) external view returns (uint256 vestedPayout) {
if (checkTimestamp < startTimestamp + cliff) {
vestedPayout = 0;
} else if (checkTimestamp >= (startTimestamp + vestingTerm) || cliff >= vestingTerm) {
vestedPayout = totalPayout;
} else {
/// @dev Linear vesting after cliff period
vestedPayout = (totalPayout * (checkTimestamp - startTimestamp - cliff)) / (vestingTerm - cliff);
}
}
}
"
},
"contracts/curves/IVestingCurve.sol": {
"content": "// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;
/// @notice VestingCurve interface to allow for simple updates of vesting release schedules.
interface IVestingCurve {
/**
* @notice Returns the vested token amount given the inputs below.
* @param totalPayout Total payout vested once the vestingTerm is up
* @param vestingTerm Length of time in seconds that tokens are vesting for
* @param startTimestamp The timestamp of when vesting starts
* @param checkTimestamp The timestamp to calculate vested tokens
* @return vestedPayout Total payoutTokens vested at checkTimestamp
*
* Requirements
* - MUST return 0 if checkTimestamp is less than startTimestamp
* - MUST return totalPayout if checkTimestamp is greater than startTimestamp + vestingTerm,
* - MUST return a value including or between 0 and totalPayout
*/
function getVestedPayoutAtTime(
uint256 totalPayout,
uint256 vestingTerm,
uint256 startTimestamp,
uint256 checkTimestamp
) external view returns (uint256 vestedPayout);
}
"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 100
},
"viaIR": true,
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}}
Submitted on: 2025-10-28 14:39:35
Comments
Log in to comment.
No comments yet.