Source Code
Latest 25 from a total of 37 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Add Batch Items ... | 6104609 | 561 days ago | IN | 0 ETH | 0.00000211 | ||||
| Set Display Para... | 6104529 | 561 days ago | IN | 0 ETH | 0.00000064 | ||||
| Set Display Para... | 6099975 | 561 days ago | IN | 0 ETH | 0.00000022 | ||||
| Set Display Para... | 6099864 | 561 days ago | IN | 0 ETH | 0.00000022 | ||||
| Add Asset Item P... | 5821241 | 568 days ago | IN | 0 ETH | 0.00000195 | ||||
| Add Asset Item P... | 5821232 | 568 days ago | IN | 0 ETH | 0.00000231 | ||||
| Add Batch Items ... | 5821097 | 568 days ago | IN | 0 ETH | 0.000004 | ||||
| Set Display Para... | 5820858 | 568 days ago | IN | 0 ETH | 0.00000298 | ||||
| Add Batch Items ... | 4998008 | 587 days ago | IN | 0 ETH | 0.0000332 | ||||
| Set Display Para... | 4996643 | 587 days ago | IN | 0 ETH | 0.00001876 | ||||
| Add Batch Items ... | 4794909 | 591 days ago | IN | 0 ETH | 0.00000762 | ||||
| Set Display Para... | 4794693 | 591 days ago | IN | 0 ETH | 0.00000722 | ||||
| Add Batch Items ... | 4428612 | 600 days ago | IN | 0 ETH | 0.00000426 | ||||
| Add Batch Items ... | 4428504 | 600 days ago | IN | 0 ETH | 0.00000306 | ||||
| Set Display Para... | 4428362 | 600 days ago | IN | 0 ETH | 0.00000214 | ||||
| Set Display Para... | 4041301 | 609 days ago | IN | 0 ETH | 0.00000269 | ||||
| Set Display Para... | 3849404 | 613 days ago | IN | 0 ETH | 0.00039145 | ||||
| Add Batch Items ... | 3104963 | 631 days ago | IN | 0 ETH | 0.00052715 | ||||
| Set Display Para... | 3103211 | 631 days ago | IN | 0 ETH | 0.00039313 | ||||
| Buy Asset Item | 2993383 | 633 days ago | IN | 0 ETH | 0.00001346 | ||||
| Add Asset Item P... | 2090623 | 654 days ago | IN | 0 ETH | 0.00002543 | ||||
| Buy Asset Item | 2090465 | 654 days ago | IN | 0 ETH | 0.00002687 | ||||
| Edit Asset Item ... | 2090326 | 654 days ago | IN | 0 ETH | 0.00002437 | ||||
| Add Asset Item P... | 2090212 | 654 days ago | IN | 0 ETH | 0.00002571 | ||||
| Add Batch Items ... | 2090112 | 654 days ago | IN | 0 ETH | 0.0000302 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
EnvelopLazyKioskServiceBlast
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
// ENVELOP(NIFTSY) NFT(wNFT) Kiosk.
pragma solidity 0.8.21;
import "@envelop-subscription/contracts/ServiceProviderOwnable.sol";
import "./NFTKioskLazy.sol";
import "../interfaces/IModelWhiteList.sol";
import "./BlastPoints.sol";
contract EnvelopLazyKioskServiceBlast is NFTKioskLazy, ServiceProviderOwnable, BlastPoints {
address public modelWhiteListAddress;
constructor (address _subscrRegistry, address _pointsOperator)
ServiceProviderOwnable(_subscrRegistry)
BlastPoints(_pointsOperator)
{
}
function setDisplayParams(
string calldata _name,
address _beneficiary, // who will receive assets from sale
uint256 _enableAfter,
uint256 _disableAfter,
address _priceModel
) public override(NFTKiosk)
{
require(
IModelWhiteList(modelWhiteListAddress).isModelEnabled(_priceModel),
"Unexpected price model address"
);
if (displays[hlpHashString(_name)].owner == address(0))
{
// Fix subscriptionfor NEW display only
_checkAndFixSubscription(msg.sender);
}
super.setDisplayParams(
_name,
_beneficiary,
_enableAfter,
_disableAfter,
_priceModel
);
}
////////////////////////////////////////
// Admin functions ///
////////////////////////////////////////
function setWhiteList(address _modelWhiteList) external onlyOwner {
modelWhiteListAddress = _modelWhiteList;
}
/////////////////////////////////////////////////////////////////////
function checkUser(address _user) external view returns (bool ok, bool needFix) {
return _checkUserSubscription(_user);
}
}// SPDX-License-Identifier: MIT
// ENVELOP(NIFTSY) Subscription Registry Contract V2
/// The subscription platform operates with the following role model
/// (it is assumed that the actor with the role is implemented as a contract).
/// `Service Provider` is a contract whose services are sold by subscription.
/// `Agent` - a contract that sells a subscription on behalf ofservice provider.
/// May receive sales commission
/// `Platform` - SubscriptionRegistry contract that performs processingsubscriptions,
/// fares, tickets
pragma solidity 0.8.21;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ServiceProvider.sol";
/// @title ServiceProviderOwnable contract
/// @author Envelop project Team
/// @notice Contract implements Ownable pattern for service providers.
/// @dev Inherit this code in service provider contract that
/// want use subscription.
contract ServiceProviderOwnable is ServiceProvider, Ownable {
constructor(address _subscrRegistry)
ServiceProvider(_subscrRegistry)
{
}
///////////////////////////////////////
// Admin functions ///
////////////////////////////////////////
function newTariff(Tariff memory _newTariff) external onlyOwner returns(uint256 tariffIndex) {
tariffIndex = _registerServiceTariff(_newTariff);
}
function registerServiceTariff(Tariff memory _newTariff)
external onlyOwner returns(uint256)
{
return _registerServiceTariff(_newTariff);
}
function editServiceTariff(
uint256 _tariffIndex,
uint256 _timelockPeriod,
uint256 _ticketValidPeriod,
uint256 _counter,
bool _isAvailable,
address _beneficiary
) external onlyOwner
{
_editServiceTariff(
_tariffIndex,
_timelockPeriod,
_ticketValidPeriod,
_counter,
_isAvailable,
_beneficiary
);
}
function addPayOption(
uint256 _tariffIndex,
address _paymentToken,
uint256 _paymentAmount,
uint16 _agentFeePercent
) external onlyOwner returns(uint256 index)
{
index = _addTariffPayOption(
_tariffIndex,
_paymentToken,
_paymentAmount,
_agentFeePercent
);
}
function editPayOption(
uint256 _tariffIndex,
uint256 _payWithIndex,
address _paymentToken,
uint256 _paymentAmount,
uint16 _agentFeePercent
) external onlyOwner
{
_editTariffPayOption(
_tariffIndex,
_payWithIndex,
_paymentToken,
_paymentAmount,
_agentFeePercent
);
}
function authorizeAgentForService(
address _agent,
uint256[] memory _serviceTariffIndexes
) external onlyOwner returns (uint256[] memory actualTariffs)
{
actualTariffs = _authorizeAgentForService(
_agent,
_serviceTariffIndexes
);
}
function setSubscriptionRegistry(address _subscrRegistry) external onlyOwner {
subscriptionRegistry = ISubscriptionRegistry(_subscrRegistry);
}
function setSubscriptionOnOff(bool _isEnable) external onlyOwner {
isEnabled = _isEnable;
}
}// SPDX-License-Identifier: MIT
// ENVELOP(NIFTSY) NFT(wNFT) Kiosk.
pragma solidity 0.8.21;
import "./NFTKiosk.sol";
contract NFTKioskLazy is NFTKiosk {
function buyAssetItem(
ETypes.AssetItem calldata _assetItem,
uint256 _priceIndex,
address _buyer,
address _referrer,
string calldata _promo
) external override payable nonReentrant
{
// 1.Define exact asset price with discounts
ETypes.AssetItem memory payWithItem;
{ // Against stack too deep
(KTypes.Price[] memory pArray, KTypes.Discount[] memory dArray)
= _getAssetItemPricesAndDiscounts(
_assetItem, _buyer, _referrer, hlpHashString(_promo)
);
uint256 totalDiscountPercent;
for (uint256 i = 0; i < dArray.length; ++ i){
totalDiscountPercent += dArray[i].dsctPercent;
if (dArray[i].dsctType == KTypes.DiscountType.REFERRAL){
emit EnvelopReferrer(
_referrer, msg.sender,
pArray[_priceIndex].payWith,
pArray[_priceIndex].amount,
uint16(dArray[i].dsctPercent)
);
}
}
payWithItem = ETypes.AssetItem(
ETypes.Asset(
pArray[_priceIndex].payWith == address(0)
?ETypes.AssetType.NATIVE
:ETypes.AssetType.ERC20,
pArray[_priceIndex].payWith
),
0,
pArray[_priceIndex].amount
* (PERCENT_DENOMINATOR - totalDiscountPercent)
* (_assetItem.amount == 0 ? 1 : _assetItem.amount) // amount of items for buy
/ PERCENT_DENOMINATOR
);
}
// 2. Manage display records for different cases
address beneficiary;
address modelAddress;
KTypes.Place memory p = getAssetItemPlace(_assetItem);
// Case when NFT just transfered to kiosk contract
if (p.display == bytes32(0)) {
//isImplicitAdded = true;
beneficiary = displays[DEFAULT_DISPLAY].beneficiary;
p.display = DEFAULT_DISPLAY;
p.index = DEFAULT_INDEX;
modelAddress = displays[DEFAULT_DISPLAY].priceModel;
} else {
beneficiary = displays[p.display].beneficiary;
modelAddress = displays[p.display].priceModel;
}
require(
displays[p.display].enableAfter < block.timestamp
&& displays[p.display].disableAfter >= block.timestamp,
"Only in time"
);
// 3.Receive payment or buy for free
if (!_canBuyForFree(p.display, msg.sender)) {
// There are two different cases: native token and erc20
if (payWithItem.asset.assetType == ETypes.AssetType.NATIVE )
//if (pArray[_priceIndex].payWith == address(0))
{
// Native token payment
require(payWithItem.amount
<= _transferSafe(payWithItem, address(this), beneficiary),
"Insufficient balance after payment transfer"
);
// Return change
if ((msg.value - payWithItem.amount) > 0) {
address payable s = payable(msg.sender);
s.transfer(msg.value - payWithItem.amount);
}
} else {
// ERC20 token payment
require(msg.value == 0, "Only ERC20 tokens");
require(payWithItem.amount
<=_transferSafe(payWithItem, msg.sender, beneficiary),
"Insufficient balance after payment transfer"
);
}
// 4. Make some action for _buer
if (IDisplayPriceModel(modelAddress).makeActionInModel(_assetItem, _buyer)) {
// in case makeActionInModel return true we need make transfer any way
// this usefull for compatibility atleast both price models: simple and lazy
_transferSafe(_assetItem, address(this), _buyer);
}
}
else {
// 4. Send asset to buyer in case this is free payment case.
_transferSafe(_assetItem, address(this), _buyer);
}
// 4. Make some action for _buer
//IDisplayPriceModel(modelAddress).makeActionInModel(_assetItem, _buyer);
}
function removeAssetItem(ETypes.AssetItem calldata _assetItem)
external
{
KTypes.Place memory p = getAssetItemPlace(_assetItem);
if (p.display == bytes32(0)) {
p.display = DEFAULT_DISPLAY;
p.index = DEFAULT_INDEX;
}
require(
displays[p.display].items[p.index].owner == msg.sender
|| displays[p.display].owner == msg.sender ,
"Only Item owner can remove"
);
_removeAssetItemRecord(p.display, p.index,_assetItem);
_transferSafe(_assetItem, address(this), msg.sender);
emit EnvelopPurchase(p.display, _assetItem.asset.contractAddress, _assetItem.tokenId);
}
// function _getAssetItemPricesAndDiscounts(
// ETypes.AssetItem memory _assetItem,
// address _buyer,
// address _referrer,
// bytes32 _promoHash
// )
// internal
// view
// override
// returns(KTypes.Price[] memory, KTypes.Discount[] memory)
// {
// // Define current asset Place
// KTypes.Place memory pl = getAssetItemPlace(_assetItem);
// if (pl.display == bytes32(0) && pl.index == 0){
// return (
// IDisplayPriceModel(displays[DEFAULT_DISPLAY].priceModel).getItemPrices(_assetItem),
// IDisplayPriceModel(displays[DEFAULT_DISPLAY].priceModel).getItemDiscounts(
// _assetItem,
// _buyer,
// _referrer,
// _promoHash
// )
// );
// }
// if (displays[pl.display].items[pl.index].prices.length > 0)
// {
// return (
// displays[pl.display].items[pl.index].prices,
// IDisplayPriceModel(displays[pl.display].priceModel).getItemDiscounts(
// _assetItem,
// _buyer,
// _referrer,
// _promoHash
// )
// );
// }
// // If there is no individual prices then need ask priceModel contract of display
// return (
// IDisplayPriceModel(displays[pl.display].priceModel).getItemPrices(_assetItem),
// IDisplayPriceModel(displays[pl.display].priceModel).getItemDiscounts(
// _assetItem,
// _buyer,
// _referrer,
// _promoHash
// )
// );
// }
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
interface IModelWhiteList {
function isModelEnabled(address _model) external view returns(bool);
}// SPDX-License-Identifier: MIT
// ENVELOP protocol for NFT. Blast Points Adapter
pragma solidity 0.8.21;
enum YieldMode {
AUTOMATIC,
VOID,
CLAIMABLE
}
enum GasMode {
VOID,
CLAIMABLE
}
interface IBlast {
// configure
function configureContract(address contractAddress, YieldMode _yield, GasMode gasMode, address governor) external;
function configure(YieldMode _yield, GasMode gasMode, address governor) external;
// base configuration options
function configureClaimableYield() external;
function configureClaimableYieldOnBehalf(address contractAddress) external;
function configureAutomaticYield() external;
function configureAutomaticYieldOnBehalf(address contractAddress) external;
function configureVoidYield() external;
function configureVoidYieldOnBehalf(address contractAddress) external;
function configureClaimableGas() external;
function configureClaimableGasOnBehalf(address contractAddress) external;
function configureVoidGas() external;
function configureVoidGasOnBehalf(address contractAddress) external;
function configureGovernor(address _governor) external;
function configureGovernorOnBehalf(address _newGovernor, address contractAddress) external;
// claim yield
function claimYield(address contractAddress, address recipientOfYield, uint256 amount) external returns (uint256);
function claimAllYield(address contractAddress, address recipientOfYield) external returns (uint256);
// claim gas
function claimAllGas(address contractAddress, address recipientOfGas) external returns (uint256);
function claimGasAtMinClaimRate(address contractAddress, address recipientOfGas, uint256 minClaimRateBips) external returns (uint256);
function claimMaxGas(address contractAddress, address recipientOfGas) external returns (uint256);
function claimGas(address contractAddress, address recipientOfGas, uint256 gasToClaim, uint256 gasSecondsToConsume) external returns (uint256);
// read functions
function readClaimableYield(address contractAddress) external view returns (uint256);
function readYieldConfiguration(address contractAddress) external view returns (uint8);
function readGasParams(address contractAddress) external view returns (uint256 etherSeconds, uint256 etherBalance, uint256 lastUpdated, GasMode);
}
interface IBlastPoints {
function configurePointsOperator(address operator) external;
}
contract BlastPoints {
address public constant BLAST_POINTS_ADDRESS = 0x2536FE9ab3F511540F2f9e2eC2A805005C3Dd800;
IBlast public constant BLAST = IBlast(0x4300000000000000000000000000000000000002);
constructor(address _pointsOperator) {
// be sure to use the appropriate testnet/mainnet BlastPoints address
IBlastPoints(BLAST_POINTS_ADDRESS).configurePointsOperator(_pointsOperator);
BLAST.configureGovernor(msg.sender);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// ENVELOP(NIFTSY) Subscription Registry Contract V2
/// The subscription platform operates with the following role model
/// (it is assumed that the actor with the role is implemented as a contract).
/// `Service Provider` is a contract whose services are sold by subscription.
/// `Agent` - a contract that sells a subscription on behalf ofservice provider.
/// May receive sales commission
/// `Platform` - SubscriptionRegistry contract that performs processingsubscriptions,
/// fares, tickets
pragma solidity 0.8.21;
import "../interfaces/ISubscriptionRegistry.sol";
/// @title ServiceProvider abstract contract
/// @author Envelop project Team
/// @notice Abstract contract implements subscribing features.
/// For use with SubscriptionRegestry
/// @dev Use this code in service provider contract that
/// want use subscription. One contract = one servie
/// Please see example folder
abstract contract ServiceProvider {
address public serviceProvider;
ISubscriptionRegistry public subscriptionRegistry;
bool public isEnabled = true;
constructor(address _subscrRegistry) {
require(_subscrRegistry != address(0), 'Non zero only');
serviceProvider = address(this);
subscriptionRegistry = ISubscriptionRegistry(_subscrRegistry);
}
function _registerServiceTariff(Tariff memory _newTariff)
internal virtual returns(uint256)
{
return subscriptionRegistry.registerServiceTariff(_newTariff);
}
function _editServiceTariff(
uint256 _tariffIndex,
uint256 _timelockPeriod,
uint256 _ticketValidPeriod,
uint256 _counter,
bool _isAvailable,
address _beneficiary
) internal virtual
{
subscriptionRegistry.editServiceTariff(
_tariffIndex,
_timelockPeriod,
_ticketValidPeriod,
_counter,
_isAvailable,
_beneficiary
);
}
function _addTariffPayOption(
uint256 _tariffIndex,
address _paymentToken,
uint256 _paymentAmount,
uint16 _agentFeePercent
) internal virtual returns(uint256)
{
return subscriptionRegistry.addTariffPayOption(
_tariffIndex,
_paymentToken,
_paymentAmount,
_agentFeePercent
);
}
function _editTariffPayOption(
uint256 _tariffIndex,
uint256 _payWithIndex,
address _paymentToken,
uint256 _paymentAmount,
uint16 _agentFeePercent
) internal virtual
{
subscriptionRegistry.editTariffPayOption(
_tariffIndex,
_payWithIndex,
_paymentToken,
_paymentAmount,
_agentFeePercent
);
}
function _authorizeAgentForService(
address _agent,
uint256[] memory _serviceTariffIndexes
) internal virtual returns (uint256[] memory)
{
// TODO Check agent
return subscriptionRegistry.authorizeAgentForService(
_agent,
_serviceTariffIndexes
);
}
////////////////////////////
// Main USAGE //
////////////////////////////
function _checkAndFixSubscription(address _user)
internal
returns (bool ok)
{
if (isEnabled) {
ok = subscriptionRegistry.checkAndFixUserSubscription(
_user
);
} else {
ok = true;
}
}
function _checkUserSubscription(address _user)
internal
view
returns (bool ok, bool needFix)
{
if (isEnabled) {
(ok, needFix) = subscriptionRegistry.checkUserSubscription(
_user,
address(this)
);
} else {
ok = true;
}
}
}// SPDX-License-Identifier: MIT
// ENVELOP(NIFTSY) NFT(wNFT) Kiosk.
pragma solidity 0.8.21;
import "@envelop-protocol-v1/contracts/TokenServiceExtended.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
//import "./KTypes.sol";
import "../interfaces/IDisplayPriceModel.sol";
//import "./DefaultPriceModel.sol";
contract NFTKiosk is
TokenServiceExtended,
ReentrancyGuard,
ERC721Holder,
ERC1155Holder
{
uint256 constant public DEFAULT_INDEX = 0;
uint256 constant public PERCENT_DENOMINATOR = 10000;
bytes32 immutable public DEFAULT_DISPLAY = hlpHashString('NFTKiosk');
mapping(bytes32 => KTypes.Display) public displays;
mapping(bytes32 => address[]) public displayAdmins;
// mapping from contract address & tokenId to Place(displayHash and index)
mapping(address => mapping(uint256 => KTypes.Place)) public assetAtDisplay;
event DisplayChanged(
bytes32 indexed display,
address indexed owner,
address indexed beneficiary, // who will receive assets from sale
uint256 enableAfter,
uint256 disableAfter,
address priceModel,
string name
);
event DisplayTransfer(
bytes32 indexed display,
address indexed from,
address indexed newOwner
);
event ItemAddedToDisplay(
bytes32 indexed display,
address indexed assetContract,
uint256 indexed assetTokenId,
uint256 placeIndex
);
event ItemPriceChanged(
bytes32 indexed display,
address indexed assetContract,
uint256 indexed assetTokenId
);
event EnvelopPurchase(
bytes32 indexed display,
address indexed assetContract,
uint256 indexed assetTokenId
);
event EnvelopReferrer(
address indexed referrer,
address indexed customer,
address indexed payWithToken,
uint256 payWithAmount,
uint16 percentDiscount
);
function setDisplayParams(
string calldata _name,
address _beneficiary, // who will receive assets from sale
uint256 _enableAfter,
uint256 _disableAfter,
address _priceModel
) public virtual
{
// require(
// displays[DEFAULT_DISPLAY].owner != address(0),
// "DEFAULT DISPLAY must be created first"
// );
// TODO Check that model is whitelisted.. ??Ask Alex
bytes32 _displayNameHash = hlpHashString(_name);
require(
(displays[_displayNameHash].owner == msg.sender // edit existing
||displays[_displayNameHash].owner == address(0)), // create new
"Only for Display Owner"
);
_setDisplayParams(
_displayNameHash,
msg.sender,
_beneficiary, // who will receive assets from sale
_enableAfter,
_disableAfter,
_priceModel
);
emit DisplayChanged(
_displayNameHash,
msg.sender,
_beneficiary, // who will receive assets from sale
_enableAfter,
_disableAfter,
_priceModel,
_name
);
}
function transferDisplay(address _to, bytes32 _displayNameHash)
external
{
require(displays[_displayNameHash].owner == msg.sender, "Only for Display Owner");
displays[_displayNameHash].owner = _to;
emit DisplayTransfer(_displayNameHash, msg.sender, _to);
}
// TODO Check that display exists
function addItemToDisplay(
bytes32 _displayNameHash,
ETypes.AssetItem memory _assetItem,
KTypes.Price[] calldata _prices
)
public
returns (KTypes.Place memory place)
{
// We need two checks.
// 1. Only item with zero place (display and index) can be added
// to exact display
KTypes.Place memory p =
assetAtDisplay[_assetItem.asset.contractAddress][_assetItem.tokenId];
require(
p.display == bytes32(0) && p.index == 0,
"Already at display"
);
// 2. Item has been transfered to this contract
// Next check is For 721 only. Because 1155 standard
// has no `ownerOf` method. Hence we can't use simple (implicit)
// erc1155 transfer for put item at display.
// In this implementation you cant`t 'edit' display after
// simple (implicit) adding item to display
// if (_ownerOf(_assetItem) != address(this)) {
// Do transfer to this contract
require(_assetItem.amount
<=_transferSafe(_assetItem, msg.sender, address(this)),
"Insufficient balance after NFT transfer"
);
// }
// DEFAULT_DISPLAY accept items from any addresses
if (msg.sender != displays[_displayNameHash].owner) {
require(
_displayNameHash == DEFAULT_DISPLAY,
"Only Default Display allow for any"
);
}
place = _addItemRecordAtDisplay(
_displayNameHash,
msg.sender, // Item Owner
_assetItem,
_prices
);
emit ItemAddedToDisplay(
place.display,
_assetItem.asset.contractAddress,
_assetItem.tokenId,
place.index
);
}
function addBatchItemsToDisplayWithSamePrice(
bytes32 _displayNameHash,
ETypes.AssetItem[] memory _assetItems,
KTypes.Price[] calldata _prices
)
external
returns (KTypes.Place[] memory)
{
// Lets calc and create array var for result
KTypes.Place[] memory pls = new KTypes.Place[](_assetItems.length);
for (uint256 i = 0; i < _assetItems.length; ++i){
pls[i] = addItemToDisplay(_displayNameHash,_assetItems[i],_prices);
}
return pls;
}
function addAssetItemPriceAtIndex(
ETypes.AssetItem calldata _assetItem,
KTypes.Price[] calldata _prices
)
external
{
KTypes.Place memory p = getAssetItemPlace(_assetItem);
// check that sender is item owner or display owner(if item owner not set)
if (displays[p.display].items[p.index].owner != msg.sender)
{
require(
displays[p.display].owner == msg.sender,
"Only display owner can edit price"
);
}
_addItemPriceAtIndex(p.display, p.index, _prices);
emit ItemPriceChanged(
p.display,
_assetItem.asset.contractAddress,
_assetItem.tokenId
);
}
function editAssetItemPriceAtIndex(
ETypes.AssetItem calldata _assetItem,
uint256 _priceIndex,
KTypes.Price calldata _price
)
external
{
KTypes.Place memory p = getAssetItemPlace(_assetItem);
// check that sender is item owner or display owner(if item owner not set)
if (displays[p.display].items[p.index].owner != msg.sender)
{
require(displays[p.display].owner == msg.sender, "Only for display owner");
}
_editItemPriceAtIndex(p.display, p.index, _priceIndex ,_price);
emit ItemPriceChanged(
p.display,
_assetItem.asset.contractAddress,
_assetItem.tokenId
);
}
function removeLastPersonalPriceForAssetItem(
ETypes.AssetItem calldata _assetItem
)
external
{
KTypes.Place memory p = getAssetItemPlace(_assetItem);
// check that sender is item owner or display owner(if item owner not set)
if (displays[p.display].items[p.index].owner != msg.sender)
{
require(displays[p.display].owner == msg.sender, "Only for display owner");
}
KTypes.Price[] storage priceArray = displays[p.display].items[p.index].prices;
priceArray.pop();
emit ItemPriceChanged(
p.display,
_assetItem.asset.contractAddress,
_assetItem.tokenId
);
}
function buyAssetItem(
ETypes.AssetItem calldata _assetItem,
uint256 _priceIndex,
address _buyer,
address _referrer,
string calldata _promo
) external virtual payable nonReentrant
{
// 1.Define exact asset price with discounts
ETypes.AssetItem memory payWithItem;
{ // Against stack too deep
(KTypes.Price[] memory pArray, KTypes.Discount[] memory dArray)
= _getAssetItemPricesAndDiscounts(
_assetItem, _buyer, _referrer, hlpHashString(_promo)
);
uint256 totalDiscountPercent;
for (uint256 i = 0; i < dArray.length; ++ i){
totalDiscountPercent += dArray[i].dsctPercent;
if (dArray[i].dsctType ==KTypes.DiscountType.REFERRAL){
emit EnvelopReferrer(
_referrer, msg.sender,
pArray[_priceIndex].payWith,
pArray[_priceIndex].amount,
uint16(dArray[i].dsctPercent)
);
}
}
payWithItem = ETypes.AssetItem(
ETypes.Asset(
pArray[_priceIndex].payWith == address(0)
?ETypes.AssetType.NATIVE
:ETypes.AssetType.ERC20,
pArray[_priceIndex].payWith
),
0,
pArray[_priceIndex].amount
* (PERCENT_DENOMINATOR - totalDiscountPercent) / PERCENT_DENOMINATOR
);
}
// 2. Manage display records for different cases
KTypes.Place memory p = getAssetItemPlace(_assetItem);
address beneficiary;
// Case when NFT just transfered to kiosk contract
if (p.display == bytes32(0)) {
// isImplicitAdded = true;
beneficiary = displays[DEFAULT_DISPLAY].beneficiary;
p.display = DEFAULT_DISPLAY;
p.index = DEFAULT_INDEX;
} else {
beneficiary = displays[p.display].beneficiary;
// 2.1 remove item from display
_removeAssetItemRecord(p.display, p.index,_assetItem);
}
require(
displays[p.display].enableAfter < block.timestamp
&& displays[p.display].disableAfter >= block.timestamp,
"Only in time"
);
// 3.Receive payment or buy for free
if (!_canBuyForFree(p.display, msg.sender)) {
// There are two different cases: native token and erc20
if (payWithItem.asset.assetType == ETypes.AssetType.NATIVE )
//if (pArray[_priceIndex].payWith == address(0))
{
// Native token payment
require(payWithItem.amount
<= _transferSafe(payWithItem, address(this), beneficiary),
"Insufficient balance after payment transfer"
);
// Return change
if ((msg.value - payWithItem.amount) > 0) {
address payable s = payable(msg.sender);
s.transfer(msg.value - payWithItem.amount);
}
} else {
// ERC20 token payment
require(msg.value == 0, "Only ERC20 tokens");
require(payWithItem.amount
<=_transferSafe(payWithItem, msg.sender, beneficiary),
"Insufficient balance after payment transfer"
);
}
}
// 4. Send asset to buyer
_transferSafe(_assetItem, address(this), _buyer);
emit EnvelopPurchase(p.display, _assetItem.asset.contractAddress, _assetItem.tokenId);
}
function addAdminToDisplay(bytes32 _displayNameHash, address _admin)
external
{
require(
displays[_displayNameHash].owner == msg.sender,
"Only display owner can add admins"
);
// Check that admin already exist or not
require(
!_isDisplayAdmin(_displayNameHash, _admin),
"Already admin"
);
displayAdmins[_displayNameHash].push(_admin);
}
function removeAdminFromDisplayByIndex(bytes32 _displayNameHash, uint256 _adminIndex)
external
{
require(
displays[_displayNameHash].owner == msg.sender,
"Only display owner can add admins"
);
address[] storage admins = displayAdmins[_displayNameHash];
if (_adminIndex != admins.length - 1) {
admins[_adminIndex] = admins[admins.length - 1];
}
admins.pop();
}
//////////////////////////////////////////////////////////////
function getDisplayOwner(bytes32 _displayNameHash) public view returns (address) {
return displays[_displayNameHash].owner;
}
function getDisplay(bytes32 _displayNameHash)
public
view
returns (KTypes.Display memory)
{
return displays[_displayNameHash];
}
function getAssetItemPlace(ETypes.AssetItem memory _assetItem)
public
view
returns (KTypes.Place memory)
{
if (_assetItem.asset.assetType == ETypes.AssetType.ERC721) {
// ERC721
require(
_ownerOf(_assetItem) == address(this),
"Asset not transfered to kiosk"
);
} else {
//ERC1155 or other**
require(
//_balanceOf(_assetItem, address(this)) >= _assetItem.amount,
_balanceOf(_assetItem, address(this)) > 0,
"Asset not transfered to kiosk"
);
}
return assetAtDisplay[_assetItem.asset.contractAddress][_assetItem.tokenId];
}
function getAssetItemPricesAndDiscounts(
ETypes.AssetItem memory _assetItem,
address _buyer,
address _referrer,
string calldata _promo
)
external
view
returns (KTypes.Price[] memory, KTypes.Discount[] memory)
{
return _getAssetItemPricesAndDiscounts(
_assetItem,
_buyer,
_referrer,
hlpHashString(_promo)
);
}
/// @notice Returns ONLY items that was added with `addItemToDisplay`.
/// @dev For obtain all items please use envelop oracle
function getDisplayAssetItems(bytes32 _displayNameHash)
public
view
virtual
returns (KTypes.ItemForSale[] memory)
{
return displays[_displayNameHash].items;
}
function getAssetItem(ETypes.AssetItem memory _assetItem)
public
view
returns (KTypes.ItemForSale memory)
{
KTypes.Place memory p = getAssetItemPlace(_assetItem);
return displays[p.display].items[p.index];
}
function hlpHashString(string memory _name) public pure returns (bytes32) {
return keccak256(abi.encode(_name));
}
function canBuyForFree(bytes32 _displayNameHash, address _who)
external
view
returns(bool)
{
return _canBuyForFree(_displayNameHash, _who);
}
function isDisplayAdmin(bytes32 _displayNameHash, address _who)
external
view
returns(bool)
{
return _isDisplayAdmin(_displayNameHash, _who);
}
/////////////////////////////
/// Internals //
/////////////////////////////
function _setDisplayParams(
bytes32 _displayNameHash,
address _owner,
address _beneficiary, // who will receive assets from sale
uint256 _enableAfter,
uint256 _disableAfter,
address _priceModel
)
internal
{
KTypes.Display storage d = displays[_displayNameHash];
d.owner = _owner;
d.beneficiary = _beneficiary;
d.enableAfter = _enableAfter;
d.disableAfter = _disableAfter;
d.priceModel = _priceModel;
}
function _addItemRecordAtDisplay(
bytes32 _displayNameHash,
address _itemOwner,
ETypes.AssetItem memory _nft,
KTypes.Price[] calldata _prices
)
internal
returns (KTypes.Place memory)
{
KTypes.ItemForSale storage it = displays[_displayNameHash].items.push();
it.owner = _itemOwner;
it.nft = _nft;
if (_prices.length > 0){
for (uint256 i = 0; i < _prices.length; ++ i) {
it.prices.push(_prices[i]);
}
}
// add to mapping assetAtDisplay
assetAtDisplay[_nft.asset.contractAddress][_nft.tokenId] = KTypes.Place(
_displayNameHash,
displays[_displayNameHash].items.length - 1
);
return assetAtDisplay[_nft.asset.contractAddress][_nft.tokenId];
}
function _addItemPriceAtIndex(
bytes32 _displayNameHash,
uint256 _itemIndex,
KTypes.Price[] calldata _prices
)
internal
{
KTypes.ItemForSale storage it = displays[_displayNameHash].items[_itemIndex];
for (uint256 i = 0; i < _prices.length; ++ i) {
it.prices.push(_prices[i]);
}
}
function _editItemPriceAtIndex(
bytes32 _displayNameHash,
uint256 _itemIndex,
uint256 _priceIndex,
KTypes.Price calldata _price
)
internal
{
displays[_displayNameHash].items[_itemIndex].prices[_priceIndex] = _price;
}
function _removeAssetItemRecord(
bytes32 _displayNameHash,
uint256 _itemIndex,
ETypes.AssetItem calldata _assetItem
)
internal
{
// 2.1 remove item from display
if (_itemIndex != displays[_displayNameHash].items.length - 1) {
// if asset item is not last array element
// then replace it with last element
displays[_displayNameHash].items[_itemIndex] = displays[_displayNameHash].items[
displays[_displayNameHash].items.length - 1
];
// and change last element that was moved in above string
assetAtDisplay[
displays[_displayNameHash].items[_itemIndex].nft.asset.contractAddress // address of just moved nft
][
displays[_displayNameHash].items[_itemIndex].nft.tokenId
] = KTypes.Place(
_displayNameHash,
_itemIndex
);
}
// remove last element from array
displays[_displayNameHash].items.pop();
// delete mapping element
delete assetAtDisplay[_assetItem.asset.contractAddress][_assetItem.tokenId];
}
function _getAssetItemPricesAndDiscounts(
ETypes.AssetItem memory _assetItem,
address _buyer,
address _referrer,
bytes32 _promoHash
)
internal
view
virtual
returns(KTypes.Price[] memory, KTypes.Discount[] memory)
{
// Define current asset Place
KTypes.Place memory pl = getAssetItemPlace(_assetItem);
// implicit adding case - without call addItemToDisplay, just transfer
// So get prices from model
if (pl.display == bytes32(0) && pl.index == 0){
return (
IDisplayPriceModel(displays[DEFAULT_DISPLAY].priceModel).getItemPrices(_assetItem),
IDisplayPriceModel(displays[DEFAULT_DISPLAY].priceModel).getItemDiscounts(
_assetItem,
_buyer,
_referrer,
_promoHash
)
);
}
// If exist individual prices for exact item then return it
if (displays[pl.display].items[pl.index].prices.length > 0)
{
return (
displays[pl.display].items[pl.index].prices,
IDisplayPriceModel(displays[pl.display].priceModel).getItemDiscounts(
_assetItem,
_buyer,
_referrer,
_promoHash
)
);
}
// If there is no individual prices then need ask priceModel contract of display
return (
IDisplayPriceModel(displays[pl.display].priceModel).getItemPrices(_assetItem),
IDisplayPriceModel(displays[pl.display].priceModel).getItemDiscounts(
_assetItem,
_buyer,
_referrer,
_promoHash
)
);
}
function _canBuyForFree(bytes32 _displayNameHash, address _who)
internal
view
returns(bool _can)
{
// TODO add logik
if (displays[_displayNameHash].owner == _who) {
_can = true;
}
}
function _isDisplayAdmin(bytes32 _displayNameHash, address _who)
internal
view
returns(bool _isAdmin)
{
address[] memory admins = displayAdmins[_displayNameHash];
for (uint256 i = 0; i < admins.length; ++ i) {
if (admins[i] == _who) {
_isAdmin = true;
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import {SubscriptionType, PayOption, Tariff, Ticket} from "../contracts/SubscriptionRegistry.sol";
interface ISubscriptionRegistry {
/**
* @notice Add new tariff for caller
* @dev Call this method from ServiceProvider
* for setup new tariff
* using `Tariff` data type(please see above)
*
* @param _newTariff full encded Tariff object
* @return last added tariff index in Tariff[] array
* for current Service Provider (msg.sender)
*/
function registerServiceTariff(Tariff calldata _newTariff) external returns(uint256);
/**
* @notice Authorize agent for caller service provider
* @dev Call this method from ServiceProvider
*
* @param _agent - address of contract that implement Agent role
* @param _serviceTariffIndexes - array of index in `availableTariffs` array
* that available for given `_agent`
* @return full array of actual tarifs for this agent
*/
function authorizeAgentForService(
address _agent,
uint256[] calldata _serviceTariffIndexes
) external returns (uint256[] memory);
/**
* @notice By Ticket for subscription
* @dev Call this method from Agent
*
* @param _service - Service Provider address
* @param _tariffIndex - index in `availableTariffs` array
* @param _payWithIndex - index in `tariff.payWith` array
* @param _buyFor - address for whome this ticket would be bought
* @param _payer - address of payer for this ticket
* @return ticket structure that would be use for validate service process
*/
function buySubscription(
address _service,
uint256 _tariffIndex,
uint256 _payWithIndex,
address _buyFor,
address _payer
) external payable returns(Ticket memory ticket);
/**
* @notice Edit tariff for caller
* @dev Call this method from ServiceProvider
* for setup new tariff
* using `Tariff` data type(please see above)
*
* @param _tariffIndex - index in `availableTariffs` array
* @param _timelockPeriod - see SubscriptionType notice above
* @param _ticketValidPeriod - see SubscriptionType notice above
* @param _counter - see SubscriptionType notice above
* @param _isAvailable - see SubscriptionType notice above
* @param _beneficiary - see SubscriptionType notice above
*/
function editServiceTariff(
uint256 _tariffIndex,
uint256 _timelockPeriod,
uint256 _ticketValidPeriod,
uint256 _counter,
bool _isAvailable,
address _beneficiary
) external;
/**
* @notice Add tariff PayOption for exact service
* @dev Call this method from ServiceProvider
* for add tariff PayOption
*
* @param _tariffIndex - index in `availableTariffs` array
* @param _paymentToken - see PayOption notice above
* @param _paymentAmount - see PayOption notice above
* @param _agentFeePercent - see PayOption notice above
* @return last added PaymentOption index in array
* for _tariffIndex Tariff of caller Service Provider (msg.sender)
*/
function addTariffPayOption(
uint256 _tariffIndex,
address _paymentToken,
uint256 _paymentAmount,
uint16 _agentFeePercent
) external returns(uint256);
/**
* @notice Edit tariff PayOption for exact service
* @dev Call this method from ServiceProvider
* for edit tariff PayOption
*
* @param _tariffIndex - index in `availableTariffs` array
* @param _payWithIndex - index in `tariff.payWith` array
* @param _paymentToken - see PayOption notice above
* @param _paymentAmount - see PayOption notice above
* @param _agentFeePercent - see PayOption notice above
* for _tariffIndex Tariff of caller Service Provider (msg.sender)
*/
function editTariffPayOption(
uint256 _tariffIndex,
uint256 _payWithIndex,
address _paymentToken,
uint256 _paymentAmount,
uint16 _agentFeePercent
) external;
/**
* @notice Check that `_user` have still valid ticket for this service.
* @dev Call this method from any context
*
* @param _user - address of user who has an ticket and who trying get service
* @param _service - address of Service Provider
* @return ok True in case ticket is valid
* @return needFix True in case ticket has counter > 0
*/
function checkUserSubscription(
address _user,
address _service
) external view returns (bool ok, bool needFix);
/**
* @notice Check that `_user` have still valid ticket for this service.
* Decrement ticket counter in case it > 0
* @dev Call this method from ServiceProvider
*
* @param _user - address of user who has an ticket and who trying get service
* @return ok True in case ticket is valid
*/
function checkAndFixUserSubscription(address _user) external returns (bool ok);
/**
* @notice Decrement ticket counter in case it > 0
* @dev Call this method from new SubscriptionRegistry in case of upgrade
*
* @param _user - address of user who has an ticket and who trying get service
* @param _serviceFromProxy - address of service from more new SubscriptionRegistry contract
*/
function fixUserSubscription(address _user, address _serviceFromProxy) external;
/**
* @notice Returns `_user` ticket for this service.
* @dev Call this method from any context
*
* @param _user - address of user who has an ticket and who trying get service
* @param _service - address of Service Provider
* @return ticket
*/
function getUserTicketForService(
address _service,
address _user
) external view returns(Ticket memory);
/**
* @notice Returns array of Tariff for `_service`
* @dev Call this method from any context
*
* @param _service - address of Service Provider
* @return Tariff array
*/
function getTariffsForService(address _service) external view returns (Tariff[] memory);
/**
* @notice Returns ticket price include any fees
* @dev Call this method from any context
*
* @param _service - address of Service Provider
* @param _tariffIndex - index in `availableTariffs` array
* @param _payWithIndex - index in `tariff.payWith` array
* @return tulpe with payment token an ticket price
*/
function getTicketPrice(
address _service,
uint256 _tariffIndex,
uint256 _payWithIndex
) external view returns (address, uint256);
/**
* @notice Returns array of Tariff for `_service` assigned to `_agent`
* @dev Call this method from any context
*
* @param _agent - address of Agent
* @param _service - address of Service Provider
* @return Tariff array
*/
function getAvailableAgentsTariffForService(
address _agent,
address _service
) external view returns(Tariff[] memory);
}// SPDX-License-Identifier: MIT
// ENVELOP(NIFTSY) protocol V1 for NFT. Wrapper - main protocol contract
pragma solidity 0.8.21;
import "./TokenService.sol";
import "../interfaces/IUsersSBT.sol";
/// @title Envelop PrtocolV1 helper service for manage ERC(20, 721, 115) getters
/// @author Envelop Team
/// @notice Just as dependence for main wrapper contract
abstract contract TokenServiceExtended is TokenService {
event EnvelopRulesChanged(
address indexed wrappedAddress,
uint256 indexed wrappedIdaddress,
bytes2 newRules
);
function _balanceOf(
ETypes.AssetItem memory _assetItem,
address _holder
) internal view virtual returns (uint256 _balance){
if (_assetItem.asset.assetType == ETypes.AssetType.NATIVE) {
_balance = _holder.balance;
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC20) {
_balance = IERC20Extended(_assetItem.asset.contractAddress).balanceOf(_holder);
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC721) {
_balance = IERC721Mintable(_assetItem.asset.contractAddress).balanceOf(_holder);
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC1155) {
_balance = IERC1155Mintable(_assetItem.asset.contractAddress).balanceOf(_holder, _assetItem.tokenId);
} else {
revert UnSupportedAsset(_assetItem);
}
}
function _ownerOf(
ETypes.AssetItem memory _assetItem
) internal view virtual returns (address _owner){
if (_assetItem.asset.assetType == ETypes.AssetType.NATIVE) {
_owner = address(0);
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC20) {
_owner = address(0);
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC721) {
_owner = IERC721Mintable(_assetItem.asset.contractAddress).ownerOf(_assetItem.tokenId);
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC1155) {
_owner = address(0);
} else {
revert UnSupportedAsset(_assetItem);
}
}
function _mintWNFTWithRules(
ETypes.AssetType _mint_type,
address _contract,
address _mintFor,
uint256 _outBalance,
bytes2 _rules
)
internal
virtual
returns(uint256 tokenId)
{
if (_mint_type == ETypes.AssetType.ERC721) {
tokenId = IUsersSBT(_contract).mintWithRules(_mintFor, _rules);
} else if (_mint_type == ETypes.AssetType.ERC1155) {
tokenId = IUsersSBT(_contract).mintWithRules(_mintFor, _outBalance, _rules);
}else {
revert UnSupportedAsset(
ETypes.AssetItem(
ETypes.Asset(_mint_type, _contract),
tokenId, _outBalance
)
);
}
}
function _updateRules(
address _contract,
uint256 _tokenId,
bytes2 _rules
)
internal
virtual
returns(bool changed)
{
changed = IUsersSBT(_contract).updateRules(_tokenId, _rules);
if (changed){
emit EnvelopRulesChanged(_contract, _tokenId, _rules);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/utils/ERC721Holder.sol)
pragma solidity ^0.8.0;
import "../IERC721Receiver.sol";
/**
* @dev Implementation of the {IERC721Receiver} interface.
*
* Accepts all token transfers.
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
*/
contract ERC721Holder is IERC721Receiver {
/**
* @dev See {IERC721Receiver-onERC721Received}.
*
* Always returns `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {
return this.onERC721Received.selector;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)
pragma solidity ^0.8.0;
import "./ERC1155Receiver.sol";
/**
* Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
*
* IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
* stuck.
*
* @dev _Available since v3.1._
*/
contract ERC1155Holder is ERC1155Receiver {
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC1155Received.selector;
}
function onERC1155BatchReceived(
address,
address,
uint256[] memory,
uint256[] memory,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC1155BatchReceived.selector;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
//import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@envelop-protocol-v1/contracts/LibEnvelopTypes.sol";
import "../contracts/KTypes.sol";
interface IDisplayPriceModel {
event DiscountChanged(
bytes32 indexed display,
uint8 indexed DiscountType,
bytes32 DiscountParam,
uint16 DiscountPercent
);
event DefaultPriceChanged(
bytes32 indexed display,
address indexed payWithContract,
uint256 indexed priceAmount
);
function makeActionInModel(
ETypes.AssetItem calldata _assetItem,
address _buyer
) external returns(bool needMakeTansfer);
function getItemPrices(
ETypes.AssetItem memory _assetItem
) external view returns (KTypes.Price[] memory);
function getDefaultDisplayPrices(
ETypes.AssetItem memory _assetItem
) external view returns (KTypes.Price[] memory);
function getItemDiscounts(
ETypes.AssetItem memory _assetItem,
address _buyer,
address _referrer,
bytes32 _promoHash
) external view returns (KTypes.Discount[] memory);
function getBatchPrices(
ETypes.AssetItem[] memory _assetItemArray
) external view returns (KTypes.Price[] memory);
function getBatchDiscounts(
ETypes.AssetItem[] memory _assetItemArray,
address _buyer,
address _referrer,
bytes32 _promoHash
) external view returns (KTypes.Discount[] memory);
}// SPDX-License-Identifier: MIT
// ENVELOP(NIFTSY) Team. Subscription Registry Contract V2
pragma solidity 0.8.21;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@envelop-protocol-v1/interfaces/ITrustedWrapper.sol";
import "@envelop-protocol-v1/contracts/LibEnvelopTypes.sol";
import "../interfaces/ISubscriptionRegistry.sol";
/// The subscription platform operates with the following role model
/// (it is assumed that the actor with the role is implemented as a contract).
/// `Service Provider` is a contract whose services are sold by subscription.
/// `Agent` - a contract that sells a subscription on behalf ofservice provider.
/// May receive sales commission
/// `Platform` - SubscriptionRegistry contract that performs processingsubscriptions,
/// fares, tickets
struct SubscriptionType {
uint256 timelockPeriod; // in seconds e.g. 3600*24*30*12 = 31104000 = 1 year
uint256 ticketValidPeriod; // in seconds e.g. 3600*24*30 = 2592000 = 1 month
uint256 counter; // For case when ticket valid for N usage, e.g. for Min N NFTs
bool isAvailable; // USe for stop using tariff because we can`t remove tariff from array
address beneficiary; // Who will receive payment for tickets
}
struct PayOption {
address paymentToken; // token contract address or zero address for native token(ETC etc)
uint256 paymentAmount; // ticket price exclude any fees
uint16 agentFeePercent; // 100%-10000, 20%-2000, 3%-300
}
struct Tariff {
SubscriptionType subscription; // link to subscriptionType
PayOption[] payWith; // payment option array. Use it for price in defferent tokens
}
// native subscribtionManager tickets format
struct Ticket {
uint256 validUntil; // Unixdate, tickets not valid after
uint256 countsLeft; // for tarif with fixed use counter
}
/// @title Base contract in Envelop Subscription Platform
/// @author Envelop Team
/// @notice You can use this contract for make and operate any on-chain subscriptions
/// @dev Contract that performs processing subscriptions, fares(tariffs), tickets
/// @custom:please see example folder.
contract SubscriptionRegistry is Ownable {
using SafeERC20 for IERC20;
uint256 constant public PERCENT_DENOMINATOR = 10000;
/// @notice Envelop Multisig contract
address public platformOwner;
/// @notice Platform owner can receive fee from each payments
uint16 public platformFeePercent = 50; // 100%-10000, 20%-2000, 3%-300
/// @notice address used for wrapp & lock incoming assets
address public mainWrapper;
/// @notice Used in case upgrade this contract
address public previousRegistry;
/// @notice Used in case upgrade this contract
address public proxyRegistry;
/// @notice Only white listed assets can be used on platform
mapping(address => bool) public whiteListedForPayments;
/// @notice from service(=smart contract address) to tarifs
mapping(address => Tariff[]) public availableTariffs;
/// @notice from service to agent to available tarifs(tarif index);
mapping(address => mapping(address => uint256[])) public agentServiceRegistry;
/// @notice mapping from user addres to service contract address to ticket
mapping(address => mapping(address => Ticket)) public userTickets;
event PlatfromFeeChanged(uint16 indexed newPercent);
event WhitelistPaymentTokenChanged(address indexed asset, bool indexed state);
event TariffChanged(address indexed service, uint256 indexed tariffIndex);
event TicketIssued(
address indexed service,
address indexed agent,
address indexed forUser,
uint256 tariffIndex
);
constructor(address _platformOwner) {
require(_platformOwner != address(0),'Zero platform fee receiver');
platformOwner = _platformOwner;
}
/**
* @notice Add new tariff for caller
* @dev Call this method from ServiceProvider
* for setup new tariff
* using `Tariff` data type(please see above)
*
* @param _newTariff full encded Tariff object
* @return last added tariff index in Tariff[] array
* for current Service Provider (msg.sender)
*/
function registerServiceTariff(Tariff calldata _newTariff)
external
returns(uint256)
{
// TODO
// Tarif structure check
// PayWith array whiteList check
return _addTariff(msg.sender, _newTariff);
}
/**
* @notice Edit tariff for caller
* @dev Call this method from ServiceProvider
* for setup new tariff
* using `Tariff` data type(please see above)
*
* @param _tariffIndex - index in `availableTariffs` array
* @param _timelockPeriod - see SubscriptionType notice above
* @param _ticketValidPeriod - see SubscriptionType notice above
* @param _counter - see SubscriptionType notice above
* @param _isAvailable - see SubscriptionType notice above
* @param _beneficiary - see SubscriptionType notice above
*/
function editServiceTariff(
uint256 _tariffIndex,
uint256 _timelockPeriod,
uint256 _ticketValidPeriod,
uint256 _counter,
bool _isAvailable,
address _beneficiary
)
external
{
// TODO
// Tariff structure check
// PayWith array whiteList check
_editTariff(
msg.sender,
_tariffIndex,
_timelockPeriod,
_ticketValidPeriod,
_counter,
_isAvailable,
_beneficiary
);
}
/**
* @notice Add tariff PayOption for exact service
* @dev Call this method from ServiceProvider
* for add tariff PayOption
*
* @param _tariffIndex - index in `availableTariffs` array
* @param _paymentToken - see PayOption notice above
* @param _paymentAmount - see PayOption notice above
* @param _agentFeePercent - see PayOption notice above
* @return last added PaymentOption index in array
* for _tariffIndex Tariff of caller Service Provider (msg.sender)
*/
function addTariffPayOption(
uint256 _tariffIndex,
address _paymentToken,
uint256 _paymentAmount,
uint16 _agentFeePercent
) external returns(uint256)
{
return _addTariffPayOption(
msg.sender,
_tariffIndex,
_paymentToken,
_paymentAmount,
_agentFeePercent
);
}
/**
* @notice Edit tariff PayOption for exact service
* @dev Call this method from ServiceProvider
* for edit tariff PayOption
*
* @param _tariffIndex - index in `availableTariffs` array
* @param _payWithIndex - index in `tariff.payWith` array
* @param _paymentToken - see PayOption notice above
* @param _paymentAmount - see PayOption notice above
* @param _agentFeePercent - see PayOption notice above
* for _tariffIndex Tariff of caller Service Provider (msg.sender)
*/
function editTariffPayOption(
uint256 _tariffIndex,
uint256 _payWithIndex,
address _paymentToken,
uint256 _paymentAmount,
uint16 _agentFeePercent
) external
{
_editTariffPayOption(
msg.sender,
_tariffIndex,
_payWithIndex,
_paymentToken,
_paymentAmount,
_agentFeePercent
);
}
/**
* @notice Authorize agent for caller service provider
* @dev Call this method from ServiceProvider
*
* @param _agent - address of contract that implement Agent role
* @param _serviceTariffIndexes - array of index in `availableTariffs` array
* that available for given `_agent`
* @return full array of actual tarifs for this agent
*/
function authorizeAgentForService(
address _agent,
uint256[] calldata _serviceTariffIndexes
) external virtual returns (uint256[] memory)
{
// remove previouse tariffs
delete agentServiceRegistry[msg.sender][_agent];
uint256[] storage currentServiceTariffsOfAgent = agentServiceRegistry[msg.sender][_agent];
// check that adding tariffs still available
for(uint256 i; i < _serviceTariffIndexes.length; ++ i) {
if (availableTariffs[msg.sender][_serviceTariffIndexes[i]].subscription.isAvailable){
currentServiceTariffsOfAgent.push(_serviceTariffIndexes[i]);
}
}
return currentServiceTariffsOfAgent;
}
/**
* @notice By Ticket for subscription
* @dev Call this method from Agent
*
* @param _service - Service Provider address
* @param _tariffIndex - index in `availableTariffs` array
* @param _payWithIndex - index in `tariff.payWith` array
* @param _buyFor - address for whome this ticket would be bought
* @param _payer - address of payer for this ticket
* @return ticket structure that would be use for validate service process
*/
function buySubscription(
address _service,
uint256 _tariffIndex,
uint256 _payWithIndex,
address _buyFor,
address _payer
) external
payable
returns(Ticket memory ticket) {
// Cant buy ticket for nobody
require(_buyFor != address(0),'Cant buy ticket for nobody');
require(
availableTariffs[_service][_tariffIndex].subscription.isAvailable,
'This subscription not available'
);
// Not used in this implementation
// require(
// availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount > 0,
// 'This Payment option not available'
// );
// Check that agent is authorized for purchace of this service
require(
_isAgentAuthorized(msg.sender, _service, _tariffIndex),
'Agent not authorized for this service tariff'
);
(bool isValid, bool needFix) = _isTicketValid(_buyFor, _service);
require(!isValid, 'Only one valid ticket at time');
//lets safe user ticket (only one ticket available in this version)
ticket = Ticket(
availableTariffs[_service][_tariffIndex].subscription.ticketValidPeriod + block.timestamp,
availableTariffs[_service][_tariffIndex].subscription.counter
);
userTickets[_buyFor][_service] = ticket;
// Lets receive payment tokens FROM sender
if (availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount > 0){
_processPayment(_service, _tariffIndex, _payWithIndex, _payer);
}
emit TicketIssued(_service, msg.sender, _buyFor, _tariffIndex);
}
/**
* @notice Check that `_user` have still valid ticket for this service.
* Decrement ticket counter in case it > 0
* @dev Call this method from ServiceProvider
*
* @param _user - address of user who has an ticket and who trying get service
* @return ok True in case ticket is valid
*/
function checkAndFixUserSubscription(
address _user
) external returns (bool ok){
address _service = msg.sender;
// Check user ticket
(bool isValid, bool needFix) = _isTicketValid(_user, msg.sender);
// Proxy to previos
if (!isValid && previousRegistry != address(0)) {
(isValid, needFix) = ISubscriptionRegistry(previousRegistry).checkUserSubscription(
_user,
_service
);
// Case when valid ticket stored in previousManager
if (isValid ) {
if (needFix){
ISubscriptionRegistry(previousRegistry).fixUserSubscription(
_user,
_service
);
}
ok = true;
return ok;
}
}
require(isValid,'Valid ticket not found');
// Fix action (for subscription with counter)
if (needFix){
_fixUserSubscription(_user, msg.sender);
}
ok = true;
}
/**
* @notice Decrement ticket counter in case it > 0
* @dev Call this method from new SubscriptionRegistry in case of upgrade
*
* @param _user - address of user who has an ticket and who trying get service
* @param _serviceFromProxy - address of service from more new SubscriptionRegistry contract
*/
function fixUserSubscription(
address _user,
address _serviceFromProxy
) public {
require(proxyRegistry !=address(0) && msg.sender == proxyRegistry,
'Only for future registry'
);
_fixUserSubscription(_user, _serviceFromProxy);
}
////////////////////////////////////////////////////////////////
/**
* @notice Check that `_user` have still valid ticket for this service.
* @dev Call this method from any context
*
* @param _user - address of user who has an ticket and who trying get service
* @param _service - address of Service Provider
* @return ok True in case ticket is valid
* @return needFix True in case ticket has counter > 0
*/
function checkUserSubscription(
address _user,
address _service
) external view returns (bool ok, bool needFix) {
(ok, needFix) = _isTicketValid(_user, _service);
if (!ok && previousRegistry != address(0)) {
(ok, needFix) = ISubscriptionRegistry(previousRegistry).checkUserSubscription(
_user,
_service
);
}
}
/**
* @notice Returns `_user` ticket for this service.
* @dev Call this method from any context
*
* @param _user - address of user who has an ticket and who trying get service
* @param _service - address of Service Provider
* @return ticket
*/
function getUserTicketForService(
address _service,
address _user
) public view returns(Ticket memory)
{
return userTickets[_user][_service];
}
/**
* @notice Returns array of Tariff for `_service`
* @dev Call this method from any context
*
* @param _service - address of Service Provider
* @return Tariff array
*/
function getTariffsForService(address _service) external view returns (Tariff[] memory) {
return availableTariffs[_service];
}
/**
* @notice Returns ticket price include any fees
* @dev Call this method from any context
*
* @param _service - address of Service Provider
* @param _tariffIndex - index in `availableTariffs` array
* @param _payWithIndex - index in `tariff.payWith` array
* @return tulpe with payment token an ticket price
*/
function getTicketPrice(
address _service,
uint256 _tariffIndex,
uint256 _payWithIndex
) public view virtual returns (address, uint256)
{
if (availableTariffs[_service][_tariffIndex].subscription.timelockPeriod != 0)
{
return(
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentToken,
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount
);
} else {
return(
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentToken,
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount
+ availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount
*availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].agentFeePercent
/PERCENT_DENOMINATOR
+ availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount
*_platformFeePercent(_service, _tariffIndex, _payWithIndex)
/PERCENT_DENOMINATOR
);
}
}
/**
* @notice Returns array of Tariff for `_service` assigned to `_agent`
* @dev Call this method from any context
*
* @param _agent - address of Agent
* @param _service - address of Service Provider
* @return tuple with two arrays: indexes and Tariffs
*/
function getAvailableAgentsTariffForService(
address _agent,
address _service
) external view virtual returns(uint256[] memory, Tariff[] memory)
{
//First need get count of tarifs that still available
uint256 availableCount;
for (uint256 i; i < agentServiceRegistry[_service][_agent].length; ++i){
if (availableTariffs[_service][
agentServiceRegistry[_service][_agent][i]
].subscription.isAvailable
) {++availableCount;}
}
Tariff[] memory tariffs = new Tariff[](availableCount);
uint256[] memory indexes = new uint256[](availableCount);
for (uint256 i; i < agentServiceRegistry[_service][_agent].length; ++i){
if (availableTariffs[_service][
agentServiceRegistry[_service][_agent][i]
].subscription.isAvailable
)
{
tariffs[availableCount - 1] = availableTariffs[_service][
agentServiceRegistry[_service][_agent][i]
];
indexes[availableCount - 1] = agentServiceRegistry[_service][_agent][i];
--availableCount;
}
}
return (indexes, tariffs);
}
////////////////////////////////////////////////////////////////
////////// Admins //////
////////////////////////////////////////////////////////////////
function setAssetForPaymentState(address _asset, bool _isEnable)
external onlyOwner
{
whiteListedForPayments[_asset] = _isEnable;
emit WhitelistPaymentTokenChanged(_asset, _isEnable);
}
function setMainWrapper(address _wrapper) external onlyOwner {
mainWrapper = _wrapper;
}
function setPlatformOwner(address _newOwner) external {
require(msg.sender == platformOwner, 'Only platform owner');
require(_newOwner != address(0),'Zero platform fee receiver');
platformOwner = _newOwner;
}
function setPlatformFeePercent(uint16 _newPercent) external {
require(msg.sender == platformOwner, 'Only platform owner');
platformFeePercent = _newPercent;
emit PlatfromFeeChanged(platformFeePercent);
}
function setPreviousRegistry(address _registry) external onlyOwner {
previousRegistry = _registry;
}
function setProxyRegistry(address _registry) external onlyOwner {
proxyRegistry = _registry;
}
/////////////////////////////////////////////////////////////////////
function _processPayment(
address _service,
uint256 _tariffIndex,
uint256 _payWithIndex,
address _payer
)
internal
virtual
returns(bool)
{
// there are two payment method for this implementation.
// 1. with wrap and lock in asset (no fees)
// 2. simple payment (agent & platform fee enabled)
if (availableTariffs[_service][_tariffIndex].subscription.timelockPeriod != 0){
require(msg.value == 0, 'Ether Not accepted in this method');
// 1. with wrap and lock in asset
IERC20(
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentToken
).safeTransferFrom(
_payer,
address(this),
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount
);
// Lets approve received for wrap
IERC20(
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentToken
).safeApprove(
mainWrapper,
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount
);
// Lets wrap with timelock and appropriate params
ETypes.INData memory _inData;
ETypes.AssetItem[] memory _collateralERC20 = new ETypes.AssetItem[](1);
ETypes.Lock[] memory timeLock = new ETypes.Lock[](1);
// Only need set timelock for this wNFT
timeLock[0] = ETypes.Lock(
0x00, // timelock
availableTariffs[_service][_tariffIndex].subscription.timelockPeriod + block.timestamp
);
_inData = ETypes.INData(
ETypes.AssetItem(
ETypes.Asset(ETypes.AssetType.EMPTY, address(0)),
0,0
), // INAsset
address(0), // Unwrap destinition
new ETypes.Fee[](0), // Fees
//new ETypes.Lock[](0), // Locks
timeLock,
new ETypes.Royalty[](0), // Royalties
ETypes.AssetType.ERC721, // Out type
0, // Out Balance
0x0000 // Rules
);
_collateralERC20[0] = ETypes.AssetItem(
ETypes.Asset(
ETypes.AssetType.ERC20,
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentToken
),
0,
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount
);
ITrustedWrapper(mainWrapper).wrap(
_inData,
_collateralERC20,
_payer
);
} else {
// 2. simple payment
if (availableTariffs[_service][_tariffIndex]
.payWith[_payWithIndex]
.paymentToken != address(0)
)
{
// pay with erc20
require(msg.value == 0, 'Ether Not accepted in this method');
// 2.1. Body payment
IERC20(
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentToken
).safeTransferFrom(
_payer,
availableTariffs[_service][_tariffIndex].subscription.beneficiary,
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount
);
// 2.2. Agent fee payment
IERC20(
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentToken
).safeTransferFrom(
_payer,
msg.sender,
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount
*availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].agentFeePercent
/PERCENT_DENOMINATOR
);
// 2.3. Platform fee
uint256 _pFee = _platformFeePercent(_service, _tariffIndex, _payWithIndex);
if (_pFee > 0) {
IERC20(
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentToken
).safeTransferFrom(
_payer,
platformOwner, //
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount
*_pFee
/PERCENT_DENOMINATOR
);
}
} else {
// pay with native token(eth, bnb, etc)
(, uint256 needPay) = getTicketPrice(_service, _tariffIndex,_payWithIndex);
require(msg.value >= needPay, 'Not enough ether');
// 2.4. Body ether payment
sendValue(
payable(availableTariffs[_service][_tariffIndex].subscription.beneficiary),
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount
);
// 2.5. Agent fee payment
sendValue(
payable(msg.sender),
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount
*availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].agentFeePercent
/PERCENT_DENOMINATOR
);
// 2.3. Platform fee
uint256 _pFee = _platformFeePercent(_service, _tariffIndex, _payWithIndex);
if (_pFee > 0) {
sendValue(
payable(platformOwner),
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex].paymentAmount
*_pFee
/PERCENT_DENOMINATOR
);
}
// return change
if ((msg.value - needPay) > 0) {
address payable s = payable(_payer);
s.transfer(msg.value - needPay);
}
}
}
}
// In this impementation params not used.
// Can be ovveriden in other cases
function _platformFeePercent(
address _service,
uint256 _tariffIndex,
uint256 _payWithIndex
) internal view virtual returns(uint256)
{
return platformFeePercent;
}
function _addTariff(address _service, Tariff calldata _newTariff)
internal returns(uint256)
{
require (_newTariff.payWith.length > 0, 'No payment method');
for (uint256 i; i < _newTariff.payWith.length; ++i){
require(
whiteListedForPayments[_newTariff.payWith[i].paymentToken],
'Not whitelisted for payments'
);
}
require(
_newTariff.subscription.ticketValidPeriod > 0
|| _newTariff.subscription.counter > 0,
'Tariff has no valid ticket option'
);
availableTariffs[_service].push(_newTariff);
emit TariffChanged(_service, availableTariffs[_service].length - 1);
return availableTariffs[_service].length - 1;
}
function _editTariff(
address _service,
uint256 _tariffIndex,
uint256 _timelockPeriod,
uint256 _ticketValidPeriod,
uint256 _counter,
bool _isAvailable,
address _beneficiary
) internal
{
availableTariffs[_service][_tariffIndex].subscription.timelockPeriod = _timelockPeriod;
availableTariffs[_service][_tariffIndex].subscription.ticketValidPeriod = _ticketValidPeriod;
availableTariffs[_service][_tariffIndex].subscription.counter = _counter;
availableTariffs[_service][_tariffIndex].subscription.isAvailable = _isAvailable;
availableTariffs[_service][_tariffIndex].subscription.beneficiary = _beneficiary;
emit TariffChanged(_service, _tariffIndex);
}
function _addTariffPayOption(
address _service,
uint256 _tariffIndex,
address _paymentToken,
uint256 _paymentAmount,
uint16 _agentFeePercent
) internal returns(uint256)
{
require(whiteListedForPayments[_paymentToken], 'Not whitelisted for payments');
availableTariffs[_service][_tariffIndex].payWith.push(
PayOption(_paymentToken, _paymentAmount, _agentFeePercent)
);
emit TariffChanged(_service, _tariffIndex);
return availableTariffs[_service][_tariffIndex].payWith.length - 1;
}
function _editTariffPayOption(
address _service,
uint256 _tariffIndex,
uint256 _payWithIndex,
address _paymentToken,
uint256 _paymentAmount,
uint16 _agentFeePercent
) internal
{
require(whiteListedForPayments[_paymentToken], 'Not whitelisted for payments');
availableTariffs[_service][_tariffIndex].payWith[_payWithIndex]
= PayOption(_paymentToken, _paymentAmount, _agentFeePercent);
emit TariffChanged(_service, _tariffIndex);
}
function _fixUserSubscription(
address _user,
address _service
) internal {
// Fix action (for subscription with counter)
if (userTickets[_user][_service].countsLeft > 0) {
-- userTickets[_user][_service].countsLeft;
}
}
function _isTicketValid(address _user, address _service)
internal
view
returns (bool isValid, bool needFix )
{
isValid = userTickets[_user][_service].validUntil > block.timestamp
|| userTickets[_user][_service].countsLeft > 0;
needFix = userTickets[_user][_service].countsLeft > 0;
}
function _isAgentAuthorized(
address _agent,
address _service,
uint256 _tariffIndex
)
internal
view
returns(bool authorized)
{
for (uint256 i; i < agentServiceRegistry[_service][_agent].length; ++ i){
if (agentServiceRegistry[_service][_agent][i] == _tariffIndex){
authorized = true;
return authorized;
}
}
}
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");
}
}// SPDX-License-Identifier: MIT
// ENVELOP(NIFTSY) protocol V1 for NFT. Wrapper - main protocol contract
pragma solidity 0.8.21;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "../interfaces/IERC20Extended.sol";
import "./LibEnvelopTypes.sol";
import "../interfaces/IERC721Mintable.sol";
import "../interfaces/IERC1155Mintable.sol";
/// @title Envelop PrtocolV1 helper service for ERC(20, 721, 115) transfers
/// @author Envelop Team
/// @notice Just as dependence for main wrapper contract
abstract contract TokenService {
using SafeERC20 for IERC20Extended;
error UnSupportedAsset(ETypes.AssetItem asset);
function _mintNFT(
ETypes.AssetType _mint_type,
address _contract,
address _mintFor,
uint256 _tokenId,
uint256 _outBalance
)
internal
virtual
{
if (_mint_type == ETypes.AssetType.ERC721) {
IERC721Mintable(_contract).mint(_mintFor, _tokenId);
} else if (_mint_type == ETypes.AssetType.ERC1155) {
IERC1155Mintable(_contract).mint(_mintFor, _tokenId, _outBalance);
}else {
revert UnSupportedAsset(
ETypes.AssetItem(
ETypes.Asset(_mint_type, _contract),
_tokenId, _outBalance
)
);
}
}
function _burnNFT(
ETypes.AssetType _burn_type,
address _contract,
address _burnFor,
uint256 _tokenId,
uint256 _balance
)
internal
virtual
{
if (_burn_type == ETypes.AssetType.ERC721) {
IERC721Mintable(_contract).burn(_tokenId);
} else if (_burn_type == ETypes.AssetType.ERC1155) {
IERC1155Mintable(_contract).burn(_burnFor, _tokenId, _balance);
}
}
function _transfer(
ETypes.AssetItem memory _assetItem,
address _from,
address _to
) internal virtual returns (bool _transfered){
if (_assetItem.asset.assetType == ETypes.AssetType.NATIVE) {
(bool success, ) = _to.call{ value: _assetItem.amount}("");
require(success, "transfer failed");
_transfered = true;
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC20) {
require(IERC20Extended(_assetItem.asset.contractAddress).balanceOf(_from) <= _assetItem.amount, "UPS!!!!");
IERC20Extended(_assetItem.asset.contractAddress).safeTransferFrom(_from, _to, _assetItem.amount);
_transfered = true;
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC721) {
IERC721Mintable(_assetItem.asset.contractAddress).transferFrom(_from, _to, _assetItem.tokenId);
_transfered = true;
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC1155) {
IERC1155Mintable(_assetItem.asset.contractAddress).safeTransferFrom(_from, _to, _assetItem.tokenId, _assetItem.amount, "");
_transfered = true;
} else {
revert UnSupportedAsset(_assetItem);
}
return _transfered;
}
function _transferSafe(
ETypes.AssetItem memory _assetItem,
address _from,
address _to
) internal virtual returns (uint256 _transferedValue){
//TODO think about try catch in transfers
uint256 balanceBefore;
if (_assetItem.asset.assetType == ETypes.AssetType.NATIVE) {
balanceBefore = _to.balance;
(bool success, ) = _to.call{ value: _assetItem.amount}("");
require(success, "transfer failed");
_transferedValue = _to.balance - balanceBefore;
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC20) {
balanceBefore = IERC20Extended(_assetItem.asset.contractAddress).balanceOf(_to);
if (_from == address(this)){
IERC20Extended(_assetItem.asset.contractAddress).safeTransfer(_to, _assetItem.amount);
} else {
IERC20Extended(_assetItem.asset.contractAddress).safeTransferFrom(_from, _to, _assetItem.amount);
}
_transferedValue = IERC20Extended(_assetItem.asset.contractAddress).balanceOf(_to) - balanceBefore;
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC721 &&
IERC721Mintable(_assetItem.asset.contractAddress).ownerOf(_assetItem.tokenId) == _from) {
balanceBefore = IERC721Mintable(_assetItem.asset.contractAddress).balanceOf(_to);
IERC721Mintable(_assetItem.asset.contractAddress).transferFrom(_from, _to, _assetItem.tokenId);
if (IERC721Mintable(_assetItem.asset.contractAddress).ownerOf(_assetItem.tokenId) == _to &&
IERC721Mintable(_assetItem.asset.contractAddress).balanceOf(_to) - balanceBefore == 1
) {
_transferedValue = 1;
}
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC1155) {
balanceBefore = IERC1155Mintable(_assetItem.asset.contractAddress).balanceOf(_to, _assetItem.tokenId);
IERC1155Mintable(_assetItem.asset.contractAddress).safeTransferFrom(_from, _to, _assetItem.tokenId, _assetItem.amount, "");
_transferedValue = IERC1155Mintable(_assetItem.asset.contractAddress).balanceOf(_to, _assetItem.tokenId) - balanceBefore;
} else {
revert UnSupportedAsset(_assetItem);
}
return _transferedValue;
}
// This function must never revert. Use it for unwrap in case some
// collateral transfers are revert
function _transferEmergency(
ETypes.AssetItem memory _assetItem,
address _from,
address _to
) internal virtual returns (uint256 _transferedValue){
//TODO think about try catch in transfers
uint256 balanceBefore;
if (_assetItem.asset.assetType == ETypes.AssetType.NATIVE) {
balanceBefore = _to.balance;
(bool success, ) = _to.call{ value: _assetItem.amount}("");
//require(success, "transfer failed");
_transferedValue = _to.balance - balanceBefore;
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC20) {
if (_from == address(this)){
(bool success, ) = _assetItem.asset.contractAddress.call(
abi.encodeWithSignature("transfer(address,uint256)", _to, _assetItem.amount)
);
} else {
(bool success, ) = _assetItem.asset.contractAddress.call(
abi.encodeWithSignature("transferFrom(address,address,uint256)", _from, _to, _assetItem.amount)
);
}
_transferedValue = _assetItem.amount;
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC721) {
(bool success, ) = _assetItem.asset.contractAddress.call(
abi.encodeWithSignature("transferFrom(address,address,uint256)", _from, _to, _assetItem.tokenId)
);
_transferedValue = 1;
} else if (_assetItem.asset.assetType == ETypes.AssetType.ERC1155) {
(bool success, ) = _assetItem.asset.contractAddress.call(
abi.encodeWithSignature("safeTransferFrom(address,address,uint256,uint256,bytes)", _from, _to, _assetItem.tokenId, _assetItem.amount, "")
);
_transferedValue = _assetItem.amount;
} else {
revert UnSupportedAsset(_assetItem);
}
return _transferedValue;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
interface IUsersSBT {
function mintWithRules(
address _to,
bytes2 _rules
) external returns(uint256 tokenId);
function mintWithRules(
address _to,
uint256 _balance,
bytes2 _rules
) external returns(uint256 tokenId);
function updateRules(
uint256 _tokenId,
bytes2 _rules
) external returns(bool changed);
function owner() external view returns(address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../IERC1155Receiver.sol";
import "../../../utils/introspection/ERC165.sol";
/**
* @dev _Available since v3.1._
*/
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
}
}// SPDX-License-Identifier: MIT
// ENVELOP(NIFTSY) protocol V1 for NFT.
pragma solidity 0.8.21;
/// @title Flibrary ETypes in Envelop PrtocolV1
/// @author Envelop Team
/// @notice This contract implement main protocol's data types
library ETypes {
enum AssetType {EMPTY, NATIVE, ERC20, ERC721, ERC1155, FUTURE1, FUTURE2, FUTURE3}
struct Asset {
AssetType assetType;
address contractAddress;
}
struct AssetItem {
Asset asset;
uint256 tokenId;
uint256 amount;
}
struct NFTItem {
address contractAddress;
uint256 tokenId;
}
struct Fee {
bytes1 feeType;
uint256 param;
address token;
}
struct Lock {
bytes1 lockType;
uint256 param;
}
struct Royalty {
address beneficiary;
uint16 percent;
}
struct WNFT {
AssetItem inAsset;
AssetItem[] collateral;
address unWrapDestination;
Fee[] fees;
Lock[] locks;
Royalty[] royalties;
bytes2 rules;
}
struct INData {
AssetItem inAsset;
address unWrapDestination;
Fee[] fees;
Lock[] locks;
Royalty[] royalties;
AssetType outType;
uint256 outBalance; //0- for 721 and any amount for 1155
bytes2 rules;
}
struct WhiteListItem {
bool enabledForFee;
bool enabledForCollateral;
bool enabledRemoveFromCollateral;
address transferFeeModel;
}
struct Rules {
bytes2 onlythis;
bytes2 disabled;
}
}// SPDX-License-Identifier: MIT
// ENVELOP(NIFTSY) protocol V1 for NFT.
import "@envelop-protocol-v1/contracts/LibEnvelopTypes.sol";
pragma solidity 0.8.21;
library KTypes {
enum DiscountType {PROMO, REFERRAL, BATCH, TIME, WHITELIST, CUSTOM1, CUSTOM2, CUSTOM3}
struct Price {
address payWith;
uint256 amount;
}
struct DenominatedPrice {
address payWith;
uint256 amount;
uint256 denominator;
}
struct Discount {
DiscountType dsctType;
uint16 dsctPercent; // 100%-10000, 20%-2000, 3%-300
}
struct ItemForSale {
address owner;
ETypes.AssetItem nft;
Price[] prices;
}
struct Display {
address owner;
address beneficiary; // who will receive assets from sale
uint256 enableAfter;
uint256 disableAfter;
address priceModel;
ItemForSale[] items;
}
struct Place {
bytes32 display;
uint256 index;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/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;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
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));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
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");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
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");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// 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 cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import "./IWrapper.sol";
interface ITrustedWrapper is IWrapper {
function trustedOperator() external view returns(address);
function wrapUnsafe(
ETypes.INData calldata _inData,
ETypes.AssetItem[] calldata _collateral,
address _wrappFor
)
external
payable
returns (ETypes.AssetItem memory);
function transferIn(
ETypes.AssetItem memory _assetItem,
address _from
)
external
payable
returns (uint256 _transferedValue);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IERC20Extended is IERC20 {
function mint(address _to, uint256 _value) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
interface IERC721Mintable is IERC721Metadata {
function mint(address _to, uint256 _tokenId) external;
function burn(uint256 _tokenId) external;
function exists(uint256 _tokenId) external view returns(bool);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol";
interface IERC1155Mintable is IERC1155MetadataURI {
function mint(address _to, uint256 _tokenId, uint256 _amount) external;
function burn(address _to, uint256 _tokenId, uint256 _amount) external;
function totalSupply(uint256 _id) external view returns (uint256);
function exists(uint256 _tokenId) external view returns(bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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.9.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [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://consensys.net/diligence/blog/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.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
//import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "../contracts/LibEnvelopTypes.sol";
interface IWrapper {
event WrappedV1(
address indexed inAssetAddress,
address indexed outAssetAddress,
uint256 indexed inAssetTokenId,
uint256 outTokenId,
address wnftFirstOwner,
uint256 nativeCollateralAmount,
bytes2 rules
);
event UnWrappedV1(
address indexed wrappedAddress,
address indexed originalAddress,
uint256 indexed wrappedId,
uint256 originalTokenId,
address beneficiary,
uint256 nativeCollateralAmount,
bytes2 rules
);
event CollateralAdded(
address indexed wrappedAddress,
uint256 indexed wrappedId,
uint8 assetType,
address collateralAddress,
uint256 collateralTokenId,
uint256 collateralBalance
);
event PartialUnWrapp(
address indexed wrappedAddress,
uint256 indexed wrappedId,
uint256 lastCollateralIndex
);
event SuspiciousFail(
address indexed wrappedAddress,
uint256 indexed wrappedId,
address indexed failedContractAddress
);
event EnvelopFee(
address indexed receiver,
address indexed wNFTConatract,
uint256 indexed wNFTTokenId,
uint256 amount
);
function wrap(
ETypes.INData calldata _inData,
ETypes.AssetItem[] calldata _collateral,
address _wrappFor
)
external
payable
returns (ETypes.AssetItem memory);
// function wrapUnsafe(
// ETypes.INData calldata _inData,
// ETypes.AssetItem[] calldata _collateral,
// address _wrappFor
// )
// external
// payable
// returns (ETypes.AssetItem memory);
function addCollateral(
address _wNFTAddress,
uint256 _wNFTTokenId,
ETypes.AssetItem[] calldata _collateral
) external payable;
// function addCollateralUnsafe(
// address _wNFTAddress,
// uint256 _wNFTTokenId,
// ETypes.AssetItem[] calldata _collateral
// )
// external
// payable;
function unWrap(
address _wNFTAddress,
uint256 _wNFTTokenId
) external;
function unWrap(
ETypes.AssetType _wNFTType,
address _wNFTAddress,
uint256 _wNFTTokenId
) external;
function unWrap(
ETypes.AssetType _wNFTType,
address _wNFTAddress,
uint256 _wNFTTokenId,
bool _isEmergency
) external;
function chargeFees(
address _wNFTAddress,
uint256 _wNFTTokenId,
address _from,
address _to,
bytes1 _feeType
)
external
returns (bool);
//////////////////////////////////////////////////////////////////////
function MAX_COLLATERAL_SLOTS() external view returns (uint256);
function protocolTechToken() external view returns (address);
function protocolWhiteList() external view returns (address);
function getWrappedToken(address _wNFTAddress, uint256 _wNFTTokenId)
external
view
returns (ETypes.WNFT memory);
function getOriginalURI(address _wNFTAddress, uint256 _wNFTTokenId)
external
view
returns(string memory);
function getCollateralBalanceAndIndex(
address _wNFTAddress,
uint256 _wNFTTokenId,
ETypes.AssetType _collateralType,
address _erc,
uint256 _tokenId
) external view returns (uint256, uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
import "../IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURI is IERC1155 {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}// 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.9.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(
address[] calldata accounts,
uint256[] calldata ids
) external view returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}{
"remappings": [
"@uniswap/=lib/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"@Uopenzeppelin/=lib/openzeppelin-contracts-upgradeable/",
"@envelop-protocol-v1/=lib/envelop-protocol-v1/",
"@envelop-subscription/=lib/subscription/",
"ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"envelop-protocol-v1/=lib/envelop-protocol-v1/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin/=lib/openzeppelin-contracts/contracts/",
"subscription/=lib/subscription/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_subscrRegistry","type":"address"},{"internalType":"address","name":"_pointsOperator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"asset","type":"tuple"}],"name":"UnSupportedAsset","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"display","type":"bytes32"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"enableAfter","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"disableAfter","type":"uint256"},{"indexed":false,"internalType":"address","name":"priceModel","type":"address"},{"indexed":false,"internalType":"string","name":"name","type":"string"}],"name":"DisplayChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"display","type":"bytes32"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"DisplayTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"display","type":"bytes32"},{"indexed":true,"internalType":"address","name":"assetContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"assetTokenId","type":"uint256"}],"name":"EnvelopPurchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"referrer","type":"address"},{"indexed":true,"internalType":"address","name":"customer","type":"address"},{"indexed":true,"internalType":"address","name":"payWithToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"payWithAmount","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"percentDiscount","type":"uint16"}],"name":"EnvelopReferrer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wrappedAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"wrappedIdaddress","type":"uint256"},{"indexed":false,"internalType":"bytes2","name":"newRules","type":"bytes2"}],"name":"EnvelopRulesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"display","type":"bytes32"},{"indexed":true,"internalType":"address","name":"assetContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"assetTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"placeIndex","type":"uint256"}],"name":"ItemAddedToDisplay","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"display","type":"bytes32"},{"indexed":true,"internalType":"address","name":"assetContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"assetTokenId","type":"uint256"}],"name":"ItemPriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"BLAST","outputs":[{"internalType":"contract IBlast","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLAST_POINTS_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_DISPLAY","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_INDEX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERCENT_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"internalType":"address","name":"_admin","type":"address"}],"name":"addAdminToDisplay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"_assetItem","type":"tuple"},{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price[]","name":"_prices","type":"tuple[]"}],"name":"addAssetItemPriceAtIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem[]","name":"_assetItems","type":"tuple[]"},{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price[]","name":"_prices","type":"tuple[]"}],"name":"addBatchItemsToDisplayWithSamePrice","outputs":[{"components":[{"internalType":"bytes32","name":"display","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"internalType":"struct KTypes.Place[]","name":"","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"_assetItem","type":"tuple"},{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price[]","name":"_prices","type":"tuple[]"}],"name":"addItemToDisplay","outputs":[{"components":[{"internalType":"bytes32","name":"display","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"internalType":"struct KTypes.Place","name":"place","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tariffIndex","type":"uint256"},{"internalType":"address","name":"_paymentToken","type":"address"},{"internalType":"uint256","name":"_paymentAmount","type":"uint256"},{"internalType":"uint16","name":"_agentFeePercent","type":"uint16"}],"name":"addPayOption","outputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"assetAtDisplay","outputs":[{"internalType":"bytes32","name":"display","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_agent","type":"address"},{"internalType":"uint256[]","name":"_serviceTariffIndexes","type":"uint256[]"}],"name":"authorizeAgentForService","outputs":[{"internalType":"uint256[]","name":"actualTariffs","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"_assetItem","type":"tuple"},{"internalType":"uint256","name":"_priceIndex","type":"uint256"},{"internalType":"address","name":"_buyer","type":"address"},{"internalType":"address","name":"_referrer","type":"address"},{"internalType":"string","name":"_promo","type":"string"}],"name":"buyAssetItem","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"internalType":"address","name":"_who","type":"address"}],"name":"canBuyForFree","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"checkUser","outputs":[{"internalType":"bool","name":"ok","type":"bool"},{"internalType":"bool","name":"needFix","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"displayAdmins","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"displays","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"enableAfter","type":"uint256"},{"internalType":"uint256","name":"disableAfter","type":"uint256"},{"internalType":"address","name":"priceModel","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"_assetItem","type":"tuple"},{"internalType":"uint256","name":"_priceIndex","type":"uint256"},{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price","name":"_price","type":"tuple"}],"name":"editAssetItemPriceAtIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tariffIndex","type":"uint256"},{"internalType":"uint256","name":"_payWithIndex","type":"uint256"},{"internalType":"address","name":"_paymentToken","type":"address"},{"internalType":"uint256","name":"_paymentAmount","type":"uint256"},{"internalType":"uint16","name":"_agentFeePercent","type":"uint16"}],"name":"editPayOption","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tariffIndex","type":"uint256"},{"internalType":"uint256","name":"_timelockPeriod","type":"uint256"},{"internalType":"uint256","name":"_ticketValidPeriod","type":"uint256"},{"internalType":"uint256","name":"_counter","type":"uint256"},{"internalType":"bool","name":"_isAvailable","type":"bool"},{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"editServiceTariff","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"_assetItem","type":"tuple"}],"name":"getAssetItem","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"nft","type":"tuple"},{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price[]","name":"prices","type":"tuple[]"}],"internalType":"struct KTypes.ItemForSale","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"_assetItem","type":"tuple"}],"name":"getAssetItemPlace","outputs":[{"components":[{"internalType":"bytes32","name":"display","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"internalType":"struct KTypes.Place","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"_assetItem","type":"tuple"},{"internalType":"address","name":"_buyer","type":"address"},{"internalType":"address","name":"_referrer","type":"address"},{"internalType":"string","name":"_promo","type":"string"}],"name":"getAssetItemPricesAndDiscounts","outputs":[{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price[]","name":"","type":"tuple[]"},{"components":[{"internalType":"enum KTypes.DiscountType","name":"dsctType","type":"uint8"},{"internalType":"uint16","name":"dsctPercent","type":"uint16"}],"internalType":"struct KTypes.Discount[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"}],"name":"getDisplay","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"enableAfter","type":"uint256"},{"internalType":"uint256","name":"disableAfter","type":"uint256"},{"internalType":"address","name":"priceModel","type":"address"},{"components":[{"internalType":"address","name":"owner","type":"address"},{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"nft","type":"tuple"},{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price[]","name":"prices","type":"tuple[]"}],"internalType":"struct KTypes.ItemForSale[]","name":"items","type":"tuple[]"}],"internalType":"struct KTypes.Display","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"}],"name":"getDisplayAssetItems","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"nft","type":"tuple"},{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price[]","name":"prices","type":"tuple[]"}],"internalType":"struct KTypes.ItemForSale[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"}],"name":"getDisplayOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"hlpHashString","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"internalType":"address","name":"_who","type":"address"}],"name":"isDisplayAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"modelWhiteListAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"uint256","name":"timelockPeriod","type":"uint256"},{"internalType":"uint256","name":"ticketValidPeriod","type":"uint256"},{"internalType":"uint256","name":"counter","type":"uint256"},{"internalType":"bool","name":"isAvailable","type":"bool"},{"internalType":"address","name":"beneficiary","type":"address"}],"internalType":"struct SubscriptionType","name":"subscription","type":"tuple"},{"components":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"paymentAmount","type":"uint256"},{"internalType":"uint16","name":"agentFeePercent","type":"uint16"}],"internalType":"struct PayOption[]","name":"payWith","type":"tuple[]"}],"internalType":"struct Tariff","name":"_newTariff","type":"tuple"}],"name":"newTariff","outputs":[{"internalType":"uint256","name":"tariffIndex","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"uint256","name":"timelockPeriod","type":"uint256"},{"internalType":"uint256","name":"ticketValidPeriod","type":"uint256"},{"internalType":"uint256","name":"counter","type":"uint256"},{"internalType":"bool","name":"isAvailable","type":"bool"},{"internalType":"address","name":"beneficiary","type":"address"}],"internalType":"struct SubscriptionType","name":"subscription","type":"tuple"},{"components":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"paymentAmount","type":"uint256"},{"internalType":"uint16","name":"agentFeePercent","type":"uint16"}],"internalType":"struct PayOption[]","name":"payWith","type":"tuple[]"}],"internalType":"struct Tariff","name":"_newTariff","type":"tuple"}],"name":"registerServiceTariff","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"internalType":"uint256","name":"_adminIndex","type":"uint256"}],"name":"removeAdminFromDisplayByIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"_assetItem","type":"tuple"}],"name":"removeAssetItem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"_assetItem","type":"tuple"}],"name":"removeLastPersonalPriceForAssetItem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"serviceProvider","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"_enableAfter","type":"uint256"},{"internalType":"uint256","name":"_disableAfter","type":"uint256"},{"internalType":"address","name":"_priceModel","type":"address"}],"name":"setDisplayParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isEnable","type":"bool"}],"name":"setSubscriptionOnOff","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_subscrRegistry","type":"address"}],"name":"setSubscriptionRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_modelWhiteList","type":"address"}],"name":"setWhiteList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"subscriptionRegistry","outputs":[{"internalType":"contract ISubscriptionRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"}],"name":"transferDisplay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60e0604052600860a0908152674e46544b696f736b60c01b60c0526200002590620001dd565b6080526005805460ff60a01b1916600160a01b1790553480156200004857600080fd5b5060405162005b2a38038062005b2a8339810160408190526200006b916200027e565b60016000558082806001600160a01b038116620000be5760405162461bcd60e51b815260206004820152600d60248201526c4e6f6e207a65726f206f6e6c7960981b604482015260640160405180910390fd5b60048054306001600160a01b031991821617909155600580549091166001600160a01b0392909216919091179055620000fe620000f83390565b6200020f565b506040516336b91f2b60e01b81526001600160a01b0382166004820152732536fe9ab3f511540f2f9e2ec2a805005c3dd800906336b91f2b90602401600060405180830381600087803b1580156200015557600080fd5b505af11580156200016a573d6000803e3d6000fd5b5050604051631d70c8d360e31b8152336004820152734300000000000000000000000000000000000002925063eb8646989150602401600060405180830381600087803b158015620001bb57600080fd5b505af1158015620001d0573d6000803e3d6000fd5b5050505050505062000306565b600081604051602001620001f29190620002b6565b604051602081830303815290604052805190602001209050919050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146200027957600080fd5b919050565b600080604083850312156200029257600080fd5b6200029d8362000261565b9150620002ad6020840162000261565b90509250929050565b600060208083528351808285015260005b81811015620002e557858101830151858201604001528201620002c7565b506000604082860101526040601f19601f8301168501019250505092915050565b6080516157e562000345600039600081816104d301528181610e2301528181611a37015281816122db0152818161352701526135cd01526157e56000f3fe6080604052600436106102ae5760003560e01c8063864438fb11610175578063bc197c81116100dc578063d7fe513d11610095578063f23a6e611161006f578063f23a6e61146109a7578063f2fde38b146109d3578063f8903c24146109f3578063fb8adca414610a1357600080fd5b8063d7fe513d1461093a578063dbf9224014610967578063dc39b11f1461098757600080fd5b8063bc197c811461086e578063bffe185a1461089a578063c7eecb75146108ad578063caaf137f146108cd578063d52b4038146108ed578063d556ae961461091a57600080fd5b80639e6c29591161012e5780639e6c2959146107a05780639ec30e4a146107b6578063a3fafd05146107d6578063abba145b14610803578063b1d065f714610823578063ba5aa3f21461085957600080fd5b8063864438fb146106cd5780638d69e95e146106fa5780638da5cb5b1461071a5780638def98d61461073857806390b734581461075857806397d757761461078557600080fd5b80632f85b0ae11610219578063596b2bcc116101d2578063596b2bcc1461062f57806362d444721461064f5780636aa633b614610677578063715018a61461069857806378451d00146102e857806382b710e9146106ad57600080fd5b80632f85b0ae146104f557806339e899ee146105155780633c727f49146105355780633f62c00e1461055557806346d5b1c9146105e15780635751869b1461060f57600080fd5b80631e9d48cf1161026b5780631e9d48cf146103e55780631f16aef31461041c5780631f7b8b7b1461043c57806320da717014610469578063299b2660146104a15780632eeb42b3146104c157600080fd5b806301ffc9a7146102b35780630c5620d6146102e85780630c7b1c13146103165780630ca9f90314610338578063140cf1921461038c578063150b7a02146103ac575b600080fd5b3480156102bf57600080fd5b506102d36102ce366004614279565b610a33565b60405190151581526020015b60405180910390f35b3480156102f457600080fd5b50610308610303366004614456565b610a6a565b6040519081526020016102df565b34801561032257600080fd5b5061033661033136600461453b565b610a7d565b005b34801561034457600080fd5b50610377610353366004614584565b60036020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016102df565b34801561039857600080fd5b506103366103a73660046145fb565b610bb7565b3480156103b857600080fd5b506103cc6103c73660046146c5565b610cab565b6040516001600160e01b031990911681526020016102df565b3480156103f157600080fd5b50610405610400366004614730565b610cbc565b6040805192151583529015156020830152016102df565b34801561042857600080fd5b5061033661043736600461474d565b610cd1565b34801561044857600080fd5b5061045c61045736600461482c565b610cef565b6040516102df9190614886565b34801561047557600080fd5b50600554610489906001600160a01b031681565b6040516001600160a01b0390911681526020016102df565b3480156104ad57600080fd5b5061045c6104bc36600461489d565b610f0c565b3480156104cd57600080fd5b506103087f000000000000000000000000000000000000000000000000000000000000000081565b34801561050157600080fd5b506103366105103660046148fa565b61103c565b34801561052157600080fd5b50610336610530366004614730565b61117c565b34801561054157600080fd5b50600754610489906001600160a01b031681565b34801561056157600080fd5b506105ad610570366004614967565b6001602081905260009182526040909120805491810154600282015460038301546004909301546001600160a01b03948516949283169391921685565b604080516001600160a01b03968716815294861660208601528401929092526060830152909116608082015260a0016102df565b3480156105ed57600080fd5b506106016105fc366004614980565b6111a6565b6040516102df929190614a2e565b34801561061b57600080fd5b5061033661062a366004614ad8565b611201565b34801561063b57600080fd5b5061033661064a366004614584565b61121d565b34801561065b57600080fd5b50610489732536fe9ab3f511540f2f9e2ec2a805005c3dd80081565b34801561068357600080fd5b506005546102d390600160a01b900460ff1681565b3480156106a457600080fd5b506103366112d6565b3480156106b957600080fd5b506103086106c8366004614b2e565b6112ea565b3480156106d957600080fd5b506106ed6106e8366004614967565b61131a565b6040516102df9190614c8b565b34801561070657600080fd5b50600454610489906001600160a01b031681565b34801561072657600080fd5b506006546001600160a01b0316610489565b34801561074457600080fd5b506102d3610753366004614ce6565b611521565b34801561076457600080fd5b5061077861077336600461489d565b611534565b6040516102df9190614d16565b34801561079157600080fd5b506104896002604360981b0181565b3480156107ac57600080fd5b5061030861271081565b3480156107c257600080fd5b506103366107d1366004614730565b6116d6565b3480156107e257600080fd5b506107f66107f1366004614d84565b611700565b6040516102df9190614e0e565b34801561080f57600080fd5b5061033661081e366004614e21565b611714565b34801561082f57600080fd5b5061048961083e366004614967565b6000908152600160205260409020546001600160a01b031690565b34801561086557600080fd5b50610308600081565b34801561087a57600080fd5b506103cc610889366004614e3e565b63bc197c8160e01b95945050505050565b6103366108a8366004614eeb565b61173a565b3480156108b957600080fd5b506103366108c8366004614f6f565b611d13565b3480156108d957600080fd5b506103366108e8366004614f8b565b611eb3565b3480156108f957600080fd5b5061090d610908366004614fad565b611fc1565b6040516102df9190615072565b34801561092657600080fd5b50610336610935366004614ce6565b61208f565b34801561094657600080fd5b5061095a610955366004614967565b61214b565b6040516102df91906150bc565b34801561097357600080fd5b50610336610982366004614f6f565b6122bc565b34801561099357600080fd5b506104896109a2366004614f8b565b612444565b3480156109b357600080fd5b506103cc6109c23660046150cf565b63f23a6e6160e01b95945050505050565b3480156109df57600080fd5b506103366109ee366004614730565b61247c565b3480156109ff57600080fd5b506102d3610a0e366004614ce6565b6124f5565b348015610a1f57600080fd5b50610308610a2e366004615137565b612501565b60006001600160e01b03198216630271189760e51b1480610a6457506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000610a74612520565b610a648261257a565b6000610a916104bc3686900386018661489d565b9050336001600160a01b03166001600083600001518152602001908152602001600020600501826020015181548110610acc57610acc615181565b60009182526020909120600590910201546001600160a01b031614610b515780516000908152600160205260409020546001600160a01b03163314610b515760405162461bcd60e51b815260206004820152601660248201527527b7363c903337b9103234b9b83630bc9037bbb732b960511b60448201526064015b60405180910390fd5b610b658160000151826020015185856125ed565b60408401803590610b799060208701614730565b82516040516001600160a01b0392909216917fe27d3d65f32610d390b50c9f6af70c0bfe910e5909c6ea9c91f2a8be3924af9290600090a450505050565b6000610bcb6104bc3686900386018661489d565b9050336001600160a01b03166001600083600001518152602001908152602001600020600501826020015181548110610c0657610c06615181565b60009182526020909120600590910201546001600160a01b031614610c975780516000908152600160205260409020546001600160a01b03163314610c975760405162461bcd60e51b815260206004820152602160248201527f4f6e6c7920646973706c6179206f776e65722063616e206564697420707269636044820152606560f81b6064820152608401610b48565b610b6581600001518260200151858561264f565b630a85bd0160e11b5b949350505050565b600080610cc8836126e4565b91509150915091565b610cd9612520565b610ce7868686868686612781565b505050505050565b6040805180820182526000808252602080830182905286518101516001600160a01b03168252600381528382208782015183528152908390208351808501909452805480855260019091015491840191909152909190158015610d5457506020810151155b610d955760405162461bcd60e51b8152602060048201526012602482015271416c726561647920617420646973706c617960701b6044820152606401610b48565b610da085333061280c565b85604001511115610e035760405162461bcd60e51b815260206004820152602760248201527f496e73756666696369656e742062616c616e6365206166746572204e465420746044820152663930b739b332b960c91b6064820152608401610b48565b6000868152600160205260409020546001600160a01b03163314610e9b577f00000000000000000000000000000000000000000000000000000000000000008614610e9b5760405162461bcd60e51b815260206004820152602260248201527f4f6e6c792044656661756c7420446973706c617920616c6c6f7720666f7220616044820152616e7960f01b6064820152608401610b48565b610ea88633878787612e90565b915084602001518560000151602001516001600160a01b031683600001517fbebac2c3edec4f43f08e2877981bb81ddfa37d20a2f9ab5981f05761d16d004f8560200151604051610efb91815260200190565b60405180910390a450949350505050565b604080518082019091526000808252602082015260038251516007811115610f3657610f366149fa565b03610fa05730610f4583613063565b6001600160a01b031614610f9b5760405162461bcd60e51b815260206004820152601d60248201527f4173736574206e6f74207472616e73666572656420746f206b696f736b0000006044820152606401610b48565b610ff9565b6000610fac8330613180565b11610ff95760405162461bcd60e51b815260206004820152601d60248201527f4173736574206e6f74207472616e73666572656420746f206b696f736b0000006044820152606401610b48565b5080516020908101516001600160a01b03166000908152600382526040808220938301518252928252829020825180840190935280548352600101549082015290565b600754604051638e5f9ac560e01b81526001600160a01b03838116600483015290911690638e5f9ac590602401602060405180830381865afa158015611086573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110aa9190615197565b6110f65760405162461bcd60e51b815260206004820152601e60248201527f556e6578706563746564207072696365206d6f64656c206164647265737300006044820152606401610b48565b60006001600160a01b03166001600061114489898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506112ea92505050565b81526020810191909152604001600020546001600160a01b03160361116e5761116c33613308565b505b610ce7868686868686613395565b611184612520565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6060806111f38787876111ee88888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506112ea92505050565b6134fe565b915091509550959350505050565b611209612520565b6112168585858585613935565b5050505050565b6000818152600160205260409020546001600160a01b0316331461127c5760405162461bcd60e51b815260206004820152601660248201527527b7363c903337b9102234b9b83630bc9027bbb732b960511b6044820152606401610b48565b60008181526001602052604080822080546001600160a01b0319166001600160a01b03861690811790915590519091339184917f22c910a2dcce4230a03ebd4d4c2512b57da90f10d23745a22c8a37e16fb6939391a45050565b6112de612520565b6112e860006139ba565b565b6000816040516020016112fd91906151d8565b604051602081830303815290604052805190602001209050919050565b61136e6040518060c0016040528060006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160006001600160a01b03168152602001606081525090565b6000828152600160208181526040808420815160c08101835281546001600160a01b0390811682529482015485168185015260028201548184015260038201546060820152600482015490941660808501526005810180548351818602810186019094528084529495919460a08701949192909184015b8282101561151357600084815260209081902060408051606080820183526005870290930180546001600160a01b03168252825160a0810190935260018101805492959194918601939290918391908201908390829060ff16600781111561144f5761144f6149fa565b6007811115611460576114606149fa565b8152905461010090046001600160a01b031660209182015290825260018301548282015260029092015460409182015291835260048401805483518184028101840190945280845293820193909160009084015b828210156114fc576000848152602090819020604080518082019091526002850290910180546001600160a01b031682526001908101548284015290835290920191016114b4565b5050505081525050815260200190600101906113e5565b505050915250909392505050565b600061152d8383613a0c565b9392505050565b61157c60408051606080820183526000808352835160a08101855291820181815260808301829052825260208281018290529382015290918201908152602001606081525090565b600061158783610f0c565b905060016000826000015181526020019081526020016000206005018160200151815481106115b8576115b8615181565b60009182526020918290206040805160608082018352600590940290920180546001600160a01b03168352815160a08101909252600181018054939591949186019390918391908201908390829060ff16600781111561161a5761161a6149fa565b600781111561162b5761162b6149fa565b8152905461010090046001600160a01b031660209182015290825260018301548282015260029092015460409182015291835260048401805483518184028101840190945280845293820193909160009084015b828210156116c7576000848152602090819020604080518082019091526002850290910180546001600160a01b0316825260019081015482840152908352909201910161167f565b50505091525090949350505050565b6116de612520565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b606061170a612520565b61152d8383613acb565b61171c612520565b60058054911515600160a01b0260ff60a01b19909216919091179055565b611742613b45565b6040805160a0810182526000606082018181526080830182905282526020820181905291810182905290806117c061177f368b90038b018b61489d565b88886111ee89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506112ea92505050565b90925090506000805b8251811015611903578281815181106117e4576117e4615181565b60200260200101516020015161ffff16826117ff9190615221565b9150600183828151811061181557611815615181565b6020026020010151600001516007811115611832576118326149fa565b036118f357838a8151811061184957611849615181565b6020026020010151600001516001600160a01b0316336001600160a01b0316896001600160a01b03167fbe6f7c5115afd6431e5364f25028ab5075992833e68b41bb7e9cf9298b11c513878e815181106118a5576118a5615181565b6020026020010151602001518786815181106118c3576118c3615181565b6020026020010151602001516040516118ea92919091825261ffff16602082015260400190565b60405180910390a45b6118fc81615234565b90506117c9565b506040518060600160405280604051806040016040528060006001600160a01b0316878e8151811061193757611937615181565b6020026020010151600001516001600160a01b03161461195857600261195b565b60015b600781111561196c5761196c6149fa565b8152602001868d8151811061198357611983615181565b6020026020010151600001516001600160a01b03168152508152602001600081526020016127108c606001356000146119c0578c606001356119c3565b60015b6119cf8561271061524d565b878e815181106119e1576119e1615181565b6020026020010151602001516119f79190615260565b611a019190615260565b611a0b9190615277565b81525093505050506000806000611a2c8a8036038101906104bc919061489d565b8051909150611a91577f000000000000000000000000000000000000000000000000000000000000000060008181526001602081815260408320808301548587528683018590529490935252600401546001600160a01b039182169450169150611ac3565b8051600090815260016020819052604080832090910154835183529120600401546001600160a01b0391821694501691505b805160009081526001602052604090206002015442118015611af8575080516000908152600160205260409020600301544211155b611b335760405162461bcd60e51b815260206004820152600c60248201526b4f6e6c7920696e2074696d6560a01b6044820152606401610b48565b8051611b3f9033613b9e565b611cf15760018451516007811115611b5957611b596149fa565b03611beb57611b6984308561280c565b84604001511115611b8c5760405162461bcd60e51b8152600401610b4890615299565b6000846040015134611b9e919061524d565b1115611be6576040840151339081906108fc90611bbb903461524d565b6040518115909202916000818181858888f19350505050158015611be3573d6000803e3d6000fd5b50505b611c5b565b3415611c2d5760405162461bcd60e51b81526020600482015260116024820152704f6e6c7920455243323020746f6b656e7360781b6044820152606401610b48565b611c3884338561280c565b84604001511115611c5b5760405162461bcd60e51b8152600401610b4890615299565b604051633c08a02f60e21b81526001600160a01b0383169063f02280bc90611c89908d908c906004016152e4565b6020604051808303816000875af1158015611ca8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ccc9190615197565b15611cec57611cea611ce3368c90038c018c61489d565b308a61280c565b505b611d05565b611d03611ce3368c90038c018c61489d565b505b50505050610ce76001600055565b6000611d276104bc3684900384018461489d565b9050336001600160a01b03166001600083600001518152602001908152602001600020600501826020015181548110611d6257611d62615181565b60009182526020909120600590910201546001600160a01b031614611de25780516000908152600160205260409020546001600160a01b03163314611de25760405162461bcd60e51b815260206004820152601660248201527527b7363c903337b9103234b9b83630bc9037bbb732b960511b6044820152606401610b48565b60006001600083600001518152602001908152602001600020600501826020015181548110611e1357611e13615181565b9060005260206000209060050201600401905080805480611e3657611e36615340565b6000828152602080822060026000199094019384020180546001600160a01b031916815560010191909155915560408401803591611e7691908601614730565b83516040516001600160a01b0392909216917fe27d3d65f32610d390b50c9f6af70c0bfe910e5909c6ea9c91f2a8be3924af9290600090a4505050565b6000828152600160205260409020546001600160a01b03163314611ee95760405162461bcd60e51b8152600401610b4890615356565b60008281526002602052604090208054611f059060019061524d565b8214611f8a5780548190611f1b9060019061524d565b81548110611f2b57611f2b615181565b9060005260206000200160009054906101000a90046001600160a01b0316818381548110611f5b57611f5b615181565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b80805480611f9a57611f9a615340565b600082815260209020810160001990810180546001600160a01b0319169055019055505050565b6060600084516001600160401b03811115611fde57611fde6142a3565b60405190808252806020026020018201604052801561202357816020015b6040805180820190915260008082526020820152815260200190600190039081611ffc5790505b50905060005b8551811015612085576120578787838151811061204857612048615181565b60200260200101518787610cef565b82828151811061206957612069615181565b60200260200101819052508061207e90615234565b9050612029565b5095945050505050565b6000828152600160205260409020546001600160a01b031633146120c55760405162461bcd60e51b8152600401610b4890615356565b6120cf8282613a0c565b1561210c5760405162461bcd60e51b815260206004820152600d60248201526c20b63932b0b23c9030b236b4b760991b6044820152606401610b48565b600091825260026020908152604083208054600181018255908452922090910180546001600160a01b0319166001600160a01b03909216919091179055565b606060016000838152602001908152602001600020600501805480602002602001604051908101604052809291908181526020016000905b828210156122b157600084815260209081902060408051606080820183526005870290930180546001600160a01b03168252825160a0810190935260018101805492959194918601939290918391908201908390829060ff1660078111156121ed576121ed6149fa565b60078111156121fe576121fe6149fa565b8152905461010090046001600160a01b031660209182015290825260018301548282015260029092015460409182015291835260048401805483518184028101840190945280845293820193909160009084015b8282101561229a576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101612252565b505050508152505081526020019060010190612183565b505050509050919050565b60006122d06104bc3684900384018461489d565b8051909150612304577f00000000000000000000000000000000000000000000000000000000000000008152600060208201525b336001600160a01b0316600160008360000151815260200190815260200160002060050182602001518154811061233d5761233d615181565b60009182526020909120600590910201546001600160a01b0316148061237b575080516000908152600160205260409020546001600160a01b031633145b6123c75760405162461bcd60e51b815260206004820152601a60248201527f4f6e6c79204974656d206f776e65722063616e2072656d6f76650000000000006044820152606401610b48565b6123da8160000151826020015184613bc8565b6123f36123ec3684900384018461489d565b303361280c565b50604082018035906124089060208501614730565b82516040516001600160a01b0392909216917f0640a25b0e045d99b4dac93cd08c63e3c6803633e285b50f81ab66270fbbd56390600090a45050565b6002602052816000526040600020818154811061246057600080fd5b6000918252602090912001546001600160a01b03169150829050565b612484612520565b6001600160a01b0381166124e95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b48565b6124f2816139ba565b50565b600061152d8383613b9e565b600061250b612520565b61251785858585613e97565b95945050505050565b6006546001600160a01b031633146112e85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b48565b6005546040516278451d60e81b81526000916001600160a01b0316906378451d00906125aa908590600401615397565b6020604051808303816000875af11580156125c9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a64919061544d565b600084815260016020526040902060050180548291908590811061261357612613615181565b9060005260206000209060050201600401838154811061263557612635615181565b90600052602060002090600202018181610ce79190615466565b600084815260016020526040812060050180548590811061267257612672615181565b9060005260206000209060050201905060005b82811015610ce757816004018484838181106126a3576126a3615181565b8354600181018555600094855260209094206040909102929092019260020290910190506126d18282615466565b5050806126dd90615234565b9050612685565b6005546000908190600160a01b900460ff16156127785760055460405163496d511d60e11b81526001600160a01b038581166004830152306024830152909116906392daa23a906044016040805180830381865afa15801561274a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061276e919061549c565b9092509050915091565b60019150915091565b600554604051631f16aef360e01b81526004810188905260248101879052604481018690526064810185905283151560848201526001600160a01b0383811660a483015290911690631f16aef39060c401600060405180830381600087803b1580156127ec57600080fd5b505af1158015612800573d6000803e3d6000fd5b50505050505050505050565b60008060018551516007811115612825576128256149fa565b036128df575060408085015190516001600160a01b0384168031926000928381818185875af1925050503d806000811461287b576040519150601f19603f3d011682016040523d82523d6000602084013e612880565b606091505b50509050806128c35760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b6044820152606401610b48565b6128d7826001600160a01b0386163161524d565b925050612e88565b600285515160078111156128f5576128f56149fa565b03612a4b578451602001516040516370a0823160e01b81526001600160a01b038581166004830152909116906370a0823190602401602060405180830381865afa158015612947573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061296b919061544d565b9050306001600160a01b038516036129a457604085015185516020015161299f916001600160a01b03909116908590613f20565b6129c8565b60408501518551602001516129c8916001600160a01b039091169086908690613f88565b8451602001516040516370a0823160e01b81526001600160a01b038581166004830152839216906370a08231906024015b602060405180830381865afa158015612a16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a3a919061544d565b612a44919061524d565b9150612e88565b60038551516007811115612a6157612a616149fa565b148015612aed57508451602090810151908601516040516331a9108f60e11b815260048101919091526001600160a01b03868116921690636352211e90602401602060405180830381865afa158015612abe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae291906154cb565b6001600160a01b0316145b15612d00578451602001516040516370a0823160e01b81526001600160a01b038581166004830152909116906370a0823190602401602060405180830381865afa158015612b3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b63919061544d565b8551602090810151908701516040516323b872dd60e01b81526001600160a01b0388811660048301528781166024830152604482019290925292935016906323b872dd90606401600060405180830381600087803b158015612bc457600080fd5b505af1158015612bd8573d6000803e3d6000fd5b50505050826001600160a01b03168560000151602001516001600160a01b0316636352211e87602001516040518263ffffffff1660e01b8152600401612c2091815260200190565b602060405180830381865afa158015612c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c6191906154cb565b6001600160a01b0316148015612cf157508451602001516040516370a0823160e01b81526001600160a01b038581166004830152839216906370a0823190602401602060405180830381865afa158015612cbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ce3919061544d565b612ced919061524d565b6001145b15612cfb57600191505b612e88565b60048551516007811115612d1657612d166149fa565b03612e6d57845160209081015190860151604051627eeac760e11b81526001600160a01b038681166004830152602482019290925291169062fdd58e90604401602060405180830381865afa158015612d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d97919061544d565b8551602090810151908701516040808901519051637921219560e11b81526001600160a01b03898116600483015288811660248301526044820193909352606481019190915260a06084820152600060a4820152929350169063f242432a9060c401600060405180830381600087803b158015612e1357600080fd5b505af1158015612e27573d6000803e3d6000fd5b5050865160209081015190880151604051627eeac760e11b81526001600160a01b03888116600483015260248201929092528594509116915062fdd58e906044016129f9565b8460405163391102fb60e01b8152600401610b4891906154e8565b509392505050565b60408051808201909152600080825260208201526000868152600160208181526040832060059081018054808501825590855291909320920290910180546001600160a01b0319166001600160a01b0388161781558551805182840180549394899491939284929091839160ff191690836007811115612f1257612f126149fa565b021790555060209182015181546001600160a01b0390911661010002610100600160a81b031990911617905582015160018201556040909101516002909101558215612fbc5760005b83811015612fba5781600401858583818110612f7957612f79615181565b835460018101855560009485526020909420604090910292909201926002029091019050612fa78282615466565b505080612fb390615234565b9050612f5b565b505b60408051808201825288815260008981526001602081815293909120600501549192830191612feb919061524d565b905285516020908101516001600160a01b03908116600090815260038084526040808320858c018051855290865281842087518155968601516001978801559a518501519093168252835281812098518152978252968790208751808901909852805488529091015490860152509295945050505050565b60006001825151600781111561307b5761307b6149fa565b0361308857506000919050565b6002825151600781111561309e5761309e6149fa565b036130ab57506000919050565b600382515160078111156130c1576130c16149fa565b03613142578151602090810151908301516040516331a9108f60e11b81526001600160a01b0390921691636352211e916131019160040190815260200190565b602060405180830381865afa15801561311e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6491906154cb565b60048251516007811115613158576131586149fa565b0361316557506000919050565b8160405163391102fb60e01b8152600401610b4891906154e8565b600060018351516007811115613198576131986149fa565b036131ae57506001600160a01b03811631610a64565b600283515160078111156131c4576131c46149fa565b03613242578251602001516040516370a0823160e01b81526001600160a01b038481166004830152909116906370a08231906024015b602060405180830381865afa158015613217573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061323b919061544d565b9050610a64565b60038351516007811115613258576132586149fa565b03613292578251602001516040516370a0823160e01b81526001600160a01b038481166004830152909116906370a08231906024016131fa565b600483515160078111156132a8576132a86149fa565b036132ed57825160209081015190840151604051627eeac760e11b81526001600160a01b038581166004830152602482019290925291169062fdd58e906044016131fa565b8260405163391102fb60e01b8152600401610b4891906154e8565b600554600090600160a01b900460ff161561338d57600554604051632e5f2cf160e01b81526001600160a01b03848116600483015290911690632e5f2cf1906024016020604051808303816000875af1158015613369573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a649190615197565b506001919050565b60006133d687878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506112ea92505050565b6000818152600160205260409020549091506001600160a01b031633148061341357506000818152600160205260409020546001600160a01b0316155b6134585760405162461bcd60e51b815260206004820152601660248201527527b7363c903337b9102234b9b83630bc9027bbb732b960511b6044820152606401610b48565b6000818152600160208190526040918290208054336001600160a01b03199182168117835592820180546001600160a01b038b81169184168217909255600284018a9055600384018990556004909301805491881691909216179055915183907f4af8e278eab954a95814248126e9442f4b93f859428b736d603382314e14ac89906134ed908990899089908f908f906154f6565b60405180910390a450505050505050565b606080600061350c87610f0c565b805190915015801561352057506020810151155b15613681577f0000000000000000000000000000000000000000000000000000000000000000600090815260016020526040908190206004908101549151631ddd707b60e31b81526001600160a01b039092169163eeeb83d891613586918b91016154e8565b600060405180830381865afa1580156135a3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526135cb9190810190615545565b7f0000000000000000000000000000000000000000000000000000000000000000600090815260016020526040908190206004908101549151632d15a65360e21b81526001600160a01b039092169163b456994c91613632918c918c918c918c91016155f8565b600060405180830381865afa15801561364f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613677919081019061562d565b925092505061392c565b600060016000836000015181526020019081526020016000206005018260200151815481106136b2576136b2615181565b90600052602060002090600502016004018054905011156138125760016000826000015181526020019081526020016000206005018160200151815481106136fc576136fc615181565b600091825260208083208451845260019091526040928390206004908101549351632d15a65360e21b815260059093029091018101926001600160a01b03169163b456994c91613754918c918c918c918c91016155f8565b600060405180830381865afa158015613771573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613799919081019061562d565b81805480602002602001604051908101604052809291908181526020016000905b82821015613802576000848152602090819020604080518082019091526002850290910180546001600160a01b031682526001908101548284015290835290920191016137ba565b505050509150925092505061392c565b8051600090815260016020526040908190206004908101549151631ddd707b60e31b81526001600160a01b039092169163eeeb83d891613854918b91016154e8565b600060405180830381865afa158015613871573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526138999190810190615545565b8151600090815260016020526040908190206004908101549151632d15a65360e21b81526001600160a01b039092169163b456994c916138e1918c918c918c918c91016155f8565b600060405180830381865afa1580156138fe573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613926919081019061562d565b92509250505b94509492505050565b60055460405163650aac6160e01b815260048101879052602481018690526001600160a01b0385811660448301526064820185905261ffff841660848301529091169063650aac619060a401600060405180830381600087803b15801561399b57600080fd5b505af11580156139af573d6000803e3d6000fd5b505050505050505050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600082815260026020908152604080832080548251818502810185019093528083528493830182828015613a6957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613a4b575b5050505050905060005b8151811015613ac357836001600160a01b0316828281518110613a9857613a98615181565b60200260200101516001600160a01b031603613ab357600192505b613abc81615234565b9050613a73565b505092915050565b60055460405163a3fafd0560e01b81526060916001600160a01b03169063a3fafd0590613afe90869086906004016156ea565b6000604051808303816000875af1158015613b1d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261152d919081019061570e565b600260005403613b975760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b48565b6002600055565b6000828152600160205260408120546001600160a01b03808416911603610a645750600192915050565b600083815260016020819052604090912060050154613be7919061524d565b8214613dd957600083815260016020819052604090912060050180549091613c0e9161524d565b81548110613c1e57613c1e615181565b9060005260206000209060050201600160008581526020019081526020016000206005018381548110613c5357613c53615181565b60009182526020909120825460059092020180546001600160a01b0319166001600160a01b03909216919091178155600180830180548284018054929390928492849260ff90911691839160ff1990911690836007811115613cb757613cb76149fa565b021790555090548154610100600160a81b031916610100918290046001600160a01b03169091021790556001828101549082015560029182015491015560048281018054613d0892840191906141be565b5090505060405180604001604052808481526020018381525060036000600160008781526020019081526020016000206005018581548110613d4c57613d4c615181565b6000918252602080832060059283020160019081015461010090046001600160a01b031685528482019590955260409384018320898452949052918120909101805486908110613d9e57613d9e615181565b906000526020600020906005020160010160010154815260200190815260200160002060008201518160000155602082015181600101559050505b6000838152600160205260409020600501805480613df957613df9615340565b60008281526020812060056000199093019283020180546001600160a01b03191681556001810180546001600160a81b0319169055600281018290556003810182905590613e4a6004830182614236565b5050905560036000613e626040840160208501614730565b6001600160a01b0316815260208082019290925260409081016000908120938201358152929091528120818155600101555050565b600554604051639aab948160e01b8152600481018690526001600160a01b0385811660248301526044820185905261ffff841660648301526000921690639aab9481906084016020604051808303816000875af1158015613efc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612517919061544d565b6040516001600160a01b038316602482015260448101829052613f8390849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613fc6565b505050565b6040516001600160a01b0380851660248301528316604482015260648101829052613fc09085906323b872dd60e01b90608401613f4c565b50505050565b600061401b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661409b9092919063ffffffff16565b905080516000148061403c57508080602001905181019061403c9190615197565b613f835760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b48565b6060610cb4848460008585600080866001600160a01b031685876040516140c29190615793565b60006040518083038185875af1925050503d80600081146140ff576040519150601f19603f3d011682016040523d82523d6000602084013e614104565b606091505b509150915061411587838387614120565b979650505050505050565b6060831561418f578251600003614188576001600160a01b0385163b6141885760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b48565b5081610cb4565b610cb483838151156141a45781518083602001fd5b8060405162461bcd60e51b8152600401610b4891906151d8565b8280548282559060005260206000209060020281019282156142265760005260206000209160020282015b8281111561422657825482546001600160a01b0319166001600160a01b0390911617825560018084015490830155600292830192909101906141e9565b50614232929150614253565b5090565b50805460008255600202906000526020600020908101906124f291905b5b808211156142325780546001600160a01b031916815560006001820155600201614254565b60006020828403121561428b57600080fd5b81356001600160e01b03198116811461152d57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156142db576142db6142a3565b60405290565b604080519081016001600160401b03811182821017156142db576142db6142a3565b60405160a081016001600160401b03811182821017156142db576142db6142a3565b604051601f8201601f191681016001600160401b038111828210171561434d5761434d6142a3565b604052919050565b80151581146124f257600080fd5b6001600160a01b03811681146124f257600080fd5b60006001600160401b03821115614391576143916142a3565b5060051b60200190565b61ffff811681146124f257600080fd5b600082601f8301126143bc57600080fd5b813560206143d16143cc83614378565b614325565b828152606092830285018201928282019190878511156143f057600080fd5b8387015b858110156144495781818a03121561440c5760008081fd5b6144146142b9565b813561441f81614363565b815281860135868201526040808301356144388161439b565b9082015284529284019281016143f4565b5090979650505050505050565b60006020828403121561446857600080fd5b81356001600160401b038082111561447f57600080fd5b9083019081850360c081121561449457600080fd5b61449c6142e1565b60a08212156144aa57600080fd5b6144b2614303565b915083358252602084013560208301526040840135604083015260608401356144da81614355565b606083015260808401356144ed81614363565b608083015290815260a0830135908282111561450857600080fd5b614514878386016143ab565b60208201529695505050505050565b60006080828403121561453557600080fd5b50919050565b600080600083850360e081121561455157600080fd5b61455b8686614523565b9350608085013592506040609f198201121561457657600080fd5b5060a0840190509250925092565b6000806040838503121561459757600080fd5b82356145a281614363565b946020939093013593505050565b60008083601f8401126145c257600080fd5b5081356001600160401b038111156145d957600080fd5b6020830191508360208260061b85010111156145f457600080fd5b9250929050565b600080600060a0848603121561461057600080fd5b61461a8585614523565b925060808401356001600160401b0381111561463557600080fd5b614641868287016145b0565b9497909650939450505050565b60006001600160401b03831115614667576146676142a3565b61467a601f8401601f1916602001614325565b905082815283838301111561468e57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126146b657600080fd5b61152d8383356020850161464e565b600080600080608085870312156146db57600080fd5b84356146e681614363565b935060208501356146f681614363565b92506040850135915060608501356001600160401b0381111561471857600080fd5b614724878288016146a5565b91505092959194509250565b60006020828403121561474257600080fd5b813561152d81614363565b60008060008060008060c0878903121561476657600080fd5b86359550602087013594506040870135935060608701359250608087013561478d81614355565b915060a087013561479d81614363565b809150509295509295509295565b600881106124f257600080fd5b600081830360808112156147cb57600080fd5b6147d36142b9565b915060408112156147e357600080fd5b506147ec6142e1565b82356147f7816147ab565b8152602083013561480781614363565b8060208301525080825250604082013560208201526060820135604082015292915050565b60008060008060c0858703121561484257600080fd5b8435935061485386602087016147b8565b925060a08501356001600160401b0381111561486e57600080fd5b61487a878288016145b0565b95989497509550505050565b815181526020808301519082015260408101610a64565b6000608082840312156148af57600080fd5b61152d83836147b8565b60008083601f8401126148cb57600080fd5b5081356001600160401b038111156148e257600080fd5b6020830191508360208285010111156145f457600080fd5b60008060008060008060a0878903121561491357600080fd5b86356001600160401b0381111561492957600080fd5b61493589828a016148b9565b909750955050602087013561494981614363565b93506040870135925060608701359150608087013561479d81614363565b60006020828403121561497957600080fd5b5035919050565b600080600080600060e0868803121561499857600080fd5b6149a287876147b8565b945060808601356149b281614363565b935060a08601356149c281614363565b925060c08601356001600160401b038111156149dd57600080fd5b6149e9888289016148b9565b969995985093965092949392505050565b634e487b7160e01b600052602160045260246000fd5b600881106124f257634e487b7160e01b600052602160045260246000fd5b60408082528351828201819052600091906020906060850190828801855b82811015614a7f57815180516001600160a01b031685526020908101519085015260408401935090840190600101614a4c565b5050508481038286015285518082528683019183019060005b81811015614aca5783518051614aad81614a10565b845285015161ffff16858401529284019291850191600101614a98565b509098975050505050505050565b600080600080600060a08688031215614af057600080fd5b85359450602086013593506040860135614b0981614363565b9250606086013591506080860135614b208161439b565b809150509295509295909350565b600060208284031215614b4057600080fd5b81356001600160401b03811115614b5657600080fd5b8201601f81018413614b6757600080fd5b610cb48482356020840161464e565b80518051614b8381614a10565b83526020908101516001600160a01b0316818401528101516040808401919091520151606090910152565b80516001600160a01b0316825260208082015160009160c0850191614bd582870182614b76565b50604084015160c060a087015280519283905281019160009060e08701905b80831015614c2b57845180516001600160a01b03168352602090810151908301526040820191508385019450600183019250614bf4565b509695505050505050565b600081518084526020808501808196508360051b8101915082860160005b85811015614c7e578284038952614c6c848351614bae565b98850198935090840190600101614c54565b5091979650505050505050565b60208152600060018060a01b0380845116602084015280602085015116604084015260408401516060840152606084015160808401528060808501511660a08401525060a083015160c080840152610cb460e0840182614c36565b60008060408385031215614cf957600080fd5b823591506020830135614d0b81614363565b809150509250929050565b60208152600061152d6020830184614bae565b600082601f830112614d3a57600080fd5b81356020614d4a6143cc83614378565b82815260059290921b84018101918181019086841115614d6957600080fd5b8286015b84811015614c2b5780358352918301918301614d6d565b60008060408385031215614d9757600080fd5b8235614da281614363565b915060208301356001600160401b03811115614dbd57600080fd5b614dc985828601614d29565b9150509250929050565b600081518084526020808501945080840160005b83811015614e0357815187529582019590820190600101614de7565b509495945050505050565b60208152600061152d6020830184614dd3565b600060208284031215614e3357600080fd5b813561152d81614355565b600080600080600060a08688031215614e5657600080fd5b8535614e6181614363565b94506020860135614e7181614363565b935060408601356001600160401b0380821115614e8d57600080fd5b614e9989838a01614d29565b94506060880135915080821115614eaf57600080fd5b614ebb89838a01614d29565b93506080880135915080821115614ed157600080fd5b50614ede888289016146a5565b9150509295509295909350565b6000806000806000806101008789031215614f0557600080fd5b614f0f8888614523565b95506080870135945060a0870135614f2681614363565b935060c0870135614f3681614363565b925060e08701356001600160401b03811115614f5157600080fd5b614f5d89828a016148b9565b979a9699509497509295939492505050565b600060808284031215614f8157600080fd5b61152d8383614523565b60008060408385031215614f9e57600080fd5b50508035926020909101359150565b60008060008060608587031215614fc357600080fd5b843593506020808601356001600160401b0380821115614fe257600080fd5b818801915088601f830112614ff657600080fd5b81356150046143cc82614378565b81815260079190911b8301840190848101908b83111561502357600080fd5b938501935b8285101561504c5761503a8c866147b8565b82528582019150608085019450615028565b97505050604088013592508083111561506457600080fd5b505061487a878288016145b0565b602080825282518282018190526000919060409081850190868401855b82811015614c7e576150ac84835180518252602090810151910152565b928401929085019060010161508f565b60208152600061152d6020830184614c36565b600080600080600060a086880312156150e757600080fd5b85356150f281614363565b9450602086013561510281614363565b9350604086013592506060860135915060808601356001600160401b0381111561512b57600080fd5b614ede888289016146a5565b6000806000806080858703121561514d57600080fd5b84359350602085013561515f81614363565b92506040850135915060608501356151768161439b565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156151a957600080fd5b815161152d81614355565b60005b838110156151cf5781810151838201526020016151b7565b50506000910152565b60208152600082518060208401526151f78160408501602087016151b4565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610a6457610a6461520b565b6000600182016152465761524661520b565b5060010190565b81810381811115610a6457610a6461520b565b8082028115828204841417610a6457610a6461520b565b60008261529457634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602b908201527f496e73756666696369656e742062616c616e6365206166746572207061796d6560408201526a373a103a3930b739b332b960a91b606082015260800190565b60a0810183356152f3816147ab565b6152fc81614a10565b8252602084013561530c81614363565b60018060a01b0380821660208501526040860135604085015260608601356060850152808516608085015250509392505050565b634e487b7160e01b600052603160045260246000fd5b60208082526021908201527f4f6e6c7920646973706c6179206f776e65722063616e206164642061646d696e6040820152607360f81b606082015260800190565b602080825282518051838301528082015160408085019190915280820151606080860191909152808301511515608080870191909152909201516001600160a01b0390811660a08601528584015160c080870152805160e08701819052600095949185019386939290916101008901905b8086101561543f578651805186168352888101518984015284015161ffff1684830152958701956001959095019490820190615408565b509998505050505050505050565b60006020828403121561545f57600080fd5b5051919050565b813561547181614363565b81546001600160a01b0319166001600160a01b03919091161781556020919091013560019190910155565b600080604083850312156154af57600080fd5b82516154ba81614355565b6020840151909250614d0b81614355565b6000602082840312156154dd57600080fd5b815161152d81614363565b60808101610a648284614b76565b858152602081018590526001600160a01b03841660408201526080606082018190528101829052818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b6000602080838503121561555857600080fd5b82516001600160401b0381111561556e57600080fd5b8301601f8101851361557f57600080fd5b805161558d6143cc82614378565b81815260069190911b820183019083810190878311156155ac57600080fd5b928401925b8284101561411557604084890312156155ca5760008081fd5b6155d26142e1565b84516155dd81614363565b815284860151868201528252604090930192908401906155b1565b60e081016156068287614b76565b6001600160a01b0394851660808301529290931660a084015260c090920191909152919050565b6000602080838503121561564057600080fd5b82516001600160401b0381111561565657600080fd5b8301601f8101851361566757600080fd5b80516156756143cc82614378565b81815260069190911b8201830190838101908783111561569457600080fd5b928401925b8284101561411557604084890312156156b25760008081fd5b6156ba6142e1565b84516156c5816147ab565b8152848601516156d48161439b565b8187015282526040939093019290840190615699565b6001600160a01b0383168152604060208201819052600090610cb490830184614dd3565b6000602080838503121561572157600080fd5b82516001600160401b0381111561573757600080fd5b8301601f8101851361574857600080fd5b80516157566143cc82614378565b81815260059190911b8201830190838101908783111561577557600080fd5b928401925b828410156141155783518252928401929084019061577a565b600082516157a58184602087016151b4565b919091019291505056fea2646970667358221220df177ff60f201682d4cabb921c155fd943e0df84f9e6cd829d2c08e9af42b05164736f6c6343000815003300000000000000000000000068247df83d594af6332bf901a5ff8c3448622774000000000000000000000000303cd2a927d9cb6f5ce03b88a4e3e2528baedf40
Deployed Bytecode
0x6080604052600436106102ae5760003560e01c8063864438fb11610175578063bc197c81116100dc578063d7fe513d11610095578063f23a6e611161006f578063f23a6e61146109a7578063f2fde38b146109d3578063f8903c24146109f3578063fb8adca414610a1357600080fd5b8063d7fe513d1461093a578063dbf9224014610967578063dc39b11f1461098757600080fd5b8063bc197c811461086e578063bffe185a1461089a578063c7eecb75146108ad578063caaf137f146108cd578063d52b4038146108ed578063d556ae961461091a57600080fd5b80639e6c29591161012e5780639e6c2959146107a05780639ec30e4a146107b6578063a3fafd05146107d6578063abba145b14610803578063b1d065f714610823578063ba5aa3f21461085957600080fd5b8063864438fb146106cd5780638d69e95e146106fa5780638da5cb5b1461071a5780638def98d61461073857806390b734581461075857806397d757761461078557600080fd5b80632f85b0ae11610219578063596b2bcc116101d2578063596b2bcc1461062f57806362d444721461064f5780636aa633b614610677578063715018a61461069857806378451d00146102e857806382b710e9146106ad57600080fd5b80632f85b0ae146104f557806339e899ee146105155780633c727f49146105355780633f62c00e1461055557806346d5b1c9146105e15780635751869b1461060f57600080fd5b80631e9d48cf1161026b5780631e9d48cf146103e55780631f16aef31461041c5780631f7b8b7b1461043c57806320da717014610469578063299b2660146104a15780632eeb42b3146104c157600080fd5b806301ffc9a7146102b35780630c5620d6146102e85780630c7b1c13146103165780630ca9f90314610338578063140cf1921461038c578063150b7a02146103ac575b600080fd5b3480156102bf57600080fd5b506102d36102ce366004614279565b610a33565b60405190151581526020015b60405180910390f35b3480156102f457600080fd5b50610308610303366004614456565b610a6a565b6040519081526020016102df565b34801561032257600080fd5b5061033661033136600461453b565b610a7d565b005b34801561034457600080fd5b50610377610353366004614584565b60036020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016102df565b34801561039857600080fd5b506103366103a73660046145fb565b610bb7565b3480156103b857600080fd5b506103cc6103c73660046146c5565b610cab565b6040516001600160e01b031990911681526020016102df565b3480156103f157600080fd5b50610405610400366004614730565b610cbc565b6040805192151583529015156020830152016102df565b34801561042857600080fd5b5061033661043736600461474d565b610cd1565b34801561044857600080fd5b5061045c61045736600461482c565b610cef565b6040516102df9190614886565b34801561047557600080fd5b50600554610489906001600160a01b031681565b6040516001600160a01b0390911681526020016102df565b3480156104ad57600080fd5b5061045c6104bc36600461489d565b610f0c565b3480156104cd57600080fd5b506103087f0b6fa5fd572a777383d3c573d07a54a7f90effe232d6da72acb8d30c0ba8a93d81565b34801561050157600080fd5b506103366105103660046148fa565b61103c565b34801561052157600080fd5b50610336610530366004614730565b61117c565b34801561054157600080fd5b50600754610489906001600160a01b031681565b34801561056157600080fd5b506105ad610570366004614967565b6001602081905260009182526040909120805491810154600282015460038301546004909301546001600160a01b03948516949283169391921685565b604080516001600160a01b03968716815294861660208601528401929092526060830152909116608082015260a0016102df565b3480156105ed57600080fd5b506106016105fc366004614980565b6111a6565b6040516102df929190614a2e565b34801561061b57600080fd5b5061033661062a366004614ad8565b611201565b34801561063b57600080fd5b5061033661064a366004614584565b61121d565b34801561065b57600080fd5b50610489732536fe9ab3f511540f2f9e2ec2a805005c3dd80081565b34801561068357600080fd5b506005546102d390600160a01b900460ff1681565b3480156106a457600080fd5b506103366112d6565b3480156106b957600080fd5b506103086106c8366004614b2e565b6112ea565b3480156106d957600080fd5b506106ed6106e8366004614967565b61131a565b6040516102df9190614c8b565b34801561070657600080fd5b50600454610489906001600160a01b031681565b34801561072657600080fd5b506006546001600160a01b0316610489565b34801561074457600080fd5b506102d3610753366004614ce6565b611521565b34801561076457600080fd5b5061077861077336600461489d565b611534565b6040516102df9190614d16565b34801561079157600080fd5b506104896002604360981b0181565b3480156107ac57600080fd5b5061030861271081565b3480156107c257600080fd5b506103366107d1366004614730565b6116d6565b3480156107e257600080fd5b506107f66107f1366004614d84565b611700565b6040516102df9190614e0e565b34801561080f57600080fd5b5061033661081e366004614e21565b611714565b34801561082f57600080fd5b5061048961083e366004614967565b6000908152600160205260409020546001600160a01b031690565b34801561086557600080fd5b50610308600081565b34801561087a57600080fd5b506103cc610889366004614e3e565b63bc197c8160e01b95945050505050565b6103366108a8366004614eeb565b61173a565b3480156108b957600080fd5b506103366108c8366004614f6f565b611d13565b3480156108d957600080fd5b506103366108e8366004614f8b565b611eb3565b3480156108f957600080fd5b5061090d610908366004614fad565b611fc1565b6040516102df9190615072565b34801561092657600080fd5b50610336610935366004614ce6565b61208f565b34801561094657600080fd5b5061095a610955366004614967565b61214b565b6040516102df91906150bc565b34801561097357600080fd5b50610336610982366004614f6f565b6122bc565b34801561099357600080fd5b506104896109a2366004614f8b565b612444565b3480156109b357600080fd5b506103cc6109c23660046150cf565b63f23a6e6160e01b95945050505050565b3480156109df57600080fd5b506103366109ee366004614730565b61247c565b3480156109ff57600080fd5b506102d3610a0e366004614ce6565b6124f5565b348015610a1f57600080fd5b50610308610a2e366004615137565b612501565b60006001600160e01b03198216630271189760e51b1480610a6457506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000610a74612520565b610a648261257a565b6000610a916104bc3686900386018661489d565b9050336001600160a01b03166001600083600001518152602001908152602001600020600501826020015181548110610acc57610acc615181565b60009182526020909120600590910201546001600160a01b031614610b515780516000908152600160205260409020546001600160a01b03163314610b515760405162461bcd60e51b815260206004820152601660248201527527b7363c903337b9103234b9b83630bc9037bbb732b960511b60448201526064015b60405180910390fd5b610b658160000151826020015185856125ed565b60408401803590610b799060208701614730565b82516040516001600160a01b0392909216917fe27d3d65f32610d390b50c9f6af70c0bfe910e5909c6ea9c91f2a8be3924af9290600090a450505050565b6000610bcb6104bc3686900386018661489d565b9050336001600160a01b03166001600083600001518152602001908152602001600020600501826020015181548110610c0657610c06615181565b60009182526020909120600590910201546001600160a01b031614610c975780516000908152600160205260409020546001600160a01b03163314610c975760405162461bcd60e51b815260206004820152602160248201527f4f6e6c7920646973706c6179206f776e65722063616e206564697420707269636044820152606560f81b6064820152608401610b48565b610b6581600001518260200151858561264f565b630a85bd0160e11b5b949350505050565b600080610cc8836126e4565b91509150915091565b610cd9612520565b610ce7868686868686612781565b505050505050565b6040805180820182526000808252602080830182905286518101516001600160a01b03168252600381528382208782015183528152908390208351808501909452805480855260019091015491840191909152909190158015610d5457506020810151155b610d955760405162461bcd60e51b8152602060048201526012602482015271416c726561647920617420646973706c617960701b6044820152606401610b48565b610da085333061280c565b85604001511115610e035760405162461bcd60e51b815260206004820152602760248201527f496e73756666696369656e742062616c616e6365206166746572204e465420746044820152663930b739b332b960c91b6064820152608401610b48565b6000868152600160205260409020546001600160a01b03163314610e9b577f0b6fa5fd572a777383d3c573d07a54a7f90effe232d6da72acb8d30c0ba8a93d8614610e9b5760405162461bcd60e51b815260206004820152602260248201527f4f6e6c792044656661756c7420446973706c617920616c6c6f7720666f7220616044820152616e7960f01b6064820152608401610b48565b610ea88633878787612e90565b915084602001518560000151602001516001600160a01b031683600001517fbebac2c3edec4f43f08e2877981bb81ddfa37d20a2f9ab5981f05761d16d004f8560200151604051610efb91815260200190565b60405180910390a450949350505050565b604080518082019091526000808252602082015260038251516007811115610f3657610f366149fa565b03610fa05730610f4583613063565b6001600160a01b031614610f9b5760405162461bcd60e51b815260206004820152601d60248201527f4173736574206e6f74207472616e73666572656420746f206b696f736b0000006044820152606401610b48565b610ff9565b6000610fac8330613180565b11610ff95760405162461bcd60e51b815260206004820152601d60248201527f4173736574206e6f74207472616e73666572656420746f206b696f736b0000006044820152606401610b48565b5080516020908101516001600160a01b03166000908152600382526040808220938301518252928252829020825180840190935280548352600101549082015290565b600754604051638e5f9ac560e01b81526001600160a01b03838116600483015290911690638e5f9ac590602401602060405180830381865afa158015611086573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110aa9190615197565b6110f65760405162461bcd60e51b815260206004820152601e60248201527f556e6578706563746564207072696365206d6f64656c206164647265737300006044820152606401610b48565b60006001600160a01b03166001600061114489898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506112ea92505050565b81526020810191909152604001600020546001600160a01b03160361116e5761116c33613308565b505b610ce7868686868686613395565b611184612520565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6060806111f38787876111ee88888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506112ea92505050565b6134fe565b915091509550959350505050565b611209612520565b6112168585858585613935565b5050505050565b6000818152600160205260409020546001600160a01b0316331461127c5760405162461bcd60e51b815260206004820152601660248201527527b7363c903337b9102234b9b83630bc9027bbb732b960511b6044820152606401610b48565b60008181526001602052604080822080546001600160a01b0319166001600160a01b03861690811790915590519091339184917f22c910a2dcce4230a03ebd4d4c2512b57da90f10d23745a22c8a37e16fb6939391a45050565b6112de612520565b6112e860006139ba565b565b6000816040516020016112fd91906151d8565b604051602081830303815290604052805190602001209050919050565b61136e6040518060c0016040528060006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160006001600160a01b03168152602001606081525090565b6000828152600160208181526040808420815160c08101835281546001600160a01b0390811682529482015485168185015260028201548184015260038201546060820152600482015490941660808501526005810180548351818602810186019094528084529495919460a08701949192909184015b8282101561151357600084815260209081902060408051606080820183526005870290930180546001600160a01b03168252825160a0810190935260018101805492959194918601939290918391908201908390829060ff16600781111561144f5761144f6149fa565b6007811115611460576114606149fa565b8152905461010090046001600160a01b031660209182015290825260018301548282015260029092015460409182015291835260048401805483518184028101840190945280845293820193909160009084015b828210156114fc576000848152602090819020604080518082019091526002850290910180546001600160a01b031682526001908101548284015290835290920191016114b4565b5050505081525050815260200190600101906113e5565b505050915250909392505050565b600061152d8383613a0c565b9392505050565b61157c60408051606080820183526000808352835160a08101855291820181815260808301829052825260208281018290529382015290918201908152602001606081525090565b600061158783610f0c565b905060016000826000015181526020019081526020016000206005018160200151815481106115b8576115b8615181565b60009182526020918290206040805160608082018352600590940290920180546001600160a01b03168352815160a08101909252600181018054939591949186019390918391908201908390829060ff16600781111561161a5761161a6149fa565b600781111561162b5761162b6149fa565b8152905461010090046001600160a01b031660209182015290825260018301548282015260029092015460409182015291835260048401805483518184028101840190945280845293820193909160009084015b828210156116c7576000848152602090819020604080518082019091526002850290910180546001600160a01b0316825260019081015482840152908352909201910161167f565b50505091525090949350505050565b6116de612520565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b606061170a612520565b61152d8383613acb565b61171c612520565b60058054911515600160a01b0260ff60a01b19909216919091179055565b611742613b45565b6040805160a0810182526000606082018181526080830182905282526020820181905291810182905290806117c061177f368b90038b018b61489d565b88886111ee89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506112ea92505050565b90925090506000805b8251811015611903578281815181106117e4576117e4615181565b60200260200101516020015161ffff16826117ff9190615221565b9150600183828151811061181557611815615181565b6020026020010151600001516007811115611832576118326149fa565b036118f357838a8151811061184957611849615181565b6020026020010151600001516001600160a01b0316336001600160a01b0316896001600160a01b03167fbe6f7c5115afd6431e5364f25028ab5075992833e68b41bb7e9cf9298b11c513878e815181106118a5576118a5615181565b6020026020010151602001518786815181106118c3576118c3615181565b6020026020010151602001516040516118ea92919091825261ffff16602082015260400190565b60405180910390a45b6118fc81615234565b90506117c9565b506040518060600160405280604051806040016040528060006001600160a01b0316878e8151811061193757611937615181565b6020026020010151600001516001600160a01b03161461195857600261195b565b60015b600781111561196c5761196c6149fa565b8152602001868d8151811061198357611983615181565b6020026020010151600001516001600160a01b03168152508152602001600081526020016127108c606001356000146119c0578c606001356119c3565b60015b6119cf8561271061524d565b878e815181106119e1576119e1615181565b6020026020010151602001516119f79190615260565b611a019190615260565b611a0b9190615277565b81525093505050506000806000611a2c8a8036038101906104bc919061489d565b8051909150611a91577f0b6fa5fd572a777383d3c573d07a54a7f90effe232d6da72acb8d30c0ba8a93d60008181526001602081815260408320808301548587528683018590529490935252600401546001600160a01b039182169450169150611ac3565b8051600090815260016020819052604080832090910154835183529120600401546001600160a01b0391821694501691505b805160009081526001602052604090206002015442118015611af8575080516000908152600160205260409020600301544211155b611b335760405162461bcd60e51b815260206004820152600c60248201526b4f6e6c7920696e2074696d6560a01b6044820152606401610b48565b8051611b3f9033613b9e565b611cf15760018451516007811115611b5957611b596149fa565b03611beb57611b6984308561280c565b84604001511115611b8c5760405162461bcd60e51b8152600401610b4890615299565b6000846040015134611b9e919061524d565b1115611be6576040840151339081906108fc90611bbb903461524d565b6040518115909202916000818181858888f19350505050158015611be3573d6000803e3d6000fd5b50505b611c5b565b3415611c2d5760405162461bcd60e51b81526020600482015260116024820152704f6e6c7920455243323020746f6b656e7360781b6044820152606401610b48565b611c3884338561280c565b84604001511115611c5b5760405162461bcd60e51b8152600401610b4890615299565b604051633c08a02f60e21b81526001600160a01b0383169063f02280bc90611c89908d908c906004016152e4565b6020604051808303816000875af1158015611ca8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ccc9190615197565b15611cec57611cea611ce3368c90038c018c61489d565b308a61280c565b505b611d05565b611d03611ce3368c90038c018c61489d565b505b50505050610ce76001600055565b6000611d276104bc3684900384018461489d565b9050336001600160a01b03166001600083600001518152602001908152602001600020600501826020015181548110611d6257611d62615181565b60009182526020909120600590910201546001600160a01b031614611de25780516000908152600160205260409020546001600160a01b03163314611de25760405162461bcd60e51b815260206004820152601660248201527527b7363c903337b9103234b9b83630bc9037bbb732b960511b6044820152606401610b48565b60006001600083600001518152602001908152602001600020600501826020015181548110611e1357611e13615181565b9060005260206000209060050201600401905080805480611e3657611e36615340565b6000828152602080822060026000199094019384020180546001600160a01b031916815560010191909155915560408401803591611e7691908601614730565b83516040516001600160a01b0392909216917fe27d3d65f32610d390b50c9f6af70c0bfe910e5909c6ea9c91f2a8be3924af9290600090a4505050565b6000828152600160205260409020546001600160a01b03163314611ee95760405162461bcd60e51b8152600401610b4890615356565b60008281526002602052604090208054611f059060019061524d565b8214611f8a5780548190611f1b9060019061524d565b81548110611f2b57611f2b615181565b9060005260206000200160009054906101000a90046001600160a01b0316818381548110611f5b57611f5b615181565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b80805480611f9a57611f9a615340565b600082815260209020810160001990810180546001600160a01b0319169055019055505050565b6060600084516001600160401b03811115611fde57611fde6142a3565b60405190808252806020026020018201604052801561202357816020015b6040805180820190915260008082526020820152815260200190600190039081611ffc5790505b50905060005b8551811015612085576120578787838151811061204857612048615181565b60200260200101518787610cef565b82828151811061206957612069615181565b60200260200101819052508061207e90615234565b9050612029565b5095945050505050565b6000828152600160205260409020546001600160a01b031633146120c55760405162461bcd60e51b8152600401610b4890615356565b6120cf8282613a0c565b1561210c5760405162461bcd60e51b815260206004820152600d60248201526c20b63932b0b23c9030b236b4b760991b6044820152606401610b48565b600091825260026020908152604083208054600181018255908452922090910180546001600160a01b0319166001600160a01b03909216919091179055565b606060016000838152602001908152602001600020600501805480602002602001604051908101604052809291908181526020016000905b828210156122b157600084815260209081902060408051606080820183526005870290930180546001600160a01b03168252825160a0810190935260018101805492959194918601939290918391908201908390829060ff1660078111156121ed576121ed6149fa565b60078111156121fe576121fe6149fa565b8152905461010090046001600160a01b031660209182015290825260018301548282015260029092015460409182015291835260048401805483518184028101840190945280845293820193909160009084015b8282101561229a576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101612252565b505050508152505081526020019060010190612183565b505050509050919050565b60006122d06104bc3684900384018461489d565b8051909150612304577f0b6fa5fd572a777383d3c573d07a54a7f90effe232d6da72acb8d30c0ba8a93d8152600060208201525b336001600160a01b0316600160008360000151815260200190815260200160002060050182602001518154811061233d5761233d615181565b60009182526020909120600590910201546001600160a01b0316148061237b575080516000908152600160205260409020546001600160a01b031633145b6123c75760405162461bcd60e51b815260206004820152601a60248201527f4f6e6c79204974656d206f776e65722063616e2072656d6f76650000000000006044820152606401610b48565b6123da8160000151826020015184613bc8565b6123f36123ec3684900384018461489d565b303361280c565b50604082018035906124089060208501614730565b82516040516001600160a01b0392909216917f0640a25b0e045d99b4dac93cd08c63e3c6803633e285b50f81ab66270fbbd56390600090a45050565b6002602052816000526040600020818154811061246057600080fd5b6000918252602090912001546001600160a01b03169150829050565b612484612520565b6001600160a01b0381166124e95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b48565b6124f2816139ba565b50565b600061152d8383613b9e565b600061250b612520565b61251785858585613e97565b95945050505050565b6006546001600160a01b031633146112e85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b48565b6005546040516278451d60e81b81526000916001600160a01b0316906378451d00906125aa908590600401615397565b6020604051808303816000875af11580156125c9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a64919061544d565b600084815260016020526040902060050180548291908590811061261357612613615181565b9060005260206000209060050201600401838154811061263557612635615181565b90600052602060002090600202018181610ce79190615466565b600084815260016020526040812060050180548590811061267257612672615181565b9060005260206000209060050201905060005b82811015610ce757816004018484838181106126a3576126a3615181565b8354600181018555600094855260209094206040909102929092019260020290910190506126d18282615466565b5050806126dd90615234565b9050612685565b6005546000908190600160a01b900460ff16156127785760055460405163496d511d60e11b81526001600160a01b038581166004830152306024830152909116906392daa23a906044016040805180830381865afa15801561274a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061276e919061549c565b9092509050915091565b60019150915091565b600554604051631f16aef360e01b81526004810188905260248101879052604481018690526064810185905283151560848201526001600160a01b0383811660a483015290911690631f16aef39060c401600060405180830381600087803b1580156127ec57600080fd5b505af1158015612800573d6000803e3d6000fd5b50505050505050505050565b60008060018551516007811115612825576128256149fa565b036128df575060408085015190516001600160a01b0384168031926000928381818185875af1925050503d806000811461287b576040519150601f19603f3d011682016040523d82523d6000602084013e612880565b606091505b50509050806128c35760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b6044820152606401610b48565b6128d7826001600160a01b0386163161524d565b925050612e88565b600285515160078111156128f5576128f56149fa565b03612a4b578451602001516040516370a0823160e01b81526001600160a01b038581166004830152909116906370a0823190602401602060405180830381865afa158015612947573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061296b919061544d565b9050306001600160a01b038516036129a457604085015185516020015161299f916001600160a01b03909116908590613f20565b6129c8565b60408501518551602001516129c8916001600160a01b039091169086908690613f88565b8451602001516040516370a0823160e01b81526001600160a01b038581166004830152839216906370a08231906024015b602060405180830381865afa158015612a16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a3a919061544d565b612a44919061524d565b9150612e88565b60038551516007811115612a6157612a616149fa565b148015612aed57508451602090810151908601516040516331a9108f60e11b815260048101919091526001600160a01b03868116921690636352211e90602401602060405180830381865afa158015612abe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae291906154cb565b6001600160a01b0316145b15612d00578451602001516040516370a0823160e01b81526001600160a01b038581166004830152909116906370a0823190602401602060405180830381865afa158015612b3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b63919061544d565b8551602090810151908701516040516323b872dd60e01b81526001600160a01b0388811660048301528781166024830152604482019290925292935016906323b872dd90606401600060405180830381600087803b158015612bc457600080fd5b505af1158015612bd8573d6000803e3d6000fd5b50505050826001600160a01b03168560000151602001516001600160a01b0316636352211e87602001516040518263ffffffff1660e01b8152600401612c2091815260200190565b602060405180830381865afa158015612c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c6191906154cb565b6001600160a01b0316148015612cf157508451602001516040516370a0823160e01b81526001600160a01b038581166004830152839216906370a0823190602401602060405180830381865afa158015612cbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ce3919061544d565b612ced919061524d565b6001145b15612cfb57600191505b612e88565b60048551516007811115612d1657612d166149fa565b03612e6d57845160209081015190860151604051627eeac760e11b81526001600160a01b038681166004830152602482019290925291169062fdd58e90604401602060405180830381865afa158015612d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d97919061544d565b8551602090810151908701516040808901519051637921219560e11b81526001600160a01b03898116600483015288811660248301526044820193909352606481019190915260a06084820152600060a4820152929350169063f242432a9060c401600060405180830381600087803b158015612e1357600080fd5b505af1158015612e27573d6000803e3d6000fd5b5050865160209081015190880151604051627eeac760e11b81526001600160a01b03888116600483015260248201929092528594509116915062fdd58e906044016129f9565b8460405163391102fb60e01b8152600401610b4891906154e8565b509392505050565b60408051808201909152600080825260208201526000868152600160208181526040832060059081018054808501825590855291909320920290910180546001600160a01b0319166001600160a01b0388161781558551805182840180549394899491939284929091839160ff191690836007811115612f1257612f126149fa565b021790555060209182015181546001600160a01b0390911661010002610100600160a81b031990911617905582015160018201556040909101516002909101558215612fbc5760005b83811015612fba5781600401858583818110612f7957612f79615181565b835460018101855560009485526020909420604090910292909201926002029091019050612fa78282615466565b505080612fb390615234565b9050612f5b565b505b60408051808201825288815260008981526001602081815293909120600501549192830191612feb919061524d565b905285516020908101516001600160a01b03908116600090815260038084526040808320858c018051855290865281842087518155968601516001978801559a518501519093168252835281812098518152978252968790208751808901909852805488529091015490860152509295945050505050565b60006001825151600781111561307b5761307b6149fa565b0361308857506000919050565b6002825151600781111561309e5761309e6149fa565b036130ab57506000919050565b600382515160078111156130c1576130c16149fa565b03613142578151602090810151908301516040516331a9108f60e11b81526001600160a01b0390921691636352211e916131019160040190815260200190565b602060405180830381865afa15801561311e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6491906154cb565b60048251516007811115613158576131586149fa565b0361316557506000919050565b8160405163391102fb60e01b8152600401610b4891906154e8565b600060018351516007811115613198576131986149fa565b036131ae57506001600160a01b03811631610a64565b600283515160078111156131c4576131c46149fa565b03613242578251602001516040516370a0823160e01b81526001600160a01b038481166004830152909116906370a08231906024015b602060405180830381865afa158015613217573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061323b919061544d565b9050610a64565b60038351516007811115613258576132586149fa565b03613292578251602001516040516370a0823160e01b81526001600160a01b038481166004830152909116906370a08231906024016131fa565b600483515160078111156132a8576132a86149fa565b036132ed57825160209081015190840151604051627eeac760e11b81526001600160a01b038581166004830152602482019290925291169062fdd58e906044016131fa565b8260405163391102fb60e01b8152600401610b4891906154e8565b600554600090600160a01b900460ff161561338d57600554604051632e5f2cf160e01b81526001600160a01b03848116600483015290911690632e5f2cf1906024016020604051808303816000875af1158015613369573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a649190615197565b506001919050565b60006133d687878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506112ea92505050565b6000818152600160205260409020549091506001600160a01b031633148061341357506000818152600160205260409020546001600160a01b0316155b6134585760405162461bcd60e51b815260206004820152601660248201527527b7363c903337b9102234b9b83630bc9027bbb732b960511b6044820152606401610b48565b6000818152600160208190526040918290208054336001600160a01b03199182168117835592820180546001600160a01b038b81169184168217909255600284018a9055600384018990556004909301805491881691909216179055915183907f4af8e278eab954a95814248126e9442f4b93f859428b736d603382314e14ac89906134ed908990899089908f908f906154f6565b60405180910390a450505050505050565b606080600061350c87610f0c565b805190915015801561352057506020810151155b15613681577f0b6fa5fd572a777383d3c573d07a54a7f90effe232d6da72acb8d30c0ba8a93d600090815260016020526040908190206004908101549151631ddd707b60e31b81526001600160a01b039092169163eeeb83d891613586918b91016154e8565b600060405180830381865afa1580156135a3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526135cb9190810190615545565b7f0b6fa5fd572a777383d3c573d07a54a7f90effe232d6da72acb8d30c0ba8a93d600090815260016020526040908190206004908101549151632d15a65360e21b81526001600160a01b039092169163b456994c91613632918c918c918c918c91016155f8565b600060405180830381865afa15801561364f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613677919081019061562d565b925092505061392c565b600060016000836000015181526020019081526020016000206005018260200151815481106136b2576136b2615181565b90600052602060002090600502016004018054905011156138125760016000826000015181526020019081526020016000206005018160200151815481106136fc576136fc615181565b600091825260208083208451845260019091526040928390206004908101549351632d15a65360e21b815260059093029091018101926001600160a01b03169163b456994c91613754918c918c918c918c91016155f8565b600060405180830381865afa158015613771573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613799919081019061562d565b81805480602002602001604051908101604052809291908181526020016000905b82821015613802576000848152602090819020604080518082019091526002850290910180546001600160a01b031682526001908101548284015290835290920191016137ba565b505050509150925092505061392c565b8051600090815260016020526040908190206004908101549151631ddd707b60e31b81526001600160a01b039092169163eeeb83d891613854918b91016154e8565b600060405180830381865afa158015613871573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526138999190810190615545565b8151600090815260016020526040908190206004908101549151632d15a65360e21b81526001600160a01b039092169163b456994c916138e1918c918c918c918c91016155f8565b600060405180830381865afa1580156138fe573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613926919081019061562d565b92509250505b94509492505050565b60055460405163650aac6160e01b815260048101879052602481018690526001600160a01b0385811660448301526064820185905261ffff841660848301529091169063650aac619060a401600060405180830381600087803b15801561399b57600080fd5b505af11580156139af573d6000803e3d6000fd5b505050505050505050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600082815260026020908152604080832080548251818502810185019093528083528493830182828015613a6957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613a4b575b5050505050905060005b8151811015613ac357836001600160a01b0316828281518110613a9857613a98615181565b60200260200101516001600160a01b031603613ab357600192505b613abc81615234565b9050613a73565b505092915050565b60055460405163a3fafd0560e01b81526060916001600160a01b03169063a3fafd0590613afe90869086906004016156ea565b6000604051808303816000875af1158015613b1d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261152d919081019061570e565b600260005403613b975760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b48565b6002600055565b6000828152600160205260408120546001600160a01b03808416911603610a645750600192915050565b600083815260016020819052604090912060050154613be7919061524d565b8214613dd957600083815260016020819052604090912060050180549091613c0e9161524d565b81548110613c1e57613c1e615181565b9060005260206000209060050201600160008581526020019081526020016000206005018381548110613c5357613c53615181565b60009182526020909120825460059092020180546001600160a01b0319166001600160a01b03909216919091178155600180830180548284018054929390928492849260ff90911691839160ff1990911690836007811115613cb757613cb76149fa565b021790555090548154610100600160a81b031916610100918290046001600160a01b03169091021790556001828101549082015560029182015491015560048281018054613d0892840191906141be565b5090505060405180604001604052808481526020018381525060036000600160008781526020019081526020016000206005018581548110613d4c57613d4c615181565b6000918252602080832060059283020160019081015461010090046001600160a01b031685528482019590955260409384018320898452949052918120909101805486908110613d9e57613d9e615181565b906000526020600020906005020160010160010154815260200190815260200160002060008201518160000155602082015181600101559050505b6000838152600160205260409020600501805480613df957613df9615340565b60008281526020812060056000199093019283020180546001600160a01b03191681556001810180546001600160a81b0319169055600281018290556003810182905590613e4a6004830182614236565b5050905560036000613e626040840160208501614730565b6001600160a01b0316815260208082019290925260409081016000908120938201358152929091528120818155600101555050565b600554604051639aab948160e01b8152600481018690526001600160a01b0385811660248301526044820185905261ffff841660648301526000921690639aab9481906084016020604051808303816000875af1158015613efc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612517919061544d565b6040516001600160a01b038316602482015260448101829052613f8390849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613fc6565b505050565b6040516001600160a01b0380851660248301528316604482015260648101829052613fc09085906323b872dd60e01b90608401613f4c565b50505050565b600061401b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661409b9092919063ffffffff16565b905080516000148061403c57508080602001905181019061403c9190615197565b613f835760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b48565b6060610cb4848460008585600080866001600160a01b031685876040516140c29190615793565b60006040518083038185875af1925050503d80600081146140ff576040519150601f19603f3d011682016040523d82523d6000602084013e614104565b606091505b509150915061411587838387614120565b979650505050505050565b6060831561418f578251600003614188576001600160a01b0385163b6141885760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b48565b5081610cb4565b610cb483838151156141a45781518083602001fd5b8060405162461bcd60e51b8152600401610b4891906151d8565b8280548282559060005260206000209060020281019282156142265760005260206000209160020282015b8281111561422657825482546001600160a01b0319166001600160a01b0390911617825560018084015490830155600292830192909101906141e9565b50614232929150614253565b5090565b50805460008255600202906000526020600020908101906124f291905b5b808211156142325780546001600160a01b031916815560006001820155600201614254565b60006020828403121561428b57600080fd5b81356001600160e01b03198116811461152d57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156142db576142db6142a3565b60405290565b604080519081016001600160401b03811182821017156142db576142db6142a3565b60405160a081016001600160401b03811182821017156142db576142db6142a3565b604051601f8201601f191681016001600160401b038111828210171561434d5761434d6142a3565b604052919050565b80151581146124f257600080fd5b6001600160a01b03811681146124f257600080fd5b60006001600160401b03821115614391576143916142a3565b5060051b60200190565b61ffff811681146124f257600080fd5b600082601f8301126143bc57600080fd5b813560206143d16143cc83614378565b614325565b828152606092830285018201928282019190878511156143f057600080fd5b8387015b858110156144495781818a03121561440c5760008081fd5b6144146142b9565b813561441f81614363565b815281860135868201526040808301356144388161439b565b9082015284529284019281016143f4565b5090979650505050505050565b60006020828403121561446857600080fd5b81356001600160401b038082111561447f57600080fd5b9083019081850360c081121561449457600080fd5b61449c6142e1565b60a08212156144aa57600080fd5b6144b2614303565b915083358252602084013560208301526040840135604083015260608401356144da81614355565b606083015260808401356144ed81614363565b608083015290815260a0830135908282111561450857600080fd5b614514878386016143ab565b60208201529695505050505050565b60006080828403121561453557600080fd5b50919050565b600080600083850360e081121561455157600080fd5b61455b8686614523565b9350608085013592506040609f198201121561457657600080fd5b5060a0840190509250925092565b6000806040838503121561459757600080fd5b82356145a281614363565b946020939093013593505050565b60008083601f8401126145c257600080fd5b5081356001600160401b038111156145d957600080fd5b6020830191508360208260061b85010111156145f457600080fd5b9250929050565b600080600060a0848603121561461057600080fd5b61461a8585614523565b925060808401356001600160401b0381111561463557600080fd5b614641868287016145b0565b9497909650939450505050565b60006001600160401b03831115614667576146676142a3565b61467a601f8401601f1916602001614325565b905082815283838301111561468e57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126146b657600080fd5b61152d8383356020850161464e565b600080600080608085870312156146db57600080fd5b84356146e681614363565b935060208501356146f681614363565b92506040850135915060608501356001600160401b0381111561471857600080fd5b614724878288016146a5565b91505092959194509250565b60006020828403121561474257600080fd5b813561152d81614363565b60008060008060008060c0878903121561476657600080fd5b86359550602087013594506040870135935060608701359250608087013561478d81614355565b915060a087013561479d81614363565b809150509295509295509295565b600881106124f257600080fd5b600081830360808112156147cb57600080fd5b6147d36142b9565b915060408112156147e357600080fd5b506147ec6142e1565b82356147f7816147ab565b8152602083013561480781614363565b8060208301525080825250604082013560208201526060820135604082015292915050565b60008060008060c0858703121561484257600080fd5b8435935061485386602087016147b8565b925060a08501356001600160401b0381111561486e57600080fd5b61487a878288016145b0565b95989497509550505050565b815181526020808301519082015260408101610a64565b6000608082840312156148af57600080fd5b61152d83836147b8565b60008083601f8401126148cb57600080fd5b5081356001600160401b038111156148e257600080fd5b6020830191508360208285010111156145f457600080fd5b60008060008060008060a0878903121561491357600080fd5b86356001600160401b0381111561492957600080fd5b61493589828a016148b9565b909750955050602087013561494981614363565b93506040870135925060608701359150608087013561479d81614363565b60006020828403121561497957600080fd5b5035919050565b600080600080600060e0868803121561499857600080fd5b6149a287876147b8565b945060808601356149b281614363565b935060a08601356149c281614363565b925060c08601356001600160401b038111156149dd57600080fd5b6149e9888289016148b9565b969995985093965092949392505050565b634e487b7160e01b600052602160045260246000fd5b600881106124f257634e487b7160e01b600052602160045260246000fd5b60408082528351828201819052600091906020906060850190828801855b82811015614a7f57815180516001600160a01b031685526020908101519085015260408401935090840190600101614a4c565b5050508481038286015285518082528683019183019060005b81811015614aca5783518051614aad81614a10565b845285015161ffff16858401529284019291850191600101614a98565b509098975050505050505050565b600080600080600060a08688031215614af057600080fd5b85359450602086013593506040860135614b0981614363565b9250606086013591506080860135614b208161439b565b809150509295509295909350565b600060208284031215614b4057600080fd5b81356001600160401b03811115614b5657600080fd5b8201601f81018413614b6757600080fd5b610cb48482356020840161464e565b80518051614b8381614a10565b83526020908101516001600160a01b0316818401528101516040808401919091520151606090910152565b80516001600160a01b0316825260208082015160009160c0850191614bd582870182614b76565b50604084015160c060a087015280519283905281019160009060e08701905b80831015614c2b57845180516001600160a01b03168352602090810151908301526040820191508385019450600183019250614bf4565b509695505050505050565b600081518084526020808501808196508360051b8101915082860160005b85811015614c7e578284038952614c6c848351614bae565b98850198935090840190600101614c54565b5091979650505050505050565b60208152600060018060a01b0380845116602084015280602085015116604084015260408401516060840152606084015160808401528060808501511660a08401525060a083015160c080840152610cb460e0840182614c36565b60008060408385031215614cf957600080fd5b823591506020830135614d0b81614363565b809150509250929050565b60208152600061152d6020830184614bae565b600082601f830112614d3a57600080fd5b81356020614d4a6143cc83614378565b82815260059290921b84018101918181019086841115614d6957600080fd5b8286015b84811015614c2b5780358352918301918301614d6d565b60008060408385031215614d9757600080fd5b8235614da281614363565b915060208301356001600160401b03811115614dbd57600080fd5b614dc985828601614d29565b9150509250929050565b600081518084526020808501945080840160005b83811015614e0357815187529582019590820190600101614de7565b509495945050505050565b60208152600061152d6020830184614dd3565b600060208284031215614e3357600080fd5b813561152d81614355565b600080600080600060a08688031215614e5657600080fd5b8535614e6181614363565b94506020860135614e7181614363565b935060408601356001600160401b0380821115614e8d57600080fd5b614e9989838a01614d29565b94506060880135915080821115614eaf57600080fd5b614ebb89838a01614d29565b93506080880135915080821115614ed157600080fd5b50614ede888289016146a5565b9150509295509295909350565b6000806000806000806101008789031215614f0557600080fd5b614f0f8888614523565b95506080870135945060a0870135614f2681614363565b935060c0870135614f3681614363565b925060e08701356001600160401b03811115614f5157600080fd5b614f5d89828a016148b9565b979a9699509497509295939492505050565b600060808284031215614f8157600080fd5b61152d8383614523565b60008060408385031215614f9e57600080fd5b50508035926020909101359150565b60008060008060608587031215614fc357600080fd5b843593506020808601356001600160401b0380821115614fe257600080fd5b818801915088601f830112614ff657600080fd5b81356150046143cc82614378565b81815260079190911b8301840190848101908b83111561502357600080fd5b938501935b8285101561504c5761503a8c866147b8565b82528582019150608085019450615028565b97505050604088013592508083111561506457600080fd5b505061487a878288016145b0565b602080825282518282018190526000919060409081850190868401855b82811015614c7e576150ac84835180518252602090810151910152565b928401929085019060010161508f565b60208152600061152d6020830184614c36565b600080600080600060a086880312156150e757600080fd5b85356150f281614363565b9450602086013561510281614363565b9350604086013592506060860135915060808601356001600160401b0381111561512b57600080fd5b614ede888289016146a5565b6000806000806080858703121561514d57600080fd5b84359350602085013561515f81614363565b92506040850135915060608501356151768161439b565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156151a957600080fd5b815161152d81614355565b60005b838110156151cf5781810151838201526020016151b7565b50506000910152565b60208152600082518060208401526151f78160408501602087016151b4565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610a6457610a6461520b565b6000600182016152465761524661520b565b5060010190565b81810381811115610a6457610a6461520b565b8082028115828204841417610a6457610a6461520b565b60008261529457634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602b908201527f496e73756666696369656e742062616c616e6365206166746572207061796d6560408201526a373a103a3930b739b332b960a91b606082015260800190565b60a0810183356152f3816147ab565b6152fc81614a10565b8252602084013561530c81614363565b60018060a01b0380821660208501526040860135604085015260608601356060850152808516608085015250509392505050565b634e487b7160e01b600052603160045260246000fd5b60208082526021908201527f4f6e6c7920646973706c6179206f776e65722063616e206164642061646d696e6040820152607360f81b606082015260800190565b602080825282518051838301528082015160408085019190915280820151606080860191909152808301511515608080870191909152909201516001600160a01b0390811660a08601528584015160c080870152805160e08701819052600095949185019386939290916101008901905b8086101561543f578651805186168352888101518984015284015161ffff1684830152958701956001959095019490820190615408565b509998505050505050505050565b60006020828403121561545f57600080fd5b5051919050565b813561547181614363565b81546001600160a01b0319166001600160a01b03919091161781556020919091013560019190910155565b600080604083850312156154af57600080fd5b82516154ba81614355565b6020840151909250614d0b81614355565b6000602082840312156154dd57600080fd5b815161152d81614363565b60808101610a648284614b76565b858152602081018590526001600160a01b03841660408201526080606082018190528101829052818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b6000602080838503121561555857600080fd5b82516001600160401b0381111561556e57600080fd5b8301601f8101851361557f57600080fd5b805161558d6143cc82614378565b81815260069190911b820183019083810190878311156155ac57600080fd5b928401925b8284101561411557604084890312156155ca5760008081fd5b6155d26142e1565b84516155dd81614363565b815284860151868201528252604090930192908401906155b1565b60e081016156068287614b76565b6001600160a01b0394851660808301529290931660a084015260c090920191909152919050565b6000602080838503121561564057600080fd5b82516001600160401b0381111561565657600080fd5b8301601f8101851361566757600080fd5b80516156756143cc82614378565b81815260069190911b8201830190838101908783111561569457600080fd5b928401925b8284101561411557604084890312156156b25760008081fd5b6156ba6142e1565b84516156c5816147ab565b8152848601516156d48161439b565b8187015282526040939093019290840190615699565b6001600160a01b0383168152604060208201819052600090610cb490830184614dd3565b6000602080838503121561572157600080fd5b82516001600160401b0381111561573757600080fd5b8301601f8101851361574857600080fd5b80516157566143cc82614378565b81815260059190911b8201830190838101908783111561577557600080fd5b928401925b828410156141155783518252928401929084019061577a565b600082516157a58184602087016151b4565b919091019291505056fea2646970667358221220df177ff60f201682d4cabb921c155fd943e0df84f9e6cd829d2c08e9af42b05164736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000068247df83d594af6332bf901a5ff8c3448622774000000000000000000000000303cd2a927d9cb6f5ce03b88a4e3e2528baedf40
-----Decoded View---------------
Arg [0] : _subscrRegistry (address): 0x68247DF83d594af6332bF901a5fF8c3448622774
Arg [1] : _pointsOperator (address): 0x303cD2A927D9Cb6F5CE03b88a4e3E2528baEDF40
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000068247df83d594af6332bf901a5ff8c3448622774
Arg [1] : 000000000000000000000000303cd2a927d9cb6f5ce03b88a4e3e2528baedf40
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.