Source Code
Overview
ETH Balance
ETH Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 28318446 | 1 hr ago | 0 ETH | ||||
| 28312869 | 5 hrs ago | 0 ETH | ||||
| 28303714 | 11 hrs ago | 0 ETH | ||||
| 28303619 | 11 hrs ago | 0 ETH | ||||
| 28302889 | 11 hrs ago | 0 ETH | ||||
| 28302320 | 12 hrs ago | 0 ETH | ||||
| 28302297 | 12 hrs ago | 0 ETH | ||||
| 28300671 | 13 hrs ago | 0 ETH | ||||
| 28300611 | 13 hrs ago | 0 ETH | ||||
| 28296948 | 15 hrs ago | 0 ETH | ||||
| 28295741 | 16 hrs ago | 0 ETH | ||||
| 28286420 | 22 hrs ago | 0 ETH | ||||
| 28286400 | 22 hrs ago | 0 ETH | ||||
| 28284094 | 23 hrs ago | 0 ETH | ||||
| 28281917 | 24 hrs ago | 0 ETH | ||||
| 28281904 | 24 hrs ago | 0 ETH | ||||
| 28274478 | 29 hrs ago | 0 ETH | ||||
| 28270310 | 32 hrs ago | 0 ETH | ||||
| 28270298 | 32 hrs ago | 0 ETH | ||||
| 28269814 | 32 hrs ago | 0 ETH | ||||
| 28269797 | 32 hrs ago | 0 ETH | ||||
| 28258865 | 39 hrs ago | 0 ETH | ||||
| 28258859 | 39 hrs ago | 0 ETH | ||||
| 28256532 | 41 hrs ago | 0 ETH | ||||
| 28256520 | 41 hrs ago | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
StakedDistributor
Compiler Version
v0.8.10+commit.fc410830
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "./libraries/SafeToken.sol";
import "./Distributor.sol";
contract StakedDistributor is Distributor, ERC20Upgradeable {
using SafeToken for address;
struct Withdrawal {
uint256 amount;
uint256 releaseTime;
}
event Withdraw(address indexed user, uint256 amount);
uint256 public withdrawalPendingTime;
mapping(address => Withdrawal) public withdrawal;
address public underlying;
function initialize(
address claimable_,
string memory name,
string memory symbol,
address underlying_
) public initializer {
__Distributor_init(claimable_);
__ERC20_init(name, symbol);
underlying = underlying_;
withdrawalPendingTime = 7 * 1 days;
}
/* Admin functions */
function _setWithdrawalPendingTime(
uint256 withdrawalPendingTime_
) public onlyOwner {
withdrawalPendingTime = withdrawalPendingTime_;
}
function mint(uint256 amount) public {
underlying.safeTransferFrom(msg.sender, address(this), amount);
_mint(msg.sender, amount);
}
function burn(uint256 amount) public {
if (amount > 0) {
_burn(msg.sender, amount);
Withdrawal storage withdrawal_ = withdrawal[msg.sender];
withdrawal_.amount = withdrawal_.amount + amount;
withdrawal_.releaseTime = block.timestamp + withdrawalPendingTime;
}
}
function withdraw() public {
Withdrawal storage withdrawal_ = withdrawal[msg.sender];
require(
block.timestamp >= withdrawal_.releaseTime,
"StakedDistributor: not released"
);
uint256 amount = withdrawal_.amount;
withdrawal_.amount = 0;
underlying.safeTransfer(msg.sender, amount);
emit Withdraw(msg.sender, amount);
}
function _afterTokenTransfer(
address from,
address to,
uint256 /* amount */
) internal override {
if (from != address(0)) {
_editRecipientInternal(from, balanceOf(from));
}
if (to != address(0)) {
_editRecipientInternal(to, balanceOf(to));
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20Upgradeable.sol";
import "./extensions/IERC20MetadataUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC20_init_unchained(name_, symbol_);
}
function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[45] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "./libraries/SafeToken.sol";
import "./interfaces/IClaimable.sol";
abstract contract Distributor is OwnableUpgradeable {
using SafeMath for uint256;
using SafeToken for address;
uint256 public constant MANTISSA2 = 2 ** 160;
struct Recipient {
uint256 lastShareIndex;
uint256 credit;
}
// token => account => recipient
mapping(address => mapping(address => Recipient)) public recipients;
// account => shares
mapping(address => uint256) public shares;
// token => shareIndex
mapping(address => uint256) public shareIndex;
// token => totalShares
uint256 public totalShares;
event ClaimableUpdate(address oldClaimable, address newClaimable);
event UpdateShareIndex(address indexed token, uint256 shareIndex);
event UpdateCredit(
address indexed token,
address indexed account,
uint256 lastShareIndex,
uint256 credit
);
event EditRecipient(
address indexed account,
uint256 shares,
uint256 totalShares
);
event Claim(address indexed token, address indexed account, uint256 amount);
/// @notice Reward holder where can be claimed
address public claimable;
/// @notice Added reward tokens
address[] public tokens;
/// @notice Flag to check if reward token added before
mapping(address => bool) public tokenExists;
// Sets in initialize.
bool internal _notEntered;
modifier nonReentrant() {
require(_notEntered, "Distributor: REENTERED");
_notEntered = false;
_;
_notEntered = true;
}
function __Distributor_init(address claimable_) internal onlyInitializing {
__Ownable_init();
__Distributor_init_unchained(claimable_);
}
function __Distributor_init_unchained(
address claimable_
) internal onlyInitializing {
claimable = claimable_;
_notEntered = true;
}
/* Admin functions */
function _whitelistToken(address token_) external onlyOwner {
require(
token_ != address(0),
"Distributor: reward token cannot be zero address"
);
require(
!tokenExists[token_],
"Distributor: reward token already exists"
);
tokens.push(token_);
tokenExists[token_] = true;
}
function _setClaimable(address newClaimable) external onlyOwner {
require(
newClaimable != address(0),
"Distributor: claimable cannot be zero"
);
address oldClaimable = claimable;
claimable = newClaimable;
emit ClaimableUpdate(oldClaimable, newClaimable);
}
function updateShareIndex(
address token
) public virtual nonReentrant returns (uint256 _shareIndex) {
if (totalShares == 0) return shareIndex[token];
uint256 amount = claimFromClaimableInternal(token);
if (amount == 0) return shareIndex[token];
_shareIndex = amount.mul(MANTISSA2).div(totalShares).add(
shareIndex[token]
);
shareIndex[token] = _shareIndex;
emit UpdateShareIndex(token, _shareIndex);
}
/**
* claim token from claimable
* calculate after-before amount in any case if there is a fee etc.
* @param token Reward token to be claimed
*/
function claimFromClaimableInternal(
address token
) internal returns (uint256 claimedAmount) {
uint256 beforeAmount = token.balanceOf(address(this));
IClaimable(claimable).claim(token);
uint256 afterAmount = token.balanceOf(address(this));
claimedAmount = afterAmount - beforeAmount;
}
function updateCredit(
address token,
address account
) public returns (uint256 credit) {
require(tokenExists[token], "Distributor: Invalid token");
uint256 _shareIndex = updateShareIndex(token);
if (_shareIndex == 0) return 0;
Recipient storage recipient = recipients[token][account];
uint256 _shares = shares[account];
credit =
recipient.credit +
_shareIndex.sub(recipient.lastShareIndex).mul(_shares) /
MANTISSA2;
recipient.lastShareIndex = _shareIndex;
recipient.credit = credit;
emit UpdateCredit(token, account, _shareIndex, credit);
}
function claim(address token) external returns (uint256 amount) {
return claimInternal(token, msg.sender);
}
function claimAll() external returns (uint256[] memory amounts) {
amounts = new uint256[](tokens.length);
for (uint256 i = 0; i < tokens.length; i++) {
amounts[i] = claimInternal(tokens[i], msg.sender);
}
}
function claimInternal(
address token,
address account
) internal returns (uint256 amount) {
require(tokenExists[token], "Distributor: Invalid token");
amount = updateCredit(token, account);
if (amount > 0) {
recipients[token][account].credit = 0;
if (amount > 0) {
IERC20(token).transfer(account, amount);
emit Claim(token, account, amount);
}
}
}
function _editRecipientInternal(address account, uint256 shares_) internal {
for (uint256 i = 0; i < tokens.length; i++) {
updateCredit(tokens[i], account);
}
uint256 prevShares = shares[account];
uint256 _totalShares = shares_ > prevShares
? totalShares.add(shares_ - prevShares)
: totalShares.sub(prevShares - shares_);
totalShares = _totalShares;
shares[account] = shares_;
emit EditRecipient(account, shares_, _totalShares);
}
/** Getters */
function getTokens() public view returns (address[] memory) {
return tokens;
}
}//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
interface IClaimable {
function claim(address token) external returns (uint256 amount);
event Claim(address indexed token, address indexed account, uint256 amount);
}//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
interface ERC20Interface {
function balanceOf(address user) external view returns (uint256);
}
library SafeToken {
function myBalance(address token) internal view returns (uint256) {
return ERC20Interface(token).balanceOf(address(this));
}
function balanceOf(
address token,
address user
) internal view returns (uint256) {
return ERC20Interface(token).balanceOf(user);
}
function safeApprove(address token, address to, uint256 value) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(0x095ea7b3, to, value)
);
require(
success && (data.length == 0 || abi.decode(data, (bool))),
"!safeApprove"
);
}
function safeTransfer(address token, address to, uint256 value) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(0xa9059cbb, to, value)
);
require(
success && (data.length == 0 || abi.decode(data, (bool))),
"!safeTransfer"
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(0x23b872dd, from, to, value)
);
require(
success && (data.length == 0 || abi.decode(data, (bool))),
"!safeTransferFrom"
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, "!safeTransferETH");
}
}{
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldClaimable","type":"address"},{"indexed":false,"internalType":"address","name":"newClaimable","type":"address"}],"name":"ClaimableUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalShares","type":"uint256"}],"name":"EditRecipient","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"lastShareIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"credit","type":"uint256"}],"name":"UpdateCredit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"shareIndex","type":"uint256"}],"name":"UpdateShareIndex","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"MANTISSA2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newClaimable","type":"address"}],"name":"_setClaimable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"withdrawalPendingTime_","type":"uint256"}],"name":"_setWithdrawalPendingTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"}],"name":"_whitelistToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"claim","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimAll","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimable","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"claimable_","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"underlying_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"recipients","outputs":[{"internalType":"uint256","name":"lastShareIndex","type":"uint256"},{"internalType":"uint256","name":"credit","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"shareIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"shares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"underlying","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"updateCredit","outputs":[{"internalType":"uint256","name":"credit","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"updateShareIndex","outputs":[{"internalType":"uint256","name":"_shareIndex","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"withdrawal","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"releaseTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawalPendingTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b50612353806100206000396000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c80638daa0acb11610130578063b33f78ca116100b8578063d2f22cf01161007c578063d2f22cf0146104dd578063d77fa7ee146104fd578063dd62ed3e1461052f578063efe235d014610542578063f2fde38b1461055557600080fd5b8063b33f78ca1461045f578063c9b6198114610482578063cad9efff14610495578063ce7c2ac2146104a8578063d1058e59146104c857600080fd5b8063a457c2d7116100ff578063a457c2d714610406578063a4692a2614610419578063a9059cbb14610424578063aa6ca80814610437578063af38d7571461044c57600080fd5b80638daa0acb1461039c57806395d89b41146103af57806396131049146103b7578063a0712d68146103f357600080fd5b806342966c68116101b35780636f307dc3116101825780636f307dc31461033457806370a0823114610347578063715018a61461037057806375d42633146103785780638da5cb5b1461038b57600080fd5b806342966c68146102da5780634f64b2be146102ed5780636131ab0314610318578063613d25bb1461032157600080fd5b806323b872dd116101fa57806323b872dd14610292578063313ce567146102a557806339509351146102b45780633a98ef39146102c75780633ccfd60b146102d057600080fd5b806306fdde031461022c578063095ea7b31461024a57806318160ddd1461026d5780631e83409a1461027f575b600080fd5b610234610568565b6040516102419190611ec0565b60405180910390f35b61025d610258366004611f0f565b6105fa565b6040519015158152602001610241565b606f545b604051908152602001610241565b61027161028d366004611f39565b610614565b61025d6102a0366004611f54565b610620565b60405160128152602001610241565b61025d6102c2366004611f0f565b610644565b61027160685481565b6102d8610666565b005b6102d86102e8366004611f90565b610724565b6103006102fb366004611f90565b610769565b6040516001600160a01b039091168152602001610241565b610271609f5481565b6102d861032f36600461204c565b610793565b60a154610300906001600160a01b031681565b610271610355366004611f39565b6001600160a01b03166000908152606d602052604090205490565b6102d86108d5565b610271610386366004611f39565b6108e9565b6033546001600160a01b0316610300565b6102d86103aa366004611f39565b610a45565b610234610b9d565b6103de6103c5366004611f39565b60a0602052600090815260409020805460019091015482565b60408051928352602083019190915201610241565b6102d8610401366004611f90565b610bac565b61025d610414366004611f0f565b610bce565b610271600160a01b81565b61025d610432366004611f0f565b610c49565b61043f610c57565b60405161024191906120d1565b606954610300906001600160a01b031681565b61025d61046d366004611f39565b606b6020526000908152604090205460ff1681565b6102d8610490366004611f90565b610cb8565b6102d86104a3366004611f39565b610cc5565b6102716104b6366004611f39565b60666020526000908152604090205481565b6104d0610d92565b604051610241919061211e565b6102716104eb366004611f39565b60676020526000908152604090205481565b6103de61050b366004612156565b60656020908152600092835260408084209091529082529020805460019091015482565b61027161053d366004612156565b610e4d565b610271610550366004612156565b610e78565b6102d8610563366004611f39565b610fc3565b60606070805461057790612189565b80601f01602080910402602001604051908101604052809291908181526020018280546105a390612189565b80156105f05780601f106105c5576101008083540402835291602001916105f0565b820191906000526020600020905b8154815290600101906020018083116105d357829003601f168201915b5050505050905090565b600033610608818585611039565b60019150505b92915050565b600061060e823361115d565b60003361062e8582856112cf565b610639858585611349565b506001949350505050565b6000336106088185856106578383610e4d565b61066191906121da565b611039565b33600090815260a06020526040902060018101544210156106ce5760405162461bcd60e51b815260206004820152601f60248201527f5374616b65644469737472696275746f723a206e6f742072656c65617365640060448201526064015b60405180910390fd5b80546000825560a1546106eb906001600160a01b031633836114fa565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a25050565b80156107665761073433826115fe565b33600090815260a06020526040902080546107509083906121da565b8155609f5461075f90426121da565b6001909101555b50565b606a818154811061077957600080fd5b6000918252602090912001546001600160a01b0316905081565b600054610100900460ff16158080156107b35750600054600160ff909116105b806107cd5750303b1580156107cd575060005460ff166001145b6108305760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016106c5565b6000805460ff191660011790558015610853576000805461ff0019166101001790555b61085c8561173e565b6108668484611776565b60a180546001600160a01b0319166001600160a01b03841617905562093a80609f5580156108ce576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6108dd6117ab565b6108e76000611805565b565b606c5460009060ff166109375760405162461bcd60e51b8152602060048201526016602482015275111a5cdd1c9a589d5d1bdc8e8814915153951154915160521b60448201526064016106c5565b606c805460ff1916905560685461096757506001600160a01b038116600090815260676020526040902054610a33565b600061097283611857565b9050806109995750506001600160a01b038116600090815260676020526040902054610a33565b6001600160a01b0383166000908152606760205260409020546068546109d891906109d2906109cc85600160a01b611909565b9061191c565b90611928565b6001600160a01b0384166000818152606760205260409081902083905551919350907f89642dc017a85c05a3e33e3f7040d5fd40e0e2da284ade291929c335f04eebc290610a299085815260200190565b60405180910390a2505b606c805460ff19166001179055919050565b610a4d6117ab565b6001600160a01b038116610abc5760405162461bcd60e51b815260206004820152603060248201527f4469737472696275746f723a2072657761726420746f6b656e2063616e6e6f7460448201526f206265207a65726f206164647265737360801b60648201526084016106c5565b6001600160a01b0381166000908152606b602052604090205460ff1615610b365760405162461bcd60e51b815260206004820152602860248201527f4469737472696275746f723a2072657761726420746f6b656e20616c72656164604482015267792065786973747360c01b60648201526084016106c5565b606a805460018181019092557f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a510180546001600160a01b039093166001600160a01b0319909316831790556000918252606b6020526040909120805460ff19169091179055565b60606071805461057790612189565b60a154610bc4906001600160a01b0316333084611934565b6107663382611a4c565b60003381610bdc8286610e4d565b905083811015610c3c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016106c5565b6106398286868403611039565b600033610608818585611349565b6060606a8054806020026020016040519081016040528092919081815260200182805480156105f057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c91575050505050905090565b610cc06117ab565b609f55565b610ccd6117ab565b6001600160a01b038116610d315760405162461bcd60e51b815260206004820152602560248201527f4469737472696275746f723a20636c61696d61626c652063616e6e6f74206265604482015264207a65726f60d81b60648201526084016106c5565b606980546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f7b0f57de92c389b18aeb87f2b782aa383f348b53d36075a469fd8e927c4350db910160405180910390a15050565b606a5460609067ffffffffffffffff811115610db057610db0611fa9565b604051908082528060200260200182016040528015610dd9578160200160208202803683370190505b50905060005b606a54811015610e4957610e1a606a8281548110610dff57610dff6121f2565b6000918252602090912001546001600160a01b03163361115d565b828281518110610e2c57610e2c6121f2565b602090810291909101015280610e4181612208565b915050610ddf565b5090565b6001600160a01b039182166000908152606e6020908152604080832093909416825291909152205490565b6001600160a01b0382166000908152606b602052604081205460ff16610ee05760405162461bcd60e51b815260206004820152601a60248201527f4469737472696275746f723a20496e76616c696420746f6b656e00000000000060448201526064016106c5565b6000610eeb846108e9565b905080610efc57600091505061060e565b6001600160a01b03808516600090815260656020908152604080832093871683529281528282206066909152919020548154600160a01b90610f4b908390610f45908790611b15565b90611909565b610f559190612223565b8260010154610f6491906121da565b8383556001830181905560408051858152602081018390529195506001600160a01b0387811692908916917f39cb59c115665c2eda6fe547d7c2a8a8f6908243bf576a69f574973a0b650206910160405180910390a350505092915050565b610fcb6117ab565b6001600160a01b0381166110305760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106c5565b61076681611805565b6001600160a01b03831661109b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106c5565b6001600160a01b0382166110fc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106c5565b6001600160a01b038381166000818152606e602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0382166000908152606b602052604081205460ff166111c55760405162461bcd60e51b815260206004820152601a60248201527f4469737472696275746f723a20496e76616c696420746f6b656e00000000000060448201526064016106c5565b6111cf8383610e78565b9050801561060e576001600160a01b038084166000908152606560209081526040808320938616835292905290812060010155801561060e5760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611257573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127b9190612245565b50816001600160a01b0316836001600160a01b03167f70eb43c4a8ae8c40502dcf22436c509c28d6ff421cf07c491be56984bd987068836040516112c191815260200190565b60405180910390a392915050565b60006112db8484610e4d565b9050600019811461134357818110156113365760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016106c5565b6113438484848403611039565b50505050565b6001600160a01b0383166113ad5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106c5565b6001600160a01b03821661140f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106c5565b6001600160a01b0383166000908152606d6020526040902054818110156114875760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016106c5565b6001600160a01b038085166000818152606d602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906114e79086815260200190565b60405180910390a3611343848484611b21565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916115569190612267565b6000604051808303816000865af19150503d8060008114611593576040519150601f19603f3d011682016040523d82523d6000602084013e611598565b606091505b50915091508180156115c25750805115806115c25750808060200190518101906115c29190612245565b6108ce5760405162461bcd60e51b815260206004820152600d60248201526c10b9b0b332aa3930b739b332b960991b60448201526064016106c5565b6001600160a01b03821661165e5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016106c5565b6001600160a01b0382166000908152606d6020526040902054818110156116d25760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016106c5565b6001600160a01b0383166000818152606d602090815260408083208686039055606f80548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a361173983600084611b21565b505050565b600054610100900460ff166117655760405162461bcd60e51b81526004016106c590612283565b61176d611b8a565b61076681611bb9565b600054610100900460ff1661179d5760405162461bcd60e51b81526004016106c590612283565b6117a78282611c0f565b5050565b6033546001600160a01b031633146108e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106c5565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008061186d6001600160a01b03841630611c5d565b606954604051630f41a04d60e11b81526001600160a01b038681166004830152929350911690631e83409a906024016020604051808303816000875af11580156118bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118df91906122ce565b5060006118f56001600160a01b03851630611c5d565b905061190182826122e7565b949350505050565b600061191582846122fe565b9392505050565b60006119158284612223565b600061191582846121da565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916119989190612267565b6000604051808303816000865af19150503d80600081146119d5576040519150601f19603f3d011682016040523d82523d6000602084013e6119da565b606091505b5091509150818015611a04575080511580611a04575080806020019051810190611a049190612245565b611a445760405162461bcd60e51b815260206004820152601160248201527021736166655472616e7366657246726f6d60781b60448201526064016106c5565b505050505050565b6001600160a01b038216611aa25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016106c5565b80606f6000828254611ab491906121da565b90915550506001600160a01b0382166000818152606d60209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36117a760008383611b21565b600061191582846122e7565b6001600160a01b03831615611b5857611b5883611b53856001600160a01b03166000908152606d602052604090205490565b611ccb565b6001600160a01b038216156117395761173982611b53846001600160a01b03166000908152606d602052604090205490565b600054610100900460ff16611bb15760405162461bcd60e51b81526004016106c590612283565b6108e7611dd4565b600054610100900460ff16611be05760405162461bcd60e51b81526004016106c590612283565b606980546001600160a01b0319166001600160a01b0392909216919091179055606c805460ff19166001179055565b600054610100900460ff16611c365760405162461bcd60e51b81526004016106c590612283565b8151611c49906070906020850190611e04565b508051611739906071906020840190611e04565b6040516370a0823160e01b81526001600160a01b038281166004830152600091908416906370a0823190602401602060405180830381865afa158015611ca7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191591906122ce565b60005b606a54811015611d1c57611d09606a8281548110611cee57611cee6121f2565b6000918252602090912001546001600160a01b031684610e78565b5080611d1481612208565b915050611cce565b506001600160a01b03821660009081526066602052604081205490818311611d5957611d54611d4b84846122e7565b60685490611b15565b611d6f565b611d6f611d6683856122e7565b60685490611928565b60688190556001600160a01b038516600081815260666020908152604091829020879055815187815290810184905292935090917fff3664f5f2f8f85ecd8d30ef2aa6773d8a8448219c7421dcbb67957fb3fafba1910160405180910390a250505050565b600054610100900460ff16611dfb5760405162461bcd60e51b81526004016106c590612283565b6108e733611805565b828054611e1090612189565b90600052602060002090601f016020900481019282611e325760008555611e78565b82601f10611e4b57805160ff1916838001178555611e78565b82800160010185558215611e78579182015b82811115611e78578251825591602001919060010190611e5d565b50610e499291505b80821115610e495760008155600101611e80565b60005b83811015611eaf578181015183820152602001611e97565b838111156113435750506000910152565b6020815260008251806020840152611edf816040850160208701611e94565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114611f0a57600080fd5b919050565b60008060408385031215611f2257600080fd5b611f2b83611ef3565b946020939093013593505050565b600060208284031215611f4b57600080fd5b61191582611ef3565b600080600060608486031215611f6957600080fd5b611f7284611ef3565b9250611f8060208501611ef3565b9150604084013590509250925092565b600060208284031215611fa257600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112611fd057600080fd5b813567ffffffffffffffff80821115611feb57611feb611fa9565b604051601f8301601f19908116603f0116810190828211818310171561201357612013611fa9565b8160405283815286602085880101111561202c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000806080858703121561206257600080fd5b61206b85611ef3565b9350602085013567ffffffffffffffff8082111561208857600080fd5b61209488838901611fbf565b945060408701359150808211156120aa57600080fd5b506120b787828801611fbf565b9250506120c660608601611ef3565b905092959194509250565b6020808252825182820181905260009190848201906040850190845b818110156121125783516001600160a01b0316835292840192918401916001016120ed565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156121125783518352928401929184019160010161213a565b6000806040838503121561216957600080fd5b61217283611ef3565b915061218060208401611ef3565b90509250929050565b600181811c9082168061219d57607f821691505b602082108114156121be57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156121ed576121ed6121c4565b500190565b634e487b7160e01b600052603260045260246000fd5b600060001982141561221c5761221c6121c4565b5060010190565b60008261224057634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561225757600080fd5b8151801515811461191557600080fd5b60008251612279818460208701611e94565b9190910192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000602082840312156122e057600080fd5b5051919050565b6000828210156122f9576122f96121c4565b500390565b6000816000190483118215151615612318576123186121c4565b50029056fea2646970667358221220dfab71c86c34a98edeba0682602536d6cc0dfad12d0b06a5c14da92cff185f8664736f6c634300080a0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102275760003560e01c80638daa0acb11610130578063b33f78ca116100b8578063d2f22cf01161007c578063d2f22cf0146104dd578063d77fa7ee146104fd578063dd62ed3e1461052f578063efe235d014610542578063f2fde38b1461055557600080fd5b8063b33f78ca1461045f578063c9b6198114610482578063cad9efff14610495578063ce7c2ac2146104a8578063d1058e59146104c857600080fd5b8063a457c2d7116100ff578063a457c2d714610406578063a4692a2614610419578063a9059cbb14610424578063aa6ca80814610437578063af38d7571461044c57600080fd5b80638daa0acb1461039c57806395d89b41146103af57806396131049146103b7578063a0712d68146103f357600080fd5b806342966c68116101b35780636f307dc3116101825780636f307dc31461033457806370a0823114610347578063715018a61461037057806375d42633146103785780638da5cb5b1461038b57600080fd5b806342966c68146102da5780634f64b2be146102ed5780636131ab0314610318578063613d25bb1461032157600080fd5b806323b872dd116101fa57806323b872dd14610292578063313ce567146102a557806339509351146102b45780633a98ef39146102c75780633ccfd60b146102d057600080fd5b806306fdde031461022c578063095ea7b31461024a57806318160ddd1461026d5780631e83409a1461027f575b600080fd5b610234610568565b6040516102419190611ec0565b60405180910390f35b61025d610258366004611f0f565b6105fa565b6040519015158152602001610241565b606f545b604051908152602001610241565b61027161028d366004611f39565b610614565b61025d6102a0366004611f54565b610620565b60405160128152602001610241565b61025d6102c2366004611f0f565b610644565b61027160685481565b6102d8610666565b005b6102d86102e8366004611f90565b610724565b6103006102fb366004611f90565b610769565b6040516001600160a01b039091168152602001610241565b610271609f5481565b6102d861032f36600461204c565b610793565b60a154610300906001600160a01b031681565b610271610355366004611f39565b6001600160a01b03166000908152606d602052604090205490565b6102d86108d5565b610271610386366004611f39565b6108e9565b6033546001600160a01b0316610300565b6102d86103aa366004611f39565b610a45565b610234610b9d565b6103de6103c5366004611f39565b60a0602052600090815260409020805460019091015482565b60408051928352602083019190915201610241565b6102d8610401366004611f90565b610bac565b61025d610414366004611f0f565b610bce565b610271600160a01b81565b61025d610432366004611f0f565b610c49565b61043f610c57565b60405161024191906120d1565b606954610300906001600160a01b031681565b61025d61046d366004611f39565b606b6020526000908152604090205460ff1681565b6102d8610490366004611f90565b610cb8565b6102d86104a3366004611f39565b610cc5565b6102716104b6366004611f39565b60666020526000908152604090205481565b6104d0610d92565b604051610241919061211e565b6102716104eb366004611f39565b60676020526000908152604090205481565b6103de61050b366004612156565b60656020908152600092835260408084209091529082529020805460019091015482565b61027161053d366004612156565b610e4d565b610271610550366004612156565b610e78565b6102d8610563366004611f39565b610fc3565b60606070805461057790612189565b80601f01602080910402602001604051908101604052809291908181526020018280546105a390612189565b80156105f05780601f106105c5576101008083540402835291602001916105f0565b820191906000526020600020905b8154815290600101906020018083116105d357829003601f168201915b5050505050905090565b600033610608818585611039565b60019150505b92915050565b600061060e823361115d565b60003361062e8582856112cf565b610639858585611349565b506001949350505050565b6000336106088185856106578383610e4d565b61066191906121da565b611039565b33600090815260a06020526040902060018101544210156106ce5760405162461bcd60e51b815260206004820152601f60248201527f5374616b65644469737472696275746f723a206e6f742072656c65617365640060448201526064015b60405180910390fd5b80546000825560a1546106eb906001600160a01b031633836114fa565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a25050565b80156107665761073433826115fe565b33600090815260a06020526040902080546107509083906121da565b8155609f5461075f90426121da565b6001909101555b50565b606a818154811061077957600080fd5b6000918252602090912001546001600160a01b0316905081565b600054610100900460ff16158080156107b35750600054600160ff909116105b806107cd5750303b1580156107cd575060005460ff166001145b6108305760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016106c5565b6000805460ff191660011790558015610853576000805461ff0019166101001790555b61085c8561173e565b6108668484611776565b60a180546001600160a01b0319166001600160a01b03841617905562093a80609f5580156108ce576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6108dd6117ab565b6108e76000611805565b565b606c5460009060ff166109375760405162461bcd60e51b8152602060048201526016602482015275111a5cdd1c9a589d5d1bdc8e8814915153951154915160521b60448201526064016106c5565b606c805460ff1916905560685461096757506001600160a01b038116600090815260676020526040902054610a33565b600061097283611857565b9050806109995750506001600160a01b038116600090815260676020526040902054610a33565b6001600160a01b0383166000908152606760205260409020546068546109d891906109d2906109cc85600160a01b611909565b9061191c565b90611928565b6001600160a01b0384166000818152606760205260409081902083905551919350907f89642dc017a85c05a3e33e3f7040d5fd40e0e2da284ade291929c335f04eebc290610a299085815260200190565b60405180910390a2505b606c805460ff19166001179055919050565b610a4d6117ab565b6001600160a01b038116610abc5760405162461bcd60e51b815260206004820152603060248201527f4469737472696275746f723a2072657761726420746f6b656e2063616e6e6f7460448201526f206265207a65726f206164647265737360801b60648201526084016106c5565b6001600160a01b0381166000908152606b602052604090205460ff1615610b365760405162461bcd60e51b815260206004820152602860248201527f4469737472696275746f723a2072657761726420746f6b656e20616c72656164604482015267792065786973747360c01b60648201526084016106c5565b606a805460018181019092557f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a510180546001600160a01b039093166001600160a01b0319909316831790556000918252606b6020526040909120805460ff19169091179055565b60606071805461057790612189565b60a154610bc4906001600160a01b0316333084611934565b6107663382611a4c565b60003381610bdc8286610e4d565b905083811015610c3c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016106c5565b6106398286868403611039565b600033610608818585611349565b6060606a8054806020026020016040519081016040528092919081815260200182805480156105f057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c91575050505050905090565b610cc06117ab565b609f55565b610ccd6117ab565b6001600160a01b038116610d315760405162461bcd60e51b815260206004820152602560248201527f4469737472696275746f723a20636c61696d61626c652063616e6e6f74206265604482015264207a65726f60d81b60648201526084016106c5565b606980546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f7b0f57de92c389b18aeb87f2b782aa383f348b53d36075a469fd8e927c4350db910160405180910390a15050565b606a5460609067ffffffffffffffff811115610db057610db0611fa9565b604051908082528060200260200182016040528015610dd9578160200160208202803683370190505b50905060005b606a54811015610e4957610e1a606a8281548110610dff57610dff6121f2565b6000918252602090912001546001600160a01b03163361115d565b828281518110610e2c57610e2c6121f2565b602090810291909101015280610e4181612208565b915050610ddf565b5090565b6001600160a01b039182166000908152606e6020908152604080832093909416825291909152205490565b6001600160a01b0382166000908152606b602052604081205460ff16610ee05760405162461bcd60e51b815260206004820152601a60248201527f4469737472696275746f723a20496e76616c696420746f6b656e00000000000060448201526064016106c5565b6000610eeb846108e9565b905080610efc57600091505061060e565b6001600160a01b03808516600090815260656020908152604080832093871683529281528282206066909152919020548154600160a01b90610f4b908390610f45908790611b15565b90611909565b610f559190612223565b8260010154610f6491906121da565b8383556001830181905560408051858152602081018390529195506001600160a01b0387811692908916917f39cb59c115665c2eda6fe547d7c2a8a8f6908243bf576a69f574973a0b650206910160405180910390a350505092915050565b610fcb6117ab565b6001600160a01b0381166110305760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106c5565b61076681611805565b6001600160a01b03831661109b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106c5565b6001600160a01b0382166110fc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106c5565b6001600160a01b038381166000818152606e602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0382166000908152606b602052604081205460ff166111c55760405162461bcd60e51b815260206004820152601a60248201527f4469737472696275746f723a20496e76616c696420746f6b656e00000000000060448201526064016106c5565b6111cf8383610e78565b9050801561060e576001600160a01b038084166000908152606560209081526040808320938616835292905290812060010155801561060e5760405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611257573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127b9190612245565b50816001600160a01b0316836001600160a01b03167f70eb43c4a8ae8c40502dcf22436c509c28d6ff421cf07c491be56984bd987068836040516112c191815260200190565b60405180910390a392915050565b60006112db8484610e4d565b9050600019811461134357818110156113365760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016106c5565b6113438484848403611039565b50505050565b6001600160a01b0383166113ad5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106c5565b6001600160a01b03821661140f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106c5565b6001600160a01b0383166000908152606d6020526040902054818110156114875760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016106c5565b6001600160a01b038085166000818152606d602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906114e79086815260200190565b60405180910390a3611343848484611b21565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916115569190612267565b6000604051808303816000865af19150503d8060008114611593576040519150601f19603f3d011682016040523d82523d6000602084013e611598565b606091505b50915091508180156115c25750805115806115c25750808060200190518101906115c29190612245565b6108ce5760405162461bcd60e51b815260206004820152600d60248201526c10b9b0b332aa3930b739b332b960991b60448201526064016106c5565b6001600160a01b03821661165e5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016106c5565b6001600160a01b0382166000908152606d6020526040902054818110156116d25760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016106c5565b6001600160a01b0383166000818152606d602090815260408083208686039055606f80548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a361173983600084611b21565b505050565b600054610100900460ff166117655760405162461bcd60e51b81526004016106c590612283565b61176d611b8a565b61076681611bb9565b600054610100900460ff1661179d5760405162461bcd60e51b81526004016106c590612283565b6117a78282611c0f565b5050565b6033546001600160a01b031633146108e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106c5565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008061186d6001600160a01b03841630611c5d565b606954604051630f41a04d60e11b81526001600160a01b038681166004830152929350911690631e83409a906024016020604051808303816000875af11580156118bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118df91906122ce565b5060006118f56001600160a01b03851630611c5d565b905061190182826122e7565b949350505050565b600061191582846122fe565b9392505050565b60006119158284612223565b600061191582846121da565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916119989190612267565b6000604051808303816000865af19150503d80600081146119d5576040519150601f19603f3d011682016040523d82523d6000602084013e6119da565b606091505b5091509150818015611a04575080511580611a04575080806020019051810190611a049190612245565b611a445760405162461bcd60e51b815260206004820152601160248201527021736166655472616e7366657246726f6d60781b60448201526064016106c5565b505050505050565b6001600160a01b038216611aa25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016106c5565b80606f6000828254611ab491906121da565b90915550506001600160a01b0382166000818152606d60209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36117a760008383611b21565b600061191582846122e7565b6001600160a01b03831615611b5857611b5883611b53856001600160a01b03166000908152606d602052604090205490565b611ccb565b6001600160a01b038216156117395761173982611b53846001600160a01b03166000908152606d602052604090205490565b600054610100900460ff16611bb15760405162461bcd60e51b81526004016106c590612283565b6108e7611dd4565b600054610100900460ff16611be05760405162461bcd60e51b81526004016106c590612283565b606980546001600160a01b0319166001600160a01b0392909216919091179055606c805460ff19166001179055565b600054610100900460ff16611c365760405162461bcd60e51b81526004016106c590612283565b8151611c49906070906020850190611e04565b508051611739906071906020840190611e04565b6040516370a0823160e01b81526001600160a01b038281166004830152600091908416906370a0823190602401602060405180830381865afa158015611ca7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191591906122ce565b60005b606a54811015611d1c57611d09606a8281548110611cee57611cee6121f2565b6000918252602090912001546001600160a01b031684610e78565b5080611d1481612208565b915050611cce565b506001600160a01b03821660009081526066602052604081205490818311611d5957611d54611d4b84846122e7565b60685490611b15565b611d6f565b611d6f611d6683856122e7565b60685490611928565b60688190556001600160a01b038516600081815260666020908152604091829020879055815187815290810184905292935090917fff3664f5f2f8f85ecd8d30ef2aa6773d8a8448219c7421dcbb67957fb3fafba1910160405180910390a250505050565b600054610100900460ff16611dfb5760405162461bcd60e51b81526004016106c590612283565b6108e733611805565b828054611e1090612189565b90600052602060002090601f016020900481019282611e325760008555611e78565b82601f10611e4b57805160ff1916838001178555611e78565b82800160010185558215611e78579182015b82811115611e78578251825591602001919060010190611e5d565b50610e499291505b80821115610e495760008155600101611e80565b60005b83811015611eaf578181015183820152602001611e97565b838111156113435750506000910152565b6020815260008251806020840152611edf816040850160208701611e94565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114611f0a57600080fd5b919050565b60008060408385031215611f2257600080fd5b611f2b83611ef3565b946020939093013593505050565b600060208284031215611f4b57600080fd5b61191582611ef3565b600080600060608486031215611f6957600080fd5b611f7284611ef3565b9250611f8060208501611ef3565b9150604084013590509250925092565b600060208284031215611fa257600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112611fd057600080fd5b813567ffffffffffffffff80821115611feb57611feb611fa9565b604051601f8301601f19908116603f0116810190828211818310171561201357612013611fa9565b8160405283815286602085880101111561202c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000806080858703121561206257600080fd5b61206b85611ef3565b9350602085013567ffffffffffffffff8082111561208857600080fd5b61209488838901611fbf565b945060408701359150808211156120aa57600080fd5b506120b787828801611fbf565b9250506120c660608601611ef3565b905092959194509250565b6020808252825182820181905260009190848201906040850190845b818110156121125783516001600160a01b0316835292840192918401916001016120ed565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156121125783518352928401929184019160010161213a565b6000806040838503121561216957600080fd5b61217283611ef3565b915061218060208401611ef3565b90509250929050565b600181811c9082168061219d57607f821691505b602082108114156121be57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156121ed576121ed6121c4565b500190565b634e487b7160e01b600052603260045260246000fd5b600060001982141561221c5761221c6121c4565b5060010190565b60008261224057634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561225757600080fd5b8151801515811461191557600080fd5b60008251612279818460208701611e94565b9190910192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000602082840312156122e057600080fd5b5051919050565b6000828210156122f9576122f96121c4565b500390565b6000816000190483118215151615612318576123186121c4565b50029056fea2646970667358221220dfab71c86c34a98edeba0682602536d6cc0dfad12d0b06a5c14da92cff185f8664736f6c634300080a0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.