Source Code
Latest 25 from a total of 189 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Grant Chrono... | 18967998 | 790 days ago | IN | 0 ETH | 0.00032569 | ||||
| Claim Chronos | 18961627 | 791 days ago | IN | 0 ETH | 0.00159548 | ||||
| Claim Chronos | 18961610 | 791 days ago | IN | 0 ETH | 0.00163642 | ||||
| Unstake | 18943863 | 794 days ago | IN | 0 ETH | 0.002239 | ||||
| Unstake | 16835376 | 1090 days ago | IN | 0 ETH | 0.00223469 | ||||
| Unstake | 16835374 | 1090 days ago | IN | 0 ETH | 0.00274144 | ||||
| Group Unstake | 16000714 | 1207 days ago | IN | 0 ETH | 0.00272036 | ||||
| Unstake | 15494165 | 1279 days ago | IN | 0 ETH | 0.00534654 | ||||
| Claim Chronos | 15433647 | 1288 days ago | IN | 0 ETH | 0.00082564 | ||||
| Unstake | 15433644 | 1288 days ago | IN | 0 ETH | 0.00095172 | ||||
| Unstake | 15433641 | 1288 days ago | IN | 0 ETH | 0.00118564 | ||||
| Unstake | 15433640 | 1288 days ago | IN | 0 ETH | 0.00163051 | ||||
| Claim Chronos | 15388355 | 1295 days ago | IN | 0 ETH | 0.00063547 | ||||
| Claim Chronos | 15371544 | 1298 days ago | IN | 0 ETH | 0.00138941 | ||||
| Claim Chronos | 15371543 | 1298 days ago | IN | 0 ETH | 0.00140083 | ||||
| Claim Chronos | 15366865 | 1299 days ago | IN | 0 ETH | 0.00129692 | ||||
| Claim Chronos | 15358986 | 1300 days ago | IN | 0 ETH | 0.00093554 | ||||
| Unstake | 15330345 | 1305 days ago | IN | 0 ETH | 0.00684134 | ||||
| Group Unstake | 15322434 | 1306 days ago | IN | 0 ETH | 0.01013721 | ||||
| Group Unstake | 15313842 | 1307 days ago | IN | 0 ETH | 0.00547799 | ||||
| Unstake | 15311879 | 1308 days ago | IN | 0 ETH | 0.00133332 | ||||
| Unstake | 15311877 | 1308 days ago | IN | 0 ETH | 0.00121335 | ||||
| Unstake | 15311876 | 1308 days ago | IN | 0 ETH | 0.00109795 | ||||
| Unstake | 15311871 | 1308 days ago | IN | 0 ETH | 0.0011913 | ||||
| Unstake | 15311870 | 1308 days ago | IN | 0 ETH | 0.00120243 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
AdventurerHolding
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
/**
________ ___ ___ ________ ___ ___ _______ ________ _________
|\ __ \|\ \ / /|\ __ \|\ \|\ \|\ ___ \ |\ ____\|\___ ___\
\ \ \|\ \ \ \/ / | \ \|\ \ \ \\\ \ \ __/|\ \ \___|\|___ \ \_|
\ \ ____\ \ / / \ \ \\\ \ \ \\\ \ \ \_|/_\ \_____ \ \ \ \
\ \ \___|/ \/ \ \ \\\ \ \ \\\ \ \ \_|\ \|____|\ \ \ \ \
\ \__\ / /\ \ \ \_____ \ \_______\ \_______\____\_\ \ \ \__\
\|__| /__/ /\ __\ \|___| \__\|_______|\|_______|\_________\ \|__|
|__|/ \|__| \|__| \|_________|
* @title AdventurerHolding
* AdventurerHolding - a multi-purpose contract for staked PX Quest Adventurers
*/
pragma solidity ^0.8.11;
import "./IAdventurer.sol";
import "./IChronos.sol";
import "./IAdventurerHolding.sol";
import "./IAdventurerStaking.sol";
import "./utils/BitMap.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract AdventurerHolding is
Initializable,
IAdventurerHolding,
AccessControlUpgradeable,
ERC721HolderUpgradeable
{
using SafeERC20 for IChronos;
IAdventurer public adventurerContract;
IChronos public chronosContract;
bytes32 public constant LOCK_IN_ROLE = keccak256("LOCK_IN_ROLE");
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
// NFT tokenId to time staked and owner's address
mapping(uint256 => StakedToken) public stakes;
// Address to number of tokens they have staked
mapping(address => uint256) public _userStakes;
// Last update for claimed chronos
mapping(address => uint256) public lastUpdated;
// Add store of current claimable chronos
mapping(address => uint256) public _chronosReward;
// Store of BitMap representing token statuses
mapping(uint256 => uint256) public _status;
// Store of timestamp for token lock-in expiry.
mapping(uint256 => uint256) _lockIn;
uint256 public SHARED_SUMMON_REWARD = 150 ether; // 150 CHRONOS
uint256 public constant SINGLE_SUMMON_COST = 750 ether; // 750 CHRONOS
uint8 private constant SUMMON_BIT = 1;
address private constant DEAD_ADDRESS = address(0xdead);
uint256 public LOCK_IN = 0;
bool grantChronos = true;
uint256 private MAX_GEN_COUNT;
function initialize(
IAdventurer _adventurerContract,
IChronos _chronosContract,
address _adminAddress
) external payable initializer {
if (
(_adventurerContract == IAdventurer(address(0))) ||
(_chronosContract == IChronos(address(0))) ||
(_adminAddress == address(0))
) revert CannotBeZeroAddress();
_grantRole(ADMIN_ROLE, _adminAddress);
chronosContract = _chronosContract;
adventurerContract = _adventurerContract;
MAX_GEN_COUNT = adventurerContract.maxGenCount();
}
// VIEW FUNCTIONS
// Considering an individual array of tokens staked per user/status isn't stored,
// when we want to access this information externally, we are forced to use these
// extremely gas expensive view functions which are made free by them being simply
// calculated by the RPC instead of being an actual gas-ful transaction.
function viewStakes(address _address)
external
view
returns (uint256[] memory)
{
uint256[] memory _tokens = new uint256[](7500);
uint256 tookCount = 0;
for (uint64 i = 0; i < 7500; i++) {
if (stakes[i].user == _address) {
_tokens[tookCount] = i;
tookCount++;
}
}
uint256[] memory trimmedResult = new uint256[](tookCount);
for (uint256 j = 0; j < trimmedResult.length; j++) {
trimmedResult[j] = _tokens[j];
}
return trimmedResult;
}
function viewStakesByStatus(uint8[] memory status)
public
view
returns (uint256[] memory)
{
uint256[] memory _tokens = new uint256[](7500);
uint256 bitmap = BitMap.setBits(0, status);
uint256 tookCount = 0;
for (uint64 i = 0; i < 7500; i++) {
if (_status[i] & bitmap == bitmap) {
_tokens[tookCount] = i;
tookCount++;
}
}
uint256[] memory trimmedResult = new uint256[](tookCount);
for (uint256 j = 0; j < trimmedResult.length; j++) {
trimmedResult[j] = _tokens[j];
}
return trimmedResult;
}
function viewSharedSummoners() public view returns (uint256[] memory) {
uint256[] memory _tokens = new uint256[](MAX_GEN_COUNT);
uint256 tookCount = 0;
for (uint64 i = 0; i <= MAX_GEN_COUNT; i++) {
if (BitMap.checkBit(_status[i], SUMMON_BIT)) {
_tokens[tookCount] = i;
tookCount++;
}
}
uint256[] memory trimmedResult = new uint256[](tookCount);
for (uint256 j = 0; j < trimmedResult.length; j++) {
trimmedResult[j] = _tokens[j];
}
return trimmedResult;
}
function getAccruedChronos(address _address)
public
view
returns (uint256 amount)
{
amount =
(_userStakes[_address] *
5 ether *
(block.timestamp - lastUpdated[_address])) /
86400;
}
function updateRewardAndTimestamp(address _address) internal {
_chronosReward[_address] += getAccruedChronos(_address);
lastUpdated[_address] = block.timestamp;
}
function getSummonCost(bool _shared) public view returns (uint256 cost) {
cost = SINGLE_SUMMON_COST + (_shared ? SHARED_SUMMON_REWARD : 0);
}
function claimChronos() public {
uint256 unclaimed = chronosContract.getTotalUnclaimed(msg.sender);
uint256 accrued = unclaimed;
updateRewardAndTimestamp(msg.sender);
if (grantChronos == true) {
accrued += _chronosReward[msg.sender];
_chronosReward[msg.sender] = 0;
}
chronosContract.burnUnclaimed(msg.sender, unclaimed);
chronosContract.grantChronos(msg.sender, accrued);
}
function _stake(uint256 token) internal {
stakes[token] = StakedToken(
msg.sender,
uint64(block.timestamp),
uint64(_userStakes[msg.sender]) + 1
);
_userStakes[msg.sender] += 1;
emit StartStake(msg.sender, token);
adventurerContract.safeTransferFrom(
msg.sender,
address(this),
uint256(token)
);
}
function stake(uint256 token) public override {
updateRewardAndTimestamp(msg.sender);
_stake(token);
}
function groupStake(uint256[] memory tokens) external override {
updateRewardAndTimestamp(msg.sender);
for (uint64 i = 0; i < tokens.length; ++i) {
_stake(tokens[i]);
}
}
function _unstake(uint256 token, uint256 stakeLength) private {
emit Unstake(msg.sender, token, stakeLength > 90 days, stakeLength);
delete stakes[token];
delete _status[token];
_userStakes[msg.sender] -= 1;
adventurerContract.safeTransferFrom(
address(this),
msg.sender,
uint256(token)
);
}
function unstake(uint256 token) public override {
if (stakes[token].user != msg.sender) revert UserNotStaker();
if (block.timestamp < _lockIn[token]) revert TokenLocked();
uint64 stakeLength = uint64(block.timestamp) - stakes[token].timeStaked;
if (stakeLength < LOCK_IN) revert TokenLocked();
updateRewardAndTimestamp(msg.sender);
_unstake(token, stakeLength);
}
function groupUnstake(uint256[] memory tokens) external override {
updateRewardAndTimestamp(msg.sender);
for (uint256 i = 0; i < tokens.length; ++i) {
if (stakes[tokens[i]].user != msg.sender) revert UserNotStaker();
if (block.timestamp < _lockIn[tokens[i]]) revert TokenLocked();
uint64 stakeLength = uint64(block.timestamp) -
stakes[tokens[i]].timeStaked;
if (stakeLength < LOCK_IN) revert TokenLocked();
_unstake(tokens[i], stakeLength);
}
}
function burnToken(uint256 token) public onlyRole(BURNER_ROLE) {
if (stakes[token].user == address(0)) revert TokenNotStaked();
emit Burn(stakes[token].user, token);
delete stakes[token];
adventurerContract.safeTransferFrom(address(this), DEAD_ADDRESS, token);
}
function batchBurnTokens(uint256[] memory tokens)
external
onlyRole(BURNER_ROLE)
{
for (uint256 i = 0; i < tokens.length; ++i) {
burnToken(tokens[i]);
}
}
function lockToken(uint256 token, uint256 period)
public
onlyRole(LOCK_IN_ROLE)
{
if (stakes[token].user == address(0)) revert TokenNotStaked();
_lockIn[token] = block.timestamp + period;
}
function groupLockTokens(uint256[] memory tokens, uint256 period)
external
onlyRole(LOCK_IN_ROLE)
{
for (uint256 i = 0; i < tokens.length; ++i) {
lockToken(tokens[i], period);
}
}
function _summon(
uint256 _token1,
uint256 _token2,
uint8 option,
bool shared,
bool swapped
) private {
if (option > uint8(type(SummonOption).max))
revert InvalidSummonOption();
if (
(SummonOption(option) == SummonOption.HoldingUnclaimed) &&
(getAccruedChronos(msg.sender) + _chronosReward[msg.sender] <
getSummonCost(shared))
) revert InsufficientChronos();
uint256 cost = getSummonCost(shared);
SummonOption selectedOption = SummonOption(option);
uint256 advId = MAX_GEN_COUNT + adventurerContract.gen2Count() + 1;
if (shared) {
_chronosReward[stakes[_token2].user] += SHARED_SUMMON_REWARD;
}
uint256 token1;
uint256 token2;
(token1, token2) = swapped ? (_token2, _token1) : (_token1, _token2);
if (selectedOption == SummonOption.HoldingUnclaimed) {
updateRewardAndTimestamp(msg.sender);
_chronosReward[msg.sender] -= cost;
chronosContract.grantChronos(address(this), cost);
adventurerContract.summon(token1, token2, true);
} else if (selectedOption == SummonOption.NFTUnclaimed) {
chronosContract.burnUnclaimed(msg.sender, cost);
chronosContract.grantChronos(address(this), cost);
adventurerContract.summon(token1, token2, true);
} else {
chronosContract.safeTransferFrom(
msg.sender,
address(this),
SHARED_SUMMON_REWARD + SINGLE_SUMMON_COST
);
adventurerContract.summon(token1, token2, true);
}
adventurerContract.safeTransferFrom(address(this), msg.sender, advId);
}
function sharedSummon(
uint256 token,
uint256 summoner,
uint8 option,
bool swapped
) external {
if (stakes[token].user != msg.sender) revert UserNotStaker();
if (!(BitMap.checkBit(_status[summoner], SUMMON_BIT)))
revert TokenCannotBeUsedToSummon();
_summon(token, summoner, option, true, swapped);
}
function summon(
uint256 token1,
uint256 token2,
uint8 option
) external {
if (
stakes[token1].user != msg.sender ||
stakes[token2].user != msg.sender
) revert UserNotStaker();
_summon(token1, token2, option, false, false);
}
function setSummoning(uint256 token, bool status) public {
if (stakes[token].user != msg.sender) revert UserNotStaker();
if (status && token > MAX_GEN_COUNT) revert TokenCannotBeUsedToSummon();
_status[token] = BitMap.setBit(_status[token], SUMMON_BIT, status);
}
function batchSetSummoning(uint256[] memory tokens, bool status) external {
for (uint256 i = 0; i < tokens.length; ++i) {
setSummoning(tokens[i], status);
}
}
function setStatus(uint256 token, uint8[] memory bits) public {
if (stakes[token].user != msg.sender) revert UserNotStaker();
_status[token] = BitMap.setBits(0, bits);
}
function batchSetStatus(uint256[] memory tokens, uint8[] memory bits)
external
{
uint256 bitmap = BitMap.setBits(0, bits);
for (uint256 i = 0; i < tokens.length; ++i) {
if (stakes[tokens[i]].user != msg.sender) revert UserNotStaker();
_status[tokens[i]] = bitmap;
}
}
function setGrantChronos(bool _grant) external onlyRole(ADMIN_ROLE) {
grantChronos = _grant;
}
function setLockIn(uint256 lockin) external onlyRole(ADMIN_ROLE) {
LOCK_IN = lockin;
}
function updateSummonReward(uint256 amount) external onlyRole(ADMIN_ROLE) {
SHARED_SUMMON_REWARD = amount;
}
function addLockInRole(address user) external onlyRole(ADMIN_ROLE) {
if (user == address(0)) revert CannotBeZeroAddress();
_grantRole(LOCK_IN_ROLE, user);
}
function addBurnerRole(address user) external onlyRole(ADMIN_ROLE) {
if (user == address(0)) revert CannotBeZeroAddress();
_grantRole(BURNER_ROLE, user);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
interface IAdventurer is IERC721 {
function summon(
uint256 parent1,
uint256 parent2,
bool withdrawn
) external;
function gen2Count() external returns (uint256 gen2count);
function maxGenCount() external returns (uint256 maxGenCount);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/**
* This interface is for the CHRONOS ERC20 Utility Token for PxQuest
* As the Chronos contract was deployed before Labrys was employed on the project,
* this is a retrospectively created interface so that Chronos functionality
* can be user elsewhere.
*/
interface IChronos is IERC20 {
/// @notice Update current reward status
function updateReward(address from, address to) external;
/// @notice Withdraw/Claim chronos avaialable to the sender
function withdrawChronos() external;
/// @notice Grant chronos to a user
/// @param _address the address to grant chronos to
/// @param _amount the amount of chronos to grant
function grantChronos(address _address, uint256 _amount) external;
/// @notice Burn unclaimed chronos tokens
/// @param user the address to burn unclaimed tokens from
/// @param amount the amount of unclaimed tokens to burn
function burnUnclaimed(address user, uint256 amount) external;
/// @notice Burn chronos tokens
/// @param user address to burn tokens from
/// @param amount the amount of tokens to burn
function burn(address user, uint256 amount) external;
/// @notice get the total amount of unclaimed chronos available to a user
/// @param user address of the user to check for
function getTotalUnclaimed(address user)
external
view
returns (uint256 unclaimed);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol";
interface IAdventurerHolding is IERC721ReceiverUpgradeable {
struct StakedToken {
address user;
uint64 timeStaked;
uint64 index;
}
enum SummonOption {
Claimed,
NFTUnclaimed,
HoldingUnclaimed
}
/// ERRORS
/// @notice reverts when a user tries to do an operation on a token they didn't stake
error UserNotStaker();
/// @notice reverts when an operation is attempted on a token that is not in the smart contract
error TokenNotStaked();
/// @notice reverts when a token is attempted to be withdrawn before its lock in period is over
error TokenLocked();
/// @notice reverts when a user attempts a summon option that doesn't exist
error InvalidSummonOption();
/// @notice reverts when a user attempts an operation which requires more chronos than they possess
error InsufficientChronos();
/// @notice reverts when a zero address is passed in as a potential admin or smart contract location
error CannotBeZeroAddress();
/// @notice reverts when a token cannot be used to summon, either because it's Gen 2 or not made available
error TokenCannotBeUsedToSummon();
/// EVENTS
/// @notice Emits when a user stakes their NFT.
/// @param owner the wallet address of the owner of the NFT being staked.
/// @param token the tokenId of the Adventurer NFT being staked.
event StartStake(address indexed owner, uint256 token);
/// @notice Emits when a user unstakes their NFT.
/// @param owner the wallet address of the owner of the NFT being unstaked.
/// @param token the tokenId of the Adventurer NFT being unstaked.
/// @param success whether or not the user staked the NFT for more than 90 days.
/// @param duration the duration the NFT was staked for.
event Unstake(
address indexed owner,
uint256 token,
bool success,
uint256 duration
);
/// @notice Emits when a user burns an NFT.
/// @param owner the wallet address of the owner of the NFT being burned.
/// @param token the tokenId of the NFT being burned
event Burn(address indexed owner, uint256 token);
/// VIEW FUNCTIONS
/// @notice returns a list of currently staked tokens by a given address
/// @param _address the address whose tokens are being queried
/// @return the list of tokenIds as uint256[] memory
/// @dev because stakes are not stored per user, we are forced to iterate through all possible tokenIds
function viewStakes(address _address)
external
view
returns (uint256[] memory);
/// @notice returns a list of currently staked tokens by a given list of active status bits
/// @param status the list of bits that are being queried for
/// @return the list of tokenIds as uint256[] memory
function viewStakesByStatus(uint8[] memory status)
external
view
returns (uint256[] memory);
/// @notice returns a list of currently available shared summoners
/// @return the list of tokenIds as uint256[] memory
/// @dev because someone could hardcode a non-summonable token to be available for summoning, this function filters only by tokenIds that can be used to summon in order to prevent users wasting gas attempting summon with an non-summonable token.
function viewSharedSummoners() external view returns (uint256[] memory);
/// @notice calculates the amount of Chronos accrued by a given user through staked NFTs
/// @param _address the user whose accrued Chronos is being calculated
/// @return amount of chronos accrued by user
function getAccruedChronos(address _address)
external
view
returns (uint256);
/// @notice calculates the cost of summoning depending on whether its a shared summon
/// @param _shared whether the summon is a shared summon
/// @return amount of chronos it will cost to summon
function getSummonCost(bool _shared) external view returns (uint256);
/// FUNCTIONS
/// @notice Stakes a user's NFT
/// @param token the tokenId of the NFT to be staked
function stake(uint256 token) external;
/// @notice Stakes serveral of a user's NFTs
/// @param tokens the tokenId of the NFT to be staked
function groupStake(uint256[] memory tokens) external;
/// @notice Retrieves a user's NFT from the staking contract
/// @param token the tokenId of the staked NFT
function unstake(uint256 token) external;
/// @notice Unstakes serveral of a user's NFTs
/// @param token the tokenId of the NFT to be staked
function groupUnstake(uint256[] memory token) external;
/// @notice Sets whether an NFT is available for Summoning
/// @param token the tokenId that's being set
/// @param status whether the token is available for summoning
function setSummoning(uint256 token, bool status) external;
/// @notice Sets whether several NFTS are available for Summoning
/// @param tokens a list of tokenId's that are being set
/// @param status whether the tokens will be availabe for summoning
function batchSetSummoning(uint256[] memory tokens, bool status) external;
/// @notice Sets several status bits at once
/// @param token the tokenId being set
/// @param bits which bits will be set
function setStatus(uint256 token, uint8[] memory bits) external;
/// @notice Sets several status bits of several NFTs at once
/// @param tokens the tokenIds being set
/// @param bits which bits will be set
function batchSetStatus(uint256[] memory tokens, uint8[] memory bits)
external;
/// @notice Uses a token available for summoning to summon a new adventurer
/// @param token the user's token that they want to use for summoning
/// @param summoner the token they wish to summon with
/// @param option where to use the chronos from
/// @param swapped whether the summoner should instead come first in the summon call
function sharedSummon(
uint256 token,
uint256 summoner,
uint8 option,
bool swapped
) external;
/// @notice Uses a token available for summoning to summon a new adventurer
/// @param token1 the user's first token that they want to use for summoning
/// @param token2 the user's second token that they want to use for summoning
/// @param option where to use the chronos from
function summon(
uint256 token1,
uint256 token2,
uint8 option
) external;
/// @notice Prevents a token being unstaked until the period has passed
/// @param token the tokenId being locked in
/// @param period the period that the token is locked in
function lockToken(uint256 token, uint256 period) external;
/// @notice Sends a staked token to the zero address
/// @param token the tokenId that's being burned
function burnToken(uint256 token) external;
/// @notice Sends several staked tokens to the zero address
/// @param tokens the tokens that will be sent to the zero address
function batchBurnTokens(uint256[] memory tokens) external;
/// @notice Prevents multiple tokens being unstaked until the period has passed
/// @param tokens the tokenIds being locked in
/// @param period the period that the tokens are locked in
function groupLockTokens(uint256[] memory tokens, uint256 period) external;
/// @notice Updates whether or not Chronos is granted on unstake
/// @param _grant the new status of Chronos granting
function setGrantChronos(bool _grant) external;
/// @notice Sets the Lock-In time for all tokens after stake
/// @param lockin the
function setLockIn(uint256 lockin) external;
/// @notice Claims all chronos due to msg.sender
function claimChronos() external;
/// @notice Gives an address the ability to lock in tokens for a set duration
/// @param user the address that is being given the permission
function addLockInRole(address user) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
interface IAdventurerStaking is IERC721Receiver {
struct StakedToken {
address user;
uint64 timeStaked;
}
/// @notice Emits when a user stakes their NFT.
/// @param owner the wallet address of the owner of the NFT being staked.
/// @param tokenId the tokenId of the Adventurer NFT being staked.
event StartStake(address indexed owner, uint64 tokenId);
/// @notice Emits when a user unstakes their NFT.
/// @param owner the wallet address of the owner of the NFT being unstaked.
/// @param tokenId the tokenId of the Adventurer NFT being unstaked.
/// @param success whether or not the user staked the NFT for more than 90 days.
/// @param duration the duration the NFT was staked for.
event Unstake(
address indexed owner,
uint64 tokenId,
bool success,
uint64 duration
);
/// @notice Stakes a user's NFT
/// @param tokenId the tokenId of the NFT to be staked
function stake(uint64 tokenId) external;
/// @notice Stakes serveral of a user's NFTs
/// @param tokenIds the tokenId of the NFT to be staked
function groupStake(uint64[] memory tokenIds) external;
/// @notice Retrieves a user's NFT from the staking contract
/// @param tokenId the tokenId of the staked NFT
function unstake(uint64 tokenId) external;
/// @notice Unstakes serveral of a user's NFTs
/// @param tokenIds the tokenId of the NFT to be staked
function groupUnstake(uint64[] memory tokenIds) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
/**
* @dev Library for using a uint256 as a bitmap, effectively an extremely gas efficient uint8 to bool mapping.
*/
library BitMap {
/// @notice Either sets a bit in a bitmap to on or off
/// @param bitmap the bitmap being set
/// @param bit which bit is being set
/// @param status whether the bit is being set to on or off
function setBit(
uint256 bitmap,
uint8 bit,
bool status
) internal pure returns (uint256 updatedBitmap) {
if (status) {
return bitmap | (1 << bit);
} else {
return bitmap & (~(1 << bit));
}
}
/// @notice Sets several bits at once
/// @param bitmap the bitmap being set
/// @param bits which bets are being set
function setBits(
uint256 bitmap,
uint8[] memory bits
) internal pure returns (uint256 updatedBitmap) {
uint256 _bitmap = bitmap;
for (uint256 i = 0; i < bits.length; i++) {
_bitmap = setBit(_bitmap, bits[i], true);
}
updatedBitmap = _bitmap;
}
/// @notice Checks whether a bit in a bitmap is on or off
/// @param bitmap the bitmap being checked
/// @param bit which bit is being checked
function checkBit(uint256 bitmap, uint8 bit)
internal
pure
returns (bool status)
{
return (bitmap & (1 << bit)) != 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
* initialization step. This is essential to configure modules that are added through upgrades and that require
* initialization.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
function __AccessControl_init() internal onlyInitializing {
}
function __AccessControl_init_unchained() internal onlyInitializing {
}
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
StringsUpgradeable.toHexString(uint160(account), 20),
" is missing role ",
StringsUpgradeable.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* May emit a {RoleGranted} event.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)
pragma solidity ^0.8.0;
import "../IERC721ReceiverUpgradeable.sol";
import "../../../proxy/utils/Initializable.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 ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable {
function __ERC721Holder_init() internal onlyInitializing {
}
function __ERC721Holder_init_unchained() internal onlyInitializing {
}
/**
* @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;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.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));
}
}
/**
* @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 v4.4.1 (token/ERC721/IERC721.sol)
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
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
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
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)
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
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
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 IERC721ReceiverUpgradeable {
/**
* @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 `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)
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
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(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) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason 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 {
// 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 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
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 IERC165Upgradeable {
/**
* @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
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @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
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 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 functionCall(target, data, "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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(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) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(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) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason 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 {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}{
"optimizer": {
"enabled": true,
"runs": 1000
},
"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":[],"name":"CannotBeZeroAddress","type":"error"},{"inputs":[],"name":"InsufficientChronos","type":"error"},{"inputs":[],"name":"InvalidSummonOption","type":"error"},{"inputs":[],"name":"TokenCannotBeUsedToSummon","type":"error"},{"inputs":[],"name":"TokenLocked","type":"error"},{"inputs":[],"name":"TokenNotStaked","type":"error"},{"inputs":[],"name":"UserNotStaker","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"token","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"token","type":"uint256"}],"name":"StartStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"token","type":"uint256"},{"indexed":false,"internalType":"bool","name":"success","type":"bool"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"}],"name":"Unstake","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BURNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LOCK_IN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LOCK_IN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SHARED_SUMMON_REWARD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SINGLE_SUMMON_COST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_chronosReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_status","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_userStakes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"addBurnerRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"addLockInRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"adventurerContract","outputs":[{"internalType":"contract IAdventurer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokens","type":"uint256[]"}],"name":"batchBurnTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokens","type":"uint256[]"},{"internalType":"uint8[]","name":"bits","type":"uint8[]"}],"name":"batchSetStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokens","type":"uint256[]"},{"internalType":"bool","name":"status","type":"bool"}],"name":"batchSetSummoning","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"token","type":"uint256"}],"name":"burnToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"chronosContract","outputs":[{"internalType":"contract IChronos","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimChronos","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getAccruedChronos","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_shared","type":"bool"}],"name":"getSummonCost","outputs":[{"internalType":"uint256","name":"cost","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokens","type":"uint256[]"},{"internalType":"uint256","name":"period","type":"uint256"}],"name":"groupLockTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokens","type":"uint256[]"}],"name":"groupStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokens","type":"uint256[]"}],"name":"groupUnstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IAdventurer","name":"_adventurerContract","type":"address"},{"internalType":"contract IChronos","name":"_chronosContract","type":"address"},{"internalType":"address","name":"_adminAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastUpdated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"token","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"}],"name":"lockToken","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_grant","type":"bool"}],"name":"setGrantChronos","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockin","type":"uint256"}],"name":"setLockIn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"token","type":"uint256"},{"internalType":"uint8[]","name":"bits","type":"uint8[]"}],"name":"setStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"token","type":"uint256"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setSummoning","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"token","type":"uint256"},{"internalType":"uint256","name":"summoner","type":"uint256"},{"internalType":"uint8","name":"option","type":"uint8"},{"internalType":"bool","name":"swapped","type":"bool"}],"name":"sharedSummon","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"token","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakes","outputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint64","name":"timeStaked","type":"uint64"},{"internalType":"uint64","name":"index","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"token1","type":"uint256"},{"internalType":"uint256","name":"token2","type":"uint256"},{"internalType":"uint8","name":"option","type":"uint8"}],"name":"summon","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"token","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"updateSummonReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"viewSharedSummoners","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"viewStakes","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8[]","name":"status","type":"uint8[]"}],"name":"viewStakesByStatus","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"}]Contract Creation Code
6080604052680821ab0d441498000060d155600060d25560d3805460ff1916600117905534801561002f57600080fd5b506134b98061003f6000396000f3fe6080604052600436106103085760003560e01c806399c2543c1161019a578063c81b77ae116100e1578063e59c36e71161008a578063ec982a1a11610064578063ec982a1a146109e4578063ed5a21ae146109f9578063fe706fa114610a1957600080fd5b8063e59c36e714610963578063eb2a496314610990578063ebb464cc146109c457600080fd5b8063d3e7b275116100bb578063d3e7b2751461089f578063d547741f146108bf578063d5a44f86146108df57600080fd5b8063c81b77ae14610832578063d151bfcd14610852578063d3e2d8691461087f57600080fd5b8063a694fc3a11610143578063b435534d1161011d578063b435534d146107df578063baa34110146107ff578063c0c53b8b1461081f57600080fd5b8063a694fc3a14610789578063b12f9e7f146107a9578063b3de9a07146107c957600080fd5b8063a217fddf11610174578063a217fddf14610727578063a401be491461073c578063a43c992c1461075c57600080fd5b806399c2543c146106d25780639eeb99a1146106e7578063a17b8ffb1461070757600080fd5b8063496e2ea01161025e57806378d76dce116102075780637eb646f8116101e15780637eb646f81461063457806388dfa0451461065457806391d148541461068c57600080fd5b806378d76dce146105de5780637b47ec1a146105f45780637caa23db1461061457600080fd5b80635fef195c116102385780635fef195c1461056a57806375b238fc1461058a57806375bcf8c3146105be57600080fd5b8063496e2ea01461050a5780634c30e9d11461052a578063547dfa491461054a57600080fd5b8063282c51f3116102c057806334b359f11161029a57806334b359f1146104ad57806336568abe146104ca5780634671b3fa146104ea57600080fd5b8063282c51f3146104375780632e17de781461046b5780632f2ff15d1461048d57600080fd5b80630a6f93e6116102f15780630a6f93e61461037d578063150b7a02146103aa578063248a9ca31461040757600080fd5b806301ffc9a71461030d578063085b68cd14610342575b600080fd5b34801561031957600080fd5b5061032d610328366004612c24565b610a39565b60405190151581526020015b60405180910390f35b34801561034e57600080fd5b5061036f61035d366004612c63565b60ce6020526000908152604090205481565b604051908152602001610339565b34801561038957600080fd5b5061036f610398366004612c63565b60cd6020526000908152604090205481565b3480156103b657600080fd5b506103ee6103c5366004612cc7565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b6040516001600160e01b03199091168152602001610339565b34801561041357600080fd5b5061036f610422366004612d8b565b60009081526065602052604090206001015490565b34801561044357600080fd5b5061036f7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b34801561047757600080fd5b5061048b610486366004612d8b565b610aa2565b005b34801561049957600080fd5b5061048b6104a8366004612da4565b610b82565b3480156104b957600080fd5b5061036f6828a857425466f8000081565b3480156104d657600080fd5b5061048b6104e5366004612da4565b610bac565b3480156104f657600080fd5b5061048b610505366004612e63565b610c39565b34801561051657600080fd5b5061036f610525366004612eb6565b610ca8565b34801561053657600080fd5b5061048b610545366004612ed3565b610ccd565b34801561055657600080fd5b5061048b610565366004612f1e565b610d35565b34801561057657600080fd5b5061048b610585366004612ed3565b610d9e565b34801561059657600080fd5b5061036f7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b3480156105ca57600080fd5b5061048b6105d9366004612ed3565b610df9565b3480156105ea57600080fd5b5061036f60d25481565b34801561060057600080fd5b5061048b61060f366004612d8b565b610f7b565b34801561062057600080fd5b5061048b61062f366004612fb5565b6110c9565b34801561064057600080fd5b5061048b61064f366004612ffc565b611121565b34801561066057600080fd5b5060ca54610674906001600160a01b031681565b6040516001600160a01b039091168152602001610339565b34801561069857600080fd5b5061032d6106a7366004612da4565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156106de57600080fd5b5061048b611160565b3480156106f357600080fd5b5061048b610702366004613043565b6112ca565b34801561071357600080fd5b5060c954610674906001600160a01b031681565b34801561073357600080fd5b5061036f600081565b34801561074857600080fd5b5061048b610757366004613068565b611348565b34801561076857600080fd5b5061077c610777366004612c63565b611407565b60405161033991906130c2565b34801561079557600080fd5b5061048b6107a4366004612d8b565b611566565b3480156107b557600080fd5b5061048b6107c4366004612d8b565b61157b565b3480156107d557600080fd5b5061036f60d15481565b3480156107eb57600080fd5b5061048b6107fa366004612c63565b6115ab565b34801561080b57600080fd5b5061048b61081a366004613106565b611626565b61048b61082d366004613128565b6116a6565b34801561083e57600080fd5b5061048b61084d366004612eb6565b6118fa565b34801561085e57600080fd5b5061036f61086d366004612c63565b60cc6020526000908152604090205481565b34801561088b57600080fd5b5061048b61089a366004612d8b565b611938565b3480156108ab57600080fd5b5061048b6108ba366004612c63565b611968565b3480156108cb57600080fd5b5061048b6108da366004612da4565b6119e3565b3480156108eb57600080fd5b506109336108fa366004612d8b565b60cb60205260009081526040902080546001909101546001600160a01b0382169167ffffffffffffffff600160a01b9091048116911683565b604080516001600160a01b03909416845267ffffffffffffffff9283166020850152911690820152606001610339565b34801561096f57600080fd5b5061036f61097e366004612d8b565b60cf6020526000908152604090205481565b34801561099c57600080fd5b5061036f7fbfb23ee41048b42a30e2ec7a73039c14412d38f234157009730dd77401a3782881565b3480156109d057600080fd5b5061048b6109df366004613173565b611a08565b3480156109f057600080fd5b5061077c611a7c565b348015610a0557600080fd5b5061036f610a14366004612c63565b611bed565b348015610a2557600080fd5b5061077c610a343660046131bb565b611c54565b60006001600160e01b031982167f7965db0b000000000000000000000000000000000000000000000000000000001480610a9c57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b600081815260cb60205260409020546001600160a01b03163314610ad957604051632093d68b60e01b815260040160405180910390fd5b600081815260d06020526040902054421015610b0857604051635a8181f760e01b815260040160405180910390fd5b600081815260cb6020526040812054610b3290600160a01b900467ffffffffffffffff1642613206565b905060d2548167ffffffffffffffff161015610b6157604051635a8181f760e01b815260040160405180910390fd5b610b6a33611db9565b610b7e828267ffffffffffffffff16611e0b565b5050565b600082815260656020526040902060010154610b9d81611eec565b610ba78383611ef6565b505050565b6001600160a01b0381163314610c2f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b610b7e8282611f98565b7fbfb23ee41048b42a30e2ec7a73039c14412d38f234157009730dd77401a37828610c6381611eec565b60005b8351811015610ca257610c92848281518110610c8457610c8461322f565b602002602001015184611626565b610c9b81613245565b9050610c66565b50505050565b600081610cb6576000610cba565b60d1545b610a9c906828a857425466f80000613260565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a848610cf781611eec565b60005b8251811015610ba757610d25838281518110610d1857610d1861322f565b6020026020010151610f7b565b610d2e81613245565b9050610cfa565b600083815260cb60205260409020546001600160a01b031633141580610d725750600082815260cb60205260409020546001600160a01b03163314155b15610d9057604051632093d68b60e01b815260040160405180910390fd5b610ba783838360008061201b565b610da733611db9565b60005b81518167ffffffffffffffff161015610b7e57610de9828267ffffffffffffffff1681518110610ddc57610ddc61322f565b60200260200101516124e9565b610df281613278565b9050610daa565b610e0233611db9565b60005b8151811015610b7e57336001600160a01b031660cb6000848481518110610e2e57610e2e61322f565b6020908102919091018101518252810191909152604001600020546001600160a01b031614610e7057604051632093d68b60e01b815260040160405180910390fd5b60d06000838381518110610e8657610e8661322f565b6020026020010151815260200190815260200160002054421015610ebd57604051635a8181f760e01b815260040160405180910390fd5b600060cb6000848481518110610ed557610ed561322f565b6020026020010151815260200190815260200160002060000160149054906101000a900467ffffffffffffffff1642610f0e9190613206565b905060d2548167ffffffffffffffff161015610f3d57604051635a8181f760e01b815260040160405180910390fd5b610f6a838381518110610f5257610f5261322f565b60200260200101518267ffffffffffffffff16611e0b565b50610f7481613245565b9050610e05565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a848610fa581611eec565b600082815260cb60205260409020546001600160a01b0316610fda57604051630a49bbc360e21b815260040160405180910390fd5b600082815260cb60209081526040918290205491518481526001600160a01b03909216917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5910160405180910390a2600082815260cb60205260409081902080546001600160e01b0319168155600101805467ffffffffffffffff1916905560c9549051632142170760e11b815230600482015261dead6024820152604481018490526001600160a01b03909116906342842e0e906064015b600060405180830381600087803b1580156110ad57600080fd5b505af11580156110c1573d6000803e3d6000fd5b505050505050565b600082815260cb60205260409020546001600160a01b0316331461110057604051632093d68b60e01b815260040160405180910390fd5b61110b600082612656565b600092835260cf60205260409092209190915550565b60005b8251811015610ba7576111508382815181106111425761114261322f565b6020026020010151836112ca565b61115981613245565b9050611124565b60ca546040517f8c85c3c80000000000000000000000000000000000000000000000000000000081523360048201526000916001600160a01b031690638c85c3c890602401602060405180830381865afa1580156111c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e691906132a0565b9050806111f233611db9565b60d35460ff1615156001141561122f5733600090815260ce602052604090205461121c9082613260565b33600090815260ce602052604081205590505b60ca54604051631a60d47560e21b8152336004820152602481018490526001600160a01b039091169063698351d490604401600060405180830381600087803b15801561127b57600080fd5b505af115801561128f573d6000803e3d6000fd5b505060ca54604051632f57aef160e21b8152336004820152602481018590526001600160a01b03909116925063bd5ebbc49150604401611093565b600082815260cb60205260409020546001600160a01b0316331461130157604051632093d68b60e01b815260040160405180910390fd5b80801561130f575060d45482115b1561132d57604051634195122560e11b815260040160405180910390fd5b600082815260cf602052604090205461110b9060018361269d565b6000611355600083612656565b905060005b8351811015610ca257336001600160a01b031660cb60008684815181106113835761138361322f565b6020908102919091018101518252810191909152604001600020546001600160a01b0316146113c557604051632093d68b60e01b815260040160405180910390fd5b8160cf60008684815181106113dc576113dc61322f565b60200260200101518152602001908152602001600020819055508061140090613245565b905061135a565b60408051611d4c8082526203a9a0820190925260609160009190602082016203a980803683370190505090506000805b611d4c8167ffffffffffffffff1610156114c05767ffffffffffffffff8116600090815260cb60205260409020546001600160a01b03868116911614156114ae578067ffffffffffffffff168383815181106114955761149561322f565b6020908102919091010152816114aa81613245565b9250505b806114b881613278565b915050611437565b5060008167ffffffffffffffff8111156114dc576114dc612c80565b604051908082528060200260200182016040528015611505578160200160208202803683370190505b50905060005b815181101561155d578381815181106115265761152661322f565b60200260200101518282815181106115405761154061322f565b60209081029190910101528061155581613245565b91505061150b565b50949350505050565b61156f33611db9565b611578816124e9565b50565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756115a581611eec565b5060d155565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756115d581611eec565b6001600160a01b0382166115fc57604051631e7d738760e21b815260040160405180910390fd5b610b7e7fbfb23ee41048b42a30e2ec7a73039c14412d38f234157009730dd77401a3782883611ef6565b7fbfb23ee41048b42a30e2ec7a73039c14412d38f234157009730dd77401a3782861165081611eec565b600083815260cb60205260409020546001600160a01b031661168557604051630a49bbc360e21b815260040160405180910390fd5b61168f8242613260565b600093845260d06020526040909320929092555050565b600054610100900460ff16158080156116c65750600054600160ff909116105b806116e05750303b1580156116e0575060005460ff166001145b6117525760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610c26565b6000805460ff191660011790558015611775576000805461ff0019166101001790555b6001600160a01b038416158061179257506001600160a01b038316155b806117a457506001600160a01b038216155b156117c257604051631e7d738760e21b815260040160405180910390fd5b6117ec7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177583611ef6565b60ca80546001600160a01b038086167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161790925560c980549287169290911682179055604080517f3299c1200000000000000000000000000000000000000000000000000000000081529051633299c1209160048082019260209290919082900301816000875af1158015611888573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ac91906132a0565b60d4558015610ca2576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561192481611eec565b5060d3805460ff1916911515919091179055565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561196281611eec565b5060d255565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561199281611eec565b6001600160a01b0382166119b957604051631e7d738760e21b815260040160405180910390fd5b610b7e7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84883611ef6565b6000828152606560205260409020600101546119fe81611eec565b610ba78383611f98565b600084815260cb60205260409020546001600160a01b03163314611a3f57604051632093d68b60e01b815260040160405180910390fd5b600083815260cf6020526040902054600216611a6e57604051634195122560e11b815260040160405180910390fd5b610ca284848460018561201b565b6060600060d45467ffffffffffffffff811115611a9b57611a9b612c80565b604051908082528060200260200182016040528015611ac4578160200160208202803683370190505b5090506000805b60d4548167ffffffffffffffff1611611b485767ffffffffffffffff8116600090815260cf602052604090205460021615611b36578067ffffffffffffffff16838381518110611b1d57611b1d61322f565b602090810291909101015281611b3281613245565b9250505b80611b4081613278565b915050611acb565b5060008167ffffffffffffffff811115611b6457611b64612c80565b604051908082528060200260200182016040528015611b8d578160200160208202803683370190505b50905060005b8151811015611be557838181518110611bae57611bae61322f565b6020026020010151828281518110611bc857611bc861322f565b602090810291909101015280611bdd81613245565b915050611b93565b509392505050565b6001600160a01b038116600090815260cd60205260408120546201518090611c1590426132b9565b6001600160a01b038416600090815260cc6020526040902054611c4090674563918244f400006132d0565b611c4a91906132d0565b610a9c91906132ef565b60408051611d4c8082526203a9a0820190925260609160009190602082016203a980803683370190505090506000611c8d600085612656565b90506000805b611d4c8167ffffffffffffffff161015611d125767ffffffffffffffff8116600090815260cf60205260409020548316831415611d00578067ffffffffffffffff16848381518110611ce757611ce761322f565b602090810291909101015281611cfc81613245565b9250505b80611d0a81613278565b915050611c93565b5060008167ffffffffffffffff811115611d2e57611d2e612c80565b604051908082528060200260200182016040528015611d57578160200160208202803683370190505b50905060005b8151811015611daf57848181518110611d7857611d7861322f565b6020026020010151828281518110611d9257611d9261322f565b602090810291909101015280611da781613245565b915050611d5d565b5095945050505050565b611dc281611bed565b6001600160a01b038216600090815260ce602052604081208054909190611dea908490613260565b90915550506001600160a01b0316600090815260cd60205260409020429055565b604080518381526276a7008311602082015290810182905233907fa121f2e6408efa6639bcf460500f4b35e060a9f75344eb93059e69b2eedc0fc69060600160405180910390a2600082815260cb6020908152604080832080546001600160e01b03191681556001908101805467ffffffffffffffff1916905560cf835281842084905533845260cc9092528220805491929091611eaa9084906132b9565b909155505060c954604051632142170760e11b8152306004820152336024820152604481018490526001600160a01b03909116906342842e0e90606401611093565b61157881336126c7565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610b7e5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611f543390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1615610b7e5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600260ff84161115612059576040517f4e17ec8200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028360ff16600281111561207057612070613311565b600281111561208157612081613311565b1480156120b8575061209282610ca8565b33600081815260ce6020526040902054906120ac90611bed565b6120b69190613260565b105b156120ef576040517fb1a6eac900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006120fa83610ca8565b905060008460ff16600281111561211357612113613311565b9050600060c960009054906101000a90046001600160a01b03166001600160a01b031663410419996040518163ffffffff1660e01b81526004016020604051808303816000875af115801561216c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219091906132a0565b60d45461219d9190613260565b6121a8906001613260565b905084156121ed5760d154600088815260cb60209081526040808320546001600160a01b0316835260ce909152812080549091906121e7908490613260565b90915550505b600080856121fc5789896121ff565b888a5b9092509050600284600281111561221857612218613311565b14156123215761222733611db9565b33600090815260ce6020526040812080548792906122469084906132b9565b909155505060ca54604051632f57aef160e21b8152306004820152602481018790526001600160a01b039091169063bd5ebbc4906044015b600060405180830381600087803b15801561229857600080fd5b505af11580156122ac573d6000803e3d6000fd5b505060c95460405163cb41ea5560e01b81526004810186905260248101859052600160448201526001600160a01b03909116925063cb41ea559150606401600060405180830381600087803b15801561230457600080fd5b505af1158015612318573d6000803e3d6000fd5b50505050612473565b600184600281111561233557612335613311565b14156123d65760ca54604051631a60d47560e21b8152336004820152602481018790526001600160a01b039091169063698351d490604401600060405180830381600087803b15801561238757600080fd5b505af115801561239b573d6000803e3d6000fd5b505060ca54604051632f57aef160e21b8152306004820152602481018990526001600160a01b03909116925063bd5ebbc4915060440161227e565b61240633306828a857425466f8000060d1546123f29190613260565b60ca546001600160a01b0316929190612747565b60c95460405163cb41ea5560e01b81526004810184905260248101839052600160448201526001600160a01b039091169063cb41ea5590606401600060405180830381600087803b15801561245a57600080fd5b505af115801561246e573d6000803e3d6000fd5b505050505b60c954604051632142170760e11b8152306004820152336024820152604481018590526001600160a01b03909116906342842e0e90606401600060405180830381600087803b1580156124c557600080fd5b505af11580156124d9573d6000803e3d6000fd5b5050505050505050505050505050565b604080516060810182523380825267ffffffffffffffff4216602080840191909152600091825260cc9052829020549091820190612528906001613327565b67ffffffffffffffff908116909152600083815260cb6020908152604080832085518154878501516001600160a01b039092166001600160e01b031990911617600160a01b91871691909102178155948101516001958601805467ffffffffffffffff1916919095161790935533825260cc905290812080549091906125af908490613260565b909155505060405181815233907f830aad06b647cbc5eda6a9d33baba4c9dbf72c81cb7a2b08f4bbf5665a749ceb9060200160405180910390a260c954604051632142170760e11b8152336004820152306024820152604481018390526001600160a01b03909116906342842e0e90606401600060405180830381600087803b15801561263b57600080fd5b505af115801561264f573d6000803e3d6000fd5b5050505050565b600082815b8351811015611be5576126898285838151811061267a5761267a61322f565b6020026020010151600161269d565b91508061269581613245565b91505061265b565b600081156126b45750600160ff83161b83176126c0565b50600160ff83161b1983165b9392505050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610b7e57612705816001600160a01b031660146127cf565b6127108360206127cf565b60405160200161272192919061337f565b60408051601f198184030181529082905262461bcd60e51b8252610c2691600401613400565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052610ca29085906129b0565b606060006127de8360026132d0565b6127e9906002613260565b67ffffffffffffffff81111561280157612801612c80565b6040519080825280601f01601f19166020018201604052801561282b576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106128625761286261322f565b60200101906001600160f81b031916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106128ad576128ad61322f565b60200101906001600160f81b031916908160001a90535060006128d18460026132d0565b6128dc906001613260565b90505b6001811115612961577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061291d5761291d61322f565b1a60f81b8282815181106129335761293361322f565b60200101906001600160f81b031916908160001a90535060049490941c9361295a81613433565b90506128df565b5083156126c05760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c26565b6000612a05826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612a959092919063ffffffff16565b805190915015610ba75780806020019051810190612a23919061344a565b610ba75760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610c26565b6060612aa48484600085612aac565b949350505050565b606082471015612b245760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610c26565b843b612b725760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c26565b600080866001600160a01b03168587604051612b8e9190613467565b60006040518083038185875af1925050503d8060008114612bcb576040519150601f19603f3d011682016040523d82523d6000602084013e612bd0565b606091505b5091509150612be0828286612beb565b979650505050505050565b60608315612bfa5750816126c0565b825115612c0a5782518084602001fd5b8160405162461bcd60e51b8152600401610c269190613400565b600060208284031215612c3657600080fd5b81356001600160e01b0319811681146126c057600080fd5b6001600160a01b038116811461157857600080fd5b600060208284031215612c7557600080fd5b81356126c081612c4e565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612cbf57612cbf612c80565b604052919050565b60008060008060808587031215612cdd57600080fd5b8435612ce881612c4e565b9350602085810135612cf981612c4e565b935060408601359250606086013567ffffffffffffffff80821115612d1d57600080fd5b818801915088601f830112612d3157600080fd5b813581811115612d4357612d43612c80565b612d55601f8201601f19168501612c96565b91508082528984828501011115612d6b57600080fd5b808484018584013760008482840101525080935050505092959194509250565b600060208284031215612d9d57600080fd5b5035919050565b60008060408385031215612db757600080fd5b823591506020830135612dc981612c4e565b809150509250929050565b600067ffffffffffffffff821115612dee57612dee612c80565b5060051b60200190565b600082601f830112612e0957600080fd5b81356020612e1e612e1983612dd4565b612c96565b82815260059290921b84018101918181019086841115612e3d57600080fd5b8286015b84811015612e585780358352918301918301612e41565b509695505050505050565b60008060408385031215612e7657600080fd5b823567ffffffffffffffff811115612e8d57600080fd5b612e9985828601612df8565b95602094909401359450505050565b801515811461157857600080fd5b600060208284031215612ec857600080fd5b81356126c081612ea8565b600060208284031215612ee557600080fd5b813567ffffffffffffffff811115612efc57600080fd5b612aa484828501612df8565b803560ff81168114612f1957600080fd5b919050565b600080600060608486031215612f3357600080fd5b8335925060208401359150612f4a60408501612f08565b90509250925092565b600082601f830112612f6457600080fd5b81356020612f74612e1983612dd4565b82815260059290921b84018101918181019086841115612f9357600080fd5b8286015b84811015612e5857612fa881612f08565b8352918301918301612f97565b60008060408385031215612fc857600080fd5b82359150602083013567ffffffffffffffff811115612fe657600080fd5b612ff285828601612f53565b9150509250929050565b6000806040838503121561300f57600080fd5b823567ffffffffffffffff81111561302657600080fd5b61303285828601612df8565b9250506020830135612dc981612ea8565b6000806040838503121561305657600080fd5b823591506020830135612dc981612ea8565b6000806040838503121561307b57600080fd5b823567ffffffffffffffff8082111561309357600080fd5b61309f86838701612df8565b935060208501359150808211156130b557600080fd5b50612ff285828601612f53565b6020808252825182820181905260009190848201906040850190845b818110156130fa578351835292840192918401916001016130de565b50909695505050505050565b6000806040838503121561311957600080fd5b50508035926020909101359150565b60008060006060848603121561313d57600080fd5b833561314881612c4e565b9250602084013561315881612c4e565b9150604084013561316881612c4e565b809150509250925092565b6000806000806080858703121561318957600080fd5b84359350602085013592506131a060408601612f08565b915060608501356131b081612ea8565b939692955090935050565b6000602082840312156131cd57600080fd5b813567ffffffffffffffff8111156131e457600080fd5b612aa484828501612f53565b634e487b7160e01b600052601160045260246000fd5b600067ffffffffffffffff83811690831681811015613227576132276131f0565b039392505050565b634e487b7160e01b600052603260045260246000fd5b6000600019821415613259576132596131f0565b5060010190565b60008219821115613273576132736131f0565b500190565b600067ffffffffffffffff80831681811415613296576132966131f0565b6001019392505050565b6000602082840312156132b257600080fd5b5051919050565b6000828210156132cb576132cb6131f0565b500390565b60008160001904831182151516156132ea576132ea6131f0565b500290565b60008261330c57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052602160045260246000fd5b600067ffffffffffffffff80831681851680830382111561334a5761334a6131f0565b01949350505050565b60005b8381101561336e578181015183820152602001613356565b83811115610ca25750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516133b7816017850160208801613353565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516133f4816028840160208801613353565b01602801949350505050565b602081526000825180602084015261341f816040850160208701613353565b601f01601f19169190910160400192915050565b600081613442576134426131f0565b506000190190565b60006020828403121561345c57600080fd5b81516126c081612ea8565b60008251613479818460208701613353565b919091019291505056fea26469706673582212204fd0a8a19b85bb4a78cca7c7470ac296cccae82520df40bf9b0e8b9098bdc9e264736f6c634300080b0033
Deployed Bytecode
0x6080604052600436106103085760003560e01c806399c2543c1161019a578063c81b77ae116100e1578063e59c36e71161008a578063ec982a1a11610064578063ec982a1a146109e4578063ed5a21ae146109f9578063fe706fa114610a1957600080fd5b8063e59c36e714610963578063eb2a496314610990578063ebb464cc146109c457600080fd5b8063d3e7b275116100bb578063d3e7b2751461089f578063d547741f146108bf578063d5a44f86146108df57600080fd5b8063c81b77ae14610832578063d151bfcd14610852578063d3e2d8691461087f57600080fd5b8063a694fc3a11610143578063b435534d1161011d578063b435534d146107df578063baa34110146107ff578063c0c53b8b1461081f57600080fd5b8063a694fc3a14610789578063b12f9e7f146107a9578063b3de9a07146107c957600080fd5b8063a217fddf11610174578063a217fddf14610727578063a401be491461073c578063a43c992c1461075c57600080fd5b806399c2543c146106d25780639eeb99a1146106e7578063a17b8ffb1461070757600080fd5b8063496e2ea01161025e57806378d76dce116102075780637eb646f8116101e15780637eb646f81461063457806388dfa0451461065457806391d148541461068c57600080fd5b806378d76dce146105de5780637b47ec1a146105f45780637caa23db1461061457600080fd5b80635fef195c116102385780635fef195c1461056a57806375b238fc1461058a57806375bcf8c3146105be57600080fd5b8063496e2ea01461050a5780634c30e9d11461052a578063547dfa491461054a57600080fd5b8063282c51f3116102c057806334b359f11161029a57806334b359f1146104ad57806336568abe146104ca5780634671b3fa146104ea57600080fd5b8063282c51f3146104375780632e17de781461046b5780632f2ff15d1461048d57600080fd5b80630a6f93e6116102f15780630a6f93e61461037d578063150b7a02146103aa578063248a9ca31461040757600080fd5b806301ffc9a71461030d578063085b68cd14610342575b600080fd5b34801561031957600080fd5b5061032d610328366004612c24565b610a39565b60405190151581526020015b60405180910390f35b34801561034e57600080fd5b5061036f61035d366004612c63565b60ce6020526000908152604090205481565b604051908152602001610339565b34801561038957600080fd5b5061036f610398366004612c63565b60cd6020526000908152604090205481565b3480156103b657600080fd5b506103ee6103c5366004612cc7565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b6040516001600160e01b03199091168152602001610339565b34801561041357600080fd5b5061036f610422366004612d8b565b60009081526065602052604090206001015490565b34801561044357600080fd5b5061036f7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b34801561047757600080fd5b5061048b610486366004612d8b565b610aa2565b005b34801561049957600080fd5b5061048b6104a8366004612da4565b610b82565b3480156104b957600080fd5b5061036f6828a857425466f8000081565b3480156104d657600080fd5b5061048b6104e5366004612da4565b610bac565b3480156104f657600080fd5b5061048b610505366004612e63565b610c39565b34801561051657600080fd5b5061036f610525366004612eb6565b610ca8565b34801561053657600080fd5b5061048b610545366004612ed3565b610ccd565b34801561055657600080fd5b5061048b610565366004612f1e565b610d35565b34801561057657600080fd5b5061048b610585366004612ed3565b610d9e565b34801561059657600080fd5b5061036f7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b3480156105ca57600080fd5b5061048b6105d9366004612ed3565b610df9565b3480156105ea57600080fd5b5061036f60d25481565b34801561060057600080fd5b5061048b61060f366004612d8b565b610f7b565b34801561062057600080fd5b5061048b61062f366004612fb5565b6110c9565b34801561064057600080fd5b5061048b61064f366004612ffc565b611121565b34801561066057600080fd5b5060ca54610674906001600160a01b031681565b6040516001600160a01b039091168152602001610339565b34801561069857600080fd5b5061032d6106a7366004612da4565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156106de57600080fd5b5061048b611160565b3480156106f357600080fd5b5061048b610702366004613043565b6112ca565b34801561071357600080fd5b5060c954610674906001600160a01b031681565b34801561073357600080fd5b5061036f600081565b34801561074857600080fd5b5061048b610757366004613068565b611348565b34801561076857600080fd5b5061077c610777366004612c63565b611407565b60405161033991906130c2565b34801561079557600080fd5b5061048b6107a4366004612d8b565b611566565b3480156107b557600080fd5b5061048b6107c4366004612d8b565b61157b565b3480156107d557600080fd5b5061036f60d15481565b3480156107eb57600080fd5b5061048b6107fa366004612c63565b6115ab565b34801561080b57600080fd5b5061048b61081a366004613106565b611626565b61048b61082d366004613128565b6116a6565b34801561083e57600080fd5b5061048b61084d366004612eb6565b6118fa565b34801561085e57600080fd5b5061036f61086d366004612c63565b60cc6020526000908152604090205481565b34801561088b57600080fd5b5061048b61089a366004612d8b565b611938565b3480156108ab57600080fd5b5061048b6108ba366004612c63565b611968565b3480156108cb57600080fd5b5061048b6108da366004612da4565b6119e3565b3480156108eb57600080fd5b506109336108fa366004612d8b565b60cb60205260009081526040902080546001909101546001600160a01b0382169167ffffffffffffffff600160a01b9091048116911683565b604080516001600160a01b03909416845267ffffffffffffffff9283166020850152911690820152606001610339565b34801561096f57600080fd5b5061036f61097e366004612d8b565b60cf6020526000908152604090205481565b34801561099c57600080fd5b5061036f7fbfb23ee41048b42a30e2ec7a73039c14412d38f234157009730dd77401a3782881565b3480156109d057600080fd5b5061048b6109df366004613173565b611a08565b3480156109f057600080fd5b5061077c611a7c565b348015610a0557600080fd5b5061036f610a14366004612c63565b611bed565b348015610a2557600080fd5b5061077c610a343660046131bb565b611c54565b60006001600160e01b031982167f7965db0b000000000000000000000000000000000000000000000000000000001480610a9c57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b600081815260cb60205260409020546001600160a01b03163314610ad957604051632093d68b60e01b815260040160405180910390fd5b600081815260d06020526040902054421015610b0857604051635a8181f760e01b815260040160405180910390fd5b600081815260cb6020526040812054610b3290600160a01b900467ffffffffffffffff1642613206565b905060d2548167ffffffffffffffff161015610b6157604051635a8181f760e01b815260040160405180910390fd5b610b6a33611db9565b610b7e828267ffffffffffffffff16611e0b565b5050565b600082815260656020526040902060010154610b9d81611eec565b610ba78383611ef6565b505050565b6001600160a01b0381163314610c2f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b610b7e8282611f98565b7fbfb23ee41048b42a30e2ec7a73039c14412d38f234157009730dd77401a37828610c6381611eec565b60005b8351811015610ca257610c92848281518110610c8457610c8461322f565b602002602001015184611626565b610c9b81613245565b9050610c66565b50505050565b600081610cb6576000610cba565b60d1545b610a9c906828a857425466f80000613260565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a848610cf781611eec565b60005b8251811015610ba757610d25838281518110610d1857610d1861322f565b6020026020010151610f7b565b610d2e81613245565b9050610cfa565b600083815260cb60205260409020546001600160a01b031633141580610d725750600082815260cb60205260409020546001600160a01b03163314155b15610d9057604051632093d68b60e01b815260040160405180910390fd5b610ba783838360008061201b565b610da733611db9565b60005b81518167ffffffffffffffff161015610b7e57610de9828267ffffffffffffffff1681518110610ddc57610ddc61322f565b60200260200101516124e9565b610df281613278565b9050610daa565b610e0233611db9565b60005b8151811015610b7e57336001600160a01b031660cb6000848481518110610e2e57610e2e61322f565b6020908102919091018101518252810191909152604001600020546001600160a01b031614610e7057604051632093d68b60e01b815260040160405180910390fd5b60d06000838381518110610e8657610e8661322f565b6020026020010151815260200190815260200160002054421015610ebd57604051635a8181f760e01b815260040160405180910390fd5b600060cb6000848481518110610ed557610ed561322f565b6020026020010151815260200190815260200160002060000160149054906101000a900467ffffffffffffffff1642610f0e9190613206565b905060d2548167ffffffffffffffff161015610f3d57604051635a8181f760e01b815260040160405180910390fd5b610f6a838381518110610f5257610f5261322f565b60200260200101518267ffffffffffffffff16611e0b565b50610f7481613245565b9050610e05565b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a848610fa581611eec565b600082815260cb60205260409020546001600160a01b0316610fda57604051630a49bbc360e21b815260040160405180910390fd5b600082815260cb60209081526040918290205491518481526001600160a01b03909216917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5910160405180910390a2600082815260cb60205260409081902080546001600160e01b0319168155600101805467ffffffffffffffff1916905560c9549051632142170760e11b815230600482015261dead6024820152604481018490526001600160a01b03909116906342842e0e906064015b600060405180830381600087803b1580156110ad57600080fd5b505af11580156110c1573d6000803e3d6000fd5b505050505050565b600082815260cb60205260409020546001600160a01b0316331461110057604051632093d68b60e01b815260040160405180910390fd5b61110b600082612656565b600092835260cf60205260409092209190915550565b60005b8251811015610ba7576111508382815181106111425761114261322f565b6020026020010151836112ca565b61115981613245565b9050611124565b60ca546040517f8c85c3c80000000000000000000000000000000000000000000000000000000081523360048201526000916001600160a01b031690638c85c3c890602401602060405180830381865afa1580156111c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e691906132a0565b9050806111f233611db9565b60d35460ff1615156001141561122f5733600090815260ce602052604090205461121c9082613260565b33600090815260ce602052604081205590505b60ca54604051631a60d47560e21b8152336004820152602481018490526001600160a01b039091169063698351d490604401600060405180830381600087803b15801561127b57600080fd5b505af115801561128f573d6000803e3d6000fd5b505060ca54604051632f57aef160e21b8152336004820152602481018590526001600160a01b03909116925063bd5ebbc49150604401611093565b600082815260cb60205260409020546001600160a01b0316331461130157604051632093d68b60e01b815260040160405180910390fd5b80801561130f575060d45482115b1561132d57604051634195122560e11b815260040160405180910390fd5b600082815260cf602052604090205461110b9060018361269d565b6000611355600083612656565b905060005b8351811015610ca257336001600160a01b031660cb60008684815181106113835761138361322f565b6020908102919091018101518252810191909152604001600020546001600160a01b0316146113c557604051632093d68b60e01b815260040160405180910390fd5b8160cf60008684815181106113dc576113dc61322f565b60200260200101518152602001908152602001600020819055508061140090613245565b905061135a565b60408051611d4c8082526203a9a0820190925260609160009190602082016203a980803683370190505090506000805b611d4c8167ffffffffffffffff1610156114c05767ffffffffffffffff8116600090815260cb60205260409020546001600160a01b03868116911614156114ae578067ffffffffffffffff168383815181106114955761149561322f565b6020908102919091010152816114aa81613245565b9250505b806114b881613278565b915050611437565b5060008167ffffffffffffffff8111156114dc576114dc612c80565b604051908082528060200260200182016040528015611505578160200160208202803683370190505b50905060005b815181101561155d578381815181106115265761152661322f565b60200260200101518282815181106115405761154061322f565b60209081029190910101528061155581613245565b91505061150b565b50949350505050565b61156f33611db9565b611578816124e9565b50565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756115a581611eec565b5060d155565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756115d581611eec565b6001600160a01b0382166115fc57604051631e7d738760e21b815260040160405180910390fd5b610b7e7fbfb23ee41048b42a30e2ec7a73039c14412d38f234157009730dd77401a3782883611ef6565b7fbfb23ee41048b42a30e2ec7a73039c14412d38f234157009730dd77401a3782861165081611eec565b600083815260cb60205260409020546001600160a01b031661168557604051630a49bbc360e21b815260040160405180910390fd5b61168f8242613260565b600093845260d06020526040909320929092555050565b600054610100900460ff16158080156116c65750600054600160ff909116105b806116e05750303b1580156116e0575060005460ff166001145b6117525760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610c26565b6000805460ff191660011790558015611775576000805461ff0019166101001790555b6001600160a01b038416158061179257506001600160a01b038316155b806117a457506001600160a01b038216155b156117c257604051631e7d738760e21b815260040160405180910390fd5b6117ec7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177583611ef6565b60ca80546001600160a01b038086167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161790925560c980549287169290911682179055604080517f3299c1200000000000000000000000000000000000000000000000000000000081529051633299c1209160048082019260209290919082900301816000875af1158015611888573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ac91906132a0565b60d4558015610ca2576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561192481611eec565b5060d3805460ff1916911515919091179055565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561196281611eec565b5060d255565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561199281611eec565b6001600160a01b0382166119b957604051631e7d738760e21b815260040160405180910390fd5b610b7e7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84883611ef6565b6000828152606560205260409020600101546119fe81611eec565b610ba78383611f98565b600084815260cb60205260409020546001600160a01b03163314611a3f57604051632093d68b60e01b815260040160405180910390fd5b600083815260cf6020526040902054600216611a6e57604051634195122560e11b815260040160405180910390fd5b610ca284848460018561201b565b6060600060d45467ffffffffffffffff811115611a9b57611a9b612c80565b604051908082528060200260200182016040528015611ac4578160200160208202803683370190505b5090506000805b60d4548167ffffffffffffffff1611611b485767ffffffffffffffff8116600090815260cf602052604090205460021615611b36578067ffffffffffffffff16838381518110611b1d57611b1d61322f565b602090810291909101015281611b3281613245565b9250505b80611b4081613278565b915050611acb565b5060008167ffffffffffffffff811115611b6457611b64612c80565b604051908082528060200260200182016040528015611b8d578160200160208202803683370190505b50905060005b8151811015611be557838181518110611bae57611bae61322f565b6020026020010151828281518110611bc857611bc861322f565b602090810291909101015280611bdd81613245565b915050611b93565b509392505050565b6001600160a01b038116600090815260cd60205260408120546201518090611c1590426132b9565b6001600160a01b038416600090815260cc6020526040902054611c4090674563918244f400006132d0565b611c4a91906132d0565b610a9c91906132ef565b60408051611d4c8082526203a9a0820190925260609160009190602082016203a980803683370190505090506000611c8d600085612656565b90506000805b611d4c8167ffffffffffffffff161015611d125767ffffffffffffffff8116600090815260cf60205260409020548316831415611d00578067ffffffffffffffff16848381518110611ce757611ce761322f565b602090810291909101015281611cfc81613245565b9250505b80611d0a81613278565b915050611c93565b5060008167ffffffffffffffff811115611d2e57611d2e612c80565b604051908082528060200260200182016040528015611d57578160200160208202803683370190505b50905060005b8151811015611daf57848181518110611d7857611d7861322f565b6020026020010151828281518110611d9257611d9261322f565b602090810291909101015280611da781613245565b915050611d5d565b5095945050505050565b611dc281611bed565b6001600160a01b038216600090815260ce602052604081208054909190611dea908490613260565b90915550506001600160a01b0316600090815260cd60205260409020429055565b604080518381526276a7008311602082015290810182905233907fa121f2e6408efa6639bcf460500f4b35e060a9f75344eb93059e69b2eedc0fc69060600160405180910390a2600082815260cb6020908152604080832080546001600160e01b03191681556001908101805467ffffffffffffffff1916905560cf835281842084905533845260cc9092528220805491929091611eaa9084906132b9565b909155505060c954604051632142170760e11b8152306004820152336024820152604481018490526001600160a01b03909116906342842e0e90606401611093565b61157881336126c7565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610b7e5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611f543390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1615610b7e5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600260ff84161115612059576040517f4e17ec8200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028360ff16600281111561207057612070613311565b600281111561208157612081613311565b1480156120b8575061209282610ca8565b33600081815260ce6020526040902054906120ac90611bed565b6120b69190613260565b105b156120ef576040517fb1a6eac900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006120fa83610ca8565b905060008460ff16600281111561211357612113613311565b9050600060c960009054906101000a90046001600160a01b03166001600160a01b031663410419996040518163ffffffff1660e01b81526004016020604051808303816000875af115801561216c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219091906132a0565b60d45461219d9190613260565b6121a8906001613260565b905084156121ed5760d154600088815260cb60209081526040808320546001600160a01b0316835260ce909152812080549091906121e7908490613260565b90915550505b600080856121fc5789896121ff565b888a5b9092509050600284600281111561221857612218613311565b14156123215761222733611db9565b33600090815260ce6020526040812080548792906122469084906132b9565b909155505060ca54604051632f57aef160e21b8152306004820152602481018790526001600160a01b039091169063bd5ebbc4906044015b600060405180830381600087803b15801561229857600080fd5b505af11580156122ac573d6000803e3d6000fd5b505060c95460405163cb41ea5560e01b81526004810186905260248101859052600160448201526001600160a01b03909116925063cb41ea559150606401600060405180830381600087803b15801561230457600080fd5b505af1158015612318573d6000803e3d6000fd5b50505050612473565b600184600281111561233557612335613311565b14156123d65760ca54604051631a60d47560e21b8152336004820152602481018790526001600160a01b039091169063698351d490604401600060405180830381600087803b15801561238757600080fd5b505af115801561239b573d6000803e3d6000fd5b505060ca54604051632f57aef160e21b8152306004820152602481018990526001600160a01b03909116925063bd5ebbc4915060440161227e565b61240633306828a857425466f8000060d1546123f29190613260565b60ca546001600160a01b0316929190612747565b60c95460405163cb41ea5560e01b81526004810184905260248101839052600160448201526001600160a01b039091169063cb41ea5590606401600060405180830381600087803b15801561245a57600080fd5b505af115801561246e573d6000803e3d6000fd5b505050505b60c954604051632142170760e11b8152306004820152336024820152604481018590526001600160a01b03909116906342842e0e90606401600060405180830381600087803b1580156124c557600080fd5b505af11580156124d9573d6000803e3d6000fd5b5050505050505050505050505050565b604080516060810182523380825267ffffffffffffffff4216602080840191909152600091825260cc9052829020549091820190612528906001613327565b67ffffffffffffffff908116909152600083815260cb6020908152604080832085518154878501516001600160a01b039092166001600160e01b031990911617600160a01b91871691909102178155948101516001958601805467ffffffffffffffff1916919095161790935533825260cc905290812080549091906125af908490613260565b909155505060405181815233907f830aad06b647cbc5eda6a9d33baba4c9dbf72c81cb7a2b08f4bbf5665a749ceb9060200160405180910390a260c954604051632142170760e11b8152336004820152306024820152604481018390526001600160a01b03909116906342842e0e90606401600060405180830381600087803b15801561263b57600080fd5b505af115801561264f573d6000803e3d6000fd5b5050505050565b600082815b8351811015611be5576126898285838151811061267a5761267a61322f565b6020026020010151600161269d565b91508061269581613245565b91505061265b565b600081156126b45750600160ff83161b83176126c0565b50600160ff83161b1983165b9392505050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610b7e57612705816001600160a01b031660146127cf565b6127108360206127cf565b60405160200161272192919061337f565b60408051601f198184030181529082905262461bcd60e51b8252610c2691600401613400565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052610ca29085906129b0565b606060006127de8360026132d0565b6127e9906002613260565b67ffffffffffffffff81111561280157612801612c80565b6040519080825280601f01601f19166020018201604052801561282b576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106128625761286261322f565b60200101906001600160f81b031916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106128ad576128ad61322f565b60200101906001600160f81b031916908160001a90535060006128d18460026132d0565b6128dc906001613260565b90505b6001811115612961577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061291d5761291d61322f565b1a60f81b8282815181106129335761293361322f565b60200101906001600160f81b031916908160001a90535060049490941c9361295a81613433565b90506128df565b5083156126c05760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c26565b6000612a05826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612a959092919063ffffffff16565b805190915015610ba75780806020019051810190612a23919061344a565b610ba75760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610c26565b6060612aa48484600085612aac565b949350505050565b606082471015612b245760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610c26565b843b612b725760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c26565b600080866001600160a01b03168587604051612b8e9190613467565b60006040518083038185875af1925050503d8060008114612bcb576040519150601f19603f3d011682016040523d82523d6000602084013e612bd0565b606091505b5091509150612be0828286612beb565b979650505050505050565b60608315612bfa5750816126c0565b825115612c0a5782518084602001fd5b8160405162461bcd60e51b8152600401610c269190613400565b600060208284031215612c3657600080fd5b81356001600160e01b0319811681146126c057600080fd5b6001600160a01b038116811461157857600080fd5b600060208284031215612c7557600080fd5b81356126c081612c4e565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612cbf57612cbf612c80565b604052919050565b60008060008060808587031215612cdd57600080fd5b8435612ce881612c4e565b9350602085810135612cf981612c4e565b935060408601359250606086013567ffffffffffffffff80821115612d1d57600080fd5b818801915088601f830112612d3157600080fd5b813581811115612d4357612d43612c80565b612d55601f8201601f19168501612c96565b91508082528984828501011115612d6b57600080fd5b808484018584013760008482840101525080935050505092959194509250565b600060208284031215612d9d57600080fd5b5035919050565b60008060408385031215612db757600080fd5b823591506020830135612dc981612c4e565b809150509250929050565b600067ffffffffffffffff821115612dee57612dee612c80565b5060051b60200190565b600082601f830112612e0957600080fd5b81356020612e1e612e1983612dd4565b612c96565b82815260059290921b84018101918181019086841115612e3d57600080fd5b8286015b84811015612e585780358352918301918301612e41565b509695505050505050565b60008060408385031215612e7657600080fd5b823567ffffffffffffffff811115612e8d57600080fd5b612e9985828601612df8565b95602094909401359450505050565b801515811461157857600080fd5b600060208284031215612ec857600080fd5b81356126c081612ea8565b600060208284031215612ee557600080fd5b813567ffffffffffffffff811115612efc57600080fd5b612aa484828501612df8565b803560ff81168114612f1957600080fd5b919050565b600080600060608486031215612f3357600080fd5b8335925060208401359150612f4a60408501612f08565b90509250925092565b600082601f830112612f6457600080fd5b81356020612f74612e1983612dd4565b82815260059290921b84018101918181019086841115612f9357600080fd5b8286015b84811015612e5857612fa881612f08565b8352918301918301612f97565b60008060408385031215612fc857600080fd5b82359150602083013567ffffffffffffffff811115612fe657600080fd5b612ff285828601612f53565b9150509250929050565b6000806040838503121561300f57600080fd5b823567ffffffffffffffff81111561302657600080fd5b61303285828601612df8565b9250506020830135612dc981612ea8565b6000806040838503121561305657600080fd5b823591506020830135612dc981612ea8565b6000806040838503121561307b57600080fd5b823567ffffffffffffffff8082111561309357600080fd5b61309f86838701612df8565b935060208501359150808211156130b557600080fd5b50612ff285828601612f53565b6020808252825182820181905260009190848201906040850190845b818110156130fa578351835292840192918401916001016130de565b50909695505050505050565b6000806040838503121561311957600080fd5b50508035926020909101359150565b60008060006060848603121561313d57600080fd5b833561314881612c4e565b9250602084013561315881612c4e565b9150604084013561316881612c4e565b809150509250925092565b6000806000806080858703121561318957600080fd5b84359350602085013592506131a060408601612f08565b915060608501356131b081612ea8565b939692955090935050565b6000602082840312156131cd57600080fd5b813567ffffffffffffffff8111156131e457600080fd5b612aa484828501612f53565b634e487b7160e01b600052601160045260246000fd5b600067ffffffffffffffff83811690831681811015613227576132276131f0565b039392505050565b634e487b7160e01b600052603260045260246000fd5b6000600019821415613259576132596131f0565b5060010190565b60008219821115613273576132736131f0565b500190565b600067ffffffffffffffff80831681811415613296576132966131f0565b6001019392505050565b6000602082840312156132b257600080fd5b5051919050565b6000828210156132cb576132cb6131f0565b500390565b60008160001904831182151516156132ea576132ea6131f0565b500290565b60008261330c57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052602160045260246000fd5b600067ffffffffffffffff80831681851680830382111561334a5761334a6131f0565b01949350505050565b60005b8381101561336e578181015183820152602001613356565b83811115610ca25750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516133b7816017850160208801613353565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516133f4816028840160208801613353565b01602801949350505050565b602081526000825180602084015261341f816040850160208701613353565b601f01601f19169190910160400192915050565b600081613442576134426131f0565b506000190190565b60006020828403121561345c57600080fd5b81516126c081612ea8565b60008251613479818460208701613353565b919091019291505056fea26469706673582212204fd0a8a19b85bb4a78cca7c7470ac296cccae82520df40bf9b0e8b9098bdc9e264736f6c634300080b0033
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.