Source Code
Overview
GLMR Balance
GLMR Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
RentalMarket1155
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.13;
import {LendOrder, RentOffer} from "../constant/RentalStructs.sol";
import "./BaseRentalMarket.sol";
import "./IRentalMarket1155.sol";
import "../bank/IBank1155.sol";
contract RentalMarket1155 is BaseRentalMarket, IRentalMarket1155 {
constructor() {
_disableInitializers();
}
function initialize(
address owner_,
address admin_,
address bank_
) public initializer {
require(IBank(bank_).supportsInterface(type(IBank1155).interfaceId));
_initialize(owner_, admin_, bank_);
}
function registerBank(address oNFT, address bank) external onlyAdmin {
require(IBank(bank).supportsInterface(type(IBank1155).interfaceId));
_registerBank(oNFT, bank);
}
function fulfillLendOrder1155(
LendOrder calldata lendOrder,
Signature calldata signature,
uint64 tokenAmount,
uint256 cycleAmount,
IBank1155.RentingRecord[] calldata toDeletes
) external payable whenNotPaused nonReentrant {
require(cycleAmount >= lendOrder.minCycleAmount, "invalid cycleAmount");
bytes32 orderHash = _hashStruct_LendOrder(lendOrder);
_validateOrder(
lendOrder.maker,
lendOrder.taker,
lendOrder.nonce,
orderHash
);
_validateSignature(lendOrder.maker, orderHash, signature);
uint256 duration = lendOrder.price.cycle * cycleAmount;
uint256 rentExpiry = block.timestamp + duration;
require(duration <= maxDuration, "The duration is too long");
require(
rentExpiry <= lendOrder.maxRentExpiry,
"The duration is too long"
);
_handleFrozen(lendOrder, tokenAmount, toDeletes);
IBank1155.RecordParam memory param = IBank1155.RecordParam(
0,
lendOrder.nft.tokenType,
lendOrder.nft.token,
lendOrder.nft.tokenId,
tokenAmount,
lendOrder.maker,
msg.sender,
rentExpiry
);
IBank1155(bankOf(lendOrder.nft.token)).createUserRecord(param);
_distributePayment(
lendOrder.price,
cycleAmount,
tokenAmount,
lendOrder.fees,
lendOrder.maker,
msg.sender
);
emit LendOrderFulfilled(
orderHash,
lendOrder.nft,
lendOrder.price,
tokenAmount,
cycleAmount,
lendOrder.maker,
msg.sender
);
}
function fulfillRentOffer1155(
RentOffer calldata rentOffer,
Signature calldata signature,
IBank1155.RentingRecord[] calldata toDeletes
) public whenNotPaused nonReentrant {
bytes32 offerHash = _hashStruct_RentOffer(rentOffer);
_validateOrder(
rentOffer.maker,
rentOffer.taker,
rentOffer.nonce,
offerHash
);
require(
block.timestamp <= rentOffer.offerExpiry,
"The offer has expired"
);
_validateSignature(rentOffer.maker, offerHash, signature);
IBank1155 bank = IBank1155(bankOf(rentOffer.nft.token));
bank.deleteUserRecords(toDeletes);
uint256 duration = rentOffer.price.cycle * rentOffer.cycleAmount;
require(duration <= maxDuration, "The duration is too long");
uint256 rentExpiry = block.timestamp + duration;
IBank1155.RecordParam memory param = IBank1155.RecordParam(
0,
rentOffer.nft.tokenType,
rentOffer.nft.token,
rentOffer.nft.tokenId,
rentOffer.nft.amount,
msg.sender,
rentOffer.maker,
rentExpiry
);
bank.createUserRecord(param);
_distributePayment(
rentOffer.price,
rentOffer.cycleAmount,
rentOffer.nft.amount,
rentOffer.fees,
msg.sender,
rentOffer.maker
);
cancelledOrFulfilled[offerHash] = true;
emit RentOfferFulfilled(
offerHash,
rentOffer.nft,
rentOffer.price,
rentOffer.nft.amount,
rentOffer.cycleAmount,
msg.sender,
rentOffer.maker
);
}
function _handleFrozen(
LendOrder calldata lendOrder,
uint64 tokenAmount,
IBank1155.RentingRecord[] calldata toDeletes
) internal {
IBank1155 bank = IBank1155(bankOf(lendOrder.nft.token));
bank.deleteUserRecords(toDeletes);
uint256 frozenAmount = bank.frozenAmountOf(
lendOrder.nft.token,
lendOrder.nft.tokenId,
lendOrder.maker
);
require(
frozenAmount + tokenAmount <= lendOrder.nft.amount,
"insufficient remaining amount"
);
}
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.13;
import {NFT, Fee, Metadata} from "./BaseStructs.sol";
struct RentalPrice {
address paymentToken;
uint256 pricePerCycle;
uint256 cycle;
}
struct LendOrder {
address maker;
address taker; //private order
NFT nft;
RentalPrice price;
uint256 minCycleAmount;
uint256 maxRentExpiry;
uint256 nonce;
uint256 salt;
uint64 durationId;
Fee[] fees;
Metadata metadata;
}
struct RentOffer {
address maker;
address taker; //private order
NFT nft;
RentalPrice price;
uint256 cycleAmount;
uint256 offerExpiry;
uint256 nonce;
uint256 salt;
Fee[] fees;
Metadata metadata;
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/utils/Multicall.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
import "../lib/Pauseable.sol";
import "../lib/ENSReverseRegistrar.sol";
import "../bank/IBank.sol";
import "./IRentalMarket.sol";
import "../validater/EIP712.sol";
import "../validater/IMetadataChecker.sol";
import {Fee} from "../constant/BaseStructs.sol";
abstract contract BaseRentalMarket is
IRentalMarket,
Pauseable,
ENSReverseRegistrar,
ReentrancyGuardUpgradeable,
Multicall,
EIP712
{
/* Storage */
mapping(bytes32 => bool) internal cancelledOrFulfilled;
mapping(address => uint256) internal nonces;
mapping(address => address) internal bankMap;
address internal _baseBank;
uint256 internal maxDuration;
uint256[64] private __gap;
function _initialize(
address owner_,
address admin_,
address baseBank_
) internal onlyInitializing {
__ReentrancyGuard_init();
_initOwnable(owner_, admin_);
_baseBank = baseBank_;
IBank(_baseBank).bindMarket(address(this));
_hashDomain();
isPausing = false;
maxDuration = 86400 * 180;
}
function nonceOf(address account) public view returns (uint256) {
return nonces[account];
}
function bankOf(address oNFT) public view returns (address) {
return bankMap[oNFT] == address(0) ? _baseBank : bankMap[oNFT];
}
function _registerBank(address oNFT, address bank) internal {
IBank(bank).bindMarket(address(this));
bankMap[oNFT] = bank;
}
function cancelLendOrder(LendOrder calldata lendOrder) public {
require(
msg.sender == lendOrder.maker,
"only maker can cancel the order"
);
bytes32 orderHash = _hashStruct_LendOrder(lendOrder);
if(cancelledOrFulfilled[orderHash]) return;
cancelledOrFulfilled[orderHash] = true;
emit OrderCancelled(orderHash);
}
function cancelRentOffer(RentOffer calldata rentOffer) public {
require(
msg.sender == rentOffer.maker,
"only maker can cancel the offer"
);
bytes32 offerHash = _hashStruct_RentOffer(rentOffer);
if(cancelledOrFulfilled[offerHash]) return;
cancelledOrFulfilled[offerHash] = true;
emit OfferCancelled(offerHash);
}
/**
* @dev Cancel all current orders for a user, preventing them from being matched. Must be called by the trader of the order
*/
function incrementNonce() external {
nonces[msg.sender] += 1;
emit NonceIncremented(msg.sender, nonces[msg.sender]);
}
function _distributePayment(
RentalPrice calldata price,
uint256 cycleAmount,
uint256 nftAmount,
Fee[] calldata fees,
address lender,
address renter
) internal {
uint256 totalPrice = price.pricePerCycle * cycleAmount * nftAmount;
uint16 totalFeesRate;
for (uint256 i = 0; i < fees.length; i++) {
totalFeesRate += fees[i].rate;
}
uint256 totalFee = (totalPrice * totalFeesRate) / 100_000;
uint256 leftTotalPrice = totalPrice - totalFee;
if (price.paymentToken == address(0)) {
require(msg.value >= totalPrice, "payment is not enough");
Address.sendValue(payable(lender), leftTotalPrice);
if (msg.value > totalPrice) {
Address.sendValue(payable(renter), msg.value - totalPrice);
}
for (uint256 i = 0; i < fees.length; i++) {
Address.sendValue(
fees[i].recipient,
(totalPrice * fees[i].rate) / 100_000
);
}
} else {
SafeERC20.safeTransferFrom(
IERC20(price.paymentToken),
renter,
lender,
leftTotalPrice
);
for (uint256 i = 0; i < fees.length; i++) {
SafeERC20.safeTransferFrom(
IERC20(price.paymentToken),
renter,
fees[i].recipient,
(totalPrice * fees[i].rate) / 100_000
);
}
}
}
function _validateOrder(
address maker,
address taker,
uint256 nonce,
bytes32 orderHash
) internal view {
require(taker == address(0) || taker == msg.sender, "invalid taker");
require(nonce == nonces[maker], "nonce already expired");
require(
!cancelledOrFulfilled[orderHash],
"Be cancelled or fulfilled already"
);
}
function _validateMetadata(
NFT calldata nft,
Metadata calldata metadata
) internal view {
if (metadata.checker != address(0)) {
bool isValid = IMetadataChecker(metadata.checker).check(
nft.token,
nft.tokenId,
metadata.metadataHash
);
require(isValid, "metadata is invalid");
}
}
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.13;
import "./IRentalMarket.sol";
interface IRentalMarket1155 is IRentalMarket {
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;
import {TokenType} from "../constant/TokenEnums.sol";
import "../erc5006/IERC5006.sol";
interface IBank1155 {
struct RecordParam {
uint256 recordId;
TokenType tokenType;
address oNFT;
uint256 oNFTId;
uint256 oNFTAmount;
address owner;
address user;
uint256 expiry;
}
struct RentingRecord{
TokenType tokenType;
address oNFT;
uint256 oNFTId;
address lender;
uint256 recordId;
}
struct Renting{
address lender;
uint256 amount;
}
event CreateUserRecord(RecordParam param);
event DeleteUserRecord(RentingRecord param);
function createUserRecord(RecordParam memory param) external;
function deleteUserRecords(RentingRecord[] calldata toDeletes) external;
function frozenAmountOf(
address oNFT,
uint256 oNFTId,
address from
) external view returns (uint256);
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.13;
import {TokenType} from "./TokenEnums.sol";
enum SignatureVersion {
EIP712,
EIP1271
}
struct NFT {
TokenType tokenType;
address token;
uint256 tokenId;
uint256 amount;
}
struct Fee {
uint16 rate;
address payable recipient;
}
struct Signature {
bytes signature;
SignatureVersion signatureVersion;
}
struct Metadata {
bytes32 metadataHash;
address checker;
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.13;
enum TokenType {
ERC721,
ERC721_subNFT, //Reserved Field
ERC721_vNFT, //Reserved Field
ERC1155,
ERC4907,
ERC5006,
ERC20,
NATIVE
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Address.sol";
import "./OwnableUpgradeable.sol";
abstract contract ENSReverseRegistrar is OwnableUpgradeable {
function ENS_setName(string memory name) public onlyAdmin {
uint256 id;
assembly {
id := chainid()
}
bytes memory _data = abi.encodeWithSignature("setName(string)", name);
require(id == 1, "not mainnet");
Address.functionCall(
address(0x084b1c3C81545d370f3634392De611CaaBFf8148),
_data
);
}
}// SPDX-License-Identifier: CC0-1.0
pragma solidity 0.8.13;
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
import {LendOrder, RentalPrice, RentOffer} from "../constant/RentalStructs.sol";
import {NFT, Fee, SignatureVersion, Signature, Metadata} from "../constant/BaseStructs.sol";
import {SignatureVerificationErrors} from "./SignatureVerificationErrors.sol";
import {EIP1271Interface} from "./EIP1271Interface.sol";
/**
* @title EIP712
* @dev Contains all of the order hashing functions for EIP712 compliant signatures
*/
contract EIP712 is SignatureVerificationErrors {
// Signature-related
bytes32 internal constant EIP2098_allButHighestBitMask = (
0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
);
bytes32 internal constant NFT_TYPEHASH =
keccak256(
"NFT(uint8 tokenType,address token,uint256 tokenId,uint256 amount)"
);
bytes32 internal constant RENTAL_PRICE_TYPEHASH =
keccak256(
"RentalPrice(address paymentToken,uint256 pricePerCycle,uint256 cycle)"
);
bytes32 internal constant FEE_TYPEHASH =
keccak256("Fee(uint16 rate,address recipient)");
bytes32 internal constant METADATA_TYPEHASH =
keccak256("Metadata(bytes32 metadataHash,address checker)");
bytes32 internal constant LEND_ORDER_TYPEHASH =
keccak256(
"LendOrder(address maker,address taker,NFT nft,RentalPrice price,uint256 minCycleAmount,uint256 maxRentExpiry,uint256 nonce,uint256 salt,uint64 durationId,Fee[] fees,Metadata metadata)Fee(uint16 rate,address recipient)Metadata(bytes32 metadataHash,address checker)NFT(uint8 tokenType,address token,uint256 tokenId,uint256 amount)RentalPrice(address paymentToken,uint256 pricePerCycle,uint256 cycle)"
);
bytes32 internal constant RENT_OFFER_TYPEHASH =
keccak256(
"RentOffer(address maker,address taker,NFT nft,RentalPrice price,uint256 cycleAmount,uint256 offerExpiry,uint256 nonce,uint256 salt,Fee[] fees,Metadata metadata)Fee(uint16 rate,address recipient)Metadata(bytes32 metadataHash,address checker)NFT(uint8 tokenType,address token,uint256 tokenId,uint256 amount)RentalPrice(address paymentToken,uint256 pricePerCycle,uint256 cycle)"
);
bytes32 internal constant DOMAIN =
keccak256(
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
);
bytes32 internal constant NAME = keccak256("Double");
bytes32 internal constant VERSION = keccak256("1.0.0");
bytes32 DOMAIN_SEPARATOR;
function _hashDomain() internal {
DOMAIN_SEPARATOR = keccak256(
abi.encode(DOMAIN, NAME, VERSION, block.chainid, address(this))
);
}
function _getEIP712Hash(bytes32 structHash) internal view returns (bytes32) {
return
keccak256(
abi.encodePacked(hex"1901", DOMAIN_SEPARATOR, structHash)
);
}
function _hashStruct_NFT(NFT calldata nft) internal pure returns (bytes32) {
return keccak256(abi.encode(NFT_TYPEHASH, nft));
}
function _hashStruct_Metadata(
Metadata calldata metadata
) internal pure returns (bytes32) {
return keccak256(abi.encode(METADATA_TYPEHASH, metadata));
}
function _hashStruct_RentalPrice(
RentalPrice calldata price
) internal pure returns (bytes32) {
return keccak256(abi.encode(RENTAL_PRICE_TYPEHASH, price));
}
function _hashFee(Fee calldata fee) internal pure returns (bytes32) {
return keccak256(abi.encode(FEE_TYPEHASH, fee.rate, fee.recipient));
}
function _packFees(Fee[] calldata fees) internal pure returns (bytes32) {
bytes32[] memory feeHashes = new bytes32[](fees.length);
for (uint256 i = 0; i < fees.length; i++) {
feeHashes[i] = _hashFee(fees[i]);
}
return keccak256(abi.encodePacked(feeHashes));
}
function _hashStruct_LendOrder(
LendOrder calldata order
) internal pure returns (bytes32) {
return
keccak256(
abi.encode(
LEND_ORDER_TYPEHASH,
order.maker,
order.taker,
_hashStruct_NFT(order.nft),
_hashStruct_RentalPrice(order.price),
order.minCycleAmount,
order.maxRentExpiry,
order.nonce,
order.salt,
order.durationId,
_packFees(order.fees),
_hashStruct_Metadata(order.metadata)
)
);
}
function _hashStruct_RentOffer(
RentOffer calldata rentOffer
) internal pure returns (bytes32) {
return
keccak256(
abi.encode(
RENT_OFFER_TYPEHASH,
rentOffer.maker,
rentOffer.taker,
_hashStruct_NFT(rentOffer.nft),
_hashStruct_RentalPrice(rentOffer.price),
rentOffer.cycleAmount,
rentOffer.offerExpiry,
rentOffer.nonce,
rentOffer.salt,
_packFees(rentOffer.fees),
_hashStruct_Metadata(rentOffer.metadata)
)
);
}
function _validateSignature(
address signer,
bytes32 orderHash,
Signature memory signature
) internal view {
bytes32 hashToSign = _getEIP712Hash(orderHash);
_assertValidSignature(signer, hashToSign, signature.signature);
}
/**
* @dev Internal view function to verify the signature of an order. An
* ERC-1271 fallback will be attempted if either the signature length
* is not 64 or 65 bytes or if the recovered signer does not match the
* supplied signer. Note that in cases where a 64 or 65 byte signature
* is supplied, only standard ECDSA signatures that recover to a
* non-zero address are supported.
*
* @param signer The signer for the order.
* @param digest The digest to verify the signature against.
* @param signature A signature from the signer indicating that the order
* has been approved.
*/
function _assertValidSignature(
address signer,
bytes32 digest,
bytes memory signature
) internal view {
// Declare r, s, and v signature parameters.
bytes32 r;
bytes32 s;
uint8 v;
if (signer.code.length > 0) {
// If signer is a contract, try verification via EIP-1271.
_assertValidEIP1271Signature(signer, digest, signature);
// Return early if the ERC-1271 signature check succeeded.
return;
} else if (signature.length == 64) {
// If signature contains 64 bytes, parse as EIP-2098 signature. (r+s&v)
// Declare temporary vs that will be decomposed into s and v.
bytes32 vs;
(r, vs) = abi.decode(signature, (bytes32, bytes32));
s = vs & EIP2098_allButHighestBitMask;
v = SafeCast.toUint8(uint256(vs >> 255)) + 27;
} else if (signature.length == 65) {
(r, s) = abi.decode(signature, (bytes32, bytes32));
v = uint8(signature[64]);
// Ensure v value is properly formatted.
if (v != 27 && v != 28) {
revert BadSignatureV(v);
}
} else {
revert InvalidSignature();
}
// Attempt to recover signer using the digest and signature parameters.
address recoveredSigner = ecrecover(digest, v, r, s);
// Disallow invalid signers.
if (recoveredSigner == address(0) || recoveredSigner != signer) {
revert InvalidSigner();
// Should a signer be recovered, but it doesn't match the signer...
}
}
/**
* @dev Internal view function to verify the signature of an order using
* ERC-1271 (i.e. contract signatures via `isValidSignature`).
*
* @param signer The signer for the order.
* @param digest The signature digest, derived from the domain separator
* and the order hash.
* @param signature A signature (or other data) used to validate the digest.
*/
function _assertValidEIP1271Signature(
address signer,
bytes32 digest,
bytes memory signature
) internal view {
if (
EIP1271Interface(signer).isValidSignature(digest, signature) !=
EIP1271Interface.isValidSignature.selector
) {
revert InvalidSigner();
}
}
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {TokenType} from "../constant/TokenEnums.sol";
import {NFT} from "../constant/BaseStructs.sol";
interface IBank is IERC165 {
function bindMarket(address market_) external;
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.13;
import "./OwnableUpgradeable.sol";
abstract contract Pauseable is OwnableUpgradeable {
event Paused(address account);
event Unpaused(address account);
bool public isPausing;
modifier whenNotPaused() {
require(!isPausing, "Pausable: paused");
_;
}
function setPause(bool pause_) external onlyAdmin {
isPausing = pause_;
if (isPausing) {
emit Paused(address(this));
} else {
emit Unpaused(address(this));
}
}
}// SPDX-License-Identifier: CC0-1.0
pragma solidity 0.8.13;
interface IMetadataChecker {
function check(
address nft721,
uint256 nftId,
bytes32 metadataHash
) external view returns (bool);
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.13;
import {RentalPrice} from "../constant/RentalStructs.sol";
import {NFT} from "../constant/BaseStructs.sol";
interface IRentalMarket {
event OrderCancelled(bytes32 hash);
event OfferCancelled(bytes32 hash);
event NonceIncremented(address trader, uint256 newNonce);
event LendOrderFulfilled(
bytes32 hash,
NFT nft,
RentalPrice price,
uint256 amount,
uint256 cycleAmount,
address lender,
address renter
);
event RentOfferFulfilled(
bytes32 hash,
NFT nft,
RentalPrice price,
uint256 amount,
uint256 cycleAmount,
address lender,
address renter
);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Multicall.sol)
pragma solidity ^0.8.0;
import "./Address.sol";
/**
* @dev Provides a function to batch together multiple calls in a single external call.
*
* _Available since v4.1._
*/
abstract contract Multicall {
/**
* @dev Receives and executes a batch of function calls on this contract.
*/
function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) {
results = new bytes[](data.length);
for (uint256 i = 0; i < data.length; i++) {
results[i] = Address.functionDelegateCall(address(this), data[i]);
}
return results;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @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 ReentrancyGuardUpgradeable is Initializable {
// 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;
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
_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;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/math/SafeCast.sol)
pragma solidity ^0.8.0;
/**
* @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such an operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*
* Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
* all math on `uint256` and `int256` and then downcasting.
*/
library SafeCast {
/**
* @dev Returns the downcasted uint248 from uint256, reverting on
* overflow (when the input is greater than largest uint248).
*
* Counterpart to Solidity's `uint248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*
* _Available since v4.7._
*/
function toUint248(uint256 value) internal pure returns (uint248) {
require(value <= type(uint248).max, "SafeCast: value doesn't fit in 248 bits");
return uint248(value);
}
/**
* @dev Returns the downcasted uint240 from uint256, reverting on
* overflow (when the input is greater than largest uint240).
*
* Counterpart to Solidity's `uint240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*
* _Available since v4.7._
*/
function toUint240(uint256 value) internal pure returns (uint240) {
require(value <= type(uint240).max, "SafeCast: value doesn't fit in 240 bits");
return uint240(value);
}
/**
* @dev Returns the downcasted uint232 from uint256, reverting on
* overflow (when the input is greater than largest uint232).
*
* Counterpart to Solidity's `uint232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*
* _Available since v4.7._
*/
function toUint232(uint256 value) internal pure returns (uint232) {
require(value <= type(uint232).max, "SafeCast: value doesn't fit in 232 bits");
return uint232(value);
}
/**
* @dev Returns the downcasted uint224 from uint256, reverting on
* overflow (when the input is greater than largest uint224).
*
* Counterpart to Solidity's `uint224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*
* _Available since v4.2._
*/
function toUint224(uint256 value) internal pure returns (uint224) {
require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits");
return uint224(value);
}
/**
* @dev Returns the downcasted uint216 from uint256, reverting on
* overflow (when the input is greater than largest uint216).
*
* Counterpart to Solidity's `uint216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*
* _Available since v4.7._
*/
function toUint216(uint256 value) internal pure returns (uint216) {
require(value <= type(uint216).max, "SafeCast: value doesn't fit in 216 bits");
return uint216(value);
}
/**
* @dev Returns the downcasted uint208 from uint256, reverting on
* overflow (when the input is greater than largest uint208).
*
* Counterpart to Solidity's `uint208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*
* _Available since v4.7._
*/
function toUint208(uint256 value) internal pure returns (uint208) {
require(value <= type(uint208).max, "SafeCast: value doesn't fit in 208 bits");
return uint208(value);
}
/**
* @dev Returns the downcasted uint200 from uint256, reverting on
* overflow (when the input is greater than largest uint200).
*
* Counterpart to Solidity's `uint200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*
* _Available since v4.7._
*/
function toUint200(uint256 value) internal pure returns (uint200) {
require(value <= type(uint200).max, "SafeCast: value doesn't fit in 200 bits");
return uint200(value);
}
/**
* @dev Returns the downcasted uint192 from uint256, reverting on
* overflow (when the input is greater than largest uint192).
*
* Counterpart to Solidity's `uint192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*
* _Available since v4.7._
*/
function toUint192(uint256 value) internal pure returns (uint192) {
require(value <= type(uint192).max, "SafeCast: value doesn't fit in 192 bits");
return uint192(value);
}
/**
* @dev Returns the downcasted uint184 from uint256, reverting on
* overflow (when the input is greater than largest uint184).
*
* Counterpart to Solidity's `uint184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*
* _Available since v4.7._
*/
function toUint184(uint256 value) internal pure returns (uint184) {
require(value <= type(uint184).max, "SafeCast: value doesn't fit in 184 bits");
return uint184(value);
}
/**
* @dev Returns the downcasted uint176 from uint256, reverting on
* overflow (when the input is greater than largest uint176).
*
* Counterpart to Solidity's `uint176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*
* _Available since v4.7._
*/
function toUint176(uint256 value) internal pure returns (uint176) {
require(value <= type(uint176).max, "SafeCast: value doesn't fit in 176 bits");
return uint176(value);
}
/**
* @dev Returns the downcasted uint168 from uint256, reverting on
* overflow (when the input is greater than largest uint168).
*
* Counterpart to Solidity's `uint168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*
* _Available since v4.7._
*/
function toUint168(uint256 value) internal pure returns (uint168) {
require(value <= type(uint168).max, "SafeCast: value doesn't fit in 168 bits");
return uint168(value);
}
/**
* @dev Returns the downcasted uint160 from uint256, reverting on
* overflow (when the input is greater than largest uint160).
*
* Counterpart to Solidity's `uint160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*
* _Available since v4.7._
*/
function toUint160(uint256 value) internal pure returns (uint160) {
require(value <= type(uint160).max, "SafeCast: value doesn't fit in 160 bits");
return uint160(value);
}
/**
* @dev Returns the downcasted uint152 from uint256, reverting on
* overflow (when the input is greater than largest uint152).
*
* Counterpart to Solidity's `uint152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*
* _Available since v4.7._
*/
function toUint152(uint256 value) internal pure returns (uint152) {
require(value <= type(uint152).max, "SafeCast: value doesn't fit in 152 bits");
return uint152(value);
}
/**
* @dev Returns the downcasted uint144 from uint256, reverting on
* overflow (when the input is greater than largest uint144).
*
* Counterpart to Solidity's `uint144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*
* _Available since v4.7._
*/
function toUint144(uint256 value) internal pure returns (uint144) {
require(value <= type(uint144).max, "SafeCast: value doesn't fit in 144 bits");
return uint144(value);
}
/**
* @dev Returns the downcasted uint136 from uint256, reverting on
* overflow (when the input is greater than largest uint136).
*
* Counterpart to Solidity's `uint136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*
* _Available since v4.7._
*/
function toUint136(uint256 value) internal pure returns (uint136) {
require(value <= type(uint136).max, "SafeCast: value doesn't fit in 136 bits");
return uint136(value);
}
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*
* _Available since v2.5._
*/
function toUint128(uint256 value) internal pure returns (uint128) {
require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits");
return uint128(value);
}
/**
* @dev Returns the downcasted uint120 from uint256, reverting on
* overflow (when the input is greater than largest uint120).
*
* Counterpart to Solidity's `uint120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*
* _Available since v4.7._
*/
function toUint120(uint256 value) internal pure returns (uint120) {
require(value <= type(uint120).max, "SafeCast: value doesn't fit in 120 bits");
return uint120(value);
}
/**
* @dev Returns the downcasted uint112 from uint256, reverting on
* overflow (when the input is greater than largest uint112).
*
* Counterpart to Solidity's `uint112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*
* _Available since v4.7._
*/
function toUint112(uint256 value) internal pure returns (uint112) {
require(value <= type(uint112).max, "SafeCast: value doesn't fit in 112 bits");
return uint112(value);
}
/**
* @dev Returns the downcasted uint104 from uint256, reverting on
* overflow (when the input is greater than largest uint104).
*
* Counterpart to Solidity's `uint104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*
* _Available since v4.7._
*/
function toUint104(uint256 value) internal pure returns (uint104) {
require(value <= type(uint104).max, "SafeCast: value doesn't fit in 104 bits");
return uint104(value);
}
/**
* @dev Returns the downcasted uint96 from uint256, reverting on
* overflow (when the input is greater than largest uint96).
*
* Counterpart to Solidity's `uint96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*
* _Available since v4.2._
*/
function toUint96(uint256 value) internal pure returns (uint96) {
require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits");
return uint96(value);
}
/**
* @dev Returns the downcasted uint88 from uint256, reverting on
* overflow (when the input is greater than largest uint88).
*
* Counterpart to Solidity's `uint88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*
* _Available since v4.7._
*/
function toUint88(uint256 value) internal pure returns (uint88) {
require(value <= type(uint88).max, "SafeCast: value doesn't fit in 88 bits");
return uint88(value);
}
/**
* @dev Returns the downcasted uint80 from uint256, reverting on
* overflow (when the input is greater than largest uint80).
*
* Counterpart to Solidity's `uint80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*
* _Available since v4.7._
*/
function toUint80(uint256 value) internal pure returns (uint80) {
require(value <= type(uint80).max, "SafeCast: value doesn't fit in 80 bits");
return uint80(value);
}
/**
* @dev Returns the downcasted uint72 from uint256, reverting on
* overflow (when the input is greater than largest uint72).
*
* Counterpart to Solidity's `uint72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*
* _Available since v4.7._
*/
function toUint72(uint256 value) internal pure returns (uint72) {
require(value <= type(uint72).max, "SafeCast: value doesn't fit in 72 bits");
return uint72(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*
* _Available since v2.5._
*/
function toUint64(uint256 value) internal pure returns (uint64) {
require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits");
return uint64(value);
}
/**
* @dev Returns the downcasted uint56 from uint256, reverting on
* overflow (when the input is greater than largest uint56).
*
* Counterpart to Solidity's `uint56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*
* _Available since v4.7._
*/
function toUint56(uint256 value) internal pure returns (uint56) {
require(value <= type(uint56).max, "SafeCast: value doesn't fit in 56 bits");
return uint56(value);
}
/**
* @dev Returns the downcasted uint48 from uint256, reverting on
* overflow (when the input is greater than largest uint48).
*
* Counterpart to Solidity's `uint48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*
* _Available since v4.7._
*/
function toUint48(uint256 value) internal pure returns (uint48) {
require(value <= type(uint48).max, "SafeCast: value doesn't fit in 48 bits");
return uint48(value);
}
/**
* @dev Returns the downcasted uint40 from uint256, reverting on
* overflow (when the input is greater than largest uint40).
*
* Counterpart to Solidity's `uint40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*
* _Available since v4.7._
*/
function toUint40(uint256 value) internal pure returns (uint40) {
require(value <= type(uint40).max, "SafeCast: value doesn't fit in 40 bits");
return uint40(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*
* _Available since v2.5._
*/
function toUint32(uint256 value) internal pure returns (uint32) {
require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits");
return uint32(value);
}
/**
* @dev Returns the downcasted uint24 from uint256, reverting on
* overflow (when the input is greater than largest uint24).
*
* Counterpart to Solidity's `uint24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*
* _Available since v4.7._
*/
function toUint24(uint256 value) internal pure returns (uint24) {
require(value <= type(uint24).max, "SafeCast: value doesn't fit in 24 bits");
return uint24(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*
* _Available since v2.5._
*/
function toUint16(uint256 value) internal pure returns (uint16) {
require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits");
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*
* _Available since v2.5._
*/
function toUint8(uint256 value) internal pure returns (uint8) {
require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits");
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*
* _Available since v3.0._
*/
function toUint256(int256 value) internal pure returns (uint256) {
require(value >= 0, "SafeCast: value must be positive");
return uint256(value);
}
/**
* @dev Returns the downcasted int248 from int256, reverting on
* overflow (when the input is less than smallest int248 or
* greater than largest int248).
*
* Counterpart to Solidity's `int248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*
* _Available since v4.7._
*/
function toInt248(int256 value) internal pure returns (int248) {
require(value >= type(int248).min && value <= type(int248).max, "SafeCast: value doesn't fit in 248 bits");
return int248(value);
}
/**
* @dev Returns the downcasted int240 from int256, reverting on
* overflow (when the input is less than smallest int240 or
* greater than largest int240).
*
* Counterpart to Solidity's `int240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*
* _Available since v4.7._
*/
function toInt240(int256 value) internal pure returns (int240) {
require(value >= type(int240).min && value <= type(int240).max, "SafeCast: value doesn't fit in 240 bits");
return int240(value);
}
/**
* @dev Returns the downcasted int232 from int256, reverting on
* overflow (when the input is less than smallest int232 or
* greater than largest int232).
*
* Counterpart to Solidity's `int232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*
* _Available since v4.7._
*/
function toInt232(int256 value) internal pure returns (int232) {
require(value >= type(int232).min && value <= type(int232).max, "SafeCast: value doesn't fit in 232 bits");
return int232(value);
}
/**
* @dev Returns the downcasted int224 from int256, reverting on
* overflow (when the input is less than smallest int224 or
* greater than largest int224).
*
* Counterpart to Solidity's `int224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*
* _Available since v4.7._
*/
function toInt224(int256 value) internal pure returns (int224) {
require(value >= type(int224).min && value <= type(int224).max, "SafeCast: value doesn't fit in 224 bits");
return int224(value);
}
/**
* @dev Returns the downcasted int216 from int256, reverting on
* overflow (when the input is less than smallest int216 or
* greater than largest int216).
*
* Counterpart to Solidity's `int216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*
* _Available since v4.7._
*/
function toInt216(int256 value) internal pure returns (int216) {
require(value >= type(int216).min && value <= type(int216).max, "SafeCast: value doesn't fit in 216 bits");
return int216(value);
}
/**
* @dev Returns the downcasted int208 from int256, reverting on
* overflow (when the input is less than smallest int208 or
* greater than largest int208).
*
* Counterpart to Solidity's `int208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*
* _Available since v4.7._
*/
function toInt208(int256 value) internal pure returns (int208) {
require(value >= type(int208).min && value <= type(int208).max, "SafeCast: value doesn't fit in 208 bits");
return int208(value);
}
/**
* @dev Returns the downcasted int200 from int256, reverting on
* overflow (when the input is less than smallest int200 or
* greater than largest int200).
*
* Counterpart to Solidity's `int200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*
* _Available since v4.7._
*/
function toInt200(int256 value) internal pure returns (int200) {
require(value >= type(int200).min && value <= type(int200).max, "SafeCast: value doesn't fit in 200 bits");
return int200(value);
}
/**
* @dev Returns the downcasted int192 from int256, reverting on
* overflow (when the input is less than smallest int192 or
* greater than largest int192).
*
* Counterpart to Solidity's `int192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*
* _Available since v4.7._
*/
function toInt192(int256 value) internal pure returns (int192) {
require(value >= type(int192).min && value <= type(int192).max, "SafeCast: value doesn't fit in 192 bits");
return int192(value);
}
/**
* @dev Returns the downcasted int184 from int256, reverting on
* overflow (when the input is less than smallest int184 or
* greater than largest int184).
*
* Counterpart to Solidity's `int184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*
* _Available since v4.7._
*/
function toInt184(int256 value) internal pure returns (int184) {
require(value >= type(int184).min && value <= type(int184).max, "SafeCast: value doesn't fit in 184 bits");
return int184(value);
}
/**
* @dev Returns the downcasted int176 from int256, reverting on
* overflow (when the input is less than smallest int176 or
* greater than largest int176).
*
* Counterpart to Solidity's `int176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*
* _Available since v4.7._
*/
function toInt176(int256 value) internal pure returns (int176) {
require(value >= type(int176).min && value <= type(int176).max, "SafeCast: value doesn't fit in 176 bits");
return int176(value);
}
/**
* @dev Returns the downcasted int168 from int256, reverting on
* overflow (when the input is less than smallest int168 or
* greater than largest int168).
*
* Counterpart to Solidity's `int168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*
* _Available since v4.7._
*/
function toInt168(int256 value) internal pure returns (int168) {
require(value >= type(int168).min && value <= type(int168).max, "SafeCast: value doesn't fit in 168 bits");
return int168(value);
}
/**
* @dev Returns the downcasted int160 from int256, reverting on
* overflow (when the input is less than smallest int160 or
* greater than largest int160).
*
* Counterpart to Solidity's `int160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*
* _Available since v4.7._
*/
function toInt160(int256 value) internal pure returns (int160) {
require(value >= type(int160).min && value <= type(int160).max, "SafeCast: value doesn't fit in 160 bits");
return int160(value);
}
/**
* @dev Returns the downcasted int152 from int256, reverting on
* overflow (when the input is less than smallest int152 or
* greater than largest int152).
*
* Counterpart to Solidity's `int152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*
* _Available since v4.7._
*/
function toInt152(int256 value) internal pure returns (int152) {
require(value >= type(int152).min && value <= type(int152).max, "SafeCast: value doesn't fit in 152 bits");
return int152(value);
}
/**
* @dev Returns the downcasted int144 from int256, reverting on
* overflow (when the input is less than smallest int144 or
* greater than largest int144).
*
* Counterpart to Solidity's `int144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*
* _Available since v4.7._
*/
function toInt144(int256 value) internal pure returns (int144) {
require(value >= type(int144).min && value <= type(int144).max, "SafeCast: value doesn't fit in 144 bits");
return int144(value);
}
/**
* @dev Returns the downcasted int136 from int256, reverting on
* overflow (when the input is less than smallest int136 or
* greater than largest int136).
*
* Counterpart to Solidity's `int136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*
* _Available since v4.7._
*/
function toInt136(int256 value) internal pure returns (int136) {
require(value >= type(int136).min && value <= type(int136).max, "SafeCast: value doesn't fit in 136 bits");
return int136(value);
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*
* _Available since v3.1._
*/
function toInt128(int256 value) internal pure returns (int128) {
require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits");
return int128(value);
}
/**
* @dev Returns the downcasted int120 from int256, reverting on
* overflow (when the input is less than smallest int120 or
* greater than largest int120).
*
* Counterpart to Solidity's `int120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*
* _Available since v4.7._
*/
function toInt120(int256 value) internal pure returns (int120) {
require(value >= type(int120).min && value <= type(int120).max, "SafeCast: value doesn't fit in 120 bits");
return int120(value);
}
/**
* @dev Returns the downcasted int112 from int256, reverting on
* overflow (when the input is less than smallest int112 or
* greater than largest int112).
*
* Counterpart to Solidity's `int112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*
* _Available since v4.7._
*/
function toInt112(int256 value) internal pure returns (int112) {
require(value >= type(int112).min && value <= type(int112).max, "SafeCast: value doesn't fit in 112 bits");
return int112(value);
}
/**
* @dev Returns the downcasted int104 from int256, reverting on
* overflow (when the input is less than smallest int104 or
* greater than largest int104).
*
* Counterpart to Solidity's `int104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*
* _Available since v4.7._
*/
function toInt104(int256 value) internal pure returns (int104) {
require(value >= type(int104).min && value <= type(int104).max, "SafeCast: value doesn't fit in 104 bits");
return int104(value);
}
/**
* @dev Returns the downcasted int96 from int256, reverting on
* overflow (when the input is less than smallest int96 or
* greater than largest int96).
*
* Counterpart to Solidity's `int96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*
* _Available since v4.7._
*/
function toInt96(int256 value) internal pure returns (int96) {
require(value >= type(int96).min && value <= type(int96).max, "SafeCast: value doesn't fit in 96 bits");
return int96(value);
}
/**
* @dev Returns the downcasted int88 from int256, reverting on
* overflow (when the input is less than smallest int88 or
* greater than largest int88).
*
* Counterpart to Solidity's `int88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*
* _Available since v4.7._
*/
function toInt88(int256 value) internal pure returns (int88) {
require(value >= type(int88).min && value <= type(int88).max, "SafeCast: value doesn't fit in 88 bits");
return int88(value);
}
/**
* @dev Returns the downcasted int80 from int256, reverting on
* overflow (when the input is less than smallest int80 or
* greater than largest int80).
*
* Counterpart to Solidity's `int80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*
* _Available since v4.7._
*/
function toInt80(int256 value) internal pure returns (int80) {
require(value >= type(int80).min && value <= type(int80).max, "SafeCast: value doesn't fit in 80 bits");
return int80(value);
}
/**
* @dev Returns the downcasted int72 from int256, reverting on
* overflow (when the input is less than smallest int72 or
* greater than largest int72).
*
* Counterpart to Solidity's `int72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*
* _Available since v4.7._
*/
function toInt72(int256 value) internal pure returns (int72) {
require(value >= type(int72).min && value <= type(int72).max, "SafeCast: value doesn't fit in 72 bits");
return int72(value);
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*
* _Available since v3.1._
*/
function toInt64(int256 value) internal pure returns (int64) {
require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits");
return int64(value);
}
/**
* @dev Returns the downcasted int56 from int256, reverting on
* overflow (when the input is less than smallest int56 or
* greater than largest int56).
*
* Counterpart to Solidity's `int56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*
* _Available since v4.7._
*/
function toInt56(int256 value) internal pure returns (int56) {
require(value >= type(int56).min && value <= type(int56).max, "SafeCast: value doesn't fit in 56 bits");
return int56(value);
}
/**
* @dev Returns the downcasted int48 from int256, reverting on
* overflow (when the input is less than smallest int48 or
* greater than largest int48).
*
* Counterpart to Solidity's `int48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*
* _Available since v4.7._
*/
function toInt48(int256 value) internal pure returns (int48) {
require(value >= type(int48).min && value <= type(int48).max, "SafeCast: value doesn't fit in 48 bits");
return int48(value);
}
/**
* @dev Returns the downcasted int40 from int256, reverting on
* overflow (when the input is less than smallest int40 or
* greater than largest int40).
*
* Counterpart to Solidity's `int40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*
* _Available since v4.7._
*/
function toInt40(int256 value) internal pure returns (int40) {
require(value >= type(int40).min && value <= type(int40).max, "SafeCast: value doesn't fit in 40 bits");
return int40(value);
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*
* _Available since v3.1._
*/
function toInt32(int256 value) internal pure returns (int32) {
require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits");
return int32(value);
}
/**
* @dev Returns the downcasted int24 from int256, reverting on
* overflow (when the input is less than smallest int24 or
* greater than largest int24).
*
* Counterpart to Solidity's `int24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*
* _Available since v4.7._
*/
function toInt24(int256 value) internal pure returns (int24) {
require(value >= type(int24).min && value <= type(int24).max, "SafeCast: value doesn't fit in 24 bits");
return int24(value);
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*
* _Available since v3.1._
*/
function toInt16(int256 value) internal pure returns (int16) {
require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits");
return int16(value);
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*
* _Available since v3.1._
*/
function toInt8(int256 value) internal pure returns (int8) {
require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits");
return int8(value);
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*
* _Available since v3.0._
*/
function toInt256(uint256 value) internal pure returns (int256) {
// Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256");
return int256(value);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;
contract OwnableUpgradeable {
address public owner;
address public pendingOwner;
address public admin;
event NewAdmin(address oldAdmin, address newAdmin);
event NewOwner(address oldOwner, address newOwner);
event NewPendingOwner(address oldPendingOwner, address newPendingOwner);
function _initOwnable(address owner_, address admin_) internal {
require(owner_ != address(0), "owner_ cannot be Zero Address");
owner = owner_;
admin = admin_;
}
modifier onlyOwner() {
require(msg.sender == owner, "onlyOwner");
_;
}
modifier onlyPendingOwner() {
require(msg.sender == pendingOwner, "onlyPendingOwner");
_;
}
modifier onlyAdmin() {
require(msg.sender == admin || msg.sender == owner, "onlyAdmin");
_;
}
function transferOwnership(address _pendingOwner) public onlyOwner {
emit NewPendingOwner(pendingOwner, _pendingOwner);
pendingOwner = _pendingOwner;
}
function renounceOwnership() public virtual onlyOwner {
emit NewOwner(owner, address(0));
emit NewAdmin(admin, address(0));
emit NewPendingOwner(pendingOwner, address(0));
owner = address(0);
pendingOwner = address(0);
admin = address(0);
}
function acceptOwner() public onlyPendingOwner {
emit NewOwner(owner, pendingOwner);
owner = pendingOwner;
address newPendingOwner = address(0);
emit NewPendingOwner(pendingOwner, newPendingOwner);
pendingOwner = newPendingOwner;
}
function setAdmin(address newAdmin) public onlyOwner {
emit NewAdmin(admin, newAdmin);
admin = newAdmin;
}
}// 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: CC0-1.0
pragma solidity ^0.8.7;
/**
* @title SignatureVerificationErrors
* @author 0age
* @notice SignatureVerificationErrors contains all errors related to signature
* verification.
*/
interface SignatureVerificationErrors {
/**
* @dev Revert with an error when a signature that does not contain a v
* value of 27 or 28 has been supplied.
*
* @param v The invalid v value.
*/
error BadSignatureV(uint8 v);
/**
* @dev Revert with an error when the signer recovered by the supplied
* signature does not match the offerer or an allowed EIP-1271 signer
* as specified by the offerer in the event they are a contract.
*/
error InvalidSigner();
/**
* @dev Revert with an error when a signer cannot be recovered from the
* supplied signature.
*/
error InvalidSignature();
/**
* @dev Revert with an error when an EIP-1271 call to an account fails.
*/
error BadContractSignature();
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.7;
interface EIP1271Interface {
function isValidSignature(bytes32 digest, bytes calldata signature)
external
view
returns (bytes4);
}// 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.7.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
* initialization step. This is essential to configure modules that are added through upgrades and that require
* initialization.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;
interface IERC5006 {
struct UserRecord {
uint256 tokenId;
address owner;
uint64 amount;
address user;
uint64 expiry;
}
/**
* @dev Emitted when permission (for `user` to use `amount` of `tokenId` token owned by `owner`
* until `expiry`) is given.
*/
event CreateUserRecord(
uint256 recordId,
uint256 tokenId,
uint64 amount,
address owner,
address user,
uint64 expiry
);
/**
* @dev Emitted when record of `recordId` is deleted.
*/
event DeleteUserRecord(uint256 recordId);
/**
* @dev Returns the usable amount of `tokenId` tokens by `account`.
*/
function usableBalanceOf(address account, uint256 tokenId)
external
view
returns (uint256);
/**
* @dev Returns the amount of frozen tokens of token type `id` by `account`.
*/
function frozenBalanceOf(address account, uint256 tokenId)
external
view
returns (uint256);
/**
* @dev Returns the `UserRecord` of `recordId`.
*/
function userRecordOf(uint256 recordId)
external
view
returns (UserRecord memory);
/**
* @dev Gives permission to `user` to use `amount` of `tokenId` token owned by `owner` until `expiry`.
*
* Emits a {CreateUserRecord} event.
*
* Requirements:
*
* - If the caller is not `owner`, it must be have been approved to spend ``owner``'s tokens
* via {setApprovalForAll}.
* - `owner` must have a balance of tokens of type `id` of at least `amount`.
* - `user` cannot be the zero address.
* - `amount` must be greater than 0.
* - `expiry` must after the block timestamp.
*/
function createUserRecord(
address owner,
address user,
uint256 tokenId,
uint64 amount,
uint64 expiry
) external returns (uint256);
/**
* @dev Atomically delete `record` of `recordId` by the caller.
*
* Emits a {DeleteUserRecord} event.
*
* Requirements:
*
* - the caller must have allowance.
*/
function deleteUserRecord(uint256 recordId) external;
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BadContractSignature","type":"error"},{"inputs":[{"internalType":"uint8","name":"v","type":"uint8"}],"name":"BadSignatureV","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidSigner","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"},{"components":[{"internalType":"enum TokenType","name":"tokenType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"indexed":false,"internalType":"struct NFT","name":"nft","type":"tuple"},{"components":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"pricePerCycle","type":"uint256"},{"internalType":"uint256","name":"cycle","type":"uint256"}],"indexed":false,"internalType":"struct RentalPrice","name":"price","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cycleAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"lender","type":"address"},{"indexed":false,"internalType":"address","name":"renter","type":"address"}],"name":"LendOrderFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"NewOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingOwner","type":"address"}],"name":"NewPendingOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"trader","type":"address"},{"indexed":false,"internalType":"uint256","name":"newNonce","type":"uint256"}],"name":"NonceIncremented","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"OfferCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"OrderCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"},{"components":[{"internalType":"enum TokenType","name":"tokenType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"indexed":false,"internalType":"struct NFT","name":"nft","type":"tuple"},{"components":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"pricePerCycle","type":"uint256"},{"internalType":"uint256","name":"cycle","type":"uint256"}],"indexed":false,"internalType":"struct RentalPrice","name":"price","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cycleAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"lender","type":"address"},{"indexed":false,"internalType":"address","name":"renter","type":"address"}],"name":"RentOfferFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"ENS_setName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"acceptOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"oNFT","type":"address"}],"name":"bankOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"components":[{"internalType":"enum TokenType","name":"tokenType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct NFT","name":"nft","type":"tuple"},{"components":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"pricePerCycle","type":"uint256"},{"internalType":"uint256","name":"cycle","type":"uint256"}],"internalType":"struct RentalPrice","name":"price","type":"tuple"},{"internalType":"uint256","name":"minCycleAmount","type":"uint256"},{"internalType":"uint256","name":"maxRentExpiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"uint64","name":"durationId","type":"uint64"},{"components":[{"internalType":"uint16","name":"rate","type":"uint16"},{"internalType":"address payable","name":"recipient","type":"address"}],"internalType":"struct Fee[]","name":"fees","type":"tuple[]"},{"components":[{"internalType":"bytes32","name":"metadataHash","type":"bytes32"},{"internalType":"address","name":"checker","type":"address"}],"internalType":"struct Metadata","name":"metadata","type":"tuple"}],"internalType":"struct LendOrder","name":"lendOrder","type":"tuple"}],"name":"cancelLendOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"components":[{"internalType":"enum TokenType","name":"tokenType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct NFT","name":"nft","type":"tuple"},{"components":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"pricePerCycle","type":"uint256"},{"internalType":"uint256","name":"cycle","type":"uint256"}],"internalType":"struct RentalPrice","name":"price","type":"tuple"},{"internalType":"uint256","name":"cycleAmount","type":"uint256"},{"internalType":"uint256","name":"offerExpiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"},{"components":[{"internalType":"uint16","name":"rate","type":"uint16"},{"internalType":"address payable","name":"recipient","type":"address"}],"internalType":"struct Fee[]","name":"fees","type":"tuple[]"},{"components":[{"internalType":"bytes32","name":"metadataHash","type":"bytes32"},{"internalType":"address","name":"checker","type":"address"}],"internalType":"struct Metadata","name":"metadata","type":"tuple"}],"internalType":"struct RentOffer","name":"rentOffer","type":"tuple"}],"name":"cancelRentOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"components":[{"internalType":"enum TokenType","name":"tokenType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct NFT","name":"nft","type":"tuple"},{"components":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"pricePerCycle","type":"uint256"},{"internalType":"uint256","name":"cycle","type":"uint256"}],"internalType":"struct RentalPrice","name":"price","type":"tuple"},{"internalType":"uint256","name":"minCycleAmount","type":"uint256"},{"internalType":"uint256","name":"maxRentExpiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"uint64","name":"durationId","type":"uint64"},{"components":[{"internalType":"uint16","name":"rate","type":"uint16"},{"internalType":"address payable","name":"recipient","type":"address"}],"internalType":"struct Fee[]","name":"fees","type":"tuple[]"},{"components":[{"internalType":"bytes32","name":"metadataHash","type":"bytes32"},{"internalType":"address","name":"checker","type":"address"}],"internalType":"struct Metadata","name":"metadata","type":"tuple"}],"internalType":"struct LendOrder","name":"lendOrder","type":"tuple"},{"components":[{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"enum SignatureVersion","name":"signatureVersion","type":"uint8"}],"internalType":"struct Signature","name":"signature","type":"tuple"},{"internalType":"uint64","name":"tokenAmount","type":"uint64"},{"internalType":"uint256","name":"cycleAmount","type":"uint256"},{"components":[{"internalType":"enum TokenType","name":"tokenType","type":"uint8"},{"internalType":"address","name":"oNFT","type":"address"},{"internalType":"uint256","name":"oNFTId","type":"uint256"},{"internalType":"address","name":"lender","type":"address"},{"internalType":"uint256","name":"recordId","type":"uint256"}],"internalType":"struct IBank1155.RentingRecord[]","name":"toDeletes","type":"tuple[]"}],"name":"fulfillLendOrder1155","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"components":[{"internalType":"enum TokenType","name":"tokenType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct NFT","name":"nft","type":"tuple"},{"components":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"pricePerCycle","type":"uint256"},{"internalType":"uint256","name":"cycle","type":"uint256"}],"internalType":"struct RentalPrice","name":"price","type":"tuple"},{"internalType":"uint256","name":"cycleAmount","type":"uint256"},{"internalType":"uint256","name":"offerExpiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"},{"components":[{"internalType":"uint16","name":"rate","type":"uint16"},{"internalType":"address payable","name":"recipient","type":"address"}],"internalType":"struct Fee[]","name":"fees","type":"tuple[]"},{"components":[{"internalType":"bytes32","name":"metadataHash","type":"bytes32"},{"internalType":"address","name":"checker","type":"address"}],"internalType":"struct Metadata","name":"metadata","type":"tuple"}],"internalType":"struct RentOffer","name":"rentOffer","type":"tuple"},{"components":[{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"enum SignatureVersion","name":"signatureVersion","type":"uint8"}],"internalType":"struct Signature","name":"signature","type":"tuple"},{"components":[{"internalType":"enum TokenType","name":"tokenType","type":"uint8"},{"internalType":"address","name":"oNFT","type":"address"},{"internalType":"uint256","name":"oNFTId","type":"uint256"},{"internalType":"address","name":"lender","type":"address"},{"internalType":"uint256","name":"recordId","type":"uint256"}],"internalType":"struct IBank1155.RentingRecord[]","name":"toDeletes","type":"tuple[]"}],"name":"fulfillRentOffer1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"incrementNonce","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"admin_","type":"address"},{"internalType":"address","name":"bank_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isPausing","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"nonceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"oNFT","type":"address"},{"internalType":"address","name":"bank","type":"address"}],"name":"registerBank","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"pause_","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pendingOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b506200001c62000022565b620000f1565b600254600160b01b900460ff1615620000915760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60025460ff600160a81b90910481161015620000ef576002805460ff60a81b191660ff60a81b17905560405160ff81527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6136b080620001016000396000f3fe60806040526004361061011f5760003560e01c8063bedb86fb116100a0578063ed2a2d6411610064578063ed2a2d6414610320578063f2fde38b14610364578063f851a44014610384578063fa5a28ea146103a4578063faa94b7b146103c457600080fd5b8063bedb86fb1461028b578063c0c53b8b146102ab578063c229f5ce146102cb578063e30c3978146102eb578063ebbc49651461030b57600080fd5b8063704b6c02116100e7578063704b6c02146101e9578063715018a6146102095780638da5cb5b1461021e578063ac9650d81461023e578063af857f1a1461026b57600080fd5b80630d34b79c1461012457806330e804a21461015a57806335416cc31461019257806348b05a29146101b4578063627cdcb9146101d4575b600080fd5b34801561013057600080fd5b5060025461014590600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b34801561016657600080fd5b5061017a610175366004612a46565b6103d7565b6040516001600160a01b039091168152602001610151565b34801561019e57600080fd5b506101b26101ad366004612a7c565b61042c565b005b3480156101c057600080fd5b506101b26101cf366004612b3b565b61051e565b3480156101e057600080fd5b506101b2610601565b3480156101f557600080fd5b506101b2610204366004612a46565b610670565b34801561021557600080fd5b506101b2610703565b34801561022a57600080fd5b5060005461017a906001600160a01b031681565b34801561024a57600080fd5b5061025e610259366004612b83565b610827565b6040516101519190612c4f565b34801561027757600080fd5b506101b2610286366004612cb1565b61091b565b34801561029757600080fd5b506101b26102a6366004612cf8565b6109e0565b3480156102b757600080fd5b506101b26102c6366004612d15565b610ab0565b3480156102d757600080fd5b506101b26102e6366004612d73565b610c59565b3480156102f757600080fd5b5060015461017a906001600160a01b031681565b34801561031757600080fd5b506101b2610d3a565b34801561032c57600080fd5b5061035661033b366004612a46565b6001600160a01b031660009081526037602052604090205490565b604051908152602001610151565b34801561037057600080fd5b506101b261037f366004612a46565b610e51565b34801561039057600080fd5b5060025461017a906001600160a01b031681565b3480156103b057600080fd5b506101b26103bf366004612e04565b610ebf565b6101b26103d2366004612eaa565b6112a3565b6001600160a01b0381811660009081526038602052604081205490911615610419576001600160a01b0380831660009081526038602052604090205416610426565b6039546001600160a01b03165b92915050565b6104396020820182612a46565b6001600160a01b0316336001600160a01b03161461049e5760405162461bcd60e51b815260206004820152601f60248201527f6f6e6c79206d616b65722063616e2063616e63656c20746865206f726465720060448201526064015b60405180910390fd5b60006104a982611611565b60008181526036602052604090205490915060ff16156104c7575050565b60008181526036602052604090819020805460ff19166001179055517f5152abf959f6564662358c2e52b702259b78bac5ee7842a0f01937e670efcc7d906105129083815260200190565b60405180910390a15050565b6002546001600160a01b031633148061054157506000546001600160a01b031633145b61055d5760405162461bcd60e51b815260040161049590612f52565b6040514690600090610573908490602401612f75565b60408051601f198184030181529190526020810180516001600160e01b031663c47f002760e01b1790529050600182146105dd5760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081b585a5b9b995d60aa1b6044820152606401610495565b6105fb73084b1c3c81545d370f3634392de611caabff814882611740565b50505050565b336000908152603760205260408120805460019290610621908490612f9e565b909155505033600081815260376020908152604091829020548251938452908301527fa82a649bbd060c9099cd7b7326e2b0dc9e9af0836480e0f849dc9eaa79710b3b910160405180910390a1565b6000546001600160a01b0316331461069a5760405162461bcd60e51b815260040161049590612fb6565b600254604080516001600160a01b03928316815291831660208301527ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461072d5760405162461bcd60e51b815260040161049590612fb6565b60008054604080516001600160a01b03909216825260208201929092527f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b2364910160405180910390a1600254604080516001600160a01b039092168252600060208301527ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc910160405180910390a1600154604080516001600160a01b039092168252600060208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910160405180910390a1600080546001600160a01b03199081169091556001805482169055600280549091169055565b6060816001600160401b0381111561084157610841612ab0565b60405190808252806020026020018201604052801561087457816020015b606081526020019060019003908161085f5790505b50905060005b82811015610914576108e43085858481811061089857610898612fd9565b90506020028101906108aa9190612fef565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061178992505050565b8282815181106108f6576108f6612fd9565b6020026020010181905250808061090c90613035565b91505061087a565b5092915050565b6002546001600160a01b031633148061093e57506000546001600160a01b031633145b61095a5760405162461bcd60e51b815260040161049590612f52565b6040516301ffc9a760e01b8152635afec8e760e11b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa1580156109a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c9919061304e565b6109d257600080fd5b6109dc82826117ae565b5050565b6002546001600160a01b0316331480610a0357506000546001600160a01b031633145b610a1f5760405162461bcd60e51b815260040161049590612f52565b6002805460ff60a01b1916600160a01b8315158102919091179182905560ff91041615610a7d576040513081527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258906020015b60405180910390a150565b6040513081527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602001610a72565b50565b600254600160b01b900460ff1615808015610ad857506002546001600160a81b90910460ff16105b80610af95750303b158015610af95750600254600160a81b900460ff166001145b610b5c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610495565b6002805460ff60a81b1916600160a81b1790558015610b89576002805460ff60b01b1916600160b01b1790555b6040516301ffc9a760e01b8152635afec8e760e11b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa158015610bd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf8919061304e565b610c0157600080fd5b610c0c848484611835565b80156105fb576002805460ff60b01b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b610c666020820182612a46565b6001600160a01b0316336001600160a01b031614610cc65760405162461bcd60e51b815260206004820152601f60248201527f6f6e6c79206d616b65722063616e2063616e63656c20746865206f66666572006044820152606401610495565b6000610cd18261199c565b60008181526036602052604090205490915060ff1615610cef575050565b60008181526036602052604090819020805460ff19166001179055517f3f9cb69d022b6ec319f86f2df848bcce01f2fc51c9f86396779a8081cf6ca2ea906105129083815260200190565b6001546001600160a01b03163314610d875760405162461bcd60e51b815260206004820152601060248201526f37b7363ca832b73234b733a7bbb732b960811b6044820152606401610495565b600054600154604080516001600160a01b0393841681529290911660208301527f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b2364910160405180910390a1600154600080546001600160a01b0319166001600160a01b039092169182178155604080519283526020830182905290917fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b91015b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610e7b5760405162461bcd60e51b815260040161049590612fb6565b600154604080516001600160a01b03928316815291831660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b9101610e27565b600254600160a01b900460ff1615610f0c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610495565b600260035403610f5e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610495565b60026003556000610f6e8561199c565b9050610f9c610f806020870187612a46565b610f906040880160208901612a46565b87610160013584611a8c565b846101400135421115610fe95760405162461bcd60e51b8152602060048201526015602482015274151a19481bd999995c881a185cc8195e1c1a5c9959605a1b6044820152606401610495565b611008610ff96020870187612a46565b826110038761306b565b611bae565b600061101d6101756080880160608901612a46565b604051634eec19f360e01b81529091506001600160a01b03821690634eec19f39061104e908790879060040161313d565b600060405180830381600087803b15801561106857600080fd5b505af115801561107c573d6000803e3d6000fd5b50600092506110989150506101208801356101008901356131cf565b9050603a548111156110bc5760405162461bcd60e51b8152600401610495906131ee565b60006110c88242612f9e565b90506000604051806101000160405280600081526020018a60400160000160208101906110f59190613225565b600781111561110657611106613105565b815260200161111b60808c0160608d01612a46565b6001600160a01b031681526080808c013560208084019190915260a08d01356040840152336060840152910190611154908c018c612a46565b6001600160a01b03168152602001838152509050836001600160a01b03166384445e2c826040518263ffffffff1660e01b81526004016111949190613240565b600060405180830381600087803b1580156111ae57600080fd5b505af11580156111c2573d6000803e3d6000fd5b506112009250505060c08a016101208b013560a08c01356111e76101a08e018e6132af565b338f60000160208101906111fb9190612a46565b611bca565b60016036600087815260200190815260200160002060006101000a81548160ff0219169083151502179055507fdf73ed587e745e6fdf33edc6e2ffca2504530296ecaa01634de553ef587189f9858a6040018b60c0018c604001606001358d6101200135338f60000160208101906112789190612a46565b60405161128b9796959493929190613361565b60405180910390a15050600160035550505050505050565b600254600160a01b900460ff16156112f05760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610495565b6002600354036113425760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610495565b60026003556101208601358310156113925760405162461bcd60e51b81526020600482015260136024820152721a5b9d985b1a590818de58db19505b5bdd5b9d606a1b6044820152606401610495565b600061139d87611611565b90506113cb6113af6020890189612a46565b6113bf60408a0160208b01612a46565b89610160013584611a8c565b6113e56113db6020890189612a46565b826110038961306b565b60006113f6856101008a01356131cf565b905060006114048242612f9e565b9050603a548211156114285760405162461bcd60e51b8152600401610495906131ee565b88610140013581111561144d5760405162461bcd60e51b8152600401610495906131ee565b61145989888787611e4e565b6040805161010081018252600080825291602082019061147f9060608e01908e01613225565b600781111561149057611490613105565b81526020016114a560808d0160608e01612a46565b6001600160a01b031681526020018b604001604001358152602001896001600160401b031681526020018b60000160208101906114e29190612a46565b6001600160a01b03168152336020820152604001839052905061150e61017560808c0160608d01612a46565b6001600160a01b03166384445e2c826040518263ffffffff1660e01b81526004016115399190613240565b600060405180830381600087803b15801561155357600080fd5b505af1158015611567573d6000803e3d6000fd5b506115a59250505060c08b01886001600160401b038b1661158c6101c08f018f6132af565b8f600001602081019061159f9190612a46565b33611bca565b7fc630db4dffa9188397f33c62ce1992b440cb908d54e66d13f13ee3acdb8107c9848b6040018c60c0018b8b8f60000160208101906115e49190612a46565b336040516115f897969594939291906133b5565b60405180910390a1505060016003555050505050505050565b60007fa62aa05b8c04db163608c1ef9d40d4cae4143cba92d6434e6fc9f25afd0975f96116416020840184612a46565b6116516040850160208601612a46565b61165d85604001611fe2565b6116698660c001612017565b6101208701356101408801356101608901356101808a01356116936101c08c016101a08d01613412565b6116a96116a46101c08e018e6132af565b61204c565b6116b68d6101e00161211e565b60408051602081019d909d526001600160a01b039b8c16908d01529990981660608b015260808a019690965260a089019490945260c088019290925260e08701526101008601526101208501526001600160401b03166101408401526101608301526101808201526101a0015b604051602081830303815290604052805190602001209050919050565b606061178283836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612153565b9392505050565b606061178283836040518060600160405280602781526020016136546027913961216a565b60405163395922a160e11b81523060048201526001600160a01b038216906372b2454290602401600060405180830381600087803b1580156117ef57600080fd5b505af1158015611803573d6000803e3d6000fd5b505050506001600160a01b03918216600090815260386020526040902080546001600160a01b03191691909216179055565b600254600160b01b900460ff1661185e5760405162461bcd60e51b81526004016104959061342d565b611866612247565b611870838361227a565b603980546001600160a01b0319166001600160a01b03831690811790915560405163395922a160e11b81523060048201526372b2454290602401600060405180830381600087803b1580156118c457600080fd5b505af11580156118d8573d6000803e3d6000fd5b50505050611983604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527fc9b6476ed7f4a8c6bfc08d93f4d6436ef7d9ac2ed055056196a31c90e486179d918101919091527f06c015bd22b4c69690933c1058878ebdfef31f9aaae40bbe86d8a09fe1b2972c60608201524660808201523060a082015260c00160408051601f198184030181529190528051602090910120603555565b50506002805460ff60a01b191690555062ed4e00603a55565b60007f6b28d384d3d8cadaa3b3d171d4c245b681136c78cd0cd15102f986d40b86a9ac6119cc6020840184612a46565b6119dc6040850160208601612a46565b6119e885604001611fe2565b6119f48660c001612017565b6101208701356101408801356101608901356101808a0135611a1d6116a46101a08d018d6132af565b611a2a8c6101c00161211e565b60408051602081019c909c526001600160a01b039a8b16908c01529890971660608a0152608089019590955260a088019390935260c087019190915260e086015261010085015261012084015261014083015261016082015261018001611723565b6001600160a01b0383161580611aaa57506001600160a01b03831633145b611ae65760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b2103a30b5b2b960991b6044820152606401610495565b6001600160a01b0384166000908152603760205260409020548214611b455760405162461bcd60e51b81526020600482015260156024820152741b9bdb98d948185b1c9958591e48195e1c1a5c9959605a1b6044820152606401610495565b60008181526036602052604090205460ff16156105fb5760405162461bcd60e51b815260206004820152602160248201527f42652063616e63656c6c6564206f722066756c66696c6c656420616c726561646044820152607960f81b6064820152608401610495565b6000611bb9836122fe565b90506105fb84828460000151612329565b600085611bdb8860208b01356131cf565b611be591906131cf565b90506000805b85811015611c3957868682818110611c0557611c05612fd9565b611c1b9260206040909202019081019150613478565b611c25908361349c565b915080611c3181613035565b915050611beb565b506000620186a0611c4e61ffff8416856131cf565b611c5891906134c2565b90506000611c6682856134e4565b90506000611c7760208d018d612a46565b6001600160a01b031603611d865783341015611ccd5760405162461bcd60e51b81526020600482015260156024820152740e0c2f2dacadce840d2e640dcdee840cadcdeeaced605b1b6044820152606401610495565b611cd786826124df565b83341115611cf257611cf285611ced86346134e4565b6124df565b60005b87811015611d8057611d6e898983818110611d1257611d12612fd9565b9050604002016020016020810190611d2a9190612a46565b620186a08b8b85818110611d4057611d40612fd9565b611d569260206040909202019081019150613478565b611d649061ffff16896131cf565b611ced91906134c2565b80611d7881613035565b915050611cf5565b50611e41565b611d9e611d9660208d018d612a46565b8688846125fd565b60005b87811015611e3f57611e2d611db960208e018e612a46565b878b8b85818110611dcc57611dcc612fd9565b9050604002016020016020810190611de49190612a46565b620186a08d8d87818110611dfa57611dfa612fd9565b611e109260206040909202019081019150613478565b611e1e9061ffff168b6131cf565b611e2891906134c2565b6125fd565b80611e3781613035565b915050611da1565b505b5050505050505050505050565b6000611e636101756080870160608801612a46565b604051634eec19f360e01b81529091506001600160a01b03821690634eec19f390611e94908690869060040161313d565b600060405180830381600087803b158015611eae57600080fd5b505af1158015611ec2573d6000803e3d6000fd5b506000925050506001600160a01b038216637f55d611611ee86080890160608a01612a46565b6080890135611efa60208b018b612a46565b60405160e085901b6001600160e01b03191681526001600160a01b03938416600482015260248101929092529091166044820152606401602060405180830381865afa158015611f4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f7291906134fb565b905060a0860135611f8c6001600160401b03871683612f9e565b1115611fda5760405162461bcd60e51b815260206004820152601d60248201527f696e73756666696369656e742072656d61696e696e6720616d6f756e740000006044820152606401610495565b505050505050565b60007f1af3242626900424ddaf3f5b84122e529f91d995b1790c0823e49d391cf4e4a982604051602001611723929190613514565b60007f84b0b5ed9a9fec2bb2cfe82669e72bf29604ccbae5677089020f6817047b7d1682604051602001611723929190613528565b600080826001600160401b0381111561206757612067612ab0565b604051908082528060200260200182016040528015612090578160200160208202803683370190505b50905060005b838110156120ed576120be8585838181106120b3576120b3612fd9565b905060400201612657565b8282815181106120d0576120d0612fd9565b6020908102919091010152806120e581613035565b915050612096565b50806040516020016120ff919061353c565b6040516020818303038152906040528051906020012091505092915050565b60007fc723cdafbc9150fe4c873f32220f68fb6468b65ae1b6743a2a8dc75e49851e7882604051602001611723929190613572565b606061216284846000856126c7565b949350505050565b60606001600160a01b0384163b6121d25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610495565b600080856001600160a01b0316856040516121ed91906135ab565b600060405180830381855af49150503d8060008114612228576040519150601f19603f3d011682016040523d82523d6000602084013e61222d565b606091505b509150915061223d8282866127f8565b9695505050505050565b600254600160b01b900460ff166122705760405162461bcd60e51b81526004016104959061342d565b612278612831565b565b6001600160a01b0382166122d05760405162461bcd60e51b815260206004820152601d60248201527f6f776e65725f2063616e6e6f74206265205a65726f20416464726573730000006044820152606401610495565b600080546001600160a01b039384166001600160a01b03199182161790915560028054929093169116179055565b60355460405161190160f01b6020820152602281019190915260428101829052600090606201611723565b600080806001600160a01b0386163b1561234857611fda868686612861565b83516040036123985760008480602001905181019061236791906135c7565b9094506001600160ff1b0381169350905061238560ff82901c6128fa565b61239090601b6135eb565b91505061242f565b835160410361241657838060200190518101906123b591906135c7565b85519194509250849060409081106123cf576123cf612fd9565b016020015160f81c9050601b81148015906123ee57508060ff16601c14155b1561241157604051630f801e8560e11b815260ff82166004820152602401610495565b61242f565b604051638baa579f60e01b815260040160405180910390fd5b6040805160008082526020820180845288905260ff841692820192909252606081018590526080810184905260019060a0016020604051602081039080840390855afa158015612483573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615806124b85750866001600160a01b0316816001600160a01b031614155b156124d657604051632057875960e21b815260040160405180910390fd5b50505050505050565b8047101561252f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610495565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461257c576040519150601f19603f3d011682016040523d82523d6000602084013e612581565b606091505b50509050806125f85760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610495565b505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526105fb90859061295f565b60007f05b43f730f67de334a342883f867101fc7ef3361dfdff4a29a7aa97e0920ef7a6126876020840184613478565b6126976040850160208601612a46565b6040516020016117239392919092835261ffff9190911660208301526001600160a01b0316604082015260600190565b6060824710156127285760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610495565b6001600160a01b0385163b61277f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610495565b600080866001600160a01b0316858760405161279b91906135ab565b60006040518083038185875af1925050503d80600081146127d8576040519150601f19603f3d011682016040523d82523d6000602084013e6127dd565b606091505b50915091506127ed8282866127f8565b979650505050505050565b60608315612807575081611782565b8251156128175782518084602001fd5b8160405162461bcd60e51b81526004016104959190612f75565b600254600160b01b900460ff1661285a5760405162461bcd60e51b81526004016104959061342d565b6001600355565b604051630b135d3f60e11b808252906001600160a01b03851690631626ba7e906128919086908690600401613610565b602060405180830381865afa1580156128ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128d29190613629565b6001600160e01b031916146125f857604051632057875960e21b815260040160405180910390fd5b600060ff82111561295b5760405162461bcd60e51b815260206004820152602560248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2038604482015264206269747360d81b6064820152608401610495565b5090565b60006129b4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166121539092919063ffffffff16565b8051909150156125f857808060200190518101906129d2919061304e565b6125f85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610495565b6001600160a01b0381168114610aad57600080fd5b600060208284031215612a5857600080fd5b813561178281612a31565b60006102208284031215612a7657600080fd5b50919050565b600060208284031215612a8e57600080fd5b81356001600160401b03811115612aa457600080fd5b61216284828501612a63565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115612ae057612ae0612ab0565b604051601f8501601f19908116603f01168101908282118183101715612b0857612b08612ab0565b81604052809350858152868686011115612b2157600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215612b4d57600080fd5b81356001600160401b03811115612b6357600080fd5b8201601f81018413612b7457600080fd5b61216284823560208401612ac6565b60008060208385031215612b9657600080fd5b82356001600160401b0380821115612bad57600080fd5b818501915085601f830112612bc157600080fd5b813581811115612bd057600080fd5b8660208260051b8501011115612be557600080fd5b60209290920196919550909350505050565b60005b83811015612c12578181015183820152602001612bfa565b838111156105fb5750506000910152565b60008151808452612c3b816020860160208601612bf7565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612ca457603f19888603018452612c92858351612c23565b94509285019290850190600101612c76565b5092979650505050505050565b60008060408385031215612cc457600080fd5b8235612ccf81612a31565b91506020830135612cdf81612a31565b809150509250929050565b8015158114610aad57600080fd5b600060208284031215612d0a57600080fd5b813561178281612cea565b600080600060608486031215612d2a57600080fd5b8335612d3581612a31565b92506020840135612d4581612a31565b91506040840135612d5581612a31565b809150509250925092565b60006102008284031215612a7657600080fd5b600060208284031215612d8557600080fd5b81356001600160401b03811115612d9b57600080fd5b61216284828501612d60565b600060408284031215612a7657600080fd5b60008083601f840112612dcb57600080fd5b5081356001600160401b03811115612de257600080fd5b60208301915083602060a083028501011115612dfd57600080fd5b9250929050565b60008060008060608587031215612e1a57600080fd5b84356001600160401b0380821115612e3157600080fd5b612e3d88838901612d60565b95506020870135915080821115612e5357600080fd5b612e5f88838901612da7565b94506040870135915080821115612e7557600080fd5b50612e8287828801612db9565b95989497509550505050565b80356001600160401b0381168114612ea557600080fd5b919050565b60008060008060008060a08789031215612ec357600080fd5b86356001600160401b0380821115612eda57600080fd5b612ee68a838b01612a63565b97506020890135915080821115612efc57600080fd5b612f088a838b01612da7565b9650612f1660408a01612e8e565b9550606089013594506080890135915080821115612f3357600080fd5b50612f4089828a01612db9565b979a9699509497509295939492505050565b60208082526009908201526837b7363ca0b236b4b760b91b604082015260600190565b6020815260006117826020830184612c23565b634e487b7160e01b600052601160045260246000fd5b60008219821115612fb157612fb1612f88565b500190565b60208082526009908201526837b7363ca7bbb732b960b91b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261300657600080fd5b8301803591506001600160401b0382111561302057600080fd5b602001915036819003821315612dfd57600080fd5b60006001820161304757613047612f88565b5060010190565b60006020828403121561306057600080fd5b815161178281612cea565b60006040823603121561307d57600080fd5b604051604081016001600160401b0382821081831117156130a0576130a0612ab0565b8160405284359150808211156130b557600080fd5b50830136601f8201126130c757600080fd5b6130d636823560208401612ac6565b8252506020830135600281106130eb57600080fd5b602082015292915050565b803560088110612ea557600080fd5b634e487b7160e01b600052602160045260246000fd5b6008811061313957634e487b7160e01b600052602160045260246000fd5b9052565b6020808252818101839052600090604080840186845b878110156131c25761316d83613168846130f6565b61311b565b8482013561317a81612a31565b6001600160a01b03908116848701528285013585850152606090818401356131a181612a31565b16908401526080828101359084015260a09283019290910190600101613153565b5090979650505050505050565b60008160001904831182151516156131e9576131e9612f88565b500290565b60208082526018908201527f546865206475726174696f6e20697320746f6f206c6f6e670000000000000000604082015260600190565b60006020828403121561323757600080fd5b611782826130f6565b8151815260208083015161010083019161325c9084018261311b565b50604083015160018060a01b03808216604085015260608501516060850152608085015160808501528060a08601511660a08501528060c08601511660c0850152505060e083015160e083015292915050565b6000808335601e198436030181126132c657600080fd5b8301803591506001600160401b038211156132e057600080fd5b6020019150600681901b3603821315612dfd57600080fd5b61330582613168836130f6565b602081013561331381612a31565b6001600160a01b0316602083015260408181013590830152606090810135910152565b803561334181612a31565b6001600160a01b0316825260208181013590830152604090810135910152565b878152610180810161337660208301896132f8565b61338360a0830188613336565b6101008201959095526101208101939093526001600160a01b0391821661014084015216610160909101529392505050565b87815261018081016133ca60208301896132f8565b6133d760a0830188613336565b6001600160401b03959095166101008201526101208101939093526001600160a01b0391821661014084015216610160909101529392505050565b60006020828403121561342457600080fd5b61178282612e8e565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006020828403121561348a57600080fd5b813561ffff8116811461178257600080fd5b600061ffff8083168185168083038211156134b9576134b9612f88565b01949350505050565b6000826134df57634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156134f6576134f6612f88565b500390565b60006020828403121561350d57600080fd5b5051919050565b82815260a0810161178260208301846132f8565b828152608081016117826020830184613336565b815160009082906020808601845b838110156135665781518552938201939082019060010161354a565b50929695505050505050565b600060608201905083825282356020830152602083013561359281612a31565b6001600160a01b03166040929092019190915292915050565b600082516135bd818460208701612bf7565b9190910192915050565b600080604083850312156135da57600080fd5b505080516020909101519092909150565b600060ff821660ff84168060ff0382111561360857613608612f88565b019392505050565b8281526040602082015260006121626040830184612c23565b60006020828403121561363b57600080fd5b81516001600160e01b03198116811461178257600080fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201205910efabcff9fde22f11ed38d3b77e318ef2f91c10629ebf8c25cc5c3e80a64736f6c634300080d0033
Deployed Bytecode
0x60806040526004361061011f5760003560e01c8063bedb86fb116100a0578063ed2a2d6411610064578063ed2a2d6414610320578063f2fde38b14610364578063f851a44014610384578063fa5a28ea146103a4578063faa94b7b146103c457600080fd5b8063bedb86fb1461028b578063c0c53b8b146102ab578063c229f5ce146102cb578063e30c3978146102eb578063ebbc49651461030b57600080fd5b8063704b6c02116100e7578063704b6c02146101e9578063715018a6146102095780638da5cb5b1461021e578063ac9650d81461023e578063af857f1a1461026b57600080fd5b80630d34b79c1461012457806330e804a21461015a57806335416cc31461019257806348b05a29146101b4578063627cdcb9146101d4575b600080fd5b34801561013057600080fd5b5060025461014590600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b34801561016657600080fd5b5061017a610175366004612a46565b6103d7565b6040516001600160a01b039091168152602001610151565b34801561019e57600080fd5b506101b26101ad366004612a7c565b61042c565b005b3480156101c057600080fd5b506101b26101cf366004612b3b565b61051e565b3480156101e057600080fd5b506101b2610601565b3480156101f557600080fd5b506101b2610204366004612a46565b610670565b34801561021557600080fd5b506101b2610703565b34801561022a57600080fd5b5060005461017a906001600160a01b031681565b34801561024a57600080fd5b5061025e610259366004612b83565b610827565b6040516101519190612c4f565b34801561027757600080fd5b506101b2610286366004612cb1565b61091b565b34801561029757600080fd5b506101b26102a6366004612cf8565b6109e0565b3480156102b757600080fd5b506101b26102c6366004612d15565b610ab0565b3480156102d757600080fd5b506101b26102e6366004612d73565b610c59565b3480156102f757600080fd5b5060015461017a906001600160a01b031681565b34801561031757600080fd5b506101b2610d3a565b34801561032c57600080fd5b5061035661033b366004612a46565b6001600160a01b031660009081526037602052604090205490565b604051908152602001610151565b34801561037057600080fd5b506101b261037f366004612a46565b610e51565b34801561039057600080fd5b5060025461017a906001600160a01b031681565b3480156103b057600080fd5b506101b26103bf366004612e04565b610ebf565b6101b26103d2366004612eaa565b6112a3565b6001600160a01b0381811660009081526038602052604081205490911615610419576001600160a01b0380831660009081526038602052604090205416610426565b6039546001600160a01b03165b92915050565b6104396020820182612a46565b6001600160a01b0316336001600160a01b03161461049e5760405162461bcd60e51b815260206004820152601f60248201527f6f6e6c79206d616b65722063616e2063616e63656c20746865206f726465720060448201526064015b60405180910390fd5b60006104a982611611565b60008181526036602052604090205490915060ff16156104c7575050565b60008181526036602052604090819020805460ff19166001179055517f5152abf959f6564662358c2e52b702259b78bac5ee7842a0f01937e670efcc7d906105129083815260200190565b60405180910390a15050565b6002546001600160a01b031633148061054157506000546001600160a01b031633145b61055d5760405162461bcd60e51b815260040161049590612f52565b6040514690600090610573908490602401612f75565b60408051601f198184030181529190526020810180516001600160e01b031663c47f002760e01b1790529050600182146105dd5760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081b585a5b9b995d60aa1b6044820152606401610495565b6105fb73084b1c3c81545d370f3634392de611caabff814882611740565b50505050565b336000908152603760205260408120805460019290610621908490612f9e565b909155505033600081815260376020908152604091829020548251938452908301527fa82a649bbd060c9099cd7b7326e2b0dc9e9af0836480e0f849dc9eaa79710b3b910160405180910390a1565b6000546001600160a01b0316331461069a5760405162461bcd60e51b815260040161049590612fb6565b600254604080516001600160a01b03928316815291831660208301527ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461072d5760405162461bcd60e51b815260040161049590612fb6565b60008054604080516001600160a01b03909216825260208201929092527f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b2364910160405180910390a1600254604080516001600160a01b039092168252600060208301527ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc910160405180910390a1600154604080516001600160a01b039092168252600060208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910160405180910390a1600080546001600160a01b03199081169091556001805482169055600280549091169055565b6060816001600160401b0381111561084157610841612ab0565b60405190808252806020026020018201604052801561087457816020015b606081526020019060019003908161085f5790505b50905060005b82811015610914576108e43085858481811061089857610898612fd9565b90506020028101906108aa9190612fef565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061178992505050565b8282815181106108f6576108f6612fd9565b6020026020010181905250808061090c90613035565b91505061087a565b5092915050565b6002546001600160a01b031633148061093e57506000546001600160a01b031633145b61095a5760405162461bcd60e51b815260040161049590612f52565b6040516301ffc9a760e01b8152635afec8e760e11b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa1580156109a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c9919061304e565b6109d257600080fd5b6109dc82826117ae565b5050565b6002546001600160a01b0316331480610a0357506000546001600160a01b031633145b610a1f5760405162461bcd60e51b815260040161049590612f52565b6002805460ff60a01b1916600160a01b8315158102919091179182905560ff91041615610a7d576040513081527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258906020015b60405180910390a150565b6040513081527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602001610a72565b50565b600254600160b01b900460ff1615808015610ad857506002546001600160a81b90910460ff16105b80610af95750303b158015610af95750600254600160a81b900460ff166001145b610b5c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610495565b6002805460ff60a81b1916600160a81b1790558015610b89576002805460ff60b01b1916600160b01b1790555b6040516301ffc9a760e01b8152635afec8e760e11b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa158015610bd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf8919061304e565b610c0157600080fd5b610c0c848484611835565b80156105fb576002805460ff60b01b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b610c666020820182612a46565b6001600160a01b0316336001600160a01b031614610cc65760405162461bcd60e51b815260206004820152601f60248201527f6f6e6c79206d616b65722063616e2063616e63656c20746865206f66666572006044820152606401610495565b6000610cd18261199c565b60008181526036602052604090205490915060ff1615610cef575050565b60008181526036602052604090819020805460ff19166001179055517f3f9cb69d022b6ec319f86f2df848bcce01f2fc51c9f86396779a8081cf6ca2ea906105129083815260200190565b6001546001600160a01b03163314610d875760405162461bcd60e51b815260206004820152601060248201526f37b7363ca832b73234b733a7bbb732b960811b6044820152606401610495565b600054600154604080516001600160a01b0393841681529290911660208301527f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b2364910160405180910390a1600154600080546001600160a01b0319166001600160a01b039092169182178155604080519283526020830182905290917fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b91015b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610e7b5760405162461bcd60e51b815260040161049590612fb6565b600154604080516001600160a01b03928316815291831660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b9101610e27565b600254600160a01b900460ff1615610f0c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610495565b600260035403610f5e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610495565b60026003556000610f6e8561199c565b9050610f9c610f806020870187612a46565b610f906040880160208901612a46565b87610160013584611a8c565b846101400135421115610fe95760405162461bcd60e51b8152602060048201526015602482015274151a19481bd999995c881a185cc8195e1c1a5c9959605a1b6044820152606401610495565b611008610ff96020870187612a46565b826110038761306b565b611bae565b600061101d6101756080880160608901612a46565b604051634eec19f360e01b81529091506001600160a01b03821690634eec19f39061104e908790879060040161313d565b600060405180830381600087803b15801561106857600080fd5b505af115801561107c573d6000803e3d6000fd5b50600092506110989150506101208801356101008901356131cf565b9050603a548111156110bc5760405162461bcd60e51b8152600401610495906131ee565b60006110c88242612f9e565b90506000604051806101000160405280600081526020018a60400160000160208101906110f59190613225565b600781111561110657611106613105565b815260200161111b60808c0160608d01612a46565b6001600160a01b031681526080808c013560208084019190915260a08d01356040840152336060840152910190611154908c018c612a46565b6001600160a01b03168152602001838152509050836001600160a01b03166384445e2c826040518263ffffffff1660e01b81526004016111949190613240565b600060405180830381600087803b1580156111ae57600080fd5b505af11580156111c2573d6000803e3d6000fd5b506112009250505060c08a016101208b013560a08c01356111e76101a08e018e6132af565b338f60000160208101906111fb9190612a46565b611bca565b60016036600087815260200190815260200160002060006101000a81548160ff0219169083151502179055507fdf73ed587e745e6fdf33edc6e2ffca2504530296ecaa01634de553ef587189f9858a6040018b60c0018c604001606001358d6101200135338f60000160208101906112789190612a46565b60405161128b9796959493929190613361565b60405180910390a15050600160035550505050505050565b600254600160a01b900460ff16156112f05760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610495565b6002600354036113425760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610495565b60026003556101208601358310156113925760405162461bcd60e51b81526020600482015260136024820152721a5b9d985b1a590818de58db19505b5bdd5b9d606a1b6044820152606401610495565b600061139d87611611565b90506113cb6113af6020890189612a46565b6113bf60408a0160208b01612a46565b89610160013584611a8c565b6113e56113db6020890189612a46565b826110038961306b565b60006113f6856101008a01356131cf565b905060006114048242612f9e565b9050603a548211156114285760405162461bcd60e51b8152600401610495906131ee565b88610140013581111561144d5760405162461bcd60e51b8152600401610495906131ee565b61145989888787611e4e565b6040805161010081018252600080825291602082019061147f9060608e01908e01613225565b600781111561149057611490613105565b81526020016114a560808d0160608e01612a46565b6001600160a01b031681526020018b604001604001358152602001896001600160401b031681526020018b60000160208101906114e29190612a46565b6001600160a01b03168152336020820152604001839052905061150e61017560808c0160608d01612a46565b6001600160a01b03166384445e2c826040518263ffffffff1660e01b81526004016115399190613240565b600060405180830381600087803b15801561155357600080fd5b505af1158015611567573d6000803e3d6000fd5b506115a59250505060c08b01886001600160401b038b1661158c6101c08f018f6132af565b8f600001602081019061159f9190612a46565b33611bca565b7fc630db4dffa9188397f33c62ce1992b440cb908d54e66d13f13ee3acdb8107c9848b6040018c60c0018b8b8f60000160208101906115e49190612a46565b336040516115f897969594939291906133b5565b60405180910390a1505060016003555050505050505050565b60007fa62aa05b8c04db163608c1ef9d40d4cae4143cba92d6434e6fc9f25afd0975f96116416020840184612a46565b6116516040850160208601612a46565b61165d85604001611fe2565b6116698660c001612017565b6101208701356101408801356101608901356101808a01356116936101c08c016101a08d01613412565b6116a96116a46101c08e018e6132af565b61204c565b6116b68d6101e00161211e565b60408051602081019d909d526001600160a01b039b8c16908d01529990981660608b015260808a019690965260a089019490945260c088019290925260e08701526101008601526101208501526001600160401b03166101408401526101608301526101808201526101a0015b604051602081830303815290604052805190602001209050919050565b606061178283836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612153565b9392505050565b606061178283836040518060600160405280602781526020016136546027913961216a565b60405163395922a160e11b81523060048201526001600160a01b038216906372b2454290602401600060405180830381600087803b1580156117ef57600080fd5b505af1158015611803573d6000803e3d6000fd5b505050506001600160a01b03918216600090815260386020526040902080546001600160a01b03191691909216179055565b600254600160b01b900460ff1661185e5760405162461bcd60e51b81526004016104959061342d565b611866612247565b611870838361227a565b603980546001600160a01b0319166001600160a01b03831690811790915560405163395922a160e11b81523060048201526372b2454290602401600060405180830381600087803b1580156118c457600080fd5b505af11580156118d8573d6000803e3d6000fd5b50505050611983604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527fc9b6476ed7f4a8c6bfc08d93f4d6436ef7d9ac2ed055056196a31c90e486179d918101919091527f06c015bd22b4c69690933c1058878ebdfef31f9aaae40bbe86d8a09fe1b2972c60608201524660808201523060a082015260c00160408051601f198184030181529190528051602090910120603555565b50506002805460ff60a01b191690555062ed4e00603a55565b60007f6b28d384d3d8cadaa3b3d171d4c245b681136c78cd0cd15102f986d40b86a9ac6119cc6020840184612a46565b6119dc6040850160208601612a46565b6119e885604001611fe2565b6119f48660c001612017565b6101208701356101408801356101608901356101808a0135611a1d6116a46101a08d018d6132af565b611a2a8c6101c00161211e565b60408051602081019c909c526001600160a01b039a8b16908c01529890971660608a0152608089019590955260a088019390935260c087019190915260e086015261010085015261012084015261014083015261016082015261018001611723565b6001600160a01b0383161580611aaa57506001600160a01b03831633145b611ae65760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b2103a30b5b2b960991b6044820152606401610495565b6001600160a01b0384166000908152603760205260409020548214611b455760405162461bcd60e51b81526020600482015260156024820152741b9bdb98d948185b1c9958591e48195e1c1a5c9959605a1b6044820152606401610495565b60008181526036602052604090205460ff16156105fb5760405162461bcd60e51b815260206004820152602160248201527f42652063616e63656c6c6564206f722066756c66696c6c656420616c726561646044820152607960f81b6064820152608401610495565b6000611bb9836122fe565b90506105fb84828460000151612329565b600085611bdb8860208b01356131cf565b611be591906131cf565b90506000805b85811015611c3957868682818110611c0557611c05612fd9565b611c1b9260206040909202019081019150613478565b611c25908361349c565b915080611c3181613035565b915050611beb565b506000620186a0611c4e61ffff8416856131cf565b611c5891906134c2565b90506000611c6682856134e4565b90506000611c7760208d018d612a46565b6001600160a01b031603611d865783341015611ccd5760405162461bcd60e51b81526020600482015260156024820152740e0c2f2dacadce840d2e640dcdee840cadcdeeaced605b1b6044820152606401610495565b611cd786826124df565b83341115611cf257611cf285611ced86346134e4565b6124df565b60005b87811015611d8057611d6e898983818110611d1257611d12612fd9565b9050604002016020016020810190611d2a9190612a46565b620186a08b8b85818110611d4057611d40612fd9565b611d569260206040909202019081019150613478565b611d649061ffff16896131cf565b611ced91906134c2565b80611d7881613035565b915050611cf5565b50611e41565b611d9e611d9660208d018d612a46565b8688846125fd565b60005b87811015611e3f57611e2d611db960208e018e612a46565b878b8b85818110611dcc57611dcc612fd9565b9050604002016020016020810190611de49190612a46565b620186a08d8d87818110611dfa57611dfa612fd9565b611e109260206040909202019081019150613478565b611e1e9061ffff168b6131cf565b611e2891906134c2565b6125fd565b80611e3781613035565b915050611da1565b505b5050505050505050505050565b6000611e636101756080870160608801612a46565b604051634eec19f360e01b81529091506001600160a01b03821690634eec19f390611e94908690869060040161313d565b600060405180830381600087803b158015611eae57600080fd5b505af1158015611ec2573d6000803e3d6000fd5b506000925050506001600160a01b038216637f55d611611ee86080890160608a01612a46565b6080890135611efa60208b018b612a46565b60405160e085901b6001600160e01b03191681526001600160a01b03938416600482015260248101929092529091166044820152606401602060405180830381865afa158015611f4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f7291906134fb565b905060a0860135611f8c6001600160401b03871683612f9e565b1115611fda5760405162461bcd60e51b815260206004820152601d60248201527f696e73756666696369656e742072656d61696e696e6720616d6f756e740000006044820152606401610495565b505050505050565b60007f1af3242626900424ddaf3f5b84122e529f91d995b1790c0823e49d391cf4e4a982604051602001611723929190613514565b60007f84b0b5ed9a9fec2bb2cfe82669e72bf29604ccbae5677089020f6817047b7d1682604051602001611723929190613528565b600080826001600160401b0381111561206757612067612ab0565b604051908082528060200260200182016040528015612090578160200160208202803683370190505b50905060005b838110156120ed576120be8585838181106120b3576120b3612fd9565b905060400201612657565b8282815181106120d0576120d0612fd9565b6020908102919091010152806120e581613035565b915050612096565b50806040516020016120ff919061353c565b6040516020818303038152906040528051906020012091505092915050565b60007fc723cdafbc9150fe4c873f32220f68fb6468b65ae1b6743a2a8dc75e49851e7882604051602001611723929190613572565b606061216284846000856126c7565b949350505050565b60606001600160a01b0384163b6121d25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610495565b600080856001600160a01b0316856040516121ed91906135ab565b600060405180830381855af49150503d8060008114612228576040519150601f19603f3d011682016040523d82523d6000602084013e61222d565b606091505b509150915061223d8282866127f8565b9695505050505050565b600254600160b01b900460ff166122705760405162461bcd60e51b81526004016104959061342d565b612278612831565b565b6001600160a01b0382166122d05760405162461bcd60e51b815260206004820152601d60248201527f6f776e65725f2063616e6e6f74206265205a65726f20416464726573730000006044820152606401610495565b600080546001600160a01b039384166001600160a01b03199182161790915560028054929093169116179055565b60355460405161190160f01b6020820152602281019190915260428101829052600090606201611723565b600080806001600160a01b0386163b1561234857611fda868686612861565b83516040036123985760008480602001905181019061236791906135c7565b9094506001600160ff1b0381169350905061238560ff82901c6128fa565b61239090601b6135eb565b91505061242f565b835160410361241657838060200190518101906123b591906135c7565b85519194509250849060409081106123cf576123cf612fd9565b016020015160f81c9050601b81148015906123ee57508060ff16601c14155b1561241157604051630f801e8560e11b815260ff82166004820152602401610495565b61242f565b604051638baa579f60e01b815260040160405180910390fd5b6040805160008082526020820180845288905260ff841692820192909252606081018590526080810184905260019060a0016020604051602081039080840390855afa158015612483573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615806124b85750866001600160a01b0316816001600160a01b031614155b156124d657604051632057875960e21b815260040160405180910390fd5b50505050505050565b8047101561252f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610495565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461257c576040519150601f19603f3d011682016040523d82523d6000602084013e612581565b606091505b50509050806125f85760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610495565b505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526105fb90859061295f565b60007f05b43f730f67de334a342883f867101fc7ef3361dfdff4a29a7aa97e0920ef7a6126876020840184613478565b6126976040850160208601612a46565b6040516020016117239392919092835261ffff9190911660208301526001600160a01b0316604082015260600190565b6060824710156127285760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610495565b6001600160a01b0385163b61277f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610495565b600080866001600160a01b0316858760405161279b91906135ab565b60006040518083038185875af1925050503d80600081146127d8576040519150601f19603f3d011682016040523d82523d6000602084013e6127dd565b606091505b50915091506127ed8282866127f8565b979650505050505050565b60608315612807575081611782565b8251156128175782518084602001fd5b8160405162461bcd60e51b81526004016104959190612f75565b600254600160b01b900460ff1661285a5760405162461bcd60e51b81526004016104959061342d565b6001600355565b604051630b135d3f60e11b808252906001600160a01b03851690631626ba7e906128919086908690600401613610565b602060405180830381865afa1580156128ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128d29190613629565b6001600160e01b031916146125f857604051632057875960e21b815260040160405180910390fd5b600060ff82111561295b5760405162461bcd60e51b815260206004820152602560248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2038604482015264206269747360d81b6064820152608401610495565b5090565b60006129b4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166121539092919063ffffffff16565b8051909150156125f857808060200190518101906129d2919061304e565b6125f85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610495565b6001600160a01b0381168114610aad57600080fd5b600060208284031215612a5857600080fd5b813561178281612a31565b60006102208284031215612a7657600080fd5b50919050565b600060208284031215612a8e57600080fd5b81356001600160401b03811115612aa457600080fd5b61216284828501612a63565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115612ae057612ae0612ab0565b604051601f8501601f19908116603f01168101908282118183101715612b0857612b08612ab0565b81604052809350858152868686011115612b2157600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215612b4d57600080fd5b81356001600160401b03811115612b6357600080fd5b8201601f81018413612b7457600080fd5b61216284823560208401612ac6565b60008060208385031215612b9657600080fd5b82356001600160401b0380821115612bad57600080fd5b818501915085601f830112612bc157600080fd5b813581811115612bd057600080fd5b8660208260051b8501011115612be557600080fd5b60209290920196919550909350505050565b60005b83811015612c12578181015183820152602001612bfa565b838111156105fb5750506000910152565b60008151808452612c3b816020860160208601612bf7565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612ca457603f19888603018452612c92858351612c23565b94509285019290850190600101612c76565b5092979650505050505050565b60008060408385031215612cc457600080fd5b8235612ccf81612a31565b91506020830135612cdf81612a31565b809150509250929050565b8015158114610aad57600080fd5b600060208284031215612d0a57600080fd5b813561178281612cea565b600080600060608486031215612d2a57600080fd5b8335612d3581612a31565b92506020840135612d4581612a31565b91506040840135612d5581612a31565b809150509250925092565b60006102008284031215612a7657600080fd5b600060208284031215612d8557600080fd5b81356001600160401b03811115612d9b57600080fd5b61216284828501612d60565b600060408284031215612a7657600080fd5b60008083601f840112612dcb57600080fd5b5081356001600160401b03811115612de257600080fd5b60208301915083602060a083028501011115612dfd57600080fd5b9250929050565b60008060008060608587031215612e1a57600080fd5b84356001600160401b0380821115612e3157600080fd5b612e3d88838901612d60565b95506020870135915080821115612e5357600080fd5b612e5f88838901612da7565b94506040870135915080821115612e7557600080fd5b50612e8287828801612db9565b95989497509550505050565b80356001600160401b0381168114612ea557600080fd5b919050565b60008060008060008060a08789031215612ec357600080fd5b86356001600160401b0380821115612eda57600080fd5b612ee68a838b01612a63565b97506020890135915080821115612efc57600080fd5b612f088a838b01612da7565b9650612f1660408a01612e8e565b9550606089013594506080890135915080821115612f3357600080fd5b50612f4089828a01612db9565b979a9699509497509295939492505050565b60208082526009908201526837b7363ca0b236b4b760b91b604082015260600190565b6020815260006117826020830184612c23565b634e487b7160e01b600052601160045260246000fd5b60008219821115612fb157612fb1612f88565b500190565b60208082526009908201526837b7363ca7bbb732b960b91b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261300657600080fd5b8301803591506001600160401b0382111561302057600080fd5b602001915036819003821315612dfd57600080fd5b60006001820161304757613047612f88565b5060010190565b60006020828403121561306057600080fd5b815161178281612cea565b60006040823603121561307d57600080fd5b604051604081016001600160401b0382821081831117156130a0576130a0612ab0565b8160405284359150808211156130b557600080fd5b50830136601f8201126130c757600080fd5b6130d636823560208401612ac6565b8252506020830135600281106130eb57600080fd5b602082015292915050565b803560088110612ea557600080fd5b634e487b7160e01b600052602160045260246000fd5b6008811061313957634e487b7160e01b600052602160045260246000fd5b9052565b6020808252818101839052600090604080840186845b878110156131c25761316d83613168846130f6565b61311b565b8482013561317a81612a31565b6001600160a01b03908116848701528285013585850152606090818401356131a181612a31565b16908401526080828101359084015260a09283019290910190600101613153565b5090979650505050505050565b60008160001904831182151516156131e9576131e9612f88565b500290565b60208082526018908201527f546865206475726174696f6e20697320746f6f206c6f6e670000000000000000604082015260600190565b60006020828403121561323757600080fd5b611782826130f6565b8151815260208083015161010083019161325c9084018261311b565b50604083015160018060a01b03808216604085015260608501516060850152608085015160808501528060a08601511660a08501528060c08601511660c0850152505060e083015160e083015292915050565b6000808335601e198436030181126132c657600080fd5b8301803591506001600160401b038211156132e057600080fd5b6020019150600681901b3603821315612dfd57600080fd5b61330582613168836130f6565b602081013561331381612a31565b6001600160a01b0316602083015260408181013590830152606090810135910152565b803561334181612a31565b6001600160a01b0316825260208181013590830152604090810135910152565b878152610180810161337660208301896132f8565b61338360a0830188613336565b6101008201959095526101208101939093526001600160a01b0391821661014084015216610160909101529392505050565b87815261018081016133ca60208301896132f8565b6133d760a0830188613336565b6001600160401b03959095166101008201526101208101939093526001600160a01b0391821661014084015216610160909101529392505050565b60006020828403121561342457600080fd5b61178282612e8e565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006020828403121561348a57600080fd5b813561ffff8116811461178257600080fd5b600061ffff8083168185168083038211156134b9576134b9612f88565b01949350505050565b6000826134df57634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156134f6576134f6612f88565b500390565b60006020828403121561350d57600080fd5b5051919050565b82815260a0810161178260208301846132f8565b828152608081016117826020830184613336565b815160009082906020808601845b838110156135665781518552938201939082019060010161354a565b50929695505050505050565b600060608201905083825282356020830152602083013561359281612a31565b6001600160a01b03166040929092019190915292915050565b600082516135bd818460208701612bf7565b9190910192915050565b600080604083850312156135da57600080fd5b505080516020909101519092909150565b600060ff821660ff84168060ff0382111561360857613608612f88565b019392505050565b8281526040602082015260006121626040830184612c23565b60006020828403121561363b57600080fd5b81516001600160e01b03198116811461178257600080fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201205910efabcff9fde22f11ed38d3b77e318ef2f91c10629ebf8c25cc5c3e80a64736f6c634300080d0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in GLMR
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.