Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
CCCVestingV5
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {ERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import {VestEntity} from "./structs/VestEntity.sol"; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; contract CCCVestingV5 is OwnableUpgradeable, ERC20Upgradeable { using SafeERC20 for IERC20; uint256 public lockUpTime; address private _token; mapping(address => VestEntity[]) private _vestedEntities; event SetTokenAddress(address indexed token); event SetLockUpTime(uint256 lockUpTime); event Vest(address indexed user, uint256 indexed amount); event Refund(address indexed user, uint256 indexed amount); event Claim(address indexed user, uint256 indexed amount); error NA(address from, address to, uint256 amount); constructor() { _disableInitializers(); } function setTokenAddress(address newTokenAddress) external onlyOwner { require(newTokenAddress != address(0), "Zero address"); _token = newTokenAddress; emit SetTokenAddress(newTokenAddress); } function vest(address user, uint256 amount) external onlyOwner { require(user != address(0), "Zero address"); require(amount != 0, "Zero value"); _vestedEntities[user].push( VestEntity(amount, block.timestamp + lockUpTime) ); IERC20(_token).safeTransferFrom(msg.sender, address(this), amount); emit Vest(user, amount); } function refund(address user, uint256 idx) external onlyOwner { require(_vestedEntities[user].length > 0, "User didn't invest"); uint256 vestedAmount = _vestedEntities[user][idx].amount; _vestedEntities[user][idx].amount = 0; IERC20(_token).safeTransfer(msg.sender, vestedAmount); emit Refund(msg.sender, vestedAmount); } function balanceOf(address user) public view override returns (uint256) { VestEntity[] memory entities = _vestedEntities[user]; uint256 sum; for (uint256 i = 0; i < entities.length; i++) { sum += entities[i].amount; } return sum; } function refundBatch( address user, uint256[] memory idxs ) external onlyOwner { VestEntity[] memory entities = _vestedEntities[user]; require(entities.length > 0, "User didn't invest"); uint256 amount = 0; for (uint256 i = 0; i < idxs.length; i++) { amount += entities[i].amount; _vestedEntities[user][i].amount = 0; } IERC20(_token).safeTransfer(msg.sender, amount); emit Refund(msg.sender, amount); } function claim() external { _transfer(true, address(0), 0); } function transferFrom( address from, address to, uint256 amount ) public override returns (bool) { revert NA(from, to, amount); } function transfer( address to, uint256 amount ) public override returns (bool) { _transfer(false, to, amount); return true; } function setLockUpTime(uint256 newLockUpTime) external onlyOwner { require(newLockUpTime != 0, "Zero value"); lockUpTime = newLockUpTime; emit SetLockUpTime(newLockUpTime); } function getVestedEntity( address user, uint256 idx ) external view returns (VestEntity memory) { return _vestedEntities[user][idx]; } function getAllVestedEntities( address user ) external view returns (VestEntity[] memory) { return _vestedEntities[user]; } function getTokenAddress() external view returns (address) { return _token; } function _transfer( bool isClaim, address to, uint256 transferAmount ) internal { address user = msg.sender; require(_vestedEntities[user].length > 0, "User didn't invest"); uint256 maxIdx; VestEntity[] memory entities = _vestedEntities[user]; uint256 amountToSend = 0; for (uint256 i = 0; i < entities.length; i++) { if (entities[i].amount == 0) { continue; } if (block.timestamp > entities[i].lockUpTime) { amountToSend += entities[i].amount; maxIdx = i; if ( !isClaim && amountToSend >= transferAmount && transferAmount != 0 ) { break; } } else if (!isClaim) { revert("Insufficient unlocked balance"); } } _clearUserData(user, maxIdx); if (isClaim) { IERC20(_token).safeTransfer(user, amountToSend); emit Claim(user, amountToSend); } else { IERC20(_token).safeTransfer(to, transferAmount); uint256 remainingAmount = amountToSend - transferAmount; if (remainingAmount > 0) { IERC20(_token).safeTransfer(user, remainingAmount); } emit Transfer(msg.sender, to, transferAmount); } } function _clearUserData(address user, uint256 maxIdx) internal { VestEntity[] memory vestedEntities = _vestedEntities[user]; delete _vestedEntities[user]; for (uint256 i = 0; i < vestedEntities.length; i++) { if (i > maxIdx) { _vestedEntities[user].push( VestEntity( vestedEntities[i].amount, vestedEntities[i].lockUpTime ) ); } } } function addLockupTime( address user, uint256[] memory idxs, uint256 daysToAdd ) external onlyOwner { uint256 secondsToAdd = daysToAdd * 1 days; for (uint256 i = 0; i < idxs.length; i++) { _vestedEntities[user][idxs[i]].lockUpTime += secondsToAdd; } } function removeLockupTime( address user, uint256[] memory idxs, uint256 daysToAdd ) external onlyOwner { uint256 secondsToAdd = daysToAdd * 1 days; for (uint256 i = 0; i < idxs.length; i++) { _vestedEntities[user][idxs[i]].lockUpTime -= secondsToAdd; } } function changeVestingHolder( address currentAddress, address newAddress ) external onlyOwner { require(currentAddress != newAddress, "Same address"); VestEntity[] memory vestedEntities = _vestedEntities[currentAddress]; for (uint256 i = 0; i < vestedEntities.length; i++) { _vestedEntities[newAddress].push( VestEntity( vestedEntities[i].amount, vestedEntities[i].lockUpTime ) ); } delete _vestedEntities[currentAddress]; } function changeLockupTime( address user, uint256[] memory idxs, uint256 newLockupTime ) external onlyOwner { for (uint256 i = 0; i < idxs.length; i++) { _vestedEntities[user][idxs[i]].lockUpTime = newLockupTime; } } function changeLockupTimeMulti( address[] calldata users, uint256[][] calldata idxs, uint256 newLockupTime ) external onlyOwner { require(users.length == idxs.length, "UM"); for (uint256 i = 0; i < users.length; i++) { for (uint256 j = 0; j < idxs[i].length; j++) { _vestedEntities[users[i]][idxs[i][j]] .lockUpTime = newLockupTime; } } } function changeVestingHolderMulti( address[] calldata currentAddresses, address[] calldata newAddresses ) external onlyOwner { require(currentAddresses.length == newAddresses.length, "MA"); for (uint256 i = 0; i < currentAddresses.length; i++) { _changeSingleVestingHolder(currentAddresses[i], newAddresses[i]); } } function _changeSingleVestingHolder( address currentAddress, address newAddress ) internal { require(currentAddress != newAddress, "SA"); VestEntity[] storage vestedEntities = _vestedEntities[currentAddress]; _vestedEntities[newAddress] = vestedEntities; delete _vestedEntities[currentAddress]; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; struct VestEntity { uint256 amount; uint256 lockUpTime; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev 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[49] private __gap; }
// 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.3) (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. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ 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) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20Upgradeable.sol"; import "./extensions/IERC20MetadataUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC20_init_unchained(name_, symbol_); } function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} /** * @dev 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[45] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// 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; } /** * @dev 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.9.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; 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. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * 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 prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// 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 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 * * 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: 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: 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 IERC20Upgradeable { /** * @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 v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20MetadataUpgradeable is IERC20Upgradeable { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NA","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Refund","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"lockUpTime","type":"uint256"}],"name":"SetLockUpTime","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"SetTokenAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Vest","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256[]","name":"idxs","type":"uint256[]"},{"internalType":"uint256","name":"daysToAdd","type":"uint256"}],"name":"addLockupTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256[]","name":"idxs","type":"uint256[]"},{"internalType":"uint256","name":"newLockupTime","type":"uint256"}],"name":"changeLockupTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"},{"internalType":"uint256[][]","name":"idxs","type":"uint256[][]"},{"internalType":"uint256","name":"newLockupTime","type":"uint256"}],"name":"changeLockupTimeMulti","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"currentAddress","type":"address"},{"internalType":"address","name":"newAddress","type":"address"}],"name":"changeVestingHolder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"currentAddresses","type":"address[]"},{"internalType":"address[]","name":"newAddresses","type":"address[]"}],"name":"changeVestingHolderMulti","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getAllVestedEntities","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockUpTime","type":"uint256"}],"internalType":"struct VestEntity[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"idx","type":"uint256"}],"name":"getVestedEntity","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockUpTime","type":"uint256"}],"internalType":"struct VestEntity","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockUpTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"idx","type":"uint256"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256[]","name":"idxs","type":"uint256[]"}],"name":"refundBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256[]","name":"idxs","type":"uint256[]"},{"internalType":"uint256","name":"daysToAdd","type":"uint256"}],"name":"removeLockupTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newLockUpTime","type":"uint256"}],"name":"setLockUpTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTokenAddress","type":"address"}],"name":"setTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"vest","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561000f575f80fd5b5061001861001d565b6100d9565b5f54610100900460ff16156100885760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff908116146100d7575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6121e480620000e75f395ff3fe608060405234801561000f575f80fd5b50600436106101d1575f3560e01c8063715018a6116100fe578063a457c2d71161009e578063e35fe0be1161006e578063e35fe0be146103da578063f2fde38b146103ed578063f3371b9514610400578063f579622b14610413575f80fd5b8063a457c2d714610381578063a9059cbb14610394578063dd30f5c5146103a7578063dd62ed3e146103c7575f80fd5b80638da5cb5b116100d95780638da5cb5b1461034c57806394fec79f1461035d57806395d89b4114610366578063a421acbd1461036e575f80fd5b8063715018a61461031e578063735dc115146103265780637b043d0814610339575f80fd5b8063313ce5671161017457806341d589051161014457806341d58905146102d0578063471a5165146102e35780634e71d92d1461030357806370a082311461030b575f80fd5b8063313ce56714610288578063395093511461029757806340e810cf146102aa578063410085df146102bd575f80fd5b806318160ddd116101af57806318160ddd1461023b57806323b872dd1461024d57806326a4e8d2146102605780632797c6c814610275575f80fd5b806306fdde03146101d5578063095ea7b3146101f357806310fe9ae814610216575b5f80fd5b6101dd610426565b6040516101ea9190611c6e565b60405180910390f35b610206610201366004611cbb565b6104b6565b60405190151581526020016101ea565b6098546001600160a01b03165b6040516001600160a01b0390911681526020016101ea565b6067545b6040519081526020016101ea565b61020661025b366004611ce3565b6104cf565b61027361026e366004611d1c565b610509565b005b610273610283366004611cbb565b61059f565b604051601281526020016101ea565b6102066102a5366004611cbb565b6106e3565b6102736102b8366004611ddd565b610704565b6102736102cb366004611cbb565b6107a9565b6102736102de366004611e78565b6108a3565b6102f66102f1366004611cbb565b610951565b6040516101ea9190611edf565b6102736109bf565b61023f610319366004611d1c565b6109cd565b610273610a9b565b610273610334366004611ef6565b610aac565b610273610347366004611f64565b610bf6565b6033546001600160a01b0316610223565b61023f60975481565b6101dd610d6a565b61027361037c366004611ddd565b610d79565b61020661038f366004611cbb565b610dfd565b6102066103a2366004611cbb565b610e82565b6103ba6103b5366004611d1c565b610e97565b6040516101ea9190611faf565b61023f6103d5366004612005565b610f1c565b6102736103e8366004611ddd565b610f46565b6102736103fb366004611d1c565b610fe4565b61027361040e366004612005565b61105d565b610273610421366004612036565b61120c565b6060606880546104359061204d565b80601f01602080910402602001604051908101604052809291908181526020018280546104619061204d565b80156104ac5780601f10610483576101008083540402835291602001916104ac565b820191905f5260205f20905b81548152906001019060200180831161048f57829003601f168201915b5050505050905090565b5f336104c381858561128b565b60019150505b92915050565b60405163330fcee760e11b81526001600160a01b03808516600483015283166024820152604481018290525f906064015b60405180910390fd5b6105116113ae565b6001600160a01b0381166105565760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b6044820152606401610500565b609880546001600160a01b0319166001600160a01b0383169081179091556040517f33a7e73920e7bb871d64f12f439f70e8d764c488da2188d67bd27ddb60205137905f90a250565b6105a76113ae565b6001600160a01b0382166105ec5760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b6044820152606401610500565b805f036106285760405162461bcd60e51b815260206004820152600a6024820152695a65726f2076616c756560b01b6044820152606401610500565b60995f836001600160a01b03166001600160a01b031681526020019081526020015f2060405180604001604052808381526020016097544261066a9190612099565b90528154600181810184555f938452602093849020835160029093020191825592909101519101556098546106aa906001600160a01b0316333084611408565b60405181906001600160a01b038416907fd4a50953e9ae2104f507446be8391c79b33e1e86e626473e34bb79eb5fea1f3e905f90a35050565b5f336104c38185856106f58383610f1c565b6106ff9190612099565b61128b565b61070c6113ae565b5f61071a82620151806120ac565b90505f5b83518110156107a2576001600160a01b0385165f9081526099602052604090208451839190869084908110610755576107556120c3565b60200260200101518154811061076d5761076d6120c3565b905f5260205f2090600202016001015f82825461078a91906120d7565b9091555081905061079a816120ea565b91505061071e565b5050505050565b6107b16113ae565b6001600160a01b0382165f908152609960205260409020546107e55760405162461bcd60e51b815260040161050090612102565b6001600160a01b0382165f90815260996020526040812080548390811061080e5761080e6120c3565b5f91825260208083206002909202909101546001600160a01b03861683526099909152604082208054919350908490811061084b5761084b6120c3565b5f918252602090912060029091020155609854610872906001600160a01b03163383611473565b604051819033907fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d905f90a3505050565b6108ab6113ae565b8281146108df5760405162461bcd60e51b81526020600482015260026024820152614d4160f01b6044820152606401610500565b5f5b838110156107a25761093f8585838181106108fe576108fe6120c3565b90506020020160208101906109139190611d1c565b848484818110610925576109256120c3565b905060200201602081019061093a9190611d1c565b6114a3565b80610949816120ea565b9150506108e1565b604080518082019091525f80825260208201526001600160a01b0383165f90815260996020526040902080548390811061098d5761098d6120c3565b905f5260205f2090600202016040518060400160405290815f8201548152602001600182015481525050905092915050565b6109cb60015f80611517565b565b6001600160a01b0381165f90815260996020908152604080832080548251818502810185019093528083528493849084015b82821015610a42578382905f5260205f2090600202016040518060400160405290815f8201548152602001600182015481525050815260200190600101906109ff565b5050505090505f805f90505b8251811015610a9357828181518110610a6957610a696120c3565b60200260200101515f015182610a7f9190612099565b915080610a8b816120ea565b915050610a4e565b509392505050565b610aa36113ae565b6109cb5f6117ae565b610ab46113ae565b838214610ae85760405162461bcd60e51b8152602060048201526002602482015261554d60f01b6044820152606401610500565b5f5b84811015610bee575f5b848483818110610b0657610b066120c3565b9050602002810190610b18919061212e565b9050811015610bdb578260995f898986818110610b3757610b376120c3565b9050602002016020810190610b4c9190611d1c565b6001600160a01b03166001600160a01b031681526020019081526020015f20868685818110610b7d57610b7d6120c3565b9050602002810190610b8f919061212e565b84818110610b9f57610b9f6120c3565b9050602002013581548110610bb657610bb66120c3565b5f91825260209091206001600290920201015580610bd3816120ea565b915050610af4565b5080610be6816120ea565b915050610aea565b505050505050565b610bfe6113ae565b6001600160a01b0382165f90815260996020908152604080832080548251818502810185019093528083529192909190849084015b82821015610c76578382905f5260205f2090600202016040518060400160405290815f820154815260200160018201548152505081526020019060010190610c33565b5050505090505f815111610c9c5760405162461bcd60e51b815260040161050090612102565b5f805b8351811015610d2057828181518110610cba57610cba6120c3565b60200260200101515f015182610cd09190612099565b6001600160a01b0386165f9081526099602052604081208054929450909183908110610cfe57610cfe6120c3565b5f91825260209091206002909102015580610d18816120ea565b915050610c9f565b50609854610d38906001600160a01b03163383611473565b604051819033907fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d905f90a350505050565b6060606980546104359061204d565b610d816113ae565b5f5b8251811015610df7576001600160a01b0384165f9081526099602052604090208351839190859084908110610dba57610dba6120c3565b602002602001015181548110610dd257610dd26120c3565b5f91825260209091206001600290920201015580610def816120ea565b915050610d83565b50505050565b5f3381610e0a8286610f1c565b905083811015610e6a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610500565b610e77828686840361128b565b506001949350505050565b5f610e8e5f8484611517565b50600192915050565b6001600160a01b0381165f908152609960209081526040808320805482518185028101850190935280835260609492939192909184015b82821015610f11578382905f5260205f2090600202016040518060400160405290815f820154815260200160018201548152505081526020019060010190610ece565b505050509050919050565b6001600160a01b039182165f90815260666020908152604080832093909416825291909152205490565b610f4e6113ae565b5f610f5c82620151806120ac565b90505f5b83518110156107a2576001600160a01b0385165f9081526099602052604090208451839190869084908110610f9757610f976120c3565b602002602001015181548110610faf57610faf6120c3565b905f5260205f2090600202016001015f828254610fcc9190612099565b90915550819050610fdc816120ea565b915050610f60565b610fec6113ae565b6001600160a01b0381166110515760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610500565b61105a816117ae565b50565b6110656113ae565b806001600160a01b0316826001600160a01b0316036110b55760405162461bcd60e51b815260206004820152600c60248201526b53616d65206164647265737360a01b6044820152606401610500565b6001600160a01b0382165f90815260996020908152604080832080548251818502810185019093528083529192909190849084015b8282101561112d578382905f5260205f2090600202016040518060400160405290815f8201548152602001600182015481525050815260200190600101906110ea565b5050505090505f5b81518110156111e65760995f846001600160a01b03166001600160a01b031681526020019081526020015f20604051806040016040528084848151811061117e5761117e6120c3565b60200260200101515f015181526020018484815181106111a0576111a06120c3565b6020908102919091018101518101519091528254600181810185555f948552938290208351600290920201908155910151910155806111de816120ea565b915050611135565b506001600160a01b0383165f90815260996020526040812061120791611bb8565b505050565b6112146113ae565b805f036112505760405162461bcd60e51b815260206004820152600a6024820152695a65726f2076616c756560b01b6044820152606401610500565b60978190556040518181527f754a98bf1b181b55b821d2056fde8312502382fae7342437137e066bcdf9a1f09060200160405180910390a150565b6001600160a01b0383166112ed5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610500565b6001600160a01b03821661134e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610500565b6001600160a01b038381165f8181526066602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6033546001600160a01b031633146109cb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610500565b6040516001600160a01b0380851660248301528316604482015260648101829052610df79085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526117ff565b6040516001600160a01b03831660248201526044810182905261120790849063a9059cbb60e01b9060640161143c565b806001600160a01b0316826001600160a01b0316036114e95760405162461bcd60e51b8152602060048201526002602482015261534160f01b6044820152606401610500565b6001600160a01b038083165f908152609960205260408082209284168252902081546111e691908390611bd6565b335f818152609960205260409020546115425760405162461bcd60e51b815260040161050090612102565b6001600160a01b0381165f90815260996020908152604080832080548251818502810185019093528083528493849084015b828210156115b7578382905f5260205f2090600202016040518060400160405290815f820154815260200160018201548152505081526020019060010190611574565b5050505090505f805b82518110156116c0578281815181106115db576115db6120c3565b60200260200101515f01515f03156116ae578281815181106115ff576115ff6120c3565b60200260200101516020015142111561166157828181518110611624576116246120c3565b60200260200101515f01518261163a9190612099565b91508093508715801561164d5750858210155b801561165857508515155b6116c0576116ae565b876116ae5760405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e7420756e6c6f636b65642062616c616e63650000006044820152606401610500565b806116b8816120ea565b9150506115c0565b506116cb84846118d2565b8615611722576098546116e8906001600160a01b03168583611473565b60405181906001600160a01b038616907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4905f90a36117a5565b609854611739906001600160a01b03168787611473565b5f61174486836120d7565b9050801561176357609854611763906001600160a01b03168683611473565b6040518681526001600160a01b0388169033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505b50505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f611853826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a2e9092919063ffffffff16565b905080515f14806118735750808060200190518101906118739190612174565b6112075760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610500565b6001600160a01b0382165f90815260996020908152604080832080548251818502810185019093528083529192909190849084015b8282101561194a578382905f5260205f2090600202016040518060400160405290815f820154815260200160018201548152505081526020019060010190611907565b5050506001600160a01b0385165f908152609960205260408120929350611972929150611bb8565b5f5b8151811015610df75782811115611a1c5760995f856001600160a01b03166001600160a01b031681526020019081526020015f2060405180604001604052808484815181106119c5576119c56120c3565b60200260200101515f015181526020018484815181106119e7576119e76120c3565b6020908102919091018101518101519091528254600181810185555f9485529382902083516002909202019081559101519101555b80611a26816120ea565b915050611974565b6060611a3c84845f85611a44565b949350505050565b606082471015611aa55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610500565b5f80866001600160a01b03168587604051611ac09190612193565b5f6040518083038185875af1925050503d805f8114611afa576040519150601f19603f3d011682016040523d82523d5f602084013e611aff565b606091505b5091509150611b1087838387611b1b565b979650505050505050565b60608315611b895782515f03611b82576001600160a01b0385163b611b825760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610500565b5081611a3c565b611a3c8383815115611b9e5781518083602001fd5b8060405162461bcd60e51b81526004016105009190611c6e565b5080545f8255600202905f5260205f209081019061105a9190611c32565b828054828255905f5260205f20906002028101928215611c22575f5260205f209160020282015b82811115611c2257825482556001808401549083015560029283019290910190611bfd565b50611c2e929150611c32565b5090565b5b80821115611c2e575f8082556001820155600201611c33565b5f5b83811015611c66578181015183820152602001611c4e565b50505f910152565b602081525f8251806020840152611c8c816040850160208701611c4c565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114611cb6575f80fd5b919050565b5f8060408385031215611ccc575f80fd5b611cd583611ca0565b946020939093013593505050565b5f805f60608486031215611cf5575f80fd5b611cfe84611ca0565b9250611d0c60208501611ca0565b9150604084013590509250925092565b5f60208284031215611d2c575f80fd5b611d3582611ca0565b9392505050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112611d5f575f80fd5b8135602067ffffffffffffffff80831115611d7c57611d7c611d3c565b8260051b604051601f19603f83011681018181108482111715611da157611da1611d3c565b604052938452858101830193838101925087851115611dbe575f80fd5b83870191505b84821015611b1057813583529183019190830190611dc4565b5f805f60608486031215611def575f80fd5b611df884611ca0565b9250602084013567ffffffffffffffff811115611e13575f80fd5b611e1f86828701611d50565b925050604084013590509250925092565b5f8083601f840112611e40575f80fd5b50813567ffffffffffffffff811115611e57575f80fd5b6020830191508360208260051b8501011115611e71575f80fd5b9250929050565b5f805f8060408587031215611e8b575f80fd5b843567ffffffffffffffff80821115611ea2575f80fd5b611eae88838901611e30565b90965094506020870135915080821115611ec6575f80fd5b50611ed387828801611e30565b95989497509550505050565b8151815260208083015190820152604081016104c9565b5f805f805f60608688031215611f0a575f80fd5b853567ffffffffffffffff80821115611f21575f80fd5b611f2d89838a01611e30565b90975095506020880135915080821115611f45575f80fd5b50611f5288828901611e30565b96999598509660400135949350505050565b5f8060408385031215611f75575f80fd5b611f7e83611ca0565b9150602083013567ffffffffffffffff811115611f99575f80fd5b611fa585828601611d50565b9150509250929050565b602080825282518282018190525f919060409081850190868401855b82811015611ff857611fe884835180518252602090810151910152565b9284019290850190600101611fcb565b5091979650505050505050565b5f8060408385031215612016575f80fd5b61201f83611ca0565b915061202d60208401611ca0565b90509250929050565b5f60208284031215612046575f80fd5b5035919050565b600181811c9082168061206157607f821691505b60208210810361207f57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b808201808211156104c9576104c9612085565b80820281158282048414176104c9576104c9612085565b634e487b7160e01b5f52603260045260245ffd5b818103818111156104c9576104c9612085565b5f600182016120fb576120fb612085565b5060010190565b602080825260129082015271155cd95c88191a591b89dd081a5b9d995cdd60721b604082015260600190565b5f808335601e19843603018112612143575f80fd5b83018035915067ffffffffffffffff82111561215d575f80fd5b6020019150600581901b3603821315611e71575f80fd5b5f60208284031215612184575f80fd5b81518015158114611d35575f80fd5b5f82516121a4818460208701611c4c565b919091019291505056fea26469706673582212206639ae0e91bf209c3754f32140a2fe5dbffbf6073b16556e27eedc4ae74308b364736f6c63430008140033
Deployed Bytecode
0x608060405234801561000f575f80fd5b50600436106101d1575f3560e01c8063715018a6116100fe578063a457c2d71161009e578063e35fe0be1161006e578063e35fe0be146103da578063f2fde38b146103ed578063f3371b9514610400578063f579622b14610413575f80fd5b8063a457c2d714610381578063a9059cbb14610394578063dd30f5c5146103a7578063dd62ed3e146103c7575f80fd5b80638da5cb5b116100d95780638da5cb5b1461034c57806394fec79f1461035d57806395d89b4114610366578063a421acbd1461036e575f80fd5b8063715018a61461031e578063735dc115146103265780637b043d0814610339575f80fd5b8063313ce5671161017457806341d589051161014457806341d58905146102d0578063471a5165146102e35780634e71d92d1461030357806370a082311461030b575f80fd5b8063313ce56714610288578063395093511461029757806340e810cf146102aa578063410085df146102bd575f80fd5b806318160ddd116101af57806318160ddd1461023b57806323b872dd1461024d57806326a4e8d2146102605780632797c6c814610275575f80fd5b806306fdde03146101d5578063095ea7b3146101f357806310fe9ae814610216575b5f80fd5b6101dd610426565b6040516101ea9190611c6e565b60405180910390f35b610206610201366004611cbb565b6104b6565b60405190151581526020016101ea565b6098546001600160a01b03165b6040516001600160a01b0390911681526020016101ea565b6067545b6040519081526020016101ea565b61020661025b366004611ce3565b6104cf565b61027361026e366004611d1c565b610509565b005b610273610283366004611cbb565b61059f565b604051601281526020016101ea565b6102066102a5366004611cbb565b6106e3565b6102736102b8366004611ddd565b610704565b6102736102cb366004611cbb565b6107a9565b6102736102de366004611e78565b6108a3565b6102f66102f1366004611cbb565b610951565b6040516101ea9190611edf565b6102736109bf565b61023f610319366004611d1c565b6109cd565b610273610a9b565b610273610334366004611ef6565b610aac565b610273610347366004611f64565b610bf6565b6033546001600160a01b0316610223565b61023f60975481565b6101dd610d6a565b61027361037c366004611ddd565b610d79565b61020661038f366004611cbb565b610dfd565b6102066103a2366004611cbb565b610e82565b6103ba6103b5366004611d1c565b610e97565b6040516101ea9190611faf565b61023f6103d5366004612005565b610f1c565b6102736103e8366004611ddd565b610f46565b6102736103fb366004611d1c565b610fe4565b61027361040e366004612005565b61105d565b610273610421366004612036565b61120c565b6060606880546104359061204d565b80601f01602080910402602001604051908101604052809291908181526020018280546104619061204d565b80156104ac5780601f10610483576101008083540402835291602001916104ac565b820191905f5260205f20905b81548152906001019060200180831161048f57829003601f168201915b5050505050905090565b5f336104c381858561128b565b60019150505b92915050565b60405163330fcee760e11b81526001600160a01b03808516600483015283166024820152604481018290525f906064015b60405180910390fd5b6105116113ae565b6001600160a01b0381166105565760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b6044820152606401610500565b609880546001600160a01b0319166001600160a01b0383169081179091556040517f33a7e73920e7bb871d64f12f439f70e8d764c488da2188d67bd27ddb60205137905f90a250565b6105a76113ae565b6001600160a01b0382166105ec5760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b6044820152606401610500565b805f036106285760405162461bcd60e51b815260206004820152600a6024820152695a65726f2076616c756560b01b6044820152606401610500565b60995f836001600160a01b03166001600160a01b031681526020019081526020015f2060405180604001604052808381526020016097544261066a9190612099565b90528154600181810184555f938452602093849020835160029093020191825592909101519101556098546106aa906001600160a01b0316333084611408565b60405181906001600160a01b038416907fd4a50953e9ae2104f507446be8391c79b33e1e86e626473e34bb79eb5fea1f3e905f90a35050565b5f336104c38185856106f58383610f1c565b6106ff9190612099565b61128b565b61070c6113ae565b5f61071a82620151806120ac565b90505f5b83518110156107a2576001600160a01b0385165f9081526099602052604090208451839190869084908110610755576107556120c3565b60200260200101518154811061076d5761076d6120c3565b905f5260205f2090600202016001015f82825461078a91906120d7565b9091555081905061079a816120ea565b91505061071e565b5050505050565b6107b16113ae565b6001600160a01b0382165f908152609960205260409020546107e55760405162461bcd60e51b815260040161050090612102565b6001600160a01b0382165f90815260996020526040812080548390811061080e5761080e6120c3565b5f91825260208083206002909202909101546001600160a01b03861683526099909152604082208054919350908490811061084b5761084b6120c3565b5f918252602090912060029091020155609854610872906001600160a01b03163383611473565b604051819033907fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d905f90a3505050565b6108ab6113ae565b8281146108df5760405162461bcd60e51b81526020600482015260026024820152614d4160f01b6044820152606401610500565b5f5b838110156107a25761093f8585838181106108fe576108fe6120c3565b90506020020160208101906109139190611d1c565b848484818110610925576109256120c3565b905060200201602081019061093a9190611d1c565b6114a3565b80610949816120ea565b9150506108e1565b604080518082019091525f80825260208201526001600160a01b0383165f90815260996020526040902080548390811061098d5761098d6120c3565b905f5260205f2090600202016040518060400160405290815f8201548152602001600182015481525050905092915050565b6109cb60015f80611517565b565b6001600160a01b0381165f90815260996020908152604080832080548251818502810185019093528083528493849084015b82821015610a42578382905f5260205f2090600202016040518060400160405290815f8201548152602001600182015481525050815260200190600101906109ff565b5050505090505f805f90505b8251811015610a9357828181518110610a6957610a696120c3565b60200260200101515f015182610a7f9190612099565b915080610a8b816120ea565b915050610a4e565b509392505050565b610aa36113ae565b6109cb5f6117ae565b610ab46113ae565b838214610ae85760405162461bcd60e51b8152602060048201526002602482015261554d60f01b6044820152606401610500565b5f5b84811015610bee575f5b848483818110610b0657610b066120c3565b9050602002810190610b18919061212e565b9050811015610bdb578260995f898986818110610b3757610b376120c3565b9050602002016020810190610b4c9190611d1c565b6001600160a01b03166001600160a01b031681526020019081526020015f20868685818110610b7d57610b7d6120c3565b9050602002810190610b8f919061212e565b84818110610b9f57610b9f6120c3565b9050602002013581548110610bb657610bb66120c3565b5f91825260209091206001600290920201015580610bd3816120ea565b915050610af4565b5080610be6816120ea565b915050610aea565b505050505050565b610bfe6113ae565b6001600160a01b0382165f90815260996020908152604080832080548251818502810185019093528083529192909190849084015b82821015610c76578382905f5260205f2090600202016040518060400160405290815f820154815260200160018201548152505081526020019060010190610c33565b5050505090505f815111610c9c5760405162461bcd60e51b815260040161050090612102565b5f805b8351811015610d2057828181518110610cba57610cba6120c3565b60200260200101515f015182610cd09190612099565b6001600160a01b0386165f9081526099602052604081208054929450909183908110610cfe57610cfe6120c3565b5f91825260209091206002909102015580610d18816120ea565b915050610c9f565b50609854610d38906001600160a01b03163383611473565b604051819033907fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d905f90a350505050565b6060606980546104359061204d565b610d816113ae565b5f5b8251811015610df7576001600160a01b0384165f9081526099602052604090208351839190859084908110610dba57610dba6120c3565b602002602001015181548110610dd257610dd26120c3565b5f91825260209091206001600290920201015580610def816120ea565b915050610d83565b50505050565b5f3381610e0a8286610f1c565b905083811015610e6a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610500565b610e77828686840361128b565b506001949350505050565b5f610e8e5f8484611517565b50600192915050565b6001600160a01b0381165f908152609960209081526040808320805482518185028101850190935280835260609492939192909184015b82821015610f11578382905f5260205f2090600202016040518060400160405290815f820154815260200160018201548152505081526020019060010190610ece565b505050509050919050565b6001600160a01b039182165f90815260666020908152604080832093909416825291909152205490565b610f4e6113ae565b5f610f5c82620151806120ac565b90505f5b83518110156107a2576001600160a01b0385165f9081526099602052604090208451839190869084908110610f9757610f976120c3565b602002602001015181548110610faf57610faf6120c3565b905f5260205f2090600202016001015f828254610fcc9190612099565b90915550819050610fdc816120ea565b915050610f60565b610fec6113ae565b6001600160a01b0381166110515760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610500565b61105a816117ae565b50565b6110656113ae565b806001600160a01b0316826001600160a01b0316036110b55760405162461bcd60e51b815260206004820152600c60248201526b53616d65206164647265737360a01b6044820152606401610500565b6001600160a01b0382165f90815260996020908152604080832080548251818502810185019093528083529192909190849084015b8282101561112d578382905f5260205f2090600202016040518060400160405290815f8201548152602001600182015481525050815260200190600101906110ea565b5050505090505f5b81518110156111e65760995f846001600160a01b03166001600160a01b031681526020019081526020015f20604051806040016040528084848151811061117e5761117e6120c3565b60200260200101515f015181526020018484815181106111a0576111a06120c3565b6020908102919091018101518101519091528254600181810185555f948552938290208351600290920201908155910151910155806111de816120ea565b915050611135565b506001600160a01b0383165f90815260996020526040812061120791611bb8565b505050565b6112146113ae565b805f036112505760405162461bcd60e51b815260206004820152600a6024820152695a65726f2076616c756560b01b6044820152606401610500565b60978190556040518181527f754a98bf1b181b55b821d2056fde8312502382fae7342437137e066bcdf9a1f09060200160405180910390a150565b6001600160a01b0383166112ed5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610500565b6001600160a01b03821661134e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610500565b6001600160a01b038381165f8181526066602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6033546001600160a01b031633146109cb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610500565b6040516001600160a01b0380851660248301528316604482015260648101829052610df79085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526117ff565b6040516001600160a01b03831660248201526044810182905261120790849063a9059cbb60e01b9060640161143c565b806001600160a01b0316826001600160a01b0316036114e95760405162461bcd60e51b8152602060048201526002602482015261534160f01b6044820152606401610500565b6001600160a01b038083165f908152609960205260408082209284168252902081546111e691908390611bd6565b335f818152609960205260409020546115425760405162461bcd60e51b815260040161050090612102565b6001600160a01b0381165f90815260996020908152604080832080548251818502810185019093528083528493849084015b828210156115b7578382905f5260205f2090600202016040518060400160405290815f820154815260200160018201548152505081526020019060010190611574565b5050505090505f805b82518110156116c0578281815181106115db576115db6120c3565b60200260200101515f01515f03156116ae578281815181106115ff576115ff6120c3565b60200260200101516020015142111561166157828181518110611624576116246120c3565b60200260200101515f01518261163a9190612099565b91508093508715801561164d5750858210155b801561165857508515155b6116c0576116ae565b876116ae5760405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e7420756e6c6f636b65642062616c616e63650000006044820152606401610500565b806116b8816120ea565b9150506115c0565b506116cb84846118d2565b8615611722576098546116e8906001600160a01b03168583611473565b60405181906001600160a01b038616907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4905f90a36117a5565b609854611739906001600160a01b03168787611473565b5f61174486836120d7565b9050801561176357609854611763906001600160a01b03168683611473565b6040518681526001600160a01b0388169033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505b50505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f611853826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a2e9092919063ffffffff16565b905080515f14806118735750808060200190518101906118739190612174565b6112075760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610500565b6001600160a01b0382165f90815260996020908152604080832080548251818502810185019093528083529192909190849084015b8282101561194a578382905f5260205f2090600202016040518060400160405290815f820154815260200160018201548152505081526020019060010190611907565b5050506001600160a01b0385165f908152609960205260408120929350611972929150611bb8565b5f5b8151811015610df75782811115611a1c5760995f856001600160a01b03166001600160a01b031681526020019081526020015f2060405180604001604052808484815181106119c5576119c56120c3565b60200260200101515f015181526020018484815181106119e7576119e76120c3565b6020908102919091018101518101519091528254600181810185555f9485529382902083516002909202019081559101519101555b80611a26816120ea565b915050611974565b6060611a3c84845f85611a44565b949350505050565b606082471015611aa55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610500565b5f80866001600160a01b03168587604051611ac09190612193565b5f6040518083038185875af1925050503d805f8114611afa576040519150601f19603f3d011682016040523d82523d5f602084013e611aff565b606091505b5091509150611b1087838387611b1b565b979650505050505050565b60608315611b895782515f03611b82576001600160a01b0385163b611b825760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610500565b5081611a3c565b611a3c8383815115611b9e5781518083602001fd5b8060405162461bcd60e51b81526004016105009190611c6e565b5080545f8255600202905f5260205f209081019061105a9190611c32565b828054828255905f5260205f20906002028101928215611c22575f5260205f209160020282015b82811115611c2257825482556001808401549083015560029283019290910190611bfd565b50611c2e929150611c32565b5090565b5b80821115611c2e575f8082556001820155600201611c33565b5f5b83811015611c66578181015183820152602001611c4e565b50505f910152565b602081525f8251806020840152611c8c816040850160208701611c4c565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114611cb6575f80fd5b919050565b5f8060408385031215611ccc575f80fd5b611cd583611ca0565b946020939093013593505050565b5f805f60608486031215611cf5575f80fd5b611cfe84611ca0565b9250611d0c60208501611ca0565b9150604084013590509250925092565b5f60208284031215611d2c575f80fd5b611d3582611ca0565b9392505050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112611d5f575f80fd5b8135602067ffffffffffffffff80831115611d7c57611d7c611d3c565b8260051b604051601f19603f83011681018181108482111715611da157611da1611d3c565b604052938452858101830193838101925087851115611dbe575f80fd5b83870191505b84821015611b1057813583529183019190830190611dc4565b5f805f60608486031215611def575f80fd5b611df884611ca0565b9250602084013567ffffffffffffffff811115611e13575f80fd5b611e1f86828701611d50565b925050604084013590509250925092565b5f8083601f840112611e40575f80fd5b50813567ffffffffffffffff811115611e57575f80fd5b6020830191508360208260051b8501011115611e71575f80fd5b9250929050565b5f805f8060408587031215611e8b575f80fd5b843567ffffffffffffffff80821115611ea2575f80fd5b611eae88838901611e30565b90965094506020870135915080821115611ec6575f80fd5b50611ed387828801611e30565b95989497509550505050565b8151815260208083015190820152604081016104c9565b5f805f805f60608688031215611f0a575f80fd5b853567ffffffffffffffff80821115611f21575f80fd5b611f2d89838a01611e30565b90975095506020880135915080821115611f45575f80fd5b50611f5288828901611e30565b96999598509660400135949350505050565b5f8060408385031215611f75575f80fd5b611f7e83611ca0565b9150602083013567ffffffffffffffff811115611f99575f80fd5b611fa585828601611d50565b9150509250929050565b602080825282518282018190525f919060409081850190868401855b82811015611ff857611fe884835180518252602090810151910152565b9284019290850190600101611fcb565b5091979650505050505050565b5f8060408385031215612016575f80fd5b61201f83611ca0565b915061202d60208401611ca0565b90509250929050565b5f60208284031215612046575f80fd5b5035919050565b600181811c9082168061206157607f821691505b60208210810361207f57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b808201808211156104c9576104c9612085565b80820281158282048414176104c9576104c9612085565b634e487b7160e01b5f52603260045260245ffd5b818103818111156104c9576104c9612085565b5f600182016120fb576120fb612085565b5060010190565b602080825260129082015271155cd95c88191a591b89dd081a5b9d995cdd60721b604082015260600190565b5f808335601e19843603018112612143575f80fd5b83018035915067ffffffffffffffff82111561215d575f80fd5b6020019150600581901b3603821315611e71575f80fd5b5f60208284031215612184575f80fd5b81518015158114611d35575f80fd5b5f82516121a4818460208701611c4c565b919091019291505056fea26469706673582212206639ae0e91bf209c3754f32140a2fe5dbffbf6073b16556e27eedc4ae74308b364736f6c63430008140033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.