Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 9 from a total of 9 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Deploy New Colle... | 24090261 | 70 days ago | IN | 0 ETH | 0.00000224 | ||||
| Set Subscription... | 24090232 | 70 days ago | IN | 0 ETH | 0.00000144 | ||||
| Deploy New Colle... | 24090060 | 70 days ago | IN | 0 ETH | 0.00000189 | ||||
| Deploy New Colle... | 24090049 | 70 days ago | IN | 0 ETH | 0.00000196 | ||||
| Add Implementati... | 24074252 | 73 days ago | IN | 0 ETH | 0.00000265 | ||||
| Add Implementati... | 24074252 | 73 days ago | IN | 0 ETH | 0.00000253 | ||||
| Transfer Ownersh... | 24074199 | 73 days ago | IN | 0 ETH | 0.00000094 | ||||
| Add Implementati... | 20476101 | 576 days ago | IN | 0 ETH | 0.00009149 | ||||
| Add Implementati... | 20476101 | 576 days ago | IN | 0 ETH | 0.00011545 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
UserCollectionPRegistry
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
// Proxy for Public Mintable User NFT Collection
pragma solidity 0.8.21;
import "@envelop-subscription/contracts/ServiceProviderOwnable.sol";
import "../interfaces/IUsersCollectionFactory.sol";
contract UserCollectionPRegistry is ServiceProviderOwnable {
enum AssetType {EMPTY, NATIVE, ERC20, ERC721, ERC1155, FUTURE1, FUTURE2, FUTURE3}
struct Asset {
AssetType assetType;
address contractAddress;
}
Asset[] public supportedImplementations;
// mapping from user to his(her) contracts with type
mapping(address => Asset[]) public collectionRegistry;
IUsersCollectionFactory public factory;
constructor (address _subscrRegistry)
ServiceProviderOwnable(_subscrRegistry)
{}
function deployNewCollection(
address _implAddress,
address _creator,
string memory name_,
string memory symbol_,
string memory _baseurl
) external {
(bool _supported, uint256 index) = isImplementationSupported(_implAddress);
require(_supported, "This implementation address is not supported");
_checkAndFixSubscription(msg.sender);
address newCollection = factory.deployProxyFor(
_implAddress,
_creator,
name_,
symbol_,
_baseurl
);
collectionRegistry[_creator].push(Asset(supportedImplementations[index].assetType, newCollection));
}
function getSupportedImplementation() external view returns(Asset[] memory) {
return supportedImplementations;
}
function getUsersCollections(address _user) external view returns(Asset[] memory) {
return collectionRegistry[_user];
}
////////////////////////////////////
/// Admin functions /////
////////////////////////////////////
function addImplementation(Asset calldata _impl) external onlyOwner {
// Check that not exist
for(uint256 i; i < supportedImplementations.length; ++i){
require(
supportedImplementations[i].contractAddress != _impl.contractAddress,
"Already exist"
);
}
supportedImplementations.push(Asset(_impl.assetType, _impl.contractAddress));
}
function removeImplementationByIndex(uint256 _index) external onlyOwner {
if (_index != supportedImplementations.length -1) {
supportedImplementations[_index] = supportedImplementations[supportedImplementations.length -1];
}
supportedImplementations.pop();
}
function setFactory(address _factory) external onlyOwner {
factory = IUsersCollectionFactory(_factory);
}
//////////////////////////////////////
function isImplementationSupported(address _impl) public view returns(bool isSupported, uint256 index) {
for (uint256 i; i < supportedImplementations.length; ++i){
if (_impl == supportedImplementations[i].contractAddress){
isSupported = true;
index = i;
break;
}
}
}
function checkUserSubscription(address _user)
external
view
returns (bool ok, bool needFix)
{
(ok, needFix) = _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
// For access to Factory from external contracts
pragma solidity 0.8.21;
interface IUsersCollectionFactory {
function deployProxyFor(
address _implAddress,
address _creator,
string memory name_,
string memory symbol_,
string memory _baseurl
) external returns(address proxy);
}// 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
// 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) 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
// 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
// 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
// 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);
}{
"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/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-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"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"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"components":[{"internalType":"enum UserCollectionPRegistry.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct UserCollectionPRegistry.Asset","name":"_impl","type":"tuple"}],"name":"addImplementation","outputs":[],"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":"_agent","type":"address"},{"internalType":"uint256[]","name":"_serviceTariffIndexes","type":"uint256[]"}],"name":"authorizeAgentForService","outputs":[{"internalType":"uint256[]","name":"actualTariffs","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"checkUserSubscription","outputs":[{"internalType":"bool","name":"ok","type":"bool"},{"internalType":"bool","name":"needFix","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"collectionRegistry","outputs":[{"internalType":"enum UserCollectionPRegistry.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_implAddress","type":"address"},{"internalType":"address","name":"_creator","type":"address"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"string","name":"_baseurl","type":"string"}],"name":"deployNewCollection","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":[],"name":"factory","outputs":[{"internalType":"contract IUsersCollectionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSupportedImplementation","outputs":[{"components":[{"internalType":"enum UserCollectionPRegistry.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct UserCollectionPRegistry.Asset[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUsersCollections","outputs":[{"components":[{"internalType":"enum UserCollectionPRegistry.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct UserCollectionPRegistry.Asset[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_impl","type":"address"}],"name":"isImplementationSupported","outputs":[{"internalType":"bool","name":"isSupported","type":"bool"},{"internalType":"uint256","name":"index","type":"uint256"}],"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":[],"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":"uint256","name":"_index","type":"uint256"}],"name":"removeImplementationByIndex","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":"address","name":"_factory","type":"address"}],"name":"setFactory","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":[],"name":"subscriptionRegistry","outputs":[{"internalType":"contract ISubscriptionRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"supportedImplementations","outputs":[{"internalType":"enum UserCollectionPRegistry.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040526001805460ff60a01b1916600160a01b1790553480156200002457600080fd5b5060405162001be038038062001be083398101604081905262000047916200012e565b80806001600160a01b038116620000945760405162461bcd60e51b815260206004820152600d60248201526c4e6f6e207a65726f206f6e6c7960981b604482015260640160405180910390fd5b60008054306001600160a01b031991821617909155600180549091166001600160a01b0392909216919091179055620000d4620000ce3390565b620000dc565b505062000160565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000602082840312156200014157600080fd5b81516001600160a01b03811681146200015957600080fd5b9392505050565b611a7080620001706000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806378451d00116100de578063b22f6d2611610097578063e1e3c08d11610071578063e1e3c08d14610374578063e93e509414610387578063f2fde38b1461039a578063fb8adca4146103ad57600080fd5b8063b22f6d2614610324578063c45a015514610337578063d259c8a51461034a57600080fd5b806378451d00146101a25780638d69e95e146102ba5780638da5cb5b146102cd5780639ec30e4a146102de578063a3fafd05146102f1578063abba145b1461031157600080fd5b80632934092f116101305780632934092f146102295780635751869b1461023e5780635bb47808146102515780635f098cc6146102645780636aa633b61461028e578063715018a6146102b257600080fd5b806302f43e59146101785780630c5620d6146101a25780631f16aef3146101c35780632063b112146101d857806320da7170146101eb57806326e3c30a14610216575b600080fd5b61018b610186366004611023565b6103c0565b604051610199929190611074565b60405180910390f35b6101b56101b0366004611252565b6103f3565b604051908152602001610199565b6101d66101d1366004611320565b61040c565b005b6101d66101e6366004611023565b61042a565b6001546101fe906001600160a01b031681565b6040516001600160a01b039091168152602001610199565b6101d661022436600461137e565b610515565b61023161067a565b6040516101999190611396565b6101d661024c3660046113f5565b610716565b6101d661025f366004611447565b610732565b610277610272366004611447565b61075c565b604080519215158352602083019190915201610199565b6001546102a290600160a01b900460ff1681565b6040519015158152602001610199565b6101d66107c5565b6000546101fe906001600160a01b031681565b6002546001600160a01b03166101fe565b6101d66102ec366004611447565b6107de565b6103046102ff366004611464565b610808565b6040516101999190611545565b6101d661031f366004611558565b610823565b61018b610332366004611575565b610849565b6005546101fe906001600160a01b031681565b61035d610358366004611447565b61088a565b604080519215158352901515602083015201610199565b610231610382366004611447565b6108a0565b6101d6610395366004611611565b610952565b6101d66103a8366004611447565b610b2f565b6101b56103bb3660046116bf565b610ba8565b600381815481106103d057600080fd5b60009182526020909120015460ff8116915061010090046001600160a01b031682565b60006103fd610bc7565b61040682610c21565b92915050565b610414610bc7565b610422868686868686610c94565b505050505050565b610432610bc7565b6003546104419060019061171d565b81146104df57600380546104579060019061171d565b8154811061046757610467611730565b906000526020600020016003828154811061048457610484611730565b60009182526020909120825491018054909160ff1690829060ff191660018360078111156104b4576104b461103c565b021790555090548154610100600160a81b031916610100918290046001600160a01b03169091021790555b60038054806104f0576104f0611746565b600082815260209020810160001990810180546001600160a81b031916905501905550565b61051d610bc7565b60005b6003548110156105c25761053a6040830160208401611447565b6001600160a01b03166003828154811061055657610556611730565b60009182526020909120015461010090046001600160a01b0316036105b25760405162461bcd60e51b815260206004820152600d60248201526c105b1c9958591e48195e1a5cdd609a1b60448201526064015b60405180910390fd5b6105bb8161175c565b9050610520565b5060408051808201909152600390806105de6020850185611775565b60078111156105ef576105ef61103c565b81526020018360200160208101906106079190611447565b6001600160a01b031690528154600181810184556000938452602090932082519101805492939092839160ff199091169083600781111561064a5761064a61103c565b02179055506020919091015181546001600160a01b0390911661010002610100600160a81b031990911617905550565b60606003805480602002602001604051908101604052809291908181526020016000905b8282101561070d57600084815260209020604080518082019091529083018054829060ff1660078111156106d4576106d461103c565b60078111156106e5576106e561103c565b8152905461010090046001600160a01b0316602091820152908252600192909201910161069e565b50505050905090565b61071e610bc7565b61072b8585858585610d1f565b5050505050565b61073a610bc7565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008060005b6003548110156107bf576003818154811061077f5761077f611730565b6000918252602090912001546001600160a01b036101009091048116908516036107af57600192508091506107bf565b6107b88161175c565b9050610762565b50915091565b6107cd610bc7565b6107d76000610da4565b565b919050565b6107e6610bc7565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6060610812610bc7565b61081c8383610df6565b9392505050565b61082b610bc7565b60018054911515600160a01b0260ff60a01b19909216919091179055565b6004602052816000526040600020818154811061086557600080fd5b60009182526020909120015460ff8116925061010090046001600160a01b0316905082565b60008061089683610e70565b9094909350915050565b6001600160a01b0381166000908152600460209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561094757600084815260209020604080518082019091529083018054829060ff16600781111561090e5761090e61103c565b600781111561091f5761091f61103c565b8152905461010090046001600160a01b031660209182015290825260019290920191016108d8565b505050509050919050565b60008061095e8761075c565b91509150816109c45760405162461bcd60e51b815260206004820152602c60248201527f5468697320696d706c656d656e746174696f6e2061646472657373206973206e60448201526b1bdd081cdd5c1c1bdc9d195960a21b60648201526084016105a9565b6109cd33610f0d565b50600554604051631709d71560e01b81526000916001600160a01b031690631709d71590610a07908b908b908b908b908b906004016117dc565b6020604051808303816000875af1158015610a26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4a919061183a565b905060046000886001600160a01b03166001600160a01b03168152602001908152602001600020604051806040016040528060038581548110610a8f57610a8f611730565b60009182526020909120015460ff166007811115610aaf57610aaf61103c565b81526001600160a01b038416602091820152825460018181018555600094855291909320825193018054929390929091839160ff191690836007811115610af857610af861103c565b02179055506020919091015181546001600160a01b0390911661010002610100600160a81b03199091161790555050505050505050565b610b37610bc7565b6001600160a01b038116610b9c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a9565b610ba581610da4565b50565b6000610bb2610bc7565b610bbe85858585610f9a565b95945050505050565b6002546001600160a01b031633146107d75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105a9565b6001546040516278451d60e81b81526000916001600160a01b0316906378451d0090610c51908590600401611857565b6020604051808303816000875af1158015610c70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610406919061190d565b600154604051631f16aef360e01b81526004810188905260248101879052604481018690526064810185905283151560848201526001600160a01b0383811660a483015290911690631f16aef39060c401600060405180830381600087803b158015610cff57600080fd5b505af1158015610d13573d6000803e3d6000fd5b50505050505050505050565b60015460405163650aac6160e01b815260048101879052602481018690526001600160a01b0385811660448301526064820185905261ffff841660848301529091169063650aac619060a401600060405180830381600087803b158015610d8557600080fd5b505af1158015610d99573d6000803e3d6000fd5b505050505050505050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60015460405163a3fafd0560e01b81526060916001600160a01b03169063a3fafd0590610e299086908690600401611926565b6000604051808303816000875af1158015610e48573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261081c9190810190611952565b6001546000908190600160a01b900460ff1615610f045760015460405163496d511d60e11b81526001600160a01b038581166004830152306024830152909116906392daa23a906044016040805180830381865afa158015610ed6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efa91906119e3565b9092509050915091565b60019150915091565b600154600090600160a01b900460ff1615610f9257600154604051632e5f2cf160e01b81526001600160a01b03848116600483015290911690632e5f2cf1906024016020604051808303816000875af1158015610f6e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104069190611a1d565b506001919050565b600154604051639aab948160e01b8152600481018690526001600160a01b0385811660248301526044820185905261ffff841660648301526000921690639aab9481906084016020604051808303816000875af1158015610fff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbe919061190d565b60006020828403121561103557600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6008811061107057634e487b7160e01b600052602160045260246000fd5b9052565b604081016110828285611052565b6001600160a01b039290921660209190910152919050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156110d3576110d361109a565b60405290565b6040805190810167ffffffffffffffff811182821017156110d3576110d361109a565b60405160a0810167ffffffffffffffff811182821017156110d3576110d361109a565b604051601f8201601f1916810167ffffffffffffffff811182821017156111485761114861109a565b604052919050565b8015158114610ba557600080fd5b6001600160a01b0381168114610ba557600080fd5b600067ffffffffffffffff82111561118d5761118d61109a565b5060051b60200190565b803561ffff811681146107d957600080fd5b600082601f8301126111ba57600080fd5b813560206111cf6111ca83611173565b61111f565b828152606092830285018201928282019190878511156111ee57600080fd5b8387015b858110156112455781818a03121561120a5760008081fd5b6112126110b0565b813561121d8161115e565b815281860135868201526040611234818401611197565b9082015284529284019281016111f2565b5090979650505050505050565b60006020828403121561126457600080fd5b813567ffffffffffffffff8082111561127c57600080fd5b9083019081850360c081121561129157600080fd5b6112996110d9565b60a08212156112a757600080fd5b6112af6110fc565b915083358252602084013560208301526040840135604083015260608401356112d781611150565b606083015260808401356112ea8161115e565b608083015290815260a0830135908282111561130557600080fd5b611311878386016111a9565b60208201529695505050505050565b60008060008060008060c0878903121561133957600080fd5b86359550602087013594506040870135935060608701359250608087013561136081611150565b915060a08701356113708161115e565b809150509295509295509295565b60006040828403121561139057600080fd5b50919050565b602080825282518282018190526000919060409081850190868401855b828110156113e85781516113c8858251611052565b8601516001600160a01b03168487015292840192908501906001016113b3565b5091979650505050505050565b600080600080600060a0868803121561140d57600080fd5b853594506020860135935060408601356114268161115e565b92506060860135915061143b60808701611197565b90509295509295909350565b60006020828403121561145957600080fd5b813561081c8161115e565b6000806040838503121561147757600080fd5b82356114828161115e565b915060208381013567ffffffffffffffff81111561149f57600080fd5b8401601f810186136114b057600080fd5b80356114be6111ca82611173565b81815260059190911b820183019083810190888311156114dd57600080fd5b928401925b828410156114fb578335825292840192908401906114e2565b80955050505050509250929050565b600081518084526020808501945080840160005b8381101561153a5781518752958201959082019060010161151e565b509495945050505050565b60208152600061081c602083018461150a565b60006020828403121561156a57600080fd5b813561081c81611150565b6000806040838503121561158857600080fd5b82356115938161115e565b946020939093013593505050565b600082601f8301126115b257600080fd5b813567ffffffffffffffff8111156115cc576115cc61109a565b6115df601f8201601f191660200161111f565b8181528460208386010111156115f457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561162957600080fd5b85356116348161115e565b945060208601356116448161115e565b9350604086013567ffffffffffffffff8082111561166157600080fd5b61166d89838a016115a1565b9450606088013591508082111561168357600080fd5b61168f89838a016115a1565b935060808801359150808211156116a557600080fd5b506116b2888289016115a1565b9150509295509295909350565b600080600080608085870312156116d557600080fd5b8435935060208501356116e78161115e565b9250604085013591506116fc60608601611197565b905092959194509250565b634e487b7160e01b600052601160045260246000fd5b8181038181111561040657610406611707565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60006001820161176e5761176e611707565b5060010190565b60006020828403121561178757600080fd5b81356008811061081c57600080fd5b6000815180845260005b818110156117bc576020818501810151868301820152016117a0565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b0386811682528516602082015260a06040820181905260009061180890830186611796565b828103606084015261181a8186611796565b9050828103608084015261182e8185611796565b98975050505050505050565b60006020828403121561184c57600080fd5b815161081c8161115e565b602080825282518051838301528082015160408085019190915280820151606080860191909152808301511515608080870191909152909201516001600160a01b0390811660a08601528584015160c080870152805160e08701819052600095949185019386939290916101008901905b808610156118ff578651805186168352888101518984015284015161ffff16848301529587019560019590950194908201906118c8565b509998505050505050505050565b60006020828403121561191f57600080fd5b5051919050565b6001600160a01b038316815260406020820181905260009061194a9083018461150a565b949350505050565b6000602080838503121561196557600080fd5b825167ffffffffffffffff81111561197c57600080fd5b8301601f8101851361198d57600080fd5b805161199b6111ca82611173565b81815260059190911b820183019083810190878311156119ba57600080fd5b928401925b828410156119d8578351825292840192908401906119bf565b979650505050505050565b600080604083850312156119f657600080fd5b8251611a0181611150565b6020840151909250611a1281611150565b809150509250929050565b600060208284031215611a2f57600080fd5b815161081c8161115056fea2646970667358221220eb5f8cd36f1e7e007e0a4be6bc2c245ab21be7a1da44c41b46c3ff13e154d77964736f6c63430008150033000000000000000000000000937cc2f0e4e40ebe774afd01911e3d14b9cd21c0
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806378451d00116100de578063b22f6d2611610097578063e1e3c08d11610071578063e1e3c08d14610374578063e93e509414610387578063f2fde38b1461039a578063fb8adca4146103ad57600080fd5b8063b22f6d2614610324578063c45a015514610337578063d259c8a51461034a57600080fd5b806378451d00146101a25780638d69e95e146102ba5780638da5cb5b146102cd5780639ec30e4a146102de578063a3fafd05146102f1578063abba145b1461031157600080fd5b80632934092f116101305780632934092f146102295780635751869b1461023e5780635bb47808146102515780635f098cc6146102645780636aa633b61461028e578063715018a6146102b257600080fd5b806302f43e59146101785780630c5620d6146101a25780631f16aef3146101c35780632063b112146101d857806320da7170146101eb57806326e3c30a14610216575b600080fd5b61018b610186366004611023565b6103c0565b604051610199929190611074565b60405180910390f35b6101b56101b0366004611252565b6103f3565b604051908152602001610199565b6101d66101d1366004611320565b61040c565b005b6101d66101e6366004611023565b61042a565b6001546101fe906001600160a01b031681565b6040516001600160a01b039091168152602001610199565b6101d661022436600461137e565b610515565b61023161067a565b6040516101999190611396565b6101d661024c3660046113f5565b610716565b6101d661025f366004611447565b610732565b610277610272366004611447565b61075c565b604080519215158352602083019190915201610199565b6001546102a290600160a01b900460ff1681565b6040519015158152602001610199565b6101d66107c5565b6000546101fe906001600160a01b031681565b6002546001600160a01b03166101fe565b6101d66102ec366004611447565b6107de565b6103046102ff366004611464565b610808565b6040516101999190611545565b6101d661031f366004611558565b610823565b61018b610332366004611575565b610849565b6005546101fe906001600160a01b031681565b61035d610358366004611447565b61088a565b604080519215158352901515602083015201610199565b610231610382366004611447565b6108a0565b6101d6610395366004611611565b610952565b6101d66103a8366004611447565b610b2f565b6101b56103bb3660046116bf565b610ba8565b600381815481106103d057600080fd5b60009182526020909120015460ff8116915061010090046001600160a01b031682565b60006103fd610bc7565b61040682610c21565b92915050565b610414610bc7565b610422868686868686610c94565b505050505050565b610432610bc7565b6003546104419060019061171d565b81146104df57600380546104579060019061171d565b8154811061046757610467611730565b906000526020600020016003828154811061048457610484611730565b60009182526020909120825491018054909160ff1690829060ff191660018360078111156104b4576104b461103c565b021790555090548154610100600160a81b031916610100918290046001600160a01b03169091021790555b60038054806104f0576104f0611746565b600082815260209020810160001990810180546001600160a81b031916905501905550565b61051d610bc7565b60005b6003548110156105c25761053a6040830160208401611447565b6001600160a01b03166003828154811061055657610556611730565b60009182526020909120015461010090046001600160a01b0316036105b25760405162461bcd60e51b815260206004820152600d60248201526c105b1c9958591e48195e1a5cdd609a1b60448201526064015b60405180910390fd5b6105bb8161175c565b9050610520565b5060408051808201909152600390806105de6020850185611775565b60078111156105ef576105ef61103c565b81526020018360200160208101906106079190611447565b6001600160a01b031690528154600181810184556000938452602090932082519101805492939092839160ff199091169083600781111561064a5761064a61103c565b02179055506020919091015181546001600160a01b0390911661010002610100600160a81b031990911617905550565b60606003805480602002602001604051908101604052809291908181526020016000905b8282101561070d57600084815260209020604080518082019091529083018054829060ff1660078111156106d4576106d461103c565b60078111156106e5576106e561103c565b8152905461010090046001600160a01b0316602091820152908252600192909201910161069e565b50505050905090565b61071e610bc7565b61072b8585858585610d1f565b5050505050565b61073a610bc7565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008060005b6003548110156107bf576003818154811061077f5761077f611730565b6000918252602090912001546001600160a01b036101009091048116908516036107af57600192508091506107bf565b6107b88161175c565b9050610762565b50915091565b6107cd610bc7565b6107d76000610da4565b565b919050565b6107e6610bc7565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6060610812610bc7565b61081c8383610df6565b9392505050565b61082b610bc7565b60018054911515600160a01b0260ff60a01b19909216919091179055565b6004602052816000526040600020818154811061086557600080fd5b60009182526020909120015460ff8116925061010090046001600160a01b0316905082565b60008061089683610e70565b9094909350915050565b6001600160a01b0381166000908152600460209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561094757600084815260209020604080518082019091529083018054829060ff16600781111561090e5761090e61103c565b600781111561091f5761091f61103c565b8152905461010090046001600160a01b031660209182015290825260019290920191016108d8565b505050509050919050565b60008061095e8761075c565b91509150816109c45760405162461bcd60e51b815260206004820152602c60248201527f5468697320696d706c656d656e746174696f6e2061646472657373206973206e60448201526b1bdd081cdd5c1c1bdc9d195960a21b60648201526084016105a9565b6109cd33610f0d565b50600554604051631709d71560e01b81526000916001600160a01b031690631709d71590610a07908b908b908b908b908b906004016117dc565b6020604051808303816000875af1158015610a26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4a919061183a565b905060046000886001600160a01b03166001600160a01b03168152602001908152602001600020604051806040016040528060038581548110610a8f57610a8f611730565b60009182526020909120015460ff166007811115610aaf57610aaf61103c565b81526001600160a01b038416602091820152825460018181018555600094855291909320825193018054929390929091839160ff191690836007811115610af857610af861103c565b02179055506020919091015181546001600160a01b0390911661010002610100600160a81b03199091161790555050505050505050565b610b37610bc7565b6001600160a01b038116610b9c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a9565b610ba581610da4565b50565b6000610bb2610bc7565b610bbe85858585610f9a565b95945050505050565b6002546001600160a01b031633146107d75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105a9565b6001546040516278451d60e81b81526000916001600160a01b0316906378451d0090610c51908590600401611857565b6020604051808303816000875af1158015610c70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610406919061190d565b600154604051631f16aef360e01b81526004810188905260248101879052604481018690526064810185905283151560848201526001600160a01b0383811660a483015290911690631f16aef39060c401600060405180830381600087803b158015610cff57600080fd5b505af1158015610d13573d6000803e3d6000fd5b50505050505050505050565b60015460405163650aac6160e01b815260048101879052602481018690526001600160a01b0385811660448301526064820185905261ffff841660848301529091169063650aac619060a401600060405180830381600087803b158015610d8557600080fd5b505af1158015610d99573d6000803e3d6000fd5b505050505050505050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60015460405163a3fafd0560e01b81526060916001600160a01b03169063a3fafd0590610e299086908690600401611926565b6000604051808303816000875af1158015610e48573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261081c9190810190611952565b6001546000908190600160a01b900460ff1615610f045760015460405163496d511d60e11b81526001600160a01b038581166004830152306024830152909116906392daa23a906044016040805180830381865afa158015610ed6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efa91906119e3565b9092509050915091565b60019150915091565b600154600090600160a01b900460ff1615610f9257600154604051632e5f2cf160e01b81526001600160a01b03848116600483015290911690632e5f2cf1906024016020604051808303816000875af1158015610f6e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104069190611a1d565b506001919050565b600154604051639aab948160e01b8152600481018690526001600160a01b0385811660248301526044820185905261ffff841660648301526000921690639aab9481906084016020604051808303816000875af1158015610fff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbe919061190d565b60006020828403121561103557600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6008811061107057634e487b7160e01b600052602160045260246000fd5b9052565b604081016110828285611052565b6001600160a01b039290921660209190910152919050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156110d3576110d361109a565b60405290565b6040805190810167ffffffffffffffff811182821017156110d3576110d361109a565b60405160a0810167ffffffffffffffff811182821017156110d3576110d361109a565b604051601f8201601f1916810167ffffffffffffffff811182821017156111485761114861109a565b604052919050565b8015158114610ba557600080fd5b6001600160a01b0381168114610ba557600080fd5b600067ffffffffffffffff82111561118d5761118d61109a565b5060051b60200190565b803561ffff811681146107d957600080fd5b600082601f8301126111ba57600080fd5b813560206111cf6111ca83611173565b61111f565b828152606092830285018201928282019190878511156111ee57600080fd5b8387015b858110156112455781818a03121561120a5760008081fd5b6112126110b0565b813561121d8161115e565b815281860135868201526040611234818401611197565b9082015284529284019281016111f2565b5090979650505050505050565b60006020828403121561126457600080fd5b813567ffffffffffffffff8082111561127c57600080fd5b9083019081850360c081121561129157600080fd5b6112996110d9565b60a08212156112a757600080fd5b6112af6110fc565b915083358252602084013560208301526040840135604083015260608401356112d781611150565b606083015260808401356112ea8161115e565b608083015290815260a0830135908282111561130557600080fd5b611311878386016111a9565b60208201529695505050505050565b60008060008060008060c0878903121561133957600080fd5b86359550602087013594506040870135935060608701359250608087013561136081611150565b915060a08701356113708161115e565b809150509295509295509295565b60006040828403121561139057600080fd5b50919050565b602080825282518282018190526000919060409081850190868401855b828110156113e85781516113c8858251611052565b8601516001600160a01b03168487015292840192908501906001016113b3565b5091979650505050505050565b600080600080600060a0868803121561140d57600080fd5b853594506020860135935060408601356114268161115e565b92506060860135915061143b60808701611197565b90509295509295909350565b60006020828403121561145957600080fd5b813561081c8161115e565b6000806040838503121561147757600080fd5b82356114828161115e565b915060208381013567ffffffffffffffff81111561149f57600080fd5b8401601f810186136114b057600080fd5b80356114be6111ca82611173565b81815260059190911b820183019083810190888311156114dd57600080fd5b928401925b828410156114fb578335825292840192908401906114e2565b80955050505050509250929050565b600081518084526020808501945080840160005b8381101561153a5781518752958201959082019060010161151e565b509495945050505050565b60208152600061081c602083018461150a565b60006020828403121561156a57600080fd5b813561081c81611150565b6000806040838503121561158857600080fd5b82356115938161115e565b946020939093013593505050565b600082601f8301126115b257600080fd5b813567ffffffffffffffff8111156115cc576115cc61109a565b6115df601f8201601f191660200161111f565b8181528460208386010111156115f457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561162957600080fd5b85356116348161115e565b945060208601356116448161115e565b9350604086013567ffffffffffffffff8082111561166157600080fd5b61166d89838a016115a1565b9450606088013591508082111561168357600080fd5b61168f89838a016115a1565b935060808801359150808211156116a557600080fd5b506116b2888289016115a1565b9150509295509295909350565b600080600080608085870312156116d557600080fd5b8435935060208501356116e78161115e565b9250604085013591506116fc60608601611197565b905092959194509250565b634e487b7160e01b600052601160045260246000fd5b8181038181111561040657610406611707565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60006001820161176e5761176e611707565b5060010190565b60006020828403121561178757600080fd5b81356008811061081c57600080fd5b6000815180845260005b818110156117bc576020818501810151868301820152016117a0565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b0386811682528516602082015260a06040820181905260009061180890830186611796565b828103606084015261181a8186611796565b9050828103608084015261182e8185611796565b98975050505050505050565b60006020828403121561184c57600080fd5b815161081c8161115e565b602080825282518051838301528082015160408085019190915280820151606080860191909152808301511515608080870191909152909201516001600160a01b0390811660a08601528584015160c080870152805160e08701819052600095949185019386939290916101008901905b808610156118ff578651805186168352888101518984015284015161ffff16848301529587019560019590950194908201906118c8565b509998505050505050505050565b60006020828403121561191f57600080fd5b5051919050565b6001600160a01b038316815260406020820181905260009061194a9083018461150a565b949350505050565b6000602080838503121561196557600080fd5b825167ffffffffffffffff81111561197c57600080fd5b8301601f8101851361198d57600080fd5b805161199b6111ca82611173565b81815260059190911b820183019083810190878311156119ba57600080fd5b928401925b828410156119d8578351825292840192908401906119bf565b979650505050505050565b600080604083850312156119f657600080fd5b8251611a0181611150565b6020840151909250611a1281611150565b809150509250929050565b600060208284031215611a2f57600080fd5b815161081c8161115056fea2646970667358221220eb5f8cd36f1e7e007e0a4be6bc2c245ab21be7a1da44c41b46c3ff13e154d77964736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000937cc2f0e4e40ebe774afd01911e3d14b9cd21c0
-----Decoded View---------------
Arg [0] : _subscrRegistry (address): 0x937cc2f0e4E40Ebe774aFd01911e3D14B9cd21c0
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000937cc2f0e4e40ebe774afd01911e3d14b9cd21c0
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.