ETH Price: $2,446.40 (+0.20%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Manage Contribut...197170142024-04-23 8:50:47196 days ago1713862247IN
0x05c415cd...43B4AE7Ce
0 ETH0.000474089.84222669
Set Credit Spend...190847812024-01-25 16:19:59284 days ago1706199599IN
0x05c415cd...43B4AE7Ce
0 ETH0.0020174242
Manage Contribut...190779232024-01-24 17:15:47285 days ago1706116547IN
0x05c415cd...43B4AE7Ce
0 ETH0.0008188517
Manage Contribut...190779222024-01-24 17:15:35285 days ago1706116535IN
0x05c415cd...43B4AE7Ce
0 ETH0.0008188517
Manage Contribut...190779012024-01-24 17:11:11285 days ago1706116271IN
0x05c415cd...43B4AE7Ce
0 ETH0.0008188517
Manage Contribut...190779002024-01-24 17:10:59285 days ago1706116259IN
0x05c415cd...43B4AE7Ce
0 ETH0.0008188517
Manage Contribut...190778992024-01-24 17:10:47285 days ago1706116247IN
0x05c415cd...43B4AE7Ce
0 ETH0.0008188517
0x60806040190778982024-01-24 17:10:35285 days ago1706116235IN
 Create: RMRKCreditManager
0 ETH0.0300521217

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RMRKCreditManager

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 1 runs

Other Settings:
london EvmVersion
File 1 of 8 : RMRKCreditManager.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@rmrk-team/evm-contracts/contracts/RMRK/access/Ownable.sol";
import "./interfaces/IRMRKCreditManager.sol";

error FailedToSend();
error InvalidCurrency();
error InvalidFeeBps();
error NotCreditSpender();
error NotEnoughCredits();
error PriceNotSetForSizeAndCurrency();
error WrongValueSent();

contract RMRKCreditManager is Ownable, IRMRKCreditManager {
    /**
     * @notice Emitted when the platform fee discount is updated.
     * @param collection Address of the collection smart contract that the discount is granted for
     * @param tokenId ID of the token that the discount is granted for
     * @param discountGranted Boolean value indicating whether the discount is granted (`true`) or revoked (`false`)
     * @param discountBps Discount granted to the collection expressed in basis points
     */
    event PlatformFeeDiscountUpdated(
        address indexed collection,
        uint256 indexed tokenId,
        bool discountGranted,
        uint256 discountBps
    );

    /**
     * @notice Emitted when credits are added to a user.
     * @param user Address of the user that the credits are added to
     * @param mintingCredits Amount of minting credits added
     * @param pinningCredits Amount of pinning credits added
     * @param addedBy Address that added the credits
     */
    event CreditsAdded(
        address indexed user,
        uint256 indexed mintingCredits,
        uint256 indexed pinningCredits,
        address addedBy
    );

    /**
     * @notice Emitted when credits are spent by a user.
     * @param user Address of the user that the credits are spent for
     * @param mintingCredits Amount of minting credits spent
     * @param pinningCredits Amount of pinning credits spent
     * @param usedFrom Address that spent the credits
     */
    event CreditsSpent(
        address indexed user,
        uint256 indexed mintingCredits,
        uint256 indexed pinningCredits,
        address usedFrom
    );

    /**
     * @notice Emitted when credits are bought by a user.
     * @param user Address of the user that the credits are bought for
     * @param mintingCredits Amount of minting credits bought
     * @param pinningCredits Amount of pinning credits bought
     * @param currency Address of the currency used to buy the credits
     * @param price Total price paid for the credits
     */
    event CreditsBought(
        address indexed user,
        uint256 indexed mintingCredits,
        uint256 indexed pinningCredits,
        address currency,
        uint256 price
    );

    /**
     * @notice Emitted when the price of a minting pack is set.
     * @param currency Address of the currency used to buy the pack
     * @param packSize Size of the pack
     * @param price Price of the pack
     */
    event MintingPackPriceSet(
        address indexed currency,
        uint256 indexed packSize,
        uint256 price
    );

    /**
     * @notice Emitted when the price of a pinning pack is set.
     * @param currency Address of the currency used to buy the pack
     * @param packSize Size of the pack
     * @param price Price of the pack
     */
    event PinningPackPriceSet(
        address indexed currency,
        uint256 indexed packSize,
        uint256 price
    );

    /**
     * @notice Emitted when the beneficiary is updated.
     * @param beneficiary Address of the new beneficiary
     */
    event BeneficiaryUpdated(address indexed beneficiary);

    /**
     * @notice Emitted when a credit spender is updated.
     * @param spender Address of the credit spender
     * @param isCreditSpender Boolean value indicating whether the spender is a credit spender (`true`) or not (`false`)
     */
    event CreditSpenderUpdated(
        address indexed spender,
        bool indexed isCreditSpender
    );

    uint16 public constant MAX_BPS = 10_000;
    address public constant NATIVE_TOKEN_ADDRESS =
        0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    mapping(address currency => bool isValid) private _isValidCurrency;
    mapping(address spender => bool isCreditSpender) private _isCreditSpender;
    mapping(address currency => mapping(uint256 packSize => uint256 price))
        private _mintingPackPricePerCurrency;
    mapping(address currency => mapping(uint256 packSize => uint256 price))
        private _pinningPackPricePerCurrency;
    mapping(address user => uint256 mintingCredits)
        private _mintingCreditsPerUser;
    mapping(address user => uint256 pinningCredits)
        private _pinningCreditsPerUser;
    uint256[] private _mintingPackSizes;
    uint256[] private _pinningPackSizes;
    address private _beneficiary;

    // The mappings used to store the eligibility of a collection for marketplace fee discounts.
    /// @dev The mapping uses the uint256 to store the eligibility of a collection for marketplace fee discounts instead
    ///     of a boolean to save gas.
    mapping(address collection => mapping(uint256 tokenId => uint256))
        private _feeDiscountEligibility;
    mapping(address collection => uint256) private _collectionFeeDiscountBps;

    modifier onlyCreditSpender() {
        _checkCreditSpender();
        _;
    }

    constructor(address beneficiary) {
        _beneficiary = beneficiary;
    }

    // ---------------- GETTERS ----------------

    /**
     * @notice Returns whether the given currency is valid.
     * @param currency Address of the currency
     * @return isValid Boolean value indicating whether the currency is valid (`true`) or not (`false`)
     */
    function getIsValidCurrency(
        address currency
    ) public view returns (bool isValid) {
        isValid = _isValidCurrency[currency];
    }

    /**
     * @notice Returns whether the given address is a credit spender.
     * @param spender Address of the spender
     * @return isSpender Boolean value indicating whether the spender is a credit spender (`true`) or not (`false`)
     */
    function getIsCreditSpender(
        address spender
    ) public view returns (bool isSpender) {
        isSpender = _isCreditSpender[spender];
    }

    /**
     * @notice Returns the price of a minting pack for the given currency and size.
     * @param currency Address of the currency
     * @param size Size of the pack
     * @return price Price of the pack
     */
    function getMintingPackPrice(
        address currency,
        uint256 size
    ) public view returns (uint256 price) {
        price = _mintingPackPricePerCurrency[currency][size];
    }

    /**
     * @notice Returns the price of a pinning pack for the given currency and size.
     * @param currency Address of the currency
     * @param size Size of the pack
     * @return price Price of the pack
     */
    function getPinningPackPrice(
        address currency,
        uint256 size
    ) public view returns (uint256 price) {
        price = _pinningPackPricePerCurrency[currency][size];
    }

    /**
     * @notice Returns the amount of minting credits owned by the given user.
     * @param user Address of the user
     * @return credits Amount of minting credits owned by the user
     */
    function getMintingCredits(
        address user
    ) public view returns (uint256 credits) {
        credits = _mintingCreditsPerUser[user];
    }

    /**
     * @notice Returns the amount of pinning credits owned by the given user.
     * @param user Address of the user
     * @return credits Amount of pinning credits owned by the user
     */
    function getPinningCredits(
        address user
    ) public view returns (uint256 credits) {
        credits = _pinningCreditsPerUser[user];
    }

    /**
     * @notice Returns the beneficiary of the credits.
     * @return beneficiary Address of the beneficiary
     */
    function getBeneficiary() public view returns (address beneficiary) {
        beneficiary = _beneficiary;
    }

    /**
     * @notice Returns the minting pack sizes.
     * @return mintingPackSizes Array of minting pack sizes
     */
    function getMintingPackSizes()
        public
        view
        returns (uint256[] memory mintingPackSizes)
    {
        mintingPackSizes = _mintingPackSizes;
    }

    /**
     * @notice Returns the pinning pack sizes.
     * @return pinningPackSizes Array of pinning pack sizes
     */
    function getPinningPackSizes()
        public
        view
        returns (uint256[] memory pinningPackSizes)
    {
        pinningPackSizes = _pinningPackSizes;
    }

    /**
     * @notice Returns the minting pack sizes and prices for the given currency.
     * @param currency Address of the currency
     * @return packs Array of minting packs with their sizes and prices
     */
    function getAllMintingPackSizesAndPricesForCurrency(
        address currency
    ) public view returns (PackWithPrice[] memory packs) {
        packs = new PackWithPrice[](_mintingPackSizes.length);
        for (uint256 i = 0; i < _mintingPackSizes.length; i++) {
            packs[i] = PackWithPrice({
                size: _mintingPackSizes[i],
                price: _mintingPackPricePerCurrency[currency][
                    _mintingPackSizes[i]
                ]
            });
        }
    }

    /**
     * @notice Returns the pinning pack sizes and prices for the given currency.
     * @param currency Address of the currency
     * @return packs Array of pinning packs with their sizes and prices
     */
    function getAllPinningPackSizesAndPricesForCurrency(
        address currency
    ) public view returns (PackWithPrice[] memory packs) {
        packs = new PackWithPrice[](_pinningPackSizes.length);
        for (uint256 i = 0; i < _pinningPackSizes.length; i++) {
            packs[i] = PackWithPrice({
                size: _pinningPackSizes[i],
                price: _pinningPackPricePerCurrency[currency][
                    _pinningPackSizes[i]
                ]
            });
        }
    }

    // ---------------- SETTERS ----------------

    /**
     * @notice Sets the beneficiary of the credits sales.
     * @param beneficiary Address of the beneficiary
     */
    function setPlatformBeneficiary(address beneficiary) public onlyOwner {
        _beneficiary = beneficiary;
        emit BeneficiaryUpdated(beneficiary);
    }

    /**
     * @notice Sets the given address as a credit spender or not
     * @param spender Address of the credit spender
     * @param isCreditSpender Boolean value indicating whether the spender is a credit spender (`true`) or not (`false`)
     * @dev Credit spenders can spend both minting and pinning credits for any user, they should be trusted contracts.
     */
    function setCreditSpender(
        address spender,
        bool isCreditSpender
    ) public onlyOwnerOrContributor {
        _isCreditSpender[spender] = isCreditSpender;
        emit CreditSpenderUpdated(spender, isCreditSpender);
    }

    /**
     * @notice Sets the given currency as valid or not
     * @param currency Address of the currency
     * @param isValid Boolean value indicating whether the currency is valid (`true`) or not (`false`)
     * @dev Unsetting a currency will make all the packs with that currency invalid but will not remove the prices
     */
    function setValidCurrency(
        address currency,
        bool isValid
    ) public onlyOwnerOrContributor {
        _isValidCurrency[currency] = isValid;
    }

    /**
     * @notice Sets the price of multiple minting packs sizes for the given currency.
     * @param currency Address of the currency
     * @param packs Array of minting packs with their sizes and prices
     */
    function setMintingPackPrices(
        address currency,
        PackWithPrice[] memory packs
    ) public onlyOwnerOrContributor {
        uint256 length = packs.length;
        _isValidCurrency[currency] = true;
        for (uint256 i = 0; i < length; i++) {
            uint256 size = packs[i].size;
            _mintingPackPricePerCurrency[currency][size] = packs[i].price;
            _addPackSize(_mintingPackSizes, size);
            emit MintingPackPriceSet(currency, size, packs[i].price);
        }
    }

    /**
     * @notice Sets the price of multiple pinning packs sizes for the given currency.
     * @param currency Address of the currency
     * @param packs Array of pinning packs with their sizes and prices
     */
    function setPinningPackPrices(
        address currency,
        PackWithPrice[] memory packs
    ) public onlyOwnerOrContributor {
        uint256 length = packs.length;
        _isValidCurrency[currency] = true;
        for (uint256 i = 0; i < length; i++) {
            uint256 size = packs[i].size;
            _pinningPackPricePerCurrency[currency][size] = packs[i].price;
            _addPackSize(_pinningPackSizes, size);
            emit PinningPackPriceSet(currency, size, packs[i].price);
        }
    }

    // ---------------- FEE DISCOUNTS ----------------

    /**
     * @notice Used to calculate the discounted marketplace fee for the holders of discount tokens.
     * @dev The discount is calculated as a percentage of the marketplace fee.
     * @dev The discount is applied to the marketplace fee only, not the GBM fee.
     * @param totalPayoutAmount The total amount of the sale
     * @param user Address for which to calculate the discount
     * @param discountTokenAddress Address of the collection smart contract of the token providing the discount
     * @param discountTokenId ID of the token that the user owns
     * @return fee The marketplace fee with the discount applied
     * @return appliedDiscountBps The discount applied in base points
     */
    function getDiscountedFee(
        uint256 totalPayoutAmount,
        address user,
        address discountTokenAddress,
        uint256 discountTokenId
    ) public view returns (uint256 fee, uint256 appliedDiscountBps) {
        fee = totalPayoutAmount;
        if (
            discountTokenAddress != address(0) &&
            _collectionFeeDiscountBps[discountTokenAddress] != 0
        ) {
            if (
                (_feeDiscountEligibility[discountTokenAddress][0] == 1 &&
                    IERC721(discountTokenAddress).balanceOf(user) > 0) ||
                (_feeDiscountEligibility[discountTokenAddress][
                    discountTokenId
                ] ==
                    1 &&
                    IERC721(discountTokenAddress).ownerOf(discountTokenId) ==
                    user)
            ) {
                appliedDiscountBps = _collectionFeeDiscountBps[
                    discountTokenAddress
                ];
                fee = (fee * (MAX_BPS - appliedDiscountBps)) / MAX_BPS;
            }
        }
    }

    /**
     * @notice Lets a contract owner or contributor set the marketplace fee discount for a collection or specific tokens
     *  within a collection.
     * @dev The discount is calculated as a percentage of the marketplace fee and is passed as basis points (Bps).
     * @dev A basis point is the lowest percentage value supported and it is one hundreth of a percent; so 1Bps == 0.01%.
     * @dev Setting the token with ID of 0 for the discount will automatically enable the discount for all of the tokens
     *  within a collection.
     * @param collection The collection for which the discount is being set
     * @param tokenIds The array of token IDs for which the discount is being set
     * @param discountBps The discount in basis points applied to all eligible tokens in the collection
     */
    function setFeeDiscount(
        address collection,
        uint256[] memory tokenIds,
        uint256 discountBps
    ) external onlyOwnerOrContributor {
        if (discountBps > MAX_BPS) {
            revert InvalidFeeBps();
        }
        _collectionFeeDiscountBps[collection] = discountBps;
        for (uint256 i = 0; i < tokenIds.length; ) {
            _feeDiscountEligibility[collection][tokenIds[i]] = 1;
            emit PlatformFeeDiscountUpdated(
                collection,
                tokenIds[i],
                true,
                discountBps
            );
            unchecked {
                i++;
            }
        }
    }

    /**
     * @notice Lets a contract owner or contributor remove the marketplace fee discount for a collection or specific
     *  tokens within a collection.
     * @dev The function is meant to be used to remove the discount for a specific token or tokens within a collection.
     * @dev To invalidate the collection wide discount, set the token ID to 0 or use the `setFeeDiscount` and
     *  set `discountBps` to 0.
     * @param collection Address of the collection smart contract of the token providing the discount
     * @param tokenIds The array of token IDs for which the discount is being removed
     */
    function removeFeeDiscount(
        address collection,
        uint256[] memory tokenIds
    ) external onlyOwnerOrContributor {
        for (uint256 i = 0; i < tokenIds.length; ) {
            _feeDiscountEligibility[collection][tokenIds[i]] = 0;
            emit PlatformFeeDiscountUpdated(
                collection,
                tokenIds[i],
                false,
                _collectionFeeDiscountBps[collection]
            );
            unchecked {
                i++;
            }
        }
    }

    // ---------------- BUYING ----------------

    /**
     * @notice Returns the discounted price of a minting pack for the given user, currency and discount token.
     * @param user Address of the user
     * @param packSize Size of the pack
     * @param currency Address of the currency
     * @param discountTokenAddress Address of the collection smart contract of the token providing the discount
     * @param discountTokenId ID of the token that the user owns
     * @return discountedPrice Discounted price of the pack
     * @return appliedDiscount Discount applied to the price of the pack
     */
    function getDiscountedMintingPrice(
        address user,
        uint256 packSize,
        address currency,
        address discountTokenAddress,
        uint256 discountTokenId
    ) public view returns (uint256 discountedPrice, uint256 appliedDiscount) {
        uint256 price = _mintingPackPricePerCurrency[currency][packSize];
        return
            _validateAndApplyDiscount(
                user,
                price,
                currency,
                discountTokenAddress,
                discountTokenId
            );
    }

    /**
     * @notice Returns the discounted price of a pinning pack for the given user, currency and discount token.
     * @param user Address of the user
     * @param packSize Size of the pack
     * @param currency Address of the currency
     * @param discountTokenAddress Address of the collection smart contract of the token providing the discount
     * @param discountTokenId ID of the token that the user owns
     * @return discountedPrice Discounted price of the pack
     * @return appliedDiscount Discount applied to the price of the pack
     */
    function getDiscountedPinningPrice(
        address user,
        uint256 packSize,
        address currency,
        address discountTokenAddress,
        uint256 discountTokenId
    ) public view returns (uint256 discountedPrice, uint256 appliedDiscount) {
        uint256 price = _pinningPackPricePerCurrency[currency][packSize];
        return
            _validateAndApplyDiscount(
                user,
                price,
                currency,
                discountTokenAddress,
                discountTokenId
            );
    }

    /**
     * @notice Lets a user buy minting credits.
     * @param user Address of the user
     * @param packSize Size of the pack
     * @param currency Address of the currency
     * @param discountTokenAddress Address of the collection smart contract of the token providing the discount
     * @param discountTokenId ID of the token that the user owns
     */
    function buyMintingCredits(
        address user,
        uint256 packSize,
        address currency,
        address discountTokenAddress,
        uint256 discountTokenId
    ) public payable {
        (uint256 price, ) = getDiscountedMintingPrice(
            user,
            packSize,
            currency,
            discountTokenAddress,
            discountTokenId
        );
        _charge(user, price, currency);
        _mintingCreditsPerUser[user] += packSize;
        emit CreditsBought(user, packSize, 0, currency, price);
    }

    /**
     * @notice Lets a user buy pinning credits.
     * @param user Address of the user
     * @param packSize Size of the pack
     * @param currency Address of the currency
     * @param discountTokenAddress Address of the collection smart contract of the token providing the discount
     * @param discountTokenId ID of the token that the user owns
     */
    function buyPinningCredits(
        address user,
        uint256 packSize,
        address currency,
        address discountTokenAddress,
        uint256 discountTokenId
    ) public payable {
        (uint256 price, ) = getDiscountedPinningPrice(
            user,
            packSize,
            currency,
            discountTokenAddress,
            discountTokenId
        );
        _charge(user, price, currency);
        _pinningCreditsPerUser[user] += packSize;
        emit CreditsBought(user, 0, packSize, currency, price);
    }

    /**
     * @notice Lets the owner or contributor add minting credits to a user.
     * @param user Address of the user
     * @param amount Amount of credits to add
     */
    function addMintingCredits(
        address user,
        uint256 amount
    ) public onlyOwnerOrContributor {
        _mintingCreditsPerUser[user] += amount;
        emit CreditsAdded(user, amount, 0, msg.sender);
    }

    /**
     * @notice Lets the owner or contributor add pinning credits to a user.
     * @param user Address of the user
     * @param amount Amount of credits to add
     */
    function addPinningCredits(
        address user,
        uint256 amount
    ) public onlyOwnerOrContributor {
        _pinningCreditsPerUser[user] += amount;
        emit CreditsAdded(user, 0, amount, msg.sender);
    }

    // ---------------- SPENDING ----------------

    /**
     * @inheritdoc IRMRKCreditManager
     */
    function spendMintingCredits(
        address user,
        uint256 amount
    ) public onlyCreditSpender {
        if (_mintingCreditsPerUser[user] < amount) revert NotEnoughCredits();
        unchecked {
            _mintingCreditsPerUser[user] -= amount;
        }
        emit CreditsSpent(user, amount, 0, msg.sender);
    }

    /**
     * @inheritdoc IRMRKCreditManager
     */
    function spendPinningCredits(
        address user,
        uint256 amount
    ) public onlyCreditSpender {
        if (_pinningCreditsPerUser[user] < amount) revert NotEnoughCredits();
        unchecked {
            _pinningCreditsPerUser[user] -= amount;
        }
        emit CreditsSpent(user, 0, amount, msg.sender);
    }

    // ---------------- UTILS ----------------

    function _addPackSize(uint256[] storage packSizes, uint256 size) private {
        for (uint256 i = 0; i < packSizes.length; i++) {
            if (packSizes[i] == size) {
                return;
            }
        }
        packSizes.push(size);
    }

    function _validateAndApplyDiscount(
        address user,
        uint256 price,
        address currency,
        address discountTokenAddress,
        uint256 discountTokenId
    ) public view returns (uint256 discountedPrice, uint256 appliedDiscount) {
        if (!_isValidCurrency[currency]) revert InvalidCurrency();
        if (price == 0) revert PriceNotSetForSizeAndCurrency();

        (discountedPrice, appliedDiscount) = getDiscountedFee(
            price,
            user,
            discountTokenAddress,
            discountTokenId
        );
    }

    function _charge(address user, uint256 price, address currency) private {
        if (currency == NATIVE_TOKEN_ADDRESS) {
            if (msg.value != price) revert WrongValueSent();

            (bool success, ) = _beneficiary.call{value: price}("");
            if (!success) revert FailedToSend();
        } else {
            IERC20(currency).transferFrom(user, _beneficiary, price);
        }
    }

    function _checkCreditSpender() private view {
        if (!_isCreditSpender[msg.sender]) revert NotCreditSpender();
    }
}

File 2 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 3 of 8 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 4 of 8 : Context.sol
// 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;
    }
}

