More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
TieredStakingPool
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; contract TieredStakingPool is Ownable, ReentrancyGuard, Pausable { using SafeERC20 for IERC20; // Structs struct Tier { uint256 maxTokens; uint256 annualInterestRate; uint256 lockDuration; uint256 totalStaked; } struct Deposit { uint256 amount; uint256 tierIndex; uint256 depositTime; bool withdrawn; } IERC20 public token; Tier[] public tiers; mapping(address => Deposit[]) public deposits; // Events /// @notice Emitted when adding a new tiered staking pool event TierAdded(uint256 indexed tierIndex, uint256 maxTokens, uint256 annualInterestRate, uint256 lockDuration); /// @notice Emitted when depositing staking in the tiered staking pool event Deposited(address indexed user, uint256 amount, uint256 tierIndex); /// @notice Emitted when unlocking staking in the tiered staking pool after the maturity event Withdrawn(address indexed user, uint256 principal, uint256 interest); // Errors error ZeroAddress(); error InvalidInterestRate(uint256 interestRate); error InvalidBatchTiers(); error ZeroLockDuration(); error ZeroStakeAmount(); error NotEnoughCapacityInTier(); error InvalidStartIndex(uint256 tierIndex); error InvalidTierIndex(uint256 tierIndex); error ZeroWithdrawAmount(); constructor(IERC20 _token, address _owner) Ownable(_owner) { if (address(_token) == address(0) || _owner == address(0)) { revert ZeroAddress(); } token = _token; } /** * @notice Getting all tiered staking pools */ function getTiers() external view returns (Tier[] memory) { return tiers; } /** * @notice Getting all users' deposits * @param user The user address */ function getUserDeposits(address user) external view returns (Deposit[] memory) { return deposits[user]; } /** * @notice Added a tiered staking pool * @param _maxTokens The maximum tokens can be staked in the tiered staking pool * @param _annualInterestRate The percentage of annual interest rate * @param _lockDuration The period time of staking */ function addTier( uint256 _maxTokens, uint256 _annualInterestRate, uint256 _lockDuration ) external onlyOwner { _addTier(_maxTokens, _annualInterestRate, _lockDuration); } /** * @notice Added a tiered staking pool * @param maxTokens The maximum tokens can be staked in the tiered staking pool * @param annualInterestRates The percentages of annual interest rate * @param lockDurations The period time of staking */ function addBatchTier( uint256[] memory maxTokens, uint256[] memory annualInterestRates, uint256[] memory lockDurations ) external onlyOwner { if (maxTokens.length != annualInterestRates.length || maxTokens.length != lockDurations.length ) { revert InvalidBatchTiers(); } for (uint256 i = 0; i < maxTokens.length; i++) { _addTier( maxTokens[i], annualInterestRates[i], lockDurations[i] ); } } /** * @notice Depositing tokens in the tiered staking pools * @param amount The amount of tokens staked in the tiered staking pools */ function deposit(uint256 amount) external nonReentrant whenNotPaused { if (amount == 0) { revert ZeroStakeAmount(); } token.safeTransferFrom(msg.sender, address(this), amount); uint256 remaining = amount; for (uint256 i = 0; i < tiers.length && remaining > 0; i++) { Tier storage tier = tiers[i]; uint256 available = tier.maxTokens - tier.totalStaked; uint256 depositInTier = remaining <= available ? remaining : available; if (depositInTier > 0) { deposits[msg.sender].push( Deposit({ amount: depositInTier, tierIndex: i, depositTime: block.timestamp, withdrawn: false }) ); tier.totalStaked += depositInTier; remaining -= depositInTier; emit Deposited(msg.sender, depositInTier, i); } } if (remaining > 0) { revert NotEnoughCapacityInTier(); } } /** * @notice Depositing tokens in the specific tiered staking pool * @param tierIndex The index of the tiered staking pool * @param amount The amount of tokens staked in the tiered staking pool */ function depositIntoTier(uint256 tierIndex, uint256 amount) external nonReentrant whenNotPaused { if (tierIndex >= tiers.length) revert InvalidTierIndex(tierIndex); if (amount == 0) revert ZeroStakeAmount(); Tier storage tier = tiers[tierIndex]; uint256 available = tier.maxTokens - tier.totalStaked; if (amount > available) revert NotEnoughCapacityInTier(); token.safeTransferFrom(msg.sender, address(this), amount); deposits[msg.sender].push( Deposit({ amount: amount, tierIndex: tierIndex, depositTime: block.timestamp, withdrawn: false }) ); tier.totalStaked += amount; emit Deposited(msg.sender, amount, tierIndex); } /** * @notice Withdrawing staking tokens after the maturity * @param startIndex The start index to look up in the users' deposits * @param batchSize The size will be loop from the start index in the users' deposits */ function withdrawBatch(uint256 startIndex, uint256 batchSize) external nonReentrant { Deposit[] storage userDeposits = deposits[msg.sender]; if (startIndex >= userDeposits.length) { revert InvalidStartIndex(startIndex); } uint256 totalPrincipal; uint256 totalInterest; uint256 processed = 0; uint256 end = userDeposits.length; uint256 limit = startIndex + batchSize; if (limit < end) { end = limit; } for (uint256 i = startIndex; i < end; i++) { Deposit storage dep = userDeposits[i]; if (!dep.withdrawn) { Tier storage tier = tiers[dep.tierIndex]; if (block.timestamp >= dep.depositTime + tier.lockDuration) { uint256 interest = (dep.amount * tier.annualInterestRate * tier.lockDuration) / (365 days * 10000); totalPrincipal += dep.amount; totalInterest += interest; dep.withdrawn = true; if (tier.totalStaked >= dep.amount) { tier.totalStaked -= dep.amount; } else { tier.totalStaked = 0; } processed++; } } } if (totalPrincipal == 0) { revert ZeroWithdrawAmount(); } uint256 payout = totalPrincipal + totalInterest; token.safeTransfer(msg.sender, payout); emit Withdrawn(msg.sender, totalPrincipal, totalInterest); } /** * @notice Withdrawing all staking tokens after the maturity */ function withdrawAll() external nonReentrant whenNotPaused { Deposit[] storage userDeposits = deposits[msg.sender]; uint256 totalPrincipal; uint256 totalInterest; for (uint256 i = 0; i < userDeposits.length; i++) { Deposit storage dep = userDeposits[i]; if (!dep.withdrawn) { Tier storage tier = tiers[dep.tierIndex]; if (block.timestamp >= dep.depositTime + tier.lockDuration) { uint256 interest = (dep.amount * tier.annualInterestRate * tier.lockDuration) / (365 days * 10000); totalPrincipal += dep.amount; totalInterest += interest; dep.withdrawn = true; if (tier.totalStaked >= dep.amount) { tier.totalStaked -= dep.amount; } else { tier.totalStaked = 0; } } } } if (totalPrincipal == 0) { revert ZeroWithdrawAmount(); } uint256 payout = totalPrincipal + totalInterest; token.safeTransfer(msg.sender, payout); emit Withdrawn(msg.sender, totalPrincipal, totalInterest); } /** * @notice Pause stake and deposit. For emergency use. * @dev Event already defined and emitted in Pausable.sol */ function pause() public onlyOwner { _pause(); } /** * @notice Unpause stake and deposit. * @dev Event already defined and emitted in Pausable.sol */ function unpause() public onlyOwner { _unpause(); } /** * @notice Added a tiered staking pool * @param _maxTokens The maximum tokens can be staked in the tiered staking pool * @param _annualInterestRate The percentage of annual interest rate * @param _lockDuration The period time of staking */ function _addTier( uint256 _maxTokens, uint256 _annualInterestRate, uint256 _lockDuration ) internal { if (_annualInterestRate > 10000) { revert InvalidInterestRate(_annualInterestRate); } if (_lockDuration == 0) { revert ZeroLockDuration(); } tiers.push( Tier({ maxTokens: _maxTokens, annualInterestRate: _annualInterestRate, lockDuration: _lockDuration, totalStaked: 0 }) ); emit TierAdded(tiers.length - 1, _maxTokens, _annualInterestRate, _lockDuration); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC1363} from "../../../interfaces/IERC1363.sol"; import {Address} from "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC-20 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 { /** * @dev An operation with an ERC-20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @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.encodeCall(token.transfer, (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.encodeCall(token.transferFrom, (from, to, 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. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @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. * * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being * set here. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { safeTransfer(token, to, value); } else if (!token.transferAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferFromAndCallRelaxed( IERC1363 token, address from, address to, uint256 value, bytes memory data ) internal { if (to.code.length == 0) { safeTransferFrom(token, from, to, value); } else if (!token.transferFromAndCall(from, to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}. * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall} * once without retrying, and relies on the returned value to be true. * * Reverts if the returned value is other than `true`. */ function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { forceApprove(token, to, value); } else if (!token.approveAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @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 {_callOptionalReturnBool} that reverts if call fails to meet the requirements. */ function _callOptionalReturn(IERC20 token, bytes memory data) private { uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) // bubble errors if iszero(success) { let ptr := mload(0x40) returndatacopy(ptr, 0, returndatasize()) revert(ptr, returndatasize()) } returnSize := returndatasize() returnValue := mload(0) } if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) { revert SafeERC20FailedOperation(address(token)); } } /** * @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 silently catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { bool success; uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) returnSize := returndatasize() returnValue := mload(0) } return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.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. * * The initial owner is set to the address provided by the deployer. 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 Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @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 { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @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 { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at, * consider using {ReentrancyGuardTransient} instead. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { bool private _paused; /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); /** * @dev The operation failed because the contract is paused. */ error EnforcedPause(); /** * @dev The operation failed because the contract is not paused. */ error ExpectedPause(); /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { if (paused()) { revert EnforcedPause(); } } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { if (!paused()) { revert ExpectedPause(); } } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ 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 value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` 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 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC165} from "./IERC165.sol"; /** * @title IERC1363 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363]. * * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction. */ interface IERC1363 is IERC20, IERC165 { /* * Note: the ERC-165 identifier for this interface is 0xb0202a11. * 0xb0202a11 === * bytes4(keccak256('transferAndCall(address,uint256)')) ^ * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^ * bytes4(keccak256('approveAndCall(address,uint256)')) ^ * bytes4(keccak256('approveAndCall(address,uint256,bytes)')) */ /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @param data Additional data with no specified format, sent in call to `spender`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol) pragma solidity ^0.8.20; import {Errors} from "./Errors.sol"; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert Errors.InsufficientBalance(address(this).balance, amount); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert Errors.FailedCall(); } } /** * @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 or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {Errors.FailedCall} error. * * 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. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @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`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert Errors.InsufficientBalance(address(this).balance, value); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case * of an unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {Errors.FailedCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}. */ function _revert(bytes memory returndata) 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 assembly ("memory-safe") { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert Errors.FailedCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol) pragma solidity ^0.8.20; /** * @dev Collection of common custom errors used in multiple contracts * * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library. * It is recommended to avoid relying on the error API for critical functionality. * * _Available since v5.1._ */ library Errors { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error InsufficientBalance(uint256 balance, uint256 needed); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedCall(); /** * @dev The deployment failed. */ error FailedDeployment(); /** * @dev A necessary precompile is missing. */ error MissingPrecompile(address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[ERC]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "remappings": [ "@account-abstraction/=lib/account-abstraction/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "@uniswap/v2-core/contracts/=lib/v2-core/contracts/", "@uniswap/v2-periphery/contracts/=lib/v2-periphery/contracts/", "@uniswap/lib/contracts/=lib/solidity-lib/contracts/", "solmate/=lib/solmate/src/", "account-abstraction/=lib/account-abstraction/contracts/", "ds-test/=lib/solmate/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "solidity-lib/=lib/solidity-lib/contracts/", "v2-core/=lib/v2-core/contracts/", "v2-periphery/=lib/v2-periphery/contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "cancun", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"InvalidBatchTiers","type":"error"},{"inputs":[{"internalType":"uint256","name":"interestRate","type":"uint256"}],"name":"InvalidInterestRate","type":"error"},{"inputs":[{"internalType":"uint256","name":"tierIndex","type":"uint256"}],"name":"InvalidStartIndex","type":"error"},{"inputs":[{"internalType":"uint256","name":"tierIndex","type":"uint256"}],"name":"InvalidTierIndex","type":"error"},{"inputs":[],"name":"NotEnoughCapacityInTier","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroLockDuration","type":"error"},{"inputs":[],"name":"ZeroStakeAmount","type":"error"},{"inputs":[],"name":"ZeroWithdrawAmount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tierIndex","type":"uint256"}],"name":"Deposited","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tierIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxTokens","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"annualInterestRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockDuration","type":"uint256"}],"name":"TierAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"principal","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"interest","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"uint256[]","name":"maxTokens","type":"uint256[]"},{"internalType":"uint256[]","name":"annualInterestRates","type":"uint256[]"},{"internalType":"uint256[]","name":"lockDurations","type":"uint256[]"}],"name":"addBatchTier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxTokens","type":"uint256"},{"internalType":"uint256","name":"_annualInterestRate","type":"uint256"},{"internalType":"uint256","name":"_lockDuration","type":"uint256"}],"name":"addTier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tierIndex","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositIntoTier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"deposits","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"tierIndex","type":"uint256"},{"internalType":"uint256","name":"depositTime","type":"uint256"},{"internalType":"bool","name":"withdrawn","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTiers","outputs":[{"components":[{"internalType":"uint256","name":"maxTokens","type":"uint256"},{"internalType":"uint256","name":"annualInterestRate","type":"uint256"},{"internalType":"uint256","name":"lockDuration","type":"uint256"},{"internalType":"uint256","name":"totalStaked","type":"uint256"}],"internalType":"struct TieredStakingPool.Tier[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserDeposits","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"tierIndex","type":"uint256"},{"internalType":"uint256","name":"depositTime","type":"uint256"},{"internalType":"bool","name":"withdrawn","type":"bool"}],"internalType":"struct TieredStakingPool.Deposit[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tiers","outputs":[{"internalType":"uint256","name":"maxTokens","type":"uint256"},{"internalType":"uint256","name":"annualInterestRate","type":"uint256"},{"internalType":"uint256","name":"lockDuration","type":"uint256"},{"internalType":"uint256","name":"totalStaked","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startIndex","type":"uint256"},{"internalType":"uint256","name":"batchSize","type":"uint256"}],"name":"withdrawBatch","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60803461011f57601f61119438819003918201601f19168301916001600160401b0383118484101761012357808492604094855283398101031261011f578051906001600160a01b0382169081830361011f57602001516001600160a01b038116929083900361011f57821561010c575f80546001600160a01b031981168517825560405194916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a36001805560025491158015610105575b6100f6576001600160a81b031990911660089190911b610100600160a81b03161760025561105c90816101388239f35b63d92e233d60e01b5f5260045ffd5b505f6100c6565b631e4fbdf760e01b5f525f60045260245ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60806040526004361015610011575f80fd5b5f3560e01c8063039af9eb14610ba85780632a5bf6d214610a9b5780633f4ba83a14610a3557806352b86e1f146108e95780635c975abb146108c75780636358ec571461089d578063715018a6146108465780638456cb59146107ed578063853828b6146106735780638da5cb5b1461064c578063993a381814610551578063a69410ef14610468578063b6b55f251461030b578063d6d6817714610291578063de17057014610189578063f2fde38b146101045763fc0c546a146100d4575f80fd5b34610100575f3660031901126101005760025460405160089190911c6001600160a01b03168152602090f35b5f80fd5b346101005760203660031901126101005761011d610c46565b610125610e01565b6001600160a01b03168015610176575f80546001600160a01b03198116831782556001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3005b631e4fbdf760e01b5f525f60045260245ffd5b34610100575f366003190112610100576003546101a581610cc4565b906101b36040519283610ca2565b80825260208201908160035f527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5f915b838310610250578486604051918291602083019060208452518091526040830191905f5b818110610216575050500390f35b9193509160206080600192606087518051835284810151858401526040810151604084015201516060820152019401910191849392610208565b6004602060019260405161026381610c72565b85548152848601548382015260028601546040820152600386015460608201528152019201920191906101e4565b34610100576040366003190112610100576102aa610c46565b6001600160a01b03165f90815260046020526040902080546024359190821015610100576080916102da91610c2d565b5080549060018101549060ff6003600283015492015416916040519384526020840152604083015215156060820152f35b3461010057602036600319011261010057600435610327610e27565b61032f610f64565b8015610459576002546103539082903090339060081c6001600160a01b0316610f7f565b5f905b600354821080610450575b156104375761036f82610bfd565b509161038360038454940193845490610d6d565b808311610431575081925b836103a6575b506103a0919250610d7a565b90610356565b836103a0936103f792335f5260046020526103e560405f20604051906103cb82610c72565b8582528760208301524260408301525f6060830152610d88565b6103f0838254610d39565b9055610d6d565b926040519081528160208201527f73a19dd210f1a7f902193214c0ee91dd35ee5b4d920cba8d519eca65a7b488ca60403392a28291610394565b9261038e565b6104415760018055005b634a41ffd160e01b5f5260045ffd5b50801515610361565b63f69a94d360e01b5f5260045ffd5b346101005760603660031901126101005760043567ffffffffffffffff811161010057610499903690600401610cdc565b60243567ffffffffffffffff8111610100576104b9903690600401610cdc565b60443567ffffffffffffffff8111610100576104d9903690600401610cdc565b916104e2610e01565b80518251811490811591610545575b50610536575f5b8151811015610534578061052e61051160019385610ded565b5161051c8387610ded565b516105278489610ded565b5191610e89565b016104f8565b005b632468c99d60e11b5f5260045ffd5b905083511415846104f1565b346101005761055f36610c5c565b90610568610e27565b610570610f64565b60035481101561063a5781156104595761058981610bfd565b5061059c60038254920191825490610d6d565b8311610441576002546105c09084903090339060081c6001600160a01b0316610f7f565b335f5260046020526105f660405f20604051906105dc82610c72565b8582528460208301524260408301525f6060830152610d88565b610601838254610d39565b905560405191825260208201527f73a19dd210f1a7f902193214c0ee91dd35ee5b4d920cba8d519eca65a7b488ca60403392a260018055005b630dff23c960e31b5f5260045260245ffd5b34610100575f366003190112610100575f546040516001600160a01b039091168152602090f35b34610100575f3660031901126101005761068b610e27565b610693610f64565b335f52600460205260405f205f905f5f5b825481101561077c576106b78184610c2d565b50600381019081549160ff8316156106d5575b5050506001016106a4565b6106e26001830154610bfd565b509060028301546106f860028401548092610d39565b421015610707575b50506106ca565b916003916001610747819897999b610741889764496cebb80061073a9a549a8b92610735888b015485610d5a565b610d5a565b0492610d39565b9c610d39565b60ff199099161790550180549092116107735761076690548254610d6d565b90555b9085808080610700565b505f9055610769565b838281156107de576107a76107918284610d39565b600254339060081c6001600160a01b0316610e47565b60405191825260208201527f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc660403392a260018055005b63d6d9e66560e01b5f5260045ffd5b34610100575f36600319011261010057610805610e01565b61080d610f64565b600160ff1960025416176002557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1005b34610100575f3660031901126101005761085e610e01565b5f80546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b34610100576060366003190112610100576108b6610e01565b610534604435602435600435610e89565b34610100575f36600319011261010057602060ff600254166040519015158152f35b34610100576108f736610c5c565b90610900610e27565b335f52600460205260405f2091825480831015610a22575f935f935f92610928819583610d39565b908110610a1a575b505b83811061094e57858581156107de576107a76107918284610d39565b6109588183610c2d565b50600381019081549160ff831615610976575b505050600101610932565b6109836001830154610bfd565b5090600283015461099960028401548092610d39565b4210156109a8575b505061096b565b61073a92849260016109e0610a06989d9e6109da60039664496cebb800859d9f9b549a8b92610735888b015485610d5a565b9f610d39565b60ff19909d16179055018054909211610a11576109ff90548254610d6d565b9055610d7a565b9290878080806109a1565b505f9055610d7a565b935086610930565b826315a6631760e11b5f5260045260245ffd5b34610100575f36600319011261010057610a4d610e01565b60025460ff811615610a8c5760ff19166002557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b638dfc202b60e01b5f5260045ffd5b34610100576020366003190112610100576001600160a01b03610abc610c46565b165f52600460205260405f20805490610ad482610cc4565b91610ae26040519384610ca2565b8083526020830180925f5260205f205f915b838310610b62578486604051918291602083019060208452518091526040830191905f5b818110610b26575050500390f35b91935091602060806001926060875180518352848101518584015260408101516040840152015115156060820152019401910191849392610b18565b60046020600192604051610b7581610c72565b8554815284860154838201526002860154604082015260ff60038701541615156060820152815201920192019190610af4565b346101005760203660031901126101005760043560035481101561010057610bd1608091610bfd565b508054906001810154906003600282015491015491604051938452602084015260408301526060820152f35b600354811015610c195760035f5260205f209060021b01905f90565b634e487b7160e01b5f52603260045260245ffd5b8054821015610c19575f5260205f209060021b01905f90565b600435906001600160a01b038216820361010057565b6040906003190112610100576004359060243590565b6080810190811067ffffffffffffffff821117610c8e57604052565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff821117610c8e57604052565b67ffffffffffffffff8111610c8e5760051b60200190565b9080601f83011215610100578135610cf381610cc4565b92610d016040519485610ca2565b81845260208085019260051b82010192831161010057602001905b828210610d295750505090565b8135815260209182019101610d1c565b91908201809211610d4657565b634e487b7160e01b5f52601160045260245ffd5b81810292918115918404141715610d4657565b91908203918211610d4657565b5f198114610d465760010190565b8054600160401b811015610c8e57610da591600182018155610c2d565b610dda57600360609183518155602084015160018201556040840151600282015501910151151560ff80198354169116179055565b634e487b7160e01b5f525f60045260245ffd5b8051821015610c195760209160051b010190565b5f546001600160a01b03163303610e1457565b63118cdaa760e01b5f523360045260245ffd5b600260015414610e38576002600155565b633ee5aeb560e01b5f5260045ffd5b60405163a9059cbb60e01b60208201526001600160a01b039092166024830152604480830193909352918152610e8791610e82606483610ca2565b610fc3565b565b91906127108111610f52578115610f4357604051610ea681610c72565b83815260208101908282526040810184815260608201905f8252600354600160401b811015610c8e57806001610edf9201600355610bfd565b949094610dda5760039351855551600185015551600284015551910155600354925f198401938411610d46577f9eeff5fe675f51786eba4c4299284d87b3213d1cf906d1c0f19a069e40026be29260609260405192835260208301526040820152a2565b63d4d57f1960e01b5f5260045ffd5b6378db6dd360e11b5f5260045260245ffd5b60ff60025416610f7057565b63d93c066560e01b5f5260045ffd5b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152610e8791610e82608483610ca2565b905f602091828151910182855af11561101b575f513d61101257506001600160a01b0381163b155b610ff25750565b635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b60011415610feb565b6040513d5f823e3d90fdfea2646970667358221220e370ca18c410c837166ef4cac8d0e1d13c41359dff87e538137fa2967cbf0adf64736f6c634300081c0033000000000000000000000000b1c3960aeeaf4c255a877da04b06487bba6983860000000000000000000000008a552ac4b0de1da1e3bab8b7b4814ae35ae672ce
Deployed Bytecode
0x60806040526004361015610011575f80fd5b5f3560e01c8063039af9eb14610ba85780632a5bf6d214610a9b5780633f4ba83a14610a3557806352b86e1f146108e95780635c975abb146108c75780636358ec571461089d578063715018a6146108465780638456cb59146107ed578063853828b6146106735780638da5cb5b1461064c578063993a381814610551578063a69410ef14610468578063b6b55f251461030b578063d6d6817714610291578063de17057014610189578063f2fde38b146101045763fc0c546a146100d4575f80fd5b34610100575f3660031901126101005760025460405160089190911c6001600160a01b03168152602090f35b5f80fd5b346101005760203660031901126101005761011d610c46565b610125610e01565b6001600160a01b03168015610176575f80546001600160a01b03198116831782556001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3005b631e4fbdf760e01b5f525f60045260245ffd5b34610100575f366003190112610100576003546101a581610cc4565b906101b36040519283610ca2565b80825260208201908160035f527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5f915b838310610250578486604051918291602083019060208452518091526040830191905f5b818110610216575050500390f35b9193509160206080600192606087518051835284810151858401526040810151604084015201516060820152019401910191849392610208565b6004602060019260405161026381610c72565b85548152848601548382015260028601546040820152600386015460608201528152019201920191906101e4565b34610100576040366003190112610100576102aa610c46565b6001600160a01b03165f90815260046020526040902080546024359190821015610100576080916102da91610c2d565b5080549060018101549060ff6003600283015492015416916040519384526020840152604083015215156060820152f35b3461010057602036600319011261010057600435610327610e27565b61032f610f64565b8015610459576002546103539082903090339060081c6001600160a01b0316610f7f565b5f905b600354821080610450575b156104375761036f82610bfd565b509161038360038454940193845490610d6d565b808311610431575081925b836103a6575b506103a0919250610d7a565b90610356565b836103a0936103f792335f5260046020526103e560405f20604051906103cb82610c72565b8582528760208301524260408301525f6060830152610d88565b6103f0838254610d39565b9055610d6d565b926040519081528160208201527f73a19dd210f1a7f902193214c0ee91dd35ee5b4d920cba8d519eca65a7b488ca60403392a28291610394565b9261038e565b6104415760018055005b634a41ffd160e01b5f5260045ffd5b50801515610361565b63f69a94d360e01b5f5260045ffd5b346101005760603660031901126101005760043567ffffffffffffffff811161010057610499903690600401610cdc565b60243567ffffffffffffffff8111610100576104b9903690600401610cdc565b60443567ffffffffffffffff8111610100576104d9903690600401610cdc565b916104e2610e01565b80518251811490811591610545575b50610536575f5b8151811015610534578061052e61051160019385610ded565b5161051c8387610ded565b516105278489610ded565b5191610e89565b016104f8565b005b632468c99d60e11b5f5260045ffd5b905083511415846104f1565b346101005761055f36610c5c565b90610568610e27565b610570610f64565b60035481101561063a5781156104595761058981610bfd565b5061059c60038254920191825490610d6d565b8311610441576002546105c09084903090339060081c6001600160a01b0316610f7f565b335f5260046020526105f660405f20604051906105dc82610c72565b8582528460208301524260408301525f6060830152610d88565b610601838254610d39565b905560405191825260208201527f73a19dd210f1a7f902193214c0ee91dd35ee5b4d920cba8d519eca65a7b488ca60403392a260018055005b630dff23c960e31b5f5260045260245ffd5b34610100575f366003190112610100575f546040516001600160a01b039091168152602090f35b34610100575f3660031901126101005761068b610e27565b610693610f64565b335f52600460205260405f205f905f5f5b825481101561077c576106b78184610c2d565b50600381019081549160ff8316156106d5575b5050506001016106a4565b6106e26001830154610bfd565b509060028301546106f860028401548092610d39565b421015610707575b50506106ca565b916003916001610747819897999b610741889764496cebb80061073a9a549a8b92610735888b015485610d5a565b610d5a565b0492610d39565b9c610d39565b60ff199099161790550180549092116107735761076690548254610d6d565b90555b9085808080610700565b505f9055610769565b838281156107de576107a76107918284610d39565b600254339060081c6001600160a01b0316610e47565b60405191825260208201527f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc660403392a260018055005b63d6d9e66560e01b5f5260045ffd5b34610100575f36600319011261010057610805610e01565b61080d610f64565b600160ff1960025416176002557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1005b34610100575f3660031901126101005761085e610e01565b5f80546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b34610100576060366003190112610100576108b6610e01565b610534604435602435600435610e89565b34610100575f36600319011261010057602060ff600254166040519015158152f35b34610100576108f736610c5c565b90610900610e27565b335f52600460205260405f2091825480831015610a22575f935f935f92610928819583610d39565b908110610a1a575b505b83811061094e57858581156107de576107a76107918284610d39565b6109588183610c2d565b50600381019081549160ff831615610976575b505050600101610932565b6109836001830154610bfd565b5090600283015461099960028401548092610d39565b4210156109a8575b505061096b565b61073a92849260016109e0610a06989d9e6109da60039664496cebb800859d9f9b549a8b92610735888b015485610d5a565b9f610d39565b60ff19909d16179055018054909211610a11576109ff90548254610d6d565b9055610d7a565b9290878080806109a1565b505f9055610d7a565b935086610930565b826315a6631760e11b5f5260045260245ffd5b34610100575f36600319011261010057610a4d610e01565b60025460ff811615610a8c5760ff19166002557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b638dfc202b60e01b5f5260045ffd5b34610100576020366003190112610100576001600160a01b03610abc610c46565b165f52600460205260405f20805490610ad482610cc4565b91610ae26040519384610ca2565b8083526020830180925f5260205f205f915b838310610b62578486604051918291602083019060208452518091526040830191905f5b818110610b26575050500390f35b91935091602060806001926060875180518352848101518584015260408101516040840152015115156060820152019401910191849392610b18565b60046020600192604051610b7581610c72565b8554815284860154838201526002860154604082015260ff60038701541615156060820152815201920192019190610af4565b346101005760203660031901126101005760043560035481101561010057610bd1608091610bfd565b508054906001810154906003600282015491015491604051938452602084015260408301526060820152f35b600354811015610c195760035f5260205f209060021b01905f90565b634e487b7160e01b5f52603260045260245ffd5b8054821015610c19575f5260205f209060021b01905f90565b600435906001600160a01b038216820361010057565b6040906003190112610100576004359060243590565b6080810190811067ffffffffffffffff821117610c8e57604052565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff821117610c8e57604052565b67ffffffffffffffff8111610c8e5760051b60200190565b9080601f83011215610100578135610cf381610cc4565b92610d016040519485610ca2565b81845260208085019260051b82010192831161010057602001905b828210610d295750505090565b8135815260209182019101610d1c565b91908201809211610d4657565b634e487b7160e01b5f52601160045260245ffd5b81810292918115918404141715610d4657565b91908203918211610d4657565b5f198114610d465760010190565b8054600160401b811015610c8e57610da591600182018155610c2d565b610dda57600360609183518155602084015160018201556040840151600282015501910151151560ff80198354169116179055565b634e487b7160e01b5f525f60045260245ffd5b8051821015610c195760209160051b010190565b5f546001600160a01b03163303610e1457565b63118cdaa760e01b5f523360045260245ffd5b600260015414610e38576002600155565b633ee5aeb560e01b5f5260045ffd5b60405163a9059cbb60e01b60208201526001600160a01b039092166024830152604480830193909352918152610e8791610e82606483610ca2565b610fc3565b565b91906127108111610f52578115610f4357604051610ea681610c72565b83815260208101908282526040810184815260608201905f8252600354600160401b811015610c8e57806001610edf9201600355610bfd565b949094610dda5760039351855551600185015551600284015551910155600354925f198401938411610d46577f9eeff5fe675f51786eba4c4299284d87b3213d1cf906d1c0f19a069e40026be29260609260405192835260208301526040820152a2565b63d4d57f1960e01b5f5260045ffd5b6378db6dd360e11b5f5260045260245ffd5b60ff60025416610f7057565b63d93c066560e01b5f5260045ffd5b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152610e8791610e82608483610ca2565b905f602091828151910182855af11561101b575f513d61101257506001600160a01b0381163b155b610ff25750565b635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b60011415610feb565b6040513d5f823e3d90fdfea2646970667358221220e370ca18c410c837166ef4cac8d0e1d13c41359dff87e538137fa2967cbf0adf64736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b1c3960aeeaf4c255a877da04b06487bba6983860000000000000000000000008a552ac4b0de1da1e3bab8b7b4814ae35ae672ce
-----Decoded View---------------
Arg [0] : _token (address): 0xB1C3960aeeAf4C255A877da04b06487BBa698386
Arg [1] : _owner (address): 0x8a552Ac4b0dE1dA1e3bAB8B7B4814ae35ae672Ce
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000b1c3960aeeaf4c255a877da04b06487bba698386
Arg [1] : 0000000000000000000000008a552ac4b0de1da1e3bab8b7b4814ae35ae672ce
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.