Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 68 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Batch Vesting Pl... | 20284320 | 5 days ago | IN | 0 ETH | 0.00597291 | ||||
Batch Vesting Pl... | 20260470 | 9 days ago | IN | 0 ETH | 0.00142036 | ||||
Batch Vesting Pl... | 20226347 | 14 days ago | IN | 0 ETH | 0.01125758 | ||||
Batch Locking Pl... | 20221485 | 14 days ago | IN | 0 ETH | 0.00271911 | ||||
Batch Vesting Pl... | 20210222 | 16 days ago | IN | 0 ETH | 0.00251257 | ||||
Batch Vesting Pl... | 20191122 | 18 days ago | IN | 0 ETH | 0.00391829 | ||||
Batch Vesting Pl... | 20180378 | 20 days ago | IN | 0 ETH | 0.00328131 | ||||
Batch Vesting Pl... | 20180318 | 20 days ago | IN | 0 ETH | 0.00354811 | ||||
Batch Vesting Pl... | 20177106 | 20 days ago | IN | 0 ETH | 0.0044612 | ||||
Batch Vesting Pl... | 20177021 | 20 days ago | IN | 0 ETH | 0.00592569 | ||||
Batch Vesting Pl... | 20176985 | 20 days ago | IN | 0 ETH | 0.00535405 | ||||
Batch Vesting Pl... | 20160958 | 23 days ago | IN | 0 ETH | 0.00232921 | ||||
Batch Vesting Pl... | 20145473 | 25 days ago | IN | 0 ETH | 0.00127227 | ||||
Batch Vesting Pl... | 20145398 | 25 days ago | IN | 0 ETH | 0.00017401 | ||||
Batch Vesting Pl... | 20125413 | 28 days ago | IN | 0 ETH | 0.00159367 | ||||
Batch Locking Pl... | 20124768 | 28 days ago | IN | 0 ETH | 0.00213979 | ||||
Batch Vesting Pl... | 20124455 | 28 days ago | IN | 0 ETH | 0.00777835 | ||||
Batch Vesting Pl... | 20117077 | 29 days ago | IN | 0 ETH | 0.00238362 | ||||
Batch Vesting Pl... | 20080956 | 34 days ago | IN | 0 ETH | 0.00480537 | ||||
Batch Vesting Pl... | 20074943 | 35 days ago | IN | 0 ETH | 0.01608884 | ||||
Batch Vesting Pl... | 20074623 | 35 days ago | IN | 0 ETH | 0.00513199 | ||||
Batch Vesting Pl... | 20069124 | 36 days ago | IN | 0 ETH | 0.01044227 | ||||
Batch Locking Pl... | 19948483 | 52 days ago | IN | 0 ETH | 0.00201393 | ||||
Batch Vesting Pl... | 19900156 | 59 days ago | IN | 0 ETH | 0.02691932 | ||||
Batch Vesting Pl... | 19777249 | 76 days ago | IN | 0 ETH | 0.0806247 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
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[] calldata 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[] calldata 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 Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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
6080806040523461001657610c6e908161001c8239f35b600080fdfe6080604052600436101561001257600080fd5b60003560e01c806394d37b5a1461028e5763ae6253531461003257600080fd5b3461021b5760c036600319011261021b5761004b610501565b610053610517565b9060643567ffffffffffffffff811161021b5761007490369060040161052d565b909260ff60a4351660a4350361021b57610091604435151561055e565b6100a56001600160a01b038416151561059a565b6100b96001600160a01b03821615156105d1565b6100c4821515610607565b6100d2604435303384610a26565b6100e8604435846001600160a01b03841661073a565b600090815b8361ffff841610156102205761011061010b61ffff85168689610667565b61068d565b90602061012261ffff8616878a610667565b0135604061013561ffff8716888b610667565b0135606061014861ffff8816898c610667565b013590608061015c61ffff89168a8d610667565b0135926001600160a01b038a163b1561021b5760405195632744bf0b60e11b875260018060a01b0316600487015260018060a01b038716602487015260448601526064850152608484015260a483015260843560c483015260008260e4818360018060a01b038b165af190811561020f576101fa926101f492610200575b5060206101ec61ffff8716888b610667565b0135906106ed565b9261063e565b916100ed565b610209906106a1565b386101da565b6040513d6000823e3d90fd5b600080fd5b610289846102527f953aff4c10a4afa8842ad10787814e77e5126afc74e2b982eecfec5ee21debf193604435146106fa565b604080516001600160a01b03909516855260208501919091526044359084015260ff60a43516606084015233929081906080820190565b0390a2005b3461021b5761010036600319011261021b576102a8610501565b6102b0610517565b9060643567ffffffffffffffff811161021b576102d190369060040161052d565b909260a435926001600160a01b038416840361021b5760c43593841515850361021b5760ff60e4351660e4350361021b5761030f604435151561055e565b6103236001600160a01b038316151561059a565b6103376001600160a01b03841615156105d1565b610342841515610607565b610350604435303386610a26565b610366604435836001600160a01b03861661073a565b600092835b8561ffff861610156104985761038961010b61ffff8716888b610667565b90602061039b61ffff8816898c610667565b013560406103ae61ffff89168a8d610667565b013560606103c161ffff8a168b8e610667565b01359060806103d561ffff8b168c8f610667565b0135926001600160a01b0389163b1561021b576040519563050fbad760e01b875260018060a01b0316600487015260018060a01b038716602487015260448601526064850152608484015260a483015260843560c483015260018060a01b03841660e4830152871515610104830152600082610124818360018060a01b038a165af190811561020f576104839261047d92610489575b5060206101ec61ffff89168a8d610667565b9461063e565b9361036b565b610492906106a1565b8a61046b565b610289866104ca7f953aff4c10a4afa8842ad10787814e77e5126afc74e2b982eecfec5ee21debf193604435146106fa565b604080516001600160a01b03909516855260208501919091526044359084015260ff60e43516606084015233929081906080820190565b600435906001600160a01b038216820361021b57565b602435906001600160a01b038216820361021b57565b9181601f8401121561021b5782359167ffffffffffffffff831161021b5760208085019460a0850201011161021b57565b1561056557565b60405162461bcd60e51b815260206004820152600d60248201526c0c17dd1bdd185b105b5bdd5b9d609a1b6044820152606490fd5b156105a157565b60405162461bcd60e51b8152602060048201526008602482015267182fb637b1b5b2b960c11b6044820152606490fd5b156105d857565b60405162461bcd60e51b8152602060048201526007602482015266182fba37b5b2b760c91b6044820152606490fd5b1561060e57565b60405162461bcd60e51b81526020600482015260086024820152676e6f20706c616e7360c01b6044820152606490fd5b61ffff8091169081146106515760010190565b634e487b7160e01b600052601160045260246000fd5b91908110156106775760a0020190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b038116810361021b5790565b67ffffffffffffffff81116106b557604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff8211176106b557604052565b9190820180921161065157565b1561070157565b60405162461bcd60e51b81526020600482015260116024820152703a37ba30b620b6b7bab73a1032b93937b960791b6044820152606490fd5b91604051636eb1769f60e11b815230600482015260208160448160018060a01b038097169687602483015288165afa90811561020f576000916107c8575b5090610783916106ed565b6040519163095ea7b360e01b60208401526024830152604482015260448152608081019181831067ffffffffffffffff8411176106b5576107c6926040526107fe565b565b906020823d82116107f6575b816107e1602093836106cb565b810103126107f3575051610783610778565b80fd5b3d91506107d4565b60018060a01b0316906040516040810167ffffffffffffffff90828110828211176106b5576040526020938483527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858401526000808587829751910182855af1903d15610947573d92831161093357906108999392916040519261088c88601f19601f84011601856106cb565b83523d868885013e610952565b80519182159184831561090b575b5050509050156108b45750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b91938180945001031261092f578201519081151582036107f35750803880846108a7565b5080fd5b634e487b7160e01b85526041600452602485fd5b906108999392506060915b919290156109b45750815115610966575090565b3b1561096f5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156109c75750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610a0d575050604492506000838284010152601f80199101168101030190fd5b84810182015186860160440152938101938593506109ea565b604080516370a0823160e01b8082526001600160a01b03958616600480840182905297602497602097959691959181169493919088858b81895afa948515610bfe57600095610c09575b508751918383521690818b82015288818b81895afa908115610bfe57908791600091610bce575b5010610ba4578651906323b872dd60e01b89830152898201528260448201528560648201526064815260a0810181811067ffffffffffffffff821117610b905791610ae88a928a95948a52876107fe565b8751958693849283528c8301525afa918215610b8557600092610b56575b508103908111610b425703610b1b5750505050565b5162461bcd60e51b815292830152600590820152642a2426181960d91b6044820152606490fd5b84601187634e487b7160e01b600052526000fd5b90918582813d8311610b7e575b610b6d81836106cb565b810103126107f35750519038610b06565b503d610b63565b84513d6000823e3d90fd5b8960418c634e487b7160e01b600052526000fd5b865162461bcd60e51b8152808b018990526005818b01526454484c303160d81b6044820152606490fd5b91508982813d8311610bf7575b610be581836106cb565b810103126107f3575086905138610a97565b503d610bdb565b88513d6000823e3d90fd5b90948982813d8311610c31575b610c2081836106cb565b810103126107f35750519338610a70565b503d610c1656fea26469706673582212206a2b4d1a879dc6852876afb6a6af6c8e426760a350962dbedda50d06e0bb2bca64736f6c63430008130033
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c806394d37b5a1461028e5763ae6253531461003257600080fd5b3461021b5760c036600319011261021b5761004b610501565b610053610517565b9060643567ffffffffffffffff811161021b5761007490369060040161052d565b909260ff60a4351660a4350361021b57610091604435151561055e565b6100a56001600160a01b038416151561059a565b6100b96001600160a01b03821615156105d1565b6100c4821515610607565b6100d2604435303384610a26565b6100e8604435846001600160a01b03841661073a565b600090815b8361ffff841610156102205761011061010b61ffff85168689610667565b61068d565b90602061012261ffff8616878a610667565b0135604061013561ffff8716888b610667565b0135606061014861ffff8816898c610667565b013590608061015c61ffff89168a8d610667565b0135926001600160a01b038a163b1561021b5760405195632744bf0b60e11b875260018060a01b0316600487015260018060a01b038716602487015260448601526064850152608484015260a483015260843560c483015260008260e4818360018060a01b038b165af190811561020f576101fa926101f492610200575b5060206101ec61ffff8716888b610667565b0135906106ed565b9261063e565b916100ed565b610209906106a1565b386101da565b6040513d6000823e3d90fd5b600080fd5b610289846102527f953aff4c10a4afa8842ad10787814e77e5126afc74e2b982eecfec5ee21debf193604435146106fa565b604080516001600160a01b03909516855260208501919091526044359084015260ff60a43516606084015233929081906080820190565b0390a2005b3461021b5761010036600319011261021b576102a8610501565b6102b0610517565b9060643567ffffffffffffffff811161021b576102d190369060040161052d565b909260a435926001600160a01b038416840361021b5760c43593841515850361021b5760ff60e4351660e4350361021b5761030f604435151561055e565b6103236001600160a01b038316151561059a565b6103376001600160a01b03841615156105d1565b610342841515610607565b610350604435303386610a26565b610366604435836001600160a01b03861661073a565b600092835b8561ffff861610156104985761038961010b61ffff8716888b610667565b90602061039b61ffff8816898c610667565b013560406103ae61ffff89168a8d610667565b013560606103c161ffff8a168b8e610667565b01359060806103d561ffff8b168c8f610667565b0135926001600160a01b0389163b1561021b576040519563050fbad760e01b875260018060a01b0316600487015260018060a01b038716602487015260448601526064850152608484015260a483015260843560c483015260018060a01b03841660e4830152871515610104830152600082610124818360018060a01b038a165af190811561020f576104839261047d92610489575b5060206101ec61ffff89168a8d610667565b9461063e565b9361036b565b610492906106a1565b8a61046b565b610289866104ca7f953aff4c10a4afa8842ad10787814e77e5126afc74e2b982eecfec5ee21debf193604435146106fa565b604080516001600160a01b03909516855260208501919091526044359084015260ff60e43516606084015233929081906080820190565b600435906001600160a01b038216820361021b57565b602435906001600160a01b038216820361021b57565b9181601f8401121561021b5782359167ffffffffffffffff831161021b5760208085019460a0850201011161021b57565b1561056557565b60405162461bcd60e51b815260206004820152600d60248201526c0c17dd1bdd185b105b5bdd5b9d609a1b6044820152606490fd5b156105a157565b60405162461bcd60e51b8152602060048201526008602482015267182fb637b1b5b2b960c11b6044820152606490fd5b156105d857565b60405162461bcd60e51b8152602060048201526007602482015266182fba37b5b2b760c91b6044820152606490fd5b1561060e57565b60405162461bcd60e51b81526020600482015260086024820152676e6f20706c616e7360c01b6044820152606490fd5b61ffff8091169081146106515760010190565b634e487b7160e01b600052601160045260246000fd5b91908110156106775760a0020190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b038116810361021b5790565b67ffffffffffffffff81116106b557604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff8211176106b557604052565b9190820180921161065157565b1561070157565b60405162461bcd60e51b81526020600482015260116024820152703a37ba30b620b6b7bab73a1032b93937b960791b6044820152606490fd5b91604051636eb1769f60e11b815230600482015260208160448160018060a01b038097169687602483015288165afa90811561020f576000916107c8575b5090610783916106ed565b6040519163095ea7b360e01b60208401526024830152604482015260448152608081019181831067ffffffffffffffff8411176106b5576107c6926040526107fe565b565b906020823d82116107f6575b816107e1602093836106cb565b810103126107f3575051610783610778565b80fd5b3d91506107d4565b60018060a01b0316906040516040810167ffffffffffffffff90828110828211176106b5576040526020938483527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858401526000808587829751910182855af1903d15610947573d92831161093357906108999392916040519261088c88601f19601f84011601856106cb565b83523d868885013e610952565b80519182159184831561090b575b5050509050156108b45750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b91938180945001031261092f578201519081151582036107f35750803880846108a7565b5080fd5b634e487b7160e01b85526041600452602485fd5b906108999392506060915b919290156109b45750815115610966575090565b3b1561096f5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156109c75750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610a0d575050604492506000838284010152601f80199101168101030190fd5b84810182015186860160440152938101938593506109ea565b604080516370a0823160e01b8082526001600160a01b03958616600480840182905297602497602097959691959181169493919088858b81895afa948515610bfe57600095610c09575b508751918383521690818b82015288818b81895afa908115610bfe57908791600091610bce575b5010610ba4578651906323b872dd60e01b89830152898201528260448201528560648201526064815260a0810181811067ffffffffffffffff821117610b905791610ae88a928a95948a52876107fe565b8751958693849283528c8301525afa918215610b8557600092610b56575b508103908111610b425703610b1b5750505050565b5162461bcd60e51b815292830152600590820152642a2426181960d91b6044820152606490fd5b84601187634e487b7160e01b600052526000fd5b90918582813d8311610b7e575b610b6d81836106cb565b810103126107f35750519038610b06565b503d610b63565b84513d6000823e3d90fd5b8960418c634e487b7160e01b600052526000fd5b865162461bcd60e51b8152808b018990526005818b01526454484c303160d81b6044820152606490fd5b91508982813d8311610bf7575b610be581836106cb565b810103126107f3575086905138610a97565b503d610bdb565b88513d6000823e3d90fd5b90948982813d8311610c31575b610c2081836106cb565b810103126107f35750519338610a70565b503d610c1656fea26469706673582212206a2b4d1a879dc6852876afb6a6af6c8e426760a350962dbedda50d06e0bb2bca64736f6c63430008130033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.