File 5 of 8 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 6 of 8 : Ownable.sol
// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.8.21;

import "@openzeppelin/contracts/utils/Context.sol";
import "../library/RMRKErrors.sol";

/**
 * @title Ownable
 * @author RMRK team
 * @notice A minimal ownable smart contractf or owner and contributors.
 * @dev This smart contract is based on "openzeppelin's access/Ownable.sol".
 */
contract Ownable is Context {
    address private _owner;
    mapping(address => uint256) private _contributors;

    /**
     * @notice Used to anounce the transfer of ownership.
     * @param previousOwner Address of the account that transferred their ownership role
     * @param newOwner Address of the account receiving the ownership role
     */
    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );

    /**
     * @notice Event that signifies that an address was granted contributor role or that the permission has been
     *  revoked.
     * @dev This can only be triggered by a current owner, so there is no need to include that information in the event.
     * @param contributor Address of the account that had contributor role status updated
     * @param isContributor A boolean value signifying whether the role has been granted (`true`) or revoked (`false`)
     */
    event ContributorUpdate(address indexed contributor, bool isContributor);

    /**
     * @dev Reverts if called by any account other than the owner or an approved contributor.
     */
    modifier onlyOwnerOrContributor() {
        _onlyOwnerOrContributor();
        _;
    }

    /**
     * @dev Reverts if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _onlyOwner();
        _;
    }

    /**
     * @dev Initializes the contract by setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @notice Returns the address of the current owner.
     * @return Address of the current owner
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @notice Leaves the contract without owner. Functions using the `onlyOwner` modifier will be disabled.
     * @dev Can only be called by the current owner.
     * @dev Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is
     *  only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @notice Transfers ownership of the contract to a new owner.
     * @dev Can only be called by the current owner.
     * @param newOwner Address of the new owner's account
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) revert RMRKNewOwnerIsZeroAddress();
        _transferOwnership(newOwner);
    }

    /**
     * @notice Transfers ownership of the contract to a new owner.
     * @dev Internal function without access restriction.
     * @dev Emits ***OwnershipTransferred*** event.
     * @param newOwner Address of the new owner's account
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /**
     * @notice Adds or removes a contributor to the smart contract.
     * @dev Can only be called by the owner.
     * @dev Emits ***ContributorUpdate*** event.
     * @param contributor Address of the contributor's account
     * @param grantRole A boolean value signifying whether the contributor role is being granted (`true`) or revoked
     *  (`false`)
     */
    function manageContributor(
        address contributor,
        bool grantRole
    ) external onlyOwner {
        if (contributor == address(0)) revert RMRKNewContributorIsZeroAddress();
        grantRole
            ? _contributors[contributor] = 1
            : _contributors[contributor] = 0;
        emit ContributorUpdate(contributor, grantRole);
    }

    /**
     * @notice Used to check if the address is one of the contributors.
     * @param contributor Address of the contributor whose status we are checking
     * @return Boolean value indicating whether the address is a contributor or not
     */
    function isContributor(address contributor) public view returns (bool) {
        return _contributors[contributor] == 1;
    }

    /**
     * @notice Used to verify that the caller is either the owner or a contributor.
     * @dev If the caller is not the owner or a contributor, the execution will be reverted.
     */
    function _onlyOwnerOrContributor() private view {
        if (owner() != _msgSender() && !isContributor(_msgSender()))
            revert RMRKNotOwnerOrContributor();
    }

    /**
     * @notice Used to verify that the caller is the owner.
     * @dev If the caller is not the owner, the execution will be reverted.
     */
    function _onlyOwner() private view {
        if (owner() != _msgSender()) revert RMRKNotOwner();
    }
}

