Latest 9 from a total of 9 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Transfer Ownersh... | 69965172 | 1047 days ago | IN | 0 ETH | 0.0000365 | ||||
| Set Handler | 69965100 | 1047 days ago | IN | 0 ETH | 0.00004363 | ||||
| Update Pool Rewa... | 69964484 | 1047 days ago | IN | 0 ETH | 0.00004066 | ||||
| Set Handler | 69964209 | 1047 days ago | IN | 0 ETH | 0.00004697 | ||||
| Set Handler | 69964139 | 1047 days ago | IN | 0 ETH | 0.00004697 | ||||
| Transfer Ownersh... | 68252795 | 1052 days ago | IN | 0 ETH | 0.00005755 | ||||
| Set Handler | 67585608 | 1054 days ago | IN | 0 ETH | 0.00004542 | ||||
| Set Handler | 67585037 | 1054 days ago | IN | 0 ETH | 0.0000452 | ||||
| Initialize | 67585003 | 1054 days ago | IN | 0 ETH | 0.00005938 |
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 72086102 | 1041 days ago | 0 ETH | ||||
| 72082705 | 1041 days ago | 0 ETH | ||||
| 72081276 | 1041 days ago | 0 ETH | ||||
| 72081276 | 1041 days ago | 0 ETH | ||||
| 72081276 | 1041 days ago | 0 ETH | ||||
| 72079642 | 1041 days ago | 0 ETH | ||||
| 72079288 | 1041 days ago | 0 ETH | ||||
| 72078844 | 1041 days ago | 0 ETH | ||||
| 72078634 | 1041 days ago | 0 ETH | ||||
| 72078634 | 1041 days ago | 0 ETH | ||||
| 72078634 | 1041 days ago | 0 ETH | ||||
| 72078634 | 1041 days ago | 0 ETH | ||||
| 72077503 | 1041 days ago | 0 ETH | ||||
| 72076917 | 1041 days ago | 0 ETH | ||||
| 72074688 | 1041 days ago | 0 ETH | ||||
| 72074688 | 1041 days ago | 0 ETH | ||||
| 72074688 | 1041 days ago | 0 ETH | ||||
| 72070751 | 1041 days ago | 0 ETH | ||||
| 72070751 | 1041 days ago | 0 ETH | ||||
| 72070751 | 1041 days ago | 0 ETH | ||||
| 72070245 | 1041 days ago | 0 ETH | ||||
| 72069704 | 1041 days ago | 0 ETH | ||||
| 72066550 | 1041 days ago | 0 ETH | ||||
| 72064674 | 1041 days ago | 0 ETH | ||||
| 72060405 | 1041 days ago | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
RewardTracker
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IRewardTracker.sol";
import "../tokens/interfaces/IELP.sol";
contract RewardTracker is ReentrancyGuard, IRewardTracker, Ownable { //IERC20,
using SafeMath for uint256;
using SafeERC20 for IERC20;
// uint256 public constant BASIS_POINTS_DIVISOR = 10000;
uint256 public constant REWARD_PRECISION = 10 ** 20;
uint256 public lastDistributionTime;
uint256 public override poolTokenRewardPerInterval;
uint256 public cumulativeRewardPerToken;
mapping (address => uint256) public override stakedAmounts;
mapping (address => uint256) public claimableReward;
mapping (address => uint256) public previousCumulatedRewardPerToken;
mapping (address => uint256) public override cumulativeRewards;
mapping (address => uint256) public override averageStakedAmounts;
// uint256[] public rewardPerSec;
// uint256[] public rewardPerSecUpdateTime;
address public depositToken;
address public rewardToken;
bool public isInitialized;
uint256 public totalDepositSupply;
mapping (address => mapping (address => uint256)) public allowances;
bool public inPrivateStakingMode;
bool public inPrivateClaimingMode;
mapping (address => bool) public isHandler;
event Claim(address receiver, uint256 amount);
function initialize(
address _depositToken,
address _rewardToken,
uint256 _poolRewardPerInterval
) external onlyOwner {
require(!isInitialized, "RewardTracker: already initialized");
isInitialized = true;
depositToken = _depositToken;
rewardToken = _rewardToken;
poolTokenRewardPerInterval = _poolRewardPerInterval;
_updateRewards(address(0));
}
function setHandler(address _handler, bool _isActive) external onlyOwner {
isHandler[_handler] = _isActive;
}
function poolStakedAmount() external view returns (uint256){
return totalDepositSupply;
}
function updatePoolRewardRate(
uint256 _poolRewardPerInterval
) external nonReentrant {
_validateHandler();
poolTokenRewardPerInterval = _poolRewardPerInterval;
_updateRewards(address(0));
}
function setInPrivateStakingMode(bool _inPrivateStakingMode) external onlyOwner {
inPrivateStakingMode = _inPrivateStakingMode;
}
function setInPrivateClaimingMode(bool _inPrivateClaimingMode) external onlyOwner {
inPrivateClaimingMode = _inPrivateClaimingMode;
}
// // to help users who accidentally send their tokens to this contract
// function withdrawToken(address _token, address _account, uint256 _amount) external onlyOwner {
// IERC20(_token).safeTransfer(_account, _amount);
// }
function balanceOf(address _account) external override view returns (uint256) {
return stakedAmounts[_account];
}
function stake(address _depositToken, uint256 _amount) external override nonReentrant {
if (inPrivateStakingMode) { revert("RewardTracker: action not enabled"); }
require(_depositToken == depositToken, "Invalid deposit token");
_stake(msg.sender, msg.sender, _depositToken, _amount);
}
function stakeForAccount(address _fundingAccount, address _account, address _depositToken, uint256 _amount) external override nonReentrant {
_validateHandler();
require(_depositToken == depositToken, "Invalid deposit token");
_stake(_fundingAccount, _account, _depositToken, _amount);
}
function unstake(address _depositToken, uint256 _amount) external override nonReentrant {
if (inPrivateStakingMode) { revert("RewardTracker: action not enabled"); }
require(_depositToken == depositToken, "Invalid deposit token");
_unstake(msg.sender, _depositToken, _amount, msg.sender);
}
function unstakeForAccount(address _account, address _depositToken, uint256 _amount, address _receiver) external override nonReentrant {
_validateHandler();
require(_depositToken == depositToken, "Invalid deposit token");
_unstake(_account, _depositToken, _amount, _receiver);
}
function updateRewardsForUser(address _account) external override nonReentrant {
_updateRewards(_account);
}
function claim(address _receiver) external override nonReentrant returns (uint256) {
if (inPrivateClaimingMode) { revert("RewardTracker: action not enabled"); }
return _claim(msg.sender, _receiver);
}
function claimForAccount(address _account, address _receiver) external override nonReentrant returns (uint256) {
_validateHandler();
return _claim(_account, _receiver);
}
function claimable(address _account) external override view returns (uint256) {
uint256 stakedAmount = stakedAmounts[_account];
uint256 supply = totalDepositSupply;
if (supply < 1){
return 0;
}
uint256 pendingRewards = _pendingRewards().mul(REWARD_PRECISION);
uint256 nextCumulativeRewardPerToken = cumulativeRewardPerToken.add(pendingRewards.div(supply));
uint256 accountReward = stakedAmount.mul(nextCumulativeRewardPerToken.sub(previousCumulatedRewardPerToken[_account])).div(REWARD_PRECISION);
// return claimableReward[_account].add(
// stakedAmount.mul(nextCumulativeRewardPerToken.sub(previousCumulatedRewardPerToken[_account])).div(REWARD_PRECISION));
return claimableReward[_account].add(accountReward);
}
function _claim(address _account, address /*_receiver*/) private returns (uint256) {
_updateRewards(_account);
uint256 tokenAmount = claimableReward[_account];
claimableReward[_account] = 0;
if (tokenAmount > 0) {
// IERC20(rewardToken).safeTransfer(_receiver, tokenAmount);
emit Claim(_account, tokenAmount);
}
return tokenAmount;
}
function _validateHandler() private view {
require(isHandler[msg.sender], "RewardTracker: forbidden");
}
function _stake(address _fundingAccount, address _account, address _depositToken, uint256 _amount) private {
require(_amount > 0, "RewardTracker: invalid _amount");
require(_depositToken == depositToken, "Invalid deposit token");
IERC20(_depositToken).safeTransferFrom(_fundingAccount, address(this), _amount);
_updateRewards(_account);
stakedAmounts[_account] = stakedAmounts[_account].add(_amount);
IELP(depositToken).updateStakingAmount(_account, stakedAmounts[_account] );
// depositBalances[_account][_depositToken] = depositBalances[_account][_depositToken].add(_amount);
totalDepositSupply = totalDepositSupply.add(_amount);
}
function _unstake(address _account, address _depositToken, uint256 _amount, address _receiver) private {
require(_amount > 0, "RewardTracker: invalid _amount");
require(_depositToken == depositToken, "Invalid deposit token");
require(stakedAmounts[_account] >= _amount, "RewardTracker: _amount exceeds stakedAmount");
_updateRewards(_account);
uint256 stakedAmount = stakedAmounts[_account];
stakedAmounts[_account] = stakedAmount.sub(_amount);
IELP(depositToken).updateStakingAmount(_account, stakedAmounts[_account] );
totalDepositSupply = totalDepositSupply.sub(_amount);
IERC20(_depositToken).safeTransfer(_receiver, _amount);
}
function _pendingRewards() private view returns (uint256) {
if (block.timestamp == lastDistributionTime) {
return 0;
}
uint256 timeDiff = block.timestamp.sub(lastDistributionTime);
return poolTokenRewardPerInterval.mul(timeDiff);
}
function _updateRewards(address _account) private {
uint256 blockReward = _pendingRewards();
lastDistributionTime = block.timestamp;
uint256 supply = totalDepositSupply;
if (supply < 1){
return ;
}
uint256 _cumulativeRewardPerToken = cumulativeRewardPerToken;
if (supply > 0 && blockReward > 0) {
_cumulativeRewardPerToken = _cumulativeRewardPerToken.add(blockReward.mul(REWARD_PRECISION).div(supply));
cumulativeRewardPerToken = _cumulativeRewardPerToken;
}
// cumulativeRewardPerToken can only increase
// so if cumulativeRewardPerToken is zero, it means there are no rewards yet
if (_cumulativeRewardPerToken == 0) {
return;
}
if (_account != address(0)) {
uint256 stakedAmount = stakedAmounts[_account];
uint256 accountReward = stakedAmount.mul(_cumulativeRewardPerToken.sub(previousCumulatedRewardPerToken[_account])).div(REWARD_PRECISION);
uint256 _claimableReward = claimableReward[_account].add(accountReward);
claimableReward[_account] = _claimableReward;
previousCumulatedRewardPerToken[_account] = _cumulativeRewardPerToken;
if (_claimableReward > 0 && stakedAmounts[_account] > 0) {
uint256 nextCumulativeReward = cumulativeRewards[_account].add(accountReward);
averageStakedAmounts[_account] = averageStakedAmounts[_account].mul(cumulativeRewards[_account]).div(nextCumulativeReward)
.add(stakedAmount.mul(accountReward).div(nextCumulativeReward));
cumulativeRewards[_account] = nextCumulativeReward;
}
}
}
}// 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: 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.8.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* 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 Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_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);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IRewardTracker {
// function depositBalances(address _account, address _depositToken) external view returns (uint256);
function stakedAmounts(address _account) external view returns (uint256);
function updateRewardsForUser(address _account) external;
function poolStakedAmount() external view returns (uint256);
function stake(address _depositToken, uint256 _amount) external;
function stakeForAccount(address _fundingAccount, address _account, address _depositToken, uint256 _amount) external;
function unstake(address _depositToken, uint256 _amount) external;
function unstakeForAccount(address _account, address _depositToken, uint256 _amount, address _receiver) external;
// function tokensPerInterval() external view returns (uint256);
function claim(address _receiver) external returns (uint256);
function claimForAccount(address _account, address _receiver) external returns (uint256);
function claimable(address _account) external view returns (uint256);
function averageStakedAmounts(address _account) external view returns (uint256);
function cumulativeRewards(address _account) external view returns (uint256);
function balanceOf(address _account) external view returns (uint256);
function poolTokenRewardPerInterval() external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IELP {
// function mint(address _account, uint256 _amount) external;
// function burn(address _account, uint256 _amount) external;
function updateStakingAmount(address _account, uint256 _amount) external;
function claimForAccount(address _account) external returns (uint256);
function claimable(address _account) external view returns (uint256);
function USDbyFee( ) external view returns (uint256);
function TokenFeeReserved( address _token) external view returns (uint256);
function withdrawToEDEPool() external returns (uint256);
function vault() external returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","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"},{"inputs":[],"name":"REWARD_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"averageStakedAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"claimForAccount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"claimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimableReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cumulativeRewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"cumulativeRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"inPrivateClaimingMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"inPrivateStakingMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_depositToken","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"uint256","name":"_poolRewardPerInterval","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isHandler","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastDistributionTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolStakedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolTokenRewardPerInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"previousCumulatedRewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_handler","type":"address"},{"internalType":"bool","name":"_isActive","type":"bool"}],"name":"setHandler","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_inPrivateClaimingMode","type":"bool"}],"name":"setInPrivateClaimingMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_inPrivateStakingMode","type":"bool"}],"name":"setInPrivateStakingMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_depositToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_fundingAccount","type":"address"},{"internalType":"address","name":"_account","type":"address"},{"internalType":"address","name":"_depositToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stakeForAccount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakedAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDepositSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_depositToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"address","name":"_depositToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"unstakeForAccount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolRewardPerInterval","type":"uint256"}],"name":"updatePoolRewardRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"updateRewardsForUser","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b50600160005561001f33610024565b610076565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6117b7806100856000396000f3fe608060405234801561001057600080fd5b50600436106102115760003560e01c8063715018a611610125578063c5fa2730116100ad578063e95034251161007c578063e9503425146104bd578063f2fde38b146104dd578063f5fc5076146104f0578063f76033d3146104f9578063f7c618c11461050b57600080fd5b8063c5fa273014610477578063c89039c514610484578063cd6396f914610497578063e5e47753146104aa57600080fd5b8063922b2c8c116100f4578063922b2c8c146104155780639cb7de4b1461041e578063a318021714610431578063adc9772e14610451578063c2a672e01461046457600080fd5b8063715018a6146103cc57806375b17350146103d4578063790b5a6c146103dd5780638da5cb5b146103f057600080fd5b80633cd7f700116101a857806344a084111161017757806344a084111461032c57806346ea87af1461034c57806355b6ed5c1461036f578063661bbcc31461039a57806370a08231146103a357600080fd5b80633cd7f700146102ee5780633d6aa5e114610301578063402914f5146103115780634229020e1461032457600080fd5b80631d30d5bc116101e45780631d30d5bc146102845780631e83409a146102975780633792def3146102aa578063392e53cd146102ca57600080fd5b8063098bf59d1461021657806310c1c1031461022b57806313e82e7a1461025e5780631794bb3c14610271575b600080fd5b61022961022436600461143d565b61051e565b005b61024b61023936600461148a565b60056020526000908152604090205481565b6040519081526020015b60405180910390f35b61024b61026c3660046114a5565b610580565b61022961027f3660046114d8565b6105ae565b610229610292366004611522565b61066b565b61024b6102a536600461148a565b610686565b61024b6102b836600461148a565b60086020526000908152604090205481565b600b546102de90600160a01b900460ff1681565b6040519015158152602001610255565b6102296102fc366004611522565b6106d3565b61024b68056bc75e2d6310000081565b61024b61031f36600461148a565b6106f5565b600c5461024b565b61024b61033a36600461148a565b60076020526000908152604090205481565b6102de61035a36600461148a565b600f6020526000908152604090205460ff1681565b61024b61037d3660046114a5565b600d60209081526000928352604080842090915290825290205481565b61024b600c5481565b61024b6103b136600461148a565b6001600160a01b031660009081526005602052604090205490565b6102296107d4565b61024b60025481565b6102296103eb36600461153f565b6107e8565b6001546001600160a01b03165b6040516001600160a01b039091168152602001610255565b61024b60035481565b61022961042c36600461158a565b610831565b61024b61043f36600461148a565b60096020526000908152604090205481565b61022961045f3660046115c1565b610864565b6102296104723660046115c1565b6108d6565b600e546102de9060ff1681565b600a546103fd906001600160a01b031681565b6102296104a536600461148a565b61093a565b6102296104b83660046115eb565b610958565b61024b6104cb36600461148a565b60066020526000908152604090205481565b6102296104eb36600461148a565b610977565b61024b60045481565b600e546102de90610100900460ff1681565b600b546103fd906001600160a01b031681565b6105266109ed565b61052e610a46565b600a546001600160a01b038481169116146105645760405162461bcd60e51b815260040161055b90611604565b60405180910390fd5b61057084848484610aa5565b61057a6001600055565b50505050565b600061058a6109ed565b610592610a46565b61059c8383610c71565b90506105a86001600055565b92915050565b6105b6610ce9565b600b54600160a01b900460ff161561061b5760405162461bcd60e51b815260206004820152602260248201527f526577617264547261636b65723a20616c726561647920696e697469616c697a604482015261195960f21b606482015260840161055b565b600b8054600a80546001600160a01b0319166001600160a01b0387811691909117909155600160a01b6001600160a81b03199092169085161717905560038190556106666000610d43565b505050565b610673610ce9565b600e805460ff1916911515919091179055565b60006106906109ed565b600e54610100900460ff16156106b85760405162461bcd60e51b815260040161055b90611633565b6106c23383610c71565b90506106ce6001600055565b919050565b6106db610ce9565b600e80549115156101000261ff0019909216919091179055565b6001600160a01b038116600090815260056020526040812054600c546001811015610724575060009392505050565b600061074168056bc75e2d6310000061073b610f29565b90610f67565b9050600061075b6107528385610f73565b60045490610f7f565b6001600160a01b038716600090815260076020526040812054919250906107a39068056bc75e2d631000009061079d90610796908690610f8b565b8890610f67565b90610f73565b6001600160a01b0388166000908152600660205260409020549091506107c99082610f7f565b979650505050505050565b6107dc610ce9565b6107e66000610f97565b565b6107f06109ed565b6107f8610a46565b600a546001600160a01b038381169116146108255760405162461bcd60e51b815260040161055b90611604565b61057084848484610fe9565b610839610ce9565b6001600160a01b03919091166000908152600f60205260409020805460ff1916911515919091179055565b61086c6109ed565b600e5460ff161561088f5760405162461bcd60e51b815260040161055b90611633565b600a546001600160a01b038381169116146108bc5760405162461bcd60e51b815260040161055b90611604565b6108c833338484610fe9565b6108d26001600055565b5050565b6108de6109ed565b600e5460ff16156109015760405162461bcd60e51b815260040161055b90611633565b600a546001600160a01b0383811691161461092e5760405162461bcd60e51b815260040161055b90611604565b6108c833838333610aa5565b6109426109ed565b61094b81610d43565b6109556001600055565b50565b6109606109ed565b610968610a46565b600381905561094b6000610d43565b61097f610ce9565b6001600160a01b0381166109e45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161055b565b61095581610f97565b600260005403610a3f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161055b565b6002600055565b336000908152600f602052604090205460ff166107e65760405162461bcd60e51b815260206004820152601860248201527f526577617264547261636b65723a20666f7262696464656e0000000000000000604482015260640161055b565b60008211610af55760405162461bcd60e51b815260206004820152601e60248201527f526577617264547261636b65723a20696e76616c6964205f616d6f756e740000604482015260640161055b565b600a546001600160a01b03848116911614610b225760405162461bcd60e51b815260040161055b90611604565b6001600160a01b038416600090815260056020526040902054821115610b9e5760405162461bcd60e51b815260206004820152602b60248201527f526577617264547261636b65723a205f616d6f756e742065786365656473207360448201526a1d185ad959105b5bdd5b9d60aa1b606482015260840161055b565b610ba784610d43565b6001600160a01b038416600090815260056020526040902054610bca8184610f8b565b6001600160a01b0386811660008181526005602052604090819020849055600a5490516312e627c760e31b8152600481019290925260248201939093529116906397313e3890604401600060405180830381600087803b158015610c2d57600080fd5b505af1158015610c41573d6000803e3d6000fd5b5050600c54610c539250905084610f8b565b600c55610c6a6001600160a01b0385168385611139565b5050505050565b6000610c7c83610d43565b6001600160a01b038316600090815260066020526040812080549190558015610ce257604080516001600160a01b0386168152602081018390527f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4910160405180910390a15b9392505050565b6001546001600160a01b031633146107e65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161055b565b6000610d4d610f29565b42600255600c549091506001811015610d6557505050565b6004548115801590610d775750600083115b15610da557610d9d610d968361079d8668056bc75e2d63100000610f67565b8290610f7f565b600481905590505b80600003610db35750505050565b6001600160a01b0384161561057a576001600160a01b0384166000908152600560209081526040808320546007909252822054909190610e0e9068056bc75e2d631000009061079d90610e07908790610f8b565b8590610f67565b6001600160a01b03871660009081526006602052604081205491925090610e359083610f7f565b6001600160a01b03881660009081526006602090815260408083208490556007909152902085905590508015801590610e8557506001600160a01b03871660009081526005602052604090205415155b15610f20576001600160a01b038716600090815260086020526040812054610ead9084610f7f565b9050610efa610ec08261079d8787610f67565b6001600160a01b038a16600090815260086020908152604080832054600990925290912054610ef491859161079d91610f67565b90610f7f565b6001600160a01b0389166000908152600960209081526040808320939093556008905220555b50505050505050565b60006002544203610f3a5750600090565b6000610f5160025442610f8b90919063ffffffff16565b600354909150610f619082610f67565b91505090565b6000610ce2828461168a565b6000610ce282846116a9565b6000610ce282846116cb565b6000610ce282846116de565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600081116110395760405162461bcd60e51b815260206004820152601e60248201527f526577617264547261636b65723a20696e76616c6964205f616d6f756e740000604482015260640161055b565b600a546001600160a01b038381169116146110665760405162461bcd60e51b815260040161055b90611604565b61107b6001600160a01b03831685308461119c565b61108483610d43565b6001600160a01b0383166000908152600560205260409020546110a79082610f7f565b6001600160a01b0384811660008181526005602052604090819020849055600a5490516312e627c760e31b8152600481019290925260248201939093529116906397313e3890604401600060405180830381600087803b15801561110a57600080fd5b505af115801561111e573d6000803e3d6000fd5b5050600c546111309250905082610f7f565b600c5550505050565b6040516001600160a01b03831660248201526044810182905261066690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526111d4565b6040516001600160a01b038085166024830152831660448201526064810182905261057a9085906323b872dd60e01b90608401611165565b6000611229826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166112a69092919063ffffffff16565b805190915015610666578080602001905181019061124791906116f1565b6106665760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161055b565b60606112b584846000856112bd565b949350505050565b60608247101561131e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161055b565b600080866001600160a01b0316858760405161133a9190611732565b60006040518083038185875af1925050503d8060008114611377576040519150601f19603f3d011682016040523d82523d6000602084013e61137c565b606091505b50915091506107c987838387606083156113f75782516000036113f0576001600160a01b0385163b6113f05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161055b565b50816112b5565b6112b5838381511561140c5781518083602001fd5b8060405162461bcd60e51b815260040161055b919061174e565b80356001600160a01b03811681146106ce57600080fd5b6000806000806080858703121561145357600080fd5b61145c85611426565b935061146a60208601611426565b92506040850135915061147f60608601611426565b905092959194509250565b60006020828403121561149c57600080fd5b610ce282611426565b600080604083850312156114b857600080fd5b6114c183611426565b91506114cf60208401611426565b90509250929050565b6000806000606084860312156114ed57600080fd5b6114f684611426565b925061150460208501611426565b9150604084013590509250925092565b801515811461095557600080fd5b60006020828403121561153457600080fd5b8135610ce281611514565b6000806000806080858703121561155557600080fd5b61155e85611426565b935061156c60208601611426565b925061157a60408601611426565b9396929550929360600135925050565b6000806040838503121561159d57600080fd5b6115a683611426565b915060208301356115b681611514565b809150509250929050565b600080604083850312156115d457600080fd5b6115dd83611426565b946020939093013593505050565b6000602082840312156115fd57600080fd5b5035919050565b60208082526015908201527424b73b30b634b2103232b837b9b4ba103a37b5b2b760591b604082015260600190565b60208082526021908201527f526577617264547261636b65723a20616374696f6e206e6f7420656e61626c656040820152601960fa1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156116a4576116a4611674565b500290565b6000826116c657634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156105a8576105a8611674565b818103818111156105a8576105a8611674565b60006020828403121561170357600080fd5b8151610ce281611514565b60005b83811015611729578181015183820152602001611711565b50506000910152565b6000825161174481846020870161170e565b9190910192915050565b602081526000825180602084015261176d81604085016020870161170e565b601f01601f1916919091016040019291505056fea264697066735822122096151d0434cec31c5e2185a1f4ac0c68421d34f72dd5c25df5ad69ad710db23c64736f6c63430008100033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102115760003560e01c8063715018a611610125578063c5fa2730116100ad578063e95034251161007c578063e9503425146104bd578063f2fde38b146104dd578063f5fc5076146104f0578063f76033d3146104f9578063f7c618c11461050b57600080fd5b8063c5fa273014610477578063c89039c514610484578063cd6396f914610497578063e5e47753146104aa57600080fd5b8063922b2c8c116100f4578063922b2c8c146104155780639cb7de4b1461041e578063a318021714610431578063adc9772e14610451578063c2a672e01461046457600080fd5b8063715018a6146103cc57806375b17350146103d4578063790b5a6c146103dd5780638da5cb5b146103f057600080fd5b80633cd7f700116101a857806344a084111161017757806344a084111461032c57806346ea87af1461034c57806355b6ed5c1461036f578063661bbcc31461039a57806370a08231146103a357600080fd5b80633cd7f700146102ee5780633d6aa5e114610301578063402914f5146103115780634229020e1461032457600080fd5b80631d30d5bc116101e45780631d30d5bc146102845780631e83409a146102975780633792def3146102aa578063392e53cd146102ca57600080fd5b8063098bf59d1461021657806310c1c1031461022b57806313e82e7a1461025e5780631794bb3c14610271575b600080fd5b61022961022436600461143d565b61051e565b005b61024b61023936600461148a565b60056020526000908152604090205481565b6040519081526020015b60405180910390f35b61024b61026c3660046114a5565b610580565b61022961027f3660046114d8565b6105ae565b610229610292366004611522565b61066b565b61024b6102a536600461148a565b610686565b61024b6102b836600461148a565b60086020526000908152604090205481565b600b546102de90600160a01b900460ff1681565b6040519015158152602001610255565b6102296102fc366004611522565b6106d3565b61024b68056bc75e2d6310000081565b61024b61031f36600461148a565b6106f5565b600c5461024b565b61024b61033a36600461148a565b60076020526000908152604090205481565b6102de61035a36600461148a565b600f6020526000908152604090205460ff1681565b61024b61037d3660046114a5565b600d60209081526000928352604080842090915290825290205481565b61024b600c5481565b61024b6103b136600461148a565b6001600160a01b031660009081526005602052604090205490565b6102296107d4565b61024b60025481565b6102296103eb36600461153f565b6107e8565b6001546001600160a01b03165b6040516001600160a01b039091168152602001610255565b61024b60035481565b61022961042c36600461158a565b610831565b61024b61043f36600461148a565b60096020526000908152604090205481565b61022961045f3660046115c1565b610864565b6102296104723660046115c1565b6108d6565b600e546102de9060ff1681565b600a546103fd906001600160a01b031681565b6102296104a536600461148a565b61093a565b6102296104b83660046115eb565b610958565b61024b6104cb36600461148a565b60066020526000908152604090205481565b6102296104eb36600461148a565b610977565b61024b60045481565b600e546102de90610100900460ff1681565b600b546103fd906001600160a01b031681565b6105266109ed565b61052e610a46565b600a546001600160a01b038481169116146105645760405162461bcd60e51b815260040161055b90611604565b60405180910390fd5b61057084848484610aa5565b61057a6001600055565b50505050565b600061058a6109ed565b610592610a46565b61059c8383610c71565b90506105a86001600055565b92915050565b6105b6610ce9565b600b54600160a01b900460ff161561061b5760405162461bcd60e51b815260206004820152602260248201527f526577617264547261636b65723a20616c726561647920696e697469616c697a604482015261195960f21b606482015260840161055b565b600b8054600a80546001600160a01b0319166001600160a01b0387811691909117909155600160a01b6001600160a81b03199092169085161717905560038190556106666000610d43565b505050565b610673610ce9565b600e805460ff1916911515919091179055565b60006106906109ed565b600e54610100900460ff16156106b85760405162461bcd60e51b815260040161055b90611633565b6106c23383610c71565b90506106ce6001600055565b919050565b6106db610ce9565b600e80549115156101000261ff0019909216919091179055565b6001600160a01b038116600090815260056020526040812054600c546001811015610724575060009392505050565b600061074168056bc75e2d6310000061073b610f29565b90610f67565b9050600061075b6107528385610f73565b60045490610f7f565b6001600160a01b038716600090815260076020526040812054919250906107a39068056bc75e2d631000009061079d90610796908690610f8b565b8890610f67565b90610f73565b6001600160a01b0388166000908152600660205260409020549091506107c99082610f7f565b979650505050505050565b6107dc610ce9565b6107e66000610f97565b565b6107f06109ed565b6107f8610a46565b600a546001600160a01b038381169116146108255760405162461bcd60e51b815260040161055b90611604565b61057084848484610fe9565b610839610ce9565b6001600160a01b03919091166000908152600f60205260409020805460ff1916911515919091179055565b61086c6109ed565b600e5460ff161561088f5760405162461bcd60e51b815260040161055b90611633565b600a546001600160a01b038381169116146108bc5760405162461bcd60e51b815260040161055b90611604565b6108c833338484610fe9565b6108d26001600055565b5050565b6108de6109ed565b600e5460ff16156109015760405162461bcd60e51b815260040161055b90611633565b600a546001600160a01b0383811691161461092e5760405162461bcd60e51b815260040161055b90611604565b6108c833838333610aa5565b6109426109ed565b61094b81610d43565b6109556001600055565b50565b6109606109ed565b610968610a46565b600381905561094b6000610d43565b61097f610ce9565b6001600160a01b0381166109e45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161055b565b61095581610f97565b600260005403610a3f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161055b565b6002600055565b336000908152600f602052604090205460ff166107e65760405162461bcd60e51b815260206004820152601860248201527f526577617264547261636b65723a20666f7262696464656e0000000000000000604482015260640161055b565b60008211610af55760405162461bcd60e51b815260206004820152601e60248201527f526577617264547261636b65723a20696e76616c6964205f616d6f756e740000604482015260640161055b565b600a546001600160a01b03848116911614610b225760405162461bcd60e51b815260040161055b90611604565b6001600160a01b038416600090815260056020526040902054821115610b9e5760405162461bcd60e51b815260206004820152602b60248201527f526577617264547261636b65723a205f616d6f756e742065786365656473207360448201526a1d185ad959105b5bdd5b9d60aa1b606482015260840161055b565b610ba784610d43565b6001600160a01b038416600090815260056020526040902054610bca8184610f8b565b6001600160a01b0386811660008181526005602052604090819020849055600a5490516312e627c760e31b8152600481019290925260248201939093529116906397313e3890604401600060405180830381600087803b158015610c2d57600080fd5b505af1158015610c41573d6000803e3d6000fd5b5050600c54610c539250905084610f8b565b600c55610c6a6001600160a01b0385168385611139565b5050505050565b6000610c7c83610d43565b6001600160a01b038316600090815260066020526040812080549190558015610ce257604080516001600160a01b0386168152602081018390527f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4910160405180910390a15b9392505050565b6001546001600160a01b031633146107e65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161055b565b6000610d4d610f29565b42600255600c549091506001811015610d6557505050565b6004548115801590610d775750600083115b15610da557610d9d610d968361079d8668056bc75e2d63100000610f67565b8290610f7f565b600481905590505b80600003610db35750505050565b6001600160a01b0384161561057a576001600160a01b0384166000908152600560209081526040808320546007909252822054909190610e0e9068056bc75e2d631000009061079d90610e07908790610f8b565b8590610f67565b6001600160a01b03871660009081526006602052604081205491925090610e359083610f7f565b6001600160a01b03881660009081526006602090815260408083208490556007909152902085905590508015801590610e8557506001600160a01b03871660009081526005602052604090205415155b15610f20576001600160a01b038716600090815260086020526040812054610ead9084610f7f565b9050610efa610ec08261079d8787610f67565b6001600160a01b038a16600090815260086020908152604080832054600990925290912054610ef491859161079d91610f67565b90610f7f565b6001600160a01b0389166000908152600960209081526040808320939093556008905220555b50505050505050565b60006002544203610f3a5750600090565b6000610f5160025442610f8b90919063ffffffff16565b600354909150610f619082610f67565b91505090565b6000610ce2828461168a565b6000610ce282846116a9565b6000610ce282846116cb565b6000610ce282846116de565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600081116110395760405162461bcd60e51b815260206004820152601e60248201527f526577617264547261636b65723a20696e76616c6964205f616d6f756e740000604482015260640161055b565b600a546001600160a01b038381169116146110665760405162461bcd60e51b815260040161055b90611604565b61107b6001600160a01b03831685308461119c565b61108483610d43565b6001600160a01b0383166000908152600560205260409020546110a79082610f7f565b6001600160a01b0384811660008181526005602052604090819020849055600a5490516312e627c760e31b8152600481019290925260248201939093529116906397313e3890604401600060405180830381600087803b15801561110a57600080fd5b505af115801561111e573d6000803e3d6000fd5b5050600c546111309250905082610f7f565b600c5550505050565b6040516001600160a01b03831660248201526044810182905261066690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526111d4565b6040516001600160a01b038085166024830152831660448201526064810182905261057a9085906323b872dd60e01b90608401611165565b6000611229826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166112a69092919063ffffffff16565b805190915015610666578080602001905181019061124791906116f1565b6106665760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161055b565b60606112b584846000856112bd565b949350505050565b60608247101561131e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161055b565b600080866001600160a01b0316858760405161133a9190611732565b60006040518083038185875af1925050503d8060008114611377576040519150601f19603f3d011682016040523d82523d6000602084013e61137c565b606091505b50915091506107c987838387606083156113f75782516000036113f0576001600160a01b0385163b6113f05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161055b565b50816112b5565b6112b5838381511561140c5781518083602001fd5b8060405162461bcd60e51b815260040161055b919061174e565b80356001600160a01b03811681146106ce57600080fd5b6000806000806080858703121561145357600080fd5b61145c85611426565b935061146a60208601611426565b92506040850135915061147f60608601611426565b905092959194509250565b60006020828403121561149c57600080fd5b610ce282611426565b600080604083850312156114b857600080fd5b6114c183611426565b91506114cf60208401611426565b90509250929050565b6000806000606084860312156114ed57600080fd5b6114f684611426565b925061150460208501611426565b9150604084013590509250925092565b801515811461095557600080fd5b60006020828403121561153457600080fd5b8135610ce281611514565b6000806000806080858703121561155557600080fd5b61155e85611426565b935061156c60208601611426565b925061157a60408601611426565b9396929550929360600135925050565b6000806040838503121561159d57600080fd5b6115a683611426565b915060208301356115b681611514565b809150509250929050565b600080604083850312156115d457600080fd5b6115dd83611426565b946020939093013593505050565b6000602082840312156115fd57600080fd5b5035919050565b60208082526015908201527424b73b30b634b2103232b837b9b4ba103a37b5b2b760591b604082015260600190565b60208082526021908201527f526577617264547261636b65723a20616374696f6e206e6f7420656e61626c656040820152601960fa1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156116a4576116a4611674565b500290565b6000826116c657634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156105a8576105a8611674565b818103818111156105a8576105a8611674565b60006020828403121561170357600080fd5b8151610ce281611514565b60005b83811015611729578181015183820152602001611711565b50506000910152565b6000825161174481846020870161170e565b9190910192915050565b602081526000825180602084015261176d81604085016020870161170e565b601f01601f1916919091016040019291505056fea264697066735822122096151d0434cec31c5e2185a1f4ac0c68421d34f72dd5c25df5ad69ad710db23c64736f6c63430008100033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$1.06
Net Worth in ETH
0.000361
Token Allocations
WBNB
53.23%
XRP
24.11%
ADA
22.66%
Multichain Portfolio | 35 Chains
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.