Source Code
Latest 25 from a total of 1,438 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Unstake | 23185319 | 198 days ago | IN | 0 ETH | 0.00018956 | ||||
| Unstake | 23185313 | 198 days ago | IN | 0 ETH | 0.00027228 | ||||
| Stake | 20145286 | 622 days ago | IN | 0 ETH | 0.00032967 | ||||
| Unstake | 19477437 | 716 days ago | IN | 0 ETH | 0.00875104 | ||||
| Unstake | 19472156 | 717 days ago | IN | 0 ETH | 0.00486188 | ||||
| Unstake | 19407150 | 726 days ago | IN | 0 ETH | 0.00682571 | ||||
| Unstake | 18841714 | 805 days ago | IN | 0 ETH | 0.0049108 | ||||
| Unstake | 18673176 | 829 days ago | IN | 0 ETH | 0.00418058 | ||||
| Unstake | 18540142 | 847 days ago | IN | 0 ETH | 0.00447612 | ||||
| Unstake | 18453186 | 859 days ago | IN | 0 ETH | 0.00122173 | ||||
| Unstake | 18229072 | 891 days ago | IN | 0 ETH | 0.0033692 | ||||
| Unstake | 17725402 | 961 days ago | IN | 0 ETH | 0.00591315 | ||||
| Unstake | 17377655 | 1010 days ago | IN | 0 ETH | 0.00453625 | ||||
| Unstake | 17319817 | 1018 days ago | IN | 0 ETH | 0.00409939 | ||||
| Unstake | 17311197 | 1020 days ago | IN | 0 ETH | 0.00892934 | ||||
| Unstake | 17270676 | 1025 days ago | IN | 0 ETH | 0.00647602 | ||||
| Unstake | 17265096 | 1026 days ago | IN | 0 ETH | 0.00386155 | ||||
| Unstake | 16988121 | 1065 days ago | IN | 0 ETH | 0.00334398 | ||||
| Unstake | 16903145 | 1077 days ago | IN | 0 ETH | 0.00230666 | ||||
| Unstake | 16847279 | 1085 days ago | IN | 0 ETH | 0.0018413 | ||||
| Unstake | 16844352 | 1086 days ago | IN | 0 ETH | 0.0185387 | ||||
| Unstake | 16815891 | 1090 days ago | IN | 0 ETH | 0.00319421 | ||||
| Unstake | 16703098 | 1105 days ago | IN | 0 ETH | 0.00368305 | ||||
| Unstake | 16660401 | 1111 days ago | IN | 0 ETH | 0.00346211 | ||||
| Unstake | 16637320 | 1115 days ago | IN | 0 ETH | 0.00488463 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
TokenRewardStaking
Compiler Version
v0.8.10+commit.fc410830
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.10;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "./interfaces/IMintableERC20.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @notice Staking contract that allows NFT users
* to temporarily lock their NFTs to earn
* ERC-20 token rewards
*
* The NFTs are locked inside this contract for the
* duration of the staking period while allowing the
* user to unstake at any time
*
* While the NFTs are staked, they are technically
* owned by this contract and cannot be moved or placed
* on any marketplace
*
* The contract allows users to stake and unstake multiple
* NFTs efficiently, in one transaction
*
* Staking rewards are paid out to users once
* they unstake their NFTs and are calculated
* based on a rounded down number of days the NFTs
* were staken for
*
* Some of the rarest NFTs are boosted by the contract
* owner to receive bigger staking rewards
*
* @dev Features a contract owner that is able to change
* the daily rewards, the boosted NFT list and the
* boosted NFT daily rewards
*/
contract TokenRewardStaking is ERC721Holder, Ownable {
using EnumerableSet for EnumerableSet.UintSet;
/**
* @notice Stores the ERC-20 token that will
* be paid out to NFT holders for staking
*/
IMintableERC20 public immutable erc20;
/**
* @notice Stores the ERC-721 token that will
* be staken to receive ERC-20 rewards
*/
IERC721 public immutable erc721;
/**
* @notice Amount of tokens earned for each
* day (24 hours) the token was staked for
*
* @dev Can be changed by contract owner via setDailyRewards()
*/
uint128 public dailyRewards;
/**
* @notice Some NFTs are boosted to receive bigger token
* rewards. This multiplier shows how much more
* they will receive
*
* E.g. dailyRewardBoostMultiplier = 10 means that the boosted
* NFTs will receive 10 times the dailyRewards
*
* @dev Can be changed by contract owner via setDailyRewardBoostMultiplier()
*/
uint128 public dailyRewardBoostMultiplier;
/**
* @notice Boosted NFTs contained in this list
* earn bigger daily rewards
*
* @dev We use an EnumerableSet to store this data
* instead of an array to be able to query in
* O(1) complexity
*
** @dev Can be changed by contract owner via setBoostedNftIds()
*/
EnumerableSet.UintSet private boostedNftIds;
/**
* @notice Stores ownership information for staked
* NFTs
*/
mapping(uint256 => address) public ownerOf;
/**
* @notice Stores time staking started for staked
* NFTs
*/
mapping(uint256 => uint256) public stakedAt;
/**
* @dev Stores the staked tokens of an address
*/
mapping(address => EnumerableSet.UintSet) private stakedTokens;
/**
* @dev Smart contract unique identifier, a random number
*
* @dev Should be regenerated each time smart contact source code is changed
* and changes smart contract itself is to be redeployed
*
* @dev Generated using https://www.random.org/bytes/
*/
uint256 public constant UID = 0x78ea82e97e97cd54405b116b0209cbaf8bcb22911b5ad1045e81ea6caf7d47fa;
/**
* @dev Sets initialization variables which cannot be
* changed in the future
*
* @param _erc20Address address of erc20 rewards token
* @param _erc721Address address of erc721 token to be staken for rewards
* @param _dailyRewards daily amount of tokens to be paid to stakers for every day
* they have staken an NFT
* @param _boostedNftIds boosted NFTs receive bigger rewards
* @param _dailyRewardBoostMultiplier multiplier of rewards for boosted NFTs
*/
constructor(
address _erc20Address,
address _erc721Address,
uint128 _dailyRewards,
uint256[] memory _boostedNftIds,
uint128 _dailyRewardBoostMultiplier
) {
erc20 = IMintableERC20(_erc20Address);
erc721 = IERC721(_erc721Address);
setDailyRewards(_dailyRewards);
setBoostedNftIds(_boostedNftIds);
setDailyRewardBoostMultiplier(_dailyRewardBoostMultiplier);
}
/**
* @dev Emitted every time a token is staked
*
* Emitted in stake()
*
* @param by address that staked the NFT
* @param time block timestamp the NFT were staked at
* @param tokenId token ID of NFT that was staken
*/
event Staked(address indexed by, uint256 indexed tokenId, uint256 time);
/**
* @dev Emitted every time a token is unstaked
*
* Emitted in unstake()
*
* @param by address that unstaked the NFT
* @param time block timestamp the NFT were staked at
* @param tokenId token ID of NFT that was unstaken
* @param stakedAt when the NFT initially staked at
* @param reward how many tokens user got for the
* staking of the NFT
*/
event Unstaked(address indexed by, uint256 indexed tokenId, uint256 time, uint256 stakedAt, uint256 reward);
/**
* @dev Emitted when the boosted NFT ids is changed
*
* Emitted in setDailyReward()
*
* @param by address that changed the daily reward
* @param oldDailyRewards old daily reward
* @param newDailyRewards new daily reward in effect
*/
event DailyRewardsChanged(address indexed by, uint128 oldDailyRewards, uint128 newDailyRewards);
/**
* @dev Emitted when the boosted NFT daily reward
* multiplier is changed
*
* Emitted in setDailyRewardBoostMultiplier()
*
* @param by address that changed the daily reward boost multiplier
* @param oldDailyRewardBoostMultiplier old daily reward boost multiplier
* @param newDailyRewardBoostMultiplier new daily reward boost multiplier
*/
event DailyRewardBoostMultiplierChanged(
address indexed by,
uint128 oldDailyRewardBoostMultiplier,
uint128 newDailyRewardBoostMultiplier
);
/**
* @dev Emitted when the boosted NFT ids change
*
* Emitted in setBoostedNftIds()
*
* @param by address that changed the boosted NFT ids
* @param oldBoostedNftIds old boosted NFT ids
* @param newBoostedNftIds new boosted NFT ids
*/
event BoostedNftIdsChanged(address indexed by, uint256[] oldBoostedNftIds, uint256[] newBoostedNftIds);
/**
* @notice Checks whether a token is boosted to receive
* bigger staking rewards
*
* @param _tokenId ID of token to check
* @return whether the token is boosted
*/
function isBoostedToken(uint256 _tokenId) public view returns (bool) {
return boostedNftIds.contains(_tokenId);
}
/**
* @notice Changes the daily reward in erc20 tokens received
* for every NFT staked
*
* @dev Restricted to contract owner
*
* @param _newDailyRewards the new daily reward in erc20 tokens
*/
function setDailyRewards(uint128 _newDailyRewards) public onlyOwner {
// Emit event
emit DailyRewardsChanged(msg.sender, dailyRewards, _newDailyRewards);
// Change storage variable
dailyRewards = _newDailyRewards;
}
/**
* @notice Changes the daily reward boost multiplier for
* boosted NFTs
*
* @dev Restricted to contract owner
*
* @param _newDailyRewardBoostMultiplier the new daily reward boost multiplier
*/
function setDailyRewardBoostMultiplier(uint128 _newDailyRewardBoostMultiplier) public onlyOwner {
// Emit event
emit DailyRewardBoostMultiplierChanged(msg.sender, dailyRewardBoostMultiplier, _newDailyRewardBoostMultiplier);
// Change storage variable
dailyRewardBoostMultiplier = _newDailyRewardBoostMultiplier;
}
/**
* @notice Changes the boosted NFT ids that receive
* a bigger daily reward
*
* @dev Restricted to contract owner
*
* @param _newBoostedNftIds the new boosted NFT ids
*/
function setBoostedNftIds(uint256[] memory _newBoostedNftIds) public onlyOwner {
// Create array to store old boosted NFTs and emit
// event later
uint256[] memory oldBoostedNftIds = new uint256[](boostedNftIds.length());
// Empty boosted NFT ids set
for (uint256 i = 0; boostedNftIds.length() > 0; i++) {
// Get a value from the set
// Since set length is > 0 it is guaranteed
// that there is a value at index 0
uint256 value = boostedNftIds.at(0);
// Remove the value
boostedNftIds.remove(value);
// Store the value to the old boosted NFT ids
// list to later emit event
oldBoostedNftIds[i] = value;
}
// Emit event
emit BoostedNftIdsChanged(msg.sender, oldBoostedNftIds, _newBoostedNftIds);
// Enumerate new boosted NFT ids
for (uint256 i = 0; i < _newBoostedNftIds.length; i++) {
uint256 boostedNftId = _newBoostedNftIds[i];
// Add boosted NFT id to set
boostedNftIds.add(boostedNftId);
}
}
/**
* @notice Calculates all the NFTs currently staken by
* an address
*
* @dev This is an auxiliary function to help with integration
* and is not used anywhere in the smart contract login
*
* @param _owner address to search staked tokens of
* @return an array of token IDs of NFTs that are currently staken
*/
function tokensStakedByOwner(address _owner) external view returns (uint256[] memory) {
// Cache the length of the staked tokens set for the owner
uint256 stakedTokensLength = stakedTokens[_owner].length();
// Create an empty array to store the result
// Should be the same length as the staked tokens
// set
uint256[] memory tokenIds = new uint256[](stakedTokensLength);
// Copy set values to array
for (uint256 i = 0; i < stakedTokensLength; i++) {
tokenIds[i] = stakedTokens[_owner].at(i);
}
// Return array result
return tokenIds;
}
/**
* @notice Calculates the rewards that would be earned by
* the user for each an NFT if he was to unstake it at
* the current block
*
* @param _tokenId token ID of NFT rewards are to be calculated for
* @return the amount of rewards for the input staken NFT
*/
function currentRewardsOf(uint256 _tokenId) public view returns (uint256) {
// Verify NFT is staked
require(stakedAt[_tokenId] != 0, "not staked");
// Get current token ID staking time by calculating the
// delta between the current block time(`block.timestamp`)
// and the time the token was initially staked(`stakedAt[tokenId]`)
uint256 stakingTime = block.timestamp - stakedAt[_tokenId];
// `stakingTime` is the staking time in seconds
// Calculate the staking time in days by:
// * dividing by 60 (seconds in a minute)
// * dividing by 60 (minutes in an hour)
// * dividing by 24 (hours in a day)
// This will yield the (rounded down) staking
// time in days
uint256 stakingDays = stakingTime / 60 / 60 / 24;
// Calculate reward for token by multiplying
// rounded down number of staked days by daily
// rewards variable
uint256 reward = stakingDays * dailyRewards;
// If the NFT is boosted
if (isBoostedToken(_tokenId)) {
// Multiply the reward
reward *= dailyRewardBoostMultiplier;
}
// Return reward
return reward;
}
/**
* @notice Stake NFTs to start earning ERC-20
* token rewards
*
* The ERC-20 token rewards will be paid out
* when the NFTs are unstaken
*
* @dev Sender must first approve this contract
* to transfer NFTs on his behalf and NFT
* ownership is transferred to this contract
* for the duration of the staking
*
* @param _tokenIds token IDs of NFTs to be staken
*/
function stake(uint256[] memory _tokenIds) public {
// Ensure at least one token ID was sent
require(_tokenIds.length > 0, "no token IDs sent");
// Enumerate sent token IDs
for (uint256 i = 0; i < _tokenIds.length; i++) {
// Get token ID
uint256 tokenId = _tokenIds[i];
// Store NFT owner
ownerOf[tokenId] = msg.sender;
// Add NFT to owner staked tokens
stakedTokens[msg.sender].add(tokenId);
// Store staking time as block timestamp the
// the transaction was confirmed in
stakedAt[tokenId] = block.timestamp;
// Transfer token to staking contract
// Will fail if the user does not own the
// token or has not approved the staking
// contract for transferring tokens on his
// behalf
erc721.safeTransferFrom(msg.sender, address(this), tokenId, "");
// Emit event
emit Staked(msg.sender, tokenId, stakedAt[tokenId]);
}
}
/**
* @notice Unstake NFTs to receive ERC-20 token rewards
*
* @dev Sender must have first staken the NFTs
*
* @param _tokenIds token IDs of NFTs to be unstaken
*/
function unstake(uint256[] memory _tokenIds) public {
// Ensure at least one token ID was sent
require(_tokenIds.length > 0, "no token IDs sent");
// Create a variable to store the total rewards for all
// NFTs sent
uint256 totalRewards = 0;
// Enumerate sent token IDs
for (uint256 i = 0; i < _tokenIds.length; i++) {
// Get token ID
uint256 tokenId = _tokenIds[i];
// Verify sender is token ID owner
// Will fail if token is not staked (owner is 0x0)
require(ownerOf[tokenId] == msg.sender, "not token owner");
// Calculate rewards for token ID. Will revert
// if the token is not staken
uint256 rewards = currentRewardsOf(tokenId);
// Increase amount of total rewards
// for all tokens sent
totalRewards += rewards;
// Emit event
emit Unstaked(msg.sender, tokenId, block.timestamp, stakedAt[tokenId], rewards);
// Reset `ownerOf` and `stakedAt`
// for token
ownerOf[tokenId] = address(0);
stakedAt[tokenId] = 0;
// Remove NFT from owner staked tokens
stakedTokens[msg.sender].remove(tokenId);
// Transfer NFT back to user
erc721.transferFrom(address(this), msg.sender, tokenId);
}
// Mint total rewards for all sent NFTs
// to user
erc20.mint(msg.sender, totalRewards);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
pragma solidity =0.8.10;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/**
* @notice ERC20-compliant interface with added
* function for minting new tokens to addresses
*
* See {IERC20}
*/
interface IMintableERC20 is IERC20 {
/**
* @dev Allows issuing new tokens to an address
*
* @dev Should have restricted access
*/
function mint(address _to, uint256 _amount) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC721Receiver.sol";
/**
* @dev Implementation of the {IERC721Receiver} interface.
*
* Accepts all token transfers.
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
*/
contract ERC721Holder is IERC721Receiver {
/**
* @dev See {IERC721Receiver-onERC721Received}.
*
* Always returns `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address,
address,
uint256,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC721Received.selector;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
return _values(set._inner);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: MIT
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() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
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 {
_setOwner(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");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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 `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @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);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
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[{"inputs":[{"internalType":"address","name":"_erc20Address","type":"address"},{"internalType":"address","name":"_erc721Address","type":"address"},{"internalType":"uint128","name":"_dailyRewards","type":"uint128"},{"internalType":"uint256[]","name":"_boostedNftIds","type":"uint256[]"},{"internalType":"uint128","name":"_dailyRewardBoostMultiplier","type":"uint128"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"oldBoostedNftIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"newBoostedNftIds","type":"uint256[]"}],"name":"BoostedNftIdsChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":false,"internalType":"uint128","name":"oldDailyRewardBoostMultiplier","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"newDailyRewardBoostMultiplier","type":"uint128"}],"name":"DailyRewardBoostMultiplierChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":false,"internalType":"uint128","name":"oldDailyRewards","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"newDailyRewards","type":"uint128"}],"name":"DailyRewardsChanged","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":"by","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakedAt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"Unstaked","type":"event"},{"inputs":[],"name":"UID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"currentRewardsOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dailyRewardBoostMultiplier","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dailyRewards","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc20","outputs":[{"internalType":"contract IMintableERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc721","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"isBoostedToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_newBoostedNftIds","type":"uint256[]"}],"name":"setBoostedNftIds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_newDailyRewardBoostMultiplier","type":"uint128"}],"name":"setDailyRewardBoostMultiplier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_newDailyRewards","type":"uint128"}],"name":"setDailyRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"tokensStakedByOwner","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":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60c06040523480156200001157600080fd5b5060405162001b8038038062001b8083398101604081905262000034916200063f565b6200003f336200007e565b6001600160a01b03808616608052841660a0526200005d83620000ce565b620000688262000188565b620000738162000375565b50505050506200083f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031633146200011d5760405162461bcd60e51b8152602060048201819052602482015260008051602062001b6083398151915260448201526064015b60405180910390fd5b600154604080516001600160801b039283168152918316602083015233917f3bfbf35c57ea09408247d86ad23260a3590e9c1dac5c2152fc895d7b67e4ad5f910160405180910390a2600180546001600160801b0319166001600160801b0392909216919091179055565b6000546001600160a01b03163314620001d35760405162461bcd60e51b8152602060048201819052602482015260008051602062001b60833981519152604482015260640162000114565b6000620001ec60026200042f60201b62000d031760201c565b6001600160401b0381111562000206576200020662000629565b60405190808252806020026020018201604052801562000230578160200160208202803683370190505b50905060005b60006200024f60026200042f60201b62000d031760201c565b1115620002c957600062000274600060026200044060201b62000d0d1790919060201c565b9050620002918160026200045560201b62000d201790919060201c565b5080838381518110620002a857620002a862000756565b60209081029190910101525080620002c08162000782565b91505062000236565b50336001600160a01b03167f2b64405b2f240f38e5ff3949e6f0e1b2cc5d92b9fe1a6a234d052ad95dec253a828460405162000307929190620007dd565b60405180910390a260005b82518110156200037057600083828151811062000333576200033362000756565b60200260200101519050620003588160026200046360201b62000d2c1790919060201c565b50508080620003679062000782565b91505062000312565b505050565b6000546001600160a01b03163314620003c05760405162461bcd60e51b8152602060048201819052602482015260008051602062001b60833981519152604482015260640162000114565b60015460408051600160801b9092046001600160801b0390811683528316602083015233917f53a4ad96b204073ea302be0cfa5c10ed97a61b1b540a15614777fd915489b282910160405180910390a2600180546001600160801b03928316600160801b029216919091179055565b60006200043a825490565b92915050565b60006200044e838362000471565b9392505050565b60006200044e83836200049e565b60006200044e8383620005a2565b60008260000182815481106200048b576200048b62000756565b9060005260206000200154905092915050565b6000818152600183016020526040812054801562000597576000620004c56001836200080f565b8554909150600090620004db906001906200080f565b905081811462000547576000866000018281548110620004ff57620004ff62000756565b906000526020600020015490508087600001848154811062000525576200052562000756565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806200055b576200055b62000829565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506200043a565b60009150506200043a565b6000818152600183016020526040812054620005eb575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200043a565b5060006200043a565b80516001600160a01b03811681146200060c57600080fd5b919050565b80516001600160801b03811681146200060c57600080fd5b634e487b7160e01b600052604160045260246000fd5b600080600080600060a086880312156200065857600080fd5b6200066386620005f4565b9450602062000674818801620005f4565b9450620006846040880162000611565b60608801519094506001600160401b0380821115620006a257600080fd5b818901915089601f830112620006b757600080fd5b815181811115620006cc57620006cc62000629565b8060051b604051601f19603f83011681018181108582111715620006f457620006f462000629565b60405291825284820192508381018501918c8311156200071357600080fd5b938501935b82851015620007335784518452938501939285019262000718565b8097505050505050506200074a6080870162000611565b90509295509295909350565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156200079957620007996200076c565b5060010190565b600081518084526020808501945080840160005b83811015620007d257815187529582019590820190600101620007b4565b509495945050505050565b604081526000620007f26040830185620007a0565b8281036020840152620008068185620007a0565b95945050505050565b6000828210156200082457620008246200076c565b500390565b634e487b7160e01b600052603160045260246000fd5b60805160a0516112e66200087a600039600081816102e1015281816105350152610b6a0152600081816102760152610c0001526112e66000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c8063785e9e86116100ad578063c8bfef7711610071578063c8bfef7714610303578063dc554e4014610316578063dc5d2c9814610339578063e449f3411461034c578063f2fde38b1461035f57600080fd5b8063785e9e86146102715780638da5cb5b14610298578063a8acbad5146102a9578063b1449dee146102c9578063bca6ce64146102dc57600080fd5b806348d8f3e8116100f457806348d8f3e8146101ae5780634e692783146101e05780635cc99e35146102015780636352211e14610228578063715018a61461026957600080fd5b8063030f04b8146101265780630fbf0a931461014f578063150b7a0214610164578063174831421461019b575b600080fd5b610139610134366004610f28565b610372565b6040516101469190610f7e565b60405180910390f35b61016261015d366004610fd8565b610444565b005b61018261017236600461107e565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610146565b6101626101a9366004610fd8565b6105fd565b6001546101c890600160801b90046001600160801b031681565b6040516001600160801b039091168152602001610146565b6101f36101ee36600461113e565b610774565b604051908152602001610146565b6101f37f78ea82e97e97cd54405b116b0209cbaf8bcb22911b5ad1045e81ea6caf7d47fa81565b61025161023636600461113e565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610146565b61016261084f565b6102517f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b0316610251565b6101f36102b736600461113e565b60056020526000908152604090205481565b6101626102d7366004611157565b610885565b6102517f000000000000000000000000000000000000000000000000000000000000000081565b6001546101c8906001600160801b031681565b61032961032436600461113e565b610923565b6040519015158152602001610146565b610162610347366004611157565b610936565b61016261035a366004610fd8565b6109cf565b61016261036d366004610f28565b610c68565b6001600160a01b03811660009081526006602052604081206060919061039790610d03565b905060008167ffffffffffffffff8111156103b4576103b4610f91565b6040519080825280602002602001820160405280156103dd578160200160208202803683370190505b50905060005b8281101561043c576001600160a01b038516600090815260066020526040902061040d9082610d0d565b82828151811061041f5761041f611180565b602090810291909101015280610434816111ac565b9150506103e3565b509392505050565b600081511161048e5760405162461bcd60e51b81526020600482015260116024820152701b9bc81d1bdad95b8812511cc81cd95b9d607a1b60448201526064015b60405180910390fd5b60005b81518110156105f95760008282815181106104ae576104ae611180565b602090810291909101810151600081815260048352604080822080546001600160a01b0319163390811790915582526006909352919091209091506104f39082610d2c565b5060008181526005602052604080822042905551635c46a7ef60e11b8152336004820152306024820152604481018390526080606482015260848101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b88d4fde9060a401600060405180830381600087803b15801561058157600080fd5b505af1158015610595573d6000803e3d6000fd5b5050506000828152600560205260409081902054905183925033917f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee90916105de91815260200190565b60405180910390a350806105f1816111ac565b915050610491565b5050565b6000546001600160a01b031633146106275760405162461bcd60e51b8152600401610485906111c7565b60006106336002610d03565b67ffffffffffffffff81111561064b5761064b610f91565b604051908082528060200260200182016040528015610674578160200160208202803683370190505b50905060005b60006106866002610d03565b11156106d8576000610699600282610d0d565b90506106a6600282610d20565b50808383815181106106ba576106ba611180565b602090810291909101015250806106d0816111ac565b91505061067a565b50336001600160a01b03167f2b64405b2f240f38e5ff3949e6f0e1b2cc5d92b9fe1a6a234d052ad95dec253a82846040516107149291906111fc565b60405180910390a260005b825181101561076f57600083828151811061073c5761073c611180565b6020026020010151905061075a816002610d2c90919063ffffffff16565b50508080610767906111ac565b91505061071f565b505050565b6000818152600560205260408120546107bc5760405162461bcd60e51b815260206004820152600a6024820152691b9bdd081cdd185ad95960b21b6044820152606401610485565b6000828152600560205260408120546107d5904261122a565b905060006018603c6107e78185611241565b6107f19190611241565b6107fb9190611241565b600154909150600090610817906001600160801b031683611263565b905061082285610923565b156108475760015461084490600160801b90046001600160801b031682611263565b90505b949350505050565b6000546001600160a01b031633146108795760405162461bcd60e51b8152600401610485906111c7565b6108836000610d38565b565b6000546001600160a01b031633146108af5760405162461bcd60e51b8152600401610485906111c7565b600154604080516001600160801b039283168152918316602083015233917f3bfbf35c57ea09408247d86ad23260a3590e9c1dac5c2152fc895d7b67e4ad5f910160405180910390a2600180546fffffffffffffffffffffffffffffffff19166001600160801b0392909216919091179055565b6000610930600283610d88565b92915050565b6000546001600160a01b031633146109605760405162461bcd60e51b8152600401610485906111c7565b60015460408051600160801b9092046001600160801b0390811683528316602083015233917f53a4ad96b204073ea302be0cfa5c10ed97a61b1b540a15614777fd915489b282910160405180910390a2600180546001600160801b03928316600160801b029216919091179055565b6000815111610a145760405162461bcd60e51b81526020600482015260116024820152701b9bc81d1bdad95b8812511cc81cd95b9d607a1b6044820152606401610485565b6000805b8251811015610be3576000838281518110610a3557610a35611180565b602090810291909101810151600081815260049092526040909120549091506001600160a01b03163314610a9d5760405162461bcd60e51b815260206004820152600f60248201526e3737ba103a37b5b2b71037bbb732b960891b6044820152606401610485565b6000610aa882610774565b9050610ab48185611282565b60008381526005602090815260409182902054825142815291820152908101839052909450829033907fdcfd2b4017d03f7e541021db793b2f9b31e4acdee005f789e52853c390e3e9629060600160405180910390a3600082815260046020908152604080832080546001600160a01b03191690556005825280832083905533835260069091529020610b479083610d20565b506040516323b872dd60e01b8152306004820152336024820152604481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd90606401600060405180830381600087803b158015610bb657600080fd5b505af1158015610bca573d6000803e3d6000fd5b5050505050508080610bdb906111ac565b915050610a18565b506040516340c10f1960e01b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906340c10f1990604401600060405180830381600087803b158015610c4c57600080fd5b505af1158015610c60573d6000803e3d6000fd5b505050505050565b6000546001600160a01b03163314610c925760405162461bcd60e51b8152600401610485906111c7565b6001600160a01b038116610cf75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610485565b610d0081610d38565b50565b6000610930825490565b6000610d198383610da0565b9392505050565b6000610d198383610dca565b6000610d198383610ebd565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008181526001830160205260408120541515610d19565b6000826000018281548110610db757610db7611180565b9060005260206000200154905092915050565b60008181526001830160205260408120548015610eb3576000610dee60018361122a565b8554909150600090610e029060019061122a565b9050818114610e67576000866000018281548110610e2257610e22611180565b9060005260206000200154905080876000018481548110610e4557610e45611180565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610e7857610e7861129a565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610930565b6000915050610930565b6000818152600183016020526040812054610f0457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610930565b506000610930565b80356001600160a01b0381168114610f2357600080fd5b919050565b600060208284031215610f3a57600080fd5b610d1982610f0c565b600081518084526020808501945080840160005b83811015610f7357815187529582019590820190600101610f57565b509495945050505050565b602081526000610d196020830184610f43565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610fd057610fd0610f91565b604052919050565b60006020808385031215610feb57600080fd5b823567ffffffffffffffff8082111561100357600080fd5b818501915085601f83011261101757600080fd5b81358181111561102957611029610f91565b8060051b915061103a848301610fa7565b818152918301840191848101908884111561105457600080fd5b938501935b8385101561107257843582529385019390850190611059565b98975050505050505050565b6000806000806080858703121561109457600080fd5b61109d85610f0c565b935060206110ac818701610f0c565b935060408601359250606086013567ffffffffffffffff808211156110d057600080fd5b818801915088601f8301126110e457600080fd5b8135818111156110f6576110f6610f91565b611108601f8201601f19168501610fa7565b9150808252898482850101111561111e57600080fd5b808484018584013760008482840101525080935050505092959194509250565b60006020828403121561115057600080fd5b5035919050565b60006020828403121561116957600080fd5b81356001600160801b0381168114610d1957600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156111c0576111c0611196565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60408152600061120f6040830185610f43565b82810360208401526112218185610f43565b95945050505050565b60008282101561123c5761123c611196565b500390565b60008261125e57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561127d5761127d611196565b500290565b6000821982111561129557611295611196565b500190565b634e487b7160e01b600052603160045260246000fdfea26469706673582212203cfec146a752012a9c0e7e7ab9240010a7fe6258514530399d9f821bb94fd0fa64736f6c634300080a00334f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572000000000000000000000000ec5709c0750043cfb4b869dbc871e86efe18b4c5000000000000000000000000d8682bfa6918b0174f287b888e765b9a1b4dc9c300000000000000000000000000000000000000000000000000000000000061a800000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000d00000000000000000000000000000000000000000000000000000000000005d00000000000000000000000000000000000000000000000000000000000000dc1000000000000000000000000000000000000000000000000000000000000100200000000000000000000000000000000000000000000000000000000000002dc000000000000000000000000000000000000000000000000000000000000204f000000000000000000000000000000000000000000000000000000000000213d00000000000000000000000000000000000000000000000000000000000027eb0000000000000000000000000000000000000000000000000000000000000b57000000000000000000000000000000000000000000000000000000000000180600000000000000000000000000000000000000000000000000000000000019940000000000000000000000000000000000000000000000000000000000001d7b000000000000000000000000000000000000000000000000000000000000237500000000000000000000000000000000000000000000000000000000000026be
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063785e9e86116100ad578063c8bfef7711610071578063c8bfef7714610303578063dc554e4014610316578063dc5d2c9814610339578063e449f3411461034c578063f2fde38b1461035f57600080fd5b8063785e9e86146102715780638da5cb5b14610298578063a8acbad5146102a9578063b1449dee146102c9578063bca6ce64146102dc57600080fd5b806348d8f3e8116100f457806348d8f3e8146101ae5780634e692783146101e05780635cc99e35146102015780636352211e14610228578063715018a61461026957600080fd5b8063030f04b8146101265780630fbf0a931461014f578063150b7a0214610164578063174831421461019b575b600080fd5b610139610134366004610f28565b610372565b6040516101469190610f7e565b60405180910390f35b61016261015d366004610fd8565b610444565b005b61018261017236600461107e565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610146565b6101626101a9366004610fd8565b6105fd565b6001546101c890600160801b90046001600160801b031681565b6040516001600160801b039091168152602001610146565b6101f36101ee36600461113e565b610774565b604051908152602001610146565b6101f37f78ea82e97e97cd54405b116b0209cbaf8bcb22911b5ad1045e81ea6caf7d47fa81565b61025161023636600461113e565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610146565b61016261084f565b6102517f000000000000000000000000ec5709c0750043cfb4b869dbc871e86efe18b4c581565b6000546001600160a01b0316610251565b6101f36102b736600461113e565b60056020526000908152604090205481565b6101626102d7366004611157565b610885565b6102517f000000000000000000000000d8682bfa6918b0174f287b888e765b9a1b4dc9c381565b6001546101c8906001600160801b031681565b61032961032436600461113e565b610923565b6040519015158152602001610146565b610162610347366004611157565b610936565b61016261035a366004610fd8565b6109cf565b61016261036d366004610f28565b610c68565b6001600160a01b03811660009081526006602052604081206060919061039790610d03565b905060008167ffffffffffffffff8111156103b4576103b4610f91565b6040519080825280602002602001820160405280156103dd578160200160208202803683370190505b50905060005b8281101561043c576001600160a01b038516600090815260066020526040902061040d9082610d0d565b82828151811061041f5761041f611180565b602090810291909101015280610434816111ac565b9150506103e3565b509392505050565b600081511161048e5760405162461bcd60e51b81526020600482015260116024820152701b9bc81d1bdad95b8812511cc81cd95b9d607a1b60448201526064015b60405180910390fd5b60005b81518110156105f95760008282815181106104ae576104ae611180565b602090810291909101810151600081815260048352604080822080546001600160a01b0319163390811790915582526006909352919091209091506104f39082610d2c565b5060008181526005602052604080822042905551635c46a7ef60e11b8152336004820152306024820152604481018390526080606482015260848101919091527f000000000000000000000000d8682bfa6918b0174f287b888e765b9a1b4dc9c36001600160a01b03169063b88d4fde9060a401600060405180830381600087803b15801561058157600080fd5b505af1158015610595573d6000803e3d6000fd5b5050506000828152600560205260409081902054905183925033917f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee90916105de91815260200190565b60405180910390a350806105f1816111ac565b915050610491565b5050565b6000546001600160a01b031633146106275760405162461bcd60e51b8152600401610485906111c7565b60006106336002610d03565b67ffffffffffffffff81111561064b5761064b610f91565b604051908082528060200260200182016040528015610674578160200160208202803683370190505b50905060005b60006106866002610d03565b11156106d8576000610699600282610d0d565b90506106a6600282610d20565b50808383815181106106ba576106ba611180565b602090810291909101015250806106d0816111ac565b91505061067a565b50336001600160a01b03167f2b64405b2f240f38e5ff3949e6f0e1b2cc5d92b9fe1a6a234d052ad95dec253a82846040516107149291906111fc565b60405180910390a260005b825181101561076f57600083828151811061073c5761073c611180565b6020026020010151905061075a816002610d2c90919063ffffffff16565b50508080610767906111ac565b91505061071f565b505050565b6000818152600560205260408120546107bc5760405162461bcd60e51b815260206004820152600a6024820152691b9bdd081cdd185ad95960b21b6044820152606401610485565b6000828152600560205260408120546107d5904261122a565b905060006018603c6107e78185611241565b6107f19190611241565b6107fb9190611241565b600154909150600090610817906001600160801b031683611263565b905061082285610923565b156108475760015461084490600160801b90046001600160801b031682611263565b90505b949350505050565b6000546001600160a01b031633146108795760405162461bcd60e51b8152600401610485906111c7565b6108836000610d38565b565b6000546001600160a01b031633146108af5760405162461bcd60e51b8152600401610485906111c7565b600154604080516001600160801b039283168152918316602083015233917f3bfbf35c57ea09408247d86ad23260a3590e9c1dac5c2152fc895d7b67e4ad5f910160405180910390a2600180546fffffffffffffffffffffffffffffffff19166001600160801b0392909216919091179055565b6000610930600283610d88565b92915050565b6000546001600160a01b031633146109605760405162461bcd60e51b8152600401610485906111c7565b60015460408051600160801b9092046001600160801b0390811683528316602083015233917f53a4ad96b204073ea302be0cfa5c10ed97a61b1b540a15614777fd915489b282910160405180910390a2600180546001600160801b03928316600160801b029216919091179055565b6000815111610a145760405162461bcd60e51b81526020600482015260116024820152701b9bc81d1bdad95b8812511cc81cd95b9d607a1b6044820152606401610485565b6000805b8251811015610be3576000838281518110610a3557610a35611180565b602090810291909101810151600081815260049092526040909120549091506001600160a01b03163314610a9d5760405162461bcd60e51b815260206004820152600f60248201526e3737ba103a37b5b2b71037bbb732b960891b6044820152606401610485565b6000610aa882610774565b9050610ab48185611282565b60008381526005602090815260409182902054825142815291820152908101839052909450829033907fdcfd2b4017d03f7e541021db793b2f9b31e4acdee005f789e52853c390e3e9629060600160405180910390a3600082815260046020908152604080832080546001600160a01b03191690556005825280832083905533835260069091529020610b479083610d20565b506040516323b872dd60e01b8152306004820152336024820152604481018390527f000000000000000000000000d8682bfa6918b0174f287b888e765b9a1b4dc9c36001600160a01b0316906323b872dd90606401600060405180830381600087803b158015610bb657600080fd5b505af1158015610bca573d6000803e3d6000fd5b5050505050508080610bdb906111ac565b915050610a18565b506040516340c10f1960e01b8152336004820152602481018290527f000000000000000000000000ec5709c0750043cfb4b869dbc871e86efe18b4c56001600160a01b0316906340c10f1990604401600060405180830381600087803b158015610c4c57600080fd5b505af1158015610c60573d6000803e3d6000fd5b505050505050565b6000546001600160a01b03163314610c925760405162461bcd60e51b8152600401610485906111c7565b6001600160a01b038116610cf75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610485565b610d0081610d38565b50565b6000610930825490565b6000610d198383610da0565b9392505050565b6000610d198383610dca565b6000610d198383610ebd565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008181526001830160205260408120541515610d19565b6000826000018281548110610db757610db7611180565b9060005260206000200154905092915050565b60008181526001830160205260408120548015610eb3576000610dee60018361122a565b8554909150600090610e029060019061122a565b9050818114610e67576000866000018281548110610e2257610e22611180565b9060005260206000200154905080876000018481548110610e4557610e45611180565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610e7857610e7861129a565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610930565b6000915050610930565b6000818152600183016020526040812054610f0457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610930565b506000610930565b80356001600160a01b0381168114610f2357600080fd5b919050565b600060208284031215610f3a57600080fd5b610d1982610f0c565b600081518084526020808501945080840160005b83811015610f7357815187529582019590820190600101610f57565b509495945050505050565b602081526000610d196020830184610f43565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610fd057610fd0610f91565b604052919050565b60006020808385031215610feb57600080fd5b823567ffffffffffffffff8082111561100357600080fd5b818501915085601f83011261101757600080fd5b81358181111561102957611029610f91565b8060051b915061103a848301610fa7565b818152918301840191848101908884111561105457600080fd5b938501935b8385101561107257843582529385019390850190611059565b98975050505050505050565b6000806000806080858703121561109457600080fd5b61109d85610f0c565b935060206110ac818701610f0c565b935060408601359250606086013567ffffffffffffffff808211156110d057600080fd5b818801915088601f8301126110e457600080fd5b8135818111156110f6576110f6610f91565b611108601f8201601f19168501610fa7565b9150808252898482850101111561111e57600080fd5b808484018584013760008482840101525080935050505092959194509250565b60006020828403121561115057600080fd5b5035919050565b60006020828403121561116957600080fd5b81356001600160801b0381168114610d1957600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156111c0576111c0611196565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60408152600061120f6040830185610f43565b82810360208401526112218185610f43565b95945050505050565b60008282101561123c5761123c611196565b500390565b60008261125e57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561127d5761127d611196565b500290565b6000821982111561129557611295611196565b500190565b634e487b7160e01b600052603160045260246000fdfea26469706673582212203cfec146a752012a9c0e7e7ab9240010a7fe6258514530399d9f821bb94fd0fa64736f6c634300080a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ec5709c0750043cfb4b869dbc871e86efe18b4c5000000000000000000000000d8682bfa6918b0174f287b888e765b9a1b4dc9c300000000000000000000000000000000000000000000000000000000000061a800000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000d00000000000000000000000000000000000000000000000000000000000005d00000000000000000000000000000000000000000000000000000000000000dc1000000000000000000000000000000000000000000000000000000000000100200000000000000000000000000000000000000000000000000000000000002dc000000000000000000000000000000000000000000000000000000000000204f000000000000000000000000000000000000000000000000000000000000213d00000000000000000000000000000000000000000000000000000000000027eb0000000000000000000000000000000000000000000000000000000000000b57000000000000000000000000000000000000000000000000000000000000180600000000000000000000000000000000000000000000000000000000000019940000000000000000000000000000000000000000000000000000000000001d7b000000000000000000000000000000000000000000000000000000000000237500000000000000000000000000000000000000000000000000000000000026be
-----Decoded View---------------
Arg [0] : _erc20Address (address): 0xeC5709c0750043cfb4B869Dbc871E86efe18b4C5
Arg [1] : _erc721Address (address): 0xD8682bFA6918b0174F287b888e765b9A1b4dc9c3
Arg [2] : _dailyRewards (uint128): 25000
Arg [3] : _boostedNftIds (uint256[]): 1488,3521,4098,732,8271,8509,10219,2903,6150,6548,7547,9077,9918
Arg [4] : _dailyRewardBoostMultiplier (uint128): 10
-----Encoded View---------------
19 Constructor Arguments found :
Arg [0] : 000000000000000000000000ec5709c0750043cfb4b869dbc871e86efe18b4c5
Arg [1] : 000000000000000000000000d8682bfa6918b0174f287b888e765b9a1b4dc9c3
Arg [2] : 00000000000000000000000000000000000000000000000000000000000061a8
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [4] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [5] : 000000000000000000000000000000000000000000000000000000000000000d
Arg [6] : 00000000000000000000000000000000000000000000000000000000000005d0
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000dc1
Arg [8] : 0000000000000000000000000000000000000000000000000000000000001002
Arg [9] : 00000000000000000000000000000000000000000000000000000000000002dc
Arg [10] : 000000000000000000000000000000000000000000000000000000000000204f
Arg [11] : 000000000000000000000000000000000000000000000000000000000000213d
Arg [12] : 00000000000000000000000000000000000000000000000000000000000027eb
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000b57
Arg [14] : 0000000000000000000000000000000000000000000000000000000000001806
Arg [15] : 0000000000000000000000000000000000000000000000000000000000001994
Arg [16] : 0000000000000000000000000000000000000000000000000000000000001d7b
Arg [17] : 0000000000000000000000000000000000000000000000000000000000002375
Arg [18] : 00000000000000000000000000000000000000000000000000000000000026be
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 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.