File 7 of 8 : RMRKErrors.sol
// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.8.21;

/// @title RMRKErrors
/// @author RMRK team
/// @notice A collection of errors used in the RMRK suite
/// @dev Errors are kept in a centralised file in order to provide a central point of reference and to avoid error
///  naming collisions due to inheritance

/// Attempting to grant the token to 0x0 address
error ERC721AddressZeroIsNotaValidOwner();
/// Attempting to grant approval to the current owner of the token
error ERC721ApprovalToCurrentOwner();
/// Attempting to grant approval when not being owner or approved for all should not be permitted
error ERC721ApproveCallerIsNotOwnerNorApprovedForAll();
/// Attempting to get approvals for a token owned by 0x0 (considered non-existent)
error ERC721ApprovedQueryForNonexistentToken();
/// Attempting to grant approval to self
error ERC721ApproveToCaller();
/// Attempting to use an invalid token ID
error ERC721InvalidTokenId();
/// Attempting to mint to 0x0 address
error ERC721MintToTheZeroAddress();
/// Attempting to manage a token without being its owner or approved by the owner
error ERC721NotApprovedOrOwner();
/// Attempting to mint an already minted token
error ERC721TokenAlreadyMinted();
/// Attempting to transfer the token from an address that is not the owner
error ERC721TransferFromIncorrectOwner();
/// Attempting to safe transfer to an address that is unable to receive the token
error ERC721TransferToNonReceiverImplementer();
/// Attempting to transfer the token to a 0x0 address
error ERC721TransferToTheZeroAddress();
/// Attempting to grant approval of assets to their current owner
error RMRKApprovalForAssetsToCurrentOwner();
/// Attempting to grant approval of assets without being the caller or approved for all
error RMRKApproveForAssetsCallerIsNotOwnerNorApprovedForAll();
/// Attempting to incorrectly configue a Catalog item
error RMRKBadConfig();
/// Attempting to set the priorities with an array of length that doesn't match the length of active assets array
error RMRKBadPriorityListLength();
/// Attempting to add an asset entry with `Part`s, without setting the `Catalog` address
error RMRKCatalogRequiredForParts();
/// Attempting to transfer a soulbound (non-transferrable) token
error RMRKCannotTransferSoulbound();
/// Attempting to accept a child that has already been accepted
error RMRKChildAlreadyExists();
/// Attempting to interact with a child, using index that is higher than the number of children
error RMRKChildIndexOutOfRange();
/// Attempting to find the index of a child token on a parent which does not own it.
error RMRKChildNotFoundInParent();
/// Attempting to pass collaborator address array and collaborator permission array of different lengths
error RMRKCollaboratorArraysNotEqualLength();
/// Attempting to register a collection that is already registered
error RMRKCollectionAlreadyRegistered();
/// Attempting to manage or interact with colleciton that is not registered
error RMRKCollectionNotRegistered();
/// Attempting to equip a `Part` with a child not approved by the Catalog
error RMRKEquippableEquipNotAllowedByCatalog();
/// Attempting to pass an epired ECDSA deadline
error RMRKExpiredDeadline();
/// Attempting to use ID 0, which is not supported
/// @dev The ID 0 in RMRK suite is reserved for empty values. Guarding against its use ensures the expected operation
error RMRKIdZeroForbidden();
/// Attempting to interact with an asset, using index greater than number of assets
error RMRKIndexOutOfRange();
/// Attempting to reclaim a child that can't be reclaimed
error RMRKInvalidChildReclaim();
/// Attempting to use and invalid ECDSA signature
error RMRKInvalidSignature();
/// Attempting to interact with an end-user account when the contract account is expected
error RMRKIsNotContract();
/// Attempting to interact with a contract that had its operation locked
error RMRKLocked();
/// Attempting to add a pending child after the number of pending children has reached the limit (default limit is 128)
error RMRKMaxPendingChildrenReached();
/// Attempting to add a pending asset after the number of pending assets has reached the limit (default limit is
///  128)
error RMRKMaxPendingAssetsReached();
/// Attempting to burn a total number of recursive children higher than maximum set
/// @param childContract Address of the collection smart contract in which the maximum number of recursive burns was reached
/// @param childId ID of the child token at which the maximum number of recursive burns was reached
error RMRKMaxRecursiveBurnsReached(address childContract, uint256 childId);
/// Attempting to mint a number of tokens that would cause the total supply to be greater than maximum supply
error RMRKMintOverMax();
/// Attempting to mint a nested token to a smart contract that doesn't support nesting
error RMRKMintToNonRMRKNestableImplementer();
/// Attempting to mint zero tokens
error RMRKMintZero();
/// Attempting to pass complementary arrays of different lengths
error RMRKMismachedArrayLength();
/// Attempting to transfer a child before it is unequipped
error RMRKMustUnequipFirst();
/// Attempting to nest a child over the nestable limit (current limit is 100 levels of nesting)
error RMRKNestableTooDeep();
/// Attempting to nest the token to own descendant, which would create a loop and leave the looped tokens in limbo
error RMRKNestableTransferToDescendant();
/// Attempting to nest the token to a smart contract that doesn't support nesting
error RMRKNestableTransferToNonRMRKNestableImplementer();
/// Attempting to nest the token into itself
error RMRKNestableTransferToSelf();
/// Attempting to interact with an asset that can not be found
error RMRKNoAssetMatchingId();
/// Attempting to manage an asset without owning it or having been granted permission by the owner to do so
error RMRKNotApprovedForAssetsOrOwner();
/// Attempting to interact with a token without being its owner or having been granted permission by the
///  owner to do so
/// @dev When a token is nested, only the direct owner (NFT parent) can mange it. In that case, approved addresses are
///  not allowed to manage it, in order to ensure the expected behaviour
error RMRKNotApprovedOrDirectOwner();
/// Attempting to manage a collection without being the collection's collaborator
error RMRKNotCollectionCollaborator();
/// Attemting to manage a collection without being the collection's issuer
error RMRKNotCollectionIssuer();
/// Attempting to manage a collection without being the collection's issuer or collaborator
error RMRKNotCollectionIssuerOrCollaborator();
/// Attempting to compose an asset wihtout having an associated Catalog
error RMRKNotComposableAsset();
/// Attempting to unequip an item that isn't equipped
error RMRKNotEquipped();
/// Attempting to interact with a management function without being the smart contract's owner
error RMRKNotOwner();
/// Attempting to interact with a function without being the owner or contributor of the collection
error RMRKNotOwnerOrContributor();
/// Attempting to manage a collection without being the specific address
error RMRKNotSpecificAddress();
/// Attempting to manage a token without being its owner
error RMRKNotTokenOwner();
/// Attempting to transfer the ownership to the 0x0 address
error RMRKNewOwnerIsZeroAddress();
/// Attempting to assign a 0x0 address as a contributor
error RMRKNewContributorIsZeroAddress();
/// Attemtping to use `Ownable` interface without implementing it
error RMRKOwnableNotImplemented();
/// Attempting an operation requiring the token being nested, while it is not
error RMRKParentIsNotNFT();
/// Attempting to add a `Part` with an ID that is already used
error RMRKPartAlreadyExists();
/// Attempting to use a `Part` that doesn't exist
error RMRKPartDoesNotExist();
/// Attempting to use a `Part` that is `Fixed` when `Slot` kind of `Part` should be used
error RMRKPartIsNotSlot();
/// Attempting to interact with a pending child using an index greater than the size of pending array
error RMRKPendingChildIndexOutOfRange();
/// Attempting to add an asset using an ID that has already been used
error RMRKAssetAlreadyExists();
/// Attempting to equip an item into a slot that already has an item equipped
error RMRKSlotAlreadyUsed();
/// Attempting to equip an item into a `Slot` that the target asset does not implement
error RMRKTargetAssetCannotReceiveSlot();
/// Attempting to equip a child into a `Slot` and parent that the child's collection doesn't support
error RMRKTokenCannotBeEquippedWithAssetIntoSlot();
/// Attempting to compose a NFT of a token without active assets
error RMRKTokenDoesNotHaveAsset();
/// Attempting to determine the asset with the top priority on a token without assets
error RMRKTokenHasNoAssets();
/// Attempting to accept or transfer a child which does not match the one at the specified index
error RMRKUnexpectedChildId();
/// Attempting to reject all pending assets but more assets than expected are pending
error RMRKUnexpectedNumberOfAssets();
/// Attempting to reject all pending children but children assets than expected are pending
error RMRKUnexpectedNumberOfChildren();
/// Attempting to accept or reject an asset which does not match the one at the specified index
error RMRKUnexpectedAssetId();
/// Attempting an operation expecting a parent to the token which is not the actual one
error RMRKUnexpectedParent();
/// Attempting not to pass an empty array of equippable addresses when adding or setting the equippable addresses
error RMRKZeroLengthIdsPassed();
/// Attempting to set the royalties to a value higher than 100% (10000 in basis points)
error RMRKRoyaltiesTooHigh();
/// Attempting to do a bulk operation on a token that is not owned by the caller
error RMRKCanOnlyDoBulkOperationsOnOwnedTokens();
/// Attempting to do a bulk operation with multiple tokens at a time
error RMRKCanOnlyDoBulkOperationsWithOneTokenAtATime();
/// Attempting to pay with native token with a value different than expected
error RMRKWrongValueSent();

