Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
StakingActionFees
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.28; import { StakingBase, SafeERC20, IERC20 } from "./base/StakingBase.sol"; import { IStakingActionFees } from "./../interfaces/templates/IStakingActionFees.sol"; /// @title Based on StakingBase this contract also provides action fees /// @author 0xdEaF <[email protected]> contract StakingActionFees is StakingBase, IStakingActionFees { using SafeERC20 for IERC20; /// @dev basis points denominator uint16 internal constant BPS = 1e4; /// @notice amount in bps that gets used to calculate the deposit action fee uint16 public depositFee = 0; /// @notice amount in bps that gets used to calculate the withdraw action fee uint16 public withdrawFee = 0; /// @notice amount in bps that gets used to calculate the restake action fee uint16 public restakeFee = 0; /// @inheritdoc StakingBase function _initialize(address _stakingToken, address _owner, bytes calldata _args) internal virtual override { super._initialize(_stakingToken, _owner, _args); (uint16 _depositFee, uint16 _withdrawFee, uint16 _restakeFee) = abi.decode(_args, (uint16, uint16, uint16)); _updateFees(_depositFee, _withdrawFee, _restakeFee); } /// /// Executables /// /// @inheritdoc StakingBase function _deposit( address _staker, uint256 _amount, uint256 _minAmount ) internal virtual override(StakingBase) returns (uint256 _depositAmount) { if (_staker == address(0)) revert StakingActionFees__AddressZero(); _depositAmount = _transferFrom(stakingToken, _msgSender(), _amount, _minAmount); // charge deposit fee if (depositFee > 0 && staked > 0) { uint256 _fee = (_depositAmount * depositFee) / BPS; _depositAmount -= _fee; _updateReward(_fee); } _update(_staker, int256(_depositAmount)); } /// @inheritdoc StakingBase function _withdraw(address _receiver, uint256 _amount) internal virtual override(StakingBase) returns (uint256 _withdrawAmount) { if (_receiver == address(0)) revert StakingActionFees__AddressZero(); if (_amount == 0) revert StakingActionFees__AmountZero(); _withdrawAmount = _amount; // update stakers stake BEFORE charging fees _update(_msgSender(), -int256(_withdrawAmount)); // charge withdraw fee if (withdrawFee > 0 && staked > 0) { uint256 _fee = (_withdrawAmount * withdrawFee) / BPS; _withdrawAmount -= _fee; _updateReward(_fee); } IERC20(stakingToken).safeTransfer(_receiver, _withdrawAmount); } /// @inheritdoc StakingBase function _restake() internal virtual override(StakingBase) returns (uint256 _restakeAmount) { _restakeAmount = _update(_msgSender(), 0); if (_restakeAmount > 0) { stakes[_msgSender()].pending = 0; // charge restake fee if (restakeFee > 0) { uint256 _fee = (_restakeAmount * restakeFee) / BPS; _restakeAmount -= _fee; _updateReward(_fee); } _update(_msgSender(), int256(_restakeAmount)); emit Claim(_msgSender(), _restakeAmount); emit Restaked(_msgSender(), _restakeAmount); } else revert StakingActionFees__InvalidAmount(); } /// /// Management /// /// @inheritdoc IStakingActionFees function updateFees( uint16 _depositFee, uint16 _withdrawFee, uint16 _restakeFee, address[] calldata _referrals ) external payable virtual onlyOwner processValue(_referrals) { _updateFees(_depositFee, _withdrawFee, _restakeFee); } /// Internal fee updating function that can be overwritten /// @param _depositFee bps amount of deposit fee /// @param _withdrawFee bps amount of withdraw fee /// @param _restakeFee bps amount of restake fee function _updateFees(uint16 _depositFee, uint16 _withdrawFee, uint16 _restakeFee) internal virtual { if ((_depositFee | _withdrawFee | _restakeFee) == 0) revert StakingActionFees__ZeroFee(); if (_depositFee > 1000 || _withdrawFee > 1000 || _restakeFee > 1000) revert StakingActionFees__InvalidFee(); if (_depositFee != depositFee) depositFee = _depositFee; if (_withdrawFee != withdrawFee) withdrawFee = _withdrawFee; if (_restakeFee != restakeFee) restakeFee = _restakeFee; emit UpdateFees(_depositFee, _withdrawFee, _restakeFee); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (access/Ownable2Step.sol) pragma solidity ^0.8.20; import {OwnableUpgradeable} from "./OwnableUpgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This extension of the {Ownable} contract includes a two-step mechanism to transfer * ownership, where the new owner must call {acceptOwnership} in order to replace the * old one. This can help prevent common mistakes, such as transfers of ownership to * incorrect accounts, or to contracts that are unable to interact with the * permission system. * * The initial owner is specified at deployment time in the constructor for `Ownable`. This * can later be changed with {transferOwnership} and {acceptOwnership}. * * This module is used through inheritance. It will make available all functions * from parent (Ownable). */ abstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable { /// @custom:storage-location erc7201:openzeppelin.storage.Ownable2Step struct Ownable2StepStorage { address _pendingOwner; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable2Step")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant Ownable2StepStorageLocation = 0x237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00; function _getOwnable2StepStorage() private pure returns (Ownable2StepStorage storage $) { assembly { $.slot := Ownable2StepStorageLocation } } event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); function __Ownable2Step_init() internal onlyInitializing { } function __Ownable2Step_init_unchained() internal onlyInitializing { } /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { Ownable2StepStorage storage $ = _getOwnable2StepStorage(); return $._pendingOwner; } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. * * Setting `newOwner` to the zero address is allowed; this can be used to cancel an initiated ownership transfer. */ function transferOwnership(address newOwner) public virtual override onlyOwner { Ownable2StepStorage storage $ = _getOwnable2StepStorage(); $._pendingOwner = newOwner; emit OwnershipTransferStarted(owner(), newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { Ownable2StepStorage storage $ = _getOwnable2StepStorage(); delete $._pendingOwner; super._transferOwnership(newOwner); } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() public virtual { address sender = _msgSender(); if (pendingOwner() != sender) { revert OwnableUnauthorizedAccount(sender); } _transferOwnership(sender); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol"; import {Initializable} from "../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. * * 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 OwnableUpgradeable is Initializable, ContextUpgradeable { /// @custom:storage-location erc7201:openzeppelin.storage.Ownable struct OwnableStorage { address _owner; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300; function _getOwnableStorage() private pure returns (OwnableStorage storage $) { assembly { $.slot := OwnableStorageLocation } } /** * @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. */ function __Ownable_init(address initialOwner) internal onlyInitializing { __Ownable_init_unchained(initialOwner); } function __Ownable_init_unchained(address initialOwner) internal onlyInitializing { 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) { OwnableStorage storage $ = _getOwnableStorage(); 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 { OwnableStorage storage $ = _getOwnableStorage(); address oldOwner = $._owner; $._owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @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 Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 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 in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._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 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._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() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @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 { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; import {Initializable} from "../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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol) pragma solidity ^0.8.20; import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.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 PausableUpgradeable is Initializable, ContextUpgradeable { /// @custom:storage-location erc7201:openzeppelin.storage.Pausable struct PausableStorage { bool _paused; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Pausable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300; function _getPausableStorage() private pure returns (PausableStorage storage $) { assembly { $.slot := PausableStorageLocation } } /** * @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. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { PausableStorage storage $ = _getPausableStorage(); $._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) { PausableStorage storage $ = _getPausableStorage(); 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 { PausableStorage storage $ = _getPausableStorage(); $._paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { PausableStorage storage $ = _getPausableStorage(); $._paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @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 ReentrancyGuardUpgradeable is Initializable { // 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; /// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard struct ReentrancyGuardStorage { uint256 _status; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00; function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) { assembly { $.slot := ReentrancyGuardStorageLocation } } /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); $._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 { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); // 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 { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); // 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) { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); return $._status == ENTERED; } }
// 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.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.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.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) (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.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.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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.20; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position is the index of the value in the `values` array plus 1. // Position 0 is used to mean a value is not in the set. mapping(bytes32 value => uint256) _positions; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._positions[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We cache the value's position to prevent multiple reads from the same storage slot uint256 position = set._positions[value]; if (position != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 valueIndex = position - 1; uint256 lastIndex = set._values.length - 1; if (valueIndex != lastIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the lastValue to the index where the value to delete is set._values[valueIndex] = lastValue; // Update the tracked position of the lastValue (that was just moved) set._positions[lastValue] = position; } // Delete the slot where the moved value was stored set._values.pop(); // Delete the tracked position for the deleted slot delete set._positions[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._positions[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; assembly ("memory-safe") { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly ("memory-safe") { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly ("memory-safe") { result := store } return result; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.28; /// @title Interface for the base function of each staking template /// @author 0xdEaF <[email protected]> interface IStakingBase { error Staking__NoStakes(); error Staking__AmountZero(); error Staking__AmountOverflow(); error Staking__AmountReceivedInsufficient(uint256 actualAmount, uint256 minAmount); error Staking__ValueNotAllowed(); error Staking__AddressZero(); error Staking__InvalidAmount(); error Staking__InsufficientStake(); /// Deposit stake event /// @param staker address of staker /// @param amount deposited amount event Deposit(address indexed staker, int256 amount); /// Withdraw stake event /// @param staker address of staker /// @param amount withdrawn amount event Withdraw(address indexed staker, int256 amount); /// Update stake event /// @param staker address of staker /// @param amount updated amount event Update(address indexed staker, int256 amount); /// Claim rewards event /// @param staker address of staker /// @param amount rewarded amount event Claim(address indexed staker, uint256 amount); /// Restake rewards event /// @param staker address of staker /// @param amount restake amount event Restaked(address indexed staker, uint256 amount); /// Rewards injected event /// @param actor address of reward injector /// @param amountInjected amount of rewards injected /// @param amountGiven amount that actually has been given (can differ from amountInjected) /// @param amountStaked staked amount (interesting value for for apr calculation) event InjectRewards(address indexed actor, uint256 amountInjected, uint256 amountGiven, uint256 amountStaked); /// Service fee event /// @param provider address of the service provide /// @param paymentAmount fee amount of the service provider (always native currency of desired chain) event ServiceFee(address indexed provider, uint256 paymentAmount); /// Service fee transfer failed event /// @param provider address of the receiver /// @param paymentAmount fee amount of the service provider (always native currency of desired chain) event ServiceFeeFailed(address indexed provider, uint256 paymentAmount); /// @dev struct for storing the stake struct Stake { /// @dev amount of stake uint128 amount; /// @dev amount of the pending stake will be stored in case of restaking uint256 pending; /// @dev scaled dividend uint256 dividend; } /// @dev struct for list response of stake struct StakersStake { /// @dev address of the staker address staker; /// @dev amount of stake uint128 amount; /// @dev amount of the pending stake will be stored in case of restaking uint256 pending; /// @dev scaled dividend uint256 dividend; } /// Initialize function for the protocol /// @param stakingToken token address that will be used for the staking token /// @param owner address of the owner of the protocol /// @param args encoded parameters that will be used for the specific template function initialize(address stakingToken, address owner, bytes calldata args) external; /// Enabled or disables a protocol /// @param enable enable/disable flag /// @param referrals address referrals that receive an evenly spread share of sent value function enable(bool enable, address[] calldata referrals) external payable; /// Deposits a stake for a given staker with a given amount /// @param staker address of the staker /// @param amount amount of staking token that should be staked /// @param minAmount min amount of expected staking tokens that will be staked /// @param referrals address referrals that receive an evenly spread share of sent value function deposit( address staker, uint256 amount, uint256 minAmount, address[] calldata referrals ) external payable returns (uint256 depositAmount); /// Withdraws to a specified receiver /// @param receiver address of the receiver of the withdrawing stake /// @param amount amount of stake that should be withdrawn /// @param referrals address referrals that receive an evenly spread share of sent value function withdraw(address receiver, uint256 amount, address[] calldata referrals) external payable returns (uint256 withdrawAmount); /// Restakes the rewards of the sender /// @param referrals address referrals that receive an evenly spread share of sent value function restake(address[] calldata referrals) external payable returns (uint256 restakeAmount); /// Claims rewards of the sender and sends it to a specified receiver /// @param receiver address of the reward receiver /// @param referrals address referrals that receive an evenly spread share of sent value function claimRewards(address receiver, address[] calldata referrals) external payable returns (uint256 claimAmount); /// Deposit and distribute rewards to stakers /// @param amount amount of reward token that should be distributed /// @param minAmount min amount of expected rewards tokens that will be distributed /// @param referrals address referrals that receive an evenly spread share of sent value function injectRewards( uint256 amount, uint256 minAmount, address[] calldata referrals ) external payable returns (uint256 injectedAmount); /// @dev total amount of staked tokens function staked() external view returns (uint128); /// Total amount of a given reward token /// @param rewardToken address of the reward token function rewarded(address rewardToken) external view returns (uint256 amount); /// @dev address of the staking token function stakingToken() external view returns (address); /// @dev address of the reward token function rewardToken() external view returns (address); /// Pending rewards of a given staker /// @param staker address of staker function getPendingRewards(address staker) external view returns (uint256 pendingRewards); /// Stake information of a given staker /// @param staker address of staker function getStakeOf(address staker) external view returns (Stake memory stake); /// Total given rewards of a given staker /// @param staker address of staker function getRewardsOf(address staker) external view returns (uint256 rewards); /// Paginated list of stakers with the total amount /// @param _limit amount of stakers /// @param _offset index to start from until limit /// @return _stakers staker information /// @return _count total amount of stakers available function getStakers(uint256 _limit, uint256 _offset) external view returns (StakersStake[] memory _stakers, uint256 _count); /// Total amount of stakers function getStakersCount() external view returns (uint256 _count); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.28; /// @title Interface of a fee charging staking protocol /// @author 0xdEaF <[email protected]> interface IStakingActionFees { error StakingActionFees__ZeroFee(); error StakingActionFees__InvalidFee(); error StakingActionFees__AddressZero(); error StakingActionFees__AmountZero(); error StakingActionFees__InvalidAmount(); /// Fee update event /// @param depositFee bps amount of deposit fee /// @param withdrawFee bps amount of withdraw fee /// @param restakeFee bps amount of restake fee event UpdateFees(uint16 depositFee, uint16 withdrawFee, uint16 restakeFee); /// /// @param depositFee bps amount of deposit fee /// @param withdrawFee bps amount of withdraw fee /// @param restakeFee bps amount of restake fee /// @param referrals address referrals that receive an evenly spread share of sent value function updateFees(uint16 depositFee, uint16 withdrawFee, uint16 restakeFee, address[] calldata referrals) external payable; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.28; import { Address } from "@openzeppelin/contracts/utils/Address.sol"; import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import { SafeERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { PausableUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import { Ownable2StepUpgradeable } from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; import { IStakingBase } from "./../../interfaces/templates/base/IStakingBase.sol"; /// @title Base contract that has to be used for all templates available /// @author 0xdEaF <[email protected]> /// @notice This contract contains the core features of the protocol abstract contract StakingBase is IStakingBase, Ownable2StepUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable { using SafeERC20 for IERC20; using EnumerableSet for EnumerableSet.UintSet; using EnumerableSet for EnumerableSet.AddressSet; uint256 internal constant PRECISION = 1e18; /// @dev precision scaled dividend uint256 internal dividend; /// @notice total amount that has been staked uint128 public staked; /// @notice total amount that has been rewarded to a specific token mapping(address => uint256) public rewarded; /// @notice address of the token a staker has to deposit to perticipate in staking address public stakingToken; /// @notice address of the token that will get rewarded to the stakers address public rewardToken; /// @dev staker address to stake data relation mapping(address => Stake) internal stakes; /// @dev staker address => reward addresss => rewarded amount mapping(address => mapping(address => uint256)) internal rewards; /// @dev keeps track of all stakers in the protocol EnumerableSet.AddressSet internal stakers; modifier processValue(address[] calldata _receivers) { _processValue(_receivers); _; } constructor() { _disableInitializers(); _pause(); } /// @inheritdoc IStakingBase function initialize(address _stakingToken, address _owner, bytes calldata args) external virtual initializer { _initialize(_stakingToken, _owner, args); } /// Internal initialize function that can be overwritten /// @param _stakingToken staking token address /// @param _owner owner of the protocol function _initialize(address _stakingToken, address _owner, bytes calldata) internal virtual { __Ownable_init(_owner); __Pausable_init(); __Ownable2Step_init(); __ReentrancyGuard_init(); // initially paused _pause(); if (_stakingToken == address(0)) revert Staking__AddressZero(); stakingToken = _stakingToken; rewardToken = _stakingToken; } /// /// Executables /// /// @inheritdoc IStakingBase function enable(bool _enable, address[] calldata _referrals) external payable virtual onlyOwner processValue(_referrals) { if (_enable) _unpause(); else _pause(); } /// @inheritdoc IStakingBase function deposit( address _staker, uint256 _amount, uint256 _minAmount, address[] calldata _referrals ) external payable virtual whenNotPaused nonReentrant processValue(_referrals) returns (uint256 _depositAmount) { _depositAmount = _deposit(_staker, _amount, _minAmount); } /// Internal deposit function that can be overwritten /// @param _staker address of the staker /// @param _amount amount that should be staked /// @param _minAmount min amount that is expected to be staked function _deposit(address _staker, uint256 _amount, uint256 _minAmount) internal virtual returns (uint256 _depositAmount) { if (_staker == address(0)) revert Staking__AddressZero(); _depositAmount = _transferFrom(stakingToken, _msgSender(), _amount, _minAmount); _update(_staker, int256(_depositAmount)); emit Deposit(_staker, int256(_depositAmount)); } /// @inheritdoc IStakingBase function withdraw( address _receiver, uint256 _amount, address[] calldata _referrals ) external payable virtual nonReentrant processValue(_referrals) returns (uint256 _withdrawAmount) { _withdrawAmount = _withdraw(_receiver, _amount); } /// Internal withdraw function that can be overwritten /// @param _receiver address of the receiver of the withdrawn amount /// @param _amount withdraw amount function _withdraw(address _receiver, uint256 _amount) internal virtual returns (uint256 _withdrawAmount) { if (_receiver == address(0)) revert Staking__AddressZero(); if (_amount == 0) revert Staking__AmountZero(); _withdrawAmount = _amount; _update(_msgSender(), -int256(_withdrawAmount)); IERC20(stakingToken).safeTransfer(_receiver, _withdrawAmount); emit Withdraw(_receiver, -int256(_withdrawAmount)); } /// @inheritdoc IStakingBase function restake( address[] calldata _referrals ) external payable virtual whenNotPaused nonReentrant processValue(_referrals) returns (uint256 _restakeAmount) { _restakeAmount = _restake(); } /// Internal restake function that can be overwritten function _restake() internal virtual returns (uint256 _restakeAmount) { _restakeAmount = _update(_msgSender(), 0); if (_restakeAmount > 0) { stakes[_msgSender()].pending = 0; _update(_msgSender(), int256(_restakeAmount)); emit Claim(_msgSender(), _restakeAmount); emit Restaked(_msgSender(), _restakeAmount); } else revert Staking__InvalidAmount(); } /// @inheritdoc IStakingBase function claimRewards( address _receiver, address[] calldata _referrals ) external payable virtual nonReentrant processValue(_referrals) returns (uint256 _claimAmount) { _claimAmount = _claimRewards(_receiver); } /// Internal reward claiming function that can be overwritten /// @param _receiver address of the receiver of the reward tokens function _claimRewards(address _receiver) internal virtual returns (uint256 _claimAmount) { if (_receiver == address(0)) revert Staking__AddressZero(); Stake storage _stake = stakes[_msgSender()]; uint256 _pending = _update(_msgSender(), 0); if (_pending > 0) { _stake.pending = 0; rewarded[rewardToken] += _pending; rewards[_msgSender()][rewardToken] += _pending; IERC20(rewardToken).safeTransfer(_receiver, _pending); emit Claim(_msgSender(), _pending); } _claimAmount = _pending; } /// @inheritdoc IStakingBase function injectRewards( uint256 _amount, uint256 _minAmount, address[] calldata _referrals ) external payable virtual whenNotPaused nonReentrant processValue(_referrals) returns (uint256 _injectedAmount) { _injectedAmount = _injectRewards(_amount, _minAmount); } /// Internal reward injecting function that can be overwritten /// @param _amount amount of rewards that should be injected /// @param _minAmount minimum amount of reward tokens being expected to be injected function _injectRewards(uint256 _amount, uint256 _minAmount) internal virtual returns (uint256 _injectedAmount) { _injectedAmount = _transferFrom(rewardToken, _msgSender(), _amount, _minAmount); _updateReward(_injectedAmount); emit InjectRewards(_msgSender(), _injectedAmount, _amount, staked); } /// /// Viewables /// /// @inheritdoc IStakingBase function getPendingRewards(address _staker) external view virtual returns (uint256 pendingRewards) { Stake storage _stake = stakes[_staker]; pendingRewards = _stake.pending; if (_stake.amount > 0) pendingRewards += (_stake.amount * (dividend - _stake.dividend)) / PRECISION; } /// @inheritdoc IStakingBase function getStakeOf(address _staker) public view virtual returns (Stake memory _stake) { _stake = stakes[_staker]; } /// @inheritdoc IStakingBase function getRewardsOf(address _staker) public view virtual returns (uint256 _rewards) { _rewards = rewards[_staker][rewardToken]; } /// @inheritdoc IStakingBase function getStakers(uint256 _limit, uint256 _offset) external view virtual returns (StakersStake[] memory _stakers, uint256 _count) { _count = getStakersCount(); _limit = _maxLimit(_limit, _offset, _count); _stakers = new StakersStake[](_limit); for (uint256 _start = 0; _start + _offset < _limit + _offset; _start++) { address staker = stakers.at(_start + _offset); _stakers[_start].staker = staker; _stakers[_start].amount = stakes[staker].amount; _stakers[_start].pending = stakes[staker].pending; _stakers[_start].dividend = stakes[staker].dividend; } } /// @inheritdoc IStakingBase function getStakersCount() public view virtual returns (uint256 _count) { _count = stakers.length(); } /// /// Internals /// /// Updates the stake of a staker based on the given/taken amount /// @param _staker address of the staker /// @param _amount amount of the stake that should be updated (can be negative) function _update(address _staker, int256 _amount) internal virtual returns (uint256 _pending) { Stake storage _stake = stakes[_staker]; if (_stake.amount > 0) _stake.pending += (_stake.amount * (dividend - _stake.dividend)) / PRECISION; _pending = _stake.pending; _stake.dividend = dividend; uint256 totalStaked = staked; uint256 stakeAmount = _stake.amount; if (_amount != 0) { // when the current stake amount of the staker is 0, we assume that this is a new staker joining the protocol if (stakeAmount == 0) stakers.add(_staker); unchecked { stakeAmount += uint256(_amount); totalStaked += uint256(_amount); } if (int256(stakeAmount) < 0) revert Staking__InsufficientStake(); if (totalStaked > type(uint128).max) revert Staking__AmountOverflow(); // when the current stake amount of the staker is 0, we assume that this staker has withdrawn his stake and is no staker anymore if (stakeAmount == 0) stakers.remove(_staker); _stake.amount = uint128(stakeAmount); staked = uint128(totalStaked); emit Update(_staker, _amount); } } /// Updated the dividend of a token based on the amount given and available stake /// @param _amount amount that was injected /// @dev we still use PRECISION but we can have calculation differences of a really tiny amount of reward tokens function _updateReward(uint256 _amount) internal virtual { if (staked == 0) revert Staking__NoStakes(); dividend += (_amount * PRECISION) / staked; } /// Transfers a given token and respects a minimum expected amount /// @param _token token address to transfer /// @param _from address to transfer from /// @param _amount amount that should be transferred /// @param _minAmount minimum expected amount that should be receiver in order to satisfy the initiator function _transferFrom(address _token, address _from, uint256 _amount, uint256 _minAmount) internal returns (uint256 _actualAmount) { uint256 balance = IERC20(_token).balanceOf(address(this)); IERC20(_token).safeTransferFrom(_from, address(this), _amount); _actualAmount = IERC20(_token).balanceOf(address(this)) - balance; if (_actualAmount == 0) revert Staking__AmountZero(); if (_actualAmount > type(uint128).max) revert Staking__AmountOverflow(); if (_actualAmount < _minAmount) revert Staking__AmountReceivedInsufficient(_actualAmount, _minAmount); } /// /// modifier wrapper /// /// Processes the value that has been sent to the protocol /// @param _receivers addresses of msg.value receivers /// @dev is used in the modifier `processValue` function _processValue(address[] calldata _receivers) private { uint256 _value = msg.value; uint256 _recipients = _receivers.length; if (_value > 0) { if (_recipients > 0) { if (_value < _recipients) revert Staking__InvalidAmount(); uint256 _share = _value / _recipients; uint256 _shareRest = _value % _recipients; for (uint256 i = 0; i < _recipients; ) { if (_receivers[i] == address(0)) revert Staking__AddressZero(); uint256 _sendValue = _share + _shareRest; (bool successA, ) = payable(_receivers[i]).call{ value: _sendValue }(""); if (!successA) { emit ServiceFeeFailed(_receivers[i], _sendValue); Address.sendValue(payable(msg.sender), _sendValue); } emit ServiceFee(_receivers[i], _sendValue); unchecked { i++; _shareRest = 0; } } } else revert Staking__ValueNotAllowed(); } } /// Helper function to figure out the max limit of a list /// @param limit limit that has been targeted /// @param offset offset that has been targeted /// @param count the amount of entries the calculation should be based on /// @dev is used to not overflow the possible available limits of a list function _maxLimit(uint256 limit, uint256 offset, uint256 count) internal pure returns (uint256) { if (limit + offset > count && offset < count) return count - offset; else if (limit + offset <= count) return limit; else return 0; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "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":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","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":"StakingActionFees__AddressZero","type":"error"},{"inputs":[],"name":"StakingActionFees__AmountZero","type":"error"},{"inputs":[],"name":"StakingActionFees__InvalidAmount","type":"error"},{"inputs":[],"name":"StakingActionFees__InvalidFee","type":"error"},{"inputs":[],"name":"StakingActionFees__ZeroFee","type":"error"},{"inputs":[],"name":"Staking__AddressZero","type":"error"},{"inputs":[],"name":"Staking__AmountOverflow","type":"error"},{"inputs":[{"internalType":"uint256","name":"actualAmount","type":"uint256"},{"internalType":"uint256","name":"minAmount","type":"uint256"}],"name":"Staking__AmountReceivedInsufficient","type":"error"},{"inputs":[],"name":"Staking__AmountZero","type":"error"},{"inputs":[],"name":"Staking__InsufficientStake","type":"error"},{"inputs":[],"name":"Staking__InvalidAmount","type":"error"},{"inputs":[],"name":"Staking__NoStakes","type":"error"},{"inputs":[],"name":"Staking__ValueNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"int256","name":"amount","type":"int256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"actor","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountInjected","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountGiven","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountStaked","type":"uint256"}],"name":"InjectRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","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":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Restaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"provider","type":"address"},{"indexed":false,"internalType":"uint256","name":"paymentAmount","type":"uint256"}],"name":"ServiceFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"provider","type":"address"},{"indexed":false,"internalType":"uint256","name":"paymentAmount","type":"uint256"}],"name":"ServiceFeeFailed","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":"staker","type":"address"},{"indexed":false,"internalType":"int256","name":"amount","type":"int256"}],"name":"Update","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"depositFee","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"withdrawFee","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"restakeFee","type":"uint16"}],"name":"UpdateFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"int256","name":"amount","type":"int256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"address[]","name":"_referrals","type":"address[]"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"_claimAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_minAmount","type":"uint256"},{"internalType":"address[]","name":"_referrals","type":"address[]"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"_depositAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"depositFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_enable","type":"bool"},{"internalType":"address[]","name":"_referrals","type":"address[]"}],"name":"enable","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"getPendingRewards","outputs":[{"internalType":"uint256","name":"pendingRewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"getRewardsOf","outputs":[{"internalType":"uint256","name":"_rewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"getStakeOf","outputs":[{"components":[{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint256","name":"pending","type":"uint256"},{"internalType":"uint256","name":"dividend","type":"uint256"}],"internalType":"struct IStakingBase.Stake","name":"_stake","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_limit","type":"uint256"},{"internalType":"uint256","name":"_offset","type":"uint256"}],"name":"getStakers","outputs":[{"components":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint256","name":"pending","type":"uint256"},{"internalType":"uint256","name":"dividend","type":"uint256"}],"internalType":"struct IStakingBase.StakersStake[]","name":"_stakers","type":"tuple[]"},{"internalType":"uint256","name":"_count","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakersCount","outputs":[{"internalType":"uint256","name":"_count","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_stakingToken","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"bytes","name":"args","type":"bytes"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_minAmount","type":"uint256"},{"internalType":"address[]","name":"_referrals","type":"address[]"}],"name":"injectRewards","outputs":[{"internalType":"uint256","name":"_injectedAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_referrals","type":"address[]"}],"name":"restake","outputs":[{"internalType":"uint256","name":"_restakeAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"restakeFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewarded","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"staked","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_depositFee","type":"uint16"},{"internalType":"uint16","name":"_withdrawFee","type":"uint16"},{"internalType":"uint16","name":"_restakeFee","type":"uint16"},{"internalType":"address[]","name":"_referrals","type":"address[]"}],"name":"updateFees","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address[]","name":"_referrals","type":"address[]"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"_withdrawAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdrawFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040526009805465ffffffffffff1916905534801561001f57600080fd5b50610028610035565b6100306100e8565b610191565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100855760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100e55780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2906020015b60405180910390a15b50565b6100f061014c565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff191660011781556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258906020016100dc565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff161561018f5760405163d93c066560e01b815260040160405180910390fd5b565b612445806101a06000396000f3fe6080604052600436106101815760003560e01c80637e02e27b116100d1578063b32ec1f91161008a578063e941fa7811610064578063e941fa7814610487578063f2fde38b146104a8578063f6ed2017146104c8578063f7c618c1146104e857600080fd5b8063b32ec1f91461043f578063cf7a1d7714610452578063e30c39781461047257600080fd5b80637e02e27b1461036c57806384fa1f7c1461037f5780638da5cb5b146103925780639684e3dc146103a7578063ad71bd36146103ee578063afa7a8c21461041c57600080fd5b806361326c191161013e5780636e5f6919116101185780636e5f6919146102f5578063715018a61461030857806372f702f31461031f57806379ba50971461035757600080fd5b806361326c191461026957806367a527931461027c5780636a86550f146102aa57600080fd5b80630b76619b146101865780632026ffa3146101c3578063379f53e3146101e457806348284789146102115780635c975abb146102265780635f55f6f314610256575b600080fd5b34801561019257600080fd5b506001546101a6906001600160801b031681565b6040516001600160801b0390911681526020015b60405180910390f35b6101d66101d1366004611ef9565b610508565b6040519081526020016101ba565b3480156101f057600080fd5b506101d66101ff366004611f4c565b60026020526000908152604090205481565b34801561021d57600080fd5b506101d6610549565b34801561023257600080fd5b506000805160206123d08339815191525460ff1660405190151581526020016101ba565b6101d6610264366004611f67565b61055a565b6101d6610277366004611fcf565b6105a7565b34801561028857600080fd5b506009546102979061ffff1681565b60405161ffff90911681526020016101ba565b3480156102b657600080fd5b506102ca6102c5366004611f4c565b6105ee565b6040805182516001600160801b031681526020808401519082015291810151908201526060016101ba565b6101d6610303366004612011565b610666565b34801561031457600080fd5b5061031d6106a9565b005b34801561032b57600080fd5b5060035461033f906001600160a01b031681565b6040516001600160a01b0390911681526020016101ba565b34801561036357600080fd5b5061031d6106bd565b61031d61037a36600461207d565b61070a565b61031d61038d3660046120d6565b610732565b34801561039e57600080fd5b5061033f610768565b3480156103b357600080fd5b506101d66103c2366004611f4c565b6001600160a01b0390811660009081526006602090815260408083206004549094168352929052205490565b3480156103fa57600080fd5b5061040e6104093660046120fb565b61079d565b6040516101ba92919061211d565b34801561042857600080fd5b5060095461029790640100000000900461ffff1681565b6101d661044d36600461219f565b61098e565b34801561045e57600080fd5b5061031d61046d3660046121da565b6109b6565b34801561047e57600080fd5b5061033f610acc565b34801561049357600080fd5b506009546102979062010000900461ffff1681565b3480156104b457600080fd5b5061031d6104c3366004611f4c565b610af5565b3480156104d457600080fd5b506101d66104e3366004611f4c565b610b7a565b3480156104f457600080fd5b5060045461033f906001600160a01b031681565b6000610512610bf7565b828261051e8282610c2f565b61052786610e75565b9250505061054260016000805160206123f083398151915255565b9392505050565b60006105556007610f98565b905090565b6000610564610fa2565b61056c610bf7565b82826105788282610c2f565b610583888888610fd3565b9250505061059e60016000805160206123f083398151915255565b95945050505050565b60006105b1610fa2565b6105b9610bf7565b82826105c58282610c2f565b6105cd611089565b925050506105e860016000805160206123f083398151915255565b92915050565b61061b604051806060016040528060006001600160801b0316815260200160008152602001600081525090565b506001600160a01b0316600090815260056020908152604091829020825160608101845281546001600160801b03168152600182015492810192909252600201549181019190915290565b6000610670610bf7565b828261067c8282610c2f565b6106868787611197565b925050506106a160016000805160206123f083398151915255565b949350505050565b6106b1611278565b6106bb60006112aa565b565b33806106c7610acc565b6001600160a01b0316146106fe5760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b610707816112aa565b50565b610712611278565b818161071e8282610c2f565b6107298787876112e6565b50505050505050565b61073a611278565b81816107468282610c2f565b841561075957610754611427565b610761565b610761611487565b5050505050565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b606060006107a9610549565b90506107b68484836114d0565b93508367ffffffffffffffff8111156107d1576107d161226b565b60405190808252806020026020018201604052801561082357816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816107ef5790505b50915060005b6108338486612297565b61083d8583612297565b101561098657600061085a6108528684612297565b60079061151e565b90508084838151811061086f5761086f6122aa565b6020908102919091018101516001600160a01b03928316905290821660009081526005909152604090205484516001600160801b03909116908590849081106108ba576108ba6122aa565b6020026020010151602001906001600160801b031690816001600160801b03168152505060056000826001600160a01b03166001600160a01b0316815260200190815260200160002060010154848381518110610919576109196122aa565b6020026020010151604001818152505060056000826001600160a01b03166001600160a01b0316815260200190815260200160002060020154848381518110610964576109646122aa565b602090810291909101015160600152508061097e816122c0565b915050610829565b509250929050565b6000610998610fa2565b6109a0610bf7565b82826109ac8282610c2f565b610686878761152a565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156109fc5750825b905060008267ffffffffffffffff166001148015610a195750303b155b905081158015610a27575080155b15610a455760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a6f57845460ff60401b1916600160401b1785555b610a7b898989896115a2565b8315610ac157845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0061078d565b610afd611278565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b0383169081178255610b41610768565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b6001600160a01b0381166000908152600560205260409020600181015481549091906001600160801b031615610bf157670de0b6b3a76400008160020154600054610bc591906122d9565b8254610bda91906001600160801b03166122ec565b610be49190612319565b610bee9083612297565b91505b50919050565b6000805160206123f0833981519152805460011901610c2957604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b34818115610e6f578015610e565780821015610c5e57604051636fe0fba360e11b815260040160405180910390fd5b6000610c6a8284612319565b90506000610c78838561232d565b905060005b83811015610e4e576000878783818110610c9957610c996122aa565b9050602002016020810190610cae9190611f4c565b6001600160a01b031603610cd5576040516316709a1760e21b815260040160405180910390fd5b6000610ce18385612297565b90506000888884818110610cf757610cf76122aa565b9050602002016020810190610d0c9190611f4c565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114610d56576040519150601f19603f3d011682016040523d82523d6000602084013e610d5b565b606091505b5050905080610dd757888884818110610d7657610d766122aa565b9050602002016020810190610d8b9190611f4c565b6001600160a01b03167fffa4ae17301d79d9f0aaae82668d39104fcd3e0ada8bc96249f642730615b51a83604051610dc591815260200190565b60405180910390a2610dd733836115cf565b888884818110610de957610de96122aa565b9050602002016020810190610dfe9190611f4c565b6001600160a01b03167f6b7bb0b92cd59ba9788b4dfc60bc3df994068312c781a7e82cfb2b9e78e8cab383604051610e3891815260200190565b60405180910390a2506000925050600101610c7d565b505050610e6f565b60405163593f696160e01b815260040160405180910390fd5b50505050565b60006001600160a01b038216610e9e576040516316709a1760e21b815260040160405180910390fd5b33600081815260056020526040812091610eba905b6000611672565b90508015610542576000600183018190556004546001600160a01b031681526002602052604081208054839290610ef2908490612297565b90915550503360009081526006602090815260408083206004546001600160a01b0316845290915281208054839290610f2c908490612297565b9091555050600454610f48906001600160a01b03168583611811565b60405181815233907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d49060200160405180910390a29392505050565b60016000805160206123f083398151915255565b60006105e8825490565b6000805160206123d08339815191525460ff16156106bb5760405163d93c066560e01b815260040160405180910390fd5b60006001600160a01b038416610ffc57604051631538ebc360e21b815260040160405180910390fd5b600354611015906001600160a01b0316335b8585611870565b60095490915061ffff161580159061103757506001546001600160801b031615155b1561107757600954600090612710906110549061ffff16846122ec565b61105e9190612319565b905061106a81836122d9565b9150611075816119e7565b505b6110818482611672565b509392505050565b600061109433610eb3565b9050801561117e5733600090815260056020526040812060010155600954640100000000900461ffff161561110657600954600090612710906110e390640100000000900461ffff16846122ec565b6110ed9190612319565b90506110f981836122d9565b9150611104816119e7565b505b6111103382611672565b5060405181815233907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d49060200160405180910390a260405181815233907ffc11547e675aec955dee8afa8fab2509420a3a91ca90e88b9b95db75bdf4c00b9060200160405180910390a290565b604051637dcf504560e01b815260040160405180910390fd5b60006001600160a01b0383166111c057604051631538ebc360e21b815260040160405180910390fd5b816000036111e157604051630ca20ee760e01b815260040160405180910390fd5b50806111f5336111f083612341565b611672565b5060095462010000900461ffff161580159061121b57506001546001600160801b031615155b15611261576009546000906127109061123e9062010000900461ffff16846122ec565b6112489190612319565b905061125481836122d9565b915061125f816119e7565b505b6003546105e8906001600160a01b03168483611811565b33611281610768565b6001600160a01b0316146106bb5760405163118cdaa760e01b81523360048201526024016106f5565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b03191681556112e282611a53565b5050565b808284171761ffff1660000361130f576040516363a5858b60e11b815260040160405180910390fd5b6103e88361ffff16118061132857506103e88261ffff16115b8061133857506103e88161ffff16115b156113565760405163335c1b8360e21b815260040160405180910390fd5b60095461ffff848116911614611378576009805461ffff191661ffff85161790555b60095461ffff8381166201000090920416146113a7576009805463ffff000019166201000061ffff8516021790555b60095461ffff82811664010000000090920416146113dc576009805465ffff00000000191664010000000061ffff8416021790555b6040805161ffff8581168252848116602083015283168183015290517f8e05a662e732e4c6ab8ef59a2504c6502f5cc89d4e5bc7edd9f339f0e80e73d99181900360600190a1505050565b61142f611ac4565b6000805160206123d0833981519152805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a150565b61148f610fa2565b6000805160206123d0833981519152805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833611469565b6000816114dd8486612297565b1180156114e957508183105b156114ff576114f883836122d9565b9050610542565b8161150a8486612297565b11611516575082610542565b506000610542565b60006105428383611af4565b600454600090611543906001600160a01b03163361100e565b905061154e816119e7565b60015460408051838152602081018690526001600160801b03909216828201525133917fdff8c28014db33834beee8e781f6d605c9cb46451508a58468ffd33c597532d1919081900360600190a292915050565b6115ae84848484611b1e565b600080806115be8486018661235d565b9250925092506107298383836112e6565b804710156115f95760405163cf47918160e01b8152476004820152602481018290526044016106f5565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611646576040519150601f19603f3d011682016040523d82523d6000602084013e61164b565b606091505b505090508061166d5760405163d6bda27560e01b815260040160405180910390fd5b505050565b6001600160a01b038216600090815260056020526040812080546001600160801b0316156116ed57670de0b6b3a764000081600201546000546116b591906122d9565b82546116ca91906001600160801b03166122ec565b6116d49190612319565b8160010160008282546116e79190612297565b90915550505b6001808201546000546002840155905482549193506001600160801b0390811691168415611808578060000361172a57611728600787611b9e565b505b9084019084016000811215611752576040516371a3b96f60e01b815260040160405180910390fd5b6001600160801b0382111561177a5760405163e6b9d2cd60e01b815260040160405180910390fd5b8060000361178f5761178d600787611bb3565b505b82546001600160801b038083166fffffffffffffffffffffffffffffffff1992831617855560018054918516919092161790556040516001600160a01b038716907f80cf2e80441b35f6fb6db47e95f658f5dc06cbee618ed7c8d21189f0eb8c8885906117ff9088815260200190565b60405180910390a25b50505092915050565b6040516001600160a01b0383811660248301526044820183905261166d91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611bc8565b6040516370a0823160e01b815230600482015260009081906001600160a01b038716906370a0823190602401602060405180830381865afa1580156118b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118dd91906123a0565b90506118f46001600160a01b038716863087611c39565b6040516370a0823160e01b815230600482015281906001600160a01b038816906370a0823190602401602060405180830381865afa15801561193a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195e91906123a0565b61196891906122d9565b91508160000361198b5760405163c47a846d60e01b815260040160405180910390fd5b6001600160801b038211156119b35760405163e6b9d2cd60e01b815260040160405180910390fd5b828210156119de576040516312f9363160e11b815260048101839052602481018490526044016106f5565b50949350505050565b6001546001600160801b0316600003611a135760405163736706cd60e01b815260040160405180910390fd5b6001546001600160801b0316611a31670de0b6b3a7640000836122ec565b611a3b9190612319565b600080828254611a4b9190612297565b909155505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000805160206123d08339815191525460ff166106bb57604051638dfc202b60e01b815260040160405180910390fd5b6000826000018281548110611b0b57611b0b6122aa565b9060005260206000200154905092915050565b611b2783611c72565b611b2f611c83565b611b37611c93565b611b3f611c9b565b611b47611487565b6001600160a01b038416611b6e576040516316709a1760e21b815260040160405180910390fd5b5050600380546001600160a01b039093166001600160a01b03199384168117909155600480549093161790915550565b6000610542836001600160a01b038416611cab565b6000610542836001600160a01b038416611cfa565b600080602060008451602086016000885af180611beb576040513d6000823e3d81fd5b50506000513d91508115611c03578060011415611c10565b6001600160a01b0384163b155b15610e6f57604051635274afe760e01b81526001600160a01b03851660048201526024016106f5565b6040516001600160a01b038481166024830152838116604483015260648201839052610e6f9186918216906323b872dd9060840161183e565b611c7a611ded565b61070781611e36565b611c8b611ded565b6106bb611e68565b6106bb611ded565b611ca3611ded565b6106bb611e89565b6000818152600183016020526040812054611cf2575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105e8565b5060006105e8565b60008181526001830160205260408120548015611de3576000611d1e6001836122d9565b8554909150600090611d32906001906122d9565b9050808214611d97576000866000018281548110611d5257611d526122aa565b9060005260206000200154905080876000018481548110611d7557611d756122aa565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611da857611da86123b9565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105e8565b60009150506105e8565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166106bb57604051631afcd79f60e31b815260040160405180910390fd5b611e3e611ded565b6001600160a01b0381166106fe57604051631e4fbdf760e01b8152600060048201526024016106f5565b611e70611ded565b6000805160206123d0833981519152805460ff19169055565b610f84611ded565b80356001600160a01b0381168114611ea857600080fd5b919050565b60008083601f840112611ebf57600080fd5b50813567ffffffffffffffff811115611ed757600080fd5b6020830191508360208260051b8501011115611ef257600080fd5b9250929050565b600080600060408486031215611f0e57600080fd5b611f1784611e91565b9250602084013567ffffffffffffffff811115611f3357600080fd5b611f3f86828701611ead565b9497909650939450505050565b600060208284031215611f5e57600080fd5b61054282611e91565b600080600080600060808688031215611f7f57600080fd5b611f8886611e91565b94506020860135935060408601359250606086013567ffffffffffffffff811115611fb257600080fd5b611fbe88828901611ead565b969995985093965092949392505050565b60008060208385031215611fe257600080fd5b823567ffffffffffffffff811115611ff957600080fd5b61200585828601611ead565b90969095509350505050565b6000806000806060858703121561202757600080fd5b61203085611e91565b935060208501359250604085013567ffffffffffffffff81111561205357600080fd5b61205f87828801611ead565b95989497509550505050565b803561ffff81168114611ea857600080fd5b60008060008060006080868803121561209557600080fd5b61209e8661206b565b94506120ac6020870161206b565b93506120ba6040870161206b565b9250606086013567ffffffffffffffff811115611fb257600080fd5b6000806000604084860312156120eb57600080fd5b83358015158114611f1757600080fd5b6000806040838503121561210e57600080fd5b50508035926020909101359150565b6040808252835190820181905260009060208501906060840190835b8181101561218c57835180516001600160a01b031684526020808201516001600160801b031681860152604080830151908601526060918201519185019190915290930192608090920191600101612139565b5050602093909301939093525092915050565b600080600080606085870312156121b557600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561205357600080fd5b600080600080606085870312156121f057600080fd5b6121f985611e91565b935061220760208601611e91565b9250604085013567ffffffffffffffff81111561222357600080fd5b8501601f8101871361223457600080fd5b803567ffffffffffffffff81111561224b57600080fd5b87602082840101111561225d57600080fd5b949793965060200194505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156105e8576105e8612281565b634e487b7160e01b600052603260045260246000fd5b6000600182016122d2576122d2612281565b5060010190565b818103818111156105e8576105e8612281565b80820281158282048414176105e8576105e8612281565b634e487b7160e01b600052601260045260246000fd5b60008261232857612328612303565b500490565b60008261233c5761233c612303565b500690565b6000600160ff1b820161235657612356612281565b5060000390565b60008060006060848603121561237257600080fd5b61237b8461206b565b92506123896020850161206b565b91506123976040850161206b565b90509250925092565b6000602082840312156123b257600080fd5b5051919050565b634e487b7160e01b600052603160045260246000fdfecd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a26469706673582212207c1ee9a2305106b92eeebeecb9b37d4a3dd4cf191939c3d3cb625454ed8e5a2f64736f6c634300081c0033
Deployed Bytecode
0x6080604052600436106101815760003560e01c80637e02e27b116100d1578063b32ec1f91161008a578063e941fa7811610064578063e941fa7814610487578063f2fde38b146104a8578063f6ed2017146104c8578063f7c618c1146104e857600080fd5b8063b32ec1f91461043f578063cf7a1d7714610452578063e30c39781461047257600080fd5b80637e02e27b1461036c57806384fa1f7c1461037f5780638da5cb5b146103925780639684e3dc146103a7578063ad71bd36146103ee578063afa7a8c21461041c57600080fd5b806361326c191161013e5780636e5f6919116101185780636e5f6919146102f5578063715018a61461030857806372f702f31461031f57806379ba50971461035757600080fd5b806361326c191461026957806367a527931461027c5780636a86550f146102aa57600080fd5b80630b76619b146101865780632026ffa3146101c3578063379f53e3146101e457806348284789146102115780635c975abb146102265780635f55f6f314610256575b600080fd5b34801561019257600080fd5b506001546101a6906001600160801b031681565b6040516001600160801b0390911681526020015b60405180910390f35b6101d66101d1366004611ef9565b610508565b6040519081526020016101ba565b3480156101f057600080fd5b506101d66101ff366004611f4c565b60026020526000908152604090205481565b34801561021d57600080fd5b506101d6610549565b34801561023257600080fd5b506000805160206123d08339815191525460ff1660405190151581526020016101ba565b6101d6610264366004611f67565b61055a565b6101d6610277366004611fcf565b6105a7565b34801561028857600080fd5b506009546102979061ffff1681565b60405161ffff90911681526020016101ba565b3480156102b657600080fd5b506102ca6102c5366004611f4c565b6105ee565b6040805182516001600160801b031681526020808401519082015291810151908201526060016101ba565b6101d6610303366004612011565b610666565b34801561031457600080fd5b5061031d6106a9565b005b34801561032b57600080fd5b5060035461033f906001600160a01b031681565b6040516001600160a01b0390911681526020016101ba565b34801561036357600080fd5b5061031d6106bd565b61031d61037a36600461207d565b61070a565b61031d61038d3660046120d6565b610732565b34801561039e57600080fd5b5061033f610768565b3480156103b357600080fd5b506101d66103c2366004611f4c565b6001600160a01b0390811660009081526006602090815260408083206004549094168352929052205490565b3480156103fa57600080fd5b5061040e6104093660046120fb565b61079d565b6040516101ba92919061211d565b34801561042857600080fd5b5060095461029790640100000000900461ffff1681565b6101d661044d36600461219f565b61098e565b34801561045e57600080fd5b5061031d61046d3660046121da565b6109b6565b34801561047e57600080fd5b5061033f610acc565b34801561049357600080fd5b506009546102979062010000900461ffff1681565b3480156104b457600080fd5b5061031d6104c3366004611f4c565b610af5565b3480156104d457600080fd5b506101d66104e3366004611f4c565b610b7a565b3480156104f457600080fd5b5060045461033f906001600160a01b031681565b6000610512610bf7565b828261051e8282610c2f565b61052786610e75565b9250505061054260016000805160206123f083398151915255565b9392505050565b60006105556007610f98565b905090565b6000610564610fa2565b61056c610bf7565b82826105788282610c2f565b610583888888610fd3565b9250505061059e60016000805160206123f083398151915255565b95945050505050565b60006105b1610fa2565b6105b9610bf7565b82826105c58282610c2f565b6105cd611089565b925050506105e860016000805160206123f083398151915255565b92915050565b61061b604051806060016040528060006001600160801b0316815260200160008152602001600081525090565b506001600160a01b0316600090815260056020908152604091829020825160608101845281546001600160801b03168152600182015492810192909252600201549181019190915290565b6000610670610bf7565b828261067c8282610c2f565b6106868787611197565b925050506106a160016000805160206123f083398151915255565b949350505050565b6106b1611278565b6106bb60006112aa565b565b33806106c7610acc565b6001600160a01b0316146106fe5760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b610707816112aa565b50565b610712611278565b818161071e8282610c2f565b6107298787876112e6565b50505050505050565b61073a611278565b81816107468282610c2f565b841561075957610754611427565b610761565b610761611487565b5050505050565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b606060006107a9610549565b90506107b68484836114d0565b93508367ffffffffffffffff8111156107d1576107d161226b565b60405190808252806020026020018201604052801561082357816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816107ef5790505b50915060005b6108338486612297565b61083d8583612297565b101561098657600061085a6108528684612297565b60079061151e565b90508084838151811061086f5761086f6122aa565b6020908102919091018101516001600160a01b03928316905290821660009081526005909152604090205484516001600160801b03909116908590849081106108ba576108ba6122aa565b6020026020010151602001906001600160801b031690816001600160801b03168152505060056000826001600160a01b03166001600160a01b0316815260200190815260200160002060010154848381518110610919576109196122aa565b6020026020010151604001818152505060056000826001600160a01b03166001600160a01b0316815260200190815260200160002060020154848381518110610964576109646122aa565b602090810291909101015160600152508061097e816122c0565b915050610829565b509250929050565b6000610998610fa2565b6109a0610bf7565b82826109ac8282610c2f565b610686878761152a565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156109fc5750825b905060008267ffffffffffffffff166001148015610a195750303b155b905081158015610a27575080155b15610a455760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a6f57845460ff60401b1916600160401b1785555b610a7b898989896115a2565b8315610ac157845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0061078d565b610afd611278565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b0383169081178255610b41610768565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b6001600160a01b0381166000908152600560205260409020600181015481549091906001600160801b031615610bf157670de0b6b3a76400008160020154600054610bc591906122d9565b8254610bda91906001600160801b03166122ec565b610be49190612319565b610bee9083612297565b91505b50919050565b6000805160206123f0833981519152805460011901610c2957604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b34818115610e6f578015610e565780821015610c5e57604051636fe0fba360e11b815260040160405180910390fd5b6000610c6a8284612319565b90506000610c78838561232d565b905060005b83811015610e4e576000878783818110610c9957610c996122aa565b9050602002016020810190610cae9190611f4c565b6001600160a01b031603610cd5576040516316709a1760e21b815260040160405180910390fd5b6000610ce18385612297565b90506000888884818110610cf757610cf76122aa565b9050602002016020810190610d0c9190611f4c565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114610d56576040519150601f19603f3d011682016040523d82523d6000602084013e610d5b565b606091505b5050905080610dd757888884818110610d7657610d766122aa565b9050602002016020810190610d8b9190611f4c565b6001600160a01b03167fffa4ae17301d79d9f0aaae82668d39104fcd3e0ada8bc96249f642730615b51a83604051610dc591815260200190565b60405180910390a2610dd733836115cf565b888884818110610de957610de96122aa565b9050602002016020810190610dfe9190611f4c565b6001600160a01b03167f6b7bb0b92cd59ba9788b4dfc60bc3df994068312c781a7e82cfb2b9e78e8cab383604051610e3891815260200190565b60405180910390a2506000925050600101610c7d565b505050610e6f565b60405163593f696160e01b815260040160405180910390fd5b50505050565b60006001600160a01b038216610e9e576040516316709a1760e21b815260040160405180910390fd5b33600081815260056020526040812091610eba905b6000611672565b90508015610542576000600183018190556004546001600160a01b031681526002602052604081208054839290610ef2908490612297565b90915550503360009081526006602090815260408083206004546001600160a01b0316845290915281208054839290610f2c908490612297565b9091555050600454610f48906001600160a01b03168583611811565b60405181815233907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d49060200160405180910390a29392505050565b60016000805160206123f083398151915255565b60006105e8825490565b6000805160206123d08339815191525460ff16156106bb5760405163d93c066560e01b815260040160405180910390fd5b60006001600160a01b038416610ffc57604051631538ebc360e21b815260040160405180910390fd5b600354611015906001600160a01b0316335b8585611870565b60095490915061ffff161580159061103757506001546001600160801b031615155b1561107757600954600090612710906110549061ffff16846122ec565b61105e9190612319565b905061106a81836122d9565b9150611075816119e7565b505b6110818482611672565b509392505050565b600061109433610eb3565b9050801561117e5733600090815260056020526040812060010155600954640100000000900461ffff161561110657600954600090612710906110e390640100000000900461ffff16846122ec565b6110ed9190612319565b90506110f981836122d9565b9150611104816119e7565b505b6111103382611672565b5060405181815233907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d49060200160405180910390a260405181815233907ffc11547e675aec955dee8afa8fab2509420a3a91ca90e88b9b95db75bdf4c00b9060200160405180910390a290565b604051637dcf504560e01b815260040160405180910390fd5b60006001600160a01b0383166111c057604051631538ebc360e21b815260040160405180910390fd5b816000036111e157604051630ca20ee760e01b815260040160405180910390fd5b50806111f5336111f083612341565b611672565b5060095462010000900461ffff161580159061121b57506001546001600160801b031615155b15611261576009546000906127109061123e9062010000900461ffff16846122ec565b6112489190612319565b905061125481836122d9565b915061125f816119e7565b505b6003546105e8906001600160a01b03168483611811565b33611281610768565b6001600160a01b0316146106bb5760405163118cdaa760e01b81523360048201526024016106f5565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b03191681556112e282611a53565b5050565b808284171761ffff1660000361130f576040516363a5858b60e11b815260040160405180910390fd5b6103e88361ffff16118061132857506103e88261ffff16115b8061133857506103e88161ffff16115b156113565760405163335c1b8360e21b815260040160405180910390fd5b60095461ffff848116911614611378576009805461ffff191661ffff85161790555b60095461ffff8381166201000090920416146113a7576009805463ffff000019166201000061ffff8516021790555b60095461ffff82811664010000000090920416146113dc576009805465ffff00000000191664010000000061ffff8416021790555b6040805161ffff8581168252848116602083015283168183015290517f8e05a662e732e4c6ab8ef59a2504c6502f5cc89d4e5bc7edd9f339f0e80e73d99181900360600190a1505050565b61142f611ac4565b6000805160206123d0833981519152805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a150565b61148f610fa2565b6000805160206123d0833981519152805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833611469565b6000816114dd8486612297565b1180156114e957508183105b156114ff576114f883836122d9565b9050610542565b8161150a8486612297565b11611516575082610542565b506000610542565b60006105428383611af4565b600454600090611543906001600160a01b03163361100e565b905061154e816119e7565b60015460408051838152602081018690526001600160801b03909216828201525133917fdff8c28014db33834beee8e781f6d605c9cb46451508a58468ffd33c597532d1919081900360600190a292915050565b6115ae84848484611b1e565b600080806115be8486018661235d565b9250925092506107298383836112e6565b804710156115f95760405163cf47918160e01b8152476004820152602481018290526044016106f5565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611646576040519150601f19603f3d011682016040523d82523d6000602084013e61164b565b606091505b505090508061166d5760405163d6bda27560e01b815260040160405180910390fd5b505050565b6001600160a01b038216600090815260056020526040812080546001600160801b0316156116ed57670de0b6b3a764000081600201546000546116b591906122d9565b82546116ca91906001600160801b03166122ec565b6116d49190612319565b8160010160008282546116e79190612297565b90915550505b6001808201546000546002840155905482549193506001600160801b0390811691168415611808578060000361172a57611728600787611b9e565b505b9084019084016000811215611752576040516371a3b96f60e01b815260040160405180910390fd5b6001600160801b0382111561177a5760405163e6b9d2cd60e01b815260040160405180910390fd5b8060000361178f5761178d600787611bb3565b505b82546001600160801b038083166fffffffffffffffffffffffffffffffff1992831617855560018054918516919092161790556040516001600160a01b038716907f80cf2e80441b35f6fb6db47e95f658f5dc06cbee618ed7c8d21189f0eb8c8885906117ff9088815260200190565b60405180910390a25b50505092915050565b6040516001600160a01b0383811660248301526044820183905261166d91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611bc8565b6040516370a0823160e01b815230600482015260009081906001600160a01b038716906370a0823190602401602060405180830381865afa1580156118b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118dd91906123a0565b90506118f46001600160a01b038716863087611c39565b6040516370a0823160e01b815230600482015281906001600160a01b038816906370a0823190602401602060405180830381865afa15801561193a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195e91906123a0565b61196891906122d9565b91508160000361198b5760405163c47a846d60e01b815260040160405180910390fd5b6001600160801b038211156119b35760405163e6b9d2cd60e01b815260040160405180910390fd5b828210156119de576040516312f9363160e11b815260048101839052602481018490526044016106f5565b50949350505050565b6001546001600160801b0316600003611a135760405163736706cd60e01b815260040160405180910390fd5b6001546001600160801b0316611a31670de0b6b3a7640000836122ec565b611a3b9190612319565b600080828254611a4b9190612297565b909155505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000805160206123d08339815191525460ff166106bb57604051638dfc202b60e01b815260040160405180910390fd5b6000826000018281548110611b0b57611b0b6122aa565b9060005260206000200154905092915050565b611b2783611c72565b611b2f611c83565b611b37611c93565b611b3f611c9b565b611b47611487565b6001600160a01b038416611b6e576040516316709a1760e21b815260040160405180910390fd5b5050600380546001600160a01b039093166001600160a01b03199384168117909155600480549093161790915550565b6000610542836001600160a01b038416611cab565b6000610542836001600160a01b038416611cfa565b600080602060008451602086016000885af180611beb576040513d6000823e3d81fd5b50506000513d91508115611c03578060011415611c10565b6001600160a01b0384163b155b15610e6f57604051635274afe760e01b81526001600160a01b03851660048201526024016106f5565b6040516001600160a01b038481166024830152838116604483015260648201839052610e6f9186918216906323b872dd9060840161183e565b611c7a611ded565b61070781611e36565b611c8b611ded565b6106bb611e68565b6106bb611ded565b611ca3611ded565b6106bb611e89565b6000818152600183016020526040812054611cf2575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105e8565b5060006105e8565b60008181526001830160205260408120548015611de3576000611d1e6001836122d9565b8554909150600090611d32906001906122d9565b9050808214611d97576000866000018281548110611d5257611d526122aa565b9060005260206000200154905080876000018481548110611d7557611d756122aa565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611da857611da86123b9565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105e8565b60009150506105e8565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166106bb57604051631afcd79f60e31b815260040160405180910390fd5b611e3e611ded565b6001600160a01b0381166106fe57604051631e4fbdf760e01b8152600060048201526024016106f5565b611e70611ded565b6000805160206123d0833981519152805460ff19169055565b610f84611ded565b80356001600160a01b0381168114611ea857600080fd5b919050565b60008083601f840112611ebf57600080fd5b50813567ffffffffffffffff811115611ed757600080fd5b6020830191508360208260051b8501011115611ef257600080fd5b9250929050565b600080600060408486031215611f0e57600080fd5b611f1784611e91565b9250602084013567ffffffffffffffff811115611f3357600080fd5b611f3f86828701611ead565b9497909650939450505050565b600060208284031215611f5e57600080fd5b61054282611e91565b600080600080600060808688031215611f7f57600080fd5b611f8886611e91565b94506020860135935060408601359250606086013567ffffffffffffffff811115611fb257600080fd5b611fbe88828901611ead565b969995985093965092949392505050565b60008060208385031215611fe257600080fd5b823567ffffffffffffffff811115611ff957600080fd5b61200585828601611ead565b90969095509350505050565b6000806000806060858703121561202757600080fd5b61203085611e91565b935060208501359250604085013567ffffffffffffffff81111561205357600080fd5b61205f87828801611ead565b95989497509550505050565b803561ffff81168114611ea857600080fd5b60008060008060006080868803121561209557600080fd5b61209e8661206b565b94506120ac6020870161206b565b93506120ba6040870161206b565b9250606086013567ffffffffffffffff811115611fb257600080fd5b6000806000604084860312156120eb57600080fd5b83358015158114611f1757600080fd5b6000806040838503121561210e57600080fd5b50508035926020909101359150565b6040808252835190820181905260009060208501906060840190835b8181101561218c57835180516001600160a01b031684526020808201516001600160801b031681860152604080830151908601526060918201519185019190915290930192608090920191600101612139565b5050602093909301939093525092915050565b600080600080606085870312156121b557600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561205357600080fd5b600080600080606085870312156121f057600080fd5b6121f985611e91565b935061220760208601611e91565b9250604085013567ffffffffffffffff81111561222357600080fd5b8501601f8101871361223457600080fd5b803567ffffffffffffffff81111561224b57600080fd5b87602082840101111561225d57600080fd5b949793965060200194505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156105e8576105e8612281565b634e487b7160e01b600052603260045260246000fd5b6000600182016122d2576122d2612281565b5060010190565b818103818111156105e8576105e8612281565b80820281158282048414176105e8576105e8612281565b634e487b7160e01b600052601260045260246000fd5b60008261232857612328612303565b500490565b60008261233c5761233c612303565b500690565b6000600160ff1b820161235657612356612281565b5060000390565b60008060006060848603121561237257600080fd5b61237b8461206b565b92506123896020850161206b565b91506123976040850161206b565b90509250925092565b6000602082840312156123b257600080fd5b5051919050565b634e487b7160e01b600052603160045260246000fdfecd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a26469706673582212207c1ee9a2305106b92eeebeecb9b37d4a3dd4cf191939c3d3cb625454ed8e5a2f64736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.