ERC-721
Source Code
Overview
Max Total Supply
760 RBC-STAKE
Holders
406
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 RBC-STAKELoading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
RubicStaking
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import './interfaces/IRubicStaking.sol';
import './interfaces/IERC20Minimal.sol';
import './libraries/TransferHelper.sol';
import './libraries/FullMath.sol';
contract RubicStaking is IRubicStaking, ERC721Enumerable, ReentrancyGuard, Ownable {
struct Stake {
uint128 lockTime;
uint128 lockStartTime;
uint256 amount;
uint256 lastRewardGrowth;
}
IERC20Minimal public immutable RBC;
uint256 constant PRECISION = 10**29;
mapping(uint256 => Stake) public stakes;
uint256 public rewardRate;
uint256 public rewardReserve;
uint128 public prevTimestamp;
uint256 public virtualRBCBalance;
uint256 public rewardGrowth = 1;
bool public emergencyStop;
uint256 private _tokenId = 1;
string constant private uriRubican = 'https://raw.githubusercontent.com/Cryptorubic/NFT-metadata/develop/metadatas/rubican.json';
string constant private uriCubic = 'https://raw.githubusercontent.com/Cryptorubic/NFT-metadata/develop/metadatas/cubic.json';
string constant private uriWhale = 'https://raw.githubusercontent.com/Cryptorubic/NFT-metadata/develop/metadatas/whale.json';
constructor(address _RBC) ERC721('Rubic Staking NFT', 'RBC-STAKE') {
RBC = IERC20Minimal(_RBC);
prevTimestamp = uint128(block.timestamp);
}
modifier isAuthorizedForToken(uint256 tokenId) {
require(_isApprovedOrOwner(msg.sender, tokenId), 'Not authorized');
_;
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
_requireMinted(tokenId);
Stake memory stake = stakes[tokenId];
if (stake.amount >= 500_000 ether) {
return uriWhale;
} else if (stake.amount >= 100_000 ether) {
return uriCubic;
} else {
return uriRubican;
}
}
function tokensOfOwner(address owner) external view returns (uint256[] memory) {
uint256 balance = balanceOf(owner);
uint256[] memory ownedTokens = new uint256[](balance);
for (uint256 i; i < balance; i++) {
ownedTokens[i] = tokenOfOwnerByIndex(owner, i);
}
return ownedTokens;
}
function estimatedAnnualRewardsByTokenId(uint256 tokenId) external view returns (uint256) {
uint256 estimatedReward = rewardRate * 365 * 24 * 60 * 60;
uint256 estimatedRewardGrowth = rewardGrowth + FullMath.mulDiv(estimatedReward, PRECISION, virtualRBCBalance);
Stake memory stake = stakes[tokenId];
uint256 rewards = FullMath.mulDiv(
getAmountWithMultiplier(stake.amount, stake.lockTime),
estimatedRewardGrowth - stake.lastRewardGrowth,
PRECISION
);
return rewards;
}
function setRate(uint256 rate) external override onlyOwner {
require(rate < 10**27, 'too high rate');
_increaseCumulative(uint128(block.timestamp));
rewardRate = rate;
emit Rate(rate);
}
function setEmergencyStop(bool _emergencyStop) external override onlyOwner {
emergencyStop = _emergencyStop;
emit EmergencyStop(_emergencyStop);
}
function addRewards() external payable override {
_increaseCumulative(uint128(block.timestamp));
if (msg.value > 0) {
rewardReserve += msg.value;
emit AddRewards(msg.value);
}
}
function enterStaking(uint256 _amount, uint128 _lockTime) external override {
require(_amount > 0, 'stake amount should be correct');
require(!emergencyStop, 'staking is stopped');
TransferHelper.safeTransferFrom(address(RBC), msg.sender, address(this), _amount);
uint256 tokenId = _stake(_amount, _lockTime, msg.sender);
emit Enter(_amount, _lockTime, tokenId);
}
function enterStakingTo(uint256 _amount, uint128 _lockTime, address _to) external override {
require(_amount > 0, 'stake amount should be correct');
require(_to != address(0), 'to is zero');
require(!emergencyStop, 'staking is stopped');
TransferHelper.safeTransferFrom(address(RBC), msg.sender, address(this), _amount);
uint256 tokenId = _stake(_amount, _lockTime, _to);
emit Enter(_amount, _lockTime, tokenId);
}
function unstake(uint256 tokenId) external override nonReentrant isAuthorizedForToken(tokenId) {
_increaseCumulative(uint128(block.timestamp));
Stake memory stake = stakes[tokenId];
require(stake.lockStartTime + stake.lockTime < block.timestamp || emergencyStop, 'lock isnt expired');
uint256 amountWithMultiplier = getAmountWithMultiplier(stake.amount, stake.lockTime);
uint256 rewards = FullMath.mulDiv(amountWithMultiplier, rewardGrowth - stake.lastRewardGrowth, PRECISION);
virtualRBCBalance -= amountWithMultiplier;
TransferHelper.safeTransfer(address(RBC), msg.sender, stake.amount);
(bool success, ) = msg.sender.call{value: rewards}('');
require(success, 'rewards transfer failed');
_burn(tokenId);
delete stakes[tokenId];
emit Unstake(stake.amount, tokenId);
}
function claimRewards(uint256 tokenId) external override nonReentrant isAuthorizedForToken(tokenId) returns (uint256 rewards) {
_increaseCumulative(uint128(block.timestamp));
Stake storage stake = stakes[tokenId];
require(stake.amount > 0, 'amount should be correct');
rewards = FullMath.mulDiv(
getAmountWithMultiplier(stake.amount, stake.lockTime),
rewardGrowth - stake.lastRewardGrowth,
PRECISION
);
stake.lastRewardGrowth = rewardGrowth;
(bool success, ) = msg.sender.call{value: rewards}('');
require(success, 'rewards transfer failed');
emit Claim(rewards, tokenId);
}
function calculateRewards(uint256 tokenId) external view override returns (uint256 rewards) {
uint256 _rewardRate = rewardRate;
uint256 _rewardGrowth = rewardGrowth;
uint256 _rewardReserve = _rewardRate > 0 ? rewardReserve : 0;
if (_rewardReserve > 0) {
uint256 reward = _rewardRate * (block.timestamp - prevTimestamp);
if (reward > _rewardReserve) reward = _rewardReserve;
_rewardGrowth += FullMath.mulDiv(reward, PRECISION, virtualRBCBalance);
}
Stake memory stake = stakes[tokenId];
rewards = FullMath.mulDiv(
getAmountWithMultiplier(stake.amount, stake.lockTime),
_rewardGrowth - stake.lastRewardGrowth,
PRECISION
);
}
function sweepTokens(
address _asset,
address _to,
uint256 _amount
) external onlyOwner {
require(_asset != address(RBC), 'cannot sweep RBC');
address sendTo = _to == address(0) ? msg.sender : _to;
if (_asset == address(0)) {
_increaseCumulative(uint128(block.timestamp));
rewardReserve -= _amount;
(bool success, ) = sendTo.call{value: _amount}('');
require(success, 'rewards transfer failed');
} else {
IERC20Minimal(_asset).transfer(sendTo, _amount);
}
}
function _stake(uint256 _amount, uint128 _lockTime, address _to) private returns (uint256 tokenId) {
_increaseCumulative(uint128(block.timestamp));
virtualRBCBalance += getAmountWithMultiplier(_amount, _lockTime);
tokenId = _tokenId++;
stakes[tokenId] = Stake({
lockTime: _lockTime,
lockStartTime: uint128(block.timestamp),
amount: _amount,
lastRewardGrowth: rewardGrowth
});
_mint(_to, tokenId);
}
function _increaseCumulative(uint128 currentTimestamp) private {
if (emergencyStop) return;
uint256 _rewardRate = rewardRate;
uint256 _rewardReserve = _rewardRate > 0 ? rewardReserve : 0;
if (virtualRBCBalance > 0) {
if (_rewardReserve > 0) {
uint256 reward = _rewardRate * (currentTimestamp - prevTimestamp);
if (reward > _rewardReserve) reward = _rewardReserve;
rewardReserve = _rewardReserve - reward;
rewardGrowth += FullMath.mulDiv(reward, PRECISION, virtualRBCBalance);
}
}
prevTimestamp = currentTimestamp;
}
function getAmountWithMultiplier(uint256 amount, uint128 lockTime) private pure returns (uint256) {
if (lockTime == 30 days) return (10 * amount) / 10;
if (lockTime == 90 days) return (10 * amount) / 10;
if (lockTime == 180 days) return (12 * amount) / 10;
if (lockTime == 270 days) return (15 * amount) / 10;
if (lockTime == 360 days) return (20 * amount) / 10;
revert('incorrect lock');
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "./IERC721Enumerable.sol";
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IRubicStaking {
function enterStaking(uint256 _amount, uint128 _lockTime) external;
function enterStakingTo(uint256 _amount, uint128 _lockTime, address _to) external;
function unstake(uint256 tokenId) external;
function claimRewards(uint256 tokenId) external returns (uint256 rewards);
function addRewards() external payable;
function calculateRewards(uint256 tokenId) external view returns (uint256 rewards);
function setRate(uint256 rate) external;
function setEmergencyStop(bool isStopped) external;
event Enter(uint256 amount, uint128 lockTime, uint256 tokenId);
event Unstake(uint256 amount, uint256 tokenId);
event Migrate(uint256 amount, uint128 lockTime, uint256 tokenId);
event Claim(uint256 amount, uint256 tokenId);
event AddRewards(uint256 amount);
event Rate(uint256 rate);
event EmergencyStop(bool isStopped);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Minimal ERC20 interface for Rubic
/// @notice Contains a subset of the full ERC20 interface that is used in Rubic
/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:
/// https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces
interface IERC20Minimal {
/// @notice Returns the balance of a token
/// @param account The account for which to look up the number of tokens it has, i.e. its balance
/// @return The number of tokens held by the account
function balanceOf(address account) external view returns (uint256);
/// @notice Transfers the amount of token from the `msg.sender` to the recipient
/// @param recipient The account that will receive the amount transferred
/// @param amount The number of tokens to send from the sender to the recipient
/// @return Returns true for a successful transfer, false for an unsuccessful transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/// @notice Returns the current allowance given to a spender by an owner
/// @param owner The account of the token owner
/// @param spender The account of the token spender
/// @return The current allowance granted by `owner` to `spender`
function allowance(address owner, address spender) external view returns (uint256);
/// @notice Sets the allowance of a spender from the `msg.sender` to the value `amount`
/// @param spender The account which will be allowed to spend a given amount of the owners tokens
/// @param amount The amount of tokens allowed to be used by `spender`
/// @return Returns true for a successful approval, false for unsuccessful
function approve(address spender, uint256 amount) external returns (bool);
/// @notice Transfers `amount` tokens from `sender` to `recipient` up to the allowance given to the `msg.sender`
/// @param sender The account from which the transfer will be initiated
/// @param recipient The recipient of the transfer
/// @param amount The amount of the transfer
/// @return Returns true for a successful transfer, false for unsuccessful
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/// @notice Event emitted when tokens are transferred from one address to another, either via `#transfer` or `#transferFrom`.
/// @param from The account from which the tokens were sent, i.e. the balance decreased
/// @param to The account to which the tokens were sent, i.e. the balance increased
/// @param value The amount of tokens that were transferred
event Transfer(address indexed from, address indexed to, uint256 value);
/// @notice Event emitted when the approval amount for the spender of a given owner's tokens changes.
/// @param owner The account that approved spending of its tokens
/// @param spender The account for which the spending allowance was modified
/// @param value The new allowance from the owner to the spender
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.0;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:
/// https://github.com/Uniswap/v3-periphery
library TransferHelper {
/// @notice Transfers tokens from the targeted address to the given destination
/// @notice Errors with 'STF' if transfer fails
/// @param token The contract address of the token to be transferred
/// @param from The originating address from which the tokens will be transferred
/// @param to The destination address of the transfer
/// @param value The amount to be transferred
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value)
);
require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF');
}
/// @notice Transfers tokens from msg.sender to a recipient
/// @dev Errors with ST if transfer fails
/// @param token The contract address of the token which will be transferred
/// @param to The recipient of the transfer
/// @param value The value of the transfer
function safeTransfer(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST');
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title Contains 512-bit math functions
/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision
/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits
library FullMath {
/// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
/// @param a The multiplicand
/// @param b The multiplier
/// @param denominator The divisor
/// @return result The 256-bit result
/// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv
function mulDiv(
uint256 a,
uint256 b,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = a * b
// Compute the product mod 2**256 and mod 2**256 - 1
// then use the Chinese Remainder Theorem to reconstruct
// the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2**256 + prod0
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(a, b, not(0))
prod0 := mul(a, b)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division
if (prod1 == 0) {
require(denominator > 0);
assembly {
result := div(prod0, denominator)
}
return result;
}
// Make sure the result is less than 2**256.
// Also prevents denominator == 0
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0]
// Compute remainder using mulmod
uint256 remainder;
assembly {
remainder := mulmod(a, b, denominator)
}
// Subtract 256 bit number from 512 bit number
assembly {
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator
// Compute largest power of two divisor of denominator.
// Always >= 1.
uint256 twos = (0 - denominator) & denominator;
// Divide denominator by power of two
assembly {
denominator := div(denominator, twos)
}
// Divide [prod1 prod0] by the factors of two
assembly {
prod0 := div(prod0, twos)
}
// Shift in bits from prod1 into prod0. For this we need
// to flip `twos` such that it is 2**256 / twos.
// If twos is zero, then it becomes one
assembly {
twos := add(div(sub(0, twos), twos), 1)
}
prod0 |= prod1 * twos;
// Invert denominator mod 2**256
// Now that denominator is an odd number, it has an inverse
// modulo 2**256 such that denominator * inv = 1 mod 2**256.
// Compute the inverse by starting with a seed that is correct
// correct for four bits. That is, denominator * inv = 1 mod 2**4
uint256 inv = (3 * denominator) ^ 2;
// Now use Newton-Raphson iteration to improve the precision.
// Thanks to Hensel's lifting lemma, this also works in modular
// arithmetic, doubling the correct bits in each step.
inv *= 2 - denominator * inv; // inverse mod 2**8
inv *= 2 - denominator * inv; // inverse mod 2**16
inv *= 2 - denominator * inv; // inverse mod 2**32
inv *= 2 - denominator * inv; // inverse mod 2**64
inv *= 2 - denominator * inv; // inverse mod 2**128
inv *= 2 - denominator * inv; // inverse mod 2**256
// Because the division is now exact we can divide by multiplying
// with the modular inverse of denominator. This will give us the
// correct result modulo 2**256. Since the precoditions guarantee
// that the outcome is less than 2**256, this is the final result.
// We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inv;
return result;
}
}
/// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
/// @param a The multiplicand
/// @param b The multiplier
/// @param denominator The divisor
/// @return result The 256-bit result
function mulDivRoundingUp(
uint256 a,
uint256 b,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
result = mulDiv(a, b, denominator);
if (mulmod(a, b, denominator) > 0) {
require(result < type(uint256).max);
result++;
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: address zero is not a valid owner");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: invalid token ID");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
_requireMinted(tokenId);
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not token owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
_requireMinted(tokenId);
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
_safeTransfer(from, to, tokenId, data);
}
/**
* @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.
*
* `data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits an {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Reverts if the `tokenId` has not been minted yet.
*/
function _requireMinted(uint256 tokenId) internal view virtual {
require(_exists(tokenId), "ERC721: invalid token ID");
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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`.
*
* 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;
/**
* @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 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 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 the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @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);
}// 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 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 `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/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// 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 Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
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 "./IERC165.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 ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// 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 (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}{
"optimizer": {
"enabled": true,
"runs": 1000000
},
"metadata": {
"bytecodeHash": "none"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_RBC","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AddRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isStopped","type":"bool"}],"name":"EmergencyStop","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"lockTime","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Enter","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"lockTime","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Migrate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"Rate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Unstake","type":"event"},{"inputs":[],"name":"RBC","outputs":[{"internalType":"contract IERC20Minimal","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addRewards","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"calculateRewards","outputs":[{"internalType":"uint256","name":"rewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"rewards","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyStop","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint128","name":"_lockTime","type":"uint128"}],"name":"enterStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint128","name":"_lockTime","type":"uint128"},{"internalType":"address","name":"_to","type":"address"}],"name":"enterStakingTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"estimatedAnnualRewardsByTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prevTimestamp","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardGrowth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_emergencyStop","type":"bool"}],"name":"setEmergencyStop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"rate","type":"uint256"}],"name":"setRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakes","outputs":[{"internalType":"uint128","name":"lockTime","type":"uint128"},{"internalType":"uint128","name":"lockStartTime","type":"uint128"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lastRewardGrowth","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"sweepTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"virtualRBCBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60a0604052600160115560016013553480156200001b57600080fd5b506040516200420f3803806200420f8339810160408190526200003e916200013c565b60405180604001604052806011815260200170149d589a58c814dd185ada5b99c8139195607a1b815250604051806040016040528060098152602001685242432d5354414b4560b81b81525081600090816200009b919062000213565b506001620000aa828262000213565b50506001600a5550620000bd33620000ea565b6001600160a01b0316608052600f80546001600160801b031916426001600160801b0316179055620002df565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000602082840312156200014f57600080fd5b81516001600160a01b03811681146200016757600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200019957607f821691505b602082108103620001ba57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200020e57600081815260208120601f850160051c81016020861015620001e95750805b601f850160051c820191505b818110156200020a57828155600101620001f5565b5050505b505050565b81516001600160401b038111156200022f576200022f6200016e565b620002478162000240845462000184565b84620001c0565b602080601f8311600181146200027f5760008415620002665750858301515b600019600386901b1c1916600185901b1785556200020a565b600085815260208120601f198616915b82811015620002b0578886015182559484019460019091019084016200028f565b5085821015620002cf5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051613ef8620003176000396000818161079d015281816111b901528181611756015281816119710152611cf00152613ef86000f3fe6080604052600436106102855760003560e01c8063715018a611610153578063c150b5f2116100cb578063d576dfc01161007f578063e6f4641011610064578063e6f464101461078b578063e985e9c5146107bf578063f2fde38b1461081557600080fd5b8063d576dfc0146106a7578063d5a44f86146106f157600080fd5b8063c87b56dd116100b0578063c87b56dd14610651578063cab64bcd14610671578063d3ea43501461068757600080fd5b8063c150b5f21461061b578063c73d7c7b1461063157600080fd5b80638da5cb5b11610122578063a22cb46511610107578063a22cb465146105bb578063b593bc1a146105db578063b88d4fde146105fb57600080fd5b80638da5cb5b1461057b57806395d89b41146105a657600080fd5b8063715018a6146105035780637b0a47ee146105185780638462151c1461052e5780638b6ca32c1461055b57600080fd5b80632e17de78116102015780634f6ccce7116101b557806363a599a41161019a57806363a599a4146104a95780636e58030d146104c357806370a08231146104e357600080fd5b80634f6ccce7146104695780636352211e1461048957600080fd5b806334fcf437116101e657806334fcf4371461041357806342842e0e1461043357806349496e061461045357600080fd5b80632e17de78146103d35780632f745c59146103f357600080fd5b80630962ef791161025857806316c0ec6f1161023d57806316c0ec6f1461037e57806318160ddd1461039e57806323b872dd146103b357600080fd5b80630962ef791461034857806314d6aed01461037657600080fd5b806301ffc9a71461028a57806306fdde03146102bf578063081812fc146102e1578063095ea7b314610326575b600080fd5b34801561029657600080fd5b506102aa6102a536600461378a565b610835565b60405190151581526020015b60405180910390f35b3480156102cb57600080fd5b506102d4610891565b6040516102b69190613815565b3480156102ed57600080fd5b506103016102fc366004613828565b610923565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102b6565b34801561033257600080fd5b5061034661034136600461386a565b610957565b005b34801561035457600080fd5b50610368610363366004613828565b610ae8565b6040519081526020016102b6565b610346610d9c565b34801561038a57600080fd5b50610368610399366004613828565b610df8565b3480156103aa57600080fd5b50600854610368565b3480156103bf57600080fd5b506103466103ce366004613894565b610ee6565b3480156103df57600080fd5b506103466103ee366004613828565b610f87565b3480156103ff57600080fd5b5061036861040e36600461386a565b611307565b34801561041f57600080fd5b5061034661042e366004613828565b6113d6565b34801561043f57600080fd5b5061034661044e366004613894565b611498565b34801561045f57600080fd5b5061036860115481565b34801561047557600080fd5b50610368610484366004613828565b6114b3565b34801561049557600080fd5b506103016104a4366004613828565b611571565b3480156104b557600080fd5b506012546102aa9060ff1681565b3480156104cf57600080fd5b506103466104de3660046138f0565b6115fd565b3480156104ef57600080fd5b506103686104fe36600461392c565b6117e5565b34801561050f57600080fd5b506103466118b3565b34801561052457600080fd5b50610368600d5481565b34801561053a57600080fd5b5061054e61054936600461392c565b6118c5565b6040516102b69190613947565b34801561056757600080fd5b50610346610576366004613894565b611967565b34801561058757600080fd5b50600b5473ffffffffffffffffffffffffffffffffffffffff16610301565b3480156105b257600080fd5b506102d4611bf6565b3480156105c757600080fd5b506103466105d6366004613999565b611c05565b3480156105e757600080fd5b506103466105f63660046139d0565b611c14565b34801561060757600080fd5b50610346610616366004613a2b565b611d7e565b34801561062757600080fd5b5061036860105481565b34801561063d57600080fd5b5061034661064c366004613b25565b611e20565b34801561065d57600080fd5b506102d461066c366004613828565b611e87565b34801561067d57600080fd5b50610368600e5481565b34801561069357600080fd5b506103686106a2366004613828565b611f81565b3480156106b357600080fd5b50600f546106d0906fffffffffffffffffffffffffffffffff1681565b6040516fffffffffffffffffffffffffffffffff90911681526020016102b6565b3480156106fd57600080fd5b5061075761070c366004613828565b600c602052600090815260409020805460018201546002909201546fffffffffffffffffffffffffffffffff8083169370010000000000000000000000000000000090930416919084565b604080516fffffffffffffffffffffffffffffffff95861681529490931660208501529183015260608201526080016102b6565b34801561079757600080fd5b506103017f000000000000000000000000000000000000000000000000000000000000000081565b3480156107cb57600080fd5b506102aa6107da366004613b42565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561082157600080fd5b5061034661083036600461392c565b612089565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d6300000000000000000000000000000000000000000000000000000000148061088b575061088b82612140565b92915050565b6060600080546108a090613b6c565b80601f01602080910402602001604051908101604052809291908181526020018280546108cc90613b6c565b80156109195780601f106108ee57610100808354040283529160200191610919565b820191906000526020600020905b8154815290600101906020018083116108fc57829003601f168201915b5050505050905090565b600061092e82612223565b5060009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b600061096282611571565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610a24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff82161480610a4d5750610a4d81336107da565b610ad9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610a1b565b610ae383836122ae565b505050565b60006002600a5403610b56576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a1b565b6002600a5581610b66338261234e565b610bcc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e6f7420617574686f72697a65640000000000000000000000000000000000006044820152606401610a1b565b610bd54261240e565b6000838152600c602052604090206001810154610c4e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f616d6f756e742073686f756c6420626520636f727265637400000000000000006044820152606401610a1b565b60018101548154610c9991610c74916fffffffffffffffffffffffffffffffff16612514565b8260020154601154610c869190613be8565b6c01431e0fae6d7217caa0000000612656565b6011546002830155604051909350600090339085908381818185875af1925050503d8060008114610ce6576040519150601f19603f3d011682016040523d82523d6000602084013e610ceb565b606091505b5050905080610d56576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f72657761726473207472616e73666572206661696c65640000000000000000006044820152606401610a1b565b60408051858152602081018790527f022e3d29644ead4083349ca84d24bcac368b2461819b70f5921fea15de4dec4d910160405180910390a150506001600a5550919050565b610da54261240e565b3415610df65734600e6000828254610dbd9190613bfb565b90915550506040513481527fa8c8f6c9639d5a378696689ad02c4ea707de67f3175f609f1c016d3ce94297899060200160405180910390a15b565b600080600d5461016d610e0b9190613c0e565b610e16906018613c0e565b610e2190603c613c0e565b610e2c90603c613c0e565b90506000610e4a826c01431e0fae6d7217caa0000000601054612656565b601154610e579190613bfb565b6000858152600c60209081526040808320815160808101835281546fffffffffffffffffffffffffffffffff808216808452700100000000000000000000000000000000909204169482019490945260018201549281018390526002909101546060820152939450610edc91610ecd9190612514565b6060840151610c869086613be8565b9695505050505050565b610ef0338261234e565b610f7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610a1b565b610ae3838383612727565b6002600a5403610ff3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a1b565b6002600a5580611003338261234e565b611069576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e6f7420617574686f72697a65640000000000000000000000000000000000006044820152606401610a1b565b6110724261240e565b6000828152600c6020908152604091829020825160808101845281546fffffffffffffffffffffffffffffffff8082168084527001000000000000000000000000000000009092041693820184905260018301549482019490945260029091015460608201529142916110e59190613c25565b6fffffffffffffffffffffffffffffffff161080611105575060125460ff165b61116b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6c6f636b2069736e7420657870697265640000000000000000000000000000006044820152606401610a1b565b600061117f82604001518360000151612514565b90506000611199828460600151601154610c869190613be8565b905081601060008282546111ad9190613be8565b925050819055506111e37f0000000000000000000000000000000000000000000000000000000000000000338560400151612999565b604051600090339083908381818185875af1925050503d8060008114611225576040519150601f19603f3d011682016040523d82523d6000602084013e61122a565b606091505b5050905080611295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f72657761726473207472616e73666572206661696c65640000000000000000006044820152606401610a1b565b61129e86612b02565b6000868152600c6020908152604080832083815560018101849055600201929092558582015182519081529081018890527f9045c2ac9b2026de8075f2701bbdde882cd5e830b3b1ead9a15b22f2b5b93742910160405180910390a150506001600a5550505050565b6000611312836117e5565b82106113a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610a1b565b5073ffffffffffffffffffffffffffffffffffffffff919091166000908152600660209081526040808320938352929052205490565b6113de612bdb565b6b033b2e3c9fd0803ce80000008110611453576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f746f6f20686967682072617465000000000000000000000000000000000000006044820152606401610a1b565b61145c4261240e565b600d8190556040518181527f3e7f4cf5fff23ca5c3b06a93850397f53c61b3f180714cf98f14e0b000a94ab9906020015b60405180910390a150565b610ae383838360405180602001604052806000815250611d7e565b60006114be60085490565b821061154c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610a1b565b6008828154811061155f5761155f613c55565b90600052602060002001549050919050565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff168061088b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610a1b565b60008311611667576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f7374616b6520616d6f756e742073686f756c6420626520636f727265637400006044820152606401610a1b565b73ffffffffffffffffffffffffffffffffffffffff81166116e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f746f206973207a65726f000000000000000000000000000000000000000000006044820152606401610a1b565b60125460ff1615611751576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7374616b696e672069732073746f7070656400000000000000000000000000006044820152606401610a1b565b61177d7f0000000000000000000000000000000000000000000000000000000000000000333086612c5c565b600061178a848484612dd5565b604080518681526fffffffffffffffffffffffffffffffff861660208201529081018290529091507fa62eb7c552fa69d1576e9ee8ccc35ebf741a0a7eb11c7bb5ab21f2fc5545529c9060600160405180910390a150505050565b600073ffffffffffffffffffffffffffffffffffffffff821661188a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610a1b565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b6118bb612bdb565b610df66000612e97565b606060006118d2836117e5565b905060008167ffffffffffffffff8111156118ef576118ef6139fc565b604051908082528060200260200182016040528015611918578160200160208202803683370190505b50905060005b8281101561195f576119308582611307565b82828151811061194257611942613c55565b60209081029190910101528061195781613c84565b91505061191e565b509392505050565b61196f612bdb565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611a24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f63616e6e6f7420737765657020524243000000000000000000000000000000006044820152606401610a1b565b600073ffffffffffffffffffffffffffffffffffffffff831615611a485782611a4a565b335b905073ffffffffffffffffffffffffffffffffffffffff8416611b5557611a704261240e565b81600e6000828254611a829190613be8565b909155505060405160009073ffffffffffffffffffffffffffffffffffffffff83169084908381818185875af1925050503d8060008114611adf576040519150601f19603f3d011682016040523d82523d6000602084013e611ae4565b606091505b5050905080611b4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f72657761726473207472616e73666572206661696c65640000000000000000006044820152606401610a1b565b50611bf0565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301526024820184905285169063a9059cbb906044016020604051808303816000875af1158015611bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bee9190613cbc565b505b50505050565b6060600180546108a090613b6c565b611c10338383612f0e565b5050565b60008211611c7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f7374616b6520616d6f756e742073686f756c6420626520636f727265637400006044820152606401610a1b565b60125460ff1615611ceb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7374616b696e672069732073746f7070656400000000000000000000000000006044820152606401610a1b565b611d177f0000000000000000000000000000000000000000000000000000000000000000333085612c5c565b6000611d24838333612dd5565b604080518581526fffffffffffffffffffffffffffffffff851660208201529081018290529091507fa62eb7c552fa69d1576e9ee8ccc35ebf741a0a7eb11c7bb5ab21f2fc5545529c9060600160405180910390a1505050565b611d88338361234e565b611e14576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610a1b565b611bf08484848461303b565b611e28612bdb565b601280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168215159081179091556040519081527fcbe1b789cda412d9e1c647ed03d0c71e2f71484be36f9ca2b2a346b29edf1b709060200161148d565b6060611e9282612223565b6000828152600c6020908152604091829020825160808101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000090910416928101929092526001810154928201839052600201546060820152906969e10de76676d080000011611f2657604051806080016040528060578152602001613de5605791399392505050565b69152d02c7e14af6800000816040015110611f5b57604051806080016040528060578152602001613e95605791399392505050565b604051806080016040528060598152602001613e3c605991399392505050565b50919050565b600d54601154600091908282611f98576000611f9c565b600e545b9050801561200557600f54600090611fc6906fffffffffffffffffffffffffffffffff1642613be8565b611fd09085613c0e565b905081811115611fdd5750805b611ff7816c01431e0fae6d7217caa0000000601054612656565b6120019084613bfb565b9250505b6000858152600c6020908152604091829020825160808101845281546fffffffffffffffffffffffffffffffff80821680845270010000000000000000000000000000000090920416938201939093526001820154938101849052600290910154606082015291610edc9161207a9190612514565b6060830151610c869086613be8565b612091612bdb565b73ffffffffffffffffffffffffffffffffffffffff8116612134576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a1b565b61213d81612e97565b50565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd0000000000000000000000000000000000000000000000000000000014806121d357507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061088b57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461088b565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1661213d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610a1b565b600081815260046020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8416908117909155819061230882611571565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061235a83611571565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806123c8575073ffffffffffffffffffffffffffffffffffffffff80821660009081526005602090815260408083209388168352929052205460ff165b8061240657508373ffffffffffffffffffffffffffffffffffffffff166123ee84610923565b73ffffffffffffffffffffffffffffffffffffffff16145b949350505050565b60125460ff161561241c5750565b600d5460008161242d576000612431565b600e545b601054909150156124cf5780156124cf57600f54600090612464906fffffffffffffffffffffffffffffffff1685613cd9565b612480906fffffffffffffffffffffffffffffffff1684613c0e565b90508181111561248d5750805b6124978183613be8565b600e819055506124b7816c01431e0fae6d7217caa0000000601054612656565b601160008282546124c89190613bfb565b9091555050505b5050600f80547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff92909216919091179055565b6000816fffffffffffffffffffffffffffffffff1662278d000361254f57600a61253e8482613c0e565b6125489190613d02565b905061088b565b816fffffffffffffffffffffffffffffffff166276a7000361257757600a61253e8482613c0e565b816fffffffffffffffffffffffffffffffff1662ed4e00036125a057600a61253e84600c613c0e565b816fffffffffffffffffffffffffffffffff16630163f500036125ca57600a61253e84600f613c0e565b816fffffffffffffffffffffffffffffffff166301da9c00036125f457600a61253e846014613c0e565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f696e636f7272656374206c6f636b0000000000000000000000000000000000006044820152606401610a1b565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050806000036126ad57600084116126a257600080fd5b508290049050612720565b8084116126b957600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b8273ffffffffffffffffffffffffffffffffffffffff1661274782611571565b73ffffffffffffffffffffffffffffffffffffffff16146127ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610a1b565b73ffffffffffffffffffffffffffffffffffffffff821661288c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610a1b565b6128978383836130de565b6128a26000826122ae565b73ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604081208054600192906128d8908490613be8565b909155505073ffffffffffffffffffffffffffffffffffffffff82166000908152600360205260408120805460019290612913908490613bfb565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790529151600092839290871691612a309190613d3d565b6000604051808303816000865af19150503d8060008114612a6d576040519150601f19603f3d011682016040523d82523d6000602084013e612a72565b606091505b5091509150818015612a9c575080511580612a9c575080806020019051810190612a9c9190613cbc565b611bee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f53540000000000000000000000000000000000000000000000000000000000006044820152606401610a1b565b6000612b0d82611571565b9050612b1b816000846130de565b612b266000836122ae565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260408120805460019290612b5c908490613be8565b909155505060008281526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555183919073ffffffffffffffffffffffffffffffffffffffff8416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b600b5473ffffffffffffffffffffffffffffffffffffffff163314610df6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1b565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790529151600092839290881691612cfb9190613d3d565b6000604051808303816000865af19150503d8060008114612d38576040519150601f19603f3d011682016040523d82523d6000602084013e612d3d565b606091505b5091509150818015612d67575080511580612d67575080806020019051810190612d679190613cbc565b612dcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f53544600000000000000000000000000000000000000000000000000000000006044820152606401610a1b565b505050505050565b6000612de04261240e565b612dea8484612514565b60106000828254612dfb9190613bfb565b909155505060138054906000612e1083613c84565b90915550604080516080810182526fffffffffffffffffffffffffffffffff808716825242811660208084019182528385018a8152601154606086019081526000888152600c9093529590912093519151831670010000000000000000000000000000000002919092161782555160018201559051600290910155905061272082826131e4565b600b805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612fa3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610a1b565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526005602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613046848484612727565b613052848484846133b2565b611bf0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610a1b565b73ffffffffffffffffffffffffffffffffffffffff83166131465761314181600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b613183565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146131835761318383826135a5565b73ffffffffffffffffffffffffffffffffffffffff82166131a757610ae38161365c565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610ae357610ae3828261370b565b73ffffffffffffffffffffffffffffffffffffffff8216613261576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a1b565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16156132ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610a1b565b6132f9600083836130de565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260036020526040812080546001929061332f908490613bfb565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600073ffffffffffffffffffffffffffffffffffffffff84163b1561359a576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a0290613429903390899088908890600401613d59565b6020604051808303816000875af1925050508015613482575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261347f91810190613d98565b60015b61354f573d8080156134b0576040519150601f19603f3d011682016040523d82523d6000602084013e6134b5565b606091505b508051600003613547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610a1b565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050612406565b506001949350505050565b600060016135b2846117e5565b6135bc9190613be8565b60008381526007602052604090205490915080821461361c5773ffffffffffffffffffffffffffffffffffffffff841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b50600091825260076020908152604080842084905573ffffffffffffffffffffffffffffffffffffffff9094168352600681528383209183525290812055565b60085460009061366e90600190613be8565b6000838152600960205260408120546008805493945090928490811061369657613696613c55565b9060005260206000200154905080600883815481106136b7576136b7613c55565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806136ef576136ef613db5565b6001900381819060005260206000200160009055905550505050565b6000613716836117e5565b73ffffffffffffffffffffffffffffffffffffffff9093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461213d57600080fd5b60006020828403121561379c57600080fd5b81356127208161375c565b60005b838110156137c25781810151838201526020016137aa565b50506000910152565b600081518084526137e38160208601602086016137a7565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061272060208301846137cb565b60006020828403121561383a57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461386557600080fd5b919050565b6000806040838503121561387d57600080fd5b61388683613841565b946020939093013593505050565b6000806000606084860312156138a957600080fd5b6138b284613841565b92506138c060208501613841565b9150604084013590509250925092565b80356fffffffffffffffffffffffffffffffff8116811461386557600080fd5b60008060006060848603121561390557600080fd5b83359250613915602085016138d0565b915061392360408501613841565b90509250925092565b60006020828403121561393e57600080fd5b61272082613841565b6020808252825182820181905260009190848201906040850190845b8181101561397f57835183529284019291840191600101613963565b50909695505050505050565b801515811461213d57600080fd5b600080604083850312156139ac57600080fd5b6139b583613841565b915060208301356139c58161398b565b809150509250929050565b600080604083850312156139e357600080fd5b823591506139f3602084016138d0565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060008060808587031215613a4157600080fd5b613a4a85613841565b9350613a5860208601613841565b925060408501359150606085013567ffffffffffffffff80821115613a7c57600080fd5b818701915087601f830112613a9057600080fd5b813581811115613aa257613aa26139fc565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715613ae857613ae86139fc565b816040528281528a6020848701011115613b0157600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600060208284031215613b3757600080fd5b81356127208161398b565b60008060408385031215613b5557600080fd5b613b5e83613841565b91506139f360208401613841565b600181811c90821680613b8057607f821691505b602082108103611f7b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561088b5761088b613bb9565b8082018082111561088b5761088b613bb9565b808202811582820484141761088b5761088b613bb9565b6fffffffffffffffffffffffffffffffff818116838216019080821115613c4e57613c4e613bb9565b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613cb557613cb5613bb9565b5060010190565b600060208284031215613cce57600080fd5b81516127208161398b565b6fffffffffffffffffffffffffffffffff828116828216039080821115613c4e57613c4e613bb9565b600082613d38577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008251613d4f8184602087016137a7565b9190910192915050565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015260806060830152610edc60808301846137cb565b600060208284031215613daa57600080fd5b81516127208161375c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfe68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f43727970746f72756269632f4e46542d6d657461646174612f646576656c6f702f6d65746164617461732f7768616c652e6a736f6e68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f43727970746f72756269632f4e46542d6d657461646174612f646576656c6f702f6d65746164617461732f7275626963616e2e6a736f6e68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f43727970746f72756269632f4e46542d6d657461646174612f646576656c6f702f6d65746164617461732f63756269632e6a736f6ea164736f6c6343000812000a00000000000000000000000010aaed289a7b1b0155bf4b86c862f297e84465e0
Deployed Bytecode
0x6080604052600436106102855760003560e01c8063715018a611610153578063c150b5f2116100cb578063d576dfc01161007f578063e6f4641011610064578063e6f464101461078b578063e985e9c5146107bf578063f2fde38b1461081557600080fd5b8063d576dfc0146106a7578063d5a44f86146106f157600080fd5b8063c87b56dd116100b0578063c87b56dd14610651578063cab64bcd14610671578063d3ea43501461068757600080fd5b8063c150b5f21461061b578063c73d7c7b1461063157600080fd5b80638da5cb5b11610122578063a22cb46511610107578063a22cb465146105bb578063b593bc1a146105db578063b88d4fde146105fb57600080fd5b80638da5cb5b1461057b57806395d89b41146105a657600080fd5b8063715018a6146105035780637b0a47ee146105185780638462151c1461052e5780638b6ca32c1461055b57600080fd5b80632e17de78116102015780634f6ccce7116101b557806363a599a41161019a57806363a599a4146104a95780636e58030d146104c357806370a08231146104e357600080fd5b80634f6ccce7146104695780636352211e1461048957600080fd5b806334fcf437116101e657806334fcf4371461041357806342842e0e1461043357806349496e061461045357600080fd5b80632e17de78146103d35780632f745c59146103f357600080fd5b80630962ef791161025857806316c0ec6f1161023d57806316c0ec6f1461037e57806318160ddd1461039e57806323b872dd146103b357600080fd5b80630962ef791461034857806314d6aed01461037657600080fd5b806301ffc9a71461028a57806306fdde03146102bf578063081812fc146102e1578063095ea7b314610326575b600080fd5b34801561029657600080fd5b506102aa6102a536600461378a565b610835565b60405190151581526020015b60405180910390f35b3480156102cb57600080fd5b506102d4610891565b6040516102b69190613815565b3480156102ed57600080fd5b506103016102fc366004613828565b610923565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102b6565b34801561033257600080fd5b5061034661034136600461386a565b610957565b005b34801561035457600080fd5b50610368610363366004613828565b610ae8565b6040519081526020016102b6565b610346610d9c565b34801561038a57600080fd5b50610368610399366004613828565b610df8565b3480156103aa57600080fd5b50600854610368565b3480156103bf57600080fd5b506103466103ce366004613894565b610ee6565b3480156103df57600080fd5b506103466103ee366004613828565b610f87565b3480156103ff57600080fd5b5061036861040e36600461386a565b611307565b34801561041f57600080fd5b5061034661042e366004613828565b6113d6565b34801561043f57600080fd5b5061034661044e366004613894565b611498565b34801561045f57600080fd5b5061036860115481565b34801561047557600080fd5b50610368610484366004613828565b6114b3565b34801561049557600080fd5b506103016104a4366004613828565b611571565b3480156104b557600080fd5b506012546102aa9060ff1681565b3480156104cf57600080fd5b506103466104de3660046138f0565b6115fd565b3480156104ef57600080fd5b506103686104fe36600461392c565b6117e5565b34801561050f57600080fd5b506103466118b3565b34801561052457600080fd5b50610368600d5481565b34801561053a57600080fd5b5061054e61054936600461392c565b6118c5565b6040516102b69190613947565b34801561056757600080fd5b50610346610576366004613894565b611967565b34801561058757600080fd5b50600b5473ffffffffffffffffffffffffffffffffffffffff16610301565b3480156105b257600080fd5b506102d4611bf6565b3480156105c757600080fd5b506103466105d6366004613999565b611c05565b3480156105e757600080fd5b506103466105f63660046139d0565b611c14565b34801561060757600080fd5b50610346610616366004613a2b565b611d7e565b34801561062757600080fd5b5061036860105481565b34801561063d57600080fd5b5061034661064c366004613b25565b611e20565b34801561065d57600080fd5b506102d461066c366004613828565b611e87565b34801561067d57600080fd5b50610368600e5481565b34801561069357600080fd5b506103686106a2366004613828565b611f81565b3480156106b357600080fd5b50600f546106d0906fffffffffffffffffffffffffffffffff1681565b6040516fffffffffffffffffffffffffffffffff90911681526020016102b6565b3480156106fd57600080fd5b5061075761070c366004613828565b600c602052600090815260409020805460018201546002909201546fffffffffffffffffffffffffffffffff8083169370010000000000000000000000000000000090930416919084565b604080516fffffffffffffffffffffffffffffffff95861681529490931660208501529183015260608201526080016102b6565b34801561079757600080fd5b506103017f00000000000000000000000010aaed289a7b1b0155bf4b86c862f297e84465e081565b3480156107cb57600080fd5b506102aa6107da366004613b42565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561082157600080fd5b5061034661083036600461392c565b612089565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d6300000000000000000000000000000000000000000000000000000000148061088b575061088b82612140565b92915050565b6060600080546108a090613b6c565b80601f01602080910402602001604051908101604052809291908181526020018280546108cc90613b6c565b80156109195780601f106108ee57610100808354040283529160200191610919565b820191906000526020600020905b8154815290600101906020018083116108fc57829003601f168201915b5050505050905090565b600061092e82612223565b5060009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b600061096282611571565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610a24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff82161480610a4d5750610a4d81336107da565b610ad9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610a1b565b610ae383836122ae565b505050565b60006002600a5403610b56576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a1b565b6002600a5581610b66338261234e565b610bcc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e6f7420617574686f72697a65640000000000000000000000000000000000006044820152606401610a1b565b610bd54261240e565b6000838152600c602052604090206001810154610c4e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f616d6f756e742073686f756c6420626520636f727265637400000000000000006044820152606401610a1b565b60018101548154610c9991610c74916fffffffffffffffffffffffffffffffff16612514565b8260020154601154610c869190613be8565b6c01431e0fae6d7217caa0000000612656565b6011546002830155604051909350600090339085908381818185875af1925050503d8060008114610ce6576040519150601f19603f3d011682016040523d82523d6000602084013e610ceb565b606091505b5050905080610d56576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f72657761726473207472616e73666572206661696c65640000000000000000006044820152606401610a1b565b60408051858152602081018790527f022e3d29644ead4083349ca84d24bcac368b2461819b70f5921fea15de4dec4d910160405180910390a150506001600a5550919050565b610da54261240e565b3415610df65734600e6000828254610dbd9190613bfb565b90915550506040513481527fa8c8f6c9639d5a378696689ad02c4ea707de67f3175f609f1c016d3ce94297899060200160405180910390a15b565b600080600d5461016d610e0b9190613c0e565b610e16906018613c0e565b610e2190603c613c0e565b610e2c90603c613c0e565b90506000610e4a826c01431e0fae6d7217caa0000000601054612656565b601154610e579190613bfb565b6000858152600c60209081526040808320815160808101835281546fffffffffffffffffffffffffffffffff808216808452700100000000000000000000000000000000909204169482019490945260018201549281018390526002909101546060820152939450610edc91610ecd9190612514565b6060840151610c869086613be8565b9695505050505050565b610ef0338261234e565b610f7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610a1b565b610ae3838383612727565b6002600a5403610ff3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a1b565b6002600a5580611003338261234e565b611069576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e6f7420617574686f72697a65640000000000000000000000000000000000006044820152606401610a1b565b6110724261240e565b6000828152600c6020908152604091829020825160808101845281546fffffffffffffffffffffffffffffffff8082168084527001000000000000000000000000000000009092041693820184905260018301549482019490945260029091015460608201529142916110e59190613c25565b6fffffffffffffffffffffffffffffffff161080611105575060125460ff165b61116b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6c6f636b2069736e7420657870697265640000000000000000000000000000006044820152606401610a1b565b600061117f82604001518360000151612514565b90506000611199828460600151601154610c869190613be8565b905081601060008282546111ad9190613be8565b925050819055506111e37f00000000000000000000000010aaed289a7b1b0155bf4b86c862f297e84465e0338560400151612999565b604051600090339083908381818185875af1925050503d8060008114611225576040519150601f19603f3d011682016040523d82523d6000602084013e61122a565b606091505b5050905080611295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f72657761726473207472616e73666572206661696c65640000000000000000006044820152606401610a1b565b61129e86612b02565b6000868152600c6020908152604080832083815560018101849055600201929092558582015182519081529081018890527f9045c2ac9b2026de8075f2701bbdde882cd5e830b3b1ead9a15b22f2b5b93742910160405180910390a150506001600a5550505050565b6000611312836117e5565b82106113a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610a1b565b5073ffffffffffffffffffffffffffffffffffffffff919091166000908152600660209081526040808320938352929052205490565b6113de612bdb565b6b033b2e3c9fd0803ce80000008110611453576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f746f6f20686967682072617465000000000000000000000000000000000000006044820152606401610a1b565b61145c4261240e565b600d8190556040518181527f3e7f4cf5fff23ca5c3b06a93850397f53c61b3f180714cf98f14e0b000a94ab9906020015b60405180910390a150565b610ae383838360405180602001604052806000815250611d7e565b60006114be60085490565b821061154c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610a1b565b6008828154811061155f5761155f613c55565b90600052602060002001549050919050565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff168061088b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610a1b565b60008311611667576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f7374616b6520616d6f756e742073686f756c6420626520636f727265637400006044820152606401610a1b565b73ffffffffffffffffffffffffffffffffffffffff81166116e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f746f206973207a65726f000000000000000000000000000000000000000000006044820152606401610a1b565b60125460ff1615611751576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7374616b696e672069732073746f7070656400000000000000000000000000006044820152606401610a1b565b61177d7f00000000000000000000000010aaed289a7b1b0155bf4b86c862f297e84465e0333086612c5c565b600061178a848484612dd5565b604080518681526fffffffffffffffffffffffffffffffff861660208201529081018290529091507fa62eb7c552fa69d1576e9ee8ccc35ebf741a0a7eb11c7bb5ab21f2fc5545529c9060600160405180910390a150505050565b600073ffffffffffffffffffffffffffffffffffffffff821661188a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610a1b565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b6118bb612bdb565b610df66000612e97565b606060006118d2836117e5565b905060008167ffffffffffffffff8111156118ef576118ef6139fc565b604051908082528060200260200182016040528015611918578160200160208202803683370190505b50905060005b8281101561195f576119308582611307565b82828151811061194257611942613c55565b60209081029190910101528061195781613c84565b91505061191e565b509392505050565b61196f612bdb565b7f00000000000000000000000010aaed289a7b1b0155bf4b86c862f297e84465e073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611a24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f63616e6e6f7420737765657020524243000000000000000000000000000000006044820152606401610a1b565b600073ffffffffffffffffffffffffffffffffffffffff831615611a485782611a4a565b335b905073ffffffffffffffffffffffffffffffffffffffff8416611b5557611a704261240e565b81600e6000828254611a829190613be8565b909155505060405160009073ffffffffffffffffffffffffffffffffffffffff83169084908381818185875af1925050503d8060008114611adf576040519150601f19603f3d011682016040523d82523d6000602084013e611ae4565b606091505b5050905080611b4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f72657761726473207472616e73666572206661696c65640000000000000000006044820152606401610a1b565b50611bf0565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301526024820184905285169063a9059cbb906044016020604051808303816000875af1158015611bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bee9190613cbc565b505b50505050565b6060600180546108a090613b6c565b611c10338383612f0e565b5050565b60008211611c7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f7374616b6520616d6f756e742073686f756c6420626520636f727265637400006044820152606401610a1b565b60125460ff1615611ceb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f7374616b696e672069732073746f7070656400000000000000000000000000006044820152606401610a1b565b611d177f00000000000000000000000010aaed289a7b1b0155bf4b86c862f297e84465e0333085612c5c565b6000611d24838333612dd5565b604080518581526fffffffffffffffffffffffffffffffff851660208201529081018290529091507fa62eb7c552fa69d1576e9ee8ccc35ebf741a0a7eb11c7bb5ab21f2fc5545529c9060600160405180910390a1505050565b611d88338361234e565b611e14576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610a1b565b611bf08484848461303b565b611e28612bdb565b601280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168215159081179091556040519081527fcbe1b789cda412d9e1c647ed03d0c71e2f71484be36f9ca2b2a346b29edf1b709060200161148d565b6060611e9282612223565b6000828152600c6020908152604091829020825160808101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000090910416928101929092526001810154928201839052600201546060820152906969e10de76676d080000011611f2657604051806080016040528060578152602001613de5605791399392505050565b69152d02c7e14af6800000816040015110611f5b57604051806080016040528060578152602001613e95605791399392505050565b604051806080016040528060598152602001613e3c605991399392505050565b50919050565b600d54601154600091908282611f98576000611f9c565b600e545b9050801561200557600f54600090611fc6906fffffffffffffffffffffffffffffffff1642613be8565b611fd09085613c0e565b905081811115611fdd5750805b611ff7816c01431e0fae6d7217caa0000000601054612656565b6120019084613bfb565b9250505b6000858152600c6020908152604091829020825160808101845281546fffffffffffffffffffffffffffffffff80821680845270010000000000000000000000000000000090920416938201939093526001820154938101849052600290910154606082015291610edc9161207a9190612514565b6060830151610c869086613be8565b612091612bdb565b73ffffffffffffffffffffffffffffffffffffffff8116612134576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a1b565b61213d81612e97565b50565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd0000000000000000000000000000000000000000000000000000000014806121d357507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061088b57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461088b565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1661213d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610a1b565b600081815260046020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8416908117909155819061230882611571565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061235a83611571565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806123c8575073ffffffffffffffffffffffffffffffffffffffff80821660009081526005602090815260408083209388168352929052205460ff165b8061240657508373ffffffffffffffffffffffffffffffffffffffff166123ee84610923565b73ffffffffffffffffffffffffffffffffffffffff16145b949350505050565b60125460ff161561241c5750565b600d5460008161242d576000612431565b600e545b601054909150156124cf5780156124cf57600f54600090612464906fffffffffffffffffffffffffffffffff1685613cd9565b612480906fffffffffffffffffffffffffffffffff1684613c0e565b90508181111561248d5750805b6124978183613be8565b600e819055506124b7816c01431e0fae6d7217caa0000000601054612656565b601160008282546124c89190613bfb565b9091555050505b5050600f80547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff92909216919091179055565b6000816fffffffffffffffffffffffffffffffff1662278d000361254f57600a61253e8482613c0e565b6125489190613d02565b905061088b565b816fffffffffffffffffffffffffffffffff166276a7000361257757600a61253e8482613c0e565b816fffffffffffffffffffffffffffffffff1662ed4e00036125a057600a61253e84600c613c0e565b816fffffffffffffffffffffffffffffffff16630163f500036125ca57600a61253e84600f613c0e565b816fffffffffffffffffffffffffffffffff166301da9c00036125f457600a61253e846014613c0e565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f696e636f7272656374206c6f636b0000000000000000000000000000000000006044820152606401610a1b565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050806000036126ad57600084116126a257600080fd5b508290049050612720565b8084116126b957600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b8273ffffffffffffffffffffffffffffffffffffffff1661274782611571565b73ffffffffffffffffffffffffffffffffffffffff16146127ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610a1b565b73ffffffffffffffffffffffffffffffffffffffff821661288c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610a1b565b6128978383836130de565b6128a26000826122ae565b73ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604081208054600192906128d8908490613be8565b909155505073ffffffffffffffffffffffffffffffffffffffff82166000908152600360205260408120805460019290612913908490613bfb565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790529151600092839290871691612a309190613d3d565b6000604051808303816000865af19150503d8060008114612a6d576040519150601f19603f3d011682016040523d82523d6000602084013e612a72565b606091505b5091509150818015612a9c575080511580612a9c575080806020019051810190612a9c9190613cbc565b611bee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f53540000000000000000000000000000000000000000000000000000000000006044820152606401610a1b565b6000612b0d82611571565b9050612b1b816000846130de565b612b266000836122ae565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260408120805460019290612b5c908490613be8565b909155505060008281526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555183919073ffffffffffffffffffffffffffffffffffffffff8416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b600b5473ffffffffffffffffffffffffffffffffffffffff163314610df6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1b565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790529151600092839290881691612cfb9190613d3d565b6000604051808303816000865af19150503d8060008114612d38576040519150601f19603f3d011682016040523d82523d6000602084013e612d3d565b606091505b5091509150818015612d67575080511580612d67575080806020019051810190612d679190613cbc565b612dcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f53544600000000000000000000000000000000000000000000000000000000006044820152606401610a1b565b505050505050565b6000612de04261240e565b612dea8484612514565b60106000828254612dfb9190613bfb565b909155505060138054906000612e1083613c84565b90915550604080516080810182526fffffffffffffffffffffffffffffffff808716825242811660208084019182528385018a8152601154606086019081526000888152600c9093529590912093519151831670010000000000000000000000000000000002919092161782555160018201559051600290910155905061272082826131e4565b600b805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612fa3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610a1b565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526005602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613046848484612727565b613052848484846133b2565b611bf0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610a1b565b73ffffffffffffffffffffffffffffffffffffffff83166131465761314181600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b613183565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146131835761318383826135a5565b73ffffffffffffffffffffffffffffffffffffffff82166131a757610ae38161365c565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610ae357610ae3828261370b565b73ffffffffffffffffffffffffffffffffffffffff8216613261576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a1b565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16156132ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610a1b565b6132f9600083836130de565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260036020526040812080546001929061332f908490613bfb565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600073ffffffffffffffffffffffffffffffffffffffff84163b1561359a576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a0290613429903390899088908890600401613d59565b6020604051808303816000875af1925050508015613482575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261347f91810190613d98565b60015b61354f573d8080156134b0576040519150601f19603f3d011682016040523d82523d6000602084013e6134b5565b606091505b508051600003613547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610a1b565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050612406565b506001949350505050565b600060016135b2846117e5565b6135bc9190613be8565b60008381526007602052604090205490915080821461361c5773ffffffffffffffffffffffffffffffffffffffff841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b50600091825260076020908152604080842084905573ffffffffffffffffffffffffffffffffffffffff9094168352600681528383209183525290812055565b60085460009061366e90600190613be8565b6000838152600960205260408120546008805493945090928490811061369657613696613c55565b9060005260206000200154905080600883815481106136b7576136b7613c55565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806136ef576136ef613db5565b6001900381819060005260206000200160009055905550505050565b6000613716836117e5565b73ffffffffffffffffffffffffffffffffffffffff9093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461213d57600080fd5b60006020828403121561379c57600080fd5b81356127208161375c565b60005b838110156137c25781810151838201526020016137aa565b50506000910152565b600081518084526137e38160208601602086016137a7565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061272060208301846137cb565b60006020828403121561383a57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461386557600080fd5b919050565b6000806040838503121561387d57600080fd5b61388683613841565b946020939093013593505050565b6000806000606084860312156138a957600080fd5b6138b284613841565b92506138c060208501613841565b9150604084013590509250925092565b80356fffffffffffffffffffffffffffffffff8116811461386557600080fd5b60008060006060848603121561390557600080fd5b83359250613915602085016138d0565b915061392360408501613841565b90509250925092565b60006020828403121561393e57600080fd5b61272082613841565b6020808252825182820181905260009190848201906040850190845b8181101561397f57835183529284019291840191600101613963565b50909695505050505050565b801515811461213d57600080fd5b600080604083850312156139ac57600080fd5b6139b583613841565b915060208301356139c58161398b565b809150509250929050565b600080604083850312156139e357600080fd5b823591506139f3602084016138d0565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060008060808587031215613a4157600080fd5b613a4a85613841565b9350613a5860208601613841565b925060408501359150606085013567ffffffffffffffff80821115613a7c57600080fd5b818701915087601f830112613a9057600080fd5b813581811115613aa257613aa26139fc565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715613ae857613ae86139fc565b816040528281528a6020848701011115613b0157600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600060208284031215613b3757600080fd5b81356127208161398b565b60008060408385031215613b5557600080fd5b613b5e83613841565b91506139f360208401613841565b600181811c90821680613b8057607f821691505b602082108103611f7b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561088b5761088b613bb9565b8082018082111561088b5761088b613bb9565b808202811582820484141761088b5761088b613bb9565b6fffffffffffffffffffffffffffffffff818116838216019080821115613c4e57613c4e613bb9565b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613cb557613cb5613bb9565b5060010190565b600060208284031215613cce57600080fd5b81516127208161398b565b6fffffffffffffffffffffffffffffffff828116828216039080821115613c4e57613c4e613bb9565b600082613d38577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008251613d4f8184602087016137a7565b9190910192915050565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015260806060830152610edc60808301846137cb565b600060208284031215613daa57600080fd5b81516127208161375c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfe68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f43727970746f72756269632f4e46542d6d657461646174612f646576656c6f702f6d65746164617461732f7768616c652e6a736f6e68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f43727970746f72756269632f4e46542d6d657461646174612f646576656c6f702f6d65746164617461732f7275626963616e2e6a736f6e68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f43727970746f72756269632f4e46542d6d657461646174612f646576656c6f702f6d65746164617461732f63756269632e6a736f6ea164736f6c6343000812000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000010aaed289a7b1b0155bf4b86c862f297e84465e0
-----Decoded View---------------
Arg [0] : _RBC (address): 0x10aAeD289a7b1B0155bF4b86c862f297E84465e0
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000010aaed289a7b1b0155bf4b86c862f297e84465e0
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.