File 8 of 8 : IRMRKCreditManager.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;

interface IRMRKCreditManager {
    struct PackWithPrice {
        uint256 size;
        uint256 price;
    }

    /**
     * @notice Spends minting credits for the user
     * @param user The user to spend the credits for
     * @param amount The amount of credits to spend
     */
    function spendMintingCredits(address user, uint256 amount) external;

    /**
     * @notice Spends pinning credits for the user
     * @param user The user to spend the credits for
     * @param amount The amount of credits to spend
     */
    function spendPinningCredits(address user, uint256 amount) external;
}

Settings
{
  "evmVersion": "london",
  "optimizer": {
    "enabled": true,
    "runs": 1
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"FailedToSend","type":"error"},{"inputs":[],"name":"InvalidCurrency","type":"error"},{"inputs":[],"name":"InvalidFeeBps","type":"error"},{"inputs":[],"name":"NotCreditSpender","type":"error"},{"inputs":[],"name":"NotEnoughCredits","type":"error"},{"inputs":[],"name":"PriceNotSetForSizeAndCurrency","type":"error"},{"inputs":[],"name":"RMRKNewContributorIsZeroAddress","type":"error"},{"inputs":[],"name":"RMRKNewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"RMRKNotOwner","type":"error"},{"inputs":[],"name":"RMRKNotOwnerOrContributor","type":"error"},{"inputs":[],"name":"WrongValueSent","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"}],"name":"BeneficiaryUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"contributor","type":"address"},{"indexed":false,"internalType":"bool","name":"isContributor","type":"bool"}],"name":"ContributorUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":true,"internalType":"bool","name":"isCreditSpender","type":"bool"}],"name":"CreditSpenderUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"mintingCredits","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"pinningCredits","type":"uint256"},{"indexed":false,"internalType":"address","name":"addedBy","type":"address"}],"name":"CreditsAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"mintingCredits","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"pinningCredits","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"CreditsBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"mintingCredits","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"pinningCredits","type":"uint256"},{"indexed":false,"internalType":"address","name":"usedFrom","type":"address"}],"name":"CreditsSpent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":true,"internalType":"uint256","name":"packSize","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"MintingPackPriceSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":true,"internalType":"uint256","name":"packSize","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"PinningPackPriceSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collection","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"discountGranted","type":"bool"},{"indexed":false,"internalType":"uint256","name":"discountBps","type":"uint256"}],"name":"PlatformFeeDiscountUpdated","type":"event"},{"inputs":[],"name":"MAX_BPS","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TOKEN_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"discountTokenAddress","type":"address"},{"internalType":"uint256","name":"discountTokenId","type":"uint256"}],"name":"_validateAndApplyDiscount","outputs":[{"internalType":"uint256","name":"discountedPrice","type":"uint256"},{"internalType":"uint256","name":"appliedDiscount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addMintingCredits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addPinningCredits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"packSize","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"discountTokenAddress","type":"address"},{"internalType":"uint256","name":"discountTokenId","type":"uint256"}],"name":"buyMintingCredits","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"packSize","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"discountTokenAddress","type":"address"},{"internalType":"uint256","name":"discountTokenId","type":"uint256"}],"name":"buyPinningCredits","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"currency","type":"address"}],"name":"getAllMintingPackSizesAndPricesForCurrency","outputs":[{"components":[{"internalType":"uint256","name":"size","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct IRMRKCreditManager.PackWithPrice[]","name":"packs","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"currency","type":"address"}],"name":"getAllPinningPackSizesAndPricesForCurrency","outputs":[{"components":[{"internalType":"uint256","name":"size","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct IRMRKCreditManager.PackWithPrice[]","name":"packs","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBeneficiary","outputs":[{"internalType":"address","name":"beneficiary","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"totalPayoutAmount","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"discountTokenAddress","type":"address"},{"internalType":"uint256","name":"discountTokenId","type":"uint256"}],"name":"getDiscountedFee","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"appliedDiscountBps","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"packSize","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"discountTokenAddress","type":"address"},{"internalType":"uint256","name":"discountTokenId","type":"uint256"}],"name":"getDiscountedMintingPrice","outputs":[{"internalType":"uint256","name":"discountedPrice","type":"uint256"},{"internalType":"uint256","name":"appliedDiscount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"packSize","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"discountTokenAddress","type":"address"},{"internalType":"uint256","name":"discountTokenId","type":"uint256"}],"name":"getDiscountedPinningPrice","outputs":[{"internalType":"uint256","name":"discountedPrice","type":"uint256"},{"internalType":"uint256","name":"appliedDiscount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"getIsCreditSpender","outputs":[{"internalType":"bool","name":"isSpender","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"currency","type":"address"}],"name":"getIsValidCurrency","outputs":[{"internalType":"bool","name":"isValid","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getMintingCredits","outputs":[{"internalType":"uint256","name":"credits","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"size","type":"uint256"}],"name":"getMintingPackPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMintingPackSizes","outputs":[{"internalType":"uint256[]","name":"mintingPackSizes","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getPinningCredits","outputs":[{"internalType":"uint256","name":"credits","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"size","type":"uint256"}],"name":"getPinningPackPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPinningPackSizes","outputs":[{"internalType":"uint256[]","name":"pinningPackSizes","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contributor","type":"address"}],"name":"isContributor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contributor","type":"address"},{"internalType":"bool","name":"grantRole","type":"bool"}],"name":"manageContributor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"removeFeeDiscount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"bool","name":"isCreditSpender","type":"bool"}],"name":"setCreditSpender","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256","name":"discountBps","type":"uint256"}],"name":"setFeeDiscount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"currency","type":"address"},{"components":[{"internalType":"uint256","name":"size","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct IRMRKCreditManager.PackWithPrice[]","name":"packs","type":"tuple[]"}],"name":"setMintingPackPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"currency","type":"address"},{"components":[{"internalType":"uint256","name":"size","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct IRMRKCreditManager.PackWithPrice[]","name":"packs","type":"tuple[]"}],"name":"setPinningPackPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"}],"name":"setPlatformBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"bool","name":"isValid","type":"bool"}],"name":"setValidCurrency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"spendMintingCredits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"spendPinningCredits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b5060405162001f1338038062001f138339810160408190526200003491620000b5565b6200003f3362000065565b600a80546001600160a01b0319166001600160a01b0392909216919091179055620000e7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215620000c857600080fd5b81516001600160a01b0381168114620000e057600080fd5b9392505050565b611e1c80620000f76000396000f3fe6080604052600436106101945760003560e01c80630102dc61146101995780630e6f5bf3146101e25780631b8c3677146102045780631d0d35f51461024d5780631d154b971461028757806333610c3b146102c05780633414d492146102e05780634b1796c71461030d578063565a2e2c1461032d57806368cd589414610354578063715018a6146103895780637258dff41461039e57806377e251c7146103e057806379e8ca9e1461040057806383a61b12146104205780638658464614610442578063892965c8146104625780638da5cb5b146104755780639c1807c61461048a578063a1fda03f1461049d578063b4c62abf146104bd578063c575db08146104d2578063c9f43cb8146104f2578063d28fddb614610512578063d46e673414610532578063d9c98b0f14610552578063da264a0b14610572578063df2ebdbb14610592578063e4b69bc9146105ba578063e878b485146105f0578063f2fde38b14610632578063f8e3434b14610652578063facbb85014610672578063fcb8ed1314610692578063fd967f47146106b2575b600080fd5b3480156101a557600080fd5b506101cf6101b4366004611803565b6001600160a01b031660009081526006602052604090205490565b6040519081526020015b60405180910390f35b3480156101ee57600080fd5b506102026101fd366004611835565b6106db565b005b34801561021057600080fd5b5061023d61021f366004611803565b6001600160a01b031660009081526003602052604090205460ff1690565b60405190151581526020016101d9565b34801561025957600080fd5b5061023d610268366004611803565b6001600160a01b03166000908152600160208190526040909120541490565b34801561029357600080fd5b5061023d6102a2366004611803565b6001600160a01b031660009081526002602052604090205460ff1690565b3480156102cc57600080fd5b506102026102db366004611835565b61070e565b3480156102ec57600080fd5b506103006102fb366004611803565b61076a565b6040516101d9919061186e565b34801561031957600080fd5b5061020261032836600461194e565b61088b565b34801561033957600080fd5b50600a546001600160a01b03165b6040516101d99190611a1c565b34801561036057600080fd5b5061037461036f366004611a30565b6109ac565b604080519283526020830191909152016101d9565b34801561039557600080fd5b50610202610b7c565b3480156103aa57600080fd5b506101cf6103b9366004611a78565b6001600160a01b039091166000908152600560209081526040808320938352929052205490565b3480156103ec57600080fd5b506102026103fb366004611a78565b610b90565b34801561040c57600080fd5b5061020261041b366004611835565b610bfd565b34801561042c57600080fd5b50610435610cba565b6040516101d99190611aa4565b34801561044e57600080fd5b5061037461045d366004611ae8565b610d12565b610202610470366004611ae8565b610d54565b34801561048157600080fd5b50610347610ddc565b610202610498366004611ae8565b610deb565b3480156104a957600080fd5b506103006104b8366004611803565b610e63565b3480156104c957600080fd5b50610435610f7e565b3480156104de57600080fd5b506102026104ed36600461194e565b610fd4565b3480156104fe57600080fd5b5061020261050d366004611ba9565b6110ef565b34801561051e57600080fd5b5061037461052d366004611ae8565b6111b8565b34801561053e57600080fd5b5061020261054d366004611803565b61122e565b34801561055e57600080fd5b5061020261056d366004611a78565b611280565b34801561057e57600080fd5b5061020261058d366004611bf8565b611300565b34801561059e57600080fd5b5061034773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b3480156105c657600080fd5b506101cf6105d5366004611803565b6001600160a01b031660009081526007602052604090205490565b3480156105fc57600080fd5b506101cf61060b366004611a78565b6001600160a01b039091166000908152600460209081526040808320938352929052205490565b34801561063e57600080fd5b5061020261064d366004611803565b6113f9565b34801561065e57600080fd5b5061037461066d366004611ae8565b611434565b34801561067e57600080fd5b5061020261068d366004611a78565b611467565b34801561069e57600080fd5b506102026106ad366004611a78565b6114c8565b3480156106be57600080fd5b506106c861271081565b60405161ffff90911681526020016101d9565b6106e3611549565b6001600160a01b03919091166000908152600260205260409020805460ff1916911515919091179055565b610716611549565b6001600160a01b038216600081815260036020526040808220805460ff191685151590811790915590519092917fe019e96788a4bff9d8253086a6045ed96fa6e7f7ae36ff9d0ece429044125e4391a35050565b6009546060906001600160401b03811115610787576107876118bd565b6040519080825280602002602001820160405280156107c057816020015b6107ad6117d4565b8152602001906001900390816107a55790505b50905060005b600954811015610885576040518060400160405280600983815481106107ee576107ee611c50565b9060005260206000200154815260200160056000866001600160a01b03166001600160a01b0316815260200190815260200160002060006009858154811061083857610838611c50565b906000526020600020015481526020019081526020016000205481525082828151811061086757610867611c50565b6020026020010181905250808061087d90611c7c565b9150506107c6565b50919050565b610893611549565b80516001600160a01b0383166000908152600260205260408120805460ff191660011790555b818110156109a65760008382815181106108d5576108d5611c50565b60200260200101516000015190508382815181106108f5576108f5611c50565b6020908102919091018101518101516001600160a01b0387166000908152600483526040808220858352909352919091205561093260088261158d565b80856001600160a01b03167fccb5fe12477695b3d3294f0c694d9c29d9eec184fa942872888e6de6f5a1140c86858151811061097057610970611c50565b60200260200101516020015160405161098b91815260200190565b60405180910390a3508061099e81611c7c565b9150506108b9565b50505050565b8360006001600160a01b038416158015906109de57506001600160a01b0384166000908152600c602052604090205415155b15610b73576001600160a01b0384166000908152600b602090815260408083208380529091529020546001148015610a8357506040516370a0823160e01b81526000906001600160a01b038616906370a0823190610a40908990600401611a1c565b602060405180830381865afa158015610a5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a819190611c95565b115b80610b3057506001600160a01b0384166000908152600b602090815260408083208684529091529020546001148015610b3057506040516331a9108f60e11b8152600481018490526001600160a01b038087169190861690636352211e90602401602060405180830381865afa158015610b01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b259190611cae565b6001600160a01b0316145b15610b7357506001600160a01b0383166000908152600c6020526040902054612710610b5c8282611ccb565b610b669084611ce4565b610b709190611cfb565b91505b94509492505050565b610b846115ec565b610b8e600061161c565b565b610b98611549565b6001600160a01b03821660009081526006602052604081208054839290610bc0908490611d1d565b92505081905550600081836001600160a01b0316600080516020611d8783398151915233604051610bf19190611a1c565b60405180910390a45050565b610c056115ec565b6001600160a01b038216610c2c5760405163016b812760e71b815260040160405180910390fd5b80610c51576001600160a01b0382166000908152600160205260408120819055610c70565b6001600160a01b03821660009081526001602081905260409091208190555b50816001600160a01b03167f4b5657e84cf8a17ac5587bbeb3cc2bab9826c4c67b8bad81b4849de49d37aac282604051610cae911515815260200190565b60405180910390a25050565b60606008805480602002602001604051908101604052809291908181526020018280548015610d0857602002820191906000526020600020905b815481526020019060010190808311610cf4575b5050505050905090565b6001600160a01b03831660009081526005602090815260408083208784529091528120548190610d4588828888886111b8565b92509250509550959350505050565b6000610d638686868686610d12565b509050610d7186828661166c565b6001600160a01b03861660009081526007602052604081208054879290610d99908490611d1d565b92505081905550846000876001600160a01b0316600080516020611da78339815191528785604051610dcc929190611d30565b60405180910390a4505050505050565b6000546001600160a01b031690565b6000610dfa8686868686611434565b509050610e0886828661166c565b6001600160a01b03861660009081526006602052604081208054879290610e30908490611d1d565b92505081905550600085876001600160a01b0316600080516020611da78339815191528785604051610dcc929190611d30565b6008546060906001600160401b03811115610e8057610e806118bd565b604051908082528060200260200182016040528015610eb957816020015b610ea66117d4565b815260200190600190039081610e9e5790505b50905060005b60085481101561088557604051806040016040528060088381548110610ee757610ee7611c50565b9060005260206000200154815260200160046000866001600160a01b03166001600160a01b03168152602001908152602001600020600060088581548110610f3157610f31611c50565b9060005260206000200154815260200190815260200160002054815250828281518110610f6057610f60611c50565b60200260200101819052508080610f7690611c7c565b915050610ebf565b60606009805480602002602001604051908101604052809291908181526020018280548015610d085760200282019190600052602060002090815481526020019060010190808311610cf4575050505050905090565b610fdc611549565b80516001600160a01b0383166000908152600260205260408120805460ff191660011790555b818110156109a657600083828151811061101e5761101e611c50565b602002602001015160000151905083828151811061103e5761103e611c50565b6020908102919091018101518101516001600160a01b0387166000908152600583526040808220858352909352919091205561107b60098261158d565b80856001600160a01b03167fbb9ccec398ec7024f6b6e8cdfe68cbff3992a91cd52104d20481405c9853f4f18685815181106110b9576110b9611c50565b6020026020010151602001516040516110d491815260200190565b60405180910390a350806110e781611c7c565b915050611002565b6110f7611549565b60005b81518110156111b3576001600160a01b0383166000908152600b602052604081208351829085908590811061113157611131611c50565b602002602001015181526020019081526020016000208190555081818151811061115d5761115d611c50565b6020908102919091018101516001600160a01b0385166000818152600c845260408082205481519283529482019490945291929091600080516020611dc7833981519152910160405180910390a36001016110fa565b505050565b6001600160a01b038316600090815260026020526040812054819060ff166111f357604051631eb3268560e31b815260040160405180910390fd5b8560000361121457604051636a8cc1ff60e01b815260040160405180910390fd5b611220868886866109ac565b909890975095505050505050565b6112366115ec565b600a80546001600160a01b0319166001600160a01b0383169081179091556040517feee59a71c694e68368a1cb0d135c448051bbfb12289e6c2223b0ceb100c2321d90600090a250565b6112886117a4565b6001600160a01b0382166000908152600760205260409020548111156112c157604051630e19bf1b60e21b815260040160405180910390fd5b6001600160a01b0382166000818152600760205260408082208054859003905551839290600080516020611d6783398151915290610bf1903390611a1c565b611308611549565b61271081111561132b57604051638bff87cf60e01b815260040160405180910390fd5b6001600160a01b0383166000908152600c602052604081208290555b82518110156109a6576001600160a01b0384166000908152600b6020526040812084516001929086908590811061138057611380611c50565b60200260200101518152602001908152602001600020819055508281815181106113ac576113ac611c50565b6020026020010151846001600160a01b0316600080516020611dc78339815191526001856040516113e99291909115158252602082015260400190565b60405180910390a3600101611347565b6114016115ec565b6001600160a01b03811661142857604051634ece6ecf60e01b815260040160405180910390fd5b6114318161161c565b50565b6001600160a01b03831660009081526004602090815260408083208784529091528120548190610d4588828888886111b8565b61146f611549565b6001600160a01b03821660009081526007602052604081208054839290611497908490611d1d565b92505081905550806000836001600160a01b0316600080516020611d8783398151915233604051610bf19190611a1c565b6114d06117a4565b6001600160a01b03821660009081526006602052604090205481111561150957604051630e19bf1b60e21b815260040160405180910390fd5b6001600160a01b038216600081815260066020526040808220805485900390555190918391600080516020611d6783398151915290610bf1903390611a1c565b33611552610ddc565b6001600160a01b03161415801561156f575061156d33610268565b155b15610b8e576040516301eca16760e41b815260040160405180910390fd5b60005b82548110156115d357818382815481106115ac576115ac611c50565b9060005260206000200154036115c157505050565b806115cb81611c7c565b915050611590565b5081546001810183556000928352602090922090910155565b336115f5610ddc565b6001600160a01b031614610b8e57604051631c62d58f60e11b815260040160405180910390fd5b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601611725578134146116b157604051632f4613eb60e01b815260040160405180910390fd5b600a546040516000916001600160a01b03169084908381818185875af1925050503d80600081146116fe576040519150601f19603f3d011682016040523d82523d6000602084013e611703565b606091505b50509050806109a65760405163467d86d160e01b815260040160405180910390fd5b600a546040516323b872dd60e01b81526001600160a01b038581166004830152918216602482015260448101849052908216906323b872dd906064016020604051808303816000875af1158015611780573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a69190611d49565b3360009081526003602052604090205460ff16610b8e57604051633e1e594160e11b815260040160405180910390fd5b604051806040016040528060008152602001600081525090565b6001600160a01b038116811461143157600080fd5b60006020828403121561181557600080fd5b8135611820816117ee565b9392505050565b801515811461143157600080fd5b6000806040838503121561184857600080fd5b8235611853816117ee565b9150602083013561186381611827565b809150509250929050565b602080825282518282018190526000919060409081850190868401855b828110156118b05781518051855286015186850152928401929085019060010161188b565b5091979650505050505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156118f5576118f56118bd565b60405290565b604051601f8201601f191681016001600160401b0381118282101715611923576119236118bd565b604052919050565b60006001600160401b03821115611944576119446118bd565b5060051b60200190565b600080604080848603121561196257600080fd5b833561196d816117ee565b92506020848101356001600160401b0381111561198957600080fd5b8501601f8101871361199a57600080fd5b80356119ad6119a88261192b565b6118fb565b81815260069190911b820183019083810190898311156119cc57600080fd5b928401925b82841015611a0c5785848b0312156119e95760008081fd5b6119f16118d3565b843581528585013586820152825292850192908401906119d1565b8096505050505050509250929050565b6001600160a01b0391909116815260200190565b60008060008060808587031215611a4657600080fd5b843593506020850135611a58816117ee565b92506040850135611a68816117ee565b9396929550929360600135925050565b60008060408385031215611a8b57600080fd5b8235611a96816117ee565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b81811015611adc57835183529284019291840191600101611ac0565b50909695505050505050565b600080600080600060a08688031215611b0057600080fd5b8535611b0b816117ee565b9450602086013593506040860135611b22816117ee565b92506060860135611b32816117ee565b949793965091946080013592915050565b600082601f830112611b5457600080fd5b81356020611b646119a88361192b565b82815260059290921b84018101918181019086841115611b8357600080fd5b8286015b84811015611b9e5780358352918301918301611b87565b509695505050505050565b60008060408385031215611bbc57600080fd5b8235611bc7816117ee565b915060208301356001600160401b03811115611be257600080fd5b611bee85828601611b43565b9150509250929050565b600080600060608486031215611c0d57600080fd5b8335611c18816117ee565b925060208401356001600160401b03811115611c3357600080fd5b611c3f86828701611b43565b925050604084013590509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c8e57611c8e611c66565b5060010190565b600060208284031215611ca757600080fd5b5051919050565b600060208284031215611cc057600080fd5b8151611820816117ee565b81810381811115611cde57611cde611c66565b92915050565b8082028115828204841417611cde57611cde611c66565b600082611d1857634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115611cde57611cde611c66565b6001600160a01b03929092168252602082015260400190565b600060208284031215611d5b57600080fd5b81516118208161182756fedff675936e7bbdbcbe18b00f3e7867427a489786760afc51c9d17a58ec7d82d28a9137d4593bc8e56e629f2b078fc1841055f7a9c5036e0c34e818b963e0ea7d184972699884a26bbdf6a4f1cbf187e9c89ef778377abc790ddbc6a0b843d387de318742815eeb7981a435b9dbbaa7ab5e2e96f61a85b35b57479a1a6d3e38b0a2646970667358221220debeabc5ceda99b6270703d438a2e543507bb306eecd60d499380c7b430cfeab64736f6c63430008150033000000000000000000000000ca03d97879031ab5edf81921ef5ad3383b3cc760

