Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
Multichain Info
N/A
Latest 25 from a total of 1,240 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Batch Locking Pl... | 9559779 | 3 days ago | IN | 0 ETH | 0.00000083 | ||||
| Batch Locking Pl... | 9517890 | 9 days ago | IN | 0 ETH | 0.00000047 | ||||
| Batch Vesting Pl... | 9500770 | 11 days ago | IN | 0 ETH | 0.0009223 | ||||
| Batch Vesting Pl... | 9500768 | 11 days ago | IN | 0 ETH | 0.00096619 | ||||
| Batch Vesting Pl... | 9457985 | 17 days ago | IN | 0 ETH | 0.00060531 | ||||
| Batch Vesting Pl... | 9457885 | 17 days ago | IN | 0 ETH | 0.00060111 | ||||
| Batch Vesting Pl... | 9457849 | 17 days ago | IN | 0 ETH | 0.00060108 | ||||
| Batch Vesting Pl... | 9433014 | 21 days ago | IN | 0 ETH | 0.00278217 | ||||
| Batch Vesting Pl... | 9432996 | 21 days ago | IN | 0 ETH | 0.00119087 | ||||
| Batch Vesting Pl... | 9415030 | 23 days ago | IN | 0 ETH | 0.00007488 | ||||
| Batch Vesting Pl... | 9414992 | 23 days ago | IN | 0 ETH | 0.00000047 | ||||
| Batch Vesting Pl... | 9414975 | 23 days ago | IN | 0 ETH | 0.00000047 | ||||
| Batch Vesting Pl... | 9414923 | 23 days ago | IN | 0 ETH | 0.0000751 | ||||
| Batch Vesting Pl... | 9410351 | 24 days ago | IN | 0 ETH | 0.0000751 | ||||
| Batch Vesting Pl... | 9408876 | 24 days ago | IN | 0 ETH | 0.0000751 | ||||
| Batch Vesting Pl... | 9408801 | 24 days ago | IN | 0 ETH | 0.0000751 | ||||
| Batch Vesting Pl... | 9408754 | 24 days ago | IN | 0 ETH | 0.0000751 | ||||
| Batch Vesting Pl... | 9408741 | 24 days ago | IN | 0 ETH | 0.00000047 | ||||
| Batch Vesting Pl... | 9408638 | 24 days ago | IN | 0 ETH | 0.0000751 | ||||
| Batch Vesting Pl... | 9408636 | 24 days ago | IN | 0 ETH | 0.0000751 | ||||
| Batch Vesting Pl... | 9408636 | 24 days ago | IN | 0 ETH | 0.0000751 | ||||
| Batch Vesting Pl... | 9408621 | 24 days ago | IN | 0 ETH | 0.00000047 | ||||
| Batch Vesting Pl... | 9408614 | 24 days ago | IN | 0 ETH | 0.00000047 | ||||
| Batch Vesting Pl... | 9408605 | 24 days ago | IN | 0 ETH | 0.00000047 | ||||
| Batch Vesting Pl... | 9408595 | 24 days ago | IN | 0 ETH | 0.00000047 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Contract Name:
BatchPlanner
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;
import '../libraries/TransferHelper.sol';
import '../interfaces/IVestingPlans.sol';
import '../interfaces/ILockupPlans.sol';
/// @title BatchPlanner - contract to create batches of lockup and vesting plans in bulk
contract BatchPlanner {
/// @dev struct object that defines the parameters of a general lockup and vesting plan, that are shared by both lockup and vesting plans
/// @param recipient is the address of the wallet receiving the plan
/// @param amount is the amount of tokens to be locked in the plan
/// @param start is the unix timestamp of when unlocking or vesting starts
/// @param cliff is an optional cliff date when the plan has a second discrete date after the start when an initial chunk unlocks / vests
/// @param rate is the amount of tokens that unlock or vest per period
struct Plan {
address recipient;
uint256 amount;
uint256 start;
uint256 cliff;
uint256 rate;
}
/// @dev event used for internal analytics and reporting only
event BatchCreated(address indexed creator, address token, uint256 recipients, uint256 totalAmount, uint8 mintType);
/// @notice function to create a batch of lockup plans
/// @dev the function will pull in the entire balancde of totalAmount into the contract, then increase the approval allowance and then via loop mint lockup plans
/// @param locker is the address of the lockup plan that the tokens will be locked in, and NFT plan provided to
/// @param token is the address of the token that is given and locked to the individuals
/// @param totalAmount is the total amount of tokens being locked, this has to equal the sum of all the individual amounts in the plans struct
/// @param plans is the array of plans that contain each plan parameters
/// @param period is the length of the period in seconds that tokens become unlocked / vested
/// @param mintType is an internal tool to help with identifying front end applications
function batchLockingPlans(
address locker,
address token,
uint256 totalAmount,
Plan[] memory plans,
uint256 period,
uint8 mintType
) external {
require(totalAmount > 0, '0_totalAmount');
require(locker != address(0), '0_locker');
require(token != address(0), '0_token');
require(plans.length > 0, 'no plans');
TransferHelper.transferTokens(token, msg.sender, address(this), totalAmount);
SafeERC20.safeIncreaseAllowance(IERC20(token), locker, totalAmount);
uint256 amountCheck;
for (uint16 i; i < plans.length; i++) {
ILockupPlans(locker).createPlan(
plans[i].recipient,
token,
plans[i].amount,
plans[i].start,
plans[i].cliff,
plans[i].rate,
period
);
amountCheck += plans[i].amount;
}
require(amountCheck == totalAmount, 'totalAmount error');
emit BatchCreated(msg.sender, token, plans.length, totalAmount, mintType);
}
/// @notice function to create a batch of vesting plans.
/// @dev the function will pull in the entire balance of totalAmount to the contract, increase the allowance and then via loop mint vesting plans
/// @param locker is the address of the lockup plan that the tokens will be locked in, and NFT plan provided to
/// @param token is the address of the token that is given and locked to the individuals
/// @param totalAmount is the total amount of tokens being locked, this has to equal the sum of all the individual amounts in the plans struct
/// @param plans is the array of plans that contain each plan parameters
/// @param period is the length of the period in seconds that tokens become unlocked / vested
/// @param vestingAdmin is the address of the vesting admin, that will be the same for all plans created
/// @param adminTransferOBO is an emergency toggle that allows the vesting admin to tranfer a vesting plan on behalf of a beneficiary
/// @param mintType is an internal tool to help with identifying front end applications
function batchVestingPlans(
address locker,
address token,
uint256 totalAmount,
Plan[] memory plans,
uint256 period,
address vestingAdmin,
bool adminTransferOBO,
uint8 mintType
) external {
require(totalAmount > 0, '0_totalAmount');
require(locker != address(0), '0_locker');
require(token != address(0), '0_token');
require(plans.length > 0, 'no plans');
TransferHelper.transferTokens(token, msg.sender, address(this), totalAmount);
SafeERC20.safeIncreaseAllowance(IERC20(token), locker, totalAmount);
uint256 amountCheck;
for (uint16 i; i < plans.length; i++) {
IVestingPlans(locker).createPlan(
plans[i].recipient,
token,
plans[i].amount,
plans[i].start,
plans[i].cliff,
plans[i].rate,
period,
vestingAdmin,
adminTransferOBO
);
amountCheck += plans[i].amount;
}
require(amountCheck == totalAmount, 'totalAmount error');
emit BatchCreated(msg.sender, token, plans.length, totalAmount, mintType);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// 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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.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 SafeERC20 {
using Address for address;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 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(IERC20 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));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to
* 0 before setting it to a non-zero value.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @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(IERC20 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");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @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).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// 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 cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [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://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or 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 {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;
interface ILockupPlans {
function createPlan(
address recipient,
address token,
uint256 amount,
uint256 start,
uint256 cliff,
uint256 rate,
uint256 period
) external;
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;
interface IVestingPlans {
function createPlan(
address recipient,
address token,
uint256 amount,
uint256 start,
uint256 cliff,
uint256 rate,
uint256 period,
address vestingAdmin,
bool adminTransferOBO
) external;
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
/// @notice Library to help safely transfer tokens and handle ETH wrapping and unwrapping of WETH
library TransferHelper {
using SafeERC20 for IERC20;
/// @notice Internal function used for standard ERC20 transferFrom method
/// @notice it contains a pre and post balance check
/// @notice as well as a check on the msg.senders balance
/// @param token is the address of the ERC20 being transferred
/// @param from is the remitting address
/// @param to is the location where they are being delivered
function transferTokens(
address token,
address from,
address to,
uint256 amount
) internal {
uint256 priorBalance = IERC20(token).balanceOf(address(to));
require(IERC20(token).balanceOf(from) >= amount, 'THL01');
SafeERC20.safeTransferFrom(IERC20(token), from, to, amount);
uint256 postBalance = IERC20(token).balanceOf(address(to));
require(postBalance - priorBalance == amount, 'THL02');
}
/// @notice Internal function is used with standard ERC20 transfer method
/// @notice this function ensures that the amount received is the amount sent with pre and post balance checking
/// @param token is the ERC20 contract address that is being transferred
/// @param to is the address of the recipient
/// @param amount is the amount of tokens that are being transferred
function withdrawTokens(
address token,
address to,
uint256 amount
) internal {
uint256 priorBalance = IERC20(token).balanceOf(address(to));
SafeERC20.safeTransfer(IERC20(token), to, amount);
uint256 postBalance = IERC20(token).balanceOf(address(to));
require(postBalance - priorBalance == amount, 'THL02');
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"viaIR": true,
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"recipients","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"mintType","type":"uint8"}],"name":"BatchCreated","type":"event"},{"inputs":[{"internalType":"address","name":"locker","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"rate","type":"uint256"}],"internalType":"struct BatchPlanner.Plan[]","name":"plans","type":"tuple[]"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint8","name":"mintType","type":"uint8"}],"name":"batchLockingPlans","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"locker","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"rate","type":"uint256"}],"internalType":"struct BatchPlanner.Plan[]","name":"plans","type":"tuple[]"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"address","name":"vestingAdmin","type":"address"},{"internalType":"bool","name":"adminTransferOBO","type":"bool"},{"internalType":"uint8","name":"mintType","type":"uint8"}],"name":"batchVestingPlans","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6080806040523461001657610d04908161001c8239f35b600080fdfe6080604052600436101561001257600080fd5b60003560e01c806394d37b5a146102895763ae6253531461003257600080fd5b346102145760c03660031901126102145761004b6104fa565b610053610510565b9060643567ffffffffffffffff811161021457610074903690600401610572565b60ff60a4351660a435036102145761008f6044351515610650565b6100a36001600160a01b038316151561068c565b6100b76001600160a01b03841615156106c3565b6100c3815115156106f9565b6100d1604435303386610abc565b6100e7604435836001600160a01b0386166107d0565b6000805b825161ffff83161015610219576001600160a01b0361010e61ffff841685610759565b51511690602061012261ffff851686610759565b510151604061013561ffff861687610759565b510151606061014861ffff871688610759565b51015190608061015c61ffff881689610759565b510151926001600160a01b0389163b156102145760405195632744bf0b60e11b8752600487015260018060a01b038a16602487015260448601526064850152608484015260a483015260843560c483015260008260e4818360018060a01b038a165af1908115610208576101f3926101ed926101f9575b5060206101e461ffff861687610759565b51015190610783565b91610730565b906100eb565b61020290610526565b386101d3565b6040513d6000823e3d90fd5b600080fd5b7f953aff4c10a4afa8842ad10787814e77e5126afc74e2b982eecfec5ee21debf16102848461024c889460443514610790565b51604080516001600160a01b03909516855260208501919091526044359084015260ff60a43516606084015233929081906080820190565b0390a2005b3461021457610100366003190112610214576102a36104fa565b6102ab610510565b60643567ffffffffffffffff8111610214576102cb903690600401610572565b60a435916001600160a01b03831683036102145760c4359283151584036102145760ff60e4351660e43503610214576103076044351515610650565b61031b6001600160a01b038616151561068c565b61032f6001600160a01b03831615156106c3565b61033b835115156106f9565b610349604435303385610abc565b61035f604435866001600160a01b0385166107d0565b600091825b845161ffff85161015610490576001600160a01b0361038761ffff861687610759565b51511690602061039b61ffff871688610759565b51015160406103ae61ffff881689610759565b51015160606103c161ffff89168a610759565b5101519060806103d561ffff8a168b610759565b510151926001600160a01b038c163b15610214576040519563050fbad760e01b8752600487015260018060a01b038716602487015260448601526064850152608484015260a483015260843560c483015260018060a01b03841660e4830152861515610104830152600082610124818360018060a01b038d165af19081156102085761047b9261047592610481575b5060206101e461ffff881689610759565b93610730565b92610364565b61048a90610526565b89610464565b610284856104c27f953aff4c10a4afa8842ad10787814e77e5126afc74e2b982eecfec5ee21debf19360443514610790565b51604080516001600160a01b03909516855260208501919091526044359084015260ff60e43516606084015233929081906080820190565b600435906001600160a01b038216820361021457565b602435906001600160a01b038216820361021457565b67ffffffffffffffff811161053a57604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761053a57604052565b81601f820112156102145780359067ffffffffffffffff9283831161053a576040908151946020926105a9848760051b0188610550565b858752838701928460a080980287010195818711610214578501935b8685106105d757505050505050505090565b8785830312610214578251908882018281108682111761063b5784528535906001600160a01b0382168203610214578288928b94528288013583820152858801358682015260608089013590820152608080890135908201528152019401936105c5565b60246000634e487b7160e01b81526041600452fd5b1561065757565b60405162461bcd60e51b815260206004820152600d60248201526c0c17dd1bdd185b105b5bdd5b9d609a1b6044820152606490fd5b1561069357565b60405162461bcd60e51b8152602060048201526008602482015267182fb637b1b5b2b960c11b6044820152606490fd5b156106ca57565b60405162461bcd60e51b8152602060048201526007602482015266182fba37b5b2b760c91b6044820152606490fd5b1561070057565b60405162461bcd60e51b81526020600482015260086024820152676e6f20706c616e7360c01b6044820152606490fd5b61ffff8091169081146107435760010190565b634e487b7160e01b600052601160045260246000fd5b805182101561076d5760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b9190820180921161074357565b1561079757565b60405162461bcd60e51b81526020600482015260116024820152703a37ba30b620b6b7bab73a1032b93937b960791b6044820152606490fd5b91604051636eb1769f60e11b815230600482015260208160448160018060a01b038097169687602483015288165afa9081156102085760009161085e575b509061081991610783565b6040519163095ea7b360e01b60208401526024830152604482015260448152608081019181831067ffffffffffffffff84111761053a5761085c92604052610894565b565b906020823d821161088c575b8161087760209383610550565b8101031261088957505161081961080e565b80fd5b3d915061086a565b60018060a01b0316906040516040810167ffffffffffffffff908281108282111761053a576040526020938483527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858401526000808587829751910182855af1903d156109dd573d9283116109c9579061092f9392916040519261092288601f19601f8401160185610550565b83523d868885013e6109e8565b8051918215918483156109a1575b50505090501561094a5750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b9193818094500103126109c55782015190811515820361088957508038808461093d565b5080fd5b634e487b7160e01b85526041600452602485fd5b9061092f9392506060915b91929015610a4a57508151156109fc575090565b3b15610a055790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015610a5d5750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610aa3575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350610a80565b604080516370a0823160e01b8082526001600160a01b03958616600480840182905297602497602097959691959181169493919088858b81895afa948515610c9457600095610c9f575b508751918383521690818b82015288818b81895afa908115610c9457908791600091610c64575b5010610c3a578651906323b872dd60e01b89830152898201528260448201528560648201526064815260a0810181811067ffffffffffffffff821117610c265791610b7e8a928a95948a5287610894565b8751958693849283528c8301525afa918215610c1b57600092610bec575b508103908111610bd85703610bb15750505050565b5162461bcd60e51b815292830152600590820152642a2426181960d91b6044820152606490fd5b84601187634e487b7160e01b600052526000fd5b90918582813d8311610c14575b610c038183610550565b810103126108895750519038610b9c565b503d610bf9565b84513d6000823e3d90fd5b8960418c634e487b7160e01b600052526000fd5b865162461bcd60e51b8152808b018990526005818b01526454484c303160d81b6044820152606490fd5b91508982813d8311610c8d575b610c7b8183610550565b81010312610889575086905138610b2d565b503d610c71565b88513d6000823e3d90fd5b90948982813d8311610cc7575b610cb68183610550565b810103126108895750519338610b06565b503d610cac56fea2646970667358221220847e0f7f6b8866f64ed0b0aeb02881aa9f17779ced24ef23c08832ff7ef01e6b64736f6c63430008130033
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c806394d37b5a146102895763ae6253531461003257600080fd5b346102145760c03660031901126102145761004b6104fa565b610053610510565b9060643567ffffffffffffffff811161021457610074903690600401610572565b60ff60a4351660a435036102145761008f6044351515610650565b6100a36001600160a01b038316151561068c565b6100b76001600160a01b03841615156106c3565b6100c3815115156106f9565b6100d1604435303386610abc565b6100e7604435836001600160a01b0386166107d0565b6000805b825161ffff83161015610219576001600160a01b0361010e61ffff841685610759565b51511690602061012261ffff851686610759565b510151604061013561ffff861687610759565b510151606061014861ffff871688610759565b51015190608061015c61ffff881689610759565b510151926001600160a01b0389163b156102145760405195632744bf0b60e11b8752600487015260018060a01b038a16602487015260448601526064850152608484015260a483015260843560c483015260008260e4818360018060a01b038a165af1908115610208576101f3926101ed926101f9575b5060206101e461ffff861687610759565b51015190610783565b91610730565b906100eb565b61020290610526565b386101d3565b6040513d6000823e3d90fd5b600080fd5b7f953aff4c10a4afa8842ad10787814e77e5126afc74e2b982eecfec5ee21debf16102848461024c889460443514610790565b51604080516001600160a01b03909516855260208501919091526044359084015260ff60a43516606084015233929081906080820190565b0390a2005b3461021457610100366003190112610214576102a36104fa565b6102ab610510565b60643567ffffffffffffffff8111610214576102cb903690600401610572565b60a435916001600160a01b03831683036102145760c4359283151584036102145760ff60e4351660e43503610214576103076044351515610650565b61031b6001600160a01b038616151561068c565b61032f6001600160a01b03831615156106c3565b61033b835115156106f9565b610349604435303385610abc565b61035f604435866001600160a01b0385166107d0565b600091825b845161ffff85161015610490576001600160a01b0361038761ffff861687610759565b51511690602061039b61ffff871688610759565b51015160406103ae61ffff881689610759565b51015160606103c161ffff89168a610759565b5101519060806103d561ffff8a168b610759565b510151926001600160a01b038c163b15610214576040519563050fbad760e01b8752600487015260018060a01b038716602487015260448601526064850152608484015260a483015260843560c483015260018060a01b03841660e4830152861515610104830152600082610124818360018060a01b038d165af19081156102085761047b9261047592610481575b5060206101e461ffff881689610759565b93610730565b92610364565b61048a90610526565b89610464565b610284856104c27f953aff4c10a4afa8842ad10787814e77e5126afc74e2b982eecfec5ee21debf19360443514610790565b51604080516001600160a01b03909516855260208501919091526044359084015260ff60e43516606084015233929081906080820190565b600435906001600160a01b038216820361021457565b602435906001600160a01b038216820361021457565b67ffffffffffffffff811161053a57604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761053a57604052565b81601f820112156102145780359067ffffffffffffffff9283831161053a576040908151946020926105a9848760051b0188610550565b858752838701928460a080980287010195818711610214578501935b8685106105d757505050505050505090565b8785830312610214578251908882018281108682111761063b5784528535906001600160a01b0382168203610214578288928b94528288013583820152858801358682015260608089013590820152608080890135908201528152019401936105c5565b60246000634e487b7160e01b81526041600452fd5b1561065757565b60405162461bcd60e51b815260206004820152600d60248201526c0c17dd1bdd185b105b5bdd5b9d609a1b6044820152606490fd5b1561069357565b60405162461bcd60e51b8152602060048201526008602482015267182fb637b1b5b2b960c11b6044820152606490fd5b156106ca57565b60405162461bcd60e51b8152602060048201526007602482015266182fba37b5b2b760c91b6044820152606490fd5b1561070057565b60405162461bcd60e51b81526020600482015260086024820152676e6f20706c616e7360c01b6044820152606490fd5b61ffff8091169081146107435760010190565b634e487b7160e01b600052601160045260246000fd5b805182101561076d5760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b9190820180921161074357565b1561079757565b60405162461bcd60e51b81526020600482015260116024820152703a37ba30b620b6b7bab73a1032b93937b960791b6044820152606490fd5b91604051636eb1769f60e11b815230600482015260208160448160018060a01b038097169687602483015288165afa9081156102085760009161085e575b509061081991610783565b6040519163095ea7b360e01b60208401526024830152604482015260448152608081019181831067ffffffffffffffff84111761053a5761085c92604052610894565b565b906020823d821161088c575b8161087760209383610550565b8101031261088957505161081961080e565b80fd5b3d915061086a565b60018060a01b0316906040516040810167ffffffffffffffff908281108282111761053a576040526020938483527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858401526000808587829751910182855af1903d156109dd573d9283116109c9579061092f9392916040519261092288601f19601f8401160185610550565b83523d868885013e6109e8565b8051918215918483156109a1575b50505090501561094a5750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b9193818094500103126109c55782015190811515820361088957508038808461093d565b5080fd5b634e487b7160e01b85526041600452602485fd5b9061092f9392506060915b91929015610a4a57508151156109fc575090565b3b15610a055790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015610a5d5750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610aa3575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350610a80565b604080516370a0823160e01b8082526001600160a01b03958616600480840182905297602497602097959691959181169493919088858b81895afa948515610c9457600095610c9f575b508751918383521690818b82015288818b81895afa908115610c9457908791600091610c64575b5010610c3a578651906323b872dd60e01b89830152898201528260448201528560648201526064815260a0810181811067ffffffffffffffff821117610c265791610b7e8a928a95948a5287610894565b8751958693849283528c8301525afa918215610c1b57600092610bec575b508103908111610bd85703610bb15750505050565b5162461bcd60e51b815292830152600590820152642a2426181960d91b6044820152606490fd5b84601187634e487b7160e01b600052526000fd5b90918582813d8311610c14575b610c038183610550565b810103126108895750519038610b9c565b503d610bf9565b84513d6000823e3d90fd5b8960418c634e487b7160e01b600052526000fd5b865162461bcd60e51b8152808b018990526005818b01526454484c303160d81b6044820152606490fd5b91508982813d8311610c8d575b610c7b8183610550565b81010312610889575086905138610b2d565b503d610c71565b88513d6000823e3d90fd5b90948982813d8311610cc7575b610cb68183610550565b810103126108895750519338610b06565b503d610cac56fea2646970667358221220847e0f7f6b8866f64ed0b0aeb02881aa9f17779ced24ef23c08832ff7ef01e6b64736f6c63430008130033
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.