ETH Price: $2,398.00 (-1.59%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RoyaltyFeeManagerV1B

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 888888 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IERC2981} from "@openzeppelin/contracts/interfaces/IERC2981.sol";

import {IRoyaltyFeeManager} from "./interfaces/IRoyaltyFeeManager.sol";
import {IRoyaltyFeeRegistry} from "./interfaces/IRoyaltyFeeRegistry.sol";

/**
 * @title RoyaltyFeeManagerV1B
 * @notice It handles the logic to check and transfer rebate fees (if any).
 */
contract RoyaltyFeeManagerV1B is IRoyaltyFeeManager {
    // Interface Id ERC2981
    bytes4 public constant INTERFACE_ID_ERC2981 = 0x2a55205a;

    // Standard royalty fee
    uint256 public constant STANDARD_ROYALTY_FEE = 50;

    // Royalty fee registry
    IRoyaltyFeeRegistry public immutable royaltyFeeRegistry;

    /**
     * @notice Constructor
     * @param _royaltyFeeRegistry Royalty fee registry address
     */
    constructor(address _royaltyFeeRegistry) {
        royaltyFeeRegistry = IRoyaltyFeeRegistry(_royaltyFeeRegistry);
    }

    /**
     * @notice Calculate royalty fee and get recipient
     * @param collection address of the NFT contract
     * @param tokenId tokenId
     * @param amount amount to transfer
     */
    function calculateRoyaltyFeeAndGetRecipient(
        address collection,
        uint256 tokenId,
        uint256 amount
    ) external view override returns (address receiver, uint256 royaltyAmount) {
        // 1. Check if there is a royalty info in the system
        (receiver, ) = royaltyFeeRegistry.royaltyInfo(collection, amount);

        // 2. If the receiver is address(0), check if it supports the ERC2981 interface
        if (receiver == address(0)) {
            if (IERC2981(collection).supportsInterface(INTERFACE_ID_ERC2981)) {
                (bool status, bytes memory data) = collection.staticcall(
                    abi.encodeWithSelector(IERC2981.royaltyInfo.selector, tokenId, amount)
                );
                if (status) {
                    (receiver, ) = abi.decode(data, (address, uint256));
                }
            }
        }

        // A fixed royalty fee is applied
        if (receiver != address(0)) {
            royaltyAmount = (STANDARD_ROYALTY_FEE * amount) / 10000;
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Interface for the NFT Royalty Standard
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Called with the sale price to determine how much royalty is owed and to whom.
     * @param tokenId - the NFT asset queried for royalty information
     * @param salePrice - the sale price of the NFT asset specified by `tokenId`
     * @return receiver - address of who should be sent the royalty payment
     * @return royaltyAmount - the royalty payment amount for `salePrice`
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IRoyaltyFeeManager {
    function calculateRoyaltyFeeAndGetRecipient(
        address collection,
        uint256 tokenId,
        uint256 amount
    ) external view returns (address, uint256);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IRoyaltyFeeRegistry {
    function updateRoyaltyInfoForCollection(
        address collection,
        address setter,
        address receiver,
        uint256 fee
    ) external;

    function updateRoyaltyFeeLimit(uint256 _royaltyFeeLimit) external;

    function royaltyInfo(address collection, uint256 amount) external view returns (address, uint256);

    function royaltyFeeInfoCollection(address collection)
        external
        view
        returns (
            address,
            address,
            uint256
        );
}

File 5 of 6 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

import "../utils/introspection/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);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_royaltyFeeRegistry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"INTERFACE_ID_ERC2981","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STANDARD_ROYALTY_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calculateRoyaltyFeeAndGetRecipient","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyFeeRegistry","outputs":[{"internalType":"contract IRoyaltyFeeRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60a060405234801561001057600080fd5b5060405161068b38038061068b83398101604081905261002f91610044565b60601b6001600160601b031916608052610074565b60006020828403121561005657600080fd5b81516001600160a01b038116811461006d57600080fd5b9392505050565b60805160601c6105f36100986000396000818160c901526101a001526105f36000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806323e0998b14610051578063b060dd861461006c578063c16f5156146100c4578063f4f635fa14610110575b600080fd5b610059603281565b6040519081526020015b60405180910390f35b6100937f2a55205a0000000000000000000000000000000000000000000000000000000081565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610063565b6100eb7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610063565b61012361011e366004610460565b61014f565b6040805173ffffffffffffffffffffffffffffffffffffffff9093168352602083019190915201610063565b6040517f2782d6c700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820183905260009182917f00000000000000000000000000000000000000000000000000000000000000001690632782d6c790604401604080518083038186803b1580156101e157600080fd5b505afa1580156101f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102199190610432565b50915073ffffffffffffffffffffffffffffffffffffffff82166103f3576040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f2a55205a00000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8616906301ffc9a79060240160206040518083038186803b1580156102bc57600080fd5b505afa1580156102d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f49190610495565b156103f3576040805160248101869052604480820186905282518083039091018152606490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f2a55205a000000000000000000000000000000000000000000000000000000001790529051600091829173ffffffffffffffffffffffffffffffffffffffff89169161038d916104be565b600060405180830381855afa9150503d80600081146103c8576040519150601f19603f3d011682016040523d82523d6000602084013e6103cd565b606091505b509150915081156103f057808060200190518101906103ec9190610432565b5093505b50505b73ffffffffffffffffffffffffffffffffffffffff82161561042a5761271061041d846032610534565b61042791906104f9565b90505b935093915050565b6000806040838503121561044557600080fd5b825161045081610598565b6020939093015192949293505050565b60008060006060848603121561047557600080fd5b833561048081610598565b95602085013595506040909401359392505050565b6000602082840312156104a757600080fd5b815180151581146104b757600080fd5b9392505050565b6000825160005b818110156104df57602081860181015185830152016104c5565b818111156104ee576000828501525b509190910192915050565b60008261052f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610593577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500290565b73ffffffffffffffffffffffffffffffffffffffff811681146105ba57600080fd5b5056fea2646970667358221220e15f4952a8e79cfd0f2cc52f941ce83f3900aceb15aad450ed96e369cc587b1664736f6c6343000807003300000000000000000000000055010472a93921a117aad9b055c141060c8d8022

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806323e0998b14610051578063b060dd861461006c578063c16f5156146100c4578063f4f635fa14610110575b600080fd5b610059603281565b6040519081526020015b60405180910390f35b6100937f2a55205a0000000000000000000000000000000000000000000000000000000081565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610063565b6100eb7f00000000000000000000000055010472a93921a117aad9b055c141060c8d802281565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610063565b61012361011e366004610460565b61014f565b6040805173ffffffffffffffffffffffffffffffffffffffff9093168352602083019190915201610063565b6040517f2782d6c700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820183905260009182917f00000000000000000000000055010472a93921a117aad9b055c141060c8d80221690632782d6c790604401604080518083038186803b1580156101e157600080fd5b505afa1580156101f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102199190610432565b50915073ffffffffffffffffffffffffffffffffffffffff82166103f3576040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f2a55205a00000000000000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8616906301ffc9a79060240160206040518083038186803b1580156102bc57600080fd5b505afa1580156102d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f49190610495565b156103f3576040805160248101869052604480820186905282518083039091018152606490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f2a55205a000000000000000000000000000000000000000000000000000000001790529051600091829173ffffffffffffffffffffffffffffffffffffffff89169161038d916104be565b600060405180830381855afa9150503d80600081146103c8576040519150601f19603f3d011682016040523d82523d6000602084013e6103cd565b606091505b509150915081156103f057808060200190518101906103ec9190610432565b5093505b50505b73ffffffffffffffffffffffffffffffffffffffff82161561042a5761271061041d846032610534565b61042791906104f9565b90505b935093915050565b6000806040838503121561044557600080fd5b825161045081610598565b6020939093015192949293505050565b60008060006060848603121561047557600080fd5b833561048081610598565b95602085013595506040909401359392505050565b6000602082840312156104a757600080fd5b815180151581146104b757600080fd5b9392505050565b6000825160005b818110156104df57602081860181015185830152016104c5565b818111156104ee576000828501525b509190910192915050565b60008261052f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610593577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500290565b73ffffffffffffffffffffffffffffffffffffffff811681146105ba57600080fd5b5056fea2646970667358221220e15f4952a8e79cfd0f2cc52f941ce83f3900aceb15aad450ed96e369cc587b1664736f6c63430008070033

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

00000000000000000000000055010472a93921a117aad9b055c141060c8d8022

-----Decoded View---------------
Arg [0] : _royaltyFeeRegistry (address): 0x55010472a93921a117aAD9b055c141060c8d8022

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000055010472a93921a117aad9b055c141060c8d8022


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

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.

OSZAR »