Deployed Bytecode

0x6080604052600436106101945760003560e01c80630102dc61146101995780630e6f5bf3146101e25780631b8c3677146102045780631d0d35f51461024d5780631d154b971461028757806333610c3b146102c05780633414d492146102e05780634b1796c71461030d578063565a2e2c1461032d57806368cd589414610354578063715018a6146103895780637258dff41461039e57806377e251c7146103e057806379e8ca9e1461040057806383a61b12146104205780638658464614610442578063892965c8146104625780638da5cb5b146104755780639c1807c61461048a578063a1fda03f1461049d578063b4c62abf146104bd578063c575db08146104d2578063c9f43cb8146104f2578063d28fddb614610512578063d46e673414610532578063d9c98b0f14610552578063da264a0b14610572578063df2ebdbb14610592578063e4b69bc9146105ba578063e878b485146105f0578063f2fde38b14610632578063f8e3434b14610652578063facbb85014610672578063fcb8ed1314610692578063fd967f47146106b2575b600080fd5b3480156101a557600080fd5b506101cf6101b4366004611803565b6001600160a01b031660009081526006602052604090205490565b6040519081526020015b60405180910390f35b3480156101ee57600080fd5b506102026101fd366004611835565b6106db565b005b34801561021057600080fd5b5061023d61021f366004611803565b6001600160a01b031660009081526003602052604090205460ff1690565b60405190151581526020016101d9565b34801561025957600080fd5b5061023d610268366004611803565b6001600160a01b03166000908152600160208190526040909120541490565b34801561029357600080fd5b5061023d6102a2366004611803565b6001600160a01b031660009081526002602052604090205460ff1690565b3480156102cc57600080fd5b506102026102db366004611835565b61070e565b3480156102ec57600080fd5b506103006102fb366004611803565b61076a565b6040516101d9919061186e565b34801561031957600080fd5b5061020261032836600461194e565b61088b565b34801561033957600080fd5b50600a546001600160a01b03165b6040516101d99190611a1c565b34801561036057600080fd5b5061037461036f366004611a30565b6109ac565b604080519283526020830191909152016101d9565b34801561039557600080fd5b50610202610b7c565b3480156103aa57600080fd5b506101cf6103b9366004611a78565b6001600160a01b039091166000908152600560209081526040808320938352929052205490565b3480156103ec57600080fd5b506102026103fb366004611a78565b610b90565b34801561040c57600080fd5b5061020261041b366004611835565b610bfd565b34801561042c57600080fd5b50610435610cba565b6040516101d99190611aa4565b34801561044e57600080fd5b5061037461045d366004611ae8565b610d12565b610202610470366004611ae8565b610d54565b34801561048157600080fd5b50610347610ddc565b610202610498366004611ae8565b610deb565b3480156104a957600080fd5b506103006104b8366004611803565b610e63565b3480156104c957600080fd5b50610435610f7e565b3480156104de57600080fd5b506102026104ed36600461194e565b610fd4565b3480156104fe57600080fd5b5061020261050d366004611ba9565b6110ef565b34801561051e57600080fd5b5061037461052d366004611ae8565b6111b8565b34801561053e57600080fd5b5061020261054d366004611803565b61122e565b34801561055e57600080fd5b5061020261056d366004611a78565b611280565b34801561057e57600080fd5b5061020261058d366004611bf8565b611300565b34801561059e57600080fd5b5061034773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b3480156105c657600080fd5b506101cf6105d5366004611803565b6001600160a01b031660009081526007602052604090205490565b3480156105fc57600080fd5b506101cf61060b366004611a78565b6001600160a01b039091166000908152600460209081526040808320938352929052205490565b34801561063e57600080fd5b5061020261064d366004611803565b6113f9565b34801561065e57600080fd5b5061037461066d366004611ae8565b611434565b34801561067e57600080fd5b5061020261068d366004611a78565b611467565b34801561069e57600080fd5b506102026106ad366004611a78565b6114c8565b3480156106be57600080fd5b506106c861271081565b60405161ffff90911681526020016101d9565b6106e3611549565b6001600160a01b03919091166000908152600260205260409020805460ff1916911515919091179055565b610716611549565b6001600160a01b038216600081815260036020526040808220805460ff191685151590811790915590519092917fe019e96788a4bff9d8253086a6045ed96fa6e7f7ae36ff9d0ece429044125e4391a35050565b6009546060906001600160401b03811115610787576107876118bd565b6040519080825280602002602001820160405280156107c057816020015b6107ad6117d4565b8152602001906001900390816107a55790505b50905060005b600954811015610885576040518060400160405280600983815481106107ee576107ee611c50565b9060005260206000200154815260200160056000866001600160a01b03166001600160a01b0316815260200190815260200160002060006009858154811061083857610838611c50565b906000526020600020015481526020019081526020016000205481525082828151811061086757610867611c50565b6020026020010181905250808061087d90611c7c565b9150506107c6565b50919050565b610893611549565b80516001600160a01b0383166000908152600260205260408120805460ff191660011790555b818110156109a65760008382815181106108d5576108d5611c50565b60200260200101516000015190508382815181106108f5576108f5611c50565b6020908102919091018101518101516001600160a01b0387166000908152600483526040808220858352909352919091205561093260088261158d565b80856001600160a01b03167fccb5fe12477695b3d3294f0c694d9c29d9eec184fa942872888e6de6f5a1140c86858151811061097057610970611c50565b60200260200101516020015160405161098b91815260200190565b60405180910390a3508061099e81611c7c565b9150506108b9565b50505050565b8360006001600160a01b038416158015906109de57506001600160a01b0384166000908152600c602052604090205415155b15610b73576001600160a01b0384166000908152600b602090815260408083208380529091529020546001148015610a8357506040516370a0823160e01b81526000906001600160a01b038616906370a0823190610a40908990600401611a1c565b602060405180830381865afa158015610a5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a819190611c95565b115b80610b3057506001600160a01b0384166000908152600b602090815260408083208684529091529020546001148015610b3057506040516331a9108f60e11b8152600481018490526001600160a01b038087169190861690636352211e90602401602060405180830381865afa158015610b01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b259190611cae565b6001600160a01b0316145b15610b7357506001600160a01b0383166000908152600c6020526040902054612710610b5c8282611ccb565b610b669084611ce4565b610b709190611cfb565b91505b94509492505050565b610b846115ec565b610b8e600061161c565b565b610b98611549565b6001600160a01b03821660009081526006602052604081208054839290610bc0908490611d1d565b92505081905550600081836001600160a01b0316600080516020611d8783398151915233604051610bf19190611a1c565b60405180910390a45050565b610c056115ec565b6001600160a01b038216610c2c5760405163016b812760e71b815260040160405180910390fd5b80610c51576001600160a01b0382166000908152600160205260408120819055610c70565b6001600160a01b03821660009081526001602081905260409091208190555b50816001600160a01b03167f4b5657e84cf8a17ac5587bbeb3cc2bab9826c4c67b8bad81b4849de49d37aac282604051610cae911515815260200190565b60405180910390a25050565b60606008805480602002602001604051908101604052809291908181526020018280548015610d0857602002820191906000526020600020905b815481526020019060010190808311610cf4575b5050505050905090565b6001600160a01b03831660009081526005602090815260408083208784529091528120548190610d4588828888886111b8565b92509250509550959350505050565b6000610d638686868686610d12565b509050610d7186828661166c565b6001600160a01b03861660009081526007602052604081208054879290610d99908490611d1d565b92505081905550846000876001600160a01b0316600080516020611da78339815191528785604051610dcc929190611d30565b60405180910390a4505050505050565b6000546001600160a01b031690565b6000610dfa8686868686611434565b509050610e0886828661166c565b6001600160a01b03861660009081526006602052604081208054879290610e30908490611d1d565b92505081905550600085876001600160a01b0316600080516020611da78339815191528785604051610dcc929190611d30565b6008546060906001600160401b03811115610e8057610e806118bd565b604051908082528060200260200182016040528015610eb957816020015b610ea66117d4565b815260200190600190039081610e9e5790505b50905060005b60085481101561088557604051806040016040528060088381548110610ee757610ee7611c50565b9060005260206000200154815260200160046000866001600160a01b03166001600160a01b03168152602001908152602001600020600060088581548110610f3157610f31611c50565b9060005260206000200154815260200190815260200160002054815250828281518110610f6057610f60611c50565b60200260200101819052508080610f7690611c7c565b915050610ebf565b60606009805480602002602001604051908101604052809291908181526020018280548015610d085760200282019190600052602060002090815481526020019060010190808311610cf4575050505050905090565b610fdc611549565b80516001600160a01b0383166000908152600260205260408120805460ff191660011790555b818110156109a657600083828151811061101e5761101e611c50565b602002602001015160000151905083828151811061103e5761103e611c50565b6020908102919091018101518101516001600160a01b0387166000908152600583526040808220858352909352919091205561107b60098261158d565b80856001600160a01b03167fbb9ccec398ec7024f6b6e8cdfe68cbff3992a91cd52104d20481405c9853f4f18685815181106110b9576110b9611c50565b6020026020010151602001516040516110d491815260200190565b60405180910390a350806110e781611c7c565b915050611002565b6110f7611549565b60005b81518110156111b3576001600160a01b0383166000908152600b602052604081208351829085908590811061113157611131611c50565b602002602001015181526020019081526020016000208190555081818151811061115d5761115d611c50565b6020908102919091018101516001600160a01b0385166000818152600c845260408082205481519283529482019490945291929091600080516020611dc7833981519152910160405180910390a36001016110fa565b505050565b6001600160a01b038316600090815260026020526040812054819060ff166111f357604051631eb3268560e31b815260040160405180910390fd5b8560000361121457604051636a8cc1ff60e01b815260040160405180910390fd5b611220868886866109ac565b909890975095505050505050565b6112366115ec565b600a80546001600160a01b0319166001600160a01b0383169081179091556040517feee59a71c694e68368a1cb0d135c448051bbfb12289e6c2223b0ceb100c2321d90600090a250565b6112886117a4565b6001600160a01b0382166000908152600760205260409020548111156112c157604051630e19bf1b60e21b815260040160405180910390fd5b6001600160a01b0382166000818152600760205260408082208054859003905551839290600080516020611d6783398151915290610bf1903390611a1c565b611308611549565b61271081111561132b57604051638bff87cf60e01b815260040160405180910390fd5b6001600160a01b0383166000908152600c602052604081208290555b82518110156109a6576001600160a01b0384166000908152600b6020526040812084516001929086908590811061138057611380611c50565b60200260200101518152602001908152602001600020819055508281815181106113ac576113ac611c50565b6020026020010151846001600160a01b0316600080516020611dc78339815191526001856040516113e99291909115158252602082015260400190565b60405180910390a3600101611347565b6114016115ec565b6001600160a01b03811661142857604051634ece6ecf60e01b815260040160405180910390fd5b6114318161161c565b50565b6001600160a01b03831660009081526004602090815260408083208784529091528120548190610d4588828888886111b8565b61146f611549565b6001600160a01b03821660009081526007602052604081208054839290611497908490611d1d565b92505081905550806000836001600160a01b0316600080516020611d8783398151915233604051610bf19190611a1c565b6114d06117a4565b6001600160a01b03821660009081526006602052604090205481111561150957604051630e19bf1b60e21b815260040160405180910390fd5b6001600160a01b038216600081815260066020526040808220805485900390555190918391600080516020611d6783398151915290610bf1903390611a1c565b33611552610ddc565b6001600160a01b03161415801561156f575061156d33610268565b155b15610b8e576040516301eca16760e41b815260040160405180910390fd5b60005b82548110156115d357818382815481106115ac576115ac611c50565b9060005260206000200154036115c157505050565b806115cb81611c7c565b915050611590565b5081546001810183556000928352602090922090910155565b336115f5610ddc565b6001600160a01b031614610b8e57604051631c62d58f60e11b815260040160405180910390fd5b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601611725578134146116b157604051632f4613eb60e01b815260040160405180910390fd5b600a546040516000916001600160a01b03169084908381818185875af1925050503d80600081146116fe576040519150601f19603f3d011682016040523d82523d6000602084013e611703565b606091505b50509050806109a65760405163467d86d160e01b815260040160405180910390fd5b600a546040516323b872dd60e01b81526001600160a01b038581166004830152918216602482015260448101849052908216906323b872dd906064016020604051808303816000875af1158015611780573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a69190611d49565b3360009081526003602052604090205460ff16610b8e57604051633e1e594160e11b815260040160405180910390fd5b604051806040016040528060008152602001600081525090565b6001600160a01b038116811461143157600080fd5b60006020828403121561181557600080fd5b8135611820816117ee565b9392505050565b801515811461143157600080fd5b6000806040838503121561184857600080fd5b8235611853816117ee565b9150602083013561186381611827565b809150509250929050565b602080825282518282018190526000919060409081850190868401855b828110156118b05781518051855286015186850152928401929085019060010161188b565b5091979650505050505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156118f5576118f56118bd565b60405290565b604051601f8201601f191681016001600160401b0381118282101715611923576119236118bd565b604052919050565b60006001600160401b03821115611944576119446118bd565b5060051b60200190565b600080604080848603121561196257600080fd5b833561196d816117ee565b92506020848101356001600160401b0381111561198957600080fd5b8501601f8101871361199a57600080fd5b80356119ad6119a88261192b565b6118fb565b81815260069190911b820183019083810190898311156119cc57600080fd5b928401925b82841015611a0c5785848b0312156119e95760008081fd5b6119f16118d3565b843581528585013586820152825292850192908401906119d1565b8096505050505050509250929050565b6001600160a01b0391909116815260200190565b60008060008060808587031215611a4657600080fd5b843593506020850135611a58816117ee565b92506040850135611a68816117ee565b9396929550929360600135925050565b60008060408385031215611a8b57600080fd5b8235611a96816117ee565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b81811015611adc57835183529284019291840191600101611ac0565b50909695505050505050565b600080600080600060a08688031215611b0057600080fd5b8535611b0b816117ee565b9450602086013593506040860135611b22816117ee565b92506060860135611b32816117ee565b949793965091946080013592915050565b600082601f830112611b5457600080fd5b81356020611b646119a88361192b565b82815260059290921b84018101918181019086841115611b8357600080fd5b8286015b84811015611b9e5780358352918301918301611b87565b509695505050505050565b60008060408385031215611bbc57600080fd5b8235611bc7816117ee565b915060208301356001600160401b03811115611be257600080fd5b611bee85828601611b43565b9150509250929050565b600080600060608486031215611c0d57600080fd5b8335611c18816117ee565b925060208401356001600160401b03811115611c3357600080fd5b611c3f86828701611b43565b925050604084013590509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c8e57611c8e611c66565b5060010190565b600060208284031215611ca757600080fd5b5051919050565b600060208284031215611cc057600080fd5b8151611820816117ee565b81810381811115611cde57611cde611c66565b92915050565b8082028115828204841417611cde57611cde611c66565b600082611d1857634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115611cde57611cde611c66565b6001600160a01b03929092168252602082015260400190565b600060208284031215611d5b57600080fd5b81516118208161182756fedff675936e7bbdbcbe18b00f3e7867427a489786760afc51c9d17a58ec7d82d28a9137d4593bc8e56e629f2b078fc1841055f7a9c5036e0c34e818b963e0ea7d184972699884a26bbdf6a4f1cbf187e9c89ef778377abc790ddbc6a0b843d387de318742815eeb7981a435b9dbbaa7ab5e2e96f61a85b35b57479a1a6d3e38b0a2646970667358221220debeabc5ceda99b6270703d438a2e543507bb306eecd60d499380c7b430cfeab64736f6c63430008150033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000ca03d97879031ab5edf81921ef5ad3383b3cc760

-----Decoded View---------------
Arg [0] : beneficiary (address): 0xCa03d97879031aB5EDF81921Ef5AD3383B3Cc760

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000ca03d97879031ab5edf81921ef5ad3383b3cc760


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.